dealposbarcode 1.2.9 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (self.webpackChunkbarcode_app=self.webpackChunkbarcode_app||[]).push([[469],{1813:function(K){K.exports=function(){return L={},S.m=T=[function(N,t,x){"use strict";x.r(t);var F={allowedTagList:["b","caption","cite","code","const","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","input","ins","kdb","label","li","option","output","p","q","s","sample","span","strong","td","th","u"]};Object.freeze(F.allowedTagList),Object.defineProperty(F,"allowedTagList",{configurable:!1,writable:!1}),F.keyCode={Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,Pause:19,CapsLock:20,Esc:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Insert:45,Delete:46,num0:48,num1:49,num2:50,num3:51,num4:52,num5:53,num6:54,num7:55,num8:56,num9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,OSLeft:91,OSRight:92,ContextMenu:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,MultiplyNumpad:106,PlusNumpad:107,MinusNumpad:109,DotNumpad:110,SlashNumpad:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,HyphenFirefox:173,MyComputer:182,MyCalculator:183,Semicolon:186,Equal:187,Comma:188,Hyphen:189,Dot:190,Slash:191,Backquote:192,LeftBracket:219,Backslash:220,RightBracket:221,Quote:222,Command:224,AltGraph:225,AndroidDefault:229},Object.freeze(F.keyCode),Object.defineProperty(F,"keyCode",{configurable:!1,writable:!1}),F.fromCharCodeKeyCode={0:"LaunchCalculator",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",91:"OS",92:"OSRight",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",173:"-",182:"MyComputer",183:"MyCalculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta",225:"AltGraph"},Object.freeze(F.fromCharCodeKeyCode),Object.defineProperty(F,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),F.keyName={Unidentified:"Unidentified",AndroidDefault:"AndroidDefault",Alt:"Alt",AltGr:"AltGraph",CapsLock:"CapsLock",Ctrl:"Control",Fn:"Fn",FnLock:"FnLock",Hyper:"Hyper",Meta:"Meta",OSLeft:"OS",OSRight:"OS",Command:"OS",NumLock:"NumLock",ScrollLock:"ScrollLock",Shift:"Shift",Super:"Super",Symbol:"Symbol",SymbolLock:"SymbolLock",Enter:"Enter",Tab:"Tab",Space:" ",LeftArrow:"ArrowLeft",UpArrow:"ArrowUp",RightArrow:"ArrowRight",DownArrow:"ArrowDown",End:"End",Home:"Home",PageUp:"PageUp",PageDown:"PageDown",Backspace:"Backspace",Clear:"Clear",Copy:"Copy",CrSel:"CrSel",Cut:"Cut",Delete:"Delete",EraseEof:"EraseEof",ExSel:"ExSel",Insert:"Insert",Paste:"Paste",Redo:"Redo",Undo:"Undo",Accept:"Accept",Again:"Again",Attn:"Attn",Cancel:"Cancel",ContextMenu:"ContextMenu",Esc:"Escape",Execute:"Execute",Find:"Find",Finish:"Finish",Help:"Help",Pause:"Pause",Play:"Play",Props:"Props",Select:"Select",ZoomIn:"ZoomIn",ZoomOut:"ZoomOut",BrightnessDown:"BrightnessDown",BrightnessUp:"BrightnessUp",Eject:"Eject",LogOff:"LogOff",Power:"Power",PowerOff:"PowerOff",PrintScreen:"PrintScreen",Hibernate:"Hibernate",Standby:"Standby",WakeUp:"WakeUp",Compose:"Compose",Dead:"Dead",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",Print:"Print",num0:"0",num1:"1",num2:"2",num3:"3",num4:"4",num5:"5",num6:"6",num7:"7",num8:"8",num9:"9",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",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",Semicolon:";",Equal:"=",Comma:",",Hyphen:"-",Minus:"-",Plus:"+",Dot:".",Slash:"/",Backquote:"`",LeftParenthesis:"(",RightParenthesis:")",LeftBracket:"[",RightBracket:"]",Backslash:"\\",Quote:"'",numpad0:"0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",NumpadDot:".",NumpadDotAlt:",",NumpadMultiply:"*",NumpadPlus:"+",NumpadMinus:"-",NumpadSubtract:"-",NumpadSlash:"/",NumpadDotObsoleteBrowsers:"Decimal",NumpadMultiplyObsoleteBrowsers:"Multiply",NumpadPlusObsoleteBrowsers:"Add",NumpadMinusObsoleteBrowsers:"Subtract",NumpadSlashObsoleteBrowsers:"Divide",_allFnKeys:["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"],_someNonPrintableKeys:["Tab","Enter","Shift","ShiftLeft","ShiftRight","Control","ControlLeft","ControlRight","Alt","AltLeft","AltRight","Pause","CapsLock","Escape"],_directionKeys:["PageUp","PageDown","End","Home","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"]},Object.freeze(F.keyName._allFnKeys),Object.freeze(F.keyName._someNonPrintableKeys),Object.freeze(F.keyName._directionKeys),Object.freeze(F.keyName),Object.defineProperty(F,"keyName",{configurable:!1,writable:!1}),Object.freeze(F);var b=F;function E(a){return function(c){if(Array.isArray(c))return l(c)}(a)||function(c){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(c))return Array.from(c)}(a)||o(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(){return(I=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var g=arguments[c];for(var e in g)Object.prototype.hasOwnProperty.call(g,e)&&(a[e]=g[e])}return a}).apply(this,arguments)}function y(a,c){return function(g){if(Array.isArray(g))return g}(a)||function(g,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(g)){var i=[],r=!0,m=!1,p=void 0;try{for(var s,C=g[Symbol.iterator]();!(r=(s=C.next()).done)&&(i.push(s.value),!e||i.length!==e);r=!0);}catch(M){m=!0,p=M}finally{try{r||null==C.return||C.return()}finally{if(m)throw p}}return i}}(a,c)||o(a,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(a,c){if(a){if("string"==typeof a)return l(a,c);var g=Object.prototype.toString.call(a).slice(8,-1);return"Object"===g&&a.constructor&&(g=a.constructor.name),"Map"===g||"Set"===g?Array.from(g):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?l(a,c):void 0}}function l(a,c){(null==c||c>a.length)&&(c=a.length);for(var g=0,e=new Array(c);g<c;g++)e[g]=a[g];return e}function d(a){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(a)}var n=function(){function a(){!function(c){if(!(c instanceof a))throw new TypeError("Cannot call a class as a function")}(this)}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a,[{key:"isNull",value:function(c){return null===c}},{key:"isUndefined",value:function(c){return void 0===c}},{key:"isUndefinedOrNullOrEmpty",value:function(c){return null==c||""===c}},{key:"isString",value:function(c){return"string"==typeof c||c instanceof String}},{key:"isEmptyString",value:function(c){return""===c}},{key:"isBoolean",value:function(c){return"boolean"==typeof c}},{key:"isTrueOrFalseString",value:function(c){var g=String(c).toLowerCase();return"true"===g||"false"===g}},{key:"isObject",value:function(c){return"object"===d(c)&&null!==c&&!Array.isArray(c)}},{key:"isEmptyObj",value:function(c){for(var g in c)if(Object.prototype.hasOwnProperty.call(c,g))return!1;return!0}},{key:"isNumberStrict",value:function(c){return"number"==typeof c}},{key:"isNumber",value:function(c){return!this.isArray(c)&&!isNaN(parseFloat(c))&&isFinite(c)}},{key:"isDigit",value:function(c){return/\d/.test(c)}},{key:"isNumberOrArabic",value:function(c){var g=this.arabicToLatinNumbers(c,!1,!0,!0);return this.isNumber(g)}},{key:"isInt",value:function(c){return"number"==typeof c&&parseFloat(c)===parseInt(c,10)&&!isNaN(c)}},{key:"isFunction",value:function(c){return"function"==typeof c}},{key:"isIE11",value:function(){return"undefined"!=typeof window&&!!window.MSInputMethodContext&&!!document.documentMode}},{key:"contains",value:function(c,g){return!(!this.isString(c)||!this.isString(g)||""===c||""===g)&&-1!==c.indexOf(g)}},{key:"isInArray",value:function(c,g){return!(!this.isArray(g)||g===[]||this.isUndefined(c))&&-1!==g.indexOf(c)}},{key:"isArray",value:function(c){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(c)||"object"===d(c)&&"[object Array]"===Object.prototype.toString.call(c);throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(c){return"undefined"!=typeof Element&&c instanceof Element}},{key:"isInputElement",value:function(c){return this.isElement(c)&&"input"===c.tagName.toLowerCase()}},{key:"decimalPlaces",value:function(c){var g=y(c.split("."),2)[1];return this.isUndefined(g)?0:g.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(c){var g=y(String(Math.abs(c)).split("."),2)[1];if(this.isUndefined(g))return 0;var e=g.lastIndexOf("0");return-1===e?e=0:e+=2,e}},{key:"keyCodeNumber",value:function(c){return void 0===c.which?c.keyCode:c.which}},{key:"character",value:function(c){var g;if("Unidentified"===c.key||void 0===c.key||this.isSeleniumBot()){var e=this.keyCodeNumber(c);if(e===b.keyCode.AndroidDefault)return b.keyName.AndroidDefault;var i=b.fromCharCodeKeyCode[e];g=a.isUndefinedOrNullOrEmpty(i)?String.fromCharCode(e):i}else{var r;switch(c.key){case"Add":g=b.keyName.NumpadPlus;break;case"Apps":g=b.keyName.ContextMenu;break;case"Crsel":g=b.keyName.CrSel;break;case"Decimal":g=c.char?c.char:b.keyName.NumpadDot;break;case"Del":g="firefox"===(r=this.browser()).name&&r.version<=36||"ie"===r.name&&r.version<=9?b.keyName.Dot:b.keyName.Delete;break;case"Divide":g=b.keyName.NumpadSlash;break;case"Down":g=b.keyName.DownArrow;break;case"Esc":g=b.keyName.Esc;break;case"Exsel":g=b.keyName.ExSel;break;case"Left":g=b.keyName.LeftArrow;break;case"Meta":case"Super":g=b.keyName.OSLeft;break;case"Multiply":g=b.keyName.NumpadMultiply;break;case"Right":g=b.keyName.RightArrow;break;case"Spacebar":g=b.keyName.Space;break;case"Subtract":g=b.keyName.NumpadMinus;break;case"Up":g=b.keyName.UpArrow;break;default:g=c.key}}return g}},{key:"browser",value:function(){var c,g=navigator.userAgent,e=g.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(e[1])?{name:"ie",version:(c=/\brv[ :]+(\d+)/g.exec(g)||[])[1]||""}:"Chrome"===e[1]&&null!==(c=g.match(/\b(OPR|Edge)\/(\d+)/))?{name:c[1].replace("OPR","opera"),version:c[2]}:(e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(c=g.match(/version\/(\d+)/i))&&e.splice(1,1,c[1]),{name:e[0].toLowerCase(),version:e[1]})}},{key:"isSeleniumBot",value:function(){return!0===window.navigator.webdriver}},{key:"isNegative",value:function(c,g,e){var i=1<arguments.length&&void 0!==g?g:"-",r=!(2<arguments.length&&void 0!==e)||e;return c===i||""!==c&&(a.isNumber(c)?c<0:r?this.contains(c,i):this.isNegativeStrict(c,i))}},{key:"isNegativeStrict",value:function(c,g){var e=1<arguments.length&&void 0!==g?g:"-";return c.charAt(0)===e}},{key:"isNegativeWithBrackets",value:function(c,g,e){return c.charAt(0)===g&&this.contains(c,e)}},{key:"isZeroOrHasNoValue",value:function(c){return!/[1-9]/g.test(c)}},{key:"setRawNegativeSign",value:function(c){return this.isNegativeStrict(c,"-")?c:"-".concat(c)}},{key:"replaceCharAt",value:function(c,g,e){return"".concat(c.substr(0,g)).concat(e).concat(c.substr(g+e.length))}},{key:"clampToRangeLimits",value:function(c,g){return Math.max(g.minimumValue,Math.min(g.maximumValue,c))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(c,g,e){for(var i=new RegExp("[0-9".concat(e,"-]")),r=0,m=0;m<g;m++)i.test(c[m])&&r++;return r}},{key:"findCaretPositionInFormattedNumber",value:function(c,g,e,i){var r,m=e.length,p=c.length,s=0;for(r=0;r<m&&s<p&&s<g;r++)(c[s]===e[r]||"."===c[s]&&e[r]===i)&&s++;return r}},{key:"countCharInText",value:function(c,g){for(var e=0,i=0;i<g.length;i++)g[i]===c&&e++;return e}},{key:"convertCharacterCountToIndexPosition",value:function(c){return Math.max(c,c-1)}},{key:"getElementSelection",value:function(c){var g,e={};try{g=this.isUndefined(c.selectionStart)}catch(r){g=!1}try{if(g){var i=window.getSelection().getRangeAt(0);e.start=i.startOffset,e.end=i.endOffset,e.length=e.end-e.start}else e.start=c.selectionStart,e.end=c.selectionEnd,e.length=e.end-e.start}catch(r){e.start=0,e.end=0,e.length=0}return e}},{key:"setElementSelection",value:function(c,g,e){var i=2<arguments.length&&void 0!==e?e:null;if(this.isUndefinedOrNullOrEmpty(i)&&(i=g),this.isInputElement(c))c.setSelectionRange(g,i);else if(!a.isNull(c.firstChild)){var r=document.createRange();r.setStart(c.firstChild,g),r.setEnd(c.firstChild,i);var m=window.getSelection();m.removeAllRanges(),m.addRange(r)}}},{key:"throwError",value:function(c){throw new Error(c)}},{key:"warning",value:function(c,g){1<arguments.length&&void 0!==g&&!g||console.warn("Warning: ".concat(c))}},{key:"isWheelUpEvent",value:function(c){return c.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(c.type,"' given.")),c.deltaY<0}},{key:"isWheelDownEvent",value:function(c){return c.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(c.type,"' given.")),0<c.deltaY}},{key:"forceDecimalPlaces",value:function(c,g){var e=y(String(c).split("."),2),r=e[1];return r?"".concat(e[0],".").concat(r.substr(0,g)):c}},{key:"roundToNearest",value:function(c,g){var e=1<arguments.length&&void 0!==g?g:1e3;return 0===c?0:(0===e&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(c/e)*e)}},{key:"modifyAndRoundToNearestAuto",value:function(c,g,e){c=Number(this.forceDecimalPlaces(c,e));var i=Math.abs(c);if(0<=i&&i<1){var r,m=Math.pow(10,-e);if(0===c)return g?m:-m;var s=e,C=this.indexFirstNonZeroDecimalPlace(c);return r=s-1<=C?m:Math.pow(10,-(C+1)),this.roundToNearest(g?c+r:c-r,r)}c=parseInt(c,10);var M,q=Math.abs(c).toString().length;switch(q){case 1:M=0;break;case 2:case 3:M=1;break;case 4:case 5:M=2;break;default:M=q-3}var v,Z=Math.pow(10,M);return(v=g?c+Z:c-Z)<=10&&-10<=v?v:this.roundToNearest(v,Z)}},{key:"addAndRoundToNearestAuto",value:function(c,g){return this.modifyAndRoundToNearestAuto(c,!0,g)}},{key:"subtractAndRoundToNearestAuto",value:function(c,g){return this.modifyAndRoundToNearestAuto(c,!1,g)}},{key:"arabicToLatinNumbers",value:function(c,g,e,i){var r=!(1<arguments.length&&void 0!==g)||g,m=2<arguments.length&&void 0!==e&&e,p=3<arguments.length&&void 0!==i&&i;if(this.isNull(c))return c;var s=c.toString();if(""===s)return c;if(null===s.match(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06f4\u06f5\u06f6]/g))return r&&(s=Number(s)),s;m&&(s=s.replace(/\u066b/,".")),p&&(s=s.replace(/\u066c/g,"")),s=s.replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g,function(M){return M.charCodeAt(0)-1632}).replace(/[\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9]/g,function(M){return M.charCodeAt(0)-1776});var C=Number(s);return isNaN(C)?C:(r&&(s=C),s)}},{key:"triggerEvent",value:function(c,g,e,i,r){var m,p=1<arguments.length&&void 0!==g?g:document,s=2<arguments.length&&void 0!==e?e:null,C=!(3<arguments.length&&void 0!==i)||i,M=!(4<arguments.length&&void 0!==r)||r;window.CustomEvent?m=new CustomEvent(c,{detail:s,bubbles:C,cancelable:M}):(m=document.createEvent("CustomEvent")).initCustomEvent(c,C,M,{detail:s}),p.dispatchEvent(m)}},{key:"parseStr",value:function(c){var g,e,i,r,m={};if(0===c&&1/c<0&&(c="-0"),c=c.toString(),this.isNegativeStrict(c,"-")?(c=c.slice(1),m.s=-1):m.s=1,-1<(g=c.indexOf("."))&&(c=c.replace(".","")),g<0&&(g=c.length),(e=-1===c.search(/[1-9]/i)?c.length:c.search(/[1-9]/i))===(i=c.length))m.e=0,m.c=[0];else{for(r=i-1;"0"===c.charAt(r);--r)--i;for(--i,m.e=g-e-1,m.c=[],g=0;e<=i;e+=1)m.c[g]=+c.charAt(e),g+=1}return m}},{key:"testMinMax",value:function(c,g){var e=g.c,i=c.c,r=g.s,m=c.s,p=g.e,s=c.e;if(!e[0]||!i[0])return e[0]?r:i[0]?-m:0;if(r!==m)return r;var C=r<0;if(p!==s)return s<p^C?1:-1;for(r=-1,m=(p=e.length)<(s=i.length)?p:s,r+=1;r<m;r+=1)if(e[r]!==i[r])return e[r]>i[r]^C?1:-1;return p===s?0:s<p^C?1:-1}},{key:"randomString",value:function(c){var g=0<arguments.length&&void 0!==c?c:5;return Math.random().toString(36).substr(2,g)}},{key:"domElement",value:function(c){return a.isString(c)?document.querySelector(c):c}},{key:"getElementValue",value:function(c){return"input"===c.tagName.toLowerCase()?c.value:this.text(c)}},{key:"setElementValue",value:function(c,g){var e=1<arguments.length&&void 0!==g?g:null;"input"===c.tagName.toLowerCase()?c.value=e:c.textContent=e}},{key:"setInvalidState",value:function(c,g){var e=1<arguments.length&&void 0!==g?g:"Invalid";""!==e&&!this.isNull(e)||this.throwError("Cannot set the invalid state with an empty message."),c.setCustomValidity(e)}},{key:"setValidState",value:function(c){c.setCustomValidity("")}},{key:"cloneObject",value:function(c){return I({},c)}},{key:"camelize",value:function(c,g,e,i){var r=1<arguments.length&&void 0!==g?g:"-",m=!(2<arguments.length&&void 0!==e)||e,p=!(3<arguments.length&&void 0!==i)||i;if(this.isNull(c))return null;m&&(c=c.replace(/^data-/,""));var s=c.split(r).map(function(C){return"".concat(C.charAt(0).toUpperCase()).concat(C.slice(1))});return s=s.join(""),p&&(s="".concat(s.charAt(0).toLowerCase()).concat(s.slice(1))),s}},{key:"text",value:function(c){var g=c.nodeType;return g===Node.ELEMENT_NODE||g===Node.DOCUMENT_NODE||g===Node.DOCUMENT_FRAGMENT_NODE?c.textContent:g===Node.TEXT_NODE?c.nodeValue:""}},{key:"setText",value:function(c,g){var e=c.nodeType;e!==Node.ELEMENT_NODE&&e!==Node.DOCUMENT_NODE&&e!==Node.DOCUMENT_FRAGMENT_NODE||(c.textContent=g)}},{key:"filterOut",value:function(c,g){var e=this;return c.filter(function(i){return!e.isInArray(i,g)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(c){if(""===(c=String(c)))return"";var g=y(c.split("."),2),e=g[0],i=g[1];if(this.isUndefinedOrNullOrEmpty(i))return e;var r=i.replace(/0+$/g,"");return""===r?e:"".concat(e,".").concat(r)}},{key:"getHoveredElement",value:function(){var c=E(document.querySelectorAll(":hover"));return c[c.length-1]}},{key:"arrayTrim",value:function(c,g){var e=c.length;return 0===e||e<g?c:g<0?[]:(c.length=parseInt(g,10),c)}},{key:"arrayUnique",value:function(){var c;return E(new Set((c=[]).concat.apply(c,arguments)))}},{key:"mergeMaps",value:function(){for(var c=arguments.length,g=new Array(c),e=0;e<c;e++)g[e]=arguments[e];return new Map(g.reduce(function(i,r){return i.concat(E(r))},[]))}},{key:"objectKeyLookup",value:function(c,g){var e=Object.entries(c).find(function(r){return r[1]===g}),i=null;return void 0!==e&&(i=e[0]),i}},{key:"insertAt",value:function(c,g,e){if(e>(c=String(c)).length)throw new Error("The given index is out of the string range.");if(1!==g.length)throw new Error("The given string `char` should be only one character long.");return""===c&&0===e?g:"".concat(c.slice(0,e)).concat(g).concat(c.slice(e))}},{key:"scientificToDecimal",value:function(c){var g=Number(c);if(isNaN(g))return NaN;if(c=String(c),!this.contains(c,"e")&&!this.contains(c,"E"))return c;var e=y(c.split(/e/i),2),i=e[0],r=e[1],m=i<0;m&&(i=i.replace("-",""));var p=+r<0;p&&(r=r.replace("-",""));var s,C=y(i.split(/\./),2),M=C[0],q=C[1];return s=p?(s=M.length>r?this.insertAt(M,".",M.length-r):"0.".concat("0".repeat(r-M.length)).concat(M),"".concat(s).concat(q||"")):q?(i="".concat(M).concat(q),r<q.length?this.insertAt(i,".",+r+M.length):"".concat(i).concat("0".repeat(r-q.length))):(i=i.replace(".",""),"".concat(i).concat("0".repeat(Number(r)))),m&&(s="-".concat(s)),s}}]),a}(),f=function(){function a(c){if(function(g){if(!(g instanceof a))throw new TypeError("Cannot call a class as a function")}(this),null===c)throw new Error("Invalid AST")}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a.prototype,[{key:"evaluate",value:function(c){if(null==c)throw new Error("Invalid AST sub-tree");if("number"===c.type)return c.value;if("unaryMinus"===c.type)return-this.evaluate(c.left);var g=this.evaluate(c.left),e=this.evaluate(c.right);switch(c.type){case"op_+":return Number(g)+Number(e);case"op_-":return g-e;case"op_*":return g*e;case"op_/":return g/e;default:throw new Error("Invalid operator '".concat(c.type,"'"))}}}]),a}(),_=function(){function a(){!function(c){if(!(c instanceof a))throw new TypeError("Cannot call a class as a function")}(this)}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a,[{key:"createNode",value:function(c,g,e){var i=new a;return i.type=c,i.left=g,i.right=e,i}},{key:"createUnaryNode",value:function(c){var g=new a;return g.type="unaryMinus",g.left=c,g.right=null,g}},{key:"createLeaf",value:function(c){var g=new a;return g.type="number",g.value=c,g}}]),a}();function P(a,c,g){(function(e){if(!(e instanceof P))throw new TypeError("Cannot call a class as a function")})(this),this.type=a,this.value=c,this.symbol=g}var R=function(){function a(c){(function(g){if(!(g instanceof a))throw new TypeError("Cannot call a class as a function")})(this),this.text=c,this.textLength=c.length,this.index=0,this.token=new P("Error",0,0)}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a.prototype,[{key:"_skipSpaces",value:function(){for(;" "===this.text[this.index]&&this.index<=this.textLength;)this.index++}},{key:"getIndex",value:function(){return this.index}},{key:"getNextToken",value:function(c){var g=0<arguments.length&&void 0!==c?c:".";if(this._skipSpaces(),this.textLength===this.index)return this.token.type="EOT",this.token;if(n.isDigit(this.text[this.index]))return this.token.type="num",this.token.value=this._getNumber(g),this.token;switch(this.token.type="Error",this.text[this.index]){case"+":this.token.type="+";break;case"-":this.token.type="-";break;case"*":this.token.type="*";break;case"/":this.token.type="/";break;case"(":this.token.type="(";break;case")":this.token.type=")"}if("Error"===this.token.type)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(this.token.index,"' in the token function"));return this.token.symbol=this.text[this.index],this.index++,this.token}},{key:"_getNumber",value:function(c){this._skipSpaces();for(var g=this.index;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===c&&this.index++;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;if(this.index===g)throw new Error("No number has been found while it was expected");return this.text.substring(g,this.index).replace(c,".")}}]),a}(),U=function(){function a(c){var g=1<arguments.length&&void 0!==arguments[1]?arguments[1]:".";return function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this.text=c,this.decimalCharacter=g,this.lexer=new R(c),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a.prototype,[{key:"_exp",value:function(){var c=this._term(),g=this._moreExp();return _.createNode("op_+",c,g)}},{key:"_moreExp",value:function(){var c,g;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._term(),g=this._moreExp(),_.createNode("op_+",g,c);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._term(),g=this._moreExp(),_.createNode("op_-",g,c)}return _.createLeaf(0)}},{key:"_term",value:function(){var c=this._factor(),g=this._moreTerms();return _.createNode("op_*",c,g)}},{key:"_moreTerms",value:function(){var c,g;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._factor(),g=this._moreTerms(),_.createNode("op_*",g,c);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._factor(),g=this._moreTerms(),_.createNode("op_/",g,c)}return _.createLeaf(1)}},{key:"_factor",value:function(){var c,g,e;switch(this.token.type){case"num":return e=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),_.createLeaf(e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),g=this._factor(),_.createUnaryNode(g);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._exp(),this._match(")"),c;default:throw new Error("Unexpected token '".concat(this.token.symbol,"' with type '").concat(this.token.type,"' at position '").concat(this.token.index,"' in the factor function"))}}},{key:"_match",value:function(c){var g=this.lexer.getIndex()-1;if(this.text[g]!==c)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(g,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}]),a}();function G(a){return function(c){if(Array.isArray(c))return le(c)}(a)||function(c){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(c))return Array.from(c)}(a)||$(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(a,c){return function(g){if(Array.isArray(g))return g}(a)||function(g,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(g)){var i=[],r=!0,m=!1,p=void 0;try{for(var s,C=g[Symbol.iterator]();!(r=(s=C.next()).done)&&(i.push(s.value),!e||i.length!==e);r=!0);}catch(M){m=!0,p=M}finally{try{r||null==C.return||C.return()}finally{if(m)throw p}}return i}}(a,c)||$(a,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(a,c){if(a){if("string"==typeof a)return le(a,c);var g=Object.prototype.toString.call(a).slice(8,-1);return"Object"===g&&a.constructor&&(g=a.constructor.name),"Map"===g||"Set"===g?Array.from(g):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?le(a,c):void 0}}function le(a,c){(null==c||c>a.length)&&(c=a.length);for(var g=0,e=new Array(c);g<c;g++)e[g]=a[g];return e}function re(){return(re=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var g=arguments[c];for(var e in g)Object.prototype.hasOwnProperty.call(g,e)&&(a[e]=g[e])}return a}).apply(this,arguments)}function te(a){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(a)}function ce(a,c){for(var g=0;g<c.length;g++){var e=c[g];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}var H,k=function(){function a(){var e=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,m=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;!function(v){if(!(v instanceof a))throw new TypeError("Cannot call a class as a function")}(this);var p=a._setArgumentsValues(i,r,m),C=p.initialValue,M=p.userOptions;if(this.domElement=p.domElement,this.defaultRawValue="",this._setSettings(M,!1),this._checkElement(),this.savedCancellableValue=null,this.historyTable=[],this.historyTableIndex=-1,this.onGoingRedo=!1,this.parentForm=this._getParentForm(),!this.runOnce&&this.settings.formatOnPageLoad)this._formatDefaultValueOnPageLoad(C);else{var q;if(n.isNull(C))switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.min:q=this.settings.minimumValue;break;case a.options.emptyInputBehavior.max:q=this.settings.maximumValue;break;case a.options.emptyInputBehavior.zero:q="0";break;case a.options.emptyInputBehavior.focus:case a.options.emptyInputBehavior.press:case a.options.emptyInputBehavior.always:case a.options.emptyInputBehavior.null:q="";break;default:q=this.settings.emptyInputBehavior}else q=C;this._setElementAndRawValue(q)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(C),this.sessionStorageAvailable=this.constructor._storageTest(),this.storageNamePrefix="AUTO_",this._setPersistentStorageName(),this.validState=!0,this.isFocused=!1,this.isWheelEvent=!1,this.isDropEvent=!1,this.isEditing=!1,this.rawValueOnFocus=void 0,this.internalModification=!1,this.attributeToWatch=this._getAttributeToWatch(),this.getterSetter=Object.getOwnPropertyDescriptor(this.domElement.__proto__,this.attributeToWatch),this._addWatcher(),this.settings.createLocalList&&this._createLocalList(),this.constructor._addToGlobalList(this),this.global={set:function(v,Z){var V=1<arguments.length&&void 0!==Z?Z:null;e.autoNumericLocalList.forEach(function(B){B.set(v,V)})},setUnformatted:function(v,Z){var V=1<arguments.length&&void 0!==Z?Z:null;e.autoNumericLocalList.forEach(function(B){B.setUnformatted(v,V)})},get:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.get())}),e._executeCallback(V,Z),V},getNumericString:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.getNumericString())}),e._executeCallback(V,Z),V},getFormatted:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.getFormatted())}),e._executeCallback(V,Z),V},getNumber:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.getNumber())}),e._executeCallback(V,Z),V},getLocalized:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.getLocalized())}),e._executeCallback(V,Z),V},reformat:function(){e.autoNumericLocalList.forEach(function(v){v.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(v){v.unformat()})},unformatLocalized:function(v){var Z=0<arguments.length&&void 0!==v?v:null;e.autoNumericLocalList.forEach(function(V){V.unformatLocalized(Z)})},update:function(){for(var v=arguments.length,Z=new Array(v),V=0;V<v;V++)Z[V]=arguments[V];e.autoNumericLocalList.forEach(function(B){B.update.apply(B,Z)})},isPristine:function(){var v=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],Z=!0;return e.autoNumericLocalList.forEach(function(V){Z&&!V.isPristine(v)&&(Z=!1)}),Z},clear:function(v){var Z=0<arguments.length&&void 0!==v&&v;e.autoNumericLocalList.forEach(function(V){V.clear(Z)})},remove:function(){e.autoNumericLocalList.forEach(function(v){v.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(v){v.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(v){v.nuke()})},has:function(v){return e.autoNumericLocalList.has(v instanceof a?v.node():v)},addObject:function(v){var Z,V;V=v instanceof a?(Z=v.node(),v):a.getAutoNumericElement(Z=v),e._hasLocalList()||e._createLocalList();var B,j=V._getLocalList();0===j.size&&(V._createLocalList(),j=V._getLocalList()),(B=j instanceof Map?n.mergeMaps(e._getLocalList(),j):(e._addToLocalList(Z,V),e._getLocalList())).forEach(function(z){z._setLocalList(B)})},removeObject:function(v,Z){var V,B,j=1<arguments.length&&void 0!==Z&&Z;B=v instanceof a?(V=v.node(),v):a.getAutoNumericElement(V=v);var z=e.autoNumericLocalList;e.autoNumericLocalList.delete(V),z.forEach(function(X){X._setLocalList(e.autoNumericLocalList)}),j||V!==e.node()?B._createLocalList():B._setLocalList(new Map)},empty:function(v){var Z=0<arguments.length&&void 0!==v&&v;e.autoNumericLocalList.forEach(function(V){Z?V._createLocalList():V._setLocalList(new Map)})},elements:function(){var v=[];return e.autoNumericLocalList.forEach(function(Z){v.push(Z.node())}),v},getList:function(){return e.autoNumericLocalList},size:function(){return e.autoNumericLocalList.size}},this.options={reset:function(){return e.settings={rawValue:e.defaultRawValue},e.update(a.defaultSettings),e},allowDecimalPadding:function(v){return e.update({allowDecimalPadding:v}),e},alwaysAllowDecimalCharacter:function(v){return e.update({alwaysAllowDecimalCharacter:v}),e},caretPositionOnFocus:function(v){return e.settings.caretPositionOnFocus=v,e},createLocalList:function(v){return e.settings.createLocalList=v,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(v){return e.update({currencySymbol:v}),e},currencySymbolPlacement:function(v){return e.update({currencySymbolPlacement:v}),e},decimalCharacter:function(v){return e.update({decimalCharacter:v}),e},decimalCharacterAlternative:function(v){return e.settings.decimalCharacterAlternative=v,e},decimalPlaces:function(v){return n.warning("Using `options.decimalPlaces()` instead of calling the specific `options.decimalPlacesRawValue()`, `options.decimalPlacesShownOnFocus()` and `options.decimalPlacesShownOnBlur()` methods will reset those options.\nPlease call the specific methods if you do not want to reset those.",e.settings.showWarnings),e.update({decimalPlaces:v}),e},decimalPlacesRawValue:function(v){return e.update({decimalPlacesRawValue:v}),e},decimalPlacesShownOnBlur:function(v){return e.update({decimalPlacesShownOnBlur:v}),e},decimalPlacesShownOnFocus:function(v){return e.update({decimalPlacesShownOnFocus:v}),e},defaultValueOverride:function(v){return e.update({defaultValueOverride:v}),e},digitalGroupSpacing:function(v){return e.update({digitalGroupSpacing:v}),e},digitGroupSeparator:function(v){return e.update({digitGroupSeparator:v}),e},divisorWhenUnfocused:function(v){return e.update({divisorWhenUnfocused:v}),e},emptyInputBehavior:function(v){return null===e.rawValue&&v!==a.options.emptyInputBehavior.null&&(n.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(v,"), but the element raw value is currently set to `null`. This would result in an invalid `rawValue`. In order to fix that, the element value has been changed to the empty string `''`."),e.settings.showWarnings),e.rawValue=""),e.update({emptyInputBehavior:v}),e},eventBubbles:function(v){return e.settings.eventBubbles=v,e},eventIsCancelable:function(v){return e.settings.eventIsCancelable=v,e},failOnUnknownOption:function(v){return e.settings.failOnUnknownOption=v,e},formatOnPageLoad:function(v){return e.settings.formatOnPageLoad=v,e},formulaMode:function(v){return e.settings.formulaMode=v,e},historySize:function(v){return e.settings.historySize=v,e},invalidClass:function(v){return e.settings.invalidClass=v,e},isCancellable:function(v){return e.settings.isCancellable=v,e},leadingZero:function(v){return e.update({leadingZero:v}),e},maximumValue:function(v){return e.update({maximumValue:v}),e},minimumValue:function(v){return e.update({minimumValue:v}),e},modifyValueOnWheel:function(v){return e.settings.modifyValueOnWheel=v,e},negativeBracketsTypeOnBlur:function(v){return e.update({negativeBracketsTypeOnBlur:v}),e},negativePositiveSignPlacement:function(v){return e.update({negativePositiveSignPlacement:v}),e},negativeSignCharacter:function(v){return e.update({negativeSignCharacter:v}),e},noEventListeners:function(v){return v===a.options.noEventListeners.noEvents&&e.settings.noEventListeners===a.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:v}),e},onInvalidPaste:function(v){return e.settings.onInvalidPaste=v,e},outputFormat:function(v){return e.settings.outputFormat=v,e},overrideMinMaxLimits:function(v){return e.update({overrideMinMaxLimits:v}),e},positiveSignCharacter:function(v){return e.update({positiveSignCharacter:v}),e},rawValueDivisor:function(v){return e.update({rawValueDivisor:v}),e},readOnly:function(v){return e.settings.readOnly=v,e._setWritePermissions(),e},roundingMethod:function(v){return e.update({roundingMethod:v}),e},saveValueToSessionStorage:function(v){return e.update({saveValueToSessionStorage:v}),e},symbolWhenUnfocused:function(v){return e.update({symbolWhenUnfocused:v}),e},selectNumberOnly:function(v){return e.settings.selectNumberOnly=v,e},selectOnFocus:function(v){return e.settings.selectOnFocus=v,e},serializeSpaces:function(v){return e.settings.serializeSpaces=v,e},showOnlyNumbersOnFocus:function(v){return e.update({showOnlyNumbersOnFocus:v}),e},showPositiveSign:function(v){return e.update({showPositiveSign:v}),e},showWarnings:function(v){return e.settings.showWarnings=v,e},styleRules:function(v){return e.update({styleRules:v}),e},suffixText:function(v){return e.update({suffixText:v}),e},unformatOnHover:function(v){return e.settings.unformatOnHover=v,e},unformatOnSubmit:function(v){return e.settings.unformatOnSubmit=v,e},valuesToStrings:function(v){return e.update({valuesToStrings:v}),e},watchExternalChanges:function(v){return e.update({watchExternalChanges:v}),e},wheelOn:function(v){return e.settings.wheelOn=v,e},wheelStep:function(v){return e.settings.wheelStep=v,e}},this._triggerEvent(a.events.initialized,this.domElement,{newValue:n.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var c,g;return g=[{key:"version",value:function(){return"4.6.0"}},{key:"_setArgumentsValues",value:function(e,i,r){n.isNull(e)&&n.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var m,p,s,C=n.isElement(e),M=n.isString(e),q=n.isObject(i),v=Array.isArray(i)&&0<i.length,Z=n.isNumberOrArabic(i)||""===i,V=this._isPreDefinedOptionValid(i),B=n.isNull(i),j=n.isEmptyString(i),z=n.isObject(r),X=Array.isArray(r)&&0<r.length,ne=n.isNull(r),se=this._isPreDefinedOptionValid(r);return C&&B&&ne?(m=e,p=s=null):C&&Z&&ne?(m=e,s=i,p=null):C&&q&&ne?(m=e,s=null,p=i):C&&V&&ne?(m=e,s=null,p=this._getOptionObject(i)):C&&v&&ne?(m=e,s=null,p=this.mergeOptions(i)):C&&(B||j)&&z?(m=e,s=null,p=r):C&&(B||j)&&X?(m=e,s=null,p=this.mergeOptions(r)):M&&B&&ne?(m=document.querySelector(e),p=s=null):M&&q&&ne?(m=document.querySelector(e),s=null,p=i):M&&V&&ne?(m=document.querySelector(e),s=null,p=this._getOptionObject(i)):M&&v&&ne?(m=document.querySelector(e),s=null,p=this.mergeOptions(i)):M&&(B||j)&&z?(m=document.querySelector(e),s=null,p=r):M&&(B||j)&&X?(m=document.querySelector(e),s=null,p=this.mergeOptions(r)):M&&Z&&ne?(m=document.querySelector(e),s=i,p=null):M&&Z&&z?(m=document.querySelector(e),s=i,p=r):M&&Z&&se?(m=document.querySelector(e),s=i,p=this._getOptionObject(r)):M&&Z&&X?(m=document.querySelector(e),s=i,p=this.mergeOptions(r)):C&&Z&&z?(m=e,s=i,p=r):C&&Z&&se?(m=e,s=i,p=this._getOptionObject(r)):C&&Z&&X?(m=e,s=i,p=this.mergeOptions(r)):n.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(i,"' and '").concat(r,"' given.")),n.isNull(m)&&n.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:m,initialValue:s,userOptions:p}}},{key:"mergeOptions",value:function(e){var i=this,r={};return e.forEach(function(m){re(r,i._getOptionObject(m))}),r}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(a.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var i;return n.isString(e)?null==(i=a.getPredefinedOptions()[e])&&n.warning("The given pre-defined option [".concat(e,"] is not recognized by autoNumeric. Please check that pre-defined option name."),!0):i=e,i}},{key:"_doesFormHandlerListExists",value:function(){var e=te(window.aNFormHandlerMap);return"undefined"!==e&&"object"===e}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,i){return n.isInArray(String(e),i)}},{key:"_checkValuesToStringsSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.keys(i.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.values(i.valuesToStrings))}},{key:"_unformatAltHovered",value:function(e){e.hoveredWithAlt=!0,e.unformat()}},{key:"_reformatAltHovered",value:function(e){e.hoveredWithAlt=!1,e.reformat()}},{key:"_getChildANInputElement",value:function(e){var i=this,r=e.getElementsByTagName("input"),m=[];return Array.prototype.slice.call(r,0).forEach(function(p){i.test(p)&&m.push(p)}),m}},{key:"test",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"_createWeakMap",value:function(e){window[e]=new WeakMap}},{key:"_createGlobalList",value:function(){this.autoNumericGlobalListName="autoNumericGlobalList",this._createWeakMap(this.autoNumericGlobalListName)}},{key:"_doesGlobalListExists",value:function(){var e=te(window[this.autoNumericGlobalListName]);return"undefined"!==e&&"object"===e}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var i=e.node();if(this._isInGlobalList(i)){if(this._getFromGlobalList(i)===this)return;n.warning("A reference to the DOM element you just initialized already exists in the global AutoNumeric element list. Please make sure to not initialize the same DOM element multiple times.",e.getSettings().showWarnings)}window[this.autoNumericGlobalListName].set(i,e)}},{key:"_removeFromGlobalList",value:function(e){this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].delete(e.node())}},{key:"_getFromGlobalList",value:function(e){return this._doesGlobalListExists()?window[this.autoNumericGlobalListName].get(e):null}},{key:"_isInGlobalList",value:function(e){return!!this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].has(e)}},{key:"validate",value:function(e,i,r){var m=!(1<arguments.length&&void 0!==i)||i,p=2<arguments.length&&void 0!==r?r:null;!n.isUndefinedOrNullOrEmpty(e)&&n.isObject(e)||n.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var s,C=n.isObject(p);C||n.isNull(p)||n.throwError("The 'originalOptions' parameter is invalid ; it should either be a valid option object or `null`, [".concat(e,"] given.")),n.isNull(e)||this._convertOldOptionsToNewOnes(e),s=m?re({},this.getDefaultConfig(),e):e,n.isTrueOrFalseString(s.showWarnings)||n.isBoolean(s.showWarnings)||n.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(s.showWarnings,"] given."));var M,q=/^[0-9]+$/,v=/[0-9]+/,Z=/^-?[0-9]+(\.?[0-9]+)?$/,V=/^[0-9]+(\.?[0-9]+)?$/;n.isTrueOrFalseString(s.allowDecimalPadding)||n.isBoolean(s.allowDecimalPadding)||s.allowDecimalPadding===a.options.allowDecimalPadding.floats||n.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true` or `'floats'`, [".concat(s.allowDecimalPadding,"] given.")),s.allowDecimalPadding!==a.options.allowDecimalPadding.never&&"false"!==s.allowDecimalPadding||s.decimalPlaces===a.options.decimalPlaces.none&&s.decimalPlacesShownOnBlur===a.options.decimalPlacesShownOnBlur.none&&s.decimalPlacesShownOnFocus===a.options.decimalPlacesShownOnFocus.none||n.warning("Setting 'allowDecimalPadding' to [".concat(s.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(s.decimalPlaces,", ").concat(s.decimalPlacesShownOnBlur," and ").concat(s.decimalPlacesShownOnFocus,"]."),s.showWarnings),n.isTrueOrFalseString(s.alwaysAllowDecimalCharacter)||n.isBoolean(s.alwaysAllowDecimalCharacter)||n.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(s.alwaysAllowDecimalCharacter,"] given.")),n.isNull(s.caretPositionOnFocus)||n.isInArray(s.caretPositionOnFocus,[a.options.caretPositionOnFocus.start,a.options.caretPositionOnFocus.end,a.options.caretPositionOnFocus.decimalLeft,a.options.caretPositionOnFocus.decimalRight])||n.throwError("The display on empty string option 'caretPositionOnFocus' is invalid ; it should either be `null`, 'focus', 'press', 'always' or 'zero', [".concat(s.caretPositionOnFocus,"] given.")),M=C?p:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),n.isNull(M)||M.caretPositionOnFocus===a.options.caretPositionOnFocus.doNoForceCaretPosition||M.selectOnFocus!==a.options.selectOnFocus.select||n.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(M.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),s.showWarnings),n.isInArray(s.digitGroupSeparator,[a.options.digitGroupSeparator.comma,a.options.digitGroupSeparator.dot,a.options.digitGroupSeparator.normalSpace,a.options.digitGroupSeparator.thinSpace,a.options.digitGroupSeparator.narrowNoBreakSpace,a.options.digitGroupSeparator.noBreakSpace,a.options.digitGroupSeparator.noSeparator,a.options.digitGroupSeparator.apostrophe,a.options.digitGroupSeparator.arabicThousandsSeparator,a.options.digitGroupSeparator.dotAbove,a.options.digitGroupSeparator.privateUseTwo])||n.throwError("The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '\u066c', '\u02d9', \"'\", '\x92', ' ', '\u2009', '\u202f', '\xa0' or empty (''), [".concat(s.digitGroupSeparator,"] given.")),n.isTrueOrFalseString(s.showOnlyNumbersOnFocus)||n.isBoolean(s.showOnlyNumbersOnFocus)||n.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(s.showOnlyNumbersOnFocus,"] given.")),n.isInArray(s.digitalGroupSpacing,[a.options.digitalGroupSpacing.two,a.options.digitalGroupSpacing.twoScaled,a.options.digitalGroupSpacing.three,a.options.digitalGroupSpacing.four])||2<=s.digitalGroupSpacing&&s.digitalGroupSpacing<=4||n.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2s', '3', or '4', [".concat(s.digitalGroupSpacing,"] given.")),n.isInArray(s.decimalCharacter,[a.options.decimalCharacter.comma,a.options.decimalCharacter.dot,a.options.decimalCharacter.middleDot,a.options.decimalCharacter.arabicDecimalSeparator,a.options.decimalCharacter.decimalSeparatorKeySymbol])||n.throwError("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '\xb7', '\u2396' or '\u066b', [".concat(s.decimalCharacter,"] given.")),s.decimalCharacter===s.digitGroupSeparator&&n.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(s.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(s.digitGroupSeparator,"] are the same character.")),n.isNull(s.decimalCharacterAlternative)||n.isString(s.decimalCharacterAlternative)||n.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(s.decimalCharacterAlternative,"] given.")),""===s.currencySymbol||n.isString(s.currencySymbol)||n.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(s.currencySymbol,"] given.")),n.isInArray(s.currencySymbolPlacement,[a.options.currencySymbolPlacement.prefix,a.options.currencySymbolPlacement.suffix])||n.throwError("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), [".concat(s.currencySymbolPlacement,"] given.")),n.isInArray(s.negativePositiveSignPlacement,[a.options.negativePositiveSignPlacement.prefix,a.options.negativePositiveSignPlacement.suffix,a.options.negativePositiveSignPlacement.left,a.options.negativePositiveSignPlacement.right,a.options.negativePositiveSignPlacement.none])||n.throwError("The placement of the negative sign option 'negativePositiveSignPlacement' is invalid ; it should either be 'p' (prefix), 's' (suffix), 'l' (left), 'r' (right) or 'null', [".concat(s.negativePositiveSignPlacement,"] given.")),n.isTrueOrFalseString(s.showPositiveSign)||n.isBoolean(s.showPositiveSign)||n.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(s.showPositiveSign,"] given.")),n.isString(s.suffixText)&&(""===s.suffixText||!n.isNegative(s.suffixText,s.negativeSignCharacter)&&!v.test(s.suffixText))||n.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(s.negativeSignCharacter,"' nor any numerical characters, [").concat(s.suffixText,"] given.")),n.isString(s.negativeSignCharacter)&&1===s.negativeSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(s.negativeSignCharacter)&&!v.test(s.negativeSignCharacter)||n.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(s.negativeSignCharacter,"] given.")),n.isString(s.positiveSignCharacter)&&1===s.positiveSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(s.positiveSignCharacter)&&!v.test(s.positiveSignCharacter)||n.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(s.positiveSignCharacter,"] given.\nIf you want to hide the positive sign character, you need to set the `showPositiveSign` option to `true`.")),s.negativeSignCharacter===s.positiveSignCharacter&&n.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(s.negativeSignCharacter,"] given."));var B=W(n.isNull(s.negativeBracketsTypeOnBlur)?["",""]:s.negativeBracketsTypeOnBlur.split(","),2),j=B[0],z=B[1];(n.contains(s.digitGroupSeparator,s.negativeSignCharacter)||n.contains(s.decimalCharacter,s.negativeSignCharacter)||n.contains(s.decimalCharacterAlternative,s.negativeSignCharacter)||n.contains(j,s.negativeSignCharacter)||n.contains(z,s.negativeSignCharacter)||n.contains(s.suffixText,s.negativeSignCharacter))&&n.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(s.negativeSignCharacter,"] given.")),(n.contains(s.digitGroupSeparator,s.positiveSignCharacter)||n.contains(s.decimalCharacter,s.positiveSignCharacter)||n.contains(s.decimalCharacterAlternative,s.positiveSignCharacter)||n.contains(j,s.positiveSignCharacter)||n.contains(z,s.positiveSignCharacter)||n.contains(s.suffixText,s.positiveSignCharacter))&&n.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(s.positiveSignCharacter,"] given.")),n.isNull(s.overrideMinMaxLimits)||n.isInArray(s.overrideMinMaxLimits,[a.options.overrideMinMaxLimits.ceiling,a.options.overrideMinMaxLimits.floor,a.options.overrideMinMaxLimits.ignore,a.options.overrideMinMaxLimits.invalid])||n.throwError("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor', 'ignore' or 'invalid', [".concat(s.overrideMinMaxLimits,"] given.")),s.overrideMinMaxLimits!==a.options.overrideMinMaxLimits.invalid&&s.overrideMinMaxLimits!==a.options.overrideMinMaxLimits.ignore&&(0<s.minimumValue||s.maximumValue<0)&&n.warning("You've set a `minimumValue` or a `maximumValue` excluding the value `0`. AutoNumeric will force the users to always have a valid value in the input, hence preventing them to clear the field. If you want to allow for temporary invalid values (ie. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),n.isString(s.maximumValue)&&Z.test(s.maximumValue)||n.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(s.maximumValue,"] given.")),n.isString(s.minimumValue)&&Z.test(s.minimumValue)||n.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(s.minimumValue,"] given.")),parseFloat(s.minimumValue)>parseFloat(s.maximumValue)&&n.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(s.minimumValue,"] should be smaller than 'maximumValue' [").concat(s.maximumValue,"].")),n.isInt(s.decimalPlaces)&&0<=s.decimalPlaces||n.isString(s.decimalPlaces)&&q.test(s.decimalPlaces)||n.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(s.decimalPlaces,"] given.")),n.isNull(s.decimalPlacesRawValue)||n.isInt(s.decimalPlacesRawValue)&&0<=s.decimalPlacesRawValue||n.isString(s.decimalPlacesRawValue)&&q.test(s.decimalPlacesRawValue)||n.throwError("The number of decimal places for the raw value option 'decimalPlacesRawValue' is invalid ; it should be a positive integer or `null`, [".concat(s.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(s),n.isNull(s.decimalPlacesShownOnFocus)||q.test(String(s.decimalPlacesShownOnFocus))||n.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(s.decimalPlacesShownOnFocus,"] given.")),!n.isNull(s.decimalPlacesShownOnFocus)&&Number(s.decimalPlaces)>Number(s.decimalPlacesShownOnFocus)&&n.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(s.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(s.decimalPlaces,"] value. Currently, this will limit the ability of your user to manually change some of the decimal places. Do you really want to do that?"),s.showWarnings),(n.isNull(s.divisorWhenUnfocused)||V.test(s.divisorWhenUnfocused))&&0!==s.divisorWhenUnfocused&&"0"!==s.divisorWhenUnfocused&&1!==s.divisorWhenUnfocused&&"1"!==s.divisorWhenUnfocused||n.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(s.divisorWhenUnfocused,"] given.")),n.isNull(s.decimalPlacesShownOnBlur)||q.test(s.decimalPlacesShownOnBlur)||n.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(s.decimalPlacesShownOnBlur,"] given.")),n.isNull(s.symbolWhenUnfocused)||n.isString(s.symbolWhenUnfocused)||n.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(s.symbolWhenUnfocused,"] given.")),n.isTrueOrFalseString(s.saveValueToSessionStorage)||n.isBoolean(s.saveValueToSessionStorage)||n.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(s.saveValueToSessionStorage,"] given.")),n.isInArray(s.onInvalidPaste,[a.options.onInvalidPaste.error,a.options.onInvalidPaste.ignore,a.options.onInvalidPaste.clamp,a.options.onInvalidPaste.truncate,a.options.onInvalidPaste.replace])||n.throwError("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), [".concat(s.onInvalidPaste,"] given.")),n.isInArray(s.roundingMethod,[a.options.roundingMethod.halfUpSymmetric,a.options.roundingMethod.halfUpAsymmetric,a.options.roundingMethod.halfDownSymmetric,a.options.roundingMethod.halfDownAsymmetric,a.options.roundingMethod.halfEvenBankersRounding,a.options.roundingMethod.upRoundAwayFromZero,a.options.roundingMethod.downRoundTowardZero,a.options.roundingMethod.toCeilingTowardPositiveInfinity,a.options.roundingMethod.toFloorTowardNegativeInfinity,a.options.roundingMethod.toNearest05,a.options.roundingMethod.toNearest05Alt,a.options.roundingMethod.upToNext05,a.options.roundingMethod.downToNext05])||n.throwError("The rounding method option 'roundingMethod' is invalid ; it should either be 'S', 'A', 's', 'a', 'B', 'U', 'D', 'C', 'F', 'N05', 'CHF', 'U05' or 'D05' (cf. documentation), [".concat(s.roundingMethod,"] given.")),n.isNull(s.negativeBracketsTypeOnBlur)||n.isInArray(s.negativeBracketsTypeOnBlur,[a.options.negativeBracketsTypeOnBlur.parentheses,a.options.negativeBracketsTypeOnBlur.brackets,a.options.negativeBracketsTypeOnBlur.chevrons,a.options.negativeBracketsTypeOnBlur.curlyBraces,a.options.negativeBracketsTypeOnBlur.angleBrackets,a.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,a.options.negativeBracketsTypeOnBlur.halfBrackets,a.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,a.options.negativeBracketsTypeOnBlur.quotationMarks,a.options.negativeBracketsTypeOnBlur.guillemets])||n.throwError("The brackets for negative values option 'negativeBracketsTypeOnBlur' is invalid ; it should either be '(,)', '[,]', '<,>', '{,}', '\u3008,\u3009', '\uff62,\uff63', '\u2e24,\u2e25', '\u27e6,\u27e7', '\u2039,\u203a' or '\xab,\xbb', [".concat(s.negativeBracketsTypeOnBlur,"] given.")),(n.isString(s.emptyInputBehavior)||n.isNumber(s.emptyInputBehavior))&&(n.isInArray(s.emptyInputBehavior,[a.options.emptyInputBehavior.focus,a.options.emptyInputBehavior.press,a.options.emptyInputBehavior.always,a.options.emptyInputBehavior.min,a.options.emptyInputBehavior.max,a.options.emptyInputBehavior.zero,a.options.emptyInputBehavior.null])||Z.test(s.emptyInputBehavior))||n.throwError("The display on empty string option 'emptyInputBehavior' is invalid ; it should either be 'focus', 'press', 'always', 'min', 'max', 'zero', 'null', a number, or a string that represents a number, [".concat(s.emptyInputBehavior,"] given.")),s.emptyInputBehavior===a.options.emptyInputBehavior.zero&&(0<s.minimumValue||s.maximumValue<0)&&n.throwError("The 'emptyInputBehavior' option is set to 'zero', but this value is outside of the range defined by 'minimumValue' and 'maximumValue' [".concat(s.minimumValue,", ").concat(s.maximumValue,"].")),Z.test(String(s.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(s.emptyInputBehavior,s)||n.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(s.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(s.minimumValue,", ").concat(s.maximumValue,"]."))),n.isTrueOrFalseString(s.eventBubbles)||n.isBoolean(s.eventBubbles)||n.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(s.eventBubbles,"] given.")),n.isTrueOrFalseString(s.eventIsCancelable)||n.isBoolean(s.eventIsCancelable)||n.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(s.eventIsCancelable,"] given.")),!n.isBoolean(s.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(s.invalidClass)||n.throwError("The name of the 'invalidClass' option is not a valid CSS class name ; it should not be empty, and should follow the '^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$' regex, [".concat(s.invalidClass,"] given.")),n.isInArray(s.leadingZero,[a.options.leadingZero.allow,a.options.leadingZero.deny,a.options.leadingZero.keep])||n.throwError("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [".concat(s.leadingZero,"] given.")),n.isTrueOrFalseString(s.formatOnPageLoad)||n.isBoolean(s.formatOnPageLoad)||n.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(s.formatOnPageLoad,"] given.")),n.isTrueOrFalseString(s.formulaMode)||n.isBoolean(s.formulaMode)||n.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(s.formulaMode,"] given.")),q.test(s.historySize)&&0!==s.historySize||n.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(s.historySize,"] given.")),n.isTrueOrFalseString(s.selectNumberOnly)||n.isBoolean(s.selectNumberOnly)||n.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(s.selectNumberOnly,"] given.")),n.isTrueOrFalseString(s.selectOnFocus)||n.isBoolean(s.selectOnFocus)||n.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(s.selectOnFocus,"] given.")),n.isNull(s.defaultValueOverride)||""===s.defaultValueOverride||Z.test(s.defaultValueOverride)||n.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(s.defaultValueOverride,"] given.")),n.isTrueOrFalseString(s.unformatOnSubmit)||n.isBoolean(s.unformatOnSubmit)||n.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(s.unformatOnSubmit,"] given.")),n.isNull(s.valuesToStrings)||n.isObject(s.valuesToStrings)||n.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(s.valuesToStrings,"] given.")),n.isNull(s.outputFormat)||n.isInArray(s.outputFormat,[a.options.outputFormat.string,a.options.outputFormat.number,a.options.outputFormat.dot,a.options.outputFormat.negativeDot,a.options.outputFormat.comma,a.options.outputFormat.negativeComma,a.options.outputFormat.dotNegative,a.options.outputFormat.commaNegative])||n.throwError("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [".concat(s.outputFormat,"] given.")),n.isTrueOrFalseString(s.isCancellable)||n.isBoolean(s.isCancellable)||n.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(s.isCancellable,"] given.")),n.isTrueOrFalseString(s.modifyValueOnWheel)||n.isBoolean(s.modifyValueOnWheel)||n.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(s.modifyValueOnWheel,"] given.")),n.isTrueOrFalseString(s.watchExternalChanges)||n.isBoolean(s.watchExternalChanges)||n.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(s.watchExternalChanges,"] given.")),n.isInArray(s.wheelOn,[a.options.wheelOn.focus,a.options.wheelOn.hover])||n.throwError("The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [".concat(s.wheelOn,"] given.")),(n.isString(s.wheelStep)||n.isNumber(s.wheelStep))&&("progressive"===s.wheelStep||V.test(s.wheelStep))&&0!==Number(s.wheelStep)||n.throwError("The wheel step value option 'wheelStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(s.wheelStep,"] given.")),n.isInArray(s.serializeSpaces,[a.options.serializeSpaces.plus,a.options.serializeSpaces.percent])||n.throwError("The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [".concat(s.serializeSpaces,"] given.")),n.isTrueOrFalseString(s.noEventListeners)||n.isBoolean(s.noEventListeners)||n.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(s.noEventListeners,"] given.")),n.isNull(s.styleRules)||n.isObject(s.styleRules)&&(Object.prototype.hasOwnProperty.call(s.styleRules,"positive")||Object.prototype.hasOwnProperty.call(s.styleRules,"negative")||Object.prototype.hasOwnProperty.call(s.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(s.styleRules,"userDefined"))||n.throwError("The option 'styleRules' is invalid ; it should be a correctly structured object, with one or more 'positive', 'negative', 'ranges' or 'userDefined' attributes, [".concat(s.styleRules,"] given.")),n.isNull(s.styleRules)||!Object.prototype.hasOwnProperty.call(s.styleRules,"userDefined")||n.isNull(s.styleRules.userDefined)||s.styleRules.userDefined.forEach(function(X){Object.prototype.hasOwnProperty.call(X,"callback")&&!n.isFunction(X.callback)&&n.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(te(X.callback)," given."))}),(n.isNull(s.rawValueDivisor)||V.test(s.rawValueDivisor))&&0!==s.rawValueDivisor&&"0"!==s.rawValueDivisor&&1!==s.rawValueDivisor&&"1"!==s.rawValueDivisor||n.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(s.rawValueDivisor,"] given.")),n.isTrueOrFalseString(s.readOnly)||n.isBoolean(s.readOnly)||n.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(s.readOnly,"] given.")),n.isTrueOrFalseString(s.unformatOnHover)||n.isBoolean(s.unformatOnHover)||n.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(s.unformatOnHover,"] given.")),n.isTrueOrFalseString(s.failOnUnknownOption)||n.isBoolean(s.failOnUnknownOption)||n.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(s.failOnUnknownOption,"] given.")),n.isTrueOrFalseString(s.createLocalList)||n.isBoolean(s.createLocalList)||n.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(s.createLocalList,"] given."))}},{key:"_validateDecimalPlacesRawValue",value:function(e){n.isNull(e.decimalPlacesRawValue)||(e.decimalPlacesRawValue<e.decimalPlaces&&n.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones to display [").concat(e.decimalPlaces,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlaces`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnFocus&&n.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown on focus [").concat(e.decimalPlacesShownOnFocus,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnFocus`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnBlur&&n.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown when unfocused [").concat(e.decimalPlacesShownOnBlur,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnBlur`."),e.showWarnings))}},{key:"areSettingsValid",value:function(e){var i=!0;try{this.validate(e,!0)}catch(r){i=!1}return i}},{key:"getDefaultConfig",value:function(){return a.defaultSettings}},{key:"getPredefinedOptions",value:function(){return a.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var i,r=this;return n.isUndefinedOrNullOrEmpty(e)||0===e.length?i=null:(i={},1===e.length&&Array.isArray(e[0])?e[0].forEach(function(m){re(i,r._getOptionObject(m))}):1<=e.length&&e.forEach(function(m){re(i,r._getOptionObject(m))})),i}},{key:"format",value:function(e){if(n.isUndefined(e)||null===e)return null;var i;i=n.isElement(e)?n.getElementValue(e):e,n.isString(i)||n.isNumber(i)||n.throwError('The value "'.concat(i,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var r=arguments.length,m=new Array(1<r?r-1:0),p=1;p<r;p++)m[p-1]=arguments[p];var s=this._generateOptionsObjectFromOptionsArray(m),C=re({},this.getDefaultConfig(),s);C.isNegativeSignAllowed=i<0,C.isPositiveSignAllowed=0<=i,this._setBrackets(C),this._cachesUsualRegularExpressions(C,{});var M=this._toNumericValue(i,C);return isNaN(Number(M))&&n.throwError("The value [".concat(M,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(M,C)||(n.triggerEvent(a.events.formatted,document,{oldValue:null,newValue:null,oldRawValue:null,newRawValue:null,isPristine:null,error:"Range test failed",aNElement:null},!0,!0),n.throwError("The value [".concat(M,"] being set falls outside of the minimumValue [").concat(C.minimumValue,"] and maximumValue [").concat(C.maximumValue,"] range set for this element"))),C.valuesToStrings&&this._checkValuesToStringsSettings(i,C)?C.valuesToStrings[i]:(this._correctNegativePositiveSignPlacementOption(C),this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===M||null===M||(M*=C.rawValueDivisor),M=this._roundFormattedValueShownOnFocus(M,C),M=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(M,C),M=this._addGroupSeparators(M,C,!1,M))}},{key:"formatAndSet",value:function(e,i){var m=this.format(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,m),m}},{key:"unformat",value:function(e){if(n.isNumberStrict(e))return e;var i;if(""===(i=n.isElement(e)?n.getElementValue(e):e))return"";if(n.isUndefined(i)||null===i)return null;(n.isArray(i)||n.isObject(i))&&n.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(i,"] given."));for(var r=arguments.length,m=new Array(1<r?r-1:0),p=1;p<r;p++)m[p-1]=arguments[p];var s=this._generateOptionsObjectFromOptionsArray(m),C=re({},this.getDefaultConfig(),s);if(C.isNegativeSignAllowed=!1,C.isPositiveSignAllowed=!0,i=i.toString(),C.valuesToStrings&&this._checkStringsToValuesSettings(i,C))return n.objectKeyLookup(C.valuesToStrings,i);if(n.isNegative(i,C.negativeSignCharacter))C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1;else if(!n.isNull(C.negativeBracketsTypeOnBlur)){var M=W(C.negativeBracketsTypeOnBlur.split(","),2);C.firstBracket=M[0],C.lastBracket=M[1],i.charAt(0)===C.firstBracket&&i.charAt(i.length-1)===C.lastBracket&&(C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1,i=this._removeBrackets(i,C,!1))}return i=this._convertToNumericString(i,C),new RegExp("[^+-0123456789.]","gi").test(i)?NaN:(this._correctNegativePositiveSignPlacementOption(C),C.originalDecimalPlacesRawValue=C.decimalPlacesRawValue?C.decimalPlacesRawValue:C.decimalPlaces,this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===i||null===i||(i/=C.rawValueDivisor),i=(i=this._roundRawValue(i,C)).replace(C.decimalCharacter,"."),i=this._toLocale(i,C.outputFormat,C))}},{key:"unformatAndSet",value:function(e,i){var m=this.unformat(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,m),m}},{key:"localize",value:function(e,i){var r,m,p=1<arguments.length&&void 0!==i?i:null;return""===(r=n.isElement(e)?n.getElementValue(e):e)?"":(n.isNull(p)&&(p=a.defaultSettings),r=this.unformat(r,p),0===Number(r)&&p.leadingZero!==a.options.leadingZero.keep&&(r="0"),m=n.isNull(p)?p.outputFormat:a.defaultSettings.outputFormat,this._toLocale(r,m,p))}},{key:"localizeAndSet",value:function(e,i){var m=this.localize(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,m),m}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var i=n.domElement(e);return this.isManagedByAutoNumeric(i)?this._getFromGlobalList(i):null}},{key:"set",value:function(e,i,r,m){var p,s=2<arguments.length&&void 0!==r?r:null,C=!(3<arguments.length&&void 0!==m)||m,M=n.domElement(e);return this.isManagedByAutoNumeric(M)?this.getAutoNumericElement(M).set(i,s,C):(p=!(!n.isNull(s)&&Object.prototype.hasOwnProperty.call(s,"showWarnings"))||s.showWarnings,n.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",p),null)}},{key:"getNumericString",value:function(e,i){return this._get(e,"getNumericString",1<arguments.length&&void 0!==i?i:null)}},{key:"getFormatted",value:function(e,i){return this._get(e,"getFormatted",1<arguments.length&&void 0!==i?i:null)}},{key:"getNumber",value:function(e,i){return this._get(e,"getNumber",1<arguments.length&&void 0!==i?i:null)}},{key:"_get",value:function(e,i,r){var m=2<arguments.length&&void 0!==r?r:null,p=n.domElement(e);return this.isManagedByAutoNumeric(p)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(p)[i](m)}},{key:"getLocalized",value:function(e,i,r){var m=1<arguments.length&&void 0!==i?i:null,p=2<arguments.length&&void 0!==r?r:null,s=n.domElement(e);return this.isManagedByAutoNumeric(s)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(s).getLocalized(m,p)}},{key:"_stripAllNonNumberCharacters",value:function(e,i,r,m){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,r,m).replace(i.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,i,r,m){var p=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(i.allowedAutoStrip,"")).match(i.numRegAutoStrip);if(e=p?[p[1],p[2],p[3]].join(""):"",i.leadingZero===a.options.leadingZero.allow||i.leadingZero===a.options.leadingZero.keep){var s="",C=W(e.split(i.decimalCharacter),2),q=C[1],v=C[0];n.contains(v,i.negativeSignCharacter)&&(s=i.negativeSignCharacter,v=v.replace(i.negativeSignCharacter,"")),""===s&&v.length>i.mIntPos&&"0"===v.charAt(0)&&(v=v.slice(1)),""!==s&&v.length>i.mIntNeg&&"0"===v.charAt(0)&&(v=v.slice(1)),e="".concat(s).concat(v).concat(n.isUndefined(q)?"":i.decimalCharacter+q)}return(r&&i.leadingZero===a.options.leadingZero.deny||!m&&i.leadingZero===a.options.leadingZero.allow)&&(e=e.replace(i.stripReg,"$1$2")),e}},{key:"_toggleNegativeBracket",value:function(e,i,r){return r?this._removeBrackets(e,i):this._addBrackets(e,i)}},{key:"_addBrackets",value:function(e,i){return n.isNull(i.negativeBracketsTypeOnBlur)?e:"".concat(i.firstBracket).concat(e.replace(i.negativeSignCharacter,"")).concat(i.lastBracket)}},{key:"_removeBrackets",value:function(e,i,r){var m,p=!(2<arguments.length&&void 0!==r)||r;return n.isNull(i.negativeBracketsTypeOnBlur)||e.charAt(0)!==i.firstBracket?e:(m=(m=e.replace(i.firstBracket,"")).replace(i.lastBracket,""),p?(m=m.replace(i.currencySymbol,""),this._mergeCurrencySignNegativePositiveSignAndValue(m,i,!0,!1)):"".concat(i.negativeSignCharacter).concat(m))}},{key:"_setBrackets",value:function(e){if(n.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var i=W(e.negativeBracketsTypeOnBlur.split(","),2),m=i[1];e.firstBracket=i[0],e.lastBracket=m}}},{key:"_convertToNumericString",value:function(e,i){e=this._removeBrackets(e,i,!1),e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(new RegExp("[".concat(i.digitGroupSeparator,"]"),"g"),""),"."!==i.decimalCharacter&&(e=e.replace(i.decimalCharacter,".")),n.isNegative(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-".concat(e)),i.showPositiveSign&&(e=e.replace(i.positiveSignCharacter,""));var m=n.arabicToLatinNumbers(e,i.leadingZero!==a.options.leadingZero.keep,!1,!1);return isNaN(m)||(e=m.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,i){return e=String(e),i.currencySymbol!==a.options.currencySymbol.none&&(e=e.replace(i.currencySymbol,"")),i.suffixText!==a.options.suffixText.none&&(e=e.replace(i.suffixText,"")),i.negativeSignCharacter!==a.options.negativeSignCharacter.hyphen&&(e=e.replace(i.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,i,r){if(n.isNull(i)||i===a.options.outputFormat.string)return e;var m;switch(i){case a.options.outputFormat.number:m=Number(e);break;case a.options.outputFormat.dotNegative:m=n.isNegative(e)?e.replace("-","")+"-":e;break;case a.options.outputFormat.comma:case a.options.outputFormat.negativeComma:m=e.replace(".",",");break;case a.options.outputFormat.commaNegative:m=e.replace(".",","),m=n.isNegative(m)?m.replace("-","")+"-":m;break;case a.options.outputFormat.dot:case a.options.outputFormat.negativeDot:m=e;break;default:n.throwError("The given outputFormat [".concat(i,"] option is not recognized."))}return i!==a.options.outputFormat.number&&"-"!==r.negativeSignCharacter&&(m=m.replace("-",r.negativeSignCharacter)),m}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,i){return"-"!==i.negativeSignCharacter&&(e=e.replace("-",i.negativeSignCharacter)),"."!==i.decimalCharacter&&(e=e.replace(".",i.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,i){return""===e||e===i.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(e,i,r){var m;if(i.emptyInputBehavior===a.options.emptyInputBehavior.always||r)switch(i.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.none:m=e+i.currencySymbol+i.suffixText;break;default:m=i.currencySymbol+e+i.suffixText}else m=e;return m}},{key:"_addGroupSeparators",value:function(e,i,r,m,p){var s,C=4<arguments.length&&void 0!==p?p:null;if(s=n.isNull(C)?n.isNegative(e,i.negativeSignCharacter)||n.isNegativeWithBrackets(e,i.firstBracket,i.lastBracket):C<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,!1,r),this._isElementValueEmptyOrOnlyTheNegativeSign(e,i))return this._orderValueCurrencySymbolAndSuffixText(e,i,!0);var M,q=n.isZeroOrHasNoValue(e);switch(s&&(e=e.replace("-","")),i.digitalGroupSpacing=i.digitalGroupSpacing.toString(),i.digitalGroupSpacing){case a.options.digitalGroupSpacing.two:M=/(\d)((\d)(\d{2}?)+)$/;break;case a.options.digitalGroupSpacing.twoScaled:M=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case a.options.digitalGroupSpacing.four:M=/(\d)((\d{4}?)+)$/;break;default:M=/(\d)((\d{3}?)+)$/}var v,Z=W(e.split(i.decimalCharacter),2),V=Z[0],B=Z[1];if(i.decimalCharacterAlternative&&n.isUndefined(B)){var j=W(e.split(i.decimalCharacterAlternative),2);V=j[0],B=j[1]}if(""!==i.digitGroupSeparator)for(;M.test(V);)V=V.replace(M,"$1".concat(i.digitGroupSeparator,"$2"));return e=0===(v=r?i.decimalPlacesShownOnFocus:i.decimalPlacesShownOnBlur)||n.isUndefined(B)?V:(B.length>v&&(B=B.substring(0,v)),"".concat(V).concat(i.decimalCharacter).concat(B)),e=a._mergeCurrencySignNegativePositiveSignAndValue(e,i,s,q),n.isNull(C)&&(C=m),null!==i.negativeBracketsTypeOnBlur&&(C<0||n.isNegativeStrict(e,i.negativeSignCharacter))&&(e=this._toggleNegativeBracket(e,i,r)),i.suffixText?"".concat(e).concat(i.suffixText):e}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(e,i,r,m){var p,s="";if(r?s=i.negativeSignCharacter:i.showPositiveSign&&!m&&(s=i.positiveSignCharacter),i.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix)if(i.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(r||!r&&i.showPositiveSign&&!m))switch(i.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:p="".concat(s).concat(i.currencySymbol).concat(e);break;case a.options.negativePositiveSignPlacement.right:p="".concat(i.currencySymbol).concat(s).concat(e);break;case a.options.negativePositiveSignPlacement.suffix:p="".concat(i.currencySymbol).concat(e).concat(s)}else p=i.currencySymbol+e;else if(i.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)if(i.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(r||!r&&i.showPositiveSign&&!m))switch(i.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:p="".concat(e).concat(i.currencySymbol).concat(s);break;case a.options.negativePositiveSignPlacement.left:p="".concat(e).concat(s).concat(i.currencySymbol);break;case a.options.negativePositiveSignPlacement.prefix:p="".concat(s).concat(e).concat(i.currencySymbol)}else p=e+i.currencySymbol;return p}},{key:"_truncateZeros",value:function(e,i){var r;switch(i){case 0:r=/(\.(?:\d*[1-9])?)0*$/;break;case 1:r=/(\.\d(?:\d*[1-9])?)0*$/;break;default:r=new RegExp("(\\.\\d{".concat(i,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(r,"$1"),0===i&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,i){return this._roundValue(e,i,i.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,i,r){return r?this._roundFormattedValueShownOnFocus(e,i):this._roundFormattedValueShownOnBlur(e,i)}},{key:"_roundValue",value:function(e,i,r){if(n.isNull(e))return e;if(e=""===e?"0":e.toString(),i.roundingMethod===a.options.roundingMethod.toNearest05||i.roundingMethod===a.options.roundingMethod.toNearest05Alt||i.roundingMethod===a.options.roundingMethod.upToNext05||i.roundingMethod===a.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,i);var m,p=W(a._prepareValueForRounding(e,i),2),s=p[0],C=(e=p[1]).lastIndexOf("."),M=-1===C,q=W(e.split("."),2),v=q[0];if(!(0<q[1]||i.allowDecimalPadding!==a.options.allowDecimalPadding.never&&i.allowDecimalPadding!==a.options.allowDecimalPadding.floats))return 0===Number(e)?v:"".concat(s).concat(v);m=i.allowDecimalPadding===a.options.allowDecimalPadding.always||i.allowDecimalPadding===a.options.allowDecimalPadding.floats?r:0;var Z,B=e.length-1-(M?e.length-1:C),j="";if(B<=r){if(j=e,B<m){M&&(j="".concat(j).concat(i.decimalCharacter));for(var z="000000";B<m;)j+=z=z.substring(0,m-B),B+=z.length}else m<B?j=this._truncateZeros(j,m):0===B&&0===m&&(j=j.replace(/\.$/,""));return 0===Number(j)?j:"".concat(s).concat(j)}Z=M?r-1:Number(r)+Number(C);var X,ne=Number(e.charAt(Z+1)),se=e.substring(0,Z+1).split("");if(X="."===e.charAt(Z)?e.charAt(Z-1)%2:e.charAt(Z)%2,this._shouldRoundUp(ne,i,s,X))for(var ae=se.length-1;0<=ae;--ae)if("."!==se[ae]){if(se[ae]=+se[ae]+1,se[ae]<10)break;0<ae&&(se[ae]="0")}return se=se.slice(0,Z+1),j=this._truncateZeros(se.join(""),m),0===Number(j)?j:"".concat(s).concat(j)}},{key:"_roundCloseTo05",value:function(e,i){switch(i.roundingMethod){case a.options.roundingMethod.toNearest05:case a.options.roundingMethod.toNearest05Alt:e=(Math.round(20*e)/20).toString();break;case a.options.roundingMethod.upToNext05:e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}return n.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,i){var r="";return n.isNegativeStrict(e,"-")&&(r="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),0===Number(e)&&(r=""),(0<Number(e)&&i.leadingZero!==a.options.leadingZero.keep||0<e.length&&i.leadingZero===a.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[r,e]}},{key:"_shouldRoundUp",value:function(e,i,r,m){return 4<e&&i.roundingMethod===a.options.roundingMethod.halfUpSymmetric||4<e&&i.roundingMethod===a.options.roundingMethod.halfUpAsymmetric&&""===r||5<e&&i.roundingMethod===a.options.roundingMethod.halfUpAsymmetric&&"-"===r||5<e&&i.roundingMethod===a.options.roundingMethod.halfDownSymmetric||5<e&&i.roundingMethod===a.options.roundingMethod.halfDownAsymmetric&&""===r||4<e&&i.roundingMethod===a.options.roundingMethod.halfDownAsymmetric&&"-"===r||5<e&&i.roundingMethod===a.options.roundingMethod.halfEvenBankersRounding||5===e&&i.roundingMethod===a.options.roundingMethod.halfEvenBankersRounding&&1===m||0<e&&i.roundingMethod===a.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===r||0<e&&i.roundingMethod===a.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===r||0<e&&i.roundingMethod===a.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,i,r,m){r&&(e=this._roundFormattedValueShownOnFocus(e,i));var p=W(e.split(i.decimalCharacter),2),s=p[0],C=p[1];if(C&&C.length>m)if(0<m){var M=C.substring(0,m);e="".concat(s).concat(i.decimalCharacter).concat(M)}else e=s;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,i){if(n.isNull(e)&&i.emptyInputBehavior===a.options.emptyInputBehavior.null||i.overrideMinMaxLimits===a.options.overrideMinMaxLimits.ignore||i.overrideMinMaxLimits===a.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var r,m=n.parseStr(i.minimumValue),p=n.parseStr(i.maximumValue),s=n.parseStr(e);switch(i.overrideMinMaxLimits){case a.options.overrideMinMaxLimits.floor:r=[-1<n.testMinMax(m,s),!0];break;case a.options.overrideMinMaxLimits.ceiling:r=[!0,n.testMinMax(p,s)<1];break;default:r=[-1<n.testMinMax(m,s),n.testMinMax(p,s)<1]}return r}},{key:"_isWithinRangeWithOverrideOption",value:function(e,i){var r=W(this._checkIfInRangeWithOverrideOption(e,i),2);return r[0]&&r[1]}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),n.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,i){return-1<n.testMinMax(n.parseStr(i.minimumValue),this._cleanValueForRangeParse(e))}},{key:"_isMaximumRangeRespected",value:function(e,i){return n.testMinMax(n.parseStr(i.maximumValue),this._cleanValueForRangeParse(e))<1}},{key:"_readCookie",value:function(e){for(var i=e+"=",r=document.cookie.split(";"),m="",p=0;p<r.length;p+=1){for(m=r[p];" "===m.charAt(0);)m=m.substring(1,m.length);if(0===m.indexOf(i))return m.substring(i.length,m.length)}return null}},{key:"_storageTest",value:function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(i){return!1}}},{key:"_correctNegativePositiveSignPlacementOption",value:function(e){if(n.isNull(e.negativePositiveSignPlacement))if(n.isUndefined(e)||!n.isUndefinedOrNullOrEmpty(e.negativePositiveSignPlacement)||n.isUndefinedOrNullOrEmpty(e.currencySymbol))e.negativePositiveSignPlacement=a.options.negativePositiveSignPlacement.left;else switch(e.currencySymbolPlacement){case a.options.currencySymbolPlacement.suffix:e.negativePositiveSignPlacement=a.options.negativePositiveSignPlacement.prefix;break;case a.options.currencySymbolPlacement.prefix:e.negativePositiveSignPlacement=a.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(e){return n.isNull(e)?null:(!n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=a.options.selectOnFocus.doNotSelect),n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&e.selectOnFocus===a.options.selectOnFocus.select&&(e.caretPositionOnFocus=a.options.caretPositionOnFocus.doNoForceCaretPosition),e)}},{key:"_calculateDecimalPlacesOnInit",value:function(e){this._validateDecimalPlacesRawValue(e),e.decimalPlacesShownOnFocus===a.options.decimalPlacesShownOnFocus.useDefault&&(e.decimalPlacesShownOnFocus=e.decimalPlaces),e.decimalPlacesShownOnBlur===a.options.decimalPlacesShownOnBlur.useDefault&&(e.decimalPlacesShownOnBlur=e.decimalPlaces),e.decimalPlacesRawValue===a.options.decimalPlacesRawValue.useDefault&&(e.decimalPlacesRawValue=e.decimalPlaces);var i=0;e.rawValueDivisor&&e.rawValueDivisor!==a.options.rawValueDivisor.none&&(i=String(e.rawValueDivisor).length-1)<0&&(i=0),e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+i,Number(e.originalDecimalPlacesRawValue)+i)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;this._validateDecimalPlacesRawValue(e),n.isNull(r)&&n.throwError("When updating the settings, the previous ones should be passed as an argument.");var m="decimalPlaces"in e;if(m||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){m?("decimalPlacesShownOnFocus"in e&&e.decimalPlacesShownOnFocus!==a.options.decimalPlacesShownOnFocus.useDefault||(e.decimalPlacesShownOnFocus=e.decimalPlaces),"decimalPlacesShownOnBlur"in e&&e.decimalPlacesShownOnBlur!==a.options.decimalPlacesShownOnBlur.useDefault||(e.decimalPlacesShownOnBlur=e.decimalPlaces),"decimalPlacesRawValue"in e&&e.decimalPlacesRawValue!==a.options.decimalPlacesRawValue.useDefault||(e.decimalPlacesRawValue=e.decimalPlaces)):(n.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=r.decimalPlacesShownOnFocus),n.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=r.decimalPlacesShownOnBlur));var p=0;e.rawValueDivisor&&e.rawValueDivisor!==a.options.rawValueDivisor.none&&(p=String(e.rawValueDivisor).length-1)<0&&(p=0),e.decimalPlacesRawValue=e.decimalPlaces||e.decimalPlacesRawValue?Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+p,Number(e.decimalPlacesRawValue)+p):Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+p,Number(r.originalDecimalPlacesRawValue)+p)}}},{key:"_cachesUsualRegularExpressions",value:function(e,i){var r;r=e.negativeSignCharacter!==a.options.negativeSignCharacter.hyphen?"([-\\".concat(e.negativeSignCharacter,"]?)"):"(-?)",i.aNegRegAutoStrip=r,e.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(e.decimalCharacter,"]"),"g"),e.numRegAutoStrip=new RegExp("".concat(r,"(?:\\").concat(e.decimalCharacter,"?([0-9]+\\").concat(e.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(e.decimalCharacter,"[0-9]*)?))")),e.stripReg=new RegExp("^".concat(i.aNegRegAutoStrip,"0*([0-9])")),e.formulaChars=new RegExp("[0-9".concat(e.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var i={aSep:"digitGroupSeparator",nSep:"showOnlyNumbersOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"decimalPlacesShownOnBlur",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",allowDecimalPadding:!0,alwaysAllowDecimalCharacter:!0,caretPositionOnFocus:!0,createLocalList:!0,currencySymbol:!0,currencySymbolPlacement:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,decimalPlaces:!0,decimalPlacesRawValue:!0,decimalPlacesShownOnBlur:!0,decimalPlacesShownOnFocus:!0,defaultValueOverride:!0,digitalGroupSpacing:!0,digitGroupSeparator:!0,divisorWhenUnfocused:!0,emptyInputBehavior:!0,eventBubbles:!0,eventIsCancelable:!0,failOnUnknownOption:!0,formatOnPageLoad:!0,formulaMode:!0,historySize:!0,isCancellable:!0,leadingZero:!0,maximumValue:!0,minimumValue:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,noEventListeners:!0,onInvalidPaste:!0,outputFormat:!0,overrideMinMaxLimits:!0,positiveSignCharacter:!0,rawValueDivisor:!0,readOnly:!0,roundingMethod:!0,saveValueToSessionStorage:!0,selectNumberOnly:!0,selectOnFocus:!0,serializeSpaces:!0,showOnlyNumbersOnFocus:!0,showPositiveSign:!0,showWarnings:!0,styleRules:!0,suffixText:!0,symbolWhenUnfocused:!0,unformatOnHover:!0,unformatOnSubmit:!0,valuesToStrings:!0,watchExternalChanges:!0,wheelOn:!0,wheelStep:!0,allowedAutoStrip:!0,formulaChars:!0,isNegativeSignAllowed:!0,isPositiveSignAllowed:!0,mIntNeg:!0,mIntPos:!0,numRegAutoStrip:!0,originalDecimalPlaces:!0,originalDecimalPlacesRawValue:!0,stripReg:!0};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(!0===i[r])continue;Object.prototype.hasOwnProperty.call(i,r)?(n.warning("You are using the deprecated option name '".concat(r,"'. Please use '").concat(i[r],"' instead from now on. The old option name will be dropped very soon\u2122."),!0),e[i[r]]=e[r],delete e[r]):e.failOnUnknownOption&&n.throwError("Option name '".concat(r,"' is unknown. Please fix the options passed to autoNumeric"))}"mDec"in e&&n.warning("The old `mDec` option has been deprecated in favor of more accurate options ; `decimalPlaces`, `decimalPlacesRawValue`, `decimalPlacesShownOnFocus` and `decimalPlacesShownOnBlur`.",!0)}},{key:"_setNegativePositiveSignPermissions",value:function(e){e.isNegativeSignAllowed=e.minimumValue<0,e.isPositiveSignAllowed=0<=e.maximumValue}},{key:"_toNumericValue",value:function(e,i){var r;return n.isNumber(Number(e))?r=n.scientificToDecimal(e):(r=this._convertToNumericString(e.toString(),i),n.isNumber(Number(r))||(n.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),i.showWarnings),r=NaN)),r}},{key:"_checkIfInRange",value:function(e,i,r){var m=n.parseStr(e);return-1<n.testMinMax(i,m)&&n.testMinMax(r,m)<1}},{key:"_shouldSkipEventKey",value:function(e){var i=n.isInArray(e,b.keyName._allFnKeys),r=e===b.keyName.OSLeft||e===b.keyName.OSRight,m=e===b.keyName.ContextMenu,p=n.isInArray(e,b.keyName._someNonPrintableKeys);return i||r||m||p||e===b.keyName.Unidentified||e===b.keyName.NumLock||e===b.keyName.ScrollLock||e===b.keyName.Insert||e===b.keyName.Command}},{key:"_serialize",value:function(e,i,r,m,p){var s,C=this,M=1<arguments.length&&void 0!==i&&i,q=2<arguments.length&&void 0!==r?r:"unformatted",v=3<arguments.length&&void 0!==m?m:"+",Z=4<arguments.length&&void 0!==p?p:null,V=[];return"object"===te(e)&&"form"===e.nodeName.toLowerCase()&&Array.prototype.slice.call(e.elements).forEach(function(B){if(B.name&&!B.disabled&&-1===["file","reset","submit","button"].indexOf(B.type))if("select-multiple"===B.type)Array.prototype.slice.call(B.options).forEach(function(ne){ne.selected&&V.push(M?{name:B.name,value:ne.value}:"".concat(encodeURIComponent(B.name),"=").concat(encodeURIComponent(ne.value)))});else if(-1===["checkbox","radio"].indexOf(B.type)||B.checked){var j,z;if(C.isManagedByAutoNumeric(B))switch(q){case"unformatted":z=C.getAutoNumericElement(B),n.isNull(z)||(j=C.unformat(B,z.getSettings()));break;case"localized":if(z=C.getAutoNumericElement(B),!n.isNull(z)){var X=n.cloneObject(z.getSettings());n.isNull(Z)||(X.outputFormat=Z),j=C.localize(B,X)}break;default:j=B.value}else j=B.value;n.isUndefined(j)&&n.throwError("This error should never be hit. If it has, something really wrong happened!"),V.push(M?{name:B.name,value:j}:"".concat(encodeURIComponent(B.name),"=").concat(encodeURIComponent(j)))}}),M?s=V:(s=V.join("&"),"+"===v&&(s=s.replace(/%20/g,"+"))),s}},{key:"_serializeNumericString",value:function(e,i){return this._serialize(e,!1,"unformatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeFormatted",value:function(e,i){return this._serialize(e,!1,"formatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeLocalized",value:function(e,i,r){return this._serialize(e,!1,"localized",1<arguments.length&&void 0!==i?i:"+",2<arguments.length&&void 0!==r?r:null)}},{key:"_serializeNumericStringArray",value:function(e,i){return this._serialize(e,!0,"unformatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeFormattedArray",value:function(e,i){return this._serialize(e,!0,"formatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeLocalizedArray",value:function(e,i,r){return this._serialize(e,!0,"localized",1<arguments.length&&void 0!==i?i:"+",2<arguments.length&&void 0!==r?r:null)}}],ce((c=a).prototype,[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=n.scientificToDecimal(this.domElement.getAttribute("value")),n.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,n.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this._onFocusInFunc=function(i){e._onFocusIn(i)},this._onFocusInAndMouseEnterFunc=function(i){e._onFocusInAndMouseEnter(i)},this._onFocusFunc=function(){e._onFocus()},this._onKeydownFunc=function(i){e._onKeydown(i)},this._onKeypressFunc=function(i){e._onKeypress(i)},this._onKeyupFunc=function(i){e._onKeyup(i)},this._onFocusOutAndMouseLeaveFunc=function(i){e._onFocusOutAndMouseLeave(i)},this._onPasteFunc=function(i){e._onPaste(i)},this._onWheelFunc=function(i){e._onWheel(i)},this._onDropFunc=function(i){e._onDrop(i)},this._onKeydownGlobalFunc=function(i){e._onKeydownGlobal(i)},this._onKeyupGlobalFunc=function(i){e._onKeyupGlobal(i)},this.domElement.addEventListener("focusin",this._onFocusInFunc,!1),this.domElement.addEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("focus",this._onFocusFunc,!1),this.domElement.addEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("keydown",this._onKeydownFunc,!1),this.domElement.addEventListener("keypress",this._onKeypressFunc,!1),this.domElement.addEventListener("keyup",this._onKeyupFunc,!1),this.domElement.addEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("paste",this._onPasteFunc,!1),this.domElement.addEventListener("wheel",this._onWheelFunc,!1),this.domElement.addEventListener("drop",this._onDropFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,a._doesGlobalListExists()||(document.addEventListener("keydown",this._onKeydownGlobalFunc,!1),document.addEventListener("keyup",this._onKeyupGlobalFunc,!1))}},{key:"_removeEventListeners",value:function(){this.domElement.removeEventListener("focusin",this._onFocusInFunc,!1),this.domElement.removeEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("focus",this._onFocusFunc,!1),this.domElement.removeEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("keydown",this._onKeydownFunc,!1),this.domElement.removeEventListener("keypress",this._onKeypressFunc,!1),this.domElement.removeEventListener("keyup",this._onKeyupFunc,!1),this.domElement.removeEventListener("paste",this._onPasteFunc,!1),this.domElement.removeEventListener("wheel",this._onWheelFunc,!1),this.domElement.removeEventListener("drop",this._onDropFunc,!1),this._removeFormListener(),this.hasEventListeners=!1,document.removeEventListener("keydown",this._onKeydownGlobalFunc,!1),document.removeEventListener("keyup",this._onKeyupGlobalFunc,!1)}},{key:"_updateEventListeners",value:function(){this.settings.noEventListeners||this.hasEventListeners||this._createEventListeners(),this.settings.noEventListeners&&this.hasEventListeners&&this._removeEventListeners()}},{key:"_setupFormListener",value:function(){var e=this;n.isNull(this.parentForm)||(this._onFormSubmitFunc=function(){e._onFormSubmit()},this._onFormResetFunc=function(){e._onFormReset()},this._hasParentFormCounter()?this._incrementParentFormCounter():(this._initializeFormCounterToOne(),this.parentForm.addEventListener("submit",this._onFormSubmitFunc,!1),this.parentForm.addEventListener("reset",this._onFormResetFunc,!1),this._storeFormHandlerFunction()))}},{key:"_removeFormListener",value:function(){if(!n.isNull(this.parentForm)){var e=this._getParentFormCounter();1===e?(this.parentForm.removeEventListener("submit",this._getFormHandlerFunction().submitFn,!1),this.parentForm.removeEventListener("reset",this._getFormHandlerFunction().resetFn,!1),this._removeFormDataSetInfo()):1<e?this._decrementParentFormCounter():n.throwError("The AutoNumeric object count on the form is incoherent.")}}},{key:"_hasParentFormCounter",value:function(){return"anCount"in this.parentForm.dataset}},{key:"_getParentFormCounter",value:function(){return Number(this.parentForm.dataset.anCount)}},{key:"_initializeFormCounterToOne",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(e){return"anFormHandler"in this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset}},{key:"_getFormElement",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?this.parentForm:i}},{key:"_storeFormHandlerFunction",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var r=n.randomString();this._getFormElement(i).dataset.anFormHandler=r,window.aNFormHandlerMap.set(r,{submitFn:this._onFormSubmitFunc,resetFn:this._onFormResetFunc})}},{key:"_getFormHandlerKey",value:function(){this._hasFormHandlerFunction()||n.throwError("Unable to retrieve the form handler name");var e=this.parentForm.dataset.anFormHandler;return""===e&&n.throwError("The form handler name is invalid"),e}},{key:"_getFormHandlerFunction",value:function(){var e=this._getFormHandlerKey();return window.aNFormHandlerMap.get(e)}},{key:"_removeFormDataSetInfo",value:function(){this._decrementParentFormCounter(),window.aNFormHandlerMap.delete(this._getFormHandlerKey()),this.parentForm.removeAttribute("data-an-count"),this.parentForm.removeAttribute("data-an-form-handler")}},{key:"_setWritePermissions",value:function(e){0<arguments.length&&void 0!==e&&e&&this.domElement.readOnly||this.settings.readOnly?this._setReadOnly():this._setReadWrite()}},{key:"_setReadOnly",value:function(){this.isInputElement?this.domElement.readOnly=!0:this.domElement.setAttribute("contenteditable",!1)}},{key:"_setReadWrite",value:function(){this.isInputElement?this.domElement.readOnly=!1:this.domElement.setAttribute("contenteditable",!0)}},{key:"_addWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,r=i.set,m=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return m.call(e.domElement)},set:function(p){r.call(e.domElement,p),e.settings.watchExternalChanges&&!e.internalModification&&e.set(p)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,r=i.set,m=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return m.call(e.domElement)},set:function(p){r.call(e.domElement,p)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var i=this.domElement.nodeType;i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":i===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=0===this.historyTable.length;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var i=!0;if(!e){var r=this.historyTableIndex+1;r<this.historyTable.length&&this.rawValue===this.historyTable[r].value?i=!1:n.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,i){var m=n.getElementSelection(this.domElement);this.selectionStart=m.start,this.selectionEnd=m.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),1<this.historyTable.length&&(this.historyTable[this.historyTableIndex-1].start=this.selectionStart,this.historyTable[this.historyTableIndex-1].end=this.selectionEnd)}this.historyTable.length>this.settings.historySize&&this._historyTableForget()}}},{key:"_historyTableUndoOrRedo",value:function(e){var i;if(0<arguments.length&&void 0!==e&&!e?(i=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(i=0<this.historyTableIndex)&&this.historyTableIndex--,i){var r=this.historyTable[this.historyTableIndex];this.set(r.value,null,!1),n.setElementSelection(this.domElement,r.start,r.end)}}},{key:"_historyTableUndo",value:function(){this._historyTableUndoOrRedo(!0)}},{key:"_historyTableRedo",value:function(){this._historyTableUndoOrRedo(!1)}},{key:"_historyTableForget",value:function(e){for(var i=0<arguments.length&&void 0!==e?e:1,r=[],m=0;m<i;m++)r.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return 1===r.length?r[0]:r}},{key:"_historyTableCurrentValueUsed",value:function(){var e=this.historyTableIndex;return e<0&&(e=0),n.isUndefinedOrNullOrEmpty(this.historyTable[e])?"":this.historyTable[e].value}},{key:"_parseStyleRules",value:function(){var e=this;n.isUndefinedOrNullOrEmpty(this.settings.styleRules)||""===this.rawValue||(n.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)||(0<=this.rawValue?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||0===this.settings.styleRules.ranges.length||this.settings.styleRules.ranges.forEach(function(i){e.rawValue>=i.min&&e.rawValue<i.max?e._addCSSClass(i.class):e._removeCSSClass(i.class)}),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||0===this.settings.styleRules.userDefined.length||this.settings.styleRules.userDefined.forEach(function(i){if(n.isFunction(i.callback))if(n.isString(i.classes))i.callback(e.rawValue)?e._addCSSClass(i.classes):e._removeCSSClass(i.classes);else if(n.isArray(i.classes))if(2===i.classes.length)i.callback(e.rawValue)?(e._addCSSClass(i.classes[0]),e._removeCSSClass(i.classes[1])):(e._removeCSSClass(i.classes[0]),e._addCSSClass(i.classes[1]));else if(2<i.classes.length){var r=i.callback(e.rawValue);n.isArray(r)?i.classes.forEach(function(m,p){n.isInArray(p,r)?e._addCSSClass(m):e._removeCSSClass(m)}):n.isInt(r)?i.classes.forEach(function(m,p){p===r?e._addCSSClass(m):e._removeCSSClass(m)}):n.isNull(r)?i.classes.forEach(function(m){e._removeCSSClass(m)}):n.throwError("The callback result is not an array nor a valid array index, ".concat(te(r)," given."))}else n.throwError("The classes attribute is not valid for the `styleRules` option.");else n.isUndefinedOrNullOrEmpty(i.classes)?i.callback(e):n.throwError("The callback/classes structure is not valid for the `styleRules` option.");else n.warning("The given `styleRules` callback is not a function, ".concat("undefined"==typeof callback?"undefined":te(callback)," given."),e.settings.showWarnings)}))}},{key:"_addCSSClass",value:function(e){this.domElement.classList.add(e)}},{key:"_removeCSSClass",value:function(e){this.domElement.classList.remove(e)}},{key:"update",value:function(){for(var e=this,i=arguments.length,r=new Array(i),m=0;m<i;m++)r[m]=arguments[m];Array.isArray(r)&&Array.isArray(r[0])&&(r=r[0]);var p=n.cloneObject(this.settings),s=this.rawValue,C={};n.isUndefinedOrNullOrEmpty(r)||0===r.length?C=null:1<=r.length&&r.forEach(function(M){e.constructor._isPreDefinedOptionValid(M)&&(M=e.constructor._getOptionObject(M)),re(C,M)});try{this._setSettings(C,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(s)}catch(M){return this._setSettings(p,!0),n.throwError("Unable to update the settings, those are invalid: [".concat(M,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e,i,r){var m,p=1<arguments.length&&void 0!==i?i:null,s=!(2<arguments.length&&void 0!==r)||r;if(n.isUndefined(e))return n.warning("You are trying to set an 'undefined' value ; an error could have occurred.",this.settings.showWarnings),this;if(n.isNull(p)||this._setSettings(p,!0),null===e&&this.settings.emptyInputBehavior!==a.options.emptyInputBehavior.null)return n.warning("You are trying to set the `null` value while the `emptyInputBehavior` option is set to ".concat(this.settings.emptyInputBehavior,". If you want to be able to set the `null` value, you need to change the 'emptyInputBehavior' option to `'null'`."),this.settings.showWarnings),this;if(null===e)return this._setElementAndRawValue(null,null,s),this._saveValueToPersistentStorage(),this;if(m=this.constructor._toNumericValue(e,this.settings),isNaN(Number(m)))return n.warning("The value you are trying to set results in `NaN`. The element value is set to the empty string instead.",this.settings.showWarnings),this.setValue("",s),this;if(""===m)switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.zero:m=0;break;case a.options.emptyInputBehavior.min:m=this.settings.minimumValue;break;case a.options.emptyInputBehavior.max:m=this.settings.maximumValue;break;default:n.isNumber(this.settings.emptyInputBehavior)&&(m=Number(this.settings.emptyInputBehavior))}if(""===m)return this._setElementAndRawValue(this.settings.emptyInputBehavior===a.options.emptyInputBehavior.always?this.settings.currencySymbol:"","",s),this;var M=W(this.constructor._checkIfInRangeWithOverrideOption(m,this.settings),2),q=M[0],v=M[1];if(q&&v&&this.settings.valuesToStrings&&this._checkValuesToStrings(m))return this._setElementAndRawValue(this.settings.valuesToStrings[m],m,s),this._saveValueToPersistentStorage(),this;if(n.isZeroOrHasNoValue(m)&&(m="0"),q&&v){var Z=this.constructor._roundRawValue(m,this.settings);return Z=this._trimLeadingAndTrailingZeros(Z.replace(this.settings.decimalCharacter,".")),m=this._getRawValueToFormat(m),m=this.isFocused?this.constructor._roundFormattedValueShownOnFocus(m,this.settings):(this.settings.divisorWhenUnfocused&&(m=(m/=this.settings.divisorWhenUnfocused).toString()),this.constructor._roundFormattedValueShownOnBlur(m,this.settings)),m=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(m,this.settings),m=this.constructor._addGroupSeparators(m,this.settings,this.isFocused,this.rawValue,Z),!this.isFocused&&this.settings.symbolWhenUnfocused&&(m="".concat(m).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(m,Z,s),this._setValidOrInvalidState(Z),this}return this._triggerRangeEvents(q,v),n.throwError("The value [".concat(m,"] being set falls outside of the minimumValue [").concat(this.settings.minimumValue,"] and maximumValue [").concat(this.settings.maximumValue,"] range set for this element")),this._removeValueFromPersistentStorage(),this.setValue("",s),this}},{key:"setUnformatted",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;if(null===e||n.isUndefined(e))return this;n.isNull(r)||this._setSettings(r,!0);var m=this.constructor._removeBrackets(e,this.settings),p=this.constructor._stripAllNonNumberCharacters(m,this.settings,!0,this.isFocused);return n.isNumber(p)||n.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(p,this.settings)?this.setValue(e):n.throwError("The value is out of the range limits [".concat(this.settings.minimumValue,", ").concat(this.settings.maximumValue,"].")),this}},{key:"setValue",value:function(e,i){return this._setElementAndRawValue(e,!(1<arguments.length&&void 0!==i)||i),this}},{key:"_setRawValue",value:function(e,i){var r=!(1<arguments.length&&void 0!==i)||i;if(this.rawValue!==e){var m=this.rawValue;this.rawValue=e,!n.isNull(this.settings.rawValueDivisor)&&0!==this.settings.rawValueDivisor&&""!==e&&null!==e&&this._isUserManuallyEditingTheValue()&&(this.rawValue/=this.settings.rawValueDivisor),this._triggerEvent(a.events.rawValueModified,this.domElement,{oldRawValue:m,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),r&&this._historyTableAdd()}}},{key:"_setElementValue",value:function(e,i){var r=!(1<arguments.length&&void 0!==i)||i,m=n.getElementValue(this.domElement);return e!==m&&(this.internalModification=!0,n.setElementValue(this.domElement,e),this.internalModification=!1,r&&this._triggerEvent(a.events.formatted,this.domElement,{oldValue:m,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e,i,r){var m=1<arguments.length&&void 0!==i?i:null,p=!(2<arguments.length&&void 0!==r)||r;return n.isNull(m)?m=e:n.isBoolean(m)&&(p=m,m=e),this._setElementValue(e),this._setRawValue(m,p),this}},{key:"_getRawValueToFormat",value:function(e){return n.isNull(this.settings.rawValueDivisor)||0===this.settings.rawValueDivisor||""===e||null===e?e:e*this.settings.rawValueDivisor}},{key:"_checkValuesToStrings",value:function(e){return this.constructor._checkValuesToStringsArray(e,this.valuesToStringsKeys)}},{key:"_isUserManuallyEditingTheValue",value:function(){return this.isFocused&&this.isEditing||this.isDropEvent}},{key:"_executeCallback",value:function(e,i){!n.isNull(i)&&n.isFunction(i)&&i(e,this)}},{key:"_triggerEvent",value:function(e,i,r){var m=1<arguments.length&&void 0!==i?i:document;n.triggerEvent(e,m,2<arguments.length&&void 0!==r?r:null,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(e){return this.getNumericString(0<arguments.length&&void 0!==e?e:null)}},{key:"getNumericString",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(this.rawValue)?null:n.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(i,r),i}},{key:"getFormatted",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;"value"in this.domElement||"textContent"in this.domElement||n.throwError("Unable to get the formatted string from the element.");var r=n.getElementValue(this.domElement);return this._executeCallback(r,i),r}},{key:"getNumber",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(i,r),i}},{key:"getLocalized",value:function(e,i){var r,m,p=0<arguments.length&&void 0!==e?e:null,s=1<arguments.length&&void 0!==i?i:null;n.isFunction(p)&&n.isNull(s)&&(s=p,p=null),(r=n.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(r)&&this.settings.leadingZero!==a.options.leadingZero.keep&&(r="0"),m=n.isNull(p)?this.settings.outputFormat:p;var C=this.constructor._toLocale(r,m,this.settings);return this._executeCallback(C,s),C}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(e){return this._setElementValue(this.getLocalized(0<arguments.length&&void 0!==e?e:null)),this}},{key:"isPristine",value:function(e){return 0<arguments.length&&void 0!==e&&!e?this.initialValueHtmlAttribute===this.getFormatted():this.initialValue===this.getNumericString()}},{key:"select",value:function(){return this.settings.selectNumberOnly?this.selectNumber():this._defaultSelectAll(),this}},{key:"_defaultSelectAll",value:function(){n.setElementSelection(this.domElement,0,n.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,i,r=n.getElementValue(this.domElement),m=r.length,p=this.settings.currencySymbol.length,s=this.settings.currencySymbolPlacement,C=n.isNegative(r,this.settings.negativeSignCharacter)?1:0,M=this.settings.suffixText.length;if(e=s===a.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left&&1==C&&0<p?p+1:p,s===a.options.currencySymbolPlacement.prefix)i=m-M;else switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.left:i=m-(M+p);break;case a.options.negativePositiveSignPlacement.right:i=0<p?m-(p+C+M):m-(p+M);break;default:i=m-(p+M)}return n.setElementSelection(this.domElement,e,i),this}},{key:"selectInteger",value:function(){var e=0,i=0<=this.rawValue;this.settings.currencySymbolPlacement!==a.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==a.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&i||!i&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left)&&(e+=1),this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&(e+=this.settings.currencySymbol.length);var r=n.getElementValue(this.domElement),m=r.indexOf(this.settings.decimalCharacter);return-1===m&&(m=this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?r.length-this.settings.currencySymbol.length:r.length,i||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==a.options.currencySymbolPlacement.suffix||--m,m-=this.settings.suffixText.length),n.setElementSelection(this.domElement,e,m),this}},{key:"selectDecimal",value:function(){var e,r=n.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return e=-1===r?r=0:(r+=1)+Number(this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur),n.setElementSelection(this.domElement,r,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(r)?this.domElement:r.node(),this._removeFromLocalList(i),this}},{key:"attach",value:function(e,i){var r=!(1<arguments.length&&void 0!==i)||i;return this._addToLocalList(e.node()),r&&e.update(this.settings),this}},{key:"formatOther",value:function(e,i){return this._formatOrUnformatOther(!0,e,1<arguments.length&&void 0!==i?i:null)}},{key:"unformatOther",value:function(e,i){return this._formatOrUnformatOther(!1,e,1<arguments.length&&void 0!==i?i:null)}},{key:"_formatOrUnformatOther",value:function(e,i,r){var m,p,s=2<arguments.length&&void 0!==r?r:null;if(m=n.isNull(s)?this.settings:this._cloneAndMergeSettings(s),n.isElement(i)){var C=n.getElementValue(i);return p=e?a.format(C,m):a.unformat(C,m),n.setElementValue(i,p),null}return e?a.format(i,m):a.unformat(i,m)}},{key:"init",value:function(e,i){var r=this,m=!(1<arguments.length&&void 0!==i)||i,p=!1,s=[];if(n.isString(e)?s=G(document.querySelectorAll(e)):n.isElement(e)?(s.push(e),p=!0):n.isArray(e)?s=e:n.throwError("The given parameters to the 'init' function are invalid."),0===s.length)return n.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var C=this._getLocalList(),M=[];return s.forEach(function(q){var v=r.settings.createLocalList;m&&(r.settings.createLocalList=!1);var Z=new a(q,n.getElementValue(q),r.settings);m&&(Z._setLocalList(C),r._addToLocalList(q,Z),r.settings.createLocalList=v),M.push(Z)}),p?M[0]:M}},{key:"clear",value:function(e){return 0<arguments.length&&void 0!==e&&e?this.set("",{emptyInputBehavior:a.options.emptyInputBehavior.focus}):this.set(""),this}},{key:"remove",value:function(){this._removeValueFromPersistentStorage(),this._removeEventListeners(),this._removeWatcher(),this._removeFromLocalList(this.domElement),this.constructor._removeFromGlobalList(this)}},{key:"wipe",value:function(){this._setElementValue("",!1),this.remove()}},{key:"nuke",value:function(){this.remove(),this.domElement.parentNode.removeChild(this.domElement)}},{key:"form",value:function(e){if(0<arguments.length&&void 0!==e&&e||n.isUndefinedOrNullOrEmpty(this.parentForm)){var i=this._getParentForm();if(!n.isNull(i)&&i!==this.parentForm){var r=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=r.length,this._hasFormHandlerFunction(i)?this._incrementParentFormCounter(i):(this._storeFormHandlerFunction(i),this._initializeFormCounterToOne(i))}this.parentForm=i}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var i=this;return G(e.querySelectorAll("input")).filter(function(r){return i.constructor.isManagedByAutoNumeric(r)})}},{key:"_getParentForm",value:function(){if("body"===this.domElement.tagName.toLowerCase())return null;var e,i=this.domElement;do{if(n.isNull(i=i.parentNode))return null;if("body"===(e=i.tagName?i.tagName.toLowerCase():""))break}while("form"!==e);return"form"===e?i:null}},{key:"formNumericString",value:function(){return this.constructor._serializeNumericString(this.form(),this.settings.serializeSpaces)}},{key:"formFormatted",value:function(){return this.constructor._serializeFormatted(this.form(),this.settings.serializeSpaces)}},{key:"formLocalized",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(r)?this.settings.outputFormat:r,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,i)}},{key:"formArrayNumericString",value:function(){return this.constructor._serializeNumericStringArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayFormatted",value:function(){return this.constructor._serializeFormattedArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayLocalized",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(r)?this.settings.outputFormat:r,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,i)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(e){return JSON.stringify(this.formArrayLocalized(0<arguments.length&&void 0!==e?e:null))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){a.getAutoNumericElement(e).unformat()}),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){a.getAutoNumericElement(e).unformatLocalized()}),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){a.getAutoNumericElement(e).reformat()}),this}},{key:"formSubmitNumericString",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?(this.formUnformat(),this.form().submit(),this.formReformat()):n.isFunction(i)?i(this.formNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?this.form().submit():n.isFunction(i)?i(this.formFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(e,i){var r=0<arguments.length&&void 0!==e?e:null,m=1<arguments.length&&void 0!==i?i:null;return n.isNull(m)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):n.isFunction(m)?m(this.formLocalized(r)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayNumericString",value:function(e){return n.isFunction(e)?e(this.formArrayNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayFormatted",value:function(e){return n.isFunction(e)?e(this.formArrayFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayLocalized",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;return n.isFunction(e)?e(this.formArrayLocalized(r)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonNumericString",value:function(e){return n.isFunction(e)?e(this.formJsonNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonFormatted",value:function(e){return n.isFunction(e)?e(this.formJsonFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonLocalized",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;return n.isFunction(e)?e(this.formJsonLocalized(r)):n.throwError("The given callback is not a function."),this}},{key:"_createLocalList",value:function(){this.autoNumericLocalList=new Map,this._addToLocalList(this.domElement)}},{key:"_deleteLocalList",value:function(){delete this.autoNumericLocalList}},{key:"_setLocalList",value:function(e){this.autoNumericLocalList=e}},{key:"_getLocalList",value:function(){return this.autoNumericLocalList}},{key:"_hasLocalList",value:function(){return this.autoNumericLocalList instanceof Map&&0!==this.autoNumericLocalList.size}},{key:"_addToLocalList",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;n.isNull(r)&&(r=this),n.isUndefined(this.autoNumericLocalList)?n.throwError("The local list provided does not exists when trying to add an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.set(e,r)}},{key:"_removeFromLocalList",value:function(e){n.isUndefined(this.autoNumericLocalList)?this.settings.createLocalList&&n.throwError("The local list provided does not exists when trying to remove an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.delete(e)}},{key:"_mergeSettings",value:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];re.apply(void 0,[this.settings].concat(i))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},i=arguments.length,r=new Array(i),m=0;m<i;m++)r[m]=arguments[m];return re.apply(void 0,[e,this.settings].concat(r)),e}},{key:"_updatePredefinedOptions",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;return n.isNull(r)?this.update(e):(this._mergeSettings(e,r),this.update(this.settings)),this}},{key:"french",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().French,i),this}},{key:"northAmerican",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().NorthAmerican,i),this}},{key:"british",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().British,i),this}},{key:"swiss",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Swiss,i),this}},{key:"japanese",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Japanese,i),this}},{key:"spanish",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Spanish,i),this}},{key:"chinese",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Chinese,i),this}},{key:"brazilian",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Brazilian,i),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];if("function"==typeof i)this.settings[e]=i(this,e);else{var r=this.domElement.getAttribute(e);r=n.camelize(r),"function"==typeof this.settings[r]&&(this.settings[e]=r(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.right)}},{key:"_modifyNegativeSignAndDecimalCharacterForRawValue",value:function(e){return"."!==this.settings.decimalCharacter&&(e=e.replace(this.settings.decimalCharacter,".")),"-"!==this.settings.negativeSignCharacter&&this.settings.isNegativeSignAllowed&&(e=e.replace(this.settings.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}},{key:"_initialCaretPosition",value:function(e){n.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===a.options.selectOnFocus.doNotSelect&&n.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var i=this.rawValue<0,r=n.isZeroOrHasNoValue(e),m=e.length,p=0,s=0,C=!1,M=0;this.settings.caretPositionOnFocus!==a.options.caretPositionOnFocus.start&&(p=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,C=n.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==a.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==a.options.caretPositionOnFocus.decimalRight||(M=C?(s=e.indexOf(this.settings.decimalCharacter),this.settings.decimalCharacter.length):(s=p,0)));var q="";i?q=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!r&&(q=this.settings.positiveSignCharacter);var v,Z=q.length,V=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:v=Z+V;break;case a.options.negativePositiveSignPlacement.suffix:v=V}else v=V;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:v=m;break;case a.options.negativePositiveSignPlacement.suffix:v=V+p}else v=m;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:v=Z+V+s;break;case a.options.negativePositiveSignPlacement.suffix:v=V+s}else v=V+s;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:v=Z+V+s+M;break;case a.options.negativePositiveSignPlacement.suffix:v=V+s+M}else v=V+s+M}else if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:v=0;break;case a.options.negativePositiveSignPlacement.prefix:v=Z}else v=0;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:v=p;break;case a.options.negativePositiveSignPlacement.prefix:v=Z+p}else v=p;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:v=s;break;case a.options.negativePositiveSignPlacement.prefix:v=Z+s}else v=s;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:v=s+M;break;case a.options.negativePositiveSignPlacement.prefix:v=Z+s+M}else v=s+M;return v}},{key:"_triggerRangeEvents",value:function(e,i){e||this._triggerEvent(a.events.minRangeExceeded,this.domElement),i||this._triggerEvent(a.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?n.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(a.events.invalidValue,this.domElement),this.validState=!1}},{key:"_setValidState",value:function(){this.isInputElement?n.setValidState(this.domElement):this._removeCSSClass(this.settings.invalidClass),this.validState||this._triggerEvent(a.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(e){if(this.settings.overrideMinMaxLimits===a.options.overrideMinMaxLimits.invalid){var i=this.constructor._isMinimumRangeRespected(e,this.settings),r=this.constructor._isMaximumRangeRespected(e,this.settings);i&&r?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(i,r)}}},{key:"_keepAnOriginalSettingsCopy",value:function(){this.originalDigitGroupSeparator=this.settings.digitGroupSeparator,this.originalCurrencySymbol=this.settings.currencySymbol,this.originalSuffixText=this.settings.suffixText}},{key:"_trimLeadingAndTrailingZeros",value:function(e){if(""===e||null===e)return e;if(this.settings.leadingZero!==a.options.leadingZero.keep){if(0===Number(e))return"0";e=e.replace(/^(-)?0+(?=\d)/g,"$1")}return n.contains(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1")),e.replace(/\.$/,"")}},{key:"_setPersistentStorageName",value:function(){this.settings.saveValueToSessionStorage&&(this.rawValueStorageName=""===this.domElement.name||n.isUndefined(this.domElement.name)?"".concat(this.storageNamePrefix).concat(this.domElement.id):"".concat(this.storageNamePrefix).concat(decodeURIComponent(this.domElement.name)))}},{key:"_saveValueToPersistentStorage",value:function(){this.settings.saveValueToSessionStorage&&(this.sessionStorageAvailable?sessionStorage.setItem(this.rawValueStorageName,this.rawValue):document.cookie="".concat(this.rawValueStorageName,"=").concat(this.rawValue,"; expires= ; path=/"))}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?this.sessionStorageAvailable?sessionStorage.getItem(this.rawValueStorageName):this.constructor._readCookie(this.rawValueStorageName):(n.warning("`_getValueFromPersistentStorage()` is called but `settings.saveValueToSessionStorage` is false. There must be an error that needs fixing.",this.settings.showWarnings),null)}},{key:"_removeValueFromPersistentStorage",value:function(){if(this.settings.saveValueToSessionStorage)if(this.sessionStorageAvailable)sessionStorage.removeItem(this.rawValueStorageName);else{var e=new Date;e.setTime(e.getTime()-864e5);var i="; expires=".concat(e.toUTCString());document.cookie="".concat(this.rawValueStorageName,"='' ;").concat(i,"; path=/")}}},{key:"_getDefaultValue",value:function(e){var i=e.getAttribute("value");return n.isNull(i)?"":i}},{key:"_onFocusInAndMouseEnter",value:function(e){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&"mouseenter"===e.type&&e.altKey)this.constructor._unformatAltHovered(this);else if("focus"===e.type&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),"focus"===e.type&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),"focus"===e.type||"mouseenter"===e.type&&!this.isFocused){var i=null;this.settings.emptyInputBehavior===a.options.emptyInputBehavior.focus&&this.rawValue<0&&null!==this.settings.negativeBracketsTypeOnBlur&&this.settings.isNegativeSignAllowed&&(i=this.constructor._removeBrackets(n.getElementValue(this.domElement),this.settings));var r=this._getRawValueToFormat(this.rawValue);if(""!==r){var m=this.constructor._roundFormattedValueShownOnFocusOrBlur(r,this.settings,this.isFocused);i=this.settings.showOnlyNumbersOnFocus===a.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",m.replace(".",this.settings.decimalCharacter)):n.isNull(m)?"":this.constructor._addGroupSeparators(m.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,r)}this.valueOnFocus=n.isNull(i)?"":i,this.lastVal=this.valueOnFocus;var p=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),s=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),C=p&&""!==s&&this.settings.emptyInputBehavior===a.options.emptyInputBehavior.focus;C&&(i=s),n.isNull(i)||this._setElementValue(i),C&&s===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&n.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():n.isNull(this.settings.caretPositionOnFocus)||n.setElementSelection(e.target,this._initialCaretPosition(n.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,n.setElementValue(this.domElement,"="),n.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,i=n.getElementValue(this.domElement);i=i.replace(/^\s*=/,"");try{var r=new U(i,this.settings.decimalCharacter);e=(new f).evaluate(r)}catch(m){return this._triggerEvent(a.events.invalidFormula,this.domElement,{formula:i,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(a.events.validFormula,this.domElement,{formula:i,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===b.keyName.Backspace||this.eventKey===b.keyName.Delete||this.eventKey===b.keyName.LeftArrow||this.eventKey===b.keyName.RightArrow||this.eventKey===b.keyName.Home||this.eventKey===b.keyName.End}},{key:"_onKeydown",value:function(e){if(this.formatted=!1,this.isEditing=!0,this.formulaMode||this.isFocused||!this.settings.unformatOnHover||!e.altKey||this.domElement!==n.getHoveredElement()){if(this._updateEventKeyInfo(e),this.keydownEventCounter+=1,1===this.keydownEventCounter&&(this.initialValueOnFirstKeydown=n.getElementValue(e.target),this.initialRawValueOnFirstKeydown=this.rawValue),this.formulaMode){if(this.eventKey===b.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===b.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else if(this.eventKey===b.keyName.Equal)return void this._enterFormulaMode();if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===b.keyName.Esc&&(e.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(a.events.native.input,e.target)),this.select());var i=n.getElementValue(e.target);if(this.eventKey===b.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(a.events.native.change,e.target),this.valueOnFocus=i,this.rawValueOnFocus=this.rawValue,this.settings.isCancellable&&this._saveCancellableValue()),this._updateInternalProperties(e),this._processNonPrintableKeysAndShortcuts(e))this.processed=!0;else if(this.eventKey===b.keyName.Backspace||this.eventKey===b.keyName.Delete){var r=this._processCharacterDeletion();if(this.processed=!0,!r)return void e.preventDefault();this._formatValue(e),(i=n.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(a.events.native.input,e.target),e.preventDefault()),this.lastVal=i,this.throwInput=!0}}}else this.constructor._unformatAltHovered(this)}},{key:"_onKeypress",value:function(e){if(this.formulaMode){if(this._acceptNonPrintableKeysInFormulaMode()||this.settings.formulaChars.test(this.eventKey))return;e.preventDefault()}else if(this.eventKey!==b.keyName.Insert){var i=this.processed;if(this._updateInternalProperties(e),!this._processNonPrintableKeysAndShortcuts(e))if(i)e.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(e);var r=n.getElementValue(e.target);if(r!==this.lastVal&&this.throwInput)this._triggerEvent(a.events.native.input,e.target),e.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&n.getElementSelection(e.target).start===n.getElementSelection(e.target).end&&n.getElementSelection(e.target).start===r.indexOf(this.settings.decimalCharacter)){var m=n.getElementSelection(e.target).start+1;n.setElementSelection(e.target,m)}e.preventDefault()}return this.lastVal=n.getElementValue(e.target),this.throwInput=!0,void this._setValidOrInvalidState(this.rawValue)}e.preventDefault()}}}},{key:"_onKeyup",value:function(e){if(this.isEditing=!1,this.keydownEventCounter=0,!this.formulaMode)if(this.settings.isCancellable&&this.eventKey===b.keyName.Esc)e.preventDefault();else{if(this.eventKey===b.keyName.Z||this.eventKey===b.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),void this._historyTableUndo();this.onGoingRedo=!1}}if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&this.eventKey===b.keyName.x){var i=n.getElementSelection(this.domElement).start,r=this.constructor._toNumericValue(n.getElementValue(e.target),this.settings);this.set(r),this._setCaretPosition(i)}if(this.eventKey===b.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==b.keyName.Backspace&&this.eventKey!==b.keyName.Delete){this._updateInternalProperties(e);var m=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var p=n.getElementValue(e.target);if(!(m||""===p&&""===this.initialValueOnFirstKeydown)&&(p===this.settings.currencySymbol?n.setElementSelection(e.target,this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?0:this.settings.currencySymbol.length):this.eventKey===b.keyName.Tab&&n.setElementSelection(e.target,0,p.length),(p===this.settings.suffixText||""===this.rawValue&&""!==this.settings.currencySymbol&&""!==this.settings.suffixText)&&n.setElementSelection(e.target,0),null!==this.settings.decimalPlacesShownOnFocus&&this._saveValueToPersistentStorage(),this.formatted||this._formatValue(e),this._setValidOrInvalidState(this.rawValue),this._saveRawValueForAndroid(),p!==this.initialValueOnFirstKeydown&&this._triggerEvent(a.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:p,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),1<this.historyTable.length)){var s=n.getElementSelection(this.domElement);this.selectionStart=s.start,this.selectionEnd=s.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var C=n.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,C))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===b.keyName.AndroidDefault){var e=this.constructor._stripAllNonNumberCharactersExceptCustomDecimalChar(this.getFormatted(),this.settings,!0,this.isFocused);e=this.constructor._convertToNumericString(e,this.settings),this._setRawValue(e)}}},{key:"_onFocusOutAndMouseLeave",value:function(e){if(this.isEditing=!1,"mouseleave"!==e.type||!this.formulaMode)if(this.settings.unformatOnHover&&"mouseleave"===e.type&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if("mouseleave"===e.type&&!this.isFocused||"blur"===e.type){"blur"===e.type&&this.formulaMode&&this._exitFormulaMode(),this._saveValueToPersistentStorage(),this.settings.showOnlyNumbersOnFocus===a.options.showOnlyNumbersOnFocus.onlyNumbers&&(this.settings.digitGroupSeparator=this.originalDigitGroupSeparator,this.settings.currencySymbol=this.originalCurrencySymbol,this.settings.suffixText=this.originalSuffixText);var i=this._getRawValueToFormat(this.rawValue),r=n.isNull(i),m=W(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),p=m[0],s=m[1],C=!1;if(""===i||r||(this._triggerRangeEvents(p,s),this.settings.valuesToStrings&&this._checkValuesToStrings(i)&&(this._setElementValue(this.settings.valuesToStrings[i]),C=!0)),!C){var M;if(M=r||""===i?i:String(i),""===i||r){if(""===i)switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.zero:this._setRawValue("0"),M=this.constructor._roundValue("0",this.settings,0);break;case a.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),M=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case a.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),M=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:n.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),M=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else p&&s&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(i,this.settings)?(M=this._modifyNegativeSignAndDecimalCharacterForRawValue(M),this.settings.divisorWhenUnfocused&&!n.isNull(M)&&(M=(M/=this.settings.divisorWhenUnfocused).toString()),M=this.constructor._roundFormattedValueShownOnBlur(M,this.settings),M=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(M,this.settings)):this._triggerRangeEvents(p,s);var q=this.constructor._orderValueCurrencySymbolAndSuffixText(M,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(M,this.settings)||r&&this.settings.emptyInputBehavior===a.options.emptyInputBehavior.null||(q=this.constructor._addGroupSeparators(M,this.settings,!1,i)),q===i&&""!==i&&this.settings.allowDecimalPadding!==a.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==a.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&""!==i&&null!==i&&(q="".concat(q).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(q))}this._setValidOrInvalidState(this.rawValue),"blur"===e.type&&this._onBlur(e)}}},{key:"_onPaste",value:function(e){if(e.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i,r;window.clipboardData&&window.clipboardData.getData?i=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?i=e.clipboardData.getData("text/plain"):n.throwError("Unable to retrieve the pasted value. Please use a modern browser (ie. Firefox or Chromium).");var m=n.getElementValue(r=e.target.tagName?e.target:e.explicitOriginalTarget),p=r.selectionStart||0,s=r.selectionEnd||0,C=s-p;if(C===m.length){var M=this._preparePastedText(i),q=n.arabicToLatinNumbers(M,!1,!1,!1);return"."===q||""===q||"."!==q&&!n.isNumber(q)?(this.formatted=!0,void(this.settings.onInvalidPaste===a.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")))):(this.set(q),this.formatted=!0,void this._triggerEvent(a.events.native.input,r))}var v=n.isNegativeStrict(i,this.settings.negativeSignCharacter);v&&(i=i.slice(1,i.length));var Z,V,B=this._preparePastedText(i);if("."!==(Z="."===B?".":n.arabicToLatinNumbers(B,!1,!1,!1))&&(!n.isNumber(Z)||""===Z))return this.formatted=!0,void(this.settings.onInvalidPaste===a.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")));var j,z,X=n.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);j=!(!v||X)&&(X=!0);var ne=m.slice(0,p),se=m.slice(s,m.length);z=this._preparePastedText(p!==s?ne+se:m),X&&(z=n.setRawNegativeSign(z)),V=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,p,this.settings.decimalCharacter)),j&&V++;var ae=z.slice(0,V),ge=z.slice(V,z.length),Ae=!1;"."===Z&&(n.contains(ae,".")&&(Ae=!0,ae=ae.replace(".","")),ge=ge.replace(".",""));var w=!1;switch(""===ae&&"-"===ge&&(ae="-",w=!(ge="")),this.settings.onInvalidPaste){case a.options.onInvalidPaste.truncate:case a.options.onInvalidPaste.replace:for(var A=n.parseStr(this.settings.minimumValue),u=n.parseStr(this.settings.maximumValue),h=z,O=0,D=ae;O<Z.length&&(z=(D+=Z[O])+ge,this.constructor._checkIfInRange(z,A,u));)h=z,O++;if(V+=O,w&&V++,this.settings.onInvalidPaste===a.options.onInvalidPaste.truncate){z=h,Ae&&V--;break}for(var J=V,ie=h.length;O<Z.length&&J<ie;)if("."!==h[J]){if(z=n.replaceCharAt(h,J,Z[O]),!this.constructor._checkIfInRange(z,A,u))break;h=z,O++,J++}else J++;V=J,Ae&&V--,z=h;break;default:if(z="".concat(ae).concat(Z).concat(ge),p===s)V=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,p,this.settings.decimalCharacter))+Z.length;else if(""===ge)V=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,p,this.settings.decimalCharacter))+Z.length,w&&V++;else{var be=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,s,this.settings.decimalCharacter)),Ne=n.getElementValue(r).slice(p,s);V=be-C+n.countCharInText(this.settings.digitGroupSeparator,Ne)+Z.length}j&&V++,Ae&&V--}if(n.isNumber(z)&&""!==z){var fe=!1,he=!1;try{this.set(z),fe=!0}catch(Ue){var ue;switch(this.settings.onInvalidPaste){case a.options.onInvalidPaste.clamp:ue=n.clampToRangeLimits(z,this.settings);try{this.set(ue)}catch(ve){n.throwError("Fatal error: Unable to set the clamped value '".concat(ue,"'."))}fe=he=!0,z=ue;break;case a.options.onInvalidPaste.error:case a.options.onInvalidPaste.truncate:case a.options.onInvalidPaste.replace:n.throwError("The pasted value '".concat(i,"' results in a value '").concat(z,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));default:return}}var Be,Ee=n.getElementValue(r);if(fe)switch(this.settings.onInvalidPaste){case a.options.onInvalidPaste.clamp:if(he){n.setElementSelection(r,this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?Ee.length-this.settings.currencySymbol.length:Ee.length);break}default:Be=n.findCaretPositionInFormattedNumber(z,V,Ee,this.settings.decimalCharacter),n.setElementSelection(r,Be)}fe&&m!==Ee&&this._triggerEvent(a.events.native.input,r)}else this.settings.onInvalidPaste===a.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' would result into an invalid content '").concat(z,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,this.rawValue!==this.rawValueOnFocus&&this._triggerEvent(a.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_onWheel",value:function(e){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===a.options.wheelOn.focus?this.isFocused?e.shiftKey||this.wheelAction(e):e.shiftKey&&this.wheelAction(e):this.settings.wheelOn===a.options.wheelOn.hover?e.shiftKey?(e.preventDefault(),window.scrollBy(0,n.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):n.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var i,r=e.target.selectionStart||0,m=e.target.selectionEnd||0,p=this.rawValue;if(n.isUndefinedOrNullOrEmpty(p)?0<this.settings.minimumValue||this.settings.maximumValue<0?n.isWheelUpEvent(e)?i=this.settings.minimumValue:n.isWheelDownEvent(e)?i=this.settings.maximumValue:n.throwError("The event is not a 'wheel' event."):i=0:i=p,i=+i,n.isNumber(this.settings.wheelStep)){var s=+this.settings.wheelStep;n.isWheelUpEvent(e)?i+=s:n.isWheelDownEvent(e)&&(i-=s)}else n.isWheelUpEvent(e)?i=n.addAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue):n.isWheelDownEvent(e)&&(i=n.subtractAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue));(i=n.clampToRangeLimits(i,this.settings))!==+p&&(this.set(i),this._triggerEvent(a.events.native.input,e.target)),e.preventDefault(),this._setSelection(r,m),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){var i;this.isDropEvent=!0,e.preventDefault(),i=n.isIE11()?"text":"text/plain";var r=e.dataTransfer.getData(i),m=this.unformatOther(r);this.set(m),this.isDropEvent=!1}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){return i._unformatOnSubmit()}),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){var r=e._getDefaultValue(i.node());setTimeout(function(){return i.set(r)},0)})}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(e){if(n.character(e)===b.keyName.Alt){var i=n.getHoveredElement();if(a.isManagedByAutoNumeric(i)){var r=a.getAutoNumericElement(i);!r.formulaMode&&r.settings.unformatOnHover&&this.constructor._unformatAltHovered(r)}}}},{key:"_onKeyupGlobal",value:function(e){if(n.character(e)===b.keyName.Alt){var i=n.getHoveredElement();if(a.isManagedByAutoNumeric(i)){var r=a.getAutoNumericElement(i);if(r.formulaMode||!r.settings.unformatOnHover)return;this.constructor._reformatAltHovered(r)}}}},{key:"_isElementTagSupported",value:function(){return n.isElement(this.domElement)||n.throwError("The DOM element is not valid, ".concat(this.domElement," given.")),n.isInArray(this.domElement.tagName.toLowerCase(),this.allowedTagList)}},{key:"_isInputElement",value:function(){return"input"===this.domElement.tagName.toLowerCase()}},{key:"_isInputTypeSupported",value:function(){return"text"===this.domElement.type||"hidden"===this.domElement.type||"tel"===this.domElement.type||n.isUndefinedOrNullOrEmpty(this.domElement.type)}},{key:"_checkElement",value:function(){var e=this.domElement.tagName.toLowerCase();this._isElementTagSupported()||n.throwError("The <".concat(e,"> tag is not supported by autoNumeric")),this._isInputElement()?(this._isInputTypeSupported()||n.throwError('The input type "'.concat(this.domElement.type,'" is not supported by autoNumeric')),this.isInputElement=!0):(this.isInputElement=!1,this.isContentEditable=this.domElement.hasAttribute("contenteditable")&&"true"===this.domElement.getAttribute("contenteditable"))}},{key:"_formatDefaultValueOnPageLoad",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null,m=!0;if(n.isNull(r)?(i=n.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",i)):i=r,this.isInputElement||this.isContentEditable){var p=this.constructor._toNumericValue(i,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==i||null===this.settings.defaultValueOverride&&""!==i&&i!==this.domElement.getAttribute("value")||""!==i&&"hidden"===this.domElement.getAttribute("type")&&!n.isNumber(p)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var s=this.constructor._removeBrackets(i,this.settings);(this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)&&""!==this.settings.negativeSignCharacter&&n.isNegative(i,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(s,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(s,this.settings,!0,this.isFocused))}m=!1}}else isNaN(Number(p))||1/0===p?n.throwError("The value [".concat(i,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(p),m=!1);if(""===i)switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.focus:case a.options.emptyInputBehavior.null:case a.options.emptyInputBehavior.press:break;case a.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case a.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case a.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case a.options.emptyInputBehavior.zero:this.set("0");break;default:this.set(this.settings.emptyInputBehavior)}else m&&i===this.domElement.getAttribute("value")&&this.set(i)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==i||this.set(i)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=W(this.settings.maximumValue.toString().split("."),1)[0],i=W(this.settings.minimumValue||0===this.settings.minimumValue?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),i=i.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(i.length,1)}},{key:"_calculateValuesToStringsKeys",value:function(){this.valuesToStringsKeys=this.settings.valuesToStrings?Object.keys(this.settings.valuesToStrings):[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];"true"!==i&&"false"!==i||(this.settings[e]="true"===i),"number"==typeof i&&(this.settings[e]=i.toString())}}},{key:"_setSettings",value:function(e,i){var r=1<arguments.length&&void 0!==i&&i;!r&&n.isNull(e)||this.constructor._convertOldOptionsToNewOnes(e),r?("decimalPlacesRawValue"in e&&(this.settings.originalDecimalPlacesRawValue=e.decimalPlacesRawValue),"decimalPlaces"in e&&(this.settings.originalDecimalPlaces=e.decimalPlaces),this.constructor._calculateDecimalPlacesOnUpdate(e,this.settings),this._mergeSettings(e)):(this.settings={},this._mergeSettings(this.constructor.getDefaultConfig(),this.domElement.dataset,e,{rawValue:this.defaultRawValue}),this.caretFix=!1,this.throwInput=!0,this.allowedTagList=b.allowedTagList,this.runOnce=!1,this.hoveredWithAlt=!1),this._transformOptionsValuesToDefaultTypes(),this._runCallbacksFoundInTheSettingsObject(),this.constructor._correctNegativePositiveSignPlacementOption(this.settings),this.constructor._correctCaretPositionOnFocusAndSelectOnFocusOptions(this.settings),this.constructor._setNegativePositiveSignPermissions(this.settings),r||(this.settings.originalDecimalPlaces=n.isNull(e)||!e.decimalPlaces?null:e.decimalPlaces,this.settings.originalDecimalPlacesRawValue=this.settings.decimalPlacesRawValue,this.constructor._calculateDecimalPlacesOnInit(this.settings)),this._calculateVMinAndVMaxIntegerSizes(),this._setTrailingNegativeSignInfo(),this.regex={},this.constructor._cachesUsualRegularExpressions(this.settings,this.regex),this.constructor._setBrackets(this.settings),this._calculateValuesToStringsKeys(),n.isEmptyObj(this.settings)&&n.throwError("Unable to set the settings, those are invalid ; an empty object was given."),this.constructor.validate(this.settings,!1,e),this._keepAnOriginalSettingsCopy()}},{key:"_preparePastedText",value:function(e){return this.constructor._stripAllNonNumberCharacters(e,this.settings,!0,this.isFocused)}},{key:"_updateInternalProperties",value:function(){this.selection=n.getElementSelection(this.domElement),this.processed=!1}},{key:"_updateEventKeyInfo",value:function(e){this.eventKey=n.character(e)}},{key:"_saveCancellableValue",value:function(){this.savedCancellableValue=this.rawValue}},{key:"_setSelection",value:function(e,i){e=Math.max(e,0),i=Math.min(i,n.getElementValue(this.domElement).length),this.selection={start:e,end:i,length:i-e},n.setElementSelection(this.domElement,e,i)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=n.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=W(this._getLeftAndRightPartAroundTheSelection(),2),i=e[0],r=e[1];if(""===i&&""===r)return["",""];var m=!0;return this.eventKey!==b.keyName.Hyphen&&this.eventKey!==b.keyName.Minus||0!==Number(i)||(m=!1),this.isTrailingNegative&&(n.isNegative(r,this.settings.negativeSignCharacter)&&!n.isNegative(i,this.settings.negativeSignCharacter)||""===r&&n.isNegative(i,this.settings.negativeSignCharacter,!0))&&(i=i.replace(this.settings.negativeSignCharacter,""),r=r.replace(this.settings.negativeSignCharacter,""),i=i.replace("-",""),r=r.replace("-",""),i="-".concat(i)),[i=a._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,m,this.isFocused),r=a._stripAllNonNumberCharactersExceptCustomDecimalChar(r,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,i){var r=!0;this.eventKey!==b.keyName.Hyphen&&this.eventKey!==b.keyName.Minus||0!==Number(e)||(r=!1),this.isTrailingNegative&&n.isNegative(i,this.settings.negativeSignCharacter)&&!n.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),i=i.replace(this.settings.negativeSignCharacter,"")),e=a._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,r,this.isFocused),i=a._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,!1,this.isFocused),this.settings.leadingZero!==a.options.leadingZero.deny||this.eventKey!==b.keyName.num0&&this.eventKey!==b.keyName.numpad0||0!==Number(e)||n.contains(e,this.settings.decimalCharacter)||""===i||(e=e.substring(0,e.length-1));var m=e+i;if(this.settings.decimalCharacter){var p=m.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));p&&(m=(e=e.replace(p[1],p[1]+"0"))+i)}return[e,i,m]}},{key:"_setValueParts",value:function(e,i,r){var m=2<arguments.length&&void 0!==r&&r,p=W(this._normalizeParts(e,i),3),s=p[0],C=p[1],M=p[2],q=W(a._checkIfInRangeWithOverrideOption(M,this.settings),2),v=q[0],Z=q[1];if(v&&Z){var V=a._truncateDecimalPlaces(M,this.settings,m,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(""===V||V===this.settings.negativeSignCharacter){var B;switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.focus:case a.options.emptyInputBehavior.press:case a.options.emptyInputBehavior.always:B="";break;case a.options.emptyInputBehavior.min:B=this.settings.minimumValue;break;case a.options.emptyInputBehavior.max:B=this.settings.maximumValue;break;case a.options.emptyInputBehavior.zero:B="0";break;case a.options.emptyInputBehavior.null:B=null;break;default:B=this.settings.emptyInputBehavior}this._setRawValue(B)}else this._setRawValue(this._trimLeadingAndTrailingZeros(V));var j=a._truncateDecimalPlaces(M,this.settings,m,this.settings.decimalPlacesShownOnFocus),z=s.length;return z>j.length&&(z=j.length),1===z&&"0"===s&&this.settings.leadingZero===a.options.leadingZero.deny&&(z=""===C||"0"===s&&""!==C?1:0),this._setElementValue(j,!1),this._setCaretPosition(z),!0}return this._triggerRangeEvents(v,Z),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var i=this.settings.currencySymbol.length,r=n.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&r&&r.charAt(0)===this.settings.negativeSignCharacter?[1,i+1]:[0,i];else{var m=r.length;e=[m-i,m]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=W(this._getSignPosition(),2),i=e[0],r=e[1],m=this.selection;m.start<r&&m.end>i&&((m.start<i||m.end>r)&&n.getElementValue(this.domElement).substring(Math.max(m.start,i),Math.min(m.end,r)).match(/^\s*$/)?m.start<i?this._setSelection(m.start,i):this._setSelection(r,m.end):this._setSelection(Math.min(m.start,i),Math.max(m.end,r)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!n.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,i=W(this._getLeftAndRightPartAroundTheSelection(),2),r=i[0],m=i[1];delete this.valuePartsBeforePaste;var p=r.substr(0,e[0].length)+a._stripAllNonNumberCharactersExceptCustomDecimalChar(r.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(p,m,!0)||(this._setElementValue(e.join(""),!1),this._setCaretPosition(e[0].length))}}},{key:"_processNonPrintableKeysAndShortcuts",value:function(e){if((e.ctrlKey||e.metaKey)&&"keyup"===e.type&&!n.isUndefined(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKey===b.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===b.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===b.keyName.c||this.eventKey===b.keyName.v||this.eventKey===b.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==b.keyName.v&&this.eventKey!==b.keyName.Insert||("keydown"===e.type||"keypress"===e.type?n.isUndefined(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),"keydown"===e.type||"keypress"===e.type||this.eventKey===b.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===b.keyName.Z||this.eventKey===b.keyName.z);if(this.eventKey!==b.keyName.LeftArrow&&this.eventKey!==b.keyName.RightArrow)return n.isInArray(this.eventKey,b.keyName._directionKeys);if("keydown"===e.type&&!e.shiftKey){var i=n.getElementValue(this.domElement);this.eventKey!==b.keyName.LeftArrow||i.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==b.keyName.RightArrow||i.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start+1)!==this.settings.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)}return!0}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var i=W(e,2),r=i[0],m=i[1],p=n.getElementValue(this.domElement),s=n.isNegative(p,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix&&(this.eventKey===b.keyName.Backspace?(this.caretFix=this.selection.start>=p.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===p.charAt(this.selection.start-1)?r=r.substring(1):this.selection.start<=p.length-this.settings.suffixText.length&&(r=r.substring(0,r.length-1))):(this.caretFix=this.selection.start>=p.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,this.selection.start>=p.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(m=m.substring(1,m.length)),n.isNegative(r,this.settings.negativeSignCharacter)&&"-"===p.charAt(this.selection.start)&&(r=r.substring(1)))),this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=p.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===b.keyName.Backspace?this.selection.start===p.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&s?r=r.substring(1):"-"!==r&&(this.selection.start<=p.indexOf(this.settings.negativeSignCharacter)||!s)&&(r=r.substring(0,r.length-1)):("-"===r[0]&&(m=m.substring(1)),this.selection.start===p.indexOf(this.settings.negativeSignCharacter)&&s&&(r=r.substring(1)));break;case a.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=p.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===b.keyName.Backspace?this.selection.start===p.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?r=r.substring(1):("-"!==r&&this.selection.start<=p.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length||""!==r&&!s)&&(r=r.substring(0,r.length-1)):(this.caretFix=this.selection.start>=p.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===p.indexOf(this.settings.negativeSignCharacter)&&(r=r.substring(1)),m=m.substring(1))}return[r,m]}},{key:"_processCharacterDeletion",value:function(){var e,i;if(this.selection.length){this._expandSelectionOnSign();var r=W(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);e=r[0],i=r[1]}else{var m=W(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(i=m[1],""===(e=m[0])&&""===i&&(this.throwInput=!1),this.isTrailingNegative&&n.isNegative(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var p=W(this._processCharacterDeletionIfTrailingNegativeSign([e,i]),2);e=p[0],i=p[1]}else this.eventKey===b.keyName.Backspace?e=e.substring(0,e.length-1):i=i.substring(1,i.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(e).concat(i),this.settings)&&(this._setValueParts(e,i),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(a.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(a.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=W(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),i=e[0],r=e[1];if(this.eventKey!==b.keyName.AndroidDefault&&(this.throwInput=!0),this.eventKey===this.settings.decimalCharacter||this.settings.decimalCharacterAlternative&&this.eventKey===this.settings.decimalCharacterAlternative){if(!this._isDecimalCharacterInsertionAllowed()||!this.settings.decimalCharacter)return!1;if(this.settings.alwaysAllowDecimalCharacter)i=i.replace(this.settings.decimalCharacter,""),r=r.replace(this.settings.decimalCharacter,"");else{if(n.contains(i,this.settings.decimalCharacter)||0<r.indexOf(this.settings.decimalCharacter))return!0;0===r.indexOf(this.settings.decimalCharacter)&&(r=r.substr(1))}return this.settings.negativeSignCharacter&&n.contains(r,this.settings.negativeSignCharacter)&&(i="".concat(this.settings.negativeSignCharacter).concat(i),r=r.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(i+this.settings.decimalCharacter,r),!0}if(("-"===this.eventKey||"+"===this.eventKey)&&this.settings.isNegativeSignAllowed)return""===i&&n.contains(r,"-")?r=r.replace("-",""):i=n.isNegativeStrict(i,"-")?i.replace("-",""):"".concat(this.settings.negativeSignCharacter).concat(i),this._setValueParts(i,r),!0;var m=Number(this.eventKey);return 0<=m&&m<=9?(this.settings.isNegativeSignAllowed&&""===i&&n.contains(r,"-")&&(i="-",r=r.substring(1,r.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!n.contains(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&"0"!==this.eventKey&&(i="-".concat(i)),this._setValueParts("".concat(i).concat(this.eventKey),r),!0):this.throwInput=!1}},{key:"_formatValue",value:function(e){var i=n.getElementValue(this.domElement),r=W(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((""===this.settings.digitGroupSeparator||""!==this.settings.digitGroupSeparator&&!n.contains(i,this.settings.digitGroupSeparator))&&(""===this.settings.currencySymbol||""!==this.settings.currencySymbol&&!n.contains(i,this.settings.currencySymbol))){var m=W(i.split(this.settings.decimalCharacter),1)[0],p="";n.isNegative(m,this.settings.negativeSignCharacter)&&(p=this.settings.negativeSignCharacter,m=m.replace(this.settings.negativeSignCharacter,""),r=r.replace("-","")),""===p&&m.length>this.settings.mIntPos&&"0"===r.charAt(0)&&(r=r.slice(1)),p===this.settings.negativeSignCharacter&&m.length>this.settings.mIntNeg&&"0"===r.charAt(0)&&(r=r.slice(1)),this.isTrailingNegative||(r="".concat(p).concat(r))}var s=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue),C=s.length;if(s){var M,q=r.split("");if((this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)&&q[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(q.shift(),(this.eventKey===b.keyName.Backspace||this.eventKey===b.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix)&&(q.push(this.settings.negativeSignCharacter),this.caretFix="keydown"===e.type),this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.right))){var v=this.settings.currencySymbol.split(""),Z=["\\","^","$",".","|","?","*","+","(",")","["],V=[];v.forEach(function(z,X){n.isInArray(X=v[z],Z)?V.push("\\"+X):V.push(X)}),this.eventKey===b.keyName.Backspace&&"-"===this.settings.negativeSignCharacter&&V.push("-"),q.push(V.join("")),this.caretFix="keydown"===e.type}for(var B=0;B<q.length;B++)q[B].match("\\d")||(q[B]="\\"+q[B]);M=this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(q.join(".*?"))):new RegExp("^.*?".concat(this.settings.currencySymbol).concat(q.join(".*?")));var j=s.match(M);j?(C=j[0].length,this.settings.showPositiveSign&&(0===C&&j.input.charAt(0)===this.settings.positiveSignCharacter&&(C=1===j.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===C&&j.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(C=this.settings.currencySymbol.length+1)),(0===C&&s.charAt(0)!==this.settings.negativeSignCharacter||1===C&&s.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&(C=this.settings.currencySymbol.length+(n.isNegativeStrict(s,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&(C-=this.settings.currencySymbol.length),this.settings.suffixText&&(C-=this.settings.suffixText.length))}s!==i&&(this._setElementValue(s,!1),this._setCaretPosition(C)),this.formatted=!0}}]),ce(c,g),a}();function ee(a,c){c=c||{bubbles:!1,cancelable:!1,detail:void 0};var g=document.createEvent("CustomEvent");return g.initCustomEvent(a,c.bubbles,c.cancelable,c.detail),g}k.multiple=function(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,g=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,e=[];if(n.isObject(c)&&(g=c,c=null),n.isString(a))a=G(document.querySelectorAll(a));else if(n.isObject(a)){Object.prototype.hasOwnProperty.call(a,"rootElement")||n.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var i=G(a.rootElement.querySelectorAll("input"));a=Object.prototype.hasOwnProperty.call(a,"exclude")?(Array.isArray(a.exclude)||n.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),n.filterOut(i,a.exclude)):i}else n.isArray(a)||n.throwError("The given parameters to the 'multiple' function are invalid.");if(0===a.length){var r=!0;return!n.isNull(g)&&n.isBoolean(g.showWarnings)&&(r=g.showWarnings),n.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",r),[]}var m=n.isArray(c)&&1<=c.length,p=!1,s=!1;if(m){var C=te(Number(c[0]));(p="number"===C&&!isNaN(Number(c[0])))||"string"!==C&&!isNaN(C)&&"object"!==C||(s=!0)}var M,q=!1;if(n.isArray(g)&&1<=g.length){var v=te(g[0]);"string"!==v&&"object"!==v||(q=!0)}M=s?k.mergeOptions(c):q?k.mergeOptions(g):g;var Z,V=n.isNumber(c);return p&&(Z=c.length),a.forEach(function(B,j){e.push(new k(B,V?c:p&&j<=Z?c[j]:null,M))}),e},Array.from||(Array.from=function(a){return[].slice.call(a)}),"undefined"!=typeof window&&"function"!=typeof window.CustomEvent&&(ee.prototype=window.Event.prototype,window.CustomEvent=ee),k.events={correctedValue:"autoNumeric:correctedValue",initialized:"autoNumeric:initialized",invalidFormula:"autoNumeric:invalidFormula",invalidValue:"autoNumeric:invalidValue",formatted:"autoNumeric:formatted",rawValueModified:"autoNumeric:rawValueModified",minRangeExceeded:"autoNumeric:minExceeded",maxRangeExceeded:"autoNumeric:maxExceeded",native:{input:"input",change:"change"},validFormula:"autoNumeric:validFormula"},Object.freeze(k.events.native),Object.freeze(k.events),Object.defineProperty(k,"events",{configurable:!1,writable:!1}),k.options={allowDecimalPadding:{always:!0,never:!1,floats:"floats"},alwaysAllowDecimalCharacter:{alwaysAllow:!0,doNotAllow:!1},caretPositionOnFocus:{start:"start",end:"end",decimalLeft:"decimalLeft",decimalRight:"decimalRight",doNoForceCaretPosition:null},createLocalList:{createList:!0,doNotCreateList:!1},currencySymbol:{none:"",currencySign:"\xa4",austral:"\u20b3",australCentavo:"\xa2",baht:"\u0e3f",cedi:"\u20b5",cent:"\xa2",colon:"\u20a1",cruzeiro:"\u20a2",dollar:"$",dong:"\u20ab",drachma:"\u20af",dram:"\u200b\u058f",european:"\u20a0",euro:"\u20ac",florin:"\u0192",franc:"\u20a3",guarani:"\u20b2",hryvnia:"\u20b4",kip:"\u20ad",att:"\u0ead\u0eb1\u0e94",lepton:"\u039b.",lira:"\u20ba",liraOld:"\u20a4",lari:"\u20be",mark:"\u2133",mill:"\u20a5",naira:"\u20a6",peseta:"\u20a7",peso:"\u20b1",pfennig:"\u20b0",pound:"\xa3",real:"R$",riel:"\u17db",ruble:"\u20bd",rupee:"\u20b9",rupeeOld:"\u20a8",shekel:"\u20aa",shekelAlt:"\u05e9\u05f4\u05d7\u200e\u200e",taka:"\u09f3",tenge:"\u20b8",togrog:"\u20ae",won:"\u20a9",yen:"\xa5"},currencySymbolPlacement:{prefix:"p",suffix:"s"},decimalCharacter:{comma:",",dot:".",middleDot:"\xb7",arabicDecimalSeparator:"\u066b",decimalSeparatorKeySymbol:"\u2396"},decimalCharacterAlternative:{none:null,comma:",",dot:"."},decimalPlaces:{none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesRawValue:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnBlur:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnFocus:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},defaultValueOverride:{doNotOverride:null},digitalGroupSpacing:{two:"2",twoScaled:"2s",three:"3",four:"4"},digitGroupSeparator:{comma:",",dot:".",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0",noSeparator:"",apostrophe:"'",arabicThousandsSeparator:"\u066c",dotAbove:"\u02d9",privateUseTwo:"\u2019"},divisorWhenUnfocused:{none:null,percentage:100,permille:1e3,basisPoint:1e4},emptyInputBehavior:{focus:"focus",press:"press",always:"always",zero:"zero",min:"min",max:"max",null:"null"},eventBubbles:{bubbles:!0,doesNotBubble:!1},eventIsCancelable:{isCancelable:!0,isNotCancelable:!1},failOnUnknownOption:{fail:!0,ignore:!1},formatOnPageLoad:{format:!0,doNotFormat:!1},formulaMode:{enabled:!0,disabled:!1},historySize:{verySmall:5,small:10,medium:20,large:50,veryLarge:100,insane:Number.MAX_SAFE_INTEGER},invalidClass:"an-invalid",isCancellable:{cancellable:!0,notCancellable:!1},leadingZero:{allow:"allow",deny:"deny",keep:"keep"},maximumValue:{tenTrillions:"10000000000000",oneBillion:"1000000000",zero:"0"},minimumValue:{tenTrillions:"-10000000000000",oneBillion:"-1000000000",zero:"0"},modifyValueOnWheel:{modifyValue:!0,doNothing:!1},negativeBracketsTypeOnBlur:{parentheses:"(,)",brackets:"[,]",chevrons:"<,>",curlyBraces:"{,}",angleBrackets:"\u3008,\u3009",japaneseQuotationMarks:"\uff62,\uff63",halfBrackets:"\u2e24,\u2e25",whiteSquareBrackets:"\u27e6,\u27e7",quotationMarks:"\u2039,\u203a",guillemets:"\xab,\xbb",none:null},negativePositiveSignPlacement:{prefix:"p",suffix:"s",left:"l",right:"r",none:null},negativeSignCharacter:{hyphen:"-",minus:"\u2212",heavyMinus:"\u2796",fullWidthHyphen:"\uff0d",circledMinus:"\u2296",squaredMinus:"\u229f",triangleMinus:"\u2a3a",plusMinus:"\xb1",minusPlus:"\u2213",dotMinus:"\u2238",minusTilde:"\u2242",not:"\xac"},noEventListeners:{noEvents:!0,addEvents:!1},onInvalidPaste:{error:"error",ignore:"ignore",clamp:"clamp",truncate:"truncate",replace:"replace"},outputFormat:{string:"string",number:"number",dot:".",negativeDot:"-.",comma:",",negativeComma:"-,",dotNegative:".-",commaNegative:",-",none:null},overrideMinMaxLimits:{ceiling:"ceiling",floor:"floor",ignore:"ignore",invalid:"invalid",doNotOverride:null},positiveSignCharacter:{plus:"+",fullWidthPlus:"\uff0b",heavyPlus:"\u2795",doublePlus:"\u29fa",triplePlus:"\u29fb",circledPlus:"\u2295",squaredPlus:"\u229e",trianglePlus:"\u2a39",plusMinus:"\xb1",minusPlus:"\u2213",dotPlus:"\u2214",altHebrewPlus:"\ufb29",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0"},rawValueDivisor:{none:null,percentage:100,permille:1e3,basisPoint:1e4},readOnly:{readOnly:!0,readWrite:!1},roundingMethod:{halfUpSymmetric:"S",halfUpAsymmetric:"A",halfDownSymmetric:"s",halfDownAsymmetric:"a",halfEvenBankersRounding:"B",upRoundAwayFromZero:"U",downRoundTowardZero:"D",toCeilingTowardPositiveInfinity:"C",toFloorTowardNegativeInfinity:"F",toNearest05:"N05",toNearest05Alt:"CHF",upToNext05:"U05",downToNext05:"D05"},saveValueToSessionStorage:{save:!0,doNotSave:!1},selectNumberOnly:{selectNumbersOnly:!0,selectAll:!1},selectOnFocus:{select:!0,doNotSelect:!1},serializeSpaces:{plus:"+",percent:"%20"},showOnlyNumbersOnFocus:{onlyNumbers:!0,showAll:!1},showPositiveSign:{show:!0,hide:!1},showWarnings:{show:!0,hide:!1},styleRules:{none:null,positiveNegative:{positive:"autoNumeric-positive",negative:"autoNumeric-negative"},range0To100With4Steps:{ranges:[{min:0,max:25,class:"autoNumeric-red"},{min:25,max:50,class:"autoNumeric-orange"},{min:50,max:75,class:"autoNumeric-yellow"},{min:75,max:100,class:"autoNumeric-green"}]},evenOdd:{userDefined:[{callback:function(a){return a%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(a){return-1<=a&&a<0?0:0===Number(a)?1:0<a&&a<=1?2:null},classes:["autoNumeric-small-negative","autoNumeric-zero","autoNumeric-small-positive"]}]}},suffixText:{none:"",percentage:"%",permille:"\u2030",basisPoint:"\u2031"},symbolWhenUnfocused:{none:null,percentage:"%",permille:"\u2030",basisPoint:"\u2031"},unformatOnHover:{unformat:!0,doNotUnformat:!1},unformatOnSubmit:{unformat:!0,keepCurrentValue:!1},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},H=k.options,Object.getOwnPropertyNames(H).forEach(function(a){"valuesToStrings"===a?Object.getOwnPropertyNames(H.valuesToStrings).forEach(function(c){n.isIE11()||null===H.valuesToStrings[c]||Object.freeze(H.valuesToStrings[c])}):"styleRules"!==a&&(n.isIE11()||null===H[a]||Object.freeze(H[a]))}),Object.freeze(H),Object.defineProperty(k,"options",{configurable:!1,writable:!1}),k.defaultSettings={allowDecimalPadding:k.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:k.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:k.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:k.options.createLocalList.createList,currencySymbol:k.options.currencySymbol.none,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,decimalCharacter:k.options.decimalCharacter.dot,decimalCharacterAlternative:k.options.decimalCharacterAlternative.none,decimalPlaces:k.options.decimalPlaces.two,decimalPlacesRawValue:k.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:k.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:k.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:k.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:k.options.digitalGroupSpacing.three,digitGroupSeparator:k.options.digitGroupSeparator.comma,divisorWhenUnfocused:k.options.divisorWhenUnfocused.none,emptyInputBehavior:k.options.emptyInputBehavior.focus,eventBubbles:k.options.eventBubbles.bubbles,eventIsCancelable:k.options.eventIsCancelable.isCancelable,failOnUnknownOption:k.options.failOnUnknownOption.ignore,formatOnPageLoad:k.options.formatOnPageLoad.format,formulaMode:k.options.formulaMode.disabled,historySize:k.options.historySize.medium,invalidClass:k.options.invalidClass,isCancellable:k.options.isCancellable.cancellable,leadingZero:k.options.leadingZero.deny,maximumValue:k.options.maximumValue.tenTrillions,minimumValue:k.options.minimumValue.tenTrillions,modifyValueOnWheel:k.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:k.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.none,negativeSignCharacter:k.options.negativeSignCharacter.hyphen,noEventListeners:k.options.noEventListeners.addEvents,onInvalidPaste:k.options.onInvalidPaste.error,outputFormat:k.options.outputFormat.none,overrideMinMaxLimits:k.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:k.options.positiveSignCharacter.plus,rawValueDivisor:k.options.rawValueDivisor.none,readOnly:k.options.readOnly.readWrite,roundingMethod:k.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:k.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:k.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:k.options.selectOnFocus.select,serializeSpaces:k.options.serializeSpaces.plus,showOnlyNumbersOnFocus:k.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:k.options.showPositiveSign.hide,showWarnings:k.options.showWarnings.show,styleRules:k.options.styleRules.none,suffixText:k.options.suffixText.none,symbolWhenUnfocused:k.options.symbolWhenUnfocused.none,unformatOnHover:k.options.unformatOnHover.unformat,unformatOnSubmit:k.options.unformatOnSubmit.keepCurrentValue,valuesToStrings:k.options.valuesToStrings.none,watchExternalChanges:k.options.watchExternalChanges.doNotWatch,wheelOn:k.options.wheelOn.focus,wheelStep:k.options.wheelStep.progressive},Object.freeze(k.defaultSettings),Object.defineProperty(k,"defaultSettings",{configurable:!1,writable:!1});var Q={digitGroupSeparator:k.options.digitGroupSeparator.dot,decimalCharacter:k.options.decimalCharacter.comma,decimalCharacterAlternative:k.options.decimalCharacterAlternative.dot,currencySymbol:"\u202f\u20ac",currencySymbolPlacement:k.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.prefix},Y={digitGroupSeparator:k.options.digitGroupSeparator.comma,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.dollar,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.right},oe={digitGroupSeparator:k.options.digitGroupSeparator.comma,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.yen,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.right};n.cloneObject(Q).formulaMode=k.options.formulaMode.enabled;var Pe=n.cloneObject(Q);Pe.minimumValue=0;var ye=n.cloneObject(Q);ye.maximumValue=0,ye.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var pe=n.cloneObject(Q);pe.digitGroupSeparator=k.options.digitGroupSeparator.normalSpace;var we=n.cloneObject(pe);we.minimumValue=0;var Se=n.cloneObject(pe);Se.maximumValue=0,Se.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var me=n.cloneObject(Q);me.currencySymbol=k.options.currencySymbol.none,me.suffixText="\u202f".concat(k.options.suffixText.percentage),me.wheelStep=1e-4,me.rawValueDivisor=k.options.rawValueDivisor.percentage;var Ce=n.cloneObject(me);Ce.minimumValue=0;var Oe=n.cloneObject(me);Oe.maximumValue=0,Oe.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var xe=n.cloneObject(me);xe.decimalPlaces=3;var Fe=n.cloneObject(Ce);Fe.decimalPlaces=3;var Le=n.cloneObject(Oe);Le.decimalPlaces=3,n.cloneObject(Y).formulaMode=k.options.formulaMode.enabled;var Me=n.cloneObject(Y);Me.minimumValue=0;var Te=n.cloneObject(Y);Te.maximumValue=0,Te.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var Ie=n.cloneObject(Te);Ie.negativeBracketsTypeOnBlur=k.options.negativeBracketsTypeOnBlur.parentheses;var de=n.cloneObject(Y);de.currencySymbol=k.options.currencySymbol.none,de.suffixText=k.options.suffixText.percentage,de.wheelStep=1e-4,de.rawValueDivisor=k.options.rawValueDivisor.percentage;var ke=n.cloneObject(de);ke.minimumValue=0;var _e=n.cloneObject(de);_e.maximumValue=0,_e.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var Ve=n.cloneObject(de);Ve.decimalPlaces=3;var Re=n.cloneObject(ke);Re.decimalPlaces=3;var Ze=n.cloneObject(_e);Ze.decimalPlaces=3;var De=n.cloneObject(Q);De.currencySymbol=k.options.currencySymbol.lira,k.predefinedOptions={euro:Q,euroPos:Pe,euroNeg:ye,euroSpace:pe,euroSpacePos:we,euroSpaceNeg:Se,percentageEU2dec:me,percentageEU2decPos:Ce,percentageEU2decNeg:Oe,percentageEU3dec:xe,percentageEU3decPos:Fe,percentageEU3decNeg:Le,dollar:Y,dollarPos:Me,dollarNeg:Te,dollarNegBrackets:Ie,percentageUS2dec:de,percentageUS2decPos:ke,percentageUS2decNeg:_e,percentageUS3dec:Ve,percentageUS3decPos:Re,percentageUS3decNeg:Ze,French:Q,Spanish:Q,NorthAmerican:Y,British:{digitGroupSeparator:k.options.digitGroupSeparator.comma,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.pound,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:k.options.digitGroupSeparator.apostrophe,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:"\u202fCHF",currencySymbolPlacement:k.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.prefix},Japanese:oe,Chinese:oe,Brazilian:{digitGroupSeparator:k.options.digitGroupSeparator.dot,decimalCharacter:k.options.decimalCharacter.comma,currencySymbol:k.options.currencySymbol.real,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.right},Turkish:De,dotDecimalCharCommaSeparator:{digitGroupSeparator:k.options.digitGroupSeparator.comma,decimalCharacter:k.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:k.options.digitGroupSeparator.dot,decimalCharacter:k.options.decimalCharacter.comma,decimalCharacterAlternative:k.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:k.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:k.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:k.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:k.options.allowDecimalPadding.never,minimumValue:k.options.minimumValue.zero,maximumValue:k.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:k.options.allowDecimalPadding.never,minimumValue:k.options.minimumValue.tenTrillions,maximumValue:k.options.maximumValue.zero},numeric:{digitGroupSeparator:k.options.digitGroupSeparator.noSeparator,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.none},numericPos:{digitGroupSeparator:k.options.digitGroupSeparator.noSeparator,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.none,minimumValue:k.options.minimumValue.zero,maximumValue:k.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:k.options.digitGroupSeparator.noSeparator,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.none,minimumValue:k.options.minimumValue.tenTrillions,maximumValue:k.options.maximumValue.zero}},Object.getOwnPropertyNames(k.predefinedOptions).forEach(function(a){Object.freeze(k.predefinedOptions[a])}),Object.freeze(k.predefinedOptions),Object.defineProperty(k,"predefinedOptions",{configurable:!1,writable:!1}),t.default=k}],S.c=L,S.d=function(N,t,x){S.o(N,t)||Object.defineProperty(N,t,{enumerable:!0,get:x})},S.r=function(N){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},S.t=function(N,t){if(1&t&&(N=S(N)),8&t||4&t&&"object"==typeof N&&N&&N.__esModule)return N;var x=Object.create(null);if(S.r(x),Object.defineProperty(x,"default",{enumerable:!0,value:N}),2&t&&"string"!=typeof N)for(var F in N)S.d(x,F,function(b){return N[b]}.bind(null,F));return x},S.n=function(N){var t=N&&N.__esModule?function(){return N.default}:function(){return N};return S.d(t,"a",t),t},S.o=function(N,t){return Object.prototype.hasOwnProperty.call(N,t)},S.p="",S(S.s=0).default;function S(N){if(L[N])return L[N].exports;var t=L[N]={i:N,l:!1,exports:{}};return T[N].call(t.exports,t,t.exports,S),t.l=!0,t.exports}var T,L}()},9489:(K,S,T)=>{"use strict";var N=U(T(3413)),x=U(T(7720)),b=U(T(2308)),I=U(T(7095)),o=U(T(4441)),d=U(T(201)),f=U(T(400)),_=T(4779),R=U(T(1452));function U(H){return H&&H.__esModule?H:{default:H}}var G=function(){},W=function(k,ee,Q){var Y=new G;if(void 0===k)throw Error("No element to render on was provided.");return Y._renderProperties=(0,o.default)(k),Y._encodings=[],Y._options=R.default,Y._errorHandler=new f.default(Y),void 0!==ee&&((Q=Q||{}).format||(Q.format=te()),Y.options(Q)[Q.format](ee,Q).render()),Y};for(var $ in W.getModule=function(H){return N.default[H]},N.default)N.default.hasOwnProperty($)&&le(N.default,$);function le(H,k){G.prototype[k]=G.prototype[k.toUpperCase()]=G.prototype[k.toLowerCase()]=function(ee,Q){var Y=this;return Y._errorHandler.wrapBarcodeCall(function(){Q.text=void 0===Q.text?void 0:""+Q.text;var oe=(0,x.default)(Y._options,Q);oe=(0,d.default)(oe);var ye=re(ee,H[k],oe);return Y._encodings.push(ye),Y})}}function re(H,k,ee){var Q=new k(H=""+H,ee);if(!Q.valid())throw new _.InvalidInputException(Q.constructor.name,H);var Y=Q.encode();Y=(0,b.default)(Y);for(var oe=0;oe<Y.length;oe++)Y[oe].options=(0,x.default)(ee,Y[oe].options);return Y}function te(){return N.default.CODE128?"CODE128":Object.keys(N.default)[0]}function ce(H,k,ee){k=(0,b.default)(k);for(var Q=0;Q<k.length;Q++)k[Q].options=(0,x.default)(ee,k[Q].options),(0,I.default)(k[Q].options);(0,I.default)(ee),new(0,H.renderer)(H.element,k,ee).render(),H.afterRender&&H.afterRender()}G.prototype.options=function(H){return this._options=(0,x.default)(this._options,H),this},G.prototype.blank=function(H){var k=new Array(H+1).join("0");return this._encodings.push({data:k}),this},G.prototype.init=function(){var H;if(this._renderProperties)for(var k in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){var ee=(0,x.default)(this._options,(H=this._renderProperties[k]).options);"auto"==ee.format&&(ee.format=te()),this._errorHandler.wrapBarcodeCall(function(){var oe=re(ee.value,N.default[ee.format.toUpperCase()],ee);ce(H,oe,ee)})}},G.prototype.render=function(){if(!this._renderProperties)throw new _.NoElementException;if(Array.isArray(this._renderProperties))for(var H=0;H<this._renderProperties.length;H++)ce(this._renderProperties[H],this._encodings,this._options);else ce(this._renderProperties,this._encodings,this._options);return this},G.prototype._defaults=R.default,"undefined"!=typeof window&&(window.JsBarcode=W),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(H,k){var ee=[];return jQuery(this).each(function(){ee.push(this)}),W(ee,H,k)}),K.exports=W},6615:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function N(t,x){(function(N,t){if(!(N instanceof t))throw new TypeError("Cannot call a class as a function")})(this,N),this.data=t,this.text=x.text||t,this.options=x}},8901:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(6615))&&o.__esModule?o:{default:o},x=T(5286),y=function(o){function l(d,n){!function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l);var f=function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d.substring(1),n));return f.bytes=d.split("").map(function(_){return _.charCodeAt(0)}),f}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,f=n.shift()-105,_=x.SET_BY_CODE[f];if(void 0===_)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&n.unshift(x.FNC1);var P=l.next(n,1,_);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:l.getBar(f)+P.result+l.getBar((P.checksum+f)%x.MODULO)+l.getBar(x.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return"string"==typeof n&&(n="true"===n.toLowerCase()),n}}],[{key:"getBar",value:function(n){return x.BARS[n]?x.BARS[n].toString():""}},{key:"correctIndex",value:function(n,f){if(f===x.SET_A){var _=n.shift();return _<32?_+64:_-32}return f===x.SET_B?n.shift()-32:10*(n.shift()-48)+n.shift()-48}},{key:"next",value:function(n,f,_){if(!n.length)return{result:"",checksum:0};var P=void 0,R=void 0;if(n[0]>=200){R=n.shift()-105;var U=x.SWAP[R];void 0!==U?P=l.next(n,f+1,U):((_===x.SET_A||_===x.SET_B)&&R===x.SHIFT&&(n[0]=_===x.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),P=l.next(n,f+1,_))}else R=l.correctIndex(n,_),P=l.next(n,f+1,_);return{result:l.getBar(R)+P.result,checksum:R*f+P.checksum}}}]),l}(t.default);S.default=y},972:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(8901))&&o.__esModule?o:{default:o},x=T(5286),y=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,x.A_START_CHAR+d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return new RegExp("^"+x.A_CHARS+"+$").test(this.data)}}]),l}(t.default);S.default=y},399:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(8901))&&o.__esModule?o:{default:o},x=T(5286),y=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,x.B_START_CHAR+d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return new RegExp("^"+x.B_CHARS+"+$").test(this.data)}}]),l}(t.default);S.default=y},8108:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(8901))&&o.__esModule?o:{default:o},x=T(5286),y=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,x.C_START_CHAR+d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return new RegExp("^"+x.C_CHARS+"+$").test(this.data)}}]),l}(t.default);S.default=y},4156:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=F(T(8901)),x=F(T(993));function F(o){return o&&o.__esModule?o:{default:o}}function E(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}var y=function(o){function l(d,n){if(function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),/^[\x00-\x7F\xC8-\xD3]+$/.test(d))var f=E(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,(0,x.default)(d),n));else f=E(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,n));return E(f)}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),l}(N.default);S.default=y},993:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=T(5286),N=function(I){return I.match(new RegExp("^"+L.A_CHARS+"*"))[0].length},t=function(I){return I.match(new RegExp("^"+L.B_CHARS+"*"))[0].length},x=function(I){return I.match(new RegExp("^"+L.C_CHARS+"*"))[0]};function F(E,I){var y=I?L.A_CHARS:L.B_CHARS,o=E.match(new RegExp("^("+y+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(o)return o[1]+String.fromCharCode(204)+b(E.substring(o[1].length));var l=E.match(new RegExp("^"+y+"+"))[0];return l.length===E.length?E:l+String.fromCharCode(I?205:206)+F(E.substring(l.length),!I)}function b(E){var I=x(E),y=I.length;if(y===E.length)return E;E=E.substring(y);var o=N(E)>=t(E);return I+String.fromCharCode(o?206:205)+F(E,o)}S.default=function(E){var I=void 0;if(x(E).length>=2)I=L.C_START_CHAR+b(E);else{var o=N(E)>t(E);I=(o?L.A_START_CHAR:L.B_START_CHAR)+F(E,o)}return I.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(l,d){return String.fromCharCode(203)+d})}},5286:(K,S)=>{"use strict";var T;function L($,le,re){return le in $?Object.defineProperty($,le,{value:re,enumerable:!0,configurable:!0,writable:!0}):$[le]=re,$}Object.defineProperty(S,"__esModule",{value:!0});var N=S.SET_A=0,t=S.SET_B=1,x=S.SET_C=2,b=(S.SHIFT=98,S.START_A=103),E=S.START_B=104,I=S.START_C=105;S.MODULO=103,S.STOP=106,S.FNC1=207,S.SET_BY_CODE=(L(T={},b,N),L(T,E,t),L(T,I,x),T),S.SWAP={101:N,100:t,99:x},S.A_START_CHAR=String.fromCharCode(208),S.B_START_CHAR=String.fromCharCode(209),S.C_START_CHAR=String.fromCharCode(210),S.A_CHARS="[\0-_\xc8-\xcf]",S.B_CHARS="[ -\x7f\xc8-\xcf]",S.C_CHARS="(\xcf*[0-9]{2}\xcf*)",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]},6625:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CODE128C=S.CODE128B=S.CODE128A=S.CODE128=void 0;var N=y(T(4156)),x=y(T(972)),b=y(T(399)),I=y(T(8108));function y(o){return o&&o.__esModule?o:{default:o}}S.CODE128=N.default,S.CODE128A=x.default,S.CODE128B=b.default,S.CODE128C=I.default},8104:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CODE39=void 0;var P,L=function(){function P(R,U){for(var G=0;G<U.length;G++){var W=U[G];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(R,W.key,W)}}return function(R,U,G){return U&&P(R.prototype,U),G&&P(R,G),R}}(),I=function(P){function R(U,G){return function(P,R){if(!(P instanceof R))throw new TypeError("Cannot call a class as a function")}(this,R),U=U.toUpperCase(),G.mod43&&(U+=function(P){return y[P]}(function(P){for(var R=0,U=0;U<P.length;U++)R+=f(P[U]);return R%43}(U))),function(P,R){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!R||"object"!=typeof R&&"function"!=typeof R?P:R}(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,U,G))}return function(P,R){if("function"!=typeof R&&null!==R)throw new TypeError("Super expression must either be null or a function, not "+typeof R);P.prototype=Object.create(R&&R.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(P,R):P.__proto__=R)}(R,P),L(R,[{key:"encode",value:function(){for(var G=l("*"),W=0;W<this.data.length;W++)G+=l(this.data[W])+"0";return{data:G+=l("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),R}(((P=T(6615))&&P.__esModule?P:{default:P}).default),y=["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","-","."," ","$","/","+","%","*"],o=[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 l(P){return function(P){return o[P].toString(2)}(f(P))}function f(P){return y.indexOf(P)}S.CODE39=I},2679:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function d(n,f){for(var _=0;_<f.length;_++){var P=f[_];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(n,P.key,P)}}return function(n,f,_){return f&&d(n.prototype,f),_&&d(n,_),n}}(),N=T(2998),x=E(T(188));function E(d){return d&&d.__esModule?d:{default:d}}var l=function(d){function n(f,_){!function(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n);var P=function(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,f,_));return P.fontSize=!_.flat&&_.fontSize>10*_.width?10*_.width:_.fontSize,P.guardHeight=_.height+P.fontSize/2+_.textMargin,P}return function(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),L(n,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(_,P){return this.text.substr(_,P)}},{key:"leftEncode",value:function(_,P){return(0,x.default)(_,P)}},{key:"rightText",value:function(_,P){return this.text.substr(_,P)}},{key:"rightEncode",value:function(_,P){return(0,x.default)(_,P)}},{key:"encodeGuarded",value:function(){var _={fontSize:this.fontSize},P={height:this.guardHeight};return[{data:N.SIDE_BIN,options:P},{data:this.leftEncode(),text:this.leftText(),options:_},{data:N.MIDDLE_BIN,options:P},{data:this.rightEncode(),text:this.rightText(),options:_},{data:N.SIDE_BIN,options:P}]}},{key:"encodeFlat",value:function(){return{data:[N.SIDE_BIN,this.leftEncode(),N.MIDDLE_BIN,this.rightEncode(),N.SIDE_BIN].join(""),text:this.text}}}]),n}(E(T(6615)).default);S.default=l},7674:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var d,L=function(){function d(n,f){for(var _=0;_<f.length;_++){var P=f[_];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(n,P.key,P)}}return function(n,f,_){return f&&d(n.prototype,f),_&&d(n,_),n}}(),N=function d(n,f,_){null===n&&(n=Function.prototype);var P=Object.getOwnPropertyDescriptor(n,f);if(void 0===P){var R=Object.getPrototypeOf(n);return null===R?void 0:d(R,f,_)}if("value"in P)return P.value;var U=P.get;return void 0===U?void 0:U.call(_)},t=T(2998),F=(d=T(2679))&&d.__esModule?d:{default:d},o=function(n){return(10-n.substr(0,12).split("").map(function(_){return+_}).reduce(function(_,P,R){return R%2?_+3*P:_+P},0)%10)%10},l=function(d){function n(f,_){(function(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")})(this,n),-1!==f.search(/^[0-9]{12}$/)&&(f+=o(f));var P=function(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,f,_));return P.lastChar=_.lastChar,P}return function(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),L(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===o(this.data)}},{key:"leftText",value:function(){return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var _=this.data.substr(1,6),P=t.EAN13_STRUCTURE[this.data[0]];return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,_,P)}},{key:"rightText",value:function(){return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var _=this.data.substr(7,6);return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,_,"RRRRRR")}},{key:"encodeGuarded",value:function(){var _=N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(_.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(_.push({data:"00"}),_.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),_}}]),n}(F.default);S.default=l},2649:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function d(n,f){for(var _=0;_<f.length;_++){var P=f[_];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(n,P.key,P)}}return function(n,f,_){return f&&d(n.prototype,f),_&&d(n,_),n}}(),N=T(2998),x=E(T(188));function E(d){return d&&d.__esModule?d:{default:d}}var l=function(d){function n(f,_){return function(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),function(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,f,_))}return function(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),L(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var _=N.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,x.default)(this.data,_,"01"),text:this.text}}}]),n}(E(T(6615)).default);S.default=l},639:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function n(f,_){for(var P=0;P<_.length;P++){var R=_[P];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(f,R.key,R)}}return function(f,_,P){return _&&n(f.prototype,_),P&&n(f,P),f}}(),N=T(2998),x=E(T(188));function E(n){return n&&n.__esModule?n:{default:n}}var d=function(n){function f(_,P){return function(n,f){if(!(n instanceof f))throw new TypeError("Cannot call a class as a function")}(this,f),function(n,f){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||"object"!=typeof f&&"function"!=typeof f?n:f}(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,_,P))}return function(n,f){if("function"!=typeof f&&null!==f)throw new TypeError("Super expression must either be null or a function, not "+typeof f);n.prototype=Object.create(f&&f.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(n,f):n.__proto__=f)}(f,n),L(f,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var P=N.EAN5_STRUCTURE[function(f){return f.split("").map(function(P){return+P}).reduce(function(P,R,U){return U%2?P+9*R:P+3*R},0)%10}(this.data)];return{data:"1011"+(0,x.default)(this.data,P,"01"),text:this.text}}}]),f}(E(T(6615)).default);S.default=d},8036:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var l,L=function(){function l(d,n){for(var f=0;f<n.length;f++){var _=n[f];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(d,_.key,_)}}return function(d,n,f){return n&&l(d.prototype,n),f&&l(d,f),d}}(),N=function l(d,n,f){null===d&&(d=Function.prototype);var _=Object.getOwnPropertyDescriptor(d,n);if(void 0===_){var P=Object.getPrototypeOf(d);return null===P?void 0:l(P,n,f)}if("value"in _)return _.value;var R=_.get;return void 0===R?void 0:R.call(f)},x=(l=T(2679))&&l.__esModule?l:{default:l},y=function(d){return(10-d.substr(0,7).split("").map(function(f){return+f}).reduce(function(f,_,P){return P%2?f+_:f+3*_},0)%10)%10},o=function(l){function d(n,f){return function(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}(this,d),-1!==n.search(/^[0-9]{7}$/)&&(n+=y(n)),function(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?l:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,n,f))}return function(l,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}(d,l),L(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===y(this.data)}},{key:"leftText",value:function(){return N(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var f=this.data.substr(0,4);return N(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftEncode",this).call(this,f,"LLLL")}},{key:"rightText",value:function(){return N(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var f=this.data.substr(4,4);return N(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightEncode",this).call(this,f,"RRRR")}}]),d}(x.default);S.default=o},2589:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function d(n,f){for(var _=0;_<f.length;_++){var P=f[_];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(n,P.key,P)}}return function(n,f,_){return f&&d(n.prototype,f),_&&d(n,_),n}}();S.checksum=l;var t=b(T(188));function b(d){return d&&d.__esModule?d:{default:d}}var o=function(d){function n(f,_){(function(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")})(this,n),-1!==f.search(/^[0-9]{11}$/)&&(f+=l(f));var P=function(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,f,_));return P.displayValue=_.displayValue,P.fontSize=_.fontSize>10*_.width?10*_.width:_.fontSize,P.guardHeight=_.height+P.fontSize/2+_.textMargin,P}return function(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),L(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==l(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var _="";return _+="101",_+=(0,t.default)(this.data.substr(0,6),"LLLLLL"),_+="01010",_+=(0,t.default)(this.data.substr(6,6),"RRRRRR"),{data:_+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var _=[];return this.displayValue&&_.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),_.push({data:"101"+(0,t.default)(this.data[0],"L"),options:{height:this.guardHeight}}),_.push({data:(0,t.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),_.push({data:"01010",options:{height:this.guardHeight}}),_.push({data:(0,t.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),_.push({data:(0,t.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&_.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),_}}]),n}(b(T(6615)).default);function l(d){var f,n=0;for(f=1;f<11;f+=2)n+=parseInt(d[f]);for(f=0;f<11;f+=2)n+=3*parseInt(d[f]);return(10-n%10)%10}S.default=o},2054:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function _(P,R){for(var U=0;U<R.length;U++){var G=R[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(P,G.key,G)}}return function(P,R,U){return R&&_(P.prototype,R),U&&_(P,U),P}}(),t=E(T(188)),F=E(T(6615)),b=T(2589);function E(_){return _&&_.__esModule?_:{default:_}}function y(_,P){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!P||"object"!=typeof P&&"function"!=typeof P?_:P}var l=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],d=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],n=function(_){function P(R,U){!function(_,P){if(!(_ instanceof P))throw new TypeError("Cannot call a class as a function")}(this,P);var G=y(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,R,U));if(G.isValid=!1,-1!==R.search(/^[0-9]{6}$/))G.middleDigits=R,G.upcA=f(R,"0"),G.text=U.text||""+G.upcA[0]+R+G.upcA[G.upcA.length-1],G.isValid=!0;else{if(-1===R.search(/^[01][0-9]{7}$/))return y(G);if(G.middleDigits=R.substring(1,R.length-1),G.upcA=f(G.middleDigits,R[0]),G.upcA[G.upcA.length-1]!==R[R.length-1])return y(G);G.isValid=!0}return G.displayValue=U.displayValue,G.fontSize=U.fontSize>10*U.width?10*U.width:U.fontSize,G.guardHeight=U.height+G.fontSize/2+U.textMargin,G}return function(_,P){if("function"!=typeof P&&null!==P)throw new TypeError("Super expression must either be null or a function, not "+typeof P);_.prototype=Object.create(P&&P.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(_,P):_.__proto__=P)}(P,_),L(P,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var U="";return U+="101",U+=this.encodeMiddleDigits(),{data:U+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var U=[];return this.displayValue&&U.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),U.push({data:"101",options:{height:this.guardHeight}}),U.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),U.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&U.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),U}},{key:"encodeMiddleDigits",value:function(){var U=this.upcA[0],W=d[parseInt(this.upcA[this.upcA.length-1])][parseInt(U)];return(0,t.default)(this.middleDigits,W)}}]),P}(F.default);function f(_,P){for(var R=parseInt(_[_.length-1]),U=l[R],G="",W=0,$=0;$<U.length;$++){var le=U[$];G+="X"===le?_[W++]:le}return(G=""+P+G)+(0,b.checksum)(G)}S.default=n},2998:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SIDE_BIN="101",S.MIDDLE_BIN="01010",S.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"]},S.EAN2_STRUCTURE=["LL","LG","GL","GG"],S.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],S.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},188:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=T(2998);S.default=function(x,F,b){var E=x.split("").map(function(y,o){return L.BINARIES[F[o]]}).map(function(y,o){return y?y[x[o]]:""});if(b){var I=x.length-1;E=E.map(function(y,o){return o<I?y+b:y})}return E.join("")}},9214:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UPCE=S.UPC=S.EAN2=S.EAN5=S.EAN8=S.EAN13=void 0;var N=n(T(7674)),x=n(T(8036)),b=n(T(639)),I=n(T(2649)),o=n(T(2589)),d=n(T(2054));function n(f){return f&&f.__esModule?f:{default:f}}S.EAN13=N.default,S.EAN8=x.default,S.EAN5=b.default,S.EAN2=I.default,S.UPC=o.default,S.UPCE=d.default},6651:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.GenericBarcode=void 0;var y,L=function(){function y(o,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}return function(o,l,d){return l&&y(o.prototype,l),d&&y(o,d),o}}(),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l,d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),L(o,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),o}(((y=T(6615))&&y.__esModule?y:{default:y}).default);S.GenericBarcode=I},9237:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),N=T(7851);function b(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}function E(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}var y=function(o){function l(){return b(this,l),E(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var n=this,f=this.data.match(/.{2}/g).map(function(_){return n.encodePair(_)}).join("");return{data:N.START_BIN+f+N.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var f=N.BINARIES[n[1]];return N.BINARIES[n[0]].split("").map(function(_,P){return("1"===_?"111":"1")+("1"===f[P]?"000":"0")}).join("")}}]),l}(((o=T(6615))&&o.__esModule?o:{default:o}).default);S.default=y},6701:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(9237))&&o.__esModule?o:{default:o},I=function(l){var d=l.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,f,_){return n+f*(3-_%2*2)},0);return 10*Math.ceil(d/10)-d},y=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),-1!==d.search(/^[0-9]{13}$/)&&(d+=I(d)),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===I(this.data)}}]),l}(t.default);S.default=y},7851:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.START_BIN="1010",S.END_BIN="11101",S.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},4059:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ITF14=S.ITF=void 0;var N=F(T(9237)),x=F(T(6701));function F(b){return b&&b.__esModule?b:{default:b}}S.ITF=N.default,S.ITF14=x.default},44:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),I=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"encode",value:function(){for(var n="110",f=0;f<this.data.length;f++){var P=parseInt(this.data[f]).toString(2);P=y(P,4-P.length);for(var R=0;R<P.length;R++)n+="0"==P[R]?"100":"110"}return{data:n+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),l}(((o=T(6615))&&o.__esModule?o:{default:o}).default);function y(o,l){for(var d=0;d<l;d++)o="0"+o;return o}S.default=I},6926:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,N=(y=T(44))&&y.__esModule?y:{default:y},t=T(9122),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l+(0,t.mod10)(l),d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),o}(N.default);S.default=I},6375:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,N=(y=T(44))&&y.__esModule?y:{default:y},t=T(9122),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),l+=(0,t.mod10)(l),l+=(0,t.mod10)(l),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l,d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),o}(N.default);S.default=I},2558:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,N=(y=T(44))&&y.__esModule?y:{default:y},t=T(9122),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l+(0,t.mod11)(l),d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),o}(N.default);S.default=I},3332:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,N=(y=T(44))&&y.__esModule?y:{default:y},t=T(9122),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),l+=(0,t.mod11)(l),l+=(0,t.mod10)(l),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l,d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),o}(N.default);S.default=I},9122:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.mod10=function(N){for(var t=0,x=0;x<N.length;x++){var F=parseInt(N[x]);t+=(x+N.length)%2==0?F:2*F%10+Math.floor(2*F/10)}return(10-t%10)%10},S.mod11=function(N){for(var t=0,x=[2,3,4,5,6,7],F=0;F<N.length;F++){var b=parseInt(N[N.length-1-F]);t+=x[F%x.length]*b}return(11-t%11)%11}},495:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.MSI1110=S.MSI1010=S.MSI11=S.MSI10=S.MSI=void 0;var N=l(T(44)),x=l(T(6926)),b=l(T(2558)),I=l(T(6375)),o=l(T(3332));function l(d){return d&&d.__esModule?d:{default:d}}S.MSI=N.default,S.MSI10=x.default,S.MSI11=b.default,S.MSI1010=I.default,S.MSI1110=o.default},4162:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.codabar=void 0;var y,L=function(){function y(o,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}return function(o,l,d){return l&&y(o.prototype,l),d&&y(o,d),o}}(),I=function(y){function o(l,d){(function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")})(this,o),0===l.search(/^[0-9\-\$\:\.\+\/]+$/)&&(l="A"+l+"A");var n=function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l.toUpperCase(),d));return n.text=n.options.text||n.text.replace(/[A-D]/g,""),n}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),L(o,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var d=[],n=this.getEncodings(),f=0;f<this.data.length;f++)d.push(n[this.data.charAt(f)]),f!==this.data.length-1&&d.push("0");return{text:this.text,data:d.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"}}}]),o}(((y=T(6615))&&y.__esModule?y:{default:y}).default);S.codabar=I},3413:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=T(8104),N=T(6625),t=T(9214),x=T(4059),F=T(495),b=T(3133),E=T(4162),I=T(6651);S.default={CODE39:L.CODE39,CODE128:N.CODE128,CODE128A:N.CODE128A,CODE128B:N.CODE128B,CODE128C:N.CODE128C,EAN13:t.EAN13,EAN8:t.EAN8,EAN5:t.EAN5,EAN2:t.EAN2,UPC:t.UPC,UPCE:t.UPCE,ITF14:x.ITF14,ITF:x.ITF,MSI:F.MSI,MSI10:F.MSI10,MSI11:F.MSI11,MSI1010:F.MSI1010,MSI1110:F.MSI1110,pharmacode:b.pharmacode,codabar:E.codabar,GenericBarcode:I.GenericBarcode}},3133:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.pharmacode=void 0;var y,L=function(){function y(o,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}return function(o,l,d){return l&&y(o.prototype,l),d&&y(o,d),o}}(),I=function(y){function o(l,d){!function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l,d));return n.number=parseInt(l,10),n}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),L(o,[{key:"encode",value:function(){for(var d=this.number,n="";!isNaN(d)&&0!=d;)d%2==0?(n="11100"+n,d=(d-2)/2):(n="100"+n,d=(d-1)/2);return{data:n=n.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),o}(((y=T(6615))&&y.__esModule?y:{default:y}).default);S.pharmacode=I},400:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function t(x,F){for(var b=0;b<F.length;b++){var E=F[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,F,b){return F&&t(x.prototype,F),b&&t(x,b),x}}(),N=function(){function t(x){(function(t,x){if(!(t instanceof x))throw new TypeError("Cannot call a class as a function")})(this,t),this.api=x}return T(t,[{key:"handleCatch",value:function(F){if("InvalidInputException"!==F.name)throw F;if(this.api._options.valid===this.api._defaults.valid)throw F.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(F){try{var b=F.apply(void 0,arguments);return this.api._options.valid(!0),b}catch(E){return this.handleCatch(E),this.api}}}]),t}();S.default=N},4779:(K,S)=>{"use strict";function T(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function L(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!E||"object"!=typeof E&&"function"!=typeof E?b:E}function N(b,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}Object.defineProperty(S,"__esModule",{value:!0});var t=function(b){function E(I,y){T(this,E);var o=L(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));return o.name="InvalidInputException",o.symbology=I,o.input=y,o.message='"'+o.input+'" is not a valid input for '+o.symbology,o}return N(E,Error),E}(),x=function(b){function E(){T(this,E);var I=L(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));return I.name="InvalidElementException",I.message="Not supported type to render on",I}return N(E,Error),E}(),F=function(b){function E(){T(this,E);var I=L(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));return I.name="NoElementException",I.message="No element to render on.",I}return N(E,Error),E}();S.InvalidInputException=t,S.InvalidElementException=x,S.NoElementException=F},7095:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function(L){return L.marginTop=L.marginTop||L.margin,L.marginBottom=L.marginBottom||L.margin,L.marginRight=L.marginRight||L.margin,L.marginLeft=L.marginLeft||L.margin,L}},7866:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=F(T(201)),x=F(T(1452));function F(E){return E&&E.__esModule?E:{default:E}}S.default=function(E){var I={};for(var y in x.default)x.default.hasOwnProperty(y)&&(E.hasAttribute("jsbarcode-"+y.toLowerCase())&&(I[y]=E.getAttribute("jsbarcode-"+y.toLowerCase())),E.hasAttribute("data-"+y.toLowerCase())&&(I[y]=E.getAttribute("data-"+y.toLowerCase())));return I.value=E.getAttribute("jsbarcode-value")||E.getAttribute("data-value"),(0,N.default)(I)}},4441:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(l){return typeof l}:function(l){return l&&"function"==typeof Symbol&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},t=E(T(7866)),F=E(T(1462)),b=T(4779);function E(l){return l&&l.__esModule?l:{default:l}}S.default=function I(l){if("string"==typeof l)return function(l){var d=document.querySelectorAll(l);if(0!==d.length){for(var n=[],f=0;f<d.length;f++)n.push(I(d[f]));return n}}(l);if(Array.isArray(l)){for(var d=[],n=0;n<l.length;n++)d.push(I(l[n]));return d}if("undefined"!=typeof HTMLCanvasElement&&l instanceof HTMLImageElement)return function(l){var d=document.createElement("canvas");return{element:d,options:(0,t.default)(l),renderer:F.default.CanvasRenderer,afterRender:function(){l.setAttribute("src",d.toDataURL())}}}(l);if(l&&l.nodeName&&"svg"===l.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&l instanceof SVGElement)return{element:l,options:(0,t.default)(l),renderer:F.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&l instanceof HTMLCanvasElement)return{element:l,options:(0,t.default)(l),renderer:F.default.CanvasRenderer};if(l&&l.getContext)return{element:l,renderer:F.default.CanvasRenderer};if(l&&"object"===(void 0===l?"undefined":L(l))&&!l.nodeName)return{element:l,renderer:F.default.ObjectRenderer};throw new b.InvalidElementException}},2308:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function(L){var N=[];return function t(x){if(Array.isArray(x))for(var F=0;F<x.length;F++)t(x[F]);else x.text=x.text||"",x.data=x.data||"",N.push(x)}(L),N}},7720:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var T=Object.assign||function(L){for(var N=1;N<arguments.length;N++){var t=arguments[N];for(var x in t)Object.prototype.hasOwnProperty.call(t,x)&&(L[x]=t[x])}return L};S.default=function(L,N){return T({},L,N)}},201:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function(L){var N=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in N)N.hasOwnProperty(t)&&"string"==typeof L[t=N[t]]&&(L[t]=parseInt(L[t],10));return"string"==typeof L.displayValue&&(L.displayValue="false"!=L.displayValue),L}},1452:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default={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(){}}},3010:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var I,L=function(){function I(y,o){for(var l=0;l<o.length;l++){var d=o[l];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(y,d.key,d)}}return function(y,o,l){return o&&I(y.prototype,o),l&&I(y,l),y}}(),t=(I=T(7720))&&I.__esModule?I:{default:I},x=T(9390),E=function(){function I(y,o,l){(function(I,y){if(!(I instanceof y))throw new TypeError("Cannot call a class as a function")})(this,I),this.canvas=y,this.encodings=o,this.options=l}return L(I,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var o=0;o<this.encodings.length;o++){var l=(0,t.default)(this.options,this.encodings[o].options);this.drawCanvasBarcode(l,this.encodings[o]),this.drawCanvasText(l,this.encodings[o]),this.moveCanvasDrawing(this.encodings[o])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var o=this.canvas.getContext("2d");o.save(),(0,x.calculateEncodingAttributes)(this.encodings,this.options,o);var l=(0,x.getTotalWidthOfEncodings)(this.encodings),d=(0,x.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=l+this.options.marginLeft+this.options.marginRight,this.canvas.height=d,o.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(o.fillStyle=this.options.background,o.fillRect(0,0,this.canvas.width,this.canvas.height)),o.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(o,l){var f,d=this.canvas.getContext("2d"),n=l.data;f="top"==o.textPosition?o.marginTop+o.fontSize+o.textMargin:o.marginTop,d.fillStyle=o.lineColor;for(var _=0;_<n.length;_++){var P=_*o.width+l.barcodePadding;"1"===n[_]?d.fillRect(P,f,o.width,o.height):n[_]&&d.fillRect(P,f,o.width,o.height*n[_])}}},{key:"drawCanvasText",value:function(o,l){var f,_,d=this.canvas.getContext("2d");o.displayValue&&(_="top"==o.textPosition?o.marginTop+o.fontSize-o.textMargin:o.height+o.textMargin+o.marginTop+o.fontSize,d.font=o.fontOptions+" "+o.fontSize+"px "+o.font,"left"==o.textAlign||l.barcodePadding>0?(f=0,d.textAlign="left"):"right"==o.textAlign?(f=l.width-1,d.textAlign="right"):(f=l.width/2,d.textAlign="center"),d.fillText(l.text,f,_))}},{key:"moveCanvasDrawing",value:function(o){this.canvas.getContext("2d").translate(o.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),I}();S.default=E},1462:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=E(T(3010)),x=E(T(5995)),b=E(T(3911));function E(I){return I&&I.__esModule?I:{default:I}}S.default={CanvasRenderer:N.default,SVGRenderer:x.default,ObjectRenderer:b.default}},3911:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function t(x,F){for(var b=0;b<F.length;b++){var E=F[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,F,b){return F&&t(x.prototype,F),b&&t(x,b),x}}(),N=function(){function t(x,F,b){(function(t,x){if(!(t instanceof x))throw new TypeError("Cannot call a class as a function")})(this,t),this.object=x,this.encodings=F,this.options=b}return T(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();S.default=N},9390:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.getTotalWidthOfEncodings=S.calculateEncodingAttributes=S.getBarcodePadding=S.getEncodingHeight=S.getMaximumHeightOfEncodings=void 0;var o,N=(o=T(7720))&&o.__esModule?o:{default:o};function x(o,l){return l.height+(l.displayValue&&o.text.length>0?l.fontSize+l.textMargin:0)+l.marginTop+l.marginBottom}function F(o,l,d){if(d.displayValue&&l<o){if("center"==d.textAlign)return Math.floor((o-l)/2);if("left"==d.textAlign)return 0;if("right"==d.textAlign)return Math.floor(o-l)}return 0}function y(o,l,d){var n;if(d)n=d;else{if("undefined"==typeof document)return 0;n=document.createElement("canvas").getContext("2d")}n.font=l.fontOptions+" "+l.fontSize+"px "+l.font;var f=n.measureText(o);return f?f.width:0}S.getMaximumHeightOfEncodings=function(o){for(var l=0,d=0;d<o.length;d++)o[d].height>l&&(l=o[d].height);return l},S.getEncodingHeight=x,S.getBarcodePadding=F,S.calculateEncodingAttributes=function(o,l,d){for(var n=0;n<o.length;n++){var P,f=o[n],_=(0,N.default)(l,f.options);P=_.displayValue?y(f.text,_,d):0;var R=f.data.length*_.width;f.width=Math.ceil(Math.max(P,R)),f.height=x(f,_),f.barcodePadding=F(P,R,_)}},S.getTotalWidthOfEncodings=function(o){for(var l=0,d=0;d<o.length;d++)l+=o[d].width;return l}},5995:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,L=function(){function y(o,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}return function(o,l,d){return l&&y(o.prototype,l),d&&y(o,d),o}}(),t=(y=T(7720))&&y.__esModule?y:{default:y},x=T(9390),E="http://www.w3.org/2000/svg",I=function(){function y(o,l,d){(function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")})(this,y),this.svg=o,this.encodings=l,this.options=d,this.document=d.xmlDocument||document}return L(y,[{key:"render",value:function(){var l=this.options.marginLeft;this.prepareSVG();for(var d=0;d<this.encodings.length;d++){var n=this.encodings[d],f=(0,t.default)(this.options,n.options),_=this.createGroup(l,f.marginTop,this.svg);this.setGroupOptions(_,f),this.drawSvgBarcode(_,f,n),this.drawSVGText(_,f,n),l+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,x.calculateEncodingAttributes)(this.encodings,this.options);var l=(0,x.getTotalWidthOfEncodings)(this.encodings),d=(0,x.getMaximumHeightOfEncodings)(this.encodings),n=l+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,d),this.options.background&&this.drawRect(0,0,n,d,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(l,d,n){var _,f=n.data;_="top"==d.textPosition?d.fontSize+d.textMargin:0;for(var P=0,R=0,U=0;U<f.length;U++)R=U*d.width+n.barcodePadding,"1"===f[U]?P++:P>0&&(this.drawRect(R-d.width*P,_,d.width*P,d.height,l),P=0);P>0&&this.drawRect(R-d.width*(P-1),_,d.width*P,d.height,l)}},{key:"drawSVGText",value:function(l,d,n){var _,P,f=this.document.createElementNS(E,"text");d.displayValue&&(f.setAttribute("style","font:"+d.fontOptions+" "+d.fontSize+"px "+d.font),P="top"==d.textPosition?d.fontSize-d.textMargin:d.height+d.textMargin+d.fontSize,"left"==d.textAlign||n.barcodePadding>0?(_=0,f.setAttribute("text-anchor","start")):"right"==d.textAlign?(_=n.width-1,f.setAttribute("text-anchor","end")):(_=n.width/2,f.setAttribute("text-anchor","middle")),f.setAttribute("x",_),f.setAttribute("y",P),f.appendChild(this.document.createTextNode(n.text)),l.appendChild(f))}},{key:"setSvgAttributes",value:function(l,d){var n=this.svg;n.setAttribute("width",l+"px"),n.setAttribute("height",d+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+l+" "+d),n.setAttribute("xmlns",E),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(l,d,n){var f=this.document.createElementNS(E,"g");return f.setAttribute("transform","translate("+l+", "+d+")"),n.appendChild(f),f}},{key:"setGroupOptions",value:function(l,d){l.setAttribute("style","fill:"+d.lineColor+";")}},{key:"drawRect",value:function(l,d,n,f,_){var P=this.document.createElementNS(E,"rect");return P.setAttribute("x",l),P.setAttribute("y",d),P.setAttribute("width",n),P.setAttribute("height",f),_.appendChild(P),P}}]),y}();S.default=I},4469:(K,S,T)=>{"use strict";T.r(S),T.d(S,{PagesModule:()=>Ae});var L=T(6019),N=T(1086),t=T(3668),x=T(4099),F=T(8735);let b=(()=>{class w{constructor(){this.store=new x.X([])}getState(){return this.store.asObservable().pipe((0,F.h)(u=>void 0!==u))}setState(u){this.store.next(u)}}return w.\u0275fac=function(u){return new(u||w)},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})();var E=T(1286),I=T(1273),y=T(3405),o=T(8805);let l=(()=>{class w{static StringFormat(u,...h){for(let O=0;O<h.length;O++)u=u.replace(`{${O}}`,h[O]);return u}static IsNotEmpty(u){return""!=u&&u!=w.GuidEmpty&&null!=u&&null!=u}static IsEmpty(u){return""==u||null==u||null==u||u==w.GuidEmpty}static FilterByID(u,h){try{const O=u.filter(D=>D.ID==h);if(O.length>0)return O[0]}catch(O){console.log("error filter")}return null}static DateOnly(u){return u?new Date(new Date(u).toDateString()):new Date((new Date).toDateString())}}return w.GuidEmpty="00000000-0000-0000-0000-000000000000",w.DecimalMinValue="-7.922816251426434e+28",w.InputLockTimeSpan=500,w.MinDate="0001-01-01T00:00:00",w.MinTime="00:00:00",w})();var P=(()=>{return(w=P||(P={}))[w.SUPPLIER_BILL=0]="SUPPLIER_BILL",w[w.OUTLET_DELIVERY=1]="OUTLET_DELIVERY",P;var w})(),R=T(5304),U=T(2193),G=T(9090),W=T(5496),$=T(9010);let le=(()=>{class w{constructor(u,h){this.data=u,this.dialogRef=h,this.outlets=u.outlets}ngOnInit(){this.initModalConfig(),this.initTransactionType()}initModalConfig(){this.modalConfig=new U.O,this.modalConfig.title="Choose your transaction",this.modalConfig.hideMoreButton=!0}initTransactionType(){this.transactionTypes=[{title:"Supplier Bill",type:P.SUPPLIER_BILL},{title:"Outlet Delivery",type:P.OUTLET_DELIVERY}]}onOk(){this.selectedOutlet&&this.poNumber&&this.dialogRef.close({Outlet:this.selectedOutlet.getName,Number:this.poNumber,Type:this.selectedTransactionType})}onCancel(){this.dialogRef.close()}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.WI),t.Y36(R.so))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-form-add-bill"]],decls:16,vars:10,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["bindLabel","title","bindValue","type","placeholder","Choose Type",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"pt-6"],["bindLabel","Name","placeholder","Choose Outlet",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"form-label-group"],["min","1","id","qty","type","text","placeholder","Number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"]],template:function(u,h){1&u&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return h.onOk()})("onCancel",function(){return h.onCancel()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"table",3),t.TgZ(5,"tbody"),t.TgZ(6,"tr",4),t.TgZ(7,"td"),t.TgZ(8,"ng-select",5),t.NdJ("ngModelChange",function(D){return h.selectedTransactionType=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(9,"tr",4),t.TgZ(10,"td",6),t.TgZ(11,"ng-select",7),t.NdJ("ngModelChange",function(D){return h.selectedOutlet=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"tr",4),t.TgZ(13,"td",6),t.TgZ(14,"div",8),t.TgZ(15,"input",9),t.NdJ("ngModelChange",function(D){return h.poNumber=D}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.Q6J("config",h.modalConfig),t.xp6(8),t.Q6J("items",h.transactionTypes)("ngModel",h.selectedTransactionType)("clearable",!1)("appendTo","body"),t.xp6(3),t.Q6J("items",h.outlets)("ngModel",h.selectedOutlet)("clearable",!1)("appendTo","body"),t.xp6(4),t.Q6J("ngModel",h.poNumber))},directives:[G.M,W.w9,$.JJ,$.On,$.Fj],styles:[""]}),w})();var re=T(1366),te=T(8053),ce=T(8930);let H=(()=>{class w{constructor(u){this.httpService=u,this.barcodeConfigState=new x.X(null)}updatePaperFormatConfig(u){let h=localStorage.getItem("Domain");return this.httpService.post("/api/Config/SaveConfig",{SubDomain:h,Version:this.paperFormatVersion,PaperFormats:u})}getPaperFormatConfig(){let u=localStorage.getItem("Domain"),h=[];return this.httpService.post("/api/Config/PaperConfig",{SubDomain:u}).pipe((0,te.U)(J=>(this.paperFormatVersion=J.version,h=J.PaperFormats,h)))}setBarcodeConfigState(u){this.barcodeConfigState.next(u)}getBarcodeConfigState(){return this.barcodeConfigState.asObservable().pipe((0,F.h)(u=>l.IsNotEmpty(u)))}}return w.\u0275fac=function(u){return new(u||w)(t.LFG(ce.O))},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})();var k=T(4522);class ee{constructor(A){A&&(this.AccountID=A.AccountID,this.CalculationTypeID=A.CalculationTypeID,this.ID=A.ID,this.Index=A.Index,this.Label=A.Label,this.MultipleTaxTypeID=A.MultipleTaxTypeID,this.Note=A.Note,this.PrintVisible=A.PrintVisible,this.Rate=A.Rate,this.TypeID=A.TypeID,this.Name=A.Name,this.Type=A.Type)}get getID(){return this.ID}get getType(){return this.Type}get getName(){return this.Name}get getAccountID(){return this.AccountID}set setAccountId(A){this.AccountID=A}get getCalculationTypeID(){return this.CalculationTypeID}set setCalculationID(A){this.CalculationTypeID=A}get getRate(){return this.Rate}set setRate(A){this.Rate=A}get getLabel(){return this.Label}}class Q{get getID(){return this.ID}set setID(A){this.ID=A}get getSelectedPromotion(){return this.SelectedPromotion}set setSelectedPromotion(A){this.SelectedPromotion=A}get getDescription(){return this.description}set setDescription(A){this.description=A}set setBarcodeTitle(A){this.barcodeTitle=A}get getBarcodeTitle(){return this.barcodeTitle}set setCustomPrice(A){this.customPrice=A}get getCustomPrice(){return this.customPrice}get getUnitPrice(){return this.UnitPrice}set setUnitPrice(A){this.UnitPrice=A}get getCode(){return this.Code}set setCode(A){this.barcodeTitle=A,this.Code=A}get getModel(){return this.Model}set setModel(A){this.Model=A}get getName(){return this.Name}set setName(A){this.Name=A}get getCurrency(){return this.CurrencySymbol}set setCurrency(A){this.CurrencySymbol=A}}class Y{get getCode(){return this.Code}get getName(){return this.Name}get getSuspended(){return this.Suspended}set setCode(A){this.Code=A}set setName(A){this.Name=A}set setSuspended(A){this.Suspended=A}}class oe{get getOutlet(){return this.Outlet}get getNumber(){return this.Number}get getDate(){return this.Date}get getDueDate(){return this.DueDate}get getSupplier(){return this.Supplier}get getCreatorID(){return this.CreatorID}get getCreated(){return this.Created}get getDiscount1(){return this.Discount1}get getDiscountAmount(){return this.DiscountAmount}get getGross(){return this.Gross}get getDiscountTotal(){return this.DiscountTotal}get getTaxType(){return this.TaxType}get getTax(){return this.Tax}get getPurchase(){return this.Purchase}get getPurchaseNTax(){return this.PurchaseNTax}get getDelivery(){return this.Delivery}get getVariants(){return this.Variants}get getPayments(){return this.Payments}set setOutlet(A){this.Outlet=A}set setNumber(A){this.Number=A}set setDate(A){this.Date=A}set setDueDate(A){this.DueDate=A}set setSupplier(A){this.Supplier=A}set setCreatorID(A){this.CreatorID=A}set setCreated(A){this.Created=A}set setDiscount1(A){this.Discount1=A}set setDiscountAmount(A){this.DiscountAmount=A}set setGross(A){this.Gross=A}set setDiscountTotal(A){this.DiscountTotal=A}set setTaxType(A){this.TaxType=A}set setTax(A){this.Tax=A}set setPurchase(A){this.Purchase=A}set setPurchaseNTax(A){this.PurchaseNTax=A}set setDelivery(A){this.Delivery=A}set setVariants(A){this.Variants=A}set setPayments(A){this.Payments=A}}class Pe extends Q{constructor(){super()}get getVariantID(){return this.VariantID}get getQuantity(){return this.Quantity}get getPrice(){return this.Price}get getDiscount(){return this.Discount}get getNettPrice(){return this.NettPrice}set setVariantID(A){this.VariantID=A}set setQuantity(A){this.Quantity=A}set setPrice(A){this.Price=A}set setDiscount(A){this.Discount=A}set setNettPrice(A){this.NettPrice=A}}class ye{get getID(){return this.ID}set setID(A){this.ID=A}get getName(){return this.Name}set setName(A){this.Name=A}get getDiscount(){return this.Discount}get getExtraCost(){return this.ExtraCost}get getPromotionID(){return this.PromotionID}get getUnitPrice(){return this.UnitPrice}set setDiscount(A){this.Discount=A}set setExtraCost(A){this.ExtraCost=A}set setPromotionID(A){this.PromotionID=A}set setUnitPrice(A){this.UnitPrice=A}}let pe=(()=>{class w{constructor(){}getProductModel(u){let h=new Q;return h.setID=u.ID,h.setCode=u.Code,h.setCurrency=u.CurrencySymbol,h.setModel=u.Model,h.setName=u.Name,h.setUnitPrice=u.UnitPrice,h.setDescription=u.Description,h}getTaxModel(u){return new ee(u)}getOutletModel(u){let h=new Y;return h.setCode=u.Code,h.setName=u.Name,h.setSuspended=u.Suspended,h}getVariantModel(u){let h=new Pe;return h.setCode=u.Code,h.setDiscount=u.Discount,h.setNettPrice=u.NettPrice,h.setPrice=u.Price,h.setUnitPrice=u.UnitPrice,h.setQuantity=u.Quantity,h.setVariantID=u.VariantID,h.setName=u.Name,h}getBillModel(u){let h=new oe;return h.setNumber=u.Number,h.setOutlet=u.Outlet,h.setVariants=u.Variants?u.Variants.map(O=>this.getVariantModel(O)):[],h}getPromotionModel(u){let h=new ye;return h.setDiscount=u.Discount,h.setExtraCost=u.ExtraCost,h.setPromotionID=u.PromotionID,h.setUnitPrice=u.UnitPrice,h.setName=u.Name,h.setID=u.ID,h}}return w.\u0275fac=function(u){return new(u||w)},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})(),we=(()=>{class w{constructor(u,h,O){this.httpService=u,this.http=h,this.factoryService=O}getProductById(u){let h=localStorage.getItem("Domain");return this.httpService.post(`https://${h}/API/V3/Variant/ID`,{ID:u}).pipe((0,te.U)(O=>this.factoryService.getProductModel(O)))}getPromotionByProducID(u){let h=localStorage.getItem("Domain");return this.httpService.post(`https://${h}/API/v3/PromotionEvent/GetByVariantID`,{VariantID:u}).pipe((0,te.U)(O=>O.map(J=>this.factoryService.getPromotionModel(J))))}uploadProducts(u){let h=localStorage.getItem("Domain"),O=new FormData;return O.append("file",u,u.name),this.httpService.postFormData(`https://${h}/API/Product/UploadCSVforBarcode`,O).pipe((0,te.U)(D=>D.map(J=>(J.Print=J.Print.map(ie=>this.factoryService.getProductModel(ie)),J))))}getTax(){let u=localStorage.getItem("Domain"),h=localStorage.getItem("Token"),O=`https://${u}/API/V3/Tax`,D=new k.WM({authorization:"Bearer "+h,"content-type":"application/json","X-ClientId":"dealpos-app"});return this.http.get(O,{headers:D}).pipe((0,te.U)(J=>{if(J)return J.map(ie=>this.factoryService.getTaxModel(ie))}))}}return w.\u0275fac=function(u){return new(u||w)(t.LFG(ce.O),t.LFG(k.eN),t.LFG(pe))},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})();var Se=T(8076),me=T(5686),Ce=T(6731);const Oe=["input"];function xe(w,A){if(1&w&&t._UZ(0,"img",10),2&w){const u=t.oxw().$implicit;t.Q6J("src",u.ImgUrl,t.LSH)}}function Fe(w,A){if(1&w){const u=t.EpF();t.TgZ(0,"mat-option",8),t.NdJ("click",function(O){const J=t.CHM(u).$implicit;return t.oxw().changeDisplayName(J),O.stopPropagation()}),t.YNc(1,xe,1,1,"img",9),t._uU(2),t.qZA()}if(2&w){const u=A.$implicit,h=t.oxw();t.Q6J("value",u),t.xp6(1),t.Q6J("ngIf",h.renderThumbnail&&u.ImgUrl),t.xp6(1),t.hij(" ",u.Value," ")}}let Le=(()=>{class w{constructor(u,h){this.httpService=u,this.ngZone=h,this.offlineStorage=[],this.inputLock=!1,this.renderThumbnail=!1,this.onOffline=new t.vpe,this.onEnter=new t.vpe,this.onSelect=new t.vpe,this.onOptionSelect=new t.vpe,this.reset=new t.vpe,this.termControl=new $.NI(""),this.options=[],this.complete=!1,this.foundProduct=!1,this.propagateChange=O=>{},this.termControl.valueChanges.pipe((0,me.b)(500)).subscribe(O=>{this.options=[],"object"==typeof O?(this.value=O.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(O.Value),this.complete=!0),this.onSelect&&this.onSelect.emit(O.Key),this.options=[],"object"==typeof O&&(this.value=O.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(O.Value),this.complete=!0),this.onOptionSelect)&&this.onOptionSelect.emit(JSON.stringify({Key:O.Key,Value:O.Value}))):"string"==typeof O&&O.length>0?O.length>2&&!this.inputLock&&this.search(O):this.clear()})}set display(u){this.input.nativeElement.value=u}get value(){return this._value}set value(u){this._value=u,this.propagateChange(this._value)}ngOnChanges(u){null!=u.ngModel&&null==u.ngModel.currentValue&&this.clear(),null!=u.display&&u.display.currentValue!=u.display.previousValue&&this.termControl.setValue(u.display.currentValue)}ngAfterViewInit(){}search(u){if(this.termControl.value.length>0){let h={};if(this.data&&(h=this.data),h.prefix=u,h.count=100,this.complete)this.complete=!1;else{let O=this.url,D=localStorage.getItem("Domain");D&&(O=`https://${D}${this.url}`),this.httpService.post(O,h).subscribe(J=>{this.options=J,this.foundProduct=this.options.length>0})}}else this.options=null}onblur(){setTimeout(()=>{},600)}changeDisplayName(u){this.input.nativeElement.value=u.Value}onKeydown(u){const h=u.key;"Enter"===h?(this.clearOnSelect&&this.clear(),!this.foundProduct&&this.termControl.value.length>0&&(this.onEnter.emit(this.termControl.value),u.stopPropagation()),null!=this.termControl.value&&(this.input.nativeElement.value=this.termControl.value.Value),this.foundProduct=!1):(this.inputLock&&("Backspace"===h?this.clear():this.validateInputLock()),this.complete=!1,this.reset.emit())}validateInputLock(){""==this.input.nativeElement.value||0==this.input.nativeElement.value.length?this.startInput=new Date:(new Date).getTime()-this.startInput.getTime()>500&&this.clear()}clear(){this.value=null,this.input.nativeElement.value=""}displayFn(u){return u&&u.Value}writeValue(u){}registerOnChange(u){this.propagateChange=u}registerOnTouched(){}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(ce.O),t.Y36(t.R0b))},w.\u0275cmp=t.Xpm({type:w,selectors:[["autocomplete"]],viewQuery:function(u,h){if(1&u&&t.Gf(Oe,7),2&u){let O;t.iGM(O=t.CRH())&&(h.input=O.first)}},inputs:{placeholder:"placeholder",url:"url",clearOnSelect:"clearOnSelect",offlineStorage:"offlineStorage",inputLock:"inputLock",data:"data",renderThumbnail:"renderThumbnail",ngModel:"ngModel",displayText:"displayText",localStorage:"localStorage",_value:"_value",display:"display"},outputs:{onOffline:"onOffline",onEnter:"onEnter",onSelect:"onSelect",onOptionSelect:"onOptionSelect",reset:"reset"},features:[t._Bn([{provide:$.JU,useExisting:(0,t.Gpc)(()=>w),multi:!0}]),t.TTD],decls:9,vars:5,consts:[[1,"w-100"],[1,"form-label-group"],["id","input","type","text","matInput","",1,"form-control","text-black",3,"matAutocomplete","placeholder","formControl","paste","keydown","blur"],["input",""],["for","input"],["autoActiveFirstOption","true"],["autocomplete","matAutocomplete"],["class","option-autocomplete",3,"value","click",4,"ngFor","ngForOf"],[1,"option-autocomplete",3,"value","click"],["width","30","height","30",3,"src",4,"ngIf"],["width","30","height","30",3,"src"]],template:function(u,h){if(1&u&&(t.TgZ(0,"mat-form-field",0),t.TgZ(1,"div",1),t.TgZ(2,"input",2,3),t.NdJ("paste",function(D){return h.inputLock?D.preventDefault():""})("keydown",function(D){return h.onKeydown(D)})("blur",function(){return h.onblur()}),t.qZA(),t.TgZ(4,"label",4),t._uU(5),t.qZA(),t.qZA(),t.qZA(),t.TgZ(6,"mat-autocomplete",5,6),t.YNc(8,Fe,3,3,"mat-option",7),t.qZA()),2&u){const O=t.MAs(7);t.xp6(2),t.s9C("placeholder",h.placeholder||""),t.Q6J("matAutocomplete",O)("formControl",h.termControl),t.xp6(3),t.Oqu(h.placeholder||""),t.xp6(3),t.Q6J("ngForOf",h.options)}},directives:[Se.ZL,$.Fj,$.JJ,$.oH,Se.XC,L.sg,Ce.ey,L.O5],styles:["mat-option[_ngcontent-%COMP%]{font-size:12px}"]}),w})(),Me=(()=>{class w{}return w.\u0275fac=function(u){return new(u||w)},w.\u0275mod=t.oAB({type:w}),w.\u0275inj=t.cJS({imports:[[Se.Bb,L.ez,$.UX]]}),w})();var Te=T(1813);let Ie=(()=>{class w{constructor(u){this.elementRef=u,this.decimalPlaces=4,this.modifyValueOnWheel=!0,this.max="999999999999999.9999",this.min="-999999999999999.9999",this.propagateChange=O=>{},this.preventNegative=!1,this.numericElement=new Te(this.elementRef.nativeElement,null,{digitGroupSeparator:",",decimalCharacter:".",decimalPlaces:this.decimalPlaces,maximumValue:this.max,minimumValue:this.min,allowDecimalPadding:!1,showWarnings:!1})}set _max(u){u&&(this.max=u,this.updateNumericSettings())}set _min(u){u&&(this.min=u,this.updateNumericSettings())}ngOnInit(){""==this.percentage&&(this.max="100"),this.preventNegative&&(this.min="0.00"),this.updateNumericSettings()}updateNumericSettings(){const u={maximumValue:this.max,minimumValue:this.min,readOnly:this.isElementDisabled(),decimalPlaces:this.decimalPlaces,modifyValueOnWheel:this.modifyValueOnWheel};this.numericElement.update(u)}onKeyUp(){let u=this.numericElement.getNumber();this.propagateChange(u)}isElementDisabled(){let u=!1;return(!0===this.elementRef.nativeElement.readOnly||!0===this.elementRef.nativeElement.disabled)&&(u=!0),u}writeValue(u){null!=u&&this.numericElement.set(u)}registerOnChange(u){this.propagateChange=u}registerOnTouched(){}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(t.SBq))},w.\u0275dir=t.lG2({type:w,selectors:[["","autoNum",""]],hostBindings:function(u,h){1&u&&t.NdJ("keyup",function(){return h.onKeyUp()})},inputs:{percentage:"percentage",preventNegative:"preventNegative",decimalPlaces:"decimalPlaces",modifyValueOnWheel:"modifyValueOnWheel",_max:["max","_max"],_min:["min","_min"]},features:[t._Bn([{provide:$.JU,useExisting:(0,t.Gpc)(()=>w),multi:!0}])]}),w})(),de=(()=>{class w{constructor(u,h,O,D,J){this.dialogRef=u,this.barcodeService=h,this.productService=O,this.authenticationService=D,this.data=J,this.modalConfig=new U.O,this.variantName="",this.hasProductEdit=!0,this.hasPromotion=!1,this.destroy$=new y.xQ,this.variantName=J.variantName,this.qty=J.qty,this.customPrice=J.customPrice}ngOnInit(){this.getBarcodeConfig(),this.initModalConfig(),this.initProductUpdate(),this.initRoleProductEdit()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initRoleProductEdit(){let u=this.authenticationService.getRoles();this.hasProductEdit=-1!==u.findIndex(h=>"ProdE"==h)}initProductUpdate(){l.IsNotEmpty(this.data.variantId)&&this.getProductById(this.data.variantId).subscribe(u=>{this.product.setSelectedPromotion=this.data.promotion,this.hasPromotion=l.IsNotEmpty(this.data.promotion)})}getBarcodeConfig(){this.barcodeService.getBarcodeConfigState().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&(this.paperFormat=u)})}initModalConfig(){this.modalConfig.title="Add New Product Barcode?",this.modalConfig.hideMoreButton=!0}onSelectProduct(u){this.getProductById(u).subscribe(h=>{this.customPrice=h.getUnitPrice,this.hasPromotion=!1,this.product.setSelectedPromotion=null})}getProductById(u){return this.productService.getProductById(u).pipe((0,re.b)(h=>{this.product=h,this.getPromotionByProductID(u)}))}getPromotionByProductID(u){this.productService.getPromotionByProducID(u).subscribe(h=>{this.promotions=h})}onCustomPriceChange(u){this.customPrice=u}onSelectPromotion(u){u?(this.product.setSelectedPromotion=this.promotions.find(h=>h.getName==(null==u?void 0:u.getName)),this.customPrice=this.product.getUnitPrice,this.hasPromotion=l.IsNotEmpty(this.product.getSelectedPromotion)):(this.hasPromotion=!1,this.product.setSelectedPromotion=null)}onOk(){this.qty&&this.qty>0&&this.product&&this.dialogRef.close({customPrice:this.customPrice,product:this.product,quantity:this.qty})}onCancel(){this.dialogRef.close()}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.so),t.Y36(H),t.Y36(we),t.Y36(E.$),t.Y36(R.WI))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-form-add-variant"]],features:[t._Bn([L.JJ])],decls:24,vars:7,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["placeholder","Name","url","/API/AC/GetVariantSuggestionByCodeNName",3,"display","onSelect"],[1,"form-label-group"],["id","qty","type","text","placeholder","Quantity","aria-label","width","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","qty"],[1,"pb-9"],["bindLabel","Name","bindValue","PromotionID","appendTo","body","placeholder","Select Promotion Price",1,"sticky-top","tall",3,"items","ngModel","change"],["placeholder","Price","aria-label","width","autoNum","",1,"form-control",3,"ngModel","readonly","ngModelChange"],["for","price"]],template:function(u,h){1&u&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return h.onOk()})("onCancel",function(){return h.onCancel()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"table",3),t.TgZ(5,"tbody"),t.TgZ(6,"tr",4),t.TgZ(7,"td"),t.TgZ(8,"autocomplete",5),t.NdJ("onSelect",function(D){return h.onSelectProduct(D)}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(9,"tr",4),t.TgZ(10,"td"),t.TgZ(11,"div",6),t.TgZ(12,"input",7),t.NdJ("ngModelChange",function(D){return h.qty=D}),t.qZA(),t.TgZ(13,"label",8),t._uU(14,"Quantity"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(15,"tr",4),t.TgZ(16,"td",9),t.TgZ(17,"ng-select",10),t.NdJ("change",function(D){return h.onSelectPromotion(D)}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(18,"tr",4),t.TgZ(19,"td"),t.TgZ(20,"div",6),t.TgZ(21,"input",11),t.NdJ("ngModelChange",function(D){return h.onCustomPriceChange(D)}),t.qZA(),t.TgZ(22,"label",12),t._uU(23,"Price"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.Q6J("config",h.modalConfig),t.xp6(8),t.Q6J("display",h.variantName),t.xp6(4),t.Q6J("ngModel",h.qty),t.xp6(5),t.Q6J("items",h.promotions)("ngModel",null==h.product||null==h.product.getSelectedPromotion?null:h.product.getSelectedPromotion.getPromotionID),t.xp6(4),t.Q6J("ngModel",h.customPrice)("readonly",h.hasPromotion||!h.hasProductEdit))},directives:[G.M,Le,$.Fj,Ie,$.JJ,$.On,W.w9],styles:[""]}),w})(),ke=(()=>{class w{constructor(u,h){this.dialogRef=u,this.data=h,this.event=new t.vpe,this.modalConfig=new U.O}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig.title="Upload New Product Barcode?",this.modalConfig.hideMoreButton=!0}onOk(){this.dialogRef.close(this.files)}onCancel(){this.dialogRef.close()}onUploadFile(u){u&&(this.files=u.target.files)}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.so),t.Y36(R.WI))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-form-upload-variant"]],outputs:{event:"event"},decls:15,vars:1,consts:[[3,"config","onOk","onCancel"],[1,"row"],[1,"col-sm-12"],["href","//res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv"],[1,"value-title"],["type","file","aria-label","upload",3,"change"]],template:function(u,h){1&u&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return h.onOk()})("onCancel",function(){return h.onCancel()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Download Sample CSV"),t.qZA(),t.TgZ(6,"table"),t.TgZ(7,"tbody"),t.TgZ(8,"tr"),t.TgZ(9,"th",4),t._uU(10,"CSV File"),t.qZA(),t.TgZ(11,"td"),t._uU(12,":"),t.qZA(),t.TgZ(13,"td"),t.TgZ(14,"input",5),t.NdJ("change",function(D){return h.onUploadFile(D)}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&t.Q6J("config",h.modalConfig)},directives:[G.M],styles:[""]}),w})();var _e=T(8452);let Ve=(()=>{class w{constructor(u,h){this.httpService=u,this.factoryService=h}get(){let h=localStorage.getItem("Domain");return this.httpService.post(`https://${h}/api/v3/Outlet/p`,{Suspended:!1}).pipe((0,te.U)(O=>{let D=[];return O&&(D=O.map(J=>this.factoryService.getOutletModel(J))),D}))}}return w.\u0275fac=function(u){return new(u||w)(t.LFG(ce.O),t.LFG(pe))},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})(),Re=(()=>{class w{constructor(u,h){this.httpService=u,this.factoryService=h}get(u){let h=localStorage.getItem("Domain"),O=this.getEndPointByType(u.Type);return this.httpService.post(`https://${h}${O}`,{Outlet:u.Outlet,Number:u.Number}).pipe((0,te.U)(J=>J.map(ie=>this.factoryService.getVariantModel(ie))))}getEndPointByType(u){let h;return h=u===P.SUPPLIER_BILL?"/API/V3/Barcode/byBillNumber":"/API/V3/Barcode/byOutletDeliveryNumber",h}}return w.\u0275fac=function(u){return new(u||w)(t.LFG(ce.O),t.LFG(pe))},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})();function Ze(w,A){if(1&w){const u=t.EpF();t.TgZ(0,"tr",18),t.NdJ("click",function(){const O=t.CHM(u),D=O.$implicit,J=O.index;return t.oxw().onUpdateProduct(D,J)}),t.TgZ(1,"td"),t.TgZ(2,"i",19),t.NdJ("click",function(){const D=t.CHM(u).index;return t.oxw().onDeleteProduct(D)}),t.qZA(),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",20),t._uU(6),t.qZA(),t.qZA()}if(2&w){const u=A.$implicit;t.xp6(4),t.AsE(" ",null==u||null==u.Variants[0]?null:u.Variants[0].getName,"- ",null==u||null==u.Variants[0]?null:u.Variants[0].getCode," - "),t.xp6(2),t.Oqu(null==u?null:u.Quantity)}}let De=(()=>{class w{constructor(u,h,O,D,J,ie,be){this.dialog=u,this.productStateService=h,this.productService=O,this.toastService=D,this.queryParamService=J,this.outletService=ie,this.billService=be,this.destroy$=new y.xQ,this.stickerTotal=0,this.productGroups=[],this.productSource=[],this.getRouteParam(),this.initOutlets()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getRouteParam(){this.queryParamService.getState().pipe((0,o.R)(this.destroy$),(0,F.h)(u=>l.IsEmpty(u))).subscribe(u=>{u.ID&&this.getProductById(u.ID,5),u.billNumber&&this.getBill({Number:u.billNumber,Outlet:u.outletName,Type:P.SUPPLIER_BILL})})}initOutlets(){this.outletService.get().pipe((0,o.R)(this.destroy$)).subscribe(u=>{this.outlets=u})}onAddBill(){this.dialog.open(le,{width:"350px",data:{outlets:this.outlets}}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&this.getBill(u)})}getBill(u){this.billService.get(u).pipe((0,o.R)(this.destroy$)).subscribe(h=>{h&&h.forEach(O=>{this.checkAvailableProductCode(O);let D=this.generateProductByQty(O,O.getQuantity);this.productGroups=[...this.productGroups,{VariantID:O.getVariantID,Quantity:O.getQuantity,Variants:D}],this.updateProductsSource()})})}onAddProduct(){this.dialog.open(de,{width:"350px",data:{variantName:"",variantId:null,qty:null}}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&(this.customPrice=u.customPrice,this.generateProductBarcode(u.product,u.quantity))})}getProductById(u,h){this.productService.getProductById(u).pipe((0,o.R)(this.destroy$)).subscribe(O=>{O&&this.generateProductBarcode(O,h)})}generateProductBarcode(u,h){this.checkAvailableProductCode(u);let O=this.generateProductByQty(u,h);O=this.updateCustomPriceProducts(O),this.productGroups=[...this.productGroups,{VariantID:u.getID,Quantity:h,Variants:O}],this.updateProductsSource()}checkAvailableProductCode(u){u.getCode||this.toastService.error("Product has no code","Code Not Found")}onUpdateProduct(u,h){this.dialog.open(de,{width:"350px",data:{variantName:u.Variants[0].getName+" - "+u.Variants[0].getCode,variantId:u.VariantID,qty:u.Quantity,customPrice:u.Variants[0].getCustomPrice,promotion:u.Variants[0].getSelectedPromotion}}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(he=>{if(he){this.customPrice=he.customPrice,this.checkAvailableProductCode(he.product);let ue=this.generateProductByQty(he.product,he.quantity);ue=this.updateCustomPriceProducts(ue),this.productGroups[h].Variants=ue,this.productGroups[h].Quantity=he.quantity,this.productGroups[h].VariantID=he.product.getID,this.updateProductsSource()}})}onDeleteProduct(u){this.productGroups=this.productGroups.filter((h,O)=>O!==u),this.updateProductsSource()}updateProductsSource(){this.productSource=[],this.productGroups.forEach(u=>{this.productSource=[...this.productSource,...u.Variants]}),this.stickerTotal=this.productSource.length,this.productStateService.setState(this.productSource)}onUploadProduct(){this.dialog.open(ke,{width:"350px"}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(u=>{if(u){let h;this.productService.uploadProducts(u[0]).pipe((0,o.R)(this.destroy$)).subscribe(O=>{O&&(this.productGroups=[...this.productGroups,...O.map(D=>(h={Quantity:D.Quantity,VariantID:D.VariantID,Variants:D.Print},h))],this.updateProductsSource())})}})}updateCustomPriceProducts(u){let h=u;return this.customPrice&&(h=u.map(O=>(O.setCustomPrice=this.customPrice,O))),h}generateProductByQty(u,h){let O=[];for(let D=1;D<=h;D++)O.push(u);return O}onClear(){this.productGroups=[],this.updateProductsSource()}onPrint(){window.print()}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.uw),t.Y36(b),t.Y36(we),t.Y36(_e._W),t.Y36(I.U),t.Y36(Ve),t.Y36(Re))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-list-products"]],decls:29,vars:2,consts:[[1,"card","mt-3","sticky-top"],[1,"card-header","d-flex","justify-content-between","align-items-center","bg-white","pb-5",2,"border","none"],[1,"font-weight-light","m-1"],[1,"ml-1","font-italic","text-info","d-block","mt-1"],[1,"btn-group"],["type","button",1,"btn-md","btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-cart-plus"],["aria-hidden","true",1,"fa","fa-plus"],["aria-hidden","true",1,"fa","fa-upload"],[1,"card-body","py-0"],[1,"table","table-fixed"],[1,"thead-light","lh-1"],["scope","col"],["scope","col",1,"text-right"],[3,"click",4,"ngFor","ngForOf"],[1,"card-footer","d-flex","justify-content-end","bg-white"],[1,"btn","btn-lg","btn-outline-secondary","ml-5",3,"click"],[1,"btn","btn-lg","btn-success","ml-5",3,"click"],[3,"click"],["aria-hidden","true",1,"fa","fa-times",2,"color","#fb404b !important","cursor","pointer",3,"click"],[1,"text-right"]],template:function(u,h){1&u&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"h1",2),t._uU(3," Products "),t.TgZ(4,"small",3),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"div",4),t.TgZ(7,"button",5),t.NdJ("click",function(){return h.onAddBill()}),t._UZ(8,"i",6),t.qZA(),t.TgZ(9,"button",5),t.NdJ("click",function(){return h.onAddProduct()}),t._UZ(10,"i",7),t.qZA(),t.TgZ(11,"button",5),t.NdJ("click",function(){return h.onUploadProduct()}),t._UZ(12,"i",8),t.qZA(),t.qZA(),t.qZA(),t.TgZ(13,"div",9),t.TgZ(14,"table",10),t.TgZ(15,"thead",11),t.TgZ(16,"tr"),t._UZ(17,"th",12),t.TgZ(18,"th",12),t._uU(19,"NAME"),t.qZA(),t.TgZ(20,"th",13),t._uU(21,"QTY"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"tbody"),t.YNc(23,Ze,7,3,"tr",14),t.qZA(),t.qZA(),t.qZA(),t.TgZ(24,"div",15),t.TgZ(25,"a",16),t.NdJ("click",function(){return h.onClear()}),t._uU(26,"Clear"),t.qZA(),t.TgZ(27,"a",17),t.NdJ("click",function(){return h.onPrint()}),t._uU(28,"Print"),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.xp6(5),t.hij("( ",0===h.stickerTotal?"":h.stickerTotal," stickers )"),t.xp6(18),t.Q6J("ngForOf",h.productGroups))},directives:[L.sg],styles:["td[_ngcontent-%COMP%]{font-size:12px}th[_ngcontent-%COMP%]{font-size:12px}"]}),w})();function a(w,A){if(1&w){const u=t.EpF();t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2,"Selected Tax"),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"ng-select",45),t.NdJ("ngModelChange",function(O){return t.CHM(u),t.oxw().taxOptionSelected=O})("change",function(){return t.CHM(u),t.oxw().onSelectTaxType()}),t.qZA(),t.qZA(),t.TgZ(5,"td"),t._uU(6,"Applied Tax ex: 100 + 10% = 110"),t.qZA(),t.qZA()}if(2&w){const u=t.oxw();t.xp6(4),t.Q6J("items",u.taxOptions)("ngModel",u.taxOptionSelected)("clearable",!1)}}const c=function(w){return{active:w}};let g=(()=>{class w{constructor(u,h){this.dialogRef=u,this.data=h,this.event=new t.vpe,this.modalConfig=new U.O,this.taxOptions=[],this.paperWidth=0,this.marginTop=0,this.marginLeft=0,this.stickerWidth=0,this.stickerHeight=0,this.barcodeHeight=0,this.spacingColumn=0,this.spacingRow=0,this.barcode=!0,this.code=!0,this.price=!0,this.name=!0,this.removeDefault=!0,this.desc=!0,this.priceTax=!0,this.fontSize=0,this.namePrefix="",this.maxChar=0,this.publiclineHeight=0,this.paperFormat=JSON.parse(JSON.stringify(h.paperFormat)),this.taxs=h.taxs,this.authTax=h.authTax,this.initTaxOptions(),this.activeTab="paper"}ngOnInit(){this.initModalConfig(),this.initFormValue(),this.authTax&&this.initTaxOptionSelected()}initTaxOptions(){this.taxOptions=[],this.taxs.forEach((u,h)=>{this.taxOptions=[...this.taxOptions,{id:h+1,name:u.getName,ID:u.getID}]})}initTaxOptionSelected(){this.taxSelected&&(this.taxOptionSelected=this.taxOptions.find(u=>u.ID===this.taxSelected.ID))}onSelectTaxType(){this.taxSelected=this.taxs.find(u=>u.getID===this.taxOptionSelected.ID)}initModalConfig(){this.modalConfig.title="Sticker Configuration",this.modalConfig.hideMoreButton=!0}onOk(){this.setPaperFormat(),this.dialogRef.close(this.paperFormat)}onCancel(){this.dialogRef.close()}initFormValue(){this.paperFormat&&(this.barcodeHeight=this.paperFormat.BarcodeHeight,this.paperWidth=this.paperFormat.PaperWidth,this.marginTop=this.paperFormat.MarginTop,this.marginLeft=this.paperFormat.MarginLeft,this.stickerWidth=this.paperFormat.StickerWidth,this.stickerHeight=this.paperFormat.StickerHeight,this.barcodeHeight=this.paperFormat.BarcodeHeight,this.spacingColumn=this.paperFormat.ColumnSpacing,this.spacingRow=this.paperFormat.RowSpacing,this.barcode=this.paperFormat.BarcodeVisible,this.code=this.paperFormat.CodeVisible,this.price=this.paperFormat.PriceVisible,this.name=this.paperFormat.NameVisible,this.desc=this.paperFormat.DescriptionAsCode,this.fontSize=this.paperFormat.ProductNameFontSize,this.namePrefix=this.paperFormat.ProductNamePrefix,this.maxChar=this.paperFormat.ProductNameMaxLength,this.lineHeight=this.paperFormat.LineHeight,this.priceTax=this.paperFormat.PriceWithTax,this.taxSelected=this.paperFormat.TaxType,this.storeName=this.paperFormat.StoreName,this.currencySymbol=this.paperFormat.CurrencySymbol,this.promotionPriceLabel=this.paperFormat.PromotionPriceLabel,this.basicPriceLabel=this.paperFormat.BasicPriceLabel)}setPaperFormat(){this.paperFormat&&(this.checkPriceWithTax(),this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.PaperWidth=this.paperWidth,this.paperFormat.MarginTop=this.marginTop,this.paperFormat.MarginLeft=this.marginLeft,this.paperFormat.StickerWidth=this.stickerWidth,this.paperFormat.StickerHeight=this.stickerHeight,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.ColumnSpacing=this.spacingColumn,this.paperFormat.RowSpacing=this.spacingRow,this.paperFormat.BarcodeVisible=this.barcode,this.paperFormat.CodeVisible=this.code,this.paperFormat.PriceVisible=this.price,this.paperFormat.NameVisible=this.name,this.paperFormat.DescriptionAsCode=this.desc,this.paperFormat.ProductNameFontSize=this.fontSize,this.paperFormat.ProductNamePrefix=this.namePrefix,this.paperFormat.ProductNameMaxLength=this.maxChar,this.paperFormat.LineHeight=this.lineHeight,this.paperFormat.PriceWithTax=this.priceTax,this.paperFormat.TaxType=this.taxSelected,this.paperFormat.StoreName=this.storeName,this.paperFormat.CurrencySymbol=this.currencySymbol,this.paperFormat.PromotionPriceLabel=this.promotionPriceLabel,this.paperFormat.BasicPriceLabel=this.basicPriceLabel)}checkPriceWithTax(){this.priceTax||(this.taxSelected=this.taxs.find(u=>"No Tax"==u.getLabel))}dataTarget(u){this.activeTab=u}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.so),t.Y36(R.WI))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-form-settings"]],outputs:{event:"event"},decls:283,vars:68,consts:[[3,"config","onOk","onCancel"],["container",""],[1,"container-fluid","px-0","bg-light-white","nav-tabs-custom-border"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["tabs",""],[1,"nav-item"],["data-toggle","tab",1,"nav-link",3,"ngClass","click"],["id","spacing-tab","data-toggle","tab","data-target","'#spacing'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","dua-tab","data-toggle","tab","data-target","'#sticker-content'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","price-tab","data-toggle","tab","data-target","'#price'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","advanced-tab","data-toggle","tab","data-target","'#advanced'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","promotionLabel-tab","data-toggle","tab","data-target","'#promotionLabel'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],[1,"tab-content"],["id","paper",1,"tab-pane","mt-0",3,"ngClass"],[1,"table","w-100"],[1,"input-group"],["type","number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],[1,"input-group-append"],[1,"input-group-text"],["id","spacing",1,"tab-pane","mt-0",3,"ngClass"],["id","sticker-content",1,"tab-pane","mt-0",3,"ngClass"],[1,"form-check","form-check-inline"],["type","radio","name","barcode","id","barcode","value","option3",1,"form-check-input",3,"checked","change"],["for","barcode",1,"form-check-label"],["type","radio","name","barcode","id","barcode","value","option4",1,"form-check-input",3,"checked","change"],["type","radio","name","code","id","code","value","option1",1,"form-check-input",3,"checked","change"],["for","code",1,"form-check-label"],["type","radio","name","code","id","code","value","option2",1,"form-check-input",3,"checked","change"],["type","radio","name","price","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["for","inlineRadio1",1,"form-check-label"],["type","radio","name","price","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],["for","inlineRadio2",1,"form-check-label"],["type","radio","name","name","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["type","radio","name","name","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],["id","price",1,"tab-pane","mt-0",3,"ngClass"],["type","radio","name","priceTax","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["type","radio","name","priceTax","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],[4,"ngIf"],["type","text","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["id","advanced",1,"tab-pane","mt-0",3,"ngClass"],["type","radio","name","desc","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["type","radio","name","desc","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],["type","radio","name","default","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["type","radio","name","default","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],["id","promotionLabel",1,"tab-pane","mt-0",3,"ngClass"],["bindLabel","name","placeholder","Select Column",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange","change"]],template:function(u,h){1&u&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return h.onOk()})("onCancel",function(){return h.onCancel()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"ul",3,4),t.TgZ(6,"li",5),t.TgZ(7,"a",6),t.NdJ("click",function(){return h.dataTarget("paper")}),t._uU(8,"Paper"),t.qZA(),t.qZA(),t.TgZ(9,"li",5),t.TgZ(10,"a",7),t.NdJ("click",function(){return h.dataTarget("spacing")}),t._uU(11,"Spacing"),t.qZA(),t.qZA(),t.TgZ(12,"li",5),t.TgZ(13,"a",8),t.NdJ("click",function(){return h.dataTarget("sticker-content")}),t._uU(14,"Sticker Content"),t.qZA(),t.qZA(),t.TgZ(15,"li",5),t.TgZ(16,"a",9),t.NdJ("click",function(){return h.dataTarget("price")}),t._uU(17,"Price"),t.qZA(),t.qZA(),t.TgZ(18,"li",5),t.TgZ(19,"a",10),t.NdJ("click",function(){return h.dataTarget("advanced")}),t._uU(20,"Advanced"),t.qZA(),t.qZA(),t.TgZ(21,"li",5),t.TgZ(22,"a",11),t.NdJ("click",function(){return h.dataTarget("promotionLabel")}),t._uU(23,"Label"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(24,"div",12),t.TgZ(25,"div",13),t.TgZ(26,"table",14),t.TgZ(27,"tr"),t.TgZ(28,"td"),t._uU(29,"Paper Width"),t.qZA(),t.TgZ(30,"td"),t.TgZ(31,"div",15),t.TgZ(32,"input",16),t.NdJ("ngModelChange",function(D){return h.paperWidth=D}),t.qZA(),t.TgZ(33,"div",17),t.TgZ(34,"span",18),t._uU(35,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(36,"td"),t._uU(37,"The width of the paper"),t.qZA(),t.qZA(),t.TgZ(38,"tr"),t.TgZ(39,"td"),t._uU(40,"Sticker Width"),t.qZA(),t.TgZ(41,"td"),t.TgZ(42,"div",15),t.TgZ(43,"input",16),t.NdJ("ngModelChange",function(D){return h.stickerWidth=D}),t.qZA(),t.TgZ(44,"div",17),t.TgZ(45,"span",18),t._uU(46,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(47,"td"),t._uU(48,"The width of the sticker"),t.qZA(),t.qZA(),t.TgZ(49,"tr"),t.TgZ(50,"td"),t._uU(51,"Sticker Height"),t.qZA(),t.TgZ(52,"td"),t.TgZ(53,"div",15),t.TgZ(54,"input",16),t.NdJ("ngModelChange",function(D){return h.stickerHeight=D}),t.qZA(),t.TgZ(55,"div",17),t.TgZ(56,"span",18),t._uU(57,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(58,"td"),t._uU(59,"The height of the sticker"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(60,"div",19),t.TgZ(61,"table",14),t.TgZ(62,"tr"),t.TgZ(63,"td"),t._uU(64,"Left Indent"),t.qZA(),t.TgZ(65,"td"),t.TgZ(66,"div",15),t.TgZ(67,"input",16),t.NdJ("ngModelChange",function(D){return h.marginLeft=D}),t.qZA(),t.TgZ(68,"div",17),t.TgZ(69,"span",18),t._uU(70,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(71,"td"),t._uU(72,"the number of pixels appended before the first COLUMN"),t.qZA(),t.qZA(),t.TgZ(73,"tr"),t.TgZ(74,"td"),t._uU(75,"Top Indent"),t.qZA(),t.TgZ(76,"td"),t.TgZ(77,"div",15),t.TgZ(78,"input",16),t.NdJ("ngModelChange",function(D){return h.marginTop=D}),t.qZA(),t.TgZ(79,"div",17),t.TgZ(80,"span",18),t._uU(81,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(82,"td"),t._uU(83,"the number of pixels appended before the first ROW"),t.qZA(),t.qZA(),t.TgZ(84,"tr"),t.TgZ(85,"td"),t._uU(86,"Row Spacing"),t.qZA(),t.TgZ(87,"td"),t.TgZ(88,"div",15),t.TgZ(89,"input",16),t.NdJ("ngModelChange",function(D){return h.spacingRow=D}),t.qZA(),t.TgZ(90,"div",17),t.TgZ(91,"span",18),t._uU(92,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(93,"td"),t._uU(94,"The number of pixels between each ROW"),t.qZA(),t.qZA(),t.TgZ(95,"tr"),t.TgZ(96,"td"),t._uU(97,"Column Spacing"),t.qZA(),t.TgZ(98,"td"),t.TgZ(99,"div",15),t.TgZ(100,"input",16),t.NdJ("ngModelChange",function(D){return h.spacingColumn=D}),t.qZA(),t.TgZ(101,"div",17),t.TgZ(102,"span",18),t._uU(103,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(104,"td"),t._uU(105,"The number of pixels between each COLUMN"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(106,"div",20),t.TgZ(107,"table",14),t.TgZ(108,"tr"),t.TgZ(109,"td"),t._uU(110,"Barcode Height"),t.qZA(),t.TgZ(111,"td"),t.TgZ(112,"div",15),t.TgZ(113,"input",16),t.NdJ("ngModelChange",function(D){return h.barcodeHeight=D}),t.qZA(),t.TgZ(114,"div",17),t.TgZ(115,"span",18),t._uU(116,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(117,"td"),t._uU(118,"the height of the generated barcode in pixels"),t.qZA(),t.qZA(),t.TgZ(119,"tr"),t.TgZ(120,"td"),t._uU(121,"Font Size"),t.qZA(),t.TgZ(122,"td"),t.TgZ(123,"div",15),t.TgZ(124,"input",16),t.NdJ("ngModelChange",function(D){return h.fontSize=D}),t.qZA(),t.TgZ(125,"div",17),t.TgZ(126,"span",18),t._uU(127,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(128,"td"),t._uU(129,"Change all font size (include price)"),t.qZA(),t.qZA(),t.TgZ(130,"tr"),t.TgZ(131,"td"),t._uU(132,"Barcode"),t.qZA(),t.TgZ(133,"td"),t.TgZ(134,"div",21),t.TgZ(135,"input",22),t.NdJ("change",function(){return h.barcode=!1}),t.qZA(),t.TgZ(136,"label",23),t._uU(137,"No"),t.qZA(),t.qZA(),t.TgZ(138,"div",21),t.TgZ(139,"input",24),t.NdJ("change",function(){return h.barcode=!0}),t.qZA(),t.TgZ(140,"label",23),t._uU(141,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(142,"td"),t._uU(143,"Whether barcode is visible"),t.qZA(),t.qZA(),t.TgZ(144,"tr"),t.TgZ(145,"td"),t._uU(146,"Code"),t.qZA(),t.TgZ(147,"td"),t.TgZ(148,"div",21),t.TgZ(149,"input",25),t.NdJ("change",function(){return h.code=!1}),t.qZA(),t.TgZ(150,"label",26),t._uU(151,"No"),t.qZA(),t.qZA(),t.TgZ(152,"div",21),t.TgZ(153,"input",27),t.NdJ("change",function(){return h.code=!0}),t.qZA(),t.TgZ(154,"label",26),t._uU(155,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(156,"td"),t._uU(157,"Whether variant code is visible"),t.qZA(),t.qZA(),t.TgZ(158,"tr"),t.TgZ(159,"td"),t._uU(160,"Price"),t.qZA(),t.TgZ(161,"td"),t.TgZ(162,"div",21),t.TgZ(163,"input",28),t.NdJ("change",function(){return h.price=!1}),t.qZA(),t.TgZ(164,"label",29),t._uU(165,"No"),t.qZA(),t.qZA(),t.TgZ(166,"div",21),t.TgZ(167,"input",30),t.NdJ("change",function(){return h.price=!0}),t.qZA(),t.TgZ(168,"label",31),t._uU(169,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(170,"td"),t._uU(171,"Whether variant price is visible"),t.qZA(),t.qZA(),t.TgZ(172,"tr"),t.TgZ(173,"td"),t._uU(174,"Name"),t.qZA(),t.TgZ(175,"td"),t.TgZ(176,"div",21),t.TgZ(177,"input",32),t.NdJ("change",function(){return h.name=!1}),t.qZA(),t.TgZ(178,"label",29),t._uU(179,"No"),t.qZA(),t.qZA(),t.TgZ(180,"div",21),t.TgZ(181,"input",33),t.NdJ("change",function(){return h.name=!0}),t.qZA(),t.TgZ(182,"label",31),t._uU(183,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(184,"td"),t._uU(185,"Whether variant name is visible"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(186,"div",34),t.TgZ(187,"table",14),t.TgZ(188,"tr"),t.TgZ(189,"td"),t._uU(190,"Price with Tax"),t.qZA(),t.TgZ(191,"td"),t.TgZ(192,"div",21),t.TgZ(193,"input",35),t.NdJ("change",function(){return h.priceTax=!1}),t.qZA(),t.TgZ(194,"label",29),t._uU(195,"No"),t.qZA(),t.qZA(),t.TgZ(196,"div",21),t.TgZ(197,"input",36),t.NdJ("change",function(){return h.priceTax=!0}),t.qZA(),t.TgZ(198,"label",31),t._uU(199,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(200,"td"),t._uU(201),t.qZA(),t.qZA(),t.YNc(202,a,7,3,"tr",37),t.TgZ(203,"tr"),t.TgZ(204,"td"),t._uU(205,"Currency"),t.qZA(),t.TgZ(206,"td"),t.TgZ(207,"div",15),t.TgZ(208,"input",38),t.NdJ("ngModelChange",function(D){return h.currencySymbol=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(209,"td"),t._uU(210,"the default currency"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(211,"div",39),t.TgZ(212,"table",14),t.TgZ(213,"tr"),t.TgZ(214,"td"),t._uU(215,"Max Character"),t.qZA(),t.TgZ(216,"td"),t.TgZ(217,"div",15),t.TgZ(218,"input",16),t.NdJ("ngModelChange",function(D){return h.maxChar=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(219,"td"),t._uU(220,"the max character of the product name"),t.qZA(),t.qZA(),t.TgZ(221,"tr"),t.TgZ(222,"td"),t._uU(223,"Name Prefix"),t.qZA(),t.TgZ(224,"td"),t.TgZ(225,"div",15),t.TgZ(226,"input",38),t.NdJ("ngModelChange",function(D){return h.namePrefix=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(227,"td"),t._uU(228,"a word, letter, or number placed before product name"),t.qZA(),t.qZA(),t.TgZ(229,"tr"),t.TgZ(230,"td"),t._uU(231,"Store Name"),t.qZA(),t.TgZ(232,"td"),t.TgZ(233,"div",15),t.TgZ(234,"input",38),t.NdJ("ngModelChange",function(D){return h.storeName=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(235,"td"),t._uU(236,"the name of the store"),t.qZA(),t.qZA(),t.TgZ(237,"tr"),t.TgZ(238,"td"),t._uU(239,"Use description as code"),t.qZA(),t.TgZ(240,"td"),t.TgZ(241,"div",21),t.TgZ(242,"input",40),t.NdJ("change",function(){return h.desc=!1}),t.qZA(),t.TgZ(243,"label",29),t._uU(244,"No"),t.qZA(),t.qZA(),t.TgZ(245,"div",21),t.TgZ(246,"input",41),t.NdJ("change",function(){return h.desc=!0}),t.qZA(),t.TgZ(247,"label",31),t._uU(248,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(249,"td"),t._uU(250,"Copy product description into Product Code"),t.qZA(),t.qZA(),t.TgZ(251,"tr"),t.TgZ(252,"td"),t._uU(253,'Remove "Default"'),t.qZA(),t.TgZ(254,"td"),t.TgZ(255,"div",21),t.TgZ(256,"input",42),t.NdJ("change",function(){return h.removeDefault=!1}),t.qZA(),t.TgZ(257,"label",29),t._uU(258,"No"),t.qZA(),t.qZA(),t.TgZ(259,"div",21),t.TgZ(260,"input",43),t.NdJ("change",function(){return h.removeDefault=!0}),t.qZA(),t.TgZ(261,"label",31),t._uU(262,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(263,"td"),t._uU(264,'Remove "Default" Label from product name'),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(265,"div",44),t.TgZ(266,"table",14),t.TgZ(267,"tr"),t.TgZ(268,"td"),t._uU(269,"Normal Price"),t.qZA(),t.TgZ(270,"td"),t.TgZ(271,"div",15),t.TgZ(272,"input",38),t.NdJ("ngModelChange",function(D){return h.promotionPriceLabel=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(273,"td"),t._uU(274,"Custom label normal price"),t.qZA(),t.qZA(),t.TgZ(275,"tr"),t.TgZ(276,"td"),t._uU(277,"Promotion Price"),t.qZA(),t.TgZ(278,"td"),t.TgZ(279,"div",15),t.TgZ(280,"input",38),t.NdJ("ngModelChange",function(D){return h.basicPriceLabel=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(281,"td"),t._uU(282,"Custom label promotion price"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.Q6J("config",h.modalConfig),t.xp6(7),t.Q6J("ngClass",t.VKq(44,c,"paper"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(46,c,"spacing"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(48,c,"sticker-content"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(50,c,"price"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(52,c,"advanced"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(54,c,"promotionLabel"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(56,c,"paper"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.paperWidth),t.xp6(11),t.Q6J("ngModel",h.stickerWidth),t.xp6(11),t.Q6J("ngModel",h.stickerHeight),t.xp6(6),t.Q6J("ngClass",t.VKq(58,c,"spacing"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.marginLeft),t.xp6(11),t.Q6J("ngModel",h.marginTop),t.xp6(11),t.Q6J("ngModel",h.spacingRow),t.xp6(11),t.Q6J("ngModel",h.spacingColumn),t.xp6(6),t.Q6J("ngClass",t.VKq(60,c,"sticker-content"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.barcodeHeight),t.xp6(11),t.Q6J("ngModel",h.fontSize),t.xp6(11),t.Q6J("checked",!h.barcode),t.xp6(4),t.Q6J("checked",h.barcode),t.xp6(10),t.Q6J("checked",!h.code),t.xp6(4),t.Q6J("checked",h.code),t.xp6(10),t.Q6J("checked",!h.price),t.xp6(4),t.Q6J("checked",h.price),t.xp6(10),t.Q6J("checked",!h.name),t.xp6(4),t.Q6J("checked",h.name),t.xp6(5),t.Q6J("ngClass",t.VKq(62,c,"price"===h.activeTab)),t.xp6(7),t.Q6J("checked",!h.priceTax),t.xp6(4),t.Q6J("checked",h.priceTax),t.xp6(4),t.hij("Tax is added to the product base price ",h.authTax,""),t.xp6(1),t.Q6J("ngIf",1==h.priceTax&&1==h.authTax),t.xp6(6),t.Q6J("ngModel",h.currencySymbol),t.xp6(3),t.Q6J("ngClass",t.VKq(64,c,"advanced"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.maxChar),t.xp6(8),t.Q6J("ngModel",h.namePrefix),t.xp6(8),t.Q6J("ngModel",h.storeName),t.xp6(8),t.Q6J("checked",!h.desc),t.xp6(4),t.Q6J("checked",h.desc),t.xp6(10),t.Q6J("checked",!h.removeDefault),t.xp6(4),t.Q6J("checked",h.removeDefault),t.xp6(5),t.Q6J("ngClass",t.VKq(66,c,"promotionLabel"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.promotionPriceLabel),t.xp6(8),t.Q6J("ngModel",h.basicPriceLabel))},directives:[G.M,L.mk,$.wV,$.Fj,$.JJ,$.On,L.O5,W.w9],styles:[".input-group-append[_ngcontent-%COMP%]{height:30px}.form-control[_ngcontent-%COMP%]{height:30px;font-size:12px}.input-group-text[_ngcontent-%COMP%]{font-size:12px}.value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:90px}.advance-value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:135px}h3[_ngcontent-%COMP%]{margin-bottom:0;font-weight:550}label[_ngcontent-%COMP%]{font-size:12px}bs-dropdown-container[_ngcontent-%COMP%]{z-index:1060}.nav-tabs-custom-border[_ngcontent-%COMP%] .nav-tabs[_ngcontent-%COMP%]{border-bottom:0}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%]{border:1px solid #dee2e6;margin-bottom:15px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(1){font-weight:bold;width:172px;padding:12px 1rem}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){width:120px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:nth-child(2), .tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){border-right:1px solid #dee2e6;border-left:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) input[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) .input-group-text[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(3){font-style:italic;color:#28a745}.nav-link[_ngcontent-%COMP%]{cursor:pointer}"]}),w})();const e=["bcElement"],i=T(9489);let r=(()=>{class w{constructor(u){this.renderer=u,this.elementType="svg",this.cssClass="barcode",this.format="CODE128",this.lineColor="#000000",this.width=2,this.height=100,this.displayValue=!1,this.fontOptions="",this.font="monospace",this.textAlign="center",this.textPosition="bottom",this.textMargin=2,this.fontSize=20,this.background="#ffffff",this.margin=10,this.marginTop=10,this.marginBottom=10,this.marginLeft=10,this.marginRight=10,this.value="",this.valid=()=>!0}get options(){return{format:this.format,lineColor:this.lineColor,width:this.width,height:this.height,displayValue:this.displayValue,fontOptions:this.fontOptions,font:this.font,textAlign:this.textAlign,textPosition:this.textPosition,textMargin:this.textMargin,fontSize:this.fontSize,background:this.background,margin:this.margin,marginTop:this.marginTop,marginBottom:this.marginBottom,marginLeft:this.marginLeft,marginRight:this.marginRight,valid:this.valid}}ngOnChanges(){this.createBarcode()}createBarcode(){if(!this.value)return;let u;switch(this.elementType){case"img":u=this.renderer.createElement("img");break;case"canvas":u=this.renderer.createElement("canvas");break;default:u=this.renderer.createElement("svg","svg")}i(u,this.value,this.options);for(const h of this.bcElement.nativeElement.childNodes)this.renderer.removeChild(this.bcElement.nativeElement,h);this.renderer.appendChild(this.bcElement.nativeElement,u)}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(t.Qsj))},w.\u0275cmp=t.Xpm({type:w,selectors:[["ngx-barcode6"]],viewQuery:function(u,h){if(1&u&&t.Gf(e,7),2&u){let O;t.iGM(O=t.CRH())&&(h.bcElement=O.first)}},inputs:{elementType:["bc-element-type","elementType"],cssClass:["bc-class","cssClass"],format:["bc-format","format"],lineColor:["bc-line-color","lineColor"],width:["bc-width","width"],height:["bc-height","height"],displayValue:["bc-display-value","displayValue"],fontOptions:["bc-font-options","fontOptions"],font:["bc-font","font"],textAlign:["bc-text-align","textAlign"],textPosition:["bc-text-position","textPosition"],textMargin:["bc-text-margin","textMargin"],fontSize:["bc-font-size","fontSize"],background:["bc-background","background"],margin:["bc-margin","margin"],marginTop:["bc-margin-top","marginTop"],marginBottom:["bc-margin-bottom","marginBottom"],marginLeft:["bc-margin-left","marginLeft"],marginRight:["bc-margin-right","marginRight"],value:["bc-value","value"],valid:["bc-valid","valid"]},features:[t.TTD],decls:2,vars:2,consts:[["bcElement",""]],template:function(u,h){1&u&&t._UZ(0,"div",null,0),2&u&&t.Tol(h.cssClass)},encapsulation:2}),w})(),m=(()=>{class w{}return w.\u0275fac=function(u){return new(u||w)},w.\u0275mod=t.oAB({type:w}),w.\u0275inj=t.cJS({imports:[[]]}),w})(),p=(()=>{class w{transform(u,h){let O=u,D=0;return h&&0!==h&&(D=u*(h/100),O=u+D),O}}return w.\u0275fac=function(u){return new(u||w)},w.\u0275pipe=t.Yjl({name:"taxPipe",type:w,pure:!0}),w})();function s(w,A){if(1&w&&t._UZ(0,"ngx-barcode6",18),2&w){const u=t.oxw().$implicit,h=t.oxw();t.Q6J("bc-value",null==u?null:u.getCode)("bc-element-type","img")("bc-width",1)("bc-height",null==h.selectedPaperFormat?null:h.selectedPaperFormat.BarcodeHeight)}}function C(w,A){if(1&w&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&w){const u=t.oxw().$implicit,h=t.oxw();t.Udp("font-size",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.Oqu(u.getBarcodeTitle)}}function M(w,A){if(1&w&&(t.ynx(0),t.TgZ(1,"div",22),t.TgZ(2,"span",23),t._uU(3),t.qZA(),t.TgZ(4,"span",24),t.TgZ(5,"span",25),t.TgZ(6,"span",26),t._uU(7),t.ALo(8,"number"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(9,"div",27),t.TgZ(10,"span",23),t._uU(11),t.qZA(),t.TgZ(12,"span",28),t._uU(13),t.ALo(14,"number"),t.qZA(),t.qZA(),t.BQk()),2&w){const u=t.oxw(2).$implicit,h=t.oxw();t.xp6(3),t.Oqu(h.selectedPaperFormat.BasicPriceLabel?h.selectedPaperFormat.BasicPriceLabel:"N. Price"),t.xp6(4),t.AsE("",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(8,6,null==u?null:u.getUnitPrice),""),t.xp6(4),t.Oqu(h.selectedPaperFormat.PromotionPriceLabel?h.selectedPaperFormat.PromotionPriceLabel:"Spc. Price"),t.xp6(2),t.AsE("",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(14,8,null==u||null==u.getSelectedPromotion?null:u.getSelectedPromotion.getUnitPrice),"")}}function q(w,A){if(1&w&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&w){const u=t.oxw(3).$implicit,h=t.oxw();t.xp6(1),t.AsE(" ",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==u?null:u.getCustomPrice,h.tax))," ")}}function v(w,A){if(1&w&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&w){const u=t.oxw(4).$implicit,h=t.oxw();t.xp6(1),t.AsE(" ",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==u?null:u.getUnitPrice,h.tax))," ")}}function Z(w,A){if(1&w&&t.YNc(0,v,4,7,"ng-container",20),2&w){t.oxw();const u=t.MAs(5),h=t.oxw(3);t.Q6J("ngIf",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.PriceWithTax)&&h.tax&&0!=h.tax)("ngIfElse",u)}}function V(w,A){if(1&w&&(t._uU(0),t.ALo(1,"number")),2&w){const u=t.oxw(3).$implicit,h=t.oxw();t.AsE(" ",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(1,2,null==u?null:u.getUnitPrice)," ")}}function B(w,A){if(1&w&&(t.TgZ(0,"strong"),t.YNc(1,q,4,7,"ng-container",20),t.YNc(2,Z,1,2,"ng-template",null,29,t.W1O),t.YNc(4,V,2,4,"ng-template",null,30,t.W1O),t.qZA()),2&w){const u=t.MAs(3),h=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",0!==(null==h?null:h.getCustomPrice)&&void 0!==(null==h?null:h.getCustomPrice))("ngIfElse",u)}}function j(w,A){if(1&w&&(t.TgZ(0,"span",19),t.YNc(1,M,15,10,"ng-container",20),t.YNc(2,B,6,2,"ng-template",null,21,t.W1O),t.qZA()),2&w){const u=t.MAs(3),h=t.oxw().$implicit,O=t.oxw();t.Udp("font-size",(null==O.selectedPaperFormat?null:O.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.Q6J("ngIf",h.getSelectedPromotion)("ngIfElse",u)}}function z(w,A){if(1&w&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&w){const u=t.oxw().$implicit,h=t.oxw();t.Udp("font-size",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=h.selectedPaperFormat&&h.selectedPaperFormat.ProductNamePrefix?(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNamePrefix)+" "+u.getName:u.getName,0,null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNameMaxLength)," ")}}function X(w,A){if(1&w&&(t.TgZ(0,"li"),t.TgZ(1,"div",13),t.YNc(2,s,1,4,"ngx-barcode6",14),t.TgZ(3,"div",15),t.YNc(4,C,2,3,"span",16),t.YNc(5,j,4,4,"span",16),t.YNc(6,z,3,7,"span",16),t.qZA(),t.TgZ(7,"div",17),t._uU(8),t.qZA(),t.qZA(),t.qZA()),2&w){const u=A.index,h=t.oxw();t.Udp("width",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.StickerWidth)+"px")("height",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.StickerHeight)+"px")("margin-right",(u+1)%h.totalStickerPerRow==0?0:(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ColumnSpacing)+"px")("margin-bottom",u>=h.productPreview.length-h.lastIndex?0:(null==h.selectedPaperFormat?null:h.selectedPaperFormat.RowSpacing)+"px"),t.xp6(2),t.Q6J("ngIf",null==h.selectedPaperFormat?null:h.selectedPaperFormat.BarcodeVisible),t.xp6(2),t.Q6J("ngIf",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CodeVisible),t.xp6(1),t.Q6J("ngIf",null==h.selectedPaperFormat?null:h.selectedPaperFormat.PriceVisible),t.xp6(1),t.Q6J("ngIf",null==h.selectedPaperFormat?null:h.selectedPaperFormat.NameVisible),t.xp6(1),t.Udp("font-size",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==h.selectedPaperFormat?null:h.selectedPaperFormat.StoreName," ")}}let ne=(()=>{class w{constructor(u,h,O,D,J,ie){this.dialog=u,this.productStateService=h,this.productService=O,this.barcodeService=D,this.toastService=J,this.authService=ie,this.paperFormatOptions=[],this.optionSelected={id:1,name:"Continuous - 3 Column"},this.paperFormats=[],this.totalStickerPerRow=0,this.lastIndex=0,this.destroy$=new y.xQ,this.productPreview=[],this.taxs=[]}ngOnInit(){this.getPaperFormats(),this.checkAuthTax(),this.subscribeToObsproducts()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}checkAuthTax(){this.authService.getRoles().find(O=>"StpE"===O)?(this.getProductTax(),this.authTax=!0):this.authTax=!1}subscribeToObsproducts(){this.productStateService.getState().pipe((0,o.R)(this.destroy$)).subscribe(u=>{this.productPreview=u,this.relayout()})}getProductTax(){this.productService.getTax().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&(this.taxs=u)})}getPaperFormats(){this.barcodeService.getPaperFormatConfig().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&(this.paperFormats=u,this.setSelectedPaperFormat(u[0]),this.initOptionFormat(),this.initOptionSelected(this.selectedPaperFormat))},u=>{console.error(u)})}initOptionFormat(){this.paperFormatOptions=[],this.paperFormats.forEach((u,h)=>{this.paperFormatOptions=[...this.paperFormatOptions,{id:h+1,name:u.Name}]})}initOptionSelected(u){this.optionSelected=this.paperFormatOptions.find(h=>h.name===u.Name)}openSettingModal(){this.dialog.open(g,{width:"850px",data:{paperFormat:this.selectedPaperFormat,taxs:this.taxs,authTax:this.authTax}}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&this.selectedPaperFormat&&(this.updatePaperFormatSource(u),this.updatePaperFormat(),this.setSelectedPaperFormat(u))})}onSelectPaperFormat(){this.getPaperFormatBarcode()}getPaperFormatBarcode(){let h=this.findPaperFormatByName(this.optionSelected.name);this.setSelectedPaperFormat(h)}updatePaperFormat(){this.barcodeService.updatePaperFormatConfig(this.paperFormats).pipe((0,o.R)(this.destroy$)).subscribe(()=>{this.toastService.success("Success Update Paper Format","Success")},u=>{console.error(u)})}setSelectedPaperFormat(u){this.selectedPaperFormat=u,this.barcodeService.setBarcodeConfigState(u),this.relayout(),this.getPPnVal(u)}findPaperFormatByName(u){return this.paperFormats.find(O=>O.Name==u)}updatePaperFormatSource(u){this.paperFormats=this.paperFormats.map(h=>(u.Name===h.Name&&(h=u),h))}getPPnVal(u){this.tax=u.TaxType?u.TaxType.Rate:null}relayout(){var u,h,O,D,J,ie;let be=(null===(u=this.selectedPaperFormat)||void 0===u?void 0:u.PaperWidth)?null===(h=this.selectedPaperFormat)||void 0===h?void 0:h.PaperWidth:0,Ne=(null===(O=this.selectedPaperFormat)||void 0===O?void 0:O.StickerWidth)?null===(D=this.selectedPaperFormat)||void 0===D?void 0:D.StickerWidth:0,fe=(null===(J=this.selectedPaperFormat)||void 0===J?void 0:J.ColumnSpacing)?null===(ie=this.selectedPaperFormat)||void 0===ie?void 0:ie.ColumnSpacing:0,ue=Math.floor((be+fe)/(Ne+fe));this.totalStickerPerRow=ue;let Ee=Math.floor(this.productPreview.length/ue),Ue=this.productPreview.length-Ee*ue;this.lastIndex=0===Ue?ue:Ue,this.productPreview=this.productPreview.map(ve=>{var qe;return ve.setBarcodeTitle=(null===(qe=this.selectedPaperFormat)||void 0===qe?void 0:qe.DescriptionAsCode)&&ve.getDescription?ve.getDescription:ve.getCode,ve})}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.uw),t.Y36(b),t.Y36(we),t.Y36(H),t.Y36(_e._W),t.Y36(E.$))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-print-preview"]],decls:15,vars:10,consts:[[1,"mt-3","d-print-none"],[1,"card","mt-0","mb-0","paper-barcode"],[1,"card-header","d-flex","justify-content-between","align-items-center","border-bottom","pb-5","d-print-none"],[1,"font-weight-light"],["align","right",2,"width","400px"],[1,"d-inline-block","font-weight-light","text-info","font-italic"],["align","left","bindLabel","name","placeholder","Select Column",1,"d-inline-block","ml-4",3,"items","ngModel","clearable","ngModelChange","change"],[1,"btn","btn","btn-outline-secondary","ml-4",3,"click"],["aria-hidden","true",1,"fa","fa-cog"],[1,"card-body","p-0"],[1,"canvas","clearfix"],[1,"barcodes"],[3,"width","height","margin-right","margin-bottom",4,"ngFor","ngForOf"],[1,"position-relative"],[3,"bc-value","bc-element-type","bc-width","bc-height",4,"ngIf"],[2,"margin-top","-4px","line-height","1"],["class","d-block",3,"font-size",4,"ngIf"],[1,"vertical-text"],[3,"bc-value","bc-element-type","bc-width","bc-height"],[1,"d-block"],[4,"ngIf","ngIfElse"],["WITHOUT_PROMOTION",""],[1,"d-flex","justify-content-between"],[1,"ml-12"],[1,"mr-12"],[1,"text-danger",2,"text-decoration","line-through","text-decoration-thickness","1.5px"],[1,"text-dark"],[1,"d-flex","justify-content-between","mt-1"],[1,"mr-12","text-danger"],["WITH_TAX",""],["WITHOUT_TAX",""]],template:function(u,h){1&u&&(t._UZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"div",2),t.TgZ(3,"h1",3),t._uU(4," Print Preview "),t.qZA(),t.TgZ(5,"div",4),t.TgZ(6,"h5",5),t._uU(7,"Paper Source"),t.qZA(),t.TgZ(8,"ng-select",6),t.NdJ("ngModelChange",function(D){return h.optionSelected=D})("change",function(){return h.onSelectPaperFormat()}),t.qZA(),t.TgZ(9,"button",7),t.NdJ("click",function(){return h.openSettingModal()}),t._UZ(10,"i",8),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"div",9),t.TgZ(12,"div",10),t.TgZ(13,"ul",11),t.YNc(14,X,9,15,"li",12),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.xp6(8),t.Q6J("items",h.paperFormatOptions)("ngModel",h.optionSelected)("clearable",!1),t.xp6(4),t.Udp("width",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.PaperWidth)+"px")("margin-top",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.MarginTop)+"px")("margin-left",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.MarginLeft)+"px"),t.xp6(2),t.Q6J("ngForOf",h.productPreview))},directives:[W.w9,$.JJ,$.On,L.sg,L.O5,r],pipes:[L.JJ,p,L.OU],styles:["ng-select[_ngcontent-%COMP%]{width:50%}.card-header[_ngcontent-%COMP%]{height:65px} div.barcode>img{text-align:center;max-width:100%;border:none;outline:none}@media (max-width: 480px){ div.barcode>img{border:none!important}} div.canvas ul.barcodes li img{display:block;margin:0 auto}.vertical-text[_ngcontent-%COMP%]{transform:rotate(180deg);writing-mode:vertical-rl;position:absolute;right:0px;height:100%;top:8%;text-align:center}"]}),w})(),se=(()=>{class w{constructor(u,h,O){this.variantServiceState=u,this.authService=h,this.queryParamService=O,this.domainName=localStorage.getItem("Domain")}onLogout(){this.variantServiceState.setState([]),this.queryParamService.setState(null),this.authService.logout()}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(b),t.Y36(E.$),t.Y36(I.U))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-pages"]],decls:20,vars:2,consts:[[1,"container"],[1,"row"],[1,"col-4","d-print-none"],[1,"col-8","p-0"],[1,"d-md-block","d-print-none"],[1,"row","justify-content-between","align-items-center"],[1,"col-auto","d-inline-flex"],[1,"pt-1rem","mr-3"],["target","_blank","href","https://www.dealpos.com"],["src","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid"],[1,"col-auto"],[1,"logout","d-print-none"],[3,"href"],[3,"click"],[1,"fa","fa-sign-out-alt"]],template:function(u,h){1&u&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"div",2),t._UZ(3,"app-list-products"),t.qZA(),t.TgZ(4,"div",3),t._UZ(5,"app-print-preview"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(6,"footer",4),t.TgZ(7,"div",5),t.TgZ(8,"div",6),t.TgZ(9,"p",7),t._uU(10,"Powered by : "),t.qZA(),t.TgZ(11,"a",8),t._UZ(12,"img",9),t.qZA(),t.qZA(),t.TgZ(13,"div",10),t.TgZ(14,"div",11),t.TgZ(15,"a",12),t._uU(16),t.qZA(),t.TgZ(17,"h5",13),t.NdJ("click",function(){return h.onLogout()}),t._UZ(18,"span",14),t._uU(19,"\xa0Logout"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.xp6(15),t.MGl("href","https://",h.domainName,"",t.LSH),t.xp6(1),t.Oqu(h.domainName))},directives:[De,ne],styles:[".logout[_ngcontent-%COMP%]{position:relative;left:2.5vw;top:-5px;font-size:14px;cursor:pointer}footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:-1%}@media (min-height: 720px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:12%}}@media (min-height: 768px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:16%}}"]}),w})();var ae=T(8367);const ge=[{path:"",component:se}];let Ae=(()=>{class w{}return w.\u0275fac=function(u){return new(u||w)},w.\u0275mod=t.oAB({type:w}),w.\u0275inj=t.cJS({imports:[[L.ez,ae.m,Me,m,N.Bz.forChild(ge)]]}),w})()}}]);
1
+ (self.webpackChunkbarcode_app=self.webpackChunkbarcode_app||[]).push([[469],{1813:function(K){K.exports=function(){return L={},S.m=T=[function(N,t,x){"use strict";x.r(t);var F={allowedTagList:["b","caption","cite","code","const","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","input","ins","kdb","label","li","option","output","p","q","s","sample","span","strong","td","th","u"]};Object.freeze(F.allowedTagList),Object.defineProperty(F,"allowedTagList",{configurable:!1,writable:!1}),F.keyCode={Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,Pause:19,CapsLock:20,Esc:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Insert:45,Delete:46,num0:48,num1:49,num2:50,num3:51,num4:52,num5:53,num6:54,num7:55,num8:56,num9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,OSLeft:91,OSRight:92,ContextMenu:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,MultiplyNumpad:106,PlusNumpad:107,MinusNumpad:109,DotNumpad:110,SlashNumpad:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,HyphenFirefox:173,MyComputer:182,MyCalculator:183,Semicolon:186,Equal:187,Comma:188,Hyphen:189,Dot:190,Slash:191,Backquote:192,LeftBracket:219,Backslash:220,RightBracket:221,Quote:222,Command:224,AltGraph:225,AndroidDefault:229},Object.freeze(F.keyCode),Object.defineProperty(F,"keyCode",{configurable:!1,writable:!1}),F.fromCharCodeKeyCode={0:"LaunchCalculator",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",91:"OS",92:"OSRight",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",173:"-",182:"MyComputer",183:"MyCalculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta",225:"AltGraph"},Object.freeze(F.fromCharCodeKeyCode),Object.defineProperty(F,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),F.keyName={Unidentified:"Unidentified",AndroidDefault:"AndroidDefault",Alt:"Alt",AltGr:"AltGraph",CapsLock:"CapsLock",Ctrl:"Control",Fn:"Fn",FnLock:"FnLock",Hyper:"Hyper",Meta:"Meta",OSLeft:"OS",OSRight:"OS",Command:"OS",NumLock:"NumLock",ScrollLock:"ScrollLock",Shift:"Shift",Super:"Super",Symbol:"Symbol",SymbolLock:"SymbolLock",Enter:"Enter",Tab:"Tab",Space:" ",LeftArrow:"ArrowLeft",UpArrow:"ArrowUp",RightArrow:"ArrowRight",DownArrow:"ArrowDown",End:"End",Home:"Home",PageUp:"PageUp",PageDown:"PageDown",Backspace:"Backspace",Clear:"Clear",Copy:"Copy",CrSel:"CrSel",Cut:"Cut",Delete:"Delete",EraseEof:"EraseEof",ExSel:"ExSel",Insert:"Insert",Paste:"Paste",Redo:"Redo",Undo:"Undo",Accept:"Accept",Again:"Again",Attn:"Attn",Cancel:"Cancel",ContextMenu:"ContextMenu",Esc:"Escape",Execute:"Execute",Find:"Find",Finish:"Finish",Help:"Help",Pause:"Pause",Play:"Play",Props:"Props",Select:"Select",ZoomIn:"ZoomIn",ZoomOut:"ZoomOut",BrightnessDown:"BrightnessDown",BrightnessUp:"BrightnessUp",Eject:"Eject",LogOff:"LogOff",Power:"Power",PowerOff:"PowerOff",PrintScreen:"PrintScreen",Hibernate:"Hibernate",Standby:"Standby",WakeUp:"WakeUp",Compose:"Compose",Dead:"Dead",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",Print:"Print",num0:"0",num1:"1",num2:"2",num3:"3",num4:"4",num5:"5",num6:"6",num7:"7",num8:"8",num9:"9",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",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",Semicolon:";",Equal:"=",Comma:",",Hyphen:"-",Minus:"-",Plus:"+",Dot:".",Slash:"/",Backquote:"`",LeftParenthesis:"(",RightParenthesis:")",LeftBracket:"[",RightBracket:"]",Backslash:"\\",Quote:"'",numpad0:"0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",NumpadDot:".",NumpadDotAlt:",",NumpadMultiply:"*",NumpadPlus:"+",NumpadMinus:"-",NumpadSubtract:"-",NumpadSlash:"/",NumpadDotObsoleteBrowsers:"Decimal",NumpadMultiplyObsoleteBrowsers:"Multiply",NumpadPlusObsoleteBrowsers:"Add",NumpadMinusObsoleteBrowsers:"Subtract",NumpadSlashObsoleteBrowsers:"Divide",_allFnKeys:["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"],_someNonPrintableKeys:["Tab","Enter","Shift","ShiftLeft","ShiftRight","Control","ControlLeft","ControlRight","Alt","AltLeft","AltRight","Pause","CapsLock","Escape"],_directionKeys:["PageUp","PageDown","End","Home","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"]},Object.freeze(F.keyName._allFnKeys),Object.freeze(F.keyName._someNonPrintableKeys),Object.freeze(F.keyName._directionKeys),Object.freeze(F.keyName),Object.defineProperty(F,"keyName",{configurable:!1,writable:!1}),Object.freeze(F);var b=F;function E(a){return function(c){if(Array.isArray(c))return l(c)}(a)||function(c){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(c))return Array.from(c)}(a)||o(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(){return(I=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var g=arguments[c];for(var e in g)Object.prototype.hasOwnProperty.call(g,e)&&(a[e]=g[e])}return a}).apply(this,arguments)}function y(a,c){return function(g){if(Array.isArray(g))return g}(a)||function(g,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(g)){var i=[],r=!0,m=!1,p=void 0;try{for(var s,C=g[Symbol.iterator]();!(r=(s=C.next()).done)&&(i.push(s.value),!e||i.length!==e);r=!0);}catch(M){m=!0,p=M}finally{try{r||null==C.return||C.return()}finally{if(m)throw p}}return i}}(a,c)||o(a,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(a,c){if(a){if("string"==typeof a)return l(a,c);var g=Object.prototype.toString.call(a).slice(8,-1);return"Object"===g&&a.constructor&&(g=a.constructor.name),"Map"===g||"Set"===g?Array.from(g):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?l(a,c):void 0}}function l(a,c){(null==c||c>a.length)&&(c=a.length);for(var g=0,e=new Array(c);g<c;g++)e[g]=a[g];return e}function d(a){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(a)}var n=function(){function a(){!function(c){if(!(c instanceof a))throw new TypeError("Cannot call a class as a function")}(this)}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a,[{key:"isNull",value:function(c){return null===c}},{key:"isUndefined",value:function(c){return void 0===c}},{key:"isUndefinedOrNullOrEmpty",value:function(c){return null==c||""===c}},{key:"isString",value:function(c){return"string"==typeof c||c instanceof String}},{key:"isEmptyString",value:function(c){return""===c}},{key:"isBoolean",value:function(c){return"boolean"==typeof c}},{key:"isTrueOrFalseString",value:function(c){var g=String(c).toLowerCase();return"true"===g||"false"===g}},{key:"isObject",value:function(c){return"object"===d(c)&&null!==c&&!Array.isArray(c)}},{key:"isEmptyObj",value:function(c){for(var g in c)if(Object.prototype.hasOwnProperty.call(c,g))return!1;return!0}},{key:"isNumberStrict",value:function(c){return"number"==typeof c}},{key:"isNumber",value:function(c){return!this.isArray(c)&&!isNaN(parseFloat(c))&&isFinite(c)}},{key:"isDigit",value:function(c){return/\d/.test(c)}},{key:"isNumberOrArabic",value:function(c){var g=this.arabicToLatinNumbers(c,!1,!0,!0);return this.isNumber(g)}},{key:"isInt",value:function(c){return"number"==typeof c&&parseFloat(c)===parseInt(c,10)&&!isNaN(c)}},{key:"isFunction",value:function(c){return"function"==typeof c}},{key:"isIE11",value:function(){return"undefined"!=typeof window&&!!window.MSInputMethodContext&&!!document.documentMode}},{key:"contains",value:function(c,g){return!(!this.isString(c)||!this.isString(g)||""===c||""===g)&&-1!==c.indexOf(g)}},{key:"isInArray",value:function(c,g){return!(!this.isArray(g)||g===[]||this.isUndefined(c))&&-1!==g.indexOf(c)}},{key:"isArray",value:function(c){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(c)||"object"===d(c)&&"[object Array]"===Object.prototype.toString.call(c);throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(c){return"undefined"!=typeof Element&&c instanceof Element}},{key:"isInputElement",value:function(c){return this.isElement(c)&&"input"===c.tagName.toLowerCase()}},{key:"decimalPlaces",value:function(c){var g=y(c.split("."),2)[1];return this.isUndefined(g)?0:g.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(c){var g=y(String(Math.abs(c)).split("."),2)[1];if(this.isUndefined(g))return 0;var e=g.lastIndexOf("0");return-1===e?e=0:e+=2,e}},{key:"keyCodeNumber",value:function(c){return void 0===c.which?c.keyCode:c.which}},{key:"character",value:function(c){var g;if("Unidentified"===c.key||void 0===c.key||this.isSeleniumBot()){var e=this.keyCodeNumber(c);if(e===b.keyCode.AndroidDefault)return b.keyName.AndroidDefault;var i=b.fromCharCodeKeyCode[e];g=a.isUndefinedOrNullOrEmpty(i)?String.fromCharCode(e):i}else{var r;switch(c.key){case"Add":g=b.keyName.NumpadPlus;break;case"Apps":g=b.keyName.ContextMenu;break;case"Crsel":g=b.keyName.CrSel;break;case"Decimal":g=c.char?c.char:b.keyName.NumpadDot;break;case"Del":g="firefox"===(r=this.browser()).name&&r.version<=36||"ie"===r.name&&r.version<=9?b.keyName.Dot:b.keyName.Delete;break;case"Divide":g=b.keyName.NumpadSlash;break;case"Down":g=b.keyName.DownArrow;break;case"Esc":g=b.keyName.Esc;break;case"Exsel":g=b.keyName.ExSel;break;case"Left":g=b.keyName.LeftArrow;break;case"Meta":case"Super":g=b.keyName.OSLeft;break;case"Multiply":g=b.keyName.NumpadMultiply;break;case"Right":g=b.keyName.RightArrow;break;case"Spacebar":g=b.keyName.Space;break;case"Subtract":g=b.keyName.NumpadMinus;break;case"Up":g=b.keyName.UpArrow;break;default:g=c.key}}return g}},{key:"browser",value:function(){var c,g=navigator.userAgent,e=g.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(e[1])?{name:"ie",version:(c=/\brv[ :]+(\d+)/g.exec(g)||[])[1]||""}:"Chrome"===e[1]&&null!==(c=g.match(/\b(OPR|Edge)\/(\d+)/))?{name:c[1].replace("OPR","opera"),version:c[2]}:(e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(c=g.match(/version\/(\d+)/i))&&e.splice(1,1,c[1]),{name:e[0].toLowerCase(),version:e[1]})}},{key:"isSeleniumBot",value:function(){return!0===window.navigator.webdriver}},{key:"isNegative",value:function(c,g,e){var i=1<arguments.length&&void 0!==g?g:"-",r=!(2<arguments.length&&void 0!==e)||e;return c===i||""!==c&&(a.isNumber(c)?c<0:r?this.contains(c,i):this.isNegativeStrict(c,i))}},{key:"isNegativeStrict",value:function(c,g){var e=1<arguments.length&&void 0!==g?g:"-";return c.charAt(0)===e}},{key:"isNegativeWithBrackets",value:function(c,g,e){return c.charAt(0)===g&&this.contains(c,e)}},{key:"isZeroOrHasNoValue",value:function(c){return!/[1-9]/g.test(c)}},{key:"setRawNegativeSign",value:function(c){return this.isNegativeStrict(c,"-")?c:"-".concat(c)}},{key:"replaceCharAt",value:function(c,g,e){return"".concat(c.substr(0,g)).concat(e).concat(c.substr(g+e.length))}},{key:"clampToRangeLimits",value:function(c,g){return Math.max(g.minimumValue,Math.min(g.maximumValue,c))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(c,g,e){for(var i=new RegExp("[0-9".concat(e,"-]")),r=0,m=0;m<g;m++)i.test(c[m])&&r++;return r}},{key:"findCaretPositionInFormattedNumber",value:function(c,g,e,i){var r,m=e.length,p=c.length,s=0;for(r=0;r<m&&s<p&&s<g;r++)(c[s]===e[r]||"."===c[s]&&e[r]===i)&&s++;return r}},{key:"countCharInText",value:function(c,g){for(var e=0,i=0;i<g.length;i++)g[i]===c&&e++;return e}},{key:"convertCharacterCountToIndexPosition",value:function(c){return Math.max(c,c-1)}},{key:"getElementSelection",value:function(c){var g,e={};try{g=this.isUndefined(c.selectionStart)}catch(r){g=!1}try{if(g){var i=window.getSelection().getRangeAt(0);e.start=i.startOffset,e.end=i.endOffset,e.length=e.end-e.start}else e.start=c.selectionStart,e.end=c.selectionEnd,e.length=e.end-e.start}catch(r){e.start=0,e.end=0,e.length=0}return e}},{key:"setElementSelection",value:function(c,g,e){var i=2<arguments.length&&void 0!==e?e:null;if(this.isUndefinedOrNullOrEmpty(i)&&(i=g),this.isInputElement(c))c.setSelectionRange(g,i);else if(!a.isNull(c.firstChild)){var r=document.createRange();r.setStart(c.firstChild,g),r.setEnd(c.firstChild,i);var m=window.getSelection();m.removeAllRanges(),m.addRange(r)}}},{key:"throwError",value:function(c){throw new Error(c)}},{key:"warning",value:function(c,g){1<arguments.length&&void 0!==g&&!g||console.warn("Warning: ".concat(c))}},{key:"isWheelUpEvent",value:function(c){return c.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(c.type,"' given.")),c.deltaY<0}},{key:"isWheelDownEvent",value:function(c){return c.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(c.type,"' given.")),0<c.deltaY}},{key:"forceDecimalPlaces",value:function(c,g){var e=y(String(c).split("."),2),r=e[1];return r?"".concat(e[0],".").concat(r.substr(0,g)):c}},{key:"roundToNearest",value:function(c,g){var e=1<arguments.length&&void 0!==g?g:1e3;return 0===c?0:(0===e&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(c/e)*e)}},{key:"modifyAndRoundToNearestAuto",value:function(c,g,e){c=Number(this.forceDecimalPlaces(c,e));var i=Math.abs(c);if(0<=i&&i<1){var r,m=Math.pow(10,-e);if(0===c)return g?m:-m;var s=e,C=this.indexFirstNonZeroDecimalPlace(c);return r=s-1<=C?m:Math.pow(10,-(C+1)),this.roundToNearest(g?c+r:c-r,r)}c=parseInt(c,10);var M,q=Math.abs(c).toString().length;switch(q){case 1:M=0;break;case 2:case 3:M=1;break;case 4:case 5:M=2;break;default:M=q-3}var v,Z=Math.pow(10,M);return(v=g?c+Z:c-Z)<=10&&-10<=v?v:this.roundToNearest(v,Z)}},{key:"addAndRoundToNearestAuto",value:function(c,g){return this.modifyAndRoundToNearestAuto(c,!0,g)}},{key:"subtractAndRoundToNearestAuto",value:function(c,g){return this.modifyAndRoundToNearestAuto(c,!1,g)}},{key:"arabicToLatinNumbers",value:function(c,g,e,i){var r=!(1<arguments.length&&void 0!==g)||g,m=2<arguments.length&&void 0!==e&&e,p=3<arguments.length&&void 0!==i&&i;if(this.isNull(c))return c;var s=c.toString();if(""===s)return c;if(null===s.match(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06f4\u06f5\u06f6]/g))return r&&(s=Number(s)),s;m&&(s=s.replace(/\u066b/,".")),p&&(s=s.replace(/\u066c/g,"")),s=s.replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g,function(M){return M.charCodeAt(0)-1632}).replace(/[\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9]/g,function(M){return M.charCodeAt(0)-1776});var C=Number(s);return isNaN(C)?C:(r&&(s=C),s)}},{key:"triggerEvent",value:function(c,g,e,i,r){var m,p=1<arguments.length&&void 0!==g?g:document,s=2<arguments.length&&void 0!==e?e:null,C=!(3<arguments.length&&void 0!==i)||i,M=!(4<arguments.length&&void 0!==r)||r;window.CustomEvent?m=new CustomEvent(c,{detail:s,bubbles:C,cancelable:M}):(m=document.createEvent("CustomEvent")).initCustomEvent(c,C,M,{detail:s}),p.dispatchEvent(m)}},{key:"parseStr",value:function(c){var g,e,i,r,m={};if(0===c&&1/c<0&&(c="-0"),c=c.toString(),this.isNegativeStrict(c,"-")?(c=c.slice(1),m.s=-1):m.s=1,-1<(g=c.indexOf("."))&&(c=c.replace(".","")),g<0&&(g=c.length),(e=-1===c.search(/[1-9]/i)?c.length:c.search(/[1-9]/i))===(i=c.length))m.e=0,m.c=[0];else{for(r=i-1;"0"===c.charAt(r);--r)--i;for(--i,m.e=g-e-1,m.c=[],g=0;e<=i;e+=1)m.c[g]=+c.charAt(e),g+=1}return m}},{key:"testMinMax",value:function(c,g){var e=g.c,i=c.c,r=g.s,m=c.s,p=g.e,s=c.e;if(!e[0]||!i[0])return e[0]?r:i[0]?-m:0;if(r!==m)return r;var C=r<0;if(p!==s)return s<p^C?1:-1;for(r=-1,m=(p=e.length)<(s=i.length)?p:s,r+=1;r<m;r+=1)if(e[r]!==i[r])return e[r]>i[r]^C?1:-1;return p===s?0:s<p^C?1:-1}},{key:"randomString",value:function(c){var g=0<arguments.length&&void 0!==c?c:5;return Math.random().toString(36).substr(2,g)}},{key:"domElement",value:function(c){return a.isString(c)?document.querySelector(c):c}},{key:"getElementValue",value:function(c){return"input"===c.tagName.toLowerCase()?c.value:this.text(c)}},{key:"setElementValue",value:function(c,g){var e=1<arguments.length&&void 0!==g?g:null;"input"===c.tagName.toLowerCase()?c.value=e:c.textContent=e}},{key:"setInvalidState",value:function(c,g){var e=1<arguments.length&&void 0!==g?g:"Invalid";""!==e&&!this.isNull(e)||this.throwError("Cannot set the invalid state with an empty message."),c.setCustomValidity(e)}},{key:"setValidState",value:function(c){c.setCustomValidity("")}},{key:"cloneObject",value:function(c){return I({},c)}},{key:"camelize",value:function(c,g,e,i){var r=1<arguments.length&&void 0!==g?g:"-",m=!(2<arguments.length&&void 0!==e)||e,p=!(3<arguments.length&&void 0!==i)||i;if(this.isNull(c))return null;m&&(c=c.replace(/^data-/,""));var s=c.split(r).map(function(C){return"".concat(C.charAt(0).toUpperCase()).concat(C.slice(1))});return s=s.join(""),p&&(s="".concat(s.charAt(0).toLowerCase()).concat(s.slice(1))),s}},{key:"text",value:function(c){var g=c.nodeType;return g===Node.ELEMENT_NODE||g===Node.DOCUMENT_NODE||g===Node.DOCUMENT_FRAGMENT_NODE?c.textContent:g===Node.TEXT_NODE?c.nodeValue:""}},{key:"setText",value:function(c,g){var e=c.nodeType;e!==Node.ELEMENT_NODE&&e!==Node.DOCUMENT_NODE&&e!==Node.DOCUMENT_FRAGMENT_NODE||(c.textContent=g)}},{key:"filterOut",value:function(c,g){var e=this;return c.filter(function(i){return!e.isInArray(i,g)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(c){if(""===(c=String(c)))return"";var g=y(c.split("."),2),e=g[0],i=g[1];if(this.isUndefinedOrNullOrEmpty(i))return e;var r=i.replace(/0+$/g,"");return""===r?e:"".concat(e,".").concat(r)}},{key:"getHoveredElement",value:function(){var c=E(document.querySelectorAll(":hover"));return c[c.length-1]}},{key:"arrayTrim",value:function(c,g){var e=c.length;return 0===e||e<g?c:g<0?[]:(c.length=parseInt(g,10),c)}},{key:"arrayUnique",value:function(){var c;return E(new Set((c=[]).concat.apply(c,arguments)))}},{key:"mergeMaps",value:function(){for(var c=arguments.length,g=new Array(c),e=0;e<c;e++)g[e]=arguments[e];return new Map(g.reduce(function(i,r){return i.concat(E(r))},[]))}},{key:"objectKeyLookup",value:function(c,g){var e=Object.entries(c).find(function(r){return r[1]===g}),i=null;return void 0!==e&&(i=e[0]),i}},{key:"insertAt",value:function(c,g,e){if(e>(c=String(c)).length)throw new Error("The given index is out of the string range.");if(1!==g.length)throw new Error("The given string `char` should be only one character long.");return""===c&&0===e?g:"".concat(c.slice(0,e)).concat(g).concat(c.slice(e))}},{key:"scientificToDecimal",value:function(c){var g=Number(c);if(isNaN(g))return NaN;if(c=String(c),!this.contains(c,"e")&&!this.contains(c,"E"))return c;var e=y(c.split(/e/i),2),i=e[0],r=e[1],m=i<0;m&&(i=i.replace("-",""));var p=+r<0;p&&(r=r.replace("-",""));var s,C=y(i.split(/\./),2),M=C[0],q=C[1];return s=p?(s=M.length>r?this.insertAt(M,".",M.length-r):"0.".concat("0".repeat(r-M.length)).concat(M),"".concat(s).concat(q||"")):q?(i="".concat(M).concat(q),r<q.length?this.insertAt(i,".",+r+M.length):"".concat(i).concat("0".repeat(r-q.length))):(i=i.replace(".",""),"".concat(i).concat("0".repeat(Number(r)))),m&&(s="-".concat(s)),s}}]),a}(),f=function(){function a(c){if(function(g){if(!(g instanceof a))throw new TypeError("Cannot call a class as a function")}(this),null===c)throw new Error("Invalid AST")}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a.prototype,[{key:"evaluate",value:function(c){if(null==c)throw new Error("Invalid AST sub-tree");if("number"===c.type)return c.value;if("unaryMinus"===c.type)return-this.evaluate(c.left);var g=this.evaluate(c.left),e=this.evaluate(c.right);switch(c.type){case"op_+":return Number(g)+Number(e);case"op_-":return g-e;case"op_*":return g*e;case"op_/":return g/e;default:throw new Error("Invalid operator '".concat(c.type,"'"))}}}]),a}(),_=function(){function a(){!function(c){if(!(c instanceof a))throw new TypeError("Cannot call a class as a function")}(this)}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a,[{key:"createNode",value:function(c,g,e){var i=new a;return i.type=c,i.left=g,i.right=e,i}},{key:"createUnaryNode",value:function(c){var g=new a;return g.type="unaryMinus",g.left=c,g.right=null,g}},{key:"createLeaf",value:function(c){var g=new a;return g.type="number",g.value=c,g}}]),a}();function P(a,c,g){(function(e){if(!(e instanceof P))throw new TypeError("Cannot call a class as a function")})(this),this.type=a,this.value=c,this.symbol=g}var R=function(){function a(c){(function(g){if(!(g instanceof a))throw new TypeError("Cannot call a class as a function")})(this),this.text=c,this.textLength=c.length,this.index=0,this.token=new P("Error",0,0)}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a.prototype,[{key:"_skipSpaces",value:function(){for(;" "===this.text[this.index]&&this.index<=this.textLength;)this.index++}},{key:"getIndex",value:function(){return this.index}},{key:"getNextToken",value:function(c){var g=0<arguments.length&&void 0!==c?c:".";if(this._skipSpaces(),this.textLength===this.index)return this.token.type="EOT",this.token;if(n.isDigit(this.text[this.index]))return this.token.type="num",this.token.value=this._getNumber(g),this.token;switch(this.token.type="Error",this.text[this.index]){case"+":this.token.type="+";break;case"-":this.token.type="-";break;case"*":this.token.type="*";break;case"/":this.token.type="/";break;case"(":this.token.type="(";break;case")":this.token.type=")"}if("Error"===this.token.type)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(this.token.index,"' in the token function"));return this.token.symbol=this.text[this.index],this.index++,this.token}},{key:"_getNumber",value:function(c){this._skipSpaces();for(var g=this.index;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===c&&this.index++;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;if(this.index===g)throw new Error("No number has been found while it was expected");return this.text.substring(g,this.index).replace(c,".")}}]),a}(),U=function(){function a(c){var g=1<arguments.length&&void 0!==arguments[1]?arguments[1]:".";return function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this.text=c,this.decimalCharacter=g,this.lexer=new R(c),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}return function(c,g){for(var e=0;e<g.length;e++){var i=g[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}(a.prototype,[{key:"_exp",value:function(){var c=this._term(),g=this._moreExp();return _.createNode("op_+",c,g)}},{key:"_moreExp",value:function(){var c,g;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._term(),g=this._moreExp(),_.createNode("op_+",g,c);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._term(),g=this._moreExp(),_.createNode("op_-",g,c)}return _.createLeaf(0)}},{key:"_term",value:function(){var c=this._factor(),g=this._moreTerms();return _.createNode("op_*",c,g)}},{key:"_moreTerms",value:function(){var c,g;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._factor(),g=this._moreTerms(),_.createNode("op_*",g,c);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._factor(),g=this._moreTerms(),_.createNode("op_/",g,c)}return _.createLeaf(1)}},{key:"_factor",value:function(){var c,g,e;switch(this.token.type){case"num":return e=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),_.createLeaf(e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),g=this._factor(),_.createUnaryNode(g);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._exp(),this._match(")"),c;default:throw new Error("Unexpected token '".concat(this.token.symbol,"' with type '").concat(this.token.type,"' at position '").concat(this.token.index,"' in the factor function"))}}},{key:"_match",value:function(c){var g=this.lexer.getIndex()-1;if(this.text[g]!==c)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(g,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}]),a}();function G(a){return function(c){if(Array.isArray(c))return le(c)}(a)||function(c){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(c))return Array.from(c)}(a)||$(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(a,c){return function(g){if(Array.isArray(g))return g}(a)||function(g,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(g)){var i=[],r=!0,m=!1,p=void 0;try{for(var s,C=g[Symbol.iterator]();!(r=(s=C.next()).done)&&(i.push(s.value),!e||i.length!==e);r=!0);}catch(M){m=!0,p=M}finally{try{r||null==C.return||C.return()}finally{if(m)throw p}}return i}}(a,c)||$(a,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(a,c){if(a){if("string"==typeof a)return le(a,c);var g=Object.prototype.toString.call(a).slice(8,-1);return"Object"===g&&a.constructor&&(g=a.constructor.name),"Map"===g||"Set"===g?Array.from(g):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?le(a,c):void 0}}function le(a,c){(null==c||c>a.length)&&(c=a.length);for(var g=0,e=new Array(c);g<c;g++)e[g]=a[g];return e}function re(){return(re=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var g=arguments[c];for(var e in g)Object.prototype.hasOwnProperty.call(g,e)&&(a[e]=g[e])}return a}).apply(this,arguments)}function te(a){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(a)}function ce(a,c){for(var g=0;g<c.length;g++){var e=c[g];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}var H,k=function(){function a(){var e=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,m=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;!function(v){if(!(v instanceof a))throw new TypeError("Cannot call a class as a function")}(this);var p=a._setArgumentsValues(i,r,m),C=p.initialValue,M=p.userOptions;if(this.domElement=p.domElement,this.defaultRawValue="",this._setSettings(M,!1),this._checkElement(),this.savedCancellableValue=null,this.historyTable=[],this.historyTableIndex=-1,this.onGoingRedo=!1,this.parentForm=this._getParentForm(),!this.runOnce&&this.settings.formatOnPageLoad)this._formatDefaultValueOnPageLoad(C);else{var q;if(n.isNull(C))switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.min:q=this.settings.minimumValue;break;case a.options.emptyInputBehavior.max:q=this.settings.maximumValue;break;case a.options.emptyInputBehavior.zero:q="0";break;case a.options.emptyInputBehavior.focus:case a.options.emptyInputBehavior.press:case a.options.emptyInputBehavior.always:case a.options.emptyInputBehavior.null:q="";break;default:q=this.settings.emptyInputBehavior}else q=C;this._setElementAndRawValue(q)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(C),this.sessionStorageAvailable=this.constructor._storageTest(),this.storageNamePrefix="AUTO_",this._setPersistentStorageName(),this.validState=!0,this.isFocused=!1,this.isWheelEvent=!1,this.isDropEvent=!1,this.isEditing=!1,this.rawValueOnFocus=void 0,this.internalModification=!1,this.attributeToWatch=this._getAttributeToWatch(),this.getterSetter=Object.getOwnPropertyDescriptor(this.domElement.__proto__,this.attributeToWatch),this._addWatcher(),this.settings.createLocalList&&this._createLocalList(),this.constructor._addToGlobalList(this),this.global={set:function(v,Z){var V=1<arguments.length&&void 0!==Z?Z:null;e.autoNumericLocalList.forEach(function(B){B.set(v,V)})},setUnformatted:function(v,Z){var V=1<arguments.length&&void 0!==Z?Z:null;e.autoNumericLocalList.forEach(function(B){B.setUnformatted(v,V)})},get:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.get())}),e._executeCallback(V,Z),V},getNumericString:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.getNumericString())}),e._executeCallback(V,Z),V},getFormatted:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.getFormatted())}),e._executeCallback(V,Z),V},getNumber:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.getNumber())}),e._executeCallback(V,Z),V},getLocalized:function(v){var Z=0<arguments.length&&void 0!==v?v:null,V=[];return e.autoNumericLocalList.forEach(function(B){V.push(B.getLocalized())}),e._executeCallback(V,Z),V},reformat:function(){e.autoNumericLocalList.forEach(function(v){v.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(v){v.unformat()})},unformatLocalized:function(v){var Z=0<arguments.length&&void 0!==v?v:null;e.autoNumericLocalList.forEach(function(V){V.unformatLocalized(Z)})},update:function(){for(var v=arguments.length,Z=new Array(v),V=0;V<v;V++)Z[V]=arguments[V];e.autoNumericLocalList.forEach(function(B){B.update.apply(B,Z)})},isPristine:function(){var v=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],Z=!0;return e.autoNumericLocalList.forEach(function(V){Z&&!V.isPristine(v)&&(Z=!1)}),Z},clear:function(v){var Z=0<arguments.length&&void 0!==v&&v;e.autoNumericLocalList.forEach(function(V){V.clear(Z)})},remove:function(){e.autoNumericLocalList.forEach(function(v){v.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(v){v.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(v){v.nuke()})},has:function(v){return e.autoNumericLocalList.has(v instanceof a?v.node():v)},addObject:function(v){var Z,V;V=v instanceof a?(Z=v.node(),v):a.getAutoNumericElement(Z=v),e._hasLocalList()||e._createLocalList();var B,j=V._getLocalList();0===j.size&&(V._createLocalList(),j=V._getLocalList()),(B=j instanceof Map?n.mergeMaps(e._getLocalList(),j):(e._addToLocalList(Z,V),e._getLocalList())).forEach(function(z){z._setLocalList(B)})},removeObject:function(v,Z){var V,B,j=1<arguments.length&&void 0!==Z&&Z;B=v instanceof a?(V=v.node(),v):a.getAutoNumericElement(V=v);var z=e.autoNumericLocalList;e.autoNumericLocalList.delete(V),z.forEach(function(X){X._setLocalList(e.autoNumericLocalList)}),j||V!==e.node()?B._createLocalList():B._setLocalList(new Map)},empty:function(v){var Z=0<arguments.length&&void 0!==v&&v;e.autoNumericLocalList.forEach(function(V){Z?V._createLocalList():V._setLocalList(new Map)})},elements:function(){var v=[];return e.autoNumericLocalList.forEach(function(Z){v.push(Z.node())}),v},getList:function(){return e.autoNumericLocalList},size:function(){return e.autoNumericLocalList.size}},this.options={reset:function(){return e.settings={rawValue:e.defaultRawValue},e.update(a.defaultSettings),e},allowDecimalPadding:function(v){return e.update({allowDecimalPadding:v}),e},alwaysAllowDecimalCharacter:function(v){return e.update({alwaysAllowDecimalCharacter:v}),e},caretPositionOnFocus:function(v){return e.settings.caretPositionOnFocus=v,e},createLocalList:function(v){return e.settings.createLocalList=v,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(v){return e.update({currencySymbol:v}),e},currencySymbolPlacement:function(v){return e.update({currencySymbolPlacement:v}),e},decimalCharacter:function(v){return e.update({decimalCharacter:v}),e},decimalCharacterAlternative:function(v){return e.settings.decimalCharacterAlternative=v,e},decimalPlaces:function(v){return n.warning("Using `options.decimalPlaces()` instead of calling the specific `options.decimalPlacesRawValue()`, `options.decimalPlacesShownOnFocus()` and `options.decimalPlacesShownOnBlur()` methods will reset those options.\nPlease call the specific methods if you do not want to reset those.",e.settings.showWarnings),e.update({decimalPlaces:v}),e},decimalPlacesRawValue:function(v){return e.update({decimalPlacesRawValue:v}),e},decimalPlacesShownOnBlur:function(v){return e.update({decimalPlacesShownOnBlur:v}),e},decimalPlacesShownOnFocus:function(v){return e.update({decimalPlacesShownOnFocus:v}),e},defaultValueOverride:function(v){return e.update({defaultValueOverride:v}),e},digitalGroupSpacing:function(v){return e.update({digitalGroupSpacing:v}),e},digitGroupSeparator:function(v){return e.update({digitGroupSeparator:v}),e},divisorWhenUnfocused:function(v){return e.update({divisorWhenUnfocused:v}),e},emptyInputBehavior:function(v){return null===e.rawValue&&v!==a.options.emptyInputBehavior.null&&(n.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(v,"), but the element raw value is currently set to `null`. This would result in an invalid `rawValue`. In order to fix that, the element value has been changed to the empty string `''`."),e.settings.showWarnings),e.rawValue=""),e.update({emptyInputBehavior:v}),e},eventBubbles:function(v){return e.settings.eventBubbles=v,e},eventIsCancelable:function(v){return e.settings.eventIsCancelable=v,e},failOnUnknownOption:function(v){return e.settings.failOnUnknownOption=v,e},formatOnPageLoad:function(v){return e.settings.formatOnPageLoad=v,e},formulaMode:function(v){return e.settings.formulaMode=v,e},historySize:function(v){return e.settings.historySize=v,e},invalidClass:function(v){return e.settings.invalidClass=v,e},isCancellable:function(v){return e.settings.isCancellable=v,e},leadingZero:function(v){return e.update({leadingZero:v}),e},maximumValue:function(v){return e.update({maximumValue:v}),e},minimumValue:function(v){return e.update({minimumValue:v}),e},modifyValueOnWheel:function(v){return e.settings.modifyValueOnWheel=v,e},negativeBracketsTypeOnBlur:function(v){return e.update({negativeBracketsTypeOnBlur:v}),e},negativePositiveSignPlacement:function(v){return e.update({negativePositiveSignPlacement:v}),e},negativeSignCharacter:function(v){return e.update({negativeSignCharacter:v}),e},noEventListeners:function(v){return v===a.options.noEventListeners.noEvents&&e.settings.noEventListeners===a.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:v}),e},onInvalidPaste:function(v){return e.settings.onInvalidPaste=v,e},outputFormat:function(v){return e.settings.outputFormat=v,e},overrideMinMaxLimits:function(v){return e.update({overrideMinMaxLimits:v}),e},positiveSignCharacter:function(v){return e.update({positiveSignCharacter:v}),e},rawValueDivisor:function(v){return e.update({rawValueDivisor:v}),e},readOnly:function(v){return e.settings.readOnly=v,e._setWritePermissions(),e},roundingMethod:function(v){return e.update({roundingMethod:v}),e},saveValueToSessionStorage:function(v){return e.update({saveValueToSessionStorage:v}),e},symbolWhenUnfocused:function(v){return e.update({symbolWhenUnfocused:v}),e},selectNumberOnly:function(v){return e.settings.selectNumberOnly=v,e},selectOnFocus:function(v){return e.settings.selectOnFocus=v,e},serializeSpaces:function(v){return e.settings.serializeSpaces=v,e},showOnlyNumbersOnFocus:function(v){return e.update({showOnlyNumbersOnFocus:v}),e},showPositiveSign:function(v){return e.update({showPositiveSign:v}),e},showWarnings:function(v){return e.settings.showWarnings=v,e},styleRules:function(v){return e.update({styleRules:v}),e},suffixText:function(v){return e.update({suffixText:v}),e},unformatOnHover:function(v){return e.settings.unformatOnHover=v,e},unformatOnSubmit:function(v){return e.settings.unformatOnSubmit=v,e},valuesToStrings:function(v){return e.update({valuesToStrings:v}),e},watchExternalChanges:function(v){return e.update({watchExternalChanges:v}),e},wheelOn:function(v){return e.settings.wheelOn=v,e},wheelStep:function(v){return e.settings.wheelStep=v,e}},this._triggerEvent(a.events.initialized,this.domElement,{newValue:n.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var c,g;return g=[{key:"version",value:function(){return"4.6.0"}},{key:"_setArgumentsValues",value:function(e,i,r){n.isNull(e)&&n.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var m,p,s,C=n.isElement(e),M=n.isString(e),q=n.isObject(i),v=Array.isArray(i)&&0<i.length,Z=n.isNumberOrArabic(i)||""===i,V=this._isPreDefinedOptionValid(i),B=n.isNull(i),j=n.isEmptyString(i),z=n.isObject(r),X=Array.isArray(r)&&0<r.length,ne=n.isNull(r),se=this._isPreDefinedOptionValid(r);return C&&B&&ne?(m=e,p=s=null):C&&Z&&ne?(m=e,s=i,p=null):C&&q&&ne?(m=e,s=null,p=i):C&&V&&ne?(m=e,s=null,p=this._getOptionObject(i)):C&&v&&ne?(m=e,s=null,p=this.mergeOptions(i)):C&&(B||j)&&z?(m=e,s=null,p=r):C&&(B||j)&&X?(m=e,s=null,p=this.mergeOptions(r)):M&&B&&ne?(m=document.querySelector(e),p=s=null):M&&q&&ne?(m=document.querySelector(e),s=null,p=i):M&&V&&ne?(m=document.querySelector(e),s=null,p=this._getOptionObject(i)):M&&v&&ne?(m=document.querySelector(e),s=null,p=this.mergeOptions(i)):M&&(B||j)&&z?(m=document.querySelector(e),s=null,p=r):M&&(B||j)&&X?(m=document.querySelector(e),s=null,p=this.mergeOptions(r)):M&&Z&&ne?(m=document.querySelector(e),s=i,p=null):M&&Z&&z?(m=document.querySelector(e),s=i,p=r):M&&Z&&se?(m=document.querySelector(e),s=i,p=this._getOptionObject(r)):M&&Z&&X?(m=document.querySelector(e),s=i,p=this.mergeOptions(r)):C&&Z&&z?(m=e,s=i,p=r):C&&Z&&se?(m=e,s=i,p=this._getOptionObject(r)):C&&Z&&X?(m=e,s=i,p=this.mergeOptions(r)):n.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(i,"' and '").concat(r,"' given.")),n.isNull(m)&&n.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:m,initialValue:s,userOptions:p}}},{key:"mergeOptions",value:function(e){var i=this,r={};return e.forEach(function(m){re(r,i._getOptionObject(m))}),r}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(a.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var i;return n.isString(e)?null==(i=a.getPredefinedOptions()[e])&&n.warning("The given pre-defined option [".concat(e,"] is not recognized by autoNumeric. Please check that pre-defined option name."),!0):i=e,i}},{key:"_doesFormHandlerListExists",value:function(){var e=te(window.aNFormHandlerMap);return"undefined"!==e&&"object"===e}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,i){return n.isInArray(String(e),i)}},{key:"_checkValuesToStringsSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.keys(i.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.values(i.valuesToStrings))}},{key:"_unformatAltHovered",value:function(e){e.hoveredWithAlt=!0,e.unformat()}},{key:"_reformatAltHovered",value:function(e){e.hoveredWithAlt=!1,e.reformat()}},{key:"_getChildANInputElement",value:function(e){var i=this,r=e.getElementsByTagName("input"),m=[];return Array.prototype.slice.call(r,0).forEach(function(p){i.test(p)&&m.push(p)}),m}},{key:"test",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"_createWeakMap",value:function(e){window[e]=new WeakMap}},{key:"_createGlobalList",value:function(){this.autoNumericGlobalListName="autoNumericGlobalList",this._createWeakMap(this.autoNumericGlobalListName)}},{key:"_doesGlobalListExists",value:function(){var e=te(window[this.autoNumericGlobalListName]);return"undefined"!==e&&"object"===e}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var i=e.node();if(this._isInGlobalList(i)){if(this._getFromGlobalList(i)===this)return;n.warning("A reference to the DOM element you just initialized already exists in the global AutoNumeric element list. Please make sure to not initialize the same DOM element multiple times.",e.getSettings().showWarnings)}window[this.autoNumericGlobalListName].set(i,e)}},{key:"_removeFromGlobalList",value:function(e){this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].delete(e.node())}},{key:"_getFromGlobalList",value:function(e){return this._doesGlobalListExists()?window[this.autoNumericGlobalListName].get(e):null}},{key:"_isInGlobalList",value:function(e){return!!this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].has(e)}},{key:"validate",value:function(e,i,r){var m=!(1<arguments.length&&void 0!==i)||i,p=2<arguments.length&&void 0!==r?r:null;!n.isUndefinedOrNullOrEmpty(e)&&n.isObject(e)||n.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var s,C=n.isObject(p);C||n.isNull(p)||n.throwError("The 'originalOptions' parameter is invalid ; it should either be a valid option object or `null`, [".concat(e,"] given.")),n.isNull(e)||this._convertOldOptionsToNewOnes(e),s=m?re({},this.getDefaultConfig(),e):e,n.isTrueOrFalseString(s.showWarnings)||n.isBoolean(s.showWarnings)||n.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(s.showWarnings,"] given."));var M,q=/^[0-9]+$/,v=/[0-9]+/,Z=/^-?[0-9]+(\.?[0-9]+)?$/,V=/^[0-9]+(\.?[0-9]+)?$/;n.isTrueOrFalseString(s.allowDecimalPadding)||n.isBoolean(s.allowDecimalPadding)||s.allowDecimalPadding===a.options.allowDecimalPadding.floats||n.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true` or `'floats'`, [".concat(s.allowDecimalPadding,"] given.")),s.allowDecimalPadding!==a.options.allowDecimalPadding.never&&"false"!==s.allowDecimalPadding||s.decimalPlaces===a.options.decimalPlaces.none&&s.decimalPlacesShownOnBlur===a.options.decimalPlacesShownOnBlur.none&&s.decimalPlacesShownOnFocus===a.options.decimalPlacesShownOnFocus.none||n.warning("Setting 'allowDecimalPadding' to [".concat(s.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(s.decimalPlaces,", ").concat(s.decimalPlacesShownOnBlur," and ").concat(s.decimalPlacesShownOnFocus,"]."),s.showWarnings),n.isTrueOrFalseString(s.alwaysAllowDecimalCharacter)||n.isBoolean(s.alwaysAllowDecimalCharacter)||n.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(s.alwaysAllowDecimalCharacter,"] given.")),n.isNull(s.caretPositionOnFocus)||n.isInArray(s.caretPositionOnFocus,[a.options.caretPositionOnFocus.start,a.options.caretPositionOnFocus.end,a.options.caretPositionOnFocus.decimalLeft,a.options.caretPositionOnFocus.decimalRight])||n.throwError("The display on empty string option 'caretPositionOnFocus' is invalid ; it should either be `null`, 'focus', 'press', 'always' or 'zero', [".concat(s.caretPositionOnFocus,"] given.")),M=C?p:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),n.isNull(M)||M.caretPositionOnFocus===a.options.caretPositionOnFocus.doNoForceCaretPosition||M.selectOnFocus!==a.options.selectOnFocus.select||n.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(M.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),s.showWarnings),n.isInArray(s.digitGroupSeparator,[a.options.digitGroupSeparator.comma,a.options.digitGroupSeparator.dot,a.options.digitGroupSeparator.normalSpace,a.options.digitGroupSeparator.thinSpace,a.options.digitGroupSeparator.narrowNoBreakSpace,a.options.digitGroupSeparator.noBreakSpace,a.options.digitGroupSeparator.noSeparator,a.options.digitGroupSeparator.apostrophe,a.options.digitGroupSeparator.arabicThousandsSeparator,a.options.digitGroupSeparator.dotAbove,a.options.digitGroupSeparator.privateUseTwo])||n.throwError("The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '\u066c', '\u02d9', \"'\", '\x92', ' ', '\u2009', '\u202f', '\xa0' or empty (''), [".concat(s.digitGroupSeparator,"] given.")),n.isTrueOrFalseString(s.showOnlyNumbersOnFocus)||n.isBoolean(s.showOnlyNumbersOnFocus)||n.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(s.showOnlyNumbersOnFocus,"] given.")),n.isInArray(s.digitalGroupSpacing,[a.options.digitalGroupSpacing.two,a.options.digitalGroupSpacing.twoScaled,a.options.digitalGroupSpacing.three,a.options.digitalGroupSpacing.four])||2<=s.digitalGroupSpacing&&s.digitalGroupSpacing<=4||n.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2s', '3', or '4', [".concat(s.digitalGroupSpacing,"] given.")),n.isInArray(s.decimalCharacter,[a.options.decimalCharacter.comma,a.options.decimalCharacter.dot,a.options.decimalCharacter.middleDot,a.options.decimalCharacter.arabicDecimalSeparator,a.options.decimalCharacter.decimalSeparatorKeySymbol])||n.throwError("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '\xb7', '\u2396' or '\u066b', [".concat(s.decimalCharacter,"] given.")),s.decimalCharacter===s.digitGroupSeparator&&n.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(s.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(s.digitGroupSeparator,"] are the same character.")),n.isNull(s.decimalCharacterAlternative)||n.isString(s.decimalCharacterAlternative)||n.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(s.decimalCharacterAlternative,"] given.")),""===s.currencySymbol||n.isString(s.currencySymbol)||n.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(s.currencySymbol,"] given.")),n.isInArray(s.currencySymbolPlacement,[a.options.currencySymbolPlacement.prefix,a.options.currencySymbolPlacement.suffix])||n.throwError("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), [".concat(s.currencySymbolPlacement,"] given.")),n.isInArray(s.negativePositiveSignPlacement,[a.options.negativePositiveSignPlacement.prefix,a.options.negativePositiveSignPlacement.suffix,a.options.negativePositiveSignPlacement.left,a.options.negativePositiveSignPlacement.right,a.options.negativePositiveSignPlacement.none])||n.throwError("The placement of the negative sign option 'negativePositiveSignPlacement' is invalid ; it should either be 'p' (prefix), 's' (suffix), 'l' (left), 'r' (right) or 'null', [".concat(s.negativePositiveSignPlacement,"] given.")),n.isTrueOrFalseString(s.showPositiveSign)||n.isBoolean(s.showPositiveSign)||n.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(s.showPositiveSign,"] given.")),n.isString(s.suffixText)&&(""===s.suffixText||!n.isNegative(s.suffixText,s.negativeSignCharacter)&&!v.test(s.suffixText))||n.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(s.negativeSignCharacter,"' nor any numerical characters, [").concat(s.suffixText,"] given.")),n.isString(s.negativeSignCharacter)&&1===s.negativeSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(s.negativeSignCharacter)&&!v.test(s.negativeSignCharacter)||n.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(s.negativeSignCharacter,"] given.")),n.isString(s.positiveSignCharacter)&&1===s.positiveSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(s.positiveSignCharacter)&&!v.test(s.positiveSignCharacter)||n.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(s.positiveSignCharacter,"] given.\nIf you want to hide the positive sign character, you need to set the `showPositiveSign` option to `true`.")),s.negativeSignCharacter===s.positiveSignCharacter&&n.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(s.negativeSignCharacter,"] given."));var B=W(n.isNull(s.negativeBracketsTypeOnBlur)?["",""]:s.negativeBracketsTypeOnBlur.split(","),2),j=B[0],z=B[1];(n.contains(s.digitGroupSeparator,s.negativeSignCharacter)||n.contains(s.decimalCharacter,s.negativeSignCharacter)||n.contains(s.decimalCharacterAlternative,s.negativeSignCharacter)||n.contains(j,s.negativeSignCharacter)||n.contains(z,s.negativeSignCharacter)||n.contains(s.suffixText,s.negativeSignCharacter))&&n.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(s.negativeSignCharacter,"] given.")),(n.contains(s.digitGroupSeparator,s.positiveSignCharacter)||n.contains(s.decimalCharacter,s.positiveSignCharacter)||n.contains(s.decimalCharacterAlternative,s.positiveSignCharacter)||n.contains(j,s.positiveSignCharacter)||n.contains(z,s.positiveSignCharacter)||n.contains(s.suffixText,s.positiveSignCharacter))&&n.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(s.positiveSignCharacter,"] given.")),n.isNull(s.overrideMinMaxLimits)||n.isInArray(s.overrideMinMaxLimits,[a.options.overrideMinMaxLimits.ceiling,a.options.overrideMinMaxLimits.floor,a.options.overrideMinMaxLimits.ignore,a.options.overrideMinMaxLimits.invalid])||n.throwError("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor', 'ignore' or 'invalid', [".concat(s.overrideMinMaxLimits,"] given.")),s.overrideMinMaxLimits!==a.options.overrideMinMaxLimits.invalid&&s.overrideMinMaxLimits!==a.options.overrideMinMaxLimits.ignore&&(0<s.minimumValue||s.maximumValue<0)&&n.warning("You've set a `minimumValue` or a `maximumValue` excluding the value `0`. AutoNumeric will force the users to always have a valid value in the input, hence preventing them to clear the field. If you want to allow for temporary invalid values (ie. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),n.isString(s.maximumValue)&&Z.test(s.maximumValue)||n.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(s.maximumValue,"] given.")),n.isString(s.minimumValue)&&Z.test(s.minimumValue)||n.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(s.minimumValue,"] given.")),parseFloat(s.minimumValue)>parseFloat(s.maximumValue)&&n.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(s.minimumValue,"] should be smaller than 'maximumValue' [").concat(s.maximumValue,"].")),n.isInt(s.decimalPlaces)&&0<=s.decimalPlaces||n.isString(s.decimalPlaces)&&q.test(s.decimalPlaces)||n.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(s.decimalPlaces,"] given.")),n.isNull(s.decimalPlacesRawValue)||n.isInt(s.decimalPlacesRawValue)&&0<=s.decimalPlacesRawValue||n.isString(s.decimalPlacesRawValue)&&q.test(s.decimalPlacesRawValue)||n.throwError("The number of decimal places for the raw value option 'decimalPlacesRawValue' is invalid ; it should be a positive integer or `null`, [".concat(s.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(s),n.isNull(s.decimalPlacesShownOnFocus)||q.test(String(s.decimalPlacesShownOnFocus))||n.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(s.decimalPlacesShownOnFocus,"] given.")),!n.isNull(s.decimalPlacesShownOnFocus)&&Number(s.decimalPlaces)>Number(s.decimalPlacesShownOnFocus)&&n.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(s.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(s.decimalPlaces,"] value. Currently, this will limit the ability of your user to manually change some of the decimal places. Do you really want to do that?"),s.showWarnings),(n.isNull(s.divisorWhenUnfocused)||V.test(s.divisorWhenUnfocused))&&0!==s.divisorWhenUnfocused&&"0"!==s.divisorWhenUnfocused&&1!==s.divisorWhenUnfocused&&"1"!==s.divisorWhenUnfocused||n.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(s.divisorWhenUnfocused,"] given.")),n.isNull(s.decimalPlacesShownOnBlur)||q.test(s.decimalPlacesShownOnBlur)||n.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(s.decimalPlacesShownOnBlur,"] given.")),n.isNull(s.symbolWhenUnfocused)||n.isString(s.symbolWhenUnfocused)||n.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(s.symbolWhenUnfocused,"] given.")),n.isTrueOrFalseString(s.saveValueToSessionStorage)||n.isBoolean(s.saveValueToSessionStorage)||n.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(s.saveValueToSessionStorage,"] given.")),n.isInArray(s.onInvalidPaste,[a.options.onInvalidPaste.error,a.options.onInvalidPaste.ignore,a.options.onInvalidPaste.clamp,a.options.onInvalidPaste.truncate,a.options.onInvalidPaste.replace])||n.throwError("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), [".concat(s.onInvalidPaste,"] given.")),n.isInArray(s.roundingMethod,[a.options.roundingMethod.halfUpSymmetric,a.options.roundingMethod.halfUpAsymmetric,a.options.roundingMethod.halfDownSymmetric,a.options.roundingMethod.halfDownAsymmetric,a.options.roundingMethod.halfEvenBankersRounding,a.options.roundingMethod.upRoundAwayFromZero,a.options.roundingMethod.downRoundTowardZero,a.options.roundingMethod.toCeilingTowardPositiveInfinity,a.options.roundingMethod.toFloorTowardNegativeInfinity,a.options.roundingMethod.toNearest05,a.options.roundingMethod.toNearest05Alt,a.options.roundingMethod.upToNext05,a.options.roundingMethod.downToNext05])||n.throwError("The rounding method option 'roundingMethod' is invalid ; it should either be 'S', 'A', 's', 'a', 'B', 'U', 'D', 'C', 'F', 'N05', 'CHF', 'U05' or 'D05' (cf. documentation), [".concat(s.roundingMethod,"] given.")),n.isNull(s.negativeBracketsTypeOnBlur)||n.isInArray(s.negativeBracketsTypeOnBlur,[a.options.negativeBracketsTypeOnBlur.parentheses,a.options.negativeBracketsTypeOnBlur.brackets,a.options.negativeBracketsTypeOnBlur.chevrons,a.options.negativeBracketsTypeOnBlur.curlyBraces,a.options.negativeBracketsTypeOnBlur.angleBrackets,a.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,a.options.negativeBracketsTypeOnBlur.halfBrackets,a.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,a.options.negativeBracketsTypeOnBlur.quotationMarks,a.options.negativeBracketsTypeOnBlur.guillemets])||n.throwError("The brackets for negative values option 'negativeBracketsTypeOnBlur' is invalid ; it should either be '(,)', '[,]', '<,>', '{,}', '\u3008,\u3009', '\uff62,\uff63', '\u2e24,\u2e25', '\u27e6,\u27e7', '\u2039,\u203a' or '\xab,\xbb', [".concat(s.negativeBracketsTypeOnBlur,"] given.")),(n.isString(s.emptyInputBehavior)||n.isNumber(s.emptyInputBehavior))&&(n.isInArray(s.emptyInputBehavior,[a.options.emptyInputBehavior.focus,a.options.emptyInputBehavior.press,a.options.emptyInputBehavior.always,a.options.emptyInputBehavior.min,a.options.emptyInputBehavior.max,a.options.emptyInputBehavior.zero,a.options.emptyInputBehavior.null])||Z.test(s.emptyInputBehavior))||n.throwError("The display on empty string option 'emptyInputBehavior' is invalid ; it should either be 'focus', 'press', 'always', 'min', 'max', 'zero', 'null', a number, or a string that represents a number, [".concat(s.emptyInputBehavior,"] given.")),s.emptyInputBehavior===a.options.emptyInputBehavior.zero&&(0<s.minimumValue||s.maximumValue<0)&&n.throwError("The 'emptyInputBehavior' option is set to 'zero', but this value is outside of the range defined by 'minimumValue' and 'maximumValue' [".concat(s.minimumValue,", ").concat(s.maximumValue,"].")),Z.test(String(s.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(s.emptyInputBehavior,s)||n.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(s.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(s.minimumValue,", ").concat(s.maximumValue,"]."))),n.isTrueOrFalseString(s.eventBubbles)||n.isBoolean(s.eventBubbles)||n.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(s.eventBubbles,"] given.")),n.isTrueOrFalseString(s.eventIsCancelable)||n.isBoolean(s.eventIsCancelable)||n.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(s.eventIsCancelable,"] given.")),!n.isBoolean(s.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(s.invalidClass)||n.throwError("The name of the 'invalidClass' option is not a valid CSS class name ; it should not be empty, and should follow the '^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$' regex, [".concat(s.invalidClass,"] given.")),n.isInArray(s.leadingZero,[a.options.leadingZero.allow,a.options.leadingZero.deny,a.options.leadingZero.keep])||n.throwError("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [".concat(s.leadingZero,"] given.")),n.isTrueOrFalseString(s.formatOnPageLoad)||n.isBoolean(s.formatOnPageLoad)||n.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(s.formatOnPageLoad,"] given.")),n.isTrueOrFalseString(s.formulaMode)||n.isBoolean(s.formulaMode)||n.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(s.formulaMode,"] given.")),q.test(s.historySize)&&0!==s.historySize||n.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(s.historySize,"] given.")),n.isTrueOrFalseString(s.selectNumberOnly)||n.isBoolean(s.selectNumberOnly)||n.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(s.selectNumberOnly,"] given.")),n.isTrueOrFalseString(s.selectOnFocus)||n.isBoolean(s.selectOnFocus)||n.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(s.selectOnFocus,"] given.")),n.isNull(s.defaultValueOverride)||""===s.defaultValueOverride||Z.test(s.defaultValueOverride)||n.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(s.defaultValueOverride,"] given.")),n.isTrueOrFalseString(s.unformatOnSubmit)||n.isBoolean(s.unformatOnSubmit)||n.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(s.unformatOnSubmit,"] given.")),n.isNull(s.valuesToStrings)||n.isObject(s.valuesToStrings)||n.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(s.valuesToStrings,"] given.")),n.isNull(s.outputFormat)||n.isInArray(s.outputFormat,[a.options.outputFormat.string,a.options.outputFormat.number,a.options.outputFormat.dot,a.options.outputFormat.negativeDot,a.options.outputFormat.comma,a.options.outputFormat.negativeComma,a.options.outputFormat.dotNegative,a.options.outputFormat.commaNegative])||n.throwError("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [".concat(s.outputFormat,"] given.")),n.isTrueOrFalseString(s.isCancellable)||n.isBoolean(s.isCancellable)||n.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(s.isCancellable,"] given.")),n.isTrueOrFalseString(s.modifyValueOnWheel)||n.isBoolean(s.modifyValueOnWheel)||n.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(s.modifyValueOnWheel,"] given.")),n.isTrueOrFalseString(s.watchExternalChanges)||n.isBoolean(s.watchExternalChanges)||n.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(s.watchExternalChanges,"] given.")),n.isInArray(s.wheelOn,[a.options.wheelOn.focus,a.options.wheelOn.hover])||n.throwError("The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [".concat(s.wheelOn,"] given.")),(n.isString(s.wheelStep)||n.isNumber(s.wheelStep))&&("progressive"===s.wheelStep||V.test(s.wheelStep))&&0!==Number(s.wheelStep)||n.throwError("The wheel step value option 'wheelStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(s.wheelStep,"] given.")),n.isInArray(s.serializeSpaces,[a.options.serializeSpaces.plus,a.options.serializeSpaces.percent])||n.throwError("The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [".concat(s.serializeSpaces,"] given.")),n.isTrueOrFalseString(s.noEventListeners)||n.isBoolean(s.noEventListeners)||n.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(s.noEventListeners,"] given.")),n.isNull(s.styleRules)||n.isObject(s.styleRules)&&(Object.prototype.hasOwnProperty.call(s.styleRules,"positive")||Object.prototype.hasOwnProperty.call(s.styleRules,"negative")||Object.prototype.hasOwnProperty.call(s.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(s.styleRules,"userDefined"))||n.throwError("The option 'styleRules' is invalid ; it should be a correctly structured object, with one or more 'positive', 'negative', 'ranges' or 'userDefined' attributes, [".concat(s.styleRules,"] given.")),n.isNull(s.styleRules)||!Object.prototype.hasOwnProperty.call(s.styleRules,"userDefined")||n.isNull(s.styleRules.userDefined)||s.styleRules.userDefined.forEach(function(X){Object.prototype.hasOwnProperty.call(X,"callback")&&!n.isFunction(X.callback)&&n.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(te(X.callback)," given."))}),(n.isNull(s.rawValueDivisor)||V.test(s.rawValueDivisor))&&0!==s.rawValueDivisor&&"0"!==s.rawValueDivisor&&1!==s.rawValueDivisor&&"1"!==s.rawValueDivisor||n.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(s.rawValueDivisor,"] given.")),n.isTrueOrFalseString(s.readOnly)||n.isBoolean(s.readOnly)||n.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(s.readOnly,"] given.")),n.isTrueOrFalseString(s.unformatOnHover)||n.isBoolean(s.unformatOnHover)||n.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(s.unformatOnHover,"] given.")),n.isTrueOrFalseString(s.failOnUnknownOption)||n.isBoolean(s.failOnUnknownOption)||n.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(s.failOnUnknownOption,"] given.")),n.isTrueOrFalseString(s.createLocalList)||n.isBoolean(s.createLocalList)||n.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(s.createLocalList,"] given."))}},{key:"_validateDecimalPlacesRawValue",value:function(e){n.isNull(e.decimalPlacesRawValue)||(e.decimalPlacesRawValue<e.decimalPlaces&&n.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones to display [").concat(e.decimalPlaces,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlaces`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnFocus&&n.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown on focus [").concat(e.decimalPlacesShownOnFocus,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnFocus`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnBlur&&n.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown when unfocused [").concat(e.decimalPlacesShownOnBlur,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnBlur`."),e.showWarnings))}},{key:"areSettingsValid",value:function(e){var i=!0;try{this.validate(e,!0)}catch(r){i=!1}return i}},{key:"getDefaultConfig",value:function(){return a.defaultSettings}},{key:"getPredefinedOptions",value:function(){return a.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var i,r=this;return n.isUndefinedOrNullOrEmpty(e)||0===e.length?i=null:(i={},1===e.length&&Array.isArray(e[0])?e[0].forEach(function(m){re(i,r._getOptionObject(m))}):1<=e.length&&e.forEach(function(m){re(i,r._getOptionObject(m))})),i}},{key:"format",value:function(e){if(n.isUndefined(e)||null===e)return null;var i;i=n.isElement(e)?n.getElementValue(e):e,n.isString(i)||n.isNumber(i)||n.throwError('The value "'.concat(i,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var r=arguments.length,m=new Array(1<r?r-1:0),p=1;p<r;p++)m[p-1]=arguments[p];var s=this._generateOptionsObjectFromOptionsArray(m),C=re({},this.getDefaultConfig(),s);C.isNegativeSignAllowed=i<0,C.isPositiveSignAllowed=0<=i,this._setBrackets(C),this._cachesUsualRegularExpressions(C,{});var M=this._toNumericValue(i,C);return isNaN(Number(M))&&n.throwError("The value [".concat(M,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(M,C)||(n.triggerEvent(a.events.formatted,document,{oldValue:null,newValue:null,oldRawValue:null,newRawValue:null,isPristine:null,error:"Range test failed",aNElement:null},!0,!0),n.throwError("The value [".concat(M,"] being set falls outside of the minimumValue [").concat(C.minimumValue,"] and maximumValue [").concat(C.maximumValue,"] range set for this element"))),C.valuesToStrings&&this._checkValuesToStringsSettings(i,C)?C.valuesToStrings[i]:(this._correctNegativePositiveSignPlacementOption(C),this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===M||null===M||(M*=C.rawValueDivisor),M=this._roundFormattedValueShownOnFocus(M,C),M=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(M,C),M=this._addGroupSeparators(M,C,!1,M))}},{key:"formatAndSet",value:function(e,i){var m=this.format(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,m),m}},{key:"unformat",value:function(e){if(n.isNumberStrict(e))return e;var i;if(""===(i=n.isElement(e)?n.getElementValue(e):e))return"";if(n.isUndefined(i)||null===i)return null;(n.isArray(i)||n.isObject(i))&&n.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(i,"] given."));for(var r=arguments.length,m=new Array(1<r?r-1:0),p=1;p<r;p++)m[p-1]=arguments[p];var s=this._generateOptionsObjectFromOptionsArray(m),C=re({},this.getDefaultConfig(),s);if(C.isNegativeSignAllowed=!1,C.isPositiveSignAllowed=!0,i=i.toString(),C.valuesToStrings&&this._checkStringsToValuesSettings(i,C))return n.objectKeyLookup(C.valuesToStrings,i);if(n.isNegative(i,C.negativeSignCharacter))C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1;else if(!n.isNull(C.negativeBracketsTypeOnBlur)){var M=W(C.negativeBracketsTypeOnBlur.split(","),2);C.firstBracket=M[0],C.lastBracket=M[1],i.charAt(0)===C.firstBracket&&i.charAt(i.length-1)===C.lastBracket&&(C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1,i=this._removeBrackets(i,C,!1))}return i=this._convertToNumericString(i,C),new RegExp("[^+-0123456789.]","gi").test(i)?NaN:(this._correctNegativePositiveSignPlacementOption(C),C.originalDecimalPlacesRawValue=C.decimalPlacesRawValue?C.decimalPlacesRawValue:C.decimalPlaces,this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===i||null===i||(i/=C.rawValueDivisor),i=(i=this._roundRawValue(i,C)).replace(C.decimalCharacter,"."),i=this._toLocale(i,C.outputFormat,C))}},{key:"unformatAndSet",value:function(e,i){var m=this.unformat(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,m),m}},{key:"localize",value:function(e,i){var r,m,p=1<arguments.length&&void 0!==i?i:null;return""===(r=n.isElement(e)?n.getElementValue(e):e)?"":(n.isNull(p)&&(p=a.defaultSettings),r=this.unformat(r,p),0===Number(r)&&p.leadingZero!==a.options.leadingZero.keep&&(r="0"),m=n.isNull(p)?p.outputFormat:a.defaultSettings.outputFormat,this._toLocale(r,m,p))}},{key:"localizeAndSet",value:function(e,i){var m=this.localize(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,m),m}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var i=n.domElement(e);return this.isManagedByAutoNumeric(i)?this._getFromGlobalList(i):null}},{key:"set",value:function(e,i,r,m){var p,s=2<arguments.length&&void 0!==r?r:null,C=!(3<arguments.length&&void 0!==m)||m,M=n.domElement(e);return this.isManagedByAutoNumeric(M)?this.getAutoNumericElement(M).set(i,s,C):(p=!(!n.isNull(s)&&Object.prototype.hasOwnProperty.call(s,"showWarnings"))||s.showWarnings,n.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",p),null)}},{key:"getNumericString",value:function(e,i){return this._get(e,"getNumericString",1<arguments.length&&void 0!==i?i:null)}},{key:"getFormatted",value:function(e,i){return this._get(e,"getFormatted",1<arguments.length&&void 0!==i?i:null)}},{key:"getNumber",value:function(e,i){return this._get(e,"getNumber",1<arguments.length&&void 0!==i?i:null)}},{key:"_get",value:function(e,i,r){var m=2<arguments.length&&void 0!==r?r:null,p=n.domElement(e);return this.isManagedByAutoNumeric(p)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(p)[i](m)}},{key:"getLocalized",value:function(e,i,r){var m=1<arguments.length&&void 0!==i?i:null,p=2<arguments.length&&void 0!==r?r:null,s=n.domElement(e);return this.isManagedByAutoNumeric(s)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(s).getLocalized(m,p)}},{key:"_stripAllNonNumberCharacters",value:function(e,i,r,m){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,r,m).replace(i.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,i,r,m){var p=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(i.allowedAutoStrip,"")).match(i.numRegAutoStrip);if(e=p?[p[1],p[2],p[3]].join(""):"",i.leadingZero===a.options.leadingZero.allow||i.leadingZero===a.options.leadingZero.keep){var s="",C=W(e.split(i.decimalCharacter),2),q=C[1],v=C[0];n.contains(v,i.negativeSignCharacter)&&(s=i.negativeSignCharacter,v=v.replace(i.negativeSignCharacter,"")),""===s&&v.length>i.mIntPos&&"0"===v.charAt(0)&&(v=v.slice(1)),""!==s&&v.length>i.mIntNeg&&"0"===v.charAt(0)&&(v=v.slice(1)),e="".concat(s).concat(v).concat(n.isUndefined(q)?"":i.decimalCharacter+q)}return(r&&i.leadingZero===a.options.leadingZero.deny||!m&&i.leadingZero===a.options.leadingZero.allow)&&(e=e.replace(i.stripReg,"$1$2")),e}},{key:"_toggleNegativeBracket",value:function(e,i,r){return r?this._removeBrackets(e,i):this._addBrackets(e,i)}},{key:"_addBrackets",value:function(e,i){return n.isNull(i.negativeBracketsTypeOnBlur)?e:"".concat(i.firstBracket).concat(e.replace(i.negativeSignCharacter,"")).concat(i.lastBracket)}},{key:"_removeBrackets",value:function(e,i,r){var m,p=!(2<arguments.length&&void 0!==r)||r;return n.isNull(i.negativeBracketsTypeOnBlur)||e.charAt(0)!==i.firstBracket?e:(m=(m=e.replace(i.firstBracket,"")).replace(i.lastBracket,""),p?(m=m.replace(i.currencySymbol,""),this._mergeCurrencySignNegativePositiveSignAndValue(m,i,!0,!1)):"".concat(i.negativeSignCharacter).concat(m))}},{key:"_setBrackets",value:function(e){if(n.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var i=W(e.negativeBracketsTypeOnBlur.split(","),2),m=i[1];e.firstBracket=i[0],e.lastBracket=m}}},{key:"_convertToNumericString",value:function(e,i){e=this._removeBrackets(e,i,!1),e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(new RegExp("[".concat(i.digitGroupSeparator,"]"),"g"),""),"."!==i.decimalCharacter&&(e=e.replace(i.decimalCharacter,".")),n.isNegative(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-".concat(e)),i.showPositiveSign&&(e=e.replace(i.positiveSignCharacter,""));var m=n.arabicToLatinNumbers(e,i.leadingZero!==a.options.leadingZero.keep,!1,!1);return isNaN(m)||(e=m.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,i){return e=String(e),i.currencySymbol!==a.options.currencySymbol.none&&(e=e.replace(i.currencySymbol,"")),i.suffixText!==a.options.suffixText.none&&(e=e.replace(i.suffixText,"")),i.negativeSignCharacter!==a.options.negativeSignCharacter.hyphen&&(e=e.replace(i.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,i,r){if(n.isNull(i)||i===a.options.outputFormat.string)return e;var m;switch(i){case a.options.outputFormat.number:m=Number(e);break;case a.options.outputFormat.dotNegative:m=n.isNegative(e)?e.replace("-","")+"-":e;break;case a.options.outputFormat.comma:case a.options.outputFormat.negativeComma:m=e.replace(".",",");break;case a.options.outputFormat.commaNegative:m=e.replace(".",","),m=n.isNegative(m)?m.replace("-","")+"-":m;break;case a.options.outputFormat.dot:case a.options.outputFormat.negativeDot:m=e;break;default:n.throwError("The given outputFormat [".concat(i,"] option is not recognized."))}return i!==a.options.outputFormat.number&&"-"!==r.negativeSignCharacter&&(m=m.replace("-",r.negativeSignCharacter)),m}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,i){return"-"!==i.negativeSignCharacter&&(e=e.replace("-",i.negativeSignCharacter)),"."!==i.decimalCharacter&&(e=e.replace(".",i.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,i){return""===e||e===i.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(e,i,r){var m;if(i.emptyInputBehavior===a.options.emptyInputBehavior.always||r)switch(i.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.none:m=e+i.currencySymbol+i.suffixText;break;default:m=i.currencySymbol+e+i.suffixText}else m=e;return m}},{key:"_addGroupSeparators",value:function(e,i,r,m,p){var s,C=4<arguments.length&&void 0!==p?p:null;if(s=n.isNull(C)?n.isNegative(e,i.negativeSignCharacter)||n.isNegativeWithBrackets(e,i.firstBracket,i.lastBracket):C<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,!1,r),this._isElementValueEmptyOrOnlyTheNegativeSign(e,i))return this._orderValueCurrencySymbolAndSuffixText(e,i,!0);var M,q=n.isZeroOrHasNoValue(e);switch(s&&(e=e.replace("-","")),i.digitalGroupSpacing=i.digitalGroupSpacing.toString(),i.digitalGroupSpacing){case a.options.digitalGroupSpacing.two:M=/(\d)((\d)(\d{2}?)+)$/;break;case a.options.digitalGroupSpacing.twoScaled:M=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case a.options.digitalGroupSpacing.four:M=/(\d)((\d{4}?)+)$/;break;default:M=/(\d)((\d{3}?)+)$/}var v,Z=W(e.split(i.decimalCharacter),2),V=Z[0],B=Z[1];if(i.decimalCharacterAlternative&&n.isUndefined(B)){var j=W(e.split(i.decimalCharacterAlternative),2);V=j[0],B=j[1]}if(""!==i.digitGroupSeparator)for(;M.test(V);)V=V.replace(M,"$1".concat(i.digitGroupSeparator,"$2"));return e=0===(v=r?i.decimalPlacesShownOnFocus:i.decimalPlacesShownOnBlur)||n.isUndefined(B)?V:(B.length>v&&(B=B.substring(0,v)),"".concat(V).concat(i.decimalCharacter).concat(B)),e=a._mergeCurrencySignNegativePositiveSignAndValue(e,i,s,q),n.isNull(C)&&(C=m),null!==i.negativeBracketsTypeOnBlur&&(C<0||n.isNegativeStrict(e,i.negativeSignCharacter))&&(e=this._toggleNegativeBracket(e,i,r)),i.suffixText?"".concat(e).concat(i.suffixText):e}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(e,i,r,m){var p,s="";if(r?s=i.negativeSignCharacter:i.showPositiveSign&&!m&&(s=i.positiveSignCharacter),i.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix)if(i.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(r||!r&&i.showPositiveSign&&!m))switch(i.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:p="".concat(s).concat(i.currencySymbol).concat(e);break;case a.options.negativePositiveSignPlacement.right:p="".concat(i.currencySymbol).concat(s).concat(e);break;case a.options.negativePositiveSignPlacement.suffix:p="".concat(i.currencySymbol).concat(e).concat(s)}else p=i.currencySymbol+e;else if(i.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)if(i.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(r||!r&&i.showPositiveSign&&!m))switch(i.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:p="".concat(e).concat(i.currencySymbol).concat(s);break;case a.options.negativePositiveSignPlacement.left:p="".concat(e).concat(s).concat(i.currencySymbol);break;case a.options.negativePositiveSignPlacement.prefix:p="".concat(s).concat(e).concat(i.currencySymbol)}else p=e+i.currencySymbol;return p}},{key:"_truncateZeros",value:function(e,i){var r;switch(i){case 0:r=/(\.(?:\d*[1-9])?)0*$/;break;case 1:r=/(\.\d(?:\d*[1-9])?)0*$/;break;default:r=new RegExp("(\\.\\d{".concat(i,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(r,"$1"),0===i&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,i){return this._roundValue(e,i,i.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,i,r){return r?this._roundFormattedValueShownOnFocus(e,i):this._roundFormattedValueShownOnBlur(e,i)}},{key:"_roundValue",value:function(e,i,r){if(n.isNull(e))return e;if(e=""===e?"0":e.toString(),i.roundingMethod===a.options.roundingMethod.toNearest05||i.roundingMethod===a.options.roundingMethod.toNearest05Alt||i.roundingMethod===a.options.roundingMethod.upToNext05||i.roundingMethod===a.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,i);var m,p=W(a._prepareValueForRounding(e,i),2),s=p[0],C=(e=p[1]).lastIndexOf("."),M=-1===C,q=W(e.split("."),2),v=q[0];if(!(0<q[1]||i.allowDecimalPadding!==a.options.allowDecimalPadding.never&&i.allowDecimalPadding!==a.options.allowDecimalPadding.floats))return 0===Number(e)?v:"".concat(s).concat(v);m=i.allowDecimalPadding===a.options.allowDecimalPadding.always||i.allowDecimalPadding===a.options.allowDecimalPadding.floats?r:0;var Z,B=e.length-1-(M?e.length-1:C),j="";if(B<=r){if(j=e,B<m){M&&(j="".concat(j).concat(i.decimalCharacter));for(var z="000000";B<m;)j+=z=z.substring(0,m-B),B+=z.length}else m<B?j=this._truncateZeros(j,m):0===B&&0===m&&(j=j.replace(/\.$/,""));return 0===Number(j)?j:"".concat(s).concat(j)}Z=M?r-1:Number(r)+Number(C);var X,ne=Number(e.charAt(Z+1)),se=e.substring(0,Z+1).split("");if(X="."===e.charAt(Z)?e.charAt(Z-1)%2:e.charAt(Z)%2,this._shouldRoundUp(ne,i,s,X))for(var ae=se.length-1;0<=ae;--ae)if("."!==se[ae]){if(se[ae]=+se[ae]+1,se[ae]<10)break;0<ae&&(se[ae]="0")}return se=se.slice(0,Z+1),j=this._truncateZeros(se.join(""),m),0===Number(j)?j:"".concat(s).concat(j)}},{key:"_roundCloseTo05",value:function(e,i){switch(i.roundingMethod){case a.options.roundingMethod.toNearest05:case a.options.roundingMethod.toNearest05Alt:e=(Math.round(20*e)/20).toString();break;case a.options.roundingMethod.upToNext05:e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}return n.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,i){var r="";return n.isNegativeStrict(e,"-")&&(r="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),0===Number(e)&&(r=""),(0<Number(e)&&i.leadingZero!==a.options.leadingZero.keep||0<e.length&&i.leadingZero===a.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[r,e]}},{key:"_shouldRoundUp",value:function(e,i,r,m){return 4<e&&i.roundingMethod===a.options.roundingMethod.halfUpSymmetric||4<e&&i.roundingMethod===a.options.roundingMethod.halfUpAsymmetric&&""===r||5<e&&i.roundingMethod===a.options.roundingMethod.halfUpAsymmetric&&"-"===r||5<e&&i.roundingMethod===a.options.roundingMethod.halfDownSymmetric||5<e&&i.roundingMethod===a.options.roundingMethod.halfDownAsymmetric&&""===r||4<e&&i.roundingMethod===a.options.roundingMethod.halfDownAsymmetric&&"-"===r||5<e&&i.roundingMethod===a.options.roundingMethod.halfEvenBankersRounding||5===e&&i.roundingMethod===a.options.roundingMethod.halfEvenBankersRounding&&1===m||0<e&&i.roundingMethod===a.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===r||0<e&&i.roundingMethod===a.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===r||0<e&&i.roundingMethod===a.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,i,r,m){r&&(e=this._roundFormattedValueShownOnFocus(e,i));var p=W(e.split(i.decimalCharacter),2),s=p[0],C=p[1];if(C&&C.length>m)if(0<m){var M=C.substring(0,m);e="".concat(s).concat(i.decimalCharacter).concat(M)}else e=s;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,i){if(n.isNull(e)&&i.emptyInputBehavior===a.options.emptyInputBehavior.null||i.overrideMinMaxLimits===a.options.overrideMinMaxLimits.ignore||i.overrideMinMaxLimits===a.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var r,m=n.parseStr(i.minimumValue),p=n.parseStr(i.maximumValue),s=n.parseStr(e);switch(i.overrideMinMaxLimits){case a.options.overrideMinMaxLimits.floor:r=[-1<n.testMinMax(m,s),!0];break;case a.options.overrideMinMaxLimits.ceiling:r=[!0,n.testMinMax(p,s)<1];break;default:r=[-1<n.testMinMax(m,s),n.testMinMax(p,s)<1]}return r}},{key:"_isWithinRangeWithOverrideOption",value:function(e,i){var r=W(this._checkIfInRangeWithOverrideOption(e,i),2);return r[0]&&r[1]}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),n.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,i){return-1<n.testMinMax(n.parseStr(i.minimumValue),this._cleanValueForRangeParse(e))}},{key:"_isMaximumRangeRespected",value:function(e,i){return n.testMinMax(n.parseStr(i.maximumValue),this._cleanValueForRangeParse(e))<1}},{key:"_readCookie",value:function(e){for(var i=e+"=",r=document.cookie.split(";"),m="",p=0;p<r.length;p+=1){for(m=r[p];" "===m.charAt(0);)m=m.substring(1,m.length);if(0===m.indexOf(i))return m.substring(i.length,m.length)}return null}},{key:"_storageTest",value:function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(i){return!1}}},{key:"_correctNegativePositiveSignPlacementOption",value:function(e){if(n.isNull(e.negativePositiveSignPlacement))if(n.isUndefined(e)||!n.isUndefinedOrNullOrEmpty(e.negativePositiveSignPlacement)||n.isUndefinedOrNullOrEmpty(e.currencySymbol))e.negativePositiveSignPlacement=a.options.negativePositiveSignPlacement.left;else switch(e.currencySymbolPlacement){case a.options.currencySymbolPlacement.suffix:e.negativePositiveSignPlacement=a.options.negativePositiveSignPlacement.prefix;break;case a.options.currencySymbolPlacement.prefix:e.negativePositiveSignPlacement=a.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(e){return n.isNull(e)?null:(!n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=a.options.selectOnFocus.doNotSelect),n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&e.selectOnFocus===a.options.selectOnFocus.select&&(e.caretPositionOnFocus=a.options.caretPositionOnFocus.doNoForceCaretPosition),e)}},{key:"_calculateDecimalPlacesOnInit",value:function(e){this._validateDecimalPlacesRawValue(e),e.decimalPlacesShownOnFocus===a.options.decimalPlacesShownOnFocus.useDefault&&(e.decimalPlacesShownOnFocus=e.decimalPlaces),e.decimalPlacesShownOnBlur===a.options.decimalPlacesShownOnBlur.useDefault&&(e.decimalPlacesShownOnBlur=e.decimalPlaces),e.decimalPlacesRawValue===a.options.decimalPlacesRawValue.useDefault&&(e.decimalPlacesRawValue=e.decimalPlaces);var i=0;e.rawValueDivisor&&e.rawValueDivisor!==a.options.rawValueDivisor.none&&(i=String(e.rawValueDivisor).length-1)<0&&(i=0),e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+i,Number(e.originalDecimalPlacesRawValue)+i)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;this._validateDecimalPlacesRawValue(e),n.isNull(r)&&n.throwError("When updating the settings, the previous ones should be passed as an argument.");var m="decimalPlaces"in e;if(m||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){m?("decimalPlacesShownOnFocus"in e&&e.decimalPlacesShownOnFocus!==a.options.decimalPlacesShownOnFocus.useDefault||(e.decimalPlacesShownOnFocus=e.decimalPlaces),"decimalPlacesShownOnBlur"in e&&e.decimalPlacesShownOnBlur!==a.options.decimalPlacesShownOnBlur.useDefault||(e.decimalPlacesShownOnBlur=e.decimalPlaces),"decimalPlacesRawValue"in e&&e.decimalPlacesRawValue!==a.options.decimalPlacesRawValue.useDefault||(e.decimalPlacesRawValue=e.decimalPlaces)):(n.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=r.decimalPlacesShownOnFocus),n.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=r.decimalPlacesShownOnBlur));var p=0;e.rawValueDivisor&&e.rawValueDivisor!==a.options.rawValueDivisor.none&&(p=String(e.rawValueDivisor).length-1)<0&&(p=0),e.decimalPlacesRawValue=e.decimalPlaces||e.decimalPlacesRawValue?Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+p,Number(e.decimalPlacesRawValue)+p):Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+p,Number(r.originalDecimalPlacesRawValue)+p)}}},{key:"_cachesUsualRegularExpressions",value:function(e,i){var r;r=e.negativeSignCharacter!==a.options.negativeSignCharacter.hyphen?"([-\\".concat(e.negativeSignCharacter,"]?)"):"(-?)",i.aNegRegAutoStrip=r,e.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(e.decimalCharacter,"]"),"g"),e.numRegAutoStrip=new RegExp("".concat(r,"(?:\\").concat(e.decimalCharacter,"?([0-9]+\\").concat(e.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(e.decimalCharacter,"[0-9]*)?))")),e.stripReg=new RegExp("^".concat(i.aNegRegAutoStrip,"0*([0-9])")),e.formulaChars=new RegExp("[0-9".concat(e.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var i={aSep:"digitGroupSeparator",nSep:"showOnlyNumbersOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"decimalPlacesShownOnBlur",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",allowDecimalPadding:!0,alwaysAllowDecimalCharacter:!0,caretPositionOnFocus:!0,createLocalList:!0,currencySymbol:!0,currencySymbolPlacement:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,decimalPlaces:!0,decimalPlacesRawValue:!0,decimalPlacesShownOnBlur:!0,decimalPlacesShownOnFocus:!0,defaultValueOverride:!0,digitalGroupSpacing:!0,digitGroupSeparator:!0,divisorWhenUnfocused:!0,emptyInputBehavior:!0,eventBubbles:!0,eventIsCancelable:!0,failOnUnknownOption:!0,formatOnPageLoad:!0,formulaMode:!0,historySize:!0,isCancellable:!0,leadingZero:!0,maximumValue:!0,minimumValue:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,noEventListeners:!0,onInvalidPaste:!0,outputFormat:!0,overrideMinMaxLimits:!0,positiveSignCharacter:!0,rawValueDivisor:!0,readOnly:!0,roundingMethod:!0,saveValueToSessionStorage:!0,selectNumberOnly:!0,selectOnFocus:!0,serializeSpaces:!0,showOnlyNumbersOnFocus:!0,showPositiveSign:!0,showWarnings:!0,styleRules:!0,suffixText:!0,symbolWhenUnfocused:!0,unformatOnHover:!0,unformatOnSubmit:!0,valuesToStrings:!0,watchExternalChanges:!0,wheelOn:!0,wheelStep:!0,allowedAutoStrip:!0,formulaChars:!0,isNegativeSignAllowed:!0,isPositiveSignAllowed:!0,mIntNeg:!0,mIntPos:!0,numRegAutoStrip:!0,originalDecimalPlaces:!0,originalDecimalPlacesRawValue:!0,stripReg:!0};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(!0===i[r])continue;Object.prototype.hasOwnProperty.call(i,r)?(n.warning("You are using the deprecated option name '".concat(r,"'. Please use '").concat(i[r],"' instead from now on. The old option name will be dropped very soon\u2122."),!0),e[i[r]]=e[r],delete e[r]):e.failOnUnknownOption&&n.throwError("Option name '".concat(r,"' is unknown. Please fix the options passed to autoNumeric"))}"mDec"in e&&n.warning("The old `mDec` option has been deprecated in favor of more accurate options ; `decimalPlaces`, `decimalPlacesRawValue`, `decimalPlacesShownOnFocus` and `decimalPlacesShownOnBlur`.",!0)}},{key:"_setNegativePositiveSignPermissions",value:function(e){e.isNegativeSignAllowed=e.minimumValue<0,e.isPositiveSignAllowed=0<=e.maximumValue}},{key:"_toNumericValue",value:function(e,i){var r;return n.isNumber(Number(e))?r=n.scientificToDecimal(e):(r=this._convertToNumericString(e.toString(),i),n.isNumber(Number(r))||(n.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),i.showWarnings),r=NaN)),r}},{key:"_checkIfInRange",value:function(e,i,r){var m=n.parseStr(e);return-1<n.testMinMax(i,m)&&n.testMinMax(r,m)<1}},{key:"_shouldSkipEventKey",value:function(e){var i=n.isInArray(e,b.keyName._allFnKeys),r=e===b.keyName.OSLeft||e===b.keyName.OSRight,m=e===b.keyName.ContextMenu,p=n.isInArray(e,b.keyName._someNonPrintableKeys);return i||r||m||p||e===b.keyName.Unidentified||e===b.keyName.NumLock||e===b.keyName.ScrollLock||e===b.keyName.Insert||e===b.keyName.Command}},{key:"_serialize",value:function(e,i,r,m,p){var s,C=this,M=1<arguments.length&&void 0!==i&&i,q=2<arguments.length&&void 0!==r?r:"unformatted",v=3<arguments.length&&void 0!==m?m:"+",Z=4<arguments.length&&void 0!==p?p:null,V=[];return"object"===te(e)&&"form"===e.nodeName.toLowerCase()&&Array.prototype.slice.call(e.elements).forEach(function(B){if(B.name&&!B.disabled&&-1===["file","reset","submit","button"].indexOf(B.type))if("select-multiple"===B.type)Array.prototype.slice.call(B.options).forEach(function(ne){ne.selected&&V.push(M?{name:B.name,value:ne.value}:"".concat(encodeURIComponent(B.name),"=").concat(encodeURIComponent(ne.value)))});else if(-1===["checkbox","radio"].indexOf(B.type)||B.checked){var j,z;if(C.isManagedByAutoNumeric(B))switch(q){case"unformatted":z=C.getAutoNumericElement(B),n.isNull(z)||(j=C.unformat(B,z.getSettings()));break;case"localized":if(z=C.getAutoNumericElement(B),!n.isNull(z)){var X=n.cloneObject(z.getSettings());n.isNull(Z)||(X.outputFormat=Z),j=C.localize(B,X)}break;default:j=B.value}else j=B.value;n.isUndefined(j)&&n.throwError("This error should never be hit. If it has, something really wrong happened!"),V.push(M?{name:B.name,value:j}:"".concat(encodeURIComponent(B.name),"=").concat(encodeURIComponent(j)))}}),M?s=V:(s=V.join("&"),"+"===v&&(s=s.replace(/%20/g,"+"))),s}},{key:"_serializeNumericString",value:function(e,i){return this._serialize(e,!1,"unformatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeFormatted",value:function(e,i){return this._serialize(e,!1,"formatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeLocalized",value:function(e,i,r){return this._serialize(e,!1,"localized",1<arguments.length&&void 0!==i?i:"+",2<arguments.length&&void 0!==r?r:null)}},{key:"_serializeNumericStringArray",value:function(e,i){return this._serialize(e,!0,"unformatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeFormattedArray",value:function(e,i){return this._serialize(e,!0,"formatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeLocalizedArray",value:function(e,i,r){return this._serialize(e,!0,"localized",1<arguments.length&&void 0!==i?i:"+",2<arguments.length&&void 0!==r?r:null)}}],ce((c=a).prototype,[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=n.scientificToDecimal(this.domElement.getAttribute("value")),n.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,n.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this._onFocusInFunc=function(i){e._onFocusIn(i)},this._onFocusInAndMouseEnterFunc=function(i){e._onFocusInAndMouseEnter(i)},this._onFocusFunc=function(){e._onFocus()},this._onKeydownFunc=function(i){e._onKeydown(i)},this._onKeypressFunc=function(i){e._onKeypress(i)},this._onKeyupFunc=function(i){e._onKeyup(i)},this._onFocusOutAndMouseLeaveFunc=function(i){e._onFocusOutAndMouseLeave(i)},this._onPasteFunc=function(i){e._onPaste(i)},this._onWheelFunc=function(i){e._onWheel(i)},this._onDropFunc=function(i){e._onDrop(i)},this._onKeydownGlobalFunc=function(i){e._onKeydownGlobal(i)},this._onKeyupGlobalFunc=function(i){e._onKeyupGlobal(i)},this.domElement.addEventListener("focusin",this._onFocusInFunc,!1),this.domElement.addEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("focus",this._onFocusFunc,!1),this.domElement.addEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("keydown",this._onKeydownFunc,!1),this.domElement.addEventListener("keypress",this._onKeypressFunc,!1),this.domElement.addEventListener("keyup",this._onKeyupFunc,!1),this.domElement.addEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("paste",this._onPasteFunc,!1),this.domElement.addEventListener("wheel",this._onWheelFunc,!1),this.domElement.addEventListener("drop",this._onDropFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,a._doesGlobalListExists()||(document.addEventListener("keydown",this._onKeydownGlobalFunc,!1),document.addEventListener("keyup",this._onKeyupGlobalFunc,!1))}},{key:"_removeEventListeners",value:function(){this.domElement.removeEventListener("focusin",this._onFocusInFunc,!1),this.domElement.removeEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("focus",this._onFocusFunc,!1),this.domElement.removeEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("keydown",this._onKeydownFunc,!1),this.domElement.removeEventListener("keypress",this._onKeypressFunc,!1),this.domElement.removeEventListener("keyup",this._onKeyupFunc,!1),this.domElement.removeEventListener("paste",this._onPasteFunc,!1),this.domElement.removeEventListener("wheel",this._onWheelFunc,!1),this.domElement.removeEventListener("drop",this._onDropFunc,!1),this._removeFormListener(),this.hasEventListeners=!1,document.removeEventListener("keydown",this._onKeydownGlobalFunc,!1),document.removeEventListener("keyup",this._onKeyupGlobalFunc,!1)}},{key:"_updateEventListeners",value:function(){this.settings.noEventListeners||this.hasEventListeners||this._createEventListeners(),this.settings.noEventListeners&&this.hasEventListeners&&this._removeEventListeners()}},{key:"_setupFormListener",value:function(){var e=this;n.isNull(this.parentForm)||(this._onFormSubmitFunc=function(){e._onFormSubmit()},this._onFormResetFunc=function(){e._onFormReset()},this._hasParentFormCounter()?this._incrementParentFormCounter():(this._initializeFormCounterToOne(),this.parentForm.addEventListener("submit",this._onFormSubmitFunc,!1),this.parentForm.addEventListener("reset",this._onFormResetFunc,!1),this._storeFormHandlerFunction()))}},{key:"_removeFormListener",value:function(){if(!n.isNull(this.parentForm)){var e=this._getParentFormCounter();1===e?(this.parentForm.removeEventListener("submit",this._getFormHandlerFunction().submitFn,!1),this.parentForm.removeEventListener("reset",this._getFormHandlerFunction().resetFn,!1),this._removeFormDataSetInfo()):1<e?this._decrementParentFormCounter():n.throwError("The AutoNumeric object count on the form is incoherent.")}}},{key:"_hasParentFormCounter",value:function(){return"anCount"in this.parentForm.dataset}},{key:"_getParentFormCounter",value:function(){return Number(this.parentForm.dataset.anCount)}},{key:"_initializeFormCounterToOne",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(e){return"anFormHandler"in this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset}},{key:"_getFormElement",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?this.parentForm:i}},{key:"_storeFormHandlerFunction",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var r=n.randomString();this._getFormElement(i).dataset.anFormHandler=r,window.aNFormHandlerMap.set(r,{submitFn:this._onFormSubmitFunc,resetFn:this._onFormResetFunc})}},{key:"_getFormHandlerKey",value:function(){this._hasFormHandlerFunction()||n.throwError("Unable to retrieve the form handler name");var e=this.parentForm.dataset.anFormHandler;return""===e&&n.throwError("The form handler name is invalid"),e}},{key:"_getFormHandlerFunction",value:function(){var e=this._getFormHandlerKey();return window.aNFormHandlerMap.get(e)}},{key:"_removeFormDataSetInfo",value:function(){this._decrementParentFormCounter(),window.aNFormHandlerMap.delete(this._getFormHandlerKey()),this.parentForm.removeAttribute("data-an-count"),this.parentForm.removeAttribute("data-an-form-handler")}},{key:"_setWritePermissions",value:function(e){0<arguments.length&&void 0!==e&&e&&this.domElement.readOnly||this.settings.readOnly?this._setReadOnly():this._setReadWrite()}},{key:"_setReadOnly",value:function(){this.isInputElement?this.domElement.readOnly=!0:this.domElement.setAttribute("contenteditable",!1)}},{key:"_setReadWrite",value:function(){this.isInputElement?this.domElement.readOnly=!1:this.domElement.setAttribute("contenteditable",!0)}},{key:"_addWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,r=i.set,m=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return m.call(e.domElement)},set:function(p){r.call(e.domElement,p),e.settings.watchExternalChanges&&!e.internalModification&&e.set(p)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,r=i.set,m=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return m.call(e.domElement)},set:function(p){r.call(e.domElement,p)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var i=this.domElement.nodeType;i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":i===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=0===this.historyTable.length;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var i=!0;if(!e){var r=this.historyTableIndex+1;r<this.historyTable.length&&this.rawValue===this.historyTable[r].value?i=!1:n.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,i){var m=n.getElementSelection(this.domElement);this.selectionStart=m.start,this.selectionEnd=m.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),1<this.historyTable.length&&(this.historyTable[this.historyTableIndex-1].start=this.selectionStart,this.historyTable[this.historyTableIndex-1].end=this.selectionEnd)}this.historyTable.length>this.settings.historySize&&this._historyTableForget()}}},{key:"_historyTableUndoOrRedo",value:function(e){var i;if(0<arguments.length&&void 0!==e&&!e?(i=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(i=0<this.historyTableIndex)&&this.historyTableIndex--,i){var r=this.historyTable[this.historyTableIndex];this.set(r.value,null,!1),n.setElementSelection(this.domElement,r.start,r.end)}}},{key:"_historyTableUndo",value:function(){this._historyTableUndoOrRedo(!0)}},{key:"_historyTableRedo",value:function(){this._historyTableUndoOrRedo(!1)}},{key:"_historyTableForget",value:function(e){for(var i=0<arguments.length&&void 0!==e?e:1,r=[],m=0;m<i;m++)r.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return 1===r.length?r[0]:r}},{key:"_historyTableCurrentValueUsed",value:function(){var e=this.historyTableIndex;return e<0&&(e=0),n.isUndefinedOrNullOrEmpty(this.historyTable[e])?"":this.historyTable[e].value}},{key:"_parseStyleRules",value:function(){var e=this;n.isUndefinedOrNullOrEmpty(this.settings.styleRules)||""===this.rawValue||(n.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)||(0<=this.rawValue?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||0===this.settings.styleRules.ranges.length||this.settings.styleRules.ranges.forEach(function(i){e.rawValue>=i.min&&e.rawValue<i.max?e._addCSSClass(i.class):e._removeCSSClass(i.class)}),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||0===this.settings.styleRules.userDefined.length||this.settings.styleRules.userDefined.forEach(function(i){if(n.isFunction(i.callback))if(n.isString(i.classes))i.callback(e.rawValue)?e._addCSSClass(i.classes):e._removeCSSClass(i.classes);else if(n.isArray(i.classes))if(2===i.classes.length)i.callback(e.rawValue)?(e._addCSSClass(i.classes[0]),e._removeCSSClass(i.classes[1])):(e._removeCSSClass(i.classes[0]),e._addCSSClass(i.classes[1]));else if(2<i.classes.length){var r=i.callback(e.rawValue);n.isArray(r)?i.classes.forEach(function(m,p){n.isInArray(p,r)?e._addCSSClass(m):e._removeCSSClass(m)}):n.isInt(r)?i.classes.forEach(function(m,p){p===r?e._addCSSClass(m):e._removeCSSClass(m)}):n.isNull(r)?i.classes.forEach(function(m){e._removeCSSClass(m)}):n.throwError("The callback result is not an array nor a valid array index, ".concat(te(r)," given."))}else n.throwError("The classes attribute is not valid for the `styleRules` option.");else n.isUndefinedOrNullOrEmpty(i.classes)?i.callback(e):n.throwError("The callback/classes structure is not valid for the `styleRules` option.");else n.warning("The given `styleRules` callback is not a function, ".concat("undefined"==typeof callback?"undefined":te(callback)," given."),e.settings.showWarnings)}))}},{key:"_addCSSClass",value:function(e){this.domElement.classList.add(e)}},{key:"_removeCSSClass",value:function(e){this.domElement.classList.remove(e)}},{key:"update",value:function(){for(var e=this,i=arguments.length,r=new Array(i),m=0;m<i;m++)r[m]=arguments[m];Array.isArray(r)&&Array.isArray(r[0])&&(r=r[0]);var p=n.cloneObject(this.settings),s=this.rawValue,C={};n.isUndefinedOrNullOrEmpty(r)||0===r.length?C=null:1<=r.length&&r.forEach(function(M){e.constructor._isPreDefinedOptionValid(M)&&(M=e.constructor._getOptionObject(M)),re(C,M)});try{this._setSettings(C,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(s)}catch(M){return this._setSettings(p,!0),n.throwError("Unable to update the settings, those are invalid: [".concat(M,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e,i,r){var m,p=1<arguments.length&&void 0!==i?i:null,s=!(2<arguments.length&&void 0!==r)||r;if(n.isUndefined(e))return n.warning("You are trying to set an 'undefined' value ; an error could have occurred.",this.settings.showWarnings),this;if(n.isNull(p)||this._setSettings(p,!0),null===e&&this.settings.emptyInputBehavior!==a.options.emptyInputBehavior.null)return n.warning("You are trying to set the `null` value while the `emptyInputBehavior` option is set to ".concat(this.settings.emptyInputBehavior,". If you want to be able to set the `null` value, you need to change the 'emptyInputBehavior' option to `'null'`."),this.settings.showWarnings),this;if(null===e)return this._setElementAndRawValue(null,null,s),this._saveValueToPersistentStorage(),this;if(m=this.constructor._toNumericValue(e,this.settings),isNaN(Number(m)))return n.warning("The value you are trying to set results in `NaN`. The element value is set to the empty string instead.",this.settings.showWarnings),this.setValue("",s),this;if(""===m)switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.zero:m=0;break;case a.options.emptyInputBehavior.min:m=this.settings.minimumValue;break;case a.options.emptyInputBehavior.max:m=this.settings.maximumValue;break;default:n.isNumber(this.settings.emptyInputBehavior)&&(m=Number(this.settings.emptyInputBehavior))}if(""===m)return this._setElementAndRawValue(this.settings.emptyInputBehavior===a.options.emptyInputBehavior.always?this.settings.currencySymbol:"","",s),this;var M=W(this.constructor._checkIfInRangeWithOverrideOption(m,this.settings),2),q=M[0],v=M[1];if(q&&v&&this.settings.valuesToStrings&&this._checkValuesToStrings(m))return this._setElementAndRawValue(this.settings.valuesToStrings[m],m,s),this._saveValueToPersistentStorage(),this;if(n.isZeroOrHasNoValue(m)&&(m="0"),q&&v){var Z=this.constructor._roundRawValue(m,this.settings);return Z=this._trimLeadingAndTrailingZeros(Z.replace(this.settings.decimalCharacter,".")),m=this._getRawValueToFormat(m),m=this.isFocused?this.constructor._roundFormattedValueShownOnFocus(m,this.settings):(this.settings.divisorWhenUnfocused&&(m=(m/=this.settings.divisorWhenUnfocused).toString()),this.constructor._roundFormattedValueShownOnBlur(m,this.settings)),m=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(m,this.settings),m=this.constructor._addGroupSeparators(m,this.settings,this.isFocused,this.rawValue,Z),!this.isFocused&&this.settings.symbolWhenUnfocused&&(m="".concat(m).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(m,Z,s),this._setValidOrInvalidState(Z),this}return this._triggerRangeEvents(q,v),n.throwError("The value [".concat(m,"] being set falls outside of the minimumValue [").concat(this.settings.minimumValue,"] and maximumValue [").concat(this.settings.maximumValue,"] range set for this element")),this._removeValueFromPersistentStorage(),this.setValue("",s),this}},{key:"setUnformatted",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;if(null===e||n.isUndefined(e))return this;n.isNull(r)||this._setSettings(r,!0);var m=this.constructor._removeBrackets(e,this.settings),p=this.constructor._stripAllNonNumberCharacters(m,this.settings,!0,this.isFocused);return n.isNumber(p)||n.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(p,this.settings)?this.setValue(e):n.throwError("The value is out of the range limits [".concat(this.settings.minimumValue,", ").concat(this.settings.maximumValue,"].")),this}},{key:"setValue",value:function(e,i){return this._setElementAndRawValue(e,!(1<arguments.length&&void 0!==i)||i),this}},{key:"_setRawValue",value:function(e,i){var r=!(1<arguments.length&&void 0!==i)||i;if(this.rawValue!==e){var m=this.rawValue;this.rawValue=e,!n.isNull(this.settings.rawValueDivisor)&&0!==this.settings.rawValueDivisor&&""!==e&&null!==e&&this._isUserManuallyEditingTheValue()&&(this.rawValue/=this.settings.rawValueDivisor),this._triggerEvent(a.events.rawValueModified,this.domElement,{oldRawValue:m,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),r&&this._historyTableAdd()}}},{key:"_setElementValue",value:function(e,i){var r=!(1<arguments.length&&void 0!==i)||i,m=n.getElementValue(this.domElement);return e!==m&&(this.internalModification=!0,n.setElementValue(this.domElement,e),this.internalModification=!1,r&&this._triggerEvent(a.events.formatted,this.domElement,{oldValue:m,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e,i,r){var m=1<arguments.length&&void 0!==i?i:null,p=!(2<arguments.length&&void 0!==r)||r;return n.isNull(m)?m=e:n.isBoolean(m)&&(p=m,m=e),this._setElementValue(e),this._setRawValue(m,p),this}},{key:"_getRawValueToFormat",value:function(e){return n.isNull(this.settings.rawValueDivisor)||0===this.settings.rawValueDivisor||""===e||null===e?e:e*this.settings.rawValueDivisor}},{key:"_checkValuesToStrings",value:function(e){return this.constructor._checkValuesToStringsArray(e,this.valuesToStringsKeys)}},{key:"_isUserManuallyEditingTheValue",value:function(){return this.isFocused&&this.isEditing||this.isDropEvent}},{key:"_executeCallback",value:function(e,i){!n.isNull(i)&&n.isFunction(i)&&i(e,this)}},{key:"_triggerEvent",value:function(e,i,r){var m=1<arguments.length&&void 0!==i?i:document;n.triggerEvent(e,m,2<arguments.length&&void 0!==r?r:null,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(e){return this.getNumericString(0<arguments.length&&void 0!==e?e:null)}},{key:"getNumericString",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(this.rawValue)?null:n.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(i,r),i}},{key:"getFormatted",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;"value"in this.domElement||"textContent"in this.domElement||n.throwError("Unable to get the formatted string from the element.");var r=n.getElementValue(this.domElement);return this._executeCallback(r,i),r}},{key:"getNumber",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(i,r),i}},{key:"getLocalized",value:function(e,i){var r,m,p=0<arguments.length&&void 0!==e?e:null,s=1<arguments.length&&void 0!==i?i:null;n.isFunction(p)&&n.isNull(s)&&(s=p,p=null),(r=n.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(r)&&this.settings.leadingZero!==a.options.leadingZero.keep&&(r="0"),m=n.isNull(p)?this.settings.outputFormat:p;var C=this.constructor._toLocale(r,m,this.settings);return this._executeCallback(C,s),C}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(e){return this._setElementValue(this.getLocalized(0<arguments.length&&void 0!==e?e:null)),this}},{key:"isPristine",value:function(e){return 0<arguments.length&&void 0!==e&&!e?this.initialValueHtmlAttribute===this.getFormatted():this.initialValue===this.getNumericString()}},{key:"select",value:function(){return this.settings.selectNumberOnly?this.selectNumber():this._defaultSelectAll(),this}},{key:"_defaultSelectAll",value:function(){n.setElementSelection(this.domElement,0,n.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,i,r=n.getElementValue(this.domElement),m=r.length,p=this.settings.currencySymbol.length,s=this.settings.currencySymbolPlacement,C=n.isNegative(r,this.settings.negativeSignCharacter)?1:0,M=this.settings.suffixText.length;if(e=s===a.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left&&1==C&&0<p?p+1:p,s===a.options.currencySymbolPlacement.prefix)i=m-M;else switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.left:i=m-(M+p);break;case a.options.negativePositiveSignPlacement.right:i=0<p?m-(p+C+M):m-(p+M);break;default:i=m-(p+M)}return n.setElementSelection(this.domElement,e,i),this}},{key:"selectInteger",value:function(){var e=0,i=0<=this.rawValue;this.settings.currencySymbolPlacement!==a.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==a.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&i||!i&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left)&&(e+=1),this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&(e+=this.settings.currencySymbol.length);var r=n.getElementValue(this.domElement),m=r.indexOf(this.settings.decimalCharacter);return-1===m&&(m=this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?r.length-this.settings.currencySymbol.length:r.length,i||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==a.options.currencySymbolPlacement.suffix||--m,m-=this.settings.suffixText.length),n.setElementSelection(this.domElement,e,m),this}},{key:"selectDecimal",value:function(){var e,r=n.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return e=-1===r?r=0:(r+=1)+Number(this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur),n.setElementSelection(this.domElement,r,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(r)?this.domElement:r.node(),this._removeFromLocalList(i),this}},{key:"attach",value:function(e,i){var r=!(1<arguments.length&&void 0!==i)||i;return this._addToLocalList(e.node()),r&&e.update(this.settings),this}},{key:"formatOther",value:function(e,i){return this._formatOrUnformatOther(!0,e,1<arguments.length&&void 0!==i?i:null)}},{key:"unformatOther",value:function(e,i){return this._formatOrUnformatOther(!1,e,1<arguments.length&&void 0!==i?i:null)}},{key:"_formatOrUnformatOther",value:function(e,i,r){var m,p,s=2<arguments.length&&void 0!==r?r:null;if(m=n.isNull(s)?this.settings:this._cloneAndMergeSettings(s),n.isElement(i)){var C=n.getElementValue(i);return p=e?a.format(C,m):a.unformat(C,m),n.setElementValue(i,p),null}return e?a.format(i,m):a.unformat(i,m)}},{key:"init",value:function(e,i){var r=this,m=!(1<arguments.length&&void 0!==i)||i,p=!1,s=[];if(n.isString(e)?s=G(document.querySelectorAll(e)):n.isElement(e)?(s.push(e),p=!0):n.isArray(e)?s=e:n.throwError("The given parameters to the 'init' function are invalid."),0===s.length)return n.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var C=this._getLocalList(),M=[];return s.forEach(function(q){var v=r.settings.createLocalList;m&&(r.settings.createLocalList=!1);var Z=new a(q,n.getElementValue(q),r.settings);m&&(Z._setLocalList(C),r._addToLocalList(q,Z),r.settings.createLocalList=v),M.push(Z)}),p?M[0]:M}},{key:"clear",value:function(e){return 0<arguments.length&&void 0!==e&&e?this.set("",{emptyInputBehavior:a.options.emptyInputBehavior.focus}):this.set(""),this}},{key:"remove",value:function(){this._removeValueFromPersistentStorage(),this._removeEventListeners(),this._removeWatcher(),this._removeFromLocalList(this.domElement),this.constructor._removeFromGlobalList(this)}},{key:"wipe",value:function(){this._setElementValue("",!1),this.remove()}},{key:"nuke",value:function(){this.remove(),this.domElement.parentNode.removeChild(this.domElement)}},{key:"form",value:function(e){if(0<arguments.length&&void 0!==e&&e||n.isUndefinedOrNullOrEmpty(this.parentForm)){var i=this._getParentForm();if(!n.isNull(i)&&i!==this.parentForm){var r=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=r.length,this._hasFormHandlerFunction(i)?this._incrementParentFormCounter(i):(this._storeFormHandlerFunction(i),this._initializeFormCounterToOne(i))}this.parentForm=i}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var i=this;return G(e.querySelectorAll("input")).filter(function(r){return i.constructor.isManagedByAutoNumeric(r)})}},{key:"_getParentForm",value:function(){if("body"===this.domElement.tagName.toLowerCase())return null;var e,i=this.domElement;do{if(n.isNull(i=i.parentNode))return null;if("body"===(e=i.tagName?i.tagName.toLowerCase():""))break}while("form"!==e);return"form"===e?i:null}},{key:"formNumericString",value:function(){return this.constructor._serializeNumericString(this.form(),this.settings.serializeSpaces)}},{key:"formFormatted",value:function(){return this.constructor._serializeFormatted(this.form(),this.settings.serializeSpaces)}},{key:"formLocalized",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(r)?this.settings.outputFormat:r,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,i)}},{key:"formArrayNumericString",value:function(){return this.constructor._serializeNumericStringArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayFormatted",value:function(){return this.constructor._serializeFormattedArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayLocalized",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(r)?this.settings.outputFormat:r,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,i)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(e){return JSON.stringify(this.formArrayLocalized(0<arguments.length&&void 0!==e?e:null))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){a.getAutoNumericElement(e).unformat()}),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){a.getAutoNumericElement(e).unformatLocalized()}),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){a.getAutoNumericElement(e).reformat()}),this}},{key:"formSubmitNumericString",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?(this.formUnformat(),this.form().submit(),this.formReformat()):n.isFunction(i)?i(this.formNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?this.form().submit():n.isFunction(i)?i(this.formFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(e,i){var r=0<arguments.length&&void 0!==e?e:null,m=1<arguments.length&&void 0!==i?i:null;return n.isNull(m)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):n.isFunction(m)?m(this.formLocalized(r)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayNumericString",value:function(e){return n.isFunction(e)?e(this.formArrayNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayFormatted",value:function(e){return n.isFunction(e)?e(this.formArrayFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayLocalized",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;return n.isFunction(e)?e(this.formArrayLocalized(r)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonNumericString",value:function(e){return n.isFunction(e)?e(this.formJsonNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonFormatted",value:function(e){return n.isFunction(e)?e(this.formJsonFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonLocalized",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;return n.isFunction(e)?e(this.formJsonLocalized(r)):n.throwError("The given callback is not a function."),this}},{key:"_createLocalList",value:function(){this.autoNumericLocalList=new Map,this._addToLocalList(this.domElement)}},{key:"_deleteLocalList",value:function(){delete this.autoNumericLocalList}},{key:"_setLocalList",value:function(e){this.autoNumericLocalList=e}},{key:"_getLocalList",value:function(){return this.autoNumericLocalList}},{key:"_hasLocalList",value:function(){return this.autoNumericLocalList instanceof Map&&0!==this.autoNumericLocalList.size}},{key:"_addToLocalList",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;n.isNull(r)&&(r=this),n.isUndefined(this.autoNumericLocalList)?n.throwError("The local list provided does not exists when trying to add an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.set(e,r)}},{key:"_removeFromLocalList",value:function(e){n.isUndefined(this.autoNumericLocalList)?this.settings.createLocalList&&n.throwError("The local list provided does not exists when trying to remove an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.delete(e)}},{key:"_mergeSettings",value:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];re.apply(void 0,[this.settings].concat(i))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},i=arguments.length,r=new Array(i),m=0;m<i;m++)r[m]=arguments[m];return re.apply(void 0,[e,this.settings].concat(r)),e}},{key:"_updatePredefinedOptions",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;return n.isNull(r)?this.update(e):(this._mergeSettings(e,r),this.update(this.settings)),this}},{key:"french",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().French,i),this}},{key:"northAmerican",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().NorthAmerican,i),this}},{key:"british",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().British,i),this}},{key:"swiss",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Swiss,i),this}},{key:"japanese",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Japanese,i),this}},{key:"spanish",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Spanish,i),this}},{key:"chinese",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Chinese,i),this}},{key:"brazilian",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Brazilian,i),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];if("function"==typeof i)this.settings[e]=i(this,e);else{var r=this.domElement.getAttribute(e);r=n.camelize(r),"function"==typeof this.settings[r]&&(this.settings[e]=r(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.right)}},{key:"_modifyNegativeSignAndDecimalCharacterForRawValue",value:function(e){return"."!==this.settings.decimalCharacter&&(e=e.replace(this.settings.decimalCharacter,".")),"-"!==this.settings.negativeSignCharacter&&this.settings.isNegativeSignAllowed&&(e=e.replace(this.settings.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}},{key:"_initialCaretPosition",value:function(e){n.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===a.options.selectOnFocus.doNotSelect&&n.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var i=this.rawValue<0,r=n.isZeroOrHasNoValue(e),m=e.length,p=0,s=0,C=!1,M=0;this.settings.caretPositionOnFocus!==a.options.caretPositionOnFocus.start&&(p=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,C=n.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==a.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==a.options.caretPositionOnFocus.decimalRight||(M=C?(s=e.indexOf(this.settings.decimalCharacter),this.settings.decimalCharacter.length):(s=p,0)));var q="";i?q=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!r&&(q=this.settings.positiveSignCharacter);var v,Z=q.length,V=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:v=Z+V;break;case a.options.negativePositiveSignPlacement.suffix:v=V}else v=V;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:v=m;break;case a.options.negativePositiveSignPlacement.suffix:v=V+p}else v=m;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:v=Z+V+s;break;case a.options.negativePositiveSignPlacement.suffix:v=V+s}else v=V+s;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:v=Z+V+s+M;break;case a.options.negativePositiveSignPlacement.suffix:v=V+s+M}else v=V+s+M}else if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:v=0;break;case a.options.negativePositiveSignPlacement.prefix:v=Z}else v=0;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:v=p;break;case a.options.negativePositiveSignPlacement.prefix:v=Z+p}else v=p;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:v=s;break;case a.options.negativePositiveSignPlacement.prefix:v=Z+s}else v=s;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:v=s+M;break;case a.options.negativePositiveSignPlacement.prefix:v=Z+s+M}else v=s+M;return v}},{key:"_triggerRangeEvents",value:function(e,i){e||this._triggerEvent(a.events.minRangeExceeded,this.domElement),i||this._triggerEvent(a.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?n.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(a.events.invalidValue,this.domElement),this.validState=!1}},{key:"_setValidState",value:function(){this.isInputElement?n.setValidState(this.domElement):this._removeCSSClass(this.settings.invalidClass),this.validState||this._triggerEvent(a.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(e){if(this.settings.overrideMinMaxLimits===a.options.overrideMinMaxLimits.invalid){var i=this.constructor._isMinimumRangeRespected(e,this.settings),r=this.constructor._isMaximumRangeRespected(e,this.settings);i&&r?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(i,r)}}},{key:"_keepAnOriginalSettingsCopy",value:function(){this.originalDigitGroupSeparator=this.settings.digitGroupSeparator,this.originalCurrencySymbol=this.settings.currencySymbol,this.originalSuffixText=this.settings.suffixText}},{key:"_trimLeadingAndTrailingZeros",value:function(e){if(""===e||null===e)return e;if(this.settings.leadingZero!==a.options.leadingZero.keep){if(0===Number(e))return"0";e=e.replace(/^(-)?0+(?=\d)/g,"$1")}return n.contains(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1")),e.replace(/\.$/,"")}},{key:"_setPersistentStorageName",value:function(){this.settings.saveValueToSessionStorage&&(this.rawValueStorageName=""===this.domElement.name||n.isUndefined(this.domElement.name)?"".concat(this.storageNamePrefix).concat(this.domElement.id):"".concat(this.storageNamePrefix).concat(decodeURIComponent(this.domElement.name)))}},{key:"_saveValueToPersistentStorage",value:function(){this.settings.saveValueToSessionStorage&&(this.sessionStorageAvailable?sessionStorage.setItem(this.rawValueStorageName,this.rawValue):document.cookie="".concat(this.rawValueStorageName,"=").concat(this.rawValue,"; expires= ; path=/"))}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?this.sessionStorageAvailable?sessionStorage.getItem(this.rawValueStorageName):this.constructor._readCookie(this.rawValueStorageName):(n.warning("`_getValueFromPersistentStorage()` is called but `settings.saveValueToSessionStorage` is false. There must be an error that needs fixing.",this.settings.showWarnings),null)}},{key:"_removeValueFromPersistentStorage",value:function(){if(this.settings.saveValueToSessionStorage)if(this.sessionStorageAvailable)sessionStorage.removeItem(this.rawValueStorageName);else{var e=new Date;e.setTime(e.getTime()-864e5);var i="; expires=".concat(e.toUTCString());document.cookie="".concat(this.rawValueStorageName,"='' ;").concat(i,"; path=/")}}},{key:"_getDefaultValue",value:function(e){var i=e.getAttribute("value");return n.isNull(i)?"":i}},{key:"_onFocusInAndMouseEnter",value:function(e){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&"mouseenter"===e.type&&e.altKey)this.constructor._unformatAltHovered(this);else if("focus"===e.type&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),"focus"===e.type&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),"focus"===e.type||"mouseenter"===e.type&&!this.isFocused){var i=null;this.settings.emptyInputBehavior===a.options.emptyInputBehavior.focus&&this.rawValue<0&&null!==this.settings.negativeBracketsTypeOnBlur&&this.settings.isNegativeSignAllowed&&(i=this.constructor._removeBrackets(n.getElementValue(this.domElement),this.settings));var r=this._getRawValueToFormat(this.rawValue);if(""!==r){var m=this.constructor._roundFormattedValueShownOnFocusOrBlur(r,this.settings,this.isFocused);i=this.settings.showOnlyNumbersOnFocus===a.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",m.replace(".",this.settings.decimalCharacter)):n.isNull(m)?"":this.constructor._addGroupSeparators(m.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,r)}this.valueOnFocus=n.isNull(i)?"":i,this.lastVal=this.valueOnFocus;var p=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),s=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),C=p&&""!==s&&this.settings.emptyInputBehavior===a.options.emptyInputBehavior.focus;C&&(i=s),n.isNull(i)||this._setElementValue(i),C&&s===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&n.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():n.isNull(this.settings.caretPositionOnFocus)||n.setElementSelection(e.target,this._initialCaretPosition(n.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,n.setElementValue(this.domElement,"="),n.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,i=n.getElementValue(this.domElement);i=i.replace(/^\s*=/,"");try{var r=new U(i,this.settings.decimalCharacter);e=(new f).evaluate(r)}catch(m){return this._triggerEvent(a.events.invalidFormula,this.domElement,{formula:i,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(a.events.validFormula,this.domElement,{formula:i,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===b.keyName.Backspace||this.eventKey===b.keyName.Delete||this.eventKey===b.keyName.LeftArrow||this.eventKey===b.keyName.RightArrow||this.eventKey===b.keyName.Home||this.eventKey===b.keyName.End}},{key:"_onKeydown",value:function(e){if(this.formatted=!1,this.isEditing=!0,this.formulaMode||this.isFocused||!this.settings.unformatOnHover||!e.altKey||this.domElement!==n.getHoveredElement()){if(this._updateEventKeyInfo(e),this.keydownEventCounter+=1,1===this.keydownEventCounter&&(this.initialValueOnFirstKeydown=n.getElementValue(e.target),this.initialRawValueOnFirstKeydown=this.rawValue),this.formulaMode){if(this.eventKey===b.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===b.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else if(this.eventKey===b.keyName.Equal)return void this._enterFormulaMode();if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===b.keyName.Esc&&(e.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(a.events.native.input,e.target)),this.select());var i=n.getElementValue(e.target);if(this.eventKey===b.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(a.events.native.change,e.target),this.valueOnFocus=i,this.rawValueOnFocus=this.rawValue,this.settings.isCancellable&&this._saveCancellableValue()),this._updateInternalProperties(e),this._processNonPrintableKeysAndShortcuts(e))this.processed=!0;else if(this.eventKey===b.keyName.Backspace||this.eventKey===b.keyName.Delete){var r=this._processCharacterDeletion();if(this.processed=!0,!r)return void e.preventDefault();this._formatValue(e),(i=n.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(a.events.native.input,e.target),e.preventDefault()),this.lastVal=i,this.throwInput=!0}}}else this.constructor._unformatAltHovered(this)}},{key:"_onKeypress",value:function(e){if(this.formulaMode){if(this._acceptNonPrintableKeysInFormulaMode()||this.settings.formulaChars.test(this.eventKey))return;e.preventDefault()}else if(this.eventKey!==b.keyName.Insert){var i=this.processed;if(this._updateInternalProperties(e),!this._processNonPrintableKeysAndShortcuts(e))if(i)e.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(e);var r=n.getElementValue(e.target);if(r!==this.lastVal&&this.throwInput)this._triggerEvent(a.events.native.input,e.target),e.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&n.getElementSelection(e.target).start===n.getElementSelection(e.target).end&&n.getElementSelection(e.target).start===r.indexOf(this.settings.decimalCharacter)){var m=n.getElementSelection(e.target).start+1;n.setElementSelection(e.target,m)}e.preventDefault()}return this.lastVal=n.getElementValue(e.target),this.throwInput=!0,void this._setValidOrInvalidState(this.rawValue)}e.preventDefault()}}}},{key:"_onKeyup",value:function(e){if(this.isEditing=!1,this.keydownEventCounter=0,!this.formulaMode)if(this.settings.isCancellable&&this.eventKey===b.keyName.Esc)e.preventDefault();else{if(this.eventKey===b.keyName.Z||this.eventKey===b.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),void this._historyTableUndo();this.onGoingRedo=!1}}if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&this.eventKey===b.keyName.x){var i=n.getElementSelection(this.domElement).start,r=this.constructor._toNumericValue(n.getElementValue(e.target),this.settings);this.set(r),this._setCaretPosition(i)}if(this.eventKey===b.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==b.keyName.Backspace&&this.eventKey!==b.keyName.Delete){this._updateInternalProperties(e);var m=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var p=n.getElementValue(e.target);if(!(m||""===p&&""===this.initialValueOnFirstKeydown)&&(p===this.settings.currencySymbol?n.setElementSelection(e.target,this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?0:this.settings.currencySymbol.length):this.eventKey===b.keyName.Tab&&n.setElementSelection(e.target,0,p.length),(p===this.settings.suffixText||""===this.rawValue&&""!==this.settings.currencySymbol&&""!==this.settings.suffixText)&&n.setElementSelection(e.target,0),null!==this.settings.decimalPlacesShownOnFocus&&this._saveValueToPersistentStorage(),this.formatted||this._formatValue(e),this._setValidOrInvalidState(this.rawValue),this._saveRawValueForAndroid(),p!==this.initialValueOnFirstKeydown&&this._triggerEvent(a.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:p,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),1<this.historyTable.length)){var s=n.getElementSelection(this.domElement);this.selectionStart=s.start,this.selectionEnd=s.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var C=n.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,C))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===b.keyName.AndroidDefault){var e=this.constructor._stripAllNonNumberCharactersExceptCustomDecimalChar(this.getFormatted(),this.settings,!0,this.isFocused);e=this.constructor._convertToNumericString(e,this.settings),this._setRawValue(e)}}},{key:"_onFocusOutAndMouseLeave",value:function(e){if(this.isEditing=!1,"mouseleave"!==e.type||!this.formulaMode)if(this.settings.unformatOnHover&&"mouseleave"===e.type&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if("mouseleave"===e.type&&!this.isFocused||"blur"===e.type){"blur"===e.type&&this.formulaMode&&this._exitFormulaMode(),this._saveValueToPersistentStorage(),this.settings.showOnlyNumbersOnFocus===a.options.showOnlyNumbersOnFocus.onlyNumbers&&(this.settings.digitGroupSeparator=this.originalDigitGroupSeparator,this.settings.currencySymbol=this.originalCurrencySymbol,this.settings.suffixText=this.originalSuffixText);var i=this._getRawValueToFormat(this.rawValue),r=n.isNull(i),m=W(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),p=m[0],s=m[1],C=!1;if(""===i||r||(this._triggerRangeEvents(p,s),this.settings.valuesToStrings&&this._checkValuesToStrings(i)&&(this._setElementValue(this.settings.valuesToStrings[i]),C=!0)),!C){var M;if(M=r||""===i?i:String(i),""===i||r){if(""===i)switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.zero:this._setRawValue("0"),M=this.constructor._roundValue("0",this.settings,0);break;case a.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),M=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case a.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),M=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:n.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),M=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else p&&s&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(i,this.settings)?(M=this._modifyNegativeSignAndDecimalCharacterForRawValue(M),this.settings.divisorWhenUnfocused&&!n.isNull(M)&&(M=(M/=this.settings.divisorWhenUnfocused).toString()),M=this.constructor._roundFormattedValueShownOnBlur(M,this.settings),M=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(M,this.settings)):this._triggerRangeEvents(p,s);var q=this.constructor._orderValueCurrencySymbolAndSuffixText(M,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(M,this.settings)||r&&this.settings.emptyInputBehavior===a.options.emptyInputBehavior.null||(q=this.constructor._addGroupSeparators(M,this.settings,!1,i)),q===i&&""!==i&&this.settings.allowDecimalPadding!==a.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==a.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&""!==i&&null!==i&&(q="".concat(q).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(q))}this._setValidOrInvalidState(this.rawValue),"blur"===e.type&&this._onBlur(e)}}},{key:"_onPaste",value:function(e){if(e.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i,r;window.clipboardData&&window.clipboardData.getData?i=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?i=e.clipboardData.getData("text/plain"):n.throwError("Unable to retrieve the pasted value. Please use a modern browser (ie. Firefox or Chromium).");var m=n.getElementValue(r=e.target.tagName?e.target:e.explicitOriginalTarget),p=r.selectionStart||0,s=r.selectionEnd||0,C=s-p;if(C===m.length){var M=this._preparePastedText(i),q=n.arabicToLatinNumbers(M,!1,!1,!1);return"."===q||""===q||"."!==q&&!n.isNumber(q)?(this.formatted=!0,void(this.settings.onInvalidPaste===a.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")))):(this.set(q),this.formatted=!0,void this._triggerEvent(a.events.native.input,r))}var v=n.isNegativeStrict(i,this.settings.negativeSignCharacter);v&&(i=i.slice(1,i.length));var Z,V,B=this._preparePastedText(i);if("."!==(Z="."===B?".":n.arabicToLatinNumbers(B,!1,!1,!1))&&(!n.isNumber(Z)||""===Z))return this.formatted=!0,void(this.settings.onInvalidPaste===a.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")));var j,z,X=n.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);j=!(!v||X)&&(X=!0);var ne=m.slice(0,p),se=m.slice(s,m.length);z=this._preparePastedText(p!==s?ne+se:m),X&&(z=n.setRawNegativeSign(z)),V=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,p,this.settings.decimalCharacter)),j&&V++;var ae=z.slice(0,V),ge=z.slice(V,z.length),Ae=!1;"."===Z&&(n.contains(ae,".")&&(Ae=!0,ae=ae.replace(".","")),ge=ge.replace(".",""));var w=!1;switch(""===ae&&"-"===ge&&(ae="-",w=!(ge="")),this.settings.onInvalidPaste){case a.options.onInvalidPaste.truncate:case a.options.onInvalidPaste.replace:for(var A=n.parseStr(this.settings.minimumValue),u=n.parseStr(this.settings.maximumValue),h=z,O=0,D=ae;O<Z.length&&(z=(D+=Z[O])+ge,this.constructor._checkIfInRange(z,A,u));)h=z,O++;if(V+=O,w&&V++,this.settings.onInvalidPaste===a.options.onInvalidPaste.truncate){z=h,Ae&&V--;break}for(var J=V,ie=h.length;O<Z.length&&J<ie;)if("."!==h[J]){if(z=n.replaceCharAt(h,J,Z[O]),!this.constructor._checkIfInRange(z,A,u))break;h=z,O++,J++}else J++;V=J,Ae&&V--,z=h;break;default:if(z="".concat(ae).concat(Z).concat(ge),p===s)V=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,p,this.settings.decimalCharacter))+Z.length;else if(""===ge)V=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,p,this.settings.decimalCharacter))+Z.length,w&&V++;else{var be=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,s,this.settings.decimalCharacter)),Ne=n.getElementValue(r).slice(p,s);V=be-C+n.countCharInText(this.settings.digitGroupSeparator,Ne)+Z.length}j&&V++,Ae&&V--}if(n.isNumber(z)&&""!==z){var fe=!1,he=!1;try{this.set(z),fe=!0}catch(Ue){var ue;switch(this.settings.onInvalidPaste){case a.options.onInvalidPaste.clamp:ue=n.clampToRangeLimits(z,this.settings);try{this.set(ue)}catch(ve){n.throwError("Fatal error: Unable to set the clamped value '".concat(ue,"'."))}fe=he=!0,z=ue;break;case a.options.onInvalidPaste.error:case a.options.onInvalidPaste.truncate:case a.options.onInvalidPaste.replace:n.throwError("The pasted value '".concat(i,"' results in a value '").concat(z,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));default:return}}var Be,Ee=n.getElementValue(r);if(fe)switch(this.settings.onInvalidPaste){case a.options.onInvalidPaste.clamp:if(he){n.setElementSelection(r,this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?Ee.length-this.settings.currencySymbol.length:Ee.length);break}default:Be=n.findCaretPositionInFormattedNumber(z,V,Ee,this.settings.decimalCharacter),n.setElementSelection(r,Be)}fe&&m!==Ee&&this._triggerEvent(a.events.native.input,r)}else this.settings.onInvalidPaste===a.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' would result into an invalid content '").concat(z,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,this.rawValue!==this.rawValueOnFocus&&this._triggerEvent(a.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_onWheel",value:function(e){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===a.options.wheelOn.focus?this.isFocused?e.shiftKey||this.wheelAction(e):e.shiftKey&&this.wheelAction(e):this.settings.wheelOn===a.options.wheelOn.hover?e.shiftKey?(e.preventDefault(),window.scrollBy(0,n.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):n.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var i,r=e.target.selectionStart||0,m=e.target.selectionEnd||0,p=this.rawValue;if(n.isUndefinedOrNullOrEmpty(p)?0<this.settings.minimumValue||this.settings.maximumValue<0?n.isWheelUpEvent(e)?i=this.settings.minimumValue:n.isWheelDownEvent(e)?i=this.settings.maximumValue:n.throwError("The event is not a 'wheel' event."):i=0:i=p,i=+i,n.isNumber(this.settings.wheelStep)){var s=+this.settings.wheelStep;n.isWheelUpEvent(e)?i+=s:n.isWheelDownEvent(e)&&(i-=s)}else n.isWheelUpEvent(e)?i=n.addAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue):n.isWheelDownEvent(e)&&(i=n.subtractAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue));(i=n.clampToRangeLimits(i,this.settings))!==+p&&(this.set(i),this._triggerEvent(a.events.native.input,e.target)),e.preventDefault(),this._setSelection(r,m),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){var i;this.isDropEvent=!0,e.preventDefault(),i=n.isIE11()?"text":"text/plain";var r=e.dataTransfer.getData(i),m=this.unformatOther(r);this.set(m),this.isDropEvent=!1}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){return i._unformatOnSubmit()}),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){var r=e._getDefaultValue(i.node());setTimeout(function(){return i.set(r)},0)})}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(e){if(n.character(e)===b.keyName.Alt){var i=n.getHoveredElement();if(a.isManagedByAutoNumeric(i)){var r=a.getAutoNumericElement(i);!r.formulaMode&&r.settings.unformatOnHover&&this.constructor._unformatAltHovered(r)}}}},{key:"_onKeyupGlobal",value:function(e){if(n.character(e)===b.keyName.Alt){var i=n.getHoveredElement();if(a.isManagedByAutoNumeric(i)){var r=a.getAutoNumericElement(i);if(r.formulaMode||!r.settings.unformatOnHover)return;this.constructor._reformatAltHovered(r)}}}},{key:"_isElementTagSupported",value:function(){return n.isElement(this.domElement)||n.throwError("The DOM element is not valid, ".concat(this.domElement," given.")),n.isInArray(this.domElement.tagName.toLowerCase(),this.allowedTagList)}},{key:"_isInputElement",value:function(){return"input"===this.domElement.tagName.toLowerCase()}},{key:"_isInputTypeSupported",value:function(){return"text"===this.domElement.type||"hidden"===this.domElement.type||"tel"===this.domElement.type||n.isUndefinedOrNullOrEmpty(this.domElement.type)}},{key:"_checkElement",value:function(){var e=this.domElement.tagName.toLowerCase();this._isElementTagSupported()||n.throwError("The <".concat(e,"> tag is not supported by autoNumeric")),this._isInputElement()?(this._isInputTypeSupported()||n.throwError('The input type "'.concat(this.domElement.type,'" is not supported by autoNumeric')),this.isInputElement=!0):(this.isInputElement=!1,this.isContentEditable=this.domElement.hasAttribute("contenteditable")&&"true"===this.domElement.getAttribute("contenteditable"))}},{key:"_formatDefaultValueOnPageLoad",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null,m=!0;if(n.isNull(r)?(i=n.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",i)):i=r,this.isInputElement||this.isContentEditable){var p=this.constructor._toNumericValue(i,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==i||null===this.settings.defaultValueOverride&&""!==i&&i!==this.domElement.getAttribute("value")||""!==i&&"hidden"===this.domElement.getAttribute("type")&&!n.isNumber(p)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var s=this.constructor._removeBrackets(i,this.settings);(this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)&&""!==this.settings.negativeSignCharacter&&n.isNegative(i,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(s,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(s,this.settings,!0,this.isFocused))}m=!1}}else isNaN(Number(p))||1/0===p?n.throwError("The value [".concat(i,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(p),m=!1);if(""===i)switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.focus:case a.options.emptyInputBehavior.null:case a.options.emptyInputBehavior.press:break;case a.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case a.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case a.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case a.options.emptyInputBehavior.zero:this.set("0");break;default:this.set(this.settings.emptyInputBehavior)}else m&&i===this.domElement.getAttribute("value")&&this.set(i)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==i||this.set(i)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=W(this.settings.maximumValue.toString().split("."),1)[0],i=W(this.settings.minimumValue||0===this.settings.minimumValue?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),i=i.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(i.length,1)}},{key:"_calculateValuesToStringsKeys",value:function(){this.valuesToStringsKeys=this.settings.valuesToStrings?Object.keys(this.settings.valuesToStrings):[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];"true"!==i&&"false"!==i||(this.settings[e]="true"===i),"number"==typeof i&&(this.settings[e]=i.toString())}}},{key:"_setSettings",value:function(e,i){var r=1<arguments.length&&void 0!==i&&i;!r&&n.isNull(e)||this.constructor._convertOldOptionsToNewOnes(e),r?("decimalPlacesRawValue"in e&&(this.settings.originalDecimalPlacesRawValue=e.decimalPlacesRawValue),"decimalPlaces"in e&&(this.settings.originalDecimalPlaces=e.decimalPlaces),this.constructor._calculateDecimalPlacesOnUpdate(e,this.settings),this._mergeSettings(e)):(this.settings={},this._mergeSettings(this.constructor.getDefaultConfig(),this.domElement.dataset,e,{rawValue:this.defaultRawValue}),this.caretFix=!1,this.throwInput=!0,this.allowedTagList=b.allowedTagList,this.runOnce=!1,this.hoveredWithAlt=!1),this._transformOptionsValuesToDefaultTypes(),this._runCallbacksFoundInTheSettingsObject(),this.constructor._correctNegativePositiveSignPlacementOption(this.settings),this.constructor._correctCaretPositionOnFocusAndSelectOnFocusOptions(this.settings),this.constructor._setNegativePositiveSignPermissions(this.settings),r||(this.settings.originalDecimalPlaces=n.isNull(e)||!e.decimalPlaces?null:e.decimalPlaces,this.settings.originalDecimalPlacesRawValue=this.settings.decimalPlacesRawValue,this.constructor._calculateDecimalPlacesOnInit(this.settings)),this._calculateVMinAndVMaxIntegerSizes(),this._setTrailingNegativeSignInfo(),this.regex={},this.constructor._cachesUsualRegularExpressions(this.settings,this.regex),this.constructor._setBrackets(this.settings),this._calculateValuesToStringsKeys(),n.isEmptyObj(this.settings)&&n.throwError("Unable to set the settings, those are invalid ; an empty object was given."),this.constructor.validate(this.settings,!1,e),this._keepAnOriginalSettingsCopy()}},{key:"_preparePastedText",value:function(e){return this.constructor._stripAllNonNumberCharacters(e,this.settings,!0,this.isFocused)}},{key:"_updateInternalProperties",value:function(){this.selection=n.getElementSelection(this.domElement),this.processed=!1}},{key:"_updateEventKeyInfo",value:function(e){this.eventKey=n.character(e)}},{key:"_saveCancellableValue",value:function(){this.savedCancellableValue=this.rawValue}},{key:"_setSelection",value:function(e,i){e=Math.max(e,0),i=Math.min(i,n.getElementValue(this.domElement).length),this.selection={start:e,end:i,length:i-e},n.setElementSelection(this.domElement,e,i)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=n.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=W(this._getLeftAndRightPartAroundTheSelection(),2),i=e[0],r=e[1];if(""===i&&""===r)return["",""];var m=!0;return this.eventKey!==b.keyName.Hyphen&&this.eventKey!==b.keyName.Minus||0!==Number(i)||(m=!1),this.isTrailingNegative&&(n.isNegative(r,this.settings.negativeSignCharacter)&&!n.isNegative(i,this.settings.negativeSignCharacter)||""===r&&n.isNegative(i,this.settings.negativeSignCharacter,!0))&&(i=i.replace(this.settings.negativeSignCharacter,""),r=r.replace(this.settings.negativeSignCharacter,""),i=i.replace("-",""),r=r.replace("-",""),i="-".concat(i)),[i=a._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,m,this.isFocused),r=a._stripAllNonNumberCharactersExceptCustomDecimalChar(r,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,i){var r=!0;this.eventKey!==b.keyName.Hyphen&&this.eventKey!==b.keyName.Minus||0!==Number(e)||(r=!1),this.isTrailingNegative&&n.isNegative(i,this.settings.negativeSignCharacter)&&!n.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),i=i.replace(this.settings.negativeSignCharacter,"")),e=a._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,r,this.isFocused),i=a._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,!1,this.isFocused),this.settings.leadingZero!==a.options.leadingZero.deny||this.eventKey!==b.keyName.num0&&this.eventKey!==b.keyName.numpad0||0!==Number(e)||n.contains(e,this.settings.decimalCharacter)||""===i||(e=e.substring(0,e.length-1));var m=e+i;if(this.settings.decimalCharacter){var p=m.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));p&&(m=(e=e.replace(p[1],p[1]+"0"))+i)}return[e,i,m]}},{key:"_setValueParts",value:function(e,i,r){var m=2<arguments.length&&void 0!==r&&r,p=W(this._normalizeParts(e,i),3),s=p[0],C=p[1],M=p[2],q=W(a._checkIfInRangeWithOverrideOption(M,this.settings),2),v=q[0],Z=q[1];if(v&&Z){var V=a._truncateDecimalPlaces(M,this.settings,m,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(""===V||V===this.settings.negativeSignCharacter){var B;switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.focus:case a.options.emptyInputBehavior.press:case a.options.emptyInputBehavior.always:B="";break;case a.options.emptyInputBehavior.min:B=this.settings.minimumValue;break;case a.options.emptyInputBehavior.max:B=this.settings.maximumValue;break;case a.options.emptyInputBehavior.zero:B="0";break;case a.options.emptyInputBehavior.null:B=null;break;default:B=this.settings.emptyInputBehavior}this._setRawValue(B)}else this._setRawValue(this._trimLeadingAndTrailingZeros(V));var j=a._truncateDecimalPlaces(M,this.settings,m,this.settings.decimalPlacesShownOnFocus),z=s.length;return z>j.length&&(z=j.length),1===z&&"0"===s&&this.settings.leadingZero===a.options.leadingZero.deny&&(z=""===C||"0"===s&&""!==C?1:0),this._setElementValue(j,!1),this._setCaretPosition(z),!0}return this._triggerRangeEvents(v,Z),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var i=this.settings.currencySymbol.length,r=n.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&r&&r.charAt(0)===this.settings.negativeSignCharacter?[1,i+1]:[0,i];else{var m=r.length;e=[m-i,m]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=W(this._getSignPosition(),2),i=e[0],r=e[1],m=this.selection;m.start<r&&m.end>i&&((m.start<i||m.end>r)&&n.getElementValue(this.domElement).substring(Math.max(m.start,i),Math.min(m.end,r)).match(/^\s*$/)?m.start<i?this._setSelection(m.start,i):this._setSelection(r,m.end):this._setSelection(Math.min(m.start,i),Math.max(m.end,r)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!n.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,i=W(this._getLeftAndRightPartAroundTheSelection(),2),r=i[0],m=i[1];delete this.valuePartsBeforePaste;var p=r.substr(0,e[0].length)+a._stripAllNonNumberCharactersExceptCustomDecimalChar(r.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(p,m,!0)||(this._setElementValue(e.join(""),!1),this._setCaretPosition(e[0].length))}}},{key:"_processNonPrintableKeysAndShortcuts",value:function(e){if((e.ctrlKey||e.metaKey)&&"keyup"===e.type&&!n.isUndefined(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKey===b.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===b.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===b.keyName.c||this.eventKey===b.keyName.v||this.eventKey===b.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==b.keyName.v&&this.eventKey!==b.keyName.Insert||("keydown"===e.type||"keypress"===e.type?n.isUndefined(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),"keydown"===e.type||"keypress"===e.type||this.eventKey===b.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===b.keyName.Z||this.eventKey===b.keyName.z);if(this.eventKey!==b.keyName.LeftArrow&&this.eventKey!==b.keyName.RightArrow)return n.isInArray(this.eventKey,b.keyName._directionKeys);if("keydown"===e.type&&!e.shiftKey){var i=n.getElementValue(this.domElement);this.eventKey!==b.keyName.LeftArrow||i.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==b.keyName.RightArrow||i.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start+1)!==this.settings.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)}return!0}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var i=W(e,2),r=i[0],m=i[1],p=n.getElementValue(this.domElement),s=n.isNegative(p,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix&&(this.eventKey===b.keyName.Backspace?(this.caretFix=this.selection.start>=p.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===p.charAt(this.selection.start-1)?r=r.substring(1):this.selection.start<=p.length-this.settings.suffixText.length&&(r=r.substring(0,r.length-1))):(this.caretFix=this.selection.start>=p.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,this.selection.start>=p.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(m=m.substring(1,m.length)),n.isNegative(r,this.settings.negativeSignCharacter)&&"-"===p.charAt(this.selection.start)&&(r=r.substring(1)))),this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=p.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===b.keyName.Backspace?this.selection.start===p.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&s?r=r.substring(1):"-"!==r&&(this.selection.start<=p.indexOf(this.settings.negativeSignCharacter)||!s)&&(r=r.substring(0,r.length-1)):("-"===r[0]&&(m=m.substring(1)),this.selection.start===p.indexOf(this.settings.negativeSignCharacter)&&s&&(r=r.substring(1)));break;case a.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=p.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===b.keyName.Backspace?this.selection.start===p.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?r=r.substring(1):("-"!==r&&this.selection.start<=p.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length||""!==r&&!s)&&(r=r.substring(0,r.length-1)):(this.caretFix=this.selection.start>=p.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===p.indexOf(this.settings.negativeSignCharacter)&&(r=r.substring(1)),m=m.substring(1))}return[r,m]}},{key:"_processCharacterDeletion",value:function(){var e,i;if(this.selection.length){this._expandSelectionOnSign();var r=W(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);e=r[0],i=r[1]}else{var m=W(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(i=m[1],""===(e=m[0])&&""===i&&(this.throwInput=!1),this.isTrailingNegative&&n.isNegative(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var p=W(this._processCharacterDeletionIfTrailingNegativeSign([e,i]),2);e=p[0],i=p[1]}else this.eventKey===b.keyName.Backspace?e=e.substring(0,e.length-1):i=i.substring(1,i.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(e).concat(i),this.settings)&&(this._setValueParts(e,i),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(a.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(a.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=W(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),i=e[0],r=e[1];if(this.eventKey!==b.keyName.AndroidDefault&&(this.throwInput=!0),this.eventKey===this.settings.decimalCharacter||this.settings.decimalCharacterAlternative&&this.eventKey===this.settings.decimalCharacterAlternative){if(!this._isDecimalCharacterInsertionAllowed()||!this.settings.decimalCharacter)return!1;if(this.settings.alwaysAllowDecimalCharacter)i=i.replace(this.settings.decimalCharacter,""),r=r.replace(this.settings.decimalCharacter,"");else{if(n.contains(i,this.settings.decimalCharacter)||0<r.indexOf(this.settings.decimalCharacter))return!0;0===r.indexOf(this.settings.decimalCharacter)&&(r=r.substr(1))}return this.settings.negativeSignCharacter&&n.contains(r,this.settings.negativeSignCharacter)&&(i="".concat(this.settings.negativeSignCharacter).concat(i),r=r.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(i+this.settings.decimalCharacter,r),!0}if(("-"===this.eventKey||"+"===this.eventKey)&&this.settings.isNegativeSignAllowed)return""===i&&n.contains(r,"-")?r=r.replace("-",""):i=n.isNegativeStrict(i,"-")?i.replace("-",""):"".concat(this.settings.negativeSignCharacter).concat(i),this._setValueParts(i,r),!0;var m=Number(this.eventKey);return 0<=m&&m<=9?(this.settings.isNegativeSignAllowed&&""===i&&n.contains(r,"-")&&(i="-",r=r.substring(1,r.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!n.contains(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&"0"!==this.eventKey&&(i="-".concat(i)),this._setValueParts("".concat(i).concat(this.eventKey),r),!0):this.throwInput=!1}},{key:"_formatValue",value:function(e){var i=n.getElementValue(this.domElement),r=W(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((""===this.settings.digitGroupSeparator||""!==this.settings.digitGroupSeparator&&!n.contains(i,this.settings.digitGroupSeparator))&&(""===this.settings.currencySymbol||""!==this.settings.currencySymbol&&!n.contains(i,this.settings.currencySymbol))){var m=W(i.split(this.settings.decimalCharacter),1)[0],p="";n.isNegative(m,this.settings.negativeSignCharacter)&&(p=this.settings.negativeSignCharacter,m=m.replace(this.settings.negativeSignCharacter,""),r=r.replace("-","")),""===p&&m.length>this.settings.mIntPos&&"0"===r.charAt(0)&&(r=r.slice(1)),p===this.settings.negativeSignCharacter&&m.length>this.settings.mIntNeg&&"0"===r.charAt(0)&&(r=r.slice(1)),this.isTrailingNegative||(r="".concat(p).concat(r))}var s=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue),C=s.length;if(s){var M,q=r.split("");if((this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)&&q[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(q.shift(),(this.eventKey===b.keyName.Backspace||this.eventKey===b.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix)&&(q.push(this.settings.negativeSignCharacter),this.caretFix="keydown"===e.type),this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.right))){var v=this.settings.currencySymbol.split(""),Z=["\\","^","$",".","|","?","*","+","(",")","["],V=[];v.forEach(function(z,X){n.isInArray(X=v[z],Z)?V.push("\\"+X):V.push(X)}),this.eventKey===b.keyName.Backspace&&"-"===this.settings.negativeSignCharacter&&V.push("-"),q.push(V.join("")),this.caretFix="keydown"===e.type}for(var B=0;B<q.length;B++)q[B].match("\\d")||(q[B]="\\"+q[B]);M=this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(q.join(".*?"))):new RegExp("^.*?".concat(this.settings.currencySymbol).concat(q.join(".*?")));var j=s.match(M);j?(C=j[0].length,this.settings.showPositiveSign&&(0===C&&j.input.charAt(0)===this.settings.positiveSignCharacter&&(C=1===j.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===C&&j.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(C=this.settings.currencySymbol.length+1)),(0===C&&s.charAt(0)!==this.settings.negativeSignCharacter||1===C&&s.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&(C=this.settings.currencySymbol.length+(n.isNegativeStrict(s,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&(C-=this.settings.currencySymbol.length),this.settings.suffixText&&(C-=this.settings.suffixText.length))}s!==i&&(this._setElementValue(s,!1),this._setCaretPosition(C)),this.formatted=!0}}]),ce(c,g),a}();function ee(a,c){c=c||{bubbles:!1,cancelable:!1,detail:void 0};var g=document.createEvent("CustomEvent");return g.initCustomEvent(a,c.bubbles,c.cancelable,c.detail),g}k.multiple=function(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,g=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,e=[];if(n.isObject(c)&&(g=c,c=null),n.isString(a))a=G(document.querySelectorAll(a));else if(n.isObject(a)){Object.prototype.hasOwnProperty.call(a,"rootElement")||n.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var i=G(a.rootElement.querySelectorAll("input"));a=Object.prototype.hasOwnProperty.call(a,"exclude")?(Array.isArray(a.exclude)||n.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),n.filterOut(i,a.exclude)):i}else n.isArray(a)||n.throwError("The given parameters to the 'multiple' function are invalid.");if(0===a.length){var r=!0;return!n.isNull(g)&&n.isBoolean(g.showWarnings)&&(r=g.showWarnings),n.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",r),[]}var m=n.isArray(c)&&1<=c.length,p=!1,s=!1;if(m){var C=te(Number(c[0]));(p="number"===C&&!isNaN(Number(c[0])))||"string"!==C&&!isNaN(C)&&"object"!==C||(s=!0)}var M,q=!1;if(n.isArray(g)&&1<=g.length){var v=te(g[0]);"string"!==v&&"object"!==v||(q=!0)}M=s?k.mergeOptions(c):q?k.mergeOptions(g):g;var Z,V=n.isNumber(c);return p&&(Z=c.length),a.forEach(function(B,j){e.push(new k(B,V?c:p&&j<=Z?c[j]:null,M))}),e},Array.from||(Array.from=function(a){return[].slice.call(a)}),"undefined"!=typeof window&&"function"!=typeof window.CustomEvent&&(ee.prototype=window.Event.prototype,window.CustomEvent=ee),k.events={correctedValue:"autoNumeric:correctedValue",initialized:"autoNumeric:initialized",invalidFormula:"autoNumeric:invalidFormula",invalidValue:"autoNumeric:invalidValue",formatted:"autoNumeric:formatted",rawValueModified:"autoNumeric:rawValueModified",minRangeExceeded:"autoNumeric:minExceeded",maxRangeExceeded:"autoNumeric:maxExceeded",native:{input:"input",change:"change"},validFormula:"autoNumeric:validFormula"},Object.freeze(k.events.native),Object.freeze(k.events),Object.defineProperty(k,"events",{configurable:!1,writable:!1}),k.options={allowDecimalPadding:{always:!0,never:!1,floats:"floats"},alwaysAllowDecimalCharacter:{alwaysAllow:!0,doNotAllow:!1},caretPositionOnFocus:{start:"start",end:"end",decimalLeft:"decimalLeft",decimalRight:"decimalRight",doNoForceCaretPosition:null},createLocalList:{createList:!0,doNotCreateList:!1},currencySymbol:{none:"",currencySign:"\xa4",austral:"\u20b3",australCentavo:"\xa2",baht:"\u0e3f",cedi:"\u20b5",cent:"\xa2",colon:"\u20a1",cruzeiro:"\u20a2",dollar:"$",dong:"\u20ab",drachma:"\u20af",dram:"\u200b\u058f",european:"\u20a0",euro:"\u20ac",florin:"\u0192",franc:"\u20a3",guarani:"\u20b2",hryvnia:"\u20b4",kip:"\u20ad",att:"\u0ead\u0eb1\u0e94",lepton:"\u039b.",lira:"\u20ba",liraOld:"\u20a4",lari:"\u20be",mark:"\u2133",mill:"\u20a5",naira:"\u20a6",peseta:"\u20a7",peso:"\u20b1",pfennig:"\u20b0",pound:"\xa3",real:"R$",riel:"\u17db",ruble:"\u20bd",rupee:"\u20b9",rupeeOld:"\u20a8",shekel:"\u20aa",shekelAlt:"\u05e9\u05f4\u05d7\u200e\u200e",taka:"\u09f3",tenge:"\u20b8",togrog:"\u20ae",won:"\u20a9",yen:"\xa5"},currencySymbolPlacement:{prefix:"p",suffix:"s"},decimalCharacter:{comma:",",dot:".",middleDot:"\xb7",arabicDecimalSeparator:"\u066b",decimalSeparatorKeySymbol:"\u2396"},decimalCharacterAlternative:{none:null,comma:",",dot:"."},decimalPlaces:{none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesRawValue:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnBlur:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnFocus:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},defaultValueOverride:{doNotOverride:null},digitalGroupSpacing:{two:"2",twoScaled:"2s",three:"3",four:"4"},digitGroupSeparator:{comma:",",dot:".",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0",noSeparator:"",apostrophe:"'",arabicThousandsSeparator:"\u066c",dotAbove:"\u02d9",privateUseTwo:"\u2019"},divisorWhenUnfocused:{none:null,percentage:100,permille:1e3,basisPoint:1e4},emptyInputBehavior:{focus:"focus",press:"press",always:"always",zero:"zero",min:"min",max:"max",null:"null"},eventBubbles:{bubbles:!0,doesNotBubble:!1},eventIsCancelable:{isCancelable:!0,isNotCancelable:!1},failOnUnknownOption:{fail:!0,ignore:!1},formatOnPageLoad:{format:!0,doNotFormat:!1},formulaMode:{enabled:!0,disabled:!1},historySize:{verySmall:5,small:10,medium:20,large:50,veryLarge:100,insane:Number.MAX_SAFE_INTEGER},invalidClass:"an-invalid",isCancellable:{cancellable:!0,notCancellable:!1},leadingZero:{allow:"allow",deny:"deny",keep:"keep"},maximumValue:{tenTrillions:"10000000000000",oneBillion:"1000000000",zero:"0"},minimumValue:{tenTrillions:"-10000000000000",oneBillion:"-1000000000",zero:"0"},modifyValueOnWheel:{modifyValue:!0,doNothing:!1},negativeBracketsTypeOnBlur:{parentheses:"(,)",brackets:"[,]",chevrons:"<,>",curlyBraces:"{,}",angleBrackets:"\u3008,\u3009",japaneseQuotationMarks:"\uff62,\uff63",halfBrackets:"\u2e24,\u2e25",whiteSquareBrackets:"\u27e6,\u27e7",quotationMarks:"\u2039,\u203a",guillemets:"\xab,\xbb",none:null},negativePositiveSignPlacement:{prefix:"p",suffix:"s",left:"l",right:"r",none:null},negativeSignCharacter:{hyphen:"-",minus:"\u2212",heavyMinus:"\u2796",fullWidthHyphen:"\uff0d",circledMinus:"\u2296",squaredMinus:"\u229f",triangleMinus:"\u2a3a",plusMinus:"\xb1",minusPlus:"\u2213",dotMinus:"\u2238",minusTilde:"\u2242",not:"\xac"},noEventListeners:{noEvents:!0,addEvents:!1},onInvalidPaste:{error:"error",ignore:"ignore",clamp:"clamp",truncate:"truncate",replace:"replace"},outputFormat:{string:"string",number:"number",dot:".",negativeDot:"-.",comma:",",negativeComma:"-,",dotNegative:".-",commaNegative:",-",none:null},overrideMinMaxLimits:{ceiling:"ceiling",floor:"floor",ignore:"ignore",invalid:"invalid",doNotOverride:null},positiveSignCharacter:{plus:"+",fullWidthPlus:"\uff0b",heavyPlus:"\u2795",doublePlus:"\u29fa",triplePlus:"\u29fb",circledPlus:"\u2295",squaredPlus:"\u229e",trianglePlus:"\u2a39",plusMinus:"\xb1",minusPlus:"\u2213",dotPlus:"\u2214",altHebrewPlus:"\ufb29",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0"},rawValueDivisor:{none:null,percentage:100,permille:1e3,basisPoint:1e4},readOnly:{readOnly:!0,readWrite:!1},roundingMethod:{halfUpSymmetric:"S",halfUpAsymmetric:"A",halfDownSymmetric:"s",halfDownAsymmetric:"a",halfEvenBankersRounding:"B",upRoundAwayFromZero:"U",downRoundTowardZero:"D",toCeilingTowardPositiveInfinity:"C",toFloorTowardNegativeInfinity:"F",toNearest05:"N05",toNearest05Alt:"CHF",upToNext05:"U05",downToNext05:"D05"},saveValueToSessionStorage:{save:!0,doNotSave:!1},selectNumberOnly:{selectNumbersOnly:!0,selectAll:!1},selectOnFocus:{select:!0,doNotSelect:!1},serializeSpaces:{plus:"+",percent:"%20"},showOnlyNumbersOnFocus:{onlyNumbers:!0,showAll:!1},showPositiveSign:{show:!0,hide:!1},showWarnings:{show:!0,hide:!1},styleRules:{none:null,positiveNegative:{positive:"autoNumeric-positive",negative:"autoNumeric-negative"},range0To100With4Steps:{ranges:[{min:0,max:25,class:"autoNumeric-red"},{min:25,max:50,class:"autoNumeric-orange"},{min:50,max:75,class:"autoNumeric-yellow"},{min:75,max:100,class:"autoNumeric-green"}]},evenOdd:{userDefined:[{callback:function(a){return a%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(a){return-1<=a&&a<0?0:0===Number(a)?1:0<a&&a<=1?2:null},classes:["autoNumeric-small-negative","autoNumeric-zero","autoNumeric-small-positive"]}]}},suffixText:{none:"",percentage:"%",permille:"\u2030",basisPoint:"\u2031"},symbolWhenUnfocused:{none:null,percentage:"%",permille:"\u2030",basisPoint:"\u2031"},unformatOnHover:{unformat:!0,doNotUnformat:!1},unformatOnSubmit:{unformat:!0,keepCurrentValue:!1},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},H=k.options,Object.getOwnPropertyNames(H).forEach(function(a){"valuesToStrings"===a?Object.getOwnPropertyNames(H.valuesToStrings).forEach(function(c){n.isIE11()||null===H.valuesToStrings[c]||Object.freeze(H.valuesToStrings[c])}):"styleRules"!==a&&(n.isIE11()||null===H[a]||Object.freeze(H[a]))}),Object.freeze(H),Object.defineProperty(k,"options",{configurable:!1,writable:!1}),k.defaultSettings={allowDecimalPadding:k.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:k.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:k.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:k.options.createLocalList.createList,currencySymbol:k.options.currencySymbol.none,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,decimalCharacter:k.options.decimalCharacter.dot,decimalCharacterAlternative:k.options.decimalCharacterAlternative.none,decimalPlaces:k.options.decimalPlaces.two,decimalPlacesRawValue:k.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:k.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:k.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:k.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:k.options.digitalGroupSpacing.three,digitGroupSeparator:k.options.digitGroupSeparator.comma,divisorWhenUnfocused:k.options.divisorWhenUnfocused.none,emptyInputBehavior:k.options.emptyInputBehavior.focus,eventBubbles:k.options.eventBubbles.bubbles,eventIsCancelable:k.options.eventIsCancelable.isCancelable,failOnUnknownOption:k.options.failOnUnknownOption.ignore,formatOnPageLoad:k.options.formatOnPageLoad.format,formulaMode:k.options.formulaMode.disabled,historySize:k.options.historySize.medium,invalidClass:k.options.invalidClass,isCancellable:k.options.isCancellable.cancellable,leadingZero:k.options.leadingZero.deny,maximumValue:k.options.maximumValue.tenTrillions,minimumValue:k.options.minimumValue.tenTrillions,modifyValueOnWheel:k.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:k.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.none,negativeSignCharacter:k.options.negativeSignCharacter.hyphen,noEventListeners:k.options.noEventListeners.addEvents,onInvalidPaste:k.options.onInvalidPaste.error,outputFormat:k.options.outputFormat.none,overrideMinMaxLimits:k.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:k.options.positiveSignCharacter.plus,rawValueDivisor:k.options.rawValueDivisor.none,readOnly:k.options.readOnly.readWrite,roundingMethod:k.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:k.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:k.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:k.options.selectOnFocus.select,serializeSpaces:k.options.serializeSpaces.plus,showOnlyNumbersOnFocus:k.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:k.options.showPositiveSign.hide,showWarnings:k.options.showWarnings.show,styleRules:k.options.styleRules.none,suffixText:k.options.suffixText.none,symbolWhenUnfocused:k.options.symbolWhenUnfocused.none,unformatOnHover:k.options.unformatOnHover.unformat,unformatOnSubmit:k.options.unformatOnSubmit.keepCurrentValue,valuesToStrings:k.options.valuesToStrings.none,watchExternalChanges:k.options.watchExternalChanges.doNotWatch,wheelOn:k.options.wheelOn.focus,wheelStep:k.options.wheelStep.progressive},Object.freeze(k.defaultSettings),Object.defineProperty(k,"defaultSettings",{configurable:!1,writable:!1});var Q={digitGroupSeparator:k.options.digitGroupSeparator.dot,decimalCharacter:k.options.decimalCharacter.comma,decimalCharacterAlternative:k.options.decimalCharacterAlternative.dot,currencySymbol:"\u202f\u20ac",currencySymbolPlacement:k.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.prefix},Y={digitGroupSeparator:k.options.digitGroupSeparator.comma,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.dollar,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.right},oe={digitGroupSeparator:k.options.digitGroupSeparator.comma,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.yen,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.right};n.cloneObject(Q).formulaMode=k.options.formulaMode.enabled;var Pe=n.cloneObject(Q);Pe.minimumValue=0;var ye=n.cloneObject(Q);ye.maximumValue=0,ye.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var pe=n.cloneObject(Q);pe.digitGroupSeparator=k.options.digitGroupSeparator.normalSpace;var we=n.cloneObject(pe);we.minimumValue=0;var Se=n.cloneObject(pe);Se.maximumValue=0,Se.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var me=n.cloneObject(Q);me.currencySymbol=k.options.currencySymbol.none,me.suffixText="\u202f".concat(k.options.suffixText.percentage),me.wheelStep=1e-4,me.rawValueDivisor=k.options.rawValueDivisor.percentage;var Ce=n.cloneObject(me);Ce.minimumValue=0;var Oe=n.cloneObject(me);Oe.maximumValue=0,Oe.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var xe=n.cloneObject(me);xe.decimalPlaces=3;var Fe=n.cloneObject(Ce);Fe.decimalPlaces=3;var Le=n.cloneObject(Oe);Le.decimalPlaces=3,n.cloneObject(Y).formulaMode=k.options.formulaMode.enabled;var Me=n.cloneObject(Y);Me.minimumValue=0;var Te=n.cloneObject(Y);Te.maximumValue=0,Te.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var Ie=n.cloneObject(Te);Ie.negativeBracketsTypeOnBlur=k.options.negativeBracketsTypeOnBlur.parentheses;var de=n.cloneObject(Y);de.currencySymbol=k.options.currencySymbol.none,de.suffixText=k.options.suffixText.percentage,de.wheelStep=1e-4,de.rawValueDivisor=k.options.rawValueDivisor.percentage;var ke=n.cloneObject(de);ke.minimumValue=0;var _e=n.cloneObject(de);_e.maximumValue=0,_e.negativePositiveSignPlacement=k.options.negativePositiveSignPlacement.prefix;var Ve=n.cloneObject(de);Ve.decimalPlaces=3;var Re=n.cloneObject(ke);Re.decimalPlaces=3;var Ze=n.cloneObject(_e);Ze.decimalPlaces=3;var De=n.cloneObject(Q);De.currencySymbol=k.options.currencySymbol.lira,k.predefinedOptions={euro:Q,euroPos:Pe,euroNeg:ye,euroSpace:pe,euroSpacePos:we,euroSpaceNeg:Se,percentageEU2dec:me,percentageEU2decPos:Ce,percentageEU2decNeg:Oe,percentageEU3dec:xe,percentageEU3decPos:Fe,percentageEU3decNeg:Le,dollar:Y,dollarPos:Me,dollarNeg:Te,dollarNegBrackets:Ie,percentageUS2dec:de,percentageUS2decPos:ke,percentageUS2decNeg:_e,percentageUS3dec:Ve,percentageUS3decPos:Re,percentageUS3decNeg:Ze,French:Q,Spanish:Q,NorthAmerican:Y,British:{digitGroupSeparator:k.options.digitGroupSeparator.comma,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.pound,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:k.options.digitGroupSeparator.apostrophe,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:"\u202fCHF",currencySymbolPlacement:k.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.prefix},Japanese:oe,Chinese:oe,Brazilian:{digitGroupSeparator:k.options.digitGroupSeparator.dot,decimalCharacter:k.options.decimalCharacter.comma,currencySymbol:k.options.currencySymbol.real,currencySymbolPlacement:k.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:k.options.negativePositiveSignPlacement.right},Turkish:De,dotDecimalCharCommaSeparator:{digitGroupSeparator:k.options.digitGroupSeparator.comma,decimalCharacter:k.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:k.options.digitGroupSeparator.dot,decimalCharacter:k.options.decimalCharacter.comma,decimalCharacterAlternative:k.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:k.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:k.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:k.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:k.options.allowDecimalPadding.never,minimumValue:k.options.minimumValue.zero,maximumValue:k.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:k.options.allowDecimalPadding.never,minimumValue:k.options.minimumValue.tenTrillions,maximumValue:k.options.maximumValue.zero},numeric:{digitGroupSeparator:k.options.digitGroupSeparator.noSeparator,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.none},numericPos:{digitGroupSeparator:k.options.digitGroupSeparator.noSeparator,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.none,minimumValue:k.options.minimumValue.zero,maximumValue:k.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:k.options.digitGroupSeparator.noSeparator,decimalCharacter:k.options.decimalCharacter.dot,currencySymbol:k.options.currencySymbol.none,minimumValue:k.options.minimumValue.tenTrillions,maximumValue:k.options.maximumValue.zero}},Object.getOwnPropertyNames(k.predefinedOptions).forEach(function(a){Object.freeze(k.predefinedOptions[a])}),Object.freeze(k.predefinedOptions),Object.defineProperty(k,"predefinedOptions",{configurable:!1,writable:!1}),t.default=k}],S.c=L,S.d=function(N,t,x){S.o(N,t)||Object.defineProperty(N,t,{enumerable:!0,get:x})},S.r=function(N){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},S.t=function(N,t){if(1&t&&(N=S(N)),8&t||4&t&&"object"==typeof N&&N&&N.__esModule)return N;var x=Object.create(null);if(S.r(x),Object.defineProperty(x,"default",{enumerable:!0,value:N}),2&t&&"string"!=typeof N)for(var F in N)S.d(x,F,function(b){return N[b]}.bind(null,F));return x},S.n=function(N){var t=N&&N.__esModule?function(){return N.default}:function(){return N};return S.d(t,"a",t),t},S.o=function(N,t){return Object.prototype.hasOwnProperty.call(N,t)},S.p="",S(S.s=0).default;function S(N){if(L[N])return L[N].exports;var t=L[N]={i:N,l:!1,exports:{}};return T[N].call(t.exports,t,t.exports,S),t.l=!0,t.exports}var T,L}()},9489:(K,S,T)=>{"use strict";var N=U(T(3413)),x=U(T(7720)),b=U(T(2308)),I=U(T(7095)),o=U(T(4441)),d=U(T(201)),f=U(T(400)),_=T(4779),R=U(T(1452));function U(H){return H&&H.__esModule?H:{default:H}}var G=function(){},W=function(k,ee,Q){var Y=new G;if(void 0===k)throw Error("No element to render on was provided.");return Y._renderProperties=(0,o.default)(k),Y._encodings=[],Y._options=R.default,Y._errorHandler=new f.default(Y),void 0!==ee&&((Q=Q||{}).format||(Q.format=te()),Y.options(Q)[Q.format](ee,Q).render()),Y};for(var $ in W.getModule=function(H){return N.default[H]},N.default)N.default.hasOwnProperty($)&&le(N.default,$);function le(H,k){G.prototype[k]=G.prototype[k.toUpperCase()]=G.prototype[k.toLowerCase()]=function(ee,Q){var Y=this;return Y._errorHandler.wrapBarcodeCall(function(){Q.text=void 0===Q.text?void 0:""+Q.text;var oe=(0,x.default)(Y._options,Q);oe=(0,d.default)(oe);var ye=re(ee,H[k],oe);return Y._encodings.push(ye),Y})}}function re(H,k,ee){var Q=new k(H=""+H,ee);if(!Q.valid())throw new _.InvalidInputException(Q.constructor.name,H);var Y=Q.encode();Y=(0,b.default)(Y);for(var oe=0;oe<Y.length;oe++)Y[oe].options=(0,x.default)(ee,Y[oe].options);return Y}function te(){return N.default.CODE128?"CODE128":Object.keys(N.default)[0]}function ce(H,k,ee){k=(0,b.default)(k);for(var Q=0;Q<k.length;Q++)k[Q].options=(0,x.default)(ee,k[Q].options),(0,I.default)(k[Q].options);(0,I.default)(ee),new(0,H.renderer)(H.element,k,ee).render(),H.afterRender&&H.afterRender()}G.prototype.options=function(H){return this._options=(0,x.default)(this._options,H),this},G.prototype.blank=function(H){var k=new Array(H+1).join("0");return this._encodings.push({data:k}),this},G.prototype.init=function(){var H;if(this._renderProperties)for(var k in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){var ee=(0,x.default)(this._options,(H=this._renderProperties[k]).options);"auto"==ee.format&&(ee.format=te()),this._errorHandler.wrapBarcodeCall(function(){var oe=re(ee.value,N.default[ee.format.toUpperCase()],ee);ce(H,oe,ee)})}},G.prototype.render=function(){if(!this._renderProperties)throw new _.NoElementException;if(Array.isArray(this._renderProperties))for(var H=0;H<this._renderProperties.length;H++)ce(this._renderProperties[H],this._encodings,this._options);else ce(this._renderProperties,this._encodings,this._options);return this},G.prototype._defaults=R.default,"undefined"!=typeof window&&(window.JsBarcode=W),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(H,k){var ee=[];return jQuery(this).each(function(){ee.push(this)}),W(ee,H,k)}),K.exports=W},6615:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function N(t,x){(function(N,t){if(!(N instanceof t))throw new TypeError("Cannot call a class as a function")})(this,N),this.data=t,this.text=x.text||t,this.options=x}},8901:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(6615))&&o.__esModule?o:{default:o},x=T(5286),y=function(o){function l(d,n){!function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l);var f=function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d.substring(1),n));return f.bytes=d.split("").map(function(_){return _.charCodeAt(0)}),f}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,f=n.shift()-105,_=x.SET_BY_CODE[f];if(void 0===_)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&n.unshift(x.FNC1);var P=l.next(n,1,_);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:l.getBar(f)+P.result+l.getBar((P.checksum+f)%x.MODULO)+l.getBar(x.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return"string"==typeof n&&(n="true"===n.toLowerCase()),n}}],[{key:"getBar",value:function(n){return x.BARS[n]?x.BARS[n].toString():""}},{key:"correctIndex",value:function(n,f){if(f===x.SET_A){var _=n.shift();return _<32?_+64:_-32}return f===x.SET_B?n.shift()-32:10*(n.shift()-48)+n.shift()-48}},{key:"next",value:function(n,f,_){if(!n.length)return{result:"",checksum:0};var P=void 0,R=void 0;if(n[0]>=200){R=n.shift()-105;var U=x.SWAP[R];void 0!==U?P=l.next(n,f+1,U):((_===x.SET_A||_===x.SET_B)&&R===x.SHIFT&&(n[0]=_===x.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),P=l.next(n,f+1,_))}else R=l.correctIndex(n,_),P=l.next(n,f+1,_);return{result:l.getBar(R)+P.result,checksum:R*f+P.checksum}}}]),l}(t.default);S.default=y},972:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(8901))&&o.__esModule?o:{default:o},x=T(5286),y=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,x.A_START_CHAR+d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return new RegExp("^"+x.A_CHARS+"+$").test(this.data)}}]),l}(t.default);S.default=y},399:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(8901))&&o.__esModule?o:{default:o},x=T(5286),y=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,x.B_START_CHAR+d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return new RegExp("^"+x.B_CHARS+"+$").test(this.data)}}]),l}(t.default);S.default=y},8108:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(8901))&&o.__esModule?o:{default:o},x=T(5286),y=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,x.C_START_CHAR+d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return new RegExp("^"+x.C_CHARS+"+$").test(this.data)}}]),l}(t.default);S.default=y},4156:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=F(T(8901)),x=F(T(993));function F(o){return o&&o.__esModule?o:{default:o}}function E(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}var y=function(o){function l(d,n){if(function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),/^[\x00-\x7F\xC8-\xD3]+$/.test(d))var f=E(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,(0,x.default)(d),n));else f=E(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,n));return E(f)}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),l}(N.default);S.default=y},993:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=T(5286),N=function(I){return I.match(new RegExp("^"+L.A_CHARS+"*"))[0].length},t=function(I){return I.match(new RegExp("^"+L.B_CHARS+"*"))[0].length},x=function(I){return I.match(new RegExp("^"+L.C_CHARS+"*"))[0]};function F(E,I){var y=I?L.A_CHARS:L.B_CHARS,o=E.match(new RegExp("^("+y+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(o)return o[1]+String.fromCharCode(204)+b(E.substring(o[1].length));var l=E.match(new RegExp("^"+y+"+"))[0];return l.length===E.length?E:l+String.fromCharCode(I?205:206)+F(E.substring(l.length),!I)}function b(E){var I=x(E),y=I.length;if(y===E.length)return E;E=E.substring(y);var o=N(E)>=t(E);return I+String.fromCharCode(o?206:205)+F(E,o)}S.default=function(E){var I=void 0;if(x(E).length>=2)I=L.C_START_CHAR+b(E);else{var o=N(E)>t(E);I=(o?L.A_START_CHAR:L.B_START_CHAR)+F(E,o)}return I.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(l,d){return String.fromCharCode(203)+d})}},5286:(K,S)=>{"use strict";var T;function L($,le,re){return le in $?Object.defineProperty($,le,{value:re,enumerable:!0,configurable:!0,writable:!0}):$[le]=re,$}Object.defineProperty(S,"__esModule",{value:!0});var N=S.SET_A=0,t=S.SET_B=1,x=S.SET_C=2,b=(S.SHIFT=98,S.START_A=103),E=S.START_B=104,I=S.START_C=105;S.MODULO=103,S.STOP=106,S.FNC1=207,S.SET_BY_CODE=(L(T={},b,N),L(T,E,t),L(T,I,x),T),S.SWAP={101:N,100:t,99:x},S.A_START_CHAR=String.fromCharCode(208),S.B_START_CHAR=String.fromCharCode(209),S.C_START_CHAR=String.fromCharCode(210),S.A_CHARS="[\0-_\xc8-\xcf]",S.B_CHARS="[ -\x7f\xc8-\xcf]",S.C_CHARS="(\xcf*[0-9]{2}\xcf*)",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]},6625:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CODE128C=S.CODE128B=S.CODE128A=S.CODE128=void 0;var N=y(T(4156)),x=y(T(972)),b=y(T(399)),I=y(T(8108));function y(o){return o&&o.__esModule?o:{default:o}}S.CODE128=N.default,S.CODE128A=x.default,S.CODE128B=b.default,S.CODE128C=I.default},8104:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CODE39=void 0;var P,L=function(){function P(R,U){for(var G=0;G<U.length;G++){var W=U[G];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(R,W.key,W)}}return function(R,U,G){return U&&P(R.prototype,U),G&&P(R,G),R}}(),I=function(P){function R(U,G){return function(P,R){if(!(P instanceof R))throw new TypeError("Cannot call a class as a function")}(this,R),U=U.toUpperCase(),G.mod43&&(U+=function(P){return y[P]}(function(P){for(var R=0,U=0;U<P.length;U++)R+=f(P[U]);return R%43}(U))),function(P,R){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!R||"object"!=typeof R&&"function"!=typeof R?P:R}(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,U,G))}return function(P,R){if("function"!=typeof R&&null!==R)throw new TypeError("Super expression must either be null or a function, not "+typeof R);P.prototype=Object.create(R&&R.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(P,R):P.__proto__=R)}(R,P),L(R,[{key:"encode",value:function(){for(var G=l("*"),W=0;W<this.data.length;W++)G+=l(this.data[W])+"0";return{data:G+=l("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),R}(((P=T(6615))&&P.__esModule?P:{default:P}).default),y=["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","-","."," ","$","/","+","%","*"],o=[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 l(P){return function(P){return o[P].toString(2)}(f(P))}function f(P){return y.indexOf(P)}S.CODE39=I},2679:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function d(n,f){for(var _=0;_<f.length;_++){var P=f[_];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(n,P.key,P)}}return function(n,f,_){return f&&d(n.prototype,f),_&&d(n,_),n}}(),N=T(2998),x=E(T(188));function E(d){return d&&d.__esModule?d:{default:d}}var l=function(d){function n(f,_){!function(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n);var P=function(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,f,_));return P.fontSize=!_.flat&&_.fontSize>10*_.width?10*_.width:_.fontSize,P.guardHeight=_.height+P.fontSize/2+_.textMargin,P}return function(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),L(n,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(_,P){return this.text.substr(_,P)}},{key:"leftEncode",value:function(_,P){return(0,x.default)(_,P)}},{key:"rightText",value:function(_,P){return this.text.substr(_,P)}},{key:"rightEncode",value:function(_,P){return(0,x.default)(_,P)}},{key:"encodeGuarded",value:function(){var _={fontSize:this.fontSize},P={height:this.guardHeight};return[{data:N.SIDE_BIN,options:P},{data:this.leftEncode(),text:this.leftText(),options:_},{data:N.MIDDLE_BIN,options:P},{data:this.rightEncode(),text:this.rightText(),options:_},{data:N.SIDE_BIN,options:P}]}},{key:"encodeFlat",value:function(){return{data:[N.SIDE_BIN,this.leftEncode(),N.MIDDLE_BIN,this.rightEncode(),N.SIDE_BIN].join(""),text:this.text}}}]),n}(E(T(6615)).default);S.default=l},7674:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var d,L=function(){function d(n,f){for(var _=0;_<f.length;_++){var P=f[_];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(n,P.key,P)}}return function(n,f,_){return f&&d(n.prototype,f),_&&d(n,_),n}}(),N=function d(n,f,_){null===n&&(n=Function.prototype);var P=Object.getOwnPropertyDescriptor(n,f);if(void 0===P){var R=Object.getPrototypeOf(n);return null===R?void 0:d(R,f,_)}if("value"in P)return P.value;var U=P.get;return void 0===U?void 0:U.call(_)},t=T(2998),F=(d=T(2679))&&d.__esModule?d:{default:d},o=function(n){return(10-n.substr(0,12).split("").map(function(_){return+_}).reduce(function(_,P,R){return R%2?_+3*P:_+P},0)%10)%10},l=function(d){function n(f,_){(function(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")})(this,n),-1!==f.search(/^[0-9]{12}$/)&&(f+=o(f));var P=function(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,f,_));return P.lastChar=_.lastChar,P}return function(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),L(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===o(this.data)}},{key:"leftText",value:function(){return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var _=this.data.substr(1,6),P=t.EAN13_STRUCTURE[this.data[0]];return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,_,P)}},{key:"rightText",value:function(){return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var _=this.data.substr(7,6);return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,_,"RRRRRR")}},{key:"encodeGuarded",value:function(){var _=N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(_.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(_.push({data:"00"}),_.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),_}}]),n}(F.default);S.default=l},2649:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function d(n,f){for(var _=0;_<f.length;_++){var P=f[_];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(n,P.key,P)}}return function(n,f,_){return f&&d(n.prototype,f),_&&d(n,_),n}}(),N=T(2998),x=E(T(188));function E(d){return d&&d.__esModule?d:{default:d}}var l=function(d){function n(f,_){return function(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),function(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,f,_))}return function(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),L(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var _=N.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,x.default)(this.data,_,"01"),text:this.text}}}]),n}(E(T(6615)).default);S.default=l},639:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function n(f,_){for(var P=0;P<_.length;P++){var R=_[P];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(f,R.key,R)}}return function(f,_,P){return _&&n(f.prototype,_),P&&n(f,P),f}}(),N=T(2998),x=E(T(188));function E(n){return n&&n.__esModule?n:{default:n}}var d=function(n){function f(_,P){return function(n,f){if(!(n instanceof f))throw new TypeError("Cannot call a class as a function")}(this,f),function(n,f){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||"object"!=typeof f&&"function"!=typeof f?n:f}(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,_,P))}return function(n,f){if("function"!=typeof f&&null!==f)throw new TypeError("Super expression must either be null or a function, not "+typeof f);n.prototype=Object.create(f&&f.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(n,f):n.__proto__=f)}(f,n),L(f,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var P=N.EAN5_STRUCTURE[function(f){return f.split("").map(function(P){return+P}).reduce(function(P,R,U){return U%2?P+9*R:P+3*R},0)%10}(this.data)];return{data:"1011"+(0,x.default)(this.data,P,"01"),text:this.text}}}]),f}(E(T(6615)).default);S.default=d},8036:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var l,L=function(){function l(d,n){for(var f=0;f<n.length;f++){var _=n[f];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(d,_.key,_)}}return function(d,n,f){return n&&l(d.prototype,n),f&&l(d,f),d}}(),N=function l(d,n,f){null===d&&(d=Function.prototype);var _=Object.getOwnPropertyDescriptor(d,n);if(void 0===_){var P=Object.getPrototypeOf(d);return null===P?void 0:l(P,n,f)}if("value"in _)return _.value;var R=_.get;return void 0===R?void 0:R.call(f)},x=(l=T(2679))&&l.__esModule?l:{default:l},y=function(d){return(10-d.substr(0,7).split("").map(function(f){return+f}).reduce(function(f,_,P){return P%2?f+_:f+3*_},0)%10)%10},o=function(l){function d(n,f){return function(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}(this,d),-1!==n.search(/^[0-9]{7}$/)&&(n+=y(n)),function(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?l:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,n,f))}return function(l,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}(d,l),L(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===y(this.data)}},{key:"leftText",value:function(){return N(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var f=this.data.substr(0,4);return N(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftEncode",this).call(this,f,"LLLL")}},{key:"rightText",value:function(){return N(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var f=this.data.substr(4,4);return N(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightEncode",this).call(this,f,"RRRR")}}]),d}(x.default);S.default=o},2589:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function d(n,f){for(var _=0;_<f.length;_++){var P=f[_];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(n,P.key,P)}}return function(n,f,_){return f&&d(n.prototype,f),_&&d(n,_),n}}();S.checksum=l;var t=b(T(188));function b(d){return d&&d.__esModule?d:{default:d}}var o=function(d){function n(f,_){(function(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")})(this,n),-1!==f.search(/^[0-9]{11}$/)&&(f+=l(f));var P=function(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,f,_));return P.displayValue=_.displayValue,P.fontSize=_.fontSize>10*_.width?10*_.width:_.fontSize,P.guardHeight=_.height+P.fontSize/2+_.textMargin,P}return function(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),L(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==l(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var _="";return _+="101",_+=(0,t.default)(this.data.substr(0,6),"LLLLLL"),_+="01010",_+=(0,t.default)(this.data.substr(6,6),"RRRRRR"),{data:_+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var _=[];return this.displayValue&&_.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),_.push({data:"101"+(0,t.default)(this.data[0],"L"),options:{height:this.guardHeight}}),_.push({data:(0,t.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),_.push({data:"01010",options:{height:this.guardHeight}}),_.push({data:(0,t.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),_.push({data:(0,t.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&_.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),_}}]),n}(b(T(6615)).default);function l(d){var f,n=0;for(f=1;f<11;f+=2)n+=parseInt(d[f]);for(f=0;f<11;f+=2)n+=3*parseInt(d[f]);return(10-n%10)%10}S.default=o},2054:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=function(){function _(P,R){for(var U=0;U<R.length;U++){var G=R[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(P,G.key,G)}}return function(P,R,U){return R&&_(P.prototype,R),U&&_(P,U),P}}(),t=E(T(188)),F=E(T(6615)),b=T(2589);function E(_){return _&&_.__esModule?_:{default:_}}function y(_,P){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!P||"object"!=typeof P&&"function"!=typeof P?_:P}var l=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],d=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],n=function(_){function P(R,U){!function(_,P){if(!(_ instanceof P))throw new TypeError("Cannot call a class as a function")}(this,P);var G=y(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,R,U));if(G.isValid=!1,-1!==R.search(/^[0-9]{6}$/))G.middleDigits=R,G.upcA=f(R,"0"),G.text=U.text||""+G.upcA[0]+R+G.upcA[G.upcA.length-1],G.isValid=!0;else{if(-1===R.search(/^[01][0-9]{7}$/))return y(G);if(G.middleDigits=R.substring(1,R.length-1),G.upcA=f(G.middleDigits,R[0]),G.upcA[G.upcA.length-1]!==R[R.length-1])return y(G);G.isValid=!0}return G.displayValue=U.displayValue,G.fontSize=U.fontSize>10*U.width?10*U.width:U.fontSize,G.guardHeight=U.height+G.fontSize/2+U.textMargin,G}return function(_,P){if("function"!=typeof P&&null!==P)throw new TypeError("Super expression must either be null or a function, not "+typeof P);_.prototype=Object.create(P&&P.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(_,P):_.__proto__=P)}(P,_),L(P,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var U="";return U+="101",U+=this.encodeMiddleDigits(),{data:U+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var U=[];return this.displayValue&&U.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),U.push({data:"101",options:{height:this.guardHeight}}),U.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),U.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&U.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),U}},{key:"encodeMiddleDigits",value:function(){var U=this.upcA[0],W=d[parseInt(this.upcA[this.upcA.length-1])][parseInt(U)];return(0,t.default)(this.middleDigits,W)}}]),P}(F.default);function f(_,P){for(var R=parseInt(_[_.length-1]),U=l[R],G="",W=0,$=0;$<U.length;$++){var le=U[$];G+="X"===le?_[W++]:le}return(G=""+P+G)+(0,b.checksum)(G)}S.default=n},2998:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SIDE_BIN="101",S.MIDDLE_BIN="01010",S.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"]},S.EAN2_STRUCTURE=["LL","LG","GL","GG"],S.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],S.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},188:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=T(2998);S.default=function(x,F,b){var E=x.split("").map(function(y,o){return L.BINARIES[F[o]]}).map(function(y,o){return y?y[x[o]]:""});if(b){var I=x.length-1;E=E.map(function(y,o){return o<I?y+b:y})}return E.join("")}},9214:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UPCE=S.UPC=S.EAN2=S.EAN5=S.EAN8=S.EAN13=void 0;var N=n(T(7674)),x=n(T(8036)),b=n(T(639)),I=n(T(2649)),o=n(T(2589)),d=n(T(2054));function n(f){return f&&f.__esModule?f:{default:f}}S.EAN13=N.default,S.EAN8=x.default,S.EAN5=b.default,S.EAN2=I.default,S.UPC=o.default,S.UPCE=d.default},6651:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.GenericBarcode=void 0;var y,L=function(){function y(o,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}return function(o,l,d){return l&&y(o.prototype,l),d&&y(o,d),o}}(),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l,d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),L(o,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),o}(((y=T(6615))&&y.__esModule?y:{default:y}).default);S.GenericBarcode=I},9237:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),N=T(7851);function b(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}function E(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}var y=function(o){function l(){return b(this,l),E(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var n=this,f=this.data.match(/.{2}/g).map(function(_){return n.encodePair(_)}).join("");return{data:N.START_BIN+f+N.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var f=N.BINARIES[n[1]];return N.BINARIES[n[0]].split("").map(function(_,P){return("1"===_?"111":"1")+("1"===f[P]?"000":"0")}).join("")}}]),l}(((o=T(6615))&&o.__esModule?o:{default:o}).default);S.default=y},6701:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),t=(o=T(9237))&&o.__esModule?o:{default:o},I=function(l){var d=l.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,f,_){return n+f*(3-_%2*2)},0);return 10*Math.ceil(d/10)-d},y=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),-1!==d.search(/^[0-9]{13}$/)&&(d+=I(d)),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===I(this.data)}}]),l}(t.default);S.default=y},7851:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.START_BIN="1010",S.END_BIN="11101",S.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},4059:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ITF14=S.ITF=void 0;var N=F(T(9237)),x=F(T(6701));function F(b){return b&&b.__esModule?b:{default:b}}S.ITF=N.default,S.ITF14=x.default},44:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var o,L=function(){function o(l,d){for(var n=0;n<d.length;n++){var f=d[n];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}return function(l,d,n){return d&&o(l.prototype,d),n&&o(l,n),l}}(),I=function(o){function l(d,n){return function(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function(o,l){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?o:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,n))}return function(o,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(o,l):o.__proto__=l)}(l,o),L(l,[{key:"encode",value:function(){for(var n="110",f=0;f<this.data.length;f++){var P=parseInt(this.data[f]).toString(2);P=y(P,4-P.length);for(var R=0;R<P.length;R++)n+="0"==P[R]?"100":"110"}return{data:n+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),l}(((o=T(6615))&&o.__esModule?o:{default:o}).default);function y(o,l){for(var d=0;d<l;d++)o="0"+o;return o}S.default=I},6926:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,N=(y=T(44))&&y.__esModule?y:{default:y},t=T(9122),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l+(0,t.mod10)(l),d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),o}(N.default);S.default=I},6375:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,N=(y=T(44))&&y.__esModule?y:{default:y},t=T(9122),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),l+=(0,t.mod10)(l),l+=(0,t.mod10)(l),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l,d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),o}(N.default);S.default=I},2558:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,N=(y=T(44))&&y.__esModule?y:{default:y},t=T(9122),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l+(0,t.mod11)(l),d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),o}(N.default);S.default=I},3332:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,N=(y=T(44))&&y.__esModule?y:{default:y},t=T(9122),I=function(y){function o(l,d){return function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o),l+=(0,t.mod11)(l),l+=(0,t.mod10)(l),function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l,d))}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),o}(N.default);S.default=I},9122:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.mod10=function(N){for(var t=0,x=0;x<N.length;x++){var F=parseInt(N[x]);t+=(x+N.length)%2==0?F:2*F%10+Math.floor(2*F/10)}return(10-t%10)%10},S.mod11=function(N){for(var t=0,x=[2,3,4,5,6,7],F=0;F<N.length;F++){var b=parseInt(N[N.length-1-F]);t+=x[F%x.length]*b}return(11-t%11)%11}},495:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.MSI1110=S.MSI1010=S.MSI11=S.MSI10=S.MSI=void 0;var N=l(T(44)),x=l(T(6926)),b=l(T(2558)),I=l(T(6375)),o=l(T(3332));function l(d){return d&&d.__esModule?d:{default:d}}S.MSI=N.default,S.MSI10=x.default,S.MSI11=b.default,S.MSI1010=I.default,S.MSI1110=o.default},4162:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.codabar=void 0;var y,L=function(){function y(o,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}return function(o,l,d){return l&&y(o.prototype,l),d&&y(o,d),o}}(),I=function(y){function o(l,d){(function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")})(this,o),0===l.search(/^[0-9\-\$\:\.\+\/]+$/)&&(l="A"+l+"A");var n=function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l.toUpperCase(),d));return n.text=n.options.text||n.text.replace(/[A-D]/g,""),n}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),L(o,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var d=[],n=this.getEncodings(),f=0;f<this.data.length;f++)d.push(n[this.data.charAt(f)]),f!==this.data.length-1&&d.push("0");return{text:this.text,data:d.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"}}}]),o}(((y=T(6615))&&y.__esModule?y:{default:y}).default);S.codabar=I},3413:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L=T(8104),N=T(6625),t=T(9214),x=T(4059),F=T(495),b=T(3133),E=T(4162),I=T(6651);S.default={CODE39:L.CODE39,CODE128:N.CODE128,CODE128A:N.CODE128A,CODE128B:N.CODE128B,CODE128C:N.CODE128C,EAN13:t.EAN13,EAN8:t.EAN8,EAN5:t.EAN5,EAN2:t.EAN2,UPC:t.UPC,UPCE:t.UPCE,ITF14:x.ITF14,ITF:x.ITF,MSI:F.MSI,MSI10:F.MSI10,MSI11:F.MSI11,MSI1010:F.MSI1010,MSI1110:F.MSI1110,pharmacode:b.pharmacode,codabar:E.codabar,GenericBarcode:I.GenericBarcode}},3133:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.pharmacode=void 0;var y,L=function(){function y(o,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}return function(o,l,d){return l&&y(o.prototype,l),d&&y(o,d),o}}(),I=function(y){function o(l,d){!function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(y,o){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?y:o}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,l,d));return n.number=parseInt(l,10),n}return function(y,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);y.prototype=Object.create(o&&o.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(y,o):y.__proto__=o)}(o,y),L(o,[{key:"encode",value:function(){for(var d=this.number,n="";!isNaN(d)&&0!=d;)d%2==0?(n="11100"+n,d=(d-2)/2):(n="100"+n,d=(d-1)/2);return{data:n=n.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),o}(((y=T(6615))&&y.__esModule?y:{default:y}).default);S.pharmacode=I},400:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function t(x,F){for(var b=0;b<F.length;b++){var E=F[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,F,b){return F&&t(x.prototype,F),b&&t(x,b),x}}(),N=function(){function t(x){(function(t,x){if(!(t instanceof x))throw new TypeError("Cannot call a class as a function")})(this,t),this.api=x}return T(t,[{key:"handleCatch",value:function(F){if("InvalidInputException"!==F.name)throw F;if(this.api._options.valid===this.api._defaults.valid)throw F.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(F){try{var b=F.apply(void 0,arguments);return this.api._options.valid(!0),b}catch(E){return this.handleCatch(E),this.api}}}]),t}();S.default=N},4779:(K,S)=>{"use strict";function T(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function L(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!E||"object"!=typeof E&&"function"!=typeof E?b:E}function N(b,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}Object.defineProperty(S,"__esModule",{value:!0});var t=function(b){function E(I,y){T(this,E);var o=L(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));return o.name="InvalidInputException",o.symbology=I,o.input=y,o.message='"'+o.input+'" is not a valid input for '+o.symbology,o}return N(E,Error),E}(),x=function(b){function E(){T(this,E);var I=L(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));return I.name="InvalidElementException",I.message="Not supported type to render on",I}return N(E,Error),E}(),F=function(b){function E(){T(this,E);var I=L(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));return I.name="NoElementException",I.message="No element to render on.",I}return N(E,Error),E}();S.InvalidInputException=t,S.InvalidElementException=x,S.NoElementException=F},7095:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function(L){return L.marginTop=L.marginTop||L.margin,L.marginBottom=L.marginBottom||L.margin,L.marginRight=L.marginRight||L.margin,L.marginLeft=L.marginLeft||L.margin,L}},7866:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=F(T(201)),x=F(T(1452));function F(E){return E&&E.__esModule?E:{default:E}}S.default=function(E){var I={};for(var y in x.default)x.default.hasOwnProperty(y)&&(E.hasAttribute("jsbarcode-"+y.toLowerCase())&&(I[y]=E.getAttribute("jsbarcode-"+y.toLowerCase())),E.hasAttribute("data-"+y.toLowerCase())&&(I[y]=E.getAttribute("data-"+y.toLowerCase())));return I.value=E.getAttribute("jsbarcode-value")||E.getAttribute("data-value"),(0,N.default)(I)}},4441:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(l){return typeof l}:function(l){return l&&"function"==typeof Symbol&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},t=E(T(7866)),F=E(T(1462)),b=T(4779);function E(l){return l&&l.__esModule?l:{default:l}}S.default=function I(l){if("string"==typeof l)return function(l){var d=document.querySelectorAll(l);if(0!==d.length){for(var n=[],f=0;f<d.length;f++)n.push(I(d[f]));return n}}(l);if(Array.isArray(l)){for(var d=[],n=0;n<l.length;n++)d.push(I(l[n]));return d}if("undefined"!=typeof HTMLCanvasElement&&l instanceof HTMLImageElement)return function(l){var d=document.createElement("canvas");return{element:d,options:(0,t.default)(l),renderer:F.default.CanvasRenderer,afterRender:function(){l.setAttribute("src",d.toDataURL())}}}(l);if(l&&l.nodeName&&"svg"===l.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&l instanceof SVGElement)return{element:l,options:(0,t.default)(l),renderer:F.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&l instanceof HTMLCanvasElement)return{element:l,options:(0,t.default)(l),renderer:F.default.CanvasRenderer};if(l&&l.getContext)return{element:l,renderer:F.default.CanvasRenderer};if(l&&"object"===(void 0===l?"undefined":L(l))&&!l.nodeName)return{element:l,renderer:F.default.ObjectRenderer};throw new b.InvalidElementException}},2308:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function(L){var N=[];return function t(x){if(Array.isArray(x))for(var F=0;F<x.length;F++)t(x[F]);else x.text=x.text||"",x.data=x.data||"",N.push(x)}(L),N}},7720:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var T=Object.assign||function(L){for(var N=1;N<arguments.length;N++){var t=arguments[N];for(var x in t)Object.prototype.hasOwnProperty.call(t,x)&&(L[x]=t[x])}return L};S.default=function(L,N){return T({},L,N)}},201:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function(L){var N=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in N)N.hasOwnProperty(t)&&"string"==typeof L[t=N[t]]&&(L[t]=parseInt(L[t],10));return"string"==typeof L.displayValue&&(L.displayValue="false"!=L.displayValue),L}},1452:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default={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(){}}},3010:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var I,L=function(){function I(y,o){for(var l=0;l<o.length;l++){var d=o[l];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(y,d.key,d)}}return function(y,o,l){return o&&I(y.prototype,o),l&&I(y,l),y}}(),t=(I=T(7720))&&I.__esModule?I:{default:I},x=T(9390),E=function(){function I(y,o,l){(function(I,y){if(!(I instanceof y))throw new TypeError("Cannot call a class as a function")})(this,I),this.canvas=y,this.encodings=o,this.options=l}return L(I,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var o=0;o<this.encodings.length;o++){var l=(0,t.default)(this.options,this.encodings[o].options);this.drawCanvasBarcode(l,this.encodings[o]),this.drawCanvasText(l,this.encodings[o]),this.moveCanvasDrawing(this.encodings[o])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var o=this.canvas.getContext("2d");o.save(),(0,x.calculateEncodingAttributes)(this.encodings,this.options,o);var l=(0,x.getTotalWidthOfEncodings)(this.encodings),d=(0,x.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=l+this.options.marginLeft+this.options.marginRight,this.canvas.height=d,o.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(o.fillStyle=this.options.background,o.fillRect(0,0,this.canvas.width,this.canvas.height)),o.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(o,l){var f,d=this.canvas.getContext("2d"),n=l.data;f="top"==o.textPosition?o.marginTop+o.fontSize+o.textMargin:o.marginTop,d.fillStyle=o.lineColor;for(var _=0;_<n.length;_++){var P=_*o.width+l.barcodePadding;"1"===n[_]?d.fillRect(P,f,o.width,o.height):n[_]&&d.fillRect(P,f,o.width,o.height*n[_])}}},{key:"drawCanvasText",value:function(o,l){var f,_,d=this.canvas.getContext("2d");o.displayValue&&(_="top"==o.textPosition?o.marginTop+o.fontSize-o.textMargin:o.height+o.textMargin+o.marginTop+o.fontSize,d.font=o.fontOptions+" "+o.fontSize+"px "+o.font,"left"==o.textAlign||l.barcodePadding>0?(f=0,d.textAlign="left"):"right"==o.textAlign?(f=l.width-1,d.textAlign="right"):(f=l.width/2,d.textAlign="center"),d.fillText(l.text,f,_))}},{key:"moveCanvasDrawing",value:function(o){this.canvas.getContext("2d").translate(o.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),I}();S.default=E},1462:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=E(T(3010)),x=E(T(5995)),b=E(T(3911));function E(I){return I&&I.__esModule?I:{default:I}}S.default={CanvasRenderer:N.default,SVGRenderer:x.default,ObjectRenderer:b.default}},3911:(K,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function t(x,F){for(var b=0;b<F.length;b++){var E=F[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,F,b){return F&&t(x.prototype,F),b&&t(x,b),x}}(),N=function(){function t(x,F,b){(function(t,x){if(!(t instanceof x))throw new TypeError("Cannot call a class as a function")})(this,t),this.object=x,this.encodings=F,this.options=b}return T(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();S.default=N},9390:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.getTotalWidthOfEncodings=S.calculateEncodingAttributes=S.getBarcodePadding=S.getEncodingHeight=S.getMaximumHeightOfEncodings=void 0;var o,N=(o=T(7720))&&o.__esModule?o:{default:o};function x(o,l){return l.height+(l.displayValue&&o.text.length>0?l.fontSize+l.textMargin:0)+l.marginTop+l.marginBottom}function F(o,l,d){if(d.displayValue&&l<o){if("center"==d.textAlign)return Math.floor((o-l)/2);if("left"==d.textAlign)return 0;if("right"==d.textAlign)return Math.floor(o-l)}return 0}function y(o,l,d){var n;if(d)n=d;else{if("undefined"==typeof document)return 0;n=document.createElement("canvas").getContext("2d")}n.font=l.fontOptions+" "+l.fontSize+"px "+l.font;var f=n.measureText(o);return f?f.width:0}S.getMaximumHeightOfEncodings=function(o){for(var l=0,d=0;d<o.length;d++)o[d].height>l&&(l=o[d].height);return l},S.getEncodingHeight=x,S.getBarcodePadding=F,S.calculateEncodingAttributes=function(o,l,d){for(var n=0;n<o.length;n++){var P,f=o[n],_=(0,N.default)(l,f.options);P=_.displayValue?y(f.text,_,d):0;var R=f.data.length*_.width;f.width=Math.ceil(Math.max(P,R)),f.height=x(f,_),f.barcodePadding=F(P,R,_)}},S.getTotalWidthOfEncodings=function(o){for(var l=0,d=0;d<o.length;d++)l+=o[d].width;return l}},5995:(K,S,T)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var y,L=function(){function y(o,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}return function(o,l,d){return l&&y(o.prototype,l),d&&y(o,d),o}}(),t=(y=T(7720))&&y.__esModule?y:{default:y},x=T(9390),E="http://www.w3.org/2000/svg",I=function(){function y(o,l,d){(function(y,o){if(!(y instanceof o))throw new TypeError("Cannot call a class as a function")})(this,y),this.svg=o,this.encodings=l,this.options=d,this.document=d.xmlDocument||document}return L(y,[{key:"render",value:function(){var l=this.options.marginLeft;this.prepareSVG();for(var d=0;d<this.encodings.length;d++){var n=this.encodings[d],f=(0,t.default)(this.options,n.options),_=this.createGroup(l,f.marginTop,this.svg);this.setGroupOptions(_,f),this.drawSvgBarcode(_,f,n),this.drawSVGText(_,f,n),l+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,x.calculateEncodingAttributes)(this.encodings,this.options);var l=(0,x.getTotalWidthOfEncodings)(this.encodings),d=(0,x.getMaximumHeightOfEncodings)(this.encodings),n=l+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,d),this.options.background&&this.drawRect(0,0,n,d,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(l,d,n){var _,f=n.data;_="top"==d.textPosition?d.fontSize+d.textMargin:0;for(var P=0,R=0,U=0;U<f.length;U++)R=U*d.width+n.barcodePadding,"1"===f[U]?P++:P>0&&(this.drawRect(R-d.width*P,_,d.width*P,d.height,l),P=0);P>0&&this.drawRect(R-d.width*(P-1),_,d.width*P,d.height,l)}},{key:"drawSVGText",value:function(l,d,n){var _,P,f=this.document.createElementNS(E,"text");d.displayValue&&(f.setAttribute("style","font:"+d.fontOptions+" "+d.fontSize+"px "+d.font),P="top"==d.textPosition?d.fontSize-d.textMargin:d.height+d.textMargin+d.fontSize,"left"==d.textAlign||n.barcodePadding>0?(_=0,f.setAttribute("text-anchor","start")):"right"==d.textAlign?(_=n.width-1,f.setAttribute("text-anchor","end")):(_=n.width/2,f.setAttribute("text-anchor","middle")),f.setAttribute("x",_),f.setAttribute("y",P),f.appendChild(this.document.createTextNode(n.text)),l.appendChild(f))}},{key:"setSvgAttributes",value:function(l,d){var n=this.svg;n.setAttribute("width",l+"px"),n.setAttribute("height",d+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+l+" "+d),n.setAttribute("xmlns",E),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(l,d,n){var f=this.document.createElementNS(E,"g");return f.setAttribute("transform","translate("+l+", "+d+")"),n.appendChild(f),f}},{key:"setGroupOptions",value:function(l,d){l.setAttribute("style","fill:"+d.lineColor+";")}},{key:"drawRect",value:function(l,d,n,f,_){var P=this.document.createElementNS(E,"rect");return P.setAttribute("x",l),P.setAttribute("y",d),P.setAttribute("width",n),P.setAttribute("height",f),_.appendChild(P),P}}]),y}();S.default=I},4469:(K,S,T)=>{"use strict";T.r(S),T.d(S,{PagesModule:()=>Ae});var L=T(6019),N=T(1086),t=T(3668),x=T(4099),F=T(8735);let b=(()=>{class w{constructor(){this.store=new x.X([])}getState(){return this.store.asObservable().pipe((0,F.h)(u=>void 0!==u))}setState(u){this.store.next(u)}}return w.\u0275fac=function(u){return new(u||w)},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})();var E=T(1286),I=T(1273),y=T(3405),o=T(8805);let l=(()=>{class w{static StringFormat(u,...h){for(let O=0;O<h.length;O++)u=u.replace(`{${O}}`,h[O]);return u}static IsNotEmpty(u){return""!=u&&u!=w.GuidEmpty&&null!=u&&null!=u}static IsEmpty(u){return""==u||null==u||null==u||u==w.GuidEmpty}static FilterByID(u,h){try{const O=u.filter(D=>D.ID==h);if(O.length>0)return O[0]}catch(O){console.log("error filter")}return null}static DateOnly(u){return u?new Date(new Date(u).toDateString()):new Date((new Date).toDateString())}}return w.GuidEmpty="00000000-0000-0000-0000-000000000000",w.DecimalMinValue="-7.922816251426434e+28",w.InputLockTimeSpan=500,w.MinDate="0001-01-01T00:00:00",w.MinTime="00:00:00",w})();var P=(()=>{return(w=P||(P={}))[w.SUPPLIER_BILL=0]="SUPPLIER_BILL",w[w.OUTLET_DELIVERY=1]="OUTLET_DELIVERY",P;var w})(),R=T(5304),U=T(2193),G=T(9090),W=T(5496),$=T(9010);let le=(()=>{class w{constructor(u,h){this.data=u,this.dialogRef=h,this.outlets=u.outlets}ngOnInit(){this.initModalConfig(),this.initTransactionType()}initModalConfig(){this.modalConfig=new U.O,this.modalConfig.title="Choose your transaction",this.modalConfig.hideMoreButton=!0}initTransactionType(){this.transactionTypes=[{title:"Supplier Bill",type:P.SUPPLIER_BILL},{title:"Outlet Delivery",type:P.OUTLET_DELIVERY}]}onOk(){this.selectedOutlet&&this.poNumber&&this.dialogRef.close({Outlet:this.selectedOutlet.getName,Number:this.poNumber,Type:this.selectedTransactionType})}onCancel(){this.dialogRef.close()}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.WI),t.Y36(R.so))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-form-add-bill"]],decls:16,vars:10,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["bindLabel","title","bindValue","type","placeholder","Choose Type",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"pt-6"],["bindLabel","Name","placeholder","Choose Outlet",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"form-label-group"],["min","1","id","qty","type","text","placeholder","Number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"]],template:function(u,h){1&u&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return h.onOk()})("onCancel",function(){return h.onCancel()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"table",3),t.TgZ(5,"tbody"),t.TgZ(6,"tr",4),t.TgZ(7,"td"),t.TgZ(8,"ng-select",5),t.NdJ("ngModelChange",function(D){return h.selectedTransactionType=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(9,"tr",4),t.TgZ(10,"td",6),t.TgZ(11,"ng-select",7),t.NdJ("ngModelChange",function(D){return h.selectedOutlet=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"tr",4),t.TgZ(13,"td",6),t.TgZ(14,"div",8),t.TgZ(15,"input",9),t.NdJ("ngModelChange",function(D){return h.poNumber=D}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.Q6J("config",h.modalConfig),t.xp6(8),t.Q6J("items",h.transactionTypes)("ngModel",h.selectedTransactionType)("clearable",!1)("appendTo","body"),t.xp6(3),t.Q6J("items",h.outlets)("ngModel",h.selectedOutlet)("clearable",!1)("appendTo","body"),t.xp6(4),t.Q6J("ngModel",h.poNumber))},directives:[G.M,W.w9,$.JJ,$.On,$.Fj],styles:[""]}),w})();var re=T(1366),te=T(8053),ce=T(8930);let H=(()=>{class w{constructor(u){this.httpService=u,this.barcodeConfigState=new x.X(null)}updatePaperFormatConfig(u){let h=localStorage.getItem("Domain");return this.httpService.post("/api/Config/SaveConfig",{SubDomain:h,Version:this.paperFormatVersion,PaperFormats:u})}getPaperFormatConfig(){let u=localStorage.getItem("Domain"),h=[];return this.httpService.post("/api/Config/PaperConfig",{SubDomain:u}).pipe((0,te.U)(J=>(this.paperFormatVersion=J.version,h=J.PaperFormats,h)))}setBarcodeConfigState(u){this.barcodeConfigState.next(u)}getBarcodeConfigState(){return this.barcodeConfigState.asObservable().pipe((0,F.h)(u=>l.IsNotEmpty(u)))}}return w.\u0275fac=function(u){return new(u||w)(t.LFG(ce.O))},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})();var k=T(4522);class ee{constructor(A){A&&(this.AccountID=A.AccountID,this.CalculationTypeID=A.CalculationTypeID,this.ID=A.ID,this.Index=A.Index,this.Label=A.Label,this.MultipleTaxTypeID=A.MultipleTaxTypeID,this.Note=A.Note,this.PrintVisible=A.PrintVisible,this.Rate=A.Rate,this.TypeID=A.TypeID,this.Name=A.Name,this.Type=A.Type)}get getID(){return this.ID}get getType(){return this.Type}get getName(){return this.Name}get getAccountID(){return this.AccountID}set setAccountId(A){this.AccountID=A}get getCalculationTypeID(){return this.CalculationTypeID}set setCalculationID(A){this.CalculationTypeID=A}get getRate(){return this.Rate}set setRate(A){this.Rate=A}get getLabel(){return this.Label}}class Q{get getID(){return this.ID}set setID(A){this.ID=A}get getSelectedPromotion(){return this.SelectedPromotion}set setSelectedPromotion(A){this.SelectedPromotion=A}get getDescription(){return this.description}set setDescription(A){this.description=A}set setBarcodeTitle(A){this.barcodeTitle=A}get getBarcodeTitle(){return this.barcodeTitle}set setCustomPrice(A){this.customPrice=A}get getCustomPrice(){return this.customPrice}get getUnitPrice(){return this.UnitPrice}set setUnitPrice(A){this.UnitPrice=A}get getCode(){return this.Code}set setCode(A){this.barcodeTitle=A,this.Code=A}get getModel(){return this.Model}set setModel(A){this.Model=A}get getName(){return this.Name}set setName(A){this.Name=A}get getCurrency(){return this.CurrencySymbol}set setCurrency(A){this.CurrencySymbol=A}}class Y{get getCode(){return this.Code}get getName(){return this.Name}get getSuspended(){return this.Suspended}set setCode(A){this.Code=A}set setName(A){this.Name=A}set setSuspended(A){this.Suspended=A}}class oe{get getOutlet(){return this.Outlet}get getNumber(){return this.Number}get getDate(){return this.Date}get getDueDate(){return this.DueDate}get getSupplier(){return this.Supplier}get getCreatorID(){return this.CreatorID}get getCreated(){return this.Created}get getDiscount1(){return this.Discount1}get getDiscountAmount(){return this.DiscountAmount}get getGross(){return this.Gross}get getDiscountTotal(){return this.DiscountTotal}get getTaxType(){return this.TaxType}get getTax(){return this.Tax}get getPurchase(){return this.Purchase}get getPurchaseNTax(){return this.PurchaseNTax}get getDelivery(){return this.Delivery}get getVariants(){return this.Variants}get getPayments(){return this.Payments}set setOutlet(A){this.Outlet=A}set setNumber(A){this.Number=A}set setDate(A){this.Date=A}set setDueDate(A){this.DueDate=A}set setSupplier(A){this.Supplier=A}set setCreatorID(A){this.CreatorID=A}set setCreated(A){this.Created=A}set setDiscount1(A){this.Discount1=A}set setDiscountAmount(A){this.DiscountAmount=A}set setGross(A){this.Gross=A}set setDiscountTotal(A){this.DiscountTotal=A}set setTaxType(A){this.TaxType=A}set setTax(A){this.Tax=A}set setPurchase(A){this.Purchase=A}set setPurchaseNTax(A){this.PurchaseNTax=A}set setDelivery(A){this.Delivery=A}set setVariants(A){this.Variants=A}set setPayments(A){this.Payments=A}}class Pe extends Q{constructor(){super()}get getVariantID(){return this.VariantID}get getQuantity(){return this.Quantity}get getPrice(){return this.Price}get getDiscount(){return this.Discount}get getNettPrice(){return this.NettPrice}set setVariantID(A){this.VariantID=A}set setQuantity(A){this.Quantity=A}set setPrice(A){this.Price=A}set setDiscount(A){this.Discount=A}set setNettPrice(A){this.NettPrice=A}}class ye{get getID(){return this.ID}set setID(A){this.ID=A}get getName(){return this.Name}set setName(A){this.Name=A}get getDiscount(){return this.Discount}get getExtraCost(){return this.ExtraCost}get getPromotionID(){return this.PromotionID}get getUnitPrice(){return this.UnitPrice}set setDiscount(A){this.Discount=A}set setExtraCost(A){this.ExtraCost=A}set setPromotionID(A){this.PromotionID=A}set setUnitPrice(A){this.UnitPrice=A}}let pe=(()=>{class w{constructor(){}getProductModel(u){let h=new Q;return h.setID=u.ID,h.setCode=u.Code,h.setCurrency=u.CurrencySymbol,h.setModel=u.Model,h.setName=u.Name,h.setUnitPrice=u.UnitPrice,h.setDescription=u.Description,h}getTaxModel(u){return new ee(u)}getOutletModel(u){let h=new Y;return h.setCode=u.Code,h.setName=u.Name,h.setSuspended=u.Suspended,h}getVariantModel(u){let h=new Pe;return h.setCode=u.Code,h.setDiscount=u.Discount,h.setNettPrice=u.NettPrice,h.setPrice=u.Price,h.setUnitPrice=u.UnitPrice,h.setQuantity=u.Quantity,h.setVariantID=u.VariantID,h.setName=u.Name,h}getBillModel(u){let h=new oe;return h.setNumber=u.Number,h.setOutlet=u.Outlet,h.setVariants=u.Variants?u.Variants.map(O=>this.getVariantModel(O)):[],h}getPromotionModel(u){let h=new ye;return h.setDiscount=u.Discount,h.setExtraCost=u.ExtraCost,h.setPromotionID=u.PromotionID,h.setUnitPrice=u.UnitPrice,h.setName=u.Name,h.setID=u.ID,h}}return w.\u0275fac=function(u){return new(u||w)},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})(),we=(()=>{class w{constructor(u,h,O){this.httpService=u,this.http=h,this.factoryService=O}getProductById(u){let h=localStorage.getItem("Domain");return this.httpService.post(`https://${h}/API/V3/Variant/ID`,{ID:u}).pipe((0,te.U)(O=>this.factoryService.getProductModel(O)))}getPromotionByProducID(u){let h=localStorage.getItem("Domain");return this.httpService.post(`https://${h}/API/v3/PromotionEvent/GetByVariantID`,{VariantID:u}).pipe((0,te.U)(O=>O.map(J=>this.factoryService.getPromotionModel(J))))}uploadProducts(u){let h=localStorage.getItem("Domain"),O=new FormData;return O.append("file",u,u.name),this.httpService.postFormData(`https://${h}/API/Product/UploadCSVforBarcode`,O).pipe((0,te.U)(D=>D.map(J=>(J.Print=J.Print.map(ie=>this.factoryService.getProductModel(ie)),J))))}getTax(){let u=localStorage.getItem("Domain"),h=localStorage.getItem("Token"),O=`https://${u}/API/V3/Tax`,D=new k.WM({authorization:"Bearer "+h,"content-type":"application/json","X-ClientId":"dealpos-app"});return this.http.get(O,{headers:D}).pipe((0,te.U)(J=>{if(J)return J.map(ie=>this.factoryService.getTaxModel(ie))}))}}return w.\u0275fac=function(u){return new(u||w)(t.LFG(ce.O),t.LFG(k.eN),t.LFG(pe))},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})();var Se=T(8076),me=T(5686),Ce=T(6731);const Oe=["input"];function xe(w,A){if(1&w&&t._UZ(0,"img",10),2&w){const u=t.oxw().$implicit;t.Q6J("src",u.ImgUrl,t.LSH)}}function Fe(w,A){if(1&w){const u=t.EpF();t.TgZ(0,"mat-option",8),t.NdJ("click",function(O){const J=t.CHM(u).$implicit;return t.oxw().changeDisplayName(J),O.stopPropagation()}),t.YNc(1,xe,1,1,"img",9),t._uU(2),t.qZA()}if(2&w){const u=A.$implicit,h=t.oxw();t.Q6J("value",u),t.xp6(1),t.Q6J("ngIf",h.renderThumbnail&&u.ImgUrl),t.xp6(1),t.hij(" ",u.Value," ")}}let Le=(()=>{class w{constructor(u,h){this.httpService=u,this.ngZone=h,this.offlineStorage=[],this.inputLock=!1,this.renderThumbnail=!1,this.onOffline=new t.vpe,this.onEnter=new t.vpe,this.onSelect=new t.vpe,this.onOptionSelect=new t.vpe,this.reset=new t.vpe,this.termControl=new $.NI(""),this.options=[],this.complete=!1,this.foundProduct=!1,this.propagateChange=O=>{},this.termControl.valueChanges.pipe((0,me.b)(500)).subscribe(O=>{this.options=[],"object"==typeof O?(this.value=O.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(O.Value),this.complete=!0),this.onSelect&&this.onSelect.emit(O.Key),this.options=[],"object"==typeof O&&(this.value=O.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(O.Value),this.complete=!0),this.onOptionSelect)&&this.onOptionSelect.emit(JSON.stringify({Key:O.Key,Value:O.Value}))):"string"==typeof O&&O.length>0?O.length>2&&!this.inputLock&&this.search(O):this.clear()})}set display(u){this.input.nativeElement.value=u}get value(){return this._value}set value(u){this._value=u,this.propagateChange(this._value)}ngOnChanges(u){null!=u.ngModel&&null==u.ngModel.currentValue&&this.clear(),null!=u.display&&u.display.currentValue!=u.display.previousValue&&this.termControl.setValue(u.display.currentValue)}ngAfterViewInit(){}search(u){if(this.termControl.value.length>0){let h={};if(this.data&&(h=this.data),h.prefix=u,h.count=100,this.complete)this.complete=!1;else{let O=this.url,D=localStorage.getItem("Domain");D&&(O=`https://${D}${this.url}`),this.httpService.post(O,h).subscribe(J=>{this.options=J,this.foundProduct=this.options.length>0})}}else this.options=null}onblur(){setTimeout(()=>{},600)}changeDisplayName(u){this.input.nativeElement.value=u.Value}onKeydown(u){const h=u.key;"Enter"===h?(this.clearOnSelect&&this.clear(),!this.foundProduct&&this.termControl.value.length>0&&(this.onEnter.emit(this.termControl.value),u.stopPropagation()),null!=this.termControl.value&&(this.input.nativeElement.value=this.termControl.value.Value),this.foundProduct=!1):(this.inputLock&&("Backspace"===h?this.clear():this.validateInputLock()),this.complete=!1,this.reset.emit())}validateInputLock(){""==this.input.nativeElement.value||0==this.input.nativeElement.value.length?this.startInput=new Date:(new Date).getTime()-this.startInput.getTime()>500&&this.clear()}clear(){this.value=null,this.input.nativeElement.value=""}displayFn(u){return u&&u.Value}writeValue(u){}registerOnChange(u){this.propagateChange=u}registerOnTouched(){}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(ce.O),t.Y36(t.R0b))},w.\u0275cmp=t.Xpm({type:w,selectors:[["autocomplete"]],viewQuery:function(u,h){if(1&u&&t.Gf(Oe,7),2&u){let O;t.iGM(O=t.CRH())&&(h.input=O.first)}},inputs:{placeholder:"placeholder",url:"url",clearOnSelect:"clearOnSelect",offlineStorage:"offlineStorage",inputLock:"inputLock",data:"data",renderThumbnail:"renderThumbnail",ngModel:"ngModel",displayText:"displayText",localStorage:"localStorage",_value:"_value",display:"display"},outputs:{onOffline:"onOffline",onEnter:"onEnter",onSelect:"onSelect",onOptionSelect:"onOptionSelect",reset:"reset"},features:[t._Bn([{provide:$.JU,useExisting:(0,t.Gpc)(()=>w),multi:!0}]),t.TTD],decls:9,vars:5,consts:[[1,"w-100"],[1,"form-label-group"],["id","input","type","text","matInput","",1,"form-control","text-black",3,"matAutocomplete","placeholder","formControl","paste","keydown","blur"],["input",""],["for","input"],["autoActiveFirstOption","true"],["autocomplete","matAutocomplete"],["class","option-autocomplete",3,"value","click",4,"ngFor","ngForOf"],[1,"option-autocomplete",3,"value","click"],["width","30","height","30",3,"src",4,"ngIf"],["width","30","height","30",3,"src"]],template:function(u,h){if(1&u&&(t.TgZ(0,"mat-form-field",0),t.TgZ(1,"div",1),t.TgZ(2,"input",2,3),t.NdJ("paste",function(D){return h.inputLock?D.preventDefault():""})("keydown",function(D){return h.onKeydown(D)})("blur",function(){return h.onblur()}),t.qZA(),t.TgZ(4,"label",4),t._uU(5),t.qZA(),t.qZA(),t.qZA(),t.TgZ(6,"mat-autocomplete",5,6),t.YNc(8,Fe,3,3,"mat-option",7),t.qZA()),2&u){const O=t.MAs(7);t.xp6(2),t.s9C("placeholder",h.placeholder||""),t.Q6J("matAutocomplete",O)("formControl",h.termControl),t.xp6(3),t.Oqu(h.placeholder||""),t.xp6(3),t.Q6J("ngForOf",h.options)}},directives:[Se.ZL,$.Fj,$.JJ,$.oH,Se.XC,L.sg,Ce.ey,L.O5],styles:["mat-option[_ngcontent-%COMP%]{font-size:12px}"]}),w})(),Me=(()=>{class w{}return w.\u0275fac=function(u){return new(u||w)},w.\u0275mod=t.oAB({type:w}),w.\u0275inj=t.cJS({imports:[[Se.Bb,L.ez,$.UX]]}),w})();var Te=T(1813);let Ie=(()=>{class w{constructor(u){this.elementRef=u,this.decimalPlaces=4,this.modifyValueOnWheel=!0,this.max="999999999999999.9999",this.min="-999999999999999.9999",this.propagateChange=O=>{},this.preventNegative=!1,this.numericElement=new Te(this.elementRef.nativeElement,null,{digitGroupSeparator:",",decimalCharacter:".",decimalPlaces:this.decimalPlaces,maximumValue:this.max,minimumValue:this.min,allowDecimalPadding:!1,showWarnings:!1})}set _max(u){u&&(this.max=u,this.updateNumericSettings())}set _min(u){u&&(this.min=u,this.updateNumericSettings())}ngOnInit(){""==this.percentage&&(this.max="100"),this.preventNegative&&(this.min="0.00"),this.updateNumericSettings()}updateNumericSettings(){const u={maximumValue:this.max,minimumValue:this.min,readOnly:this.isElementDisabled(),decimalPlaces:this.decimalPlaces,modifyValueOnWheel:this.modifyValueOnWheel};this.numericElement.update(u)}onKeyUp(){let u=this.numericElement.getNumber();this.propagateChange(u)}isElementDisabled(){let u=!1;return(!0===this.elementRef.nativeElement.readOnly||!0===this.elementRef.nativeElement.disabled)&&(u=!0),u}writeValue(u){null!=u&&this.numericElement.set(u)}registerOnChange(u){this.propagateChange=u}registerOnTouched(){}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(t.SBq))},w.\u0275dir=t.lG2({type:w,selectors:[["","autoNum",""]],hostBindings:function(u,h){1&u&&t.NdJ("keyup",function(){return h.onKeyUp()})},inputs:{percentage:"percentage",preventNegative:"preventNegative",decimalPlaces:"decimalPlaces",modifyValueOnWheel:"modifyValueOnWheel",_max:["max","_max"],_min:["min","_min"]},features:[t._Bn([{provide:$.JU,useExisting:(0,t.Gpc)(()=>w),multi:!0}])]}),w})(),de=(()=>{class w{constructor(u,h,O,D,J){this.dialogRef=u,this.barcodeService=h,this.productService=O,this.authenticationService=D,this.data=J,this.modalConfig=new U.O,this.variantName="",this.hasProductEdit=!0,this.hasPromotion=!1,this.destroy$=new y.xQ,this.variantName=J.variantName,this.qty=J.qty,this.customPrice=J.customPrice}ngOnInit(){this.getBarcodeConfig(),this.initModalConfig(),this.initProductUpdate(),this.initRoleProductEdit()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initRoleProductEdit(){let u=this.authenticationService.getRoles();this.hasProductEdit=-1!==u.findIndex(h=>"ProdE"==h)}initProductUpdate(){l.IsNotEmpty(this.data.variantId)&&this.getProductById(this.data.variantId).subscribe(u=>{this.product.setSelectedPromotion=this.data.promotion,this.hasPromotion=l.IsNotEmpty(this.data.promotion)})}getBarcodeConfig(){this.barcodeService.getBarcodeConfigState().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&(this.paperFormat=u)})}initModalConfig(){this.modalConfig.title="Add New Product Barcode?",this.modalConfig.hideMoreButton=!0}onSelectProduct(u){this.getProductById(u).subscribe(h=>{this.customPrice=h.getUnitPrice,this.hasPromotion=!1,this.product.setSelectedPromotion=null})}getProductById(u){return this.productService.getProductById(u).pipe((0,re.b)(h=>{this.product=h,this.getPromotionByProductID(u)}))}getPromotionByProductID(u){this.productService.getPromotionByProducID(u).subscribe(h=>{this.promotions=h})}onCustomPriceChange(u){this.customPrice=u}onSelectPromotion(u){u?(this.product.setSelectedPromotion=this.promotions.find(h=>h.getName==(null==u?void 0:u.getName)),this.customPrice=this.product.getUnitPrice,this.hasPromotion=l.IsNotEmpty(this.product.getSelectedPromotion)):(this.hasPromotion=!1,this.product.setSelectedPromotion=null)}onOk(){this.qty&&this.qty>0&&this.product&&this.dialogRef.close({customPrice:this.customPrice,product:this.product,quantity:this.qty})}onCancel(){this.dialogRef.close()}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.so),t.Y36(H),t.Y36(we),t.Y36(E.$),t.Y36(R.WI))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-form-add-variant"]],features:[t._Bn([L.JJ])],decls:24,vars:7,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["placeholder","Name","url","/API/AC/GetVariantSuggestionByCodeNName",3,"display","onSelect"],[1,"form-label-group"],["id","qty","type","text","placeholder","Quantity","aria-label","width","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","qty"],[1,"pb-9"],["bindLabel","Name","bindValue","PromotionID","appendTo","body","placeholder","Select Promotion Price",1,"sticky-top","tall",3,"items","ngModel","change"],["placeholder","Price","aria-label","width","autoNum","",1,"form-control",3,"ngModel","readonly","ngModelChange"],["for","price"]],template:function(u,h){1&u&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return h.onOk()})("onCancel",function(){return h.onCancel()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"table",3),t.TgZ(5,"tbody"),t.TgZ(6,"tr",4),t.TgZ(7,"td"),t.TgZ(8,"autocomplete",5),t.NdJ("onSelect",function(D){return h.onSelectProduct(D)}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(9,"tr",4),t.TgZ(10,"td"),t.TgZ(11,"div",6),t.TgZ(12,"input",7),t.NdJ("ngModelChange",function(D){return h.qty=D}),t.qZA(),t.TgZ(13,"label",8),t._uU(14,"Quantity"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(15,"tr",4),t.TgZ(16,"td",9),t.TgZ(17,"ng-select",10),t.NdJ("change",function(D){return h.onSelectPromotion(D)}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(18,"tr",4),t.TgZ(19,"td"),t.TgZ(20,"div",6),t.TgZ(21,"input",11),t.NdJ("ngModelChange",function(D){return h.onCustomPriceChange(D)}),t.qZA(),t.TgZ(22,"label",12),t._uU(23,"Price"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.Q6J("config",h.modalConfig),t.xp6(8),t.Q6J("display",h.variantName),t.xp6(4),t.Q6J("ngModel",h.qty),t.xp6(5),t.Q6J("items",h.promotions)("ngModel",null==h.product||null==h.product.getSelectedPromotion?null:h.product.getSelectedPromotion.getPromotionID),t.xp6(4),t.Q6J("ngModel",h.customPrice)("readonly",h.hasPromotion||!h.hasProductEdit))},directives:[G.M,Le,$.Fj,Ie,$.JJ,$.On,W.w9],styles:[""]}),w})(),ke=(()=>{class w{constructor(u,h){this.dialogRef=u,this.data=h,this.event=new t.vpe,this.modalConfig=new U.O}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig.title="Upload New Product Barcode?",this.modalConfig.hideMoreButton=!0}onOk(){this.dialogRef.close(this.files)}onCancel(){this.dialogRef.close()}onUploadFile(u){u&&(this.files=u.target.files)}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.so),t.Y36(R.WI))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-form-upload-variant"]],outputs:{event:"event"},decls:15,vars:1,consts:[[3,"config","onOk","onCancel"],[1,"row"],[1,"col-sm-12"],["href","//res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv"],[1,"value-title"],["type","file","aria-label","upload",3,"change"]],template:function(u,h){1&u&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return h.onOk()})("onCancel",function(){return h.onCancel()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Download Sample CSV"),t.qZA(),t.TgZ(6,"table"),t.TgZ(7,"tbody"),t.TgZ(8,"tr"),t.TgZ(9,"th",4),t._uU(10,"CSV File"),t.qZA(),t.TgZ(11,"td"),t._uU(12,":"),t.qZA(),t.TgZ(13,"td"),t.TgZ(14,"input",5),t.NdJ("change",function(D){return h.onUploadFile(D)}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&t.Q6J("config",h.modalConfig)},directives:[G.M],styles:[""]}),w})();var _e=T(8452);let Ve=(()=>{class w{constructor(u,h){this.httpService=u,this.factoryService=h}get(){let h=localStorage.getItem("Domain");return this.httpService.post(`https://${h}/api/v3/Outlet/p`,{Suspended:!1}).pipe((0,te.U)(O=>{let D=[];return O&&(D=O.map(J=>this.factoryService.getOutletModel(J))),D}))}}return w.\u0275fac=function(u){return new(u||w)(t.LFG(ce.O),t.LFG(pe))},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})(),Re=(()=>{class w{constructor(u,h){this.httpService=u,this.factoryService=h}get(u){let h=localStorage.getItem("Domain"),O=this.getEndPointByType(u.Type);return this.httpService.post(`https://${h}${O}`,{Outlet:u.Outlet,Number:u.Number}).pipe((0,te.U)(J=>J.map(ie=>this.factoryService.getVariantModel(ie))))}getEndPointByType(u){let h;return h=u===P.SUPPLIER_BILL?"/API/V3/Barcode/byBillNumber":"/API/V3/Barcode/byOutletDeliveryNumber",h}}return w.\u0275fac=function(u){return new(u||w)(t.LFG(ce.O),t.LFG(pe))},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})();function Ze(w,A){if(1&w){const u=t.EpF();t.TgZ(0,"tr",18),t.NdJ("click",function(){const O=t.CHM(u),D=O.$implicit,J=O.index;return t.oxw().onUpdateProduct(D,J)}),t.TgZ(1,"td"),t.TgZ(2,"i",19),t.NdJ("click",function(){const D=t.CHM(u).index;return t.oxw().onDeleteProduct(D)}),t.qZA(),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",20),t._uU(6),t.qZA(),t.qZA()}if(2&w){const u=A.$implicit;t.xp6(4),t.AsE(" ",null==u||null==u.Variants[0]?null:u.Variants[0].getName,"- ",null==u||null==u.Variants[0]?null:u.Variants[0].getCode," - "),t.xp6(2),t.Oqu(null==u?null:u.Quantity)}}let De=(()=>{class w{constructor(u,h,O,D,J,ie,be){this.dialog=u,this.productStateService=h,this.productService=O,this.toastService=D,this.queryParamService=J,this.outletService=ie,this.billService=be,this.destroy$=new y.xQ,this.stickerTotal=0,this.productGroups=[],this.productSource=[],this.getRouteParam(),this.initOutlets()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getRouteParam(){this.queryParamService.getState().pipe((0,o.R)(this.destroy$),(0,F.h)(u=>l.IsEmpty(u))).subscribe(u=>{u.ID&&this.getProductById(u.ID,5),u.billNumber&&this.getBill({Number:u.billNumber,Outlet:u.outletName,Type:P.SUPPLIER_BILL})})}initOutlets(){this.outletService.get().pipe((0,o.R)(this.destroy$)).subscribe(u=>{this.outlets=u})}onAddBill(){this.dialog.open(le,{width:"350px",data:{outlets:this.outlets}}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&this.getBill(u)})}getBill(u){this.billService.get(u).pipe((0,o.R)(this.destroy$)).subscribe(h=>{h&&h.forEach(O=>{this.checkAvailableProductCode(O);let D=this.generateProductByQty(O,O.getQuantity);this.productGroups=[...this.productGroups,{VariantID:O.getVariantID,Quantity:O.getQuantity,Variants:D}],this.updateProductsSource()})})}onAddProduct(){this.dialog.open(de,{width:"350px",data:{variantName:"",variantId:null,qty:null}}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&(this.customPrice=u.customPrice,this.generateProductBarcode(u.product,u.quantity))})}getProductById(u,h){this.productService.getProductById(u).pipe((0,o.R)(this.destroy$)).subscribe(O=>{O&&this.generateProductBarcode(O,h)})}generateProductBarcode(u,h){this.checkAvailableProductCode(u);let O=this.generateProductByQty(u,h);O=this.updateCustomPriceProducts(O),this.productGroups=[...this.productGroups,{VariantID:u.getID,Quantity:h,Variants:O}],this.updateProductsSource()}checkAvailableProductCode(u){u.getCode||this.toastService.error("Product has no code","Code Not Found")}onUpdateProduct(u,h){this.dialog.open(de,{width:"350px",data:{variantName:u.Variants[0].getName+" - "+u.Variants[0].getCode,variantId:u.VariantID,qty:u.Quantity,customPrice:u.Variants[0].getCustomPrice,promotion:u.Variants[0].getSelectedPromotion}}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(he=>{if(he){this.customPrice=he.customPrice,this.checkAvailableProductCode(he.product);let ue=this.generateProductByQty(he.product,he.quantity);ue=this.updateCustomPriceProducts(ue),this.productGroups[h].Variants=ue,this.productGroups[h].Quantity=he.quantity,this.productGroups[h].VariantID=he.product.getID,this.updateProductsSource()}})}onDeleteProduct(u){this.productGroups=this.productGroups.filter((h,O)=>O!==u),this.updateProductsSource()}updateProductsSource(){this.productSource=[],this.productGroups.forEach(u=>{this.productSource=[...this.productSource,...u.Variants]}),this.stickerTotal=this.productSource.length,this.productStateService.setState(this.productSource)}onUploadProduct(){this.dialog.open(ke,{width:"350px"}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(u=>{if(u){let h;this.productService.uploadProducts(u[0]).pipe((0,o.R)(this.destroy$)).subscribe(O=>{O&&(this.productGroups=[...this.productGroups,...O.map(D=>(h={Quantity:D.Quantity,VariantID:D.VariantID,Variants:D.Print},h))],this.updateProductsSource())})}})}updateCustomPriceProducts(u){let h=u;return this.customPrice&&(h=u.map(O=>(O.setCustomPrice=this.customPrice,O))),h}generateProductByQty(u,h){let O=[];for(let D=1;D<=h;D++)O.push(u);return O}onClear(){this.productGroups=[],this.updateProductsSource()}onPrint(){window.print()}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.uw),t.Y36(b),t.Y36(we),t.Y36(_e._W),t.Y36(I.U),t.Y36(Ve),t.Y36(Re))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-list-products"]],decls:29,vars:2,consts:[[1,"card","mt-3","sticky-top"],[1,"card-header","d-flex","justify-content-between","align-items-center","bg-white","pb-5",2,"border","none"],[1,"font-weight-light","m-1"],[1,"ml-1","font-italic","text-info","d-block","mt-1"],[1,"btn-group"],["type","button",1,"btn-md","btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-cart-plus"],["aria-hidden","true",1,"fa","fa-plus"],["aria-hidden","true",1,"fa","fa-upload"],[1,"card-body","py-0"],[1,"table","table-fixed"],[1,"thead-light","lh-1"],["scope","col"],["scope","col",1,"text-right"],[3,"click",4,"ngFor","ngForOf"],[1,"card-footer","d-flex","justify-content-end","bg-white"],[1,"btn","btn-lg","btn-outline-secondary","ml-5",3,"click"],[1,"btn","btn-lg","btn-success","ml-5",3,"click"],[3,"click"],["aria-hidden","true",1,"fa","fa-times",2,"color","#fb404b !important","cursor","pointer",3,"click"],[1,"text-right"]],template:function(u,h){1&u&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"h1",2),t._uU(3," Products "),t.TgZ(4,"small",3),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"div",4),t.TgZ(7,"button",5),t.NdJ("click",function(){return h.onAddBill()}),t._UZ(8,"i",6),t.qZA(),t.TgZ(9,"button",5),t.NdJ("click",function(){return h.onAddProduct()}),t._UZ(10,"i",7),t.qZA(),t.TgZ(11,"button",5),t.NdJ("click",function(){return h.onUploadProduct()}),t._UZ(12,"i",8),t.qZA(),t.qZA(),t.qZA(),t.TgZ(13,"div",9),t.TgZ(14,"table",10),t.TgZ(15,"thead",11),t.TgZ(16,"tr"),t._UZ(17,"th",12),t.TgZ(18,"th",12),t._uU(19,"NAME"),t.qZA(),t.TgZ(20,"th",13),t._uU(21,"QTY"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"tbody"),t.YNc(23,Ze,7,3,"tr",14),t.qZA(),t.qZA(),t.qZA(),t.TgZ(24,"div",15),t.TgZ(25,"a",16),t.NdJ("click",function(){return h.onClear()}),t._uU(26,"Clear"),t.qZA(),t.TgZ(27,"a",17),t.NdJ("click",function(){return h.onPrint()}),t._uU(28,"Print"),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.xp6(5),t.hij("( ",0===h.stickerTotal?"":h.stickerTotal," stickers )"),t.xp6(18),t.Q6J("ngForOf",h.productGroups))},directives:[L.sg],styles:["td[_ngcontent-%COMP%]{font-size:12px}th[_ngcontent-%COMP%]{font-size:12px}"]}),w})();function a(w,A){if(1&w){const u=t.EpF();t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2,"Selected Tax"),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"ng-select",45),t.NdJ("ngModelChange",function(O){return t.CHM(u),t.oxw().taxOptionSelected=O})("change",function(){return t.CHM(u),t.oxw().onSelectTaxType()}),t.qZA(),t.qZA(),t.TgZ(5,"td"),t._uU(6,"Applied Tax ex: 100 + 10% = 110"),t.qZA(),t.qZA()}if(2&w){const u=t.oxw();t.xp6(4),t.Q6J("items",u.taxOptions)("ngModel",u.taxOptionSelected)("clearable",!1)}}const c=function(w){return{active:w}};let g=(()=>{class w{constructor(u,h){this.dialogRef=u,this.data=h,this.event=new t.vpe,this.modalConfig=new U.O,this.taxOptions=[],this.paperWidth=0,this.marginTop=0,this.marginLeft=0,this.stickerWidth=0,this.stickerHeight=0,this.barcodeHeight=0,this.spacingColumn=0,this.spacingRow=0,this.barcode=!0,this.code=!0,this.price=!0,this.name=!0,this.removeDefault=!0,this.desc=!0,this.priceTax=!0,this.fontSize=0,this.namePrefix="",this.maxChar=0,this.publiclineHeight=0,this.paperFormat=JSON.parse(JSON.stringify(h.paperFormat)),this.taxs=h.taxs,this.authTax=h.authTax,this.initTaxOptions(),this.activeTab="paper"}ngOnInit(){this.initModalConfig(),this.initFormValue(),this.authTax&&this.initTaxOptionSelected()}initTaxOptions(){this.taxOptions=[],this.taxs.forEach((u,h)=>{this.taxOptions=[...this.taxOptions,{id:h+1,name:u.getName,ID:u.getID}]})}initTaxOptionSelected(){this.taxSelected&&(this.taxOptionSelected=this.taxOptions.find(u=>u.ID===this.taxSelected.ID))}onSelectTaxType(){this.taxSelected=this.taxs.find(u=>u.getID===this.taxOptionSelected.ID)}initModalConfig(){this.modalConfig.title="Sticker Configuration",this.modalConfig.hideMoreButton=!0}onOk(){this.setPaperFormat(),this.dialogRef.close(this.paperFormat)}onCancel(){this.dialogRef.close()}initFormValue(){this.paperFormat&&(this.barcodeHeight=this.paperFormat.BarcodeHeight,this.paperWidth=this.paperFormat.PaperWidth,this.marginTop=this.paperFormat.MarginTop,this.marginLeft=this.paperFormat.MarginLeft,this.stickerWidth=this.paperFormat.StickerWidth,this.stickerHeight=this.paperFormat.StickerHeight,this.barcodeHeight=this.paperFormat.BarcodeHeight,this.spacingColumn=this.paperFormat.ColumnSpacing,this.spacingRow=this.paperFormat.RowSpacing,this.barcode=this.paperFormat.BarcodeVisible,this.code=this.paperFormat.CodeVisible,this.price=this.paperFormat.PriceVisible,this.name=this.paperFormat.NameVisible,this.desc=this.paperFormat.DescriptionAsCode,this.fontSize=this.paperFormat.ProductNameFontSize,this.namePrefix=this.paperFormat.ProductNamePrefix,this.maxChar=this.paperFormat.ProductNameMaxLength,this.lineHeight=this.paperFormat.LineHeight,this.priceTax=this.paperFormat.PriceWithTax,this.taxSelected=this.paperFormat.TaxType,this.storeName=this.paperFormat.StoreName,this.currencySymbol=this.paperFormat.CurrencySymbol,this.promotionPriceLabel=this.paperFormat.PromotionPriceLabel,this.basicPriceLabel=this.paperFormat.BasicPriceLabel)}setPaperFormat(){this.paperFormat&&(this.checkPriceWithTax(),this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.PaperWidth=this.paperWidth,this.paperFormat.MarginTop=this.marginTop,this.paperFormat.MarginLeft=this.marginLeft,this.paperFormat.StickerWidth=this.stickerWidth,this.paperFormat.StickerHeight=this.stickerHeight,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.ColumnSpacing=this.spacingColumn,this.paperFormat.RowSpacing=this.spacingRow,this.paperFormat.BarcodeVisible=this.barcode,this.paperFormat.CodeVisible=this.code,this.paperFormat.PriceVisible=this.price,this.paperFormat.NameVisible=this.name,this.paperFormat.DescriptionAsCode=this.desc,this.paperFormat.ProductNameFontSize=this.fontSize,this.paperFormat.ProductNamePrefix=this.namePrefix,this.paperFormat.ProductNameMaxLength=this.maxChar,this.paperFormat.LineHeight=this.lineHeight,this.paperFormat.PriceWithTax=this.priceTax,this.paperFormat.TaxType=this.taxSelected,this.paperFormat.StoreName=this.storeName,this.paperFormat.CurrencySymbol=this.currencySymbol,this.paperFormat.PromotionPriceLabel=this.promotionPriceLabel,this.paperFormat.BasicPriceLabel=this.basicPriceLabel)}checkPriceWithTax(){this.priceTax||(this.taxSelected=this.taxs.find(u=>"No Tax"==u.getLabel))}dataTarget(u){this.activeTab=u}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.so),t.Y36(R.WI))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-form-settings"]],outputs:{event:"event"},decls:283,vars:68,consts:[[3,"config","onOk","onCancel"],["container",""],[1,"container-fluid","px-0","bg-light-white","nav-tabs-custom-border"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["tabs",""],[1,"nav-item"],["data-toggle","tab",1,"nav-link",3,"ngClass","click"],["id","spacing-tab","data-toggle","tab","data-target","'#spacing'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","dua-tab","data-toggle","tab","data-target","'#sticker-content'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","price-tab","data-toggle","tab","data-target","'#price'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","advanced-tab","data-toggle","tab","data-target","'#advanced'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","promotionLabel-tab","data-toggle","tab","data-target","'#promotionLabel'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],[1,"tab-content"],["id","paper",1,"tab-pane","mt-0",3,"ngClass"],[1,"table","w-100"],[1,"input-group"],["type","number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],[1,"input-group-append"],[1,"input-group-text"],["id","spacing",1,"tab-pane","mt-0",3,"ngClass"],["id","sticker-content",1,"tab-pane","mt-0",3,"ngClass"],[1,"form-check","form-check-inline"],["type","radio","name","barcode","id","barcode","value","option3",1,"form-check-input",3,"checked","change"],["for","barcode",1,"form-check-label"],["type","radio","name","barcode","id","barcode","value","option4",1,"form-check-input",3,"checked","change"],["type","radio","name","code","id","code","value","option1",1,"form-check-input",3,"checked","change"],["for","code",1,"form-check-label"],["type","radio","name","code","id","code","value","option2",1,"form-check-input",3,"checked","change"],["type","radio","name","price","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["for","inlineRadio1",1,"form-check-label"],["type","radio","name","price","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],["for","inlineRadio2",1,"form-check-label"],["type","radio","name","name","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["type","radio","name","name","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],["id","price",1,"tab-pane","mt-0",3,"ngClass"],["type","radio","name","priceTax","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["type","radio","name","priceTax","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],[4,"ngIf"],["type","text","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["id","advanced",1,"tab-pane","mt-0",3,"ngClass"],["type","radio","name","desc","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["type","radio","name","desc","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],["type","radio","name","default","id","inlineRadio1","value","option1",1,"form-check-input",3,"checked","change"],["type","radio","name","default","id","inlineRadio2","value","option2",1,"form-check-input",3,"checked","change"],["id","promotionLabel",1,"tab-pane","mt-0",3,"ngClass"],["bindLabel","name","placeholder","Select Column",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange","change"]],template:function(u,h){1&u&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return h.onOk()})("onCancel",function(){return h.onCancel()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"ul",3,4),t.TgZ(6,"li",5),t.TgZ(7,"a",6),t.NdJ("click",function(){return h.dataTarget("paper")}),t._uU(8,"Paper"),t.qZA(),t.qZA(),t.TgZ(9,"li",5),t.TgZ(10,"a",7),t.NdJ("click",function(){return h.dataTarget("spacing")}),t._uU(11,"Spacing"),t.qZA(),t.qZA(),t.TgZ(12,"li",5),t.TgZ(13,"a",8),t.NdJ("click",function(){return h.dataTarget("sticker-content")}),t._uU(14,"Sticker Content"),t.qZA(),t.qZA(),t.TgZ(15,"li",5),t.TgZ(16,"a",9),t.NdJ("click",function(){return h.dataTarget("price")}),t._uU(17,"Price"),t.qZA(),t.qZA(),t.TgZ(18,"li",5),t.TgZ(19,"a",10),t.NdJ("click",function(){return h.dataTarget("advanced")}),t._uU(20,"Advanced"),t.qZA(),t.qZA(),t.TgZ(21,"li",5),t.TgZ(22,"a",11),t.NdJ("click",function(){return h.dataTarget("promotionLabel")}),t._uU(23,"Label"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(24,"div",12),t.TgZ(25,"div",13),t.TgZ(26,"table",14),t.TgZ(27,"tr"),t.TgZ(28,"td"),t._uU(29,"Paper Width"),t.qZA(),t.TgZ(30,"td"),t.TgZ(31,"div",15),t.TgZ(32,"input",16),t.NdJ("ngModelChange",function(D){return h.paperWidth=D}),t.qZA(),t.TgZ(33,"div",17),t.TgZ(34,"span",18),t._uU(35,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(36,"td"),t._uU(37,"The width of the paper"),t.qZA(),t.qZA(),t.TgZ(38,"tr"),t.TgZ(39,"td"),t._uU(40,"Sticker Width"),t.qZA(),t.TgZ(41,"td"),t.TgZ(42,"div",15),t.TgZ(43,"input",16),t.NdJ("ngModelChange",function(D){return h.stickerWidth=D}),t.qZA(),t.TgZ(44,"div",17),t.TgZ(45,"span",18),t._uU(46,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(47,"td"),t._uU(48,"The width of the sticker"),t.qZA(),t.qZA(),t.TgZ(49,"tr"),t.TgZ(50,"td"),t._uU(51,"Sticker Height"),t.qZA(),t.TgZ(52,"td"),t.TgZ(53,"div",15),t.TgZ(54,"input",16),t.NdJ("ngModelChange",function(D){return h.stickerHeight=D}),t.qZA(),t.TgZ(55,"div",17),t.TgZ(56,"span",18),t._uU(57,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(58,"td"),t._uU(59,"The height of the sticker"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(60,"div",19),t.TgZ(61,"table",14),t.TgZ(62,"tr"),t.TgZ(63,"td"),t._uU(64,"Left Indent"),t.qZA(),t.TgZ(65,"td"),t.TgZ(66,"div",15),t.TgZ(67,"input",16),t.NdJ("ngModelChange",function(D){return h.marginLeft=D}),t.qZA(),t.TgZ(68,"div",17),t.TgZ(69,"span",18),t._uU(70,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(71,"td"),t._uU(72,"the number of pixels appended before the first COLUMN"),t.qZA(),t.qZA(),t.TgZ(73,"tr"),t.TgZ(74,"td"),t._uU(75,"Top Indent"),t.qZA(),t.TgZ(76,"td"),t.TgZ(77,"div",15),t.TgZ(78,"input",16),t.NdJ("ngModelChange",function(D){return h.marginTop=D}),t.qZA(),t.TgZ(79,"div",17),t.TgZ(80,"span",18),t._uU(81,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(82,"td"),t._uU(83,"the number of pixels appended before the first ROW"),t.qZA(),t.qZA(),t.TgZ(84,"tr"),t.TgZ(85,"td"),t._uU(86,"Row Spacing"),t.qZA(),t.TgZ(87,"td"),t.TgZ(88,"div",15),t.TgZ(89,"input",16),t.NdJ("ngModelChange",function(D){return h.spacingRow=D}),t.qZA(),t.TgZ(90,"div",17),t.TgZ(91,"span",18),t._uU(92,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(93,"td"),t._uU(94,"The number of pixels between each ROW"),t.qZA(),t.qZA(),t.TgZ(95,"tr"),t.TgZ(96,"td"),t._uU(97,"Column Spacing"),t.qZA(),t.TgZ(98,"td"),t.TgZ(99,"div",15),t.TgZ(100,"input",16),t.NdJ("ngModelChange",function(D){return h.spacingColumn=D}),t.qZA(),t.TgZ(101,"div",17),t.TgZ(102,"span",18),t._uU(103,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(104,"td"),t._uU(105,"The number of pixels between each COLUMN"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(106,"div",20),t.TgZ(107,"table",14),t.TgZ(108,"tr"),t.TgZ(109,"td"),t._uU(110,"Barcode Height"),t.qZA(),t.TgZ(111,"td"),t.TgZ(112,"div",15),t.TgZ(113,"input",16),t.NdJ("ngModelChange",function(D){return h.barcodeHeight=D}),t.qZA(),t.TgZ(114,"div",17),t.TgZ(115,"span",18),t._uU(116,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(117,"td"),t._uU(118,"the height of the generated barcode in pixels"),t.qZA(),t.qZA(),t.TgZ(119,"tr"),t.TgZ(120,"td"),t._uU(121,"Font Size"),t.qZA(),t.TgZ(122,"td"),t.TgZ(123,"div",15),t.TgZ(124,"input",16),t.NdJ("ngModelChange",function(D){return h.fontSize=D}),t.qZA(),t.TgZ(125,"div",17),t.TgZ(126,"span",18),t._uU(127,"px"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(128,"td"),t._uU(129,"Change all font size (include price)"),t.qZA(),t.qZA(),t.TgZ(130,"tr"),t.TgZ(131,"td"),t._uU(132,"Barcode"),t.qZA(),t.TgZ(133,"td"),t.TgZ(134,"div",21),t.TgZ(135,"input",22),t.NdJ("change",function(){return h.barcode=!1}),t.qZA(),t.TgZ(136,"label",23),t._uU(137,"No"),t.qZA(),t.qZA(),t.TgZ(138,"div",21),t.TgZ(139,"input",24),t.NdJ("change",function(){return h.barcode=!0}),t.qZA(),t.TgZ(140,"label",23),t._uU(141,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(142,"td"),t._uU(143,"Whether barcode is visible"),t.qZA(),t.qZA(),t.TgZ(144,"tr"),t.TgZ(145,"td"),t._uU(146,"Code"),t.qZA(),t.TgZ(147,"td"),t.TgZ(148,"div",21),t.TgZ(149,"input",25),t.NdJ("change",function(){return h.code=!1}),t.qZA(),t.TgZ(150,"label",26),t._uU(151,"No"),t.qZA(),t.qZA(),t.TgZ(152,"div",21),t.TgZ(153,"input",27),t.NdJ("change",function(){return h.code=!0}),t.qZA(),t.TgZ(154,"label",26),t._uU(155,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(156,"td"),t._uU(157,"Whether variant code is visible"),t.qZA(),t.qZA(),t.TgZ(158,"tr"),t.TgZ(159,"td"),t._uU(160,"Price"),t.qZA(),t.TgZ(161,"td"),t.TgZ(162,"div",21),t.TgZ(163,"input",28),t.NdJ("change",function(){return h.price=!1}),t.qZA(),t.TgZ(164,"label",29),t._uU(165,"No"),t.qZA(),t.qZA(),t.TgZ(166,"div",21),t.TgZ(167,"input",30),t.NdJ("change",function(){return h.price=!0}),t.qZA(),t.TgZ(168,"label",31),t._uU(169,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(170,"td"),t._uU(171,"Whether variant price is visible"),t.qZA(),t.qZA(),t.TgZ(172,"tr"),t.TgZ(173,"td"),t._uU(174,"Name"),t.qZA(),t.TgZ(175,"td"),t.TgZ(176,"div",21),t.TgZ(177,"input",32),t.NdJ("change",function(){return h.name=!1}),t.qZA(),t.TgZ(178,"label",29),t._uU(179,"No"),t.qZA(),t.qZA(),t.TgZ(180,"div",21),t.TgZ(181,"input",33),t.NdJ("change",function(){return h.name=!0}),t.qZA(),t.TgZ(182,"label",31),t._uU(183,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(184,"td"),t._uU(185,"Whether variant name is visible"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(186,"div",34),t.TgZ(187,"table",14),t.TgZ(188,"tr"),t.TgZ(189,"td"),t._uU(190,"Price with Tax"),t.qZA(),t.TgZ(191,"td"),t.TgZ(192,"div",21),t.TgZ(193,"input",35),t.NdJ("change",function(){return h.priceTax=!1}),t.qZA(),t.TgZ(194,"label",29),t._uU(195,"No"),t.qZA(),t.qZA(),t.TgZ(196,"div",21),t.TgZ(197,"input",36),t.NdJ("change",function(){return h.priceTax=!0}),t.qZA(),t.TgZ(198,"label",31),t._uU(199,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(200,"td"),t._uU(201),t.qZA(),t.qZA(),t.YNc(202,a,7,3,"tr",37),t.TgZ(203,"tr"),t.TgZ(204,"td"),t._uU(205,"Currency"),t.qZA(),t.TgZ(206,"td"),t.TgZ(207,"div",15),t.TgZ(208,"input",38),t.NdJ("ngModelChange",function(D){return h.currencySymbol=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(209,"td"),t._uU(210,"the default currency"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(211,"div",39),t.TgZ(212,"table",14),t.TgZ(213,"tr"),t.TgZ(214,"td"),t._uU(215,"Max Character"),t.qZA(),t.TgZ(216,"td"),t.TgZ(217,"div",15),t.TgZ(218,"input",16),t.NdJ("ngModelChange",function(D){return h.maxChar=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(219,"td"),t._uU(220,"the max character of the product name"),t.qZA(),t.qZA(),t.TgZ(221,"tr"),t.TgZ(222,"td"),t._uU(223,"Name Prefix"),t.qZA(),t.TgZ(224,"td"),t.TgZ(225,"div",15),t.TgZ(226,"input",38),t.NdJ("ngModelChange",function(D){return h.namePrefix=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(227,"td"),t._uU(228,"a word, letter, or number placed before product name"),t.qZA(),t.qZA(),t.TgZ(229,"tr"),t.TgZ(230,"td"),t._uU(231,"Store Name"),t.qZA(),t.TgZ(232,"td"),t.TgZ(233,"div",15),t.TgZ(234,"input",38),t.NdJ("ngModelChange",function(D){return h.storeName=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(235,"td"),t._uU(236,"the name of the store"),t.qZA(),t.qZA(),t.TgZ(237,"tr"),t.TgZ(238,"td"),t._uU(239,"Use description as code"),t.qZA(),t.TgZ(240,"td"),t.TgZ(241,"div",21),t.TgZ(242,"input",40),t.NdJ("change",function(){return h.desc=!1}),t.qZA(),t.TgZ(243,"label",29),t._uU(244,"No"),t.qZA(),t.qZA(),t.TgZ(245,"div",21),t.TgZ(246,"input",41),t.NdJ("change",function(){return h.desc=!0}),t.qZA(),t.TgZ(247,"label",31),t._uU(248,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(249,"td"),t._uU(250,"Copy product description into Product Code"),t.qZA(),t.qZA(),t.TgZ(251,"tr"),t.TgZ(252,"td"),t._uU(253,'Remove "Default"'),t.qZA(),t.TgZ(254,"td"),t.TgZ(255,"div",21),t.TgZ(256,"input",42),t.NdJ("change",function(){return h.removeDefault=!1}),t.qZA(),t.TgZ(257,"label",29),t._uU(258,"No"),t.qZA(),t.qZA(),t.TgZ(259,"div",21),t.TgZ(260,"input",43),t.NdJ("change",function(){return h.removeDefault=!0}),t.qZA(),t.TgZ(261,"label",31),t._uU(262,"Yes"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(263,"td"),t._uU(264,'Remove "Default" Label from product name'),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(265,"div",44),t.TgZ(266,"table",14),t.TgZ(267,"tr"),t.TgZ(268,"td"),t._uU(269,"Normal Price"),t.qZA(),t.TgZ(270,"td"),t.TgZ(271,"div",15),t.TgZ(272,"input",38),t.NdJ("ngModelChange",function(D){return h.basicPriceLabel=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(273,"td"),t._uU(274,"Custom label normal price"),t.qZA(),t.qZA(),t.TgZ(275,"tr"),t.TgZ(276,"td"),t._uU(277,"Promotion Price"),t.qZA(),t.TgZ(278,"td"),t.TgZ(279,"div",15),t.TgZ(280,"input",38),t.NdJ("ngModelChange",function(D){return h.promotionPriceLabel=D}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(281,"td"),t._uU(282,"Custom label promotion price"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.Q6J("config",h.modalConfig),t.xp6(7),t.Q6J("ngClass",t.VKq(44,c,"paper"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(46,c,"spacing"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(48,c,"sticker-content"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(50,c,"price"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(52,c,"advanced"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(54,c,"promotionLabel"===h.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(56,c,"paper"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.paperWidth),t.xp6(11),t.Q6J("ngModel",h.stickerWidth),t.xp6(11),t.Q6J("ngModel",h.stickerHeight),t.xp6(6),t.Q6J("ngClass",t.VKq(58,c,"spacing"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.marginLeft),t.xp6(11),t.Q6J("ngModel",h.marginTop),t.xp6(11),t.Q6J("ngModel",h.spacingRow),t.xp6(11),t.Q6J("ngModel",h.spacingColumn),t.xp6(6),t.Q6J("ngClass",t.VKq(60,c,"sticker-content"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.barcodeHeight),t.xp6(11),t.Q6J("ngModel",h.fontSize),t.xp6(11),t.Q6J("checked",!h.barcode),t.xp6(4),t.Q6J("checked",h.barcode),t.xp6(10),t.Q6J("checked",!h.code),t.xp6(4),t.Q6J("checked",h.code),t.xp6(10),t.Q6J("checked",!h.price),t.xp6(4),t.Q6J("checked",h.price),t.xp6(10),t.Q6J("checked",!h.name),t.xp6(4),t.Q6J("checked",h.name),t.xp6(5),t.Q6J("ngClass",t.VKq(62,c,"price"===h.activeTab)),t.xp6(7),t.Q6J("checked",!h.priceTax),t.xp6(4),t.Q6J("checked",h.priceTax),t.xp6(4),t.hij("Tax is added to the product base price ",h.authTax,""),t.xp6(1),t.Q6J("ngIf",1==h.priceTax&&1==h.authTax),t.xp6(6),t.Q6J("ngModel",h.currencySymbol),t.xp6(3),t.Q6J("ngClass",t.VKq(64,c,"advanced"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.maxChar),t.xp6(8),t.Q6J("ngModel",h.namePrefix),t.xp6(8),t.Q6J("ngModel",h.storeName),t.xp6(8),t.Q6J("checked",!h.desc),t.xp6(4),t.Q6J("checked",h.desc),t.xp6(10),t.Q6J("checked",!h.removeDefault),t.xp6(4),t.Q6J("checked",h.removeDefault),t.xp6(5),t.Q6J("ngClass",t.VKq(66,c,"promotionLabel"===h.activeTab)),t.xp6(7),t.Q6J("ngModel",h.basicPriceLabel),t.xp6(8),t.Q6J("ngModel",h.promotionPriceLabel))},directives:[G.M,L.mk,$.wV,$.Fj,$.JJ,$.On,L.O5,W.w9],styles:[".input-group-append[_ngcontent-%COMP%]{height:30px}.form-control[_ngcontent-%COMP%]{height:30px;font-size:12px}.input-group-text[_ngcontent-%COMP%]{font-size:12px}.value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:90px}.advance-value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:135px}h3[_ngcontent-%COMP%]{margin-bottom:0;font-weight:550}label[_ngcontent-%COMP%]{font-size:12px}bs-dropdown-container[_ngcontent-%COMP%]{z-index:1060}.nav-tabs-custom-border[_ngcontent-%COMP%] .nav-tabs[_ngcontent-%COMP%]{border-bottom:0}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%]{border:1px solid #dee2e6;margin-bottom:15px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(1){font-weight:bold;width:172px;padding:12px 1rem}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){width:120px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:nth-child(2), .tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){border-right:1px solid #dee2e6;border-left:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) input[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) .input-group-text[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(3){font-style:italic;color:#28a745}.nav-link[_ngcontent-%COMP%]{cursor:pointer}"]}),w})();const e=["bcElement"],i=T(9489);let r=(()=>{class w{constructor(u){this.renderer=u,this.elementType="svg",this.cssClass="barcode",this.format="CODE128",this.lineColor="#000000",this.width=2,this.height=100,this.displayValue=!1,this.fontOptions="",this.font="monospace",this.textAlign="center",this.textPosition="bottom",this.textMargin=2,this.fontSize=20,this.background="#ffffff",this.margin=10,this.marginTop=10,this.marginBottom=10,this.marginLeft=10,this.marginRight=10,this.value="",this.valid=()=>!0}get options(){return{format:this.format,lineColor:this.lineColor,width:this.width,height:this.height,displayValue:this.displayValue,fontOptions:this.fontOptions,font:this.font,textAlign:this.textAlign,textPosition:this.textPosition,textMargin:this.textMargin,fontSize:this.fontSize,background:this.background,margin:this.margin,marginTop:this.marginTop,marginBottom:this.marginBottom,marginLeft:this.marginLeft,marginRight:this.marginRight,valid:this.valid}}ngOnChanges(){this.createBarcode()}createBarcode(){if(!this.value)return;let u;switch(this.elementType){case"img":u=this.renderer.createElement("img");break;case"canvas":u=this.renderer.createElement("canvas");break;default:u=this.renderer.createElement("svg","svg")}i(u,this.value,this.options);for(const h of this.bcElement.nativeElement.childNodes)this.renderer.removeChild(this.bcElement.nativeElement,h);this.renderer.appendChild(this.bcElement.nativeElement,u)}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(t.Qsj))},w.\u0275cmp=t.Xpm({type:w,selectors:[["ngx-barcode6"]],viewQuery:function(u,h){if(1&u&&t.Gf(e,7),2&u){let O;t.iGM(O=t.CRH())&&(h.bcElement=O.first)}},inputs:{elementType:["bc-element-type","elementType"],cssClass:["bc-class","cssClass"],format:["bc-format","format"],lineColor:["bc-line-color","lineColor"],width:["bc-width","width"],height:["bc-height","height"],displayValue:["bc-display-value","displayValue"],fontOptions:["bc-font-options","fontOptions"],font:["bc-font","font"],textAlign:["bc-text-align","textAlign"],textPosition:["bc-text-position","textPosition"],textMargin:["bc-text-margin","textMargin"],fontSize:["bc-font-size","fontSize"],background:["bc-background","background"],margin:["bc-margin","margin"],marginTop:["bc-margin-top","marginTop"],marginBottom:["bc-margin-bottom","marginBottom"],marginLeft:["bc-margin-left","marginLeft"],marginRight:["bc-margin-right","marginRight"],value:["bc-value","value"],valid:["bc-valid","valid"]},features:[t.TTD],decls:2,vars:2,consts:[["bcElement",""]],template:function(u,h){1&u&&t._UZ(0,"div",null,0),2&u&&t.Tol(h.cssClass)},encapsulation:2}),w})(),m=(()=>{class w{}return w.\u0275fac=function(u){return new(u||w)},w.\u0275mod=t.oAB({type:w}),w.\u0275inj=t.cJS({imports:[[]]}),w})(),p=(()=>{class w{transform(u,h){let O=u,D=0;return h&&0!==h&&(D=u*(h/100),O=u+D),O}}return w.\u0275fac=function(u){return new(u||w)},w.\u0275pipe=t.Yjl({name:"taxPipe",type:w,pure:!0}),w})();function s(w,A){if(1&w&&t._UZ(0,"ngx-barcode6",18),2&w){const u=t.oxw().$implicit,h=t.oxw();t.Q6J("bc-value",null==u?null:u.getCode)("bc-element-type","img")("bc-width",1)("bc-height",null==h.selectedPaperFormat?null:h.selectedPaperFormat.BarcodeHeight)}}function C(w,A){if(1&w&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&w){const u=t.oxw().$implicit,h=t.oxw();t.Udp("font-size",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.Oqu(u.getBarcodeTitle)}}function M(w,A){if(1&w&&(t.ynx(0),t.TgZ(1,"div",22),t.TgZ(2,"span",23),t._uU(3),t.qZA(),t.TgZ(4,"span",24),t.TgZ(5,"span",25),t.TgZ(6,"span",26),t._uU(7),t.ALo(8,"number"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(9,"div",27),t.TgZ(10,"span",23),t._uU(11),t.qZA(),t.TgZ(12,"span",28),t._uU(13),t.ALo(14,"number"),t.qZA(),t.qZA(),t.BQk()),2&w){const u=t.oxw(2).$implicit,h=t.oxw();t.xp6(3),t.Oqu(h.selectedPaperFormat.BasicPriceLabel?h.selectedPaperFormat.BasicPriceLabel:"N. Price"),t.xp6(4),t.AsE("",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(8,6,null==u?null:u.getUnitPrice),""),t.xp6(4),t.Oqu(h.selectedPaperFormat.PromotionPriceLabel?h.selectedPaperFormat.PromotionPriceLabel:"Spc. Price"),t.xp6(2),t.AsE("",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(14,8,null==u||null==u.getSelectedPromotion?null:u.getSelectedPromotion.getUnitPrice),"")}}function q(w,A){if(1&w&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&w){const u=t.oxw(3).$implicit,h=t.oxw();t.xp6(1),t.AsE(" ",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==u?null:u.getCustomPrice,h.tax))," ")}}function v(w,A){if(1&w&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&w){const u=t.oxw(4).$implicit,h=t.oxw();t.xp6(1),t.AsE(" ",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==u?null:u.getUnitPrice,h.tax))," ")}}function Z(w,A){if(1&w&&t.YNc(0,v,4,7,"ng-container",20),2&w){t.oxw();const u=t.MAs(5),h=t.oxw(3);t.Q6J("ngIf",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.PriceWithTax)&&h.tax&&0!=h.tax)("ngIfElse",u)}}function V(w,A){if(1&w&&(t._uU(0),t.ALo(1,"number")),2&w){const u=t.oxw(3).$implicit,h=t.oxw();t.AsE(" ",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CurrencySymbol," ",t.lcZ(1,2,null==u?null:u.getUnitPrice)," ")}}function B(w,A){if(1&w&&(t.TgZ(0,"strong"),t.YNc(1,q,4,7,"ng-container",20),t.YNc(2,Z,1,2,"ng-template",null,29,t.W1O),t.YNc(4,V,2,4,"ng-template",null,30,t.W1O),t.qZA()),2&w){const u=t.MAs(3),h=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",0!==(null==h?null:h.getCustomPrice)&&void 0!==(null==h?null:h.getCustomPrice))("ngIfElse",u)}}function j(w,A){if(1&w&&(t.TgZ(0,"span",19),t.YNc(1,M,15,10,"ng-container",20),t.YNc(2,B,6,2,"ng-template",null,21,t.W1O),t.qZA()),2&w){const u=t.MAs(3),h=t.oxw().$implicit,O=t.oxw();t.Udp("font-size",(null==O.selectedPaperFormat?null:O.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.Q6J("ngIf",h.getSelectedPromotion)("ngIfElse",u)}}function z(w,A){if(1&w&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&w){const u=t.oxw().$implicit,h=t.oxw();t.Udp("font-size",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=h.selectedPaperFormat&&h.selectedPaperFormat.ProductNamePrefix?(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNamePrefix)+" "+u.getName:u.getName,0,null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNameMaxLength)," ")}}function X(w,A){if(1&w&&(t.TgZ(0,"li"),t.TgZ(1,"div",13),t.YNc(2,s,1,4,"ngx-barcode6",14),t.TgZ(3,"div",15),t.YNc(4,C,2,3,"span",16),t.YNc(5,j,4,4,"span",16),t.YNc(6,z,3,7,"span",16),t.qZA(),t.TgZ(7,"div",17),t._uU(8),t.qZA(),t.qZA(),t.qZA()),2&w){const u=A.index,h=t.oxw();t.Udp("width",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.StickerWidth)+"px")("height",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.StickerHeight)+"px")("margin-right",(u+1)%h.totalStickerPerRow==0?0:(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ColumnSpacing)+"px")("margin-bottom",u>=h.productPreview.length-h.lastIndex?0:(null==h.selectedPaperFormat?null:h.selectedPaperFormat.RowSpacing)+"px"),t.xp6(2),t.Q6J("ngIf",null==h.selectedPaperFormat?null:h.selectedPaperFormat.BarcodeVisible),t.xp6(2),t.Q6J("ngIf",null==h.selectedPaperFormat?null:h.selectedPaperFormat.CodeVisible),t.xp6(1),t.Q6J("ngIf",null==h.selectedPaperFormat?null:h.selectedPaperFormat.PriceVisible),t.xp6(1),t.Q6J("ngIf",null==h.selectedPaperFormat?null:h.selectedPaperFormat.NameVisible),t.xp6(1),t.Udp("font-size",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==h.selectedPaperFormat?null:h.selectedPaperFormat.StoreName," ")}}let ne=(()=>{class w{constructor(u,h,O,D,J,ie){this.dialog=u,this.productStateService=h,this.productService=O,this.barcodeService=D,this.toastService=J,this.authService=ie,this.paperFormatOptions=[],this.optionSelected={id:1,name:"Continuous - 3 Column"},this.paperFormats=[],this.totalStickerPerRow=0,this.lastIndex=0,this.destroy$=new y.xQ,this.productPreview=[],this.taxs=[]}ngOnInit(){this.getPaperFormats(),this.checkAuthTax(),this.subscribeToObsproducts()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}checkAuthTax(){this.authService.getRoles().find(O=>"StpE"===O)?(this.getProductTax(),this.authTax=!0):this.authTax=!1}subscribeToObsproducts(){this.productStateService.getState().pipe((0,o.R)(this.destroy$)).subscribe(u=>{this.productPreview=u,this.relayout()})}getProductTax(){this.productService.getTax().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&(this.taxs=u)})}getPaperFormats(){this.barcodeService.getPaperFormatConfig().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&(this.paperFormats=u,this.setSelectedPaperFormat(u[0]),this.initOptionFormat(),this.initOptionSelected(this.selectedPaperFormat))},u=>{console.error(u)})}initOptionFormat(){this.paperFormatOptions=[],this.paperFormats.forEach((u,h)=>{this.paperFormatOptions=[...this.paperFormatOptions,{id:h+1,name:u.Name}]})}initOptionSelected(u){this.optionSelected=this.paperFormatOptions.find(h=>h.name===u.Name)}openSettingModal(){this.dialog.open(g,{width:"850px",data:{paperFormat:this.selectedPaperFormat,taxs:this.taxs,authTax:this.authTax}}).afterClosed().pipe((0,o.R)(this.destroy$)).subscribe(u=>{u&&this.selectedPaperFormat&&(this.updatePaperFormatSource(u),this.updatePaperFormat(),this.setSelectedPaperFormat(u))})}onSelectPaperFormat(){this.getPaperFormatBarcode()}getPaperFormatBarcode(){let h=this.findPaperFormatByName(this.optionSelected.name);this.setSelectedPaperFormat(h)}updatePaperFormat(){this.barcodeService.updatePaperFormatConfig(this.paperFormats).pipe((0,o.R)(this.destroy$)).subscribe(()=>{this.toastService.success("Success Update Paper Format","Success")},u=>{console.error(u)})}setSelectedPaperFormat(u){this.selectedPaperFormat=u,this.barcodeService.setBarcodeConfigState(u),this.relayout(),this.getPPnVal(u)}findPaperFormatByName(u){return this.paperFormats.find(O=>O.Name==u)}updatePaperFormatSource(u){this.paperFormats=this.paperFormats.map(h=>(u.Name===h.Name&&(h=u),h))}getPPnVal(u){this.tax=u.TaxType?u.TaxType.Rate:null}relayout(){var u,h,O,D,J,ie;let be=(null===(u=this.selectedPaperFormat)||void 0===u?void 0:u.PaperWidth)?null===(h=this.selectedPaperFormat)||void 0===h?void 0:h.PaperWidth:0,Ne=(null===(O=this.selectedPaperFormat)||void 0===O?void 0:O.StickerWidth)?null===(D=this.selectedPaperFormat)||void 0===D?void 0:D.StickerWidth:0,fe=(null===(J=this.selectedPaperFormat)||void 0===J?void 0:J.ColumnSpacing)?null===(ie=this.selectedPaperFormat)||void 0===ie?void 0:ie.ColumnSpacing:0,ue=Math.floor((be+fe)/(Ne+fe));this.totalStickerPerRow=ue;let Ee=Math.floor(this.productPreview.length/ue),Ue=this.productPreview.length-Ee*ue;this.lastIndex=0===Ue?ue:Ue,this.productPreview=this.productPreview.map(ve=>{var qe;return ve.setBarcodeTitle=(null===(qe=this.selectedPaperFormat)||void 0===qe?void 0:qe.DescriptionAsCode)&&ve.getDescription?ve.getDescription:ve.getCode,ve})}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(R.uw),t.Y36(b),t.Y36(we),t.Y36(H),t.Y36(_e._W),t.Y36(E.$))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-print-preview"]],decls:15,vars:10,consts:[[1,"mt-3","d-print-none"],[1,"card","mt-0","mb-0","paper-barcode"],[1,"card-header","d-flex","justify-content-between","align-items-center","border-bottom","pb-5","d-print-none"],[1,"font-weight-light"],["align","right",2,"width","400px"],[1,"d-inline-block","font-weight-light","text-info","font-italic"],["align","left","bindLabel","name","placeholder","Select Column",1,"d-inline-block","ml-4",3,"items","ngModel","clearable","ngModelChange","change"],[1,"btn","btn","btn-outline-secondary","ml-4",3,"click"],["aria-hidden","true",1,"fa","fa-cog"],[1,"card-body","p-0"],[1,"canvas","clearfix"],[1,"barcodes"],[3,"width","height","margin-right","margin-bottom",4,"ngFor","ngForOf"],[1,"position-relative"],[3,"bc-value","bc-element-type","bc-width","bc-height",4,"ngIf"],[2,"margin-top","-4px","line-height","1"],["class","d-block",3,"font-size",4,"ngIf"],[1,"vertical-text"],[3,"bc-value","bc-element-type","bc-width","bc-height"],[1,"d-block"],[4,"ngIf","ngIfElse"],["WITHOUT_PROMOTION",""],[1,"d-flex","justify-content-between"],[1,"ml-12"],[1,"mr-12"],[1,"text-danger",2,"text-decoration","line-through","text-decoration-thickness","1.5px"],[1,"text-dark"],[1,"d-flex","justify-content-between","mt-1"],[1,"mr-12","text-danger"],["WITH_TAX",""],["WITHOUT_TAX",""]],template:function(u,h){1&u&&(t._UZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"div",2),t.TgZ(3,"h1",3),t._uU(4," Print Preview "),t.qZA(),t.TgZ(5,"div",4),t.TgZ(6,"h5",5),t._uU(7,"Paper Source"),t.qZA(),t.TgZ(8,"ng-select",6),t.NdJ("ngModelChange",function(D){return h.optionSelected=D})("change",function(){return h.onSelectPaperFormat()}),t.qZA(),t.TgZ(9,"button",7),t.NdJ("click",function(){return h.openSettingModal()}),t._UZ(10,"i",8),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"div",9),t.TgZ(12,"div",10),t.TgZ(13,"ul",11),t.YNc(14,X,9,15,"li",12),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.xp6(8),t.Q6J("items",h.paperFormatOptions)("ngModel",h.optionSelected)("clearable",!1),t.xp6(4),t.Udp("width",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.PaperWidth)+"px")("margin-top",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.MarginTop)+"px")("margin-left",(null==h.selectedPaperFormat?null:h.selectedPaperFormat.MarginLeft)+"px"),t.xp6(2),t.Q6J("ngForOf",h.productPreview))},directives:[W.w9,$.JJ,$.On,L.sg,L.O5,r],pipes:[L.JJ,p,L.OU],styles:["ng-select[_ngcontent-%COMP%]{width:50%}.card-header[_ngcontent-%COMP%]{height:65px} div.barcode>img{text-align:center;max-width:100%;border:none;outline:none}@media (max-width: 480px){ div.barcode>img{border:none!important}} div.canvas ul.barcodes li img{display:block;margin:0 auto}.vertical-text[_ngcontent-%COMP%]{transform:rotate(180deg);writing-mode:vertical-rl;position:absolute;right:0px;height:100%;top:8%;text-align:center}"]}),w})(),se=(()=>{class w{constructor(u,h,O){this.variantServiceState=u,this.authService=h,this.queryParamService=O,this.domainName=localStorage.getItem("Domain")}onLogout(){this.variantServiceState.setState([]),this.queryParamService.setState(null),this.authService.logout()}}return w.\u0275fac=function(u){return new(u||w)(t.Y36(b),t.Y36(E.$),t.Y36(I.U))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-pages"]],decls:20,vars:2,consts:[[1,"container"],[1,"row"],[1,"col-4","d-print-none"],[1,"col-8","p-0"],[1,"d-md-block","d-print-none"],[1,"row","justify-content-between","align-items-center"],[1,"col-auto","d-inline-flex"],[1,"pt-1rem","mr-3"],["target","_blank","href","https://www.dealpos.com"],["src","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid"],[1,"col-auto"],[1,"logout","d-print-none"],[3,"href"],[3,"click"],[1,"fa","fa-sign-out-alt"]],template:function(u,h){1&u&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"div",2),t._UZ(3,"app-list-products"),t.qZA(),t.TgZ(4,"div",3),t._UZ(5,"app-print-preview"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(6,"footer",4),t.TgZ(7,"div",5),t.TgZ(8,"div",6),t.TgZ(9,"p",7),t._uU(10,"Powered by : "),t.qZA(),t.TgZ(11,"a",8),t._UZ(12,"img",9),t.qZA(),t.qZA(),t.TgZ(13,"div",10),t.TgZ(14,"div",11),t.TgZ(15,"a",12),t._uU(16),t.qZA(),t.TgZ(17,"h5",13),t.NdJ("click",function(){return h.onLogout()}),t._UZ(18,"span",14),t._uU(19,"\xa0Logout"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&u&&(t.xp6(15),t.MGl("href","https://",h.domainName,"",t.LSH),t.xp6(1),t.Oqu(h.domainName))},directives:[De,ne],styles:[".logout[_ngcontent-%COMP%]{position:relative;left:2.5vw;top:-5px;font-size:14px;cursor:pointer}footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:-1%}@media (min-height: 720px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:12%}}@media (min-height: 768px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:16%}}"]}),w})();var ae=T(8367);const ge=[{path:"",component:se}];let Ae=(()=>{class w{}return w.\u0275fac=function(u){return new(u||w)},w.\u0275mod=t.oAB({type:w}),w.\u0275inj=t.cJS({imports:[[L.ez,ae.m,Me,m,N.Bz.forChild(ge)]]}),w})()}}]);