dealposbooks 1.0.9 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/3rdpartylicenses.txt +30 -30
  2. package/assets/scss/layouts/_customizer.scss +11 -6
  3. package/assets/scss/layouts/_sidebar.scss +15 -12
  4. package/assets/scss/style.scss +4 -0
  5. package/assets/scss/variables/_variables.scss +5 -12
  6. package/{chunk-LCATVZKP.js → chunk-223MMYH7.js} +1 -1
  7. package/chunk-33KLXB2L.js +180 -0
  8. package/{chunk-C66O26ZI.js → chunk-4Y3NYY52.js} +1 -1
  9. package/{chunk-MNPBLC23.js → chunk-5GQEUX4M.js} +1 -1
  10. package/{chunk-GCTIPWTU.js → chunk-5RRUIJ5U.js} +1 -1
  11. package/{chunk-25PFXJAK.js → chunk-6BFODHTZ.js} +1 -1
  12. package/chunk-AXJA6OO7.js +246 -0
  13. package/{chunk-G52TDPSD.js → chunk-AYVR3RIS.js} +1 -1
  14. package/{chunk-WTRMIJHX.js → chunk-B6N6C3RA.js} +1 -1
  15. package/{chunk-ZNN2E36Y.js → chunk-CINZRZMB.js} +1 -1
  16. package/{chunk-3GWDCNXX.js → chunk-DBRLQ7BX.js} +1 -1
  17. package/{chunk-JFAO2CIB.js → chunk-DJ5UHXOJ.js} +1 -1
  18. package/{chunk-EP22HTZC.js → chunk-DUOJKP2G.js} +1 -1
  19. package/{chunk-UC2RR4WT.js → chunk-E4ZVZRLO.js} +3 -3
  20. package/chunk-EBOJJWD5.js +1 -0
  21. package/{chunk-PG4QL7N2.js → chunk-EMVZ65TI.js} +1 -1
  22. package/{chunk-T7R7C3RX.js → chunk-ENPYMVZG.js} +1 -1
  23. package/chunk-EOLHIQHQ.js +1 -0
  24. package/chunk-EQDQRRRY.js +1 -0
  25. package/chunk-ERX7ND7E.js +1 -0
  26. package/chunk-FKTEL4CU.js +524 -0
  27. package/chunk-FOUHOMEE.js +301 -0
  28. package/{chunk-HG23WDL5.js → chunk-H4HFCRFZ.js} +2 -2
  29. package/chunk-HBVENULS.js +1 -0
  30. package/chunk-J53TOHZH.js +1 -0
  31. package/chunk-JC7YOUAM.js +1 -0
  32. package/{chunk-TJSPXPO6.js → chunk-JR4EQTPJ.js} +1 -1
  33. package/{chunk-I4HDCL3W.js → chunk-JSAAKZBO.js} +1 -1
  34. package/{chunk-RJYIKNTI.js → chunk-KZ2KGWUY.js} +1 -1
  35. package/chunk-LON3T466.js +1 -0
  36. package/chunk-LYEN4UBW.js +1 -0
  37. package/chunk-MG3SLH6O.js +1 -0
  38. package/chunk-NQ3CKBYP.js +1 -0
  39. package/{chunk-ATVC2UCR.js → chunk-NS7JH3QF.js} +1 -1
  40. package/{chunk-O7OAT4UO.js → chunk-O65HPMSJ.js} +1 -1
  41. package/{chunk-NQ24E7JY.js → chunk-OCLABZZW.js} +1 -1
  42. package/chunk-OH2CJBFF.js +1 -0
  43. package/{chunk-GMTXOQ6X.js → chunk-OSV7AMB2.js} +1 -1
  44. package/{chunk-PNAWRNGD.js → chunk-OWI3BWEZ.js} +1 -1
  45. package/chunk-OYYYX3IP.js +1 -0
  46. package/{chunk-I7MT7OUB.js → chunk-PNQSQQIT.js} +1 -1
  47. package/{chunk-JXNLXEJT.js → chunk-Q5PJ63MA.js} +1 -1
  48. package/{chunk-4ANSU2AT.js → chunk-R2KG54OT.js} +1 -1
  49. package/{chunk-NTDTN5DF.js → chunk-REHXXPZY.js} +1 -1
  50. package/{chunk-JT2WCR5Q.js → chunk-RIALPB2D.js} +1 -1
  51. package/{chunk-AWY6AD76.js → chunk-RJYO2KKV.js} +1 -1
  52. package/{chunk-FVXLQNAC.js → chunk-ROKYJX6Q.js} +1 -1
  53. package/{chunk-GRTIJ77T.js → chunk-RUGQ4OJG.js} +1 -1
  54. package/{chunk-SQKLMC5H.js → chunk-RUP2SWYB.js} +1 -1
  55. package/chunk-RUVT4SCE.js +1 -0
  56. package/{chunk-52HZNWBM.js → chunk-SS3CMCAX.js} +1 -1
  57. package/{chunk-AOB6BRGQ.js → chunk-TMY4NWZ6.js} +1 -1
  58. package/chunk-TOJAZ32N.js +1 -0
  59. package/{chunk-2RWUYFYR.js → chunk-TUL6Y2HH.js} +1 -1
  60. package/{chunk-AH4LZWJY.js → chunk-UGKSIDKE.js} +1 -1
  61. package/{chunk-Z4SGDPGH.js → chunk-UTL7D6E7.js} +1 -1
  62. package/{chunk-2ODJIB2A.js → chunk-V7Y6Z4AQ.js} +2 -2
  63. package/chunk-VY4Z33EE.js +7 -0
  64. package/{chunk-RSHFIZV3.js → chunk-VYKJK5YU.js} +4 -4
  65. package/{chunk-UVBFYB2X.js → chunk-WG7APCJU.js} +1 -1
  66. package/{chunk-E6QGADC5.js → chunk-X2NM4CIV.js} +1 -1
  67. package/chunk-XWVLTTMV.js +1 -0
  68. package/{chunk-FJ7O4K2Y.js → chunk-Y6MJGNH2.js} +1 -1
  69. package/{chunk-QJ2XA575.js → chunk-YKYI4A3V.js} +1 -1
  70. package/chunk-ZL4DDXH7.js +348 -0
  71. package/{chunk-E6EWXQXJ.js → chunk-ZU7I7MCL.js} +1 -1
  72. package/{chunk-KFHCGO62.js → chunk-ZZPBK2XT.js} +1 -1
  73. package/index.html +6 -3
  74. package/{main-F2OQVLJM.js → main-MCP7AVEU.js} +1 -1
  75. package/package.json +1 -1
  76. package/styles-IAH7RNKW.css +1 -0
  77. package/chunk-63UNI6LK.js +0 -256
  78. package/chunk-7LG2CFYI.js +0 -1
  79. package/chunk-AKBPKNCH.js +0 -1
  80. package/chunk-B4JAAGJX.js +0 -1
  81. package/chunk-BGKS3L73.js +0 -246
  82. package/chunk-C6Q5SG76.js +0 -1
  83. package/chunk-DOKYUX3G.js +0 -1
  84. package/chunk-EN5MVYJQ.js +0 -180
  85. package/chunk-ISXV3FIH.js +0 -1
  86. package/chunk-JQNCWTZN.js +0 -1
  87. package/chunk-K36WQVFR.js +0 -1
  88. package/chunk-LJMMN36O.js +0 -1
  89. package/chunk-OHVHLILJ.js +0 -1
  90. package/chunk-OJWZH7AB.js +0 -301
  91. package/chunk-RR5AUWZO.js +0 -1
  92. package/chunk-T3ZCO6EC.js +0 -1
  93. package/chunk-TNXHYK2R.js +0 -7
  94. package/chunk-TTG6XQNP.js +0 -1
  95. package/chunk-UOFRXQI7.js +0 -1
  96. package/chunk-WCQQSWYQ.js +0 -616
  97. package/styles-GUJHQHWA.css +0 -1
package/chunk-WCQQSWYQ.js DELETED
@@ -1,616 +0,0 @@
1
- import{a as Ui,b as ji}from"./chunk-ATVC2UCR.js";import{a as In}from"./chunk-63UNI6LK.js";import{a as Gi}from"./chunk-NTDTN5DF.js";import{b as pa,c as ha}from"./chunk-3GWDCNXX.js";import{a as da}from"./chunk-PG4QL7N2.js";import{a as Ie}from"./chunk-G4XX7EU2.js";import{a as On,b as Ji,c as $i}from"./chunk-G52TDPSD.js";import{a as Ko}from"./chunk-2RWUYFYR.js";import{a as oi,b as ai}from"./chunk-E6QGADC5.js";import"./chunk-UVBFYB2X.js";import"./chunk-KFHCGO62.js";import{a as ea,b as ta}from"./chunk-C66O26ZI.js";import{a as $e}from"./chunk-AKBPKNCH.js";import{a as Kn,b as Wn}from"./chunk-NQ24E7JY.js";import{b as Bi,c as zi,d as Tn,e as Fn,f as Vt,h as ua,i as ma,j as At}from"./chunk-HG23WDL5.js";import{e as Zo,g as ii,h as ni}from"./chunk-EP22HTZC.js";import"./chunk-4ANSU2AT.js";import"./chunk-TJSPXPO6.js";import{a as kn,b as Dt}from"./chunk-MNPBLC23.js";import{a as Qo,b as Yo,c as la,d as ca,e as Mi,f as Ri,g as Et}from"./chunk-EN5MVYJQ.js";import{a as Ai,f as xt,g as ti}from"./chunk-Z4SGDPGH.js";import{a as Li,b as ia,c as na,d as oa,e as aa,f as ra,g as sa}from"./chunk-FJ7O4K2Y.js";import{d as wn,f as $o,i as Nt,j as Gn,n as Vi,o as qo,r as En,t as Pn,u as Xt,v as ei,w as Xo}from"./chunk-PNAWRNGD.js";import{B as Jn,Ca as Ni,G as $n,Ga as Di,Ha as tt,I as Wo,Ia as It,Pa as Yt,Y as xn,a as jo,b as Si,c as et,e as wi,f as Ci,g as Ot,h as M,ja as Ho,l as xi,m as Ei,n as Pi,o as ki,q as _n,r as Jo,u as Ti,w as jn,x as Zt,ya as Yi,z as Qt}from"./chunk-FVXLQNAC.js";import{a as Ii,d as Go}from"./chunk-T3ZCO6EC.js";import{c as Cn,d as Fi,f as mi,h as Oi,i as zn,k as Un}from"./chunk-S35HUXPS.js";import{b as yn,e as zo,k as Uo,m as qt,p as bn,w as Sn}from"./chunk-25PFXJAK.js";import{d as Lo,k as Ct,l as Mo,m as Ro,n as Xe,o as bi,p as Wt,q as Bo,r as vn,s as Ft,t as Me,v as Ht}from"./chunk-GRTIJ77T.js";import{Aa as mn,Ab as vi,Ac as Do,Bb as V,D as cn,Dc as Vo,Ea as xo,Fc as Ae,Gc as Ke,Ha as Ne,Hc as Qi,I as fi,Ib as Fo,Ic as Z,Jb as he,Kb as y,Lb as Kt,Mb as Oo,Nb as vt,Ob as ct,Pb as Le,Qb as Tt,Rb as Bn,Rc as bt,Sb as yt,Sc as _i,Tb as _t,Tc as at,Ub as p,V as _o,Vb as m,Vc as fn,Wb as N,Wc as Ao,X as Zi,Xb as Ue,Yb as je,Z as ke,Zb as Ye,_b as q,ba as bo,bb as Eo,c as Rn,ca as ft,cb as Po,da as $t,dc as G,ec as P,fc as pn,g as Bt,gb as f,gc as hn,ha as un,hb as zt,hc as Je,ia as K,ic as ut,jc as ue,kc as me,lc as Io,mc as x,n as gi,nb as ko,nc as ae,ob as To,oc as ot,pa as So,pc as gn,qa as R,ra as B,s as Pt,sa as wo,ta as Qe,ub as Ee,uc as Ge,va as Co,vb as Gt,vc as Te,wb as dn,wc as Pe,xc as yi,yb as wt,yc as No,za as lt}from"./chunk-RSHFIZV3.js";import{a as pe,b as xe,d as yo,e as ui}from"./chunk-C6Q5SG76.js";var ya=yo((en,Zn)=>{var va,Xi;va=en,Xi=()=>(()=>{var n={d:(s,v)=>{for(var k in v)n.o(v,k)&&!n.o(s,k)&&Object.defineProperty(s,k,{enumerable:!0,get:v[k]})},o:(s,v)=>Object.prototype.hasOwnProperty.call(s,v)},h={};n.d(h,{default:()=>qi});var t={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(t.allowedTagList),Object.defineProperty(t,"allowedTagList",{configurable:!1,writable:!1}),t.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(t.fromCharCodeKeyCode),Object.defineProperty(t,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),t.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(t.keyName._allFnKeys),Object.freeze(t.keyName._someNonPrintableKeys),Object.freeze(t.keyName._directionKeys),Object.freeze(t.keyName),Object.defineProperty(t,"keyName",{configurable:!1,writable:!1}),Object.freeze(t);let l=t;function c(s){return function(v){if(Array.isArray(v))return ge(v)}(s)||function(v){if(typeof Symbol<"u"&&v[Symbol.iterator]!=null||v["@@iterator"]!=null)return Array.from(v)}(s)||L(s)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function _(){return _=Object.assign?Object.assign.bind():function(s){for(var v=1;v<arguments.length;v++){var k=arguments[v];for(var F in k)Object.prototype.hasOwnProperty.call(k,F)&&(s[F]=k[F])}return s},_.apply(this,arguments)}function A(s,v){return function(k){if(Array.isArray(k))return k}(s)||function(k,F){var e=k==null?null:typeof Symbol<"u"&&k[Symbol.iterator]||k["@@iterator"];if(e!=null){var i,r,o,u,g=[],S=!0,E=!1;try{if(o=(e=e.call(k)).next,F===0){if(Object(e)!==e)return;S=!1}else for(;!(S=(i=o.call(e)).done)&&(g.push(i.value),g.length!==F);S=!0);}catch(O){E=!0,r=O}finally{try{if(!S&&e.return!=null&&(u=e.return(),Object(u)!==u))return}finally{if(E)throw r}}return g}}(s,v)||L(s,v)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function L(s,v){if(s){if(typeof s=="string")return ge(s,v);var k=Object.prototype.toString.call(s).slice(8,-1);return k==="Object"&&s.constructor&&(k=s.constructor.name),k==="Map"||k==="Set"?Array.from(s):k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k)?ge(s,v):void 0}}function ge(s,v){(v==null||v>s.length)&&(v=s.length);for(var k=0,F=new Array(v);k<v;k++)F[k]=s[k];return F}function _e(s){return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},_e(s)}function dt(s,v){for(var k=0;k<v.length;k++){var F=v[k];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,i=void 0,i=function(r,o){if(_e(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(_e(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),_e(i)==="symbol"?i:String(i)),F)}var e,i}var a=function(){function s(){(function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")})(this,s)}var v,k,F;return v=s,F=[{key:"isNull",value:function(e){return e===null}},{key:"isUndefined",value:function(e){return e===void 0}},{key:"isUndefinedOrNullOrEmpty",value:function(e){return e==null||e===""}},{key:"isString",value:function(e){return typeof e=="string"||e instanceof String}},{key:"isEmptyString",value:function(e){return e===""}},{key:"isBoolean",value:function(e){return typeof e=="boolean"}},{key:"isTrueOrFalseString",value:function(e){var i=String(e).toLowerCase();return i==="true"||i==="false"}},{key:"isObject",value:function(e){return _e(e)==="object"&&e!==null&&!Array.isArray(e)}},{key:"isEmptyObj",value:function(e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))return!1;return!0}},{key:"isNumberStrict",value:function(e){return typeof e=="number"}},{key:"isNumber",value:function(e){return!this.isArray(e)&&!isNaN(parseFloat(e))&&isFinite(e)}},{key:"isDigit",value:function(e){return/\d/.test(e)}},{key:"isNumberOrArabic",value:function(e){var i=this.arabicToLatinNumbers(e,!1,!0,!0);return this.isNumber(i)}},{key:"isInt",value:function(e){return typeof e=="number"&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)}},{key:"isFunction",value:function(e){return typeof e=="function"}},{key:"contains",value:function(e,i){return!(!this.isString(e)||!this.isString(i)||e===""||i==="")&&e.indexOf(i)!==-1}},{key:"isInArray",value:function(e,i){return!(!this.isArray(i)||i===[]||this.isUndefined(e))&&i.indexOf(e)!==-1}},{key:"isArray",value:function(e){if(Object.prototype.toString.call([])==="[object Array]")return Array.isArray(e)||_e(e)==="object"&&Object.prototype.toString.call(e)==="[object Array]";throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(e){return typeof Element<"u"&&e instanceof Element}},{key:"isInputElement",value:function(e){return this.isElement(e)&&e.tagName.toLowerCase()==="input"}},{key:"decimalPlaces",value:function(e){var i=A(e.split("."),2)[1];return this.isUndefined(i)?0:i.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(e){var i=A(String(Math.abs(e)).split("."),2)[1];if(this.isUndefined(i))return 0;var r=i.lastIndexOf("0");return r===-1?r=0:r+=2,r}},{key:"keyCodeNumber",value:function(e){return e.which===void 0?e.keyCode:e.which}},{key:"character",value:function(e){var i;if(e.key==="Unidentified"||e.key===void 0||this.isSeleniumBot()){var r=this.keyCodeNumber(e);if(r===229)return l.keyName.AndroidDefault;var o=l.fromCharCodeKeyCode[r];i=s.isUndefinedOrNullOrEmpty(o)?String.fromCharCode(r):o}else switch(e.key){case"Add":i=l.keyName.NumpadPlus;break;case"Apps":i=l.keyName.ContextMenu;break;case"Crsel":i=l.keyName.CrSel;break;case"Decimal":i=e.char?e.char:l.keyName.NumpadDot;break;case"Del":i=l.keyName.Delete;break;case"Divide":i=l.keyName.NumpadSlash;break;case"Down":i=l.keyName.DownArrow;break;case"Esc":i=l.keyName.Esc;break;case"Exsel":i=l.keyName.ExSel;break;case"Left":i=l.keyName.LeftArrow;break;case"Meta":case"Super":i=l.keyName.OSLeft;break;case"Multiply":i=l.keyName.NumpadMultiply;break;case"Right":i=l.keyName.RightArrow;break;case"Spacebar":i=l.keyName.Space;break;case"Subtract":i=l.keyName.NumpadMinus;break;case"Up":i=l.keyName.UpArrow;break;default:i=e.key}return i}},{key:"browser",value:function(){var e,i=navigator.userAgent,r=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(r[1])?{name:"ie",version:(e=/\brv[ :]+(\d+)/g.exec(i)||[])[1]||""}:r[1]==="Chrome"&&(e=i.match(/\b(OPR|Edge)\/(\d+)/))!==null?{name:e[1].replace("OPR","opera"),version:e[2]}:(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],(e=i.match(/version\/(\d+)/i))!==null&&r.splice(1,1,e[1]),{name:r[0].toLowerCase(),version:r[1]})}},{key:"isSeleniumBot",value:function(){return window.navigator.webdriver===!0}},{key:"isNegative",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"-",r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return e===i||e!==""&&(s.isNumber(e)?e<0:r?this.contains(e,i):this.isNegativeStrict(e,i))}},{key:"isNegativeStrict",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"-";return e.charAt(0)===i}},{key:"isNegativeWithBrackets",value:function(e,i,r){return e.charAt(0)===i&&this.contains(e,r)}},{key:"isZeroOrHasNoValue",value:function(e){return!/[1-9]/g.test(e)}},{key:"setRawNegativeSign",value:function(e){return this.isNegativeStrict(e,"-")?e:"-".concat(e)}},{key:"replaceCharAt",value:function(e,i,r){return"".concat(e.substr(0,i)).concat(r).concat(e.substr(i+r.length))}},{key:"clampToRangeLimits",value:function(e,i){return Math.max(i.minimumValue,Math.min(i.maximumValue,e))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(e,i,r){for(var o=new RegExp("[0-9".concat(r,"-]")),u=0,g=0;g<i;g++)o.test(e[g])&&u++;return u}},{key:"findCaretPositionInFormattedNumber",value:function(e,i,r,o){var u,g=r.length,S=e.length,E=0;for(u=0;u<g&&E<S&&E<i;u++)(e[E]===r[u]||e[E]==="."&&r[u]===o)&&E++;return u}},{key:"countCharInText",value:function(e,i){for(var r=0,o=0;o<i.length;o++)i[o]===e&&r++;return r}},{key:"convertCharacterCountToIndexPosition",value:function(e){return Math.max(e,e-1)}},{key:"getElementSelection",value:function(e){var i,r={};try{i=this.isUndefined(e.selectionStart)}catch{i=!1}try{if(i){var o=window.getSelection().getRangeAt(0);r.start=o.startOffset,r.end=o.endOffset,r.length=r.end-r.start}else r.start=e.selectionStart,r.end=e.selectionEnd,r.length=r.end-r.start}catch{r.start=0,r.end=0,r.length=0}return r}},{key:"setElementSelection",value:function(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(this.isUndefinedOrNullOrEmpty(r)&&(r=i),this.isInputElement(e))e.setSelectionRange(i,r);else if(!s.isNull(e.firstChild)){var o=document.createRange();o.setStart(e.firstChild,i),o.setEnd(e.firstChild,r);var u=window.getSelection();u.removeAllRanges(),u.addRange(o)}}},{key:"throwError",value:function(e){throw new Error(e)}},{key:"warning",value:function(e){(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&console.warn("Warning: ".concat(e))}},{key:"isWheelEvent",value:function(e){return e instanceof WheelEvent}},{key:"isWheelUpEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY<0}},{key:"isWheelDownEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY>0}},{key:"isWheelEventWithZeroDeltaY",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)&&e.deltaY===0}},{key:"forceDecimalPlaces",value:function(e,i){var r=A(String(e).split("."),2),o=r[0],u=r[1];return u?"".concat(o,".").concat(u.substr(0,i)):e}},{key:"roundToNearest",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;return e===0?0:(i===0&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(e/i)*i)}},{key:"modifyAndRoundToNearestAuto",value:function(e,i,r){e=Number(this.forceDecimalPlaces(e,r));var o=Math.abs(e);if(o>=0&&o<1){var u,g=Math.pow(10,-r);if(e===0)return i?g:-g;var S,E=r,O=this.indexFirstNonZeroDecimalPlace(e);return u=O>=E-1?g:Math.pow(10,-(O+1)),S=i?e+u:e-u,this.roundToNearest(S,u)}e=parseInt(e,10);var d,T=Math.abs(e).toString().length;switch(T){case 1:d=0;break;case 2:case 3:d=1;break;case 4:case 5:d=2;break;default:d=T-3}var D,$=Math.pow(10,d);return(D=i?e+$:e-$)<=10&&D>=-10?D:this.roundToNearest(D,$)}},{key:"addAndRoundToNearestAuto",value:function(e,i){return this.modifyAndRoundToNearestAuto(e,!0,i)}},{key:"subtractAndRoundToNearestAuto",value:function(e,i){return this.modifyAndRoundToNearestAuto(e,!1,i)}},{key:"arabicToLatinNumbers",value:function(e){var i=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(this.isNull(e))return e;var u=e.toString();if(u==="")return e;if(u.match(/[٠١٢٣٤٥٦٧٨٩۴۵۶]/g)===null)return i&&(u=Number(u)),u;r&&(u=u.replace(/٫/,".")),o&&(u=u.replace(/٬/g,"")),u=u.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(S){return S.charCodeAt(0)-1632}).replace(/[۰۱۲۳۴۵۶۷۸۹]/g,function(S){return S.charCodeAt(0)-1776});var g=Number(u);return isNaN(g)?g:(i&&(u=g),u)}},{key:"triggerEvent",value:function(e){var i,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],g=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];window.CustomEvent?i=new CustomEvent(e,{detail:o,bubbles:u,cancelable:g}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,u,g,{detail:o}),r.dispatchEvent(i)}},{key:"parseStr",value:function(e){var i,r,o,u,g={};if(e===0&&1/e<0&&(e="-0"),e=e.toString(),this.isNegativeStrict(e,"-")?(e=e.slice(1),g.s=-1):g.s=1,(i=e.indexOf("."))>-1&&(e=e.replace(".","")),i<0&&(i=e.length),(r=e.search(/[1-9]/i)===-1?e.length:e.search(/[1-9]/i))===(o=e.length))g.e=0,g.c=[0];else{for(u=o-1;e.charAt(u)==="0";u-=1)o-=1;for(o-=1,g.e=i-r-1,g.c=[],i=0;r<=o;r+=1)g.c[i]=+e.charAt(r),i+=1}return g}},{key:"testMinMax",value:function(e,i){var r=i.c,o=e.c,u=i.s,g=e.s,S=i.e,E=e.e;if(!r[0]||!o[0])return r[0]?u:o[0]?-g:0;if(u!==g)return u;var O=u<0;if(S!==E)return S>E^O?1:-1;for(u=-1,g=(S=r.length)<(E=o.length)?S:E,u+=1;u<g;u+=1)if(r[u]!==o[u])return r[u]>o[u]^O?1:-1;return S===E?0:S>E^O?1:-1}},{key:"randomString",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5;return Math.random().toString(36).substr(2,e)}},{key:"domElement",value:function(e){var i;return i=s.isString(e)?document.querySelector(e):e,i}},{key:"getElementValue",value:function(e){return e.tagName.toLowerCase()==="input"?e.value:this.text(e)}},{key:"setElementValue",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;e.tagName.toLowerCase()==="input"?e.value=i:e.textContent=i}},{key:"setInvalidState",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Invalid";(i===""||this.isNull(i))&&this.throwError("Cannot set the invalid state with an empty message."),e.setCustomValidity(i)}},{key:"setValidState",value:function(e){e.setCustomValidity("")}},{key:"cloneObject",value:function(e){return _({},e)}},{key:"camelize",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"-",r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],o=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3];if(this.isNull(e))return null;r&&(e=e.replace(/^data-/,""));var u=e.split(i).map(function(g){return"".concat(g.charAt(0).toUpperCase()).concat(g.slice(1))});return u=u.join(""),o&&(u="".concat(u.charAt(0).toLowerCase()).concat(u.slice(1))),u}},{key:"text",value:function(e){var i=e.nodeType;return i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e.textContent:i===Node.TEXT_NODE?e.nodeValue:""}},{key:"setText",value:function(e,i){var r=e.nodeType;r!==Node.ELEMENT_NODE&&r!==Node.DOCUMENT_NODE&&r!==Node.DOCUMENT_FRAGMENT_NODE||(e.textContent=i)}},{key:"filterOut",value:function(e,i){var r=this;return e.filter(function(o){return!r.isInArray(o,i)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(e){if((e=String(e))==="")return"";var i=A(e.split("."),2),r=i[0],o=i[1];if(this.isUndefinedOrNullOrEmpty(o))return r;var u=o.replace(/0+$/g,"");return u===""?r:"".concat(r,".").concat(u)}},{key:"getHoveredElement",value:function(){var e=c(document.querySelectorAll(":hover"));return e[e.length-1]}},{key:"arrayTrim",value:function(e,i){var r=e.length;return r===0||i>r?e:i<0?[]:(e.length=parseInt(i,10),e)}},{key:"arrayUnique",value:function(){var e;return c(new Set((e=[]).concat.apply(e,arguments)))}},{key:"mergeMaps",value:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return new Map(i.reduce(function(o,u){return o.concat(c(u))},[]))}},{key:"objectKeyLookup",value:function(e,i){var r=Object.entries(e).find(function(u){return u[1]===i}),o=null;return r!==void 0&&(o=r[0]),o}},{key:"insertAt",value:function(e,i,r){if(r>(e=String(e)).length)throw new Error("The given index is out of the string range.");if(i.length!==1)throw new Error("The given string `char` should be only one character long.");return e===""&&r===0?i:"".concat(e.slice(0,r)).concat(i).concat(e.slice(r))}},{key:"scientificToDecimal",value:function(e){var i=Number(e);if(isNaN(i))return NaN;if(e=String(e),!this.contains(e,"e")&&!this.contains(e,"E"))return e;var r=A(e.split(/e/i),2),o=r[0],u=r[1],g=o<0;g&&(o=o.replace("-",""));var S=+u<0;S&&(u=u.replace("-",""));var E,O=A(o.split(/\./),2),d=O[0],T=O[1];return S?(E=d.length>u?this.insertAt(d,".",d.length-u):"0.".concat("0".repeat(u-d.length)).concat(d),E="".concat(E).concat(T||"")):T?(o="".concat(d).concat(T),E=u<T.length?this.insertAt(o,".",+u+d.length):"".concat(o).concat("0".repeat(u-T.length))):(o=o.replace(".",""),E="".concat(o).concat("0".repeat(Number(u)))),g&&(E="-".concat(E)),E}}],(k=null)&&dt(v.prototype,k),F&&dt(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function pt(s){return pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},pt(s)}function Ut(s,v){for(var k=0;k<v.length;k++){var F=v[k];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,i=void 0,i=function(r,o){if(pt(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(pt(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),pt(i)==="symbol"?i:String(i)),F)}var e,i}var jt=function(){function s(e){if(function(i,r){if(!(i instanceof r))throw new TypeError("Cannot call a class as a function")}(this,s),e===null)throw new Error("Invalid AST")}var v,k,F;return v=s,(k=[{key:"evaluate",value:function(e){if(e==null)throw new Error("Invalid AST sub-tree");if(e.type==="number")return e.value;if(e.type==="unaryMinus")return-this.evaluate(e.left);var i=this.evaluate(e.left),r=this.evaluate(e.right);switch(e.type){case"op_+":return Number(i)+Number(r);case"op_-":return i-r;case"op_*":return i*r;case"op_/":return i/r;default:throw new Error("Invalid operator '".concat(e.type,"'"))}}}])&&Ut(v.prototype,k),F&&Ut(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function Lt(s){return Lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Lt(s)}function on(s,v){for(var k=0;k<v.length;k++){var F=v[k];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,i=void 0,i=function(r,o){if(Lt(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(Lt(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),Lt(i)==="symbol"?i:String(i)),F)}var e,i}var ht=function(){function s(){(function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")})(this,s)}var v,k,F;return v=s,F=[{key:"createNode",value:function(e,i,r){var o=new s;return o.type=e,o.left=i,o.right=r,o}},{key:"createUnaryNode",value:function(e){var i=new s;return i.type="unaryMinus",i.left=e,i.right=null,i}},{key:"createLeaf",value:function(e){var i=new s;return i.type="number",i.value=e,i}}],(k=null)&&on(v.prototype,k),F&&on(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function Jt(s){return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Jt(s)}function pi(s,v){for(var k=0;k<v.length;k++){var F=v[k];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,i=void 0,i=function(r,o){if(Jt(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(Jt(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),Jt(i)==="symbol"?i:String(i)),F)}var e,i}function kt(s,v,k){return v&&pi(s.prototype,v),k&&pi(s,k),Object.defineProperty(s,"prototype",{writable:!1}),s}var fe=kt(function s(v,k,F){(function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")})(this,s),this.type=v,this.value=k,this.symbol=F});function w(s){return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},w(s)}function C(s,v){for(var k=0;k<v.length;k++){var F=v[k];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,i=void 0,i=function(r,o){if(w(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(w(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),w(i)==="symbol"?i:String(i)),F)}var e,i}var I=function(){function s(e){(function(i,r){if(!(i instanceof r))throw new TypeError("Cannot call a class as a function")})(this,s),this.text=e,this.textLength=e.length,this.index=0,this.token=new fe("Error",0,0)}var v,k,F;return v=s,k=[{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(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:".";if(this._skipSpaces(),this.textLength===this.index)return this.token.type="EOT",this.token;if(a.isDigit(this.text[this.index]))return this.token.type="num",this.token.value=this._getNumber(e),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(this.token.type==="Error")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(e){this._skipSpaces();for(var i=this.index;this.index<=this.textLength&&a.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===e&&this.index++;this.index<=this.textLength&&a.isDigit(this.text[this.index]);)this.index++;if(this.index===i)throw new Error("No number has been found while it was expected");return this.text.substring(i,this.index).replace(e,".")}}],k&&C(v.prototype,k),F&&C(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function z(s){return z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},z(s)}function U(s,v){for(var k=0;k<v.length;k++){var F=v[k];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,i=void 0,i=function(r,o){if(z(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(z(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),z(i)==="symbol"?i:String(i)),F)}var e,i}var ee=function(){function s(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".";return function(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}(this,s),this.text=e,this.decimalCharacter=i,this.lexer=new I(e),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}var v,k,F;return v=s,(k=[{key:"_exp",value:function(){var e=this._term(),i=this._moreExp();return ht.createNode("op_+",e,i)}},{key:"_moreExp",value:function(){var e,i;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),i=this._moreExp(),ht.createNode("op_+",i,e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),i=this._moreExp(),ht.createNode("op_-",i,e)}return ht.createLeaf(0)}},{key:"_term",value:function(){var e=this._factor(),i=this._moreTerms();return ht.createNode("op_*",e,i)}},{key:"_moreTerms",value:function(){var e,i;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),i=this._moreTerms(),ht.createNode("op_*",i,e);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),i=this._moreTerms(),ht.createNode("op_/",i,e)}return ht.createLeaf(1)}},{key:"_factor",value:function(){var e,i,r;switch(this.token.type){case"num":return r=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),ht.createLeaf(r);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),i=this._factor(),ht.createUnaryNode(i);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._exp(),this._match(")"),e;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(e){var i=this.lexer.getIndex()-1;if(this.text[i]!==e)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(i,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}])&&U(v.prototype,k),F&&U(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function Ce(s){return function(v){if(Array.isArray(v))return Q(v)}(s)||function(v){if(typeof Symbol<"u"&&v[Symbol.iterator]!=null||v["@@iterator"]!=null)return Array.from(v)}(s)||it(s)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function te(s,v){return function(k){if(Array.isArray(k))return k}(s)||function(k,F){var e=k==null?null:typeof Symbol<"u"&&k[Symbol.iterator]||k["@@iterator"];if(e!=null){var i,r,o,u,g=[],S=!0,E=!1;try{if(o=(e=e.call(k)).next,F===0){if(Object(e)!==e)return;S=!1}else for(;!(S=(i=o.call(e)).done)&&(g.push(i.value),g.length!==F);S=!0);}catch(O){E=!0,r=O}finally{try{if(!S&&e.return!=null&&(u=e.return(),Object(u)!==u))return}finally{if(E)throw r}}return g}}(s,v)||it(s,v)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
5
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function it(s,v){if(s){if(typeof s=="string")return Q(s,v);var k=Object.prototype.toString.call(s).slice(8,-1);return k==="Object"&&s.constructor&&(k=s.constructor.name),k==="Map"||k==="Set"?Array.from(s):k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k)?Q(s,v):void 0}}function Q(s,v){(v==null||v>s.length)&&(v=s.length);for(var k=0,F=new Array(v);k<v;k++)F[k]=s[k];return F}function se(){return se=Object.assign?Object.assign.bind():function(s){for(var v=1;v<arguments.length;v++){var k=arguments[v];for(var F in k)Object.prototype.hasOwnProperty.call(k,F)&&(s[F]=k[F])}return s},se.apply(this,arguments)}function J(s){return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},J(s)}function Re(s,v){for(var k=0;k<v.length;k++){var F=v[k];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,ne(F.key),F)}}function H(s,v,k){return(v=ne(v))in s?Object.defineProperty(s,v,{value:k,enumerable:!0,configurable:!0,writable:!0}):s[v]=k,s}function ne(s){var v=function(k,F){if(J(k)!=="object"||k===null)return k;var e=k[Symbol.toPrimitive];if(e!==void 0){var i=e.call(k,F||"default");if(J(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(k)}(s,"string");return J(v)==="symbol"?v:String(v)}var j,b=function(){function s(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;(function(d,T){if(!(d instanceof T))throw new TypeError("Cannot call a class as a function")})(this,s);var u=s._setArgumentsValues(i,r,o),g=u.domElement,S=u.initialValue,E=u.userOptions;if(this.domElement=g,this.defaultRawValue="",this._setSettings(E,!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(S);else{var O;if(a.isNull(S))switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.min:O=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:O=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:O="0";break;case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:O="";break;case s.options.emptyInputBehavior.null:O=null;break;default:O=this.settings.emptyInputBehavior}else O=S;this._setElementAndRawValue(O)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(S),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(d){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;e.autoNumericLocalList.forEach(function(D){D.set(d,T)})},setUnformatted:function(d){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;e.autoNumericLocalList.forEach(function(D){D.setUnformatted(d,T)})},get:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.get())}),e._executeCallback(T,d),T},getNumericString:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.getNumericString())}),e._executeCallback(T,d),T},getFormatted:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.getFormatted())}),e._executeCallback(T,d),T},getNumber:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.getNumber())}),e._executeCallback(T,d),T},getLocalized:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.getLocalized())}),e._executeCallback(T,d),T},reformat:function(){e.autoNumericLocalList.forEach(function(d){d.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(d){d.unformat()})},unformatLocalized:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;e.autoNumericLocalList.forEach(function(T){T.unformatLocalized(d)})},update:function(){for(var d=arguments.length,T=new Array(d),D=0;D<d;D++)T[D]=arguments[D];e.autoNumericLocalList.forEach(function($){$.update.apply($,T)})},isPristine:function(){var d=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],T=!0;return e.autoNumericLocalList.forEach(function(D){T&&!D.isPristine(d)&&(T=!1)}),T},clear:function(){var d=arguments.length>0&&arguments[0]!==void 0&&arguments[0];e.autoNumericLocalList.forEach(function(T){T.clear(d)})},remove:function(){e.autoNumericLocalList.forEach(function(d){d.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(d){d.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(d){d.nuke()})},has:function(d){return d instanceof s?e.autoNumericLocalList.has(d.node()):e.autoNumericLocalList.has(d)},addObject:function(d){var T,D;d instanceof s?(T=d.node(),D=d):(T=d,D=s.getAutoNumericElement(T)),e._hasLocalList()||e._createLocalList();var $,W=D._getLocalList();W.size===0&&(D._createLocalList(),W=D._getLocalList()),W instanceof Map?$=a.mergeMaps(e._getLocalList(),W):(e._addToLocalList(T,D),$=e._getLocalList()),$.forEach(function(ie){ie._setLocalList($)})},removeObject:function(d){var T,D,$=arguments.length>1&&arguments[1]!==void 0&&arguments[1];d instanceof s?(T=d.node(),D=d):(T=d,D=s.getAutoNumericElement(T));var W=e.autoNumericLocalList;e.autoNumericLocalList.delete(T),W.forEach(function(ie){ie._setLocalList(e.autoNumericLocalList)}),$||T!==e.node()?D._createLocalList():D._setLocalList(new Map)},empty:function(){var d=arguments.length>0&&arguments[0]!==void 0&&arguments[0];e.autoNumericLocalList.forEach(function(T){d?T._createLocalList():T._setLocalList(new Map)})},elements:function(){var d=[];return e.autoNumericLocalList.forEach(function(T){d.push(T.node())}),d},getList:function(){return e.autoNumericLocalList},size:function(){return e.autoNumericLocalList.size}},this.options={reset:function(){return e.settings={rawValue:e.defaultRawValue},e.update(s.defaultSettings),e},allowDecimalPadding:function(d){return e.update({allowDecimalPadding:d}),e},alwaysAllowDecimalCharacter:function(d){return e.update({alwaysAllowDecimalCharacter:d}),e},caretPositionOnFocus:function(d){return e.settings.caretPositionOnFocus=d,e},createLocalList:function(d){return e.settings.createLocalList=d,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(d){return e.update({currencySymbol:d}),e},currencySymbolPlacement:function(d){return e.update({currencySymbolPlacement:d}),e},decimalCharacter:function(d){return e.update({decimalCharacter:d}),e},decimalCharacterAlternative:function(d){return e.settings.decimalCharacterAlternative=d,e},decimalPlaces:function(d){return a.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:d}),e},decimalPlacesRawValue:function(d){return e.update({decimalPlacesRawValue:d}),e},decimalPlacesShownOnBlur:function(d){return e.update({decimalPlacesShownOnBlur:d}),e},decimalPlacesShownOnFocus:function(d){return e.update({decimalPlacesShownOnFocus:d}),e},defaultValueOverride:function(d){return e.update({defaultValueOverride:d}),e},digitalGroupSpacing:function(d){return e.update({digitalGroupSpacing:d}),e},digitGroupSeparator:function(d){return e.update({digitGroupSeparator:d}),e},divisorWhenUnfocused:function(d){return e.update({divisorWhenUnfocused:d}),e},emptyInputBehavior:function(d){return e.rawValue===null&&d!==s.options.emptyInputBehavior.null&&(a.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(d,"), 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:d}),e},eventBubbles:function(d){return e.settings.eventBubbles=d,e},eventIsCancelable:function(d){return e.settings.eventIsCancelable=d,e},failOnUnknownOption:function(d){return e.settings.failOnUnknownOption=d,e},formatOnPageLoad:function(d){return e.settings.formatOnPageLoad=d,e},formulaMode:function(d){return e.settings.formulaMode=d,e},historySize:function(d){return e.settings.historySize=d,e},invalidClass:function(d){return e.settings.invalidClass=d,e},isCancellable:function(d){return e.settings.isCancellable=d,e},leadingZero:function(d){return e.update({leadingZero:d}),e},maximumValue:function(d){return e.update({maximumValue:d}),e},minimumValue:function(d){return e.update({minimumValue:d}),e},modifyValueOnUpDownArrow:function(d){return e.settings.modifyValueOnUpDownArrow=d,e},modifyValueOnWheel:function(d){return e.settings.modifyValueOnWheel=d,e},negativeBracketsTypeOnBlur:function(d){return e.update({negativeBracketsTypeOnBlur:d}),e},negativePositiveSignPlacement:function(d){return e.update({negativePositiveSignPlacement:d}),e},negativeSignCharacter:function(d){return e.update({negativeSignCharacter:d}),e},negativePositiveSignBehavior:function(d){return e.settings.negativePositiveSignBehavior=d,e},noEventListeners:function(d){return d===s.options.noEventListeners.noEvents&&e.settings.noEventListeners===s.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:d}),e},onInvalidPaste:function(d){return e.settings.onInvalidPaste=d,e},outputFormat:function(d){return e.settings.outputFormat=d,e},overrideMinMaxLimits:function(d){return e.update({overrideMinMaxLimits:d}),e},positiveSignCharacter:function(d){return e.update({positiveSignCharacter:d}),e},rawValueDivisor:function(d){return e.update({rawValueDivisor:d}),e},readOnly:function(d){return e.settings.readOnly=d,e._setWritePermissions(),e},roundingMethod:function(d){return e.update({roundingMethod:d}),e},saveValueToSessionStorage:function(d){return e.update({saveValueToSessionStorage:d}),e},symbolWhenUnfocused:function(d){return e.update({symbolWhenUnfocused:d}),e},selectNumberOnly:function(d){return e.settings.selectNumberOnly=d,e},selectOnFocus:function(d){return e.settings.selectOnFocus=d,e},serializeSpaces:function(d){return e.settings.serializeSpaces=d,e},showOnlyNumbersOnFocus:function(d){return e.update({showOnlyNumbersOnFocus:d}),e},showPositiveSign:function(d){return e.update({showPositiveSign:d}),e},showWarnings:function(d){return e.settings.showWarnings=d,e},styleRules:function(d){return e.update({styleRules:d}),e},suffixText:function(d){return e.update({suffixText:d}),e},unformatOnHover:function(d){return e.settings.unformatOnHover=d,e},unformatOnSubmit:function(d){return e.settings.unformatOnSubmit=d,e},upDownStep:function(d){return e.settings.upDownStep=d,e},valuesToStrings:function(d){return e.update({valuesToStrings:d}),e},watchExternalChanges:function(d){return e.update({watchExternalChanges:d}),e},wheelOn:function(d){return e.settings.wheelOn=d,e},wheelStep:function(d){return e.settings.wheelStep=d,e}},this._triggerEvent(s.events.initialized,this.domElement,{newValue:a.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var v,k,F;return v=s,k=[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=a.scientificToDecimal(this.domElement.getAttribute("value")),a.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,a.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this.compositioning=!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._onCompositionstartFunc=function(i){e._onCompositionstart(i)},this._onCompositionendFunc=function(i){e._onCompositionend(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.domElement.addEventListener("compositionstart",this._onCompositionstartFunc,!1),this.domElement.addEventListener("compositionend",this._onCompositionendFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,s._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.domElement.removeEventListener("compositionstart",this._onCompositionstartFunc,!1),this.domElement.removeEventListener("compositionend",this._onCompositionendFunc,!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;a.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(!a.isNull(this.parentForm)){var e=this._getParentFormCounter();e===1?(this.parentForm.removeEventListener("submit",this._getFormHandlerFunction().submitFn,!1),this.parentForm.removeEventListener("reset",this._getFormHandlerFunction().resetFn,!1),this._removeFormDataSetInfo()):e>1?this._decrementParentFormCounter():a.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(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this._getFormElement(e).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this._getFormElement(e).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return"anFormHandler"in this._getFormElement(e).dataset}},{key:"_getFormElement",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return a.isNull(e)?this.parentForm:e}},{key:"_storeFormHandlerFunction",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var i=a.randomString();this._getFormElement(e).dataset.anFormHandler=i,window.aNFormHandlerMap.set(i,{submitFn:this._onFormSubmitFunc,resetFn:this._onFormResetFunc})}},{key:"_getFormHandlerKey",value:function(){this._hasFormHandlerFunction()||a.throwError("Unable to retrieve the form handler name");var e=this.parentForm.dataset.anFormHandler;return e===""&&a.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(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&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(!a.isUndefined(this.getterSetter)){var i=this.getterSetter,r=i.set,o=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return o.call(e.domElement)},set:function(u){r.call(e.domElement,u),e.settings.watchExternalChanges&&!e.internalModification&&e.set(u)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!a.isUndefined(this.getterSetter)){var i=this.getterSetter,r=i.set,o=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return o.call(e.domElement)},set:function(u){r.call(e.domElement,u)}})}}},{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=this.historyTable.length===0;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:a.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,i){var o=a.getElementSelection(this.domElement);this.selectionStart=o.start,this.selectionEnd=o.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),this.historyTable.length>1&&(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(){var e;if(arguments.length>0&&arguments[0]!==void 0&&!arguments[0]?(e=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(e=this.historyTableIndex>0)&&this.historyTableIndex--,e){var i=this.historyTable[this.historyTableIndex];this.set(i.value,null,!1),a.setElementSelection(this.domElement,i.start,i.end)}}},{key:"_historyTableUndo",value:function(){this._historyTableUndoOrRedo(!0)}},{key:"_historyTableRedo",value:function(){this._historyTableUndoOrRedo(!1)}},{key:"_historyTableForget",value:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,i=[],r=0;r<e;r++)i.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return i.length===1?i[0]:i}},{key:"_historyTableCurrentValueUsed",value:function(){var e=this.historyTableIndex;return e<0&&(e=0),a.isUndefinedOrNullOrEmpty(this.historyTable[e])?"":this.historyTable[e].value}},{key:"_parseStyleRules",value:function(){var e=this;a.isUndefinedOrNullOrEmpty(this.settings.styleRules)||this.rawValue===""||(a.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)||(this.rawValue>=0?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),a.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),a.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||this.settings.styleRules.ranges.length===0||this.settings.styleRules.ranges.forEach(function(i){e.rawValue>=i.min&&e.rawValue<i.max?e._addCSSClass(i.class):e._removeCSSClass(i.class)}),a.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||this.settings.styleRules.userDefined.length===0||this.settings.styleRules.userDefined.forEach(function(i){if(a.isFunction(i.callback))if(a.isString(i.classes))i.callback(e.rawValue)?e._addCSSClass(i.classes):e._removeCSSClass(i.classes);else if(a.isArray(i.classes))if(i.classes.length===2)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(i.classes.length>2){var r=i.callback(e.rawValue);a.isArray(r)?i.classes.forEach(function(o,u){a.isInArray(u,r)?e._addCSSClass(o):e._removeCSSClass(o)}):a.isInt(r)?i.classes.forEach(function(o,u){u===r?e._addCSSClass(o):e._removeCSSClass(o)}):a.isNull(r)?i.classes.forEach(function(o){e._removeCSSClass(o)}):a.throwError("The callback result is not an array nor a valid array index, ".concat(J(r)," given."))}else a.throwError("The classes attribute is not valid for the `styleRules` option.");else a.isUndefinedOrNullOrEmpty(i.classes)?i.callback(e):a.throwError("The callback/classes structure is not valid for the `styleRules` option.");else a.warning("The given `styleRules` callback is not a function, ".concat(J(i.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),o=0;o<i;o++)r[o]=arguments[o];Array.isArray(r)&&Array.isArray(r[0])&&(r=r[0]);var u=a.cloneObject(this.settings),g=this.rawValue,S={};a.isUndefinedOrNullOrEmpty(r)||r.length===0?S=null:r.length>=1&&r.forEach(function(E){e.constructor._isPreDefinedOptionValid(E)&&(E=e.constructor._getOptionObject(E)),se(S,E)});try{this._setSettings(S,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(g)}catch(E){return this._setSettings(u,!0),a.throwError("Unable to update the settings, those are invalid: [".concat(E,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e){var i,r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,u=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(a.isUndefined(e))return a.warning("You are trying to set an 'undefined' value ; an error could have occurred.",this.settings.showWarnings),this;if(a.isNull(o)||this._setSettings(o,!0),e===null&&this.settings.emptyInputBehavior!==s.options.emptyInputBehavior.null)return a.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(e===null)return this._setElementAndRawValue(null,null,u),this._saveValueToPersistentStorage(),this;if(i=this.constructor._toNumericValue(e,this.settings),isNaN(Number(i)))return a.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("",u),this;if(i==="")switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:i=0;break;case s.options.emptyInputBehavior.min:i=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:i=this.settings.maximumValue;break;default:a.isNumber(this.settings.emptyInputBehavior)&&(i=Number(this.settings.emptyInputBehavior))}if(i!==""){var g=te(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),S=g[0],E=g[1];if(S&&E&&this.settings.valuesToStrings&&this._checkValuesToStrings(i))return this._setElementAndRawValue(this.settings.valuesToStrings[i],i,u),this._saveValueToPersistentStorage(),this;if(a.isZeroOrHasNoValue(i)&&(i="0"),S&&E){var O=this.constructor._roundRawValue(i,this.settings);return O=this._trimLeadingAndTrailingZeros(O.replace(this.settings.decimalCharacter,".")),i=this._getRawValueToFormat(i),this.isFocused?i=this.constructor._roundFormattedValueShownOnFocus(i,this.settings):(this.settings.divisorWhenUnfocused&&(i=(i/=this.settings.divisorWhenUnfocused).toString()),i=this.constructor._roundFormattedValueShownOnBlur(i,this.settings)),i=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(i,this.settings),i=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue,O),!this.isFocused&&this.settings.symbolWhenUnfocused&&(i="".concat(i).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(i,O,u),this._setValidOrInvalidState(O),this}return this._triggerRangeEvents(S,E),a.throwError("The value [".concat(i,"] 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("",u),this}return r=this.settings.emptyInputBehavior===s.options.emptyInputBehavior.always?this.settings.currencySymbol:"",this._setElementAndRawValue(r,"",u),this}},{key:"setUnformatted",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(e===null||a.isUndefined(e))return this;a.isNull(i)||this._setSettings(i,!0);var r=this.constructor._removeBrackets(e,this.settings),o=this.constructor._stripAllNonNumberCharacters(r,this.settings,!0,this.isFocused);return a.isNumber(o)||a.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(o,this.settings)?this.setValue(e):a.throwError("The value is out of the range limits [".concat(this.settings.minimumValue,", ").concat(this.settings.maximumValue,"].")),this}},{key:"setValue",value:function(e){var i=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this._setElementAndRawValue(e,i),this}},{key:"_setRawValue",value:function(e){var i=this,r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(this.rawValue!==e){var o=this.rawValue;this.rawValue=e,!a.isNull(this.settings.rawValueDivisor)&&this.settings.rawValueDivisor!==0&&e!==""&&e!==null&&this._isUserManuallyEditingTheValue()&&(this.rawValue/=this.settings.rawValueDivisor),this._triggerEvent(s.events.rawValueModified,this.domElement,{oldRawValue:o,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),r&&window.requestAnimationFrame(function(){return i._historyTableAdd()})}}},{key:"_setElementValue",value:function(e){var i=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=a.getElementValue(this.domElement);return e!==r&&(this.internalModification=!0,a.setElementValue(this.domElement,e),this.internalModification=!1,i&&this._triggerEvent(s.events.formatted,this.domElement,{oldValue:r,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return a.isNull(i)?i=e:a.isBoolean(i)&&(r=i,i=e),this._setElementValue(e),this._setRawValue(i,r),this}},{key:"_getRawValueToFormat",value:function(e){return a.isNull(this.settings.rawValueDivisor)||this.settings.rawValueDivisor===0||e===""||e===null?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){!a.isNull(i)&&a.isFunction(i)&&i(e,this)}},{key:"_triggerEvent",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;a.triggerEvent(e,i,r,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.getNumericString(e)}},{key:"getNumericString",value:function(){var e,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=a.isNull(this.rawValue)?null:a.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(e,i),e}},{key:"getFormatted",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;"value"in this.domElement||"textContent"in this.domElement||a.throwError("Unable to get the formatted string from the element.");var i=a.getElementValue(this.domElement);return this._executeCallback(i,e),i}},{key:"getNumber",value:function(){var e,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=this.rawValue===null?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(e,i),e}},{key:"getLocalized",value:function(){var e,i,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;a.isFunction(r)&&a.isNull(o)&&(o=r,r=null),(e=a.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))!=""&&Number(e)===0&&this.settings.leadingZero!==s.options.leadingZero.keep&&(e="0"),i=a.isNull(r)?this.settings.outputFormat:r;var u=this.constructor._toLocale(e,i,this.settings);return this._executeCallback(u,o),u}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._setElementValue(this.getLocalized(e)),this}},{key:"isPristine",value:function(){return arguments.length>0&&arguments[0]!==void 0&&!arguments[0]?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(){a.setElementSelection(this.domElement,0,a.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,i,r=a.getElementValue(this.domElement),o=r.length,u=this.settings.currencySymbol.length,g=this.settings.currencySymbolPlacement,S=a.isNegative(r,this.settings.negativeSignCharacter)?1:0,E=this.settings.suffixText.length;if(e=g===s.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left&&S===1&&u>0?u+1:u,g===s.options.currencySymbolPlacement.prefix)i=o-E;else switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:i=o-(E+u);break;case s.options.negativePositiveSignPlacement.right:i=u>0?o-(u+S+E):o-(u+E);break;default:i=o-(u+E)}return a.setElementSelection(this.domElement,e,i),this}},{key:"selectInteger",value:function(){var e=0,i=this.rawValue>=0;this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&i||!i&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left)&&(e+=1),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(e+=this.settings.currencySymbol.length);var r=a.getElementValue(this.domElement),o=r.indexOf(this.settings.decimalCharacter);return o===-1&&(o=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?r.length-this.settings.currencySymbol.length:r.length,i||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||(o-=1),o-=this.settings.suffixText.length),a.setElementSelection(this.domElement,e,o),this}},{key:"selectDecimal",value:function(){var e,i,r=a.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return r===-1?(r=0,e=0):(r+=1,i=this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur,e=r+Number(i)),a.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(){var e,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=a.isNull(i)?this.domElement:i.node(),this._removeFromLocalList(e),this}},{key:"attach",value:function(e){var i=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this._addToLocalList(e.node()),i&&e.update(this.settings),this}},{key:"formatOther",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._formatOrUnformatOther(!0,e,i)}},{key:"unformatOther",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._formatOrUnformatOther(!1,e,i)}},{key:"_formatOrUnformatOther",value:function(e,i){var r,o,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(r=a.isNull(u)?this.settings:this._cloneAndMergeSettings(u),a.isElement(i)){var g=a.getElementValue(i);return o=e?s.format(g,r):s.unformat(g,r),a.setElementValue(i,o),null}return o=e?s.format(i,r):s.unformat(i,r)}},{key:"init",value:function(e){var i=this,r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],o=!1,u=[];if(a.isString(e)?u=Ce(document.querySelectorAll(e)):a.isElement(e)?(u.push(e),o=!0):a.isArray(e)?u=e:a.throwError("The given parameters to the 'init' function are invalid."),u.length===0)return a.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var g=this._getLocalList(),S=[];return u.forEach(function(E){var O=i.settings.createLocalList;r&&(i.settings.createLocalList=!1);var d=new s(E,a.getElementValue(E),i.settings);r&&(d._setLocalList(g),i._addToLocalList(E,d),i.settings.createLocalList=O),S.push(d)}),o?S[0]:S}},{key:"clear",value:function(){if(arguments.length>0&&arguments[0]!==void 0&&arguments[0]){var e={emptyInputBehavior:s.options.emptyInputBehavior.focus};this.set("",e)}else this.set("");return 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(){if(arguments.length>0&&arguments[0]!==void 0&&arguments[0]||a.isUndefinedOrNullOrEmpty(this.parentForm)){var e=this._getParentForm();if(!a.isNull(e)&&e!==this.parentForm){var i=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=i.length,this._hasFormHandlerFunction(e)?this._incrementParentFormCounter(e):(this._storeFormHandlerFunction(e),this._initializeFormCounterToOne(e))}this.parentForm=e}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var i=this,r=Ce(e.elements),o=this._getContenteditableElements(e);return a.arrayUnique(r,o).filter(function(u){return i.constructor.isManagedByAutoNumeric(u)})}},{key:"_getContenteditableElements",value:function(e){if(a.isUndefinedOrNullOrEmpty(e)||!e.hasAttribute("id"))return[];var i=Ce(e.querySelectorAll("[contenteditable=true]")),r=Ce(document.querySelectorAll("*:not(input)[form=".concat(e.getAttribute("id"),"][contenteditable=true]")));return a.arrayUnique(i,r)}},{key:"_getParentForm",value:function(){if(!a.isUndefined(this.domElement.form))return this.domElement.form;if(this.domElement.tagName.toLowerCase()==="body")return null;var e,i=this.domElement;do{if(i=i.parentNode,a.isNull(i))return null;if((e=i.tagName?i.tagName.toLowerCase():"")==="body")break}while(e!=="form");return e==="form"?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(){var e,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=a.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,e)}},{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(){var e,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=a.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,e)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return JSON.stringify(this.formArrayLocalized(e))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformat()}),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformatLocalized()}),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).reformat()}),this}},{key:"formSubmitNumericString",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return a.isNull(e)?(this.formUnformat(),this.form().submit(),this.formReformat()):a.isFunction(e)?e(this.formNumericString()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return a.isNull(e)?this.form().submit():a.isFunction(e)?e(this.formFormatted()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a.isNull(i)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):a.isFunction(i)?i(this.formLocalized(e)):a.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayNumericString",value:function(e){return a.isFunction(e)?e(this.formArrayNumericString()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayFormatted",value:function(e){return a.isFunction(e)?e(this.formArrayFormatted()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayLocalized",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a.isFunction(e)?e(this.formArrayLocalized(i)):a.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonNumericString",value:function(e){return a.isFunction(e)?e(this.formJsonNumericString()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonFormatted",value:function(e){return a.isFunction(e)?e(this.formJsonFormatted()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonLocalized",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a.isFunction(e)?e(this.formJsonLocalized(i)):a.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&&this.autoNumericLocalList.size!==0}},{key:"_addToLocalList",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;a.isNull(i)&&(i=this),a.isUndefined(this.autoNumericLocalList)?a.throwError("The local list provided does not exists when trying to add an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.set(e,i)}},{key:"_removeFromLocalList",value:function(e){a.isUndefined(this.autoNumericLocalList)?this.settings.createLocalList&&a.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];se.apply(void 0,[this.settings].concat(i))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return se.apply(void 0,[e,this.settings].concat(r)),e}},{key:"_updatePredefinedOptions",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a.isNull(i)?this.update(e):(this._mergeSettings(e,i),this.update(this.settings)),this}},{key:"french",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().French,e),this}},{key:"northAmerican",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().NorthAmerican,e),this}},{key:"british",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().British,e),this}},{key:"swiss",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Swiss,e),this}},{key:"japanese",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Japanese,e),this}},{key:"spanish",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Spanish,e),this}},{key:"chinese",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Chinese,e),this}},{key:"brazilian",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Brazilian,e),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(typeof i=="function")this.settings[e]=i(this,e);else{var r="";e in this.domElement.dataset&&(r=this.domElement.dataset[e]),r=a.camelize(r),typeof this.settings[r]=="function"&&(this.settings[e]=r(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===s.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){a.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===s.options.selectOnFocus.doNotSelect&&a.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var i=this.rawValue<0,r=a.isZeroOrHasNoValue(e),o=e.length,u=0,g=0,S=!1,E=0;this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.start&&(u=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,S=a.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalRight||(S?(g=e.indexOf(this.settings.decimalCharacter),E=this.settings.decimalCharacter.length):(g=u,E=0)));var O="";i?O=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!r&&(O=this.settings.positiveSignCharacter);var d,T=O.length,D=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:d=T+D;break;case s.options.negativePositiveSignPlacement.suffix:d=D}else d=D;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:d=o;break;case s.options.negativePositiveSignPlacement.suffix:d=D+u}else d=o;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:d=T+D+g;break;case s.options.negativePositiveSignPlacement.suffix:d=D+g}else d=D+g;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:d=T+D+g+E;break;case s.options.negativePositiveSignPlacement.suffix:d=D+g+E}else d=D+g+E}else if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix){if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:d=0;break;case s.options.negativePositiveSignPlacement.prefix:d=T}else d=0;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:d=u;break;case s.options.negativePositiveSignPlacement.prefix:d=T+u}else d=u;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:d=g;break;case s.options.negativePositiveSignPlacement.prefix:d=T+g}else d=g;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:d=g+E;break;case s.options.negativePositiveSignPlacement.prefix:d=T+g+E}else d=g+E}return d}},{key:"_triggerRangeEvents",value:function(e,i){e||this._triggerEvent(s.events.minRangeExceeded,this.domElement),i||this._triggerEvent(s.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?a.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(s.events.invalidValue,this.domElement),this.validState=!1}},{key:"_setValidState",value:function(){this.isInputElement?a.setValidState(this.domElement):this._removeCSSClass(this.settings.invalidClass),this.validState||this._triggerEvent(s.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(e){if(this.settings.overrideMinMaxLimits===s.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===""||e===null)return e;if(this.settings.leadingZero!==s.options.leadingZero.keep){if(Number(e)===0)return"0";e=e.replace(/^(-)?0+(?=\d)/g,"$1")}return a.contains(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1")),e=e.replace(/\.$/,"")}},{key:"_setPersistentStorageName",value:function(){this.settings.saveValueToSessionStorage&&(this.domElement.name===""||a.isUndefined(this.domElement.name)?this.rawValueStorageName="".concat(this.storageNamePrefix).concat(this.domElement.id):this.rawValueStorageName="".concat(this.storageNamePrefix).concat(decodeURIComponent(this.domElement.name)))}},{key:"_saveValueToPersistentStorage",value:function(){this.settings.saveValueToSessionStorage&&sessionStorage.setItem(this.rawValueStorageName,this.rawValue)}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?sessionStorage.getItem(this.rawValueStorageName):(a.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(){this.settings.saveValueToSessionStorage&&sessionStorage.removeItem(this.rawValueStorageName)}},{key:"_getDefaultValue",value:function(e){var i=e.getAttribute("value");return a.isNull(i)?"":i}},{key:"_onFocusInAndMouseEnter",value:function(e){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&e.type==="mouseenter"&&e.altKey)this.constructor._unformatAltHovered(this);else if(e.type==="focus"&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),e.type==="focus"&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),e.type==="focus"||e.type==="mouseenter"&&!this.isFocused){var i=null;this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus&&this.rawValue<0&&this.settings.negativeBracketsTypeOnBlur!==null&&this.settings.isNegativeSignAllowed&&(i=this.constructor._removeBrackets(a.getElementValue(this.domElement),this.settings));var r=this._getRawValueToFormat(this.rawValue);if(r!==""){var o=this.constructor._roundFormattedValueShownOnFocusOrBlur(r,this.settings,this.isFocused);this.settings.showOnlyNumbersOnFocus===s.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",i=o.replace(".",this.settings.decimalCharacter)):i=a.isNull(o)?"":this.constructor._addGroupSeparators(o.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,r)}a.isNull(i)?this.valueOnFocus="":this.valueOnFocus=i,this.lastVal=this.valueOnFocus;var u=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),g=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),S=u&&g!==""&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus;S&&(i=g),a.isNull(i)||this._setElementValue(i),S&&g===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&a.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():a.isNull(this.settings.caretPositionOnFocus)||a.setElementSelection(e.target,this._initialCaretPosition(a.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,a.setElementValue(this.domElement,"="),a.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,i=a.getElementValue(this.domElement);i=i.replace(/^\s*=/,"");try{var r=new ee(i,this.settings.decimalCharacter);e=new jt().evaluate(r)}catch{return this._triggerEvent(s.events.invalidFormula,this.domElement,{formula:i,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(s.events.validFormula,this.domElement,{formula:i,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===l.keyName.Backspace||this.eventKey===l.keyName.Delete||this.eventKey===l.keyName.LeftArrow||this.eventKey===l.keyName.RightArrow||this.eventKey===l.keyName.Home||this.eventKey===l.keyName.End}},{key:"_onKeydown",value:function(e){if(!this.compositioning)if(this.formatted=!1,this.isEditing=!0,this.formulaMode||this.isFocused||!this.settings.unformatOnHover||!e.altKey||this.domElement!==a.getHoveredElement()){if(this._updateEventKeyInfo(e),this.keydownEventCounter+=1,this.keydownEventCounter===1&&(this.initialValueOnFirstKeydown=a.getElementValue(e.target),this.initialRawValueOnFirstKeydown=this.rawValue),this.formulaMode){if(this.eventKey===l.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===l.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else{if(this.eventKey===l.keyName.Equal)return void this._enterFormulaMode();if(this.settings.modifyValueOnUpDownArrow&&(this.eventKey===l.keyName.UpArrow||this.eventKey===l.keyName.DownArrow))return void this.upDownArrowAction(e)}if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===l.keyName.Esc&&(e.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(s.events.native.input,e.target)),this.select());var i=a.getElementValue(e.target);if(this.eventKey===l.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(s.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===l.keyName.Backspace||this.eventKey===l.keyName.Delete){var r=this._processCharacterDeletion(e);if(this.processed=!0,!r)return void e.preventDefault();this._formatValue(e),(i=a.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(s.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.compositioning){if(this.formulaMode){if(this._acceptNonPrintableKeysInFormulaMode()||this.settings.formulaChars.test(this.eventKey))return;e.preventDefault()}else if(this.eventKey!==l.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=a.getElementValue(e.target);if(r!==this.lastVal&&this.throwInput)this._triggerEvent(s.events.native.input,e.target),e.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&a.getElementSelection(e.target).start===a.getElementSelection(e.target).end&&a.getElementSelection(e.target).start===r.indexOf(this.settings.decimalCharacter)){var o=a.getElementSelection(e.target).start+1;a.setElementSelection(e.target,o)}e.preventDefault()}return this.lastVal=a.getElementValue(e.target),this.throwInput=!0,void this._setValidOrInvalidState(this.rawValue)}e.preventDefault()}}}}},{key:"_onKeyup",value:function(e){if(!this.compositioning&&(this.isEditing=!1,this.keydownEventCounter=0,!this.formulaMode))if(this.settings.isCancellable&&this.eventKey===l.keyName.Esc)e.preventDefault();else{if(this._updateEventKeyInfo(e),this.eventKey===l.keyName.Z||this.eventKey===l.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),this._historyTableUndo(),void this._triggerEvent(s.events.native.input,e.target);this.onGoingRedo=!1}}else if((this.eventKey===l.keyName.Y||this.eventKey===l.keyName.y)&&e.ctrlKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&(this.eventKey===l.keyName.X||this.eventKey===l.keyName.x)){var i=a.getElementSelection(this.domElement).start,r=this.constructor._toNumericValue(a.getElementValue(e.target),this.settings);this.set(r),this._setCaretPosition(i)}if(this.eventKey===l.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==l.keyName.Backspace&&this.eventKey!==l.keyName.Delete){this._updateInternalProperties(e);var o=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var u=a.getElementValue(e.target);if(!(o||u===""&&this.initialValueOnFirstKeydown==="")&&(u===this.settings.currencySymbol?this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?a.setElementSelection(e.target,0):a.setElementSelection(e.target,this.settings.currencySymbol.length):this.eventKey===l.keyName.Tab&&a.setElementSelection(e.target,0,u.length),(u===this.settings.suffixText||this.rawValue===""&&this.settings.currencySymbol!==""&&this.settings.suffixText!=="")&&a.setElementSelection(e.target,0),this.settings.decimalPlacesShownOnFocus!==null&&this._saveValueToPersistentStorage(),this.formatted||this._formatValue(e),this._setValidOrInvalidState(this.rawValue),this._saveRawValueForAndroid(),u!==this.initialValueOnFirstKeydown&&this._triggerEvent(s.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:u,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),this.historyTable.length>1)){var g=a.getElementSelection(this.domElement);this.selectionStart=g.start,this.selectionEnd=g.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var S=a.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,S))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===l.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,e.type!=="mouseleave"||!this.formulaMode){if(this.settings.unformatOnHover&&e.type==="mouseleave"&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(e.type==="mouseleave"&&!this.isFocused||e.type==="blur"){e.type==="blur"&&this.formulaMode&&this._exitFormulaMode(),this._saveValueToPersistentStorage(),this.settings.showOnlyNumbersOnFocus===s.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=a.isNull(i),o=te(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),u=o[0],g=o[1],S=!1;if(i===""||r||(this._triggerRangeEvents(u,g),this.settings.valuesToStrings&&this._checkValuesToStrings(i)&&(this._setElementValue(this.settings.valuesToStrings[i]),S=!0)),!S){var E;if(E=r||i===""?i:String(i),i===""||r){if(i==="")switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:this._setRawValue("0"),E=this.constructor._roundValue("0",this.settings,0);break;case s.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),E=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case s.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),E=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:a.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),E=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else u&&g&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(i,this.settings)?(E=this._modifyNegativeSignAndDecimalCharacterForRawValue(E),this.settings.divisorWhenUnfocused&&!a.isNull(E)&&(E=(E/=this.settings.divisorWhenUnfocused).toString()),E=this.constructor._roundFormattedValueShownOnBlur(E,this.settings),E=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(E,this.settings)):this._triggerRangeEvents(u,g);var O=this.constructor._orderValueCurrencySymbolAndSuffixText(E,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(E,this.settings)||r&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.null||(O=this.constructor._addGroupSeparators(E,this.settings,!1,i)),O===i&&i!==""&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&i!==""&&i!==null&&(O="".concat(O).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(O))}this._setValidOrInvalidState(this.rawValue),e.type==="blur"&&this._onBlur(e)}}}},{key:"_onPaste",value:function(e){if(e.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i,r;e.clipboardData&&e.clipboardData.getData?i=e.clipboardData.getData("text/plain"):a.throwError("Unable to retrieve the pasted value. Please use a modern browser (i.e. Firefox or Chromium)."),r=e.target.tagName?e.target:e.explicitOriginalTarget;var o=a.getElementValue(r),u=r.selectionStart||0,g=r.selectionEnd||0,S=g-u;if(S===o.length){var E=this._preparePastedText(i),O=a.arabicToLatinNumbers(E,!1,!1,!1);return O==="."||O===""||O!=="."&&!a.isNumber(O)?(this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&a.throwError("The pasted value '".concat(i,"' is not a valid paste content.")))):(this.set(O),this.formatted=!0,void this._triggerEvent(s.events.native.input,r))}var d=a.isNegativeStrict(i,this.settings.negativeSignCharacter);d&&(i=i.slice(1,i.length));var T,D,$=this._preparePastedText(i);if((T=$==="."?".":a.arabicToLatinNumbers($,!1,!1,!1))!=="."&&(!a.isNumber(T)||T===""))return this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&a.throwError("The pasted value '".concat(i,"' is not a valid paste content.")));var W,ie,qe=a.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);d&&!qe?(qe=!0,W=!0):W=!1;var rt=o.slice(0,u),st=o.slice(g,o.length);ie=u!==g?this._preparePastedText(rt+st):this._preparePastedText(o),qe&&(ie=a.setRawNegativeSign(ie)),D=a.convertCharacterCountToIndexPosition(a.countNumberCharactersOnTheCaretLeftSide(o,u,this.settings.decimalCharacter)),W&&D++;var Ze=ie.slice(0,D),si=ie.slice(D,ie.length),an=!1;T==="."&&(a.contains(Ze,".")&&(an=!0,Ze=Ze.replace(".","")),si=si.replace(".",""));var Mn=!1;switch(Ze===""&&si==="-"&&(Ze="-",si="",Mn=!0),this.settings.onInvalidPaste){case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:for(var ho=a.parseStr(this.settings.minimumValue),go=a.parseStr(this.settings.maximumValue),li=ie,ci=0,Ka=Ze;ci<T.length&&(ie=(Ka+=T[ci])+si,this.constructor._checkIfInRange(ie,ho,go));)li=ie,ci++;if(D+=ci,Mn&&D++,this.settings.onInvalidPaste===s.options.onInvalidPaste.truncate){ie=li,an&&D--;break}for(var hi=D,Wa=li.length;ci<T.length&&hi<Wa;)if(li[hi]!=="."){if(ie=a.replaceCharAt(li,hi,T[ci]),!this.constructor._checkIfInRange(ie,ho,go))break;li=ie,ci++,hi++}else hi++;D=hi,an&&D--,ie=li;break;case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.ignore:case s.options.onInvalidPaste.clamp:default:if(ie="".concat(Ze).concat(T).concat(si),u===g)D=a.convertCharacterCountToIndexPosition(a.countNumberCharactersOnTheCaretLeftSide(o,u,this.settings.decimalCharacter))+T.length;else if(si==="")D=a.convertCharacterCountToIndexPosition(a.countNumberCharactersOnTheCaretLeftSide(o,u,this.settings.decimalCharacter))+T.length,Mn&&D++;else{var Ha=a.convertCharacterCountToIndexPosition(a.countNumberCharactersOnTheCaretLeftSide(o,g,this.settings.decimalCharacter)),qa=a.getElementValue(r).slice(u,g);D=Ha-S+a.countCharInText(this.settings.digitGroupSeparator,qa)+T.length}W&&D++,an&&D--}if(a.isNumber(ie)&&ie!==""){var rn=!1,fo=!1;try{this.set(ie),rn=!0}catch{var sn;switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:sn=a.clampToRangeLimits(ie,this.settings);try{this.set(sn)}catch{a.throwError("Fatal error: Unable to set the clamped value '".concat(sn,"'."))}fo=!0,rn=!0,ie=sn;break;case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:a.throwError("The pasted value '".concat(i,"' results in a value '").concat(ie,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));case s.options.onInvalidPaste.ignore:default:return}}var vo,ln=a.getElementValue(r);if(rn)switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:if(fo){this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?a.setElementSelection(r,ln.length-this.settings.currencySymbol.length):a.setElementSelection(r,ln.length);break}case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.ignore:case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:default:vo=a.findCaretPositionInFormattedNumber(ie,D,ln,this.settings.decimalCharacter),a.setElementSelection(r,vo)}rn&&o!==ln&&this._triggerEvent(s.events.native.input,r)}else this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&a.throwError("The pasted value '".concat(i,"' would result into an invalid content '").concat(ie,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,a.trimPaddedZerosFromDecimalPlaces(this.rawValue)!==a.trimPaddedZerosFromDecimalPlaces(this.rawValueOnFocus)&&this._triggerEvent(s.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_wheelAndUpDownActions",value:function(e,i,r,o){var u,g=e.target.selectionStart||0,S=e.target.selectionEnd||0,E=this.rawValue;if(u=+(u=a.isUndefinedOrNullOrEmpty(E)?this.settings.minimumValue>0||this.settings.maximumValue<0?i?this.settings.minimumValue:this.settings.maximumValue:0:E),a.isNumber(o)){var O=+o;i?u+=O:r&&(u-=O)}else i?u=a.addAndRoundToNearestAuto(u,this.settings.decimalPlacesRawValue):r&&(u=a.subtractAndRoundToNearestAuto(u,this.settings.decimalPlacesRawValue));(u=a.clampToRangeLimits(u,this.settings))!==+E&&(this.set(u),this._triggerEvent(s.events.native.input,e.target)),e.preventDefault(),this._setSelection(g,S)}},{key:"upDownArrowAction",value:function(e){if(!(this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i=!1,r=!1;this.eventKey===l.keyName.UpArrow?i=!0:this.eventKey===l.keyName.DownArrow?r=!0:a.throwError("Something has gone wrong since neither an Up or Down arrow key is detected, but the function was still called!"),this._wheelAndUpDownActions(e,i,r,this.settings.upDownStep)}}},{key:"_onWheel",value:function(e){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===s.options.wheelOn.focus?this.isFocused?e.shiftKey||this.wheelAction(e):e.shiftKey&&this.wheelAction(e):this.settings.wheelOn===s.options.wheelOn.hover?e.shiftKey?(e.preventDefault(),window.scrollBy(0,a.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):a.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var i=!1,r=!1,o=!1;a.isWheelUpEvent(e)?i=!0:a.isWheelDownEvent(e)?r=!0:a.isWheelEventWithZeroDeltaY(e)?o=!0:a.throwError("The event is not a 'wheel' event."),o||this._wheelAndUpDownActions(e,i,r,this.settings.wheelStep),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){this.isDropEvent=!0,e.preventDefault();var i=e.dataTransfer.getData("text/plain"),r=this.unformatOther(i),o=this.rawValue;this.set(r),this.isDropEvent=!1;var u=this.constructor._toNumericValue(r,this.settings);isNaN(Number(u))||a.trimPaddedZerosFromDecimalPlaces(o)!==a.trimPaddedZerosFromDecimalPlaces(u)&&this._triggerEvent(s.events.native.change,this.domElement)}}},{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(a.character(e)===l.keyName.Alt){var i=a.getHoveredElement();if(s.isManagedByAutoNumeric(i)){var r=s.getAutoNumericElement(i);!r.formulaMode&&r.settings.unformatOnHover&&this.constructor._unformatAltHovered(r)}}}},{key:"_onKeyupGlobal",value:function(e){if(a.character(e)===l.keyName.Alt){var i=a.getHoveredElement();if(s.isManagedByAutoNumeric(i)){var r=s.getAutoNumericElement(i);if(r.formulaMode||!r.settings.unformatOnHover)return;this.constructor._reformatAltHovered(r)}}}},{key:"_onCompositionstart",value:function(e){var i={key:l.keyName.Space,which:"32",keyCode:"32"},r=new KeyboardEvent("keydown",i);e.target.dispatchEvent(r),this.compositioning=!0}},{key:"_onCompositionend",value:function(e){this.compositioning=!1;var i={key:l.keyName.Space,which:"32",keyCode:"32"},r=new KeyboardEvent("keypress",i);e.target.dispatchEvent(r);var o=new KeyboardEvent("keyup",i);e.target.dispatchEvent(o)}},{key:"_isElementTagSupported",value:function(){return a.isElement(this.domElement)||a.throwError("The DOM element is not valid, ".concat(this.domElement," given.")),a.isInArray(this.domElement.tagName.toLowerCase(),this.allowedTagList)}},{key:"_isInputElement",value:function(){return this.domElement.tagName.toLowerCase()==="input"}},{key:"_isInputTypeSupported",value:function(){return this.domElement.type==="text"||this.domElement.type==="hidden"||this.domElement.type==="tel"||a.isUndefinedOrNullOrEmpty(this.domElement.type)}},{key:"_checkElement",value:function(){var e=this.domElement.tagName.toLowerCase();this._isElementTagSupported()||a.throwError("The <".concat(e,"> tag is not supported by autoNumeric")),this._isInputElement()?(this._isInputTypeSupported()||a.throwError('The input type "'.concat(this.domElement.type,'" is not supported by autoNumeric')),this.isInputElement=!0):(this.isInputElement=!1,this.isContentEditable=this._isContentEditable(this.domElement))}},{key:"_isContentEditable",value:function(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")==="true"}},{key:"_formatDefaultValueOnPageLoad",value:function(){var e,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=!0;if(a.isNull(i)?(e=a.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",e)):e=i,this.isInputElement||this.isContentEditable){var o=this.constructor._toNumericValue(e,this.settings);if(this.domElement.hasAttribute("value")&&this.domElement.getAttribute("value")!==""){if(this.settings.defaultValueOverride!==null&&this.settings.defaultValueOverride.toString()!==e||this.settings.defaultValueOverride===null&&e!==""&&e!==this.domElement.getAttribute("value")||e!==""&&this.domElement.getAttribute("type")==="hidden"&&!a.isNumber(o)){if(this.settings.saveValueToSessionStorage&&(this.settings.decimalPlacesShownOnFocus!==null||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var u=this.constructor._removeBrackets(e,this.settings);(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&this.settings.negativeSignCharacter!==""&&a.isNegative(e,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(u,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(u,this.settings,!0,this.isFocused))}r=!1}}else isNaN(Number(o))||o===1/0?a.throwError("The value [".concat(e,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(o),r=!1);if(e==="")switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:break;case s.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case s.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case s.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case s.options.emptyInputBehavior.zero:this.set("0");break;case s.options.emptyInputBehavior.null:this.set(null);break;default:this.set(this.settings.emptyInputBehavior)}else r&&e===this.domElement.getAttribute("value")&&this.set(e)}else this.settings.defaultValueOverride!==null&&this.settings.defaultValueOverride!==e||this.set(e)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=te(this.settings.maximumValue.toString().split("."),1)[0],i=te(this.settings.minimumValue||this.settings.minimumValue===0?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.settings.valuesToStrings?this.valuesToStringsKeys=Object.keys(this.settings.valuesToStrings):this.valuesToStringsKeys=[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];i!=="true"&&i!=="false"||(this.settings[e]=i==="true"),typeof i=="number"&&(this.settings[e]=i.toString())}}},{key:"_setSettings",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];!i&&a.isNull(e)||this.constructor._convertOldOptionsToNewOnes(e),i?("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=l.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),i||(a.isNull(e)||!e.decimalPlaces?this.settings.originalDecimalPlaces=null:this.settings.originalDecimalPlaces=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(),a.isEmptyObj(this.settings)&&a.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=a.getElementSelection(this.domElement),this.processed=!1}},{key:"_updateEventKeyInfo",value:function(e){this.eventKey=a.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,a.getElementValue(this.domElement).length),this.selection={start:e,end:i,length:i-e},a.setElementSelection(this.domElement,e,i)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=a.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=te(this._getLeftAndRightPartAroundTheSelection(),2),i=e[0],r=e[1];if(i===""&&r==="")return["",""];var o=!0;return this.eventKey!==l.keyName.Hyphen&&this.eventKey!==l.keyName.Minus||Number(i)!==0||(o=!1),this.isTrailingNegative&&(a.isNegative(r,this.settings.negativeSignCharacter)&&!a.isNegative(i,this.settings.negativeSignCharacter)||r===""&&a.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=s._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,o,this.isFocused),r=s._stripAllNonNumberCharactersExceptCustomDecimalChar(r,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,i){var r=!0;this.eventKey!==l.keyName.Hyphen&&this.eventKey!==l.keyName.Minus||Number(e)!==0||(r=!1),this.isTrailingNegative&&a.isNegative(i,this.settings.negativeSignCharacter)&&!a.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),i=i.replace(this.settings.negativeSignCharacter,"")),e=s._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,r,this.isFocused),i=s._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,!1,this.isFocused),this.settings.leadingZero!==s.options.leadingZero.deny||this.eventKey!==l.keyName.num0&&this.eventKey!==l.keyName.numpad0||Number(e)!==0||a.contains(e,this.settings.decimalCharacter)||i===""||(e=e.substring(0,e.length-1));var o=e+i;if(this.settings.decimalCharacter){var u=o.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));u&&(o=(e=e.replace(u[1],u[1]+"0"))+i)}return[e,i,o]}},{key:"_setValueParts",value:function(e,i){var r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=te(this._normalizeParts(e,i),3),u=o[0],g=o[1],S=o[2],E=te(s._checkIfInRangeWithOverrideOption(S,this.settings),2),O=E[0],d=E[1];if(O&&d){var T=s._truncateDecimalPlaces(S,this.settings,r,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(T===""||T===this.settings.negativeSignCharacter){var D;switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:D="";break;case s.options.emptyInputBehavior.min:D=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:D=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:D="0";break;case s.options.emptyInputBehavior.null:D=null;break;default:D=this.settings.emptyInputBehavior}this._setRawValue(D)}else this._setRawValue(this._trimLeadingAndTrailingZeros(T));var $=s._truncateDecimalPlaces(S,this.settings,r,this.settings.decimalPlacesShownOnFocus),W=u.length;return W>$.length&&(W=$.length),W===1&&u==="0"&&this.settings.leadingZero===s.options.leadingZero.deny&&(W=g===""||u==="0"&&g!==""?1:0),this._setElementValue($,!1),this._setCaretPosition(W),!0}return this._triggerRangeEvents(O,d),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var i=this.settings.currencySymbol.length,r=a.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&r&&r.charAt(0)===this.settings.negativeSignCharacter?[1,i+1]:[0,i];else{var o=r.length;e=[o-i,o]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=te(this._getSignPosition(),2),i=e[0],r=e[1],o=this.selection;o.start<r&&o.end>i&&((o.start<i||o.end>r)&&a.getElementValue(this.domElement).substring(Math.max(o.start,i),Math.min(o.end,r)).match(/^\s*$/)?o.start<i?this._setSelection(o.start,i):this._setSelection(r,o.end):this._setSelection(Math.min(o.start,i),Math.max(o.end,r)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!a.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,i=te(this._getLeftAndRightPartAroundTheSelection(),2),r=i[0],o=i[1];delete this.valuePartsBeforePaste;var u=r.substr(0,e[0].length)+s._stripAllNonNumberCharactersExceptCustomDecimalChar(r.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(u,o,!0)||(this._setElementValue(e.join(""),!1),this._setCaretPosition(e[0].length))}}},{key:"_processNonPrintableKeysAndShortcuts",value:function(e){if((e.ctrlKey||e.metaKey)&&e.type==="keyup"&&!a.isUndefined(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKey===l.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===l.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===l.keyName.c||this.eventKey===l.keyName.v||this.eventKey===l.keyName.x))return e.type==="keydown"&&this._expandSelectionOnSign(),this.eventKey!==l.keyName.v&&this.eventKey!==l.keyName.Insert||(e.type==="keydown"||e.type==="keypress"?a.isUndefined(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),e.type==="keydown"||e.type==="keypress"||this.eventKey===l.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===l.keyName.Z||this.eventKey===l.keyName.z);if(this.eventKey===l.keyName.LeftArrow||this.eventKey===l.keyName.RightArrow){if(e.type==="keydown"&&!e.shiftKey){var i=a.getElementValue(this.domElement);this.eventKey!==l.keyName.LeftArrow||i.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==l.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}return a.isInArray(this.eventKey,l.keyName._directionKeys)}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var i=te(e,2),r=i[0],o=i[1],u=a.getElementValue(this.domElement),g=a.isNegative(u,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix&&(this.eventKey===l.keyName.Backspace?(this.caretFix=this.selection.start>=u.indexOf(this.settings.suffixText)&&this.settings.suffixText!=="",u.charAt(this.selection.start-1)==="-"?r=r.substring(1):this.selection.start<=u.length-this.settings.suffixText.length&&(r=r.substring(0,r.length-1))):(this.caretFix=this.selection.start>=u.indexOf(this.settings.suffixText)&&this.settings.suffixText!=="",this.selection.start>=u.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(o=o.substring(1,o.length)),a.isNegative(r,this.settings.negativeSignCharacter)&&u.charAt(this.selection.start)==="-"&&(r=r.substring(1)))),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===l.keyName.Backspace?this.selection.start===u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&g?r=r.substring(1):r!=="-"&&(this.selection.start<=u.indexOf(this.settings.negativeSignCharacter)||!g)&&(r=r.substring(0,r.length-1)):(r[0]==="-"&&(o=o.substring(1)),this.selection.start===u.indexOf(this.settings.negativeSignCharacter)&&g&&(r=r.substring(1)));break;case s.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===l.keyName.Backspace?this.selection.start===u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?r=r.substring(1):r!=="-"&&this.selection.start<=u.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length?r=r.substring(0,r.length-1):r===""||g||(r=r.substring(0,r.length-1)):(this.caretFix=this.selection.start>=u.indexOf(this.settings.currencySymbol)&&this.settings.currencySymbol!=="",this.selection.start===u.indexOf(this.settings.negativeSignCharacter)&&(r=r.substring(1)),o=o.substring(1))}return[r,o]}},{key:"_processCharacterDeletion",value:function(e){var i,r;if(this.selection.length){this._expandSelectionOnSign();var o=te(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);i=o[0],r=o[1]}else{var u=te(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(i=u[0],r=u[1],i===""&&r===""&&(this.throwInput=!1),this.isTrailingNegative&&a.isNegative(a.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var g=te(this._processCharacterDeletionIfTrailingNegativeSign([i,r]),2);i=g[0],r=g[1]}else this.eventKey===l.keyName.Backspace?i=i.substring(0,i.length-1):r=r.substring(1,r.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(i).concat(r),this.settings)&&a.getElementValue(e.target)!==this.settings.currencySymbol&&(this._setValueParts(i,r),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(s.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(s.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=te(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),i=e[0],r=e[1];if(this.eventKey!==l.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(a.contains(i,this.settings.decimalCharacter)||r.indexOf(this.settings.decimalCharacter)>0)return!0;r.indexOf(this.settings.decimalCharacter)===0&&(r=r.substr(1))}return this.settings.negativeSignCharacter&&a.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===""&&a.contains(r,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&this.eventKey==="+")&&(r=r.replace("-","")):a.isNegativeStrict(i,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&this.eventKey==="+")&&(i=i.replace("-","")):(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&this.eventKey==="-")&&(i="".concat(this.settings.negativeSignCharacter).concat(i)),this._setValueParts(i,r),!0;var o=Number(this.eventKey);return o>=0&&o<=9?(this.settings.isNegativeSignAllowed&&i===""&&a.contains(r,"-")&&(i="-",r=r.substring(1,r.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!a.contains(a.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&this.eventKey!=="0"&&(i="-".concat(i)),this._setValueParts("".concat(i).concat(this.eventKey),r),!0):(this.throwInput=!1,!1)}},{key:"_formatValue",value:function(e){var i=a.getElementValue(this.domElement),r=te(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((this.settings.digitGroupSeparator===""||this.settings.digitGroupSeparator!==""&&!a.contains(i,this.settings.digitGroupSeparator))&&(this.settings.currencySymbol===""||this.settings.currencySymbol!==""&&!a.contains(i,this.settings.currencySymbol))){var o=te(i.split(this.settings.decimalCharacter),1)[0],u="";a.isNegative(o,this.settings.negativeSignCharacter)&&(u=this.settings.negativeSignCharacter,o=o.replace(this.settings.negativeSignCharacter,""),r=r.replace("-","")),u===""&&o.length>this.settings.mIntPos&&r.charAt(0)==="0"&&(r=r.slice(1)),u===this.settings.negativeSignCharacter&&o.length>this.settings.mIntNeg&&r.charAt(0)==="0"&&(r=r.slice(1)),this.isTrailingNegative||(r="".concat(u).concat(r))}var g=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue),S=g.length;if(g){var E,O=r.split("");if((this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&O[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(O.shift(),(this.eventKey===l.keyName.Backspace||this.eventKey===l.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix)&&(O.push(this.settings.negativeSignCharacter),this.caretFix=e.type==="keydown"),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.right))){var d=this.settings.currencySymbol.split(""),T=["\\","^","$",".","|","?","*","+","(",")","["],D=[];d.forEach(function(ie,qe){qe=d[ie],a.isInArray(qe,T)?D.push("\\"+qe):D.push(qe)}),this.eventKey===l.keyName.Backspace&&this.settings.negativeSignCharacter==="-"&&D.push("-"),O.push(D.join("")),this.caretFix=e.type==="keydown"}for(var $=0;$<O.length;$++)O[$].match("\\d")||(O[$]="\\"+O[$]);E=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(O.join(".*?"))):new RegExp("^.*?[".concat(this.settings.currencySymbol,"]*").concat(O.join(".*?")));var W=g.match(E);W?(S=W[0].length,this.settings.showPositiveSign&&(S===0&&W.input.charAt(0)===this.settings.positiveSignCharacter&&(S=W.input.indexOf(this.settings.currencySymbol)===1?this.settings.currencySymbol.length+1:1),S===0&&W.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(S=this.settings.currencySymbol.length+1)),(S===0&&g.charAt(0)!==this.settings.negativeSignCharacter||S===1&&g.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(S=this.settings.currencySymbol.length+(a.isNegativeStrict(g,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(S-=this.settings.currencySymbol.length),this.settings.suffixText&&(S-=this.settings.suffixText.length))}g!==i&&(this._setElementValue(g,!1),this._setCaretPosition(S)),this.formatted=!0}}],F=[{key:"version",value:function(){return"4.10.8"}},{key:"_setArgumentsValues",value:function(e,i,r){a.isNull(e)&&a.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var o,u,g,S=a.isElement(e),E=a.isString(e),O=a.isObject(i),d=Array.isArray(i)&&i.length>0,T=a.isNumberOrArabic(i)||i==="",D=this._isPreDefinedOptionValid(i),$=a.isNull(i),W=a.isEmptyString(i),ie=a.isObject(r),qe=Array.isArray(r)&&r.length>0,rt=a.isNull(r),st=this._isPreDefinedOptionValid(r);return S&&$&&rt?(o=e,g=null,u=null):S&&T&&rt?(o=e,g=i,u=null):S&&O&&rt?(o=e,g=null,u=i):S&&D&&rt?(o=e,g=null,u=this._getOptionObject(i)):S&&d&&rt?(o=e,g=null,u=this.mergeOptions(i)):S&&($||W)&&ie?(o=e,g=null,u=r):S&&($||W)&&qe?(o=e,g=null,u=this.mergeOptions(r)):E&&$&&rt?(o=document.querySelector(e),g=null,u=null):E&&O&&rt?(o=document.querySelector(e),g=null,u=i):E&&D&&rt?(o=document.querySelector(e),g=null,u=this._getOptionObject(i)):E&&d&&rt?(o=document.querySelector(e),g=null,u=this.mergeOptions(i)):E&&($||W)&&ie?(o=document.querySelector(e),g=null,u=r):E&&($||W)&&qe?(o=document.querySelector(e),g=null,u=this.mergeOptions(r)):E&&T&&rt?(o=document.querySelector(e),g=i,u=null):E&&T&&ie?(o=document.querySelector(e),g=i,u=r):E&&T&&st?(o=document.querySelector(e),g=i,u=this._getOptionObject(r)):E&&T&&qe?(o=document.querySelector(e),g=i,u=this.mergeOptions(r)):S&&T&&ie?(o=e,g=i,u=r):S&&T&&st?(o=e,g=i,u=this._getOptionObject(r)):S&&T&&qe?(o=e,g=i,u=this.mergeOptions(r)):a.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(i,"' and '").concat(r,"' given.")),a.isNull(o)&&a.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:o,initialValue:g,userOptions:u}}},{key:"mergeOptions",value:function(e){var i=this,r={};return e.forEach(function(o){se(r,i._getOptionObject(o))}),r}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(s.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var i;return a.isString(e)?(i=s.getPredefinedOptions()[e])==null&&a.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=J(window.aNFormHandlerMap);return e!=="undefined"&&e==="object"}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,i){return a.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"),o=[];return Array.prototype.slice.call(r,0).forEach(function(u){i.test(u)&&o.push(u)}),o}},{key:"test",value:function(e){return this._isInGlobalList(a.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=J(window[this.autoNumericGlobalListName]);return e!=="undefined"&&e==="object"}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var i=e.node();if(this._isInGlobalList(i)){if(this._getFromGlobalList(i)===this)return;a.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){var i=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;!a.isUndefinedOrNullOrEmpty(e)&&a.isObject(e)||a.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var o,u=a.isObject(r);u||a.isNull(r)||a.throwError("The 'originalOptions' parameter is invalid ; it should either be a valid option object or `null`, [".concat(e,"] given.")),a.isNull(e)||this._convertOldOptionsToNewOnes(e),o=i?se({},this.getDefaultConfig(),e):e,a.isTrueOrFalseString(o.showWarnings)||a.isBoolean(o.showWarnings)||a.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(o.showWarnings,"] given."));var g,S=/^[0-9]+$/,E=/[0-9]+/,O=/^-?[0-9]+(\.?[0-9]+)?$/,d=/^[0-9]+(\.?[0-9]+)?$/;a.isTrueOrFalseString(o.allowDecimalPadding)||a.isBoolean(o.allowDecimalPadding)||o.allowDecimalPadding===s.options.allowDecimalPadding.floats||a.isNumber(o.allowDecimalPadding)&&o.allowDecimalPadding>0||a.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true`, `'floats'` or a positive integer superior to 0, [".concat(o.allowDecimalPadding,"] given.")),a.isNumber(o.allowDecimalPadding)&&o.allowDecimalPadding>o.decimalPlaces&&a.warning("Setting 'allowDecimalPadding' to a number [".concat(o.allowDecimalPadding,"] superior to the current 'decimalPlaces' settings [").concat(o.decimalPlaces,"] is useless, since the padding will not be shown."),o.showWarnings),o.allowDecimalPadding!==s.options.allowDecimalPadding.never&&o.allowDecimalPadding!=="false"||o.decimalPlaces===s.options.decimalPlaces.none&&o.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.none&&o.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.none||a.warning("Setting 'allowDecimalPadding' to [".concat(o.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(o.decimalPlaces,", ").concat(o.decimalPlacesShownOnBlur," and ").concat(o.decimalPlacesShownOnFocus,"]."),o.showWarnings),a.isTrueOrFalseString(o.alwaysAllowDecimalCharacter)||a.isBoolean(o.alwaysAllowDecimalCharacter)||a.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(o.alwaysAllowDecimalCharacter,"] given.")),a.isNull(o.caretPositionOnFocus)||a.isInArray(o.caretPositionOnFocus,[s.options.caretPositionOnFocus.start,s.options.caretPositionOnFocus.end,s.options.caretPositionOnFocus.decimalLeft,s.options.caretPositionOnFocus.decimalRight])||a.throwError("The display on empty string option 'caretPositionOnFocus' is invalid ; it should either be `null`, 'focus', 'press', 'always' or 'zero', [".concat(o.caretPositionOnFocus,"] given.")),g=u?r:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),a.isNull(g)||g.caretPositionOnFocus===s.options.caretPositionOnFocus.doNoForceCaretPosition||g.selectOnFocus!==s.options.selectOnFocus.select||a.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(g.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),o.showWarnings),a.isInArray(o.digitGroupSeparator,[s.options.digitGroupSeparator.comma,s.options.digitGroupSeparator.dot,s.options.digitGroupSeparator.normalSpace,s.options.digitGroupSeparator.thinSpace,s.options.digitGroupSeparator.narrowNoBreakSpace,s.options.digitGroupSeparator.noBreakSpace,s.options.digitGroupSeparator.noSeparator,s.options.digitGroupSeparator.apostrophe,s.options.digitGroupSeparator.arabicThousandsSeparator,s.options.digitGroupSeparator.dotAbove,s.options.digitGroupSeparator.privateUseTwo])||a.throwError(`The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '\u066C', '\u02D9', "'", '\x92', ' ', '\u2009', '\u202F', '\xA0' or empty (''), [`.concat(o.digitGroupSeparator,"] given.")),a.isTrueOrFalseString(o.showOnlyNumbersOnFocus)||a.isBoolean(o.showOnlyNumbersOnFocus)||a.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(o.showOnlyNumbersOnFocus,"] given.")),a.isInArray(o.digitalGroupSpacing,[s.options.digitalGroupSpacing.two,s.options.digitalGroupSpacing.twoThree,s.options.digitalGroupSpacing.twoScaled,s.options.digitalGroupSpacing.three,s.options.digitalGroupSpacing.four])||o.digitalGroupSpacing>=2&&o.digitalGroupSpacing<=4||a.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2t', '2s', '3', or '4', [".concat(o.digitalGroupSpacing,"] given.")),a.isInArray(o.decimalCharacter,[s.options.decimalCharacter.comma,s.options.decimalCharacter.dot,s.options.decimalCharacter.middleDot,s.options.decimalCharacter.arabicDecimalSeparator,s.options.decimalCharacter.decimalSeparatorKeySymbol])||a.throwError("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '\xB7', '\u2396' or '\u066B', [".concat(o.decimalCharacter,"] given.")),o.decimalCharacter===o.digitGroupSeparator&&a.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(o.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(o.digitGroupSeparator,"] are the same character.")),a.isNull(o.decimalCharacterAlternative)||a.isString(o.decimalCharacterAlternative)||a.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(o.decimalCharacterAlternative,"] given.")),o.currencySymbol===""||a.isString(o.currencySymbol)||a.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(o.currencySymbol,"] given.")),a.isInArray(o.currencySymbolPlacement,[s.options.currencySymbolPlacement.prefix,s.options.currencySymbolPlacement.suffix])||a.throwError("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), [".concat(o.currencySymbolPlacement,"] given.")),a.isInArray(o.negativePositiveSignPlacement,[s.options.negativePositiveSignPlacement.prefix,s.options.negativePositiveSignPlacement.suffix,s.options.negativePositiveSignPlacement.left,s.options.negativePositiveSignPlacement.right,s.options.negativePositiveSignPlacement.none])||a.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(o.negativePositiveSignPlacement,"] given.")),a.isTrueOrFalseString(o.showPositiveSign)||a.isBoolean(o.showPositiveSign)||a.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(o.showPositiveSign,"] given.")),(!a.isString(o.suffixText)||o.suffixText!==""&&(a.isNegative(o.suffixText,o.negativeSignCharacter)||E.test(o.suffixText)))&&a.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(o.negativeSignCharacter,"' nor any numerical characters, [").concat(o.suffixText,"] given.")),(!a.isString(o.negativeSignCharacter)||o.negativeSignCharacter.length!==1||a.isUndefinedOrNullOrEmpty(o.negativeSignCharacter)||E.test(o.negativeSignCharacter))&&a.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(o.negativeSignCharacter,"] given.")),(!a.isString(o.positiveSignCharacter)||o.positiveSignCharacter.length!==1||a.isUndefinedOrNullOrEmpty(o.positiveSignCharacter)||E.test(o.positiveSignCharacter))&&a.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(o.positiveSignCharacter,"] given.\nIf you want to show the positive sign character, you need to set the `showPositiveSign` option to `true`.")),o.negativeSignCharacter===o.positiveSignCharacter&&a.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(o.negativeSignCharacter,"] given.")),a.isTrueOrFalseString(o.negativePositiveSignBehavior)||a.isBoolean(o.negativePositiveSignBehavior)||a.throwError("The option 'negativePositiveSignBehavior' is invalid ; it should be either 'true' or 'false', [".concat(o.negativePositiveSignBehavior,"] given."));var T=te(a.isNull(o.negativeBracketsTypeOnBlur)?["",""]:o.negativeBracketsTypeOnBlur.split(","),2),D=T[0],$=T[1];(a.contains(o.digitGroupSeparator,o.negativeSignCharacter)||a.contains(o.decimalCharacter,o.negativeSignCharacter)||a.contains(o.decimalCharacterAlternative,o.negativeSignCharacter)||a.contains(D,o.negativeSignCharacter)||a.contains($,o.negativeSignCharacter)||a.contains(o.suffixText,o.negativeSignCharacter))&&a.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(o.negativeSignCharacter,"] given.")),(a.contains(o.digitGroupSeparator,o.positiveSignCharacter)||a.contains(o.decimalCharacter,o.positiveSignCharacter)||a.contains(o.decimalCharacterAlternative,o.positiveSignCharacter)||a.contains(D,o.positiveSignCharacter)||a.contains($,o.positiveSignCharacter)||a.contains(o.suffixText,o.positiveSignCharacter))&&a.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(o.positiveSignCharacter,"] given.")),a.isNull(o.overrideMinMaxLimits)||a.isInArray(o.overrideMinMaxLimits,[s.options.overrideMinMaxLimits.ceiling,s.options.overrideMinMaxLimits.floor,s.options.overrideMinMaxLimits.ignore,s.options.overrideMinMaxLimits.invalid])||a.throwError("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor', 'ignore' or 'invalid', [".concat(o.overrideMinMaxLimits,"] given.")),o.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.invalid&&o.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.ignore&&(o.minimumValue>0||o.maximumValue<0)&&a.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 (i.e. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),a.isString(o.maximumValue)&&O.test(o.maximumValue)||a.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(o.maximumValue,"] given.")),a.isString(o.minimumValue)&&O.test(o.minimumValue)||a.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(o.minimumValue,"] given.")),parseFloat(o.minimumValue)>parseFloat(o.maximumValue)&&a.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(o.minimumValue,"] should be smaller than 'maximumValue' [").concat(o.maximumValue,"].")),a.isInt(o.decimalPlaces)&&o.decimalPlaces>=0||a.isString(o.decimalPlaces)&&S.test(o.decimalPlaces)||a.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(o.decimalPlaces,"] given.")),a.isNull(o.decimalPlacesRawValue)||a.isInt(o.decimalPlacesRawValue)&&o.decimalPlacesRawValue>=0||a.isString(o.decimalPlacesRawValue)&&S.test(o.decimalPlacesRawValue)||a.throwError("The number of decimal places for the raw value option 'decimalPlacesRawValue' is invalid ; it should be a positive integer or `null`, [".concat(o.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(o),a.isNull(o.decimalPlacesShownOnFocus)||S.test(String(o.decimalPlacesShownOnFocus))||a.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(o.decimalPlacesShownOnFocus,"] given.")),!a.isNull(o.decimalPlacesShownOnFocus)&&Number(o.decimalPlaces)>Number(o.decimalPlacesShownOnFocus)&&a.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(o.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(o.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?"),o.showWarnings),(a.isNull(o.divisorWhenUnfocused)||d.test(o.divisorWhenUnfocused))&&o.divisorWhenUnfocused!==0&&o.divisorWhenUnfocused!=="0"&&o.divisorWhenUnfocused!==1&&o.divisorWhenUnfocused!=="1"||a.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(o.divisorWhenUnfocused,"] given.")),a.isNull(o.decimalPlacesShownOnBlur)||S.test(o.decimalPlacesShownOnBlur)||a.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(o.decimalPlacesShownOnBlur,"] given.")),a.isNull(o.symbolWhenUnfocused)||a.isString(o.symbolWhenUnfocused)||a.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(o.symbolWhenUnfocused,"] given.")),a.isTrueOrFalseString(o.saveValueToSessionStorage)||a.isBoolean(o.saveValueToSessionStorage)||a.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(o.saveValueToSessionStorage,"] given.")),a.isInArray(o.onInvalidPaste,[s.options.onInvalidPaste.error,s.options.onInvalidPaste.ignore,s.options.onInvalidPaste.clamp,s.options.onInvalidPaste.truncate,s.options.onInvalidPaste.replace])||a.throwError("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), [".concat(o.onInvalidPaste,"] given.")),a.isInArray(o.roundingMethod,[s.options.roundingMethod.halfUpSymmetric,s.options.roundingMethod.halfUpAsymmetric,s.options.roundingMethod.halfDownSymmetric,s.options.roundingMethod.halfDownAsymmetric,s.options.roundingMethod.halfEvenBankersRounding,s.options.roundingMethod.upRoundAwayFromZero,s.options.roundingMethod.downRoundTowardZero,s.options.roundingMethod.toCeilingTowardPositiveInfinity,s.options.roundingMethod.toFloorTowardNegativeInfinity,s.options.roundingMethod.toNearest05,s.options.roundingMethod.toNearest05Alt,s.options.roundingMethod.upToNext05,s.options.roundingMethod.downToNext05])||a.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(o.roundingMethod,"] given.")),a.isNull(o.negativeBracketsTypeOnBlur)||a.isInArray(o.negativeBracketsTypeOnBlur,[s.options.negativeBracketsTypeOnBlur.parentheses,s.options.negativeBracketsTypeOnBlur.brackets,s.options.negativeBracketsTypeOnBlur.chevrons,s.options.negativeBracketsTypeOnBlur.curlyBraces,s.options.negativeBracketsTypeOnBlur.angleBrackets,s.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,s.options.negativeBracketsTypeOnBlur.halfBrackets,s.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,s.options.negativeBracketsTypeOnBlur.quotationMarks,s.options.negativeBracketsTypeOnBlur.guillemets])||a.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(o.negativeBracketsTypeOnBlur,"] given.")),(a.isString(o.emptyInputBehavior)||a.isNumber(o.emptyInputBehavior))&&(a.isInArray(o.emptyInputBehavior,[s.options.emptyInputBehavior.focus,s.options.emptyInputBehavior.press,s.options.emptyInputBehavior.always,s.options.emptyInputBehavior.min,s.options.emptyInputBehavior.max,s.options.emptyInputBehavior.zero,s.options.emptyInputBehavior.null])||O.test(o.emptyInputBehavior))||a.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(o.emptyInputBehavior,"] given.")),o.emptyInputBehavior===s.options.emptyInputBehavior.zero&&(o.minimumValue>0||o.maximumValue<0)&&a.throwError("The 'emptyInputBehavior' option is set to 'zero', but this value is outside of the range defined by 'minimumValue' and 'maximumValue' [".concat(o.minimumValue,", ").concat(o.maximumValue,"].")),O.test(String(o.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(o.emptyInputBehavior,o)||a.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(o.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(o.minimumValue,", ").concat(o.maximumValue,"]."))),a.isTrueOrFalseString(o.eventBubbles)||a.isBoolean(o.eventBubbles)||a.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(o.eventBubbles,"] given.")),a.isTrueOrFalseString(o.eventIsCancelable)||a.isBoolean(o.eventIsCancelable)||a.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(o.eventIsCancelable,"] given.")),!a.isBoolean(o.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(o.invalidClass)||a.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(o.invalidClass,"] given.")),a.isInArray(o.leadingZero,[s.options.leadingZero.allow,s.options.leadingZero.deny,s.options.leadingZero.keep])||a.throwError("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [".concat(o.leadingZero,"] given.")),a.isTrueOrFalseString(o.formatOnPageLoad)||a.isBoolean(o.formatOnPageLoad)||a.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(o.formatOnPageLoad,"] given.")),a.isTrueOrFalseString(o.formulaMode)||a.isBoolean(o.formulaMode)||a.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(o.formulaMode,"] given.")),S.test(o.historySize)&&o.historySize!==0||a.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(o.historySize,"] given.")),a.isTrueOrFalseString(o.selectNumberOnly)||a.isBoolean(o.selectNumberOnly)||a.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(o.selectNumberOnly,"] given.")),a.isTrueOrFalseString(o.selectOnFocus)||a.isBoolean(o.selectOnFocus)||a.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(o.selectOnFocus,"] given.")),a.isNull(o.defaultValueOverride)||o.defaultValueOverride===""||O.test(o.defaultValueOverride)||a.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(o.defaultValueOverride,"] given.")),a.isTrueOrFalseString(o.unformatOnSubmit)||a.isBoolean(o.unformatOnSubmit)||a.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(o.unformatOnSubmit,"] given.")),a.isNull(o.valuesToStrings)||a.isObject(o.valuesToStrings)||a.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(o.valuesToStrings,"] given.")),a.isNull(o.outputFormat)||a.isInArray(o.outputFormat,[s.options.outputFormat.string,s.options.outputFormat.number,s.options.outputFormat.dot,s.options.outputFormat.negativeDot,s.options.outputFormat.comma,s.options.outputFormat.negativeComma,s.options.outputFormat.dotNegative,s.options.outputFormat.commaNegative])||a.throwError("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [".concat(o.outputFormat,"] given.")),a.isTrueOrFalseString(o.isCancellable)||a.isBoolean(o.isCancellable)||a.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(o.isCancellable,"] given.")),a.isTrueOrFalseString(o.modifyValueOnUpDownArrow)||a.isBoolean(o.modifyValueOnUpDownArrow)||a.throwError("The increment/decrement on up and down arrow keys 'modifyValueOnUpDownArrow' is invalid ; it should be either 'true' or 'false', [".concat(o.modifyValueOnUpDownArrow,"] given.")),a.isTrueOrFalseString(o.modifyValueOnWheel)||a.isBoolean(o.modifyValueOnWheel)||a.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(o.modifyValueOnWheel,"] given.")),a.isTrueOrFalseString(o.watchExternalChanges)||a.isBoolean(o.watchExternalChanges)||a.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(o.watchExternalChanges,"] given.")),a.isInArray(o.wheelOn,[s.options.wheelOn.focus,s.options.wheelOn.hover])||a.throwError("The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [".concat(o.wheelOn,"] given.")),(!a.isString(o.upDownStep)&&!a.isNumber(o.upDownStep)||o.upDownStep!=="progressive"&&!d.test(o.upDownStep)||Number(o.upDownStep)===0)&&a.throwError("The up/down arrow step value option 'upDownStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(o.upDownStep,"] given.")),(!a.isString(o.wheelStep)&&!a.isNumber(o.wheelStep)||o.wheelStep!=="progressive"&&!d.test(o.wheelStep)||Number(o.wheelStep)===0)&&a.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(o.wheelStep,"] given.")),a.isInArray(o.serializeSpaces,[s.options.serializeSpaces.plus,s.options.serializeSpaces.percent])||a.throwError("The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [".concat(o.serializeSpaces,"] given.")),a.isTrueOrFalseString(o.noEventListeners)||a.isBoolean(o.noEventListeners)||a.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(o.noEventListeners,"] given.")),a.isNull(o.styleRules)||a.isObject(o.styleRules)&&(Object.prototype.hasOwnProperty.call(o.styleRules,"positive")||Object.prototype.hasOwnProperty.call(o.styleRules,"negative")||Object.prototype.hasOwnProperty.call(o.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(o.styleRules,"userDefined"))||a.throwError("The option 'styleRules' is invalid ; it should be a correctly structured object, with one or more 'positive', 'negative', 'ranges' or 'userDefined' attributes, [".concat(o.styleRules,"] given.")),a.isNull(o.styleRules)||!Object.prototype.hasOwnProperty.call(o.styleRules,"userDefined")||a.isNull(o.styleRules.userDefined)||o.styleRules.userDefined.forEach(function(W){Object.prototype.hasOwnProperty.call(W,"callback")&&!a.isFunction(W.callback)&&a.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(J(W.callback)," given."))}),(a.isNull(o.rawValueDivisor)||d.test(o.rawValueDivisor))&&o.rawValueDivisor!==0&&o.rawValueDivisor!=="0"&&o.rawValueDivisor!==1&&o.rawValueDivisor!=="1"||a.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(o.rawValueDivisor,"] given.")),a.isTrueOrFalseString(o.readOnly)||a.isBoolean(o.readOnly)||a.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(o.readOnly,"] given.")),a.isTrueOrFalseString(o.unformatOnHover)||a.isBoolean(o.unformatOnHover)||a.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(o.unformatOnHover,"] given.")),a.isTrueOrFalseString(o.failOnUnknownOption)||a.isBoolean(o.failOnUnknownOption)||a.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(o.failOnUnknownOption,"] given.")),a.isTrueOrFalseString(o.createLocalList)||a.isBoolean(o.createLocalList)||a.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(o.createLocalList,"] given."))}},{key:"_validateDecimalPlacesRawValue",value:function(e){a.isNull(e.decimalPlacesRawValue)||(e.decimalPlacesRawValue<e.decimalPlaces&&a.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&&a.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&&a.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{i=!1}return i}},{key:"getDefaultConfig",value:function(){return s.defaultSettings}},{key:"getPredefinedOptions",value:function(){return s.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var i,r=this;return a.isUndefinedOrNullOrEmpty(e)||e.length===0?i=null:(i={},e.length===1&&Array.isArray(e[0])?e[0].forEach(function(o){se(i,r._getOptionObject(o))}):e.length>=1&&e.forEach(function(o){se(i,r._getOptionObject(o))})),i}},{key:"format",value:function(e){if(a.isUndefined(e)||e===null)return null;var i;i=a.isElement(e)?a.getElementValue(e):e,a.isString(i)||a.isNumber(i)||a.throwError('The value "'.concat(i,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var r=arguments.length,o=new Array(r>1?r-1:0),u=1;u<r;u++)o[u-1]=arguments[u];var g=this._generateOptionsObjectFromOptionsArray(o),S=se({},this.getDefaultConfig(),g);S.isNegativeSignAllowed=i<0,S.isPositiveSignAllowed=i>=0,this._setBrackets(S),this._cachesUsualRegularExpressions(S,{});var E=this._toNumericValue(i,S);return isNaN(Number(E))&&a.throwError("The value [".concat(E,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(E,S)||(a.triggerEvent(s.events.formatted,document,{oldValue:null,newValue:null,oldRawValue:null,newRawValue:null,isPristine:null,error:"Range test failed",aNElement:null},!0,!0),a.throwError("The value [".concat(E,"] being set falls outside of the minimumValue [").concat(S.minimumValue,"] and maximumValue [").concat(S.maximumValue,"] range set for this element"))),S.valuesToStrings&&this._checkValuesToStringsSettings(i,S)?S.valuesToStrings[i]:(this._correctNegativePositiveSignPlacementOption(S),this._calculateDecimalPlacesOnInit(S),a.isUndefinedOrNullOrEmpty(S.rawValueDivisor)||S.rawValueDivisor===0||E===""||E===null||(E*=S.rawValueDivisor),E=this._roundFormattedValueShownOnFocus(E,S),E=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(E,S),E=this._addGroupSeparators(E,S,!1,E))}},{key:"formatAndSet",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=this.format(e,i);return a.setElementValue(e,r),r}},{key:"unformat",value:function(e){if(a.isNumberStrict(e))return e;var i;if((i=a.isElement(e)?a.getElementValue(e):e)==="")return"";if(a.isUndefined(i)||i===null)return null;(a.isArray(i)||a.isObject(i))&&a.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,o=new Array(r>1?r-1:0),u=1;u<r;u++)o[u-1]=arguments[u];var g=this._generateOptionsObjectFromOptionsArray(o),S=se({},this.getDefaultConfig(),g);if(S.isNegativeSignAllowed=!1,S.isPositiveSignAllowed=!0,i=i.toString(),S.valuesToStrings&&this._checkStringsToValuesSettings(i,S))return a.objectKeyLookup(S.valuesToStrings,i);if(a.isNegative(i,S.negativeSignCharacter))S.isNegativeSignAllowed=!0,S.isPositiveSignAllowed=!1;else if(!a.isNull(S.negativeBracketsTypeOnBlur)){var E=te(S.negativeBracketsTypeOnBlur.split(","),2);S.firstBracket=E[0],S.lastBracket=E[1],i.charAt(0)===S.firstBracket&&i.charAt(i.length-1)===S.lastBracket&&(S.isNegativeSignAllowed=!0,S.isPositiveSignAllowed=!1,i=this._removeBrackets(i,S,!1))}return i=this._convertToNumericString(i,S),a.isNumber(Number(i))&&(i=a.scientificToDecimal(i)),new RegExp("[^+-0123456789.]","gi").test(i)?NaN:(this._correctNegativePositiveSignPlacementOption(S),S.decimalPlacesRawValue?S.originalDecimalPlacesRawValue=S.decimalPlacesRawValue:S.originalDecimalPlacesRawValue=S.decimalPlaces,this._calculateDecimalPlacesOnInit(S),a.isUndefinedOrNullOrEmpty(S.rawValueDivisor)||S.rawValueDivisor===0||i===""||i===null||(i/=S.rawValueDivisor),i=(i=this._roundRawValue(i,S)).replace(S.decimalCharacter,"."),i=this._toLocale(i,S.outputFormat,S))}},{key:"unformatAndSet",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=this.unformat(e,i);return a.setElementValue(e,r),r}},{key:"localize",value:function(e){var i,r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return(i=a.isElement(e)?a.getElementValue(e):e)===""?"":(a.isNull(o)&&(o=s.defaultSettings),i=this.unformat(i,o),Number(i)===0&&o.leadingZero!==s.options.leadingZero.keep&&(i="0"),r=a.isNull(o)?o.outputFormat:s.defaultSettings.outputFormat,this._toLocale(i,r,o))}},{key:"localizeAndSet",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=this.localize(e,i);return a.setElementValue(e,r),r}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(a.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var i=a.domElement(e);return this.isManagedByAutoNumeric(i)?this._getFromGlobalList(i):null}},{key:"set",value:function(e,i){var r,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],g=a.domElement(e);return this.isManagedByAutoNumeric(g)?this.getAutoNumericElement(g).set(i,o,u):(r=!(!a.isNull(o)&&Object.prototype.hasOwnProperty.call(o,"showWarnings"))||o.showWarnings,a.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",r),null)}},{key:"getNumericString",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._get(e,"getNumericString",i)}},{key:"getFormatted",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._get(e,"getFormatted",i)}},{key:"getNumber",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._get(e,"getNumber",i)}},{key:"_get",value:function(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=a.domElement(e);return this.isManagedByAutoNumeric(o)||a.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(o)[i](r)}},{key:"getLocalized",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=a.domElement(e);return this.isManagedByAutoNumeric(o)||a.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(o).getLocalized(i,r)}},{key:"_stripAllNonNumberCharacters",value:function(e,i,r,o){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,r,o).replace(i.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,i,r,o){var u=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(i.allowedAutoStrip,"")).match(i.numRegAutoStrip);if(e=u?[u[1],u[2],u[3]].join(""):"",i.leadingZero===s.options.leadingZero.allow||i.leadingZero===s.options.leadingZero.keep){var g="",S=te(e.split(i.decimalCharacter),2),E=S[0],O=S[1],d=E;a.contains(d,i.negativeSignCharacter)&&(g=i.negativeSignCharacter,d=d.replace(i.negativeSignCharacter,"")),g===""&&d.length>i.mIntPos&&d.charAt(0)==="0"&&(d=d.slice(1)),g!==""&&d.length>i.mIntNeg&&d.charAt(0)==="0"&&(d=d.slice(1)),e="".concat(g).concat(d).concat(a.isUndefined(O)?"":i.decimalCharacter+O)}return(r&&i.leadingZero===s.options.leadingZero.deny||!o&&i.leadingZero===s.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 a.isNull(i.negativeBracketsTypeOnBlur)?e:"".concat(i.firstBracket).concat(e.replace(i.negativeSignCharacter,"")).concat(i.lastBracket)}},{key:"_removeBrackets",value:function(e,i){var r,o=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return a.isNull(i.negativeBracketsTypeOnBlur)||e.charAt(0)!==i.firstBracket?r=e:(r=(r=e.replace(i.firstBracket,"")).replace(i.lastBracket,""),o?(r=r.replace(i.currencySymbol,""),r=this._mergeCurrencySignNegativePositiveSignAndValue(r,i,!0,!1)):r="".concat(i.negativeSignCharacter).concat(r)),r}},{key:"_setBrackets",value:function(e){if(a.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var i=te(e.negativeBracketsTypeOnBlur.split(","),2),r=i[0],o=i[1];e.firstBracket=r,e.lastBracket=o}}},{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,".")),a.isNegative(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-".concat(e)),i.showPositiveSign&&(e=e.replace(i.positiveSignCharacter,""));var r=i.leadingZero!==s.options.leadingZero.keep,o=a.arabicToLatinNumbers(e,r,!1,!1);return isNaN(o)||(e=o.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,i){return e=String(e),i.currencySymbol!==s.options.currencySymbol.none&&(e=e.replace(i.currencySymbol,"")),i.suffixText!==s.options.suffixText.none&&(e=e.replace(i.suffixText,"")),i.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen&&(e=e.replace(i.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,i,r){if(a.isNull(i)||i===s.options.outputFormat.string)return e;var o;switch(i){case s.options.outputFormat.number:o=Number(e);break;case s.options.outputFormat.dotNegative:o=a.isNegative(e)?e.replace("-","")+"-":e;break;case s.options.outputFormat.comma:case s.options.outputFormat.negativeComma:o=e.replace(".",",");break;case s.options.outputFormat.commaNegative:o=e.replace(".",","),o=a.isNegative(o)?o.replace("-","")+"-":o;break;case s.options.outputFormat.dot:case s.options.outputFormat.negativeDot:o=e;break;default:a.throwError("The given outputFormat [".concat(i,"] option is not recognized."))}return i!==s.options.outputFormat.number&&r.negativeSignCharacter!=="-"&&(o=o.replace("-",r.negativeSignCharacter)),o}},{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 o;if(i.emptyInputBehavior===s.options.emptyInputBehavior.always||r)switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.none:o=e+i.currencySymbol+i.suffixText;break;default:o=i.currencySymbol+e+i.suffixText}else o=e;return o}},{key:"_addGroupSeparators",value:function(e,i,r,o){var u,g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;if(u=a.isNull(g)?a.isNegative(e,i.negativeSignCharacter)||a.isNegativeWithBrackets(e,i.firstBracket,i.lastBracket):g<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,!1,r),this._isElementValueEmptyOrOnlyTheNegativeSign(e,i))return this._orderValueCurrencySymbolAndSuffixText(e,i,!0);var S=a.isZeroOrHasNoValue(e);u&&(e=e.replace("-",""));var E,O=te(e.split(i.decimalCharacter),2),d=O[0],T=O[1];if(i.decimalCharacterAlternative&&a.isUndefined(T)){var D=te(e.split(i.decimalCharacterAlternative),2);d=D[0],T=D[1]}if(i.digitGroupSeparator!==""){var $;switch(i.digitalGroupSpacing=i.digitalGroupSpacing.toString(),i.digitalGroupSpacing){case s.options.digitalGroupSpacing.twoThree:$=/(\d)((\d)(\d{2}?)+)$/;break;case s.options.digitalGroupSpacing.twoScaled:$=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case s.options.digitalGroupSpacing.two:case s.options.digitalGroupSpacing.three:case s.options.digitalGroupSpacing.four:default:$=new RegExp("(\\d)((\\d{".concat(i.digitalGroupSpacing,"}?)+)$"))}for(;$.test(d);)d=d.replace($,"$1".concat(i.digitGroupSeparator,"$2"))}return(E=r?i.decimalPlacesShownOnFocus:i.decimalPlacesShownOnBlur)===0||a.isUndefined(T)?e=d:(T.length>E&&(T=T.substring(0,E)),e="".concat(d).concat(i.decimalCharacter).concat(T)),e=s._mergeCurrencySignNegativePositiveSignAndValue(e,i,u,S),a.isNull(g)&&(g=o),i.negativeBracketsTypeOnBlur!==null&&(g<0||a.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,o){var u,g="";if(r?g=i.negativeSignCharacter:i.showPositiveSign&&!o&&(g=i.positiveSignCharacter),i.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(r||!r&&i.showPositiveSign&&!o))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:u="".concat(g).concat(i.currencySymbol).concat(e);break;case s.options.negativePositiveSignPlacement.right:u="".concat(i.currencySymbol).concat(g).concat(e);break;case s.options.negativePositiveSignPlacement.suffix:u="".concat(i.currencySymbol).concat(e).concat(g)}else u=i.currencySymbol+e;else if(i.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(r||!r&&i.showPositiveSign&&!o))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:u="".concat(e).concat(i.currencySymbol).concat(g);break;case s.options.negativePositiveSignPlacement.left:u="".concat(e).concat(g).concat(i.currencySymbol);break;case s.options.negativePositiveSignPlacement.prefix:u="".concat(g).concat(e).concat(i.currencySymbol)}else u=e+i.currencySymbol;return u}},{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"),i===0&&(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(a.isNull(e))return e;if(e=e===""?"0":e.toString(),i.roundingMethod===s.options.roundingMethod.toNearest05||i.roundingMethod===s.options.roundingMethod.toNearest05Alt||i.roundingMethod===s.options.roundingMethod.upToNext05||i.roundingMethod===s.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,i);var o,u=te(s._prepareValueForRounding(e,i),2),g=u[0],S=(e=u[1]).lastIndexOf("."),E=S===-1,O=te(e.split("."),2),d=O[0];if(!(O[1]>0||i.allowDecimalPadding!==s.options.allowDecimalPadding.never&&i.allowDecimalPadding!==s.options.allowDecimalPadding.floats))return Number(e)===0?d:"".concat(g).concat(d);o=i.allowDecimalPadding===s.options.allowDecimalPadding.always||i.allowDecimalPadding===s.options.allowDecimalPadding.floats?r:i.allowDecimalPadding>0?i.allowDecimalPadding:0;var T,D=E?e.length-1:S,$=e.length-1-D,W="";if($<=r){if(W=e,$<o){E&&(W="".concat(W).concat(i.decimalCharacter));for(var ie="000000";$<o;)W+=ie=ie.substring(0,o-$),$+=ie.length}else $>o?W=this._truncateZeros(W,o):$===0&&o===0&&(W=W.replace(/\.$/,""));return Number(W)===0?W:"".concat(g).concat(W)}T=E?r-1:Number(r)+Number(S);var qe,rt=Number(e.charAt(T+1)),st=e.substring(0,T+1).split("");if(qe=e.charAt(T)==="."?e.charAt(T-1)%2:e.charAt(T)%2,this._shouldRoundUp(rt,i,g,qe)){for(var Ze=st.length-1;Ze>=0;Ze-=1)if(st[Ze]!=="."){if(st[Ze]=+st[Ze]+1,st[Ze]<10)break;Ze>0&&(st[Ze]="0")}}return st=st.slice(0,T+1),W=this._truncateZeros(st.join(""),o),Number(W)===0?W:"".concat(g).concat(W)}},{key:"_roundCloseTo05",value:function(e,i){switch(i.roundingMethod){case s.options.roundingMethod.toNearest05:case s.options.roundingMethod.toNearest05Alt:e=(Math.round(20*e)/20).toString();break;case s.options.roundingMethod.upToNext05:e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}return a.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,i){var r="";return a.isNegativeStrict(e,"-")&&(r="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),Number(e)===0&&(r=""),(Number(e)>0&&i.leadingZero!==s.options.leadingZero.keep||e.length>0&&i.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[r,e]}},{key:"_shouldRoundUp",value:function(e,i,r,o){return e>4&&i.roundingMethod===s.options.roundingMethod.halfUpSymmetric||e>4&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&r===""||e>5&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&r==="-"||e>5&&i.roundingMethod===s.options.roundingMethod.halfDownSymmetric||e>5&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&r===""||e>4&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&r==="-"||e>5&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding||e===5&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding&&o===1||e>0&&i.roundingMethod===s.options.roundingMethod.toCeilingTowardPositiveInfinity&&r===""||e>0&&i.roundingMethod===s.options.roundingMethod.toFloorTowardNegativeInfinity&&r==="-"||e>0&&i.roundingMethod===s.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,i,r,o){r&&(e=this._roundFormattedValueShownOnFocus(e,i));var u=te(e.split(i.decimalCharacter),2),g=u[0],S=u[1];if(S&&S.length>o)if(o>0){var E=S.substring(0,o);e="".concat(g).concat(i.decimalCharacter).concat(E)}else e=g;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,i){if(a.isNull(e)&&i.emptyInputBehavior===s.options.emptyInputBehavior.null||i.overrideMinMaxLimits===s.options.overrideMinMaxLimits.ignore||i.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var r,o=a.parseStr(i.minimumValue),u=a.parseStr(i.maximumValue),g=a.parseStr(e);switch(i.overrideMinMaxLimits){case s.options.overrideMinMaxLimits.floor:r=[a.testMinMax(o,g)>-1,!0];break;case s.options.overrideMinMaxLimits.ceiling:r=[!0,a.testMinMax(u,g)<1];break;default:r=[a.testMinMax(o,g)>-1,a.testMinMax(u,g)<1]}return r}},{key:"_isWithinRangeWithOverrideOption",value:function(e,i){var r=te(this._checkIfInRangeWithOverrideOption(e,i),2),o=r[0],u=r[1];return o&&u}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),a.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,i){return a.testMinMax(a.parseStr(i.minimumValue),this._cleanValueForRangeParse(e))>-1}},{key:"_isMaximumRangeRespected",value:function(e,i){return a.testMinMax(a.parseStr(i.maximumValue),this._cleanValueForRangeParse(e))<1}},{key:"_correctNegativePositiveSignPlacementOption",value:function(e){if(a.isNull(e.negativePositiveSignPlacement))if(a.isUndefined(e)||!a.isUndefinedOrNullOrEmpty(e.negativePositiveSignPlacement)||a.isUndefinedOrNullOrEmpty(e.currencySymbol))e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.left;else switch(e.currencySymbolPlacement){case s.options.currencySymbolPlacement.suffix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.prefix;break;case s.options.currencySymbolPlacement.prefix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(e){return a.isNull(e)?null:(!a.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&a.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=s.options.selectOnFocus.doNotSelect),a.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!a.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&e.selectOnFocus===s.options.selectOnFocus.select&&(e.caretPositionOnFocus=s.options.caretPositionOnFocus.doNoForceCaretPosition),e)}},{key:"_calculateDecimalPlacesOnInit",value:function(e){this._validateDecimalPlacesRawValue(e),e.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.useDefault&&(e.decimalPlacesShownOnFocus=e.decimalPlaces),e.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.useDefault&&(e.decimalPlacesShownOnBlur=e.decimalPlaces),e.decimalPlacesRawValue===s.options.decimalPlacesRawValue.useDefault&&(e.decimalPlacesRawValue=e.decimalPlaces);var i=0;e.rawValueDivisor&&e.rawValueDivisor!==s.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){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this._validateDecimalPlacesRawValue(e),a.isNull(i)&&a.throwError("When updating the settings, the previous ones should be passed as an argument.");var r="decimalPlaces"in e;if(r||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){r?("decimalPlacesShownOnFocus"in e&&e.decimalPlacesShownOnFocus!==s.options.decimalPlacesShownOnFocus.useDefault||(e.decimalPlacesShownOnFocus=e.decimalPlaces),"decimalPlacesShownOnBlur"in e&&e.decimalPlacesShownOnBlur!==s.options.decimalPlacesShownOnBlur.useDefault||(e.decimalPlacesShownOnBlur=e.decimalPlaces),"decimalPlacesRawValue"in e&&e.decimalPlacesRawValue!==s.options.decimalPlacesRawValue.useDefault||(e.decimalPlacesRawValue=e.decimalPlaces)):(a.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=i.decimalPlacesShownOnFocus),a.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=i.decimalPlacesShownOnBlur));var o=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(o=String(e.rawValueDivisor).length-1)<0&&(o=0),e.decimalPlaces||e.decimalPlacesRawValue?e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+o,Number(e.decimalPlacesRawValue)+o):e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+o,Number(i.originalDecimalPlacesRawValue)+o)}}},{key:"_cachesUsualRegularExpressions",value:function(e,i){var r;r=e.negativeSignCharacter!==s.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,modifyValueOnUpDownArrow:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,negativePositiveSignBehavior:!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,upDownStep:!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(i[r]===!0)continue;Object.prototype.hasOwnProperty.call(i,r)?(a.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&&a.throwError("Option name '".concat(r,"' is unknown. Please fix the options passed to autoNumeric"))}"mDec"in e&&a.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=e.maximumValue>=0}},{key:"_toNumericValue",value:function(e,i){var r;return a.isNumber(Number(e))?(a.isNumberStrict(e)||(e=String(e).trim()),r=a.scientificToDecimal(e)):(r=this._convertToNumericString(e.toString(),i),a.isNumber(Number(r))||(a.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 o=a.parseStr(e);return a.testMinMax(i,o)>-1&&a.testMinMax(r,o)<1}},{key:"_shouldSkipEventKey",value:function(e){var i=a.isInArray(e,l.keyName._allFnKeys),r=e===l.keyName.OSLeft||e===l.keyName.OSRight,o=e===l.keyName.ContextMenu,u=a.isInArray(e,l.keyName._someNonPrintableKeys),g=e===l.keyName.NumLock||e===l.keyName.ScrollLock||e===l.keyName.Insert||e===l.keyName.Command,S=e===l.keyName.Unidentified;return i||r||o||u||S||g}},{key:"_serialize",value:function(e){var i,r=this,o=arguments.length>1&&arguments[1]!==void 0&&arguments[1],u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unformatted",g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"+",S=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,E=[];return J(e)==="object"&&e.nodeName.toLowerCase()==="form"&&Array.prototype.slice.call(e.elements).forEach(function(O){if(O.name&&!O.disabled&&["file","reset","submit","button"].indexOf(O.type)===-1){if(O.type==="select-multiple")Array.prototype.slice.call(O.options).forEach(function($){$.selected&&(o?E.push({name:O.name,value:$.value}):E.push("".concat(encodeURIComponent(O.name),"=").concat(encodeURIComponent($.value))))});else if(["checkbox","radio"].indexOf(O.type)===-1||O.checked){var d,T;if(r.isManagedByAutoNumeric(O))switch(u){case"unformatted":T=r.getAutoNumericElement(O),a.isNull(T)||(d=r.unformat(O,T.getSettings()));break;case"localized":if(T=r.getAutoNumericElement(O),!a.isNull(T)){var D=a.cloneObject(T.getSettings());a.isNull(S)||(D.outputFormat=S),d=r.localize(O,D)}break;default:d=O.value}else d=O.value;a.isUndefined(d)&&a.throwError("This error should never be hit. If it has, something really wrong happened!"),o?E.push({name:O.name,value:d}):E.push("".concat(encodeURIComponent(O.name),"=").concat(encodeURIComponent(d)))}}}),o?i=E:(i=E.join("&"),g==="+"&&(i=i.replace(/%20/g,"+"))),i}},{key:"_serializeNumericString",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+";return this._serialize(e,!1,"unformatted",i)}},{key:"_serializeFormatted",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+";return this._serialize(e,!1,"formatted",i)}},{key:"_serializeLocalized",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this._serialize(e,!1,"localized",i,r)}},{key:"_serializeNumericStringArray",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+";return this._serialize(e,!0,"unformatted",i)}},{key:"_serializeFormattedArray",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+";return this._serialize(e,!0,"formatted",i)}},{key:"_serializeLocalizedArray",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this._serialize(e,!0,"localized",i,r)}}],k&&Re(v.prototype,k),F&&Re(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();H(b,"options",void 0),H(b,"events",void 0),H(b,"defaultSettings",void 0),H(b,"predefinedOptions",void 0),b.multiple=function(s){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,F=[];if(a.isObject(v)&&(k=v,v=null),a.isString(s))s=Ce(document.querySelectorAll(s));else if(a.isObject(s)){Object.prototype.hasOwnProperty.call(s,"rootElement")||a.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var e=Ce(s.rootElement.querySelectorAll("input"));Object.prototype.hasOwnProperty.call(s,"exclude")?(Array.isArray(s.exclude)||a.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),s=a.filterOut(e,s.exclude)):s=e}else a.isArray(s)||a.throwError("The given parameters to the 'multiple' function are invalid.");if(s.length===0){var i=!0;return!a.isNull(k)&&a.isBoolean(k.showWarnings)&&(i=k.showWarnings),a.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",i),[]}var r=a.isArray(v)&&v.length>=1,o=!1,u=!1;if(r){var g=J(Number(v[0]));(o=g==="number"&&!isNaN(Number(v[0])))||(g==="string"||isNaN(g)||g==="object")&&(u=!0)}var S,E=!1;if(a.isArray(k)&&k.length>=1){var O=J(k[0]);O!=="string"&&O!=="object"||(E=!0)}S=u?b.mergeOptions(v):E?b.mergeOptions(k):k;var d,T=a.isNumber(v);return o&&(d=v.length),s.forEach(function(D,$){T?F.push(new b(D,v,S)):o&&$<=d?F.push(new b(D,v[$],S)):F.push(new b(D,null,S))}),F},b.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(b.events.native),Object.freeze(b.events),Object.defineProperty(b,"events",{configurable:!1,writable:!1}),b.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",twoThree:"2t",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"},modifyValueOnUpDownArrow:{modifyValue:!0,doNothing:!1},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"},negativePositiveSignBehavior:{toggle:!0,doNotToggle:!1},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(s){return s%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(s){return s>=-1&&s<0?0:Number(s)===0?1:s>0&&s<=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},upDownStep:{progressive:"progressive"},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},j=b.options,Object.getOwnPropertyNames(j).forEach(function(s){s==="valuesToStrings"?Object.getOwnPropertyNames(j.valuesToStrings).forEach(function(v){j.valuesToStrings[v]!==null&&Object.freeze(j.valuesToStrings[v])}):s!=="styleRules"&&j[s]!==null&&Object.freeze(j[s])}),Object.freeze(j),Object.defineProperty(b,"options",{configurable:!1,writable:!1}),b.defaultSettings={allowDecimalPadding:b.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:b.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:b.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:b.options.createLocalList.createList,currencySymbol:b.options.currencySymbol.none,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,decimalCharacter:b.options.decimalCharacter.dot,decimalCharacterAlternative:b.options.decimalCharacterAlternative.none,decimalPlaces:b.options.decimalPlaces.two,decimalPlacesRawValue:b.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:b.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:b.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:b.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:b.options.digitalGroupSpacing.three,digitGroupSeparator:b.options.digitGroupSeparator.comma,divisorWhenUnfocused:b.options.divisorWhenUnfocused.none,emptyInputBehavior:b.options.emptyInputBehavior.focus,eventBubbles:b.options.eventBubbles.bubbles,eventIsCancelable:b.options.eventIsCancelable.isCancelable,failOnUnknownOption:b.options.failOnUnknownOption.ignore,formatOnPageLoad:b.options.formatOnPageLoad.format,formulaMode:b.options.formulaMode.disabled,historySize:b.options.historySize.medium,invalidClass:b.options.invalidClass,isCancellable:b.options.isCancellable.cancellable,leadingZero:b.options.leadingZero.deny,maximumValue:b.options.maximumValue.tenTrillions,minimumValue:b.options.minimumValue.tenTrillions,modifyValueOnUpDownArrow:b.options.modifyValueOnUpDownArrow.modifyValue,modifyValueOnWheel:b.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:b.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.none,negativeSignCharacter:b.options.negativeSignCharacter.hyphen,negativePositiveSignBehavior:b.options.negativePositiveSignBehavior.doNotToggle,noEventListeners:b.options.noEventListeners.addEvents,onInvalidPaste:b.options.onInvalidPaste.error,outputFormat:b.options.outputFormat.none,overrideMinMaxLimits:b.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:b.options.positiveSignCharacter.plus,rawValueDivisor:b.options.rawValueDivisor.none,readOnly:b.options.readOnly.readWrite,roundingMethod:b.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:b.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:b.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:b.options.selectOnFocus.select,serializeSpaces:b.options.serializeSpaces.plus,showOnlyNumbersOnFocus:b.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:b.options.showPositiveSign.hide,showWarnings:b.options.showWarnings.show,styleRules:b.options.styleRules.none,suffixText:b.options.suffixText.none,symbolWhenUnfocused:b.options.symbolWhenUnfocused.none,unformatOnHover:b.options.unformatOnHover.unformat,unformatOnSubmit:b.options.unformatOnSubmit.keepCurrentValue,upDownStep:"1",valuesToStrings:b.options.valuesToStrings.none,watchExternalChanges:b.options.watchExternalChanges.doNotWatch,wheelOn:b.options.wheelOn.focus,wheelStep:b.options.wheelStep.progressive},Object.freeze(b.defaultSettings),Object.defineProperty(b,"defaultSettings",{configurable:!1,writable:!1});var de={digitGroupSeparator:b.options.digitGroupSeparator.dot,decimalCharacter:b.options.decimalCharacter.comma,decimalCharacterAlternative:b.options.decimalCharacterAlternative.dot,currencySymbol:"\u202F\u20AC",currencySymbolPlacement:b.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.prefix},Fe={digitGroupSeparator:b.options.digitGroupSeparator.comma,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.dollar,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.right},nt={digitGroupSeparator:b.options.digitGroupSeparator.comma,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.yen,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.right};a.cloneObject(de).formulaMode=b.options.formulaMode.enabled;var oe=a.cloneObject(de);oe.minimumValue=0;var re=a.cloneObject(de);re.maximumValue=0,re.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var be=a.cloneObject(de);be.digitGroupSeparator=b.options.digitGroupSeparator.normalSpace;var Y=a.cloneObject(be);Y.minimumValue=0;var ve=a.cloneObject(be);ve.maximumValue=0,ve.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var Se=a.cloneObject(de);Se.currencySymbol=b.options.currencySymbol.none,Se.suffixText="\u202F".concat(b.options.suffixText.percentage),Se.wheelStep=1e-4,Se.rawValueDivisor=b.options.rawValueDivisor.percentage;var ye=a.cloneObject(Se);ye.minimumValue=0;var le=a.cloneObject(Se);le.maximumValue=0,le.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var X=a.cloneObject(Se);X.decimalPlaces=3;var Be=a.cloneObject(ye);Be.decimalPlaces=3;var ce=a.cloneObject(le);ce.decimalPlaces=3,a.cloneObject(Fe).formulaMode=b.options.formulaMode.enabled;var we=a.cloneObject(Fe);we.minimumValue=0;var Oe=a.cloneObject(Fe);Oe.maximumValue=0,Oe.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var Mt=a.cloneObject(Oe);Mt.negativeBracketsTypeOnBlur=b.options.negativeBracketsTypeOnBlur.parentheses;var ze=a.cloneObject(Fe);ze.currencySymbol=b.options.currencySymbol.none,ze.suffixText=b.options.suffixText.percentage,ze.wheelStep=1e-4,ze.rawValueDivisor=b.options.rawValueDivisor.percentage;var Rt=a.cloneObject(ze);Rt.minimumValue=0;var De=a.cloneObject(ze);De.maximumValue=0,De.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var gt=a.cloneObject(ze);gt.decimalPlaces=3;var Ve=a.cloneObject(Rt);Ve.decimalPlaces=3;var He=a.cloneObject(De);He.decimalPlaces=3;var St=a.cloneObject(de);St.currencySymbol=b.options.currencySymbol.lira,b.predefinedOptions={euro:de,euroPos:oe,euroNeg:re,euroSpace:be,euroSpacePos:Y,euroSpaceNeg:ve,percentageEU2dec:Se,percentageEU2decPos:ye,percentageEU2decNeg:le,percentageEU3dec:X,percentageEU3decPos:Be,percentageEU3decNeg:ce,dollar:Fe,dollarPos:we,dollarNeg:Oe,dollarNegBrackets:Mt,percentageUS2dec:ze,percentageUS2decPos:Rt,percentageUS2decNeg:De,percentageUS3dec:gt,percentageUS3decPos:Ve,percentageUS3decNeg:He,French:de,Spanish:de,NorthAmerican:Fe,British:{digitGroupSeparator:b.options.digitGroupSeparator.comma,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.pound,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:b.options.digitGroupSeparator.apostrophe,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:"\u202FCHF",currencySymbolPlacement:b.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.prefix},Japanese:nt,Chinese:nt,Brazilian:{digitGroupSeparator:b.options.digitGroupSeparator.dot,decimalCharacter:b.options.decimalCharacter.comma,currencySymbol:b.options.currencySymbol.real,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.right},Turkish:St,dotDecimalCharCommaSeparator:{digitGroupSeparator:b.options.digitGroupSeparator.comma,decimalCharacter:b.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:b.options.digitGroupSeparator.dot,decimalCharacter:b.options.decimalCharacter.comma,decimalCharacterAlternative:b.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:b.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:b.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:b.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:b.options.allowDecimalPadding.never,minimumValue:b.options.minimumValue.zero,maximumValue:b.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:b.options.allowDecimalPadding.never,minimumValue:b.options.minimumValue.tenTrillions,maximumValue:b.options.maximumValue.zero},numeric:{digitGroupSeparator:b.options.digitGroupSeparator.noSeparator,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.none},numericPos:{digitGroupSeparator:b.options.digitGroupSeparator.noSeparator,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.none,minimumValue:b.options.minimumValue.zero,maximumValue:b.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:b.options.digitGroupSeparator.noSeparator,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.none,minimumValue:b.options.minimumValue.tenTrillions,maximumValue:b.options.maximumValue.zero}},Object.getOwnPropertyNames(b.predefinedOptions).forEach(function(s){Object.freeze(b.predefinedOptions[s])}),Object.freeze(b.predefinedOptions),Object.defineProperty(b,"predefinedOptions",{configurable:!1,writable:!1});let qi=b;return h=h.default})(),typeof en=="object"&&typeof Zn=="object"?Zn.exports=Xi():typeof define=="function"&&define.amd?define([],Xi):typeof en=="object"?en.AutoNumeric=Xi():va.AutoNumeric=Xi()});var so=yo((ao,ro)=>{((n,h)=>{typeof define=="function"&&define.amd?define([],h):typeof ro=="object"&&typeof ao<"u"?ro.exports=h():n.Papa=h()})(ao,function n(){var h=typeof self<"u"?self:typeof window<"u"?window:h!==void 0?h:{},t,l=!h.document&&!!h.postMessage,c=h.IS_PAPA_WORKER||!1,_={},A=0,L={};function ge(w){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(C){var I=pi(C);I.chunkSize=parseInt(I.chunkSize),C.step||C.chunk||(I.chunkSize=null),this._handle=new Ut(I),(this._handle.streamer=this)._config=I}.call(this,w),this.parseChunk=function(C,I){var z=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<z){let ee=this._config.newline;ee||(U=this._config.quoteChar||'"',ee=this._handle.guessLineEndings(C,U)),C=[...C.split(ee).slice(z)].join(ee)}this.isFirstChunk&&fe(this._config.beforeFirstChunk)&&(U=this._config.beforeFirstChunk(C))!==void 0&&(C=U),this.isFirstChunk=!1,this._halted=!1;var z=this._partialLine+C,U=(this._partialLine="",this._handle.parse(z,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(C=U.meta.cursor,z=(this._finished||(this._partialLine=z.substring(C-this._baseIndex),this._baseIndex=C),U&&U.data&&(this._rowCount+=U.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),c)h.postMessage({results:U,workerId:L.WORKER_ID,finished:z});else if(fe(this._config.chunk)&&!I){if(this._config.chunk(U,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=U=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(U.data),this._completeResults.errors=this._completeResults.errors.concat(U.errors),this._completeResults.meta=U.meta),this._completed||!z||!fe(this._config.complete)||U&&U.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),z||U&&U.meta.paused||this._nextChunk(),U}this._halted=!0},this._sendError=function(C){fe(this._config.error)?this._config.error(C):c&&this._config.error&&h.postMessage({workerId:L.WORKER_ID,error:C,finished:!1})}}function _e(w){var C;(w=w||{}).chunkSize||(w.chunkSize=L.RemoteChunkSize),ge.call(this,w),this._nextChunk=l?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(I){this._input=I,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(C=new XMLHttpRequest,this._config.withCredentials&&(C.withCredentials=this._config.withCredentials),l||(C.onload=kt(this._chunkLoaded,this),C.onerror=kt(this._chunkError,this)),C.open(this._config.downloadRequestBody?"POST":"GET",this._input,!l),this._config.downloadRequestHeaders){var I,z=this._config.downloadRequestHeaders;for(I in z)C.setRequestHeader(I,z[I])}var U;this._config.chunkSize&&(U=this._start+this._config.chunkSize-1,C.setRequestHeader("Range","bytes="+this._start+"-"+U));try{C.send(this._config.downloadRequestBody)}catch(ee){this._chunkError(ee.message)}l&&C.status===0&&this._chunkError()}},this._chunkLoaded=function(){C.readyState===4&&(C.status<200||400<=C.status?this._chunkError():(this._start+=this._config.chunkSize||C.responseText.length,this._finished=!this._config.chunkSize||this._start>=(I=>(I=I.getResponseHeader("Content-Range"))!==null?parseInt(I.substring(I.lastIndexOf("/")+1)):-1)(C),this.parseChunk(C.responseText)))},this._chunkError=function(I){I=C.statusText||I,this._sendError(new Error(I))}}function dt(w){(w=w||{}).chunkSize||(w.chunkSize=L.LocalChunkSize),ge.call(this,w);var C,I,z=typeof FileReader<"u";this.stream=function(U){this._input=U,I=U.slice||U.webkitSlice||U.mozSlice,z?((C=new FileReader).onload=kt(this._chunkLoaded,this),C.onerror=kt(this._chunkError,this)):C=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var U=this._input,ee=(this._config.chunkSize&&(ee=Math.min(this._start+this._config.chunkSize,this._input.size),U=I.call(U,this._start,ee)),C.readAsText(U,this._config.encoding));z||this._chunkLoaded({target:{result:ee}})},this._chunkLoaded=function(U){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(U.target.result)},this._chunkError=function(){this._sendError(C.error)}}function a(w){var C;ge.call(this,w=w||{}),this.stream=function(I){return C=I,this._nextChunk()},this._nextChunk=function(){var I,z;if(!this._finished)return I=this._config.chunkSize,C=I?(z=C.substring(0,I),C.substring(I)):(z=C,""),this._finished=!C,this.parseChunk(z)}}function pt(w){ge.call(this,w=w||{});var C=[],I=!0,z=!1;this.pause=function(){ge.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){ge.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(U){this._input=U,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){z&&C.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),C.length?this.parseChunk(C.shift()):I=!0},this._streamData=kt(function(U){try{C.push(typeof U=="string"?U:U.toString(this._config.encoding)),I&&(I=!1,this._checkIsFinished(),this.parseChunk(C.shift()))}catch(ee){this._streamError(ee)}},this),this._streamError=kt(function(U){this._streamCleanUp(),this._sendError(U)},this),this._streamEnd=kt(function(){this._streamCleanUp(),z=!0,this._streamData("")},this),this._streamCleanUp=kt(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function Ut(w){var C,I,z,U,ee=Math.pow(2,53),Ce=-ee,te=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,it=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,Q=this,se=0,J=0,Re=!1,H=!1,ne=[],j={data:[],errors:[],meta:{}};function b(oe){return w.skipEmptyLines==="greedy"?oe.join("").trim()==="":oe.length===1&&oe[0].length===0}function de(){if(j&&z&&(nt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+L.DefaultDelimiter+"'"),z=!1),w.skipEmptyLines&&(j.data=j.data.filter(function(ve){return!b(ve)})),Fe()){let ve=function(Se,ye){fe(w.transformHeader)&&(Se=w.transformHeader(Se,ye)),ne.push(Se)};var Y=ve;if(j)if(Array.isArray(j.data[0])){for(var oe=0;Fe()&&oe<j.data.length;oe++)j.data[oe].forEach(ve);j.data.splice(0,1)}else j.data.forEach(ve)}function re(ve,Se){for(var ye=w.header?{}:[],le=0;le<ve.length;le++){var X=le,Be=ve[le],Be=((ce,we)=>(Oe=>(w.dynamicTypingFunction&&w.dynamicTyping[Oe]===void 0&&(w.dynamicTyping[Oe]=w.dynamicTypingFunction(Oe)),(w.dynamicTyping[Oe]||w.dynamicTyping)===!0))(ce)?we==="true"||we==="TRUE"||we!=="false"&&we!=="FALSE"&&((Oe=>{if(te.test(Oe)&&(Oe=parseFloat(Oe),Ce<Oe&&Oe<ee))return 1})(we)?parseFloat(we):it.test(we)?new Date(we):we===""?null:we):we)(X=w.header?le>=ne.length?"__parsed_extra":ne[le]:X,Be=w.transform?w.transform(Be,X):Be);X==="__parsed_extra"?(ye[X]=ye[X]||[],ye[X].push(Be)):ye[X]=Be}return w.header&&(le>ne.length?nt("FieldMismatch","TooManyFields","Too many fields: expected "+ne.length+" fields but parsed "+le,J+Se):le<ne.length&&nt("FieldMismatch","TooFewFields","Too few fields: expected "+ne.length+" fields but parsed "+le,J+Se)),ye}var be;j&&(w.header||w.dynamicTyping||w.transform)&&(be=1,!j.data.length||Array.isArray(j.data[0])?(j.data=j.data.map(re),be=j.data.length):j.data=re(j.data,0),w.header&&j.meta&&(j.meta.fields=ne),J+=be)}function Fe(){return w.header&&ne.length===0}function nt(oe,re,be,Y){oe={type:oe,code:re,message:be},Y!==void 0&&(oe.row=Y),j.errors.push(oe)}fe(w.step)&&(U=w.step,w.step=function(oe){j=oe,Fe()?de():(de(),j.data.length!==0&&(se+=oe.data.length,w.preview&&se>w.preview?I.abort():(j.data=j.data[0],U(j,Q))))}),this.parse=function(oe,re,be){var Y=w.quoteChar||'"',Y=(w.newline||(w.newline=this.guessLineEndings(oe,Y)),z=!1,w.delimiter?fe(w.delimiter)&&(w.delimiter=w.delimiter(oe),j.meta.delimiter=w.delimiter):((Y=((ve,Se,ye,le,X)=>{var Be,ce,we,Oe;X=X||[","," ","|",";",L.RECORD_SEP,L.UNIT_SEP];for(var Mt=0;Mt<X.length;Mt++){for(var ze,Rt=X[Mt],De=0,gt=0,Ve=0,He=(we=void 0,new Lt({comments:le,delimiter:Rt,newline:Se,preview:10}).parse(ve)),St=0;St<He.data.length;St++)ye&&b(He.data[St])?Ve++:(ze=He.data[St].length,gt+=ze,we===void 0?we=ze:0<ze&&(De+=Math.abs(ze-we),we=ze));0<He.data.length&&(gt/=He.data.length-Ve),(ce===void 0||De<=ce)&&(Oe===void 0||Oe<gt)&&1.99<gt&&(ce=De,Be=Rt,Oe=gt)}return{successful:!!(w.delimiter=Be),bestDelimiter:Be}})(oe,w.newline,w.skipEmptyLines,w.comments,w.delimitersToGuess)).successful?w.delimiter=Y.bestDelimiter:(z=!0,w.delimiter=L.DefaultDelimiter),j.meta.delimiter=w.delimiter),pi(w));return w.preview&&w.header&&Y.preview++,C=oe,I=new Lt(Y),j=I.parse(C,re,be),de(),Re?{meta:{paused:!0}}:j||{meta:{paused:!1}}},this.paused=function(){return Re},this.pause=function(){Re=!0,I.abort(),C=fe(w.chunk)?"":C.substring(I.getCharIndex())},this.resume=function(){Q.streamer._halted?(Re=!1,Q.streamer.parseChunk(C,!0)):setTimeout(Q.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,I.abort(),j.meta.aborted=!0,fe(w.complete)&&w.complete(j),C=""},this.guessLineEndings=function(ve,Y){ve=ve.substring(0,1048576);var Y=new RegExp(jt(Y)+"([^]*?)"+jt(Y),"gm"),be=(ve=ve.replace(Y,"")).split("\r"),Y=ve.split(`
6
- `),ve=1<Y.length&&Y[0].length<be[0].length;if(be.length===1||ve)return`
7
- `;for(var Se=0,ye=0;ye<be.length;ye++)be[ye][0]===`
8
- `&&Se++;return Se>=be.length/2?`\r
9
- `:"\r"}}function jt(w){return w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lt(w){var C=(w=w||{}).delimiter,I=w.newline,z=w.comments,U=w.step,ee=w.preview,Ce=w.fastMode,te=null,it=!1,Q=w.quoteChar==null?'"':w.quoteChar,se=Q;if(w.escapeChar!==void 0&&(se=w.escapeChar),(typeof C!="string"||-1<L.BAD_DELIMITERS.indexOf(C))&&(C=","),z===C)throw new Error("Comment character same as delimiter");z===!0?z="#":(typeof z!="string"||-1<L.BAD_DELIMITERS.indexOf(z))&&(z=!1),I!==`
10
- `&&I!=="\r"&&I!==`\r
11
- `&&(I=`
12
- `);var J=0,Re=!1;this.parse=function(H,ne,j){if(typeof H!="string")throw new Error("Input must be a string");var b=H.length,de=C.length,Fe=I.length,nt=z.length,oe=fe(U),re=[],be=[],Y=[],ve=J=0;if(!H)return De();if(Ce||Ce!==!1&&H.indexOf(Q)===-1){for(var Se=H.split(I),ye=0;ye<Se.length;ye++){if(Y=Se[ye],J+=Y.length,ye!==Se.length-1)J+=I.length;else if(j)return De();if(!z||Y.substring(0,nt)!==z){if(oe){if(re=[],Oe(Y.split(C)),gt(),Re)return De()}else Oe(Y.split(C));if(ee&&ee<=ye)return re=re.slice(0,ee),De(!0)}}return De()}for(var le=H.indexOf(C,J),X=H.indexOf(I,J),Be=new RegExp(jt(se)+jt(Q),"g"),ce=H.indexOf(Q,J);;)if(H[J]===Q)for(ce=J,J++;;){if((ce=H.indexOf(Q,ce+1))===-1)return j||be.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:re.length,index:J}),ze();if(ce===b-1)return ze(H.substring(J,ce).replace(Be,Q));if(Q===se&&H[ce+1]===se)ce++;else if(Q===se||ce===0||H[ce-1]!==se){le!==-1&&le<ce+1&&(le=H.indexOf(C,ce+1));var we=Mt((X=X!==-1&&X<ce+1?H.indexOf(I,ce+1):X)===-1?le:Math.min(le,X));if(H.substr(ce+1+we,de)===C){Y.push(H.substring(J,ce).replace(Be,Q)),H[J=ce+1+we+de]!==Q&&(ce=H.indexOf(Q,J)),le=H.indexOf(C,J),X=H.indexOf(I,J);break}if(we=Mt(X),H.substring(ce+1+we,ce+1+we+Fe)===I){if(Y.push(H.substring(J,ce).replace(Be,Q)),Rt(ce+1+we+Fe),le=H.indexOf(C,J),ce=H.indexOf(Q,J),oe&&(gt(),Re))return De();if(ee&&re.length>=ee)return De(!0);break}be.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:re.length,index:J}),ce++}}else if(z&&Y.length===0&&H.substring(J,J+nt)===z){if(X===-1)return De();J=X+Fe,X=H.indexOf(I,J),le=H.indexOf(C,J)}else if(le!==-1&&(le<X||X===-1))Y.push(H.substring(J,le)),J=le+de,le=H.indexOf(C,J);else{if(X===-1)break;if(Y.push(H.substring(J,X)),Rt(X+Fe),oe&&(gt(),Re))return De();if(ee&&re.length>=ee)return De(!0)}return ze();function Oe(Ve){re.push(Ve),ve=J}function Mt(Ve){var He=0;return He=Ve!==-1&&(Ve=H.substring(ce+1,Ve))&&Ve.trim()===""?Ve.length:He}function ze(Ve){return j||(Ve===void 0&&(Ve=H.substring(J)),Y.push(Ve),J=b,Oe(Y),oe&&gt()),De()}function Rt(Ve){J=Ve,Oe(Y),Y=[],X=H.indexOf(I,J)}function De(Ve){if(w.header&&!ne&&re.length&&!it){var He=re[0],St={},qi=new Set(He);let s=!1;for(let v=0;v<He.length;v++){let k=He[v];if(St[k=fe(w.transformHeader)?w.transformHeader(k,v):k]){let F,e=St[k];for(;F=k+"_"+e,e++,qi.has(F););qi.add(F),He[v]=F,St[k]++,s=!0,(te=te===null?{}:te)[F]=k}else St[k]=1,He[v]=k;qi.add(k)}s&&console.warn("Duplicate headers found and renamed."),it=!0}return{data:re,errors:be,meta:{delimiter:C,linebreak:I,aborted:Re,truncated:!!Ve,cursor:ve+(ne||0),renamedHeaders:te}}}function gt(){U(De()),re=[],be=[]}},this.abort=function(){Re=!0},this.getCharIndex=function(){return J}}function on(w){var C=w.data,I=_[C.workerId],z=!1;if(C.error)I.userError(C.error,C.file);else if(C.results&&C.results.data){var U={abort:function(){z=!0,ht(C.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:Jt,resume:Jt};if(fe(I.userStep)){for(var ee=0;ee<C.results.data.length&&(I.userStep({data:C.results.data[ee],errors:C.results.errors,meta:C.results.meta},U),!z);ee++);delete C.results}else fe(I.userChunk)&&(I.userChunk(C.results,U,C.file),delete C.results)}C.finished&&!z&&ht(C.workerId,C.results)}function ht(w,C){var I=_[w];fe(I.userComplete)&&I.userComplete(C),I.terminate(),delete _[w]}function Jt(){throw new Error("Not implemented.")}function pi(w){if(typeof w!="object"||w===null)return w;var C,I=Array.isArray(w)?[]:{};for(C in w)I[C]=pi(w[C]);return I}function kt(w,C){return function(){w.apply(C,arguments)}}function fe(w){return typeof w=="function"}return L.parse=function(w,C){var I=(C=C||{}).dynamicTyping||!1;if(fe(I)&&(C.dynamicTypingFunction=I,I={}),C.dynamicTyping=I,C.transform=!!fe(C.transform)&&C.transform,!C.worker||!L.WORKERS_SUPPORTED)return I=null,L.NODE_STREAM_INPUT,typeof w=="string"?(w=(z=>z.charCodeAt(0)!==65279?z:z.slice(1))(w),I=new(C.download?_e:a)(C)):w.readable===!0&&fe(w.read)&&fe(w.on)?I=new pt(C):(h.File&&w instanceof File||w instanceof Object)&&(I=new dt(C)),I.stream(w);(I=(()=>{var z;return!!L.WORKERS_SUPPORTED&&(z=(()=>{var U=h.URL||h.webkitURL||null,ee=n.toString();return L.BLOB_URL||(L.BLOB_URL=U.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",ee,")();"],{type:"text/javascript"})))})(),(z=new h.Worker(z)).onmessage=on,z.id=A++,_[z.id]=z)})()).userStep=C.step,I.userChunk=C.chunk,I.userComplete=C.complete,I.userError=C.error,C.step=fe(C.step),C.chunk=fe(C.chunk),C.complete=fe(C.complete),C.error=fe(C.error),delete C.worker,I.postMessage({input:w,config:C,workerId:I.id})},L.unparse=function(w,C){var I=!1,z=!0,U=",",ee=`\r
13
- `,Ce='"',te=Ce+Ce,it=!1,Q=null,se=!1,J=((()=>{if(typeof C=="object"){if(typeof C.delimiter!="string"||L.BAD_DELIMITERS.filter(function(ne){return C.delimiter.indexOf(ne)!==-1}).length||(U=C.delimiter),typeof C.quotes!="boolean"&&typeof C.quotes!="function"&&!Array.isArray(C.quotes)||(I=C.quotes),typeof C.skipEmptyLines!="boolean"&&typeof C.skipEmptyLines!="string"||(it=C.skipEmptyLines),typeof C.newline=="string"&&(ee=C.newline),typeof C.quoteChar=="string"&&(Ce=C.quoteChar),typeof C.header=="boolean"&&(z=C.header),Array.isArray(C.columns)){if(C.columns.length===0)throw new Error("Option columns is empty");Q=C.columns}C.escapeChar!==void 0&&(te=C.escapeChar+Ce),C.escapeFormulae instanceof RegExp?se=C.escapeFormulae:typeof C.escapeFormulae=="boolean"&&C.escapeFormulae&&(se=/^[=+\-@\t\r].*$/)}})(),new RegExp(jt(Ce),"g"));if(typeof w=="string"&&(w=JSON.parse(w)),Array.isArray(w)){if(!w.length||Array.isArray(w[0]))return Re(null,w,it);if(typeof w[0]=="object")return Re(Q||Object.keys(w[0]),w,it)}else if(typeof w=="object")return typeof w.data=="string"&&(w.data=JSON.parse(w.data)),Array.isArray(w.data)&&(w.fields||(w.fields=w.meta&&w.meta.fields||Q),w.fields||(w.fields=Array.isArray(w.data[0])?w.fields:typeof w.data[0]=="object"?Object.keys(w.data[0]):[]),Array.isArray(w.data[0])||typeof w.data[0]=="object"||(w.data=[w.data])),Re(w.fields||[],w.data||[],it);throw new Error("Unable to serialize unrecognized input");function Re(ne,j,b){var de="",Fe=(typeof ne=="string"&&(ne=JSON.parse(ne)),typeof j=="string"&&(j=JSON.parse(j)),Array.isArray(ne)&&0<ne.length),nt=!Array.isArray(j[0]);if(Fe&&z){for(var oe=0;oe<ne.length;oe++)0<oe&&(de+=U),de+=H(ne[oe],oe);0<j.length&&(de+=ee)}for(var re=0;re<j.length;re++){var be=(Fe?ne:j[re]).length,Y=!1,ve=Fe?Object.keys(j[re]).length===0:j[re].length===0;if(b&&!Fe&&(Y=b==="greedy"?j[re].join("").trim()==="":j[re].length===1&&j[re][0].length===0),b==="greedy"&&Fe){for(var Se=[],ye=0;ye<be;ye++){var le=nt?ne[ye]:ye;Se.push(j[re][le])}Y=Se.join("").trim()===""}if(!Y){for(var X=0;X<be;X++){0<X&&!ve&&(de+=U);var Be=Fe&&nt?ne[X]:X;de+=H(j[re][Be],X)}re<j.length-1&&(!b||0<be&&!ve)&&(de+=ee)}}return de}function H(ne,j){var b,de;return ne==null?"":ne.constructor===Date?JSON.stringify(ne).slice(1,25):(de=!1,se&&typeof ne=="string"&&se.test(ne)&&(ne="'"+ne,de=!0),b=ne.toString().replace(J,te),(de=de||I===!0||typeof I=="function"&&I(ne,j)||Array.isArray(I)&&I[j]||((Fe,nt)=>{for(var oe=0;oe<nt.length;oe++)if(-1<Fe.indexOf(nt[oe]))return!0;return!1})(b,L.BAD_DELIMITERS)||-1<b.indexOf(U)||b.charAt(0)===" "||b.charAt(b.length-1)===" ")?Ce+b+Ce:b)}},L.RECORD_SEP="",L.UNIT_SEP="",L.BYTE_ORDER_MARK="\uFEFF",L.BAD_DELIMITERS=["\r",`
14
- `,'"',L.BYTE_ORDER_MARK],L.WORKERS_SUPPORTED=!l&&!!h.Worker,L.NODE_STREAM_INPUT=1,L.LocalChunkSize=10485760,L.RemoteChunkSize=5242880,L.DefaultDelimiter=",",L.Parser=Lt,L.ParserHandle=Ut,L.NetworkStreamer=_e,L.FileStreamer=dt,L.StringStreamer=a,L.ReadableStreamStreamer=pt,h.jQuery&&((t=h.jQuery).fn.parse=function(w){var C=w.config||{},I=[];return this.each(function(ee){if(!(t(this).prop("tagName").toUpperCase()==="INPUT"&&t(this).attr("type").toLowerCase()==="file"&&h.FileReader)||!this.files||this.files.length===0)return!0;for(var Ce=0;Ce<this.files.length;Ce++)I.push({file:this.files[Ce],inputElem:this,instanceConfig:t.extend({},C)})}),z(),this;function z(){if(I.length===0)fe(w.complete)&&w.complete();else{var ee,Ce,te,it,Q=I[0];if(fe(w.before)){var se=w.before(Q.file,Q.inputElem);if(typeof se=="object"){if(se.action==="abort")return ee="AbortError",Ce=Q.file,te=Q.inputElem,it=se.reason,void(fe(w.error)&&w.error({name:ee},Ce,te,it));if(se.action==="skip")return void U();typeof se.config=="object"&&(Q.instanceConfig=t.extend(Q.instanceConfig,se.config))}else if(se==="skip")return void U()}var J=Q.instanceConfig.complete;Q.instanceConfig.complete=function(Re){fe(J)&&J(Re,Q.file,Q.inputElem),U()},L.parse(Q.file,Q.instanceConfig)}}function U(){I.splice(0,1),z()}}),c&&(h.onmessage=function(w){w=w.data,L.WORKER_ID===void 0&&w&&(L.WORKER_ID=w.workerId),typeof w.input=="string"?h.postMessage({workerId:L.WORKER_ID,results:L.parse(w.input,w.config),finished:!0}):(h.File&&w.input instanceof File||w.input instanceof Object)&&(w=L.parse(w.input,w.config))&&h.postMessage({workerId:L.WORKER_ID,results:w,finished:!0})}),(_e.prototype=Object.create(ge.prototype)).constructor=_e,(dt.prototype=Object.create(ge.prototype)).constructor=dt,(a.prototype=Object.create(a.prototype)).constructor=a,(pt.prototype=Object.create(ge.prototype)).constructor=pt,L})});var ga=(()=>{class n extends qo{pathId;ngOnInit(){this.pathId="url(#"+Yi()+")"}static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275cmp=Ee({type:n,selectors:[["UploadIcon"]],features:[wt],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M6.58942 9.82197C6.70165 9.93405 6.85328 9.99793 7.012 10C7.17071 9.99793 7.32234 9.93405 7.43458 9.82197C7.54681 9.7099 7.61079 9.55849 7.61286 9.4V2.04798L9.79204 4.22402C9.84752 4.28011 9.91365 4.32457 9.98657 4.35479C10.0595 4.38502 10.1377 4.40039 10.2167 4.40002C10.2956 4.40039 10.3738 4.38502 10.4467 4.35479C10.5197 4.32457 10.5858 4.28011 10.6413 4.22402C10.7538 4.11152 10.817 3.95902 10.817 3.80002C10.817 3.64102 10.7538 3.48852 10.6413 3.37602L7.45127 0.190618C7.44656 0.185584 7.44176 0.180622 7.43687 0.175736C7.32419 0.063214 7.17136 0 7.012 0C6.85264 0 6.69981 0.063214 6.58712 0.175736C6.58181 0.181045 6.5766 0.186443 6.5715 0.191927L3.38282 3.37602C3.27669 3.48976 3.2189 3.6402 3.22165 3.79564C3.2244 3.95108 3.28746 4.09939 3.39755 4.20932C3.50764 4.31925 3.65616 4.38222 3.81182 4.38496C3.96749 4.3877 4.11814 4.33001 4.23204 4.22402L6.41113 2.04807V9.4C6.41321 9.55849 6.47718 9.7099 6.58942 9.82197ZM11.9952 14H2.02883C1.751 13.9887 1.47813 13.9228 1.22584 13.8061C0.973545 13.6894 0.746779 13.5241 0.558517 13.3197C0.370254 13.1154 0.22419 12.876 0.128681 12.6152C0.0331723 12.3545 -0.00990605 12.0775 0.0019109 11.8V9.40005C0.0019109 9.24092 0.065216 9.08831 0.1779 8.97579C0.290584 8.86326 0.443416 8.80005 0.602775 8.80005C0.762134 8.80005 0.914966 8.86326 1.02765 8.97579C1.14033 9.08831 1.20364 9.24092 1.20364 9.40005V11.8C1.18295 12.0376 1.25463 12.274 1.40379 12.4602C1.55296 12.6463 1.76817 12.7681 2.00479 12.8H11.9952C12.2318 12.7681 12.447 12.6463 12.5962 12.4602C12.7453 12.274 12.817 12.0376 12.7963 11.8V9.40005C12.7963 9.24092 12.8596 9.08831 12.9723 8.97579C13.085 8.86326 13.2378 8.80005 13.3972 8.80005C13.5565 8.80005 13.7094 8.86326 13.8221 8.97579C13.9347 9.08831 13.998 9.24092 13.998 9.40005V11.8C14.022 12.3563 13.8251 12.8996 13.45 13.3116C13.0749 13.7236 12.552 13.971 11.9952 14Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(l,c){l&1&&(wo(),p(0,"svg",0)(1,"g"),N(2,"path",1),m(),p(3,"defs")(4,"clipPath",2),N(5,"rect",3),m()()()),l&2&&(ct(c.getClassNames()),he("aria-label",c.ariaLabel)("aria-hidden",c.ariaHidden)("role",c.role),f(),he("clip-path",c.pathId),f(3),y("id",c.pathId))},encapsulation:2})}return n})();var We=(()=>{class n{constructor(){this.#e=K(Go),this.authService=K(Ko)}#e;getJournalEntryLoader(){return this.#e.get("","api/JournalLoader/JournalEntry")}getJournalReceiveMoney(){return this.#e.get("","api/JournalLoader/ReceiveJournal")}getJournalRecordExpenseLoader(){return this.#e.get("","api/JournalLoader/RecordExpense")}getJournalEntryData(t){return this.#e.post("","api/Journal/JournalEntry",t)}getJournalEntryInfo(t){let l={ID:t};return this.#e.get("","/api/Journal/Info",{params:l})}getJournalEntryForm(t){return this.#e.get("",`api/journalloader/form/${t}`).pipe()}getJournalEntryCount(){return this.#e.post("","api/Journal/JournalEntryCount",{})}getJournalEntryCustomerSuggestions(t){let l={Prefix:t,Count:100};return this.#e.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:l})}getJournalEntrySupplierSuggestions(t){let l={Prefix:t,Count:100};return this.#e.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:l})}submitJournalEntry(t){return this.#e.post(void 0,"api/journal/submit",t,{observe:"response"})}deleteJournalEntry(t){let l={params:{ID:t.join(",")}};return this.#e.delete(void 0,"/api/Journal/delete",l)}fetchCategoryOptions(){return this.#e.get("","api/ChartOfAccount/CategoryOptions")}submitChartAccount(t,l={}){return this.#e.post("","api/ChartOfAccount/Submit",t,l)}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275prov=ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Za={filter:{transID:"",bulkID:"",rowCount:10,pageNumber:1,orderBy:0,orderbyCreated:0,auditEditor:!1,listOutletID:[],searchAudit:!1},data:[],count:0},Hn=ia(ra(Za),sa("JournalEntryStore"),na(n=>({first:at(()=>(n.filter().pageNumber-1)*n.filter().rowCount+1),end:at(()=>Math.min(n.filter().pageNumber*n.filter().rowCount,n.count())),selectedItems:at(()=>n.data().filter(h=>h.checked))})),aa(n=>{let h=K(We);return{updateCount(t){Li(n,l=>xe(pe({},l),{count:t}))},updateFilter(t){Li(n,l=>xe(pe({},l),{filter:pe(pe({},l.filter),t)}))},loadJournalEntryLoader:Kn(Rn(Zi(()=>h.getJournalEntryLoader().pipe(Wn({next:t=>{console.log("response",t),Li(n,l=>xe(pe({},l),{filter:xe(pe({},t.filter),{pageNumber:1})})),console.log("store",n)},error(t){console.log("error",t)}}))))),loadJournalEntryData:Kn(Rn(cn(t=>!!t),Zi(t=>h.getJournalEntryData(t).pipe(Pt(l=>xe(pe({},l),{data:l.data.map(c=>xe(pe({},c),{checked:!1}))})),Wn({next(l){console.log("response",l),Li(n,c=>xe(pe({},c),{data:l.data}))},error(l){console.log("error",l)}}))))),updateData:t=>{Li(n,l=>xe(pe({},l),{data:t}))}}}),oa({onInit(n){n.loadJournalEntryLoader()}}));var Xa=["filterRef"],er=["class","page"],tr=n=>[n];function ir(n,h){if(n&1){let t=q();p(0,"button",12),G("click",function(){R(t);let c=P(2);return B(c.onDeleteJournalEntry())}),x(1," Delete "),m()}}function nr(n,h){if(n&1&&(V(0,ir,2,0,"button",7),p(1,"div",8)(2,"button",9),x(3,"Import"),m(),p(4,"button",9),x(5,"Export"),m()(),p(6,"a",10),N(7,"i",11),p(8,"span"),x(9,"Add"),m()()),n&2){let t=P();y("ngIf",t.JournalEntryStore.selectedItems().length)}}function or(n,h){n&1&&(p(0,"tr")(1,"th",14),N(2,"p-tableHeaderCheckbox"),m(),p(3,"th"),x(4,"Outlet"),m(),p(5,"th"),x(6,"Number"),m(),p(7,"th"),x(8,"Date/Name"),m(),p(9,"th"),x(10,"Description"),m(),p(11,"th"),x(12,"Code"),m(),p(13,"th"),x(14,"Account"),m(),p(15,"th"),x(16,"Debit"),m(),p(17,"th"),x(18,"Credit"),m()())}function ar(n,h){if(n&1&&x(0),n&2){let t=h.$implicit;ot(" ",t.note," ")}}function rr(n,h){if(n&1&&(p(0,"span"),x(1),m()),n&2){let t=h.$implicit;f(),ae(t.accountCode)}}function sr(n,h){if(n&1&&(p(0,"span"),x(1),m()),n&2){let t=h.$implicit;f(),ae(t.accountName)}}function lr(n,h){if(n&1&&(p(0,"span"),x(1),Ae(2,"number"),m()),n&2){let t=h.$implicit;f(),ae(Ke(2,1,t.debitAmount))}}function cr(n,h){if(n&1&&(p(0,"span"),x(1),Ae(2,"number"),m()),n&2){let t=h.$implicit;f(),ae(Ke(2,1,t.creditAmount))}}function ur(n,h){if(n&1&&(p(0,"tr")(1,"td"),N(2,"p-tableCheckbox",15),m(),p(3,"td"),x(4),m(),p(5,"td")(6,"a",16),x(7),m()(),p(8,"td"),x(9),Ae(10,"date"),m(),p(11,"td"),yt(12,ar,1,1,null,null,Tt),m(),p(14,"td")(15,"div",17),yt(16,rr,2,1,"span",null,Tt),m()(),p(18,"td")(19,"div",17),yt(20,sr,2,1,"span",null,Tt),m()(),p(22,"td")(23,"div",17),yt(24,lr,3,3,"span",null,Tt),m()(),p(26,"td")(27,"div",17),yt(28,cr,3,3,"span",null,Tt),m()()()),n&2){let t=h.$implicit;f(2),y("value",t),f(2),ae(t.outletName),f(2),y("routerLink",Pe(8,tr,t.id)),f(),ae(t.number),f(2),ae(Qi(10,5,t.date,"dd MMM y")),f(3),_t(t.items),f(4),_t(t.items),f(4),_t(t.items),f(4),_t(t.items),f(4),_t(t.items)}}function mr(n,h){if(n&1&&x(0),n&2){let t=P(3);ot(" ",t.JournalEntryStore.count()," ")}}function dr(n,h){if(n&1){let t=q();p(0,"p-button",19),G("onClick",function(){R(t);let c=P(3);return B(c.getJournalEntryCount())}),m()}n&2&&y("rounded",!0)("text",!0)}function pr(n,h){if(n&1&&(x(0),V(1,mr,1,1)(2,dr,1,2,"p-button",18),x(3," entries ")),n&2){let t=P(2);gn(" Showing ",t.JournalEntryStore.first()," to ",t.JournalEntryStore.end()," of "),f(),Le(t.JournalEntryStore.count()?1:2)}}function hr(n,h){if(n&1){let t=q();p(0,"p-card")(1,"p-table",13),G("onPage",function(c){R(t);let _=P();return B(_.onPageChange(c))})("onRowSelect",function(c){R(t);let _=P();return B(_.onRowSelect(c))})("onRowUnselect",function(c){R(t);let _=P();return B(_.onRowUnselect(c))})("onHeaderCheckboxToggle",function(c){R(t);let _=P();return B(_.onHeaderCheckboxToggle(c))}),V(2,or,19,0,"ng-template",null,3,Z)(4,ur,30,10,"ng-template",null,4,Z)(6,pr,4,3,"ng-template",null,5,Z),m()()}if(n&2){let t=P();f(),y("value",t.JournalEntryStore.data())("paginator",!0)("totalRecords",t.JournalEntryStore.count())("lazy",!0)("rows",t.JournalEntryStore.filter().rowCount)("scrollable",!0)("scrollHeight","calc(100vh - 200px)")}}function gr(n,h){n&1&&(p(0,"div",20)(1,"div",21)(2,"h5",22),x(3,"Card title"),m(),p(4,"h6",23),x(5,"Card subtitle"),m(),p(6,"p",24),x(7," Some quick example text to build on the card title and make up the bulk of the card's content. "),m(),p(8,"a",25),x(9,"Card link"),m(),p(10,"a",25),x(11,"Another link"),m()()())}var fa=(()=>{class n{constructor(){this.JournalEntryStore=K(Hn),this.modalService=K(wn),this.journalEntryService=K(We)}ngOnInit(){console.log("Journal Entry Page");let t=this.JournalEntryStore.filter;this.JournalEntryStore.loadJournalEntryData(t)}onFilterChange(t){console.log("Filter Change",t),this.modalService.open(this.templateRef)}onRowSelect(t){this.updateRowSelection(t.data,!0)}onRowUnselect(t){this.JournalEntryStore.updateData(this.JournalEntryStore.data().map((l,c)=>l.id===t.data[c].id?xe(pe({},l),{checked:!1}):l))}updateRowSelection(t,l){this.JournalEntryStore.updateData(this.JournalEntryStore.data().map(c=>c.id===t.id?xe(pe({},c),{checked:l}):c))}onHeaderCheckboxToggle(t){let l=this.JournalEntryStore.data().map(c=>xe(pe({},c),{checked:t.checked}));this.JournalEntryStore.updateData(l)}onPageChange(t){let l=t.first/t.rows;this.JournalEntryStore.updateFilter({pageNumber:l+1})}next(){this.JournalEntryStore.updateFilter({pageNumber:this.JournalEntryStore.filter().pageNumber+1})}prev(){this.JournalEntryStore.filter().pageNumber<=1||this.JournalEntryStore.updateFilter({pageNumber:this.JournalEntryStore.filter().pageNumber-1})}getJournalEntryCount(){this.journalEntryService.getJournalEntryCount().pipe(ke(t=>this.JournalEntryStore.updateCount(t.count))).subscribe()}onDeleteJournalEntry(){let l=this.JournalEntryStore.selectedItems().map(c=>c.id);this.journalEntryService.deleteJournalEntry(l).pipe(ke(()=>{this.JournalEntryStore.loadJournalEntryData(this.JournalEntryStore.filter())})).subscribe()}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Ee({type:n,selectors:[["app-journal-entry",8,"page"]],viewQuery:function(l,c){if(l&1&&ut(Xa,7),l&2){let _;ue(_=me())&&(c.templateRef=_.first)}},features:[Ge([Hn])],attrs:er,decls:7,vars:2,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["pageTitle","Manual Journal",3,"eventFilterChange","isSearchableInput","isFilterable"],["class","btn btn-danger rounded",3,"click",4,"ngIf"],["role","group","aria-label","Basic example",1,"btn-group"],["type","button",1,"btn","btn-light"],["type","button","routerLink","add",1,"btn","btn-primary","rounded","d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-plus"],[1,"btn","btn-danger","rounded",3,"click"],["stripedRows","","dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollable","scrollHeight"],[2,"width","4rem"],[3,"value"],[1,"link","link-primary",3,"routerLink"],[1,"d-flex","flex-column"],["icon","fa-light fa-question","severity","primary",3,"rounded","text"],["icon","fa-light fa-question","severity","primary",3,"onClick","rounded","text"],[1,"card",2,"width","18rem"],[1,"card-body"],[1,"card-title"],[1,"card-subtitle","mb-2","text-body-secondary"],[1,"card-text"],["href","#",1,"card-link"]],template:function(l,c){if(l&1){let _=q();p(0,"app-main-panel",6),G("eventFilterChange",function(L){return R(_),B(c.onFilterChange(L))}),V(1,nr,10,1,"ng-template",null,0,Z)(3,hr,8,7,"ng-template",null,1,Z),m(),V(5,gr,12,0,"ng-template",null,2,Z)}l&2&&y("isSearchableInput",!0)("isFilterable",!0)},dependencies:[Et,Me,Xe,Ft,vn,da,$o,Sn,bn,At,Vt,ua,ma,ti,xt,Dt,kn],encapsulation:2,changeDetection:0})}}return n})();var eo=ui(On());var Qn=ui(ya());var Ki=(()=>{class n{constructor(t){this.el=t,this.options={},this.previousValue=null,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this.options=xe(pe({},Qn.default.getPredefinedOptions()),{decimalPlaces:0}),this.initAutoNumeric()}ngOnChanges(t){t.options&&!t.options.firstChange&&this.reinitAutoNumeric()}ngOnDestroy(){this.anInstance?.remove()}initAutoNumeric(){this.anInstance=new Qn.default(this.el.nativeElement,this.options),this.previousValue!=null&&this.anInstance.set(this.previousValue)}reinitAutoNumeric(){this.anInstance?.remove(),this.initAutoNumeric()}writeValue(t){this.previousValue=t,this.anInstance&&this.anInstance.set(t??"")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.el.nativeElement.disabled=t}onInput(){let t=this.anInstance?.getNumber();t!=null&&!isNaN(t)&&(this.previousValue=t),this.onChange(t??null)}onBlur(){this.onTouched();let t=this.el.nativeElement.value.trim(),l=this.anInstance?.getNumber();(t===""||l===void 0||isNaN(l))&&(this.previousValue!=null?this.anInstance?.set(this.previousValue):this.anInstance?.clear())}static{this.\u0275fac=function(l){return new(l||n)(zt(xo))}}static{this.\u0275dir=dn({type:n,selectors:[["","autoNumeric",""]],hostBindings:function(l,c){l&1&&G("input",function(){return c.onInput()})("blur",function(){return c.onBlur()})},inputs:{options:[0,"autoNumeric","options"]},features:[Ge([{provide:jo,useExisting:bo(()=>n),multi:!0}]),So]})}}return n})();var fr=["container"],vr=["icon"],yr=["closeicon"],_r=["*"],br=(n,h)=>({showTransitionParams:n,hideTransitionParams:h}),Sr=n=>({value:"visible()",params:n}),wr=n=>({closeCallback:n});function Cr(n,h){n&1&&Ye(0)}function xr(n,h){if(n&1&&V(0,Cr,1,0,"ng-container",7),n&2){let t=P(2);y("ngTemplateOutlet",t.iconTemplate||t.iconTemplate)}}function Er(n,h){if(n&1&&N(0,"i",3),n&2){let t=P(2);y("ngClass",t.icon)}}function Pr(n,h){if(n&1&&N(0,"span",9),n&2){let t=P(3);y("ngClass",t.cx("text"))("innerHTML",t.text,Eo)}}function kr(n,h){if(n&1&&(p(0,"div"),V(1,Pr,1,2,"span",8),m()),n&2){let t=P(2);f(),y("ngIf",!t.escape)}}function Tr(n,h){if(n&1&&(p(0,"span",5),x(1),m()),n&2){let t=P(3);y("ngClass",t.cx("text")),f(),ae(t.text)}}function Fr(n,h){if(n&1&&V(0,Tr,2,2,"span",10),n&2){let t=P(2);y("ngIf",t.escape&&t.text)}}function Or(n,h){n&1&&Ye(0)}function Ir(n,h){if(n&1&&V(0,Or,1,0,"ng-container",11),n&2){let t=P(2);y("ngTemplateOutlet",t.containerTemplate||t.containerTemplate)("ngTemplateOutletContext",Pe(2,wr,t.close.bind(t)))}}function Nr(n,h){if(n&1&&(p(0,"span",5),hn(1),m()),n&2){let t=P(2);y("ngClass",t.cx("text"))}}function Dr(n,h){if(n&1&&N(0,"i",13),n&2){let t=P(3);y("ngClass",t.closeIcon)}}function Vr(n,h){n&1&&Ye(0)}function Ar(n,h){if(n&1&&V(0,Vr,1,0,"ng-container",7),n&2){let t=P(3);y("ngTemplateOutlet",t.closeIconTemplate||t._closeIconTemplate)}}function Lr(n,h){n&1&&N(0,"TimesIcon",14)}function Mr(n,h){if(n&1){let t=q();p(0,"button",12),G("click",function(c){R(t);let _=P(2);return B(_.close(c))}),V(1,Dr,1,1,"i",13)(2,Ar,1,1,"ng-container")(3,Lr,1,0,"TimesIcon",14),m()}if(n&2){let t=P(2);he("aria-label",t.closeAriaLabel),f(),Le(t.closeIcon?1:-1),f(),Le(t.closeIconTemplate||t._closeIconTemplate?2:-1),f(),Le(!t.closeIconTemplate&&!t._closeIconTemplate&&!t.closeIcon?3:-1)}}function Rr(n,h){if(n&1&&(p(0,"div",1)(1,"div",2),V(2,xr,1,1,"ng-container")(3,Er,1,1,"i",3)(4,kr,2,1,"div",4)(5,Fr,1,1,"ng-template",null,0,Z)(7,Ir,1,4,"ng-container")(8,Nr,2,1,"span",5)(9,Mr,4,4,"button",6),m()()),n&2){let t=Io(6),l=P();y("ngClass",l.containerClass)("@messageAnimation",Pe(13,Sr,yi(10,br,l.showTransitionOptions,l.hideTransitionOptions))),he("aria-live","polite")("role","alert"),f(2),Le(l.iconTemplate||l._iconTemplate?2:-1),f(),Le(l.icon?3:-1),f(),y("ngIf",!l.escape)("ngIfElse",t),f(3),Le(l.containerTemplate||l._containerTemplate?7:8),f(2),Le(l.closable?9:-1)}}var Br=({dt:n})=>`
15
- .p-message {
16
- border-radius: ${n("message.border.radius")};
17
- outline-width: ${n("message.border.width")};
18
- outline-style: solid;
19
- }
20
-
21
- .p-message-content {
22
- display: flex;
23
- align-items: center;
24
- padding: ${n("message.content.padding")};
25
- gap: ${n("message.content.gap")};
26
- height: 100%;
27
- }
28
-
29
- .p-message-icon {
30
- flex-shrink: 0;
31
- }
32
-
33
- .p-message-close-button {
34
- display: flex;
35
- align-items: center;
36
- justify-content: center;
37
- flex-shrink: 0;
38
- margin-inline-start: auto;
39
- overflow: hidden;
40
- position: relative;
41
- width: ${n("message.close.button.width")};
42
- height: ${n("message.close.button.height")};
43
- border-radius: ${n("message.close.button.border.radius")};
44
- background: transparent;
45
- transition: background ${n("message.transition.duration")}, color ${n("message.transition.duration")}, outline-color ${n("message.transition.duration")}, box-shadow ${n("message.transition.duration")}, opacity 0.3s;
46
- outline-color: transparent;
47
- color: inherit;
48
- padding: 0;
49
- border: none;
50
- cursor: pointer;
51
- user-select: none;
52
- }
53
-
54
- .p-message-close-icon {
55
- font-size: ${n("message.close.icon.size")};
56
- width: ${n("message.close.icon.size")};
57
- height: ${n("message.close.icon.size")};
58
- }
59
-
60
- .p-message-close-button:focus-visible {
61
- outline-width: ${n("message.close.button.focus.ring.width")};
62
- outline-style: ${n("message.close.button.focus.ring.style")};
63
- outline-offset: ${n("message.close.button.focus.ring.offset")};
64
- }
65
-
66
- .p-message-info {
67
- background: ${n("message.info.background")};
68
- outline-color: ${n("message.info.border.color")};
69
- color: ${n("message.info.color")};
70
- box-shadow: ${n("message.info.shadow")};
71
- }
72
-
73
- .p-message-info .p-message-close-button:focus-visible {
74
- outline-color: ${n("message.info.close.button.focus.ring.color")};
75
- box-shadow: ${n("message.info.close.button.focus.ring.shadow")};
76
- }
77
-
78
- .p-message-info .p-message-close-button:hover {
79
- background: ${n("message.info.close.button.hover.background")};
80
- }
81
-
82
- .p-message-info.p-message-outlined {
83
- color: ${n("message.info.outlined.color")};
84
- outline-color: ${n("message.info.outlined.border.color")};
85
- }
86
-
87
- .p-message-info.p-message-simple {
88
- color: ${n("message.info.simple.color")};
89
- }
90
-
91
- .p-message-success {
92
- background: ${n("message.success.background")};
93
- outline-color: ${n("message.success.border.color")};
94
- color: ${n("message.success.color")};
95
- box-shadow: ${n("message.success.shadow")};
96
- }
97
-
98
- .p-message-success .p-message-close-button:focus-visible {
99
- outline-color: ${n("message.success.close.button.focus.ring.color")};
100
- box-shadow: ${n("message.success.close.button.focus.ring.shadow")};
101
- }
102
-
103
- .p-message-success .p-message-close-button:hover {
104
- background: ${n("message.success.close.button.hover.background")};
105
- }
106
-
107
- .p-message-success.p-message-outlined {
108
- color: ${n("message.success.outlined.color")};
109
- outline-color: ${n("message.success.outlined.border.color")};
110
- }
111
-
112
- .p-message-success.p-message-simple {
113
- color: ${n("message.success.simple.color")};
114
- }
115
-
116
- .p-message-warn {
117
- background: ${n("message.warn.background")};
118
- outline-color: ${n("message.warn.border.color")};
119
- color: ${n("message.warn.color")};
120
- box-shadow: ${n("message.warn.shadow")};
121
- }
122
-
123
- .p-message-warn .p-message-close-button:focus-visible {
124
- outline-color: ${n("message.warn.close.button.focus.ring.color")};
125
- box-shadow: ${n("message.warn.close.button.focus.ring.shadow")};
126
- }
127
-
128
- .p-message-warn .p-message-close-button:hover {
129
- background: ${n("message.warn.close.button.hover.background")};
130
- }
131
-
132
- .p-message-warn.p-message-outlined {
133
- color: ${n("message.warn.outlined.color")};
134
- outline-color: ${n("message.warn.outlined.border.color")};
135
- }
136
-
137
- .p-message-warn.p-message-simple {
138
- color: ${n("message.warn.simple.color")};
139
- }
140
-
141
- .p-message-error {
142
- background: ${n("message.error.background")};
143
- outline-color: ${n("message.error.border.color")};
144
- color: ${n("message.error.color")};
145
- box-shadow: ${n("message.error.shadow")};
146
- }
147
-
148
- .p-message-error .p-message-close-button:focus-visible {
149
- outline-color: ${n("message.error.close.button.focus.ring.color")};
150
- box-shadow: ${n("message.error.close.button.focus.ring.shadow")};
151
- }
152
-
153
- .p-message-error .p-message-close-button:hover {
154
- background: ${n("message.error.close.button.hover.background")};
155
- }
156
-
157
- .p-message-error.p-message-outlined {
158
- color: ${n("message.error.outlined.color")};
159
- outline-color: ${n("message.error.outlined.border.color")};
160
- }
161
-
162
- .p-message-error.p-message-simple {
163
- color: ${n("message.error.simple.color")};
164
- }
165
-
166
- .p-message-secondary {
167
- background: ${n("message.secondary.background")};
168
- outline-color: ${n("message.secondary.border.color")};
169
- color: ${n("message.secondary.color")};
170
- box-shadow: ${n("message.secondary.shadow")};
171
- }
172
-
173
- .p-message-secondary .p-message-close-button:focus-visible {
174
- outline-color: ${n("message.secondary.close.button.focus.ring.color")};
175
- box-shadow: ${n("message.secondary.close.button.focus.ring.shadow")};
176
- }
177
-
178
- .p-message-secondary .p-message-close-button:hover {
179
- background: ${n("message.secondary.close.button.hover.background")};
180
- }
181
-
182
- .p-message-secondary.p-message-outlined {
183
- color: ${n("message.secondary.outlined.color")};
184
- outline-color: ${n("message.secondary.outlined.border.color")};
185
- }
186
-
187
- .p-message-secondary.p-message-simple {
188
- color: ${n("message.secondary.simple.color")};
189
- }
190
-
191
- .p-message-contrast {
192
- background: ${n("message.contrast.background")};
193
- outline-color: ${n("message.contrast.border.color")};
194
- color: ${n("message.contrast.color")};
195
- box-shadow: ${n("message.contrast.shadow")};
196
- }
197
-
198
- .p-message-contrast .p-message-close-button:focus-visible {
199
- outline-color: ${n("message.contrast.close.button.focus.ring.color")};
200
- box-shadow: ${n("message.contrast.close.button.focus.ring.shadow")};
201
- }
202
-
203
- .p-message-contrast .p-message-close-button:hover {
204
- background: ${n("message.contrast.close.button.hover.background")};
205
- }
206
-
207
- .p-message-contrast.p-message-outlined {
208
- color: ${n("message.contrast.outlined.color")};
209
- outline-color: ${n("message.contrast.outlined.border.color")};
210
- }
211
-
212
- .p-message-contrast.p-message-simple {
213
- color: ${n("message.contrast.simple.color")};
214
- }
215
-
216
- .p-message-text {
217
- display: inline-flex;
218
- align-items: center;
219
- font-size: ${n("message.text.font.size")};
220
- font-weight: ${n("message.text.font.weight")};
221
- }
222
-
223
- .p-message-icon {
224
- font-size: ${n("message.icon.size")};
225
- width: ${n("message.icon.size")};
226
- height: ${n("message.icon.size")};
227
- }
228
-
229
- .p-message-enter-from {
230
- opacity: 0;
231
- }
232
-
233
- .p-message-enter-active {
234
- transition: opacity 0.3s;
235
- }
236
-
237
- .p-message.p-message-leave-from {
238
- max-height: 1000px;
239
- }
240
-
241
- .p-message.p-message-leave-to {
242
- max-height: 0;
243
- opacity: 0;
244
- margin: 0;
245
- }
246
-
247
- .p-message-leave-active {
248
- overflow: hidden;
249
- transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin 0.3s;
250
- }
251
-
252
- .p-message-leave-active .p-message-close-button {
253
- opacity: 0;
254
- }
255
-
256
- .p-message-sm .p-message-content {
257
- padding: ${n("message.content.sm.padding")};
258
- }
259
-
260
- .p-message-sm .p-message-text {
261
- font-size: ${n("message.text.sm.font.size")};
262
- }
263
-
264
- .p-message-sm .p-message-icon {
265
- font-size: ${n("message.icon.sm.size")};
266
- width: ${n("message.icon.sm.size")};
267
- height: ${n("message.icon.sm.size")};
268
- }
269
-
270
- .p-message-sm .p-message-close-icon {
271
- font-size: ${n("message.close.icon.sm.size")};
272
- width: ${n("message.close.icon.sm.size")};
273
- height: ${n("message.close.icon.sm.size")};
274
- }
275
-
276
- .p-message-lg .p-message-content {
277
- padding: ${n("message.content.lg.padding")};
278
- }
279
-
280
- .p-message-lg .p-message-text {
281
- font-size: ${n("message.text.lg.font.size")};
282
- }
283
-
284
- .p-message-lg .p-message-icon {
285
- font-size: ${n("message.icon.lg.size")};
286
- width: ${n("message.icon.lg.size")};
287
- height: ${n("message.icon.lg.size")};
288
- }
289
-
290
- .p-message-lg .p-message-close-icon {
291
- font-size: ${n("message.close.icon.lg.size")};
292
- width: ${n("message.close.icon.lg.size")};
293
- height: ${n("message.close.icon.lg.size")};
294
- }
295
-
296
- .p-message-outlined {
297
- background: transparent;
298
- outline-width: ${n("message.outlined.border.width")};
299
- }
300
-
301
- .p-message-simple {
302
- background: transparent;
303
- outline-color: transparent;
304
- box-shadow: none;
305
- }
306
-
307
- .p-message-simple .p-message-content {
308
- padding: ${n("message.simple.content.padding")};
309
- }
310
-
311
- .p-message-outlined .p-message-close-button:hover,
312
- .p-message-simple .p-message-close-button:hover {
313
- background: transparent;
314
- }`,zr={root:({props:n})=>["p-message p-component p-message-"+n.severity,{"p-message-simple":n.variant==="simple"}],content:"p-message-content",icon:"p-message-icon",text:"p-message-text",closeButton:"p-message-close-button",closeIcon:"p-message-close-icon"},_a=(()=>{class n extends Yt{name="message";theme=Br;classes=zr;static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var ba=(()=>{class n extends Nt{severity="info";text;escape=!0;style;styleClass;closable=!1;icon;closeIcon;life;showTransitionOptions="300ms ease-out";hideTransitionOptions="200ms cubic-bezier(0.86, 0, 0.07, 1)";size;variant;onClose=new lt;get closeAriaLabel(){return this.config.translation.aria?this.config.translation.aria.close:void 0}get containerClass(){let t=this.variant==="outlined"?"p-message-outlined":this.variant==="simple"?"p-message-simple":"",l=this.size==="small"?"p-message-sm":this.size==="large"?"p-message-lg":"";return`p-message-${this.severity} ${t} ${l}`.trim()+(this.styleClass?" "+this.styleClass:"")}visible=Ne(!0);_componentStyle=K(_a);containerTemplate;iconTemplate;closeIconTemplate;templates;_containerTemplate;_iconTemplate;_closeIconTemplate;ngOnInit(){super.ngOnInit(),this.life&&setTimeout(()=>{this.visible.set(!1)},this.life)}ngAfterContentInit(){this.templates?.forEach(t=>{switch(t.getType()){case"container":this._containerTemplate=t.template;break;case"icon":this._iconTemplate=t.template;break;case"closeicon":this._closeIconTemplate=t.template;break}})}close(t){this.visible.set(!1),this.onClose.emit({originalEvent:t})}static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275cmp=Ee({type:n,selectors:[["p-message"]],contentQueries:function(l,c,_){if(l&1&&(Je(_,fr,4),Je(_,vr,4),Je(_,yr,4),Je(_,Di,4)),l&2){let A;ue(A=me())&&(c.containerTemplate=A.first),ue(A=me())&&(c.iconTemplate=A.first),ue(A=me())&&(c.closeIconTemplate=A.first),ue(A=me())&&(c.templates=A)}},inputs:{severity:"severity",text:"text",escape:[2,"escape","escape",bt],style:"style",styleClass:"styleClass",closable:[2,"closable","closable",bt],icon:"icon",closeIcon:"closeIcon",life:"life",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",size:"size",variant:"variant"},outputs:{onClose:"onClose"},features:[Ge([_a]),vi,wt],ngContentSelectors:_r,decls:1,vars:1,consts:[["escapeOut",""],[1,"p-message","p-component",3,"ngClass"],[1,"p-message-content"],[1,"p-message-icon",3,"ngClass"],[4,"ngIf","ngIfElse"],[3,"ngClass"],["pRipple","","type","button",1,"p-message-close-button"],[4,"ngTemplateOutlet"],[3,"ngClass","innerHTML",4,"ngIf"],[3,"ngClass","innerHTML"],[3,"ngClass",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["pRipple","","type","button",1,"p-message-close-button",3,"click"],[1,"p-message-close-icon",3,"ngClass"],["styleClass","p-message-close-icon"]],template:function(l,c){l&1&&(pn(),V(0,Rr,10,15,"div",1)),l&2&&Le(c.visible()?0:-1)},dependencies:[Me,Ct,Xe,Wt,Ai,Xo,tt],encapsulation:2,data:{animation:[Cn("messageAnimation",[Oi(":enter",[mi({opacity:0,transform:"translateY(-25%)"}),Fi("{{showTransitionParams}}")]),Oi(":leave",[Fi("{{hideTransitionParams}}",mi({height:0,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,opacity:0}))])])]},changeDetection:0})}return n})();var Ur=["content"],jr=(n,h)=>({"p-progressbar p-component":!0,"p-progressbar-determinate":n,"p-progressbar-indeterminate":h}),Jr=n=>({$implicit:n});function $r(n,h){if(n&1&&(p(0,"div"),x(1),m()),n&2){let t=P(2);Kt("display",t.value!=null&&t.value!==0?"flex":"none"),he("data-pc-section","label"),f(),gn("",t.value,"",t.unit,"")}}function Gr(n,h){n&1&&Ye(0)}function Kr(n,h){if(n&1&&(p(0,"div",3)(1,"div",4),V(2,$r,2,5,"div",5)(3,Gr,1,0,"ng-container",6),m()()),n&2){let t=P();ct(t.valueStyleClass),Kt("width",t.value+"%")("background",t.color),y("ngClass","p-progressbar-value p-progressbar-value-animate"),he("data-pc-section","value"),f(2),y("ngIf",t.showValue&&!t.contentTemplate&&!t._contentTemplate),f(),y("ngTemplateOutlet",t.contentTemplate||t._contentTemplate)("ngTemplateOutletContext",Pe(11,Jr,t.value))}}function Wr(n,h){if(n&1&&(p(0,"div",7),N(1,"div",8),m()),n&2){let t=P();ct(t.valueStyleClass),y("ngClass","p-progressbar-indeterminate-container"),he("data-pc-section","container"),f(),Kt("background",t.color),he("data-pc-section","value")}}var Hr=({dt:n})=>`
315
- .p-progressbar {
316
- position: relative;
317
- overflow: hidden;
318
- height: ${n("progressbar.height")};
319
- background: ${n("progressbar.background")};
320
- border-radius: ${n("progressbar.border.radius")};
321
- }
322
-
323
- .p-progressbar-value {
324
- margin: 0;
325
- background: ${n("progressbar.value.background")};
326
- }
327
-
328
- .p-progressbar-label {
329
- color: ${n("progressbar.label.color")};
330
- font-size: ${n("progressbar.label.font.size")};
331
- font-weight: ${n("progressbar.label.font.weight")};
332
- }
333
-
334
- .p-progressbar-determinate .p-progressbar-value {
335
- height: 100%;
336
- width: 0%;
337
- position: absolute;
338
- display: none;
339
- display: flex;
340
- align-items: center;
341
- justify-content: center;
342
- overflow: hidden;
343
- transition: width 1s ease-in-out;
344
- }
345
-
346
- .p-progressbar-determinate .p-progressbar-label {
347
- display: inline-flex;
348
- }
349
-
350
- .p-progressbar-indeterminate .p-progressbar-value::before {
351
- content: "";
352
- position: absolute;
353
- background: inherit;
354
- top: 0;
355
- inset-inline-start: 0;
356
- bottom: 0;
357
- will-change: inset-inline-start, inset-inline-end;
358
- animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
359
- }
360
-
361
- .p-progressbar-indeterminate .p-progressbar-value::after {
362
- content: "";
363
- position: absolute;
364
- background: inherit;
365
- top: 0;
366
- inset-inline-start: 0;
367
- bottom: 0;
368
- will-change: inset-inline-start, inset-inline-end;
369
- animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
370
- animation-delay: 1.15s;
371
- }
372
-
373
- @-webkit-keyframes p-progressbar-indeterminate-anim {
374
- 0% {
375
- inset-inline-start: -35%;
376
- inset-inline-end: 100%;
377
- }
378
- 60% {
379
- inset-inline-start: 100%;
380
- inset-inline-end: -90%;
381
- }
382
- 100% {
383
- inset-inline-start: 100%;
384
- inset-inline-end: -90%;
385
- }
386
- }
387
- @keyframes p-progressbar-indeterminate-anim {
388
- 0% {
389
- inset-inline-start: -35%;
390
- inset-inline-end: 100%;
391
- }
392
- 60% {
393
- inset-inline-start: 100%;
394
- inset-inline-end: -90%;
395
- }
396
- 100% {
397
- inset-inline-start: 100%;
398
- inset-inline-end: -90%;
399
- }
400
- }
401
- @-webkit-keyframes p-progressbar-indeterminate-anim-short {
402
- 0% {
403
- inset-inline-start: -200%;
404
- inset-inline-end: 100%;
405
- }
406
- 60% {
407
- inset-inline-start: 107%;
408
- inset-inline-end: -8%;
409
- }
410
- 100% {
411
- inset-inline-start: 107%;
412
- inset-inline-end: -8%;
413
- }
414
- }
415
- @keyframes p-progressbar-indeterminate-anim-short {
416
- 0% {
417
- inset-inline-start: -200%;
418
- inset-inline-end: 100%;
419
- }
420
- 60% {
421
- inset-inline-start: 107%;
422
- inset-inline-end: -8%;
423
- }
424
- 100% {
425
- inset-inline-start: 107%;
426
- inset-inline-end: -8%;
427
- }
428
- }
429
- `,qr={root:({instance:n})=>["p-progressbar p-component",{"p-progressbar-determinate":n.determinate,"p-progressbar-indeterminate":n.indeterminate}],value:"p-progressbar-value",label:"p-progressbar-label"},Sa=(()=>{class n extends Yt{name="progressbar";theme=Hr;classes=qr;static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var wa=(()=>{class n extends Nt{value;showValue=!0;styleClass;valueStyleClass;style;unit="%";mode="determinate";color;contentTemplate;_componentStyle=K(Sa);templates;_contentTemplate;ngAfterContentInit(){this.templates?.forEach(t=>{switch(t.getType()){case"content":this._contentTemplate=t.template;break;default:this._contentTemplate=t.template}})}static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275cmp=Ee({type:n,selectors:[["p-progressBar"],["p-progressbar"],["p-progress-bar"]],contentQueries:function(l,c,_){if(l&1&&(Je(_,Ur,4),Je(_,Di,4)),l&2){let A;ue(A=me())&&(c.contentTemplate=A.first),ue(A=me())&&(c.templates=A)}},inputs:{value:[2,"value","value",_i],showValue:[2,"showValue","showValue",bt],styleClass:"styleClass",valueStyleClass:"valueStyleClass",style:"style",unit:"unit",mode:"mode",color:"color"},features:[Ge([Sa]),vi,wt],decls:3,vars:15,consts:[["role","progressbar",3,"ngStyle","ngClass"],["style","display:flex",3,"ngClass","class","width","background",4,"ngIf"],[3,"ngClass","class",4,"ngIf"],[2,"display","flex",3,"ngClass"],[1,"p-progressbar-label"],[3,"display",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngClass"],[1,"p-progressbar-value","p-progressbar-value-animate"]],template:function(l,c){l&1&&(p(0,"div",0),V(1,Kr,4,13,"div",1)(2,Wr,2,7,"div",2),m()),l&2&&(ct(c.styleClass),y("ngStyle",c.style)("ngClass",yi(12,jr,c.mode==="determinate",c.mode==="indeterminate")),he("aria-valuemin",0)("aria-valuenow",c.value)("aria-valuemax",100)("data-pc-name","progressbar")("data-pc-section","root")("aria-label",c.value+c.unit),f(),y("ngIf",c.mode==="determinate"),f(),y("ngIf",c.mode==="indeterminate"))},dependencies:[Me,Ct,Xe,Wt,bi,tt],encapsulation:2,changeDetection:0})}return n})();var Zr=["file"],Qr=["header"],Ca=["content"],Yr=["toolbar"],Xr=["chooseicon"],es=["filelabel"],ts=["uploadicon"],is=["cancelicon"],ns=["empty"],os=["advancedfileinput"],as=["basicfileinput"],rs=(n,h,t,l,c)=>({$implicit:n,uploadedFiles:h,chooseCallback:t,clearCallback:l,uploadCallback:c}),ss=(n,h,t,l,c,_,A,L)=>({$implicit:n,uploadedFiles:h,chooseCallback:t,clearCallback:l,removeUploadedFileCallback:c,removeFileCallback:_,progress:A,messages:L}),ls=n=>({$implicit:n});function cs(n,h){if(n&1&&N(0,"span"),n&2){let t=P(3);ct(t.chooseIcon),he("aria-label",!0)("data-pc-section","chooseicon")}}function us(n,h){n&1&&N(0,"PlusIcon"),n&2&&he("aria-label",!0)("data-pc-section","chooseicon")}function ms(n,h){}function ds(n,h){n&1&&V(0,ms,0,0,"ng-template")}function ps(n,h){if(n&1&&(p(0,"span"),V(1,ds,1,0,null,11),m()),n&2){let t=P(4);he("aria-label",!0)("data-pc-section","chooseicon"),f(),y("ngTemplateOutlet",t.chooseIconTemplate||t._chooseIconTemplate)}}function hs(n,h){if(n&1&&(Ue(0),V(1,us,1,2,"PlusIcon",9)(2,ps,2,3,"span",9),je()),n&2){let t=P(3);f(),y("ngIf",!t.chooseIconTemplate&&!t._chooseIconTemplate),f(),y("ngIf",t.chooseIconTemplate||t._chooseIconTemplate)}}function gs(n,h){if(n&1&&N(0,"span",21),n&2){let t=P(4);y("ngClass",t.uploadIcon),he("aria-hidden",!0)}}function fs(n,h){n&1&&N(0,"UploadIcon")}function vs(n,h){}function ys(n,h){n&1&&V(0,vs,0,0,"ng-template")}function _s(n,h){if(n&1&&(p(0,"span"),V(1,ys,1,0,null,11),m()),n&2){let t=P(5);he("aria-hidden",!0),f(),y("ngTemplateOutlet",t.uploadIconTemplate||t._uploadIconTemplate)}}function bs(n,h){if(n&1&&(Ue(0),V(1,fs,1,0,"UploadIcon",9)(2,_s,2,2,"span",9),je()),n&2){let t=P(4);f(),y("ngIf",!t.uploadIconTemplate&&!t._uploadIconTemplate),f(),y("ngIf",t.uploadIconTemplate||t._uploadIconTemplate)}}function Ss(n,h){if(n&1){let t=q();p(0,"p-button",19),G("onClick",function(){R(t);let c=P(3);return B(c.upload())}),V(1,gs,1,2,"span",20)(2,bs,3,2,"ng-container",9),m()}if(n&2){let t=P(3);y("label",t.uploadButtonLabel)("disabled",!t.hasFiles()||t.isFileLimitExceeded())("styleClass","p-fileupload-upload-button "+t.uploadStyleClass)("buttonProps",t.uploadButtonProps),f(),y("ngIf",t.uploadIcon),f(),y("ngIf",!t.uploadIcon)}}function ws(n,h){if(n&1&&N(0,"span",21),n&2){let t=P(4);y("ngClass",t.cancelIcon)}}function Cs(n,h){n&1&&N(0,"TimesIcon"),n&2&&he("aria-hidden",!0)}function xs(n,h){}function Es(n,h){n&1&&V(0,xs,0,0,"ng-template")}function Ps(n,h){if(n&1&&(p(0,"span"),V(1,Es,1,0,null,11),m()),n&2){let t=P(5);he("aria-hidden",!0),f(),y("ngTemplateOutlet",t.cancelIconTemplate||t._cancelIconTemplate)}}function ks(n,h){if(n&1&&(Ue(0),V(1,Cs,1,1,"TimesIcon",9)(2,Ps,2,2,"span",9),je()),n&2){let t=P(4);f(),y("ngIf",!t.cancelIconTemplate&&!t._cancelIconTemplate),f(),y("ngIf",t.cancelIconTemplate||t._cancelIconTemplate)}}function Ts(n,h){if(n&1){let t=q();p(0,"p-button",19),G("onClick",function(){R(t);let c=P(3);return B(c.clear())}),V(1,ws,1,1,"span",20)(2,ks,3,2,"ng-container",9),m()}if(n&2){let t=P(3);y("label",t.cancelButtonLabel)("disabled",!t.hasFiles()||t.uploading)("styleClass","p-fileupload-cancel-button "+t.cancelStyleClass)("buttonProps",t.cancelButtonProps),f(),y("ngIf",t.cancelIcon),f(),y("ngIf",!t.cancelIcon)}}function Fs(n,h){if(n&1){let t=q();Ue(0),p(1,"p-button",16),G("focus",function(){R(t);let c=P(2);return B(c.onFocus())})("blur",function(){R(t);let c=P(2);return B(c.onBlur())})("onClick",function(){R(t);let c=P(2);return B(c.choose())})("keydown.enter",function(){R(t);let c=P(2);return B(c.choose())}),p(2,"input",7,0),G("change",function(c){R(t);let _=P(2);return B(_.onFileSelect(c))}),m(),V(4,cs,1,4,"span",17)(5,hs,3,2,"ng-container",9),m(),V(6,Ss,3,6,"p-button",18)(7,Ts,3,6,"p-button",18),je()}if(n&2){let t=P(2);f(),y("styleClass","p-fileupload-choose-button "+t.chooseStyleClass)("disabled",t.disabled||t.isChooseDisabled())("label",t.chooseButtonLabel)("buttonProps",t.chooseButtonProps),he("data-pc-section","choosebutton"),f(),y("multiple",t.multiple)("accept",t.accept)("disabled",t.disabled||t.isChooseDisabled()),he("aria-label",t.browseFilesLabel)("title","")("data-pc-section","input"),f(2),y("ngIf",t.chooseIcon),f(),y("ngIf",!t.chooseIcon),f(),y("ngIf",!t.auto&&t.showUploadButton),f(),y("ngIf",!t.auto&&t.showCancelButton)}}function Os(n,h){n&1&&Ye(0)}function Is(n,h){n&1&&Ye(0)}function Ns(n,h){if(n&1&&N(0,"p-progressbar",22),n&2){let t=P(2);y("value",t.progress)("showValue",!1)}}function Ds(n,h){if(n&1&&N(0,"p-message",14),n&2){let t=h.$implicit;y("severity",t.severity)("text",t.text)}}function Vs(n,h){if(n&1){let t=q();p(0,"img",33),G("error",function(c){R(t);let _=P(5);return B(_.imageError(c))}),m()}if(n&2){let t=P().$implicit,l=P(4);y("src",t.objectURL,Po)("width",l.previewWidth)}}function As(n,h){n&1&&N(0,"TimesIcon")}function Ls(n,h){}function Ms(n,h){n&1&&V(0,Ls,0,0,"ng-template")}function Rs(n,h){if(n&1&&V(0,As,1,0,"TimesIcon",9)(1,Ms,1,0,null,11),n&2){let t=P(5);y("ngIf",!t.cancelIconTemplate&&!t._cancelIconTemplate),f(),y("ngTemplateOutlet",t.cancelIconTemplate||t._cancelIconTemplate)}}function Bs(n,h){if(n&1){let t=q();p(0,"div",24),V(1,Vs,1,2,"img",27),p(2,"div",28)(3,"div",29),x(4),m(),p(5,"span",30),x(6),m()(),p(7,"div",31)(8,"p-button",32),G("onClick",function(c){let _=R(t).index,A=P(4);return B(A.remove(c,_))}),V(9,Rs,2,2,"ng-template",null,2,Z),m()()()}if(n&2){let t=h.$implicit,l=P(4);f(),y("ngIf",l.isImage(t)),f(3),ae(t.name),f(2),ae(l.formatSize(t.size)),f(2),y("disabled",l.uploading)("styleClass","p-fileupload-file-remove-button "+l.removeStyleClass)}}function zs(n,h){if(n&1&&V(0,Bs,11,5,"div",26),n&2){let t=P(3);y("ngForOf",t.files)}}function Us(n,h){}function js(n,h){if(n&1&&V(0,Us,0,0,"ng-template",25),n&2){let t=P(3);y("ngForOf",t.files)("ngForTemplate",t.fileTemplate||t._fileTemplate)}}function Js(n,h){if(n&1&&(p(0,"div",23),V(1,zs,1,1,"div",24)(2,js,1,2,null,25),m()),n&2){let t=P(2);f(),Le(!t.fileTemplate&&!t._fileTemplate?1:-1),f(),Le(t.fileTemplate||t._fileTemplate?2:-1)}}function $s(n,h){n&1&&Ye(0)}function Gs(n,h){n&1&&Ye(0)}function Ks(n,h){if(n&1&&V(0,Gs,1,0,"ng-container",11),n&2){let t=P(2);y("ngTemplateOutlet",t.emptyTemplate||t._emptyTemplate)}}function Ws(n,h){if(n&1){let t=q();p(0,"div",6)(1,"input",7,0),G("change",function(c){R(t);let _=P();return B(_.onFileSelect(c))}),m(),p(3,"div",8),V(4,Fs,8,15,"ng-container",9)(5,Os,1,0,"ng-container",10)(6,Is,1,0,"ng-container",11),m(),p(7,"div",12,1),G("dragenter",function(c){R(t);let _=P();return B(_.onDragEnter(c))})("dragleave",function(c){R(t);let _=P();return B(_.onDragLeave(c))})("drop",function(c){R(t);let _=P();return B(_.onDrop(c))}),V(9,Ns,1,2,"p-progressbar",13),yt(10,Ds,1,2,"p-message",14,Bn),V(12,Js,3,2,"div",15)(13,$s,1,0,"ng-container",10)(14,Ks,1,1,"ng-container"),m()()}if(n&2){let t=P();ct(t.styleClass),y("ngClass","p-fileupload p-fileupload-advanced p-component")("ngStyle",t.style),he("data-pc-name","fileupload")("data-pc-section","root"),f(),Kt("display","none"),y("multiple",t.multiple)("accept",t.accept)("disabled",t.disabled||t.isChooseDisabled()),he("aria-label",t.browseFilesLabel)("title","")("data-pc-section","input"),f(3),y("ngIf",!t.headerTemplate&&!t._headerTemplate),f(),y("ngTemplateOutlet",t.headerTemplate||t._headerTemplate)("ngTemplateOutletContext",Do(24,rs,t.files,t.uploadedFiles,t.choose.bind(t),t.clear.bind(t),t.upload.bind(t))),f(),y("ngTemplateOutlet",t.toolbarTemplate||t._toolbarTemplate),f(),he("data-pc-section","content"),f(2),y("ngIf",t.hasFiles()),f(),_t(t.msgs),f(2),y("ngIf",t.hasFiles()),f(),y("ngTemplateOutlet",t.contentTemplate||t._contentTemplate)("ngTemplateOutletContext",Vo(30,ss,t.files,t.uploadedFiles,t.choose.bind(t),t.clear.bind(t),t.removeUploadedFile.bind(t),t.remove.bind(t),t.progress,t.msgs)),f(),Le((t.emptyTemplate||t._emptyTemplate)&&!t.hasFiles()&&!t.hasUploadedFiles()?14:-1)}}function Hs(n,h){if(n&1&&N(0,"p-message",14),n&2){let t=h.$implicit;y("severity",t.severity)("text",t.text)}}function qs(n,h){if(n&1&&N(0,"span",37),n&2){let t=P(4);y("ngClass",t.uploadIcon)}}function Zs(n,h){n&1&&N(0,"UploadIcon",40),n&2&&y("styleClass","p-button-icon p-button-icon-left")}function Qs(n,h){}function Ys(n,h){n&1&&V(0,Qs,0,0,"ng-template")}function Xs(n,h){if(n&1&&(p(0,"span",41),V(1,Ys,1,0,null,11),m()),n&2){let t=P(5);f(),y("ngTemplateOutlet",t._uploadIconTemplate||t.uploadIconTemplate)}}function el(n,h){if(n&1&&(Ue(0),V(1,Zs,1,1,"UploadIcon",38)(2,Xs,2,1,"span",39),je()),n&2){let t=P(4);f(),y("ngIf",!t.uploadIconTemplate&&!t._uploadIconTemplate),f(),y("ngIf",t._uploadIconTemplate||t.uploadIconTemplate)}}function tl(n,h){if(n&1&&V(0,qs,1,1,"span",36)(1,el,3,2,"ng-container",9),n&2){let t=P(3);y("ngIf",t.uploadIcon),f(),y("ngIf",!t.uploadIcon)}}function il(n,h){if(n&1&&N(0,"span",43),n&2){let t=P(4);y("ngClass",t.chooseIcon)}}function nl(n,h){n&1&&N(0,"PlusIcon"),n&2&&he("data-pc-section","uploadicon")}function ol(n,h){}function al(n,h){n&1&&V(0,ol,0,0,"ng-template")}function rl(n,h){if(n&1&&(Ue(0),V(1,nl,1,1,"PlusIcon",9)(2,al,1,0,null,11),je()),n&2){let t=P(4);f(),y("ngIf",!t.chooseIconTemplate&&!t._chooseIconTemplate),f(),y("ngTemplateOutlet",t.chooseIconTemplate||t._chooseIconTemplate)}}function sl(n,h){if(n&1&&V(0,il,1,1,"span",42)(1,rl,3,2,"ng-container",9),n&2){let t=P(3);y("ngIf",t.chooseIcon),f(),y("ngIf",!t.chooseIcon)}}function ll(n,h){if(n&1&&V(0,tl,2,2)(1,sl,2,2),n&2){let t=P(2);Le(t.hasFiles()&&!t.auto?0:1)}}function cl(n,h){if(n&1&&(p(0,"span"),x(1),m()),n&2){let t=P(3);ct(t.cx("filelabel")),f(),ot(" ",t.basicFileChosenLabel()," ")}}function ul(n,h){n&1&&Ye(0)}function ml(n,h){if(n&1&&V(0,ul,1,0,"ng-container",10),n&2){let t=P(3);y("ngTemplateOutlet",t.fileLabelTemplate||t._fileLabelTemplate)("ngTemplateOutletContext",Pe(2,ls,t.files))}}function dl(n,h){if(n&1&&V(0,cl,2,3,"span",44)(1,ml,1,4,"ng-container"),n&2){let t=P(2);Le(!t.fileLabelTemplate&&!t._fileLabelTemplate?0:1)}}function pl(n,h){if(n&1){let t=q();p(0,"div",21),yt(1,Hs,1,2,"p-message",14,Bn),p(3,"p-button",34),G("onClick",function(){R(t);let c=P();return B(c.onBasicUploaderClick())})("keydown",function(c){R(t);let _=P();return B(_.onBasicKeydown(c))}),V(4,ll,2,1,"ng-template",null,2,Z),p(6,"input",35,3),G("change",function(c){R(t);let _=P();return B(_.onFileSelect(c))})("focus",function(){R(t);let c=P();return B(c.onFocus())})("blur",function(){R(t);let c=P();return B(c.onBlur())}),m()(),V(8,dl,2,1),m()}if(n&2){let t=P();ct(t.styleClass),y("ngClass","p-fileupload p-fileupload-basic p-component"),he("data-pc-name","fileupload"),f(),_t(t.msgs),f(2),vt(t.style),y("styleClass","p-fileupload-choose-button "+t.chooseStyleClass)("disabled",t.disabled)("label",t.chooseButtonLabel)("buttonProps",t.chooseButtonProps),f(3),y("accept",t.accept)("multiple",t.multiple)("disabled",t.disabled),he("aria-label",t.browseFilesLabel)("data-pc-section","input"),f(2),Le(t.auto?-1:8)}}var hl=({dt:n})=>`
430
- .p-fileupload input[type="file"] {
431
- display: none;
432
- }
433
-
434
- .p-fileupload-advanced {
435
- border: 1px solid ${n("fileupload.border.color")};
436
- border-radius: ${n("fileupload.border.radius")};
437
- background: ${n("fileupload.background")};
438
- color: ${n("fileupload.color")};
439
- }
440
-
441
- .p-fileupload-header {
442
- display: flex;
443
- align-items: center;
444
- padding: ${n("fileupload.header.padding")};
445
- background: ${n("fileupload.header.background")};
446
- color: ${n("fileupload.header.color")};
447
- border-style: solid;
448
- border-width: ${n("fileupload.header.border.width")};
449
- border-color: ${n("fileupload.header.border.color")};
450
- border-radius: ${n("fileupload.header.border.radius")};
451
- gap: ${n("fileupload.header.gap")};
452
- }
453
-
454
- .p-fileupload-content {
455
- border: 1px solid transparent;
456
- display: flex;
457
- flex-direction: column;
458
- gap: ${n("fileupload.content.gap")};
459
- transition: border-color ${n("fileupload.transition.duration")};
460
- padding: ${n("fileupload.content.padding")};
461
- }
462
-
463
- .p-fileupload-content .p-progressbar {
464
- width: 100%;
465
- height: ${n("fileupload.progressbar.height")};
466
- }
467
-
468
- .p-fileupload-file-list {
469
- display: flex;
470
- flex-direction: column;
471
- gap: ${n("fileupload.filelist.gap")};
472
- }
473
-
474
- .p-fileupload-file {
475
- display: flex;
476
- flex-wrap: wrap;
477
- align-items: center;
478
- padding: ${n("fileupload.file.padding")};
479
- border-bottom: 1px solid ${n("fileupload.file.border.color")};
480
- gap: ${n("fileupload.file.gap")};
481
- }
482
-
483
- .p-fileupload-file:last-child {
484
- border-bottom: 0;
485
- }
486
-
487
- .p-fileupload-file-info {
488
- display: flex;
489
- flex-direction: column;
490
- gap: ${n("fileupload.file.info.gap")};
491
- }
492
-
493
- .p-fileupload-file-thumbnail {
494
- flex-shrink: 0;
495
- }
496
-
497
- .p-fileupload-file-actions {
498
- margin-left: auto;
499
- }
500
-
501
- .p-fileupload-highlight {
502
- border: 1px dashed ${n("fileupload.content.highlight.border.color")};
503
- }
504
-
505
- .p-fileupload-advanced .p-message {
506
- margin-top: 0;
507
- }
508
-
509
- .p-fileupload-basic {
510
- display: flex;
511
- flex-wrap: wrap;
512
- align-items: center;
513
- justify-content: center;
514
- gap: ${n("fileupload.basic.gap")};
515
- }
516
- `,gl={root:({instance:n})=>`p-fileupload p-fileupload-${n.mode} p-component`,header:"p-fileupload-header",pcChooseButton:"p-fileupload-choose-button",pcUploadButton:"p-fileupload-upload-button",pcCancelButton:"p-fileupload-cancel-button",content:"p-fileupload-content",fileList:"p-fileupload-file-list",file:"p-fileupload-file",fileThumbnail:"p-fileupload-file-thumbnail",fileInfo:"p-fileupload-file-info",fileName:"p-fileupload-file-name",fileSize:"p-fileupload-file-size",pcFileBadge:"p-fileupload-file-badge",fileActions:"p-fileupload-file-actions",pcFileRemoveButton:"p-fileupload-file-remove-button"},xa=(()=>{class n extends Yt{name="fileupload";theme=hl;classes=gl;static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var di=(()=>{class n extends Nt{name;url;method="post";multiple;accept;disabled;auto;withCredentials;maxFileSize;invalidFileSizeMessageSummary="{0}: Invalid file size, ";invalidFileSizeMessageDetail="maximum upload size is {0}.";invalidFileTypeMessageSummary="{0}: Invalid file type, ";invalidFileTypeMessageDetail="allowed file types: {0}.";invalidFileLimitMessageDetail="limit is {0} at most.";invalidFileLimitMessageSummary="Maximum number of files exceeded, ";style;styleClass;previewWidth=50;chooseLabel;uploadLabel;cancelLabel;chooseIcon;uploadIcon;cancelIcon;showUploadButton=!0;showCancelButton=!0;mode="advanced";headers;customUpload;fileLimit;uploadStyleClass;cancelStyleClass;removeStyleClass;chooseStyleClass;chooseButtonProps;uploadButtonProps={severity:"secondary"};cancelButtonProps={severity:"secondary"};onBeforeUpload=new lt;onSend=new lt;onUpload=new lt;onError=new lt;onClear=new lt;onRemove=new lt;onSelect=new lt;onProgress=new lt;uploadHandler=new lt;onImageError=new lt;onRemoveUploadedFile=new lt;fileTemplate;headerTemplate;contentTemplate;toolbarTemplate;chooseIconTemplate;fileLabelTemplate;uploadIconTemplate;cancelIconTemplate;emptyTemplate;advancedFileInput;basicFileInput;content;set files(t){this._files=[];for(let l=0;l<t.length;l++){let c=t[l];this.validate(c)&&(this.isImage(c)&&(c.objectURL=this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(t[l]))),this._files.push(t[l]))}}get files(){return this._files}get basicButtonLabel(){return this.auto||!this.hasFiles()?this.chooseLabel:this.uploadLabel??this.files[0].name}_files=[];progress=0;dragHighlight;msgs;uploadedFileCount=0;focus;uploading;duplicateIEEvent;translationSubscription;dragOverListener;uploadedFiles=[];sanitizer=K(Uo);zone=K(mn);http=K(zo);_componentStyle=K(xa);ngOnInit(){super.ngOnInit(),this.translationSubscription=this.config.translationObserver.subscribe(()=>{this.cd.markForCheck()})}ngAfterViewInit(){super.ngAfterViewInit(),Ht(this.platformId)&&this.mode==="advanced"&&this.zone.runOutsideAngular(()=>{this.content&&(this.dragOverListener=this.renderer.listen(this.content.nativeElement,"dragover",this.onDragOver.bind(this)))})}_headerTemplate;_contentTemplate;_toolbarTemplate;_chooseIconTemplate;_uploadIconTemplate;_cancelIconTemplate;_emptyTemplate;_fileTemplate;_fileLabelTemplate;templates;ngAfterContentInit(){this.templates?.forEach(t=>{switch(t.getType()){case"header":this._headerTemplate=t.template;break;case"file":this._fileTemplate=t.template;break;case"content":this._contentTemplate=t.template;break;case"toolbar":this._toolbarTemplate=t.template;break;case"chooseicon":this._chooseIconTemplate=t.template;break;case"uploadicon":this._uploadIconTemplate=t.template;break;case"cancelicon":this._cancelIconTemplate=t.template;break;case"empty":this._emptyTemplate=t.template;break;case"filelabel":this._fileLabelTemplate=t.template;break;default:this._fileTemplate=t.template;break}})}basicFileChosenLabel(){return this.auto?this.chooseButtonLabel:this.hasFiles()?this.files&&this.files.length===1?this.files[0].name:this.config.getTranslation("fileChosenMessage")?.replace("{0}",this.files.length):this.config.getTranslation("noFileChosenMessage")||""}getTranslation(t){return this.config.getTranslation(t)}choose(){this.advancedFileInput?.nativeElement.click()}onFileSelect(t){if(t.type!=="drop"&&this.isIE11()&&this.duplicateIEEvent){this.duplicateIEEvent=!1;return}this.msgs=[],this.multiple||(this.files=[]);let l=t.dataTransfer?t.dataTransfer.files:t.target.files;for(let c=0;c<l.length;c++){let _=l[c];this.isFileSelected(_)||this.validate(_)&&(this.isImage(_)&&(_.objectURL=this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(l[c]))),this.files.push(l[c]))}this.onSelect.emit({originalEvent:t,files:l,currentFiles:this.files}),this.checkFileLimit(l),this.hasFiles()&&this.auto&&(this.mode!=="advanced"||!this.isFileLimitExceeded())&&this.upload(),t.type!=="drop"&&this.isIE11()?this.clearIEInput():this.clearInputElement()}isFileSelected(t){for(let l of this.files)if(l.name+l.type+l.size===t.name+t.type+t.size)return!0;return!1}isIE11(){if(Ht(this.platformId))return!!this.document.defaultView.MSInputMethodContext&&!!this.document.documentMode}validate(t){if(this.msgs=this.msgs||[],this.accept&&!this.isFileTypeValid(t)){let l=`${this.invalidFileTypeMessageSummary.replace("{0}",t.name)} ${this.invalidFileTypeMessageDetail.replace("{0}",this.accept)}`;return this.msgs.push({severity:"error",text:l}),!1}if(this.maxFileSize&&t.size>this.maxFileSize){let l=`${this.invalidFileSizeMessageSummary.replace("{0}",t.name)} ${this.invalidFileSizeMessageDetail.replace("{0}",this.formatSize(this.maxFileSize))}`;return this.msgs.push({severity:"error",text:l}),!1}return!0}isFileTypeValid(t){let l=this.accept?.split(",").map(c=>c.trim());for(let c of l)if(this.isWildcard(c)?this.getTypeClass(t.type)===this.getTypeClass(c):t.type==c||this.getFileExtension(t).toLowerCase()===c.toLowerCase())return!0;return!1}getTypeClass(t){return t.substring(0,t.indexOf("/"))}isWildcard(t){return t.indexOf("*")!==-1}getFileExtension(t){return"."+t.name.split(".").pop()}isImage(t){return/^image\//.test(t.type)}onImageLoad(t){window.URL.revokeObjectURL(t.src)}uploader(){if(this.customUpload)this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.uploadHandler.emit({files:this.files}),this.cd.markForCheck();else{this.uploading=!0,this.msgs=[];let t=new FormData;this.onBeforeUpload.emit({formData:t});for(let l=0;l<this.files.length;l++)t.append(this.name,this.files[l],this.files[l].name);this.http.request(this.method,this.url,{body:t,headers:this.headers,reportProgress:!0,observe:"events",withCredentials:this.withCredentials}).subscribe(l=>{switch(l.type){case yn.Sent:this.onSend.emit({originalEvent:l,formData:t});break;case yn.Response:this.uploading=!1,this.progress=0,l.status>=200&&l.status<300?(this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.onUpload.emit({originalEvent:l,files:this.files})):this.onError.emit({files:this.files}),this.uploadedFiles.push(...this.files),this.clear();break;case yn.UploadProgress:{l.loaded&&(this.progress=Math.round(l.loaded*100/l.total)),this.onProgress.emit({originalEvent:l,progress:this.progress});break}}this.cd.markForCheck()},l=>{this.uploading=!1,this.onError.emit({files:this.files,error:l})})}}clear(){this.files=[],this.uploadedFileCount=0,this.onClear.emit(),this.clearInputElement(),this.msgs=[],this.cd.markForCheck()}remove(t,l){this.clearInputElement(),this.onRemove.emit({originalEvent:t,file:this.files[l]}),this.files.splice(l,1),this.checkFileLimit(this.files)}removeUploadedFile(t){let l=this.uploadedFiles.splice(t,1)[0];this.uploadedFiles=[...this.uploadedFiles],this.onRemoveUploadedFile.emit({file:l,files:this.uploadedFiles})}isFileLimitExceeded(){let l=this.auto?this.files.length:this.files.length+this.uploadedFileCount;return this.fileLimit&&this.fileLimit<=l&&this.focus&&(this.focus=!1),this.fileLimit&&this.fileLimit<l}isChooseDisabled(){return this.auto?this.fileLimit&&this.fileLimit<=this.files.length:this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount}checkFileLimit(t){this.msgs??=[];let l=this.msgs.length>0&&this.fileLimit&&this.fileLimit<t.length;if(this.isFileLimitExceeded()||l){let c=`${this.invalidFileLimitMessageSummary.replace("{0}",this.fileLimit.toString())} ${this.invalidFileLimitMessageDetail.replace("{0}",this.fileLimit.toString())}`;this.msgs.push({severity:"error",text:c})}else this.msgs=this.msgs.filter(c=>!c.text.includes(this.invalidFileLimitMessageSummary))}clearInputElement(){this.advancedFileInput&&this.advancedFileInput.nativeElement&&(this.advancedFileInput.nativeElement.value=""),this.basicFileInput&&this.basicFileInput.nativeElement&&(this.basicFileInput.nativeElement.value="")}clearIEInput(){this.advancedFileInput&&this.advancedFileInput.nativeElement&&(this.duplicateIEEvent=!0,this.advancedFileInput.nativeElement.value="")}hasFiles(){return this.files&&this.files.length>0}hasUploadedFiles(){return this.uploadedFiles&&this.uploadedFiles.length>0}onDragEnter(t){this.disabled||(t.stopPropagation(),t.preventDefault())}onDragOver(t){this.disabled||(Zt(this.content?.nativeElement,"p-fileupload-highlight"),this.dragHighlight=!0,t.stopPropagation(),t.preventDefault())}onDragLeave(t){this.disabled||Qt(this.content?.nativeElement,"p-fileupload-highlight")}onDrop(t){if(!this.disabled){Qt(this.content?.nativeElement,"p-fileupload-highlight"),t.stopPropagation(),t.preventDefault();let l=t.dataTransfer?t.dataTransfer.files:t.target.files;(this.multiple||l&&l.length===1)&&this.onFileSelect(t)}}onFocus(){this.focus=!0}onBlur(){this.focus=!1}formatSize(t){let _=this.getTranslation(It.FILE_SIZE_TYPES);if(t===0)return`0 ${_[0]}`;let A=Math.floor(Math.log(t)/Math.log(1024));return`${(t/Math.pow(1024,A)).toFixed(3)} ${_[A]}`}upload(){this.hasFiles()&&this.uploader()}onBasicUploaderClick(){this.basicFileInput?.nativeElement.click()}onBasicKeydown(t){switch(t.code){case"Space":case"Enter":this.onBasicUploaderClick(),t.preventDefault();break}}imageError(t){this.onImageError.emit(t)}getBlockableElement(){return this.el.nativeElement.children[0]}get chooseButtonLabel(){return this.chooseLabel||this.config.getTranslation(It.CHOOSE)}get uploadButtonLabel(){return this.uploadLabel||this.config.getTranslation(It.UPLOAD)}get cancelButtonLabel(){return this.cancelLabel||this.config.getTranslation(It.CANCEL)}get browseFilesLabel(){return this.config.getTranslation(It.ARIA)[It.BROWSE_FILES]}get pendingLabel(){return this.config.getTranslation(It.PENDING)}ngOnDestroy(){this.content&&this.content.nativeElement&&this.dragOverListener&&(this.dragOverListener(),this.dragOverListener=null),this.translationSubscription&&this.translationSubscription.unsubscribe(),super.ngOnDestroy()}static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275cmp=Ee({type:n,selectors:[["p-fileupload"],["p-fileUpload"]],contentQueries:function(l,c,_){if(l&1&&(Je(_,Zr,4),Je(_,Qr,4),Je(_,Ca,4),Je(_,Yr,4),Je(_,Xr,4),Je(_,es,4),Je(_,ts,4),Je(_,is,4),Je(_,ns,4),Je(_,Di,4)),l&2){let A;ue(A=me())&&(c.fileTemplate=A.first),ue(A=me())&&(c.headerTemplate=A.first),ue(A=me())&&(c.contentTemplate=A.first),ue(A=me())&&(c.toolbarTemplate=A.first),ue(A=me())&&(c.chooseIconTemplate=A.first),ue(A=me())&&(c.fileLabelTemplate=A.first),ue(A=me())&&(c.uploadIconTemplate=A.first),ue(A=me())&&(c.cancelIconTemplate=A.first),ue(A=me())&&(c.emptyTemplate=A.first),ue(A=me())&&(c.templates=A)}},viewQuery:function(l,c){if(l&1&&(ut(os,5),ut(as,5),ut(Ca,5)),l&2){let _;ue(_=me())&&(c.advancedFileInput=_.first),ue(_=me())&&(c.basicFileInput=_.first),ue(_=me())&&(c.content=_.first)}},inputs:{name:"name",url:"url",method:"method",multiple:[2,"multiple","multiple",bt],accept:"accept",disabled:[2,"disabled","disabled",bt],auto:[2,"auto","auto",bt],withCredentials:[2,"withCredentials","withCredentials",bt],maxFileSize:[2,"maxFileSize","maxFileSize",_i],invalidFileSizeMessageSummary:"invalidFileSizeMessageSummary",invalidFileSizeMessageDetail:"invalidFileSizeMessageDetail",invalidFileTypeMessageSummary:"invalidFileTypeMessageSummary",invalidFileTypeMessageDetail:"invalidFileTypeMessageDetail",invalidFileLimitMessageDetail:"invalidFileLimitMessageDetail",invalidFileLimitMessageSummary:"invalidFileLimitMessageSummary",style:"style",styleClass:"styleClass",previewWidth:[2,"previewWidth","previewWidth",_i],chooseLabel:"chooseLabel",uploadLabel:"uploadLabel",cancelLabel:"cancelLabel",chooseIcon:"chooseIcon",uploadIcon:"uploadIcon",cancelIcon:"cancelIcon",showUploadButton:[2,"showUploadButton","showUploadButton",bt],showCancelButton:[2,"showCancelButton","showCancelButton",bt],mode:"mode",headers:"headers",customUpload:[2,"customUpload","customUpload",bt],fileLimit:[2,"fileLimit","fileLimit",t=>_i(t,null)],uploadStyleClass:"uploadStyleClass",cancelStyleClass:"cancelStyleClass",removeStyleClass:"removeStyleClass",chooseStyleClass:"chooseStyleClass",chooseButtonProps:"chooseButtonProps",uploadButtonProps:"uploadButtonProps",cancelButtonProps:"cancelButtonProps",files:"files"},outputs:{onBeforeUpload:"onBeforeUpload",onSend:"onSend",onUpload:"onUpload",onError:"onError",onClear:"onClear",onRemove:"onRemove",onSelect:"onSelect",onProgress:"onProgress",uploadHandler:"uploadHandler",onImageError:"onImageError",onRemoveUploadedFile:"onRemoveUploadedFile"},features:[Ge([xa]),vi,wt],decls:2,vars:2,consts:[["advancedfileinput",""],["content",""],["icon",""],["basicfileinput",""],[3,"ngClass","ngStyle","class",4,"ngIf"],[3,"ngClass","class",4,"ngIf"],[3,"ngClass","ngStyle"],["type","file",3,"change","multiple","accept","disabled"],[1,"p-fileupload-header"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngTemplateOutlet"],[1,"p-fileupload-content",3,"dragenter","dragleave","drop"],[3,"value","showValue",4,"ngIf"],[3,"severity","text"],["class","p-fileupload-file-list",4,"ngIf"],[3,"focus","blur","onClick","keydown.enter","styleClass","disabled","label","buttonProps"],[3,"class",4,"ngIf"],[3,"label","disabled","styleClass","buttonProps","onClick",4,"ngIf"],[3,"onClick","label","disabled","styleClass","buttonProps"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],[3,"value","showValue"],[1,"p-fileupload-file-list"],[1,"p-fileupload-file"],["ngFor","",3,"ngForOf","ngForTemplate"],["class","p-fileupload-file",4,"ngFor","ngForOf"],["class","p-fileupload-file-thumbnail",3,"src","width","error",4,"ngIf"],[1,"p-fileupload-file-info"],[1,"p-fileupload-file-name"],[1,"p-fileupload-file-size"],[1,"p-fileupload-file-actions"],["text","","rounded","","severity","danger",3,"onClick","disabled","styleClass"],[1,"p-fileupload-file-thumbnail",3,"error","src","width"],[3,"onClick","keydown","styleClass","disabled","label","buttonProps"],["type","file",3,"change","focus","blur","accept","multiple","disabled"],["class","p-button-icon p-button-icon-left",3,"ngClass",4,"ngIf"],[1,"p-button-icon","p-button-icon-left",3,"ngClass"],[3,"styleClass",4,"ngIf"],["class","p-button-icon p-button-icon-left",4,"ngIf"],[3,"styleClass"],[1,"p-button-icon","p-button-icon-left"],["class","p-button-icon p-button-icon-left pi",3,"ngClass",4,"ngIf"],[1,"p-button-icon","p-button-icon-left","pi",3,"ngClass"],[3,"class"]],template:function(l,c){l&1&&V(0,Ws,15,39,"div",4)(1,pl,9,16,"div",5),l&2&&(y("ngIf",c.mode==="advanced"),f(),y("ngIf",c.mode==="basic"))},dependencies:[Me,Ct,Ro,Xe,Wt,bi,xt,wa,ba,Zo,ga,Ai,tt],encapsulation:2,changeDetection:0})}return n})(),Wi=(()=>{class n{static \u0275fac=function(l){return new(l||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({imports:[di,tt,tt]})}return n})();var Xn=ui(On()),Ea=n=>(0,Xn.default)(n).isSame((0,Xn.default)("0001-01-01T00:00:00"));var fl=["class","page"],vl=()=>({width:"25rem"}),yl=()=>({width:"100%"}),_l=()=>({width:"50%"}),bl=()=>({});function Sl(n,h){if(n&1){let t=q();p(0,"button",23),x(1,"Cancel"),m(),p(2,"button",24),G("click",function(){R(t);let c=P();return B(c.onSubmitJournalEntry())}),x(3," Save "),m()}}function wl(n,h){n&1&&(p(0,"tr")(1,"th"),x(2,"Account"),m(),p(3,"th",40),x(4,"Amount"),m(),p(5,"th",41),x(6,"Note"),m(),N(7,"th",42),m())}function Cl(n,h){if(n&1&&(p(0,"div",50)(1,"div"),x(2),m()()),n&2){let t=P().$implicit;f(2),ae(t.value)}}function xl(n,h){if(n&1&&V(0,Cl,3,1,"div",49),n&2){let t=h.$implicit;y("ngIf",t)}}function El(n,h){if(n&1&&(p(0,"div",50)(1,"div"),x(2),m()()),n&2){let t=h.$implicit;f(2),ae(t.value)}}function Pl(n,h){if(n&1){let t=q();p(0,"div",51)(1,"p-button",52),G("onClick",function(){R(t);let c=P(3);return B(c.addIitemVisible.set(!c.addIitemVisible()))}),m()()}}function kl(n,h){if(n&1){let t=q();p(0,"tr",43)(1,"td")(2,"p-select",44),V(3,xl,1,1,"ng-template",null,6,Z)(5,El,3,1,"ng-template",null,7,Z)(7,Pl,2,0,"ng-template",null,4,Z),m()(),p(9,"td"),N(10,"input",45),m(),p(11,"td"),N(12,"textarea",46),m(),p(13,"td")(14,"button",47),G("click",function(){let c=R(t).rowIndex,_=P(2);return B(_.removeItem(c))}),N(15,"i",48),m()()()}if(n&2){let t=h.rowIndex,l=P(2);y("formGroupName",t),f(2),vt(Te(7,_l)),y("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.journalRecordExpense().options.accounts),f(8),y("autoNumeric",Te(8,bl))}}function Tl(n,h){if(n&1){let t=q();p(0,"tr")(1,"td")(2,"div",53)(3,"button",54),G("click",function(){R(t);let c=P(2);return B(c.addItem())}),x(4," Add "),m(),p(5,"span"),x(6,"Total :"),m()()(),p(7,"td",55),x(8),Ae(9,"async"),Ae(10,"number"),m(),N(11,"td",56),m()}if(n&2){let t=P(2);f(8),ae(Ke(10,3,Ke(9,1,t.totalDebitAmount$)))}}function Fl(n,h){if(n&1){let t=q();p(0,"div",25)(1,"p-panel")(2,"div",26)(3,"div",27)(4,"div",12)(5,"label",28),x(6,"Outlet"),m(),N(7,"p-select",29),m()(),p(8,"div",27)(9,"div",12)(10,"label",28),x(11,"Date"),m(),N(12,"p-datepicker",30),m()(),p(13,"div",27)(14,"div",12)(15,"label",28),x(16,"Number"),m(),N(17,"input",31),m()(),p(18,"div",11)(19,"div",12)(20,"label",28),x(21,"Account"),m(),N(22,"p-select",32),m()()(),N(23,"hr"),p(24,"p-table",33),V(25,wl,8,0,"ng-template",null,2,Z)(27,kl,16,9,"ng-template",null,3,Z)(29,Tl,12,5,"ng-template",null,4,Z),m(),N(31,"hr"),p(32,"div",34)(33,"div",11)(34,"div",26)(35,"div",11)(36,"div",12)(37,"label",35),x(38,"Supplier"),m(),p(39,"p-autocomplete",36),Ae(40,"async"),G("completeMethod",function(c){R(t);let _=P();return B(_.search(c))}),m()()(),p(41,"div",11)(42,"div",12)(43,"label",35),x(44,"Note"),m(),N(45,"textarea",37),m()(),p(46,"div",11)(47,"div",38)(48,"label",35),x(49,"Upload"),m(),p(50,"p-fileupload",39,5),G("onSelect",function(c){R(t);let _=P();return B(_.onUpload(c))}),m()()()()()()()()}if(n&2){let t=P();y("formGroup",t.form),f(7),y("virtualScroll",!0)("virtualScrollItemSize",50)("options",t.journalRecordExpense().options.entities)("filter",!0),f(15),y("virtualScroll",!0)("virtualScrollItemSize",50)("options",t.journalRecordExpense().options.paymentAccounts),f(2),y("value",t.form.controls.items.controls),f(15),y("suggestions",Ke(40,11,t.supplierSuggestions$)),f(6),y("autoResize",!0)}}var Ia=(()=>{class n{constructor(){this.fb=K(Jo),this.journalRecordExpense=Ne(null),this.activatedRoute=K(qt),this.journalService=K(We),this.toasr=K(Ii),this.file=Ne(null),this.addIitemVisible=Ne(!1)}ngOnInit(){this.initForm(),this.loadJournalForm(),this.initFormAddItemCOA(),this.totalDebitAmount$=this.form.controls.items.valueChanges.pipe(Pt(t=>t.reduce((l,c)=>l+c.debitAmount,0)),$e("response"))}loadCategories(){this.categories$||(this.categories$=this.journalService.fetchCategoryOptions().pipe(_o(1)))}initFormAddItemCOA(){this.formAddItemCOA=this.fb.group({ID:this.fb.control(Ie.toString()),Name:this.fb.control(""),Code:this.fb.control(""),Note:this.fb.control(""),CategoryID:this.fb.control(""),OutletID:this.fb.control(Ie.toString()),Balance:this.fb.control(0)})}onaddItemCOA(){if(this.formAddItemCOA.invalid){this.formAddItemCOA.markAllAsTouched();return}let t=Object.entries(this.formAddItemCOA.getRawValue()).reduce((l,[c,_])=>(c==="CategoryID"?l[c]=_.key||_:l[c]=_,l),{});this.journalService.submitChartAccount(t).pipe(ke(()=>{this.toasr.success("Add COA Success","Success"),this.loadJournalForm(),this.formAddItemCOA.reset(),this.addIitemVisible.update(l=>!l)})).subscribe()}loadJournalForm(){this.activatedRoute.data.pipe(Pt(t=>t.form),ke(t=>{this.patchForm(t.form),this.journalRecordExpense.set(t)})).subscribe()}initForm(){this.form=this.fb.group({order:this.buildOrderGroup(this.fb),items:this.fb.array([]),additionalAccountID:this.fb.control(""),file:this.fb.control("")}),this.form.controls.order.controls.date.disable()}buildOrderGroup(t){return t.group({id:t.control(""),number:t.control(""),date:t.control(new Date),note:t.control(""),entryTypeID:t.control(0),referenceID:t.control(""),referenceTypeID:t.control(0),referenceText:t.control(""),contactID:t.control(""),detailReferenceID:t.control(""),creatorID:t.control(""),created:t.control(""),modifierID:t.control(""),modified:t.control(""),entityID:t.control(""),statusID:t.control(""),contactName:t.control("")})}buildItemGroup(t){return t.group({id:t.control(Ie.toString()),journalID:t.control(Ie.toString()),accountID:t.control(""),debitAmount:t.control(0),creditAmount:t.control(0),index:t.control(0),note:t.control("")})}patchForm(t){if(!t)return;this.form.controls.order.patchValue({id:t.order.id,number:t.order.number,date:Ea(t.order.date)?(0,eo.default)().toDate():(0,eo.default)(t.order.date).toDate(),note:t.order.note,entryTypeID:t.order.entryTypeID,referenceID:t.order.referenceID,referenceTypeID:t.order.referenceTypeID,referenceText:t.order.referenceText,contactID:t.order.contactID,detailReferenceID:t.order.detailReferenceID,creatorID:t.order.creatorID,created:t.order.created,modifierID:t.order.modifierID,modified:t.order.modified,entityID:t.order.entityID,statusID:t.order.statusID,contactName:t.order.contactName});let l=this.form.controls.items;l.clear(),t.items.forEach(c=>{let _=this.buildItemGroup(this.fb);_.patchValue(c),l.push(_)}),this.form.patchValue({items:void 0,order:void 0,additionalAccountID:t.additionalAccountID??"",file:t.file??""})}openDialogAddItemCOA(){this.addIitemVisible.update(t=>!t)}addItem(){let t=this.form.controls.items,l=this.buildItemGroup(this.fb);t.push(l)}removeItem(t){this.form.controls.items.removeAt(t)}search(t){let l=t.query;this.supplierSuggestions$=this.journalService.getJournalEntrySupplierSuggestions(l).pipe($e("response"))}onUpload(t){this.file.set(t.currentFiles[0])}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let t=this.getCleanedFormValue();console.log("cleanedFormValue",t);let l=this.buildFormData(t);this.journalService.submitJournalEntry(l).pipe($e("response"),ke(()=>this.form.controls.order.controls.date.disable()),fi(c=>gi(()=>c)),$e("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let t=this.form.getRawValue(),l=Object.entries(t).reduce((c,[_,A])=>(_==="items"?c[_]=A.map(L=>xe(pe({},L),{debitAmount:+L.debitAmount,creditAmount:+L.creditAmount})):_==="order"?c[_]=xe(pe({},A),{contactID:A.contactID||Ie}):_==="file"?c[_]=A.length>0?A:null:c[_]=A,c),{});return JSON.parse(JSON.stringify(l,(c,_)=>_==="null"?null:_))}buildFormData(t){let l=new FormData;return l.append("Data",JSON.stringify(t)),l.append("File",this.file()),l}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Ee({type:n,selectors:[["app-journal-record-expense",8,"page"]],attrs:fl,decls:27,vars:13,consts:[["actionButton",""],["content",""],["header",""],["body",""],["footer",""],["fu",""],["selectedItem",""],["item",""],["pageTitle","Record Expense"],["header","Add New Account",3,"modal","visible","closable"],[1,"row","row-gap-3",3,"formGroup"],[1,"col"],[1,"d-flex","flex-column"],["for","username",1,"font-semibold","w-24"],["formControlName","Name","pInputText","","id","username","autocomplete","off",1,"flex-auto"],["for","email",1,"font-semibold","w-24"],["formControlName","Code","pInputText","","id","email","autocomplete","off",1,"flex-auto"],[1,"col-12"],["for","password",1,"font-semibold","w-24"],["formControlName","CategoryID","containerStyleClass","w-100","appendTo","body","placeholder","Select Item",3,"onFocus","options"],[1,"d-flex","justify-content-end","gap-2"],["label","Cancel","severity","secondary",3,"click"],["label","Save",3,"click"],[1,"btn","btn-secondary","rounded"],["type","button",1,"btn","btn-primary","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],[1,"row"],["formGroupName","order",1,"col"],["for","outlet"],["inputId","outlet","formControlName","entityID","optionLabel","name","optionValue","id","placeholder","Select an outlet","filterBy","name",3,"virtualScroll","virtualScrollItemSize","options","filter"],["styleClass","w-100","formControlName","date"],["formControlName","number","type","text","pInputText",""],["inputId","outlet","formControlName","additionalAccountID","optionLabel","value","optionValue","key","placeholder","",3,"virtualScroll","virtualScrollItemSize","options"],["showGridlines","","formArrayName","items",3,"value"],["formGroupName","order",1,"row"],["for",""],["styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",3,"completeMethod","suggestions"],["rows","1","pTextarea","","formControlName","note","placeholder","e.g. Electricity & Phone Bill for Decemeber",3,"autoResize"],[1,"form-group","d-flex","flex-column"],["styleClass","justify-content-start","mode","basic","chooseLabel","Choose","chooseIcon","fa-solid fa-upload","maxFileSize","1000000",3,"onSelect"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[2,"width","5%"],[3,"formGroupName"],["filter","","filterBy","value","styleClass","w-50","appendTo","body","formControlName","accountID","optionLabel","value","optionValue","key","placeholder","Select an account",3,"virtualScroll","virtualScrollItemSize","options"],["type","text","pInputText","","formControlName","debitAmount",1,"text-end",3,"autoNumeric"],["autoResize","","rows","1","pTextarea","","formControlName","note"],[1,"btn","btn-link",3,"click"],[1,"fa-light","fa-trash","text-danger"],["class","flex items-center gap-2",4,"ngIf"],[1,"flex","items-center","gap-2"],[1,"p-3"],["label","Add New","fluid","","severity","secondary","text","","size","small","icon","pi pi-plus",3,"onClick"],[1,"d-flex","justify-content-between","align-items-center"],[1,"btn","btn-primary","rounded",3,"click"],[1,"text-end"],["colspan","2"]],template:function(l,c){if(l&1){let _=q();p(0,"app-main-panel",8),V(1,Sl,4,0,"ng-template",null,0,Z)(3,Fl,52,13,"ng-template",null,1,Z),m(),p(5,"p-dialog",9)(6,"div",10)(7,"div",11)(8,"div",12)(9,"label",13),x(10,"Name"),m(),N(11,"input",14),m()(),p(12,"div",11)(13,"div",12)(14,"label",15),x(15,"Code"),m(),N(16,"input",16),m()(),p(17,"div",17)(18,"div",12)(19,"label",18),x(20,"Category"),m(),p(21,"p-treeselect",19),Ae(22,"async"),G("onFocus",function(){return R(_),B(c.loadCategories())}),m()()(),p(23,"div",11)(24,"div",20)(25,"p-button",21),G("click",function(){return R(_),B(c.addIitemVisible.set(!c.addIitemVisible()))}),m(),p(26,"p-button",22),G("click",function(){return R(_),B(c.onaddItemCOA())}),m()()()()()}l&2&&(f(5),vt(Te(11,vl)),y("modal",!0)("visible",c.addIitemVisible())("closable",!1),f(),y("formGroup",c.formAddItemCOA),f(15),vt(Te(12,yl)),y("options",Ke(22,9,c.categories$)))},dependencies:[Et,Me,Xe,Bo,Ft,ji,Ui,ni,ii,zi,Bi,ei,Xt,Dt,At,Vt,Ti,Si,wi,Ci,xi,ki,Ei,Pi,Ki,ai,oi,$i,Ji,Wi,di,ti,xt,Ri,Mi,ha,pa],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var Ol=["filterRef"],Il=["class","page"];function Nl(n,h){n&1&&(p(0,"div",10)(1,"div",5)(2,"h5",11),x(3,"Card title"),m(),p(4,"h6",12),x(5,"Card subtitle"),m(),p(6,"p",13),x(7," Some quick example text to build on the card title and make up the bulk of the card's content. "),m(),p(8,"a",14),x(9,"Card link"),m(),p(10,"a",14),x(11,"Another link"),m()()())}var Na=(()=>{class n{constructor(){this.modalService=K(wn)}onFilterChange(t){console.log("Filter Change",t),this.modalService.open(this.templateRef)}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Ee({type:n,selectors:[["app-journal-deposit",8,"page"]],viewQuery:function(l,c){if(l&1&&ut(Ol,7),l&2){let _;ue(_=me())&&(c.templateRef=_.first)}},attrs:Il,decls:44,vars:0,consts:[["filterRef",""],[3,"eventFilterChange"],["ngProjectAs","content",5,["content"]],[1,"container","my-4"],[1,"card"],[1,"card-body"],[1,"table"],["scope","col"],["scope","row"],["colspan","2"],[1,"card",2,"width","18rem"],[1,"card-title"],[1,"card-subtitle","mb-2","text-body-secondary"],[1,"card-text"],["href","#",1,"card-link"]],template:function(l,c){if(l&1){let _=q();p(0,"app-main-panel",1),G("eventFilterChange",function(L){return R(_),B(c.onFilterChange(L))}),Ue(1,2),p(2,"div",3)(3,"div",4)(4,"div",5)(5,"table",6)(6,"thead")(7,"tr")(8,"th",7),x(9,"#"),m(),p(10,"th",7),x(11,"First"),m(),p(12,"th",7),x(13,"Last"),m(),p(14,"th",7),x(15,"Handle"),m()()(),p(16,"tbody")(17,"tr")(18,"th",8),x(19,"1"),m(),p(20,"td"),x(21,"Mark"),m(),p(22,"td"),x(23,"Otto"),m(),p(24,"td"),x(25,"mdo"),m()(),p(26,"tr")(27,"th",8),x(28,"2"),m(),p(29,"td"),x(30,"Jacob"),m(),p(31,"td"),x(32,"Thornton"),m(),p(33,"td"),x(34,"fat"),m()(),p(35,"tr")(36,"th",8),x(37,"3"),m(),p(38,"td",9),x(39,"Larry the Bird"),m(),p(40,"td"),x(41,"twitter"),m()()()()()()(),je(),m(),V(42,Nl,12,0,"ng-template",null,0,Z)}},dependencies:[Et],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var lo=ui(On());var Dl=["mask"],Vl=["content"],Al=["footer"],Ll=["titlebar"],Ml=(n,h,t)=>({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex","justify-content":n,"align-items":h,"pointer-events":t}),Rl=n=>({"p-dialog p-component":!0,"p-dialog-maximized":n}),Bl=()=>({display:"flex","flex-direction":"column","pointer-events":"auto"}),zl=(n,h)=>({transform:n,transition:h}),Ul=n=>({value:"visible",params:n});function jl(n,h){if(n&1){let t=q();p(0,"div",14),G("mousedown",function(c){R(t);let _=P(2);return B(_.initResize(c))}),m()}n&2&&y("ngClass","p-resizable-handle")}function Jl(n,h){n&1&&Ye(0)}function $l(n,h){n&1&&N(0,"WindowMaximizeIcon")}function Gl(n,h){n&1&&N(0,"WindowMinimizeIcon")}function Kl(n,h){if(n&1&&(Ue(0),V(1,$l,1,0,"WindowMaximizeIcon",11)(2,Gl,1,0,"WindowMinimizeIcon",11),je()),n&2){let t=P(5);f(),y("ngIf",!t.maximized&&!t.maximizeIconTemplate),f(),y("ngIf",t.maximized&&!t.minimizeIconTemplate)}}function Wl(n,h){}function Hl(n,h){n&1&&V(0,Wl,0,0,"ng-template")}function ql(n,h){if(n&1&&(Ue(0),V(1,Hl,1,0,null,21),je()),n&2){let t=P(5);f(),y("ngTemplateOutlet",t.maximizeIconTemplate)}}function Zl(n,h){}function Ql(n,h){n&1&&V(0,Zl,0,0,"ng-template")}function Yl(n,h){if(n&1&&(Ue(0),V(1,Ql,1,0,null,21),je()),n&2){let t=P(5);f(),y("ngTemplateOutlet",t.minimizeIconTemplate)}}function Xl(n,h){if(n&1){let t=q();p(0,"p-button",20),G("onClick",function(){R(t);let c=P(4);return B(c.maximize())})("keydown.enter",function(){R(t);let c=P(4);return B(c.maximize())}),V(1,Kl,3,2,"ng-container",11)(2,ql,2,1,"ng-container",11)(3,Yl,2,1,"ng-container",11),m()}if(n&2){let t=P(4);y("styleClass","p-dialog-maximize-button")("tabindex",t.maximizable?"0":"-1"),f(),y("ngIf",!t.maximizeIcon),f(),y("ngIf",!t.maximized),f(),y("ngIf",t.maximized)}}function ec(n,h){n&1&&(Ue(0),N(1,"TimesIcon"),je())}function tc(n,h){}function ic(n,h){n&1&&V(0,tc,0,0,"ng-template")}function nc(n,h){if(n&1&&(p(0,"span"),V(1,ic,1,0,null,21),m()),n&2){let t=P(5);f(),y("ngTemplateOutlet",t.closeIconTemplate)}}function oc(n,h){if(n&1){let t=q();p(0,"p-button",22),G("onClick",function(){R(t);let c=P(4);return B(c.hide())})("keydown.enter",function(){R(t);let c=P(4);return B(c.hide())}),V(1,ec,2,0,"ng-container",11)(2,nc,2,1,"span",11),m()}if(n&2){let t=P(4);y("styleClass","p-dialog-close-button")("ariaLabel",t.ddconfig.closeAriaLabel||t.defaultCloseAriaLabel),f(),y("ngIf",!t.closeIconTemplate),f(),y("ngIf",t.closeIconTemplate)}}function ac(n,h){if(n&1&&(Ue(0),p(1,"span",16),x(2),m(),p(3,"div",17),V(4,Xl,4,5,"p-button",18)(5,oc,3,4,"p-button",19),m(),je()),n&2){let t=P(3);f(),y("ngClass","p-dialog-title")("id",t.ariaLabelledBy),f(),ae(t.ddconfig.header),f(),y("ngClass","p-dialog-header-actions"),f(),y("ngIf",t.ddconfig.maximizable),f(),y("ngIf",t.closable)}}function rc(n,h){if(n&1){let t=q();p(0,"div",15,3),G("mousedown",function(c){R(t);let _=P(2);return B(_.initDrag(c))}),V(2,Jl,1,0,"ng-container",12)(3,ac,6,6,"ng-container",11),m()}if(n&2){let t=P(2);y("ngClass","p-dialog-header"),f(2),y("ngComponentOutlet",t.headerTemplate),f(),y("ngIf",!t.headerTemplate)}}function sc(n,h){}function lc(n,h){n&1&&V(0,sc,0,0,"ng-template",23)}function cc(n,h){n&1&&Ye(0)}function uc(n,h){if(n&1&&(Ue(0),x(1),je()),n&2){let t=P(3);f(),ot(" ",t.ddconfig.footer," ")}}function mc(n,h){n&1&&Ye(0)}function dc(n,h){if(n&1&&(p(0,"div",17,4),V(2,uc,2,1,"ng-container",11)(3,mc,1,0,"ng-container",12),m()),n&2){let t=P(2);y("ngClass","p-dialog-footer"),f(2),y("ngIf",!t.footerTemplate),f(),y("ngComponentOutlet",t.footerTemplate)}}function pc(n,h){if(n&1){let t=q();p(0,"div",7,1),G("@animation.start",function(c){R(t);let _=P();return B(_.onAnimationStart(c))})("@animation.done",function(c){R(t);let _=P();return B(_.onAnimationEnd(c))}),V(2,jl,1,1,"div",8)(3,rc,4,3,"div",9),p(4,"div",10,2),V(6,lc,1,0,null,11)(7,cc,1,0,"ng-container",12),m(),V(8,dc,4,3,"div",13),m()}if(n&2){let t=P();vt(t.ddconfig.style),ct(t.ddconfig.styleClass),Kt("width",t.ddconfig.width)("height",t.ddconfig.height),y("ngClass",Pe(22,Rl,t.maximizable&&t.maximized))("ngStyle",Te(24,Bl))("@animation",Pe(28,Ul,yi(25,zl,t.transformOptions,t.ddconfig.transitionOptions||"150ms cubic-bezier(0, 0, 0.2, 1)")))("pFocusTrapDisabled",t.ddconfig.focusTrap===!1),he("aria-labelledby",t.ariaLabelledBy)("aria-modal",!0)("id",t.dialogId),f(2),y("ngIf",t.ddconfig.resizable),f(),y("ngIf",t.ddconfig.showHeader!==!1),f(),y("ngClass","p-dialog-content")("ngStyle",t.ddconfig.contentStyle),f(2),y("ngIf",!t.contentTemplate),f(),y("ngComponentOutlet",t.contentTemplate),f(),y("ngIf",t.ddconfig.footer||t.footerTemplate)}}var Da=(()=>{class n{viewContainerRef;constructor(t){this.viewContainerRef=t}static \u0275fac=function(l){return new(l||n)(zt(To))};static \u0275dir=dn({type:n,selectors:[["","pDynamicDialogContent",""]]})}return n})(),Va=(()=>{class n extends ca{name="dialog";static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var Dn=class{data;inputValues;header;ariaLabelledBy;footer;width;height;closeOnEscape=!1;focusOnShow=!0;focusTrap=!0;baseZIndex;autoZIndex=!1;dismissableMask=!1;rtl=!1;style;contentStyle;styleClass;transitionOptions;closable=!1;showHeader=!1;modal=!1;maskStyleClass;resizable=!1;draggable=!1;keepInViewport=!1;minX;minY;maximizable=!1;maximizeIcon;minimizeIcon;position;closeAriaLabel;appendTo;duplicate=!1;breakpoints;templates},tn=class{constructor(){}close(h){this._onClose.next(h),setTimeout(()=>{this._onClose.complete()},1e3)}destroy(){this._onDestroy.next(null)}dragStart(h){this._onDragStart.next(h)}dragEnd(h){this._onDragEnd.next(h)}resizeInit(h){this._onResizeInit.next(h)}resizeEnd(h){this._onResizeEnd.next(h)}maximize(h){this._onMaximize.next(h)}_onClose=new Bt;onClose=this._onClose.asObservable();_onDestroy=new Bt;onDestroy=this._onDestroy.asObservable();_onDragStart=new Bt;onDragStart=this._onDragStart.asObservable();_onDragEnd=new Bt;onDragEnd=this._onDragEnd.asObservable();_onResizeInit=new Bt;onResizeInit=this._onResizeInit.asObservable();_onResizeEnd=new Bt;onResizeEnd=this._onResizeEnd.asObservable();_onMaximize=new Bt;onMaximize=this._onMaximize.asObservable();onChildComponentLoaded=new Bt},hc=zn([mi({transform:"{{transform}}",opacity:0}),Fi("{{transition}}",mi({transform:"none",opacity:1}))]),gc=zn([Fi("{{transition}}",mi({transform:"{{transform}}",opacity:0}))]),Aa=(()=>{class n extends Nt{renderer;ddconfig;dialogRef;zone;parentDialog;visible=!0;componentRef;mask;resizing;dragging;maximized;_style={};originalStyle;lastPageX;lastPageY;ariaLabelledBy;id=Yi("pn_id_");styleElement;insertionPoint;maskViewChild;contentViewChild;footerViewChild;headerViewChild;childComponentType;inputValues;container;wrapper;documentKeydownListener;documentEscapeListener;maskClickListener;transformOptions="scale(0.7)";documentResizeListener;documentResizeEndListener;documentDragListener;documentDragEndListener;_componentStyle=K(Va);get minX(){return this.ddconfig.minX?this.ddconfig.minX:0}get minY(){return this.ddconfig.minY?this.ddconfig.minY:0}get keepInViewport(){return this.ddconfig.keepInViewport}get maximizable(){return this.ddconfig.maximizable}get maximizeIcon(){return this.ddconfig.maximizeIcon}get minimizeIcon(){return this.ddconfig.minimizeIcon}get closable(){return this.ddconfig.closable}get style(){return this._style}get position(){return this.ddconfig.position}get defaultCloseAriaLabel(){return this.config.getTranslation(It.ARIA).close}set style(t){t&&(this._style=pe({},t),this.originalStyle=t)}get parent(){let t=Array.from(this.document.getElementsByClassName("p-dialog"));if(t.length>1)return t.pop()}get parentContent(){let t=Array.from(this.document.getElementsByClassName("p-dialog"));if(t.length>0){let l=t[t.length-1].querySelector(".p-dialog-content");if(l)return Array.isArray(l)?l[0]:l}}get header(){return this.ddconfig.header}get data(){return this.ddconfig.data}get breakpoints(){return this.ddconfig.breakpoints}get footerTemplate(){return this.ddconfig?.templates?.footer}get headerTemplate(){return this.ddconfig?.templates?.header}get contentTemplate(){return this.ddconfig?.templates?.content}get minimizeIconTemplate(){return this.ddconfig?.templates?.minimizeicon}get maximizeIconTemplate(){return this.ddconfig?.templates?.maximizeicon}get closeIconTemplate(){return this.ddconfig?.templates?.closeicon}get maskClass(){let l=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find(c=>c===this.position);return{"p-dialog-mask":!0,"p-overlay-mask p-overlay-mask-enter":this.ddconfig.modal||this.ddconfig.dismissableMask,[`p-dialog-${l}`]:l}}get dialogId(){return this.attrSelector}zIndexForLayering;constructor(t,l,c,_,A){super(),this.renderer=t,this.ddconfig=l,this.dialogRef=c,this.zone=_,this.parentDialog=A}ngOnInit(){super.ngOnInit(),this.breakpoints&&this.createStyle()}createStyle(){if(Ht(this.platformId)&&!this.styleElement){this.styleElement=this.renderer.createElement("style"),this.styleElement.type="text/css",this.renderer.appendChild(this.document.head,this.styleElement);let t="";for(let l in this.breakpoints)t+=`
517
- @media screen and (max-width: ${l}) {
518
- .p-dialog[id=${this.dialogId}]:not(.p-dialog-maximized) {
519
- width: ${this.breakpoints[l]} !important;
520
- }
521
- }
522
- `;this.renderer.setProperty(this.styleElement,"innerHTML",t),Ho(this.styleElement,"nonce",this.config?.csp()?.nonce)}}destroyStyle(){this.styleElement&&(this.renderer.removeChild(this.document.head,this.styleElement),this.styleElement=null)}ngAfterViewInit(){super.ngAfterViewInit(),this.loadChildComponent(this.childComponentType),this.ariaLabelledBy=this.getAriaLabelledBy(),this.cd.detectChanges()}getAriaLabelledBy(){let{header:t,showHeader:l}=this.ddconfig;return t===null||l===!1?null:Yi("pn_id_")+"_header"}loadChildComponent(t){let l=this.insertionPoint?.viewContainerRef;l?.clear(),this.componentRef=l?.createComponent(t),this.inputValues&&Object.entries(this.inputValues).forEach(([c,_])=>{this.componentRef.setInput(c,_)}),this.dialogRef.onChildComponentLoaded.next(this.componentRef.instance)}moveOnTop(){this.ddconfig.autoZIndex!==!1?(Vi.set("modal",this.container,(this.ddconfig.baseZIndex||0)+this.config.zIndex.modal),this.wrapper.style.zIndex=String(parseInt(this.container.style.zIndex,10)-1)):this.zIndexForLayering=Vi.generateZIndex("modal",(this.ddconfig.baseZIndex||0)+this.config.zIndex.modal)}onAnimationStart(t){switch(t.toState){case"visible":this.container=t.element,this.wrapper=this.container.parentElement,this.moveOnTop(),this.parent&&this.unbindGlobalListeners(),this.bindGlobalListeners(),this.container?.setAttribute(this.id,""),this.ddconfig.modal!==!1&&this.enableModality(),this.ddconfig.focusOnShow!==!1&&this.focus();break;case"void":this.wrapper&&this.ddconfig.modal!==!1&&Zt(this.wrapper,"p-overlay-mask-leave");break}}onAnimationEnd(t){t.toState==="void"&&(this.parentContent&&this.focus(this.parentContent),this.onContainerDestroy(),this.dialogRef.destroy())}onContainerDestroy(){this.unbindGlobalListeners(),this.container&&this.ddconfig.autoZIndex!==!1&&Vi.clear(this.container),this.zIndexForLayering&&Vi.revertZIndex(this.zIndexForLayering),this.ddconfig.modal!==!1&&this.disableModality(),this.container=null}close(){this.visible=!1,this.cd.markForCheck()}hide(){this.dialogRef&&this.dialogRef.close()}enableModality(){this.ddconfig.dismissableMask&&(this.maskClickListener=this.renderer.listen(this.wrapper,"mousedown",t=>{this.wrapper&&this.wrapper.isSameNode(t.target)&&this.hide()})),this.ddconfig.modal!==!1&&Zt(this.document.body,"p-overflow-hidden")}disableModality(){this.wrapper&&(this.ddconfig.dismissableMask&&this.unbindMaskClickListener(),this.ddconfig.modal!==!1&&Qt(this.document.body,"p-overflow-hidden"),this.cd.destroyed||this.cd.detectChanges())}focus(t=this.contentViewChild.nativeElement){let l=Gn.getFocusableElement(t,"[autofocus]");if(l){this.zone.runOutsideAngular(()=>{setTimeout(()=>l.focus(),5)});return}let c=Gn.getFocusableElement(t);c?this.zone.runOutsideAngular(()=>{setTimeout(()=>c.focus(),5)}):this.footerViewChild?this.focus(this.footerViewChild.nativeElement):!c&&this.headerViewChild&&this.focus(this.headerViewChild.nativeElement)}maximize(){this.maximized=!this.maximized,this.maximized?Zt(this.document.body,"p-overflow-hidden"):Qt(this.document.body,"p-overflow-hidden"),this.dialogRef.maximize({maximized:this.maximized})}initResize(t){this.ddconfig.resizable&&(this.documentResizeListener||this.bindDocumentResizeListeners(),this.resizing=!0,this.lastPageX=t.pageX,this.lastPageY=t.pageY,Zt(this.document.body,"p-unselectable-text"),this.dialogRef.resizeInit(t))}onResize(t){if(this.resizing){let l=t.pageX-this.lastPageX,c=t.pageY-this.lastPageY,_=$n(this.container),A=xn(this.container),L=xn(this.contentViewChild.nativeElement),ge=_+l,_e=A+c,dt=this.container.style.minWidth,a=this.container.style.minHeight,pt=this.container.getBoundingClientRect(),Ut=Jn();(!parseInt(this.container.style.top)||!parseInt(this.container.style.left))&&(ge+=l,_e+=c),(!dt||ge>parseInt(dt))&&pt.left+ge<Ut.width&&(this._style.width=ge+"px",this.container.style.width=this._style.width),(!a||_e>parseInt(a))&&pt.top+_e<Ut.height&&(this.contentViewChild.nativeElement.style.height=L+_e-A+"px",this._style.height&&(this._style.height=_e+"px",this.container.style.height=this._style.height)),this.lastPageX=t.pageX,this.lastPageY=t.pageY}}resizeEnd(t){this.resizing&&(this.resizing=!1,Qt(this.document.body,"p-unselectable-text"),this.dialogRef.resizeEnd(t))}initDrag(t){jn(t.target,"p-dialog-header-icon")||jn(t.target.parentElement,"p-dialog-header-icon")||this.ddconfig.draggable&&(this.dragging=!0,this.lastPageX=t.pageX,this.lastPageY=t.pageY,this.container.style.margin="0",Zt(this.document.body,"p-unselectable-text"),this.dialogRef.dragStart(t))}onDrag(t){if(this.dragging){let l=$n(this.container),c=xn(this.container),_=t.pageX-this.lastPageX,A=t.pageY-this.lastPageY,L=this.container.getBoundingClientRect(),ge=L.left+_,_e=L.top+A,dt=Jn();this.container.style.position="fixed",this.keepInViewport?(ge>=this.minX&&ge+l<dt.width&&(this._style.left=ge+"px",this.lastPageX=t.pageX,this.container.style.left=ge+"px"),_e>=this.minY&&_e+c<dt.height&&(this._style.top=_e+"px",this.lastPageY=t.pageY,this.container.style.top=_e+"px")):(this.lastPageX=t.pageX,this.container.style.left=ge+"px",this.lastPageY=t.pageY,this.container.style.top=_e+"px")}}endDrag(t){this.dragging&&(this.dragging=!1,Qt(this.document.body,"p-unselectable-text"),this.dialogRef.dragEnd(t),this.cd.detectChanges())}resetPosition(){this.container.style.position="",this.container.style.left="",this.container.style.top="",this.container.style.margin=""}bindDocumentDragListener(){Ht(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentDragListener=this.renderer.listen(this.document,"mousemove",this.onDrag.bind(this))})}bindDocumentDragEndListener(){Ht(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentDragEndListener=this.renderer.listen(this.document,"mouseup",this.endDrag.bind(this))})}unbindDocumentDragEndListener(){this.documentDragEndListener&&(this.documentDragEndListener(),this.documentDragListener=null)}unbindDocumentDragListener(){this.documentDragListener&&(this.documentDragListener(),this.documentDragListener=null)}bindDocumentResizeListeners(){Ht(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentResizeListener=this.renderer.listen(this.document,"mousemove",this.onResize.bind(this)),this.documentResizeEndListener=this.renderer.listen(this.document,"mouseup",this.resizeEnd.bind(this))})}unbindDocumentResizeListeners(){this.documentResizeListener&&this.documentResizeEndListener&&(this.documentResizeListener(),this.documentResizeEndListener(),this.documentResizeListener=null,this.documentResizeEndListener=null)}bindGlobalListeners(){this.ddconfig.closeOnEscape!==!1&&this.bindDocumentEscapeListener(),this.ddconfig.resizable&&this.bindDocumentResizeListeners(),this.ddconfig.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener())}unbindGlobalListeners(){this.unbindDocumentEscapeListener(),this.unbindDocumentResizeListeners(),this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener()}bindDocumentEscapeListener(){let t=this.maskViewChild?this.maskViewChild.nativeElement.ownerDocument:"document";this.documentEscapeListener=this.renderer.listen(t,"keydown",l=>{if(l.which==27){let c=Vi.getCurrent();(parseInt(this.container.style.zIndex)==c||this.zIndexForLayering==c)&&this.hide()}})}unbindDocumentEscapeListener(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)}unbindMaskClickListener(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)}ngOnDestroy(){this.onContainerDestroy(),this.componentRef&&this.componentRef.destroy(),this.destroyStyle(),super.ngOnDestroy()}static \u0275fac=function(l){return new(l||n)(zt(ko),zt(Dn),zt(tn),zt(mn),zt(n,12))};static \u0275cmp=Ee({type:n,selectors:[["p-dynamicDialog"],["p-dynamicdialog"],["p-dynamic-dialog"]],viewQuery:function(l,c){if(l&1&&(ut(Da,5),ut(Dl,5),ut(Vl,5),ut(Al,5),ut(Ll,5)),l&2){let _;ue(_=me())&&(c.insertionPoint=_.first),ue(_=me())&&(c.maskViewChild=_.first),ue(_=me())&&(c.contentViewChild=_.first),ue(_=me())&&(c.footerViewChild=_.first),ue(_=me())&&(c.headerViewChild=_.first)}},features:[Ge([Va]),wt],decls:3,vars:9,consts:[["mask",""],["container",""],["content",""],["titlebar",""],["footer",""],[3,"ngStyle","ngClass"],["role","dialog","pFocusTrap","",3,"ngClass","ngStyle","style","class","pFocusTrapDisabled","width","height",4,"ngIf"],["role","dialog","pFocusTrap","",3,"ngClass","ngStyle","pFocusTrapDisabled"],["style","z-index: 90;",3,"ngClass","mousedown",4,"ngIf"],[3,"ngClass","mousedown",4,"ngIf"],[3,"ngClass","ngStyle"],[4,"ngIf"],[4,"ngComponentOutlet"],[3,"ngClass",4,"ngIf"],[2,"z-index","90",3,"mousedown","ngClass"],[3,"mousedown","ngClass"],[3,"ngClass","id"],[3,"ngClass"],["rounded","","text","",3,"styleClass","tabindex","onClick","keydown.enter",4,"ngIf"],["rounded","","text","","severity","secondary",3,"styleClass","ariaLabel","onClick","keydown.enter",4,"ngIf"],["rounded","","text","",3,"onClick","keydown.enter","styleClass","tabindex"],[4,"ngTemplateOutlet"],["rounded","","text","","severity","secondary",3,"onClick","keydown.enter","styleClass","ariaLabel"],["pDynamicDialogContent",""]],template:function(l,c){l&1&&(p(0,"div",5,0),V(2,pc,9,30,"div",6),m()),l&2&&(ct(c.ddconfig.maskStyleClass),y("ngStyle",No(5,Ml,c.position==="left"||c.position==="topleft"||c.position==="bottomleft"?"flex-start":c.position==="right"||c.position==="topright"||c.position==="bottomright"?"flex-end":"center",c.position==="top"||c.position==="topleft"||c.position==="topright"?"flex-start":c.position==="bottom"||c.position==="bottomleft"||c.position==="bottomright"?"flex-end":"center",c.ddconfig.modal?"auto":"none"))("ngClass",c.maskClass),f(2),y("ngIf",c.visible))},dependencies:[Me,Ct,Mo,Xe,Wt,bi,tt,Da,Qo,Yo,Ai,xt,la],encapsulation:2,data:{animation:[Cn("animation",[Oi("void => visible",[Un(hc)]),Oi("visible => void",[Un(gc)])])]}})}return n})(),Vn=(()=>{class n{static \u0275fac=function(l){return new(l||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({imports:[Aa,tt,tt]})}return n})(),oo=class{_parentInjector;_additionalTokens;constructor(h,t){this._parentInjector=h,this._additionalTokens=t}get(h,t,l){let c=this._additionalTokens.get(h);return c||this._parentInjector.get(h,t)}},Hi=(()=>{class n{appRef;injector;document;dialogComponentRefMap=new Map;constructor(t,l,c){this.appRef=t,this.injector=l,this.document=c}open(t,l){if(!this.duplicationPermission(t,l))return null;let c=this.appendDialogComponentToBody(l,t);return this.dialogComponentRefMap.get(c).instance.childComponentType=t,this.dialogComponentRefMap.get(c).instance.inputValues=l.inputValues,c}getInstance(t){return this.dialogComponentRefMap.get(t).instance}appendDialogComponentToBody(t,l){let c=new WeakMap;c.set(Dn,t);let _=new tn;c.set(tn,_);let A=_.onClose.subscribe(()=>{this.dialogComponentRefMap.get(_).instance.close()}),L=_.onDestroy.subscribe(()=>{this.removeDialogComponentFromBody(_),L.unsubscribe(),A.unsubscribe()}),ge=Ao(Aa,{environmentInjector:this.appRef.injector,elementInjector:new oo(this.injector,c)});this.appRef.attachView(ge.hostView);let _e=ge.hostView.rootNodes[0];return!t.appendTo||t.appendTo==="body"?this.document.body.appendChild(_e):Wo(t.appendTo,_e),this.dialogComponentRefMap.set(_,ge),_}removeDialogComponentFromBody(t){if(!t||!this.dialogComponentRefMap.has(t))return;let l=this.dialogComponentRefMap.get(t);this.appRef.detachView(l.hostView),l.destroy(),l.changeDetectorRef.detectChanges(),this.dialogComponentRefMap.delete(t)}duplicationPermission(t,l){if(l.duplicate)return!0;let c=!0;for(let[_,A]of this.dialogComponentRefMap)if(A.instance.childComponentType===t){c=!1;break}return c}static \u0275fac=function(l){return new(l||n)(un(Fo),un(Co),un(Lo))};static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var fc=["*"],vc=({dt:n})=>`
523
- .p-floatlabel {
524
- display: block;
525
- position: relative;
526
- }
527
-
528
- .p-floatlabel label {
529
- position: absolute;
530
- pointer-events: none;
531
- top: 50%;
532
- transform: translateY(-50%);
533
- transition-property: all;
534
- transition-timing-function: ease;
535
- line-height: 1;
536
- font-weight: ${n("floatlabel.font.weight")};
537
- inset-inline-start: ${n("floatlabel.position.x")};
538
- color: ${n("floatlabel.color")};
539
- transition-duration: ${n("floatlabel.transition.duration")};
540
- }
541
-
542
- .p-floatlabel:has(.p-textarea) label {
543
- top: ${n("floatlabel.position.y")};
544
- transform: translateY(0);
545
- }
546
-
547
- .p-floatlabel:has(.p-inputicon:first-child) label {
548
- inset-inline-start: calc((${n("form.field.padding.x")} * 2) + ${n("icon.size")});
549
- }
550
-
551
- .p-floatlabel:has(.ng-invalid.ng-dirty) label {
552
- color: ${n("floatlabel.invalid.color")};
553
- }
554
-
555
- .p-floatlabel:has(input:focus) label,
556
- .p-floatlabel:has(input.p-filled) label,
557
- .p-floatlabel:has(input:-webkit-autofill) label,
558
- .p-floatlabel:has(textarea:focus) label,
559
- .p-floatlabel:has(textarea.p-filled) label,
560
- .p-floatlabel:has(.p-inputwrapper-focus) label,
561
- .p-floatlabel:has(.p-inputwrapper-filled) label {
562
- top: ${n("floatlabel.over.active.top")};
563
- transform: translateY(0);
564
- font-size: ${n("floatlabel.active.font.size")};
565
- font-weight: ${n("floatlabel.label.active.font.weight")};
566
- }
567
-
568
- .p-floatlabel:has(input.p-filled) label,
569
- .p-floatlabel:has(textarea.p-filled) label,
570
- .p-floatlabel:has(.p-inputwrapper-filled) label {
571
- color: ${n("floatlabel.active.color")};
572
- }
573
-
574
- .p-floatlabel:has(input:focus) label,
575
- .p-floatlabel:has(input:-webkit-autofill) label,
576
- .p-floatlabel:has(textarea:focus) label,
577
- .p-floatlabel:has(.p-inputwrapper-focus) label {
578
- color: ${n("floatlabel.focus.color")};
579
- }
580
-
581
- .p-floatlabel-in .p-inputtext,
582
- .p-floatlabel-in .p-textarea,
583
- .p-floatlabel-in .p-select-label,
584
- .p-floatlabel-in .p-multiselect-label-container,
585
- .p-floatlabel-in .p-autocomplete-input-multiple,
586
- .p-floatlabel-in .p-cascadeselect-label,
587
- .p-floatlabel-in .p-treeselect-label {
588
- padding-top: ${n("floatlabel.in.input.padding.top")};
589
- }
590
-
591
- .p-floatlabel-in:has(input:focus) label,
592
- .p-floatlabel-in:has(input.p-filled) label,
593
- .p-floatlabel-in:has(input:-webkit-autofill) label,
594
- .p-floatlabel-in:has(textarea:focus) label,
595
- .p-floatlabel-in:has(textarea.p-filled) label,
596
- .p-floatlabel-in:has(.p-inputwrapper-focus) label,
597
- .p-floatlabel-in:has(.p-inputwrapper-filled) label {
598
- top: ${n("floatlabel.in.active.top")};
599
- }
600
-
601
- .p-floatlabel-on:has(input:focus) label,
602
- .p-floatlabel-on:has(input.p-filled) label,
603
- .p-floatlabel-on:has(input:-webkit-autofill) label,
604
- .p-floatlabel-on:has(textarea:focus) label,
605
- .p-floatlabel-on:has(textarea.p-filled) label,
606
- .p-floatlabel-on:has(.p-inputwrapper-focus) label,
607
- .p-floatlabel-on:has(.p-inputwrapper-filled) label {
608
- top: 0;
609
- transform: translateY(-50%);
610
- border-radius: ${n("floatlabel.on.border.radius")};
611
- background: ${n("floatlabel.on.active.background")};
612
- padding: ${n("floatlabel.on.active.padding")};
613
- }
614
- `,yc={root:({instance:n,props:h})=>["p-floatlabel",{"p-floatlabel-over":h.variant==="over","p-floatlabel-on":h.variant==="on","p-floatlabel-in":h.variant==="in"}]},La=(()=>{class n extends Yt{name="floatlabel";theme=vc;classes=yc;static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var _c=(()=>{class n extends Nt{_componentStyle=K(La);variant="over";static \u0275fac=(()=>{let t;return function(c){return(t||(t=Qe(n)))(c||n)}})();static \u0275cmp=Ee({type:n,selectors:[["p-floatlabel"],["p-floatLabel"],["p-float-label"]],hostVars:8,hostBindings:function(l,c){l&2&&Oo("p-floatlabel",!0)("p-floatlabel-over",c.variant==="over")("p-floatlabel-on",c.variant==="on")("p-floatlabel-in",c.variant==="in")},inputs:{variant:"variant"},features:[Ge([La]),wt],ngContentSelectors:fc,decls:1,vars:0,template:function(l,c){l&1&&(pn(),hn(0))},dependencies:[Me,tt],encapsulation:2,changeDetection:0})}return n})(),Ma=(()=>{class n{static \u0275fac=function(l){return new(l||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({imports:[_c,tt,tt]})}return n})();var An=()=>[],Ln=(()=>{class n{static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Ee({type:n,selectors:[["app-dialog-create-customer-supplier"]],decls:66,vars:8,consts:[[1,"row","row-gap-2"],[1,"col-12"],[1,"form-group","d-flex","flex-column"],["for",""],["appendTo","body","optionLabel","name","placeholder","Select a City",1,"w-full","md:w-56",3,"options"],[1,"col-12","col-lg-4"],["pInputText","","autocomplete","off",1,"w-100"],["rows","1","cols","30","pTextarea",""],[1,"col-12","col-lg-6"]],template:function(l,c){l&1&&(p(0,"div",0)(1,"div",1)(2,"div",2)(3,"label",3),x(4,"Customer / Supplier"),m(),N(5,"p-select",4),m()(),p(6,"div",5)(7,"div",2)(8,"label",3),x(9,"Title"),m(),N(10,"input",6),m()(),p(11,"div",5)(12,"div",2)(13,"label",3),x(14,"First Name"),m(),N(15,"input",6),m()(),p(16,"div",5)(17,"div",2)(18,"label",3),x(19,"Last Name"),m(),N(20,"input",6),m()(),p(21,"div",5)(22,"div",2)(23,"label",3),x(24,"Mobile"),m(),N(25,"input",6),m()(),p(26,"div",5)(27,"div",2)(28,"label",3),x(29,"Email"),m(),N(30,"input",6),m()(),p(31,"div",5)(32,"div",2)(33,"label",3),x(34,"Identification"),m(),N(35,"input",6),m()(),p(36,"div",1)(37,"div",2)(38,"label",3),x(39,"Birthday"),m(),N(40,"input",6),m()(),p(41,"div",1)(42,"div",2)(43,"label",3),x(44,"Title"),m(),N(45,"textarea",7),m()(),p(46,"div",8)(47,"div",2)(48,"label",3),x(49,"City"),m(),N(50,"p-select",4),m()(),p(51,"div",8)(52,"div",2)(53,"label",3),x(54,"Nationality"),m(),N(55,"p-select",4),m()(),p(56,"div",8)(57,"div",2)(58,"label",3),x(59,"Gender"),m(),N(60,"p-select",4),m()(),p(61,"div",8)(62,"div",2)(63,"label",3),x(64,"Member Code"),m(),N(65,"textarea",7),m()()()),l&2&&(f(5),y("options",Te(4,An)),f(45),y("options",Te(5,An)),f(5),y("options",Te(6,An)),f(5),y("options",Te(7,An)))},dependencies:[ai,oi,ei,Xt,Ma,ni,ii],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var za=ui(so());var Sc=["class","page"],wc=()=>({width:"25rem"}),Cc=()=>({height:"calc(100vh - 100px)"}),nn=n=>({"ng-invalid ng-dirty":n}),xc=()=>({"min-width":"50rem"}),Ra=()=>({}),Ba=n=>({"text-danger":n});function Ec(n,h){if(n&1){let t=q();p(0,"button",9),G("click",function(){R(t);let c=P();return B(c.onSubmitJournalEntry())}),x(1," Submit "),m()}}function Pc(n,h){if(n&1&&(p(0,"div",23),N(1,"p-radiobutton",35),p(2,"label",36),x(3),m()()),n&2){let t=h.$implicit;f(),y("value",t.key),f(2),ae(t.value)}}function kc(n,h){n&1&&(p(0,"tr")(1,"th",37),x(2,"Account"),m(),p(3,"th",38),x(4,"Debit"),m(),p(5,"th",38),x(6,"Credit"),m(),p(7,"th",37),x(8,"Note"),m(),N(9,"th"),m())}function Tc(n,h){if(n&1){let t=q();p(0,"tr",39)(1,"td"),N(2,"p-select",40),m(),p(3,"td"),N(4,"input",41),m(),p(5,"td"),N(6,"input",42),m(),p(7,"td"),N(8,"textarea",43),m(),p(9,"td")(10,"p-button",44),G("onClick",function(){let c=R(t).rowIndex,_=P(3);return B(_.removeItems(c))}),m()()()}if(n&2){let t=h.rowIndex,l=P(3);y("formGroupName",t),f(2),y("options",l.journalEntryForm().options.accounts)("virtualScrollItemSize",50),f(2),y("autoNumeric",Te(5,Ra)),f(2),y("autoNumeric",Te(6,Ra))}}function Fc(n,h){if(n&1){let t=q();p(0,"tr")(1,"td")(2,"div",45)(3,"div",46)(4,"p-button",47),G("onClick",function(){R(t);let c=P(3);return B(c.addItems())}),m()(),p(5,"span",48),x(6,"Total"),m()()(),p(7,"td",49),x(8),Ae(9,"number"),m(),p(10,"td",49),x(11),Ae(12,"number"),m(),N(13,"td",50),m()}if(n&2){let t=P(3);f(7),y("ngClass",Pe(8,Ba,t.subTotalCredit()!==t.subTotalDebit())),f(),ot(" ",Ke(9,4,t.subTotalDebit())," "),f(2),y("ngClass",Pe(10,Ba,t.subTotalCredit()!==t.subTotalDebit())),f(),ot(" ",Ke(12,6,t.subTotalCredit())," ")}}function Oc(n,h){if(n&1){let t=q();p(0,"div",11)(1,"p-panel")(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"label",16),x(7,"Outlets"),m(),N(8,"p-select",17),m(),p(9,"div",15)(10,"label",16),x(11,"Date"),m(),N(12,"p-datepicker",18),m(),p(13,"div",15)(14,"label",16),x(15,"Number"),m(),N(16,"input",19),m(),p(17,"div",15)(18,"label",16),x(19),m(),p(20,"div",20)(21,"p-autocomplete",21),G("completeMethod",function(c){R(t);let _=P(2);return B(_.searchCustomer(c))}),m()()(),p(22,"div",15)(23,"label",16),x(24,"Contact"),m(),p(25,"div",22),yt(26,Pc,4,2,"div",23,Tt),m()()()()(),N(28,"hr"),p(29,"div",24)(30,"div",13)(31,"p-table",25),V(32,kc,10,0,"ng-template",null,3,Z)(34,Tc,11,7,"ng-template",null,4,Z)(36,Fc,14,12,"ng-template",null,2,Z),m()()(),N(38,"hr"),p(39,"div",12)(40,"div",13)(41,"div",26)(42,"div",27)(43,"div",28)(44,"label",16),x(45,"Document"),m(),N(46,"p-select",29),m()(),p(47,"div",27)(48,"div",28)(49,"label",16),x(50,"Type"),m(),N(51,"p-select",30),m()(),p(52,"div",27)(53,"div",28)(54,"label",16),x(55,"Number"),m(),N(56,"input",31),m()(),p(57,"div",27)(58,"div",28)(59,"label",16),x(60,"ID"),m(),N(61,"input",32),m()(),p(62,"div",27)(63,"div",28)(64,"label",16),x(65,"Note"),m(),N(66,"textarea",33),m()(),p(67,"div",27)(68,"div",28)(69,"label",16),x(70,"Upload"),m(),p(71,"p-fileupload",34,5),G("onSelect",function(c){R(t);let _=P(2);return B(_.onUpload(c))}),m()()()()()()()()}if(n&2){let t=P(2);y("formGroup",t.form),f(8),y("options",t.outlets()),f(4),y("showIcon",!0)("ngClass",Pe(15,nn,t.form.controls.order.controls.date.invalid&&(t.form.controls.order.controls.date.dirty||t.form.controls.order.controls.date.touched))),f(4),y("ngClass",Pe(17,nn,t.form.controls.order.controls.number.invalid&&(t.form.controls.order.controls.number.dirty||t.form.controls.order.controls.number.touched))),f(3),ae(+t.form.controls.order.controls.contactType.value==0?"Customer":"Supplier"),f(2),y("suggestions",t.customerSuggestions())("placeholder",+t.form.controls.order.controls.contactType.value==0?"Search Customer":"Search Supplier"),f(5),_t(t.contactType()),f(5),y("value",t.form.controls.items.controls)("tableStyle",Te(19,xc)),f(15),y("ngClass",Pe(20,nn,t.form.controls.order.controls.entryTypeID.invalid&&(t.form.controls.order.controls.entryTypeID.dirty||t.form.controls.order.controls.entryTypeID.touched)))("options",t.journalEntryForm().options.entryTypes),f(5),y("ngClass",Pe(22,nn,t.form.controls.order.controls.referenceTypeID.invalid&&(t.form.controls.order.controls.referenceTypeID.dirty||t.form.controls.order.controls.referenceTypeID.touched)))("options",t.journalEntryForm().options.referenceTypes),f(15),y("ngClass",Pe(24,nn,t.form.controls.order.controls.note.invalid&&(t.form.controls.order.controls.note.dirty||t.form.controls.order.controls.note.touched)))}}function Ic(n,h){if(n&1&&(p(0,"p-scroll-panel"),V(1,Oc,73,26,"div",10),m()),n&2){let t=P();vt(Te(3,Cc)),f(),y("ngIf",t.journalEntryForm())}}function Nc(n,h){if(n&1){let t=q();p(0,"p-button",51),G("click",function(){R(t);let c=P();return B(c.uploadDialogVisible.set(!1))}),m(),p(1,"p-button",52),G("click",function(){R(t);let c=P();return B(c.uploadDialogVisible.set(!1))}),m()}n&2&&y("text",!0)}var co=(()=>{class n{constructor(){this.fileAttachment=Ne(new File([],"")),this.activatedRoute=K(qt),this.journalEntryService=K(We),this.journalEntryForm=Ne(null),this.customerSuggestions=Ne([]),this.itemsForm=Ne([]),this.subTotalDebit=at(()=>this.itemsForm().reduce((t,l)=>t+ +l.debitAmount,0)),this.subTotalCredit=at(()=>this.itemsForm().reduce((t,l)=>t+ +l.creditAmount,0)),this.contactType=Ne([{key:0,value:"Customer"},{key:1,value:"Supplier"}]),this.dialogService=K(Hi),this.uploadDialogVisible=Ne(!1),this.messageService=K(Ni),this.outlets=at(()=>this.journalEntryForm()?.options?.outlets||[]),this.toasr=K(Ii),this.initializeFormEffect()}toggleDialog(){this.dialogService.open(Ln,{header:"Create Customer/Supplier",width:"40vw",footer:"submit",closable:!0,dismissableMask:!0,modal:!0,showHeader:!0})}ngOnInit(){this.initializeForm(),this.loadJournalEntryForm(),setInterval(()=>{this.subTotalCredit()!==this.subTotalDebit()&&this.messageService.add({severity:"warn",summary:"Mismatch Detected",detail:`The total Debit and Credit amounts are not balanced. Difference: ${this.subTotalCredit()-this.subTotalDebit()}`})},1e3)}onToggleUploadDialog(){this.uploadDialogVisible.update(t=>!t)}onUploadDialog(t){console.log(t),za.default.parse(t.currentFiles[0],{complete:l=>{console.log("Parsed result:",l)},error:l=>{console.error("Parsing error:",l)}})}initializeForm(){this.form=new Ot({order:new Ot({id:new M("",[et.required]),number:new M("",[et.required]),date:new M({value:new Date,disabled:!0},[et.required]),note:new M(""),entryTypeID:new M(1,[et.required]),referenceID:new M(""),referenceTypeID:new M(0,[et.required]),referenceText:new M(""),contactID:new M(""),detailReferenceID:new M(""),creatorID:new M("",[et.required]),created:new M("",[et.required]),modifierID:new M(""),modified:new M(""),entityID:new M(""),statusID:new M(0),contactName:new M(""),contactType:new M(0)}),items:new _n([]),additionalAccountID:new M(""),file:new M(null)})}initializeFormEffect(){fn(()=>{let t=this.journalEntryForm();t&&(this.form.patchValue({order:xe(pe({},t.form.order),{entryTypeID:Number(t.form.order.entryTypeID===0&&1),referenceID:String(t.form.order.referenceID||Ie),contactID:String(t.form.order.contactID||""),detailReferenceID:String(t.form.order.detailReferenceID||Ie),contactName:String(t.form.order.contactName),date:lo.default.isDayjs(t.form.order.date)?t.form.order.date.toDate():(0,lo.default)().toDate(),modifierID:String(t.form.order.modifierID||Ie),statusID:t.form.order.statusID,modified:String(t.form.order.modified),entityID:String(t.form.order.entityID||Ie)}),additionalAccountID:t.form.additionalAccountID}),this.updateFormItems(t.form.items),this.form.controls.items.touched||this.itemsForm.set(this.form.controls.items.value),this.form.controls.items.valueChanges.subscribe(l=>{this.itemsForm.set(l)}))})}updateFormItems(t){let l=this.form.controls.items;l.clear(),t.forEach(c=>{l.push(new Ot({id:new M(c.id),journalID:new M(c.journalID),accountID:new M(c.accountID),debitAmount:new M(c.debitAmount),creditAmount:new M(c.creditAmount),index:new M(c.index),note:new M(c.note)}))})}loadJournalEntryForm(){this.activatedRoute.data.pipe(Pt(t=>t.form),ke(t=>this.journalEntryForm.set(t))).subscribe()}searchCustomer(t){switch(+this.form.controls.order.value.contactType){case 0:this.journalEntryService.getJournalEntryCustomerSuggestions(t.query).pipe(ke(l=>this.customerSuggestions.set(l))).subscribe();break;case 1:this.journalEntryService.getJournalEntrySupplierSuggestions(t.query).pipe(ke(l=>this.customerSuggestions.set(l))).subscribe();break;default:console.error("Invalid contact type");break}}addItems(){this.form.controls.items.push(new Ot({id:new M(Ie.toString()),journalID:new M(Ie.toString()),accountID:new M(Ie.toString()),debitAmount:new M(0),creditAmount:new M(0),index:new M(this.form.controls.items.length??0),note:new M("")}))}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let t=this.getCleanedFormValue();console.log("cleanedFormValue",t);let l=this.buildFormData(t);this.journalEntryService.submitJournalEntry(l).pipe($e("response"),ke(()=>this.form.controls.order.controls.date.disable()),fi(c=>gi(()=>c)),$e("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let t=this.form.getRawValue(),l=Object.entries(t).reduce((c,[_,A])=>(_==="items"?c[_]=A.map(L=>xe(pe({},L),{debitAmount:+L.debitAmount,creditAmount:+L.creditAmount})):_==="order"?c[_]=xe(pe({},A),{contactID:A.contactID||Ie}):c[_]=A,c),{});return JSON.parse(JSON.stringify(l,(c,_)=>_==="null"?null:_))}buildFormData(t){let l=new FormData;return l.append("Data",JSON.stringify(t)),l.append("File",this.fileAttachment()),l}onUpload(t){console.log(t),this.fileAttachment.set(t.currentFiles[0])}removeItems(t){this.form.controls.items.removeAt(t)}onSwap(){let t=this.form.controls.items.value.map(l=>({id:l.id??"",journalID:l.journalID??"",accountID:l.accountID??"",debitAmount:l.creditAmount,creditAmount:l.debitAmount,index:l.index??0,note:l.note??""}));this.form.controls.items.setValue(t)}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Ee({type:n,selectors:[["app-journal-entry-form",8,"page"]],features:[Ge([Hi,Ni])],attrs:Sc,decls:10,vars:5,consts:[["actionButton",""],["content",""],["footer",""],["header",""],["body",""],["fu",""],["pageTitle",`Manual Journal Form
615
- `],["header","Upload",3,"modal","visible"],["mode","basic","chooseLabel","Choose","chooseIcon","pi pi-upload",3,"onSelect"],["type","button",1,"btn","btn-primary","rounded",3,"click"],["class","d-flex flex-column row-gap-4",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],["formGroupName","order",1,"row"],[1,"col"],[1,"row"],[1,"col","d-flex","flex-column"],["for",""],["size","small","formControlName","entityID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",1,"w-full",3,"options"],["styleClass","w-100","dataType","string","dateFormat","mm-dd-yy","size","small","formControlName","date",3,"showIcon","ngClass"],["pSize","small","type","text","pInputText","","formControlName","number","placeholder","Enter Number",3,"ngClass"],[1,"d-flex","align-items-center","gap-2"],["size","small","styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"w-100",3,"completeMethod","suggestions","placeholder"],[1,"d-flex","align-items-center","gap-2",2,"height","100%","min-height","43px"],[1,"d-flex","items-center","gap-2"],["formArrayName","items",1,"row"],["showGridlines","",3,"value","tableStyle"],[1,"row","gap-3"],[1,"col","col-lg-4"],[1,"form-group","d-flex","flex-column"],["formControlName","selectedCity","formControlName","entryTypeID","optionLabel","value","optionValue","key",3,"ngClass","options"],["formControlName","referenceTypeID","optionLabel","value","optionValue","key",3,"ngClass","options"],["pSize","small","type","text","formControlName","referenceText","pInputText","","placeholder","Enter Number"],["pSize","small","type","text","pInputText","","formControlName","referenceID"],["rows","1","cols","30","pTextarea","","formControlName","note","placeholder","Enter Note",1,"w-100",3,"ngClass"],["styleClass","justify-content-start","mode","basic","chooseLabel","Choose","chooseIcon","fa-solid fa-upload","maxFileSize","1000000",3,"onSelect"],["formControlName","contactType","name","contactType","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],[2,"width","25%"],[1,"text-end",2,"width","25%"],[3,"formGroupName"],["appendTo","body","size","small","formControlName","accountID","virtualScroll","","optionLabel","name","optionValue","id","placeholder","Select an account","styleClass","w-100","showClear","",3,"options","virtualScrollItemSize"],["pSize","small","formControlName","debitAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],["pSize","small","formControlName","creditAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],["rows","1","cols","30","pTextarea","","formControlName","note",1,"w-100"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick"],[1,"d-flex","justify-content-between","align-items-center"],[1,"d-flex","gap-2"],["icon","fa-light fa-plus","size","small","label","Add",3,"onClick"],[2,"vertical-align","middle"],[1,"text-end",3,"ngClass"],["colspan","2"],["label","Cancel","severity","secondary",3,"click","text"],["label","OK(F2)","severity","primary",3,"click"]],template:function(l,c){if(l&1){let _=q();p(0,"app-main-panel",6),V(1,Ec,2,0,"ng-template",null,0,Z)(3,Ic,2,4,"ng-template",null,1,Z),m(),p(5,"p-dialog",7)(6,"p-fileupload",8),G("onSelect",function(L){return R(_),B(c.onUploadDialog(L))}),m(),V(7,Nc,2,1,"ng-template",null,2,Z),m(),N(9,"p-toast")}l&2&&(f(5),vt(Te(4,wc)),y("modal",!0)("visible",c.uploadDialogVisible()))},dependencies:[Ti,Si,wi,Ci,xi,ki,Ei,Pi,Et,Me,Ct,Xe,Ft,ni,ii,zi,Bi,ei,Xt,$i,Ji,Fn,Tn,At,Vt,ti,xt,Dt,En,Pn,ai,oi,Vn,Wi,di,Ri,Mi,Ki,In,ta,ea,ji,Ui],encapsulation:2})}}return n})();var uo=n=>{let h=K(We),t=K(Gi);return t.show(),console.log("journalEntryResolver",n),h.getJournalEntryForm(n.paramMap.get("id")??"").pipe($e("response"),ke(()=>t.hide()))};var Dc=()=>["edit"],Vc=()=>["/report/general-ledger"],Ac=n=>({id:n});function Lc(n,h){n&1&&(p(0,"tr")(1,"th",15),x(2,"Code"),m(),p(3,"th"),x(4,"Account"),m(),p(5,"th",15),x(6,"Debit"),m(),p(7,"th",15),x(8,"Credit"),m()())}function Mc(n,h){if(n&1&&(p(0,"tr")(1,"td")(2,"a",16),x(3),m()(),p(4,"td"),x(5),m(),p(6,"td"),x(7),Ae(8,"number"),m(),p(9,"td"),x(10),Ae(11,"number"),m()()),n&2){let t=h.$implicit;f(2),y("routerLink",Te(10,Vc))("queryParams",Pe(11,Ac,t.accountID)),f(),ae(t.accountCode),f(2),ae(t.accountName),f(2),ae(Ke(8,6,t.debitAmount)),f(3),ae(Ke(11,8,t.creditAmount))}}function Rc(n,h){if(n&1&&(p(0,"tr")(1,"td",17),x(2,"Total"),m(),p(3,"td"),x(4),Ae(5,"number"),m(),p(6,"td"),x(7),Ae(8,"number"),m()()),n&2){let t=P(2);f(4),ae(Ke(5,2,t.totalDebitAmount())),f(3),ae(Ke(8,4,t.totalCreditAmount()))}}function Bc(n,h){if(n&1&&(p(0,"app-main-panel",3),Ue(1,4),p(2,"a",5),x(3," Edit "),m(),p(4,"button",6),x(5,"Delete"),m(),je(),Ue(6,7),p(7,"div",8)(8,"div",9)(9,"p-card",10)(10,"div",11)(11,"div",12)(12,"div",11)(13,"div",13),x(14,"Date"),m(),p(15,"div",12),x(16),Ae(17,"date"),m()(),N(18,"hr"),p(19,"div",11)(20,"div",13),x(21,"Number"),m(),p(22,"div",12),x(23),m()(),N(24,"hr"),p(25,"div",11)(26,"div",13),x(27,"Outlet"),m(),p(28,"div",12),x(29),m()()(),p(30,"div",12)(31,"div",11)(32,"div",13),x(33,"Date"),m(),p(34,"div",12),x(35),Ae(36,"date"),m()(),N(37,"hr"),p(38,"div",11)(39,"div",13),x(40,"Number"),m(),p(41,"div",12),x(42),m()(),N(43,"hr"),p(44,"div",11)(45,"div",13),x(46,"Outlet"),m(),p(47,"div",12),x(48),m()()()()()(),p(49,"div",12)(50,"p-card")(51,"p-table",14),V(52,Lc,9,0,"ng-template",null,0,Z)(54,Mc,12,13,"ng-template",null,1,Z)(56,Rc,9,6,"ng-template",null,2,Z),m()()()(),je(),m()),n&2){let t=P();y("pageTitle","Journal #"+t.journalEntryInfo().order.number),f(2),y("routerLink",Te(15,Dc)),f(14),ot(" ",Qi(17,9,t.journalEntryInfo().order.date,"dd mmm yy")," "),f(7),ae(t.journalEntryInfo().order.number),f(6),ae(t.journalEntryInfo().order.outletID),f(6),ot(" ",Qi(36,12,t.journalEntryInfo().order.date,"dd mmm yy")," "),f(7),ae(t.journalEntryInfo().order.number),f(6),ae(t.journalEntryInfo().order.outletID),f(3),y("value",t.journalEntryInfo().items)}}var Ua=(()=>{class n{constructor(){this.journalEntryService=K(We),this.route=K(qt),this.journalEntryInfo=Ne(null),this.totalDebitAmount=at(()=>this.journalEntryInfo()?.items?.reduce((l,c)=>l+c.debitAmount,0)||0),this.totalCreditAmount=at(()=>this.journalEntryInfo()?.items?.reduce((l,c)=>l+c.creditAmount,0)||0)}ngOnInit(){this.route.paramMap.pipe(cn(t=>t.has("id")),Pt(t=>t.get("id")),Zi(t=>this.journalEntryService.getJournalEntryInfo(t)),ke(t=>this.journalEntryInfo.set(t)),$e("response")).subscribe()}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Ee({type:n,selectors:[["app-journal-entry-info"]],decls:1,vars:1,consts:[["header",""],["body",""],["footer",""],[3,"pageTitle"],["ngProjectAs","action-button",5,["action-button"]],[1,"btn","btn-secondary","rounded",3,"routerLink"],[1,"btn","btn-danger","rounded"],["ngProjectAs","content",5,["content"]],[1,"row","row-gap-4"],[1,"col-12"],["header","Details"],[1,"row"],[1,"col"],[1,"col-2"],[3,"value"],[2,"width","10%"],[1,"link","link-primary",3,"routerLink","queryParams"],["colspan","2",1,"text-end"]],template:function(l,c){l&1&&V(0,Bc,58,16,"app-main-panel",3),l&2&&Le(c.journalEntryInfo()?0:-1)},dependencies:[Et,Me,Ft,vn,Dt,kn,At,Vt,Sn,bn],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var ja=n=>{let h=K(We),t=K(Gi);return t.show(),console.log("journalEntryResolver",n),h.getJournalRecordExpenseLoader().pipe($e("response"),ke(()=>t.hide()))};var po=ui(On());var Ja=ui(so());var zc=()=>({width:"25rem"}),mo=n=>({"ng-invalid ng-dirty":n}),Uc=()=>({"min-width":"50rem"}),jc=()=>({});function Jc(n,h){if(n&1){let t=q();p(0,"button",9),G("click",function(){R(t);let c=P();return B(c.onSubmitJournalEntry())}),x(1," Submit "),m()}}function $c(n,h){if(n&1&&(p(0,"div",23),N(1,"p-radiobutton",32),p(2,"label",33),x(3),m()()),n&2){let t=h.$implicit;f(),y("value",t.key),f(2),ae(t.value)}}function Gc(n,h){n&1&&(p(0,"tr")(1,"th",34),x(2,"Account"),m(),p(3,"th",35),x(4,"Amount"),m(),p(5,"th"),x(6,"Note"),m(),N(7,"th",36),m())}function Kc(n,h){if(n&1){let t=q();p(0,"tr",37)(1,"td"),N(2,"p-select",38),m(),p(3,"td"),N(4,"input",39),m(),p(5,"td"),N(6,"textarea",40),m(),p(7,"td")(8,"div",41)(9,"p-button",42),G("onClick",function(){let c=R(t).rowIndex,_=P(3);return B(_.removeItems(c))}),m()()()()}if(n&2){let t=h.rowIndex,l=P(3);y("formGroupName",t),f(2),y("options",l.JournalExpenseRecord().options.accounts)("virtualScrollItemSize",50),f(2),y("autoNumeric",Te(5,jc)),f(2),y("autoResize",!0)}}function Wc(n,h){if(n&1){let t=q();p(0,"tr")(1,"td")(2,"div",43)(3,"div",44)(4,"p-button",45),G("onClick",function(){R(t);let c=P(3);return B(c.addItems())}),m()(),p(5,"span",46),x(6,"Total"),m()()(),p(7,"td",47),x(8),Ae(9,"number"),m(),N(10,"td",48),m()}if(n&2){let t=P(3);f(8),ot(" ",Ke(9,1,t.subTotalDebit())," ")}}function Hc(n,h){if(n&1){let t=q();p(0,"div",11)(1,"p-panel")(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"label",16),x(7,"Outlets"),m(),N(8,"p-select",17),m(),p(9,"div",15)(10,"label",16),x(11,"Date"),m(),N(12,"p-datepicker",18),m(),p(13,"div",15)(14,"label",16),x(15,"Number"),m(),N(16,"input",19),m(),p(17,"div",15)(18,"label",16),x(19),m(),p(20,"div",20)(21,"p-autocomplete",21),G("completeMethod",function(c){R(t);let _=P(2);return B(_.searchCustomer(c))}),m()()(),p(22,"div",15)(23,"label",16),x(24,"Contact"),m(),p(25,"div",22),yt(26,$c,4,2,"div",23,Tt),m()(),p(28,"div",15)(29,"label",16),x(30,"Payments"),m(),N(31,"p-select",24),m()()()(),N(32,"hr"),p(33,"div",25)(34,"div",13)(35,"p-table",26),V(36,Gc,8,0,"ng-template",null,3,Z)(38,Kc,10,6,"ng-template",null,4,Z)(40,Wc,11,3,"ng-template",null,2,Z),m()()(),N(42,"hr"),p(43,"div",12)(44,"div",13)(45,"div",27)(46,"div",28)(47,"div",29)(48,"label",16),x(49,"Note"),m(),N(50,"textarea",30),m()(),p(51,"div",28)(52,"div",29)(53,"label",16),x(54,"Upload"),m(),p(55,"p-fileupload",31,5),G("onSelect",function(c){R(t);let _=P(2);return B(_.onUpload(c))}),m()()()()()()()()}if(n&2){let t=P(2);y("formGroup",t.form),f(8),y("options",t.outlets()),f(4),y("showIcon",!0)("ngClass",Pe(13,mo,t.form.controls.order.controls.date.invalid&&(t.form.controls.order.controls.date.dirty||t.form.controls.order.controls.date.touched))),f(4),y("ngClass",Pe(15,mo,t.form.controls.order.controls.number.invalid&&(t.form.controls.order.controls.number.dirty||t.form.controls.order.controls.number.touched))),f(3),ae(+t.form.controls.order.controls.contactType.value==0?"Customer":"Supplier"),f(2),y("suggestions",t.customerSuggestions())("placeholder",+t.form.controls.order.controls.contactType.value==0?"Search Customer":"Search Supplier"),f(5),_t(t.contactType()),f(5),y("options",t.JournalExpenseRecord().options.paymentAccounts),f(4),y("value",t.form.controls.items.controls)("tableStyle",Te(17,Uc)),f(15),y("autoResize",!0)("ngClass",Pe(18,mo,t.form.controls.order.controls.note.invalid&&(t.form.controls.order.controls.note.dirty||t.form.controls.order.controls.note.touched)))}}function qc(n,h){if(n&1&&V(0,Hc,57,20,"div",10),n&2){let t=P();y("ngIf",t.JournalExpenseRecord())}}function Zc(n,h){if(n&1){let t=q();p(0,"p-button",49),G("click",function(){R(t);let c=P();return B(c.uploadDialogVisible.set(!1))}),m(),p(1,"p-button",50),G("click",function(){R(t);let c=P();return B(c.uploadDialogVisible.set(!1))}),m()}n&2&&y("text",!0)}var $a=(()=>{class n{constructor(){this.fileAttachment=Ne(new File([],"")),this.activatedRoute=K(qt),this.journalEntryService=K(We),this.JournalExpenseRecord=Ne(null),this.customerSuggestions=Ne([]),this.itemsForm=Ne([]),this.subTotalDebit=at(()=>this.itemsForm().reduce((t,l)=>t+ +l.debitAmount,0)),this.subTotalCredit=at(()=>this.itemsForm().reduce((t,l)=>t+ +l.creditAmount,0)),this.contactType=Ne([{key:0,value:"Customer"},{key:1,value:"Supplier"}]),this.dialogService=K(Hi),this.uploadDialogVisible=Ne(!1),this.messageService=K(Ni),this.outlets=at(()=>this.JournalExpenseRecord()?.options?.entities||[]),this.toasr=K(Ii),this.initializeFormEffect()}toggleDialog(){this.dialogService.open(Ln,{header:"Create Customer/Supplier",width:"40vw",footer:"submit",closable:!0,dismissableMask:!0,modal:!0,showHeader:!0})}ngOnInit(){this.initializeForm(),this.loadJournalExpenseRecord()}onToggleUploadDialog(){this.uploadDialogVisible.update(t=>!t)}onUploadDialog(t){console.log(t),Ja.default.parse(t.currentFiles[0],{complete:l=>{console.log("Parsed result:",l)},error:l=>{console.error("Parsing error:",l)}})}initializeForm(){this.form=new Ot({order:new Ot({id:new M("",[et.required]),number:new M("",[et.required]),date:new M({value:new Date,disabled:!0},[et.required]),note:new M(""),entryTypeID:new M(1,[et.required]),referenceID:new M(""),referenceTypeID:new M(0,[et.required]),referenceText:new M(""),contactID:new M(""),detailReferenceID:new M(""),creatorID:new M("",[et.required]),created:new M("",[et.required]),modifierID:new M(""),modified:new M(""),entityID:new M(""),statusID:new M(0),contactName:new M(""),contactType:new M(0)}),items:new _n([]),additionalAccountID:new M(""),file:new M(null)})}initializeFormEffect(){fn(()=>{let t=this.JournalExpenseRecord();t&&(this.form.patchValue({order:xe(pe({},t.form.order),{entryTypeID:Number(t.form.order.entryTypeID===0&&1),referenceID:String(t.form.order.referenceID||Ie),contactID:String(t.form.order.contactID||""),detailReferenceID:String(t.form.order.detailReferenceID||Ie),contactName:String(t.form.order.contactName),date:po.default.isDayjs(t.form.order.date)?t.form.order.date.toDate():(0,po.default)().toDate(),modifierID:String(t.form.order.modifierID||Ie),statusID:+t.form.order.statusID,modified:String(t.form.order.modified),entityID:String(t.form.order.entityID||Ie)}),additionalAccountID:t.form.additionalAccountID}),this.updateFormItems(t.form.items),this.form.controls.items.touched||this.itemsForm.set(this.form.controls.items.value),this.form.controls.items.valueChanges.subscribe(l=>{this.itemsForm.set(l)}))})}updateFormItems(t){let l=this.form.controls.items;l.clear(),t.forEach(c=>{l.push(new Ot({id:new M(c.id),journalID:new M(c.journalID),accountID:new M(c.accountID),debitAmount:new M(c.debitAmount),creditAmount:new M(c.creditAmount),index:new M(c.index),note:new M(c.note)}))})}loadJournalExpenseRecord(){this.activatedRoute.data.pipe(Pt(t=>t.form),ke(t=>this.JournalExpenseRecord.set(t))).subscribe()}searchCustomer(t){switch(+this.form.controls.order.value.contactType){case 0:this.journalEntryService.getJournalEntryCustomerSuggestions(t.query).pipe(ke(l=>this.customerSuggestions.set(l))).subscribe();break;case 1:this.journalEntryService.getJournalEntrySupplierSuggestions(t.query).pipe(ke(l=>this.customerSuggestions.set(l))).subscribe();break;default:console.error("Invalid contact type");break}}addItems(){this.form.controls.items.push(new Ot({id:new M(Ie.toString()),journalID:new M(Ie.toString()),accountID:new M(Ie.toString()),debitAmount:new M(0),creditAmount:new M(0),index:new M(this.form.controls.items.length??0),note:new M("")}))}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let t=this.getCleanedFormValue();console.log("cleanedFormValue",t);let l=this.buildFormData(t);this.journalEntryService.submitJournalEntry(l).pipe($e("response"),ke(()=>this.form.controls.order.controls.date.disable()),fi(c=>gi(()=>c)),$e("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let t=this.form.getRawValue(),l=Object.entries(t).reduce((c,[_,A])=>(_==="items"?c[_]=A.map(L=>xe(pe({},L),{debitAmount:+L.debitAmount,creditAmount:+L.creditAmount})):_==="order"?c[_]=xe(pe({},A),{contactID:A.contactID||Ie}):c[_]=A,c),{});return JSON.parse(JSON.stringify(l,(c,_)=>_==="null"?null:_))}buildFormData(t){let l=new FormData;return l.append("Data",JSON.stringify(t)),l.append("File",this.fileAttachment()),l}onUpload(t){console.log(t),this.fileAttachment.set(t.currentFiles[0])}removeItems(t){this.form.controls.items.removeAt(t)}onSwap(){let t=this.form.controls.items.value.map(l=>({id:l.id??"",journalID:l.journalID??"",accountID:l.accountID??"",debitAmount:l.creditAmount,creditAmount:l.debitAmount,index:l.index??0,note:l.note??""}));this.form.controls.items.setValue(t)}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Ee({type:n,selectors:[["app-journal-receive-money"]],features:[Ge([Hi,Ni])],decls:10,vars:5,consts:[["actionButton",""],["content",""],["footer",""],["header",""],["body",""],["fu",""],["pageTitle",`Receive Money
616
- `],["header","Upload",3,"modal","visible"],["mode","basic","chooseLabel","Choose","chooseIcon","pi pi-upload",3,"onSelect"],["type","button",1,"btn","btn-primary","rounded",3,"click"],["class","d-flex flex-column row-gap-4",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],["formGroupName","order",1,"row"],[1,"col"],[1,"row"],[1,"col","d-flex","flex-column"],["for",""],["size","small","formControlName","entityID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",1,"w-full",3,"options"],["styleClass","w-100","dataType","string","dateFormat","mm-dd-yy","size","small","formControlName","date",3,"showIcon","ngClass"],["pSize","small","type","text","pInputText","","formControlName","number","placeholder","Enter Number",3,"ngClass"],[1,"d-flex","align-items-center","gap-2"],["size","small","styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"w-100",3,"completeMethod","suggestions","placeholder"],[1,"d-flex","align-items-center","gap-2",2,"height","100%","min-height","43px"],[1,"d-flex","items-center","gap-2"],["size","small","formControlName","entityID","optionLabel","value","optionValue","key","placeholder","Select an Outlet",1,"w-full",3,"options"],["formArrayName","items",1,"row"],["showGridlines","",3,"value","tableStyle"],[1,"row","gap-3"],[1,"col","col-lg-4"],[1,"form-group","d-flex","flex-column"],["pTextarea","","formControlName","note","placeholder","Enter Note",1,"w-100",3,"autoResize","ngClass"],["styleClass","justify-content-start","mode","basic","chooseLabel","Choose","chooseIcon","fa-solid fa-upload","maxFileSize","1000000",3,"onSelect"],["formControlName","contactType","name","contactType","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],[2,"width","25%"],[1,"text-end",2,"width","25%"],[2,"width","5%"],[3,"formGroupName"],["appendTo","body","size","small","formControlName","accountID","virtualScroll","","optionLabel","value","optionValue","key","placeholder","Select an account","styleClass","w-100","showClear","",3,"options","virtualScrollItemSize"],["pSize","small","formControlName","debitAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],["pSize","small","rows","1","cols","30","pTextarea","","formControlName","note",1,"w-100",3,"autoResize"],[1,"d-flex","justify-content-center","align-items-center"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick"],[1,"d-flex","justify-content-between","align-items-center"],[1,"d-flex","gap-2"],["icon","fa-light fa-plus","size","small","label","Add",3,"onClick"],[2,"vertical-align","middle"],[1,"text-end"],["colspan","2"],["label","Cancel","severity","secondary",3,"click","text"],["label","OK(F2)","severity","primary",3,"click"]],template:function(l,c){if(l&1){let _=q();p(0,"app-main-panel",6),V(1,Jc,2,0,"ng-template",null,0,Z)(3,qc,1,1,"ng-template",null,1,Z),m(),p(5,"p-dialog",7)(6,"p-fileupload",8),G("onSelect",function(L){return R(_),B(c.onUploadDialog(L))}),m(),V(7,Zc,2,1,"ng-template",null,2,Z),m(),N(9,"p-toast")}l&2&&(f(5),vt(Te(4,zc)),y("modal",!0)("visible",c.uploadDialogVisible()))},dependencies:[Ti,Si,wi,Ci,xi,ki,Ei,Pi,Et,Me,Ct,Xe,Ft,ni,ii,zi,Bi,ei,Xt,$i,Ji,Fn,Tn,At,Vt,ti,xt,Dt,En,Pn,ai,oi,Vn,Wi,di,Ri,Mi,Ki,In,ji,Ui],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var Ga=n=>{let h=K(We),t=K(Gi);return t.show(),console.log("journalEntryResolver",n),h.getJournalReceiveMoney().pipe($e("response"),ke(()=>t.hide()))};var cg=[{path:"",redirectTo:"journal-entry",pathMatch:"full"},{path:"journal-entry",children:[{path:"",component:fa},{path:"add",component:co,resolve:{form:uo}},{path:":id",component:Ua},{path:":id/edit",component:co,resolve:{form:uo}}]},{path:"record-expense",component:Ia,resolve:{form:ja}},{path:"receive-money",component:$a,resolve:{form:Ga}},{path:"journal-deposit",component:Na}];export{cg as JOURNAL_ROUTES};