marketplacepos 2.9.0 → 2.9.2

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.
@@ -0,0 +1 @@
1
+ (self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[533],{6304:(ce,M,k)=>{"use strict";k.d(M,{j:()=>U});var l=k(5412),T=k(6779),E=k(4650),K=k(6895),b=k(4006),g=k(6709),Y=k(6401);function X(H,D){if(1&H){const I=E.EpF();E.TgZ(0,"li")(1,"mat-checkbox",4),E.NdJ("ngModelChange",function(j){const ee=E.CHM(I).$implicit;return E.KtG(ee.selected=j)}),E.TgZ(2,"div",5)(3,"h5",6),E._uU(4),E.qZA()()()()}if(2&H){const I=D.$implicit;E.xp6(1),E.Q6J("ngModel",I.selected),E.xp6(3),E.Oqu(I.Name)}}class U{constructor(D,I){this.data=D,this.dialogRef=I,this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new T.O,this.modalConfig.title="Updating Inventory"}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}getSelectedChannel(){return this.channels.filter(D=>D.selected)}}U.\u0275fac=function(D){return new(D||U)(E.Y36(l.WI),E.Y36(l.so))},U.\u0275cmp=E.Xpm({type:U,selectors:[["app-modal-update-channels"]],decls:5,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"no-bullet"],[4,"ngFor","ngForOf"],[3,"ngModel","ngModelChange"],[1,"d-flex"],[1,"fw-light","me-2","my-auto"]],template:function(D,I){if(1&D&&(E.TgZ(0,"modal-material",0),E.NdJ("onOk",function(){return I.onOk()})("onClose",function(){return I.onClose()})("onCancel",function(){return I.onClose()}),E.TgZ(1,"div",1)(2,"div")(3,"ul",2),E.YNc(4,X,5,2,"li",3),E.qZA()()()()),2&D){let n;E.Q6J("dynamicValidated",(null==(n=I.getSelectedChannel())?null:n.length)>0)("config",I.modalConfig),E.xp6(4),E.Q6J("ngForOf",I.channels)}},dependencies:[K.sg,b.JJ,b.On,g.oG,Y.M],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]})},8705:(ce,M,k)=>{"use strict";k.d(M,{v:()=>l});var l=(()=>{return(T=l||(l={}))[T.ALL=1]="ALL",T[T.DIFFERENCE=3]="DIFFERENCE",l;var T})()},2937:(ce,M,k)=>{"use strict";k.d(M,{Z:()=>I,e:()=>D});var l=k(6895),T=k(266),E=k(284),K=k(4954),b=k(4650);function g(n,j){if(1&n&&(b.ynx(0),b.TgZ(1,"a",6),b._uU(2),b.qZA(),b.BQk()),2&n){const A=b.oxw().$implicit;b.xp6(1),b.s9C("routerLink",A.Url),b.Q6J("title",A.Description?A.Description:""),b.xp6(1),b.hij(" ",A.Title," ")}}function Y(n,j){if(1&n&&(b.TgZ(0,"li",4),b.YNc(1,g,3,3,"ng-container",5),b.qZA()),2&n){const A=j.$implicit;b.xp6(1),b.Q6J("ngxPermissionsOnly",A.Permissions)}}function X(n,j){if(1&n&&(b.ynx(0),b.YNc(1,Y,2,1,"li",3),b.BQk()),2&n){const A=b.oxw();b.xp6(1),b.Q6J("ngForOf",A.Tabs)}}function U(n,j){if(1&n&&(b.TgZ(0,"li",4)(1,"a",6),b._uU(2),b.qZA()()),2&n){const A=j.$implicit;b.xp6(1),b.s9C("routerLink",A.Url),b.Q6J("title",A.Description?A.Description:""),b.xp6(1),b.hij(" ",A.Title," ")}}function H(n,j){if(1&n&&b.YNc(0,U,3,3,"li",3),2&n){const A=b.oxw();b.Q6J("ngForOf",A.Tabs)}}class D{constructor(){this.usePermissions=!1}}D.\u0275fac=function(j){return new(j||D)},D.\u0275cmp=b.Xpm({type:D,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs",usePermissions:"usePermissions"},decls:4,vars:2,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],[4,"ngIf","ngIfElse"],["NOT_USE_PERMISSIONS",""],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[4,"ngxPermissionsOnly"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink","title"]],template:function(j,A){if(1&j&&(b.TgZ(0,"ul",0),b.YNc(1,X,2,1,"ng-container",1),b.YNc(2,H,1,1,"ng-template",null,2,b.W1O),b.qZA()),2&j){const ee=b.MAs(3);b.xp6(1),b.Q6J("ngIf",A.usePermissions)("ngIfElse",ee)}},dependencies:[l.sg,l.O5,E.rH,E.Od,K.gE]});class I{}I.\u0275fac=function(j){return new(j||I)},I.\u0275mod=b.oAB({type:I}),I.\u0275inj=b.cJS({imports:[l.ez,E.Bz,T.AV,K.VI.forChild()]})},7945:(ce,M,k)=>{"use strict";k.d(M,{k:()=>te});var l=k(6895),T=k(4006),E=k(5412),K=k(9549),b=k(4144),g=k(4650),Y=k(7370),X=k.n(Y);class U{constructor(x){this.elementRef=x,this.decimalPlaces=4,this.modifyValueOnWheel=!0,this.max="999999999999999.9999",this.min="-999999999999999.9999",this.propagateChange=z=>{},this.preventNegative=!1;const V={digitGroupSeparator:",",decimalCharacter:".",decimalPlaces:this.decimalPlaces,maximumValue:this.max,minimumValue:this.min,allowDecimalPadding:!1,showWarnings:!1};this.numericElement=new(X())(this.elementRef.nativeElement,null,V)}set _max(x){x&&(this.max=x,this.updateNumericSettings())}set _min(x){x&&(this.min=x,this.updateNumericSettings())}ngOnInit(){""==this.percentage&&(this.max="100"),this.preventNegative&&(this.min="0.00"),this.updateNumericSettings()}updateNumericSettings(){const x={maximumValue:this.max,minimumValue:this.min,readOnly:this.isElementDisabled(),decimalPlaces:this.decimalPlaces,modifyValueOnWheel:this.modifyValueOnWheel};this.numericElement.update(x)}onKeyUp(){let x=this.numericElement.getNumber();this.propagateChange(x)}isElementDisabled(){let x=!1;return(!0===this.elementRef.nativeElement.readOnly||!0===this.elementRef.nativeElement.disabled)&&(x=!0),x}writeValue(x){null!=x&&this.numericElement.set(x)}registerOnChange(x){this.propagateChange=x}registerOnTouched(){}}U.\u0275fac=function(x){return new(x||U)(g.Y36(g.SBq))},U.\u0275dir=g.lG2({type:U,selectors:[["","autoNum",""]],hostBindings:function(x,V){1&x&&g.NdJ("keyup",function(){return V.onKeyUp()})},inputs:{percentage:"percentage",preventNegative:"preventNegative",decimalPlaces:"decimalPlaces",modifyValueOnWheel:"modifyValueOnWheel",_max:["max","_max"],_min:["min","_min"]},standalone:!0,features:[g._Bn([{provide:T.JU,useExisting:(0,g.Gpc)(()=>U),multi:!0}])]});var H=k(6779),D=k(6401),I=k(4954),n=k(8703),j=k(266),A=k(9694);function ee(B,x){1&B&&g.GkF(0)}function me(B,x){if(1&B&&(g.ynx(0),g.YNc(1,ee,1,0,"ng-container",5),g.BQk()),2&B){g.oxw(2);const V=g.MAs(4);g.xp6(1),g.Q6J("ngTemplateOutlet",V)}}function ge(B,x){if(1&B&&(g.TgZ(0,"div",6)(1,"label"),g._uU(2,"Editing Data"),g.qZA(),g.TgZ(3,"div")(4,"span"),g._uU(5),g.ALo(6,"number"),g.qZA()()()),2&B){const V=g.oxw(2);g.xp6(5),g.Oqu(g.lcZ(6,1,V.value))}}function ae(B,x){if(1&B&&(g.ynx(0),g.YNc(1,me,2,1,"ng-container",2),g.YNc(2,ge,7,3,"ng-template",null,4,g.W1O),g.BQk()),2&B){const V=g.MAs(3),z=g.oxw();g.xp6(1),g.Q6J("ngIf",z.hasPriceEdit)("ngIfElse",V)}}function L(B,x){if(1&B){const V=g.EpF();g.TgZ(0,"div",7)(1,"input",8),g.NdJ("ngModelChange",function(J){g.CHM(V);const d=g.oxw();return g.KtG(d.value=J)}),g.qZA(),g.TgZ(2,"label",9),g._uU(3,"Editing Data"),g.qZA()()}if(2&B){const V=g.oxw();g.xp6(1),g.Q6J("ngModel",V.value)("max",V.maxEditInventory)}}class te{constructor(x,V,z){this.dialogRef=x,this.item=V,this.permissionService=z,this.maxEditInventory=1e5,this.permissionService.hasPermission(n.G.price).then(J=>this.hasPriceEdit=J)}ngOnInit(){this.selectedChannel=this.item.Variant.Channel.find(x=>x.ChannelID==this.item.ChannelID),this.selectedChannel.ID=this.item.Variant.ID,this.selectedChannel.Sku=this.item.Variant.Code,"inventory"==this.item.Table?(this.value=this.selectedChannel.Inventory,this.maxEditInventory=this.selectedChannel?.TypeID==A.x.Tokopedia?1e5:null):"price"==this.item.Table&&(this.value=this.selectedChannel.Price,this.maxEditInventory=null),this.selectedChannel.ItemName=this.item.Name,this.selectedChannel.VarName=this.item.Variant.Model,this.initModalConfig()}initModalConfig(){this.modalConfig=new H.O,this.modalConfig.title=`${this.item?.Name} ${this.item?.Variant?.Model} ${this.item?.Table} in ${this.selectedChannel?.Title}`}onSubmit(){"inventory"==this.item.Table?this.selectedChannel.Inventory=this.value:"price"==this.item.Table&&(this.selectedChannel.Price=this.value),this.dialogRef.close(this.selectedChannel)}onClose(){this.dialogRef.close()}}te.\u0275fac=function(x){return new(x||te)(g.Y36(E.so),g.Y36(E.WI),g.Y36(I.YI))},te.\u0275cmp=g.Xpm({type:te,selectors:[["app-table-dialog"]],standalone:!0,features:[g.jDz],decls:5,vars:4,consts:[[3,"dynamicValidated","config","onClose","onCancel","onOk"],["content",""],[4,"ngIf","ngIfElse"],["INVENTORY",""],["DISABLED",""],[4,"ngTemplateOutlet"],["matTooltipPosition","above","matTooltip","Cannot edit Unit Price because you dont have access ProductEditor role",1,"info-label-group","mt-3",2,"background","#e9ecef","opacity","1"],[1,"form-label-group","mt-3"],["type","text","name","edit","placeholder","Editing Data","autoNum","",1,"form-control",3,"ngModel","max","ngModelChange"],["for","edit"]],template:function(x,V){if(1&x&&(g.TgZ(0,"modal-material",0),g.NdJ("onClose",function(){return V.onClose()})("onCancel",function(){return V.onClose()})("onOk",function(){return V.onSubmit()}),g.TgZ(1,"div",1),g.YNc(2,ae,4,2,"ng-container",2),g.YNc(3,L,4,2,"ng-template",null,3,g.W1O),g.qZA()()),2&x){const z=g.MAs(4);g.Q6J("dynamicValidated",V.value)("config",V.modalConfig),g.xp6(2),g.Q6J("ngIf","price"==V.item.Table)("ngIfElse",z)}},dependencies:[l.ez,l.O5,l.tP,l.JJ,E.Is,K.lN,b.c,U,D.M,T.u5,T.Fj,T.JJ,T.On,I.VI,j.AV,j.gM],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-left:1rem;margin-right:1rem}.mat-dialog-content[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem;margin-left:.5rem;margin-right:.5rem}.font-lg[_ngcontent-%COMP%]{font-size:large}.font-lgr[_ngcontent-%COMP%]{font-size:larger}"]})},6114:(ce,M,k)=>{"use strict";k.d(M,{a:()=>ie});var l=k(4650),T=k(5412),E=k(7945),K=k(6895),b=k(455),g=k(4006),Y=k(9549),X=k(4144),U=k(7579),H=k(2722),D=k(4954),I=k(8703),n=k(6082),j=k(1739);function A(w,P){if(1&w){const S=l.EpF();l.ynx(0),l._UZ(1,"br"),l.TgZ(2,"mat-slide-toggle",10),l.NdJ("toggleChange",function(){l.CHM(S);const C=l.oxw();return C.toggleStatus=!C.toggleStatus,l.KtG(C.onToggle())}),l.TgZ(3,"small",11),l._uU(4),l.qZA()(),l.BQk()}if(2&w){const S=l.oxw();l.xp6(4),l.hij(" ",S.productToggleTitle?S.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function ee(w,P){if(1&w){const S=l.EpF();l.TgZ(0,"th")(1,"input",12),l.NdJ("ngModelChange",function(C){l.CHM(S);const W=l.oxw();return l.KtG(W.checkboxState=C)})("ngModelChange",function(){l.CHM(S);const C=l.oxw();return l.KtG(C.onCheckboxStateChange())}),l.qZA()()}if(2&w){const S=l.oxw();l.xp6(1),l.Q6J("ngModel",S.checkboxState)}}function me(w,P){1&w&&(l.ynx(0),l.TgZ(1,"th",13),l._uU(2,"POS"),l.qZA(),l.BQk())}function ge(w,P){if(1&w&&(l.TgZ(0,"th",14),l._uU(1),l.qZA()),2&w){const S=P.$implicit;l.xp6(1),l.Oqu(S.Name)}}function ae(w,P){1&w&&l.GkF(0)}function L(w,P){if(1&w&&(l.ynx(0),l.YNc(1,ae,1,0,"ng-container",27),l.BQk()),2&w){l.oxw();const S=l.MAs(7);l.xp6(1),l.Q6J("ngTemplateOutlet",S)}}function te(w,P){1&w&&l.GkF(0)}function B(w,P){if(1&w&&l.YNc(0,te,1,0,"ng-container",27),2&w){l.oxw(2);const S=l.MAs(7);l.Q6J("ngTemplateOutlet",S)}}const x=function(w){return[w]};function V(w,P){if(1&w&&l.YNc(0,B,1,1,"ng-template",7),2&w){const S=l.oxw(4);l.Q6J("ngxPermissionsOnly",l.VKq(1,x,S.rolePriceEdit))}}function z(w,P){if(1&w){const S=l.EpF();l.TgZ(0,"input",29),l.NdJ("ngModelChange",function(C){l.CHM(S);const W=l.oxw(4).$implicit;return l.KtG(W.selected=C)})("ngModelChange",function(){l.CHM(S);const C=l.oxw(4).$implicit,W=l.oxw();return l.KtG(W.onCheckboxStateProduct(C.ID))}),l.qZA()}if(2&w){const S=l.oxw(4).$implicit;l.Q6J("ngModel",S.selected)}}function J(w,P){if(1&w&&l.YNc(0,z,1,1,"input",28),2&w){const S=l.oxw(3).$implicit,F=l.oxw();l.Q6J("ngIf",F.countVariant(S.Variants)>=0)}}function d(w,P){if(1&w){const S=l.EpF();l.TgZ(0,"img",30),l.NdJ("click",function(C){l.CHM(S);const W=l.oxw(3).$implicit,Q=l.oxw();return l.KtG(Q.onZoomImage(C,null==W?null:W.ImageUrl))}),l.qZA()}if(2&w){const S=l.oxw(3).$implicit;l.s9C("src",null==S?null:S.ThumbnailUrl,l.LSH)}}function ye(w,P){1&w&&l._UZ(0,"img",31)}function q(w,P){if(1&w&&(l.ynx(0),l.TgZ(1,"td",19)(2,"div",20),l.YNc(3,L,2,1,"ng-container",21),l.YNc(4,V,1,3,"ng-template",null,22,l.W1O),l.YNc(6,J,1,1,"ng-template",null,23,l.W1O),l.YNc(8,d,1,1,"img",24),l.YNc(9,ye,1,0,"ng-template",null,25,l.W1O),l.qZA()(),l.TgZ(11,"td",19)(12,"span",26),l._uU(13),l.qZA(),l._UZ(14,"br"),l.TgZ(15,"small"),l._uU(16),l.qZA()(),l.BQk()),2&w){const S=l.MAs(5),F=l.MAs(10),C=l.oxw(2).$implicit,W=l.oxw();l.xp6(1),l.Q6J("rowSpan",null==C?null:C.Variants.length),l.xp6(2),l.Q6J("ngIf","inventory"==W.table)("ngIfElse",S),l.xp6(5),l.Q6J("ngIf",null==C?null:C.ThumbnailUrl)("ngIfElse",F),l.xp6(3),l.Q6J("rowSpan",null==C?null:C.Variants.length),l.xp6(2),l.Oqu(null==C?null:C.Name),l.xp6(3),l.hij("(",null==C?null:C.Category,")")}}function re(w,P){if(1&w){const S=l.EpF();l.TgZ(0,"input",12),l.NdJ("ngModelChange",function(C){l.CHM(S);const W=l.oxw(2).$implicit;return l.KtG(W.selected=C)}),l.qZA()}if(2&w){const S=l.oxw(2).$implicit;l.Q6J("ngModel",S.selected)}}function Se(w,P){if(1&w&&(l.TgZ(0,"td",32),l.YNc(1,re,1,1,"input",33),l.qZA()),2&w){const S=l.oxw().$implicit,F=l.oxw(2);l.xp6(1),l.Q6J("ngIf",F.printPOS(S)>=0||"price"==F.table)}}function _e(w,P){if(1&w&&(l.ynx(0),l.TgZ(1,"td",34),l._uU(2),l.ALo(3,"number"),l.qZA(),l.BQk()),2&w){const S=l.oxw().$implicit,F=l.oxw(2);l.xp6(2),l.Oqu(l.lcZ(3,1,F.printPOS(S)))}}const de=function(w){return{"bg-gradient-warning":w}};function ue(w,P){if(1&w){const S=l.EpF();l.ynx(0),l.TgZ(1,"td",36),l.NdJ("click",function(){l.CHM(S);const C=l.oxw().$implicit,W=l.oxw().$implicit,Q=l.oxw().$implicit,fe=l.oxw();return l.KtG(fe.openTableDialog(Q.Name,W,C.ID,Q.ChannelItemID))}),l.TgZ(2,"span",37),l._uU(3),l.ALo(4,"number"),l.qZA(),l.TgZ(5,"a",38),l.NdJ("click",function(C){return null==C?null:C.stopPropagation()}),l._UZ(6,"i",18),l.qZA()(),l.BQk()}if(2&w){const S=P.$implicit,F=l.oxw(2).$implicit,C=l.oxw(2);l.xp6(1),l.Q6J("ngClass",l.VKq(5,de,C.printPOS(F)!=C.printItem(S))),l.xp6(2),l.hij(" ",l.lcZ(4,3,C.printItem(S))," "),l.xp6(2),l.Q6J("href",S.Url,l.LSH)}}function be(w,P){1&w&&(l.TgZ(0,"td",39)(1,"span",40),l._uU(2,"X"),l.qZA()())}function ve(w,P){if(1&w&&(l.ynx(0),l.YNc(1,ue,7,7,"ng-container",21),l.YNc(2,be,3,0,"ng-template",null,35,l.W1O),l.BQk()),2&w){const S=P.$implicit,F=l.MAs(3),C=l.oxw().$implicit,W=l.oxw(2);l.xp6(1),l.Q6J("ngIf",W.getItemFromChannel(C,S.ID))("ngIfElse",F)}}function ne(w,P){if(1&w&&(l.TgZ(0,"tr"),l.YNc(1,q,17,8,"ng-container",4),l.TgZ(2,"td",15),l._uU(3),l.qZA(),l.TgZ(4,"td",15)(5,"span"),l._uU(6),l.qZA(),l.TgZ(7,"span",16)(8,"a",17),l._UZ(9,"i",18),l.qZA()()(),l.YNc(10,Se,2,1,"ng-template",7),l.YNc(11,_e,4,3,"ng-container",4),l.YNc(12,ve,4,2,"ng-container",9),l.qZA()),2&w){const S=P.$implicit,F=P.index,C=l.oxw(2);l.xp6(1),l.Q6J("ngIf",0==F),l.xp6(2),l.Oqu(null==S?null:S.Model),l.xp6(3),l.hij(" ",S.Code," "),l.xp6(2),l.Q6J("href","https://"+C.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==S?null:S.ID),l.LSH),l.xp6(2),l.Q6J("ngxPermissionsOnly",l.VKq(7,x,C.rolePriceEdit)),l.xp6(1),l.Q6J("ngIf",!(null!=C.filter&&C.filter.HiddenIPOSInventory)),l.xp6(1),l.Q6J("ngForOf",C.channel)}}function pe(w,P){if(1&w&&(l.TgZ(0,"tbody"),l.YNc(1,ne,13,9,"tr",9),l.qZA()),2&w){const S=P.$implicit;l.xp6(1),l.Q6J("ngForOf",S.Variants)}}class ie{constructor(P,S,F){this.dialog=P,this.productService=S,this.biggerPictureService=F,this.showProductToggle=!1,this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=I.G.price,this.onSubmit=new l.vpe,this.destroy$=new U.x,this.toggle=new l.vpe,this.hostName=this.productService.getHostName()}ngOnInit(){"inventory"==this.table?this.stockHeader="Stock":"price"==this.table&&(this.stockHeader="Price")}onCheckboxStateProduct(P){let S=this.data.filter(F=>F.ID==P);S.length>0&&(S=S.map(F=>(F.Variants=F.Variants.map(C=>(C.selected=F.selected,C)),F)))}onCheckboxStateChange(){this.data=this.data.map(P=>(P.Variants=P.Variants.map(S=>(S.selected=this.checkboxState,S)),P))}getItemFromChannel(P,S){return P.Channel.find(F=>F.ChannelID==S)}printItem(P){return"inventory"==this.table?P.Inventory:"price"==this.table?P.Price:void 0}openTableDialog(P,S,F,C){this.dialog.open(E.k,{data:{Name:P,Variant:S,ChannelID:F,Table:this.table,ChannelItemID:C}}).afterClosed().pipe((0,H.R)(this.destroy$)).subscribe(W=>{null!=W&&this.onSubmit.emit(W)})}printPOS(P){return"inventory"==this.table?P.Inventory?P.Inventory:0:"price"==this.table?P.UnitPrice:null}countVariant(P){let S=0;return"inventory"==this.table?(P.forEach(F=>{S+=F.Inventory}),S):"price"==this.table?(S=0,P.forEach(F=>{S+=F.UnitPrice}),S):null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(P,S){this.biggerPictureService.openBiggerPicture(P,S)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}ie.\u0275fac=function(P){return new(P||ie)(l.Y36(T.uw),l.Y36(n.M),l.Y36(j.k))},ie.\u0275cmp=l.Xpm({type:ie,selectors:[["app-table"]],inputs:{filter:"filter",data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle"},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[l.jDz],decls:15,vars:7,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-20"],[4,"ngIf"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"ngxPermissionsOnly"],["scope","col","class","text-center w-10 text-uppercase",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],["type","checkbox",3,"ngModel","ngModelChange"],["scope","col",1,"text-end","w-10"],["scope","col",1,"text-center","w-10","text-uppercase"],[1,"text-start"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center"],[4,"ngIf","ngIfElse"],["PRICE",""],["checkbox_update",""],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"item-name","mb-0"],[4,"ngTemplateOutlet"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"text-end"],["elseCol",""],[1,"text-center","p-0","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","text-center",2,"color","red"],[1,"me-10"]],template:function(P,S){1&P&&(l.TgZ(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr")(4,"th",3),l._uU(5,"Product "),l.YNc(6,A,5,1,"ng-container",4),l.qZA(),l.TgZ(7,"th",5),l._uU(8,"Variant"),l.qZA(),l.TgZ(9,"th",6),l._uU(10,"SKU"),l.qZA(),l.YNc(11,ee,2,1,"ng-template",7),l.YNc(12,me,3,0,"ng-container",4),l.YNc(13,ge,2,1,"th",8),l.qZA()(),l.YNc(14,pe,2,1,"tbody",9),l.qZA()()),2&P&&(l.xp6(6),l.Q6J("ngIf",S.showProductToggle),l.xp6(5),l.Q6J("ngxPermissionsOnly",l.VKq(5,x,S.rolePriceEdit)),l.xp6(1),l.Q6J("ngIf",!(null!=S.filter&&S.filter.HiddenIPOSInventory)),l.xp6(1),l.Q6J("ngForOf",S.channel),l.xp6(1),l.Q6J("ngForOf",S.data))},dependencies:[K.ez,K.mk,K.sg,K.O5,K.tP,K.JJ,g.u5,g.Wl,g.JJ,g.On,b.rP,b.Rr,T.Is,Y.lN,X.c,D.VI,D.gE],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}"]})},7370:function(ce){ce.exports=function(){return l={},M.m=k=[function(T,E,K){"use strict";K.r(E);var b={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(b.allowedTagList),Object.defineProperty(b,"allowedTagList",{configurable:!1,writable:!1}),b.keyCode={Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,Pause:19,CapsLock:20,Esc:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Insert:45,Delete:46,num0:48,num1:49,num2:50,num3:51,num4:52,num5:53,num6:54,num7:55,num8:56,num9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,OSLeft:91,OSRight:92,ContextMenu:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,MultiplyNumpad:106,PlusNumpad:107,MinusNumpad:109,DotNumpad:110,SlashNumpad:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,HyphenFirefox:173,MyComputer:182,MyCalculator:183,Semicolon:186,Equal:187,Comma:188,Hyphen:189,Dot:190,Slash:191,Backquote:192,LeftBracket:219,Backslash:220,RightBracket:221,Quote:222,Command:224,AltGraph:225,AndroidDefault:229},Object.freeze(b.keyCode),Object.defineProperty(b,"keyCode",{configurable:!1,writable:!1}),b.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(b.fromCharCodeKeyCode),Object.defineProperty(b,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),b.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(b.keyName._allFnKeys),Object.freeze(b.keyName._someNonPrintableKeys),Object.freeze(b.keyName._directionKeys),Object.freeze(b.keyName),Object.defineProperty(b,"keyName",{configurable:!1,writable:!1}),Object.freeze(b);var g=b;function Y(a){return function(o){if(Array.isArray(o))return D(o)}(a)||function(o){if(typeof Symbol<"u"&&Symbol.iterator in Object(o))return Array.from(o)}(a)||H(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(){return(X=Object.assign||function(a){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var e in c)Object.prototype.hasOwnProperty.call(c,e)&&(a[e]=c[e])}return a}).apply(this,arguments)}function U(a,o){return function(c){if(Array.isArray(c))return c}(a)||function(c,e){if(typeof Symbol<"u"&&Symbol.iterator in Object(c)){var t=[],i=!0,s=!1,u=void 0;try{for(var r,m=c[Symbol.iterator]();!(i=(r=m.next()).done)&&(t.push(r.value),!e||t.length!==e);i=!0);}catch(v){s=!0,u=v}finally{try{i||null==m.return||m.return()}finally{if(s)throw u}}return t}}(a,o)||H(a,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(a,o){if(a){if("string"==typeof a)return D(a,o);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(c):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?D(a,o):void 0}}function D(a,o){(null==o||o>a.length)&&(o=a.length);for(var c=0,e=new Array(o);c<o;c++)e[c]=a[c];return e}function I(a){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(a)}var n=function(){function a(){!function(o){if(!(o instanceof a))throw new TypeError("Cannot call a class as a function")}(this)}return function(o,c){for(var e=0;e<c.length;e++){var t=c[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(o,t.key,t)}}(a,[{key:"isNull",value:function(o){return null===o}},{key:"isUndefined",value:function(o){return void 0===o}},{key:"isUndefinedOrNullOrEmpty",value:function(o){return null==o||""===o}},{key:"isString",value:function(o){return"string"==typeof o||o instanceof String}},{key:"isEmptyString",value:function(o){return""===o}},{key:"isBoolean",value:function(o){return"boolean"==typeof o}},{key:"isTrueOrFalseString",value:function(o){var c=String(o).toLowerCase();return"true"===c||"false"===c}},{key:"isObject",value:function(o){return"object"===I(o)&&null!==o&&!Array.isArray(o)}},{key:"isEmptyObj",value:function(o){for(var c in o)if(Object.prototype.hasOwnProperty.call(o,c))return!1;return!0}},{key:"isNumberStrict",value:function(o){return"number"==typeof o}},{key:"isNumber",value:function(o){return!this.isArray(o)&&!isNaN(parseFloat(o))&&isFinite(o)}},{key:"isDigit",value:function(o){return/\d/.test(o)}},{key:"isNumberOrArabic",value:function(o){var c=this.arabicToLatinNumbers(o,!1,!0,!0);return this.isNumber(c)}},{key:"isInt",value:function(o){return"number"==typeof o&&parseFloat(o)===parseInt(o,10)&&!isNaN(o)}},{key:"isFunction",value:function(o){return"function"==typeof o}},{key:"isIE11",value:function(){return typeof window<"u"&&!!window.MSInputMethodContext&&!!document.documentMode}},{key:"contains",value:function(o,c){return!(!this.isString(o)||!this.isString(c)||""===o||""===c)&&-1!==o.indexOf(c)}},{key:"isInArray",value:function(o,c){return!(!this.isArray(c)||c===[]||this.isUndefined(o))&&-1!==c.indexOf(o)}},{key:"isArray",value:function(o){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(o)||"object"===I(o)&&"[object Array]"===Object.prototype.toString.call(o);throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(o){return typeof Element<"u"&&o instanceof Element}},{key:"isInputElement",value:function(o){return this.isElement(o)&&"input"===o.tagName.toLowerCase()}},{key:"decimalPlaces",value:function(o){var c=U(o.split("."),2)[1];return this.isUndefined(c)?0:c.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(o){var c=U(String(Math.abs(o)).split("."),2)[1];if(this.isUndefined(c))return 0;var e=c.lastIndexOf("0");return-1===e?e=0:e+=2,e}},{key:"keyCodeNumber",value:function(o){return void 0===o.which?o.keyCode:o.which}},{key:"character",value:function(o){var c;if("Unidentified"===o.key||void 0===o.key||this.isSeleniumBot()){var e=this.keyCodeNumber(o);if(e===g.keyCode.AndroidDefault)return g.keyName.AndroidDefault;var t=g.fromCharCodeKeyCode[e];c=a.isUndefinedOrNullOrEmpty(t)?String.fromCharCode(e):t}else{var i;switch(o.key){case"Add":c=g.keyName.NumpadPlus;break;case"Apps":c=g.keyName.ContextMenu;break;case"Crsel":c=g.keyName.CrSel;break;case"Decimal":c=o.char?o.char:g.keyName.NumpadDot;break;case"Del":c="firefox"===(i=this.browser()).name&&i.version<=36||"ie"===i.name&&i.version<=9?g.keyName.Dot:g.keyName.Delete;break;case"Divide":c=g.keyName.NumpadSlash;break;case"Down":c=g.keyName.DownArrow;break;case"Esc":c=g.keyName.Esc;break;case"Exsel":c=g.keyName.ExSel;break;case"Left":c=g.keyName.LeftArrow;break;case"Meta":case"Super":c=g.keyName.OSLeft;break;case"Multiply":c=g.keyName.NumpadMultiply;break;case"Right":c=g.keyName.RightArrow;break;case"Spacebar":c=g.keyName.Space;break;case"Subtract":c=g.keyName.NumpadMinus;break;case"Up":c=g.keyName.UpArrow;break;default:c=o.key}}return c}},{key:"browser",value:function(){var o,c=navigator.userAgent,e=c.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(e[1])?{name:"ie",version:(o=/\brv[ :]+(\d+)/g.exec(c)||[])[1]||""}:"Chrome"===e[1]&&null!==(o=c.match(/\b(OPR|Edge)\/(\d+)/))?{name:o[1].replace("OPR","opera"),version:o[2]}:(e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(o=c.match(/version\/(\d+)/i))&&e.splice(1,1,o[1]),{name:e[0].toLowerCase(),version:e[1]})}},{key:"isSeleniumBot",value:function(){return!0===window.navigator.webdriver}},{key:"isNegative",value:function(o,c,e){var t=1<arguments.length&&void 0!==c?c:"-",i=!(2<arguments.length&&void 0!==e)||e;return o===t||""!==o&&(a.isNumber(o)?o<0:i?this.contains(o,t):this.isNegativeStrict(o,t))}},{key:"isNegativeStrict",value:function(o,c){var e=1<arguments.length&&void 0!==c?c:"-";return o.charAt(0)===e}},{key:"isNegativeWithBrackets",value:function(o,c,e){return o.charAt(0)===c&&this.contains(o,e)}},{key:"isZeroOrHasNoValue",value:function(o){return!/[1-9]/g.test(o)}},{key:"setRawNegativeSign",value:function(o){return this.isNegativeStrict(o,"-")?o:"-".concat(o)}},{key:"replaceCharAt",value:function(o,c,e){return"".concat(o.substr(0,c)).concat(e).concat(o.substr(c+e.length))}},{key:"clampToRangeLimits",value:function(o,c){return Math.max(c.minimumValue,Math.min(c.maximumValue,o))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(o,c,e){for(var t=new RegExp("[0-9".concat(e,"-]")),i=0,s=0;s<c;s++)t.test(o[s])&&i++;return i}},{key:"findCaretPositionInFormattedNumber",value:function(o,c,e,t){var i,s=e.length,u=o.length,r=0;for(i=0;i<s&&r<u&&r<c;i++)(o[r]===e[i]||"."===o[r]&&e[i]===t)&&r++;return i}},{key:"countCharInText",value:function(o,c){for(var e=0,t=0;t<c.length;t++)c[t]===o&&e++;return e}},{key:"convertCharacterCountToIndexPosition",value:function(o){return Math.max(o,o-1)}},{key:"getElementSelection",value:function(o){var c,e={};try{c=this.isUndefined(o.selectionStart)}catch{c=!1}try{if(c){var t=window.getSelection().getRangeAt(0);e.start=t.startOffset,e.end=t.endOffset,e.length=e.end-e.start}else e.start=o.selectionStart,e.end=o.selectionEnd,e.length=e.end-e.start}catch{e.start=0,e.end=0,e.length=0}return e}},{key:"setElementSelection",value:function(o,c,e){var t=2<arguments.length&&void 0!==e?e:null;if(this.isUndefinedOrNullOrEmpty(t)&&(t=c),this.isInputElement(o))o.setSelectionRange(c,t);else if(!a.isNull(o.firstChild)){var i=document.createRange();i.setStart(o.firstChild,c),i.setEnd(o.firstChild,t);var s=window.getSelection();s.removeAllRanges(),s.addRange(i)}}},{key:"throwError",value:function(o){throw new Error(o)}},{key:"warning",value:function(o,c){1<arguments.length&&void 0!==c&&!c||console.warn("Warning: ".concat(o))}},{key:"isWheelUpEvent",value:function(o){return o.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(o.type,"' given.")),o.deltaY<0}},{key:"isWheelDownEvent",value:function(o){return o.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(o.type,"' given.")),0<o.deltaY}},{key:"forceDecimalPlaces",value:function(o,c){var e=U(String(o).split("."),2),i=e[1];return i?"".concat(e[0],".").concat(i.substr(0,c)):o}},{key:"roundToNearest",value:function(o,c){var e=1<arguments.length&&void 0!==c?c:1e3;return 0===o?0:(0===e&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(o/e)*e)}},{key:"modifyAndRoundToNearestAuto",value:function(o,c,e){o=Number(this.forceDecimalPlaces(o,e));var t=Math.abs(o);if(0<=t&&t<1){var i,s=Math.pow(10,-e);if(0===o)return c?s:-s;var r=e,m=this.indexFirstNonZeroDecimalPlace(o);return i=r-1<=m?s:Math.pow(10,-(m+1)),this.roundToNearest(c?o+i:o-i,i)}o=parseInt(o,10);var v,_=Math.abs(o).toString().length;switch(_){case 1:v=0;break;case 2:case 3:v=1;break;case 4:case 5:v=2;break;default:v=_-3}var h,f=Math.pow(10,v);return(h=c?o+f:o-f)<=10&&-10<=h?h:this.roundToNearest(h,f)}},{key:"addAndRoundToNearestAuto",value:function(o,c){return this.modifyAndRoundToNearestAuto(o,!0,c)}},{key:"subtractAndRoundToNearestAuto",value:function(o,c){return this.modifyAndRoundToNearestAuto(o,!1,c)}},{key:"arabicToLatinNumbers",value:function(o,c,e,t){var i=!(1<arguments.length&&void 0!==c)||c,s=2<arguments.length&&void 0!==e&&e,u=3<arguments.length&&void 0!==t&&t;if(this.isNull(o))return o;var r=o.toString();if(""===r)return o;if(null===r.match(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06f4\u06f5\u06f6]/g))return i&&(r=Number(r)),r;s&&(r=r.replace(/\u066b/,".")),u&&(r=r.replace(/\u066c/g,"")),r=r.replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g,function(v){return v.charCodeAt(0)-1632}).replace(/[\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9]/g,function(v){return v.charCodeAt(0)-1776});var m=Number(r);return isNaN(m)?m:(i&&(r=m),r)}},{key:"triggerEvent",value:function(o,c,e,t,i){var s,u=1<arguments.length&&void 0!==c?c:document,r=2<arguments.length&&void 0!==e?e:null,m=!(3<arguments.length&&void 0!==t)||t,v=!(4<arguments.length&&void 0!==i)||i;window.CustomEvent?s=new CustomEvent(o,{detail:r,bubbles:m,cancelable:v}):(s=document.createEvent("CustomEvent")).initCustomEvent(o,m,v,{detail:r}),u.dispatchEvent(s)}},{key:"parseStr",value:function(o){var c,e,t,i,s={};if(0===o&&1/o<0&&(o="-0"),o=o.toString(),this.isNegativeStrict(o,"-")?(o=o.slice(1),s.s=-1):s.s=1,-1<(c=o.indexOf("."))&&(o=o.replace(".","")),c<0&&(c=o.length),(e=-1===o.search(/[1-9]/i)?o.length:o.search(/[1-9]/i))===(t=o.length))s.e=0,s.c=[0];else{for(i=t-1;"0"===o.charAt(i);--i)--t;for(--t,s.e=c-e-1,s.c=[],c=0;e<=t;e+=1)s.c[c]=+o.charAt(e),c+=1}return s}},{key:"testMinMax",value:function(o,c){var e=c.c,t=o.c,i=c.s,s=o.s,u=c.e,r=o.e;if(!e[0]||!t[0])return e[0]?i:t[0]?-s:0;if(i!==s)return i;var m=i<0;if(u!==r)return r<u^m?1:-1;for(i=-1,s=(u=e.length)<(r=t.length)?u:r,i+=1;i<s;i+=1)if(e[i]!==t[i])return e[i]>t[i]^m?1:-1;return u===r?0:r<u^m?1:-1}},{key:"randomString",value:function(o){var c=0<arguments.length&&void 0!==o?o:5;return Math.random().toString(36).substr(2,c)}},{key:"domElement",value:function(o){return a.isString(o)?document.querySelector(o):o}},{key:"getElementValue",value:function(o){return"input"===o.tagName.toLowerCase()?o.value:this.text(o)}},{key:"setElementValue",value:function(o,c){var e=1<arguments.length&&void 0!==c?c:null;"input"===o.tagName.toLowerCase()?o.value=e:o.textContent=e}},{key:"setInvalidState",value:function(o,c){var e=1<arguments.length&&void 0!==c?c:"Invalid";""!==e&&!this.isNull(e)||this.throwError("Cannot set the invalid state with an empty message."),o.setCustomValidity(e)}},{key:"setValidState",value:function(o){o.setCustomValidity("")}},{key:"cloneObject",value:function(o){return X({},o)}},{key:"camelize",value:function(o,c,e,t){var i=1<arguments.length&&void 0!==c?c:"-",s=!(2<arguments.length&&void 0!==e)||e,u=!(3<arguments.length&&void 0!==t)||t;if(this.isNull(o))return null;s&&(o=o.replace(/^data-/,""));var r=o.split(i).map(function(m){return"".concat(m.charAt(0).toUpperCase()).concat(m.slice(1))});return r=r.join(""),u&&(r="".concat(r.charAt(0).toLowerCase()).concat(r.slice(1))),r}},{key:"text",value:function(o){var c=o.nodeType;return c===Node.ELEMENT_NODE||c===Node.DOCUMENT_NODE||c===Node.DOCUMENT_FRAGMENT_NODE?o.textContent:c===Node.TEXT_NODE?o.nodeValue:""}},{key:"setText",value:function(o,c){var e=o.nodeType;e!==Node.ELEMENT_NODE&&e!==Node.DOCUMENT_NODE&&e!==Node.DOCUMENT_FRAGMENT_NODE||(o.textContent=c)}},{key:"filterOut",value:function(o,c){var e=this;return o.filter(function(t){return!e.isInArray(t,c)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(o){if(""===(o=String(o)))return"";var c=U(o.split("."),2),e=c[0],t=c[1];if(this.isUndefinedOrNullOrEmpty(t))return e;var i=t.replace(/0+$/g,"");return""===i?e:"".concat(e,".").concat(i)}},{key:"getHoveredElement",value:function(){var o=Y(document.querySelectorAll(":hover"));return o[o.length-1]}},{key:"arrayTrim",value:function(o,c){var e=o.length;return 0===e||e<c?o:c<0?[]:(o.length=parseInt(c,10),o)}},{key:"arrayUnique",value:function(){var o;return Y(new Set((o=[]).concat.apply(o,arguments)))}},{key:"mergeMaps",value:function(){for(var o=arguments.length,c=new Array(o),e=0;e<o;e++)c[e]=arguments[e];return new Map(c.reduce(function(t,i){return t.concat(Y(i))},[]))}},{key:"objectKeyLookup",value:function(o,c){var e=Object.entries(o).find(function(i){return i[1]===c}),t=null;return void 0!==e&&(t=e[0]),t}},{key:"insertAt",value:function(o,c,e){if(e>(o=String(o)).length)throw new Error("The given index is out of the string range.");if(1!==c.length)throw new Error("The given string `char` should be only one character long.");return""===o&&0===e?c:"".concat(o.slice(0,e)).concat(c).concat(o.slice(e))}},{key:"scientificToDecimal",value:function(o){var c=Number(o);if(isNaN(c))return NaN;if(o=String(o),!this.contains(o,"e")&&!this.contains(o,"E"))return o;var e=U(o.split(/e/i),2),t=e[0],i=e[1],s=t<0;s&&(t=t.replace("-",""));var u=+i<0;u&&(i=i.replace("-",""));var r,m=U(t.split(/\./),2),v=m[0],_=m[1];return r=u?(r=v.length>i?this.insertAt(v,".",v.length-i):"0.".concat("0".repeat(i-v.length)).concat(v),"".concat(r).concat(_||"")):_?(t="".concat(v).concat(_),i<_.length?this.insertAt(t,".",+i+v.length):"".concat(t).concat("0".repeat(i-_.length))):(t=t.replace(".",""),"".concat(t).concat("0".repeat(Number(i)))),s&&(r="-".concat(r)),r}}]),a}(),j=function(){function a(o){if(function(c){if(!(c instanceof a))throw new TypeError("Cannot call a class as a function")}(this),null===o)throw new Error("Invalid AST")}return function(o,c){for(var e=0;e<c.length;e++){var t=c[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(o,t.key,t)}}(a.prototype,[{key:"evaluate",value:function(o){if(null==o)throw new Error("Invalid AST sub-tree");if("number"===o.type)return o.value;if("unaryMinus"===o.type)return-this.evaluate(o.left);var c=this.evaluate(o.left),e=this.evaluate(o.right);switch(o.type){case"op_+":return Number(c)+Number(e);case"op_-":return c-e;case"op_*":return c*e;case"op_/":return c/e;default:throw new Error("Invalid operator '".concat(o.type,"'"))}}}]),a}(),A=function(){function a(){!function(o){if(!(o instanceof a))throw new TypeError("Cannot call a class as a function")}(this)}return function(o,c){for(var e=0;e<c.length;e++){var t=c[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(o,t.key,t)}}(a,[{key:"createNode",value:function(o,c,e){var t=new a;return t.type=o,t.left=c,t.right=e,t}},{key:"createUnaryNode",value:function(o){var c=new a;return c.type="unaryMinus",c.left=o,c.right=null,c}},{key:"createLeaf",value:function(o){var c=new a;return c.type="number",c.value=o,c}}]),a}();function ee(a,o,c){(function(e){if(!(e instanceof ee))throw new TypeError("Cannot call a class as a function")})(this),this.type=a,this.value=o,this.symbol=c}var me=function(){function a(o){(function(c){if(!(c instanceof a))throw new TypeError("Cannot call a class as a function")})(this),this.text=o,this.textLength=o.length,this.index=0,this.token=new ee("Error",0,0)}return function(o,c){for(var e=0;e<c.length;e++){var t=c[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(o,t.key,t)}}(a.prototype,[{key:"_skipSpaces",value:function(){for(;" "===this.text[this.index]&&this.index<=this.textLength;)this.index++}},{key:"getIndex",value:function(){return this.index}},{key:"getNextToken",value:function(o){var c=0<arguments.length&&void 0!==o?o:".";if(this._skipSpaces(),this.textLength===this.index)return this.token.type="EOT",this.token;if(n.isDigit(this.text[this.index]))return this.token.type="num",this.token.value=this._getNumber(c),this.token;switch(this.token.type="Error",this.text[this.index]){case"+":this.token.type="+";break;case"-":this.token.type="-";break;case"*":this.token.type="*";break;case"/":this.token.type="/";break;case"(":this.token.type="(";break;case")":this.token.type=")"}if("Error"===this.token.type)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(this.token.index,"' in the token function"));return this.token.symbol=this.text[this.index],this.index++,this.token}},{key:"_getNumber",value:function(o){this._skipSpaces();for(var c=this.index;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===o&&this.index++;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;if(this.index===c)throw new Error("No number has been found while it was expected");return this.text.substring(c,this.index).replace(o,".")}}]),a}(),ge=function(){function a(o){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:".";return function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this.text=o,this.decimalCharacter=c,this.lexer=new me(o),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}return function(o,c){for(var e=0;e<c.length;e++){var t=c[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(o,t.key,t)}}(a.prototype,[{key:"_exp",value:function(){var o=this._term(),c=this._moreExp();return A.createNode("op_+",o,c)}},{key:"_moreExp",value:function(){var o,c;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),o=this._term(),c=this._moreExp(),A.createNode("op_+",c,o);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),o=this._term(),c=this._moreExp(),A.createNode("op_-",c,o)}return A.createLeaf(0)}},{key:"_term",value:function(){var o=this._factor(),c=this._moreTerms();return A.createNode("op_*",o,c)}},{key:"_moreTerms",value:function(){var o,c;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),o=this._factor(),c=this._moreTerms(),A.createNode("op_*",c,o);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),o=this._factor(),c=this._moreTerms(),A.createNode("op_/",c,o)}return A.createLeaf(1)}},{key:"_factor",value:function(){var o,c,e;switch(this.token.type){case"num":return e=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),A.createLeaf(e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),c=this._factor(),A.createUnaryNode(c);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),o=this._exp(),this._match(")"),o;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(o){var c=this.lexer.getIndex()-1;if(this.text[c]!==o)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(c,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}]),a}();function ae(a){return function(o){if(Array.isArray(o))return B(o)}(a)||function(o){if(typeof Symbol<"u"&&Symbol.iterator in Object(o))return Array.from(o)}(a)||te(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(a,o){return function(c){if(Array.isArray(c))return c}(a)||function(c,e){if(typeof Symbol<"u"&&Symbol.iterator in Object(c)){var t=[],i=!0,s=!1,u=void 0;try{for(var r,m=c[Symbol.iterator]();!(i=(r=m.next()).done)&&(t.push(r.value),!e||t.length!==e);i=!0);}catch(v){s=!0,u=v}finally{try{i||null==m.return||m.return()}finally{if(s)throw u}}return t}}(a,o)||te(a,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(a,o){if(a){if("string"==typeof a)return B(a,o);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(c):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?B(a,o):void 0}}function B(a,o){(null==o||o>a.length)&&(o=a.length);for(var c=0,e=new Array(o);c<o;c++)e[c]=a[c];return e}function x(){return(x=Object.assign||function(a){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var e in c)Object.prototype.hasOwnProperty.call(c,e)&&(a[e]=c[e])}return a}).apply(this,arguments)}function V(a){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(a)}function z(a,o){for(var c=0;c<o.length;c++){var e=o[c];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}var J,d=function(){function a(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,s=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;!function(h){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}(this);var u=a._setArgumentsValues(t,i,s),m=u.initialValue,v=u.userOptions;if(this.domElement=u.domElement,this.defaultRawValue="",this._setSettings(v,!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(m);else{var _;if(n.isNull(m))switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.min:_=this.settings.minimumValue;break;case a.options.emptyInputBehavior.max:_=this.settings.maximumValue;break;case a.options.emptyInputBehavior.zero:_="0";break;case a.options.emptyInputBehavior.focus:case a.options.emptyInputBehavior.press:case a.options.emptyInputBehavior.always:case a.options.emptyInputBehavior.null:_="";break;default:_=this.settings.emptyInputBehavior}else _=m;this._setElementAndRawValue(_)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(m),this.sessionStorageAvailable=this.constructor._storageTest(),this.storageNamePrefix="AUTO_",this._setPersistentStorageName(),this.validState=!0,this.isFocused=!1,this.isWheelEvent=!1,this.isDropEvent=!1,this.isEditing=!1,this.rawValueOnFocus=void 0,this.internalModification=!1,this.attributeToWatch=this._getAttributeToWatch(),this.getterSetter=Object.getOwnPropertyDescriptor(this.domElement.__proto__,this.attributeToWatch),this._addWatcher(),this.settings.createLocalList&&this._createLocalList(),this.constructor._addToGlobalList(this),this.global={set:function(h,f){var p=1<arguments.length&&void 0!==f?f:null;e.autoNumericLocalList.forEach(function(y){y.set(h,p)})},setUnformatted:function(h,f){var p=1<arguments.length&&void 0!==f?f:null;e.autoNumericLocalList.forEach(function(y){y.setUnformatted(h,p)})},get:function(h){var f=0<arguments.length&&void 0!==h?h:null,p=[];return e.autoNumericLocalList.forEach(function(y){p.push(y.get())}),e._executeCallback(p,f),p},getNumericString:function(h){var f=0<arguments.length&&void 0!==h?h:null,p=[];return e.autoNumericLocalList.forEach(function(y){p.push(y.getNumericString())}),e._executeCallback(p,f),p},getFormatted:function(h){var f=0<arguments.length&&void 0!==h?h:null,p=[];return e.autoNumericLocalList.forEach(function(y){p.push(y.getFormatted())}),e._executeCallback(p,f),p},getNumber:function(h){var f=0<arguments.length&&void 0!==h?h:null,p=[];return e.autoNumericLocalList.forEach(function(y){p.push(y.getNumber())}),e._executeCallback(p,f),p},getLocalized:function(h){var f=0<arguments.length&&void 0!==h?h:null,p=[];return e.autoNumericLocalList.forEach(function(y){p.push(y.getLocalized())}),e._executeCallback(p,f),p},reformat:function(){e.autoNumericLocalList.forEach(function(h){h.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(h){h.unformat()})},unformatLocalized:function(h){var f=0<arguments.length&&void 0!==h?h:null;e.autoNumericLocalList.forEach(function(p){p.unformatLocalized(f)})},update:function(){for(var h=arguments.length,f=new Array(h),p=0;p<h;p++)f[p]=arguments[p];e.autoNumericLocalList.forEach(function(y){y.update.apply(y,f)})},isPristine:function(){var h=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],f=!0;return e.autoNumericLocalList.forEach(function(p){f&&!p.isPristine(h)&&(f=!1)}),f},clear:function(h){var f=0<arguments.length&&void 0!==h&&h;e.autoNumericLocalList.forEach(function(p){p.clear(f)})},remove:function(){e.autoNumericLocalList.forEach(function(h){h.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(h){h.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(h){h.nuke()})},has:function(h){return e.autoNumericLocalList.has(h instanceof a?h.node():h)},addObject:function(h){var f,p;p=h instanceof a?(f=h.node(),h):a.getAutoNumericElement(f=h),e._hasLocalList()||e._createLocalList();var y,O=p._getLocalList();0===O.size&&(p._createLocalList(),O=p._getLocalList()),(y=O instanceof Map?n.mergeMaps(e._getLocalList(),O):(e._addToLocalList(f,p),e._getLocalList())).forEach(function(N){N._setLocalList(y)})},removeObject:function(h,f){var p,y,O=1<arguments.length&&void 0!==f&&f;y=h instanceof a?(p=h.node(),h):a.getAutoNumericElement(p=h);var N=e.autoNumericLocalList;e.autoNumericLocalList.delete(p),N.forEach(function(R){R._setLocalList(e.autoNumericLocalList)}),O||p!==e.node()?y._createLocalList():y._setLocalList(new Map)},empty:function(h){var f=0<arguments.length&&void 0!==h&&h;e.autoNumericLocalList.forEach(function(p){f?p._createLocalList():p._setLocalList(new Map)})},elements:function(){var h=[];return e.autoNumericLocalList.forEach(function(f){h.push(f.node())}),h},getList:function(){return e.autoNumericLocalList},size:function(){return e.autoNumericLocalList.size}},this.options={reset:function(){return e.settings={rawValue:e.defaultRawValue},e.update(a.defaultSettings),e},allowDecimalPadding:function(h){return e.update({allowDecimalPadding:h}),e},alwaysAllowDecimalCharacter:function(h){return e.update({alwaysAllowDecimalCharacter:h}),e},caretPositionOnFocus:function(h){return e.settings.caretPositionOnFocus=h,e},createLocalList:function(h){return e.settings.createLocalList=h,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(h){return e.update({currencySymbol:h}),e},currencySymbolPlacement:function(h){return e.update({currencySymbolPlacement:h}),e},decimalCharacter:function(h){return e.update({decimalCharacter:h}),e},decimalCharacterAlternative:function(h){return e.settings.decimalCharacterAlternative=h,e},decimalPlaces:function(h){return n.warning("Using `options.decimalPlaces()` instead of calling the specific `options.decimalPlacesRawValue()`, `options.decimalPlacesShownOnFocus()` and `options.decimalPlacesShownOnBlur()` methods will reset those options.\nPlease call the specific methods if you do not want to reset those.",e.settings.showWarnings),e.update({decimalPlaces:h}),e},decimalPlacesRawValue:function(h){return e.update({decimalPlacesRawValue:h}),e},decimalPlacesShownOnBlur:function(h){return e.update({decimalPlacesShownOnBlur:h}),e},decimalPlacesShownOnFocus:function(h){return e.update({decimalPlacesShownOnFocus:h}),e},defaultValueOverride:function(h){return e.update({defaultValueOverride:h}),e},digitalGroupSpacing:function(h){return e.update({digitalGroupSpacing:h}),e},digitGroupSeparator:function(h){return e.update({digitGroupSeparator:h}),e},divisorWhenUnfocused:function(h){return e.update({divisorWhenUnfocused:h}),e},emptyInputBehavior:function(h){return null===e.rawValue&&h!==a.options.emptyInputBehavior.null&&(n.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(h,"), 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:h}),e},eventBubbles:function(h){return e.settings.eventBubbles=h,e},eventIsCancelable:function(h){return e.settings.eventIsCancelable=h,e},failOnUnknownOption:function(h){return e.settings.failOnUnknownOption=h,e},formatOnPageLoad:function(h){return e.settings.formatOnPageLoad=h,e},formulaMode:function(h){return e.settings.formulaMode=h,e},historySize:function(h){return e.settings.historySize=h,e},invalidClass:function(h){return e.settings.invalidClass=h,e},isCancellable:function(h){return e.settings.isCancellable=h,e},leadingZero:function(h){return e.update({leadingZero:h}),e},maximumValue:function(h){return e.update({maximumValue:h}),e},minimumValue:function(h){return e.update({minimumValue:h}),e},modifyValueOnWheel:function(h){return e.settings.modifyValueOnWheel=h,e},negativeBracketsTypeOnBlur:function(h){return e.update({negativeBracketsTypeOnBlur:h}),e},negativePositiveSignPlacement:function(h){return e.update({negativePositiveSignPlacement:h}),e},negativeSignCharacter:function(h){return e.update({negativeSignCharacter:h}),e},noEventListeners:function(h){return h===a.options.noEventListeners.noEvents&&e.settings.noEventListeners===a.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:h}),e},onInvalidPaste:function(h){return e.settings.onInvalidPaste=h,e},outputFormat:function(h){return e.settings.outputFormat=h,e},overrideMinMaxLimits:function(h){return e.update({overrideMinMaxLimits:h}),e},positiveSignCharacter:function(h){return e.update({positiveSignCharacter:h}),e},rawValueDivisor:function(h){return e.update({rawValueDivisor:h}),e},readOnly:function(h){return e.settings.readOnly=h,e._setWritePermissions(),e},roundingMethod:function(h){return e.update({roundingMethod:h}),e},saveValueToSessionStorage:function(h){return e.update({saveValueToSessionStorage:h}),e},symbolWhenUnfocused:function(h){return e.update({symbolWhenUnfocused:h}),e},selectNumberOnly:function(h){return e.settings.selectNumberOnly=h,e},selectOnFocus:function(h){return e.settings.selectOnFocus=h,e},serializeSpaces:function(h){return e.settings.serializeSpaces=h,e},showOnlyNumbersOnFocus:function(h){return e.update({showOnlyNumbersOnFocus:h}),e},showPositiveSign:function(h){return e.update({showPositiveSign:h}),e},showWarnings:function(h){return e.settings.showWarnings=h,e},styleRules:function(h){return e.update({styleRules:h}),e},suffixText:function(h){return e.update({suffixText:h}),e},unformatOnHover:function(h){return e.settings.unformatOnHover=h,e},unformatOnSubmit:function(h){return e.settings.unformatOnSubmit=h,e},valuesToStrings:function(h){return e.update({valuesToStrings:h}),e},watchExternalChanges:function(h){return e.update({watchExternalChanges:h}),e},wheelOn:function(h){return e.settings.wheelOn=h,e},wheelStep:function(h){return e.settings.wheelStep=h,e}},this._triggerEvent(a.events.initialized,this.domElement,{newValue:n.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var o,c;return c=[{key:"version",value:function(){return"4.6.0"}},{key:"_setArgumentsValues",value:function(e,t,i){n.isNull(e)&&n.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var s,u,r,m=n.isElement(e),v=n.isString(e),_=n.isObject(t),h=Array.isArray(t)&&0<t.length,f=n.isNumberOrArabic(t)||""===t,p=this._isPreDefinedOptionValid(t),y=n.isNull(t),O=n.isEmptyString(t),N=n.isObject(i),R=Array.isArray(i)&&0<i.length,G=n.isNull(i),$=this._isPreDefinedOptionValid(i);return m&&y&&G?(s=e,u=r=null):m&&f&&G?(s=e,r=t,u=null):m&&_&&G?(s=e,r=null,u=t):m&&p&&G?(s=e,r=null,u=this._getOptionObject(t)):m&&h&&G?(s=e,r=null,u=this.mergeOptions(t)):m&&(y||O)&&N?(s=e,r=null,u=i):m&&(y||O)&&R?(s=e,r=null,u=this.mergeOptions(i)):v&&y&&G?(s=document.querySelector(e),u=r=null):v&&_&&G?(s=document.querySelector(e),r=null,u=t):v&&p&&G?(s=document.querySelector(e),r=null,u=this._getOptionObject(t)):v&&h&&G?(s=document.querySelector(e),r=null,u=this.mergeOptions(t)):v&&(y||O)&&N?(s=document.querySelector(e),r=null,u=i):v&&(y||O)&&R?(s=document.querySelector(e),r=null,u=this.mergeOptions(i)):v&&f&&G?(s=document.querySelector(e),r=t,u=null):v&&f&&N?(s=document.querySelector(e),r=t,u=i):v&&f&&$?(s=document.querySelector(e),r=t,u=this._getOptionObject(i)):v&&f&&R?(s=document.querySelector(e),r=t,u=this.mergeOptions(i)):m&&f&&N?(s=e,r=t,u=i):m&&f&&$?(s=e,r=t,u=this._getOptionObject(i)):m&&f&&R?(s=e,r=t,u=this.mergeOptions(i)):n.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(t,"' and '").concat(i,"' given.")),n.isNull(s)&&n.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:s,initialValue:r,userOptions:u}}},{key:"mergeOptions",value:function(e){var t=this,i={};return e.forEach(function(s){x(i,t._getOptionObject(s))}),i}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(a.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var t;return n.isString(e)?null==(t=a.getPredefinedOptions()[e])&&n.warning("The given pre-defined option [".concat(e,"] is not recognized by autoNumeric. Please check that pre-defined option name."),!0):t=e,t}},{key:"_doesFormHandlerListExists",value:function(){var e=V(window.aNFormHandlerMap);return"undefined"!==e&&"object"===e}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,t){return n.isInArray(String(e),t)}},{key:"_checkValuesToStringsSettings",value:function(e,t){return this._checkValuesToStringsArray(e,Object.keys(t.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,t){return this._checkValuesToStringsArray(e,Object.values(t.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 t=this,i=e.getElementsByTagName("input"),s=[];return Array.prototype.slice.call(i,0).forEach(function(u){t.test(u)&&s.push(u)}),s}},{key:"test",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"_createWeakMap",value:function(e){window[e]=new WeakMap}},{key:"_createGlobalList",value:function(){this.autoNumericGlobalListName="autoNumericGlobalList",this._createWeakMap(this.autoNumericGlobalListName)}},{key:"_doesGlobalListExists",value:function(){var e=V(window[this.autoNumericGlobalListName]);return"undefined"!==e&&"object"===e}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var t=e.node();if(this._isInGlobalList(t)){if(this._getFromGlobalList(t)===this)return;n.warning("A reference to the DOM element you just initialized already exists in the global AutoNumeric element list. Please make sure to not initialize the same DOM element multiple times.",e.getSettings().showWarnings)}window[this.autoNumericGlobalListName].set(t,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,t,i){var s=!(1<arguments.length&&void 0!==t)||t,u=2<arguments.length&&void 0!==i?i:null;!n.isUndefinedOrNullOrEmpty(e)&&n.isObject(e)||n.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var r,m=n.isObject(u);m||n.isNull(u)||n.throwError("The 'originalOptions' parameter is invalid ; it should either be a valid option object or `null`, [".concat(e,"] given.")),n.isNull(e)||this._convertOldOptionsToNewOnes(e),r=s?x({},this.getDefaultConfig(),e):e,n.isTrueOrFalseString(r.showWarnings)||n.isBoolean(r.showWarnings)||n.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(r.showWarnings,"] given."));var v,_=/^[0-9]+$/,h=/[0-9]+/,f=/^-?[0-9]+(\.?[0-9]+)?$/,p=/^[0-9]+(\.?[0-9]+)?$/;n.isTrueOrFalseString(r.allowDecimalPadding)||n.isBoolean(r.allowDecimalPadding)||r.allowDecimalPadding===a.options.allowDecimalPadding.floats||n.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true` or `'floats'`, [".concat(r.allowDecimalPadding,"] given.")),r.allowDecimalPadding!==a.options.allowDecimalPadding.never&&"false"!==r.allowDecimalPadding||r.decimalPlaces===a.options.decimalPlaces.none&&r.decimalPlacesShownOnBlur===a.options.decimalPlacesShownOnBlur.none&&r.decimalPlacesShownOnFocus===a.options.decimalPlacesShownOnFocus.none||n.warning("Setting 'allowDecimalPadding' to [".concat(r.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(r.decimalPlaces,", ").concat(r.decimalPlacesShownOnBlur," and ").concat(r.decimalPlacesShownOnFocus,"]."),r.showWarnings),n.isTrueOrFalseString(r.alwaysAllowDecimalCharacter)||n.isBoolean(r.alwaysAllowDecimalCharacter)||n.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(r.alwaysAllowDecimalCharacter,"] given.")),n.isNull(r.caretPositionOnFocus)||n.isInArray(r.caretPositionOnFocus,[a.options.caretPositionOnFocus.start,a.options.caretPositionOnFocus.end,a.options.caretPositionOnFocus.decimalLeft,a.options.caretPositionOnFocus.decimalRight])||n.throwError("The display on empty string option 'caretPositionOnFocus' is invalid ; it should either be `null`, 'focus', 'press', 'always' or 'zero', [".concat(r.caretPositionOnFocus,"] given.")),v=m?u:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),n.isNull(v)||v.caretPositionOnFocus===a.options.caretPositionOnFocus.doNoForceCaretPosition||v.selectOnFocus!==a.options.selectOnFocus.select||n.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(v.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),r.showWarnings),n.isInArray(r.digitGroupSeparator,[a.options.digitGroupSeparator.comma,a.options.digitGroupSeparator.dot,a.options.digitGroupSeparator.normalSpace,a.options.digitGroupSeparator.thinSpace,a.options.digitGroupSeparator.narrowNoBreakSpace,a.options.digitGroupSeparator.noBreakSpace,a.options.digitGroupSeparator.noSeparator,a.options.digitGroupSeparator.apostrophe,a.options.digitGroupSeparator.arabicThousandsSeparator,a.options.digitGroupSeparator.dotAbove,a.options.digitGroupSeparator.privateUseTwo])||n.throwError("The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '\u066c', '\u02d9', \"'\", '\x92', ' ', '\u2009', '\u202f', '\xa0' or empty (''), [".concat(r.digitGroupSeparator,"] given.")),n.isTrueOrFalseString(r.showOnlyNumbersOnFocus)||n.isBoolean(r.showOnlyNumbersOnFocus)||n.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(r.showOnlyNumbersOnFocus,"] given.")),n.isInArray(r.digitalGroupSpacing,[a.options.digitalGroupSpacing.two,a.options.digitalGroupSpacing.twoScaled,a.options.digitalGroupSpacing.three,a.options.digitalGroupSpacing.four])||2<=r.digitalGroupSpacing&&r.digitalGroupSpacing<=4||n.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2s', '3', or '4', [".concat(r.digitalGroupSpacing,"] given.")),n.isInArray(r.decimalCharacter,[a.options.decimalCharacter.comma,a.options.decimalCharacter.dot,a.options.decimalCharacter.middleDot,a.options.decimalCharacter.arabicDecimalSeparator,a.options.decimalCharacter.decimalSeparatorKeySymbol])||n.throwError("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '\xb7', '\u2396' or '\u066b', [".concat(r.decimalCharacter,"] given.")),r.decimalCharacter===r.digitGroupSeparator&&n.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(r.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(r.digitGroupSeparator,"] are the same character.")),n.isNull(r.decimalCharacterAlternative)||n.isString(r.decimalCharacterAlternative)||n.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(r.decimalCharacterAlternative,"] given.")),""===r.currencySymbol||n.isString(r.currencySymbol)||n.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(r.currencySymbol,"] given.")),n.isInArray(r.currencySymbolPlacement,[a.options.currencySymbolPlacement.prefix,a.options.currencySymbolPlacement.suffix])||n.throwError("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), [".concat(r.currencySymbolPlacement,"] given.")),n.isInArray(r.negativePositiveSignPlacement,[a.options.negativePositiveSignPlacement.prefix,a.options.negativePositiveSignPlacement.suffix,a.options.negativePositiveSignPlacement.left,a.options.negativePositiveSignPlacement.right,a.options.negativePositiveSignPlacement.none])||n.throwError("The placement of the negative sign option 'negativePositiveSignPlacement' is invalid ; it should either be 'p' (prefix), 's' (suffix), 'l' (left), 'r' (right) or 'null', [".concat(r.negativePositiveSignPlacement,"] given.")),n.isTrueOrFalseString(r.showPositiveSign)||n.isBoolean(r.showPositiveSign)||n.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(r.showPositiveSign,"] given.")),n.isString(r.suffixText)&&(""===r.suffixText||!n.isNegative(r.suffixText,r.negativeSignCharacter)&&!h.test(r.suffixText))||n.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(r.negativeSignCharacter,"' nor any numerical characters, [").concat(r.suffixText,"] given.")),n.isString(r.negativeSignCharacter)&&1===r.negativeSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(r.negativeSignCharacter)&&!h.test(r.negativeSignCharacter)||n.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(r.negativeSignCharacter,"] given.")),n.isString(r.positiveSignCharacter)&&1===r.positiveSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(r.positiveSignCharacter)&&!h.test(r.positiveSignCharacter)||n.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(r.positiveSignCharacter,"] given.\nIf you want to hide the positive sign character, you need to set the `showPositiveSign` option to `true`.")),r.negativeSignCharacter===r.positiveSignCharacter&&n.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(r.negativeSignCharacter,"] given."));var y=L(n.isNull(r.negativeBracketsTypeOnBlur)?["",""]:r.negativeBracketsTypeOnBlur.split(","),2),O=y[0],N=y[1];(n.contains(r.digitGroupSeparator,r.negativeSignCharacter)||n.contains(r.decimalCharacter,r.negativeSignCharacter)||n.contains(r.decimalCharacterAlternative,r.negativeSignCharacter)||n.contains(O,r.negativeSignCharacter)||n.contains(N,r.negativeSignCharacter)||n.contains(r.suffixText,r.negativeSignCharacter))&&n.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(r.negativeSignCharacter,"] given.")),(n.contains(r.digitGroupSeparator,r.positiveSignCharacter)||n.contains(r.decimalCharacter,r.positiveSignCharacter)||n.contains(r.decimalCharacterAlternative,r.positiveSignCharacter)||n.contains(O,r.positiveSignCharacter)||n.contains(N,r.positiveSignCharacter)||n.contains(r.suffixText,r.positiveSignCharacter))&&n.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(r.positiveSignCharacter,"] given.")),n.isNull(r.overrideMinMaxLimits)||n.isInArray(r.overrideMinMaxLimits,[a.options.overrideMinMaxLimits.ceiling,a.options.overrideMinMaxLimits.floor,a.options.overrideMinMaxLimits.ignore,a.options.overrideMinMaxLimits.invalid])||n.throwError("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor', 'ignore' or 'invalid', [".concat(r.overrideMinMaxLimits,"] given.")),r.overrideMinMaxLimits!==a.options.overrideMinMaxLimits.invalid&&r.overrideMinMaxLimits!==a.options.overrideMinMaxLimits.ignore&&(0<r.minimumValue||r.maximumValue<0)&&n.warning("You've set a `minimumValue` or a `maximumValue` excluding the value `0`. AutoNumeric will force the users to always have a valid value in the input, hence preventing them to clear the field. If you want to allow for temporary invalid values (ie. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),n.isString(r.maximumValue)&&f.test(r.maximumValue)||n.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(r.maximumValue,"] given.")),n.isString(r.minimumValue)&&f.test(r.minimumValue)||n.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(r.minimumValue,"] given.")),parseFloat(r.minimumValue)>parseFloat(r.maximumValue)&&n.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(r.minimumValue,"] should be smaller than 'maximumValue' [").concat(r.maximumValue,"].")),n.isInt(r.decimalPlaces)&&0<=r.decimalPlaces||n.isString(r.decimalPlaces)&&_.test(r.decimalPlaces)||n.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(r.decimalPlaces,"] given.")),n.isNull(r.decimalPlacesRawValue)||n.isInt(r.decimalPlacesRawValue)&&0<=r.decimalPlacesRawValue||n.isString(r.decimalPlacesRawValue)&&_.test(r.decimalPlacesRawValue)||n.throwError("The number of decimal places for the raw value option 'decimalPlacesRawValue' is invalid ; it should be a positive integer or `null`, [".concat(r.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(r),n.isNull(r.decimalPlacesShownOnFocus)||_.test(String(r.decimalPlacesShownOnFocus))||n.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(r.decimalPlacesShownOnFocus,"] given.")),!n.isNull(r.decimalPlacesShownOnFocus)&&Number(r.decimalPlaces)>Number(r.decimalPlacesShownOnFocus)&&n.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(r.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(r.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?"),r.showWarnings),(n.isNull(r.divisorWhenUnfocused)||p.test(r.divisorWhenUnfocused))&&0!==r.divisorWhenUnfocused&&"0"!==r.divisorWhenUnfocused&&1!==r.divisorWhenUnfocused&&"1"!==r.divisorWhenUnfocused||n.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(r.divisorWhenUnfocused,"] given.")),n.isNull(r.decimalPlacesShownOnBlur)||_.test(r.decimalPlacesShownOnBlur)||n.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(r.decimalPlacesShownOnBlur,"] given.")),n.isNull(r.symbolWhenUnfocused)||n.isString(r.symbolWhenUnfocused)||n.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(r.symbolWhenUnfocused,"] given.")),n.isTrueOrFalseString(r.saveValueToSessionStorage)||n.isBoolean(r.saveValueToSessionStorage)||n.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(r.saveValueToSessionStorage,"] given.")),n.isInArray(r.onInvalidPaste,[a.options.onInvalidPaste.error,a.options.onInvalidPaste.ignore,a.options.onInvalidPaste.clamp,a.options.onInvalidPaste.truncate,a.options.onInvalidPaste.replace])||n.throwError("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), [".concat(r.onInvalidPaste,"] given.")),n.isInArray(r.roundingMethod,[a.options.roundingMethod.halfUpSymmetric,a.options.roundingMethod.halfUpAsymmetric,a.options.roundingMethod.halfDownSymmetric,a.options.roundingMethod.halfDownAsymmetric,a.options.roundingMethod.halfEvenBankersRounding,a.options.roundingMethod.upRoundAwayFromZero,a.options.roundingMethod.downRoundTowardZero,a.options.roundingMethod.toCeilingTowardPositiveInfinity,a.options.roundingMethod.toFloorTowardNegativeInfinity,a.options.roundingMethod.toNearest05,a.options.roundingMethod.toNearest05Alt,a.options.roundingMethod.upToNext05,a.options.roundingMethod.downToNext05])||n.throwError("The rounding method option 'roundingMethod' is invalid ; it should either be 'S', 'A', 's', 'a', 'B', 'U', 'D', 'C', 'F', 'N05', 'CHF', 'U05' or 'D05' (cf. documentation), [".concat(r.roundingMethod,"] given.")),n.isNull(r.negativeBracketsTypeOnBlur)||n.isInArray(r.negativeBracketsTypeOnBlur,[a.options.negativeBracketsTypeOnBlur.parentheses,a.options.negativeBracketsTypeOnBlur.brackets,a.options.negativeBracketsTypeOnBlur.chevrons,a.options.negativeBracketsTypeOnBlur.curlyBraces,a.options.negativeBracketsTypeOnBlur.angleBrackets,a.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,a.options.negativeBracketsTypeOnBlur.halfBrackets,a.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,a.options.negativeBracketsTypeOnBlur.quotationMarks,a.options.negativeBracketsTypeOnBlur.guillemets])||n.throwError("The brackets for negative values option 'negativeBracketsTypeOnBlur' is invalid ; it should either be '(,)', '[,]', '<,>', '{,}', '\u3008,\u3009', '\uff62,\uff63', '\u2e24,\u2e25', '\u27e6,\u27e7', '\u2039,\u203a' or '\xab,\xbb', [".concat(r.negativeBracketsTypeOnBlur,"] given.")),(n.isString(r.emptyInputBehavior)||n.isNumber(r.emptyInputBehavior))&&(n.isInArray(r.emptyInputBehavior,[a.options.emptyInputBehavior.focus,a.options.emptyInputBehavior.press,a.options.emptyInputBehavior.always,a.options.emptyInputBehavior.min,a.options.emptyInputBehavior.max,a.options.emptyInputBehavior.zero,a.options.emptyInputBehavior.null])||f.test(r.emptyInputBehavior))||n.throwError("The display on empty string option 'emptyInputBehavior' is invalid ; it should either be 'focus', 'press', 'always', 'min', 'max', 'zero', 'null', a number, or a string that represents a number, [".concat(r.emptyInputBehavior,"] given.")),r.emptyInputBehavior===a.options.emptyInputBehavior.zero&&(0<r.minimumValue||r.maximumValue<0)&&n.throwError("The 'emptyInputBehavior' option is set to 'zero', but this value is outside of the range defined by 'minimumValue' and 'maximumValue' [".concat(r.minimumValue,", ").concat(r.maximumValue,"].")),f.test(String(r.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(r.emptyInputBehavior,r)||n.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(r.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(r.minimumValue,", ").concat(r.maximumValue,"]."))),n.isTrueOrFalseString(r.eventBubbles)||n.isBoolean(r.eventBubbles)||n.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(r.eventBubbles,"] given.")),n.isTrueOrFalseString(r.eventIsCancelable)||n.isBoolean(r.eventIsCancelable)||n.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(r.eventIsCancelable,"] given.")),!n.isBoolean(r.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(r.invalidClass)||n.throwError("The name of the 'invalidClass' option is not a valid CSS class name ; it should not be empty, and should follow the '^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$' regex, [".concat(r.invalidClass,"] given.")),n.isInArray(r.leadingZero,[a.options.leadingZero.allow,a.options.leadingZero.deny,a.options.leadingZero.keep])||n.throwError("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [".concat(r.leadingZero,"] given.")),n.isTrueOrFalseString(r.formatOnPageLoad)||n.isBoolean(r.formatOnPageLoad)||n.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(r.formatOnPageLoad,"] given.")),n.isTrueOrFalseString(r.formulaMode)||n.isBoolean(r.formulaMode)||n.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(r.formulaMode,"] given.")),_.test(r.historySize)&&0!==r.historySize||n.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(r.historySize,"] given.")),n.isTrueOrFalseString(r.selectNumberOnly)||n.isBoolean(r.selectNumberOnly)||n.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(r.selectNumberOnly,"] given.")),n.isTrueOrFalseString(r.selectOnFocus)||n.isBoolean(r.selectOnFocus)||n.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(r.selectOnFocus,"] given.")),n.isNull(r.defaultValueOverride)||""===r.defaultValueOverride||f.test(r.defaultValueOverride)||n.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(r.defaultValueOverride,"] given.")),n.isTrueOrFalseString(r.unformatOnSubmit)||n.isBoolean(r.unformatOnSubmit)||n.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(r.unformatOnSubmit,"] given.")),n.isNull(r.valuesToStrings)||n.isObject(r.valuesToStrings)||n.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(r.valuesToStrings,"] given.")),n.isNull(r.outputFormat)||n.isInArray(r.outputFormat,[a.options.outputFormat.string,a.options.outputFormat.number,a.options.outputFormat.dot,a.options.outputFormat.negativeDot,a.options.outputFormat.comma,a.options.outputFormat.negativeComma,a.options.outputFormat.dotNegative,a.options.outputFormat.commaNegative])||n.throwError("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [".concat(r.outputFormat,"] given.")),n.isTrueOrFalseString(r.isCancellable)||n.isBoolean(r.isCancellable)||n.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(r.isCancellable,"] given.")),n.isTrueOrFalseString(r.modifyValueOnWheel)||n.isBoolean(r.modifyValueOnWheel)||n.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(r.modifyValueOnWheel,"] given.")),n.isTrueOrFalseString(r.watchExternalChanges)||n.isBoolean(r.watchExternalChanges)||n.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(r.watchExternalChanges,"] given.")),n.isInArray(r.wheelOn,[a.options.wheelOn.focus,a.options.wheelOn.hover])||n.throwError("The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [".concat(r.wheelOn,"] given.")),(n.isString(r.wheelStep)||n.isNumber(r.wheelStep))&&("progressive"===r.wheelStep||p.test(r.wheelStep))&&0!==Number(r.wheelStep)||n.throwError("The wheel step value option 'wheelStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(r.wheelStep,"] given.")),n.isInArray(r.serializeSpaces,[a.options.serializeSpaces.plus,a.options.serializeSpaces.percent])||n.throwError("The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [".concat(r.serializeSpaces,"] given.")),n.isTrueOrFalseString(r.noEventListeners)||n.isBoolean(r.noEventListeners)||n.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(r.noEventListeners,"] given.")),n.isNull(r.styleRules)||n.isObject(r.styleRules)&&(Object.prototype.hasOwnProperty.call(r.styleRules,"positive")||Object.prototype.hasOwnProperty.call(r.styleRules,"negative")||Object.prototype.hasOwnProperty.call(r.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(r.styleRules,"userDefined"))||n.throwError("The option 'styleRules' is invalid ; it should be a correctly structured object, with one or more 'positive', 'negative', 'ranges' or 'userDefined' attributes, [".concat(r.styleRules,"] given.")),n.isNull(r.styleRules)||!Object.prototype.hasOwnProperty.call(r.styleRules,"userDefined")||n.isNull(r.styleRules.userDefined)||r.styleRules.userDefined.forEach(function(R){Object.prototype.hasOwnProperty.call(R,"callback")&&!n.isFunction(R.callback)&&n.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(V(R.callback)," given."))}),(n.isNull(r.rawValueDivisor)||p.test(r.rawValueDivisor))&&0!==r.rawValueDivisor&&"0"!==r.rawValueDivisor&&1!==r.rawValueDivisor&&"1"!==r.rawValueDivisor||n.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(r.rawValueDivisor,"] given.")),n.isTrueOrFalseString(r.readOnly)||n.isBoolean(r.readOnly)||n.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(r.readOnly,"] given.")),n.isTrueOrFalseString(r.unformatOnHover)||n.isBoolean(r.unformatOnHover)||n.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(r.unformatOnHover,"] given.")),n.isTrueOrFalseString(r.failOnUnknownOption)||n.isBoolean(r.failOnUnknownOption)||n.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(r.failOnUnknownOption,"] given.")),n.isTrueOrFalseString(r.createLocalList)||n.isBoolean(r.createLocalList)||n.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(r.createLocalList,"] given."))}},{key:"_validateDecimalPlacesRawValue",value:function(e){n.isNull(e.decimalPlacesRawValue)||(e.decimalPlacesRawValue<e.decimalPlaces&&n.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones to display [").concat(e.decimalPlaces,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlaces`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnFocus&&n.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown on focus [").concat(e.decimalPlacesShownOnFocus,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnFocus`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnBlur&&n.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown when unfocused [").concat(e.decimalPlacesShownOnBlur,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnBlur`."),e.showWarnings))}},{key:"areSettingsValid",value:function(e){var t=!0;try{this.validate(e,!0)}catch{t=!1}return t}},{key:"getDefaultConfig",value:function(){return a.defaultSettings}},{key:"getPredefinedOptions",value:function(){return a.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var t,i=this;return n.isUndefinedOrNullOrEmpty(e)||0===e.length?t=null:(t={},1===e.length&&Array.isArray(e[0])?e[0].forEach(function(s){x(t,i._getOptionObject(s))}):1<=e.length&&e.forEach(function(s){x(t,i._getOptionObject(s))})),t}},{key:"format",value:function(e){if(n.isUndefined(e)||null===e)return null;var t;t=n.isElement(e)?n.getElementValue(e):e,n.isString(t)||n.isNumber(t)||n.throwError('The value "'.concat(t,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var i=arguments.length,s=new Array(1<i?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];var r=this._generateOptionsObjectFromOptionsArray(s),m=x({},this.getDefaultConfig(),r);m.isNegativeSignAllowed=t<0,m.isPositiveSignAllowed=0<=t,this._setBrackets(m),this._cachesUsualRegularExpressions(m,{});var v=this._toNumericValue(t,m);return isNaN(Number(v))&&n.throwError("The value [".concat(v,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(v,m)||(n.triggerEvent(a.events.formatted,document,{oldValue:null,newValue:null,oldRawValue:null,newRawValue:null,isPristine:null,error:"Range test failed",aNElement:null},!0,!0),n.throwError("The value [".concat(v,"] being set falls outside of the minimumValue [").concat(m.minimumValue,"] and maximumValue [").concat(m.maximumValue,"] range set for this element"))),m.valuesToStrings&&this._checkValuesToStringsSettings(t,m)?m.valuesToStrings[t]:(this._correctNegativePositiveSignPlacementOption(m),this._calculateDecimalPlacesOnInit(m),n.isUndefinedOrNullOrEmpty(m.rawValueDivisor)||0===m.rawValueDivisor||""===v||null===v||(v*=m.rawValueDivisor),v=this._roundFormattedValueShownOnFocus(v,m),v=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(v,m),v=this._addGroupSeparators(v,m,!1,v))}},{key:"formatAndSet",value:function(e,t){var s=this.format(e,1<arguments.length&&void 0!==t?t:null);return n.setElementValue(e,s),s}},{key:"unformat",value:function(e){if(n.isNumberStrict(e))return e;var t;if(""===(t=n.isElement(e)?n.getElementValue(e):e))return"";if(n.isUndefined(t)||null===t)return null;(n.isArray(t)||n.isObject(t))&&n.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(t,"] given."));for(var i=arguments.length,s=new Array(1<i?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];var r=this._generateOptionsObjectFromOptionsArray(s),m=x({},this.getDefaultConfig(),r);if(m.isNegativeSignAllowed=!1,m.isPositiveSignAllowed=!0,t=t.toString(),m.valuesToStrings&&this._checkStringsToValuesSettings(t,m))return n.objectKeyLookup(m.valuesToStrings,t);if(n.isNegative(t,m.negativeSignCharacter))m.isNegativeSignAllowed=!0,m.isPositiveSignAllowed=!1;else if(!n.isNull(m.negativeBracketsTypeOnBlur)){var v=L(m.negativeBracketsTypeOnBlur.split(","),2);m.firstBracket=v[0],m.lastBracket=v[1],t.charAt(0)===m.firstBracket&&t.charAt(t.length-1)===m.lastBracket&&(m.isNegativeSignAllowed=!0,m.isPositiveSignAllowed=!1,t=this._removeBrackets(t,m,!1))}return t=this._convertToNumericString(t,m),new RegExp("[^+-0123456789.]","gi").test(t)?NaN:(this._correctNegativePositiveSignPlacementOption(m),m.originalDecimalPlacesRawValue=m.decimalPlacesRawValue?m.decimalPlacesRawValue:m.decimalPlaces,this._calculateDecimalPlacesOnInit(m),n.isUndefinedOrNullOrEmpty(m.rawValueDivisor)||0===m.rawValueDivisor||""===t||null===t||(t/=m.rawValueDivisor),t=(t=this._roundRawValue(t,m)).replace(m.decimalCharacter,"."),t=this._toLocale(t,m.outputFormat,m))}},{key:"unformatAndSet",value:function(e,t){var s=this.unformat(e,1<arguments.length&&void 0!==t?t:null);return n.setElementValue(e,s),s}},{key:"localize",value:function(e,t){var i,s,u=1<arguments.length&&void 0!==t?t:null;return""===(i=n.isElement(e)?n.getElementValue(e):e)?"":(n.isNull(u)&&(u=a.defaultSettings),i=this.unformat(i,u),0===Number(i)&&u.leadingZero!==a.options.leadingZero.keep&&(i="0"),s=n.isNull(u)?u.outputFormat:a.defaultSettings.outputFormat,this._toLocale(i,s,u))}},{key:"localizeAndSet",value:function(e,t){var s=this.localize(e,1<arguments.length&&void 0!==t?t:null);return n.setElementValue(e,s),s}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var t=n.domElement(e);return this.isManagedByAutoNumeric(t)?this._getFromGlobalList(t):null}},{key:"set",value:function(e,t,i,s){var u,r=2<arguments.length&&void 0!==i?i:null,m=!(3<arguments.length&&void 0!==s)||s,v=n.domElement(e);return this.isManagedByAutoNumeric(v)?this.getAutoNumericElement(v).set(t,r,m):(u=!(!n.isNull(r)&&Object.prototype.hasOwnProperty.call(r,"showWarnings"))||r.showWarnings,n.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",u),null)}},{key:"getNumericString",value:function(e,t){return this._get(e,"getNumericString",1<arguments.length&&void 0!==t?t:null)}},{key:"getFormatted",value:function(e,t){return this._get(e,"getFormatted",1<arguments.length&&void 0!==t?t:null)}},{key:"getNumber",value:function(e,t){return this._get(e,"getNumber",1<arguments.length&&void 0!==t?t:null)}},{key:"_get",value:function(e,t,i){var s=2<arguments.length&&void 0!==i?i:null,u=n.domElement(e);return this.isManagedByAutoNumeric(u)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(u)[t](s)}},{key:"getLocalized",value:function(e,t,i){var s=1<arguments.length&&void 0!==t?t:null,u=2<arguments.length&&void 0!==i?i:null,r=n.domElement(e);return this.isManagedByAutoNumeric(r)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(r).getLocalized(s,u)}},{key:"_stripAllNonNumberCharacters",value:function(e,t,i,s){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,t,i,s).replace(t.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,t,i,s){var u=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,t)).replace(t.allowedAutoStrip,"")).match(t.numRegAutoStrip);if(e=u?[u[1],u[2],u[3]].join(""):"",t.leadingZero===a.options.leadingZero.allow||t.leadingZero===a.options.leadingZero.keep){var r="",m=L(e.split(t.decimalCharacter),2),_=m[1],h=m[0];n.contains(h,t.negativeSignCharacter)&&(r=t.negativeSignCharacter,h=h.replace(t.negativeSignCharacter,"")),""===r&&h.length>t.mIntPos&&"0"===h.charAt(0)&&(h=h.slice(1)),""!==r&&h.length>t.mIntNeg&&"0"===h.charAt(0)&&(h=h.slice(1)),e="".concat(r).concat(h).concat(n.isUndefined(_)?"":t.decimalCharacter+_)}return(i&&t.leadingZero===a.options.leadingZero.deny||!s&&t.leadingZero===a.options.leadingZero.allow)&&(e=e.replace(t.stripReg,"$1$2")),e}},{key:"_toggleNegativeBracket",value:function(e,t,i){return i?this._removeBrackets(e,t):this._addBrackets(e,t)}},{key:"_addBrackets",value:function(e,t){return n.isNull(t.negativeBracketsTypeOnBlur)?e:"".concat(t.firstBracket).concat(e.replace(t.negativeSignCharacter,"")).concat(t.lastBracket)}},{key:"_removeBrackets",value:function(e,t,i){var s,u=!(2<arguments.length&&void 0!==i)||i;return n.isNull(t.negativeBracketsTypeOnBlur)||e.charAt(0)!==t.firstBracket?e:(s=(s=e.replace(t.firstBracket,"")).replace(t.lastBracket,""),u?(s=s.replace(t.currencySymbol,""),this._mergeCurrencySignNegativePositiveSignAndValue(s,t,!0,!1)):"".concat(t.negativeSignCharacter).concat(s))}},{key:"_setBrackets",value:function(e){if(n.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var t=L(e.negativeBracketsTypeOnBlur.split(","),2),s=t[1];e.firstBracket=t[0],e.lastBracket=s}}},{key:"_convertToNumericString",value:function(e,t){e=this._removeBrackets(e,t,!1),e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,t)).replace(new RegExp("[".concat(t.digitGroupSeparator,"]"),"g"),""),"."!==t.decimalCharacter&&(e=e.replace(t.decimalCharacter,".")),n.isNegative(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-".concat(e)),t.showPositiveSign&&(e=e.replace(t.positiveSignCharacter,""));var s=n.arabicToLatinNumbers(e,t.leadingZero!==a.options.leadingZero.keep,!1,!1);return isNaN(s)||(e=s.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,t){return e=String(e),t.currencySymbol!==a.options.currencySymbol.none&&(e=e.replace(t.currencySymbol,"")),t.suffixText!==a.options.suffixText.none&&(e=e.replace(t.suffixText,"")),t.negativeSignCharacter!==a.options.negativeSignCharacter.hyphen&&(e=e.replace(t.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,t,i){if(n.isNull(t)||t===a.options.outputFormat.string)return e;var s;switch(t){case a.options.outputFormat.number:s=Number(e);break;case a.options.outputFormat.dotNegative:s=n.isNegative(e)?e.replace("-","")+"-":e;break;case a.options.outputFormat.comma:case a.options.outputFormat.negativeComma:s=e.replace(".",",");break;case a.options.outputFormat.commaNegative:s=e.replace(".",","),s=n.isNegative(s)?s.replace("-","")+"-":s;break;case a.options.outputFormat.dot:case a.options.outputFormat.negativeDot:s=e;break;default:n.throwError("The given outputFormat [".concat(t,"] option is not recognized."))}return t!==a.options.outputFormat.number&&"-"!==i.negativeSignCharacter&&(s=s.replace("-",i.negativeSignCharacter)),s}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,t){return"-"!==t.negativeSignCharacter&&(e=e.replace("-",t.negativeSignCharacter)),"."!==t.decimalCharacter&&(e=e.replace(".",t.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,t){return""===e||e===t.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(e,t,i){var s;if(t.emptyInputBehavior===a.options.emptyInputBehavior.always||i)switch(t.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.none:s=e+t.currencySymbol+t.suffixText;break;default:s=t.currencySymbol+e+t.suffixText}else s=e;return s}},{key:"_addGroupSeparators",value:function(e,t,i,s,u){var r,m=4<arguments.length&&void 0!==u?u:null;if(r=n.isNull(m)?n.isNegative(e,t.negativeSignCharacter)||n.isNegativeWithBrackets(e,t.firstBracket,t.lastBracket):m<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,t,!1,i),this._isElementValueEmptyOrOnlyTheNegativeSign(e,t))return this._orderValueCurrencySymbolAndSuffixText(e,t,!0);var v,_=n.isZeroOrHasNoValue(e);switch(r&&(e=e.replace("-","")),t.digitalGroupSpacing=t.digitalGroupSpacing.toString(),t.digitalGroupSpacing){case a.options.digitalGroupSpacing.two:v=/(\d)((\d)(\d{2}?)+)$/;break;case a.options.digitalGroupSpacing.twoScaled:v=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case a.options.digitalGroupSpacing.four:v=/(\d)((\d{4}?)+)$/;break;default:v=/(\d)((\d{3}?)+)$/}var h,f=L(e.split(t.decimalCharacter),2),p=f[0],y=f[1];if(t.decimalCharacterAlternative&&n.isUndefined(y)){var O=L(e.split(t.decimalCharacterAlternative),2);p=O[0],y=O[1]}if(""!==t.digitGroupSeparator)for(;v.test(p);)p=p.replace(v,"$1".concat(t.digitGroupSeparator,"$2"));return e=0===(h=i?t.decimalPlacesShownOnFocus:t.decimalPlacesShownOnBlur)||n.isUndefined(y)?p:(y.length>h&&(y=y.substring(0,h)),"".concat(p).concat(t.decimalCharacter).concat(y)),e=a._mergeCurrencySignNegativePositiveSignAndValue(e,t,r,_),n.isNull(m)&&(m=s),null!==t.negativeBracketsTypeOnBlur&&(m<0||n.isNegativeStrict(e,t.negativeSignCharacter))&&(e=this._toggleNegativeBracket(e,t,i)),t.suffixText?"".concat(e).concat(t.suffixText):e}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(e,t,i,s){var u,r="";if(i?r=t.negativeSignCharacter:t.showPositiveSign&&!s&&(r=t.positiveSignCharacter),t.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix)if(t.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&t.showPositiveSign&&!s))switch(t.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:u="".concat(r).concat(t.currencySymbol).concat(e);break;case a.options.negativePositiveSignPlacement.right:u="".concat(t.currencySymbol).concat(r).concat(e);break;case a.options.negativePositiveSignPlacement.suffix:u="".concat(t.currencySymbol).concat(e).concat(r)}else u=t.currencySymbol+e;else if(t.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)if(t.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(i||!i&&t.showPositiveSign&&!s))switch(t.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:u="".concat(e).concat(t.currencySymbol).concat(r);break;case a.options.negativePositiveSignPlacement.left:u="".concat(e).concat(r).concat(t.currencySymbol);break;case a.options.negativePositiveSignPlacement.prefix:u="".concat(r).concat(e).concat(t.currencySymbol)}else u=e+t.currencySymbol;return u}},{key:"_truncateZeros",value:function(e,t){var i;switch(t){case 0:i=/(\.(?:\d*[1-9])?)0*$/;break;case 1:i=/(\.\d(?:\d*[1-9])?)0*$/;break;default:i=new RegExp("(\\.\\d{".concat(t,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(i,"$1"),0===t&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,t){return this._roundValue(e,t,t.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,t){return this._roundValue(e,t,Number(t.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,t){return this._roundValue(e,t,Number(t.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,t,i){return i?this._roundFormattedValueShownOnFocus(e,t):this._roundFormattedValueShownOnBlur(e,t)}},{key:"_roundValue",value:function(e,t,i){if(n.isNull(e))return e;if(e=""===e?"0":e.toString(),t.roundingMethod===a.options.roundingMethod.toNearest05||t.roundingMethod===a.options.roundingMethod.toNearest05Alt||t.roundingMethod===a.options.roundingMethod.upToNext05||t.roundingMethod===a.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,t);var s,u=L(a._prepareValueForRounding(e,t),2),r=u[0],m=(e=u[1]).lastIndexOf("."),v=-1===m,_=L(e.split("."),2),h=_[0];if(!(0<_[1]||t.allowDecimalPadding!==a.options.allowDecimalPadding.never&&t.allowDecimalPadding!==a.options.allowDecimalPadding.floats))return 0===Number(e)?h:"".concat(r).concat(h);s=t.allowDecimalPadding===a.options.allowDecimalPadding.always||t.allowDecimalPadding===a.options.allowDecimalPadding.floats?i:0;var f,y=e.length-1-(v?e.length-1:m),O="";if(y<=i){if(O=e,y<s){v&&(O="".concat(O).concat(t.decimalCharacter));for(var N="000000";y<s;)O+=N=N.substring(0,s-y),y+=N.length}else s<y?O=this._truncateZeros(O,s):0===y&&0===s&&(O=O.replace(/\.$/,""));return 0===Number(O)?O:"".concat(r).concat(O)}f=v?i-1:Number(i)+Number(m);var R,G=Number(e.charAt(f+1)),$=e.substring(0,f+1).split("");if(R="."===e.charAt(f)?e.charAt(f-1)%2:e.charAt(f)%2,this._shouldRoundUp(G,t,r,R))for(var Z=$.length-1;0<=Z;--Z)if("."!==$[Z]){if($[Z]=+$[Z]+1,$[Z]<10)break;0<Z&&($[Z]="0")}return $=$.slice(0,f+1),O=this._truncateZeros($.join(""),s),0===Number(O)?O:"".concat(r).concat(O)}},{key:"_roundCloseTo05",value:function(e,t){switch(t.roundingMethod){case a.options.roundingMethod.toNearest05:case a.options.roundingMethod.toNearest05Alt:e=(Math.round(20*e)/20).toString();break;case a.options.roundingMethod.upToNext05:e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}return n.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,t){var i="";return n.isNegativeStrict(e,"-")&&(i="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),0===Number(e)&&(i=""),(0<Number(e)&&t.leadingZero!==a.options.leadingZero.keep||0<e.length&&t.leadingZero===a.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[i,e]}},{key:"_shouldRoundUp",value:function(e,t,i,s){return 4<e&&t.roundingMethod===a.options.roundingMethod.halfUpSymmetric||4<e&&t.roundingMethod===a.options.roundingMethod.halfUpAsymmetric&&""===i||5<e&&t.roundingMethod===a.options.roundingMethod.halfUpAsymmetric&&"-"===i||5<e&&t.roundingMethod===a.options.roundingMethod.halfDownSymmetric||5<e&&t.roundingMethod===a.options.roundingMethod.halfDownAsymmetric&&""===i||4<e&&t.roundingMethod===a.options.roundingMethod.halfDownAsymmetric&&"-"===i||5<e&&t.roundingMethod===a.options.roundingMethod.halfEvenBankersRounding||5===e&&t.roundingMethod===a.options.roundingMethod.halfEvenBankersRounding&&1===s||0<e&&t.roundingMethod===a.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===i||0<e&&t.roundingMethod===a.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===i||0<e&&t.roundingMethod===a.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,t,i,s){i&&(e=this._roundFormattedValueShownOnFocus(e,t));var u=L(e.split(t.decimalCharacter),2),r=u[0],m=u[1];if(m&&m.length>s)if(0<s){var v=m.substring(0,s);e="".concat(r).concat(t.decimalCharacter).concat(v)}else e=r;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,t){if(n.isNull(e)&&t.emptyInputBehavior===a.options.emptyInputBehavior.null||t.overrideMinMaxLimits===a.options.overrideMinMaxLimits.ignore||t.overrideMinMaxLimits===a.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var i,s=n.parseStr(t.minimumValue),u=n.parseStr(t.maximumValue),r=n.parseStr(e);switch(t.overrideMinMaxLimits){case a.options.overrideMinMaxLimits.floor:i=[-1<n.testMinMax(s,r),!0];break;case a.options.overrideMinMaxLimits.ceiling:i=[!0,n.testMinMax(u,r)<1];break;default:i=[-1<n.testMinMax(s,r),n.testMinMax(u,r)<1]}return i}},{key:"_isWithinRangeWithOverrideOption",value:function(e,t){var i=L(this._checkIfInRangeWithOverrideOption(e,t),2);return i[0]&&i[1]}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),n.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,t){return-1<n.testMinMax(n.parseStr(t.minimumValue),this._cleanValueForRangeParse(e))}},{key:"_isMaximumRangeRespected",value:function(e,t){return n.testMinMax(n.parseStr(t.maximumValue),this._cleanValueForRangeParse(e))<1}},{key:"_readCookie",value:function(e){for(var t=e+"=",i=document.cookie.split(";"),s="",u=0;u<i.length;u+=1){for(s=i[u];" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return s.substring(t.length,s.length)}return null}},{key:"_storageTest",value:function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch{return!1}}},{key:"_correctNegativePositiveSignPlacementOption",value:function(e){if(n.isNull(e.negativePositiveSignPlacement))if(n.isUndefined(e)||!n.isUndefinedOrNullOrEmpty(e.negativePositiveSignPlacement)||n.isUndefinedOrNullOrEmpty(e.currencySymbol))e.negativePositiveSignPlacement=a.options.negativePositiveSignPlacement.left;else switch(e.currencySymbolPlacement){case a.options.currencySymbolPlacement.suffix:e.negativePositiveSignPlacement=a.options.negativePositiveSignPlacement.prefix;break;case a.options.currencySymbolPlacement.prefix:e.negativePositiveSignPlacement=a.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(e){return n.isNull(e)?null:(!n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=a.options.selectOnFocus.doNotSelect),n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&e.selectOnFocus===a.options.selectOnFocus.select&&(e.caretPositionOnFocus=a.options.caretPositionOnFocus.doNoForceCaretPosition),e)}},{key:"_calculateDecimalPlacesOnInit",value:function(e){this._validateDecimalPlacesRawValue(e),e.decimalPlacesShownOnFocus===a.options.decimalPlacesShownOnFocus.useDefault&&(e.decimalPlacesShownOnFocus=e.decimalPlaces),e.decimalPlacesShownOnBlur===a.options.decimalPlacesShownOnBlur.useDefault&&(e.decimalPlacesShownOnBlur=e.decimalPlaces),e.decimalPlacesRawValue===a.options.decimalPlacesRawValue.useDefault&&(e.decimalPlacesRawValue=e.decimalPlaces);var t=0;e.rawValueDivisor&&e.rawValueDivisor!==a.options.rawValueDivisor.none&&(t=String(e.rawValueDivisor).length-1)<0&&(t=0),e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+t,Number(e.originalDecimalPlacesRawValue)+t)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;this._validateDecimalPlacesRawValue(e),n.isNull(i)&&n.throwError("When updating the settings, the previous ones should be passed as an argument.");var s="decimalPlaces"in e;if(s||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){s?("decimalPlacesShownOnFocus"in e&&e.decimalPlacesShownOnFocus!==a.options.decimalPlacesShownOnFocus.useDefault||(e.decimalPlacesShownOnFocus=e.decimalPlaces),"decimalPlacesShownOnBlur"in e&&e.decimalPlacesShownOnBlur!==a.options.decimalPlacesShownOnBlur.useDefault||(e.decimalPlacesShownOnBlur=e.decimalPlaces),"decimalPlacesRawValue"in e&&e.decimalPlacesRawValue!==a.options.decimalPlacesRawValue.useDefault||(e.decimalPlacesRawValue=e.decimalPlaces)):(n.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=i.decimalPlacesShownOnFocus),n.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=i.decimalPlacesShownOnBlur));var u=0;e.rawValueDivisor&&e.rawValueDivisor!==a.options.rawValueDivisor.none&&(u=String(e.rawValueDivisor).length-1)<0&&(u=0),e.decimalPlacesRawValue=e.decimalPlaces||e.decimalPlacesRawValue?Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+u,Number(e.decimalPlacesRawValue)+u):Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+u,Number(i.originalDecimalPlacesRawValue)+u)}}},{key:"_cachesUsualRegularExpressions",value:function(e,t){var i;i=e.negativeSignCharacter!==a.options.negativeSignCharacter.hyphen?"([-\\".concat(e.negativeSignCharacter,"]?)"):"(-?)",t.aNegRegAutoStrip=i,e.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(e.decimalCharacter,"]"),"g"),e.numRegAutoStrip=new RegExp("".concat(i,"(?:\\").concat(e.decimalCharacter,"?([0-9]+\\").concat(e.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(e.decimalCharacter,"[0-9]*)?))")),e.stripReg=new RegExp("^".concat(t.aNegRegAutoStrip,"0*([0-9])")),e.formulaChars=new RegExp("[0-9".concat(e.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var t={aSep:"digitGroupSeparator",nSep:"showOnlyNumbersOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"decimalPlacesShownOnBlur",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",allowDecimalPadding:!0,alwaysAllowDecimalCharacter:!0,caretPositionOnFocus:!0,createLocalList:!0,currencySymbol:!0,currencySymbolPlacement:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,decimalPlaces:!0,decimalPlacesRawValue:!0,decimalPlacesShownOnBlur:!0,decimalPlacesShownOnFocus:!0,defaultValueOverride:!0,digitalGroupSpacing:!0,digitGroupSeparator:!0,divisorWhenUnfocused:!0,emptyInputBehavior:!0,eventBubbles:!0,eventIsCancelable:!0,failOnUnknownOption:!0,formatOnPageLoad:!0,formulaMode:!0,historySize:!0,isCancellable:!0,leadingZero:!0,maximumValue:!0,minimumValue:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,noEventListeners:!0,onInvalidPaste:!0,outputFormat:!0,overrideMinMaxLimits:!0,positiveSignCharacter:!0,rawValueDivisor:!0,readOnly:!0,roundingMethod:!0,saveValueToSessionStorage:!0,selectNumberOnly:!0,selectOnFocus:!0,serializeSpaces:!0,showOnlyNumbersOnFocus:!0,showPositiveSign:!0,showWarnings:!0,styleRules:!0,suffixText:!0,symbolWhenUnfocused:!0,unformatOnHover:!0,unformatOnSubmit:!0,valuesToStrings:!0,watchExternalChanges:!0,wheelOn:!0,wheelStep:!0,allowedAutoStrip:!0,formulaChars:!0,isNegativeSignAllowed:!0,isPositiveSignAllowed:!0,mIntNeg:!0,mIntPos:!0,numRegAutoStrip:!0,originalDecimalPlaces:!0,originalDecimalPlacesRawValue:!0,stripReg:!0};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(!0===t[i])continue;Object.prototype.hasOwnProperty.call(t,i)?(n.warning("You are using the deprecated option name '".concat(i,"'. Please use '").concat(t[i],"' instead from now on. The old option name will be dropped very soon\u2122."),!0),e[t[i]]=e[i],delete e[i]):e.failOnUnknownOption&&n.throwError("Option name '".concat(i,"' is unknown. Please fix the options passed to autoNumeric"))}"mDec"in e&&n.warning("The old `mDec` option has been deprecated in favor of more accurate options ; `decimalPlaces`, `decimalPlacesRawValue`, `decimalPlacesShownOnFocus` and `decimalPlacesShownOnBlur`.",!0)}},{key:"_setNegativePositiveSignPermissions",value:function(e){e.isNegativeSignAllowed=e.minimumValue<0,e.isPositiveSignAllowed=0<=e.maximumValue}},{key:"_toNumericValue",value:function(e,t){var i;return n.isNumber(Number(e))?i=n.scientificToDecimal(e):(i=this._convertToNumericString(e.toString(),t),n.isNumber(Number(i))||(n.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),t.showWarnings),i=NaN)),i}},{key:"_checkIfInRange",value:function(e,t,i){var s=n.parseStr(e);return-1<n.testMinMax(t,s)&&n.testMinMax(i,s)<1}},{key:"_shouldSkipEventKey",value:function(e){var t=n.isInArray(e,g.keyName._allFnKeys),i=e===g.keyName.OSLeft||e===g.keyName.OSRight,s=e===g.keyName.ContextMenu,u=n.isInArray(e,g.keyName._someNonPrintableKeys);return t||i||s||u||e===g.keyName.Unidentified||e===g.keyName.NumLock||e===g.keyName.ScrollLock||e===g.keyName.Insert||e===g.keyName.Command}},{key:"_serialize",value:function(e,t,i,s,u){var r,m=this,v=1<arguments.length&&void 0!==t&&t,_=2<arguments.length&&void 0!==i?i:"unformatted",h=3<arguments.length&&void 0!==s?s:"+",f=4<arguments.length&&void 0!==u?u:null,p=[];return"object"===V(e)&&"form"===e.nodeName.toLowerCase()&&Array.prototype.slice.call(e.elements).forEach(function(y){if(y.name&&!y.disabled&&-1===["file","reset","submit","button"].indexOf(y.type))if("select-multiple"===y.type)Array.prototype.slice.call(y.options).forEach(function(G){G.selected&&p.push(v?{name:y.name,value:G.value}:"".concat(encodeURIComponent(y.name),"=").concat(encodeURIComponent(G.value)))});else if(-1===["checkbox","radio"].indexOf(y.type)||y.checked){var O,N;if(m.isManagedByAutoNumeric(y))switch(_){case"unformatted":N=m.getAutoNumericElement(y),n.isNull(N)||(O=m.unformat(y,N.getSettings()));break;case"localized":if(N=m.getAutoNumericElement(y),!n.isNull(N)){var R=n.cloneObject(N.getSettings());n.isNull(f)||(R.outputFormat=f),O=m.localize(y,R)}break;default:O=y.value}else O=y.value;n.isUndefined(O)&&n.throwError("This error should never be hit. If it has, something really wrong happened!"),p.push(v?{name:y.name,value:O}:"".concat(encodeURIComponent(y.name),"=").concat(encodeURIComponent(O)))}}),v?r=p:(r=p.join("&"),"+"===h&&(r=r.replace(/%20/g,"+"))),r}},{key:"_serializeNumericString",value:function(e,t){return this._serialize(e,!1,"unformatted",1<arguments.length&&void 0!==t?t:"+")}},{key:"_serializeFormatted",value:function(e,t){return this._serialize(e,!1,"formatted",1<arguments.length&&void 0!==t?t:"+")}},{key:"_serializeLocalized",value:function(e,t,i){return this._serialize(e,!1,"localized",1<arguments.length&&void 0!==t?t:"+",2<arguments.length&&void 0!==i?i:null)}},{key:"_serializeNumericStringArray",value:function(e,t){return this._serialize(e,!0,"unformatted",1<arguments.length&&void 0!==t?t:"+")}},{key:"_serializeFormattedArray",value:function(e,t){return this._serialize(e,!0,"formatted",1<arguments.length&&void 0!==t?t:"+")}},{key:"_serializeLocalizedArray",value:function(e,t,i){return this._serialize(e,!0,"localized",1<arguments.length&&void 0!==t?t:"+",2<arguments.length&&void 0!==i?i:null)}}],z((o=a).prototype,[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=n.scientificToDecimal(this.domElement.getAttribute("value")),n.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,n.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this._onFocusInFunc=function(t){e._onFocusIn(t)},this._onFocusInAndMouseEnterFunc=function(t){e._onFocusInAndMouseEnter(t)},this._onFocusFunc=function(){e._onFocus()},this._onKeydownFunc=function(t){e._onKeydown(t)},this._onKeypressFunc=function(t){e._onKeypress(t)},this._onKeyupFunc=function(t){e._onKeyup(t)},this._onFocusOutAndMouseLeaveFunc=function(t){e._onFocusOutAndMouseLeave(t)},this._onPasteFunc=function(t){e._onPaste(t)},this._onWheelFunc=function(t){e._onWheel(t)},this._onDropFunc=function(t){e._onDrop(t)},this._onKeydownGlobalFunc=function(t){e._onKeydownGlobal(t)},this._onKeyupGlobalFunc=function(t){e._onKeyupGlobal(t)},this.domElement.addEventListener("focusin",this._onFocusInFunc,!1),this.domElement.addEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("focus",this._onFocusFunc,!1),this.domElement.addEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("keydown",this._onKeydownFunc,!1),this.domElement.addEventListener("keypress",this._onKeypressFunc,!1),this.domElement.addEventListener("keyup",this._onKeyupFunc,!1),this.domElement.addEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("paste",this._onPasteFunc,!1),this.domElement.addEventListener("wheel",this._onWheelFunc,!1),this.domElement.addEventListener("drop",this._onDropFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,a._doesGlobalListExists()||(document.addEventListener("keydown",this._onKeydownGlobalFunc,!1),document.addEventListener("keyup",this._onKeyupGlobalFunc,!1))}},{key:"_removeEventListeners",value:function(){this.domElement.removeEventListener("focusin",this._onFocusInFunc,!1),this.domElement.removeEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("focus",this._onFocusFunc,!1),this.domElement.removeEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("keydown",this._onKeydownFunc,!1),this.domElement.removeEventListener("keypress",this._onKeypressFunc,!1),this.domElement.removeEventListener("keyup",this._onKeyupFunc,!1),this.domElement.removeEventListener("paste",this._onPasteFunc,!1),this.domElement.removeEventListener("wheel",this._onWheelFunc,!1),this.domElement.removeEventListener("drop",this._onDropFunc,!1),this._removeFormListener(),this.hasEventListeners=!1,document.removeEventListener("keydown",this._onKeydownGlobalFunc,!1),document.removeEventListener("keyup",this._onKeyupGlobalFunc,!1)}},{key:"_updateEventListeners",value:function(){this.settings.noEventListeners||this.hasEventListeners||this._createEventListeners(),this.settings.noEventListeners&&this.hasEventListeners&&this._removeEventListeners()}},{key:"_setupFormListener",value:function(){var e=this;n.isNull(this.parentForm)||(this._onFormSubmitFunc=function(){e._onFormSubmit()},this._onFormResetFunc=function(){e._onFormReset()},this._hasParentFormCounter()?this._incrementParentFormCounter():(this._initializeFormCounterToOne(),this.parentForm.addEventListener("submit",this._onFormSubmitFunc,!1),this.parentForm.addEventListener("reset",this._onFormResetFunc,!1),this._storeFormHandlerFunction()))}},{key:"_removeFormListener",value:function(){if(!n.isNull(this.parentForm)){var e=this._getParentFormCounter();1===e?(this.parentForm.removeEventListener("submit",this._getFormHandlerFunction().submitFn,!1),this.parentForm.removeEventListener("reset",this._getFormHandlerFunction().resetFn,!1),this._removeFormDataSetInfo()):1<e?this._decrementParentFormCounter():n.throwError("The AutoNumeric object count on the form is incoherent.")}}},{key:"_hasParentFormCounter",value:function(){return"anCount"in this.parentForm.dataset}},{key:"_getParentFormCounter",value:function(){return Number(this.parentForm.dataset.anCount)}},{key:"_initializeFormCounterToOne",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(e){return"anFormHandler"in this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset}},{key:"_getFormElement",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return n.isNull(t)?this.parentForm:t}},{key:"_storeFormHandlerFunction",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var i=n.randomString();this._getFormElement(t).dataset.anFormHandler=i,window.aNFormHandlerMap.set(i,{submitFn:this._onFormSubmitFunc,resetFn:this._onFormResetFunc})}},{key:"_getFormHandlerKey",value:function(){this._hasFormHandlerFunction()||n.throwError("Unable to retrieve the form handler name");var e=this.parentForm.dataset.anFormHandler;return""===e&&n.throwError("The form handler name is invalid"),e}},{key:"_getFormHandlerFunction",value:function(){var e=this._getFormHandlerKey();return window.aNFormHandlerMap.get(e)}},{key:"_removeFormDataSetInfo",value:function(){this._decrementParentFormCounter(),window.aNFormHandlerMap.delete(this._getFormHandlerKey()),this.parentForm.removeAttribute("data-an-count"),this.parentForm.removeAttribute("data-an-form-handler")}},{key:"_setWritePermissions",value:function(e){0<arguments.length&&void 0!==e&&e&&this.domElement.readOnly||this.settings.readOnly?this._setReadOnly():this._setReadWrite()}},{key:"_setReadOnly",value:function(){this.isInputElement?this.domElement.readOnly=!0:this.domElement.setAttribute("contenteditable",!1)}},{key:"_setReadWrite",value:function(){this.isInputElement?this.domElement.readOnly=!1:this.domElement.setAttribute("contenteditable",!0)}},{key:"_addWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var t=this.getterSetter,i=t.set,s=t.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return s.call(e.domElement)},set:function(u){i.call(e.domElement,u),e.settings.watchExternalChanges&&!e.internalModification&&e.set(u)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var t=this.getterSetter,i=t.set,s=t.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return s.call(e.domElement)},set:function(u){i.call(e.domElement,u)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var t=this.domElement.nodeType;t===Node.ELEMENT_NODE||t===Node.DOCUMENT_NODE||t===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":t===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=0===this.historyTable.length;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var t=!0;if(!e){var i=this.historyTableIndex+1;i<this.historyTable.length&&this.rawValue===this.historyTable[i].value?t=!1:n.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,t){var s=n.getElementSelection(this.domElement);this.selectionStart=s.start,this.selectionEnd=s.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),1<this.historyTable.length&&(this.historyTable[this.historyTableIndex-1].start=this.selectionStart,this.historyTable[this.historyTableIndex-1].end=this.selectionEnd)}this.historyTable.length>this.settings.historySize&&this._historyTableForget()}}},{key:"_historyTableUndoOrRedo",value:function(e){var t;if(0<arguments.length&&void 0!==e&&!e?(t=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(t=0<this.historyTableIndex)&&this.historyTableIndex--,t){var i=this.historyTable[this.historyTableIndex];this.set(i.value,null,!1),n.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(e){for(var t=0<arguments.length&&void 0!==e?e:1,i=[],s=0;s<t;s++)i.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return 1===i.length?i[0]:i}},{key:"_historyTableCurrentValueUsed",value:function(){var e=this.historyTableIndex;return e<0&&(e=0),n.isUndefinedOrNullOrEmpty(this.historyTable[e])?"":this.historyTable[e].value}},{key:"_parseStyleRules",value:function(){var e=this;n.isUndefinedOrNullOrEmpty(this.settings.styleRules)||""===this.rawValue||(n.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)||(0<=this.rawValue?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||0===this.settings.styleRules.ranges.length||this.settings.styleRules.ranges.forEach(function(t){e.rawValue>=t.min&&e.rawValue<t.max?e._addCSSClass(t.class):e._removeCSSClass(t.class)}),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||0===this.settings.styleRules.userDefined.length||this.settings.styleRules.userDefined.forEach(function(t){if(n.isFunction(t.callback))if(n.isString(t.classes))t.callback(e.rawValue)?e._addCSSClass(t.classes):e._removeCSSClass(t.classes);else if(n.isArray(t.classes))if(2===t.classes.length)t.callback(e.rawValue)?(e._addCSSClass(t.classes[0]),e._removeCSSClass(t.classes[1])):(e._removeCSSClass(t.classes[0]),e._addCSSClass(t.classes[1]));else if(2<t.classes.length){var i=t.callback(e.rawValue);n.isArray(i)?t.classes.forEach(function(s,u){n.isInArray(u,i)?e._addCSSClass(s):e._removeCSSClass(s)}):n.isInt(i)?t.classes.forEach(function(s,u){u===i?e._addCSSClass(s):e._removeCSSClass(s)}):n.isNull(i)?t.classes.forEach(function(s){e._removeCSSClass(s)}):n.throwError("The callback result is not an array nor a valid array index, ".concat(V(i)," given."))}else n.throwError("The classes attribute is not valid for the `styleRules` option.");else n.isUndefinedOrNullOrEmpty(t.classes)?t.callback(e):n.throwError("The callback/classes structure is not valid for the `styleRules` option.");else n.warning("The given `styleRules` callback is not a function, ".concat(typeof callback>"u"?"undefined":V(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,t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];Array.isArray(i)&&Array.isArray(i[0])&&(i=i[0]);var u=n.cloneObject(this.settings),r=this.rawValue,m={};n.isUndefinedOrNullOrEmpty(i)||0===i.length?m=null:1<=i.length&&i.forEach(function(v){e.constructor._isPreDefinedOptionValid(v)&&(v=e.constructor._getOptionObject(v)),x(m,v)});try{this._setSettings(m,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(r)}catch(v){return this._setSettings(u,!0),n.throwError("Unable to update the settings, those are invalid: [".concat(v,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e,t,i){var s,u=1<arguments.length&&void 0!==t?t:null,r=!(2<arguments.length&&void 0!==i)||i;if(n.isUndefined(e))return n.warning("You are trying to set an 'undefined' value ; an error could have occurred.",this.settings.showWarnings),this;if(n.isNull(u)||this._setSettings(u,!0),null===e&&this.settings.emptyInputBehavior!==a.options.emptyInputBehavior.null)return n.warning("You are trying to set the `null` value while the `emptyInputBehavior` option is set to ".concat(this.settings.emptyInputBehavior,". If you want to be able to set the `null` value, you need to change the 'emptyInputBehavior' option to `'null'`."),this.settings.showWarnings),this;if(null===e)return this._setElementAndRawValue(null,null,r),this._saveValueToPersistentStorage(),this;if(s=this.constructor._toNumericValue(e,this.settings),isNaN(Number(s)))return n.warning("The value you are trying to set results in `NaN`. The element value is set to the empty string instead.",this.settings.showWarnings),this.setValue("",r),this;if(""===s)switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.zero:s=0;break;case a.options.emptyInputBehavior.min:s=this.settings.minimumValue;break;case a.options.emptyInputBehavior.max:s=this.settings.maximumValue;break;default:n.isNumber(this.settings.emptyInputBehavior)&&(s=Number(this.settings.emptyInputBehavior))}if(""===s)return this._setElementAndRawValue(this.settings.emptyInputBehavior===a.options.emptyInputBehavior.always?this.settings.currencySymbol:"","",r),this;var v=L(this.constructor._checkIfInRangeWithOverrideOption(s,this.settings),2),_=v[0],h=v[1];if(_&&h&&this.settings.valuesToStrings&&this._checkValuesToStrings(s))return this._setElementAndRawValue(this.settings.valuesToStrings[s],s,r),this._saveValueToPersistentStorage(),this;if(n.isZeroOrHasNoValue(s)&&(s="0"),_&&h){var f=this.constructor._roundRawValue(s,this.settings);return f=this._trimLeadingAndTrailingZeros(f.replace(this.settings.decimalCharacter,".")),s=this._getRawValueToFormat(s),s=this.isFocused?this.constructor._roundFormattedValueShownOnFocus(s,this.settings):(this.settings.divisorWhenUnfocused&&(s=(s/=this.settings.divisorWhenUnfocused).toString()),this.constructor._roundFormattedValueShownOnBlur(s,this.settings)),s=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(s,this.settings),s=this.constructor._addGroupSeparators(s,this.settings,this.isFocused,this.rawValue,f),!this.isFocused&&this.settings.symbolWhenUnfocused&&(s="".concat(s).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(s,f,r),this._setValidOrInvalidState(f),this}return this._triggerRangeEvents(_,h),n.throwError("The value [".concat(s,"] 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("",r),this}},{key:"setUnformatted",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;if(null===e||n.isUndefined(e))return this;n.isNull(i)||this._setSettings(i,!0);var s=this.constructor._removeBrackets(e,this.settings),u=this.constructor._stripAllNonNumberCharacters(s,this.settings,!0,this.isFocused);return n.isNumber(u)||n.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(u,this.settings)?this.setValue(e):n.throwError("The value is out of the range limits [".concat(this.settings.minimumValue,", ").concat(this.settings.maximumValue,"].")),this}},{key:"setValue",value:function(e,t){return this._setElementAndRawValue(e,!(1<arguments.length&&void 0!==t)||t),this}},{key:"_setRawValue",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t;if(this.rawValue!==e){var s=this.rawValue;this.rawValue=e,!n.isNull(this.settings.rawValueDivisor)&&0!==this.settings.rawValueDivisor&&""!==e&&null!==e&&this._isUserManuallyEditingTheValue()&&(this.rawValue/=this.settings.rawValueDivisor),this._triggerEvent(a.events.rawValueModified,this.domElement,{oldRawValue:s,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),i&&this._historyTableAdd()}}},{key:"_setElementValue",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t,s=n.getElementValue(this.domElement);return e!==s&&(this.internalModification=!0,n.setElementValue(this.domElement,e),this.internalModification=!1,i&&this._triggerEvent(a.events.formatted,this.domElement,{oldValue:s,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e,t,i){var s=1<arguments.length&&void 0!==t?t:null,u=!(2<arguments.length&&void 0!==i)||i;return n.isNull(s)?s=e:n.isBoolean(s)&&(u=s,s=e),this._setElementValue(e),this._setRawValue(s,u),this}},{key:"_getRawValueToFormat",value:function(e){return n.isNull(this.settings.rawValueDivisor)||0===this.settings.rawValueDivisor||""===e||null===e?e:e*this.settings.rawValueDivisor}},{key:"_checkValuesToStrings",value:function(e){return this.constructor._checkValuesToStringsArray(e,this.valuesToStringsKeys)}},{key:"_isUserManuallyEditingTheValue",value:function(){return this.isFocused&&this.isEditing||this.isDropEvent}},{key:"_executeCallback",value:function(e,t){!n.isNull(t)&&n.isFunction(t)&&t(e,this)}},{key:"_triggerEvent",value:function(e,t,i){var s=1<arguments.length&&void 0!==t?t:document;n.triggerEvent(e,s,2<arguments.length&&void 0!==i?i:null,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(e){return this.getNumericString(0<arguments.length&&void 0!==e?e:null)}},{key:"getNumericString",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=n.isNull(this.rawValue)?null:n.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(t,i),t}},{key:"getFormatted",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;"value"in this.domElement||"textContent"in this.domElement||n.throwError("Unable to get the formatted string from the element.");var i=n.getElementValue(this.domElement);return this._executeCallback(i,t),i}},{key:"getNumber",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(t,i),t}},{key:"getLocalized",value:function(e,t){var i,s,u=0<arguments.length&&void 0!==e?e:null,r=1<arguments.length&&void 0!==t?t:null;n.isFunction(u)&&n.isNull(r)&&(r=u,u=null),(i=n.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(i)&&this.settings.leadingZero!==a.options.leadingZero.keep&&(i="0"),s=n.isNull(u)?this.settings.outputFormat:u;var m=this.constructor._toLocale(i,s,this.settings);return this._executeCallback(m,r),m}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(e){return this._setElementValue(this.getLocalized(0<arguments.length&&void 0!==e?e:null)),this}},{key:"isPristine",value:function(e){return 0<arguments.length&&void 0!==e&&!e?this.initialValueHtmlAttribute===this.getFormatted():this.initialValue===this.getNumericString()}},{key:"select",value:function(){return this.settings.selectNumberOnly?this.selectNumber():this._defaultSelectAll(),this}},{key:"_defaultSelectAll",value:function(){n.setElementSelection(this.domElement,0,n.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,t,i=n.getElementValue(this.domElement),s=i.length,u=this.settings.currencySymbol.length,r=this.settings.currencySymbolPlacement,m=n.isNegative(i,this.settings.negativeSignCharacter)?1:0,v=this.settings.suffixText.length;if(e=r===a.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left&&1==m&&0<u?u+1:u,r===a.options.currencySymbolPlacement.prefix)t=s-v;else switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.left:t=s-(v+u);break;case a.options.negativePositiveSignPlacement.right:t=0<u?s-(u+m+v):s-(u+v);break;default:t=s-(u+v)}return n.setElementSelection(this.domElement,e,t),this}},{key:"selectInteger",value:function(){var e=0,t=0<=this.rawValue;this.settings.currencySymbolPlacement!==a.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==a.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&t||!t&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left)&&(e+=1),this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&(e+=this.settings.currencySymbol.length);var i=n.getElementValue(this.domElement),s=i.indexOf(this.settings.decimalCharacter);return-1===s&&(s=this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?i.length-this.settings.currencySymbol.length:i.length,t||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==a.options.currencySymbolPlacement.suffix||--s,s-=this.settings.suffixText.length),n.setElementSelection(this.domElement,e,s),this}},{key:"selectDecimal",value:function(){var e,i=n.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return e=-1===i?i=0:(i+=1)+Number(this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur),n.setElementSelection(this.domElement,i,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=n.isNull(i)?this.domElement:i.node(),this._removeFromLocalList(t),this}},{key:"attach",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t;return this._addToLocalList(e.node()),i&&e.update(this.settings),this}},{key:"formatOther",value:function(e,t){return this._formatOrUnformatOther(!0,e,1<arguments.length&&void 0!==t?t:null)}},{key:"unformatOther",value:function(e,t){return this._formatOrUnformatOther(!1,e,1<arguments.length&&void 0!==t?t:null)}},{key:"_formatOrUnformatOther",value:function(e,t,i){var s,u,r=2<arguments.length&&void 0!==i?i:null;if(s=n.isNull(r)?this.settings:this._cloneAndMergeSettings(r),n.isElement(t)){var m=n.getElementValue(t);return u=e?a.format(m,s):a.unformat(m,s),n.setElementValue(t,u),null}return e?a.format(t,s):a.unformat(t,s)}},{key:"init",value:function(e,t){var i=this,s=!(1<arguments.length&&void 0!==t)||t,u=!1,r=[];if(n.isString(e)?r=ae(document.querySelectorAll(e)):n.isElement(e)?(r.push(e),u=!0):n.isArray(e)?r=e:n.throwError("The given parameters to the 'init' function are invalid."),0===r.length)return n.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var m=this._getLocalList(),v=[];return r.forEach(function(_){var h=i.settings.createLocalList;s&&(i.settings.createLocalList=!1);var f=new a(_,n.getElementValue(_),i.settings);s&&(f._setLocalList(m),i._addToLocalList(_,f),i.settings.createLocalList=h),v.push(f)}),u?v[0]:v}},{key:"clear",value:function(e){return 0<arguments.length&&void 0!==e&&e?this.set("",{emptyInputBehavior:a.options.emptyInputBehavior.focus}):this.set(""),this}},{key:"remove",value:function(){this._removeValueFromPersistentStorage(),this._removeEventListeners(),this._removeWatcher(),this._removeFromLocalList(this.domElement),this.constructor._removeFromGlobalList(this)}},{key:"wipe",value:function(){this._setElementValue("",!1),this.remove()}},{key:"nuke",value:function(){this.remove(),this.domElement.parentNode.removeChild(this.domElement)}},{key:"form",value:function(e){if(0<arguments.length&&void 0!==e&&e||n.isUndefinedOrNullOrEmpty(this.parentForm)){var t=this._getParentForm();if(!n.isNull(t)&&t!==this.parentForm){var i=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=i.length,this._hasFormHandlerFunction(t)?this._incrementParentFormCounter(t):(this._storeFormHandlerFunction(t),this._initializeFormCounterToOne(t))}this.parentForm=t}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var t=this;return ae(e.querySelectorAll("input")).filter(function(i){return t.constructor.isManagedByAutoNumeric(i)})}},{key:"_getParentForm",value:function(){if("body"===this.domElement.tagName.toLowerCase())return null;var e,t=this.domElement;do{if(n.isNull(t=t.parentNode))return null;if("body"===(e=t.tagName?t.tagName.toLowerCase():""))break}while("form"!==e);return"form"===e?t:null}},{key:"formNumericString",value:function(){return this.constructor._serializeNumericString(this.form(),this.settings.serializeSpaces)}},{key:"formFormatted",value:function(){return this.constructor._serializeFormatted(this.form(),this.settings.serializeSpaces)}},{key:"formLocalized",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=n.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,t)}},{key:"formArrayNumericString",value:function(){return this.constructor._serializeNumericStringArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayFormatted",value:function(){return this.constructor._serializeFormattedArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayLocalized",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=n.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,t)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(e){return JSON.stringify(this.formArrayLocalized(0<arguments.length&&void 0!==e?e:null))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){a.getAutoNumericElement(e).unformat()}),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){a.getAutoNumericElement(e).unformatLocalized()}),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){a.getAutoNumericElement(e).reformat()}),this}},{key:"formSubmitNumericString",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return n.isNull(t)?(this.formUnformat(),this.form().submit(),this.formReformat()):n.isFunction(t)?t(this.formNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return n.isNull(t)?this.form().submit():n.isFunction(t)?t(this.formFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(e,t){var i=0<arguments.length&&void 0!==e?e:null,s=1<arguments.length&&void 0!==t?t:null;return n.isNull(s)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):n.isFunction(s)?s(this.formLocalized(i)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayNumericString",value:function(e){return n.isFunction(e)?e(this.formArrayNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayFormatted",value:function(e){return n.isFunction(e)?e(this.formArrayFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayLocalized",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return n.isFunction(e)?e(this.formArrayLocalized(i)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonNumericString",value:function(e){return n.isFunction(e)?e(this.formJsonNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonFormatted",value:function(e){return n.isFunction(e)?e(this.formJsonFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonLocalized",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return n.isFunction(e)?e(this.formJsonLocalized(i)):n.throwError("The given callback is not a function."),this}},{key:"_createLocalList",value:function(){this.autoNumericLocalList=new Map,this._addToLocalList(this.domElement)}},{key:"_deleteLocalList",value:function(){delete this.autoNumericLocalList}},{key:"_setLocalList",value:function(e){this.autoNumericLocalList=e}},{key:"_getLocalList",value:function(){return this.autoNumericLocalList}},{key:"_hasLocalList",value:function(){return this.autoNumericLocalList instanceof Map&&0!==this.autoNumericLocalList.size}},{key:"_addToLocalList",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;n.isNull(i)&&(i=this),n.isUndefined(this.autoNumericLocalList)?n.throwError("The local list provided does not exists when trying to add an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.set(e,i)}},{key:"_removeFromLocalList",value:function(e){n.isUndefined(this.autoNumericLocalList)?this.settings.createLocalList&&n.throwError("The local list provided does not exists when trying to remove an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.delete(e)}},{key:"_mergeSettings",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];x.apply(void 0,[this.settings].concat(t))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return x.apply(void 0,[e,this.settings].concat(i)),e}},{key:"_updatePredefinedOptions",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return n.isNull(i)?this.update(e):(this._mergeSettings(e,i),this.update(this.settings)),this}},{key:"french",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().French,t),this}},{key:"northAmerican",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().NorthAmerican,t),this}},{key:"british",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().British,t),this}},{key:"swiss",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Swiss,t),this}},{key:"japanese",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Japanese,t),this}},{key:"spanish",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Spanish,t),this}},{key:"chinese",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Chinese,t),this}},{key:"brazilian",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(a.getPredefinedOptions().Brazilian,t),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var t=this.settings[e];if("function"==typeof t)this.settings[e]=t(this,e);else{var i=this.domElement.getAttribute(e);i=n.camelize(i),"function"==typeof this.settings[i]&&(this.settings[e]=i(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.right)}},{key:"_modifyNegativeSignAndDecimalCharacterForRawValue",value:function(e){return"."!==this.settings.decimalCharacter&&(e=e.replace(this.settings.decimalCharacter,".")),"-"!==this.settings.negativeSignCharacter&&this.settings.isNegativeSignAllowed&&(e=e.replace(this.settings.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}},{key:"_initialCaretPosition",value:function(e){n.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===a.options.selectOnFocus.doNotSelect&&n.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var t=this.rawValue<0,i=n.isZeroOrHasNoValue(e),s=e.length,u=0,r=0,m=!1,v=0;this.settings.caretPositionOnFocus!==a.options.caretPositionOnFocus.start&&(u=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,m=n.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==a.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==a.options.caretPositionOnFocus.decimalRight||(v=m?(r=e.indexOf(this.settings.decimalCharacter),this.settings.decimalCharacter.length):(r=u,0)));var _="";t?_=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!i&&(_=this.settings.positiveSignCharacter);var h,f=_.length,p=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!i))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:h=f+p;break;case a.options.negativePositiveSignPlacement.suffix:h=p}else h=p;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!i))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:h=s;break;case a.options.negativePositiveSignPlacement.suffix:h=p+u}else h=s;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!i))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:h=f+p+r;break;case a.options.negativePositiveSignPlacement.suffix:h=p+r}else h=p+r;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!i))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.prefix:case a.options.negativePositiveSignPlacement.left:case a.options.negativePositiveSignPlacement.right:h=f+p+r+v;break;case a.options.negativePositiveSignPlacement.suffix:h=p+r+v}else h=p+r+v}else if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!i))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:h=0;break;case a.options.negativePositiveSignPlacement.prefix:h=f}else h=0;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!i))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:h=u;break;case a.options.negativePositiveSignPlacement.prefix:h=f+u}else h=u;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!i))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:h=r;break;case a.options.negativePositiveSignPlacement.prefix:h=f+r}else h=r;else if(this.settings.caretPositionOnFocus===a.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!i))switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.suffix:case a.options.negativePositiveSignPlacement.right:case a.options.negativePositiveSignPlacement.left:h=r+v;break;case a.options.negativePositiveSignPlacement.prefix:h=f+r+v}else h=r+v;return h}},{key:"_triggerRangeEvents",value:function(e,t){e||this._triggerEvent(a.events.minRangeExceeded,this.domElement),t||this._triggerEvent(a.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?n.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(a.events.invalidValue,this.domElement),this.validState=!1}},{key:"_setValidState",value:function(){this.isInputElement?n.setValidState(this.domElement):this._removeCSSClass(this.settings.invalidClass),this.validState||this._triggerEvent(a.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(e){if(this.settings.overrideMinMaxLimits===a.options.overrideMinMaxLimits.invalid){var t=this.constructor._isMinimumRangeRespected(e,this.settings),i=this.constructor._isMaximumRangeRespected(e,this.settings);t&&i?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(t,i)}}},{key:"_keepAnOriginalSettingsCopy",value:function(){this.originalDigitGroupSeparator=this.settings.digitGroupSeparator,this.originalCurrencySymbol=this.settings.currencySymbol,this.originalSuffixText=this.settings.suffixText}},{key:"_trimLeadingAndTrailingZeros",value:function(e){if(""===e||null===e)return e;if(this.settings.leadingZero!==a.options.leadingZero.keep){if(0===Number(e))return"0";e=e.replace(/^(-)?0+(?=\d)/g,"$1")}return n.contains(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1")),e.replace(/\.$/,"")}},{key:"_setPersistentStorageName",value:function(){this.settings.saveValueToSessionStorage&&(this.rawValueStorageName=""===this.domElement.name||n.isUndefined(this.domElement.name)?"".concat(this.storageNamePrefix).concat(this.domElement.id):"".concat(this.storageNamePrefix).concat(decodeURIComponent(this.domElement.name)))}},{key:"_saveValueToPersistentStorage",value:function(){this.settings.saveValueToSessionStorage&&(this.sessionStorageAvailable?sessionStorage.setItem(this.rawValueStorageName,this.rawValue):document.cookie="".concat(this.rawValueStorageName,"=").concat(this.rawValue,"; expires= ; path=/"))}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?this.sessionStorageAvailable?sessionStorage.getItem(this.rawValueStorageName):this.constructor._readCookie(this.rawValueStorageName):(n.warning("`_getValueFromPersistentStorage()` is called but `settings.saveValueToSessionStorage` is false. There must be an error that needs fixing.",this.settings.showWarnings),null)}},{key:"_removeValueFromPersistentStorage",value:function(){if(this.settings.saveValueToSessionStorage)if(this.sessionStorageAvailable)sessionStorage.removeItem(this.rawValueStorageName);else{var e=new Date;e.setTime(e.getTime()-864e5);var t="; expires=".concat(e.toUTCString());document.cookie="".concat(this.rawValueStorageName,"='' ;").concat(t,"; path=/")}}},{key:"_getDefaultValue",value:function(e){var t=e.getAttribute("value");return n.isNull(t)?"":t}},{key:"_onFocusInAndMouseEnter",value:function(e){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&"mouseenter"===e.type&&e.altKey)this.constructor._unformatAltHovered(this);else if("focus"===e.type&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),"focus"===e.type&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),"focus"===e.type||"mouseenter"===e.type&&!this.isFocused){var t=null;this.settings.emptyInputBehavior===a.options.emptyInputBehavior.focus&&this.rawValue<0&&null!==this.settings.negativeBracketsTypeOnBlur&&this.settings.isNegativeSignAllowed&&(t=this.constructor._removeBrackets(n.getElementValue(this.domElement),this.settings));var i=this._getRawValueToFormat(this.rawValue);if(""!==i){var s=this.constructor._roundFormattedValueShownOnFocusOrBlur(i,this.settings,this.isFocused);t=this.settings.showOnlyNumbersOnFocus===a.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",s.replace(".",this.settings.decimalCharacter)):n.isNull(s)?"":this.constructor._addGroupSeparators(s.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,i)}this.valueOnFocus=n.isNull(t)?"":t,this.lastVal=this.valueOnFocus;var u=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),r=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),m=u&&""!==r&&this.settings.emptyInputBehavior===a.options.emptyInputBehavior.focus;m&&(t=r),n.isNull(t)||this._setElementValue(t),m&&r===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&n.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():n.isNull(this.settings.caretPositionOnFocus)||n.setElementSelection(e.target,this._initialCaretPosition(n.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,n.setElementValue(this.domElement,"="),n.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,t=n.getElementValue(this.domElement);t=t.replace(/^\s*=/,"");try{var i=new ge(t,this.settings.decimalCharacter);e=(new j).evaluate(i)}catch{return this._triggerEvent(a.events.invalidFormula,this.domElement,{formula:t,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(a.events.validFormula,this.domElement,{formula:t,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===g.keyName.Backspace||this.eventKey===g.keyName.Delete||this.eventKey===g.keyName.LeftArrow||this.eventKey===g.keyName.RightArrow||this.eventKey===g.keyName.Home||this.eventKey===g.keyName.End}},{key:"_onKeydown",value:function(e){if(this.formatted=!1,this.isEditing=!0,this.formulaMode||this.isFocused||!this.settings.unformatOnHover||!e.altKey||this.domElement!==n.getHoveredElement()){if(this._updateEventKeyInfo(e),this.keydownEventCounter+=1,1===this.keydownEventCounter&&(this.initialValueOnFirstKeydown=n.getElementValue(e.target),this.initialRawValueOnFirstKeydown=this.rawValue),this.formulaMode){if(this.eventKey===g.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===g.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else if(this.eventKey===g.keyName.Equal)return void this._enterFormulaMode();if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===g.keyName.Esc&&(e.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(a.events.native.input,e.target)),this.select());var t=n.getElementValue(e.target);if(this.eventKey===g.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(a.events.native.change,e.target),this.valueOnFocus=t,this.rawValueOnFocus=this.rawValue,this.settings.isCancellable&&this._saveCancellableValue()),this._updateInternalProperties(e),this._processNonPrintableKeysAndShortcuts(e))this.processed=!0;else if(this.eventKey===g.keyName.Backspace||this.eventKey===g.keyName.Delete){var i=this._processCharacterDeletion();if(this.processed=!0,!i)return void e.preventDefault();this._formatValue(e),(t=n.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(a.events.native.input,e.target),e.preventDefault()),this.lastVal=t,this.throwInput=!0}}}else this.constructor._unformatAltHovered(this)}},{key:"_onKeypress",value:function(e){if(this.formulaMode){if(this._acceptNonPrintableKeysInFormulaMode()||this.settings.formulaChars.test(this.eventKey))return;e.preventDefault()}else if(this.eventKey!==g.keyName.Insert){var t=this.processed;if(this._updateInternalProperties(e),!this._processNonPrintableKeysAndShortcuts(e))if(t)e.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(e);var i=n.getElementValue(e.target);if(i!==this.lastVal&&this.throwInput)this._triggerEvent(a.events.native.input,e.target),e.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&n.getElementSelection(e.target).start===n.getElementSelection(e.target).end&&n.getElementSelection(e.target).start===i.indexOf(this.settings.decimalCharacter)){var s=n.getElementSelection(e.target).start+1;n.setElementSelection(e.target,s)}e.preventDefault()}return this.lastVal=n.getElementValue(e.target),this.throwInput=!0,void this._setValidOrInvalidState(this.rawValue)}e.preventDefault()}}}},{key:"_onKeyup",value:function(e){if(this.isEditing=!1,this.keydownEventCounter=0,!this.formulaMode)if(this.settings.isCancellable&&this.eventKey===g.keyName.Esc)e.preventDefault();else{if(this.eventKey===g.keyName.Z||this.eventKey===g.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),void this._historyTableUndo();this.onGoingRedo=!1}}if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&this.eventKey===g.keyName.x){var t=n.getElementSelection(this.domElement).start,i=this.constructor._toNumericValue(n.getElementValue(e.target),this.settings);this.set(i),this._setCaretPosition(t)}if(this.eventKey===g.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==g.keyName.Backspace&&this.eventKey!==g.keyName.Delete){this._updateInternalProperties(e);var s=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var u=n.getElementValue(e.target);if(!(s||""===u&&""===this.initialValueOnFirstKeydown)&&(u===this.settings.currencySymbol?n.setElementSelection(e.target,this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?0:this.settings.currencySymbol.length):this.eventKey===g.keyName.Tab&&n.setElementSelection(e.target,0,u.length),(u===this.settings.suffixText||""===this.rawValue&&""!==this.settings.currencySymbol&&""!==this.settings.suffixText)&&n.setElementSelection(e.target,0),null!==this.settings.decimalPlacesShownOnFocus&&this._saveValueToPersistentStorage(),this.formatted||this._formatValue(e),this._setValidOrInvalidState(this.rawValue),this._saveRawValueForAndroid(),u!==this.initialValueOnFirstKeydown&&this._triggerEvent(a.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:u,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),1<this.historyTable.length)){var r=n.getElementSelection(this.domElement);this.selectionStart=r.start,this.selectionEnd=r.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var m=n.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,m))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===g.keyName.AndroidDefault){var e=this.constructor._stripAllNonNumberCharactersExceptCustomDecimalChar(this.getFormatted(),this.settings,!0,this.isFocused);e=this.constructor._convertToNumericString(e,this.settings),this._setRawValue(e)}}},{key:"_onFocusOutAndMouseLeave",value:function(e){if(this.isEditing=!1,"mouseleave"!==e.type||!this.formulaMode)if(this.settings.unformatOnHover&&"mouseleave"===e.type&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if("mouseleave"===e.type&&!this.isFocused||"blur"===e.type){"blur"===e.type&&this.formulaMode&&this._exitFormulaMode(),this._saveValueToPersistentStorage(),this.settings.showOnlyNumbersOnFocus===a.options.showOnlyNumbersOnFocus.onlyNumbers&&(this.settings.digitGroupSeparator=this.originalDigitGroupSeparator,this.settings.currencySymbol=this.originalCurrencySymbol,this.settings.suffixText=this.originalSuffixText);var t=this._getRawValueToFormat(this.rawValue),i=n.isNull(t),s=L(this.constructor._checkIfInRangeWithOverrideOption(t,this.settings),2),u=s[0],r=s[1],m=!1;if(""===t||i||(this._triggerRangeEvents(u,r),this.settings.valuesToStrings&&this._checkValuesToStrings(t)&&(this._setElementValue(this.settings.valuesToStrings[t]),m=!0)),!m){var v;if(v=i||""===t?t:String(t),""===t||i){if(""===t)switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.zero:this._setRawValue("0"),v=this.constructor._roundValue("0",this.settings,0);break;case a.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),v=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case a.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),v=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:n.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),v=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else u&&r&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(t,this.settings)?(v=this._modifyNegativeSignAndDecimalCharacterForRawValue(v),this.settings.divisorWhenUnfocused&&!n.isNull(v)&&(v=(v/=this.settings.divisorWhenUnfocused).toString()),v=this.constructor._roundFormattedValueShownOnBlur(v,this.settings),v=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(v,this.settings)):this._triggerRangeEvents(u,r);var _=this.constructor._orderValueCurrencySymbolAndSuffixText(v,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(v,this.settings)||i&&this.settings.emptyInputBehavior===a.options.emptyInputBehavior.null||(_=this.constructor._addGroupSeparators(v,this.settings,!1,t)),_===t&&""!==t&&this.settings.allowDecimalPadding!==a.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==a.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&""!==t&&null!==t&&(_="".concat(_).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(_))}this._setValidOrInvalidState(this.rawValue),"blur"===e.type&&this._onBlur(e)}}},{key:"_onPaste",value:function(e){if(e.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var t,i;window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):n.throwError("Unable to retrieve the pasted value. Please use a modern browser (ie. Firefox or Chromium).");var s=n.getElementValue(i=e.target.tagName?e.target:e.explicitOriginalTarget),u=i.selectionStart||0,r=i.selectionEnd||0,m=r-u;if(m===s.length){var v=this._preparePastedText(t),_=n.arabicToLatinNumbers(v,!1,!1,!1);return"."===_||""===_||"."!==_&&!n.isNumber(_)?(this.formatted=!0,void(this.settings.onInvalidPaste===a.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(t,"' is not a valid paste content.")))):(this.set(_),this.formatted=!0,void this._triggerEvent(a.events.native.input,i))}var h=n.isNegativeStrict(t,this.settings.negativeSignCharacter);h&&(t=t.slice(1,t.length));var f,p,y=this._preparePastedText(t);if("."!==(f="."===y?".":n.arabicToLatinNumbers(y,!1,!1,!1))&&(!n.isNumber(f)||""===f))return this.formatted=!0,void(this.settings.onInvalidPaste===a.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(t,"' is not a valid paste content.")));var O,N,R=n.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);O=!(!h||R)&&(R=!0);var G=s.slice(0,u),$=s.slice(r,s.length);N=this._preparePastedText(u!==r?G+$:s),R&&(N=n.setRawNegativeSign(N)),p=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(s,u,this.settings.decimalCharacter)),O&&p++;var Z=N.slice(0,p),oe=N.slice(p,N.length),Pe=!1;"."===f&&(n.contains(Z,".")&&(Pe=!0,Z=Z.replace(".","")),oe=oe.replace(".",""));var ke=!1;switch(""===Z&&"-"===oe&&(Z="-",ke=!(oe="")),this.settings.onInvalidPaste){case a.options.onInvalidPaste.truncate:case a.options.onInvalidPaste.replace:for(var Ve=n.parseStr(this.settings.minimumValue),Ae=n.parseStr(this.settings.maximumValue),se=N,le=0,Me=Z;le<f.length&&(N=(Me+=f[le])+oe,this.constructor._checkIfInRange(N,Ve,Ae));)se=N,le++;if(p+=le,ke&&p++,this.settings.onInvalidPaste===a.options.onInvalidPaste.truncate){N=se,Pe&&p--;break}for(var he=p,De=se.length;le<f.length&&he<De;)if("."!==se[he]){if(N=n.replaceCharAt(se,he,f[le]),!this.constructor._checkIfInRange(N,Ve,Ae))break;se=N,le++,he++}else he++;p=he,Pe&&p--,N=se;break;default:if(N="".concat(Z).concat(f).concat(oe),u===r)p=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(s,u,this.settings.decimalCharacter))+f.length;else if(""===oe)p=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(s,u,this.settings.decimalCharacter))+f.length,ke&&p++;else{var Be=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(s,r,this.settings.decimalCharacter)),Re=n.getElementValue(i).slice(u,r);p=Be-m+n.countCharInText(this.settings.digitGroupSeparator,Re)+f.length}O&&p++,Pe&&p--}if(n.isNumber(N)&&""!==N){var Oe=!1,Le=!1;try{this.set(N),Oe=!0}catch{var Ee;switch(this.settings.onInvalidPaste){case a.options.onInvalidPaste.clamp:Ee=n.clampToRangeLimits(N,this.settings);try{this.set(Ee)}catch{n.throwError("Fatal error: Unable to set the clamped value '".concat(Ee,"'."))}Oe=Le=!0,N=Ee;break;case a.options.onInvalidPaste.error:case a.options.onInvalidPaste.truncate:case a.options.onInvalidPaste.replace:n.throwError("The pasted value '".concat(t,"' results in a value '").concat(N,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));default:return}}var Ie,Ne=n.getElementValue(i);if(Oe)switch(this.settings.onInvalidPaste){case a.options.onInvalidPaste.clamp:if(Le){n.setElementSelection(i,this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?Ne.length-this.settings.currencySymbol.length:Ne.length);break}default:Ie=n.findCaretPositionInFormattedNumber(N,p,Ne,this.settings.decimalCharacter),n.setElementSelection(i,Ie)}Oe&&s!==Ne&&this._triggerEvent(a.events.native.input,i)}else this.settings.onInvalidPaste===a.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(t,"' would result into an invalid content '").concat(N,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,this.rawValue!==this.rawValueOnFocus&&this._triggerEvent(a.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_onWheel",value:function(e){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===a.options.wheelOn.focus?this.isFocused?e.shiftKey||this.wheelAction(e):e.shiftKey&&this.wheelAction(e):this.settings.wheelOn===a.options.wheelOn.hover?e.shiftKey?(e.preventDefault(),window.scrollBy(0,n.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):n.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var t,i=e.target.selectionStart||0,s=e.target.selectionEnd||0,u=this.rawValue;if(n.isUndefinedOrNullOrEmpty(u)?0<this.settings.minimumValue||this.settings.maximumValue<0?n.isWheelUpEvent(e)?t=this.settings.minimumValue:n.isWheelDownEvent(e)?t=this.settings.maximumValue:n.throwError("The event is not a 'wheel' event."):t=0:t=u,t=+t,n.isNumber(this.settings.wheelStep)){var r=+this.settings.wheelStep;n.isWheelUpEvent(e)?t+=r:n.isWheelDownEvent(e)&&(t-=r)}else n.isWheelUpEvent(e)?t=n.addAndRoundToNearestAuto(t,this.settings.decimalPlacesRawValue):n.isWheelDownEvent(e)&&(t=n.subtractAndRoundToNearestAuto(t,this.settings.decimalPlacesRawValue));(t=n.clampToRangeLimits(t,this.settings))!==+u&&(this.set(t),this._triggerEvent(a.events.native.input,e.target)),e.preventDefault(),this._setSelection(i,s),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){var t;this.isDropEvent=!0,e.preventDefault(),t=n.isIE11()?"text":"text/plain";var i=e.dataTransfer.getData(t),s=this.unformatOther(i);this.set(s),this.isDropEvent=!1}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map(function(t){return e.constructor.getAutoNumericElement(t)}).forEach(function(t){return t._unformatOnSubmit()}),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map(function(t){return e.constructor.getAutoNumericElement(t)}).forEach(function(t){var i=e._getDefaultValue(t.node());setTimeout(function(){return t.set(i)},0)})}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(e){if(n.character(e)===g.keyName.Alt){var t=n.getHoveredElement();if(a.isManagedByAutoNumeric(t)){var i=a.getAutoNumericElement(t);!i.formulaMode&&i.settings.unformatOnHover&&this.constructor._unformatAltHovered(i)}}}},{key:"_onKeyupGlobal",value:function(e){if(n.character(e)===g.keyName.Alt){var t=n.getHoveredElement();if(a.isManagedByAutoNumeric(t)){var i=a.getAutoNumericElement(t);if(i.formulaMode||!i.settings.unformatOnHover)return;this.constructor._reformatAltHovered(i)}}}},{key:"_isElementTagSupported",value:function(){return n.isElement(this.domElement)||n.throwError("The DOM element is not valid, ".concat(this.domElement," given.")),n.isInArray(this.domElement.tagName.toLowerCase(),this.allowedTagList)}},{key:"_isInputElement",value:function(){return"input"===this.domElement.tagName.toLowerCase()}},{key:"_isInputTypeSupported",value:function(){return"text"===this.domElement.type||"hidden"===this.domElement.type||"tel"===this.domElement.type||n.isUndefinedOrNullOrEmpty(this.domElement.type)}},{key:"_checkElement",value:function(){var e=this.domElement.tagName.toLowerCase();this._isElementTagSupported()||n.throwError("The <".concat(e,"> tag is not supported by autoNumeric")),this._isInputElement()?(this._isInputTypeSupported()||n.throwError('The input type "'.concat(this.domElement.type,'" is not supported by autoNumeric')),this.isInputElement=!0):(this.isInputElement=!1,this.isContentEditable=this.domElement.hasAttribute("contenteditable")&&"true"===this.domElement.getAttribute("contenteditable"))}},{key:"_formatDefaultValueOnPageLoad",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null,s=!0;if(n.isNull(i)?(t=n.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",t)):t=i,this.isInputElement||this.isContentEditable){var u=this.constructor._toNumericValue(t,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==t||null===this.settings.defaultValueOverride&&""!==t&&t!==this.domElement.getAttribute("value")||""!==t&&"hidden"===this.domElement.getAttribute("type")&&!n.isNumber(u)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var r=this.constructor._removeBrackets(t,this.settings);(this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)&&""!==this.settings.negativeSignCharacter&&n.isNegative(t,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(r,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(r,this.settings,!0,this.isFocused))}s=!1}}else isNaN(Number(u))||1/0===u?n.throwError("The value [".concat(t,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(u),s=!1);if(""===t)switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.focus:case a.options.emptyInputBehavior.null:case a.options.emptyInputBehavior.press:break;case a.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case a.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case a.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case a.options.emptyInputBehavior.zero:this.set("0");break;default:this.set(this.settings.emptyInputBehavior)}else s&&t===this.domElement.getAttribute("value")&&this.set(t)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==t||this.set(t)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=L(this.settings.maximumValue.toString().split("."),1)[0],t=L(this.settings.minimumValue||0===this.settings.minimumValue?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),t=t.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(t.length,1)}},{key:"_calculateValuesToStringsKeys",value:function(){this.valuesToStringsKeys=this.settings.valuesToStrings?Object.keys(this.settings.valuesToStrings):[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var t=this.settings[e];"true"!==t&&"false"!==t||(this.settings[e]="true"===t),"number"==typeof t&&(this.settings[e]=t.toString())}}},{key:"_setSettings",value:function(e,t){var i=1<arguments.length&&void 0!==t&&t;!i&&n.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=g.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||(this.settings.originalDecimalPlaces=n.isNull(e)||!e.decimalPlaces?null:e.decimalPlaces,this.settings.originalDecimalPlacesRawValue=this.settings.decimalPlacesRawValue,this.constructor._calculateDecimalPlacesOnInit(this.settings)),this._calculateVMinAndVMaxIntegerSizes(),this._setTrailingNegativeSignInfo(),this.regex={},this.constructor._cachesUsualRegularExpressions(this.settings,this.regex),this.constructor._setBrackets(this.settings),this._calculateValuesToStringsKeys(),n.isEmptyObj(this.settings)&&n.throwError("Unable to set the settings, those are invalid ; an empty object was given."),this.constructor.validate(this.settings,!1,e),this._keepAnOriginalSettingsCopy()}},{key:"_preparePastedText",value:function(e){return this.constructor._stripAllNonNumberCharacters(e,this.settings,!0,this.isFocused)}},{key:"_updateInternalProperties",value:function(){this.selection=n.getElementSelection(this.domElement),this.processed=!1}},{key:"_updateEventKeyInfo",value:function(e){this.eventKey=n.character(e)}},{key:"_saveCancellableValue",value:function(){this.savedCancellableValue=this.rawValue}},{key:"_setSelection",value:function(e,t){e=Math.max(e,0),t=Math.min(t,n.getElementValue(this.domElement).length),this.selection={start:e,end:t,length:t-e},n.setElementSelection(this.domElement,e,t)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=n.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=L(this._getLeftAndRightPartAroundTheSelection(),2),t=e[0],i=e[1];if(""===t&&""===i)return["",""];var s=!0;return this.eventKey!==g.keyName.Hyphen&&this.eventKey!==g.keyName.Minus||0!==Number(t)||(s=!1),this.isTrailingNegative&&(n.isNegative(i,this.settings.negativeSignCharacter)&&!n.isNegative(t,this.settings.negativeSignCharacter)||""===i&&n.isNegative(t,this.settings.negativeSignCharacter,!0))&&(t=t.replace(this.settings.negativeSignCharacter,""),i=i.replace(this.settings.negativeSignCharacter,""),t=t.replace("-",""),i=i.replace("-",""),t="-".concat(t)),[t=a._stripAllNonNumberCharactersExceptCustomDecimalChar(t,this.settings,s,this.isFocused),i=a._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,t){var i=!0;this.eventKey!==g.keyName.Hyphen&&this.eventKey!==g.keyName.Minus||0!==Number(e)||(i=!1),this.isTrailingNegative&&n.isNegative(t,this.settings.negativeSignCharacter)&&!n.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),t=t.replace(this.settings.negativeSignCharacter,"")),e=a._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,i,this.isFocused),t=a._stripAllNonNumberCharactersExceptCustomDecimalChar(t,this.settings,!1,this.isFocused),this.settings.leadingZero!==a.options.leadingZero.deny||this.eventKey!==g.keyName.num0&&this.eventKey!==g.keyName.numpad0||0!==Number(e)||n.contains(e,this.settings.decimalCharacter)||""===t||(e=e.substring(0,e.length-1));var s=e+t;if(this.settings.decimalCharacter){var u=s.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));u&&(s=(e=e.replace(u[1],u[1]+"0"))+t)}return[e,t,s]}},{key:"_setValueParts",value:function(e,t,i){var s=2<arguments.length&&void 0!==i&&i,u=L(this._normalizeParts(e,t),3),r=u[0],m=u[1],v=u[2],_=L(a._checkIfInRangeWithOverrideOption(v,this.settings),2),h=_[0],f=_[1];if(h&&f){var p=a._truncateDecimalPlaces(v,this.settings,s,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(""===p||p===this.settings.negativeSignCharacter){var y;switch(this.settings.emptyInputBehavior){case a.options.emptyInputBehavior.focus:case a.options.emptyInputBehavior.press:case a.options.emptyInputBehavior.always:y="";break;case a.options.emptyInputBehavior.min:y=this.settings.minimumValue;break;case a.options.emptyInputBehavior.max:y=this.settings.maximumValue;break;case a.options.emptyInputBehavior.zero:y="0";break;case a.options.emptyInputBehavior.null:y=null;break;default:y=this.settings.emptyInputBehavior}this._setRawValue(y)}else this._setRawValue(this._trimLeadingAndTrailingZeros(p));var O=a._truncateDecimalPlaces(v,this.settings,s,this.settings.decimalPlacesShownOnFocus),N=r.length;return N>O.length&&(N=O.length),1===N&&"0"===r&&this.settings.leadingZero===a.options.leadingZero.deny&&(N=""===m||"0"===r&&""!==m?1:0),this._setElementValue(O,!1),this._setCaretPosition(N),!0}return this._triggerRangeEvents(h,f),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var t=this.settings.currencySymbol.length,i=n.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&i&&i.charAt(0)===this.settings.negativeSignCharacter?[1,t+1]:[0,t];else{var s=i.length;e=[s-t,s]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=L(this._getSignPosition(),2),t=e[0],i=e[1],s=this.selection;s.start<i&&s.end>t&&((s.start<t||s.end>i)&&n.getElementValue(this.domElement).substring(Math.max(s.start,t),Math.min(s.end,i)).match(/^\s*$/)?s.start<t?this._setSelection(s.start,t):this._setSelection(i,s.end):this._setSelection(Math.min(s.start,t),Math.max(s.end,i)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!n.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,t=L(this._getLeftAndRightPartAroundTheSelection(),2),i=t[0],s=t[1];delete this.valuePartsBeforePaste;var u=i.substr(0,e[0].length)+a._stripAllNonNumberCharactersExceptCustomDecimalChar(i.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(u,s,!0)||(this._setElementValue(e.join(""),!1),this._setCaretPosition(e[0].length))}}},{key:"_processNonPrintableKeysAndShortcuts",value:function(e){if((e.ctrlKey||e.metaKey)&&"keyup"===e.type&&!n.isUndefined(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKey===g.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===g.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===g.keyName.c||this.eventKey===g.keyName.v||this.eventKey===g.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==g.keyName.v&&this.eventKey!==g.keyName.Insert||("keydown"===e.type||"keypress"===e.type?n.isUndefined(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),"keydown"===e.type||"keypress"===e.type||this.eventKey===g.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===g.keyName.Z||this.eventKey===g.keyName.z);if(this.eventKey!==g.keyName.LeftArrow&&this.eventKey!==g.keyName.RightArrow)return n.isInArray(this.eventKey,g.keyName._directionKeys);if("keydown"===e.type&&!e.shiftKey){var t=n.getElementValue(this.domElement);this.eventKey!==g.keyName.LeftArrow||t.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&t.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==g.keyName.RightArrow||t.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&t.charAt(this.selection.start+1)!==this.settings.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)}return!0}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var t=L(e,2),i=t[0],s=t[1],u=n.getElementValue(this.domElement),r=n.isNegative(u,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix&&(this.eventKey===g.keyName.Backspace?(this.caretFix=this.selection.start>=u.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===u.charAt(this.selection.start-1)?i=i.substring(1):this.selection.start<=u.length-this.settings.suffixText.length&&(i=i.substring(0,i.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&&(s=s.substring(1,s.length)),n.isNegative(i,this.settings.negativeSignCharacter)&&"-"===u.charAt(this.selection.start)&&(i=i.substring(1)))),this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case a.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===g.keyName.Backspace?this.selection.start===u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&r?i=i.substring(1):"-"!==i&&(this.selection.start<=u.indexOf(this.settings.negativeSignCharacter)||!r)&&(i=i.substring(0,i.length-1)):("-"===i[0]&&(s=s.substring(1)),this.selection.start===u.indexOf(this.settings.negativeSignCharacter)&&r&&(i=i.substring(1)));break;case a.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===g.keyName.Backspace?this.selection.start===u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?i=i.substring(1):("-"!==i&&this.selection.start<=u.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length||""!==i&&!r)&&(i=i.substring(0,i.length-1)):(this.caretFix=this.selection.start>=u.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===u.indexOf(this.settings.negativeSignCharacter)&&(i=i.substring(1)),s=s.substring(1))}return[i,s]}},{key:"_processCharacterDeletion",value:function(){var e,t;if(this.selection.length){this._expandSelectionOnSign();var i=L(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);e=i[0],t=i[1]}else{var s=L(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(t=s[1],""===(e=s[0])&&""===t&&(this.throwInput=!1),this.isTrailingNegative&&n.isNegative(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var u=L(this._processCharacterDeletionIfTrailingNegativeSign([e,t]),2);e=u[0],t=u[1]}else this.eventKey===g.keyName.Backspace?e=e.substring(0,e.length-1):t=t.substring(1,t.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(e).concat(t),this.settings)&&(this._setValueParts(e,t),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(a.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(a.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=L(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),t=e[0],i=e[1];if(this.eventKey!==g.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)t=t.replace(this.settings.decimalCharacter,""),i=i.replace(this.settings.decimalCharacter,"");else{if(n.contains(t,this.settings.decimalCharacter)||0<i.indexOf(this.settings.decimalCharacter))return!0;0===i.indexOf(this.settings.decimalCharacter)&&(i=i.substr(1))}return this.settings.negativeSignCharacter&&n.contains(i,this.settings.negativeSignCharacter)&&(t="".concat(this.settings.negativeSignCharacter).concat(t),i=i.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(t+this.settings.decimalCharacter,i),!0}if(("-"===this.eventKey||"+"===this.eventKey)&&this.settings.isNegativeSignAllowed)return""===t&&n.contains(i,"-")?i=i.replace("-",""):t=n.isNegativeStrict(t,"-")?t.replace("-",""):"".concat(this.settings.negativeSignCharacter).concat(t),this._setValueParts(t,i),!0;var s=Number(this.eventKey);return 0<=s&&s<=9?(this.settings.isNegativeSignAllowed&&""===t&&n.contains(i,"-")&&(t="-",i=i.substring(1,i.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!n.contains(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&"0"!==this.eventKey&&(t="-".concat(t)),this._setValueParts("".concat(t).concat(this.eventKey),i),!0):this.throwInput=!1}},{key:"_formatValue",value:function(e){var t=n.getElementValue(this.domElement),i=L(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((""===this.settings.digitGroupSeparator||""!==this.settings.digitGroupSeparator&&!n.contains(t,this.settings.digitGroupSeparator))&&(""===this.settings.currencySymbol||""!==this.settings.currencySymbol&&!n.contains(t,this.settings.currencySymbol))){var s=L(t.split(this.settings.decimalCharacter),1)[0],u="";n.isNegative(s,this.settings.negativeSignCharacter)&&(u=this.settings.negativeSignCharacter,s=s.replace(this.settings.negativeSignCharacter,""),i=i.replace("-","")),""===u&&s.length>this.settings.mIntPos&&"0"===i.charAt(0)&&(i=i.slice(1)),u===this.settings.negativeSignCharacter&&s.length>this.settings.mIntNeg&&"0"===i.charAt(0)&&(i=i.slice(1)),this.isTrailingNegative||(i="".concat(u).concat(i))}var r=this.constructor._addGroupSeparators(t,this.settings,this.isFocused,this.rawValue),m=r.length;if(r){var v,_=i.split("");if((this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==a.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix)&&_[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(_.shift(),(this.eventKey===g.keyName.Backspace||this.eventKey===g.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.suffix)&&(_.push(this.settings.negativeSignCharacter),this.caretFix="keydown"===e.type),this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===a.options.negativePositiveSignPlacement.right))){var h=this.settings.currencySymbol.split(""),f=["\\","^","$",".","|","?","*","+","(",")","["],p=[];h.forEach(function(N,R){n.isInArray(R=h[N],f)?p.push("\\"+R):p.push(R)}),this.eventKey===g.keyName.Backspace&&"-"===this.settings.negativeSignCharacter&&p.push("-"),_.push(p.join("")),this.caretFix="keydown"===e.type}for(var y=0;y<_.length;y++)_[y].match("\\d")||(_[y]="\\"+_[y]);v=this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(_.join(".*?"))):new RegExp("^.*?".concat(this.settings.currencySymbol).concat(_.join(".*?")));var O=r.match(v);O?(m=O[0].length,this.settings.showPositiveSign&&(0===m&&O.input.charAt(0)===this.settings.positiveSignCharacter&&(m=1===O.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===m&&O.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(m=this.settings.currencySymbol.length+1)),(0===m&&r.charAt(0)!==this.settings.negativeSignCharacter||1===m&&r.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.prefix&&(m=this.settings.currencySymbol.length+(n.isNegativeStrict(r,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===a.options.currencySymbolPlacement.suffix&&(m-=this.settings.currencySymbol.length),this.settings.suffixText&&(m-=this.settings.suffixText.length))}r!==t&&(this._setElementValue(r,!1),this._setCaretPosition(m)),this.formatted=!0}}]),z(o,c),a}();function ye(a,o){o=o||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,o.bubbles,o.cancelable,o.detail),c}d.multiple=function(a){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,e=[];if(n.isObject(o)&&(c=o,o=null),n.isString(a))a=ae(document.querySelectorAll(a));else if(n.isObject(a)){Object.prototype.hasOwnProperty.call(a,"rootElement")||n.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var t=ae(a.rootElement.querySelectorAll("input"));a=Object.prototype.hasOwnProperty.call(a,"exclude")?(Array.isArray(a.exclude)||n.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),n.filterOut(t,a.exclude)):t}else n.isArray(a)||n.throwError("The given parameters to the 'multiple' function are invalid.");if(0===a.length){var i=!0;return!n.isNull(c)&&n.isBoolean(c.showWarnings)&&(i=c.showWarnings),n.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",i),[]}var s=n.isArray(o)&&1<=o.length,u=!1,r=!1;if(s){var m=V(Number(o[0]));(u="number"===m&&!isNaN(Number(o[0])))||"string"!==m&&!isNaN(m)&&"object"!==m||(r=!0)}var v,_=!1;if(n.isArray(c)&&1<=c.length){var h=V(c[0]);"string"!==h&&"object"!==h||(_=!0)}v=r?d.mergeOptions(o):_?d.mergeOptions(c):c;var f,p=n.isNumber(o);return u&&(f=o.length),a.forEach(function(y,O){e.push(new d(y,p?o:u&&O<=f?o[O]:null,v))}),e},Array.from||(Array.from=function(a){return[].slice.call(a)}),typeof window<"u"&&"function"!=typeof window.CustomEvent&&(ye.prototype=window.Event.prototype,window.CustomEvent=ye),d.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(d.events.native),Object.freeze(d.events),Object.defineProperty(d,"events",{configurable:!1,writable:!1}),d.options={allowDecimalPadding:{always:!0,never:!1,floats:"floats"},alwaysAllowDecimalCharacter:{alwaysAllow:!0,doNotAllow:!1},caretPositionOnFocus:{start:"start",end:"end",decimalLeft:"decimalLeft",decimalRight:"decimalRight",doNoForceCaretPosition:null},createLocalList:{createList:!0,doNotCreateList:!1},currencySymbol:{none:"",currencySign:"\xa4",austral:"\u20b3",australCentavo:"\xa2",baht:"\u0e3f",cedi:"\u20b5",cent:"\xa2",colon:"\u20a1",cruzeiro:"\u20a2",dollar:"$",dong:"\u20ab",drachma:"\u20af",dram:"\u200b\u058f",european:"\u20a0",euro:"\u20ac",florin:"\u0192",franc:"\u20a3",guarani:"\u20b2",hryvnia:"\u20b4",kip:"\u20ad",att:"\u0ead\u0eb1\u0e94",lepton:"\u039b.",lira:"\u20ba",liraOld:"\u20a4",lari:"\u20be",mark:"\u2133",mill:"\u20a5",naira:"\u20a6",peseta:"\u20a7",peso:"\u20b1",pfennig:"\u20b0",pound:"\xa3",real:"R$",riel:"\u17db",ruble:"\u20bd",rupee:"\u20b9",rupeeOld:"\u20a8",shekel:"\u20aa",shekelAlt:"\u05e9\u05f4\u05d7\u200e\u200e",taka:"\u09f3",tenge:"\u20b8",togrog:"\u20ae",won:"\u20a9",yen:"\xa5"},currencySymbolPlacement:{prefix:"p",suffix:"s"},decimalCharacter:{comma:",",dot:".",middleDot:"\xb7",arabicDecimalSeparator:"\u066b",decimalSeparatorKeySymbol:"\u2396"},decimalCharacterAlternative:{none:null,comma:",",dot:"."},decimalPlaces:{none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesRawValue:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnBlur:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnFocus:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},defaultValueOverride:{doNotOverride:null},digitalGroupSpacing:{two:"2",twoScaled:"2s",three:"3",four:"4"},digitGroupSeparator:{comma:",",dot:".",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0",noSeparator:"",apostrophe:"'",arabicThousandsSeparator:"\u066c",dotAbove:"\u02d9",privateUseTwo:"\u2019"},divisorWhenUnfocused:{none:null,percentage:100,permille:1e3,basisPoint:1e4},emptyInputBehavior:{focus:"focus",press:"press",always:"always",zero:"zero",min:"min",max:"max",null:"null"},eventBubbles:{bubbles:!0,doesNotBubble:!1},eventIsCancelable:{isCancelable:!0,isNotCancelable:!1},failOnUnknownOption:{fail:!0,ignore:!1},formatOnPageLoad:{format:!0,doNotFormat:!1},formulaMode:{enabled:!0,disabled:!1},historySize:{verySmall:5,small:10,medium:20,large:50,veryLarge:100,insane:Number.MAX_SAFE_INTEGER},invalidClass:"an-invalid",isCancellable:{cancellable:!0,notCancellable:!1},leadingZero:{allow:"allow",deny:"deny",keep:"keep"},maximumValue:{tenTrillions:"10000000000000",oneBillion:"1000000000",zero:"0"},minimumValue:{tenTrillions:"-10000000000000",oneBillion:"-1000000000",zero:"0"},modifyValueOnWheel:{modifyValue:!0,doNothing:!1},negativeBracketsTypeOnBlur:{parentheses:"(,)",brackets:"[,]",chevrons:"<,>",curlyBraces:"{,}",angleBrackets:"\u3008,\u3009",japaneseQuotationMarks:"\uff62,\uff63",halfBrackets:"\u2e24,\u2e25",whiteSquareBrackets:"\u27e6,\u27e7",quotationMarks:"\u2039,\u203a",guillemets:"\xab,\xbb",none:null},negativePositiveSignPlacement:{prefix:"p",suffix:"s",left:"l",right:"r",none:null},negativeSignCharacter:{hyphen:"-",minus:"\u2212",heavyMinus:"\u2796",fullWidthHyphen:"\uff0d",circledMinus:"\u2296",squaredMinus:"\u229f",triangleMinus:"\u2a3a",plusMinus:"\xb1",minusPlus:"\u2213",dotMinus:"\u2238",minusTilde:"\u2242",not:"\xac"},noEventListeners:{noEvents:!0,addEvents:!1},onInvalidPaste:{error:"error",ignore:"ignore",clamp:"clamp",truncate:"truncate",replace:"replace"},outputFormat:{string:"string",number:"number",dot:".",negativeDot:"-.",comma:",",negativeComma:"-,",dotNegative:".-",commaNegative:",-",none:null},overrideMinMaxLimits:{ceiling:"ceiling",floor:"floor",ignore:"ignore",invalid:"invalid",doNotOverride:null},positiveSignCharacter:{plus:"+",fullWidthPlus:"\uff0b",heavyPlus:"\u2795",doublePlus:"\u29fa",triplePlus:"\u29fb",circledPlus:"\u2295",squaredPlus:"\u229e",trianglePlus:"\u2a39",plusMinus:"\xb1",minusPlus:"\u2213",dotPlus:"\u2214",altHebrewPlus:"\ufb29",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0"},rawValueDivisor:{none:null,percentage:100,permille:1e3,basisPoint:1e4},readOnly:{readOnly:!0,readWrite:!1},roundingMethod:{halfUpSymmetric:"S",halfUpAsymmetric:"A",halfDownSymmetric:"s",halfDownAsymmetric:"a",halfEvenBankersRounding:"B",upRoundAwayFromZero:"U",downRoundTowardZero:"D",toCeilingTowardPositiveInfinity:"C",toFloorTowardNegativeInfinity:"F",toNearest05:"N05",toNearest05Alt:"CHF",upToNext05:"U05",downToNext05:"D05"},saveValueToSessionStorage:{save:!0,doNotSave:!1},selectNumberOnly:{selectNumbersOnly:!0,selectAll:!1},selectOnFocus:{select:!0,doNotSelect:!1},serializeSpaces:{plus:"+",percent:"%20"},showOnlyNumbersOnFocus:{onlyNumbers:!0,showAll:!1},showPositiveSign:{show:!0,hide:!1},showWarnings:{show:!0,hide:!1},styleRules:{none:null,positiveNegative:{positive:"autoNumeric-positive",negative:"autoNumeric-negative"},range0To100With4Steps:{ranges:[{min:0,max:25,class:"autoNumeric-red"},{min:25,max:50,class:"autoNumeric-orange"},{min:50,max:75,class:"autoNumeric-yellow"},{min:75,max:100,class:"autoNumeric-green"}]},evenOdd:{userDefined:[{callback:function(a){return a%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(a){return-1<=a&&a<0?0:0===Number(a)?1:0<a&&a<=1?2:null},classes:["autoNumeric-small-negative","autoNumeric-zero","autoNumeric-small-positive"]}]}},suffixText:{none:"",percentage:"%",permille:"\u2030",basisPoint:"\u2031"},symbolWhenUnfocused:{none:null,percentage:"%",permille:"\u2030",basisPoint:"\u2031"},unformatOnHover:{unformat:!0,doNotUnformat:!1},unformatOnSubmit:{unformat:!0,keepCurrentValue:!1},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},J=d.options,Object.getOwnPropertyNames(J).forEach(function(a){"valuesToStrings"===a?Object.getOwnPropertyNames(J.valuesToStrings).forEach(function(o){n.isIE11()||null===J.valuesToStrings[o]||Object.freeze(J.valuesToStrings[o])}):"styleRules"!==a&&(n.isIE11()||null===J[a]||Object.freeze(J[a]))}),Object.freeze(J),Object.defineProperty(d,"options",{configurable:!1,writable:!1}),d.defaultSettings={allowDecimalPadding:d.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:d.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:d.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:d.options.createLocalList.createList,currencySymbol:d.options.currencySymbol.none,currencySymbolPlacement:d.options.currencySymbolPlacement.prefix,decimalCharacter:d.options.decimalCharacter.dot,decimalCharacterAlternative:d.options.decimalCharacterAlternative.none,decimalPlaces:d.options.decimalPlaces.two,decimalPlacesRawValue:d.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:d.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:d.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:d.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:d.options.digitalGroupSpacing.three,digitGroupSeparator:d.options.digitGroupSeparator.comma,divisorWhenUnfocused:d.options.divisorWhenUnfocused.none,emptyInputBehavior:d.options.emptyInputBehavior.focus,eventBubbles:d.options.eventBubbles.bubbles,eventIsCancelable:d.options.eventIsCancelable.isCancelable,failOnUnknownOption:d.options.failOnUnknownOption.ignore,formatOnPageLoad:d.options.formatOnPageLoad.format,formulaMode:d.options.formulaMode.disabled,historySize:d.options.historySize.medium,invalidClass:d.options.invalidClass,isCancellable:d.options.isCancellable.cancellable,leadingZero:d.options.leadingZero.deny,maximumValue:d.options.maximumValue.tenTrillions,minimumValue:d.options.minimumValue.tenTrillions,modifyValueOnWheel:d.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:d.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:d.options.negativePositiveSignPlacement.none,negativeSignCharacter:d.options.negativeSignCharacter.hyphen,noEventListeners:d.options.noEventListeners.addEvents,onInvalidPaste:d.options.onInvalidPaste.error,outputFormat:d.options.outputFormat.none,overrideMinMaxLimits:d.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:d.options.positiveSignCharacter.plus,rawValueDivisor:d.options.rawValueDivisor.none,readOnly:d.options.readOnly.readWrite,roundingMethod:d.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:d.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:d.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:d.options.selectOnFocus.select,serializeSpaces:d.options.serializeSpaces.plus,showOnlyNumbersOnFocus:d.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:d.options.showPositiveSign.hide,showWarnings:d.options.showWarnings.show,styleRules:d.options.styleRules.none,suffixText:d.options.suffixText.none,symbolWhenUnfocused:d.options.symbolWhenUnfocused.none,unformatOnHover:d.options.unformatOnHover.unformat,unformatOnSubmit:d.options.unformatOnSubmit.keepCurrentValue,valuesToStrings:d.options.valuesToStrings.none,watchExternalChanges:d.options.watchExternalChanges.doNotWatch,wheelOn:d.options.wheelOn.focus,wheelStep:d.options.wheelStep.progressive},Object.freeze(d.defaultSettings),Object.defineProperty(d,"defaultSettings",{configurable:!1,writable:!1});var q={digitGroupSeparator:d.options.digitGroupSeparator.dot,decimalCharacter:d.options.decimalCharacter.comma,decimalCharacterAlternative:d.options.decimalCharacterAlternative.dot,currencySymbol:"\u202f\u20ac",currencySymbolPlacement:d.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:d.options.negativePositiveSignPlacement.prefix},re={digitGroupSeparator:d.options.digitGroupSeparator.comma,decimalCharacter:d.options.decimalCharacter.dot,currencySymbol:d.options.currencySymbol.dollar,currencySymbolPlacement:d.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:d.options.negativePositiveSignPlacement.right},Se={digitGroupSeparator:d.options.digitGroupSeparator.comma,decimalCharacter:d.options.decimalCharacter.dot,currencySymbol:d.options.currencySymbol.yen,currencySymbolPlacement:d.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:d.options.negativePositiveSignPlacement.right};n.cloneObject(q).formulaMode=d.options.formulaMode.enabled;var _e=n.cloneObject(q);_e.minimumValue=0;var de=n.cloneObject(q);de.maximumValue=0,de.negativePositiveSignPlacement=d.options.negativePositiveSignPlacement.prefix;var ue=n.cloneObject(q);ue.digitGroupSeparator=d.options.digitGroupSeparator.normalSpace;var be=n.cloneObject(ue);be.minimumValue=0;var ve=n.cloneObject(ue);ve.maximumValue=0,ve.negativePositiveSignPlacement=d.options.negativePositiveSignPlacement.prefix;var ne=n.cloneObject(q);ne.currencySymbol=d.options.currencySymbol.none,ne.suffixText="\u202f".concat(d.options.suffixText.percentage),ne.wheelStep=1e-4,ne.rawValueDivisor=d.options.rawValueDivisor.percentage;var pe=n.cloneObject(ne);pe.minimumValue=0;var ie=n.cloneObject(ne);ie.maximumValue=0,ie.negativePositiveSignPlacement=d.options.negativePositiveSignPlacement.prefix;var w=n.cloneObject(ne);w.decimalPlaces=3;var P=n.cloneObject(pe);P.decimalPlaces=3;var S=n.cloneObject(ie);S.decimalPlaces=3,n.cloneObject(re).formulaMode=d.options.formulaMode.enabled;var F=n.cloneObject(re);F.minimumValue=0;var C=n.cloneObject(re);C.maximumValue=0,C.negativePositiveSignPlacement=d.options.negativePositiveSignPlacement.prefix;var W=n.cloneObject(C);W.negativeBracketsTypeOnBlur=d.options.negativeBracketsTypeOnBlur.parentheses;var Q=n.cloneObject(re);Q.currencySymbol=d.options.currencySymbol.none,Q.suffixText=d.options.suffixText.percentage,Q.wheelStep=1e-4,Q.rawValueDivisor=d.options.rawValueDivisor.percentage;var fe=n.cloneObject(Q);fe.minimumValue=0;var we=n.cloneObject(Q);we.maximumValue=0,we.negativePositiveSignPlacement=d.options.negativePositiveSignPlacement.prefix;var Ce=n.cloneObject(Q);Ce.decimalPlaces=3;var xe=n.cloneObject(fe);xe.decimalPlaces=3;var Te=n.cloneObject(we);Te.decimalPlaces=3;var Fe=n.cloneObject(q);Fe.currencySymbol=d.options.currencySymbol.lira,d.predefinedOptions={euro:q,euroPos:_e,euroNeg:de,euroSpace:ue,euroSpacePos:be,euroSpaceNeg:ve,percentageEU2dec:ne,percentageEU2decPos:pe,percentageEU2decNeg:ie,percentageEU3dec:w,percentageEU3decPos:P,percentageEU3decNeg:S,dollar:re,dollarPos:F,dollarNeg:C,dollarNegBrackets:W,percentageUS2dec:Q,percentageUS2decPos:fe,percentageUS2decNeg:we,percentageUS3dec:Ce,percentageUS3decPos:xe,percentageUS3decNeg:Te,French:q,Spanish:q,NorthAmerican:re,British:{digitGroupSeparator:d.options.digitGroupSeparator.comma,decimalCharacter:d.options.decimalCharacter.dot,currencySymbol:d.options.currencySymbol.pound,currencySymbolPlacement:d.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:d.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:d.options.digitGroupSeparator.apostrophe,decimalCharacter:d.options.decimalCharacter.dot,currencySymbol:"\u202fCHF",currencySymbolPlacement:d.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:d.options.negativePositiveSignPlacement.prefix},Japanese:Se,Chinese:Se,Brazilian:{digitGroupSeparator:d.options.digitGroupSeparator.dot,decimalCharacter:d.options.decimalCharacter.comma,currencySymbol:d.options.currencySymbol.real,currencySymbolPlacement:d.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:d.options.negativePositiveSignPlacement.right},Turkish:Fe,dotDecimalCharCommaSeparator:{digitGroupSeparator:d.options.digitGroupSeparator.comma,decimalCharacter:d.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:d.options.digitGroupSeparator.dot,decimalCharacter:d.options.decimalCharacter.comma,decimalCharacterAlternative:d.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:d.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:d.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:d.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:d.options.allowDecimalPadding.never,minimumValue:d.options.minimumValue.zero,maximumValue:d.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:d.options.allowDecimalPadding.never,minimumValue:d.options.minimumValue.tenTrillions,maximumValue:d.options.maximumValue.zero},numeric:{digitGroupSeparator:d.options.digitGroupSeparator.noSeparator,decimalCharacter:d.options.decimalCharacter.dot,currencySymbol:d.options.currencySymbol.none},numericPos:{digitGroupSeparator:d.options.digitGroupSeparator.noSeparator,decimalCharacter:d.options.decimalCharacter.dot,currencySymbol:d.options.currencySymbol.none,minimumValue:d.options.minimumValue.zero,maximumValue:d.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:d.options.digitGroupSeparator.noSeparator,decimalCharacter:d.options.decimalCharacter.dot,currencySymbol:d.options.currencySymbol.none,minimumValue:d.options.minimumValue.tenTrillions,maximumValue:d.options.maximumValue.zero}},Object.getOwnPropertyNames(d.predefinedOptions).forEach(function(a){Object.freeze(d.predefinedOptions[a])}),Object.freeze(d.predefinedOptions),Object.defineProperty(d,"predefinedOptions",{configurable:!1,writable:!1}),E.default=d}],M.c=l,M.d=function(T,E,K){M.o(T,E)||Object.defineProperty(T,E,{enumerable:!0,get:K})},M.r=function(T){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(T,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(T,"__esModule",{value:!0})},M.t=function(T,E){if(1&E&&(T=M(T)),8&E||4&E&&"object"==typeof T&&T&&T.__esModule)return T;var K=Object.create(null);if(M.r(K),Object.defineProperty(K,"default",{enumerable:!0,value:T}),2&E&&"string"!=typeof T)for(var b in T)M.d(K,b,function(g){return T[g]}.bind(null,b));return K},M.n=function(T){var E=T&&T.__esModule?function(){return T.default}:function(){return T};return M.d(E,"a",E),E},M.o=function(T,E){return Object.prototype.hasOwnProperty.call(T,E)},M.p="",M(M.s=0).default;function M(T){if(l[T])return l[T].exports;var E=l[T]={i:T,l:!1,exports:{}};return k[T].call(E.exports,E,E.exports,M),E.l=!0,E.exports}var k,l}()}}]);