dealposbarcode 1.5.9 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (self.webpackChunkbarcode_app=self.webpackChunkbarcode_app||[]).push([[383],{2383:(W,b,E)=>{"use strict";E.r(b),E.d(b,{PagesModule:()=>gt});var A=E(6814),F=E(915),t=E(5879),v=E(5619),D=E(2181);let R=(()=>{var f;class g{constructor(){this.store=new v.X([])}getState(){return this.store.asObservable().pipe((0,D.h)(o=>void 0!==o))}setState(o){this.store.next(o)}}return(f=g).\u0275fac=function(o){return new(o||f)},f.\u0275prov=t.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),g})();var k=E(9049),I=E(2262),y=E(8645),l=E(9773),u=E(7398),n=E(6013),d=function(f){return f[f.SUPPLIER_BILL=0]="SUPPLIER_BILL",f[f.OUTLET_DELIVERY=1]="OUTLET_DELIVERY",f}(d||{}),m=E(7700),S=E(5141),_=E(95),U=E(4807),G=E(4211);let z=(()=>{var f;class g{constructor(o,c){this.data=o,this.dialogRef=c,this.outlets=o.outlets}ngOnInit(){this.initModalConfig(),this.initTransactionType()}initModalConfig(){this.modalConfig=new S.O,this.modalConfig.title="Choose your transaction",this.modalConfig.hideMoreButton=!0}initTransactionType(){this.transactionTypes=[{title:"Supplier Bill",type:d.SUPPLIER_BILL},{title:"Transfer Order",type:d.OUTLET_DELIVERY}]}onOk(){this.selectedOutlet&&this.poNumber&&this.dialogRef.close({Outlet:this.selectedOutlet.Name,Number:this.poNumber,Type:this.selectedTransactionType})}onCancel(){this.dialogRef.close()}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(m.WI),t.Y36(m.so))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-form-add-bill"]],decls:18,vars:10,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["bindLabel","title","bindValue","type","placeholder","Choose Type",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"pt-6"],["bindLabel","Name","placeholder","Choose Outlet",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"form-label-group"],["min","1","id","qty","type","text","placeholder","Invoice Number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["for","qty"]],template:function(o,c){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return c.onOk()})("onCancel",function(){return c.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"table",3)(5,"tbody")(6,"tr",4)(7,"td")(8,"ng-select",5),t.NdJ("ngModelChange",function(M){return c.selectedTransactionType=M}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td",6)(11,"ng-select",7),t.NdJ("ngModelChange",function(M){return c.selectedOutlet=M}),t.qZA()()(),t.TgZ(12,"tr",4)(13,"td",6)(14,"div",8)(15,"input",9),t.NdJ("ngModelChange",function(M){return c.poNumber=M}),t.qZA(),t.TgZ(16,"label",10),t._uU(17,"Invoice Number"),t.qZA()()()()()()()()()()),2&o&&(t.Q6J("config",c.modalConfig),t.xp6(8),t.Q6J("items",c.transactionTypes)("ngModel",c.selectedTransactionType)("clearable",!1)("appendTo","body"),t.xp6(3),t.Q6J("items",c.outlets)("ngModel",c.selectedOutlet)("clearable",!1)("appendTo","body"),t.xp6(4),t.Q6J("ngModel",c.poNumber))},dependencies:[_.Fj,_.JJ,_.On,U.w9,G.M]}),g})();var X=E(9397),ge=E(7081),ue=E(631);let pe=(()=>{var f;class g{constructor(o){this.httpService=o,this.barcodeConfigState=new v.X(null)}updatePaperFormatConfig(o){let c=localStorage.getItem("Domain");return this.httpService.post("/api/Config/SaveConfig",{SubDomain:c,Version:this.paperFormatVersion,PaperFormats:o})}getPaperFormatConfig(){let o=localStorage.getItem("Domain"),c=[];return this.httpService.post("/api/Config/PaperConfig",{SubDomain:o}).pipe((0,u.U)(K=>(this.paperFormatVersion=K.version,c=K.PaperFormats,{paperFormat:c,outlets:K.Outlets})),(0,ge.d)(1))}setBarcodeConfigState(o){this.barcodeConfigState.next(o)}getBarcodeConfigState(){return this.barcodeConfigState.asObservable().pipe((0,D.h)(o=>n.gT.IsNotEmpty(o)))}}return(f=g).\u0275fac=function(o){return new(o||f)(t.LFG(ue.O))},f.\u0275prov=t.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),g})();var ke=E(9862);class xe{constructor(g){g&&(this.AccountID=g.AccountID,this.CalculationTypeID=g.CalculationTypeID,this.ID=g.ID,this.Index=g.Index,this.Label=g.Label,this.MultipleTaxTypeID=g.MultipleTaxTypeID,this.Note=g.Note,this.PrintVisible=g.PrintVisible,this.Rate=g.Rate,this.TypeID=g.TypeID,this.Name=g.Name,this.Type=g.Type)}get getID(){return this.ID}get getType(){return this.Type}get getName(){return this.Name}get getAccountID(){return this.AccountID}set setAccountId(g){this.AccountID=g}get getCalculationTypeID(){return this.CalculationTypeID}set setCalculationID(g){this.CalculationTypeID=g}get getRate(){return this.Rate}set setRate(g){this.Rate=g}get getLabel(){return this.Label}}class Q{get getPriceDiscount(){return this.PriceDiscount}set setPriceDiscount(g){this.PriceDiscount=g}get getReleaseDate(){return this.ReleasedDate}set setReleaseDate(g){this.ReleasedDate=g}get getID(){return this.ID}set setID(g){this.ID=g}get getSelectedPromotion(){return this.SelectedPromotion}set setSelectedPromotion(g){this.SelectedPromotion=g}get getDescription(){return this.description}set setDescription(g){this.description=g}set setBarcodeTitle(g){this.barcodeTitle=g}get getBarcodeTitle(){return this.barcodeTitle}set setCustomPrice(g){this.customPrice=g}get getCustomPrice(){return this.customPrice}get getUnitPrice(){return this.UnitPrice}set setUnitPrice(g){this.UnitPrice=g}get getCode(){return this.Code}set setCode(g){this.barcodeTitle=g,this.Code=g}get getModel(){return this.Model}set setModel(g){this.Model=g}get getName(){return this.Name}set setName(g){this.Name=g}get getCurrency(){return this.CurrencySymbol}set setCurrency(g){this.CurrencySymbol=g}}class ee{get getCode(){return this.Code}get getName(){return this.Name}get getSuspended(){return this.Suspended}set setCode(g){this.Code=g}set setName(g){this.Name=g}set setSuspended(g){this.Suspended=g}}class ne{get getOutlet(){return this.Outlet}get getNumber(){return this.Number}get getDate(){return this.Date}get getDueDate(){return this.DueDate}get getSupplier(){return this.Supplier}get getCreatorID(){return this.CreatorID}get getCreated(){return this.Created}get getDiscount1(){return this.Discount1}get getDiscountAmount(){return this.DiscountAmount}get getGross(){return this.Gross}get getDiscountTotal(){return this.DiscountTotal}get getTaxType(){return this.TaxType}get getTax(){return this.Tax}get getPurchase(){return this.Purchase}get getPurchaseNTax(){return this.PurchaseNTax}get getDelivery(){return this.Delivery}get getVariants(){return this.Variants}get getPayments(){return this.Payments}set setOutlet(g){this.Outlet=g}set setNumber(g){this.Number=g}set setDate(g){this.Date=g}set setDueDate(g){this.DueDate=g}set setSupplier(g){this.Supplier=g}set setCreatorID(g){this.CreatorID=g}set setCreated(g){this.Created=g}set setDiscount1(g){this.Discount1=g}set setDiscountAmount(g){this.DiscountAmount=g}set setGross(g){this.Gross=g}set setDiscountTotal(g){this.DiscountTotal=g}set setTaxType(g){this.TaxType=g}set setTax(g){this.Tax=g}set setPurchase(g){this.Purchase=g}set setPurchaseNTax(g){this.PurchaseNTax=g}set setDelivery(g){this.Delivery=g}set setVariants(g){this.Variants=g}set setPayments(g){this.Payments=g}}class Y extends Q{constructor(){super()}get getVariantID(){return this.VariantID}get getQuantity(){return this.Quantity}get getPrice(){return this.Price}get getDiscount(){return this.Discount}get getNettPrice(){return this.NettPrice}set setVariantID(g){this.VariantID=g}set setQuantity(g){this.Quantity=g}set setPrice(g){this.Price=g}set setDiscount(g){this.Discount=g}set setNettPrice(g){this.NettPrice=g}}class J{get getID(){return this.ID}set setID(g){this.ID=g}get getName(){return this.Name}set setName(g){this.Name=g}get getDiscount(){return this.Discount}get getExtraCost(){return this.ExtraCost}get getPromotionID(){return this.PromotionID}get getUnitPrice(){return this.UnitPrice}set setDiscount(g){this.Discount=g}set setExtraCost(g){this.ExtraCost=g}set setPromotionID(g){this.PromotionID=g}set setUnitPrice(g){this.UnitPrice=g}}let ae=(()=>{var f;class g{constructor(){this.outletID=null,this.outletName=""}}return(f=g).\u0275fac=function(o){return new(o||f)},f.\u0275prov=t.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),g})(),be=(()=>{var f;class g{constructor(o){this.outlet=o}getProductModel(o){let c=new Q;c.setID=o.ID,c.setCode=o.Code,c.setCurrency=o.CurrencySymbol,c.setModel=o.Model,c.setName=o.Name,c.setUnitPrice=o.UnitPrice,c.setDescription=o.Description,c.setReleaseDate=o.ReleasedDate,c.setPriceDiscount=o.PriceDiscount;const M=o.OutletPrice?.find(K=>K.Outlet==this.outlet.outletName);return M&&(c.setUnitPrice=M.Price),c}getTaxModel(o){return new xe(o)}getOutletModel(o){let c=new ee;return c.setCode=o.Code,c.setName=o.Name,c.setSuspended=o.Suspended,c}getVariantModel(o){let c=new Y;return c.setCode=o.Code,c.setDiscount=o.Discount,c.setNettPrice=o.NettPrice,c.setPrice=o.Price,c.setUnitPrice=o.UnitPrice,c.setQuantity=o.Quantity,c.setVariantID=o.VariantID,c.setName=o.Name,c}getBillModel(o){let c=new ne;return c.setNumber=o.Number,c.setOutlet=o.Outlet,c.setVariants=o.Variants?o.Variants.map(P=>this.getVariantModel(P)):[],c}getPromotionModel(o){let c=new J;return c.setDiscount=o.Discount,c.setExtraCost=o.ExtraCost,c.setPromotionID=o.PromotionID,c.setUnitPrice=o.UnitPrice,c.setName=o.Name,c.setID=o.ID,c}}return(f=g).\u0275fac=function(o){return new(o||f)(t.LFG(ae))},f.\u0275prov=t.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),g})(),le=(()=>{var f;class g{constructor(o,c,P,M){this.httpService=o,this.http=c,this.factoryService=P,this.outlet=M}getProductById(o){let c=localStorage.getItem("Domain");return this.httpService.post(`https://${c}/API/V3/Variant/ID`,{ID:o}).pipe((0,u.U)(P=>this.factoryService.getProductModel(P)))}getPromotionByProducID(o){let c=localStorage.getItem("Domain");return this.httpService.post(`https://${c}/API/v3/PromotionEvent/GetByVariantID`,{VariantID:o}).pipe((0,u.U)(P=>P.map(K=>this.factoryService.getPromotionModel(K))))}uploadProducts(o){let c=localStorage.getItem("Domain"),P=new FormData;return P.append("file",o,o.name),P.append("OutletID",String(this.outlet.outletID)),this.httpService.postFormData(`https://${c}/API/catalog/product/UploadCSVforBarcode`,P).pipe((0,u.U)(M=>M.map(K=>(K.Print=K.Print.map(te=>this.factoryService.getProductModel(te)),K))))}getTax(){let o=localStorage.getItem("Domain"),c=localStorage.getItem("Token"),P=`https://${o}/API/V3/Tax`,M=new ke.WM({authorization:"Bearer "+c,"content-type":"application/json","X-ClientId":"dealpos-app"});return this.http.get(P,{headers:M}).pipe((0,u.U)(K=>{if(K)return K.map(te=>this.factoryService.getTaxModel(te))}))}}return(f=g).\u0275fac=function(o){return new(o||f)(t.LFG(ue.O),t.LFG(ke.eN),t.LFG(be),t.LFG(ae))},f.\u0275prov=t.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),g})();var fe=E(6608);let Re=(()=>{var f;class g{set _max(o){o&&(this.max=o,this.updateNumericSettings())}set _min(o){o&&(this.min=o,this.updateNumericSettings())}constructor(o){this.elementRef=o,this.decimalPlaces=4,this.modifyValueOnWheel=!0,this.max="999999999999999.9999",this.min="-999999999999999.9999",this.propagateChange=P=>{},this.preventNegative=!1,this.numericElement=new fe(this.elementRef.nativeElement,null,{digitGroupSeparator:",",decimalCharacter:".",decimalPlaces:this.decimalPlaces,maximumValue:this.max,minimumValue:this.min,allowDecimalPadding:!1,showWarnings:!1})}ngOnInit(){""==this.percentage&&(this.max="100"),this.preventNegative&&(this.min="0.00"),this.updateNumericSettings()}updateNumericSettings(){const o={maximumValue:this.max,minimumValue:this.min,readOnly:this.isElementDisabled(),decimalPlaces:this.decimalPlaces,modifyValueOnWheel:this.modifyValueOnWheel};this.numericElement.update(o)}onKeyUp(){let o=this.numericElement.getNumber();this.propagateChange(o)}isElementDisabled(){let o=!1;return(!0===this.elementRef.nativeElement.readOnly||!0===this.elementRef.nativeElement.disabled)&&(o=!0),o}writeValue(o){null!=o&&this.numericElement.set(o)}registerOnChange(o){this.propagateChange=o}registerOnTouched(){}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(t.SBq))},f.\u0275dir=t.lG2({type:f,selectors:[["","autoNum",""]],hostBindings:function(o,c){1&o&&t.NdJ("keyup",function(){return c.onKeyUp()})},inputs:{percentage:"percentage",preventNegative:"preventNegative",decimalPlaces:"decimalPlaces",modifyValueOnWheel:"modifyValueOnWheel",_max:["max","_max"],_min:["min","_min"]},features:[t._Bn([{provide:_.JU,useExisting:(0,t.Gpc)(()=>f),multi:!0}])]}),g})();var Te=E(2065),We=E(3620),ce=E(3680);const N=["input"];function ye(f,g){if(1&f&&t._UZ(0,"img",10),2&f){const O=t.oxw().$implicit;t.Q6J("src",O.ImgUrl,t.LSH)}}function Ce(f,g){if(1&f){const O=t.EpF();t.TgZ(0,"mat-option",8),t.NdJ("click",function(c){const M=t.CHM(O).$implicit;return t.oxw().changeDisplayName(M),t.KtG(c.stopPropagation())}),t.YNc(1,ye,1,1,"img",9),t._uU(2),t.qZA()}if(2&f){const O=g.$implicit,o=t.oxw();t.Q6J("value",O),t.xp6(1),t.Q6J("ngIf",o.renderThumbnail&&O.ImgUrl),t.xp6(1),t.hij(" ",O.Value," ")}}let Je=(()=>{var f;class g{set display(o){this.input.nativeElement.value=o}get value(){return this._value}set value(o){this._value=o,this.propagateChange(this._value)}constructor(o,c){this.httpService=o,this.ngZone=c,this.offlineStorage=[],this.inputLock=!1,this.renderThumbnail=!1,this.onOffline=new t.vpe,this.onEnter=new t.vpe,this.onSelect=new t.vpe,this.onOptionSelect=new t.vpe,this.reset=new t.vpe,this.termControl=new _.p4(""),this.options=[],this.complete=!1,this.foundProduct=!1,this.propagateChange=P=>{},this.termControl.valueChanges.pipe((0,We.b)(500)).subscribe(P=>{this.options=[],"object"==typeof P?(this.value=P.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(P.Value),this.complete=!0),this.onSelect&&this.onSelect.emit(P.Key),this.options=[],"object"==typeof P&&(this.value=P.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(P.Value),this.complete=!0),this.onOptionSelect)&&this.onOptionSelect.emit(JSON.stringify({Key:P.Key,Value:P.Value}))):"string"==typeof P&&P.length>0?P.length>2&&!this.inputLock&&this.search(P):this.clear()})}ngOnChanges(o){null!=o.ngModel&&null==o.ngModel.currentValue&&this.clear(),null!=o.display&&o.display.currentValue!=o.display.previousValue&&this.termControl.setValue(o.display.currentValue)}ngAfterViewInit(){}search(o){if(this.termControl.value.length>0){let c={};if(this.data&&(c=this.data),c.prefix=o,c.count=100,this.complete)this.complete=!1;else{let P=this.url,M=localStorage.getItem("Domain");M&&(P=`https://${M}${this.url}`),this.httpService.post(P,c).subscribe(K=>{this.options=K,this.foundProduct=this.options.length>0})}}else this.options=null}onblur(){setTimeout(()=>{},600)}changeDisplayName(o){this.input.nativeElement.value=o.Value}onKeydown(o){const c=o.key;"Enter"===c?(this.clearOnSelect&&this.clear(),!this.foundProduct&&this.termControl.value.length>0&&(this.onEnter.emit(this.termControl.value),o.stopPropagation()),null!=this.termControl.value&&(this.input.nativeElement.value=this.termControl.value.Value),this.foundProduct=!1):(this.inputLock&&("Backspace"===c?this.clear():this.validateInputLock()),this.complete=!1,this.reset.emit())}validateInputLock(){""==this.input.nativeElement.value||0==this.input.nativeElement.value.length?this.startInput=new Date:(new Date).getTime()-this.startInput.getTime()>500&&this.clear()}clear(){this.value=null,this.input.nativeElement.value=""}displayFn(o){return o&&o.Value}writeValue(o){}registerOnChange(o){this.propagateChange=o}registerOnTouched(){}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(ue.O),t.Y36(t.R0b))},f.\u0275cmp=t.Xpm({type:f,selectors:[["autocomplete"]],viewQuery:function(o,c){if(1&o&&t.Gf(N,7),2&o){let P;t.iGM(P=t.CRH())&&(c.input=P.first)}},inputs:{placeholder:"placeholder",url:"url",clearOnSelect:"clearOnSelect",offlineStorage:"offlineStorage",inputLock:"inputLock",data:"data",renderThumbnail:"renderThumbnail",ngModel:"ngModel",displayText:"displayText",localStorage:"localStorage",_value:"_value",display:"display"},outputs:{onOffline:"onOffline",onEnter:"onEnter",onSelect:"onSelect",onOptionSelect:"onOptionSelect",reset:"reset"},features:[t._Bn([{provide:_.JU,useExisting:(0,t.Gpc)(()=>f),multi:!0}]),t.TTD],decls:9,vars:5,consts:[[1,"w-100"],[1,"form-label-group"],["id","input","type","text","matInput","",1,"form-control","text-black",3,"matAutocomplete","placeholder","formControl","paste","keydown","blur"],["input",""],["for","input"],["autoActiveFirstOption","true"],["autocomplete","matAutocomplete"],["class","option-autocomplete",3,"value","click",4,"ngFor","ngForOf"],[1,"option-autocomplete",3,"value","click"],["width","30","height","30",3,"src",4,"ngIf"],["width","30","height","30",3,"src"]],template:function(o,c){if(1&o&&(t.TgZ(0,"mat-form-field",0)(1,"div",1)(2,"input",2,3),t.NdJ("paste",function(M){return c.inputLock?M.preventDefault():""})("keydown",function(M){return c.onKeydown(M)})("blur",function(){return c.onblur()}),t.qZA(),t.TgZ(4,"label",4),t._uU(5),t.qZA()()(),t.TgZ(6,"mat-autocomplete",5,6),t.YNc(8,Ce,3,3,"mat-option",7),t.qZA()),2&o){const P=t.MAs(7);t.xp6(2),t.s9C("placeholder",c.placeholder||""),t.Q6J("matAutocomplete",P)("formControl",c.termControl),t.xp6(3),t.Oqu(c.placeholder||""),t.xp6(3),t.Q6J("ngForOf",c.options)}},dependencies:[Te.XC,ce.ey,Te.ZL,A.sg,A.O5,_.Fj,_.JJ,_.oH],styles:["mat-option[_ngcontent-%COMP%]{font-size:12px}"]}),g})(),Ke=(()=>{var f;class g{}return(f=g).\u0275fac=function(o){return new(o||f)},f.\u0275mod=t.oAB({type:f}),f.\u0275inj=t.cJS({imports:[Te.Bb,A.ez,_.UX]}),g})(),Ae=(()=>{var f;class g{constructor(o,c,P,M,K){this.dialogRef=o,this.barcodeService=c,this.productService=P,this.authenticationService=M,this.data=K,this.modalConfig=new S.O,this.variantName="",this.hasProductEdit=!0,this.hasPromotion=!1,this.destroy$=new y.x,this.variantName=K.variantName,this.qty=K.qty,this.customPrice=K.customPrice}ngOnInit(){this.getBarcodeConfig(),this.initModalConfig(),this.initProductUpdate(),this.initRoleProductEdit()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initRoleProductEdit(){let o=this.authenticationService.getRoles();this.hasProductEdit=-1!==o.findIndex(c=>"ProdE"==c)}initProductUpdate(){n.gT.IsNotEmpty(this.data.variantId)&&this.getProductById(this.data.variantId).subscribe(o=>{this.product.setSelectedPromotion=this.data.promotion,this.hasPromotion=n.gT.IsNotEmpty(this.data.promotion)})}getBarcodeConfig(){this.barcodeService.getBarcodeConfigState().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&(this.paperFormat=o)})}initModalConfig(){this.modalConfig.title="Add New Product Barcode?",this.modalConfig.hideMoreButton=!0}onSelectProduct(o){this.getProductById(o).subscribe(c=>{this.customPrice=c.getUnitPrice,this.hasPromotion=!1,this.product.setSelectedPromotion=null})}getProductById(o){return this.productService.getProductById(o).pipe((0,X.b)(c=>{this.product=c,this.getPromotionByProductID(o)}))}getPromotionByProductID(o){this.productService.getPromotionByProducID(o).subscribe(c=>{this.promotions=c})}onCustomPriceChange(o){this.customPrice=o}onSelectPromotion(o){o?(this.product.setSelectedPromotion=this.promotions.find(c=>c.getName==o?.getName),this.customPrice=this.product.getUnitPrice,this.hasPromotion=n.gT.IsNotEmpty(this.product.getSelectedPromotion)):(this.hasPromotion=!1,this.product.setSelectedPromotion=null)}onOk(){this.qty&&this.qty>0&&this.product&&this.dialogRef.close({customPrice:this.customPrice,product:this.product,quantity:this.qty})}onCancel(){this.dialogRef.close()}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(m.so),t.Y36(pe),t.Y36(le),t.Y36(k.$),t.Y36(m.WI))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-form-add-variant"]],features:[t._Bn([A.JJ])],decls:24,vars:7,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["placeholder","Name","url","/API/AC/GetVariantSuggestionByCodeNName",3,"display","onSelect"],[1,"form-label-group"],["id","qty","type","text","placeholder","Quantity","aria-label","width","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","qty"],[1,"pb-9"],["bindLabel","Name","bindValue","PromotionID","appendTo","body","placeholder","Select Promotion Price",1,"sticky-top","tall",3,"items","ngModel","change"],["placeholder","Price","aria-label","width","autoNum","",1,"form-control",3,"ngModel","readonly","ngModelChange"],["for","price"]],template:function(o,c){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return c.onOk()})("onCancel",function(){return c.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"table",3)(5,"tbody")(6,"tr",4)(7,"td")(8,"autocomplete",5),t.NdJ("onSelect",function(M){return c.onSelectProduct(M)}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td")(11,"div",6)(12,"input",7),t.NdJ("ngModelChange",function(M){return c.qty=M}),t.qZA(),t.TgZ(13,"label",8),t._uU(14,"Quantity"),t.qZA()()()(),t.TgZ(15,"tr",4)(16,"td",9)(17,"ng-select",10),t.NdJ("change",function(M){return c.onSelectPromotion(M)}),t.qZA()()(),t.TgZ(18,"tr",4)(19,"td")(20,"div",6)(21,"input",11),t.NdJ("ngModelChange",function(M){return c.onCustomPriceChange(M)}),t.qZA(),t.TgZ(22,"label",12),t._uU(23,"Price"),t.qZA()()()()()()()()()()),2&o&&(t.Q6J("config",c.modalConfig),t.xp6(8),t.Q6J("display",c.variantName),t.xp6(4),t.Q6J("ngModel",c.qty),t.xp6(5),t.Q6J("items",c.promotions)("ngModel",null==c.product||null==c.product.getSelectedPromotion?null:c.product.getSelectedPromotion.getPromotionID),t.xp6(4),t.Q6J("ngModel",c.customPrice)("readonly",c.hasPromotion||!c.hasProductEdit))},dependencies:[_.Fj,_.JJ,_.On,U.w9,G.M,Re,Je]}),g})(),Fe=(()=>{var f;class g{constructor(o,c){this.dialogRef=o,this.data=c,this.event=new t.vpe,this.modalConfig=new S.O}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig.title="Upload New Product Barcode?",this.modalConfig.hideMoreButton=!0}onOk(){this.dialogRef.close(this.files)}onCancel(){this.dialogRef.close()}onUploadFile(o){o&&(this.files=o.target.files)}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(m.so),t.Y36(m.WI))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-form-upload-variant"]],outputs:{event:"event"},decls:15,vars:1,consts:[[3,"config","onOk","onCancel"],[1,"row"],[1,"col-sm-12"],["href","//res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",2,"font-size","12px"],[1,"value-title"],["type","file","aria-label","upload",3,"change"]],template:function(o,c){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return c.onOk()})("onCancel",function(){return c.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"a",3),t._uU(5,"Download Sample CSV"),t.qZA(),t.TgZ(6,"table")(7,"tbody")(8,"tr")(9,"th",4),t._uU(10,"CSV File"),t.qZA(),t.TgZ(11,"td"),t._uU(12,":"),t.qZA(),t.TgZ(13,"td")(14,"input",5),t.NdJ("change",function(M){return c.onUploadFile(M)}),t.qZA()()()()()()()()()),2&o&&t.Q6J("config",c.modalConfig)},dependencies:[G.M]}),g})();var Be=E(9229);let Ue=(()=>{var f;class g{constructor(o,c){this.httpService=o,this.factoryService=c}get(){let c=localStorage.getItem("Domain");return this.httpService.post(`https://${c}/api/v3/Outlet/p`,{Suspended:!1}).pipe((0,u.U)(P=>{let M=[];return P&&(M=P.map(K=>this.factoryService.getOutletModel(K))),M}))}}return(f=g).\u0275fac=function(o){return new(o||f)(t.LFG(ue.O),t.LFG(be))},f.\u0275prov=t.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),g})(),_e=(()=>{var f;class g{constructor(o,c){this.httpService=o,this.factoryService=c}get(o){let c=localStorage.getItem("Domain"),P=this.getEndPointByType(o.Type);return this.httpService.post(`https://${c}${P}`,{Outlet:o.Outlet,Number:o.Number}).pipe((0,u.U)(K=>K.map(te=>this.factoryService.getVariantModel(te))))}getEndPointByType(o){let c;return c=o===d.SUPPLIER_BILL?"/API/V3/Barcode/byBillNumber":"/API/V3/Barcode/byOutletDeliveryNumber",c}}return(f=g).\u0275fac=function(o){return new(o||f)(t.LFG(ue.O),t.LFG(be))},f.\u0275prov=t.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),g})();function Ze(f,g){if(1&f){const O=t.EpF();t.TgZ(0,"tr",22),t.NdJ("click",function(){const c=t.CHM(O),P=c.$implicit,M=c.index,K=t.oxw();return t.KtG(K.onUpdateProduct(P,M))}),t.TgZ(1,"td")(2,"i",23),t.NdJ("click",function(){const P=t.CHM(O).index,M=t.oxw();return t.KtG(M.onDeleteProduct(P))}),t.qZA()(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",24),t._uU(6),t.qZA()()}if(2&f){const O=g.$implicit;t.xp6(4),t.AsE(" ",null==O||null==O.Variants[0]?null:O.Variants[0].getName,"- ",null==O||null==O.Variants[0]?null:O.Variants[0].getCode," - "),t.xp6(2),t.Oqu(null==O?null:O.Quantity)}}let Ve=(()=>{var f;class g{constructor(o,c,P,M,K,te,re,ie){this.dialog=o,this.productStateService=c,this.productService=P,this.toastService=M,this.queryParamService=K,this.outletService=te,this.billService=re,this.barcodeService=ie,this.destroy$=new y.x,this.stickerTotal=0,this.productGroups=[],this.productSource=[],this.getRouteParam(),this.initOutlets()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getRouteParam(){this.queryParamService.getState().pipe((0,l.R)(this.destroy$),(0,D.h)(o=>n.gT.IsEmpty(o))).subscribe(o=>{o?.ID&&this.getProductById(o.ID,5),o.billNumber&&this.getBill({Number:o.billNumber,Outlet:o.outletName,Type:d.SUPPLIER_BILL})})}initOutlets(){this.barcodeService.getPaperFormatConfig().pipe((0,u.U)(o=>o.outlets),(0,l.R)(this.destroy$)).subscribe(o=>{this.outlets=o})}onAddBill(){this.dialog.open(z,{width:"350px",data:{outlets:this.outlets}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&this.getBill(o)})}getBill(o){this.billService.get(o).pipe((0,l.R)(this.destroy$)).subscribe(c=>{c&&c.forEach(P=>{this.checkAvailableProductCode(P);let M=this.generateProductByQty(P,P.getQuantity);this.productGroups=[...this.productGroups,{VariantID:P.getVariantID,Quantity:P.getQuantity,Variants:M}],this.updateProductsSource()})})}onAddProduct(){this.dialog.open(Ae,{width:"350px",data:{variantName:"",variantId:null,qty:null}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&(this.customPrice=o.customPrice,this.generateProductBarcode(o.product,o.quantity))})}getProductById(o,c){this.productService.getProductById(o).pipe((0,l.R)(this.destroy$)).subscribe(P=>{P&&this.generateProductBarcode(P,c)})}generateProductBarcode(o,c){this.checkAvailableProductCode(o);let P=this.generateProductByQty(o,c);P=this.updateCustomPriceProducts(P),this.productGroups=[...this.productGroups,{VariantID:o.getID,Quantity:c,Variants:P}],this.updateProductsSource()}checkAvailableProductCode(o){o.getCode||this.toastService.error("Product has no code","Code Not Found")}onUpdateProduct(o,c){this.dialog.open(Ae,{width:"350px",data:{variantName:o.Variants[0].getName+" - "+o.Variants[0].getCode,variantId:o.VariantID,qty:o.Quantity,customPrice:o.Variants[0].getCustomPrice,promotion:o.Variants[0].getSelectedPromotion}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(ve=>{if(ve){this.customPrice=ve.customPrice,this.checkAvailableProductCode(ve.product);let qe=this.generateProductByQty(ve.product,ve.quantity);qe=this.updateCustomPriceProducts(qe),this.productGroups[c].Variants=qe,this.productGroups[c].Quantity=ve.quantity,this.productGroups[c].VariantID=ve.product.getID,this.updateProductsSource()}})}onDeleteProduct(o){this.productGroups=this.productGroups.filter((c,P)=>P!==o),this.updateProductsSource()}updateProductsSource(){this.productSource=[],this.productGroups.forEach(o=>{this.productSource=[...this.productSource,...o.Variants]}),this.stickerTotal=this.productSource.length,this.productStateService.setState(this.productSource)}onUploadProduct(){this.dialog.open(Fe,{width:"350px"}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{if(o){let c;this.productService.uploadProducts(o[0]).pipe((0,l.R)(this.destroy$)).subscribe(P=>{P&&(this.productGroups=[...this.productGroups,...P.map(M=>(c={Quantity:M.Quantity,VariantID:M.VariantID,Variants:M.Print},c))],this.updateProductsSource())})}})}updateCustomPriceProducts(o){let c=o;return this.customPrice&&(c=o.map(P=>(P.setCustomPrice=this.customPrice,P))),c}generateProductByQty(o,c){let P=[];for(let M=1;M<=c;M++)P.push(o);return P}onClear(){this.productGroups=[],this.updateProductsSource()}onPrint(){window.print()}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(m.uw),t.Y36(R),t.Y36(le),t.Y36(Be._W),t.Y36(I.U),t.Y36(Ue),t.Y36(_e),t.Y36(pe))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-list-products"]],decls:33,vars:2,consts:[[1,"card","mt-3","sticky-top"],[1,"card-header","d-flex","justify-content-between","align-items-center","bg-white","pb-5",2,"border","none"],[1,"fw-light","m-1"],[1,"ms-1","fst-italic","text-info","d-block","mt-1"],[1,"btn-group"],["type","button",1,"btn-md","btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-plus"],["aria-hidden","true",1,"fa","fa-upload"],[1,"card-body","py-0"],[1,"table","table-borderless","table-fixed"],[1,"table-light","lh-1"],["scope","col"],["scope","col",1,"text-end"],[3,"click",4,"ngFor","ngForOf"],[1,"card-footer","bg-white","py-8","p-0"],[1,"row"],[1,"col-6","d-flex","justify-content-start"],[1,"btn","btn-xl","btn-outline-secondary",3,"click"],[1,"fa-regular","fa-file-lines","me-2"],[1,"col-6","d-flex","justify-content-end"],[1,"btn","btn-xl","btn-outline-secondary","ms-5",3,"click"],[1,"btn","btn-xl","btn-success","ms-5",3,"click"],[3,"click"],["aria-hidden","true",1,"fa","fa-times",2,"color","#fb404b !important","cursor","pointer",3,"click"],[1,"text-end"]],template:function(o,c){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h1",2),t._uU(3," Products "),t.TgZ(4,"small",3),t._uU(5),t.qZA()(),t.TgZ(6,"div",4)(7,"button",5),t.NdJ("click",function(){return c.onAddProduct()}),t._UZ(8,"i",6),t.qZA(),t.TgZ(9,"button",5),t.NdJ("click",function(){return c.onUploadProduct()}),t._UZ(10,"i",7),t.qZA()()(),t.TgZ(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr"),t._UZ(15,"th",11),t.TgZ(16,"th",11),t._uU(17,"NAME"),t.qZA(),t.TgZ(18,"th",12),t._uU(19,"QTY"),t.qZA()()(),t.TgZ(20,"tbody"),t.YNc(21,Ze,7,3,"tr",13),t.qZA()()(),t.TgZ(22,"div",14)(23,"div",15)(24,"div",16)(25,"a",17),t.NdJ("click",function(){return c.onAddBill()}),t._UZ(26,"i",18),t._uU(27," Load Transaction "),t.qZA()(),t.TgZ(28,"div",19)(29,"a",20),t.NdJ("click",function(){return c.onClear()}),t._uU(30,"Clear"),t.qZA(),t.TgZ(31,"a",21),t.NdJ("click",function(){return c.onPrint()}),t._uU(32,"Print"),t.qZA()()()()()),2&o&&(t.xp6(5),t.hij("( ",0===c.stickerTotal?"":c.stickerTotal," stickers )"),t.xp6(16),t.Q6J("ngForOf",c.productGroups))},dependencies:[A.sg],styles:["td[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{font-size:12px}.btn[_ngcontent-%COMP%]{font-size:14px!important}"]}),g})();var He=E(4802),Se=E(2495);let $e=(()=>{var f;class g{constructor(){this._listeners=[]}notify(o,c){for(let P of this._listeners)P(o,c)}listen(o){return this._listeners.push(o),()=>{this._listeners=this._listeners.filter(c=>o!==c)}}ngOnDestroy(){this._listeners=[]}}return(f=g).\u0275fac=function(o){return new(o||f)},f.\u0275prov=t.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),g})();const Ye=["input"],Xe=["*"];let et=0;class s{constructor(g,O){this.source=g,this.value=O}}const T={provide:_.JU,useExisting:(0,t.Gpc)(()=>w),multi:!0},L=new t.OlP("MatRadioGroup"),B=new t.OlP("mat-radio-default-options",{providedIn:"root",factory:function e(){return{color:"accent"}}});let i=(()=>{var f;class g{get name(){return this._name}set name(o){this._name=o,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(o){this._labelPosition="before"===o?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(o){this._selected=o,this.value=o?o.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(o){this._disabled=(0,Se.Ig)(o),this._markRadiosForCheck()}get required(){return this._required}set required(o){this._required=(0,Se.Ig)(o),this._markRadiosForCheck()}constructor(o){this._changeDetector=o,this._value=null,this._name="mat-radio-group-"+et++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new t.vpe}ngAfterContentInit(){this._isInitialized=!0,this._buttonChanges=this._radios.changes.subscribe(()=>{this.selected&&!this._radios.find(o=>o===this.selected)&&(this._selected=null)})}ngOnDestroy(){this._buttonChanges?.unsubscribe()}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(o=>{o.name=this.name,o._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(c=>{c.checked=this.value===c.value,c.checked&&(this._selected=c)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new s(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(o=>o._markForCheck())}writeValue(o){this.value=o,this._changeDetector.markForCheck()}registerOnChange(o){this._controlValueAccessorChangeFn=o}registerOnTouched(o){this.onTouched=o}setDisabledState(o){this.disabled=o,this._changeDetector.markForCheck()}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(t.sBO))},f.\u0275dir=t.lG2({type:f,inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required"},outputs:{change:"change"}}),g})();class a{constructor(g){this._elementRef=g}}const r=(0,ce.Kr)((0,ce.sb)(a));let h=(()=>{var f;class g extends r{get checked(){return this._checked}set checked(o){const c=(0,Se.Ig)(o);this._checked!==c&&(this._checked=c,c&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!c&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),c&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===o),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(o){this._labelPosition=o}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(o){this._setDisabled((0,Se.Ig)(o))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(o){this._required=(0,Se.Ig)(o)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(o){this._color=o}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(o,c,P,M,K,te,re,ie){super(c),this._changeDetector=P,this._focusMonitor=M,this._radioDispatcher=K,this._providerOverride=re,this._uniqueId="mat-radio-"+ ++et,this.id=this._uniqueId,this.change=new t.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=o,this._noopAnimations="NoopAnimations"===te,ie&&(this.tabIndex=(0,Se.su)(ie,0))}focus(o,c){c?this._focusMonitor.focusVia(this._inputElement,c,o):this._inputElement.nativeElement.focus(o)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name),this._removeUniqueSelectionListener=this._radioDispatcher.listen((o,c)=>{o!==this.id&&c===this.name&&(this.checked=!1)})}ngDoCheck(){this._updateTabIndex()}ngAfterViewInit(){this._updateTabIndex(),this._focusMonitor.monitor(this._elementRef,!0).subscribe(o=>{!o&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new s(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(o){o.stopPropagation()}_onInputInteraction(o){if(o.stopPropagation(),!this.checked&&!this.disabled){const c=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),c&&this.radioGroup._emitChangeEvent())}}_onTouchTargetClick(o){this._onInputInteraction(o),this.disabled||this._inputElement.nativeElement.focus()}_setDisabled(o){this._disabled!==o&&(this._disabled=o,this._changeDetector.markForCheck())}_updateTabIndex(){const o=this.radioGroup;let c;if(c=o&&o.selected&&!this.disabled?o.selected===this?this.tabIndex:-1:this.tabIndex,c!==this._previousTabIndex){const P=this._inputElement?.nativeElement;P&&(P.setAttribute("tabindex",c+""),this._previousTabIndex=c)}}}return(f=g).\u0275fac=function(o){t.$Z()},f.\u0275dir=t.lG2({type:f,viewQuery:function(o,c){if(1&o&&t.Gf(Ye,5),2&o){let P;t.iGM(P=t.CRH())&&(c._inputElement=P.first)}},inputs:{id:"id",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"],checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"},features:[t.qOj]}),g})(),w=(()=>{var f;class g extends i{}return(f=g).\u0275fac=function(){let O;return function(c){return(O||(O=t.n5z(f)))(c||f)}}(),f.\u0275dir=t.lG2({type:f,selectors:[["mat-radio-group"]],contentQueries:function(o,c,P){if(1&o&&t.Suo(P,C,5),2&o){let M;t.iGM(M=t.CRH())&&(c._radios=M)}},hostAttrs:["role","radiogroup",1,"mat-mdc-radio-group"],exportAs:["matRadioGroup"],features:[t._Bn([T,{provide:L,useExisting:f}]),t.qOj]}),g})(),C=(()=>{var f;class g extends h{constructor(o,c,P,M,K,te,re,ie){super(o,c,P,M,K,te,re,ie)}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(L,8),t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(He.tE),t.Y36($e),t.Y36(t.QbO,8),t.Y36(B,8),t.$8M("tabindex"))},f.\u0275cmp=t.Xpm({type:f,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-mdc-radio-button"],hostVars:15,hostBindings:function(o,c){1&o&&t.NdJ("focus",function(){return c._inputElement.nativeElement.focus()}),2&o&&(t.uIk("id",c.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),t.ekj("mat-primary","primary"===c.color)("mat-accent","accent"===c.color)("mat-warn","warn"===c.color)("mat-mdc-radio-checked",c.checked)("_mat-animation-noopable",c._noopAnimations))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[t.qOj],ngContentSelectors:Xe,decls:13,vars:17,consts:[[1,"mdc-form-field"],["formField",""],[1,"mdc-radio"],[1,"mat-mdc-radio-touch-target",3,"click"],["type","radio",1,"mdc-radio__native-control",3,"id","checked","disabled","required","change"],["input",""],[1,"mdc-radio__background"],[1,"mdc-radio__outer-circle"],[1,"mdc-radio__inner-circle"],["mat-ripple","",1,"mat-radio-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mdc-label",3,"for"]],template:function(o,c){if(1&o&&(t.F$t(),t.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3),t.NdJ("click",function(M){return c._onTouchTargetClick(M)}),t.qZA(),t.TgZ(4,"input",4,5),t.NdJ("change",function(M){return c._onInputInteraction(M)}),t.qZA(),t.TgZ(6,"div",6),t._UZ(7,"div",7)(8,"div",8),t.qZA(),t.TgZ(9,"div",9),t._UZ(10,"div",10),t.qZA()(),t.TgZ(11,"label",11),t.Hsn(12),t.qZA()()),2&o){const P=t.MAs(1);t.ekj("mdc-form-field--align-end","before"==c.labelPosition),t.xp6(2),t.ekj("mdc-radio--disabled",c.disabled),t.xp6(2),t.Q6J("id",c.inputId)("checked",c.checked)("disabled",c.disabled)("required",c.required),t.uIk("name",c.name)("value",c.value)("aria-label",c.ariaLabel)("aria-labelledby",c.ariaLabelledby)("aria-describedby",c.ariaDescribedby),t.xp6(5),t.Q6J("matRippleTrigger",P)("matRippleDisabled",c._isRippleDisabled())("matRippleCentered",!0),t.xp6(2),t.Q6J("for",c.inputId)}},dependencies:[ce.wG],styles:['.mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio[hidden]{display:none}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mat-mdc-radio-button{--mdc-radio-disabled-selected-icon-opacity:0.38;--mdc-radio-disabled-unselected-icon-opacity:0.38;--mdc-radio-state-layer-size:40px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size) - 20px) / 2)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-unselected-icon-opacity)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);right:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);left:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color)}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple .mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, black)}.mat-mdc-radio-button.cdk-focused .mat-mdc-focus-indicator::before{content:""}.mat-mdc-radio-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}[dir=rtl] .mat-mdc-radio-touch-target{left:0;right:50%;transform:translate(50%, -50%)}'],encapsulation:2,changeDetection:0}),g})(),x=(()=>{var f;class g{}return(f=g).\u0275fac=function(o){return new(o||f)},f.\u0275mod=t.oAB({type:f}),f.\u0275inj=t.cJS({imports:[ce.BQ,A.ez,ce.si,ce.BQ]}),g})();function Z(f,g){if(1&f){const O=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2,"Selected Tax"),t.qZA(),t.TgZ(3,"td")(4,"ng-select",31),t.NdJ("ngModelChange",function(c){t.CHM(O);const P=t.oxw();return t.KtG(P.taxOptionSelected=c)})("change",function(){t.CHM(O);const c=t.oxw();return t.KtG(c.onSelectTaxType())}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Applied Tax ex: 100 + 10% = 110"),t.qZA()()()}if(2&f){const O=t.oxw();t.xp6(4),t.Q6J("items",O.taxOptions)("ngModel",O.taxOptionSelected)("clearable",!1)}}function p(f,g){if(1&f){const O=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2,"Outlet Price"),t.qZA(),t.TgZ(3,"td")(4,"ng-select",32),t.NdJ("ngModelChange",function(c){t.CHM(O);const P=t.oxw();return t.KtG(P.outletID=c)}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Price will be set according to the outlet price assigned when selected the outlet"),t.qZA()()()}if(2&f){const O=t.oxw();t.xp6(4),t.Q6J("items",O.outlets)("ngModel",O.outletID)("clearable",!0)}}const V=function(f){return{active:f}};let j=(()=>{var f;class g{constructor(o,c,P){this.dialogRef=o,this.data=c,this.outlet=P,this.event=new t.vpe,this.modalConfig=new S.O,this.taxOptions=[],this.paperWidth=0,this.marginTop=0,this.marginLeft=0,this.stickerWidth=0,this.stickerHeight=0,this.barcodeHeight=0,this.spacingColumn=0,this.spacingRow=0,this.barcode=!0,this.code=!0,this.price=!0,this.name=!0,this.move=!0,this.relaseDate=!0,this.priceDiscount=!0,this.removeDefault=!0,this.desc=!0,this.priceTax=!0,this.fontSize=0,this.namePrefix="",this.maxChar=0,this.publiclineHeight=0,this.orientationOptions=[],this.paperFormat=JSON.parse(JSON.stringify(c.paperFormat)),this.orientationOptions=this.paperFormat.OrientationChoice,this.outlets=c.outlets,this.taxs=c.taxs,this.authTax=c.authTax,this.initTaxOptions(),this.activeTab="paper",this.outletRole=c.outletRole}ngOnInit(){this.initModalConfig(),this.initFormValue(),this.authTax&&this.initTaxOptionSelected()}initTaxOptions(){this.taxOptions=[],this.taxs.forEach((o,c)=>{this.taxOptions=[...this.taxOptions,{id:c+1,name:o.getName,ID:o.getID}]})}initTaxOptionSelected(){this.taxSelected&&(this.taxOptionSelected=this.taxOptions.find(o=>o.ID===this.taxSelected.ID))}onSelectTaxType(){this.taxSelected=this.taxs.find(o=>o.getID===this.taxOptionSelected.ID)}initModalConfig(){this.modalConfig.title="Sticker Configuration",this.modalConfig.hideMoreButton=!0}onOk(){this.setPaperFormat(),this.dialogRef.close(this.paperFormat)}onCancel(){this.dialogRef.close()}initFormValue(){this.paperFormat&&(this.barcodeHeight=this.paperFormat.BarcodeHeight,this.PriceFontSize=this.paperFormat.PriceFontSize,this.paperWidth=this.paperFormat.PaperWidth,this.marginTop=this.paperFormat.MarginTop,this.marginLeft=this.paperFormat.MarginLeft,this.stickerWidth=this.paperFormat.StickerWidth,this.stickerHeight=this.paperFormat.StickerHeight,this.barcodeHeight=this.paperFormat.BarcodeHeight,this.spacingColumn=this.paperFormat.ColumnSpacing,this.spacingRow=this.paperFormat.RowSpacing,this.barcode=this.paperFormat.BarcodeVisible,this.code=this.paperFormat.CodeVisible,this.price=this.paperFormat.PriceVisible,this.name=this.paperFormat.NameVisible,this.move=this.paperFormat.MoveProductNameOnTop,this.desc=this.paperFormat.DescriptionAsCode,this.fontSize=this.paperFormat.ProductNameFontSize,this.namePrefix=this.paperFormat.ProductNamePrefix,this.maxChar=this.paperFormat.ProductNameMaxLength,this.lineHeight=this.paperFormat.LineHeight,this.priceTax=this.paperFormat.PriceWithTax,this.taxSelected=this.paperFormat.TaxType,this.storeName=this.paperFormat.StoreName,this.currencySymbol=this.paperFormat.CurrencySymbol,this.promotionPriceLabel=this.paperFormat.PromotionPriceLabel,this.basicPriceLabel=this.paperFormat.BasicPriceLabel,this.relaseDate=this.paperFormat.ShowReleasedDate,this.priceDiscount=this.paperFormat.ShowPriceDiscount,this.orientationType=this.paperFormat.Orientation,this.outletID=this.outlet.outletID)}setPaperFormat(){this.paperFormat&&(this.checkPriceWithTax(),this.paperFormat.PriceFontSize=this.PriceFontSize,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.PaperWidth=this.paperWidth,this.paperFormat.MarginTop=this.marginTop,this.paperFormat.MarginLeft=this.marginLeft,this.paperFormat.StickerWidth=this.stickerWidth,this.paperFormat.StickerHeight=this.stickerHeight,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.ColumnSpacing=this.spacingColumn,this.paperFormat.RowSpacing=this.spacingRow,this.paperFormat.BarcodeVisible=this.barcode,this.paperFormat.MoveProductNameOnTop=this.move,this.paperFormat.CodeVisible=this.code,this.paperFormat.PriceVisible=this.price,this.paperFormat.NameVisible=this.name,this.paperFormat.DescriptionAsCode=this.desc,this.paperFormat.ProductNameFontSize=this.fontSize,this.paperFormat.ProductNamePrefix=this.namePrefix,this.paperFormat.ProductNameMaxLength=this.maxChar,this.paperFormat.LineHeight=this.lineHeight,this.paperFormat.PriceWithTax=this.priceTax,this.paperFormat.TaxType=this.taxSelected,this.paperFormat.StoreName=this.storeName,this.paperFormat.CurrencySymbol=this.currencySymbol,this.paperFormat.PromotionPriceLabel=this.promotionPriceLabel,this.paperFormat.BasicPriceLabel=this.basicPriceLabel,this.paperFormat.ShowReleasedDate=this.relaseDate,this.paperFormat.ShowPriceDiscount=this.priceDiscount,this.paperFormat.Orientation=this.orientationType,this.outlet.outletID=this.outletID,this.outlet.outletName=this.outlets.find(o=>o.ID==this.outletID)?.Name)}checkPriceWithTax(){this.priceTax||(this.taxSelected=this.taxs.find(o=>"No Tax"==o.getLabel))}dataTarget(o){this.activeTab=o}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(m.so),t.Y36(m.WI),t.Y36(ae))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-form-settings"]],outputs:{event:"event"},decls:337,vars:79,consts:[[3,"config","onOk","onCancel"],["container",""],["id","myTab","role","tablist",1,"nav","nav-tabs"],["tabs",""],[1,"nav-item"],["data-bs-toggle","tab",1,"nav-link",3,"ngClass","click"],["id","spacing-tab","data-bs-toggle","tab","data-bs-target","'#spacing'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","dua-tab","data-bs-toggle","tab","data-bs-target","'#sticker-content'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","price-tab","data-bs-toggle","tab","data-bs-target","'#price'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","advanced-tab","data-bs-toggle","tab","data-bs-target","'#advanced'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","promotionLabel-tab","data-bs-toggle","tab","data-bs-target","'#promotionLabel'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],[1,"tab-content","border","bg-white"],["id","paper",1,"tab-pane","mt-0",3,"ngClass"],[1,"table","table-bordered","w-100"],[1,"input-group"],["type","number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],[1,"input-group-append"],[1,"input-group-text"],["id","spacing",1,"tab-pane","mt-0",3,"ngClass"],["id","sticker-content",1,"tab-pane","mt-0",3,"ngClass"],[2,"width","150px"],["aria-label","Select an option","color","primary"],["value","false",3,"checked","change"],["value","true",1,"ms-4",3,"checked","change"],["id","price",1,"tab-pane","mt-0",3,"ngClass"],[4,"ngIf"],["type","text","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["type","text","autoNum","","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["id","advanced",1,"tab-pane","mt-0",3,"ngClass"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Select orientation",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange"],["id","promotionLabel",1,"tab-pane","mt-0",3,"ngClass"],["appendTo","body","bindLabel","name","placeholder","Select Column",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange","change"],["appendTo","body","bindLabel","Name","bindValue","ID","name","Choose Outlet","placeholder","Choose Outlet",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange"]],template:function(o,c){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return c.onOk()})("onCancel",function(){return c.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"ul",2,3)(5,"li",4)(6,"a",5),t.NdJ("click",function(){return c.dataTarget("paper")}),t._uU(7,"Paper"),t.qZA()(),t.TgZ(8,"li",4)(9,"a",6),t.NdJ("click",function(){return c.dataTarget("spacing")}),t._uU(10,"Spacing"),t.qZA()(),t.TgZ(11,"li",4)(12,"a",7),t.NdJ("click",function(){return c.dataTarget("sticker-content")}),t._uU(13,"Sticker Content"),t.qZA()(),t.TgZ(14,"li",4)(15,"a",8),t.NdJ("click",function(){return c.dataTarget("price")}),t._uU(16,"Price"),t.qZA()(),t.TgZ(17,"li",4)(18,"a",9),t.NdJ("click",function(){return c.dataTarget("advanced")}),t._uU(19,"Advanced"),t.qZA()(),t.TgZ(20,"li",4)(21,"a",10),t.NdJ("click",function(){return c.dataTarget("promotionLabel")}),t._uU(22,"Label"),t.qZA()()(),t.TgZ(23,"div",11)(24,"div",12)(25,"table",13)(26,"tr")(27,"td"),t._uU(28,"Paper Width"),t.qZA(),t.TgZ(29,"td")(30,"div",14)(31,"input",15),t.NdJ("ngModelChange",function(M){return c.paperWidth=M}),t.qZA(),t.TgZ(32,"div",16)(33,"span",17),t._uU(34,"px"),t.qZA()()()(),t.TgZ(35,"td")(36,"span"),t._uU(37,"The width of the paper"),t.qZA()()(),t.TgZ(38,"tr")(39,"td"),t._uU(40,"Sticker Width"),t.qZA(),t.TgZ(41,"td")(42,"div",14)(43,"input",15),t.NdJ("ngModelChange",function(M){return c.stickerWidth=M}),t.qZA(),t.TgZ(44,"div",16)(45,"span",17),t._uU(46,"px"),t.qZA()()()(),t.TgZ(47,"td")(48,"span"),t._uU(49,"The width of the sticker"),t.qZA()()(),t.TgZ(50,"tr")(51,"td"),t._uU(52,"Sticker Height"),t.qZA(),t.TgZ(53,"td")(54,"div",14)(55,"input",15),t.NdJ("ngModelChange",function(M){return c.stickerHeight=M}),t.qZA(),t.TgZ(56,"div",16)(57,"span",17),t._uU(58,"px"),t.qZA()()()(),t.TgZ(59,"td")(60,"span"),t._uU(61,"The height of the sticker"),t.qZA()()()()(),t.TgZ(62,"div",18)(63,"table",13)(64,"tr")(65,"td"),t._uU(66,"Left Indent"),t.qZA(),t.TgZ(67,"td")(68,"div",14)(69,"input",15),t.NdJ("ngModelChange",function(M){return c.marginLeft=M}),t.qZA(),t.TgZ(70,"div",16)(71,"span",17),t._uU(72,"px"),t.qZA()()()(),t.TgZ(73,"td")(74,"span"),t._uU(75,"The number of pixels appended before the first COLUMN"),t.qZA()()(),t.TgZ(76,"tr")(77,"td"),t._uU(78,"Top Indent"),t.qZA(),t.TgZ(79,"td")(80,"div",14)(81,"input",15),t.NdJ("ngModelChange",function(M){return c.marginTop=M}),t.qZA(),t.TgZ(82,"div",16)(83,"span",17),t._uU(84,"px"),t.qZA()()()(),t.TgZ(85,"td")(86,"span"),t._uU(87,"The number of pixels appended before the first ROW"),t.qZA()()(),t.TgZ(88,"tr")(89,"td"),t._uU(90,"Row Spacing"),t.qZA(),t.TgZ(91,"td")(92,"div",14)(93,"input",15),t.NdJ("ngModelChange",function(M){return c.spacingRow=M}),t.qZA(),t.TgZ(94,"div",16)(95,"span",17),t._uU(96,"px"),t.qZA()()()(),t.TgZ(97,"td")(98,"span"),t._uU(99,"The number of pixels between each ROW"),t.qZA()()(),t.TgZ(100,"tr")(101,"td"),t._uU(102,"Column Spacing"),t.qZA(),t.TgZ(103,"td")(104,"div",14)(105,"input",15),t.NdJ("ngModelChange",function(M){return c.spacingColumn=M}),t.qZA(),t.TgZ(106,"div",16)(107,"span",17),t._uU(108,"px"),t.qZA()()()(),t.TgZ(109,"td")(110,"span"),t._uU(111,"The number of pixels between each COLUMN"),t.qZA()()()()(),t.TgZ(112,"div",19)(113,"table",13)(114,"tr")(115,"td"),t._uU(116,"Barcode Height"),t.qZA(),t.TgZ(117,"td",20)(118,"div",14)(119,"input",15),t.NdJ("ngModelChange",function(M){return c.barcodeHeight=M}),t.qZA(),t.TgZ(120,"div",16)(121,"span",17),t._uU(122,"px"),t.qZA()()()(),t.TgZ(123,"td")(124,"span"),t._uU(125,"The height of the generated barcode in pixels"),t.qZA()()(),t.TgZ(126,"tr")(127,"td"),t._uU(128,"Font Size"),t.qZA(),t.TgZ(129,"td")(130,"div",14)(131,"input",15),t.NdJ("ngModelChange",function(M){return c.fontSize=M}),t.qZA(),t.TgZ(132,"div",16)(133,"span",17),t._uU(134,"px"),t.qZA()()()(),t.TgZ(135,"td")(136,"span"),t._uU(137,"Change all font size (except price)"),t.qZA()()(),t.TgZ(138,"tr")(139,"td"),t._uU(140,"Barcode"),t.qZA(),t.TgZ(141,"td")(142,"mat-radio-group",21)(143,"mat-radio-button",22),t.NdJ("change",function(){return c.barcode=!1}),t._uU(144,"No "),t.qZA(),t.TgZ(145,"mat-radio-button",23),t.NdJ("change",function(){return c.barcode=!0}),t._uU(146,"Yes"),t.qZA()()(),t.TgZ(147,"td")(148,"span"),t._uU(149,"Whether barcode is visible"),t.qZA()()(),t.TgZ(150,"tr")(151,"td"),t._uU(152,"Code"),t.qZA(),t.TgZ(153,"td")(154,"mat-radio-group",21)(155,"mat-radio-button",22),t.NdJ("change",function(){return c.code=!1}),t._uU(156,"No "),t.qZA(),t.TgZ(157,"mat-radio-button",23),t.NdJ("change",function(){return c.code=!0}),t._uU(158,"Yes"),t.qZA()()(),t.TgZ(159,"td")(160,"span"),t._uU(161,"Whether variant code is visible"),t.qZA()()(),t.TgZ(162,"tr")(163,"td"),t._uU(164,"Price"),t.qZA(),t.TgZ(165,"td")(166,"mat-radio-group",21)(167,"mat-radio-button",22),t.NdJ("change",function(){return c.price=!1}),t._uU(168,"No "),t.qZA(),t.TgZ(169,"mat-radio-button",23),t.NdJ("change",function(){return c.price=!0}),t._uU(170,"Yes"),t.qZA()()(),t.TgZ(171,"td")(172,"span"),t._uU(173,"Whether variant price is visible"),t.qZA()()(),t.TgZ(174,"tr")(175,"td"),t._uU(176,"Name"),t.qZA(),t.TgZ(177,"td")(178,"mat-radio-group",21)(179,"mat-radio-button",22),t.NdJ("change",function(){return c.name=!1}),t._uU(180,"No "),t.qZA(),t.TgZ(181,"mat-radio-button",23),t.NdJ("change",function(){return c.name=!0}),t._uU(182,"Yes"),t.qZA()()(),t.TgZ(183,"td")(184,"span"),t._uU(185,"Whether variant name is visible"),t.qZA()()(),t.TgZ(186,"tr")(187,"td"),t._uU(188,"Move Product Name"),t.qZA(),t.TgZ(189,"td")(190,"mat-radio-group",21)(191,"mat-radio-button",22),t.NdJ("change",function(){return c.move=!1}),t._uU(192,"No "),t.qZA(),t.TgZ(193,"mat-radio-button",23),t.NdJ("change",function(){return c.move=!0}),t._uU(194,"Yes"),t.qZA()()(),t.TgZ(195,"td")(196,"span"),t._uU(197,"Whether move variant name below variant code or below variant price"),t.qZA()()(),t.TgZ(198,"tr")(199,"td"),t._uU(200,"Release Date"),t.qZA(),t.TgZ(201,"td")(202,"mat-radio-group",21)(203,"mat-radio-button",22),t.NdJ("change",function(){return c.relaseDate=!1}),t._uU(204,"No "),t.qZA(),t.TgZ(205,"mat-radio-button",23),t.NdJ("change",function(){return c.relaseDate=!0}),t._uU(206,"Yes"),t.qZA()()(),t.TgZ(207,"td")(208,"span"),t._uU(209,"Whether release date is visible"),t.qZA()()(),t.TgZ(210,"tr")(211,"td"),t._uU(212,"Discount Visible"),t.qZA(),t.TgZ(213,"td")(214,"mat-radio-group",21)(215,"mat-radio-button",22),t.NdJ("change",function(){return c.priceDiscount=!1}),t._uU(216,"No "),t.qZA(),t.TgZ(217,"mat-radio-button",23),t.NdJ("change",function(){return c.priceDiscount=!0}),t._uU(218,"Yes"),t.qZA()()(),t.TgZ(219,"td")(220,"span"),t._uU(221,"Whether variant's sell price discount is visible"),t.qZA()()()()(),t.TgZ(222,"div",24)(223,"table",13)(224,"tr")(225,"td"),t._uU(226,"Price with Tax"),t.qZA(),t.TgZ(227,"td")(228,"mat-radio-group",21)(229,"mat-radio-button",22),t.NdJ("change",function(){return c.priceTax=!1}),t._uU(230," No"),t.qZA(),t.TgZ(231,"mat-radio-button",23),t.NdJ("change",function(){return c.priceTax=!0}),t._uU(232,"Yes"),t.qZA()()(),t.TgZ(233,"td")(234,"span"),t._uU(235),t.qZA()()(),t.YNc(236,Z,8,3,"tr",25),t.TgZ(237,"tr")(238,"td"),t._uU(239,"Currency"),t.qZA(),t.TgZ(240,"td",20)(241,"div",14)(242,"input",26),t.NdJ("ngModelChange",function(M){return c.currencySymbol=M}),t.qZA()()(),t.TgZ(243,"td")(244,"span"),t._uU(245,"The default currency"),t.qZA()()(),t.TgZ(246,"tr")(247,"td"),t._uU(248,"Font Size"),t.qZA(),t.TgZ(249,"td")(250,"div",14)(251,"input",27),t.NdJ("ngModelChange",function(M){return c.PriceFontSize=M}),t.qZA()()(),t.TgZ(252,"td")(253,"span"),t._uU(254,"Change font size for price"),t.qZA()()(),t.YNc(255,p,8,3,"tr",25),t.qZA()(),t.TgZ(256,"div",28)(257,"table",13)(258,"tr")(259,"td"),t._uU(260,"Max Character"),t.qZA(),t.TgZ(261,"td",20)(262,"div",14)(263,"input",15),t.NdJ("ngModelChange",function(M){return c.maxChar=M}),t.qZA()()(),t.TgZ(264,"td")(265,"span"),t._uU(266,"The max character of the product name"),t.qZA()()(),t.TgZ(267,"tr")(268,"td"),t._uU(269,"Name Prefix"),t.qZA(),t.TgZ(270,"td")(271,"div",14)(272,"input",26),t.NdJ("ngModelChange",function(M){return c.namePrefix=M}),t.qZA()()(),t.TgZ(273,"td")(274,"span"),t._uU(275,"A word, letter, or number placed before product name"),t.qZA()()(),t.TgZ(276,"tr")(277,"td"),t._uU(278,"Store Name"),t.qZA(),t.TgZ(279,"td")(280,"div",14)(281,"input",26),t.NdJ("ngModelChange",function(M){return c.storeName=M}),t.qZA()()(),t.TgZ(282,"td")(283,"span"),t._uU(284,"The name of the store"),t.qZA()()(),t.TgZ(285,"tr")(286,"td"),t._uU(287,"Orientation"),t.qZA(),t.TgZ(288,"td")(289,"ng-select",29),t.NdJ("ngModelChange",function(M){return c.orientationType=M}),t.qZA()(),t.TgZ(290,"td")(291,"span"),t._uU(292,"Horizontal or vertical position store name label"),t.qZA()()(),t.TgZ(293,"tr")(294,"td"),t._uU(295,"Use description as code"),t.qZA(),t.TgZ(296,"td")(297,"mat-radio-group",21)(298,"mat-radio-button",22),t.NdJ("change",function(){return c.desc=!1}),t._uU(299,"No "),t.qZA(),t.TgZ(300,"mat-radio-button",23),t.NdJ("change",function(){return c.desc=!0}),t._uU(301,"Yes"),t.qZA()()(),t.TgZ(302,"td")(303,"span"),t._uU(304,"Copy product description into product code"),t.qZA()()(),t.TgZ(305,"tr")(306,"td"),t._uU(307,'Remove "Default"'),t.qZA(),t.TgZ(308,"td")(309,"mat-radio-group",21)(310,"mat-radio-button",22),t.NdJ("change",function(){return c.removeDefault=!1}),t._uU(311,"No "),t.qZA(),t.TgZ(312,"mat-radio-button",23),t.NdJ("change",function(){return c.removeDefault=!0}),t._uU(313,"Yes"),t.qZA()()(),t.TgZ(314,"td")(315,"span"),t._uU(316,'Remove "Default" label from product name'),t.qZA()()()()(),t.TgZ(317,"div",30)(318,"table",13)(319,"tr")(320,"td"),t._uU(321,"Normal Price"),t.qZA(),t.TgZ(322,"td")(323,"div",14)(324,"input",26),t.NdJ("ngModelChange",function(M){return c.basicPriceLabel=M}),t.qZA()()(),t.TgZ(325,"td")(326,"span"),t._uU(327,"Custom label normal price"),t.qZA()()(),t.TgZ(328,"tr")(329,"td"),t._uU(330,"Promotion Price"),t.qZA(),t.TgZ(331,"td")(332,"div",14)(333,"input",26),t.NdJ("ngModelChange",function(M){return c.promotionPriceLabel=M}),t.qZA()()(),t.TgZ(334,"td")(335,"span"),t._uU(336,"Custom label promotion price"),t.qZA()()()()()()()()()),2&o&&(t.Q6J("config",c.modalConfig),t.xp6(6),t.Q6J("ngClass",t.VKq(55,V,"paper"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(57,V,"spacing"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(59,V,"sticker-content"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(61,V,"price"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(63,V,"advanced"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(65,V,"promotionLabel"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(67,V,"paper"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.paperWidth),t.xp6(12),t.Q6J("ngModel",c.stickerWidth),t.xp6(12),t.Q6J("ngModel",c.stickerHeight),t.xp6(7),t.Q6J("ngClass",t.VKq(69,V,"spacing"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.marginLeft),t.xp6(12),t.Q6J("ngModel",c.marginTop),t.xp6(12),t.Q6J("ngModel",c.spacingRow),t.xp6(12),t.Q6J("ngModel",c.spacingColumn),t.xp6(7),t.Q6J("ngClass",t.VKq(71,V,"sticker-content"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.barcodeHeight),t.xp6(12),t.Q6J("ngModel",c.fontSize),t.xp6(12),t.Q6J("checked",!c.barcode),t.xp6(2),t.Q6J("checked",c.barcode),t.xp6(10),t.Q6J("checked",!c.code),t.xp6(2),t.Q6J("checked",c.code),t.xp6(10),t.Q6J("checked",!c.price),t.xp6(2),t.Q6J("checked",c.price),t.xp6(10),t.Q6J("checked",!c.name),t.xp6(2),t.Q6J("checked",c.name),t.xp6(10),t.Q6J("checked",!c.move),t.xp6(2),t.Q6J("checked",c.move),t.xp6(10),t.Q6J("checked",!c.relaseDate),t.xp6(2),t.Q6J("checked",c.relaseDate),t.xp6(10),t.Q6J("checked",!c.priceDiscount),t.xp6(2),t.Q6J("checked",c.priceDiscount),t.xp6(5),t.Q6J("ngClass",t.VKq(73,V,"price"===c.activeTab)),t.xp6(7),t.Q6J("checked",!c.priceTax),t.xp6(2),t.Q6J("checked",c.priceTax),t.xp6(4),t.hij("Tax is added to the product base price ",c.authTax,""),t.xp6(1),t.Q6J("ngIf",1==c.priceTax&&1==c.authTax),t.xp6(6),t.Q6J("ngModel",c.currencySymbol),t.xp6(9),t.Q6J("ngModel",c.PriceFontSize),t.xp6(4),t.Q6J("ngIf",c.outletRole),t.xp6(1),t.Q6J("ngClass",t.VKq(75,V,"advanced"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.maxChar),t.xp6(9),t.Q6J("ngModel",c.namePrefix),t.xp6(9),t.Q6J("ngModel",c.storeName),t.xp6(8),t.Q6J("items",c.orientationOptions)("ngModel",c.orientationType)("clearable",!1),t.xp6(9),t.Q6J("checked",!c.desc),t.xp6(2),t.Q6J("checked",c.desc),t.xp6(10),t.Q6J("checked",!c.removeDefault),t.xp6(2),t.Q6J("checked",c.removeDefault),t.xp6(5),t.Q6J("ngClass",t.VKq(77,V,"promotionLabel"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.basicPriceLabel),t.xp6(9),t.Q6J("ngModel",c.promotionPriceLabel))},dependencies:[A.mk,A.O5,_.Fj,_.wV,_.JJ,_.On,U.w9,G.M,Re,w,C],styles:[".input-group-append[_ngcontent-%COMP%]{height:30px}.form-control[_ngcontent-%COMP%]{height:30px;font-size:12px}.input-group-text[_ngcontent-%COMP%]{font-size:12px}.value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:90px}.advance-value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:135px}h3[_ngcontent-%COMP%]{margin-bottom:0;font-weight:550}label[_ngcontent-%COMP%]{font-size:12px}bs-dropdown-container[_ngcontent-%COMP%]{z-index:1060}.nav-tabs-custom-border[_ngcontent-%COMP%] .nav-tabs[_ngcontent-%COMP%]{border-bottom:0}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%]{margin-bottom:10px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(1){font-weight:700;width:172px;padding:12px 1rem}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){width:120px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:nth-child(2), .tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){border-right:1px solid #dee2e6;border-left:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) input[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) .input-group-text[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6;margin-top:-1px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(3){font-style:italic;color:#28a745}.nav-link[_ngcontent-%COMP%]{cursor:pointer} .mat-mdc-radio-checked .mdc-radio__outer-circle{border-color:#0075ff} .mat-radio-checked .mdc-radio__inner-circle{background-color:#0075ff}"]}),g})();var q=E(6387);const H=["bcElement"];let $=(()=>{var f;class g{get options(){return{format:this.format,lineColor:this.lineColor,width:this.width,height:this.height,displayValue:this.displayValue,fontOptions:this.fontOptions,font:this.font,textAlign:this.textAlign,textPosition:this.textPosition,textMargin:this.textMargin,fontSize:this.fontSize,background:this.background,margin:this.margin,marginTop:this.marginTop,marginBottom:this.marginBottom,marginLeft:this.marginLeft,marginRight:this.marginRight,valid:this.valid}}constructor(o){this.renderer=o,this.elementType="svg",this.cssClass="barcode",this.format="CODE128",this.lineColor="#000000",this.width=2,this.height=100,this.displayValue=!1,this.fontOptions="",this.font="monospace",this.textAlign="center",this.textPosition="bottom",this.textMargin=2,this.fontSize=20,this.background="#ffffff",this.margin=10,this.marginTop=10,this.marginBottom=10,this.marginLeft=10,this.marginRight=10,this.value="",this.valid=()=>!0}ngAfterViewInit(){this.createBarcode()}ngOnChanges(){this.bcElement&&this.createBarcode()}createBarcode(){if(!this.value)return;let o;switch(this.elementType){case"img":o=this.renderer.createElement("img");break;case"canvas":o=this.renderer.createElement("canvas");break;default:o=this.renderer.createElement("svg","svg")}q(o,this.value,this.options);for(const c of this.bcElement.nativeElement.childNodes)this.renderer.removeChild(this.bcElement.nativeElement,c);this.renderer.appendChild(this.bcElement.nativeElement,o)}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(t.Qsj))},f.\u0275cmp=t.Xpm({type:f,selectors:[["ngx-barcode6"]],viewQuery:function(o,c){if(1&o&&t.Gf(H,5),2&o){let P;t.iGM(P=t.CRH())&&(c.bcElement=P.first)}},inputs:{elementType:["bc-element-type","elementType"],cssClass:["bc-class","cssClass"],format:["bc-format","format"],lineColor:["bc-line-color","lineColor"],width:["bc-width","width"],height:["bc-height","height"],displayValue:["bc-display-value","displayValue"],fontOptions:["bc-font-options","fontOptions"],font:["bc-font","font"],textAlign:["bc-text-align","textAlign"],textPosition:["bc-text-position","textPosition"],textMargin:["bc-text-margin","textMargin"],fontSize:["bc-font-size","fontSize"],background:["bc-background","background"],margin:["bc-margin","margin"],marginTop:["bc-margin-top","marginTop"],marginBottom:["bc-margin-bottom","marginBottom"],marginLeft:["bc-margin-left","marginLeft"],marginRight:["bc-margin-right","marginRight"],value:["bc-value","value"],valid:["bc-valid","valid"]},features:[t.TTD],decls:2,vars:2,consts:[["bcElement",""]],template:function(o,c){1&o&&t._UZ(0,"div",null,0),2&o&&t.Tol(c.cssClass)},encapsulation:2}),g})(),oe=(()=>{var f;class g{}return(f=g).\u0275fac=function(o){return new(o||f)},f.\u0275mod=t.oAB({type:f}),f.\u0275inj=t.cJS({}),g})(),de=(()=>{var f;class g{transform(o,c){let P=o,M=0;return c&&0!==c&&(M=o*(c/100),P=o+M),P}}return(f=g).\u0275fac=function(o){return new(o||f)},f.\u0275pipe=t.Yjl({name:"taxPipe",type:f,pure:!0}),g})();function he(f,g){if(1&f&&t._UZ(0,"ngx-barcode6",18),2&f){const O=t.oxw().$implicit,o=t.oxw();t.Q6J("bc-value",null==O?null:O.getCode)("bc-element-type","img")("bc-width",1)("bc-height",null==o.selectedPaperFormat?null:o.selectedPaperFormat.BarcodeHeight)}}function se(f,g){if(1&f&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&f){const O=t.oxw().$implicit,o=t.oxw();t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.Oqu(O.getBarcodeTitle)}}function we(f,g){if(1&f&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&f){const O=t.oxw().$implicit,o=t.oxw();t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=o.selectedPaperFormat&&o.selectedPaperFormat.ProductNamePrefix?(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNamePrefix)+" "+O.getName:O.getName,0,null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameMaxLength)," ")}}function Me(f,g){if(1&f&&(t.ynx(0),t.TgZ(1,"div",22)(2,"span",23),t._uU(3),t.qZA(),t.TgZ(4,"span",24)(5,"span",25)(6,"span",26),t._uU(7),t.ALo(8,"number"),t.qZA()()()(),t.TgZ(9,"div",27)(10,"span",23),t._uU(11),t.qZA(),t.TgZ(12,"span",28),t._uU(13),t.ALo(14,"number"),t.qZA()(),t.BQk()),2&f){const O=t.oxw(2).$implicit,o=t.oxw();t.xp6(3),t.Oqu(o.selectedPaperFormat.BasicPriceLabel?o.selectedPaperFormat.BasicPriceLabel:"N. Price"),t.xp6(4),t.AsE("",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(8,6,null==O?null:O.getUnitPrice),""),t.xp6(4),t.Oqu(o.selectedPaperFormat.PromotionPriceLabel?o.selectedPaperFormat.PromotionPriceLabel:"Spc. Price"),t.xp6(2),t.AsE("",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(14,8,(null==O||null==O.getSelectedPromotion?null:O.getSelectedPromotion.getUnitPrice)-(null==O||null==O.getSelectedPromotion?null:O.getSelectedPromotion.getUnitPrice)*(null==O||null==O.getSelectedPromotion?null:O.getSelectedPromotion.getDiscount)/100),"")}}function ze(f,g){if(1&f&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&f){const O=t.oxw(3).$implicit,o=t.oxw();t.xp6(1),t.AsE(" ",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==O?null:O.getCustomPrice,o.tax))," ")}}function tt(f,g){if(1&f&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&f){const O=t.oxw(4).$implicit,o=t.oxw();t.xp6(1),t.AsE(" ",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==O?null:O.getUnitPrice,o.tax))," ")}}function nt(f,g){if(1&f&&t.YNc(0,tt,4,7,"ng-container",20),2&f){t.oxw();const O=t.MAs(5),o=t.oxw(3);t.Q6J("ngIf",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.PriceWithTax)&&o.tax&&0!=o.tax)("ngIfElse",O)}}function Oe(f,g){if(1&f&&(t._uU(0),t.ALo(1,"number")),2&f){const O=t.oxw(3).$implicit,o=t.oxw();t.AsE(" ",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(1,2,null==O?null:O.getUnitPrice)," ")}}function Ee(f,g){if(1&f&&(t.TgZ(0,"strong"),t.YNc(1,ze,4,7,"ng-container",20),t.YNc(2,nt,1,2,"ng-template",null,29,t.W1O),t.YNc(4,Oe,2,4,"ng-template",null,30,t.W1O),t.qZA()),2&f){const O=t.MAs(3),o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",0!==(null==o?null:o.getCustomPrice)&&void 0!==(null==o?null:o.getCustomPrice))("ngIfElse",O)}}function ut(f,g){if(1&f&&(t.TgZ(0,"span",19),t.YNc(1,Me,15,10,"ng-container",20),t.YNc(2,Ee,6,2,"ng-template",null,21,t.W1O),t.qZA()),2&f){const O=t.MAs(3),o=t.oxw().$implicit,c=t.oxw();t.Udp("font-size",(null==c.selectedPaperFormat?null:c.selectedPaperFormat.PriceFontSize)+"px"),t.xp6(1),t.Q6J("ngIf",o.getSelectedPromotion)("ngIfElse",O)}}function Ne(f,g){if(1&f&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&f){const O=t.oxw().$implicit,o=t.oxw();t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=o.selectedPaperFormat&&o.selectedPaperFormat.ProductNamePrefix?(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNamePrefix)+" "+O.getName:O.getName,0,null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameMaxLength)," ")}}function ct(f,g){if(1&f&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.ALo(3,"date"),t.qZA(),t.BQk()),2&f){const O=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.xi3(3,3,O.getReleaseDate,"dd MMM yy")," ")}}function dt(f,g){if(1&f&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&f){const O=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",O.getPriceDiscount,"% Off ")}}function ht(f,g){if(1&f&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&f){const O=t.oxw(2);t.xp6(1),t.Udp("font-size",(null==O.selectedPaperFormat?null:O.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==O.selectedPaperFormat?null:O.selectedPaperFormat.StoreName," ")}}function De(f,g){if(1&f&&(t.ynx(0),t.TgZ(1,"div",31)(2,"div",32),t._uU(3),t.qZA()(),t.BQk()),2&f){const O=t.oxw(2);t.xp6(2),t.Udp("height",(null==O.selectedPaperFormat?null:O.selectedPaperFormat.StickerHeight)+"px")("font-size",(null==O.selectedPaperFormat?null:O.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==O.selectedPaperFormat?null:O.selectedPaperFormat.StoreName," ")}}function it(f,g){if(1&f&&(t.TgZ(0,"li")(1,"div",13),t.YNc(2,he,1,4,"ngx-barcode6",14),t.TgZ(3,"div",15),t.YNc(4,se,2,3,"span",16),t.YNc(5,we,3,7,"span",16),t.YNc(6,ut,4,4,"span",16),t.YNc(7,Ne,3,7,"span",16),t.YNc(8,ct,4,6,"ng-container",17),t.YNc(9,dt,3,3,"ng-container",17),t.YNc(10,ht,3,3,"ng-container",17),t.qZA(),t.YNc(11,De,4,5,"ng-container",17),t.qZA()()),2&f){const O=g.index,o=t.oxw();t.Udp("width",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.StickerWidth)+"px")("height",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.StickerHeight)+"px")("margin-right",(O+1)%o.totalStickerPerRow==0?0:(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ColumnSpacing)+"px")("margin-bottom",O>=o.productPreview.length-o.lastIndex?0:(null==o.selectedPaperFormat?null:o.selectedPaperFormat.RowSpacing)+"px"),t.xp6(2),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.BarcodeVisible),t.xp6(2),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CodeVisible),t.xp6(1),t.Q6J("ngIf",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.NameVisible)&&(null==o.selectedPaperFormat?null:o.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.PriceVisible),t.xp6(1),t.Q6J("ngIf",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.NameVisible)&&!(null!=o.selectedPaperFormat&&o.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.ShowReleasedDate),t.xp6(1),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.ShowPriceDiscount),t.xp6(1),t.Q6J("ngIf",0==(null==o.selectedPaperFormat?null:o.selectedPaperFormat.Orientation)),t.xp6(1),t.Q6J("ngIf",1==(null==o.selectedPaperFormat?null:o.selectedPaperFormat.Orientation))}}let Ie=(()=>{var f;class g{constructor(o,c,P,M,K,te,re){this.dialog=o,this.productStateService=c,this.productService=P,this.barcodeService=M,this.toastService=K,this.authService=te,this.route=re,this.paperFormatOptions=[],this.optionSelected={id:1,name:"Continuous - 3 Column"},this.paperFormats=[],this.totalStickerPerRow=0,this.lastIndex=0,this.destroy$=new y.x,this.productPreview=[],this.taxs=[];const ie=this.route.snapshot.queryParams?.ID;ie&&this.productService.getProductById(ie).pipe((0,X.b)(ve=>this.productStateService.setState([ve]))).subscribe(),(()=>{const ve=localStorage.getItem("Token");if(n.gT.IsNotEmpty(ve)){var qe=n.gT.parseJwt(ve);this.outletView=qe["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"].includes("Out")}})()}ngOnInit(){this.getPaperFormats(),this.checkAuthTax(),this.subscribeToObsproducts()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}checkAuthTax(){this.authService.getRoles().find(P=>"StpE"===P)?(this.getProductTax(),this.authTax=!0):this.authTax=!1}subscribeToObsproducts(){this.productStateService.getState().pipe((0,l.R)(this.destroy$)).subscribe(o=>{this.productPreview=o,this.relayout()})}getProductTax(){this.productService.getTax().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&(this.taxs=o)})}getPaperFormats(){this.barcodeService.getPaperFormatConfig().pipe((0,l.R)(this.destroy$)).subscribe({next:o=>{o.paperFormat&&(this.paperFormats=o.paperFormat,this.outlets=o.outlets,this.setSelectedPaperFormat(o.paperFormat[0]),this.initOptionFormat(),this.initOptionSelected(this.selectedPaperFormat))},error:o=>{console.error(o)}})}initOptionFormat(){this.paperFormatOptions=[],this.paperFormats.forEach((o,c)=>{this.paperFormatOptions=[...this.paperFormatOptions,{id:c+1,name:o.Name}]})}initOptionSelected(o){this.optionSelected=this.paperFormatOptions.find(c=>c.name===o.Name)}openSettingModal(){this.dialog.open(j,{width:"850px",data:{paperFormat:this.selectedPaperFormat,taxs:this.taxs,authTax:this.authTax,outlets:this.outlets,outletRole:this.outletView}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&this.selectedPaperFormat&&(this.updatePaperFormatSource(o),this.updatePaperFormat(),this.setSelectedPaperFormat(o))})}onSelectPaperFormat(){this.getPaperFormatBarcode()}getPaperFormatBarcode(){let c=this.findPaperFormatByName(this.optionSelected.name);this.setSelectedPaperFormat(c)}updatePaperFormat(){this.barcodeService.updatePaperFormatConfig(this.paperFormats).pipe((0,l.R)(this.destroy$)).subscribe({next:()=>{this.toastService.success("Success Update Paper Format","Success")},error:o=>{console.error(o)}})}setSelectedPaperFormat(o){this.selectedPaperFormat=o,this.barcodeService.setBarcodeConfigState(o),this.relayout(),this.getPPnVal(o)}findPaperFormatByName(o){return this.paperFormats.find(P=>P.Name==o)}updatePaperFormatSource(o){this.paperFormats=this.paperFormats.map(c=>(o.Name===c.Name&&(c=o),c))}getPPnVal(o){this.tax=o.TaxType?o.TaxType.Rate:null}relayout(){let o=this.selectedPaperFormat?.PaperWidth?this.selectedPaperFormat?.PaperWidth:0,c=this.selectedPaperFormat?.StickerWidth?this.selectedPaperFormat?.StickerWidth:0,P=this.selectedPaperFormat?.ColumnSpacing?this.selectedPaperFormat?.ColumnSpacing:0,K=Math.floor((o+P)/(c+P));this.totalStickerPerRow=K;let re=Math.floor(this.productPreview.length/K),ie=this.productPreview.length-re*K;this.lastIndex=0===ie?K:ie,this.productPreview=this.productPreview.map(me=>(me.setBarcodeTitle=this.selectedPaperFormat?.DescriptionAsCode&&me.getDescription?me.getDescription:me.getCode,me))}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(m.uw),t.Y36(R),t.Y36(le),t.Y36(pe),t.Y36(Be._W),t.Y36(k.$),t.Y36(F.gz))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-print-preview"]],decls:15,vars:10,consts:[[1,"mt-3","d-print-none"],[1,"card","mt-0","mb-0","paper-barcode"],[1,"card-header","d-flex","justify-content-between","align-items-center","border-bottom","pb-5","d-print-none"],[1,"fw-light"],["align","right",2,"width","400px"],[1,"d-inline-block","fw-light","text-info","fst-italic"],["align","left","bindLabel","name","placeholder","Select Column",1,"d-inline-block","ms-4",3,"items","ngModel","clearable","ngModelChange","change"],[1,"btn","btn","btn-outline-secondary","ms-4",3,"click"],["aria-hidden","true",1,"fa","fa-cog"],[1,"card-body","d-print-block",2,"padding","0"],[1,"canvas"],[1,"barcodes"],[3,"width","height","margin-right","margin-bottom",4,"ngFor","ngForOf"],[1,"position-relative"],[3,"bc-value","bc-element-type","bc-width","bc-height",4,"ngIf"],[2,"margin-top","-4px","line-height","1"],["class","d-block",3,"font-size",4,"ngIf"],[4,"ngIf"],[3,"bc-value","bc-element-type","bc-width","bc-height"],[1,"d-block"],[4,"ngIf","ngIfElse"],["WITHOUT_PROMOTION",""],[1,"d-flex","justify-content-between"],[1,"ms-12"],[1,"me-12"],[1,"text-danger",2,"text-decoration","line-through","text-decoration-thickness","1.5px"],[1,"text-dark"],[1,"d-flex","justify-content-between","mt-1"],[1,"me-12","text-danger"],["WITH_TAX",""],["WITHOUT_TAX",""],[1,"h-100"],[1,"vertical-text"]],template:function(o,c){1&o&&(t._UZ(0,"div",0),t.TgZ(1,"div",1)(2,"div",2)(3,"h1",3),t._uU(4," Print Preview "),t.qZA(),t.TgZ(5,"div",4)(6,"h5",5),t._uU(7,"Paper Source"),t.qZA(),t.TgZ(8,"ng-select",6),t.NdJ("ngModelChange",function(M){return c.optionSelected=M})("change",function(){return c.onSelectPaperFormat()}),t.qZA(),t.TgZ(9,"button",7),t.NdJ("click",function(){return c.openSettingModal()}),t._UZ(10,"i",8),t.qZA()()(),t.TgZ(11,"div",9)(12,"div",10)(13,"ul",11),t.YNc(14,it,12,17,"li",12),t.qZA()()()()),2&o&&(t.xp6(8),t.Q6J("items",c.paperFormatOptions)("ngModel",c.optionSelected)("clearable",!1),t.xp6(4),t.Udp("width",(null==c.selectedPaperFormat?null:c.selectedPaperFormat.PaperWidth)+"px")("margin-top",(null==c.selectedPaperFormat?null:c.selectedPaperFormat.MarginTop)+"px")("margin-left",(null==c.selectedPaperFormat?null:c.selectedPaperFormat.MarginLeft)+"px"),t.xp6(2),t.Q6J("ngForOf",c.productPreview))},dependencies:[A.sg,A.O5,_.JJ,_.On,U.w9,$,A.OU,A.JJ,A.uU,de],styles:["ng-select[_ngcontent-%COMP%]{width:50%}.card-header[_ngcontent-%COMP%]{height:65px} div.barcode>img{text-align:center;max-width:100%;border:none;outline:none}@media (max-width: 480px){ div.barcode>img{border:none!important}} div.canvas ul.barcodes li img{display:block;margin:0 auto}.vertical-text[_ngcontent-%COMP%]{transform:rotate(180deg);writing-mode:vertical-rl;position:absolute;right:0;top:0%;text-align:center}"]}),g})(),rt=(()=>{var f;class g{constructor(o,c,P){this.variantServiceState=o,this.authService=c,this.queryParamService=P,this.domainName=localStorage.getItem("Domain")}onLogout(){this.variantServiceState.setState([]),this.queryParamService.setState(null),this.authService.logout()}}return(f=g).\u0275fac=function(o){return new(o||f)(t.Y36(R),t.Y36(k.$),t.Y36(I.U))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-pages"]],decls:20,vars:2,consts:[[1,"container"],[1,"row"],[1,"col-4","d-print-none"],[1,"col-8","p-0"],[1,"d-md-block","d-print-none"],[1,"row","justify-content-between","align-items-center"],[1,"col-auto","d-inline-flex"],[1,"pt-1rem","me-3"],["target","_blank","href","https://www.dealpos.com"],["src","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid"],[1,"col-auto"],[1,"logout","d-print-none"],[3,"href"],[3,"click"],[1,"fa","fa-sign-out-alt"]],template:function(o,c){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"app-list-products"),t.qZA(),t.TgZ(4,"div",3),t._UZ(5,"app-print-preview"),t.qZA()()(),t.TgZ(6,"footer",4)(7,"div",5)(8,"div",6)(9,"p",7),t._uU(10,"Powered by : "),t.qZA(),t.TgZ(11,"a",8),t._UZ(12,"img",9),t.qZA()(),t.TgZ(13,"div",10)(14,"div",11)(15,"a",12),t._uU(16),t.qZA(),t.TgZ(17,"h5",13),t.NdJ("click",function(){return c.onLogout()}),t._UZ(18,"span",14),t._uU(19,"\xa0Logout"),t.qZA()()()()()),2&o&&(t.xp6(15),t.MGl("href","https://",c.domainName,"",t.LSH),t.xp6(1),t.Oqu(c.domainName))},dependencies:[Ve,Ie],styles:[".logout[_ngcontent-%COMP%]{position:relative;left:2.5vw;top:-5px;font-size:14px;cursor:pointer}footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:-1%}@media (min-height: 720px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:12%}}@media (min-height: 768px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:16%}}"]}),g})();var Le=E(4007);const mt=[{path:"",component:rt}];let gt=(()=>{var f;class g{}return(f=g).\u0275fac=function(o){return new(o||f)},f.\u0275mod=t.oAB({type:f}),f.\u0275inj=t.cJS({imports:[A.ez,Le.m,Ke,oe,x,F.Bz.forChild(mt)]}),g})()},6608:function(W){var E;E=()=>(()=>{var A={d:(s,T)=>{for(var L in T)A.o(T,L)&&!A.o(s,L)&&Object.defineProperty(s,L,{enumerable:!0,get:T[L]})},o:(s,T)=>Object.prototype.hasOwnProperty.call(s,T)},F={};A.d(F,{default:()=>et});var t={allowedTagList:["b","caption","cite","code","const","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","input","ins","kdb","label","li","option","output","p","q","s","sample","span","strong","td","th","u"]};Object.freeze(t.allowedTagList),Object.defineProperty(t,"allowedTagList",{configurable:!1,writable:!1}),t.fromCharCodeKeyCode={0:"LaunchCalculator",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",91:"OS",92:"OSRight",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",173:"-",182:"MyComputer",183:"MyCalculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta",225:"AltGraph"},Object.freeze(t.fromCharCodeKeyCode),Object.defineProperty(t,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),t.keyName={Unidentified:"Unidentified",AndroidDefault:"AndroidDefault",Alt:"Alt",AltGr:"AltGraph",CapsLock:"CapsLock",Ctrl:"Control",Fn:"Fn",FnLock:"FnLock",Hyper:"Hyper",Meta:"Meta",OSLeft:"OS",OSRight:"OS",Command:"OS",NumLock:"NumLock",ScrollLock:"ScrollLock",Shift:"Shift",Super:"Super",Symbol:"Symbol",SymbolLock:"SymbolLock",Enter:"Enter",Tab:"Tab",Space:" ",LeftArrow:"ArrowLeft",UpArrow:"ArrowUp",RightArrow:"ArrowRight",DownArrow:"ArrowDown",End:"End",Home:"Home",PageUp:"PageUp",PageDown:"PageDown",Backspace:"Backspace",Clear:"Clear",Copy:"Copy",CrSel:"CrSel",Cut:"Cut",Delete:"Delete",EraseEof:"EraseEof",ExSel:"ExSel",Insert:"Insert",Paste:"Paste",Redo:"Redo",Undo:"Undo",Accept:"Accept",Again:"Again",Attn:"Attn",Cancel:"Cancel",ContextMenu:"ContextMenu",Esc:"Escape",Execute:"Execute",Find:"Find",Finish:"Finish",Help:"Help",Pause:"Pause",Play:"Play",Props:"Props",Select:"Select",ZoomIn:"ZoomIn",ZoomOut:"ZoomOut",BrightnessDown:"BrightnessDown",BrightnessUp:"BrightnessUp",Eject:"Eject",LogOff:"LogOff",Power:"Power",PowerOff:"PowerOff",PrintScreen:"PrintScreen",Hibernate:"Hibernate",Standby:"Standby",WakeUp:"WakeUp",Compose:"Compose",Dead:"Dead",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",Print:"Print",num0:"0",num1:"1",num2:"2",num3:"3",num4:"4",num5:"5",num6:"6",num7:"7",num8:"8",num9:"9",a:"a",b:"b",c:"c",d:"d",e:"e",f:"f",g:"g",h:"h",i:"i",j:"j",k:"k",l:"l",m:"m",n:"n",o:"o",p:"p",q:"q",r:"r",s:"s",t:"t",u:"u",v:"v",w:"w",x:"x",y:"y",z:"z",A:"A",B:"B",C:"C",D:"D",E:"E",F:"F",G:"G",H:"H",I:"I",J:"J",K:"K",L:"L",M:"M",N:"N",O:"O",P:"P",Q:"Q",R:"R",S:"S",T:"T",U:"U",V:"V",W:"W",X:"X",Y:"Y",Z:"Z",Semicolon:";",Equal:"=",Comma:",",Hyphen:"-",Minus:"-",Plus:"+",Dot:".",Slash:"/",Backquote:"`",LeftParenthesis:"(",RightParenthesis:")",LeftBracket:"[",RightBracket:"]",Backslash:"\\",Quote:"'",numpad0:"0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",NumpadDot:".",NumpadDotAlt:",",NumpadMultiply:"*",NumpadPlus:"+",NumpadMinus:"-",NumpadSubtract:"-",NumpadSlash:"/",NumpadDotObsoleteBrowsers:"Decimal",NumpadMultiplyObsoleteBrowsers:"Multiply",NumpadPlusObsoleteBrowsers:"Add",NumpadMinusObsoleteBrowsers:"Subtract",NumpadSlashObsoleteBrowsers:"Divide",_allFnKeys:["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"],_someNonPrintableKeys:["Tab","Enter","Shift","ShiftLeft","ShiftRight","Control","ControlLeft","ControlRight","Alt","AltLeft","AltRight","Pause","CapsLock","Escape"],_directionKeys:["PageUp","PageDown","End","Home","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"]},Object.freeze(t.keyName._allFnKeys),Object.freeze(t.keyName._someNonPrintableKeys),Object.freeze(t.keyName._directionKeys),Object.freeze(t.keyName),Object.defineProperty(t,"keyName",{configurable:!1,writable:!1}),Object.freeze(t);const v=t;function D(s){return function(T){if(Array.isArray(T))return y(T)}(s)||function(T){if(typeof Symbol<"u"&&null!=T[Symbol.iterator]||null!=T["@@iterator"])return Array.from(T)}(s)||I(s)||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 R(){return R=Object.assign?Object.assign.bind():function(s){for(var T=1;T<arguments.length;T++){var L=arguments[T];for(var B in L)Object.prototype.hasOwnProperty.call(L,B)&&(s[B]=L[B])}return s},R.apply(this,arguments)}function k(s,T){return function(L){if(Array.isArray(L))return L}(s)||function(L,B){var e=null==L?null:typeof Symbol<"u"&&L[Symbol.iterator]||L["@@iterator"];if(null!=e){var i,a,r,h,w=[],C=!0,x=!1;try{if(r=(e=e.call(L)).next,0===B){if(Object(e)!==e)return;C=!1}else for(;!(C=(i=r.call(e)).done)&&(w.push(i.value),w.length!==B);C=!0);}catch(Z){x=!0,a=Z}finally{try{if(!C&&null!=e.return&&(h=e.return(),Object(h)!==h))return}finally{if(x)throw a}}return w}}(s,T)||I(s,T)||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 I(s,T){if(s){if("string"==typeof s)return y(s,T);var L=Object.prototype.toString.call(s).slice(8,-1);return"Object"===L&&s.constructor&&(L=s.constructor.name),"Map"===L||"Set"===L?Array.from(s):"Arguments"===L||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L)?y(s,T):void 0}}function y(s,T){(null==T||T>s.length)&&(T=s.length);for(var L=0,B=new Array(T);L<T;L++)B[L]=s[L];return B}function l(s){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&"function"==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T})(s)}function u(s,T){for(var L=0;L<T.length;L++){var B=T[L];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==l(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var w=h.call(a,"string");if("object"!==l(w))return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===l(i)?i:String(i)),B)}var i}var n=function(){function s(){!function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}(this,s)}var T,B;return T=s,B=[{key:"isNull",value:function(e){return null===e}},{key:"isUndefined",value:function(e){return void 0===e}},{key:"isUndefinedOrNullOrEmpty",value:function(e){return null==e||""===e}},{key:"isString",value:function(e){return"string"==typeof e||e instanceof String}},{key:"isEmptyString",value:function(e){return""===e}},{key:"isBoolean",value:function(e){return"boolean"==typeof e}},{key:"isTrueOrFalseString",value:function(e){var i=String(e).toLowerCase();return"true"===i||"false"===i}},{key:"isObject",value:function(e){return"object"===l(e)&&null!==e&&!Array.isArray(e)}},{key:"isEmptyObj",value:function(e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))return!1;return!0}},{key:"isNumberStrict",value:function(e){return"number"==typeof e}},{key:"isNumber",value:function(e){return!this.isArray(e)&&!isNaN(parseFloat(e))&&isFinite(e)}},{key:"isDigit",value:function(e){return/\d/.test(e)}},{key:"isNumberOrArabic",value:function(e){var i=this.arabicToLatinNumbers(e,!1,!0,!0);return this.isNumber(i)}},{key:"isInt",value:function(e){return"number"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)}},{key:"isFunction",value:function(e){return"function"==typeof e}},{key:"contains",value:function(e,i){return!(!this.isString(e)||!this.isString(i)||""===e||""===i)&&-1!==e.indexOf(i)}},{key:"isInArray",value:function(e,i){return!(!this.isArray(i)||i===[]||this.isUndefined(e))&&-1!==i.indexOf(e)}},{key:"isArray",value:function(e){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(e)||"object"===l(e)&&"[object Array]"===Object.prototype.toString.call(e);throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(e){return typeof Element<"u"&&e instanceof Element}},{key:"isInputElement",value:function(e){return this.isElement(e)&&"input"===e.tagName.toLowerCase()}},{key:"decimalPlaces",value:function(e){var i=k(e.split("."),2)[1];return this.isUndefined(i)?0:i.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(e){var i=k(String(Math.abs(e)).split("."),2)[1];if(this.isUndefined(i))return 0;var a=i.lastIndexOf("0");return-1===a?a=0:a+=2,a}},{key:"keyCodeNumber",value:function(e){return void 0===e.which?e.keyCode:e.which}},{key:"character",value:function(e){var i;if("Unidentified"===e.key||void 0===e.key||this.isSeleniumBot()){var a=this.keyCodeNumber(e);if(229===a)return v.keyName.AndroidDefault;var r=v.fromCharCodeKeyCode[a];i=s.isUndefinedOrNullOrEmpty(r)?String.fromCharCode(a):r}else switch(e.key){case"Add":i=v.keyName.NumpadPlus;break;case"Apps":i=v.keyName.ContextMenu;break;case"Crsel":i=v.keyName.CrSel;break;case"Decimal":i=e.char?e.char:v.keyName.NumpadDot;break;case"Del":i=v.keyName.Delete;break;case"Divide":i=v.keyName.NumpadSlash;break;case"Down":i=v.keyName.DownArrow;break;case"Esc":i=v.keyName.Esc;break;case"Exsel":i=v.keyName.ExSel;break;case"Left":i=v.keyName.LeftArrow;break;case"Meta":case"Super":i=v.keyName.OSLeft;break;case"Multiply":i=v.keyName.NumpadMultiply;break;case"Right":i=v.keyName.RightArrow;break;case"Spacebar":i=v.keyName.Space;break;case"Subtract":i=v.keyName.NumpadMinus;break;case"Up":i=v.keyName.UpArrow;break;default:i=e.key}return i}},{key:"browser",value:function(){var e,i=navigator.userAgent,a=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(a[1])?{name:"ie",version:(e=/\brv[ :]+(\d+)/g.exec(i)||[])[1]||""}:"Chrome"===a[1]&&null!==(e=i.match(/\b(OPR|Edge)\/(\d+)/))?{name:e[1].replace("OPR","opera"),version:e[2]}:(a=a[2]?[a[1],a[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(e=i.match(/version\/(\d+)/i))&&a.splice(1,1,e[1]),{name:a[0].toLowerCase(),version:a[1]})}},{key:"isSeleniumBot",value:function(){return!0===window.navigator.webdriver}},{key:"isNegative",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e===i||""!==e&&(s.isNumber(e)?e<0:a?this.contains(e,i):this.isNegativeStrict(e,i))}},{key:"isNegativeStrict",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.charAt(0)===i}},{key:"isNegativeWithBrackets",value:function(e,i,a){return e.charAt(0)===i&&this.contains(e,a)}},{key:"isZeroOrHasNoValue",value:function(e){return!/[1-9]/g.test(e)}},{key:"setRawNegativeSign",value:function(e){return this.isNegativeStrict(e,"-")?e:"-".concat(e)}},{key:"replaceCharAt",value:function(e,i,a){return"".concat(e.substr(0,i)).concat(a).concat(e.substr(i+a.length))}},{key:"clampToRangeLimits",value:function(e,i){return Math.max(i.minimumValue,Math.min(i.maximumValue,e))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(e,i,a){for(var r=new RegExp("[0-9".concat(a,"-]")),h=0,w=0;w<i;w++)r.test(e[w])&&h++;return h}},{key:"findCaretPositionInFormattedNumber",value:function(e,i,a,r){var h,w=a.length,C=e.length,x=0;for(h=0;h<w&&x<C&&x<i;h++)(e[x]===a[h]||"."===e[x]&&a[h]===r)&&x++;return h}},{key:"countCharInText",value:function(e,i){for(var a=0,r=0;r<i.length;r++)i[r]===e&&a++;return a}},{key:"convertCharacterCountToIndexPosition",value:function(e){return Math.max(e,e-1)}},{key:"getElementSelection",value:function(e){var i,a={};try{i=this.isUndefined(e.selectionStart)}catch{i=!1}try{if(i){var r=window.getSelection().getRangeAt(0);a.start=r.startOffset,a.end=r.endOffset,a.length=a.end-a.start}else a.start=e.selectionStart,a.end=e.selectionEnd,a.length=a.end-a.start}catch{a.start=0,a.end=0,a.length=0}return a}},{key:"setElementSelection",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(this.isUndefinedOrNullOrEmpty(a)&&(a=i),this.isInputElement(e))e.setSelectionRange(i,a);else if(!s.isNull(e.firstChild)){var r=document.createRange();r.setStart(e.firstChild,i),r.setEnd(e.firstChild,a);var h=window.getSelection();h.removeAllRanges(),h.addRange(r)}}},{key:"throwError",value:function(e){throw new Error(e)}},{key:"warning",value:function(e){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&console.warn("Warning: ".concat(e))}},{key:"isWheelEvent",value:function(e){return e instanceof WheelEvent}},{key:"isWheelUpEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY<0}},{key:"isWheelDownEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY>0}},{key:"forceDecimalPlaces",value:function(e,i){var a=k(String(e).split("."),2),h=a[1];return h?"".concat(a[0],".").concat(h.substr(0,i)):e}},{key:"roundToNearest",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return 0===e?0:(0===i&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(e/i)*i)}},{key:"modifyAndRoundToNearestAuto",value:function(e,i,a){e=Number(this.forceDecimalPlaces(e,a));var r=Math.abs(e);if(r>=0&&r<1){var h,w=Math.pow(10,-a);if(0===e)return i?w:-w;var x=a,Z=this.indexFirstNonZeroDecimalPlace(e);return h=Z>=x-1?w:Math.pow(10,-(Z+1)),this.roundToNearest(i?e+h:e-h,h)}e=parseInt(e,10);var p,V=Math.abs(e).toString().length;switch(V){case 1:p=0;break;case 2:case 3:p=1;break;case 4:case 5:p=2;break;default:p=V-3}var j,q=Math.pow(10,p);return(j=i?e+q:e-q)<=10&&j>=-10?j:this.roundToNearest(j,q)}},{key:"addAndRoundToNearestAuto",value:function(e,i){return this.modifyAndRoundToNearestAuto(e,!0,i)}},{key:"subtractAndRoundToNearestAuto",value:function(e,i){return this.modifyAndRoundToNearestAuto(e,!1,i)}},{key:"arabicToLatinNumbers",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.isNull(e))return e;var h=e.toString();if(""===h)return e;if(null===h.match(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06f4\u06f5\u06f6]/g))return i&&(h=Number(h)),h;a&&(h=h.replace(/\u066b/,".")),r&&(h=h.replace(/\u066c/g,"")),h=h.replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g,function(C){return C.charCodeAt(0)-1632}).replace(/[\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9]/g,function(C){return C.charCodeAt(0)-1776});var w=Number(h);return isNaN(w)?w:(i&&(h=w),h)}},{key:"triggerEvent",value:function(e){var i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,h=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],w=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];window.CustomEvent?i=new CustomEvent(e,{detail:r,bubbles:h,cancelable:w}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,h,w,{detail:r}),a.dispatchEvent(i)}},{key:"parseStr",value:function(e){var i,a,r,h,w={};if(0===e&&1/e<0&&(e="-0"),e=e.toString(),this.isNegativeStrict(e,"-")?(e=e.slice(1),w.s=-1):w.s=1,(i=e.indexOf("."))>-1&&(e=e.replace(".","")),i<0&&(i=e.length),(a=-1===e.search(/[1-9]/i)?e.length:e.search(/[1-9]/i))===(r=e.length))w.e=0,w.c=[0];else{for(h=r-1;"0"===e.charAt(h);h-=1)r-=1;for(r-=1,w.e=i-a-1,w.c=[],i=0;a<=r;a+=1)w.c[i]=+e.charAt(a),i+=1}return w}},{key:"testMinMax",value:function(e,i){var a=i.c,r=e.c,h=i.s,w=e.s,C=i.e,x=e.e;if(!a[0]||!r[0])return a[0]?h:r[0]?-w:0;if(h!==w)return h;var Z=h<0;if(C!==x)return C>x^Z?1:-1;for(h=-1,w=(C=a.length)<(x=r.length)?C:x,h+=1;h<w;h+=1)if(a[h]!==r[h])return a[h]>r[h]^Z?1:-1;return C===x?0:C>x^Z?1:-1}},{key:"randomString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;return Math.random().toString(36).substr(2,e)}},{key:"domElement",value:function(e){return s.isString(e)?document.querySelector(e):e}},{key:"getElementValue",value:function(e){return"input"===e.tagName.toLowerCase()?e.value:this.text(e)}},{key:"setElementValue",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;"input"===e.tagName.toLowerCase()?e.value=i:e.textContent=i}},{key:"setInvalidState",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Invalid";(""===i||this.isNull(i))&&this.throwError("Cannot set the invalid state with an empty message."),e.setCustomValidity(i)}},{key:"setValidState",value:function(e){e.setCustomValidity("")}},{key:"cloneObject",value:function(e){return R({},e)}},{key:"camelize",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(this.isNull(e))return null;a&&(e=e.replace(/^data-/,""));var h=e.split(i).map(function(w){return"".concat(w.charAt(0).toUpperCase()).concat(w.slice(1))});return h=h.join(""),r&&(h="".concat(h.charAt(0).toLowerCase()).concat(h.slice(1))),h}},{key:"text",value:function(e){var i=e.nodeType;return i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e.textContent:i===Node.TEXT_NODE?e.nodeValue:""}},{key:"setText",value:function(e,i){var a=e.nodeType;a!==Node.ELEMENT_NODE&&a!==Node.DOCUMENT_NODE&&a!==Node.DOCUMENT_FRAGMENT_NODE||(e.textContent=i)}},{key:"filterOut",value:function(e,i){var a=this;return e.filter(function(r){return!a.isInArray(r,i)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(e){if(""===(e=String(e)))return"";var i=k(e.split("."),2),a=i[0],r=i[1];if(this.isUndefinedOrNullOrEmpty(r))return a;var h=r.replace(/0+$/g,"");return""===h?a:"".concat(a,".").concat(h)}},{key:"getHoveredElement",value:function(){var e=D(document.querySelectorAll(":hover"));return e[e.length-1]}},{key:"arrayTrim",value:function(e,i){var a=e.length;return 0===a||i>a?e:i<0?[]:(e.length=parseInt(i,10),e)}},{key:"arrayUnique",value:function(){var e;return D(new Set((e=[]).concat.apply(e,arguments)))}},{key:"mergeMaps",value:function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];return new Map(i.reduce(function(r,h){return r.concat(D(h))},[]))}},{key:"objectKeyLookup",value:function(e,i){var a=Object.entries(e).find(function(h){return h[1]===i}),r=null;return void 0!==a&&(r=a[0]),r}},{key:"insertAt",value:function(e,i,a){if(a>(e=String(e)).length)throw new Error("The given index is out of the string range.");if(1!==i.length)throw new Error("The given string `char` should be only one character long.");return""===e&&0===a?i:"".concat(e.slice(0,a)).concat(i).concat(e.slice(a))}},{key:"scientificToDecimal",value:function(e){var i=Number(e);if(isNaN(i))return NaN;if(e=String(e),!this.contains(e,"e")&&!this.contains(e,"E"))return e;var a=k(e.split(/e/i),2),r=a[0],h=a[1],w=r<0;w&&(r=r.replace("-",""));var C=+h<0;C&&(h=h.replace("-",""));var x,Z=k(r.split(/\./),2),p=Z[0],V=Z[1];return C?(x=p.length>h?this.insertAt(p,".",p.length-h):"0.".concat("0".repeat(h-p.length)).concat(p),x="".concat(x).concat(V||"")):V?(r="".concat(p).concat(V),x=h<V.length?this.insertAt(r,".",+h+p.length):"".concat(r).concat("0".repeat(h-V.length))):(r=r.replace(".",""),x="".concat(r).concat("0".repeat(Number(h)))),w&&(x="-".concat(x)),x}}],B&&u(T,B),Object.defineProperty(T,"prototype",{writable:!1}),s}();function d(s){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&"function"==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T})(s)}var S=function(){function s(e){if(function(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")}(this,s),null===e)throw new Error("Invalid AST")}var T,L;return T=s,(L=[{key:"evaluate",value:function(e){if(null==e)throw new Error("Invalid AST sub-tree");if("number"===e.type)return e.value;if("unaryMinus"===e.type)return-this.evaluate(e.left);var i=this.evaluate(e.left),a=this.evaluate(e.right);switch(e.type){case"op_+":return Number(i)+Number(a);case"op_-":return i-a;case"op_*":return i*a;case"op_/":return i/a;default:throw new Error("Invalid operator '".concat(e.type,"'"))}}}])&&function m(s,T){for(var L=0;L<T.length;L++){var B=T[L];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==d(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var w=h.call(a,"string");if("object"!==d(w))return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===d(i)?i:String(i)),B)}var i}(T.prototype,L),Object.defineProperty(T,"prototype",{writable:!1}),s}();function _(s){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&"function"==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T})(s)}function U(s,T){for(var L=0;L<T.length;L++){var B=T[L];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==_(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var w=h.call(a,"string");if("object"!==_(w))return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===_(i)?i:String(i)),B)}var i}var G=function(){function s(){!function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}(this,s)}var T,B;return T=s,(B=[{key:"createNode",value:function(e,i,a){var r=new s;return r.type=e,r.left=i,r.right=a,r}},{key:"createUnaryNode",value:function(e){var i=new s;return i.type="unaryMinus",i.left=e,i.right=null,i}},{key:"createLeaf",value:function(e){var i=new s;return i.type="number",i.value=e,i}}])&&U(T,B),Object.defineProperty(T,"prototype",{writable:!1}),s}();function z(s){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&"function"==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T})(s)}function X(s,T){for(var L=0;L<T.length;L++){var B=T[L];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==z(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var w=h.call(a,"string");if("object"!==z(w))return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===z(i)?i:String(i)),B)}var i}var ue=function ge(s,T,L){return T&&X(s.prototype,T),L&&X(s,L),Object.defineProperty(s,"prototype",{writable:!1}),s}(function s(T,L,B){(function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")})(this,s),this.type=T,this.value=L,this.symbol=B});function pe(s){return(pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&"function"==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T})(s)}var xe=function(){function s(e){(function(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")})(this,s),this.text=e,this.textLength=e.length,this.index=0,this.token=new ue("Error",0,0)}var T,L;return T=s,L=[{key:"_skipSpaces",value:function(){for(;" "===this.text[this.index]&&this.index<=this.textLength;)this.index++}},{key:"getIndex",value:function(){return this.index}},{key:"getNextToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".";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(e),this.token;switch(this.token.type="Error",this.text[this.index]){case"+":this.token.type="+";break;case"-":this.token.type="-";break;case"*":this.token.type="*";break;case"/":this.token.type="/";break;case"(":this.token.type="(";break;case")":this.token.type=")"}if("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(e){this._skipSpaces();for(var i=this.index;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===e&&this.index++;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;if(this.index===i)throw new Error("No number has been found while it was expected");return this.text.substring(i,this.index).replace(e,".")}}],L&&function ke(s,T){for(var L=0;L<T.length;L++){var B=T[L];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==pe(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var w=h.call(a,"string");if("object"!==pe(w))return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===pe(i)?i:String(i)),B)}var i}(T.prototype,L),Object.defineProperty(T,"prototype",{writable:!1}),s}();function Q(s){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&"function"==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T})(s)}var ne=function(){function s(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".";return function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}(this,s),this.text=e,this.decimalCharacter=i,this.lexer=new xe(e),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}var T,L;return T=s,(L=[{key:"_exp",value:function(){var e=this._term(),i=this._moreExp();return G.createNode("op_+",e,i)}},{key:"_moreExp",value:function(){var e,i;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),i=this._moreExp(),G.createNode("op_+",i,e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),i=this._moreExp(),G.createNode("op_-",i,e)}return G.createLeaf(0)}},{key:"_term",value:function(){var e=this._factor(),i=this._moreTerms();return G.createNode("op_*",e,i)}},{key:"_moreTerms",value:function(){var e,i;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),i=this._moreTerms(),G.createNode("op_*",i,e);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),i=this._moreTerms(),G.createNode("op_/",i,e)}return G.createLeaf(1)}},{key:"_factor",value:function(){var e,i,a;switch(this.token.type){case"num":return a=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),G.createLeaf(a);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),i=this._factor(),G.createUnaryNode(i);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._exp(),this._match(")"),e;default:throw new Error("Unexpected token '".concat(this.token.symbol,"' with type '").concat(this.token.type,"' at position '").concat(this.token.index,"' in the factor function"))}}},{key:"_match",value:function(e){var i=this.lexer.getIndex()-1;if(this.text[i]!==e)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(i,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}])&&function ee(s,T){for(var L=0;L<T.length;L++){var B=T[L];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==Q(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var w=h.call(a,"string");if("object"!==Q(w))return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===Q(i)?i:String(i)),B)}var i}(T.prototype,L),Object.defineProperty(T,"prototype",{writable:!1}),s}();function Y(s){return function(T){if(Array.isArray(T))return be(T)}(s)||function(T){if(typeof Symbol<"u"&&null!=T[Symbol.iterator]||null!=T["@@iterator"])return Array.from(T)}(s)||ae(s)||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 J(s,T){return function(L){if(Array.isArray(L))return L}(s)||function(L,B){var e=null==L?null:typeof Symbol<"u"&&L[Symbol.iterator]||L["@@iterator"];if(null!=e){var i,a,r,h,w=[],C=!0,x=!1;try{if(r=(e=e.call(L)).next,0===B){if(Object(e)!==e)return;C=!1}else for(;!(C=(i=r.call(e)).done)&&(w.push(i.value),w.length!==B);C=!0);}catch(Z){x=!0,a=Z}finally{try{if(!C&&null!=e.return&&(h=e.return(),Object(h)!==h))return}finally{if(x)throw a}}return w}}(s,T)||ae(s,T)||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 ae(s,T){if(s){if("string"==typeof s)return be(s,T);var L=Object.prototype.toString.call(s).slice(8,-1);return"Object"===L&&s.constructor&&(L=s.constructor.name),"Map"===L||"Set"===L?Array.from(s):"Arguments"===L||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L)?be(s,T):void 0}}function be(s,T){(null==T||T>s.length)&&(T=s.length);for(var L=0,B=new Array(T);L<T;L++)B[L]=s[L];return B}function le(){return le=Object.assign?Object.assign.bind():function(s){for(var T=1;T<arguments.length;T++){var L=arguments[T];for(var B in L)Object.prototype.hasOwnProperty.call(L,B)&&(s[B]=L[B])}return s},le.apply(this,arguments)}function fe(s){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&"function"==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T})(s)}function Re(s,T){for(var L=0;L<T.length;L++){var B=T[L];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,We(B.key),B)}}function Te(s,T,L){return(T=We(T))in s?Object.defineProperty(s,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):s[T]=L,s}function We(s){var T=function(L,B){if("object"!==fe(L)||null===L)return L;var e=L[Symbol.toPrimitive];if(void 0!==e){var i=e.call(L,"string");if("object"!==fe(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(L)}(s);return"symbol"===fe(T)?T:String(T)}var ce,N=function(){function s(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(p,V){if(!(p instanceof V))throw new TypeError("Cannot call a class as a function")}(this,s);var h=s._setArgumentsValues(i,a,r),C=h.initialValue,x=h.userOptions;if(this.domElement=h.domElement,this.defaultRawValue="",this._setSettings(x,!1),this._checkElement(),this.savedCancellableValue=null,this.historyTable=[],this.historyTableIndex=-1,this.onGoingRedo=!1,this.parentForm=this._getParentForm(),!this.runOnce&&this.settings.formatOnPageLoad)this._formatDefaultValueOnPageLoad(C);else{var Z;if(n.isNull(C))switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.min:Z=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:Z=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:Z="0";break;case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:Z="";break;case s.options.emptyInputBehavior.null:Z=null;break;default:Z=this.settings.emptyInputBehavior}else Z=C;this._setElementAndRawValue(Z)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(C),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(p){var V=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e.autoNumericLocalList.forEach(function(j){j.set(p,V)})},setUnformatted:function(p){var V=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e.autoNumericLocalList.forEach(function(j){j.setUnformatted(p,V)})},get:function(){var p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,V=[];return e.autoNumericLocalList.forEach(function(j){V.push(j.get())}),e._executeCallback(V,p),V},getNumericString:function(){var p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,V=[];return e.autoNumericLocalList.forEach(function(j){V.push(j.getNumericString())}),e._executeCallback(V,p),V},getFormatted:function(){var p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,V=[];return e.autoNumericLocalList.forEach(function(j){V.push(j.getFormatted())}),e._executeCallback(V,p),V},getNumber:function(){var p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,V=[];return e.autoNumericLocalList.forEach(function(j){V.push(j.getNumber())}),e._executeCallback(V,p),V},getLocalized:function(){var p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,V=[];return e.autoNumericLocalList.forEach(function(j){V.push(j.getLocalized())}),e._executeCallback(V,p),V},reformat:function(){e.autoNumericLocalList.forEach(function(p){p.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(p){p.unformat()})},unformatLocalized:function(){var p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e.autoNumericLocalList.forEach(function(V){V.unformatLocalized(p)})},update:function(){for(var p=arguments.length,V=new Array(p),j=0;j<p;j++)V[j]=arguments[j];e.autoNumericLocalList.forEach(function(q){q.update.apply(q,V)})},isPristine:function(){var p=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],V=!0;return e.autoNumericLocalList.forEach(function(j){V&&!j.isPristine(p)&&(V=!1)}),V},clear:function(){var p=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.autoNumericLocalList.forEach(function(V){V.clear(p)})},remove:function(){e.autoNumericLocalList.forEach(function(p){p.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(p){p.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(p){p.nuke()})},has:function(p){return e.autoNumericLocalList.has(p instanceof s?p.node():p)},addObject:function(p){var V,j;p instanceof s?(V=p.node(),j=p):j=s.getAutoNumericElement(V=p),e._hasLocalList()||e._createLocalList();var q,H=j._getLocalList();0===H.size&&(j._createLocalList(),H=j._getLocalList()),H instanceof Map?q=n.mergeMaps(e._getLocalList(),H):(e._addToLocalList(V,j),q=e._getLocalList()),q.forEach(function($){$._setLocalList(q)})},removeObject:function(p){var V,j,q=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p instanceof s?(V=p.node(),j=p):j=s.getAutoNumericElement(V=p);var H=e.autoNumericLocalList;e.autoNumericLocalList.delete(V),H.forEach(function($){$._setLocalList(e.autoNumericLocalList)}),q||V!==e.node()?j._createLocalList():j._setLocalList(new Map)},empty:function(){var p=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.autoNumericLocalList.forEach(function(V){p?V._createLocalList():V._setLocalList(new Map)})},elements:function(){var p=[];return e.autoNumericLocalList.forEach(function(V){p.push(V.node())}),p},getList:function(){return e.autoNumericLocalList},size:function(){return e.autoNumericLocalList.size}},this.options={reset:function(){return e.settings={rawValue:e.defaultRawValue},e.update(s.defaultSettings),e},allowDecimalPadding:function(p){return e.update({allowDecimalPadding:p}),e},alwaysAllowDecimalCharacter:function(p){return e.update({alwaysAllowDecimalCharacter:p}),e},caretPositionOnFocus:function(p){return e.settings.caretPositionOnFocus=p,e},createLocalList:function(p){return e.settings.createLocalList=p,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(p){return e.update({currencySymbol:p}),e},currencySymbolPlacement:function(p){return e.update({currencySymbolPlacement:p}),e},decimalCharacter:function(p){return e.update({decimalCharacter:p}),e},decimalCharacterAlternative:function(p){return e.settings.decimalCharacterAlternative=p,e},decimalPlaces:function(p){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:p}),e},decimalPlacesRawValue:function(p){return e.update({decimalPlacesRawValue:p}),e},decimalPlacesShownOnBlur:function(p){return e.update({decimalPlacesShownOnBlur:p}),e},decimalPlacesShownOnFocus:function(p){return e.update({decimalPlacesShownOnFocus:p}),e},defaultValueOverride:function(p){return e.update({defaultValueOverride:p}),e},digitalGroupSpacing:function(p){return e.update({digitalGroupSpacing:p}),e},digitGroupSeparator:function(p){return e.update({digitGroupSeparator:p}),e},divisorWhenUnfocused:function(p){return e.update({divisorWhenUnfocused:p}),e},emptyInputBehavior:function(p){return null===e.rawValue&&p!==s.options.emptyInputBehavior.null&&(n.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(p,"), 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:p}),e},eventBubbles:function(p){return e.settings.eventBubbles=p,e},eventIsCancelable:function(p){return e.settings.eventIsCancelable=p,e},failOnUnknownOption:function(p){return e.settings.failOnUnknownOption=p,e},formatOnPageLoad:function(p){return e.settings.formatOnPageLoad=p,e},formulaMode:function(p){return e.settings.formulaMode=p,e},historySize:function(p){return e.settings.historySize=p,e},invalidClass:function(p){return e.settings.invalidClass=p,e},isCancellable:function(p){return e.settings.isCancellable=p,e},leadingZero:function(p){return e.update({leadingZero:p}),e},maximumValue:function(p){return e.update({maximumValue:p}),e},minimumValue:function(p){return e.update({minimumValue:p}),e},modifyValueOnUpDownArrow:function(p){return e.settings.modifyValueOnUpDownArrow=p,e},modifyValueOnWheel:function(p){return e.settings.modifyValueOnWheel=p,e},negativeBracketsTypeOnBlur:function(p){return e.update({negativeBracketsTypeOnBlur:p}),e},negativePositiveSignPlacement:function(p){return e.update({negativePositiveSignPlacement:p}),e},negativeSignCharacter:function(p){return e.update({negativeSignCharacter:p}),e},negativePositiveSignBehavior:function(p){return e.settings.negativePositiveSignBehavior=p,e},noEventListeners:function(p){return p===s.options.noEventListeners.noEvents&&e.settings.noEventListeners===s.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:p}),e},onInvalidPaste:function(p){return e.settings.onInvalidPaste=p,e},outputFormat:function(p){return e.settings.outputFormat=p,e},overrideMinMaxLimits:function(p){return e.update({overrideMinMaxLimits:p}),e},positiveSignCharacter:function(p){return e.update({positiveSignCharacter:p}),e},rawValueDivisor:function(p){return e.update({rawValueDivisor:p}),e},readOnly:function(p){return e.settings.readOnly=p,e._setWritePermissions(),e},roundingMethod:function(p){return e.update({roundingMethod:p}),e},saveValueToSessionStorage:function(p){return e.update({saveValueToSessionStorage:p}),e},symbolWhenUnfocused:function(p){return e.update({symbolWhenUnfocused:p}),e},selectNumberOnly:function(p){return e.settings.selectNumberOnly=p,e},selectOnFocus:function(p){return e.settings.selectOnFocus=p,e},serializeSpaces:function(p){return e.settings.serializeSpaces=p,e},showOnlyNumbersOnFocus:function(p){return e.update({showOnlyNumbersOnFocus:p}),e},showPositiveSign:function(p){return e.update({showPositiveSign:p}),e},showWarnings:function(p){return e.settings.showWarnings=p,e},styleRules:function(p){return e.update({styleRules:p}),e},suffixText:function(p){return e.update({suffixText:p}),e},unformatOnHover:function(p){return e.settings.unformatOnHover=p,e},unformatOnSubmit:function(p){return e.settings.unformatOnSubmit=p,e},upDownStep:function(p){return e.settings.upDownStep=p,e},valuesToStrings:function(p){return e.update({valuesToStrings:p}),e},watchExternalChanges:function(p){return e.update({watchExternalChanges:p}),e},wheelOn:function(p){return e.settings.wheelOn=p,e},wheelStep:function(p){return e.settings.wheelStep=p,e}},this._triggerEvent(s.events.initialized,this.domElement,{newValue:n.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var T,L,B;return T=s,L=[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=n.scientificToDecimal(this.domElement.getAttribute("value")),n.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,n.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this._onFocusInFunc=function(i){e._onFocusIn(i)},this._onFocusInAndMouseEnterFunc=function(i){e._onFocusInAndMouseEnter(i)},this._onFocusFunc=function(){e._onFocus()},this._onKeydownFunc=function(i){e._onKeydown(i)},this._onKeypressFunc=function(i){e._onKeypress(i)},this._onKeyupFunc=function(i){e._onKeyup(i)},this._onFocusOutAndMouseLeaveFunc=function(i){e._onFocusOutAndMouseLeave(i)},this._onPasteFunc=function(i){e._onPaste(i)},this._onWheelFunc=function(i){e._onWheel(i)},this._onDropFunc=function(i){e._onDrop(i)},this._onKeydownGlobalFunc=function(i){e._onKeydownGlobal(i)},this._onKeyupGlobalFunc=function(i){e._onKeyupGlobal(i)},this.domElement.addEventListener("focusin",this._onFocusInFunc,!1),this.domElement.addEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("focus",this._onFocusFunc,!1),this.domElement.addEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("keydown",this._onKeydownFunc,!1),this.domElement.addEventListener("keypress",this._onKeypressFunc,!1),this.domElement.addEventListener("keyup",this._onKeyupFunc,!1),this.domElement.addEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("paste",this._onPasteFunc,!1),this.domElement.addEventListener("wheel",this._onWheelFunc,!1),this.domElement.addEventListener("drop",this._onDropFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,s._doesGlobalListExists()||(document.addEventListener("keydown",this._onKeydownGlobalFunc,!1),document.addEventListener("keyup",this._onKeyupGlobalFunc,!1))}},{key:"_removeEventListeners",value:function(){this.domElement.removeEventListener("focusin",this._onFocusInFunc,!1),this.domElement.removeEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("focus",this._onFocusFunc,!1),this.domElement.removeEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("keydown",this._onKeydownFunc,!1),this.domElement.removeEventListener("keypress",this._onKeypressFunc,!1),this.domElement.removeEventListener("keyup",this._onKeyupFunc,!1),this.domElement.removeEventListener("paste",this._onPasteFunc,!1),this.domElement.removeEventListener("wheel",this._onWheelFunc,!1),this.domElement.removeEventListener("drop",this._onDropFunc,!1),this._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()):e>1?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(){this._getFormElement(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(){this._getFormElement(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(){return"anFormHandler"in this._getFormElement(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null).dataset}},{key:"_getFormElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n.isNull(e)?this.parentForm:e}},{key:"_storeFormHandlerFunction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var i=n.randomString();this._getFormElement(e).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(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.domElement.readOnly||this.settings.readOnly?this._setReadOnly():this._setReadWrite()}},{key:"_setReadOnly",value:function(){this.isInputElement?this.domElement.readOnly=!0:this.domElement.setAttribute("contenteditable",!1)}},{key:"_setReadWrite",value:function(){this.isInputElement?this.domElement.readOnly=!1:this.domElement.setAttribute("contenteditable",!0)}},{key:"_addWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,a=i.set,r=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return r.call(e.domElement)},set:function(h){a.call(e.domElement,h),e.settings.watchExternalChanges&&!e.internalModification&&e.set(h)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,a=i.set,r=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return r.call(e.domElement)},set:function(h){a.call(e.domElement,h)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var i=this.domElement.nodeType;i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":i===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=0===this.historyTable.length;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var i=!0;if(!e){var a=this.historyTableIndex+1;a<this.historyTable.length&&this.rawValue===this.historyTable[a].value?i=!1:n.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,i){var r=n.getElementSelection(this.domElement);this.selectionStart=r.start,this.selectionEnd=r.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),this.historyTable.length>1&&(this.historyTable[this.historyTableIndex-1].start=this.selectionStart,this.historyTable[this.historyTableIndex-1].end=this.selectionEnd)}this.historyTable.length>this.settings.historySize&&this._historyTableForget()}}},{key:"_historyTableUndoOrRedo",value:function(){var e;if(arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?(e=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(e=this.historyTableIndex>0)&&this.historyTableIndex--,e){var i=this.historyTable[this.historyTableIndex];this.set(i.value,null,!1),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(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=[],a=0;a<e;a++)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)||(this.rawValue>=0?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||0===this.settings.styleRules.ranges.length||this.settings.styleRules.ranges.forEach(function(i){e.rawValue>=i.min&&e.rawValue<i.max?e._addCSSClass(i.class):e._removeCSSClass(i.class)}),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||0===this.settings.styleRules.userDefined.length||this.settings.styleRules.userDefined.forEach(function(i){if(n.isFunction(i.callback))if(n.isString(i.classes))i.callback(e.rawValue)?e._addCSSClass(i.classes):e._removeCSSClass(i.classes);else if(n.isArray(i.classes))if(2===i.classes.length)i.callback(e.rawValue)?(e._addCSSClass(i.classes[0]),e._removeCSSClass(i.classes[1])):(e._removeCSSClass(i.classes[0]),e._addCSSClass(i.classes[1]));else if(i.classes.length>2){var a=i.callback(e.rawValue);n.isArray(a)?i.classes.forEach(function(r,h){n.isInArray(h,a)?e._addCSSClass(r):e._removeCSSClass(r)}):n.isInt(a)?i.classes.forEach(function(r,h){h===a?e._addCSSClass(r):e._removeCSSClass(r)}):n.isNull(a)?i.classes.forEach(function(r){e._removeCSSClass(r)}):n.throwError("The callback result is not an array nor a valid array index, ".concat(fe(a)," given."))}else n.throwError("The classes attribute is not valid for the `styleRules` option.");else n.isUndefinedOrNullOrEmpty(i.classes)?i.callback(e):n.throwError("The callback/classes structure is not valid for the `styleRules` option.");else n.warning("The given `styleRules` callback is not a function, ".concat(fe(i.callback)," given."),e.settings.showWarnings)}))}},{key:"_addCSSClass",value:function(e){this.domElement.classList.add(e)}},{key:"_removeCSSClass",value:function(e){this.domElement.classList.remove(e)}},{key:"update",value:function(){for(var e=this,i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];Array.isArray(a)&&Array.isArray(a[0])&&(a=a[0]);var h=n.cloneObject(this.settings),w=this.rawValue,C={};n.isUndefinedOrNullOrEmpty(a)||0===a.length?C=null:a.length>=1&&a.forEach(function(x){e.constructor._isPreDefinedOptionValid(x)&&(x=e.constructor._getOptionObject(x)),le(C,x)});try{this._setSettings(C,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(w)}catch(x){return this._setSettings(h,!0),n.throwError("Unable to update the settings, those are invalid: [".concat(x,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,h=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];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(r)||this._setSettings(r,!0),null===e&&this.settings.emptyInputBehavior!==s.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,h),this._saveValueToPersistentStorage(),this;if(i=this.constructor._toNumericValue(e,this.settings),isNaN(Number(i)))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("",h),this;if(""===i)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:i=0;break;case s.options.emptyInputBehavior.min:i=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:i=this.settings.maximumValue;break;default:n.isNumber(this.settings.emptyInputBehavior)&&(i=Number(this.settings.emptyInputBehavior))}if(""!==i){var w=J(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),C=w[0],x=w[1];if(C&&x&&this.settings.valuesToStrings&&this._checkValuesToStrings(i))return this._setElementAndRawValue(this.settings.valuesToStrings[i],i,h),this._saveValueToPersistentStorage(),this;if(n.isZeroOrHasNoValue(i)&&(i="0"),C&&x){var Z=this.constructor._roundRawValue(i,this.settings);return Z=this._trimLeadingAndTrailingZeros(Z.replace(this.settings.decimalCharacter,".")),i=this._getRawValueToFormat(i),this.isFocused?i=this.constructor._roundFormattedValueShownOnFocus(i,this.settings):(this.settings.divisorWhenUnfocused&&(i=(i/=this.settings.divisorWhenUnfocused).toString()),i=this.constructor._roundFormattedValueShownOnBlur(i,this.settings)),i=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(i,this.settings),i=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue,Z),!this.isFocused&&this.settings.symbolWhenUnfocused&&(i="".concat(i).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(i,Z,h),this._setValidOrInvalidState(Z),this}return this._triggerRangeEvents(C,x),n.throwError("The value [".concat(i,"] being set falls outside of the minimumValue [").concat(this.settings.minimumValue,"] and maximumValue [").concat(this.settings.maximumValue,"] range set for this element")),this._removeValueFromPersistentStorage(),this.setValue("",h),this}return this._setElementAndRawValue(this.settings.emptyInputBehavior===s.options.emptyInputBehavior.always?this.settings.currencySymbol:"","",h),this}},{key:"setUnformatted",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===e||n.isUndefined(e))return this;n.isNull(i)||this._setSettings(i,!0);var a=this.constructor._removeBrackets(e,this.settings),r=this.constructor._stripAllNonNumberCharacters(a,this.settings,!0,this.isFocused);return n.isNumber(r)||n.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(r,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){return this._setElementAndRawValue(e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),this}},{key:"_setRawValue",value:function(e){var i=this,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.rawValue!==e){var r=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(s.events.rawValueModified,this.domElement,{oldRawValue:r,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),a&&window.requestAnimationFrame(function(){return i._historyTableAdd()})}}},{key:"_setElementValue",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=n.getElementValue(this.domElement);return e!==a&&(this.internalModification=!0,n.setElementValue(this.domElement,e),this.internalModification=!1,i&&this._triggerEvent(s.events.formatted,this.domElement,{oldValue:a,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n.isNull(i)?i=e:n.isBoolean(i)&&(a=i,i=e),this._setElementValue(e),this._setRawValue(i,a),this}},{key:"_getRawValueToFormat",value:function(e){return n.isNull(this.settings.rawValueDivisor)||0===this.settings.rawValueDivisor||""===e||null===e?e:e*this.settings.rawValueDivisor}},{key:"_checkValuesToStrings",value:function(e){return this.constructor._checkValuesToStringsArray(e,this.valuesToStringsKeys)}},{key:"_isUserManuallyEditingTheValue",value:function(){return this.isFocused&&this.isEditing||this.isDropEvent}},{key:"_executeCallback",value:function(e,i){!n.isNull(i)&&n.isFunction(i)&&i(e,this)}},{key:"_triggerEvent",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;n.triggerEvent(e,i,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(){return this.getNumericString(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)}},{key:"getNumericString",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(this.rawValue)?null:n.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(e,i),e}},{key:"getFormatted",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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,e),i}},{key:"getNumber",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(e,i),e}},{key:"getLocalized",value:function(){var e,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.isFunction(a)&&n.isNull(r)&&(r=a,a=null),""!=(e=n.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(e)&&this.settings.leadingZero!==s.options.leadingZero.keep&&(e="0"),i=n.isNull(a)?this.settings.outputFormat:a;var h=this.constructor._toLocale(e,i,this.settings);return this._executeCallback(h,r),h}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(){return this._setElementValue(this.getLocalized(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)),this}},{key:"isPristine",value:function(){return arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?this.initialValueHtmlAttribute===this.getFormatted():this.initialValue===this.getNumericString()}},{key:"select",value:function(){return this.settings.selectNumberOnly?this.selectNumber():this._defaultSelectAll(),this}},{key:"_defaultSelectAll",value:function(){n.setElementSelection(this.domElement,0,n.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,i,a=n.getElementValue(this.domElement),r=a.length,h=this.settings.currencySymbol.length,w=this.settings.currencySymbolPlacement,C=n.isNegative(a,this.settings.negativeSignCharacter)?1:0,x=this.settings.suffixText.length;if(e=w===s.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left&&1===C&&h>0?h+1:h,w===s.options.currencySymbolPlacement.prefix)i=r-x;else switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:i=r-(x+h);break;case s.options.negativePositiveSignPlacement.right:i=h>0?r-(h+C+x):r-(h+x);break;default:i=r-(h+x)}return n.setElementSelection(this.domElement,e,i),this}},{key:"selectInteger",value:function(){var e=0,i=this.rawValue>=0;this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&i||!i&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left)&&(e+=1),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(e+=this.settings.currencySymbol.length);var a=n.getElementValue(this.domElement),r=a.indexOf(this.settings.decimalCharacter);return-1===r&&(r=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?a.length-this.settings.currencySymbol.length:a.length,i||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||(r-=1),r-=this.settings.suffixText.length),n.setElementSelection(this.domElement,e,r),this}},{key:"selectDecimal",value:function(){var e,a=n.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return-1===a?(a=0,e=0):e=(a+=1)+Number(this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur),n.setElementSelection(this.domElement,a,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(i)?this.domElement:i.node(),this._removeFromLocalList(e),this}},{key:"attach",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this._addToLocalList(e.node()),i&&e.update(this.settings),this}},{key:"formatOther",value:function(e){return this._formatOrUnformatOther(!0,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"unformatOther",value:function(e){return this._formatOrUnformatOther(!1,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"_formatOrUnformatOther",value:function(e,i){var a,r,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(a=n.isNull(h)?this.settings:this._cloneAndMergeSettings(h),n.isElement(i)){var w=n.getElementValue(i);return r=e?s.format(w,a):s.unformat(w,a),n.setElementValue(i,r),null}return e?s.format(i,a):s.unformat(i,a)}},{key:"init",value:function(e){var i=this,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!1,h=[];if(n.isString(e)?h=Y(document.querySelectorAll(e)):n.isElement(e)?(h.push(e),r=!0):n.isArray(e)?h=e:n.throwError("The given parameters to the 'init' function are invalid."),0===h.length)return n.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var w=this._getLocalList(),C=[];return h.forEach(function(x){var Z=i.settings.createLocalList;a&&(i.settings.createLocalList=!1);var p=new s(x,n.getElementValue(x),i.settings);a&&(p._setLocalList(w),i._addToLocalList(x,p),i.settings.createLocalList=Z),C.push(p)}),r?C[0]:C}},{key:"clear",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.set("",{emptyInputBehavior:s.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(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||n.isUndefinedOrNullOrEmpty(this.parentForm)){var e=this._getParentForm();if(!n.isNull(e)&&e!==this.parentForm){var i=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=i.length,this._hasFormHandlerFunction(e)?this._incrementParentFormCounter(e):(this._storeFormHandlerFunction(e),this._initializeFormCounterToOne(e))}this.parentForm=e}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var i=this,a=Y(e.elements),r=this._getContenteditableElements(e);return n.arrayUnique(a,r).filter(function(h){return i.constructor.isManagedByAutoNumeric(h)})}},{key:"_getContenteditableElements",value:function(e){if(n.isUndefinedOrNullOrEmpty(e)||!e.hasAttribute("id"))return[];var i=Y(e.querySelectorAll("[contenteditable=true]")),a=Y(document.querySelectorAll("*:not(input)[form=".concat(e.id,"][contenteditable=true]")));return n.arrayUnique(i,a)}},{key:"_getParentForm",value:function(){if(!n.isUndefined(this.domElement.form))return this.domElement.form;if("body"===this.domElement.tagName.toLowerCase())return null;var e,i=this.domElement;do{if(n.isNull(i=i.parentNode))return null;if("body"===(e=i.tagName?i.tagName.toLowerCase():""))break}while("form"!==e);return"form"===e?i:null}},{key:"formNumericString",value:function(){return this.constructor._serializeNumericString(this.form(),this.settings.serializeSpaces)}},{key:"formFormatted",value:function(){return this.constructor._serializeFormatted(this.form(),this.settings.serializeSpaces)}},{key:"formLocalized",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,e)}},{key:"formArrayNumericString",value:function(){return this.constructor._serializeNumericStringArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayFormatted",value:function(){return this.constructor._serializeFormattedArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayLocalized",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,e)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(){return JSON.stringify(this.formArrayLocalized(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformat()}),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformatLocalized()}),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).reformat()}),this}},{key:"formSubmitNumericString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n.isNull(e)?(this.formUnformat(),this.form().submit(),this.formReformat()):n.isFunction(e)?e(this.formNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n.isNull(e)?this.form().submit():n.isFunction(e)?e(this.formFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.isNull(i)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):n.isFunction(i)?i(this.formLocalized(e)):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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];le.apply(void 0,[this.settings].concat(i))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return le.apply(void 0,[e,this.settings].concat(a)),e}},{key:"_updatePredefinedOptions",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.isNull(i)?this.update(e):(this._mergeSettings(e,i),this.update(this.settings)),this}},{key:"french",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().French,e),this}},{key:"northAmerican",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().NorthAmerican,e),this}},{key:"british",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().British,e),this}},{key:"swiss",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Swiss,e),this}},{key:"japanese",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Japanese,e),this}},{key:"spanish",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Spanish,e),this}},{key:"chinese",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Chinese,e),this}},{key:"brazilian",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Brazilian,e),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];if("function"==typeof i)this.settings[e]=i(this,e);else{var a="";e in this.domElement.dataset&&(a=this.domElement.dataset[e]),a=n.camelize(a),"function"==typeof this.settings[a]&&(this.settings[e]=a(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.right)}},{key:"_modifyNegativeSignAndDecimalCharacterForRawValue",value:function(e){return"."!==this.settings.decimalCharacter&&(e=e.replace(this.settings.decimalCharacter,".")),"-"!==this.settings.negativeSignCharacter&&this.settings.isNegativeSignAllowed&&(e=e.replace(this.settings.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}},{key:"_initialCaretPosition",value:function(e){n.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===s.options.selectOnFocus.doNotSelect&&n.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var i=this.rawValue<0,a=n.isZeroOrHasNoValue(e),r=e.length,h=0,w=0,C=!1,x=0;this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.start&&(h=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,C=n.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalRight||(C?(w=e.indexOf(this.settings.decimalCharacter),x=this.settings.decimalCharacter.length):(w=h,x=0)));var Z="";i?Z=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!a&&(Z=this.settings.positiveSignCharacter);var p,V=Z.length,j=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:p=V+j;break;case s.options.negativePositiveSignPlacement.suffix:p=j}else p=j;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:p=r;break;case s.options.negativePositiveSignPlacement.suffix:p=j+h}else p=r;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:p=V+j+w;break;case s.options.negativePositiveSignPlacement.suffix:p=j+w}else p=j+w;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:p=V+j+w+x;break;case s.options.negativePositiveSignPlacement.suffix:p=j+w+x}else p=j+w+x}else if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:p=0;break;case s.options.negativePositiveSignPlacement.prefix:p=V}else p=0;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:p=h;break;case s.options.negativePositiveSignPlacement.prefix:p=V+h}else p=h;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:p=w;break;case s.options.negativePositiveSignPlacement.prefix:p=V+w}else p=w;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:p=w+x;break;case s.options.negativePositiveSignPlacement.prefix:p=V+w+x}else p=w+x;return p}},{key:"_triggerRangeEvents",value:function(e,i){e||this._triggerEvent(s.events.minRangeExceeded,this.domElement),i||this._triggerEvent(s.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?n.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(s.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(s.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(e){if(this.settings.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid){var i=this.constructor._isMinimumRangeRespected(e,this.settings),a=this.constructor._isMaximumRangeRespected(e,this.settings);i&&a?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(i,a)}}},{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!==s.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&&sessionStorage.setItem(this.rawValueStorageName,this.rawValue)}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?sessionStorage.getItem(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(){this.settings.saveValueToSessionStorage&&sessionStorage.removeItem(this.rawValueStorageName)}},{key:"_getDefaultValue",value:function(e){var i=e.getAttribute("value");return n.isNull(i)?"":i}},{key:"_onFocusInAndMouseEnter",value:function(e){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&"mouseenter"===e.type&&e.altKey)this.constructor._unformatAltHovered(this);else if("focus"===e.type&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),"focus"===e.type&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),"focus"===e.type||"mouseenter"===e.type&&!this.isFocused){var i=null;this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus&&this.rawValue<0&&null!==this.settings.negativeBracketsTypeOnBlur&&this.settings.isNegativeSignAllowed&&(i=this.constructor._removeBrackets(n.getElementValue(this.domElement),this.settings));var a=this._getRawValueToFormat(this.rawValue);if(""!==a){var r=this.constructor._roundFormattedValueShownOnFocusOrBlur(a,this.settings,this.isFocused);this.settings.showOnlyNumbersOnFocus===s.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",i=r.replace(".",this.settings.decimalCharacter)):i=n.isNull(r)?"":this.constructor._addGroupSeparators(r.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,a)}this.valueOnFocus=n.isNull(i)?"":i,this.lastVal=this.valueOnFocus;var h=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),w=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),C=h&&""!==w&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus;C&&(i=w),n.isNull(i)||this._setElementValue(i),C&&w===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&n.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():n.isNull(this.settings.caretPositionOnFocus)||n.setElementSelection(e.target,this._initialCaretPosition(n.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,n.setElementValue(this.domElement,"="),n.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,i=n.getElementValue(this.domElement);i=i.replace(/^\s*=/,"");try{var a=new ne(i,this.settings.decimalCharacter);e=(new S).evaluate(a)}catch{return this._triggerEvent(s.events.invalidFormula,this.domElement,{formula:i,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(s.events.validFormula,this.domElement,{formula:i,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===v.keyName.Backspace||this.eventKey===v.keyName.Delete||this.eventKey===v.keyName.LeftArrow||this.eventKey===v.keyName.RightArrow||this.eventKey===v.keyName.Home||this.eventKey===v.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===v.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===v.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else{if(this.eventKey===v.keyName.Equal)return void this._enterFormulaMode();if(this.settings.modifyValueOnUpDownArrow&&(this.eventKey===v.keyName.UpArrow||this.eventKey===v.keyName.DownArrow))return void this.upDownArrowAction(e)}if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===v.keyName.Esc&&(e.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(s.events.native.input,e.target)),this.select());var i=n.getElementValue(e.target);if(this.eventKey===v.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(s.events.native.change,e.target),this.valueOnFocus=i,this.rawValueOnFocus=this.rawValue,this.settings.isCancellable&&this._saveCancellableValue()),this._updateInternalProperties(e),this._processNonPrintableKeysAndShortcuts(e))this.processed=!0;else if(this.eventKey===v.keyName.Backspace||this.eventKey===v.keyName.Delete){var a=this._processCharacterDeletion(e);if(this.processed=!0,!a)return void e.preventDefault();this._formatValue(e),(i=n.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(s.events.native.input,e.target),e.preventDefault()),this.lastVal=i,this.throwInput=!0}}}else this.constructor._unformatAltHovered(this)}},{key:"_onKeypress",value:function(e){if(this.formulaMode){if(this._acceptNonPrintableKeysInFormulaMode()||this.settings.formulaChars.test(this.eventKey))return;e.preventDefault()}else if(this.eventKey!==v.keyName.Insert){var i=this.processed;if(this._updateInternalProperties(e),!this._processNonPrintableKeysAndShortcuts(e))if(i)e.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(e);var a=n.getElementValue(e.target);if(a!==this.lastVal&&this.throwInput)this._triggerEvent(s.events.native.input,e.target),e.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&n.getElementSelection(e.target).start===n.getElementSelection(e.target).end&&n.getElementSelection(e.target).start===a.indexOf(this.settings.decimalCharacter)){var r=n.getElementSelection(e.target).start+1;n.setElementSelection(e.target,r)}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===v.keyName.Esc)e.preventDefault();else{if(this._updateEventKeyInfo(e),this.eventKey===v.keyName.Z||this.eventKey===v.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),this._historyTableUndo(),void this._triggerEvent(s.events.native.input,e.target);this.onGoingRedo=!1}}else if((this.eventKey===v.keyName.Y||this.eventKey===v.keyName.y)&&e.ctrlKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&this.eventKey===v.keyName.x){var i=n.getElementSelection(this.domElement).start,a=this.constructor._toNumericValue(n.getElementValue(e.target),this.settings);this.set(a),this._setCaretPosition(i)}if(this.eventKey===v.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==v.keyName.Backspace&&this.eventKey!==v.keyName.Delete){this._updateInternalProperties(e);var r=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var h=n.getElementValue(e.target);if(!(r||""===h&&""===this.initialValueOnFirstKeydown)&&(h===this.settings.currencySymbol?n.setElementSelection(e.target,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?0:this.settings.currencySymbol.length):this.eventKey===v.keyName.Tab&&n.setElementSelection(e.target,0,h.length),(h===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(),h!==this.initialValueOnFirstKeydown&&this._triggerEvent(s.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:h,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),this.historyTable.length>1)){var w=n.getElementSelection(this.domElement);this.selectionStart=w.start,this.selectionEnd=w.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var C=n.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,C))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===v.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===s.options.showOnlyNumbersOnFocus.onlyNumbers&&(this.settings.digitGroupSeparator=this.originalDigitGroupSeparator,this.settings.currencySymbol=this.originalCurrencySymbol,this.settings.suffixText=this.originalSuffixText);var i=this._getRawValueToFormat(this.rawValue),a=n.isNull(i),r=J(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),h=r[0],w=r[1],C=!1;if(""===i||a||(this._triggerRangeEvents(h,w),this.settings.valuesToStrings&&this._checkValuesToStrings(i)&&(this._setElementValue(this.settings.valuesToStrings[i]),C=!0)),!C){var x;if(x=a||""===i?i:String(i),""===i||a){if(""===i)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:this._setRawValue("0"),x=this.constructor._roundValue("0",this.settings,0);break;case s.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),x=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case s.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),x=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:n.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),x=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else h&&w&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(i,this.settings)?(x=this._modifyNegativeSignAndDecimalCharacterForRawValue(x),this.settings.divisorWhenUnfocused&&!n.isNull(x)&&(x=(x/=this.settings.divisorWhenUnfocused).toString()),x=this.constructor._roundFormattedValueShownOnBlur(x,this.settings),x=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(x,this.settings)):this._triggerRangeEvents(h,w);var Z=this.constructor._orderValueCurrencySymbolAndSuffixText(x,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(x,this.settings)||a&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.null||(Z=this.constructor._addGroupSeparators(x,this.settings,!1,i)),Z===i&&""!==i&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&""!==i&&null!==i&&(Z="".concat(Z).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(Z))}this._setValidOrInvalidState(this.rawValue),"blur"===e.type&&this._onBlur(e)}}},{key:"_onPaste",value:function(e){if(e.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i,a;e.clipboardData&&e.clipboardData.getData?i=e.clipboardData.getData("text/plain"):n.throwError("Unable to retrieve the pasted value. Please use a modern browser (i.e. Firefox or Chromium).");var r=n.getElementValue(a=e.target.tagName?e.target:e.explicitOriginalTarget),h=a.selectionStart||0,w=a.selectionEnd||0,C=w-h;if(C===r.length){var x=this._preparePastedText(i),Z=n.arabicToLatinNumbers(x,!1,!1,!1);return"."===Z||""===Z||"."!==Z&&!n.isNumber(Z)?(this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")))):(this.set(Z),this.formatted=!0,void this._triggerEvent(s.events.native.input,a))}var p=n.isNegativeStrict(i,this.settings.negativeSignCharacter);p&&(i=i.slice(1,i.length));var V,j,q=this._preparePastedText(i);if("."!==(V="."===q?".":n.arabicToLatinNumbers(q,!1,!1,!1))&&(!n.isNumber(V)||""===V))return this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")));var H,$,oe=n.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);p&&!oe?(oe=!0,H=!0):H=!1;var de=r.slice(0,h),he=r.slice(w,r.length);$=this._preparePastedText(h!==w?de+he:r),oe&&($=n.setRawNegativeSign($)),j=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,h,this.settings.decimalCharacter)),H&&j++;var se=$.slice(0,j),we=$.slice(j,$.length),Me=!1;"."===V&&(n.contains(se,".")&&(Me=!0,se=se.replace(".","")),we=we.replace(".",""));var ze=!1;switch(""===se&&"-"===we&&(se="-",we="",ze=!0),this.settings.onInvalidPaste){case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:for(var tt=n.parseStr(this.settings.minimumValue),nt=n.parseStr(this.settings.maximumValue),Oe=$,Ee=0,ut=se;Ee<V.length&&($=(ut+=V[Ee])+we,this.constructor._checkIfInRange($,tt,nt));)Oe=$,Ee++;if(j+=Ee,ze&&j++,this.settings.onInvalidPaste===s.options.onInvalidPaste.truncate){$=Oe,Me&&j--;break}for(var Ne=j,ct=Oe.length;Ee<V.length&&Ne<ct;)if("."!==Oe[Ne]){if($=n.replaceCharAt(Oe,Ne,V[Ee]),!this.constructor._checkIfInRange($,tt,nt))break;Oe=$,Ee++,Ne++}else Ne++;j=Ne,Me&&j--,$=Oe;break;default:if($="".concat(se).concat(V).concat(we),h===w)j=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,h,this.settings.decimalCharacter))+V.length;else if(""===we)j=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,h,this.settings.decimalCharacter))+V.length,ze&&j++;else{var dt=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,w,this.settings.decimalCharacter)),ht=n.getElementValue(a).slice(h,w);j=dt-C+n.countCharInText(this.settings.digitGroupSeparator,ht)+V.length}H&&j++,Me&&j--}if(n.isNumber($)&&""!==$){var De=!1,it=!1;try{this.set($),De=!0}catch{var Ie;switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:Ie=n.clampToRangeLimits($,this.settings);try{this.set(Ie)}catch{n.throwError("Fatal error: Unable to set the clamped value '".concat(Ie,"'."))}it=!0,De=!0,$=Ie;break;case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:n.throwError("The pasted value '".concat(i,"' results in a value '").concat($,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));default:return}}var rt,Le=n.getElementValue(a);if(De)switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:if(it){n.setElementSelection(a,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?Le.length-this.settings.currencySymbol.length:Le.length);break}default:rt=n.findCaretPositionInFormattedNumber($,j,Le,this.settings.decimalCharacter),n.setElementSelection(a,rt)}De&&r!==Le&&this._triggerEvent(s.events.native.input,a)}else this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' would result into an invalid content '").concat($,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,n.trimPaddedZerosFromDecimalPlaces(this.rawValue)!==n.trimPaddedZerosFromDecimalPlaces(this.rawValueOnFocus)&&this._triggerEvent(s.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_wheelAndUpDownActions",value:function(e,i,a,r){var h,w=e.target.selectionStart||0,C=e.target.selectionEnd||0,x=this.rawValue;if(h=+(h=n.isUndefinedOrNullOrEmpty(x)?this.settings.minimumValue>0||this.settings.maximumValue<0?i?this.settings.minimumValue:this.settings.maximumValue:0:x),n.isNumber(r)){var Z=+r;i?h+=Z:a&&(h-=Z)}else i?h=n.addAndRoundToNearestAuto(h,this.settings.decimalPlacesRawValue):a&&(h=n.subtractAndRoundToNearestAuto(h,this.settings.decimalPlacesRawValue));(h=n.clampToRangeLimits(h,this.settings))!==+x&&(this.set(h),this._triggerEvent(s.events.native.input,e.target)),e.preventDefault(),this._setSelection(w,C)}},{key:"upDownArrowAction",value:function(e){if(!(this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i=!1,a=!1;this.eventKey===v.keyName.UpArrow?i=!0:this.eventKey===v.keyName.DownArrow?a=!0:n.throwError("Something has gone wrong since neither an Up or Down arrow key is detected, but the function was still called!"),this._wheelAndUpDownActions(e,i,a,this.settings.upDownStep)}}},{key:"_onWheel",value:function(e){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===s.options.wheelOn.focus?this.isFocused?e.shiftKey||this.wheelAction(e):e.shiftKey&&this.wheelAction(e):this.settings.wheelOn===s.options.wheelOn.hover?e.shiftKey?(e.preventDefault(),window.scrollBy(0,n.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):n.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var i=!1,a=!1;n.isWheelUpEvent(e)?i=!0:n.isWheelDownEvent(e)?a=!0:n.throwError("The event is not a 'wheel' event."),this._wheelAndUpDownActions(e,i,a,this.settings.wheelStep),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){this.isDropEvent=!0,e.preventDefault();var i=e.dataTransfer.getData("text/plain"),a=this.unformatOther(i),r=this.rawValue;this.set(a),this.isDropEvent=!1;var h=this.constructor._toNumericValue(a,this.settings);isNaN(Number(h))||n.trimPaddedZerosFromDecimalPlaces(r)!==n.trimPaddedZerosFromDecimalPlaces(h)&&this._triggerEvent(s.events.native.change,this.domElement)}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){return i._unformatOnSubmit()}),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){var a=e._getDefaultValue(i.node());setTimeout(function(){return i.set(a)},0)})}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(e){if(n.character(e)===v.keyName.Alt){var i=n.getHoveredElement();if(s.isManagedByAutoNumeric(i)){var a=s.getAutoNumericElement(i);!a.formulaMode&&a.settings.unformatOnHover&&this.constructor._unformatAltHovered(a)}}}},{key:"_onKeyupGlobal",value:function(e){if(n.character(e)===v.keyName.Alt){var i=n.getHoveredElement();if(s.isManagedByAutoNumeric(i)){var a=s.getAutoNumericElement(i);if(a.formulaMode||!a.settings.unformatOnHover)return;this.constructor._reformatAltHovered(a)}}}},{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._isContentEditable(this.domElement))}},{key:"_isContentEditable",value:function(e){return e.hasAttribute("contenteditable")&&"true"===e.getAttribute("contenteditable")}},{key:"_formatDefaultValueOnPageLoad",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=!0;if(n.isNull(i)?(e=n.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",e)):e=i,this.isInputElement||this.isContentEditable){var r=this.constructor._toNumericValue(e,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==e||null===this.settings.defaultValueOverride&&""!==e&&e!==this.domElement.getAttribute("value")||""!==e&&"hidden"===this.domElement.getAttribute("type")&&!n.isNumber(r)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var h=this.constructor._removeBrackets(e,this.settings);(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&""!==this.settings.negativeSignCharacter&&n.isNegative(e,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(h,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(h,this.settings,!0,this.isFocused))}a=!1}}else isNaN(Number(r))||r===1/0?n.throwError("The value [".concat(e,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(r),a=!1);if(""===e)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:break;case s.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case s.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case s.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case s.options.emptyInputBehavior.zero:this.set("0");break;case s.options.emptyInputBehavior.null:this.set(null);break;default:this.set(this.settings.emptyInputBehavior)}else a&&e===this.domElement.getAttribute("value")&&this.set(e)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==e||this.set(e)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=J(this.settings.maximumValue.toString().split("."),1)[0],i=J(this.settings.minimumValue||0===this.settings.minimumValue?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),i=i.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(i.length,1)}},{key:"_calculateValuesToStringsKeys",value:function(){this.valuesToStringsKeys=this.settings.valuesToStrings?Object.keys(this.settings.valuesToStrings):[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];"true"!==i&&"false"!==i||(this.settings[e]="true"===i),"number"==typeof i&&(this.settings[e]=i.toString())}}},{key:"_setSettings",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!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=v.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,i){e=Math.max(e,0),i=Math.min(i,n.getElementValue(this.domElement).length),this.selection={start:e,end:i,length:i-e},n.setElementSelection(this.domElement,e,i)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=n.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=J(this._getLeftAndRightPartAroundTheSelection(),2),i=e[0],a=e[1];if(""===i&&""===a)return["",""];var r=!0;return this.eventKey!==v.keyName.Hyphen&&this.eventKey!==v.keyName.Minus||0!==Number(i)||(r=!1),this.isTrailingNegative&&(n.isNegative(a,this.settings.negativeSignCharacter)&&!n.isNegative(i,this.settings.negativeSignCharacter)||""===a&&n.isNegative(i,this.settings.negativeSignCharacter,!0))&&(i=i.replace(this.settings.negativeSignCharacter,""),a=a.replace(this.settings.negativeSignCharacter,""),i=i.replace("-",""),a=a.replace("-",""),i="-".concat(i)),[i=s._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,r,this.isFocused),a=s._stripAllNonNumberCharactersExceptCustomDecimalChar(a,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,i){var a=!0;this.eventKey!==v.keyName.Hyphen&&this.eventKey!==v.keyName.Minus||0!==Number(e)||(a=!1),this.isTrailingNegative&&n.isNegative(i,this.settings.negativeSignCharacter)&&!n.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),i=i.replace(this.settings.negativeSignCharacter,"")),e=s._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,a,this.isFocused),i=s._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,!1,this.isFocused),this.settings.leadingZero!==s.options.leadingZero.deny||this.eventKey!==v.keyName.num0&&this.eventKey!==v.keyName.numpad0||0!==Number(e)||n.contains(e,this.settings.decimalCharacter)||""===i||(e=e.substring(0,e.length-1));var r=e+i;if(this.settings.decimalCharacter){var h=r.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));h&&(r=(e=e.replace(h[1],h[1]+"0"))+i)}return[e,i,r]}},{key:"_setValueParts",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=J(this._normalizeParts(e,i),3),h=r[0],w=r[1],C=r[2],x=J(s._checkIfInRangeWithOverrideOption(C,this.settings),2),Z=x[0],p=x[1];if(Z&&p){var V=s._truncateDecimalPlaces(C,this.settings,a,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(""===V||V===this.settings.negativeSignCharacter){var j;switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:j="";break;case s.options.emptyInputBehavior.min:j=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:j=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:j="0";break;case s.options.emptyInputBehavior.null:j=null;break;default:j=this.settings.emptyInputBehavior}this._setRawValue(j)}else this._setRawValue(this._trimLeadingAndTrailingZeros(V));var q=s._truncateDecimalPlaces(C,this.settings,a,this.settings.decimalPlacesShownOnFocus),H=h.length;return H>q.length&&(H=q.length),1===H&&"0"===h&&this.settings.leadingZero===s.options.leadingZero.deny&&(H=""===w||"0"===h&&""!==w?1:0),this._setElementValue(q,!1),this._setCaretPosition(H),!0}return this._triggerRangeEvents(Z,p),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var i=this.settings.currencySymbol.length,a=n.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&a&&a.charAt(0)===this.settings.negativeSignCharacter?[1,i+1]:[0,i];else{var r=a.length;e=[r-i,r]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=J(this._getSignPosition(),2),i=e[0],a=e[1],r=this.selection;r.start<a&&r.end>i&&((r.start<i||r.end>a)&&n.getElementValue(this.domElement).substring(Math.max(r.start,i),Math.min(r.end,a)).match(/^\s*$/)?r.start<i?this._setSelection(r.start,i):this._setSelection(a,r.end):this._setSelection(Math.min(r.start,i),Math.max(r.end,a)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!n.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,i=J(this._getLeftAndRightPartAroundTheSelection(),2),a=i[0],r=i[1];delete this.valuePartsBeforePaste;var h=a.substr(0,e[0].length)+s._stripAllNonNumberCharactersExceptCustomDecimalChar(a.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(h,r,!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===v.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===v.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===v.keyName.c||this.eventKey===v.keyName.v||this.eventKey===v.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==v.keyName.v&&this.eventKey!==v.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===v.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===v.keyName.Z||this.eventKey===v.keyName.z);if(this.eventKey===v.keyName.LeftArrow||this.eventKey===v.keyName.RightArrow){if("keydown"===e.type&&!e.shiftKey){var i=n.getElementValue(this.domElement);this.eventKey!==v.keyName.LeftArrow||i.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==v.keyName.RightArrow||i.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start+1)!==this.settings.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)}return!0}return n.isInArray(this.eventKey,v.keyName._directionKeys)}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var i=J(e,2),a=i[0],r=i[1],h=n.getElementValue(this.domElement),w=n.isNegative(h,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix&&(this.eventKey===v.keyName.Backspace?(this.caretFix=this.selection.start>=h.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===h.charAt(this.selection.start-1)?a=a.substring(1):this.selection.start<=h.length-this.settings.suffixText.length&&(a=a.substring(0,a.length-1))):(this.caretFix=this.selection.start>=h.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,this.selection.start>=h.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(r=r.substring(1,r.length)),n.isNegative(a,this.settings.negativeSignCharacter)&&"-"===h.charAt(this.selection.start)&&(a=a.substring(1)))),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===v.keyName.Backspace?this.selection.start===h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&w?a=a.substring(1):"-"!==a&&(this.selection.start<=h.indexOf(this.settings.negativeSignCharacter)||!w)&&(a=a.substring(0,a.length-1)):("-"===a[0]&&(r=r.substring(1)),this.selection.start===h.indexOf(this.settings.negativeSignCharacter)&&w&&(a=a.substring(1)));break;case s.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===v.keyName.Backspace?this.selection.start===h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?a=a.substring(1):"-"!==a&&this.selection.start<=h.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length?a=a.substring(0,a.length-1):""===a||w||(a=a.substring(0,a.length-1)):(this.caretFix=this.selection.start>=h.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===h.indexOf(this.settings.negativeSignCharacter)&&(a=a.substring(1)),r=r.substring(1))}return[a,r]}},{key:"_processCharacterDeletion",value:function(e){var i,a;if(this.selection.length){this._expandSelectionOnSign();var r=J(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);i=r[0],a=r[1]}else{var h=J(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(a=h[1],""===(i=h[0])&&""===a&&(this.throwInput=!1),this.isTrailingNegative&&n.isNegative(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var w=J(this._processCharacterDeletionIfTrailingNegativeSign([i,a]),2);i=w[0],a=w[1]}else this.eventKey===v.keyName.Backspace?i=i.substring(0,i.length-1):a=a.substring(1,a.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(i).concat(a),this.settings)&&n.getElementValue(e.target)!==this.settings.currencySymbol&&(this._setValueParts(i,a),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(s.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(s.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=J(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),i=e[0],a=e[1];if(this.eventKey!==v.keyName.AndroidDefault&&(this.throwInput=!0),this.eventKey===this.settings.decimalCharacter||this.settings.decimalCharacterAlternative&&this.eventKey===this.settings.decimalCharacterAlternative){if(!this._isDecimalCharacterInsertionAllowed()||!this.settings.decimalCharacter)return!1;if(this.settings.alwaysAllowDecimalCharacter)i=i.replace(this.settings.decimalCharacter,""),a=a.replace(this.settings.decimalCharacter,"");else{if(n.contains(i,this.settings.decimalCharacter)||a.indexOf(this.settings.decimalCharacter)>0)return!0;0===a.indexOf(this.settings.decimalCharacter)&&(a=a.substr(1))}return this.settings.negativeSignCharacter&&n.contains(a,this.settings.negativeSignCharacter)&&(i="".concat(this.settings.negativeSignCharacter).concat(i),a=a.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(i+this.settings.decimalCharacter,a),!0}if(("-"===this.eventKey||"+"===this.eventKey)&&this.settings.isNegativeSignAllowed)return""===i&&n.contains(a,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&"+"===this.eventKey)&&(a=a.replace("-","")):n.isNegativeStrict(i,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&"+"===this.eventKey)&&(i=i.replace("-","")):(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&"-"===this.eventKey)&&(i="".concat(this.settings.negativeSignCharacter).concat(i)),this._setValueParts(i,a),!0;var r=Number(this.eventKey);return r>=0&&r<=9?(this.settings.isNegativeSignAllowed&&""===i&&n.contains(a,"-")&&(i="-",a=a.substring(1,a.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!n.contains(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&"0"!==this.eventKey&&(i="-".concat(i)),this._setValueParts("".concat(i).concat(this.eventKey),a),!0):(this.throwInput=!1,!1)}},{key:"_formatValue",value:function(e){var i=n.getElementValue(this.domElement),a=J(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((""===this.settings.digitGroupSeparator||""!==this.settings.digitGroupSeparator&&!n.contains(i,this.settings.digitGroupSeparator))&&(""===this.settings.currencySymbol||""!==this.settings.currencySymbol&&!n.contains(i,this.settings.currencySymbol))){var r=J(i.split(this.settings.decimalCharacter),1)[0],h="";n.isNegative(r,this.settings.negativeSignCharacter)&&(h=this.settings.negativeSignCharacter,r=r.replace(this.settings.negativeSignCharacter,""),a=a.replace("-","")),""===h&&r.length>this.settings.mIntPos&&"0"===a.charAt(0)&&(a=a.slice(1)),h===this.settings.negativeSignCharacter&&r.length>this.settings.mIntNeg&&"0"===a.charAt(0)&&(a=a.slice(1)),this.isTrailingNegative||(a="".concat(h).concat(a))}var w=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue),C=w.length;if(w){var x,Z=a.split("");if((this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&Z[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(Z.shift(),(this.eventKey===v.keyName.Backspace||this.eventKey===v.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix)&&(Z.push(this.settings.negativeSignCharacter),this.caretFix="keydown"===e.type),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.right))){var p=this.settings.currencySymbol.split(""),V=["\\","^","$",".","|","?","*","+","(",")","["],j=[];p.forEach(function($,oe){n.isInArray(oe=p[$],V)?j.push("\\"+oe):j.push(oe)}),this.eventKey===v.keyName.Backspace&&"-"===this.settings.negativeSignCharacter&&j.push("-"),Z.push(j.join("")),this.caretFix="keydown"===e.type}for(var q=0;q<Z.length;q++)Z[q].match("\\d")||(Z[q]="\\"+Z[q]);x=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(Z.join(".*?"))):new RegExp("^.*?[".concat(this.settings.currencySymbol,"]*").concat(Z.join(".*?")));var H=w.match(x);H?(C=H[0].length,this.settings.showPositiveSign&&(0===C&&H.input.charAt(0)===this.settings.positiveSignCharacter&&(C=1===H.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===C&&H.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(C=this.settings.currencySymbol.length+1)),(0===C&&w.charAt(0)!==this.settings.negativeSignCharacter||1===C&&w.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(C=this.settings.currencySymbol.length+(n.isNegativeStrict(w,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(C-=this.settings.currencySymbol.length),this.settings.suffixText&&(C-=this.settings.suffixText.length))}w!==i&&(this._setElementValue(w,!1),this._setCaretPosition(C)),this.formatted=!0}}],B=[{key:"version",value:function(){return"4.10.0"}},{key:"_setArgumentsValues",value:function(e,i,a){n.isNull(e)&&n.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var r,h,w,C=n.isElement(e),x=n.isString(e),Z=n.isObject(i),p=Array.isArray(i)&&i.length>0,V=n.isNumberOrArabic(i)||""===i,j=this._isPreDefinedOptionValid(i),q=n.isNull(i),H=n.isEmptyString(i),$=n.isObject(a),oe=Array.isArray(a)&&a.length>0,de=n.isNull(a),he=this._isPreDefinedOptionValid(a);return C&&q&&de?(r=e,w=null,h=null):C&&V&&de?(r=e,w=i,h=null):C&&Z&&de?(r=e,w=null,h=i):C&&j&&de?(r=e,w=null,h=this._getOptionObject(i)):C&&p&&de?(r=e,w=null,h=this.mergeOptions(i)):C&&(q||H)&&$?(r=e,w=null,h=a):C&&(q||H)&&oe?(r=e,w=null,h=this.mergeOptions(a)):x&&q&&de?(r=document.querySelector(e),w=null,h=null):x&&Z&&de?(r=document.querySelector(e),w=null,h=i):x&&j&&de?(r=document.querySelector(e),w=null,h=this._getOptionObject(i)):x&&p&&de?(r=document.querySelector(e),w=null,h=this.mergeOptions(i)):x&&(q||H)&&$?(r=document.querySelector(e),w=null,h=a):x&&(q||H)&&oe?(r=document.querySelector(e),w=null,h=this.mergeOptions(a)):x&&V&&de?(r=document.querySelector(e),w=i,h=null):x&&V&&$?(r=document.querySelector(e),w=i,h=a):x&&V&&he?(r=document.querySelector(e),w=i,h=this._getOptionObject(a)):x&&V&&oe?(r=document.querySelector(e),w=i,h=this.mergeOptions(a)):C&&V&&$?(r=e,w=i,h=a):C&&V&&he?(r=e,w=i,h=this._getOptionObject(a)):C&&V&&oe?(r=e,w=i,h=this.mergeOptions(a)):n.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(i,"' and '").concat(a,"' given.")),n.isNull(r)&&n.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:r,initialValue:w,userOptions:h}}},{key:"mergeOptions",value:function(e){var i=this,a={};return e.forEach(function(r){le(a,i._getOptionObject(r))}),a}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(s.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var i;return n.isString(e)?null==(i=s.getPredefinedOptions()[e])&&n.warning("The given pre-defined option [".concat(e,"] is not recognized by autoNumeric. Please check that pre-defined option name."),!0):i=e,i}},{key:"_doesFormHandlerListExists",value:function(){var e=fe(window.aNFormHandlerMap);return"undefined"!==e&&"object"===e}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,i){return n.isInArray(String(e),i)}},{key:"_checkValuesToStringsSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.keys(i.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.values(i.valuesToStrings))}},{key:"_unformatAltHovered",value:function(e){e.hoveredWithAlt=!0,e.unformat()}},{key:"_reformatAltHovered",value:function(e){e.hoveredWithAlt=!1,e.reformat()}},{key:"_getChildANInputElement",value:function(e){var i=this,a=e.getElementsByTagName("input"),r=[];return Array.prototype.slice.call(a,0).forEach(function(h){i.test(h)&&r.push(h)}),r}},{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=fe(window[this.autoNumericGlobalListName]);return"undefined"!==e&&"object"===e}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var i=e.node();if(this._isInGlobalList(i)){if(this._getFromGlobalList(i)===this)return;n.warning("A reference to the DOM element you just initialized already exists in the global AutoNumeric element list. Please make sure to not initialize the same DOM element multiple times.",e.getSettings().showWarnings)}window[this.autoNumericGlobalListName].set(i,e)}},{key:"_removeFromGlobalList",value:function(e){this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].delete(e.node())}},{key:"_getFromGlobalList",value:function(e){return this._doesGlobalListExists()?window[this.autoNumericGlobalListName].get(e):null}},{key:"_isInGlobalList",value:function(e){return!!this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].has(e)}},{key:"validate",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!n.isUndefinedOrNullOrEmpty(e)&&n.isObject(e)||n.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var r,h=n.isObject(a);h||n.isNull(a)||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=i?le({},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 w,C=/^[0-9]+$/,x=/[0-9]+/,Z=/^-?[0-9]+(\.?[0-9]+)?$/,p=/^[0-9]+(\.?[0-9]+)?$/;n.isTrueOrFalseString(r.allowDecimalPadding)||n.isBoolean(r.allowDecimalPadding)||r.allowDecimalPadding===s.options.allowDecimalPadding.floats||n.isNumber(r.allowDecimalPadding)&&r.allowDecimalPadding>0||n.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true`, `'floats'` or a positive integer superior to 0, [".concat(r.allowDecimalPadding,"] given.")),n.isNumber(r.allowDecimalPadding)&&r.allowDecimalPadding>r.decimalPlaces&&n.warning("Setting 'allowDecimalPadding' to a number [".concat(r.allowDecimalPadding,"] superior to the current 'decimalPlaces' settings [").concat(r.decimalPlaces,"] is useless, since the padding will not be shown."),r.showWarnings),r.allowDecimalPadding!==s.options.allowDecimalPadding.never&&"false"!==r.allowDecimalPadding||r.decimalPlaces===s.options.decimalPlaces.none&&r.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.none&&r.decimalPlacesShownOnFocus===s.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,[s.options.caretPositionOnFocus.start,s.options.caretPositionOnFocus.end,s.options.caretPositionOnFocus.decimalLeft,s.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.")),w=h?a:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),n.isNull(w)||w.caretPositionOnFocus===s.options.caretPositionOnFocus.doNoForceCaretPosition||w.selectOnFocus!==s.options.selectOnFocus.select||n.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(w.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,[s.options.digitGroupSeparator.comma,s.options.digitGroupSeparator.dot,s.options.digitGroupSeparator.normalSpace,s.options.digitGroupSeparator.thinSpace,s.options.digitGroupSeparator.narrowNoBreakSpace,s.options.digitGroupSeparator.noBreakSpace,s.options.digitGroupSeparator.noSeparator,s.options.digitGroupSeparator.apostrophe,s.options.digitGroupSeparator.arabicThousandsSeparator,s.options.digitGroupSeparator.dotAbove,s.options.digitGroupSeparator.privateUseTwo])||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,[s.options.digitalGroupSpacing.two,s.options.digitalGroupSpacing.twoThree,s.options.digitalGroupSpacing.twoScaled,s.options.digitalGroupSpacing.three,s.options.digitalGroupSpacing.four])||r.digitalGroupSpacing>=2&&r.digitalGroupSpacing<=4||n.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2t', '2s', '3', or '4', [".concat(r.digitalGroupSpacing,"] given.")),n.isInArray(r.decimalCharacter,[s.options.decimalCharacter.comma,s.options.decimalCharacter.dot,s.options.decimalCharacter.middleDot,s.options.decimalCharacter.arabicDecimalSeparator,s.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,[s.options.currencySymbolPlacement.prefix,s.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,[s.options.negativePositiveSignPlacement.prefix,s.options.negativePositiveSignPlacement.suffix,s.options.negativePositiveSignPlacement.left,s.options.negativePositiveSignPlacement.right,s.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)||x.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)||x.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)||x.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 show 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.")),n.isTrueOrFalseString(r.negativePositiveSignBehavior)||n.isBoolean(r.negativePositiveSignBehavior)||n.throwError("The option 'negativePositiveSignBehavior' is invalid ; it should be either 'true' or 'false', [".concat(r.negativePositiveSignBehavior,"] given."));var V=J(n.isNull(r.negativeBracketsTypeOnBlur)?["",""]:r.negativeBracketsTypeOnBlur.split(","),2),j=V[0],q=V[1];(n.contains(r.digitGroupSeparator,r.negativeSignCharacter)||n.contains(r.decimalCharacter,r.negativeSignCharacter)||n.contains(r.decimalCharacterAlternative,r.negativeSignCharacter)||n.contains(j,r.negativeSignCharacter)||n.contains(q,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(j,r.positiveSignCharacter)||n.contains(q,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,[s.options.overrideMinMaxLimits.ceiling,s.options.overrideMinMaxLimits.floor,s.options.overrideMinMaxLimits.ignore,s.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!==s.options.overrideMinMaxLimits.invalid&&r.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.ignore&&(r.minimumValue>0||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 (i.e. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),n.isString(r.maximumValue)&&Z.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)&&Z.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)&&r.decimalPlaces>=0||n.isString(r.decimalPlaces)&&C.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)&&r.decimalPlacesRawValue>=0||n.isString(r.decimalPlacesRawValue)&&C.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)||C.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)||C.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,[s.options.onInvalidPaste.error,s.options.onInvalidPaste.ignore,s.options.onInvalidPaste.clamp,s.options.onInvalidPaste.truncate,s.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,[s.options.roundingMethod.halfUpSymmetric,s.options.roundingMethod.halfUpAsymmetric,s.options.roundingMethod.halfDownSymmetric,s.options.roundingMethod.halfDownAsymmetric,s.options.roundingMethod.halfEvenBankersRounding,s.options.roundingMethod.upRoundAwayFromZero,s.options.roundingMethod.downRoundTowardZero,s.options.roundingMethod.toCeilingTowardPositiveInfinity,s.options.roundingMethod.toFloorTowardNegativeInfinity,s.options.roundingMethod.toNearest05,s.options.roundingMethod.toNearest05Alt,s.options.roundingMethod.upToNext05,s.options.roundingMethod.downToNext05])||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,[s.options.negativeBracketsTypeOnBlur.parentheses,s.options.negativeBracketsTypeOnBlur.brackets,s.options.negativeBracketsTypeOnBlur.chevrons,s.options.negativeBracketsTypeOnBlur.curlyBraces,s.options.negativeBracketsTypeOnBlur.angleBrackets,s.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,s.options.negativeBracketsTypeOnBlur.halfBrackets,s.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,s.options.negativeBracketsTypeOnBlur.quotationMarks,s.options.negativeBracketsTypeOnBlur.guillemets])||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,[s.options.emptyInputBehavior.focus,s.options.emptyInputBehavior.press,s.options.emptyInputBehavior.always,s.options.emptyInputBehavior.min,s.options.emptyInputBehavior.max,s.options.emptyInputBehavior.zero,s.options.emptyInputBehavior.null])||Z.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===s.options.emptyInputBehavior.zero&&(r.minimumValue>0||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,"].")),Z.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,[s.options.leadingZero.allow,s.options.leadingZero.deny,s.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.")),C.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||Z.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,[s.options.outputFormat.string,s.options.outputFormat.number,s.options.outputFormat.dot,s.options.outputFormat.negativeDot,s.options.outputFormat.comma,s.options.outputFormat.negativeComma,s.options.outputFormat.dotNegative,s.options.outputFormat.commaNegative])||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.modifyValueOnUpDownArrow)||n.isBoolean(r.modifyValueOnUpDownArrow)||n.throwError("The increment/decrement on up and down arrow keys 'modifyValueOnUpDownArrow' is invalid ; it should be either 'true' or 'false', [".concat(r.modifyValueOnUpDownArrow,"] 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,[s.options.wheelOn.focus,s.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.upDownStep)&&!n.isNumber(r.upDownStep)||"progressive"!==r.upDownStep&&!p.test(r.upDownStep)||0===Number(r.upDownStep))&&n.throwError("The up/down arrow step value option 'upDownStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(r.upDownStep,"] 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,[s.options.serializeSpaces.plus,s.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(H){Object.prototype.hasOwnProperty.call(H,"callback")&&!n.isFunction(H.callback)&&n.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(fe(H.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 i=!0;try{this.validate(e,!0)}catch{i=!1}return i}},{key:"getDefaultConfig",value:function(){return s.defaultSettings}},{key:"getPredefinedOptions",value:function(){return s.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var i,a=this;return n.isUndefinedOrNullOrEmpty(e)||0===e.length?i=null:(i={},1===e.length&&Array.isArray(e[0])?e[0].forEach(function(r){le(i,a._getOptionObject(r))}):e.length>=1&&e.forEach(function(r){le(i,a._getOptionObject(r))})),i}},{key:"format",value:function(e){if(n.isUndefined(e)||null===e)return null;var i;i=n.isElement(e)?n.getElementValue(e):e,n.isString(i)||n.isNumber(i)||n.throwError('The value "'.concat(i,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var a=arguments.length,r=new Array(a>1?a-1:0),h=1;h<a;h++)r[h-1]=arguments[h];var w=this._generateOptionsObjectFromOptionsArray(r),C=le({},this.getDefaultConfig(),w);C.isNegativeSignAllowed=i<0,C.isPositiveSignAllowed=i>=0,this._setBrackets(C),this._cachesUsualRegularExpressions(C,{});var x=this._toNumericValue(i,C);return isNaN(Number(x))&&n.throwError("The value [".concat(x,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(x,C)||(n.triggerEvent(s.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(x,"] being set falls outside of the minimumValue [").concat(C.minimumValue,"] and maximumValue [").concat(C.maximumValue,"] range set for this element"))),C.valuesToStrings&&this._checkValuesToStringsSettings(i,C)?C.valuesToStrings[i]:(this._correctNegativePositiveSignPlacementOption(C),this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===x||null===x||(x*=C.rawValueDivisor),x=this._roundFormattedValueShownOnFocus(x,C),x=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(x,C),x=this._addGroupSeparators(x,C,!1,x))}},{key:"formatAndSet",value:function(e){var a=this.format(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return n.setElementValue(e,a),a}},{key:"unformat",value:function(e){if(n.isNumberStrict(e))return e;var i;if(""===(i=n.isElement(e)?n.getElementValue(e):e))return"";if(n.isUndefined(i)||null===i)return null;(n.isArray(i)||n.isObject(i))&&n.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(i,"] given."));for(var a=arguments.length,r=new Array(a>1?a-1:0),h=1;h<a;h++)r[h-1]=arguments[h];var w=this._generateOptionsObjectFromOptionsArray(r),C=le({},this.getDefaultConfig(),w);if(C.isNegativeSignAllowed=!1,C.isPositiveSignAllowed=!0,i=i.toString(),C.valuesToStrings&&this._checkStringsToValuesSettings(i,C))return n.objectKeyLookup(C.valuesToStrings,i);if(n.isNegative(i,C.negativeSignCharacter))C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1;else if(!n.isNull(C.negativeBracketsTypeOnBlur)){var x=J(C.negativeBracketsTypeOnBlur.split(","),2);C.firstBracket=x[0],C.lastBracket=x[1],i.charAt(0)===C.firstBracket&&i.charAt(i.length-1)===C.lastBracket&&(C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1,i=this._removeBrackets(i,C,!1))}return i=this._convertToNumericString(i,C),n.isNumber(Number(i))&&(i=n.scientificToDecimal(i)),new RegExp("[^+-0123456789.]","gi").test(i)?NaN:(this._correctNegativePositiveSignPlacementOption(C),C.originalDecimalPlacesRawValue=C.decimalPlacesRawValue?C.decimalPlacesRawValue:C.decimalPlaces,this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===i||null===i||(i/=C.rawValueDivisor),i=(i=this._roundRawValue(i,C)).replace(C.decimalCharacter,"."),i=this._toLocale(i,C.outputFormat,C))}},{key:"unformatAndSet",value:function(e){var a=this.unformat(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return n.setElementValue(e,a),a}},{key:"localize",value:function(e){var i,a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return""===(i=n.isElement(e)?n.getElementValue(e):e)?"":(n.isNull(r)&&(r=s.defaultSettings),i=this.unformat(i,r),0===Number(i)&&r.leadingZero!==s.options.leadingZero.keep&&(i="0"),a=n.isNull(r)?r.outputFormat:s.defaultSettings.outputFormat,this._toLocale(i,a,r))}},{key:"localizeAndSet",value:function(e){var a=this.localize(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return n.setElementValue(e,a),a}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var i=n.domElement(e);return this.isManagedByAutoNumeric(i)?this._getFromGlobalList(i):null}},{key:"set",value:function(e,i){var a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,h=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],w=n.domElement(e);return this.isManagedByAutoNumeric(w)?this.getAutoNumericElement(w).set(i,r,h):(a=!(!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.",a),null)}},{key:"getNumericString",value:function(e){return this._get(e,"getNumericString",arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"getFormatted",value:function(e){return this._get(e,"getFormatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"getNumber",value:function(e){return this._get(e,"getNumber",arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"_get",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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)[i](a)}},{key:"getLocalized",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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(i,a)}},{key:"_stripAllNonNumberCharacters",value:function(e,i,a,r){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,a,r).replace(i.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,i,a,r){var h=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(i.allowedAutoStrip,"")).match(i.numRegAutoStrip);if(e=h?[h[1],h[2],h[3]].join(""):"",i.leadingZero===s.options.leadingZero.allow||i.leadingZero===s.options.leadingZero.keep){var w="",C=J(e.split(i.decimalCharacter),2),Z=C[1],p=C[0];n.contains(p,i.negativeSignCharacter)&&(w=i.negativeSignCharacter,p=p.replace(i.negativeSignCharacter,"")),""===w&&p.length>i.mIntPos&&"0"===p.charAt(0)&&(p=p.slice(1)),""!==w&&p.length>i.mIntNeg&&"0"===p.charAt(0)&&(p=p.slice(1)),e="".concat(w).concat(p).concat(n.isUndefined(Z)?"":i.decimalCharacter+Z)}return(a&&i.leadingZero===s.options.leadingZero.deny||!r&&i.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(i.stripReg,"$1$2")),e}},{key:"_toggleNegativeBracket",value:function(e,i,a){return a?this._removeBrackets(e,i):this._addBrackets(e,i)}},{key:"_addBrackets",value:function(e,i){return n.isNull(i.negativeBracketsTypeOnBlur)?e:"".concat(i.firstBracket).concat(e.replace(i.negativeSignCharacter,"")).concat(i.lastBracket)}},{key:"_removeBrackets",value:function(e,i){var a,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n.isNull(i.negativeBracketsTypeOnBlur)||e.charAt(0)!==i.firstBracket?a=e:(a=(a=e.replace(i.firstBracket,"")).replace(i.lastBracket,""),r?(a=a.replace(i.currencySymbol,""),a=this._mergeCurrencySignNegativePositiveSignAndValue(a,i,!0,!1)):a="".concat(i.negativeSignCharacter).concat(a)),a}},{key:"_setBrackets",value:function(e){if(n.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var i=J(e.negativeBracketsTypeOnBlur.split(","),2),r=i[1];e.firstBracket=i[0],e.lastBracket=r}}},{key:"_convertToNumericString",value:function(e,i){e=this._removeBrackets(e,i,!1),e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(new RegExp("[".concat(i.digitGroupSeparator,"]"),"g"),""),"."!==i.decimalCharacter&&(e=e.replace(i.decimalCharacter,".")),n.isNegative(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-".concat(e)),i.showPositiveSign&&(e=e.replace(i.positiveSignCharacter,""));var r=n.arabicToLatinNumbers(e,i.leadingZero!==s.options.leadingZero.keep,!1,!1);return isNaN(r)||(e=r.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,i){return e=String(e),i.currencySymbol!==s.options.currencySymbol.none&&(e=e.replace(i.currencySymbol,"")),i.suffixText!==s.options.suffixText.none&&(e=e.replace(i.suffixText,"")),i.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen&&(e=e.replace(i.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,i,a){if(n.isNull(i)||i===s.options.outputFormat.string)return e;var r;switch(i){case s.options.outputFormat.number:r=Number(e);break;case s.options.outputFormat.dotNegative:r=n.isNegative(e)?e.replace("-","")+"-":e;break;case s.options.outputFormat.comma:case s.options.outputFormat.negativeComma:r=e.replace(".",",");break;case s.options.outputFormat.commaNegative:r=e.replace(".",","),r=n.isNegative(r)?r.replace("-","")+"-":r;break;case s.options.outputFormat.dot:case s.options.outputFormat.negativeDot:r=e;break;default:n.throwError("The given outputFormat [".concat(i,"] option is not recognized."))}return i!==s.options.outputFormat.number&&"-"!==a.negativeSignCharacter&&(r=r.replace("-",a.negativeSignCharacter)),r}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,i){return"-"!==i.negativeSignCharacter&&(e=e.replace("-",i.negativeSignCharacter)),"."!==i.decimalCharacter&&(e=e.replace(".",i.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,i){return""===e||e===i.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(e,i,a){var r;if(i.emptyInputBehavior===s.options.emptyInputBehavior.always||a)switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.none:r=e+i.currencySymbol+i.suffixText;break;default:r=i.currencySymbol+e+i.suffixText}else r=e;return r}},{key:"_addGroupSeparators",value:function(e,i,a,r){var h,w=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(h=n.isNull(w)?n.isNegative(e,i.negativeSignCharacter)||n.isNegativeWithBrackets(e,i.firstBracket,i.lastBracket):w<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,!1,a),this._isElementValueEmptyOrOnlyTheNegativeSign(e,i))return this._orderValueCurrencySymbolAndSuffixText(e,i,!0);var C=n.isZeroOrHasNoValue(e);h&&(e=e.replace("-",""));var x,Z=J(e.split(i.decimalCharacter),2),p=Z[0],V=Z[1];if(i.decimalCharacterAlternative&&n.isUndefined(V)){var j=J(e.split(i.decimalCharacterAlternative),2);p=j[0],V=j[1]}if(""!==i.digitGroupSeparator){var q;switch(i.digitalGroupSpacing=i.digitalGroupSpacing.toString(),i.digitalGroupSpacing){case s.options.digitalGroupSpacing.twoThree:q=/(\d)((\d)(\d{2}?)+)$/;break;case s.options.digitalGroupSpacing.twoScaled:q=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;default:q=new RegExp("(\\d)((\\d{".concat(i.digitalGroupSpacing,"}?)+)$"))}for(;q.test(p);)p=p.replace(q,"$1".concat(i.digitGroupSeparator,"$2"))}return 0===(x=a?i.decimalPlacesShownOnFocus:i.decimalPlacesShownOnBlur)||n.isUndefined(V)?e=p:(V.length>x&&(V=V.substring(0,x)),e="".concat(p).concat(i.decimalCharacter).concat(V)),e=s._mergeCurrencySignNegativePositiveSignAndValue(e,i,h,C),n.isNull(w)&&(w=r),null!==i.negativeBracketsTypeOnBlur&&(w<0||n.isNegativeStrict(e,i.negativeSignCharacter))&&(e=this._toggleNegativeBracket(e,i,a)),i.suffixText?"".concat(e).concat(i.suffixText):e}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(e,i,a,r){var h,w="";if(a?w=i.negativeSignCharacter:i.showPositiveSign&&!r&&(w=i.positiveSignCharacter),i.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(a||!a&&i.showPositiveSign&&!r))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:h="".concat(w).concat(i.currencySymbol).concat(e);break;case s.options.negativePositiveSignPlacement.right:h="".concat(i.currencySymbol).concat(w).concat(e);break;case s.options.negativePositiveSignPlacement.suffix:h="".concat(i.currencySymbol).concat(e).concat(w)}else h=i.currencySymbol+e;else if(i.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(a||!a&&i.showPositiveSign&&!r))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:h="".concat(e).concat(i.currencySymbol).concat(w);break;case s.options.negativePositiveSignPlacement.left:h="".concat(e).concat(w).concat(i.currencySymbol);break;case s.options.negativePositiveSignPlacement.prefix:h="".concat(w).concat(e).concat(i.currencySymbol)}else h=e+i.currencySymbol;return h}},{key:"_truncateZeros",value:function(e,i){var a;switch(i){case 0:a=/(\.(?:\d*[1-9])?)0*$/;break;case 1:a=/(\.\d(?:\d*[1-9])?)0*$/;break;default:a=new RegExp("(\\.\\d{".concat(i,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(a,"$1"),0===i&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,i){return this._roundValue(e,i,i.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,i,a){return a?this._roundFormattedValueShownOnFocus(e,i):this._roundFormattedValueShownOnBlur(e,i)}},{key:"_roundValue",value:function(e,i,a){if(n.isNull(e))return e;if(e=""===e?"0":e.toString(),i.roundingMethod===s.options.roundingMethod.toNearest05||i.roundingMethod===s.options.roundingMethod.toNearest05Alt||i.roundingMethod===s.options.roundingMethod.upToNext05||i.roundingMethod===s.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,i);var r,h=J(s._prepareValueForRounding(e,i),2),w=h[0],C=(e=h[1]).lastIndexOf("."),x=-1===C,Z=J(e.split("."),2),p=Z[0];if(!(Z[1]>0||i.allowDecimalPadding!==s.options.allowDecimalPadding.never&&i.allowDecimalPadding!==s.options.allowDecimalPadding.floats))return 0===Number(e)?p:"".concat(w).concat(p);r=i.allowDecimalPadding===s.options.allowDecimalPadding.always||i.allowDecimalPadding===s.options.allowDecimalPadding.floats?a:i.allowDecimalPadding>0?i.allowDecimalPadding:0;var V,q=e.length-1-(x?e.length-1:C),H="";if(q<=a){if(H=e,q<r){x&&(H="".concat(H).concat(i.decimalCharacter));for(var $="000000";q<r;)H+=$=$.substring(0,r-q),q+=$.length}else q>r?H=this._truncateZeros(H,r):0===q&&0===r&&(H=H.replace(/\.$/,""));return 0===Number(H)?H:"".concat(w).concat(H)}V=x?a-1:Number(a)+Number(C);var oe,de=Number(e.charAt(V+1)),he=e.substring(0,V+1).split("");if(oe="."===e.charAt(V)?e.charAt(V-1)%2:e.charAt(V)%2,this._shouldRoundUp(de,i,w,oe))for(var se=he.length-1;se>=0;se-=1)if("."!==he[se]){if(he[se]=+he[se]+1,he[se]<10)break;se>0&&(he[se]="0")}return he=he.slice(0,V+1),H=this._truncateZeros(he.join(""),r),0===Number(H)?H:"".concat(w).concat(H)}},{key:"_roundCloseTo05",value:function(e,i){switch(i.roundingMethod){case s.options.roundingMethod.toNearest05:case s.options.roundingMethod.toNearest05Alt:e=(Math.round(20*e)/20).toString();break;case s.options.roundingMethod.upToNext05:e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}return n.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,i){var a="";return n.isNegativeStrict(e,"-")&&(a="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),0===Number(e)&&(a=""),(Number(e)>0&&i.leadingZero!==s.options.leadingZero.keep||e.length>0&&i.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[a,e]}},{key:"_shouldRoundUp",value:function(e,i,a,r){return e>4&&i.roundingMethod===s.options.roundingMethod.halfUpSymmetric||e>4&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&""===a||e>5&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&"-"===a||e>5&&i.roundingMethod===s.options.roundingMethod.halfDownSymmetric||e>5&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&""===a||e>4&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&"-"===a||e>5&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding||5===e&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding&&1===r||e>0&&i.roundingMethod===s.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===a||e>0&&i.roundingMethod===s.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===a||e>0&&i.roundingMethod===s.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,i,a,r){a&&(e=this._roundFormattedValueShownOnFocus(e,i));var h=J(e.split(i.decimalCharacter),2),w=h[0],C=h[1];if(C&&C.length>r)if(r>0){var x=C.substring(0,r);e="".concat(w).concat(i.decimalCharacter).concat(x)}else e=w;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,i){if(n.isNull(e)&&i.emptyInputBehavior===s.options.emptyInputBehavior.null||i.overrideMinMaxLimits===s.options.overrideMinMaxLimits.ignore||i.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var a,r=n.parseStr(i.minimumValue),h=n.parseStr(i.maximumValue),w=n.parseStr(e);switch(i.overrideMinMaxLimits){case s.options.overrideMinMaxLimits.floor:a=[n.testMinMax(r,w)>-1,!0];break;case s.options.overrideMinMaxLimits.ceiling:a=[!0,n.testMinMax(h,w)<1];break;default:a=[n.testMinMax(r,w)>-1,n.testMinMax(h,w)<1]}return a}},{key:"_isWithinRangeWithOverrideOption",value:function(e,i){var a=J(this._checkIfInRangeWithOverrideOption(e,i),2);return a[0]&&a[1]}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),n.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,i){return n.testMinMax(n.parseStr(i.minimumValue),this._cleanValueForRangeParse(e))>-1}},{key:"_isMaximumRangeRespected",value:function(e,i){return n.testMinMax(n.parseStr(i.maximumValue),this._cleanValueForRangeParse(e))<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=s.options.negativePositiveSignPlacement.left;else switch(e.currencySymbolPlacement){case s.options.currencySymbolPlacement.suffix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.prefix;break;case s.options.currencySymbolPlacement.prefix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(e){return n.isNull(e)?null:(!n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=s.options.selectOnFocus.doNotSelect),n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&e.selectOnFocus===s.options.selectOnFocus.select&&(e.caretPositionOnFocus=s.options.caretPositionOnFocus.doNoForceCaretPosition),e)}},{key:"_calculateDecimalPlacesOnInit",value:function(e){this._validateDecimalPlacesRawValue(e),e.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.useDefault&&(e.decimalPlacesShownOnFocus=e.decimalPlaces),e.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.useDefault&&(e.decimalPlacesShownOnBlur=e.decimalPlaces),e.decimalPlacesRawValue===s.options.decimalPlacesRawValue.useDefault&&(e.decimalPlacesRawValue=e.decimalPlaces);var i=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(i=String(e.rawValueDivisor).length-1)<0&&(i=0),e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+i,Number(e.originalDecimalPlacesRawValue)+i)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._validateDecimalPlacesRawValue(e),n.isNull(i)&&n.throwError("When updating the settings, the previous ones should be passed as an argument.");var a="decimalPlaces"in e;if(a||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){a?("decimalPlacesShownOnFocus"in e&&e.decimalPlacesShownOnFocus!==s.options.decimalPlacesShownOnFocus.useDefault||(e.decimalPlacesShownOnFocus=e.decimalPlaces),"decimalPlacesShownOnBlur"in e&&e.decimalPlacesShownOnBlur!==s.options.decimalPlacesShownOnBlur.useDefault||(e.decimalPlacesShownOnBlur=e.decimalPlaces),"decimalPlacesRawValue"in e&&e.decimalPlacesRawValue!==s.options.decimalPlacesRawValue.useDefault||(e.decimalPlacesRawValue=e.decimalPlaces)):(n.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=i.decimalPlacesShownOnFocus),n.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=i.decimalPlacesShownOnBlur));var r=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(r=String(e.rawValueDivisor).length-1)<0&&(r=0),e.decimalPlacesRawValue=e.decimalPlaces||e.decimalPlacesRawValue?Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+r,Number(e.decimalPlacesRawValue)+r):Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+r,Number(i.originalDecimalPlacesRawValue)+r)}}},{key:"_cachesUsualRegularExpressions",value:function(e,i){var a;a=e.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen?"([-\\".concat(e.negativeSignCharacter,"]?)"):"(-?)",i.aNegRegAutoStrip=a,e.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(e.decimalCharacter,"]"),"g"),e.numRegAutoStrip=new RegExp("".concat(a,"(?:\\").concat(e.decimalCharacter,"?([0-9]+\\").concat(e.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(e.decimalCharacter,"[0-9]*)?))")),e.stripReg=new RegExp("^".concat(i.aNegRegAutoStrip,"0*([0-9])")),e.formulaChars=new RegExp("[0-9".concat(e.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var i={aSep:"digitGroupSeparator",nSep:"showOnlyNumbersOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"decimalPlacesShownOnBlur",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",allowDecimalPadding:!0,alwaysAllowDecimalCharacter:!0,caretPositionOnFocus:!0,createLocalList:!0,currencySymbol:!0,currencySymbolPlacement:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,decimalPlaces:!0,decimalPlacesRawValue:!0,decimalPlacesShownOnBlur:!0,decimalPlacesShownOnFocus:!0,defaultValueOverride:!0,digitalGroupSpacing:!0,digitGroupSeparator:!0,divisorWhenUnfocused:!0,emptyInputBehavior:!0,eventBubbles:!0,eventIsCancelable:!0,failOnUnknownOption:!0,formatOnPageLoad:!0,formulaMode:!0,historySize:!0,isCancellable:!0,leadingZero:!0,maximumValue:!0,minimumValue:!0,modifyValueOnUpDownArrow:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,negativePositiveSignBehavior:!0,noEventListeners:!0,onInvalidPaste:!0,outputFormat:!0,overrideMinMaxLimits:!0,positiveSignCharacter:!0,rawValueDivisor:!0,readOnly:!0,roundingMethod:!0,saveValueToSessionStorage:!0,selectNumberOnly:!0,selectOnFocus:!0,serializeSpaces:!0,showOnlyNumbersOnFocus:!0,showPositiveSign:!0,showWarnings:!0,styleRules:!0,suffixText:!0,symbolWhenUnfocused:!0,upDownStep:!0,unformatOnHover:!0,unformatOnSubmit:!0,valuesToStrings:!0,watchExternalChanges:!0,wheelOn:!0,wheelStep:!0,allowedAutoStrip:!0,formulaChars:!0,isNegativeSignAllowed:!0,isPositiveSignAllowed:!0,mIntNeg:!0,mIntPos:!0,numRegAutoStrip:!0,originalDecimalPlaces:!0,originalDecimalPlacesRawValue:!0,stripReg:!0};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(!0===i[a])continue;Object.prototype.hasOwnProperty.call(i,a)?(n.warning("You are using the deprecated option name '".concat(a,"'. Please use '").concat(i[a],"' instead from now on. The old option name will be dropped very soon\u2122."),!0),e[i[a]]=e[a],delete e[a]):e.failOnUnknownOption&&n.throwError("Option name '".concat(a,"' 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=e.maximumValue>=0}},{key:"_toNumericValue",value:function(e,i){var a;return n.isNumber(Number(e))?(n.isNumberStrict(e)||(e=String(e).trim()),a=n.scientificToDecimal(e)):(a=this._convertToNumericString(e.toString(),i),n.isNumber(Number(a))||(n.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),i.showWarnings),a=NaN)),a}},{key:"_checkIfInRange",value:function(e,i,a){var r=n.parseStr(e);return n.testMinMax(i,r)>-1&&n.testMinMax(a,r)<1}},{key:"_shouldSkipEventKey",value:function(e){var i=n.isInArray(e,v.keyName._allFnKeys),a=e===v.keyName.OSLeft||e===v.keyName.OSRight,r=e===v.keyName.ContextMenu,h=n.isInArray(e,v.keyName._someNonPrintableKeys);return i||a||r||h||e===v.keyName.Unidentified||e===v.keyName.NumLock||e===v.keyName.ScrollLock||e===v.keyName.Insert||e===v.keyName.Command}},{key:"_serialize",value:function(e){var i,a=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unformatted",w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+",C=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,x=[];return"object"===fe(e)&&"form"===e.nodeName.toLowerCase()&&Array.prototype.slice.call(e.elements).forEach(function(Z){if(Z.name&&!Z.disabled&&-1===["file","reset","submit","button"].indexOf(Z.type))if("select-multiple"===Z.type)Array.prototype.slice.call(Z.options).forEach(function(q){q.selected&&x.push(r?{name:Z.name,value:q.value}:"".concat(encodeURIComponent(Z.name),"=").concat(encodeURIComponent(q.value)))});else if(-1===["checkbox","radio"].indexOf(Z.type)||Z.checked){var p,V;if(a.isManagedByAutoNumeric(Z))switch(h){case"unformatted":V=a.getAutoNumericElement(Z),n.isNull(V)||(p=a.unformat(Z,V.getSettings()));break;case"localized":if(V=a.getAutoNumericElement(Z),!n.isNull(V)){var j=n.cloneObject(V.getSettings());n.isNull(C)||(j.outputFormat=C),p=a.localize(Z,j)}break;default:p=Z.value}else p=Z.value;n.isUndefined(p)&&n.throwError("This error should never be hit. If it has, something really wrong happened!"),x.push(r?{name:Z.name,value:p}:"".concat(encodeURIComponent(Z.name),"=").concat(encodeURIComponent(p)))}}),r?i=x:(i=x.join("&"),"+"===w&&(i=i.replace(/%20/g,"+"))),i}},{key:"_serializeNumericString",value:function(e){return this._serialize(e,!1,"unformatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeFormatted",value:function(e){return this._serialize(e,!1,"formatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeLocalized",value:function(e){return this._serialize(e,!1,"localized",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}},{key:"_serializeNumericStringArray",value:function(e){return this._serialize(e,!0,"unformatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeFormattedArray",value:function(e){return this._serialize(e,!0,"formatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeLocalizedArray",value:function(e){return this._serialize(e,!0,"localized",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}}],L&&Re(T.prototype,L),B&&Re(T,B),Object.defineProperty(T,"prototype",{writable:!1}),s}();Te(N,"options",void 0),Te(N,"events",void 0),Te(N,"defaultSettings",void 0),Te(N,"predefinedOptions",void 0),N.multiple=function(s){var T=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,L=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,B=[];if(n.isObject(T)&&(L=T,T=null),n.isString(s))s=Y(document.querySelectorAll(s));else if(n.isObject(s)){Object.prototype.hasOwnProperty.call(s,"rootElement")||n.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var e=Y(s.rootElement.querySelectorAll("input"));Object.prototype.hasOwnProperty.call(s,"exclude")?(Array.isArray(s.exclude)||n.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),s=n.filterOut(e,s.exclude)):s=e}else n.isArray(s)||n.throwError("The given parameters to the 'multiple' function are invalid.");if(0===s.length){var i=!0;return!n.isNull(L)&&n.isBoolean(L.showWarnings)&&(i=L.showWarnings),n.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",i),[]}var a=n.isArray(T)&&T.length>=1,r=!1,h=!1;if(a){var w=fe(Number(T[0]));(r="number"===w&&!isNaN(Number(T[0])))||("string"===w||isNaN(w)||"object"===w)&&(h=!0)}var C,x=!1;if(n.isArray(L)&&L.length>=1){var Z=fe(L[0]);"string"!==Z&&"object"!==Z||(x=!0)}C=h?N.mergeOptions(T):x?N.mergeOptions(L):L;var p,V=n.isNumber(T);return r&&(p=T.length),s.forEach(function(j,q){B.push(new N(j,V?T:r&&q<=p?T[q]:null,C))}),B},N.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(N.events.native),Object.freeze(N.events),Object.defineProperty(N,"events",{configurable:!1,writable:!1}),N.options={allowDecimalPadding:{always:!0,never:!1,floats:"floats"},alwaysAllowDecimalCharacter:{alwaysAllow:!0,doNotAllow:!1},caretPositionOnFocus:{start:"start",end:"end",decimalLeft:"decimalLeft",decimalRight:"decimalRight",doNoForceCaretPosition:null},createLocalList:{createList:!0,doNotCreateList:!1},currencySymbol:{none:"",currencySign:"\xa4",austral:"\u20b3",australCentavo:"\xa2",baht:"\u0e3f",cedi:"\u20b5",cent:"\xa2",colon:"\u20a1",cruzeiro:"\u20a2",dollar:"$",dong:"\u20ab",drachma:"\u20af",dram:"\u200b\u058f",european:"\u20a0",euro:"\u20ac",florin:"\u0192",franc:"\u20a3",guarani:"\u20b2",hryvnia:"\u20b4",kip:"\u20ad",att:"\u0ead\u0eb1\u0e94",lepton:"\u039b.",lira:"\u20ba",liraOld:"\u20a4",lari:"\u20be",mark:"\u2133",mill:"\u20a5",naira:"\u20a6",peseta:"\u20a7",peso:"\u20b1",pfennig:"\u20b0",pound:"\xa3",real:"R$ ",riel:"\u17db",ruble:"\u20bd",rupee:"\u20b9",rupeeOld:"\u20a8",shekel:"\u20aa",shekelAlt:"\u05e9\u05f4\u05d7\u200e\u200e",taka:"\u09f3",tenge:"\u20b8",togrog:"\u20ae",won:"\u20a9",yen:"\xa5"},currencySymbolPlacement:{prefix:"p",suffix:"s"},decimalCharacter:{comma:",",dot:".",middleDot:"\xb7",arabicDecimalSeparator:"\u066b",decimalSeparatorKeySymbol:"\u2396"},decimalCharacterAlternative:{none:null,comma:",",dot:"."},decimalPlaces:{none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesRawValue:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnBlur:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnFocus:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},defaultValueOverride:{doNotOverride:null},digitalGroupSpacing:{two:"2",twoThree:"2t",twoScaled:"2s",three:"3",four:"4"},digitGroupSeparator:{comma:",",dot:".",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0",noSeparator:"",apostrophe:"'",arabicThousandsSeparator:"\u066c",dotAbove:"\u02d9",privateUseTwo:"\u2019"},divisorWhenUnfocused:{none:null,percentage:100,permille:1e3,basisPoint:1e4},emptyInputBehavior:{focus:"focus",press:"press",always:"always",zero:"zero",min:"min",max:"max",null:"null"},eventBubbles:{bubbles:!0,doesNotBubble:!1},eventIsCancelable:{isCancelable:!0,isNotCancelable:!1},failOnUnknownOption:{fail:!0,ignore:!1},formatOnPageLoad:{format:!0,doNotFormat:!1},formulaMode:{enabled:!0,disabled:!1},historySize:{verySmall:5,small:10,medium:20,large:50,veryLarge:100,insane:Number.MAX_SAFE_INTEGER},invalidClass:"an-invalid",isCancellable:{cancellable:!0,notCancellable:!1},leadingZero:{allow:"allow",deny:"deny",keep:"keep"},maximumValue:{tenTrillions:"10000000000000",oneBillion:"1000000000",zero:"0"},minimumValue:{tenTrillions:"-10000000000000",oneBillion:"-1000000000",zero:"0"},modifyValueOnUpDownArrow:{modifyValue:!0,doNothing:!1},modifyValueOnWheel:{modifyValue:!0,doNothing:!1},negativeBracketsTypeOnBlur:{parentheses:"(,)",brackets:"[,]",chevrons:"<,>",curlyBraces:"{,}",angleBrackets:"\u3008,\u3009",japaneseQuotationMarks:"\uff62,\uff63",halfBrackets:"\u2e24,\u2e25",whiteSquareBrackets:"\u27e6,\u27e7",quotationMarks:"\u2039,\u203a",guillemets:"\xab,\xbb",none:null},negativePositiveSignPlacement:{prefix:"p",suffix:"s",left:"l",right:"r",none:null},negativeSignCharacter:{hyphen:"-",minus:"\u2212",heavyMinus:"\u2796",fullWidthHyphen:"\uff0d",circledMinus:"\u2296",squaredMinus:"\u229f",triangleMinus:"\u2a3a",plusMinus:"\xb1",minusPlus:"\u2213",dotMinus:"\u2238",minusTilde:"\u2242",not:"\xac"},negativePositiveSignBehavior:{toggle:!0,doNotToggle:!1},noEventListeners:{noEvents:!0,addEvents:!1},onInvalidPaste:{error:"error",ignore:"ignore",clamp:"clamp",truncate:"truncate",replace:"replace"},outputFormat:{string:"string",number:"number",dot:".",negativeDot:"-.",comma:",",negativeComma:"-,",dotNegative:".-",commaNegative:",-",none:null},overrideMinMaxLimits:{ceiling:"ceiling",floor:"floor",ignore:"ignore",invalid:"invalid",doNotOverride:null},positiveSignCharacter:{plus:"+",fullWidthPlus:"\uff0b",heavyPlus:"\u2795",doublePlus:"\u29fa",triplePlus:"\u29fb",circledPlus:"\u2295",squaredPlus:"\u229e",trianglePlus:"\u2a39",plusMinus:"\xb1",minusPlus:"\u2213",dotPlus:"\u2214",altHebrewPlus:"\ufb29",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0"},rawValueDivisor:{none:null,percentage:100,permille:1e3,basisPoint:1e4},readOnly:{readOnly:!0,readWrite:!1},roundingMethod:{halfUpSymmetric:"S",halfUpAsymmetric:"A",halfDownSymmetric:"s",halfDownAsymmetric:"a",halfEvenBankersRounding:"B",upRoundAwayFromZero:"U",downRoundTowardZero:"D",toCeilingTowardPositiveInfinity:"C",toFloorTowardNegativeInfinity:"F",toNearest05:"N05",toNearest05Alt:"CHF",upToNext05:"U05",downToNext05:"D05"},saveValueToSessionStorage:{save:!0,doNotSave:!1},selectNumberOnly:{selectNumbersOnly:!0,selectAll:!1},selectOnFocus:{select:!0,doNotSelect:!1},serializeSpaces:{plus:"+",percent:"%20"},showOnlyNumbersOnFocus:{onlyNumbers:!0,showAll:!1},showPositiveSign:{show:!0,hide:!1},showWarnings:{show:!0,hide:!1},styleRules:{none:null,positiveNegative:{positive:"autoNumeric-positive",negative:"autoNumeric-negative"},range0To100With4Steps:{ranges:[{min:0,max:25,class:"autoNumeric-red"},{min:25,max:50,class:"autoNumeric-orange"},{min:50,max:75,class:"autoNumeric-yellow"},{min:75,max:100,class:"autoNumeric-green"}]},evenOdd:{userDefined:[{callback:function(s){return s%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(s){return s>=-1&&s<0?0:0===Number(s)?1:s>0&&s<=1?2:null},classes:["autoNumeric-small-negative","autoNumeric-zero","autoNumeric-small-positive"]}]}},suffixText:{none:"",percentage:"%",permille:"\u2030",basisPoint:"\u2031"},symbolWhenUnfocused:{none:null,percentage:"%",permille:"\u2030",basisPoint:"\u2031"},unformatOnHover:{unformat:!0,doNotUnformat:!1},unformatOnSubmit:{unformat:!0,keepCurrentValue:!1},upDownStep:{progressive:"progressive"},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},ce=N.options,Object.getOwnPropertyNames(ce).forEach(function(s){"valuesToStrings"===s?Object.getOwnPropertyNames(ce.valuesToStrings).forEach(function(T){null!==ce.valuesToStrings[T]&&Object.freeze(ce.valuesToStrings[T])}):"styleRules"!==s&&null!==ce[s]&&Object.freeze(ce[s])}),Object.freeze(ce),Object.defineProperty(N,"options",{configurable:!1,writable:!1}),N.defaultSettings={allowDecimalPadding:N.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:N.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:N.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:N.options.createLocalList.createList,currencySymbol:N.options.currencySymbol.none,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,decimalCharacter:N.options.decimalCharacter.dot,decimalCharacterAlternative:N.options.decimalCharacterAlternative.none,decimalPlaces:N.options.decimalPlaces.two,decimalPlacesRawValue:N.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:N.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:N.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:N.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:N.options.digitalGroupSpacing.three,digitGroupSeparator:N.options.digitGroupSeparator.comma,divisorWhenUnfocused:N.options.divisorWhenUnfocused.none,emptyInputBehavior:N.options.emptyInputBehavior.focus,eventBubbles:N.options.eventBubbles.bubbles,eventIsCancelable:N.options.eventIsCancelable.isCancelable,failOnUnknownOption:N.options.failOnUnknownOption.ignore,formatOnPageLoad:N.options.formatOnPageLoad.format,formulaMode:N.options.formulaMode.disabled,historySize:N.options.historySize.medium,invalidClass:N.options.invalidClass,isCancellable:N.options.isCancellable.cancellable,leadingZero:N.options.leadingZero.deny,maximumValue:N.options.maximumValue.tenTrillions,minimumValue:N.options.minimumValue.tenTrillions,modifyValueOnUpDownArrow:N.options.modifyValueOnUpDownArrow.modifyValue,modifyValueOnWheel:N.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:N.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.none,negativeSignCharacter:N.options.negativeSignCharacter.hyphen,negativePositiveSignBehavior:N.options.negativePositiveSignBehavior.doNotToggle,noEventListeners:N.options.noEventListeners.addEvents,onInvalidPaste:N.options.onInvalidPaste.error,outputFormat:N.options.outputFormat.none,overrideMinMaxLimits:N.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:N.options.positiveSignCharacter.plus,rawValueDivisor:N.options.rawValueDivisor.none,readOnly:N.options.readOnly.readWrite,roundingMethod:N.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:N.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:N.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:N.options.selectOnFocus.select,serializeSpaces:N.options.serializeSpaces.plus,showOnlyNumbersOnFocus:N.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:N.options.showPositiveSign.hide,showWarnings:N.options.showWarnings.show,styleRules:N.options.styleRules.none,suffixText:N.options.suffixText.none,symbolWhenUnfocused:N.options.symbolWhenUnfocused.none,unformatOnHover:N.options.unformatOnHover.unformat,unformatOnSubmit:N.options.unformatOnSubmit.keepCurrentValue,upDownStep:"1",valuesToStrings:N.options.valuesToStrings.none,watchExternalChanges:N.options.watchExternalChanges.doNotWatch,wheelOn:N.options.wheelOn.focus,wheelStep:N.options.wheelStep.progressive},Object.freeze(N.defaultSettings),Object.defineProperty(N,"defaultSettings",{configurable:!1,writable:!1});var ye={digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,decimalCharacterAlternative:N.options.decimalCharacterAlternative.dot,currencySymbol:"\u202f\u20ac",currencySymbolPlacement:N.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.prefix},Ce={digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.dollar,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Je={digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.yen,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right};n.cloneObject(ye).formulaMode=N.options.formulaMode.enabled;var Ke=n.cloneObject(ye);Ke.minimumValue=0;var Ae=n.cloneObject(ye);Ae.maximumValue=0,Ae.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var Fe=n.cloneObject(ye);Fe.digitGroupSeparator=N.options.digitGroupSeparator.normalSpace;var Be=n.cloneObject(Fe);Be.minimumValue=0;var Ue=n.cloneObject(Fe);Ue.maximumValue=0,Ue.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var _e=n.cloneObject(ye);_e.currencySymbol=N.options.currencySymbol.none,_e.suffixText="\u202f".concat(N.options.suffixText.percentage),_e.wheelStep=1e-4,_e.rawValueDivisor=N.options.rawValueDivisor.percentage;var Ze=n.cloneObject(_e);Ze.minimumValue=0;var Ve=n.cloneObject(_e);Ve.maximumValue=0,Ve.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var He=n.cloneObject(_e);He.decimalPlaces=3;var Se=n.cloneObject(Ze);Se.decimalPlaces=3;var at=n.cloneObject(Ve);at.decimalPlaces=3,n.cloneObject(Ce).formulaMode=N.options.formulaMode.enabled;var ot=n.cloneObject(Ce);ot.minimumValue=0;var je=n.cloneObject(Ce);je.maximumValue=0,je.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var st=n.cloneObject(je);st.negativeBracketsTypeOnBlur=N.options.negativeBracketsTypeOnBlur.parentheses;var Pe=n.cloneObject(Ce);Pe.currencySymbol=N.options.currencySymbol.none,Pe.suffixText=N.options.suffixText.percentage,Pe.wheelStep=1e-4,Pe.rawValueDivisor=N.options.rawValueDivisor.percentage;var Qe=n.cloneObject(Pe);Qe.minimumValue=0;var Ge=n.cloneObject(Pe);Ge.maximumValue=0,Ge.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var $e=n.cloneObject(Pe);$e.decimalPlaces=3;var lt=n.cloneObject(Qe);lt.decimalPlaces=3;var Ye=n.cloneObject(Ge);Ye.decimalPlaces=3;var Xe=n.cloneObject(ye);Xe.currencySymbol=N.options.currencySymbol.lira,N.predefinedOptions={euro:ye,euroPos:Ke,euroNeg:Ae,euroSpace:Fe,euroSpacePos:Be,euroSpaceNeg:Ue,percentageEU2dec:_e,percentageEU2decPos:Ze,percentageEU2decNeg:Ve,percentageEU3dec:He,percentageEU3decPos:Se,percentageEU3decNeg:at,dollar:Ce,dollarPos:ot,dollarNeg:je,dollarNegBrackets:st,percentageUS2dec:Pe,percentageUS2decPos:Qe,percentageUS2decNeg:Ge,percentageUS3dec:$e,percentageUS3decPos:lt,percentageUS3decNeg:Ye,French:ye,Spanish:ye,NorthAmerican:Ce,British:{digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.pound,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:N.options.digitGroupSeparator.apostrophe,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:"\u202fCHF",currencySymbolPlacement:N.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.prefix},Japanese:Je,Chinese:Je,Brazilian:{digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,currencySymbol:N.options.currencySymbol.real,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Turkish:Xe,dotDecimalCharCommaSeparator:{digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,decimalCharacterAlternative:N.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:N.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:N.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:N.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:N.options.allowDecimalPadding.never,minimumValue:N.options.minimumValue.zero,maximumValue:N.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:N.options.allowDecimalPadding.never,minimumValue:N.options.minimumValue.tenTrillions,maximumValue:N.options.maximumValue.zero},numeric:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none},numericPos:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none,minimumValue:N.options.minimumValue.zero,maximumValue:N.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none,minimumValue:N.options.minimumValue.tenTrillions,maximumValue:N.options.maximumValue.zero}},Object.getOwnPropertyNames(N.predefinedOptions).forEach(function(s){Object.freeze(N.predefinedOptions[s])}),Object.freeze(N.predefinedOptions),Object.defineProperty(N,"predefinedOptions",{configurable:!1,writable:!1});const et=N;return F.default})(),W.exports=E()},6387:(W,b,E)=>{"use strict";var F=G(E(4168)),v=G(E(6017)),R=G(E(1301)),I=G(E(7164)),l=G(E(8619)),n=G(E(4866)),m=G(E(3057)),S=E(723),U=G(E(530));function G(Q){return Q&&Q.__esModule?Q:{default:Q}}var z=function(){},X=function(ee,ne,Y){var J=new z;if(typeof ee>"u")throw Error("No element to render on was provided.");return J._renderProperties=(0,l.default)(ee),J._encodings=[],J._options=U.default,J._errorHandler=new m.default(J),typeof ne<"u"&&((Y=Y||{}).format||(Y.format=ke()),J.options(Y)[Y.format](ne,Y).render()),J};for(var ge in X.getModule=function(Q){return F.default[Q]},F.default)F.default.hasOwnProperty(ge)&&ue(F.default,ge);function ue(Q,ee){z.prototype[ee]=z.prototype[ee.toUpperCase()]=z.prototype[ee.toLowerCase()]=function(ne,Y){var J=this;return J._errorHandler.wrapBarcodeCall(function(){Y.text=typeof Y.text>"u"?void 0:""+Y.text;var ae=(0,v.default)(J._options,Y);ae=(0,n.default)(ae);var le=pe(ne,Q[ee],ae);return J._encodings.push(le),J})}}function pe(Q,ee,ne){var Y=new ee(Q=""+Q,ne);if(!Y.valid())throw new S.InvalidInputException(Y.constructor.name,Q);var J=Y.encode();J=(0,R.default)(J);for(var ae=0;ae<J.length;ae++)J[ae].options=(0,v.default)(ne,J[ae].options);return J}function ke(){return F.default.CODE128?"CODE128":Object.keys(F.default)[0]}function xe(Q,ee,ne){ee=(0,R.default)(ee);for(var Y=0;Y<ee.length;Y++)ee[Y].options=(0,v.default)(ne,ee[Y].options),(0,I.default)(ee[Y].options);(0,I.default)(ne),new(0,Q.renderer)(Q.element,ee,ne).render(),Q.afterRender&&Q.afterRender()}z.prototype.options=function(Q){return this._options=(0,v.default)(this._options,Q),this},z.prototype.blank=function(Q){var ee=new Array(Q+1).join("0");return this._encodings.push({data:ee}),this},z.prototype.init=function(){var Q;if(this._renderProperties)for(var ee in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){var ne=(0,v.default)(this._options,(Q=this._renderProperties[ee]).options);"auto"==ne.format&&(ne.format=ke()),this._errorHandler.wrapBarcodeCall(function(){var ae=pe(ne.value,F.default[ne.format.toUpperCase()],ne);xe(Q,ae,ne)})}},z.prototype.render=function(){if(!this._renderProperties)throw new S.NoElementException;if(Array.isArray(this._renderProperties))for(var Q=0;Q<this._renderProperties.length;Q++)xe(this._renderProperties[Q],this._encodings,this._options);else xe(this._renderProperties,this._encodings,this._options);return this},z.prototype._defaults=U.default,typeof window<"u"&&(window.JsBarcode=X),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(Q,ee){var ne=[];return jQuery(this).each(function(){ne.push(this)}),X(ne,Q,ee)}),W.exports=X},9418:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function F(t,v){(function E(F,t){if(!(F instanceof t))throw new TypeError("Cannot call a class as a function")})(this,F),this.data=t,this.text=v.text||t,this.options=v}},8514:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function D(l){return l&&l.__esModule?l:{default:l}}(E(9418)),v=E(9144),y=function(l){function u(n,d){!function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u);var m=function k(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,n.substring(1),d));return m.bytes=n.split("").map(function(S){return S.charCodeAt(0)}),m}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),A(u,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var d=this.bytes,m=d.shift()-105,S=v.SET_BY_CODE[m];if(void 0===S)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&d.unshift(v.FNC1);var _=u.next(d,1,S);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:u.getBar(m)+_.result+u.getBar((_.checksum+m)%v.MODULO)+u.getBar(v.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var d=this.options.ean128||!1;return"string"==typeof d&&(d="true"===d.toLowerCase()),d}}],[{key:"getBar",value:function(d){return v.BARS[d]?v.BARS[d].toString():""}},{key:"correctIndex",value:function(d,m){if(m===v.SET_A){var S=d.shift();return S<32?S+64:S-32}return m===v.SET_B?d.shift()-32:10*(d.shift()-48)+d.shift()-48}},{key:"next",value:function(d,m,S){if(!d.length)return{result:"",checksum:0};var _=void 0,U=void 0;if(d[0]>=200){U=d.shift()-105;var G=v.SWAP[U];void 0!==G?_=u.next(d,m+1,G):((S===v.SET_A||S===v.SET_B)&&U===v.SHIFT&&(d[0]=S===v.SET_A?d[0]>95?d[0]-96:d[0]:d[0]<32?d[0]+96:d[0]),_=u.next(d,m+1,S))}else U=u.correctIndex(d,S),_=u.next(d,m+1,S);return{result:u.getBar(U)+_.result,checksum:U*m+_.checksum}}}]),u}(t.default);b.default=y},2100:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function D(l){return l&&l.__esModule?l:{default:l}}(E(8514)),v=E(9144),y=function(l){function u(n,d){return function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function k(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,v.A_START_CHAR+n,d))}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),A(u,[{key:"valid",value:function(){return new RegExp("^"+v.A_CHARS+"+$").test(this.data)}}]),u}(t.default);b.default=y},2943:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function D(l){return l&&l.__esModule?l:{default:l}}(E(8514)),v=E(9144),y=function(l){function u(n,d){return function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function k(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,v.B_START_CHAR+n,d))}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),A(u,[{key:"valid",value:function(){return new RegExp("^"+v.B_CHARS+"+$").test(this.data)}}]),u}(t.default);b.default=y},5683:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function D(l){return l&&l.__esModule?l:{default:l}}(E(8514)),v=E(9144),y=function(l){function u(n,d){return function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function k(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,v.C_START_CHAR+n,d))}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),A(u,[{key:"valid",value:function(){return new RegExp("^"+v.C_CHARS+"+$").test(this.data)}}]),u}(t.default);b.default=y},7737:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=D(E(8514)),v=D(E(4336));function D(l){return l&&l.__esModule?l:{default:l}}function k(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}var y=function(l){function u(n,d){if(function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var m=k(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,(0,v.default)(n),d));else m=k(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,n,d));return k(m)}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),u}(F.default);b.default=y},4336:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=E(9144),F=function(I){return I.match(new RegExp("^"+A.A_CHARS+"*"))[0].length},t=function(I){return I.match(new RegExp("^"+A.B_CHARS+"*"))[0].length},v=function(I){return I.match(new RegExp("^"+A.C_CHARS+"*"))[0]};function D(k,I){var y=I?A.A_CHARS:A.B_CHARS,l=k.match(new RegExp("^("+y+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+String.fromCharCode(204)+R(k.substring(l[1].length));var u=k.match(new RegExp("^"+y+"+"))[0];return u.length===k.length?k:u+String.fromCharCode(I?205:206)+D(k.substring(u.length),!I)}function R(k){var I=v(k),y=I.length;if(y===k.length)return k;k=k.substring(y);var l=F(k)>=t(k);return I+String.fromCharCode(l?206:205)+D(k,l)}b.default=function(k){var I=void 0;if(v(k).length>=2)I=A.C_START_CHAR+R(k);else{var l=F(k)>t(k);I=(l?A.A_START_CHAR:A.B_START_CHAR)+D(k,l)}return I.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(u,n){return String.fromCharCode(203)+n})}},9144:(W,b)=>{"use strict";var E;function A(ge,ue,pe){return ue in ge?Object.defineProperty(ge,ue,{value:pe,enumerable:!0,configurable:!0,writable:!0}):ge[ue]=pe,ge}Object.defineProperty(b,"__esModule",{value:!0});var F=b.SET_A=0,t=b.SET_B=1,v=b.SET_C=2,R=(b.SHIFT=98,b.START_A=103),k=b.START_B=104,I=b.START_C=105;b.MODULO=103,b.STOP=106,b.FNC1=207,b.SET_BY_CODE=(A(E={},R,F),A(E,k,t),A(E,I,v),E),b.SWAP={101:F,100:t,99:v},b.A_START_CHAR=String.fromCharCode(208),b.B_START_CHAR=String.fromCharCode(209),b.C_START_CHAR=String.fromCharCode(210),b.A_CHARS="[\0-_\xc8-\xcf]",b.B_CHARS="[ -\x7f\xc8-\xcf]",b.C_CHARS="(\xcf*[0-9]{2}\xcf*)",b.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},8754:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CODE128C=b.CODE128B=b.CODE128A=b.CODE128=void 0;var F=y(E(7737)),v=y(E(2100)),R=y(E(2943)),I=y(E(5683));function y(l){return l&&l.__esModule?l:{default:l}}b.CODE128=F.default,b.CODE128A=v.default,b.CODE128B=R.default,b.CODE128C=I.default},6602:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CODE39=void 0;var A=function(){function _(U,G){for(var z=0;z<G.length;z++){var X=G[z];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(U,X.key,X)}}return function(U,G,z){return G&&_(U.prototype,G),z&&_(U,z),U}}(),I=function(_){function U(G,z){return function D(_,U){if(!(_ instanceof U))throw new TypeError("Cannot call a class as a function")}(this,U),G=G.toUpperCase(),z.mod43&&(G+=function d(_){return y[_]}(function S(_){for(var U=0,G=0;G<_.length;G++)U+=m(_[G]);return U%=43}(G))),function R(_,U){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!U||"object"!=typeof U&&"function"!=typeof U?_:U}(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,G,z))}return function k(_,U){if("function"!=typeof U&&null!==U)throw new TypeError("Super expression must either be null or a function, not "+typeof U);_.prototype=Object.create(U&&U.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(_,U):_.__proto__=U)}(U,_),A(U,[{key:"encode",value:function(){for(var z=u("*"),X=0;X<this.data.length;X++)z+=u(this.data[X])+"0";return{data:z+=u("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),U}(function v(_){return _&&_.__esModule?_:{default:_}}(E(9418)).default),y=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],l=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function u(_){return function n(_){return l[_].toString(2)}(m(_))}function m(_){return y.indexOf(_)}b.CODE39=I},4079:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function n(d,m){for(var S=0;S<m.length;S++){var _=m[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(d,_.key,_)}}return function(d,m,S){return m&&n(d.prototype,m),S&&n(d,S),d}}(),F=E(1392),v=k(E(2651));function k(n){return n&&n.__esModule?n:{default:n}}var u=function(n){function d(m,S){!function I(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}(this,d);var _=function y(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,m,S));return _.fontSize=!S.flat&&S.fontSize>10*S.width?10*S.width:S.fontSize,_.guardHeight=S.height+_.fontSize/2+S.textMargin,_}return function l(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),A(d,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(S,_){return this.text.substr(S,_)}},{key:"leftEncode",value:function(S,_){return(0,v.default)(S,_)}},{key:"rightText",value:function(S,_){return this.text.substr(S,_)}},{key:"rightEncode",value:function(S,_){return(0,v.default)(S,_)}},{key:"encodeGuarded",value:function(){var S={fontSize:this.fontSize},_={height:this.guardHeight};return[{data:F.SIDE_BIN,options:_},{data:this.leftEncode(),text:this.leftText(),options:S},{data:F.MIDDLE_BIN,options:_},{data:this.rightEncode(),text:this.rightText(),options:S},{data:F.SIDE_BIN,options:_}]}},{key:"encodeFlat",value:function(){return{data:[F.SIDE_BIN,this.leftEncode(),F.MIDDLE_BIN,this.rightEncode(),F.SIDE_BIN].join(""),text:this.text}}}]),d}(k(E(9418)).default);b.default=u},9619:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function n(d,m){for(var S=0;S<m.length;S++){var _=m[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(d,_.key,_)}}return function(d,m,S){return m&&n(d.prototype,m),S&&n(d,S),d}}(),F=function n(d,m,S){null===d&&(d=Function.prototype);var _=Object.getOwnPropertyDescriptor(d,m);if(void 0===_){var U=Object.getPrototypeOf(d);return null===U?void 0:n(U,m,S)}if("value"in _)return _.value;var G=_.get;return void 0===G?void 0:G.call(S)},t=E(1392),D=function R(n){return n&&n.__esModule?n:{default:n}}(E(4079)),l=function(d){return(10-d.substr(0,12).split("").map(function(S){return+S}).reduce(function(S,_,U){return U%2?S+3*_:S+_},0)%10)%10},u=function(n){function d(m,S){(function k(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")})(this,d),-1!==m.search(/^[0-9]{12}$/)&&(m+=l(m));var _=function I(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,m,S));return _.lastChar=S.lastChar,_}return function y(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),A(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var S=this.data.substr(1,6),_=t.EAN13_STRUCTURE[this.data[0]];return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftEncode",this).call(this,S,_)}},{key:"rightText",value:function(){return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var S=this.data.substr(7,6);return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightEncode",this).call(this,S,"RRRRRR")}},{key:"encodeGuarded",value:function(){var S=F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(S.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(S.push({data:"00"}),S.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),S}}]),d}(D.default);b.default=u},5754:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function n(d,m){for(var S=0;S<m.length;S++){var _=m[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(d,_.key,_)}}return function(d,m,S){return m&&n(d.prototype,m),S&&n(d,S),d}}(),F=E(1392),v=k(E(2651));function k(n){return n&&n.__esModule?n:{default:n}}var u=function(n){function d(m,S){return function I(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}(this,d),function y(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,m,S))}return function l(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),A(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var S=F.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,v.default)(this.data,S,"01"),text:this.text}}}]),d}(k(E(9418)).default);b.default=u},1931:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function d(m,S){for(var _=0;_<S.length;_++){var U=S[_];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(m,U.key,U)}}return function(m,S,_){return S&&d(m.prototype,S),_&&d(m,_),m}}(),F=E(1392),v=k(E(2651));function k(d){return d&&d.__esModule?d:{default:d}}var n=function(d){function m(S,_){return function I(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}(this,m),function y(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!m||"object"!=typeof m&&"function"!=typeof m?d:m}(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,S,_))}return function l(d,m){if("function"!=typeof m&&null!==m)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}(m,d),A(m,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var _=F.EAN5_STRUCTURE[function(m){return m.split("").map(function(_){return+_}).reduce(function(_,U,G){return G%2?_+9*U:_+3*U},0)%10}(this.data)];return{data:"1011"+(0,v.default)(this.data,_,"01"),text:this.text}}}]),m}(k(E(9418)).default);b.default=n},3372:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function u(n,d){for(var m=0;m<d.length;m++){var S=d[m];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(n,S.key,S)}}return function(n,d,m){return d&&u(n.prototype,d),m&&u(n,m),n}}(),F=function u(n,d,m){null===n&&(n=Function.prototype);var S=Object.getOwnPropertyDescriptor(n,d);if(void 0===S){var _=Object.getPrototypeOf(n);return null===_?void 0:u(_,d,m)}if("value"in S)return S.value;var U=S.get;return void 0===U?void 0:U.call(m)},v=function D(u){return u&&u.__esModule?u:{default:u}}(E(4079)),y=function(n){return(10-n.substr(0,7).split("").map(function(m){return+m}).reduce(function(m,S,_){return _%2?m+S:m+3*S},0)%10)%10},l=function(u){function n(d,m){return function R(u,n){if(!(u instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),-1!==d.search(/^[0-9]{7}$/)&&(d+=y(d)),function k(u,n){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?u:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,d,m))}return function I(u,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);u.prototype=Object.create(n&&n.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(u,n):u.__proto__=n)}(n,u),A(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===y(this.data)}},{key:"leftText",value:function(){return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var m=this.data.substr(0,4);return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,m,"LLLL")}},{key:"rightText",value:function(){return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var m=this.data.substr(4,4);return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,m,"RRRR")}}]),n}(v.default);b.default=l},5821:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function n(d,m){for(var S=0;S<m.length;S++){var _=m[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(d,_.key,_)}}return function(d,m,S){return m&&n(d.prototype,m),S&&n(d,S),d}}();b.checksum=u;var t=R(E(2651));function R(n){return n&&n.__esModule?n:{default:n}}var l=function(n){function d(m,S){(function k(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")})(this,d),-1!==m.search(/^[0-9]{11}$/)&&(m+=u(m));var _=function I(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,m,S));return _.displayValue=S.displayValue,_.fontSize=S.fontSize>10*S.width?10*S.width:S.fontSize,_.guardHeight=S.height+_.fontSize/2+S.textMargin,_}return function y(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),A(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==u(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var S="";return S+="101",S+=(0,t.default)(this.data.substr(0,6),"LLLLLL"),S+="01010",S+=(0,t.default)(this.data.substr(6,6),"RRRRRR"),{data:S+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var S=[];return this.displayValue&&S.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),S.push({data:"101"+(0,t.default)(this.data[0],"L"),options:{height:this.guardHeight}}),S.push({data:(0,t.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),S.push({data:"01010",options:{height:this.guardHeight}}),S.push({data:(0,t.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),S.push({data:(0,t.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&S.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),S}}]),d}(R(E(9418)).default);function u(n){var m,d=0;for(m=1;m<11;m+=2)d+=parseInt(n[m]);for(m=0;m<11;m+=2)d+=3*parseInt(n[m]);return(10-d%10)%10}b.default=l},1091:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function S(_,U){for(var G=0;G<U.length;G++){var z=U[G];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(_,z.key,z)}}return function(_,U,G){return U&&S(_.prototype,U),G&&S(_,G),_}}(),t=k(E(2651)),D=k(E(9418)),R=E(5821);function k(S){return S&&S.__esModule?S:{default:S}}function y(S,_){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!_||"object"!=typeof _&&"function"!=typeof _?S:_}var u=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],n=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],d=function(S){function _(U,G){!function I(S,_){if(!(S instanceof _))throw new TypeError("Cannot call a class as a function")}(this,_);var z=y(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,U,G));if(z.isValid=!1,-1!==U.search(/^[0-9]{6}$/))z.middleDigits=U,z.upcA=m(U,"0"),z.text=G.text||""+z.upcA[0]+U+z.upcA[z.upcA.length-1],z.isValid=!0;else{if(-1===U.search(/^[01][0-9]{7}$/))return y(z);if(z.middleDigits=U.substring(1,U.length-1),z.upcA=m(z.middleDigits,U[0]),z.upcA[z.upcA.length-1]!==U[U.length-1])return y(z);z.isValid=!0}return z.displayValue=G.displayValue,z.fontSize=G.fontSize>10*G.width?10*G.width:G.fontSize,z.guardHeight=G.height+z.fontSize/2+G.textMargin,z}return function l(S,_){if("function"!=typeof _&&null!==_)throw new TypeError("Super expression must either be null or a function, not "+typeof _);S.prototype=Object.create(_&&_.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(S,_):S.__proto__=_)}(_,S),A(_,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var G="";return G+="101",G+=this.encodeMiddleDigits(),{data:G+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var G=[];return this.displayValue&&G.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),G.push({data:"101",options:{height:this.guardHeight}}),G.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),G.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&G.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),G}},{key:"encodeMiddleDigits",value:function(){var G=this.upcA[0],X=n[parseInt(this.upcA[this.upcA.length-1])][parseInt(G)];return(0,t.default)(this.middleDigits,X)}}]),_}(D.default);function m(S,_){for(var U=parseInt(S[S.length-1]),G=u[U],z="",X=0,ge=0;ge<G.length;ge++){var ue=G[ge];z+="X"===ue?S[X++]:ue}return(z=""+_+z)+(0,R.checksum)(z)}b.default=d},1392:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.SIDE_BIN="101",b.MIDDLE_BIN="01010",b.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},b.EAN2_STRUCTURE=["LL","LG","GL","GG"],b.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],b.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},2651:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=E(1392);b.default=function(v,D,R){var k=v.split("").map(function(y,l){return A.BINARIES[D[l]]}).map(function(y,l){return y?y[v[l]]:""});if(R){var I=v.length-1;k=k.map(function(y,l){return l<I?y+R:y})}return k.join("")}},2708:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.UPCE=b.UPC=b.EAN2=b.EAN5=b.EAN8=b.EAN13=void 0;var F=d(E(9619)),v=d(E(3372)),R=d(E(1931)),I=d(E(5754)),l=d(E(5821)),n=d(E(1091));function d(m){return m&&m.__esModule?m:{default:m}}b.EAN13=F.default,b.EAN8=v.default,b.EAN5=R.default,b.EAN2=I.default,b.UPC=l.default,b.UPCE=n.default},8817:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.GenericBarcode=void 0;var A=function(){function y(l,u){for(var n=0;n<u.length;n++){var d=u[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,u,n){return u&&y(l.prototype,u),n&&y(l,n),l}}(),I=function(y){function l(u,n){return function D(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,n))}return function k(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),A(l,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),l}(function v(y){return y&&y.__esModule?y:{default:y}}(E(9418)).default);b.GenericBarcode=I},6065:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),F=E(5168),y=function(l){function u(){return function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function k(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),A(u,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var d=this,m=this.data.match(/.{2}/g).map(function(S){return d.encodePair(S)}).join("");return{data:F.START_BIN+m+F.END_BIN,text:this.text}}},{key:"encodePair",value:function(d){var m=F.BINARIES[d[1]];return F.BINARIES[d[0]].split("").map(function(S,_){return("1"===S?"111":"1")+("1"===m[_]?"000":"0")}).join("")}}]),u}(function D(l){return l&&l.__esModule?l:{default:l}}(E(9418)).default);b.default=y},9643:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function v(l){return l&&l.__esModule?l:{default:l}}(E(6065)),I=function(u){var n=u.substr(0,13).split("").map(function(d){return parseInt(d,10)}).reduce(function(d,m,S){return d+m*(3-S%2*2)},0);return 10*Math.ceil(n/10)-n},y=function(l){function u(n,d){return function D(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),-1!==n.search(/^[0-9]{13}$/)&&(n+=I(n)),function R(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,n,d))}return function k(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),A(u,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===I(this.data)}}]),u}(t.default);b.default=y},5168:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.START_BIN="1010",b.END_BIN="11101",b.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},8969:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ITF14=b.ITF=void 0;var F=D(E(6065)),v=D(E(9643));function D(R){return R&&R.__esModule?R:{default:R}}b.ITF=F.default,b.ITF14=v.default},7037:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),I=function(l){function u(n,d){return function D(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function R(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,n,d))}return function k(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),A(u,[{key:"encode",value:function(){for(var d="110",m=0;m<this.data.length;m++){var _=parseInt(this.data[m]).toString(2);_=y(_,4-_.length);for(var U=0;U<_.length;U++)d+="0"==_[U]?"100":"110"}return{data:d+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),u}(function v(l){return l&&l.__esModule?l:{default:l}}(E(9418)).default);function y(l,u){for(var n=0;n<u;n++)l="0"+l;return l}b.default=I},3922:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),I=function(y){function l(u,n){return function D(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u+(0,t.mod10)(u),n))}return function k(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(F.default);b.default=I},8742:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),I=function(y){function l(u,n){return function D(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),u+=(0,t.mod10)(u),u+=(0,t.mod10)(u),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,n))}return function k(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(F.default);b.default=I},1825:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),I=function(y){function l(u,n){return function D(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u+(0,t.mod11)(u),n))}return function k(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(F.default);b.default=I},4455:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),I=function(y){function l(u,n){return function D(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),u+=(0,t.mod11)(u),u+=(0,t.mod10)(u),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,n))}return function k(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(F.default);b.default=I},6225:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.mod10=function E(F){for(var t=0,v=0;v<F.length;v++){var D=parseInt(F[v]);t+=(v+F.length)%2==0?D:2*D%10+Math.floor(2*D/10)}return(10-t%10)%10},b.mod11=function A(F){for(var t=0,v=[2,3,4,5,6,7],D=0;D<F.length;D++){var R=parseInt(F[F.length-1-D]);t+=v[D%v.length]*R}return(11-t%11)%11}},1122:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.MSI1110=b.MSI1010=b.MSI11=b.MSI10=b.MSI=void 0;var F=u(E(7037)),v=u(E(3922)),R=u(E(1825)),I=u(E(8742)),l=u(E(4455));function u(n){return n&&n.__esModule?n:{default:n}}b.MSI=F.default,b.MSI10=v.default,b.MSI11=R.default,b.MSI1010=I.default,b.MSI1110=l.default},886:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.codabar=void 0;var A=function(){function y(l,u){for(var n=0;n<u.length;n++){var d=u[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,u,n){return u&&y(l.prototype,u),n&&y(l,n),l}}(),I=function(y){function l(u,n){(function D(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")})(this,l),0===u.search(/^[0-9\-\$\:\.\+\/]+$/)&&(u="A"+u+"A");var d=function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u.toUpperCase(),n));return d.text=d.options.text||d.text.replace(/[A-D]/g,""),d}return function k(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),A(l,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var n=[],d=this.getEncodings(),m=0;m<this.data.length;m++)n.push(d[this.data.charAt(m)]),m!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),l}(function v(y){return y&&y.__esModule?y:{default:y}}(E(9418)).default);b.codabar=I},4168:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=E(6602),F=E(8754),t=E(2708),v=E(8969),D=E(1122),R=E(8758),k=E(886),I=E(8817);b.default={CODE39:A.CODE39,CODE128:F.CODE128,CODE128A:F.CODE128A,CODE128B:F.CODE128B,CODE128C:F.CODE128C,EAN13:t.EAN13,EAN8:t.EAN8,EAN5:t.EAN5,EAN2:t.EAN2,UPC:t.UPC,UPCE:t.UPCE,ITF14:v.ITF14,ITF:v.ITF,MSI:D.MSI,MSI10:D.MSI10,MSI11:D.MSI11,MSI1010:D.MSI1010,MSI1110:D.MSI1110,pharmacode:R.pharmacode,codabar:k.codabar,GenericBarcode:I.GenericBarcode}},8758:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.pharmacode=void 0;var A=function(){function y(l,u){for(var n=0;n<u.length;n++){var d=u[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,u,n){return u&&y(l.prototype,u),n&&y(l,n),l}}(),I=function(y){function l(u,n){!function D(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l);var d=function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,n));return d.number=parseInt(u,10),d}return function k(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),A(l,[{key:"encode",value:function(){for(var n=this.number,d="";!isNaN(n)&&0!=n;)n%2==0?(d="11100"+d,n=(n-2)/2):(d="100"+d,n=(n-1)/2);return{data:d=d.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),l}(function v(y){return y&&y.__esModule?y:{default:y}}(E(9418)).default);b.pharmacode=I},3057:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var E=function(){function t(v,D){for(var R=0;R<D.length;R++){var k=D[R];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(v,k.key,k)}}return function(v,D,R){return D&&t(v.prototype,D),R&&t(v,R),v}}(),F=function(){function t(v){(function A(t,v){if(!(t instanceof v))throw new TypeError("Cannot call a class as a function")})(this,t),this.api=v}return E(t,[{key:"handleCatch",value:function(D){if("InvalidInputException"!==D.name)throw D;if(this.api._options.valid===this.api._defaults.valid)throw D.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(D){try{var R=D.apply(void 0,arguments);return this.api._options.valid(!0),R}catch(k){return this.handleCatch(k),this.api}}}]),t}();b.default=F},723:(W,b)=>{"use strict";function E(R,k){if(!(R instanceof k))throw new TypeError("Cannot call a class as a function")}function A(R,k){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!k||"object"!=typeof k&&"function"!=typeof k?R:k}function F(R,k){if("function"!=typeof k&&null!==k)throw new TypeError("Super expression must either be null or a function, not "+typeof k);R.prototype=Object.create(k&&k.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(R,k):R.__proto__=k)}Object.defineProperty(b,"__esModule",{value:!0});var t=function(R){function k(I,y){E(this,k);var l=A(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return l.name="InvalidInputException",l.symbology=I,l.input=y,l.message='"'+l.input+'" is not a valid input for '+l.symbology,l}return F(k,Error),k}(),v=function(R){function k(){E(this,k);var I=A(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return I.name="InvalidElementException",I.message="Not supported type to render on",I}return F(k,Error),k}(),D=function(R){function k(){E(this,k);var I=A(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return I.name="NoElementException",I.message="No element to render on.",I}return F(k,Error),k}();b.InvalidInputException=t,b.InvalidElementException=v,b.NoElementException=D},7164:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function E(A){return A.marginTop=A.marginTop||A.margin,A.marginBottom=A.marginBottom||A.margin,A.marginRight=A.marginRight||A.margin,A.marginLeft=A.marginLeft||A.margin,A}},7020:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=D(E(4866)),v=D(E(530));function D(k){return k&&k.__esModule?k:{default:k}}b.default=function R(k){var I={};for(var y in v.default)v.default.hasOwnProperty(y)&&(k.hasAttribute("jsbarcode-"+y.toLowerCase())&&(I[y]=k.getAttribute("jsbarcode-"+y.toLowerCase())),k.hasAttribute("data-"+y.toLowerCase())&&(I[y]=k.getAttribute("data-"+y.toLowerCase())));return I.value=k.getAttribute("jsbarcode-value")||k.getAttribute("data-value"),(0,F.default)(I)}},8619:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},t=k(E(7020)),D=k(E(2233)),R=E(723);function k(u){return u&&u.__esModule?u:{default:u}}b.default=function I(u){if("string"==typeof u)return function y(u){var n=document.querySelectorAll(u);if(0!==n.length){for(var d=[],m=0;m<n.length;m++)d.push(I(n[m]));return d}}(u);if(Array.isArray(u)){for(var n=[],d=0;d<u.length;d++)n.push(I(u[d]));return n}if(typeof HTMLCanvasElement<"u"&&u instanceof HTMLImageElement)return function l(u){var n=document.createElement("canvas");return{element:n,options:(0,t.default)(u),renderer:D.default.CanvasRenderer,afterRender:function(){u.setAttribute("src",n.toDataURL())}}}(u);if(u&&u.nodeName&&"svg"===u.nodeName.toLowerCase()||typeof SVGElement<"u"&&u instanceof SVGElement)return{element:u,options:(0,t.default)(u),renderer:D.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&u instanceof HTMLCanvasElement)return{element:u,options:(0,t.default)(u),renderer:D.default.CanvasRenderer};if(u&&u.getContext)return{element:u,renderer:D.default.CanvasRenderer};if(u&&"object"===(typeof u>"u"?"undefined":A(u))&&!u.nodeName)return{element:u,renderer:D.default.ObjectRenderer};throw new R.InvalidElementException}},1301:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function E(A){var F=[];return function t(v){if(Array.isArray(v))for(var D=0;D<v.length;D++)t(v[D]);else v.text=v.text||"",v.data=v.data||"",F.push(v)}(A),F}},6017:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var E=Object.assign||function(A){for(var F=1;F<arguments.length;F++){var t=arguments[F];for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(A[v]=t[v])}return A};b.default=function(A,F){return E({},A,F)}},4866:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function E(A){var F=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in F)F.hasOwnProperty(t)&&"string"==typeof A[t=F[t]]&&(A[t]=parseInt(A[t],10));return"string"==typeof A.displayValue&&(A.displayValue="false"!=A.displayValue),A}},530:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}}},1799:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function I(y,l){for(var u=0;u<l.length;u++){var n=l[u];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(y,n.key,n)}}return function(y,l,u){return l&&I(y.prototype,l),u&&I(y,u),y}}(),t=function D(I){return I&&I.__esModule?I:{default:I}}(E(6017)),v=E(4358),k=function(){function I(y,l,u){(function R(I,y){if(!(I instanceof y))throw new TypeError("Cannot call a class as a function")})(this,I),this.canvas=y,this.encodings=l,this.options=u}return A(I,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var l=0;l<this.encodings.length;l++){var u=(0,t.default)(this.options,this.encodings[l].options);this.drawCanvasBarcode(u,this.encodings[l]),this.drawCanvasText(u,this.encodings[l]),this.moveCanvasDrawing(this.encodings[l])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var l=this.canvas.getContext("2d");l.save(),(0,v.calculateEncodingAttributes)(this.encodings,this.options,l);var u=(0,v.getTotalWidthOfEncodings)(this.encodings),n=(0,v.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=u+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,l.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(l.fillStyle=this.options.background,l.fillRect(0,0,this.canvas.width,this.canvas.height)),l.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(l,u){var m,n=this.canvas.getContext("2d"),d=u.data;m="top"==l.textPosition?l.marginTop+l.fontSize+l.textMargin:l.marginTop,n.fillStyle=l.lineColor;for(var S=0;S<d.length;S++){var _=S*l.width+u.barcodePadding;"1"===d[S]?n.fillRect(_,m,l.width,l.height):d[S]&&n.fillRect(_,m,l.width,l.height*d[S])}}},{key:"drawCanvasText",value:function(l,u){var m,S,n=this.canvas.getContext("2d");l.displayValue&&(S="top"==l.textPosition?l.marginTop+l.fontSize-l.textMargin:l.height+l.textMargin+l.marginTop+l.fontSize,n.font=l.fontOptions+" "+l.fontSize+"px "+l.font,"left"==l.textAlign||u.barcodePadding>0?(m=0,n.textAlign="left"):"right"==l.textAlign?(m=u.width-1,n.textAlign="right"):(m=u.width/2,n.textAlign="center"),n.fillText(u.text,m,S))}},{key:"moveCanvasDrawing",value:function(l){this.canvas.getContext("2d").translate(l.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),I}();b.default=k},2233:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=k(E(1799)),v=k(E(5794)),R=k(E(1138));function k(I){return I&&I.__esModule?I:{default:I}}b.default={CanvasRenderer:F.default,SVGRenderer:v.default,ObjectRenderer:R.default}},1138:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var E=function(){function t(v,D){for(var R=0;R<D.length;R++){var k=D[R];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(v,k.key,k)}}return function(v,D,R){return D&&t(v.prototype,D),R&&t(v,R),v}}(),F=function(){function t(v,D,R){(function A(t,v){if(!(t instanceof v))throw new TypeError("Cannot call a class as a function")})(this,t),this.object=v,this.encodings=D,this.options=R}return E(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();b.default=F},4358:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.getTotalWidthOfEncodings=b.calculateEncodingAttributes=b.getBarcodePadding=b.getEncodingHeight=b.getMaximumHeightOfEncodings=void 0;var F=function t(l){return l&&l.__esModule?l:{default:l}}(E(6017));function v(l,u){return u.height+(u.displayValue&&l.text.length>0?u.fontSize+u.textMargin:0)+u.marginTop+u.marginBottom}function D(l,u,n){if(n.displayValue&&u<l){if("center"==n.textAlign)return Math.floor((l-u)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(l-u)}return 0}function y(l,u,n){var d;if(n)d=n;else{if(!(typeof document<"u"))return 0;d=document.createElement("canvas").getContext("2d")}d.font=u.fontOptions+" "+u.fontSize+"px "+u.font;var m=d.measureText(l);return m?m.width:0}b.getMaximumHeightOfEncodings=function I(l){for(var u=0,n=0;n<l.length;n++)l[n].height>u&&(u=l[n].height);return u},b.getEncodingHeight=v,b.getBarcodePadding=D,b.calculateEncodingAttributes=function R(l,u,n){for(var d=0;d<l.length;d++){var _,m=l[d],S=(0,F.default)(u,m.options);_=S.displayValue?y(m.text,S,n):0;var U=m.data.length*S.width;m.width=Math.ceil(Math.max(_,U)),m.height=v(m,S),m.barcodePadding=D(_,U,S)}},b.getTotalWidthOfEncodings=function k(l){for(var u=0,n=0;n<l.length;n++)u+=l[n].width;return u}},5794:(W,b,E)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function y(l,u){for(var n=0;n<u.length;n++){var d=u[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,u,n){return u&&y(l.prototype,u),n&&y(l,n),l}}(),t=function D(y){return y&&y.__esModule?y:{default:y}}(E(6017)),v=E(4358),k="http://www.w3.org/2000/svg",I=function(){function y(l,u,n){(function R(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")})(this,y),this.svg=l,this.encodings=u,this.options=n,this.document=n.xmlDocument||document}return A(y,[{key:"render",value:function(){var u=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var d=this.encodings[n],m=(0,t.default)(this.options,d.options),S=this.createGroup(u,m.marginTop,this.svg);this.setGroupOptions(S,m),this.drawSvgBarcode(S,m,d),this.drawSVGText(S,m,d),u+=d.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,v.calculateEncodingAttributes)(this.encodings,this.options);var u=(0,v.getTotalWidthOfEncodings)(this.encodings),n=(0,v.getMaximumHeightOfEncodings)(this.encodings),d=u+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(d,n),this.options.background&&this.drawRect(0,0,d,n,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(u,n,d){var S,m=d.data;S="top"==n.textPosition?n.fontSize+n.textMargin:0;for(var _=0,U=0,G=0;G<m.length;G++)U=G*n.width+d.barcodePadding,"1"===m[G]?_++:_>0&&(this.drawRect(U-n.width*_,S,n.width*_,n.height,u),_=0);_>0&&this.drawRect(U-n.width*(_-1),S,n.width*_,n.height,u)}},{key:"drawSVGText",value:function(u,n,d){var S,_,m=this.document.createElementNS(k,"text");n.displayValue&&(m.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),_="top"==n.textPosition?n.fontSize-n.textMargin:n.height+n.textMargin+n.fontSize,"left"==n.textAlign||d.barcodePadding>0?(S=0,m.setAttribute("text-anchor","start")):"right"==n.textAlign?(S=d.width-1,m.setAttribute("text-anchor","end")):(S=d.width/2,m.setAttribute("text-anchor","middle")),m.setAttribute("x",S),m.setAttribute("y",_),m.appendChild(this.document.createTextNode(d.text)),u.appendChild(m))}},{key:"setSvgAttributes",value:function(u,n){var d=this.svg;d.setAttribute("width",u+"px"),d.setAttribute("height",n+"px"),d.setAttribute("x","0px"),d.setAttribute("y","0px"),d.setAttribute("viewBox","0 0 "+u+" "+n),d.setAttribute("xmlns",k),d.setAttribute("version","1.1"),d.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(u,n,d){var m=this.document.createElementNS(k,"g");return m.setAttribute("transform","translate("+u+", "+n+")"),d.appendChild(m),m}},{key:"setGroupOptions",value:function(u,n){u.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(u,n,d,m,S){var _=this.document.createElementNS(k,"rect");return _.setAttribute("x",u),_.setAttribute("y",n),_.setAttribute("width",d),_.setAttribute("height",m),S.appendChild(_),_}}]),y}();b.default=I}}]);
1
+ (self.webpackChunkbarcode_app=self.webpackChunkbarcode_app||[]).push([[383],{2383:(J,S,E)=>{"use strict";E.r(S),E.d(S,{PagesModule:()=>yt});var F=E(6814),A=E(915),t=E(5879),v=E(5619),M=E(2181);let R=(()=>{var p;class g{constructor(){this.store=new v.X([])}getState(){return this.store.asObservable().pipe((0,M.h)(o=>void 0!==o))}setState(o){this.store.next(o)}}return(p=g).\u0275fac=function(o){return new(o||p)},p.\u0275prov=t.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),g})();var T=E(9049),D=E(2262),y=E(8645),l=E(9773),u=E(7398),n=E(6013),d=function(p){return p[p.SUPPLIER_BILL=0]="SUPPLIER_BILL",p[p.OUTLET_DELIVERY=1]="OUTLET_DELIVERY",p}(d||{}),m=E(7700),P=E(5141),b=E(95),U=E(4807),z=E(4211);let G=(()=>{var p;class g{constructor(o,c){this.data=o,this.dialogRef=c,this.outlets=o.outlets}ngOnInit(){this.initModalConfig(),this.initTransactionType()}initModalConfig(){this.modalConfig=new P.O,this.modalConfig.title="Choose your transaction",this.modalConfig.hideMoreButton=!0}initTransactionType(){this.transactionTypes=[{title:"Supplier Bill",type:d.SUPPLIER_BILL},{title:"Transfer Order",type:d.OUTLET_DELIVERY}]}onOk(){this.selectedOutlet&&this.poNumber&&this.dialogRef.close({Outlet:this.selectedOutlet.Name,Number:this.poNumber,Type:this.selectedTransactionType})}onCancel(){this.dialogRef.close()}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(m.WI),t.Y36(m.so))},p.\u0275cmp=t.Xpm({type:p,selectors:[["app-form-add-bill"]],decls:18,vars:10,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["bindLabel","title","bindValue","type","placeholder","Choose Type",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"pt-6"],["bindLabel","Name","placeholder","Choose Outlet",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"form-label-group"],["min","1","id","qty","type","text","placeholder","Invoice Number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["for","qty"]],template:function(o,c){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return c.onOk()})("onCancel",function(){return c.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"table",3)(5,"tbody")(6,"tr",4)(7,"td")(8,"ng-select",5),t.NdJ("ngModelChange",function(V){return c.selectedTransactionType=V}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td",6)(11,"ng-select",7),t.NdJ("ngModelChange",function(V){return c.selectedOutlet=V}),t.qZA()()(),t.TgZ(12,"tr",4)(13,"td",6)(14,"div",8)(15,"input",9),t.NdJ("ngModelChange",function(V){return c.poNumber=V}),t.qZA(),t.TgZ(16,"label",10),t._uU(17,"Invoice Number"),t.qZA()()()()()()()()()()),2&o&&(t.Q6J("config",c.modalConfig),t.xp6(8),t.Q6J("items",c.transactionTypes)("ngModel",c.selectedTransactionType)("clearable",!1)("appendTo","body"),t.xp6(3),t.Q6J("items",c.outlets)("ngModel",c.selectedOutlet)("clearable",!1)("appendTo","body"),t.xp6(4),t.Q6J("ngModel",c.poNumber))},dependencies:[b.Fj,b.JJ,b.On,U.w9,z.M]}),g})();var X=E(9397),pe=E(7081),ce=E(631);let de=(()=>{var p;class g{constructor(o){this.httpService=o,this.barcodeConfigState=new v.X(null)}updatePaperFormatConfig(o){let c=localStorage.getItem("Domain");return this.httpService.post("/api/Config/SaveConfig",{SubDomain:c,Version:this.paperFormatVersion,PaperFormats:o})}getPaperFormatConfig(){let o=localStorage.getItem("Domain"),c=[];return this.httpService.post("/api/Config/PaperConfig",{SubDomain:o}).pipe((0,u.U)(W=>(this.paperFormatVersion=W.version,c=W.PaperFormats,{paperFormat:c,outlets:W.Outlets})),(0,pe.d)(1))}setBarcodeConfigState(o){this.barcodeConfigState.next(o)}getBarcodeConfigState(){return this.barcodeConfigState.asObservable().pipe((0,M.h)(o=>n.gT.IsNotEmpty(o)))}}return(p=g).\u0275fac=function(o){return new(o||p)(t.LFG(ce.O))},p.\u0275prov=t.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),g})();var ke=E(9862),Ne=E(4664);class Q{constructor(g){g&&(this.AccountID=g.AccountID,this.CalculationTypeID=g.CalculationTypeID,this.ID=g.ID,this.Index=g.Index,this.Label=g.Label,this.MultipleTaxTypeID=g.MultipleTaxTypeID,this.Note=g.Note,this.PrintVisible=g.PrintVisible,this.Rate=g.Rate,this.TypeID=g.TypeID,this.Name=g.Name,this.Type=g.Type)}get getID(){return this.ID}get getType(){return this.Type}get getName(){return this.Name}get getAccountID(){return this.AccountID}set setAccountId(g){this.AccountID=g}get getCalculationTypeID(){return this.CalculationTypeID}set setCalculationID(g){this.CalculationTypeID=g}get getRate(){return this.Rate}set setRate(g){this.Rate=g}get getLabel(){return this.Label}}class ee{get getPricebooks(){return this.Pricebook}set setPricebooks(g){this.Pricebook=g}get getPriceDiscount(){return this.PriceDiscount}set setPriceDiscount(g){this.PriceDiscount=g}get getReleaseDate(){return this.ReleasedDate}set setReleaseDate(g){this.ReleasedDate=g}get getID(){return this.ID}set setID(g){this.ID=g}get getSelectedPromotion(){return this.SelectedPromotion}set setSelectedPromotion(g){this.SelectedPromotion=g}get getDescription(){return this.description}set setDescription(g){this.description=g}set setBarcodeTitle(g){this.barcodeTitle=g}get getBarcodeTitle(){return this.barcodeTitle}set setCustomPrice(g){this.customPrice=g}get getCustomPrice(){return this.customPrice}get getUnitPrice(){return this.UnitPrice}set setUnitPrice(g){this.UnitPrice=g}get getCode(){return this.Code}set setCode(g){this.barcodeTitle=g,this.Code=g}get getModel(){return this.Model}set setModel(g){this.Model=g}get getName(){return this.Name}set setName(g){this.Name=g}get getCurrency(){return this.CurrencySymbol}set setCurrency(g){this.CurrencySymbol=g}}class ne{get getCode(){return this.Code}get getName(){return this.Name}get getSuspended(){return this.Suspended}set setCode(g){this.Code=g}set setName(g){this.Name=g}set setSuspended(g){this.Suspended=g}}class Y{get getOutlet(){return this.Outlet}get getNumber(){return this.Number}get getDate(){return this.Date}get getDueDate(){return this.DueDate}get getSupplier(){return this.Supplier}get getCreatorID(){return this.CreatorID}get getCreated(){return this.Created}get getDiscount1(){return this.Discount1}get getDiscountAmount(){return this.DiscountAmount}get getGross(){return this.Gross}get getDiscountTotal(){return this.DiscountTotal}get getTaxType(){return this.TaxType}get getTax(){return this.Tax}get getPurchase(){return this.Purchase}get getPurchaseNTax(){return this.PurchaseNTax}get getDelivery(){return this.Delivery}get getVariants(){return this.Variants}get getPayments(){return this.Payments}set setOutlet(g){this.Outlet=g}set setNumber(g){this.Number=g}set setDate(g){this.Date=g}set setDueDate(g){this.DueDate=g}set setSupplier(g){this.Supplier=g}set setCreatorID(g){this.CreatorID=g}set setCreated(g){this.Created=g}set setDiscount1(g){this.Discount1=g}set setDiscountAmount(g){this.DiscountAmount=g}set setGross(g){this.Gross=g}set setDiscountTotal(g){this.DiscountTotal=g}set setTaxType(g){this.TaxType=g}set setTax(g){this.Tax=g}set setPurchase(g){this.Purchase=g}set setPurchaseNTax(g){this.PurchaseNTax=g}set setDelivery(g){this.Delivery=g}set setVariants(g){this.Variants=g}set setPayments(g){this.Payments=g}}class K extends ee{constructor(){super()}get getVariantID(){return this.VariantID}get getQuantity(){return this.Quantity}get getPrice(){return this.Price}get getDiscount(){return this.Discount}get getNettPrice(){return this.NettPrice}set setVariantID(g){this.VariantID=g}set setQuantity(g){this.Quantity=g}set setPrice(g){this.Price=g}set setDiscount(g){this.Discount=g}set setNettPrice(g){this.NettPrice=g}}class se{get getID(){return this.ID}set setID(g){this.ID=g}get getName(){return this.Name}set setName(g){this.Name=g}get getDiscount(){return this.Discount}get getExtraCost(){return this.ExtraCost}get getPromotionID(){return this.PromotionID}get getUnitPrice(){return this.UnitPrice}set setDiscount(g){this.Discount=g}set setExtraCost(g){this.ExtraCost=g}set setPromotionID(g){this.PromotionID=g}set setUnitPrice(g){this.UnitPrice=g}}let be=(()=>{var p;class g{constructor(){this.outletID=null,this.outletName=""}}return(p=g).\u0275fac=function(o){return new(o||p)},p.\u0275prov=t.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),g})(),le=(()=>{var p;class g{constructor(o){this.outlet=o}getProductModel(o){let c=new ee;c.setID=o.ID,c.setCode=o.Code,c.setCurrency=o.CurrencySymbol,c.setModel=o.Model,c.setName=o.Name,c.setUnitPrice=o.UnitPrice,c.setDescription=o.Description,c.setReleaseDate=o.ReleasedDate,c.setPriceDiscount=o.PriceDiscount;const V=o.OutletPrice?.find(W=>W.Outlet==this.outlet.outletName);return V&&(c.setUnitPrice=V.Price,c.setPriceDiscount=V.PriceDiscount),c.setPricebooks=o.Pricebook,c}getTaxModel(o){return new Q(o)}getOutletModel(o){let c=new ne;return c.setCode=o.Code,c.setName=o.Name,c.setSuspended=o.Suspended,c}getVariantModel(o){let c=new K;return c.setCode=o.Code,c.setDiscount=o.Discount,c.setNettPrice=o.NettPrice,c.setPrice=o.Price,c.setUnitPrice=o.UnitPrice,c.setQuantity=o.Quantity,c.setVariantID=o.VariantID,c.setName=o.Name,c}getBillModel(o){let c=new Y;return c.setNumber=o.Number,c.setOutlet=o.Outlet,c.setVariants=o.Variants?o.Variants.map(_=>this.getVariantModel(_)):[],c}getPromotionModel(o){let c=new se;return c.setDiscount=o.Discount,c.setExtraCost=o.ExtraCost,c.setPromotionID=o.PromotionID,c.setUnitPrice=o.UnitPrice,c.setName=o.Name,c.setID=o.ID,c}}return(p=g).\u0275fac=function(o){return new(o||p)(t.LFG(be))},p.\u0275prov=t.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),g})(),ue=(()=>{var p;class g{constructor(o,c,_,V,W){this.httpService=o,this.http=c,this.factoryService=_,this.outlet=V,this.barcodeService=W}getProductById(o){let c=localStorage.getItem("Domain");return this.barcodeService.getBarcodeConfigState().pipe((0,Ne.w)(_=>this.httpService.post(`https://${c}/API/V3/Variant/ID`,{ID:o,EntityID:n.gT.IsNotEmpty(_.OutletID)?_.OutletID:n.gT.GuidEmpty})),(0,u.U)(_=>this.factoryService.getProductModel(_)))}getPromotionByProducID(o){let c=localStorage.getItem("Domain");return this.httpService.post(`https://${c}/API/v3/PromotionEvent/GetByVariantID`,{VariantID:o}).pipe((0,u.U)(_=>_.map(W=>this.factoryService.getPromotionModel(W))))}uploadProducts(o){let c=localStorage.getItem("Domain"),_=new FormData;return _.append("file",o,o.name),_.append("OutletID",String(this.outlet.outletID)),this.httpService.postFormData(`https://${c}/API/catalog/product/UploadCSVforBarcode`,_).pipe((0,u.U)(V=>V.map(W=>(W.Print=W.Print.map(te=>this.factoryService.getProductModel(te)),W))))}getTax(){let o=localStorage.getItem("Domain"),c=localStorage.getItem("Token"),_=`https://${o}/API/V3/Tax`,V=new ke.WM({authorization:"Bearer "+c,"content-type":"application/json","X-ClientId":"dealpos-app"});return this.http.get(_,{headers:V}).pipe((0,u.U)(W=>{if(W)return W.map(te=>this.factoryService.getTaxModel(te))}))}}return(p=g).\u0275fac=function(o){return new(o||p)(t.LFG(ce.O),t.LFG(ke.eN),t.LFG(le),t.LFG(be),t.LFG(de))},p.\u0275prov=t.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),g})();var qe=E(6608);let xe=(()=>{var p;class g{set _max(o){o&&(this.max=o,this.updateNumericSettings())}set _min(o){o&&(this.min=o,this.updateNumericSettings())}constructor(o){this.elementRef=o,this.decimalPlaces=4,this.modifyValueOnWheel=!0,this.max="999999999999999.9999",this.min="-999999999999999.9999",this.propagateChange=_=>{},this.preventNegative=!1,this.numericElement=new qe(this.elementRef.nativeElement,null,{digitGroupSeparator:",",decimalCharacter:".",decimalPlaces:this.decimalPlaces,maximumValue:this.max,minimumValue:this.min,allowDecimalPadding:!1,showWarnings:!1})}ngOnInit(){""==this.percentage&&(this.max="100"),this.preventNegative&&(this.min="0.00"),this.updateNumericSettings()}updateNumericSettings(){const o={maximumValue:this.max,minimumValue:this.min,readOnly:this.isElementDisabled(),decimalPlaces:this.decimalPlaces,modifyValueOnWheel:this.modifyValueOnWheel};this.numericElement.update(o)}onKeyUp(){let o=this.numericElement.getNumber();this.propagateChange(o)}isElementDisabled(){let o=!1;return(!0===this.elementRef.nativeElement.readOnly||!0===this.elementRef.nativeElement.disabled)&&(o=!0),o}writeValue(o){null!=o&&this.numericElement.set(o)}registerOnChange(o){this.propagateChange=o}registerOnTouched(){}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(t.SBq))},p.\u0275dir=t.lG2({type:p,selectors:[["","autoNum",""]],hostBindings:function(o,c){1&o&&t.NdJ("keyup",function(){return c.onKeyUp()})},inputs:{percentage:"percentage",preventNegative:"preventNegative",decimalPlaces:"decimalPlaces",modifyValueOnWheel:"modifyValueOnWheel",_max:["max","_max"],_min:["min","_min"]},features:[t._Bn([{provide:b.JU,useExisting:(0,t.Gpc)(()=>p),multi:!0}])]}),g})();var Ae=E(2065),ye=E(3620),N=E(3680);const ve=["input"];function Te(p,g){if(1&p&&t._UZ(0,"img",10),2&p){const w=t.oxw().$implicit;t.Q6J("src",w.ImgUrl,t.LSH)}}function Je(p,g){if(1&p){const w=t.EpF();t.TgZ(0,"mat-option",8),t.NdJ("click",function(c){const V=t.CHM(w).$implicit;return t.oxw().changeDisplayName(V),t.KtG(c.stopPropagation())}),t.YNc(1,Te,1,1,"img",9),t._uU(2),t.qZA()}if(2&p){const w=g.$implicit,o=t.oxw();t.Q6J("value",w),t.xp6(1),t.Q6J("ngIf",o.renderThumbnail&&w.ImgUrl),t.xp6(1),t.hij(" ",w.Value," ")}}let We=(()=>{var p;class g{set display(o){this.input.nativeElement.value=o}get value(){return this._value}set value(o){this._value=o,this.propagateChange(this._value)}constructor(o,c){this.httpService=o,this.ngZone=c,this.offlineStorage=[],this.inputLock=!1,this.renderThumbnail=!1,this.onOffline=new t.vpe,this.onEnter=new t.vpe,this.onSelect=new t.vpe,this.onOptionSelect=new t.vpe,this.reset=new t.vpe,this.termControl=new b.p4(""),this.options=[],this.complete=!1,this.foundProduct=!1,this.propagateChange=_=>{},this.termControl.valueChanges.pipe((0,ye.b)(500)).subscribe(_=>{this.options=[],"object"==typeof _?(this.value=_.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(_.Value),this.complete=!0),this.onSelect&&this.onSelect.emit(_.Key),this.options=[],"object"==typeof _&&(this.value=_.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(_.Value),this.complete=!0),this.onOptionSelect)&&this.onOptionSelect.emit(JSON.stringify({Key:_.Key,Value:_.Value}))):"string"==typeof _&&_.length>0?_.length>2&&!this.inputLock&&this.search(_):this.clear()})}ngOnChanges(o){null!=o.ngModel&&null==o.ngModel.currentValue&&this.clear(),null!=o.display&&o.display.currentValue!=o.display.previousValue&&this.termControl.setValue(o.display.currentValue)}ngAfterViewInit(){}search(o){if(this.termControl.value.length>0){let c={};if(this.data&&(c=this.data),c.prefix=o,c.count=100,this.complete)this.complete=!1;else{let _=this.url,V=localStorage.getItem("Domain");V&&(_=`https://${V}${this.url}`),this.httpService.post(_,c).subscribe(W=>{this.options=W,this.foundProduct=this.options.length>0})}}else this.options=null}onblur(){setTimeout(()=>{},600)}changeDisplayName(o){this.input.nativeElement.value=o.Value}onKeydown(o){const c=o.key;"Enter"===c?(this.clearOnSelect&&this.clear(),!this.foundProduct&&this.termControl.value.length>0&&(this.onEnter.emit(this.termControl.value),o.stopPropagation()),null!=this.termControl.value&&(this.input.nativeElement.value=this.termControl.value.Value),this.foundProduct=!1):(this.inputLock&&("Backspace"===c?this.clear():this.validateInputLock()),this.complete=!1,this.reset.emit())}validateInputLock(){""==this.input.nativeElement.value||0==this.input.nativeElement.value.length?this.startInput=new Date:(new Date).getTime()-this.startInput.getTime()>500&&this.clear()}clear(){this.value=null,this.input.nativeElement.value=""}displayFn(o){return o&&o.Value}writeValue(o){}registerOnChange(o){this.propagateChange=o}registerOnTouched(){}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(ce.O),t.Y36(t.R0b))},p.\u0275cmp=t.Xpm({type:p,selectors:[["autocomplete"]],viewQuery:function(o,c){if(1&o&&t.Gf(ve,7),2&o){let _;t.iGM(_=t.CRH())&&(c.input=_.first)}},inputs:{placeholder:"placeholder",url:"url",clearOnSelect:"clearOnSelect",offlineStorage:"offlineStorage",inputLock:"inputLock",data:"data",renderThumbnail:"renderThumbnail",ngModel:"ngModel",displayText:"displayText",localStorage:"localStorage",_value:"_value",display:"display"},outputs:{onOffline:"onOffline",onEnter:"onEnter",onSelect:"onSelect",onOptionSelect:"onOptionSelect",reset:"reset"},features:[t._Bn([{provide:b.JU,useExisting:(0,t.Gpc)(()=>p),multi:!0}]),t.TTD],decls:9,vars:5,consts:[[1,"w-100"],[1,"form-label-group"],["id","input","type","text","matInput","",1,"form-control","text-black",3,"matAutocomplete","placeholder","formControl","paste","keydown","blur"],["input",""],["for","input"],["autoActiveFirstOption","true"],["autocomplete","matAutocomplete"],["class","option-autocomplete",3,"value","click",4,"ngFor","ngForOf"],[1,"option-autocomplete",3,"value","click"],["width","30","height","30",3,"src",4,"ngIf"],["width","30","height","30",3,"src"]],template:function(o,c){if(1&o&&(t.TgZ(0,"mat-form-field",0)(1,"div",1)(2,"input",2,3),t.NdJ("paste",function(V){return c.inputLock?V.preventDefault():""})("keydown",function(V){return c.onKeydown(V)})("blur",function(){return c.onblur()}),t.qZA(),t.TgZ(4,"label",4),t._uU(5),t.qZA()()(),t.TgZ(6,"mat-autocomplete",5,6),t.YNc(8,Je,3,3,"mat-option",7),t.qZA()),2&o){const _=t.MAs(7);t.xp6(2),t.s9C("placeholder",c.placeholder||""),t.Q6J("matAutocomplete",_)("formControl",c.termControl),t.xp6(3),t.Oqu(c.placeholder||""),t.xp6(3),t.Q6J("ngForOf",c.options)}},dependencies:[Ae.XC,N.ey,Ae.ZL,F.sg,F.O5,b.Fj,b.JJ,b.oH],styles:["mat-option[_ngcontent-%COMP%]{font-size:12px}"]}),g})(),Be=(()=>{var p;class g{}return(p=g).\u0275fac=function(o){return new(o||p)},p.\u0275mod=t.oAB({type:p}),p.\u0275inj=t.cJS({imports:[Ae.Bb,F.ez,b.UX]}),g})(),Fe=(()=>{var p;class g{constructor(o,c,_,V,W){this.dialogRef=o,this.barcodeService=c,this.productService=_,this.authenticationService=V,this.data=W,this.modalConfig=new P.O,this.variantName="",this.hasProductEdit=!0,this.hasPromotion=!1,this.destroy$=new y.x,this.variantName=W.variantName,this.qty=W.qty,this.customPrice=W.customPrice}ngOnInit(){this.getBarcodeConfig(),this.initModalConfig(),this.initProductUpdate(),this.initRoleProductEdit()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initRoleProductEdit(){let o=this.authenticationService.getRoles();this.hasProductEdit=-1!==o.findIndex(c=>"ProdE"==c)}initProductUpdate(){n.gT.IsNotEmpty(this.data.variantId)&&this.getProductById(this.data.variantId).subscribe(o=>{this.product.setSelectedPromotion=this.data.promotion,this.hasPromotion=n.gT.IsNotEmpty(this.data.promotion)})}getBarcodeConfig(){this.barcodeService.getBarcodeConfigState().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&(this.paperFormat=o)})}initModalConfig(){this.modalConfig.title="Add New Product Barcode?",this.modalConfig.hideMoreButton=!0}onSelectProduct(o){this.getProductById(o).subscribe(c=>{this.customPrice=c.getUnitPrice,this.hasPromotion=!1,this.product.setSelectedPromotion=null})}getProductById(o){return this.productService.getProductById(o).pipe((0,X.b)(c=>{this.product=c,this.getPromotionByProductID(o)}))}getPromotionByProductID(o){this.productService.getPromotionByProducID(o).subscribe(c=>{this.promotions=c})}onCustomPriceChange(o){this.customPrice=o}onSelectPromotion(o){o?(this.product.setSelectedPromotion=this.promotions.find(c=>c.getName==o?.getName),this.customPrice=this.product.getUnitPrice,this.hasPromotion=n.gT.IsNotEmpty(this.product.getSelectedPromotion)):(this.hasPromotion=!1,this.product.setSelectedPromotion=null)}onOk(){this.qty&&this.qty>0&&this.product&&this.dialogRef.close({customPrice:this.customPrice,product:this.product,quantity:this.qty})}onCancel(){this.dialogRef.close()}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(m.so),t.Y36(de),t.Y36(ue),t.Y36(T.$),t.Y36(m.WI))},p.\u0275cmp=t.Xpm({type:p,selectors:[["app-form-add-variant"]],features:[t._Bn([F.JJ])],decls:24,vars:7,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["placeholder","Name","url","/API/AC/GetVariantSuggestionByCodeNName",3,"display","onSelect"],[1,"form-label-group"],["id","qty","type","text","placeholder","Quantity","aria-label","width","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","qty"],[1,"pb-9"],["bindLabel","Name","bindValue","PromotionID","appendTo","body","placeholder","Select Promotion Price",1,"sticky-top","tall",3,"items","ngModel","change"],["placeholder","Price","aria-label","width","autoNum","",1,"form-control",3,"ngModel","readonly","ngModelChange"],["for","price"]],template:function(o,c){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return c.onOk()})("onCancel",function(){return c.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"table",3)(5,"tbody")(6,"tr",4)(7,"td")(8,"autocomplete",5),t.NdJ("onSelect",function(V){return c.onSelectProduct(V)}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td")(11,"div",6)(12,"input",7),t.NdJ("ngModelChange",function(V){return c.qty=V}),t.qZA(),t.TgZ(13,"label",8),t._uU(14,"Quantity"),t.qZA()()()(),t.TgZ(15,"tr",4)(16,"td",9)(17,"ng-select",10),t.NdJ("change",function(V){return c.onSelectPromotion(V)}),t.qZA()()(),t.TgZ(18,"tr",4)(19,"td")(20,"div",6)(21,"input",11),t.NdJ("ngModelChange",function(V){return c.onCustomPriceChange(V)}),t.qZA(),t.TgZ(22,"label",12),t._uU(23,"Price"),t.qZA()()()()()()()()()()),2&o&&(t.Q6J("config",c.modalConfig),t.xp6(8),t.Q6J("display",c.variantName),t.xp6(4),t.Q6J("ngModel",c.qty),t.xp6(5),t.Q6J("items",c.promotions)("ngModel",null==c.product||null==c.product.getSelectedPromotion?null:c.product.getSelectedPromotion.getPromotionID),t.xp6(4),t.Q6J("ngModel",c.customPrice)("readonly",c.hasPromotion||!c.hasProductEdit))},dependencies:[b.Fj,b.JJ,b.On,U.w9,z.M,xe,We]}),g})(),Ke=(()=>{var p;class g{constructor(o,c){this.dialogRef=o,this.data=c,this.event=new t.vpe,this.modalConfig=new P.O}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig.title="Upload New Product Barcode?",this.modalConfig.hideMoreButton=!0}onOk(){this.dialogRef.close(this.files)}onCancel(){this.dialogRef.close()}onUploadFile(o){o&&(this.files=o.target.files)}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(m.so),t.Y36(m.WI))},p.\u0275cmp=t.Xpm({type:p,selectors:[["app-form-upload-variant"]],outputs:{event:"event"},decls:15,vars:1,consts:[[3,"config","onOk","onCancel"],[1,"row"],[1,"col-sm-12"],["href","//res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",2,"font-size","12px"],[1,"value-title"],["type","file","aria-label","upload",3,"change"]],template:function(o,c){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return c.onOk()})("onCancel",function(){return c.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"a",3),t._uU(5,"Download Sample CSV"),t.qZA(),t.TgZ(6,"table")(7,"tbody")(8,"tr")(9,"th",4),t._uU(10,"CSV File"),t.qZA(),t.TgZ(11,"td"),t._uU(12,":"),t.qZA(),t.TgZ(13,"td")(14,"input",5),t.NdJ("change",function(V){return c.onUploadFile(V)}),t.qZA()()()()()()()()()),2&o&&t.Q6J("config",c.modalConfig)},dependencies:[z.M]}),g})();var Ve=E(9229);let _e=(()=>{var p;class g{constructor(o,c){this.httpService=o,this.factoryService=c}get(){let c=localStorage.getItem("Domain");return this.httpService.post(`https://${c}/api/v3/Outlet/p`,{Suspended:!1}).pipe((0,u.U)(_=>{let V=[];return _&&(V=_.map(W=>this.factoryService.getOutletModel(W))),V}))}}return(p=g).\u0275fac=function(o){return new(o||p)(t.LFG(ce.O),t.LFG(le))},p.\u0275prov=t.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),g})(),Ue=(()=>{var p;class g{constructor(o,c){this.httpService=o,this.factoryService=c}get(o){let c=localStorage.getItem("Domain"),_=this.getEndPointByType(o.Type);return this.httpService.post(`https://${c}${_}`,{Outlet:o.Outlet,Number:o.Number}).pipe((0,u.U)(W=>W.map(te=>this.factoryService.getVariantModel(te))))}getEndPointByType(o){let c;return c=o===d.SUPPLIER_BILL?"/API/V3/Barcode/byBillNumber":"/API/V3/Barcode/byOutletDeliveryNumber",c}}return(p=g).\u0275fac=function(o){return new(o||p)(t.LFG(ce.O),t.LFG(le))},p.\u0275prov=t.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),g})();function Me(p,g){if(1&p){const w=t.EpF();t.TgZ(0,"tr",22),t.NdJ("click",function(){const c=t.CHM(w),_=c.$implicit,V=c.index,W=t.oxw();return t.KtG(W.onUpdateProduct(_,V))}),t.TgZ(1,"td")(2,"i",23),t.NdJ("click",function(){const _=t.CHM(w).index,V=t.oxw();return t.KtG(V.onDeleteProduct(_))}),t.qZA()(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",24),t._uU(6),t.qZA()()}if(2&p){const w=g.$implicit;t.xp6(4),t.AsE(" ",null==w||null==w.Variants[0]?null:w.Variants[0].getName,"- ",null==w||null==w.Variants[0]?null:w.Variants[0].getCode," - "),t.xp6(2),t.Oqu(null==w?null:w.Quantity)}}let He=(()=>{var p;class g{constructor(o,c,_,V,W,te,re,ie){this.dialog=o,this.productStateService=c,this.productService=_,this.toastService=V,this.queryParamService=W,this.outletService=te,this.billService=re,this.barcodeService=ie,this.destroy$=new y.x,this.stickerTotal=0,this.productGroups=[],this.productSource=[],this.getRouteParam(),this.initOutlets()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getRouteParam(){this.queryParamService.getState().pipe((0,l.R)(this.destroy$),(0,M.h)(o=>n.gT.IsEmpty(o))).subscribe(o=>{o?.ID&&this.getProductById(o.ID,5),o.billNumber&&this.getBill({Number:o.billNumber,Outlet:o.outletName,Type:d.SUPPLIER_BILL})})}initOutlets(){this.barcodeService.getPaperFormatConfig().pipe((0,u.U)(o=>o.outlets),(0,l.R)(this.destroy$)).subscribe(o=>{this.outlets=o})}onAddBill(){this.dialog.open(G,{width:"350px",data:{outlets:this.outlets}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&this.getBill(o)})}getBill(o){this.billService.get(o).pipe((0,l.R)(this.destroy$)).subscribe(c=>{c&&c.forEach(_=>{this.checkAvailableProductCode(_);let V=this.generateProductByQty(_,_.getQuantity);this.productGroups=[...this.productGroups,{VariantID:_.getVariantID,Quantity:_.getQuantity,Variants:V}],this.updateProductsSource()})})}onAddProduct(){this.dialog.open(Fe,{width:"350px",data:{variantName:"",variantId:null,qty:null}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&(this.customPrice=o.customPrice,this.generateProductBarcode(o.product,o.quantity))})}getProductById(o,c){this.productService.getProductById(o).pipe((0,l.R)(this.destroy$)).subscribe(_=>{_&&this.generateProductBarcode(_,c)})}generateProductBarcode(o,c){this.checkAvailableProductCode(o);let _=this.generateProductByQty(o,c);_=this.updateCustomPriceProducts(_),this.productGroups=[...this.productGroups,{VariantID:o.getID,Quantity:c,Variants:_}],this.updateProductsSource()}checkAvailableProductCode(o){o.getCode||this.toastService.error("Product has no code","Code Not Found")}onUpdateProduct(o,c){this.dialog.open(Fe,{width:"350px",data:{variantName:o.Variants[0].getName+" - "+o.Variants[0].getCode,variantId:o.VariantID,qty:o.Quantity,customPrice:o.Variants[0].getCustomPrice,promotion:o.Variants[0].getSelectedPromotion}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(fe=>{if(fe){this.customPrice=fe.customPrice,this.checkAvailableProductCode(fe.product);let Ge=this.generateProductByQty(fe.product,fe.quantity);Ge=this.updateCustomPriceProducts(Ge),this.productGroups[c].Variants=Ge,this.productGroups[c].Quantity=fe.quantity,this.productGroups[c].VariantID=fe.product.getID,this.updateProductsSource()}})}onDeleteProduct(o){this.productGroups=this.productGroups.filter((c,_)=>_!==o),this.updateProductsSource()}updateProductsSource(){this.productSource=[],this.productGroups.forEach(o=>{this.productSource=[...this.productSource,...o.Variants]}),this.stickerTotal=this.productSource.length,this.productStateService.setState(this.productSource)}onUploadProduct(){this.dialog.open(Ke,{width:"350px"}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{if(o){let c;this.productService.uploadProducts(o[0]).pipe((0,l.R)(this.destroy$)).subscribe(_=>{_&&(this.productGroups=[...this.productGroups,..._.map(V=>(c={Quantity:V.Quantity,VariantID:V.VariantID,Variants:V.Print},c))],this.updateProductsSource())})}})}updateCustomPriceProducts(o){let c=o;return this.customPrice&&(c=o.map(_=>(_.setCustomPrice=this.customPrice,_))),c}generateProductByQty(o,c){let _=[];for(let V=1;V<=c;V++)_.push(o);return _}onClear(){this.productGroups=[],this.updateProductsSource()}onPrint(){window.print()}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(m.uw),t.Y36(R),t.Y36(ue),t.Y36(Ve._W),t.Y36(D.U),t.Y36(_e),t.Y36(Ue),t.Y36(de))},p.\u0275cmp=t.Xpm({type:p,selectors:[["app-list-products"]],decls:33,vars:2,consts:[[1,"card","mt-3","sticky-top"],[1,"card-header","d-flex","justify-content-between","align-items-center","bg-white","pb-5",2,"border","none"],[1,"fw-light","m-1"],[1,"ms-1","fst-italic","text-info","d-block","mt-1"],[1,"btn-group"],["type","button",1,"btn-md","btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-plus"],["aria-hidden","true",1,"fa","fa-upload"],[1,"card-body","py-0"],[1,"table","table-borderless","table-fixed"],[1,"table-light","lh-1"],["scope","col"],["scope","col",1,"text-end"],[3,"click",4,"ngFor","ngForOf"],[1,"card-footer","bg-white","py-8","p-0"],[1,"row"],[1,"col-6","d-flex","justify-content-start"],[1,"btn","btn-xl","btn-outline-secondary",3,"click"],[1,"fa-regular","fa-file-lines","me-2"],[1,"col-6","d-flex","justify-content-end"],[1,"btn","btn-xl","btn-outline-secondary","ms-5",3,"click"],[1,"btn","btn-xl","btn-success","ms-5",3,"click"],[3,"click"],["aria-hidden","true",1,"fa","fa-times",2,"color","#fb404b !important","cursor","pointer",3,"click"],[1,"text-end"]],template:function(o,c){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h1",2),t._uU(3," Products "),t.TgZ(4,"small",3),t._uU(5),t.qZA()(),t.TgZ(6,"div",4)(7,"button",5),t.NdJ("click",function(){return c.onAddProduct()}),t._UZ(8,"i",6),t.qZA(),t.TgZ(9,"button",5),t.NdJ("click",function(){return c.onUploadProduct()}),t._UZ(10,"i",7),t.qZA()()(),t.TgZ(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr"),t._UZ(15,"th",11),t.TgZ(16,"th",11),t._uU(17,"NAME"),t.qZA(),t.TgZ(18,"th",12),t._uU(19,"QTY"),t.qZA()()(),t.TgZ(20,"tbody"),t.YNc(21,Me,7,3,"tr",13),t.qZA()()(),t.TgZ(22,"div",14)(23,"div",15)(24,"div",16)(25,"a",17),t.NdJ("click",function(){return c.onAddBill()}),t._UZ(26,"i",18),t._uU(27," Load Transaction "),t.qZA()(),t.TgZ(28,"div",19)(29,"a",20),t.NdJ("click",function(){return c.onClear()}),t._uU(30,"Clear"),t.qZA(),t.TgZ(31,"a",21),t.NdJ("click",function(){return c.onPrint()}),t._uU(32,"Print"),t.qZA()()()()()),2&o&&(t.xp6(5),t.hij("( ",0===c.stickerTotal?"":c.stickerTotal," stickers )"),t.xp6(16),t.Q6J("ngForOf",c.productGroups))},dependencies:[F.sg],styles:["td[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{font-size:12px}.btn[_ngcontent-%COMP%]{font-size:14px!important}"]}),g})();var Qe=E(4802),Se=E(2495);let Ye=(()=>{var p;class g{constructor(){this._listeners=[]}notify(o,c){for(let _ of this._listeners)_(o,c)}listen(o){return this._listeners.push(o),()=>{this._listeners=this._listeners.filter(c=>o!==c)}}ngOnDestroy(){this._listeners=[]}}return(p=g).\u0275fac=function(o){return new(o||p)},p.\u0275prov=t.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),g})();const Xe=["input"],lt=["*"];let s=0;class k{constructor(g,w){this.source=g,this.value=w}}const I={provide:b.JU,useExisting:(0,t.Gpc)(()=>C),multi:!0},B=new t.OlP("MatRadioGroup"),e=new t.OlP("mat-radio-default-options",{providedIn:"root",factory:function i(){return{color:"accent"}}});let a=(()=>{var p;class g{get name(){return this._name}set name(o){this._name=o,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(o){this._labelPosition="before"===o?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(o){this._selected=o,this.value=o?o.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(o){this._disabled=(0,Se.Ig)(o),this._markRadiosForCheck()}get required(){return this._required}set required(o){this._required=(0,Se.Ig)(o),this._markRadiosForCheck()}constructor(o){this._changeDetector=o,this._value=null,this._name="mat-radio-group-"+s++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new t.vpe}ngAfterContentInit(){this._isInitialized=!0,this._buttonChanges=this._radios.changes.subscribe(()=>{this.selected&&!this._radios.find(o=>o===this.selected)&&(this._selected=null)})}ngOnDestroy(){this._buttonChanges?.unsubscribe()}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(o=>{o.name=this.name,o._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(c=>{c.checked=this.value===c.value,c.checked&&(this._selected=c)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new k(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(o=>o._markForCheck())}writeValue(o){this.value=o,this._changeDetector.markForCheck()}registerOnChange(o){this._controlValueAccessorChangeFn=o}registerOnTouched(o){this.onTouched=o}setDisabledState(o){this.disabled=o,this._changeDetector.markForCheck()}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(t.sBO))},p.\u0275dir=t.lG2({type:p,inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required"},outputs:{change:"change"}}),g})();class r{constructor(g){this._elementRef=g}}const h=(0,N.Kr)((0,N.sb)(r));let O=(()=>{var p;class g extends h{get checked(){return this._checked}set checked(o){const c=(0,Se.Ig)(o);this._checked!==c&&(this._checked=c,c&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!c&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),c&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===o),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(o){this._labelPosition=o}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(o){this._setDisabled((0,Se.Ig)(o))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(o){this._required=(0,Se.Ig)(o)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(o){this._color=o}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(o,c,_,V,W,te,re,ie){super(c),this._changeDetector=_,this._focusMonitor=V,this._radioDispatcher=W,this._providerOverride=re,this._uniqueId="mat-radio-"+ ++s,this.id=this._uniqueId,this.change=new t.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=o,this._noopAnimations="NoopAnimations"===te,ie&&(this.tabIndex=(0,Se.su)(ie,0))}focus(o,c){c?this._focusMonitor.focusVia(this._inputElement,c,o):this._inputElement.nativeElement.focus(o)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name),this._removeUniqueSelectionListener=this._radioDispatcher.listen((o,c)=>{o!==this.id&&c===this.name&&(this.checked=!1)})}ngDoCheck(){this._updateTabIndex()}ngAfterViewInit(){this._updateTabIndex(),this._focusMonitor.monitor(this._elementRef,!0).subscribe(o=>{!o&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new k(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(o){o.stopPropagation()}_onInputInteraction(o){if(o.stopPropagation(),!this.checked&&!this.disabled){const c=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),c&&this.radioGroup._emitChangeEvent())}}_onTouchTargetClick(o){this._onInputInteraction(o),this.disabled||this._inputElement.nativeElement.focus()}_setDisabled(o){this._disabled!==o&&(this._disabled=o,this._changeDetector.markForCheck())}_updateTabIndex(){const o=this.radioGroup;let c;if(c=o&&o.selected&&!this.disabled?o.selected===this?this.tabIndex:-1:this.tabIndex,c!==this._previousTabIndex){const _=this._inputElement?.nativeElement;_&&(_.setAttribute("tabindex",c+""),this._previousTabIndex=c)}}}return(p=g).\u0275fac=function(o){t.$Z()},p.\u0275dir=t.lG2({type:p,viewQuery:function(o,c){if(1&o&&t.Gf(Xe,5),2&o){let _;t.iGM(_=t.CRH())&&(c._inputElement=_.first)}},inputs:{id:"id",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"],checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"},features:[t.qOj]}),g})(),C=(()=>{var p;class g extends a{}return(p=g).\u0275fac=function(){let w;return function(c){return(w||(w=t.n5z(p)))(c||p)}}(),p.\u0275dir=t.lG2({type:p,selectors:[["mat-radio-group"]],contentQueries:function(o,c,_){if(1&o&&t.Suo(_,x,5),2&o){let V;t.iGM(V=t.CRH())&&(c._radios=V)}},hostAttrs:["role","radiogroup",1,"mat-mdc-radio-group"],exportAs:["matRadioGroup"],features:[t._Bn([I,{provide:B,useExisting:p}]),t.qOj]}),g})(),x=(()=>{var p;class g extends O{constructor(o,c,_,V,W,te,re,ie){super(o,c,_,V,W,te,re,ie)}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(B,8),t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(Qe.tE),t.Y36(Ye),t.Y36(t.QbO,8),t.Y36(e,8),t.$8M("tabindex"))},p.\u0275cmp=t.Xpm({type:p,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-mdc-radio-button"],hostVars:15,hostBindings:function(o,c){1&o&&t.NdJ("focus",function(){return c._inputElement.nativeElement.focus()}),2&o&&(t.uIk("id",c.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),t.ekj("mat-primary","primary"===c.color)("mat-accent","accent"===c.color)("mat-warn","warn"===c.color)("mat-mdc-radio-checked",c.checked)("_mat-animation-noopable",c._noopAnimations))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[t.qOj],ngContentSelectors:lt,decls:13,vars:17,consts:[[1,"mdc-form-field"],["formField",""],[1,"mdc-radio"],[1,"mat-mdc-radio-touch-target",3,"click"],["type","radio",1,"mdc-radio__native-control",3,"id","checked","disabled","required","change"],["input",""],[1,"mdc-radio__background"],[1,"mdc-radio__outer-circle"],[1,"mdc-radio__inner-circle"],["mat-ripple","",1,"mat-radio-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mdc-label",3,"for"]],template:function(o,c){if(1&o&&(t.F$t(),t.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3),t.NdJ("click",function(V){return c._onTouchTargetClick(V)}),t.qZA(),t.TgZ(4,"input",4,5),t.NdJ("change",function(V){return c._onInputInteraction(V)}),t.qZA(),t.TgZ(6,"div",6),t._UZ(7,"div",7)(8,"div",8),t.qZA(),t.TgZ(9,"div",9),t._UZ(10,"div",10),t.qZA()(),t.TgZ(11,"label",11),t.Hsn(12),t.qZA()()),2&o){const _=t.MAs(1);t.ekj("mdc-form-field--align-end","before"==c.labelPosition),t.xp6(2),t.ekj("mdc-radio--disabled",c.disabled),t.xp6(2),t.Q6J("id",c.inputId)("checked",c.checked)("disabled",c.disabled)("required",c.required),t.uIk("name",c.name)("value",c.value)("aria-label",c.ariaLabel)("aria-labelledby",c.ariaLabelledby)("aria-describedby",c.ariaDescribedby),t.xp6(5),t.Q6J("matRippleTrigger",_)("matRippleDisabled",c._isRippleDisabled())("matRippleCentered",!0),t.xp6(2),t.Q6J("for",c.inputId)}},dependencies:[N.wG],styles:['.mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio[hidden]{display:none}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mat-mdc-radio-button{--mdc-radio-disabled-selected-icon-opacity:0.38;--mdc-radio-disabled-unselected-icon-opacity:0.38;--mdc-radio-state-layer-size:40px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size) - 20px) / 2)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-unselected-icon-opacity)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);right:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);left:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color)}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple .mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, black)}.mat-mdc-radio-button.cdk-focused .mat-mdc-focus-indicator::before{content:""}.mat-mdc-radio-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}[dir=rtl] .mat-mdc-radio-touch-target{left:0;right:50%;transform:translate(50%, -50%)}'],encapsulation:2,changeDetection:0}),g})(),Z=(()=>{var p;class g{}return(p=g).\u0275fac=function(o){return new(o||p)},p.\u0275mod=t.oAB({type:p}),p.\u0275inj=t.cJS({imports:[N.BQ,F.ez,N.si,N.BQ]}),g})();function f(p,g){if(1&p){const w=t.EpF();t.ynx(0),t.TgZ(1,"tr")(2,"td"),t._uU(3,"Pricebook Font Size"),t.qZA(),t.TgZ(4,"td")(5,"div",14)(6,"input",27),t.NdJ("ngModelChange",function(c){t.CHM(w);const _=t.oxw();return t.KtG(_.pricebookFontSize=c)}),t.qZA()()(),t.TgZ(7,"td")(8,"span"),t._uU(9,"Change font size for pricebook price"),t.qZA()()(),t.BQk()}if(2&p){const w=t.oxw();t.xp6(6),t.Q6J("ngModel",w.pricebookFontSize)}}function L(p,g){if(1&p){const w=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2,"Selected Tax"),t.qZA(),t.TgZ(3,"td")(4,"ng-select",31),t.NdJ("ngModelChange",function(c){t.CHM(w);const _=t.oxw();return t.KtG(_.taxOptionSelected=c)})("change",function(){t.CHM(w);const c=t.oxw();return t.KtG(c.onSelectTaxType())}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Applied Tax ex: 100 + 10% = 110"),t.qZA()()()}if(2&p){const w=t.oxw();t.xp6(4),t.Q6J("items",w.taxOptions)("ngModel",w.taxOptionSelected)("clearable",!1)}}function j(p,g){if(1&p){const w=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2,"Outlet Price"),t.qZA(),t.TgZ(3,"td")(4,"ng-select",32),t.NdJ("ngModelChange",function(c){t.CHM(w);const _=t.oxw();return t.KtG(_.outletID=c)}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Price will be set according to the outlet price assigned when selected the outlet"),t.qZA()()()}if(2&p){const w=t.oxw();t.xp6(4),t.Q6J("items",w.outlets)("ngModel",w.outletID)("clearable",!0)}}const q=function(p){return{active:p}};let H=(()=>{var p;class g{constructor(o,c,_){this.dialogRef=o,this.data=c,this.outlet=_,this.event=new t.vpe,this.modalConfig=new P.O,this.taxOptions=[],this.paperWidth=0,this.marginTop=0,this.marginLeft=0,this.stickerWidth=0,this.stickerHeight=0,this.barcodeHeight=0,this.spacingColumn=0,this.spacingRow=0,this.barcode=!0,this.code=!0,this.price=!0,this.name=!0,this.move=!0,this.relaseDate=!0,this.priceDiscount=!0,this.removeDefault=!0,this.desc=!0,this.priceTax=!0,this.fontSize=0,this.namePrefix="",this.maxChar=0,this.publiclineHeight=0,this.orientationOptions=[],this.pricebookVisible=!1,this.pricebookFontSize=null,this.paperFormat=JSON.parse(JSON.stringify(c.paperFormat)),this.orientationOptions=this.paperFormat.OrientationChoice,this.outlets=c.outlets,this.taxs=c.taxs,this.authTax=c.authTax,this.initTaxOptions(),this.activeTab="paper",this.outletRole=c.outletRole}ngOnInit(){this.initModalConfig(),this.initFormValue(),this.authTax&&this.initTaxOptionSelected()}initTaxOptions(){this.taxOptions=[],this.taxs.forEach((o,c)=>{this.taxOptions=[...this.taxOptions,{id:c+1,name:o.getName,ID:o.getID}]})}initTaxOptionSelected(){this.taxSelected&&(this.taxOptionSelected=this.taxOptions.find(o=>o.ID===this.taxSelected.ID))}onSelectTaxType(){this.taxSelected=this.taxs.find(o=>o.getID===this.taxOptionSelected.ID)}initModalConfig(){this.modalConfig.title="Sticker Configuration",this.modalConfig.hideMoreButton=!0}onOk(){this.setPaperFormat(),this.dialogRef.close(this.paperFormat)}onCancel(){this.dialogRef.close()}initFormValue(){this.paperFormat&&(this.barcodeHeight=this.paperFormat.BarcodeHeight,this.PriceFontSize=this.paperFormat.PriceFontSize,this.paperWidth=this.paperFormat.PaperWidth,this.marginTop=this.paperFormat.MarginTop,this.marginLeft=this.paperFormat.MarginLeft,this.stickerWidth=this.paperFormat.StickerWidth,this.stickerHeight=this.paperFormat.StickerHeight,this.barcodeHeight=this.paperFormat.BarcodeHeight,this.spacingColumn=this.paperFormat.ColumnSpacing,this.spacingRow=this.paperFormat.RowSpacing,this.barcode=this.paperFormat.BarcodeVisible,this.code=this.paperFormat.CodeVisible,this.price=this.paperFormat.PriceVisible,this.name=this.paperFormat.NameVisible,this.move=this.paperFormat.MoveProductNameOnTop,this.desc=this.paperFormat.DescriptionAsCode,this.fontSize=this.paperFormat.ProductNameFontSize,this.namePrefix=this.paperFormat.ProductNamePrefix,this.maxChar=this.paperFormat.ProductNameMaxLength,this.lineHeight=this.paperFormat.LineHeight,this.priceTax=this.paperFormat.PriceWithTax,this.taxSelected=this.paperFormat.TaxType,this.storeName=this.paperFormat.StoreName,this.currencySymbol=this.paperFormat.CurrencySymbol,this.promotionPriceLabel=this.paperFormat.PromotionPriceLabel,this.basicPriceLabel=this.paperFormat.BasicPriceLabel,this.relaseDate=this.paperFormat.ShowReleasedDate,this.priceDiscount=this.paperFormat.ShowPriceDiscount,this.orientationType=this.paperFormat.Orientation,this.outletID=this.paperFormat.OutletID,this.outletID=this.outlet.outletID,this.pricebookVisible=this.paperFormat.PricebookVisible,this.pricebookFontSize=this.paperFormat.PricebookFontSize)}setPaperFormat(){this.paperFormat&&(this.checkPriceWithTax(),this.paperFormat.PriceFontSize=this.PriceFontSize,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.PaperWidth=this.paperWidth,this.paperFormat.MarginTop=this.marginTop,this.paperFormat.MarginLeft=this.marginLeft,this.paperFormat.StickerWidth=this.stickerWidth,this.paperFormat.StickerHeight=this.stickerHeight,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.ColumnSpacing=this.spacingColumn,this.paperFormat.RowSpacing=this.spacingRow,this.paperFormat.BarcodeVisible=this.barcode,this.paperFormat.MoveProductNameOnTop=this.move,this.paperFormat.CodeVisible=this.code,this.paperFormat.PriceVisible=this.price,this.paperFormat.NameVisible=this.name,this.paperFormat.DescriptionAsCode=this.desc,this.paperFormat.ProductNameFontSize=this.fontSize,this.paperFormat.ProductNamePrefix=this.namePrefix,this.paperFormat.ProductNameMaxLength=this.maxChar,this.paperFormat.LineHeight=this.lineHeight,this.paperFormat.PriceWithTax=this.priceTax,this.paperFormat.TaxType=this.taxSelected,this.paperFormat.StoreName=this.storeName,this.paperFormat.CurrencySymbol=this.currencySymbol,this.paperFormat.PromotionPriceLabel=this.promotionPriceLabel,this.paperFormat.BasicPriceLabel=this.basicPriceLabel,this.paperFormat.ShowReleasedDate=this.relaseDate,this.paperFormat.ShowPriceDiscount=this.priceDiscount,this.paperFormat.Orientation=this.orientationType,this.paperFormat.OutletID=this.outletID,this.outlet.outletID=this.outletID,this.outlet.outletName=this.outlets.find(o=>o.ID==this.outletID)?.Name,this.paperFormat.PricebookVisible=this.pricebookVisible,this.paperFormat.PricebookFontSize=this.pricebookFontSize)}checkPriceWithTax(){this.priceTax||(this.taxSelected=this.taxs.find(o=>"No Tax"==o.getLabel))}dataTarget(o){this.activeTab=o}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(m.so),t.Y36(m.WI),t.Y36(be))},p.\u0275cmp=t.Xpm({type:p,selectors:[["app-form-settings"]],outputs:{event:"event"},decls:350,vars:82,consts:[[3,"config","onOk","onCancel"],["container",""],["id","myTab","role","tablist",1,"nav","nav-tabs"],["tabs",""],[1,"nav-item"],["data-bs-toggle","tab",1,"nav-link",3,"ngClass","click"],["id","spacing-tab","data-bs-toggle","tab","data-bs-target","'#spacing'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","dua-tab","data-bs-toggle","tab","data-bs-target","'#sticker-content'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","price-tab","data-bs-toggle","tab","data-bs-target","'#price'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","advanced-tab","data-bs-toggle","tab","data-bs-target","'#advanced'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","promotionLabel-tab","data-bs-toggle","tab","data-bs-target","'#promotionLabel'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],[1,"tab-content","border","bg-white"],["id","paper",1,"tab-pane","mt-0",3,"ngClass"],[1,"table","table-bordered","w-100"],[1,"input-group"],["type","number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],[1,"input-group-append"],[1,"input-group-text"],["id","spacing",1,"tab-pane","mt-0",3,"ngClass"],["id","sticker-content",1,"tab-pane","mt-0",3,"ngClass"],[2,"width","150px"],["aria-label","Select an option","color","primary"],["value","false",3,"checked","change"],["value","true",1,"ms-4",3,"checked","change"],[4,"ngIf"],["id","price",1,"tab-pane","mt-0",3,"ngClass"],["type","text","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["type","text","autoNum","","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["id","advanced",1,"tab-pane","mt-0",3,"ngClass"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Select orientation",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange"],["id","promotionLabel",1,"tab-pane","mt-0",3,"ngClass"],["appendTo","body","bindLabel","name","placeholder","Select Column",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange","change"],["appendTo","body","bindLabel","Name","bindValue","ID","name","Choose Outlet","placeholder","Choose Outlet",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange"]],template:function(o,c){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return c.onOk()})("onCancel",function(){return c.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"ul",2,3)(5,"li",4)(6,"a",5),t.NdJ("click",function(){return c.dataTarget("paper")}),t._uU(7,"Paper"),t.qZA()(),t.TgZ(8,"li",4)(9,"a",6),t.NdJ("click",function(){return c.dataTarget("spacing")}),t._uU(10,"Spacing"),t.qZA()(),t.TgZ(11,"li",4)(12,"a",7),t.NdJ("click",function(){return c.dataTarget("sticker-content")}),t._uU(13,"Sticker Content"),t.qZA()(),t.TgZ(14,"li",4)(15,"a",8),t.NdJ("click",function(){return c.dataTarget("price")}),t._uU(16,"Price"),t.qZA()(),t.TgZ(17,"li",4)(18,"a",9),t.NdJ("click",function(){return c.dataTarget("advanced")}),t._uU(19,"Advanced"),t.qZA()(),t.TgZ(20,"li",4)(21,"a",10),t.NdJ("click",function(){return c.dataTarget("promotionLabel")}),t._uU(22,"Label"),t.qZA()()(),t.TgZ(23,"div",11)(24,"div",12)(25,"table",13)(26,"tr")(27,"td"),t._uU(28,"Paper Width"),t.qZA(),t.TgZ(29,"td")(30,"div",14)(31,"input",15),t.NdJ("ngModelChange",function(V){return c.paperWidth=V}),t.qZA(),t.TgZ(32,"div",16)(33,"span",17),t._uU(34,"px"),t.qZA()()()(),t.TgZ(35,"td")(36,"span"),t._uU(37,"The width of the paper"),t.qZA()()(),t.TgZ(38,"tr")(39,"td"),t._uU(40,"Sticker Width"),t.qZA(),t.TgZ(41,"td")(42,"div",14)(43,"input",15),t.NdJ("ngModelChange",function(V){return c.stickerWidth=V}),t.qZA(),t.TgZ(44,"div",16)(45,"span",17),t._uU(46,"px"),t.qZA()()()(),t.TgZ(47,"td")(48,"span"),t._uU(49,"The width of the sticker"),t.qZA()()(),t.TgZ(50,"tr")(51,"td"),t._uU(52,"Sticker Height"),t.qZA(),t.TgZ(53,"td")(54,"div",14)(55,"input",15),t.NdJ("ngModelChange",function(V){return c.stickerHeight=V}),t.qZA(),t.TgZ(56,"div",16)(57,"span",17),t._uU(58,"px"),t.qZA()()()(),t.TgZ(59,"td")(60,"span"),t._uU(61,"The height of the sticker"),t.qZA()()()()(),t.TgZ(62,"div",18)(63,"table",13)(64,"tr")(65,"td"),t._uU(66,"Left Indent"),t.qZA(),t.TgZ(67,"td")(68,"div",14)(69,"input",15),t.NdJ("ngModelChange",function(V){return c.marginLeft=V}),t.qZA(),t.TgZ(70,"div",16)(71,"span",17),t._uU(72,"px"),t.qZA()()()(),t.TgZ(73,"td")(74,"span"),t._uU(75,"The number of pixels appended before the first COLUMN"),t.qZA()()(),t.TgZ(76,"tr")(77,"td"),t._uU(78,"Top Indent"),t.qZA(),t.TgZ(79,"td")(80,"div",14)(81,"input",15),t.NdJ("ngModelChange",function(V){return c.marginTop=V}),t.qZA(),t.TgZ(82,"div",16)(83,"span",17),t._uU(84,"px"),t.qZA()()()(),t.TgZ(85,"td")(86,"span"),t._uU(87,"The number of pixels appended before the first ROW"),t.qZA()()(),t.TgZ(88,"tr")(89,"td"),t._uU(90,"Row Spacing"),t.qZA(),t.TgZ(91,"td")(92,"div",14)(93,"input",15),t.NdJ("ngModelChange",function(V){return c.spacingRow=V}),t.qZA(),t.TgZ(94,"div",16)(95,"span",17),t._uU(96,"px"),t.qZA()()()(),t.TgZ(97,"td")(98,"span"),t._uU(99,"The number of pixels between each ROW"),t.qZA()()(),t.TgZ(100,"tr")(101,"td"),t._uU(102,"Column Spacing"),t.qZA(),t.TgZ(103,"td")(104,"div",14)(105,"input",15),t.NdJ("ngModelChange",function(V){return c.spacingColumn=V}),t.qZA(),t.TgZ(106,"div",16)(107,"span",17),t._uU(108,"px"),t.qZA()()()(),t.TgZ(109,"td")(110,"span"),t._uU(111,"The number of pixels between each COLUMN"),t.qZA()()()()(),t.TgZ(112,"div",19)(113,"table",13)(114,"tr")(115,"td"),t._uU(116,"Barcode Height"),t.qZA(),t.TgZ(117,"td",20)(118,"div",14)(119,"input",15),t.NdJ("ngModelChange",function(V){return c.barcodeHeight=V}),t.qZA(),t.TgZ(120,"div",16)(121,"span",17),t._uU(122,"px"),t.qZA()()()(),t.TgZ(123,"td")(124,"span"),t._uU(125,"The height of the generated barcode in pixels"),t.qZA()()(),t.TgZ(126,"tr")(127,"td"),t._uU(128,"Font Size"),t.qZA(),t.TgZ(129,"td")(130,"div",14)(131,"input",15),t.NdJ("ngModelChange",function(V){return c.fontSize=V}),t.qZA(),t.TgZ(132,"div",16)(133,"span",17),t._uU(134,"px"),t.qZA()()()(),t.TgZ(135,"td")(136,"span"),t._uU(137,"Change all font size (except price)"),t.qZA()()(),t.TgZ(138,"tr")(139,"td"),t._uU(140,"Barcode"),t.qZA(),t.TgZ(141,"td")(142,"mat-radio-group",21)(143,"mat-radio-button",22),t.NdJ("change",function(){return c.barcode=!1}),t._uU(144,"No "),t.qZA(),t.TgZ(145,"mat-radio-button",23),t.NdJ("change",function(){return c.barcode=!0}),t._uU(146,"Yes"),t.qZA()()(),t.TgZ(147,"td")(148,"span"),t._uU(149,"Whether barcode is visible"),t.qZA()()(),t.TgZ(150,"tr")(151,"td"),t._uU(152,"Code"),t.qZA(),t.TgZ(153,"td")(154,"mat-radio-group",21)(155,"mat-radio-button",22),t.NdJ("change",function(){return c.code=!1}),t._uU(156,"No "),t.qZA(),t.TgZ(157,"mat-radio-button",23),t.NdJ("change",function(){return c.code=!0}),t._uU(158,"Yes"),t.qZA()()(),t.TgZ(159,"td")(160,"span"),t._uU(161,"Whether variant code is visible"),t.qZA()()(),t.TgZ(162,"tr")(163,"td"),t._uU(164,"Price"),t.qZA(),t.TgZ(165,"td")(166,"mat-radio-group",21)(167,"mat-radio-button",22),t.NdJ("change",function(){return c.price=!1}),t._uU(168,"No "),t.qZA(),t.TgZ(169,"mat-radio-button",23),t.NdJ("change",function(){return c.price=!0}),t._uU(170,"Yes"),t.qZA()()(),t.TgZ(171,"td")(172,"span"),t._uU(173,"Whether variant price is visible"),t.qZA()()(),t.TgZ(174,"tr")(175,"td"),t._uU(176,"Name"),t.qZA(),t.TgZ(177,"td")(178,"mat-radio-group",21)(179,"mat-radio-button",22),t.NdJ("change",function(){return c.name=!1}),t._uU(180,"No "),t.qZA(),t.TgZ(181,"mat-radio-button",23),t.NdJ("change",function(){return c.name=!0}),t._uU(182,"Yes"),t.qZA()()(),t.TgZ(183,"td")(184,"span"),t._uU(185,"Whether variant name is visible"),t.qZA()()(),t.TgZ(186,"tr")(187,"td"),t._uU(188,"Move Product Name"),t.qZA(),t.TgZ(189,"td")(190,"mat-radio-group",21)(191,"mat-radio-button",22),t.NdJ("change",function(){return c.move=!1}),t._uU(192,"No "),t.qZA(),t.TgZ(193,"mat-radio-button",23),t.NdJ("change",function(){return c.move=!0}),t._uU(194,"Yes"),t.qZA()()(),t.TgZ(195,"td")(196,"span"),t._uU(197,"Whether move variant name below variant code or below variant price"),t.qZA()()(),t.TgZ(198,"tr")(199,"td"),t._uU(200,"Release Date"),t.qZA(),t.TgZ(201,"td")(202,"mat-radio-group",21)(203,"mat-radio-button",22),t.NdJ("change",function(){return c.relaseDate=!1}),t._uU(204,"No "),t.qZA(),t.TgZ(205,"mat-radio-button",23),t.NdJ("change",function(){return c.relaseDate=!0}),t._uU(206,"Yes"),t.qZA()()(),t.TgZ(207,"td")(208,"span"),t._uU(209,"Whether release date is visible"),t.qZA()()(),t.TgZ(210,"tr")(211,"td"),t._uU(212,"Discount Visible"),t.qZA(),t.TgZ(213,"td")(214,"mat-radio-group",21)(215,"mat-radio-button",22),t.NdJ("change",function(){return c.priceDiscount=!1}),t._uU(216,"No "),t.qZA(),t.TgZ(217,"mat-radio-button",23),t.NdJ("change",function(){return c.priceDiscount=!0}),t._uU(218,"Yes"),t.qZA()()(),t.TgZ(219,"td")(220,"span"),t._uU(221,"Whether variant's sell price discount is visible"),t.qZA()()(),t.TgZ(222,"tr")(223,"td"),t._uU(224,"Pricebook Price"),t.qZA(),t.TgZ(225,"td")(226,"mat-radio-group",21)(227,"mat-radio-button",22),t.NdJ("change",function(){return c.pricebookVisible=!1}),t._uU(228,"No "),t.qZA(),t.TgZ(229,"mat-radio-button",23),t.NdJ("change",function(){return c.pricebookVisible=!0}),t._uU(230,"Yes"),t.qZA()()(),t.TgZ(231,"td")(232,"span"),t._uU(233,"Whether pricebook price is visible"),t.qZA()()(),t.YNc(234,f,10,1,"ng-container",24),t.qZA()(),t.TgZ(235,"div",25)(236,"table",13)(237,"tr")(238,"td"),t._uU(239,"Price with Tax"),t.qZA(),t.TgZ(240,"td")(241,"mat-radio-group",21)(242,"mat-radio-button",22),t.NdJ("change",function(){return c.priceTax=!1}),t._uU(243," No"),t.qZA(),t.TgZ(244,"mat-radio-button",23),t.NdJ("change",function(){return c.priceTax=!0}),t._uU(245,"Yes"),t.qZA()()(),t.TgZ(246,"td")(247,"span"),t._uU(248),t.qZA()()(),t.YNc(249,L,8,3,"tr",24),t.TgZ(250,"tr")(251,"td"),t._uU(252,"Currency"),t.qZA(),t.TgZ(253,"td",20)(254,"div",14)(255,"input",26),t.NdJ("ngModelChange",function(V){return c.currencySymbol=V}),t.qZA()()(),t.TgZ(256,"td")(257,"span"),t._uU(258,"The default currency"),t.qZA()()(),t.TgZ(259,"tr")(260,"td"),t._uU(261,"Font Size"),t.qZA(),t.TgZ(262,"td")(263,"div",14)(264,"input",27),t.NdJ("ngModelChange",function(V){return c.PriceFontSize=V}),t.qZA()()(),t.TgZ(265,"td")(266,"span"),t._uU(267,"Change font size for price"),t.qZA()()(),t.YNc(268,j,8,3,"tr",24),t.qZA()(),t.TgZ(269,"div",28)(270,"table",13)(271,"tr")(272,"td"),t._uU(273,"Max Character"),t.qZA(),t.TgZ(274,"td",20)(275,"div",14)(276,"input",15),t.NdJ("ngModelChange",function(V){return c.maxChar=V}),t.qZA()()(),t.TgZ(277,"td")(278,"span"),t._uU(279,"The max character of the product name"),t.qZA()()(),t.TgZ(280,"tr")(281,"td"),t._uU(282,"Name Prefix"),t.qZA(),t.TgZ(283,"td")(284,"div",14)(285,"input",26),t.NdJ("ngModelChange",function(V){return c.namePrefix=V}),t.qZA()()(),t.TgZ(286,"td")(287,"span"),t._uU(288,"A word, letter, or number placed before product name"),t.qZA()()(),t.TgZ(289,"tr")(290,"td"),t._uU(291,"Store Name"),t.qZA(),t.TgZ(292,"td")(293,"div",14)(294,"input",26),t.NdJ("ngModelChange",function(V){return c.storeName=V}),t.qZA()()(),t.TgZ(295,"td")(296,"span"),t._uU(297,"The name of the store"),t.qZA()()(),t.TgZ(298,"tr")(299,"td"),t._uU(300,"Orientation"),t.qZA(),t.TgZ(301,"td")(302,"ng-select",29),t.NdJ("ngModelChange",function(V){return c.orientationType=V}),t.qZA()(),t.TgZ(303,"td")(304,"span"),t._uU(305,"Horizontal or vertical position store name label"),t.qZA()()(),t.TgZ(306,"tr")(307,"td"),t._uU(308,"Use description as code"),t.qZA(),t.TgZ(309,"td")(310,"mat-radio-group",21)(311,"mat-radio-button",22),t.NdJ("change",function(){return c.desc=!1}),t._uU(312,"No "),t.qZA(),t.TgZ(313,"mat-radio-button",23),t.NdJ("change",function(){return c.desc=!0}),t._uU(314,"Yes"),t.qZA()()(),t.TgZ(315,"td")(316,"span"),t._uU(317,"Copy product description into product code"),t.qZA()()(),t.TgZ(318,"tr")(319,"td"),t._uU(320,'Remove "Default"'),t.qZA(),t.TgZ(321,"td")(322,"mat-radio-group",21)(323,"mat-radio-button",22),t.NdJ("change",function(){return c.removeDefault=!1}),t._uU(324,"No "),t.qZA(),t.TgZ(325,"mat-radio-button",23),t.NdJ("change",function(){return c.removeDefault=!0}),t._uU(326,"Yes"),t.qZA()()(),t.TgZ(327,"td")(328,"span"),t._uU(329,'Remove "Default" label from product name'),t.qZA()()()()(),t.TgZ(330,"div",30)(331,"table",13)(332,"tr")(333,"td"),t._uU(334,"Normal Price"),t.qZA(),t.TgZ(335,"td")(336,"div",14)(337,"input",26),t.NdJ("ngModelChange",function(V){return c.basicPriceLabel=V}),t.qZA()()(),t.TgZ(338,"td")(339,"span"),t._uU(340,"Custom label normal price"),t.qZA()()(),t.TgZ(341,"tr")(342,"td"),t._uU(343,"Promotion Price"),t.qZA(),t.TgZ(344,"td")(345,"div",14)(346,"input",26),t.NdJ("ngModelChange",function(V){return c.promotionPriceLabel=V}),t.qZA()()(),t.TgZ(347,"td")(348,"span"),t._uU(349,"Custom label promotion price"),t.qZA()()()()()()()()()),2&o&&(t.Q6J("config",c.modalConfig),t.xp6(6),t.Q6J("ngClass",t.VKq(58,q,"paper"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(60,q,"spacing"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(62,q,"sticker-content"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(64,q,"price"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(66,q,"advanced"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(68,q,"promotionLabel"===c.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(70,q,"paper"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.paperWidth),t.xp6(12),t.Q6J("ngModel",c.stickerWidth),t.xp6(12),t.Q6J("ngModel",c.stickerHeight),t.xp6(7),t.Q6J("ngClass",t.VKq(72,q,"spacing"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.marginLeft),t.xp6(12),t.Q6J("ngModel",c.marginTop),t.xp6(12),t.Q6J("ngModel",c.spacingRow),t.xp6(12),t.Q6J("ngModel",c.spacingColumn),t.xp6(7),t.Q6J("ngClass",t.VKq(74,q,"sticker-content"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.barcodeHeight),t.xp6(12),t.Q6J("ngModel",c.fontSize),t.xp6(12),t.Q6J("checked",!c.barcode),t.xp6(2),t.Q6J("checked",c.barcode),t.xp6(10),t.Q6J("checked",!c.code),t.xp6(2),t.Q6J("checked",c.code),t.xp6(10),t.Q6J("checked",!c.price),t.xp6(2),t.Q6J("checked",c.price),t.xp6(10),t.Q6J("checked",!c.name),t.xp6(2),t.Q6J("checked",c.name),t.xp6(10),t.Q6J("checked",!c.move),t.xp6(2),t.Q6J("checked",c.move),t.xp6(10),t.Q6J("checked",!c.relaseDate),t.xp6(2),t.Q6J("checked",c.relaseDate),t.xp6(10),t.Q6J("checked",!c.priceDiscount),t.xp6(2),t.Q6J("checked",c.priceDiscount),t.xp6(10),t.Q6J("checked",!c.pricebookVisible),t.xp6(2),t.Q6J("checked",c.pricebookVisible),t.xp6(5),t.Q6J("ngIf",c.pricebookVisible),t.xp6(1),t.Q6J("ngClass",t.VKq(76,q,"price"===c.activeTab)),t.xp6(7),t.Q6J("checked",!c.priceTax),t.xp6(2),t.Q6J("checked",c.priceTax),t.xp6(4),t.hij("Tax is added to the product base price ",c.authTax,""),t.xp6(1),t.Q6J("ngIf",1==c.priceTax&&1==c.authTax),t.xp6(6),t.Q6J("ngModel",c.currencySymbol),t.xp6(9),t.Q6J("ngModel",c.PriceFontSize),t.xp6(4),t.Q6J("ngIf",c.outletRole),t.xp6(1),t.Q6J("ngClass",t.VKq(78,q,"advanced"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.maxChar),t.xp6(9),t.Q6J("ngModel",c.namePrefix),t.xp6(9),t.Q6J("ngModel",c.storeName),t.xp6(8),t.Q6J("items",c.orientationOptions)("ngModel",c.orientationType)("clearable",!1),t.xp6(9),t.Q6J("checked",!c.desc),t.xp6(2),t.Q6J("checked",c.desc),t.xp6(10),t.Q6J("checked",!c.removeDefault),t.xp6(2),t.Q6J("checked",c.removeDefault),t.xp6(5),t.Q6J("ngClass",t.VKq(80,q,"promotionLabel"===c.activeTab)),t.xp6(7),t.Q6J("ngModel",c.basicPriceLabel),t.xp6(9),t.Q6J("ngModel",c.promotionPriceLabel))},dependencies:[F.mk,F.O5,b.Fj,b.wV,b.JJ,b.On,U.w9,z.M,xe,C,x],styles:[".input-group-append[_ngcontent-%COMP%]{height:30px}.form-control[_ngcontent-%COMP%]{height:30px;font-size:12px}.input-group-text[_ngcontent-%COMP%]{font-size:12px}.value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:90px}.advance-value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:135px}h3[_ngcontent-%COMP%]{margin-bottom:0;font-weight:550}label[_ngcontent-%COMP%]{font-size:12px}bs-dropdown-container[_ngcontent-%COMP%]{z-index:1060}.nav-tabs-custom-border[_ngcontent-%COMP%] .nav-tabs[_ngcontent-%COMP%]{border-bottom:0}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%]{margin-bottom:10px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(1){font-weight:700;width:172px;padding:12px 1rem}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){width:120px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:nth-child(2), .tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){border-right:1px solid #dee2e6;border-left:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) input[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) .input-group-text[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6;margin-top:-1px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(3){font-style:italic;color:#28a745}.nav-link[_ngcontent-%COMP%]{cursor:pointer} .mat-mdc-radio-checked .mdc-radio__outer-circle{border-color:#0075ff} .mat-radio-checked .mdc-radio__inner-circle{background-color:#0075ff}"]}),g})();var $=E(6387);const ae=["bcElement"];let he=(()=>{var p;class g{get options(){return{format:this.format,lineColor:this.lineColor,width:this.width,height:this.height,displayValue:this.displayValue,fontOptions:this.fontOptions,font:this.font,textAlign:this.textAlign,textPosition:this.textPosition,textMargin:this.textMargin,fontSize:this.fontSize,background:this.background,margin:this.margin,marginTop:this.marginTop,marginBottom:this.marginBottom,marginLeft:this.marginLeft,marginRight:this.marginRight,valid:this.valid}}constructor(o){this.renderer=o,this.elementType="svg",this.cssClass="barcode",this.format="CODE128",this.lineColor="#000000",this.width=2,this.height=100,this.displayValue=!1,this.fontOptions="",this.font="monospace",this.textAlign="center",this.textPosition="bottom",this.textMargin=2,this.fontSize=20,this.background="#ffffff",this.margin=10,this.marginTop=10,this.marginBottom=10,this.marginLeft=10,this.marginRight=10,this.value="",this.valid=()=>!0}ngAfterViewInit(){this.createBarcode()}ngOnChanges(){this.bcElement&&this.createBarcode()}createBarcode(){if(!this.value)return;let o;switch(this.elementType){case"img":o=this.renderer.createElement("img");break;case"canvas":o=this.renderer.createElement("canvas");break;default:o=this.renderer.createElement("svg","svg")}$(o,this.value,this.options);for(const c of this.bcElement.nativeElement.childNodes)this.renderer.removeChild(this.bcElement.nativeElement,c);this.renderer.appendChild(this.bcElement.nativeElement,o)}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(t.Qsj))},p.\u0275cmp=t.Xpm({type:p,selectors:[["ngx-barcode6"]],viewQuery:function(o,c){if(1&o&&t.Gf(ae,5),2&o){let _;t.iGM(_=t.CRH())&&(c.bcElement=_.first)}},inputs:{elementType:["bc-element-type","elementType"],cssClass:["bc-class","cssClass"],format:["bc-format","format"],lineColor:["bc-line-color","lineColor"],width:["bc-width","width"],height:["bc-height","height"],displayValue:["bc-display-value","displayValue"],fontOptions:["bc-font-options","fontOptions"],font:["bc-font","font"],textAlign:["bc-text-align","textAlign"],textPosition:["bc-text-position","textPosition"],textMargin:["bc-text-margin","textMargin"],fontSize:["bc-font-size","fontSize"],background:["bc-background","background"],margin:["bc-margin","margin"],marginTop:["bc-margin-top","marginTop"],marginBottom:["bc-margin-bottom","marginBottom"],marginLeft:["bc-margin-left","marginLeft"],marginRight:["bc-margin-right","marginRight"],value:["bc-value","value"],valid:["bc-valid","valid"]},features:[t.TTD],decls:2,vars:2,consts:[["bcElement",""]],template:function(o,c){1&o&&t._UZ(0,"div",null,0),2&o&&t.Tol(c.cssClass)},encapsulation:2}),g})(),me=(()=>{var p;class g{}return(p=g).\u0275fac=function(o){return new(o||p)},p.\u0275mod=t.oAB({type:p}),p.\u0275inj=t.cJS({}),g})(),oe=(()=>{var p;class g{transform(o,c){let _=o,V=0;return c&&0!==c&&(V=o*(c/100),_=o+V),_}}return(p=g).\u0275fac=function(o){return new(o||p)},p.\u0275pipe=t.Yjl({name:"taxPipe",type:p,pure:!0}),g})();function we(p,g){if(1&p&&t._UZ(0,"ngx-barcode6",18),2&p){const w=t.oxw().$implicit,o=t.oxw();t.Q6J("bc-value",null==w?null:w.getCode)("bc-element-type","img")("bc-width",1)("bc-height",null==o.selectedPaperFormat?null:o.selectedPaperFormat.BarcodeHeight)}}function De(p,g){if(1&p&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&p){const w=t.oxw().$implicit,o=t.oxw();t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.Oqu(w.getBarcodeTitle)}}function ze(p,g){if(1&p&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&p){const w=t.oxw().$implicit,o=t.oxw();t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=o.selectedPaperFormat&&o.selectedPaperFormat.ProductNamePrefix?(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNamePrefix)+" "+w.getName:w.getName,0,null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameMaxLength)," ")}}function et(p,g){if(1&p&&(t.ynx(0),t.TgZ(1,"div",22)(2,"span",23),t._uU(3),t.qZA(),t.TgZ(4,"span",24)(5,"span",25)(6,"span",26),t._uU(7),t.ALo(8,"number"),t.qZA()()()(),t.TgZ(9,"div",27)(10,"span",23),t._uU(11),t.qZA(),t.TgZ(12,"span",28),t._uU(13),t.ALo(14,"number"),t.qZA()(),t.BQk()),2&p){const w=t.oxw(2).$implicit,o=t.oxw();t.xp6(3),t.Oqu(o.selectedPaperFormat.BasicPriceLabel?o.selectedPaperFormat.BasicPriceLabel:"N. Price"),t.xp6(4),t.AsE("",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(8,6,null==w?null:w.getUnitPrice),""),t.xp6(4),t.Oqu(o.selectedPaperFormat.PromotionPriceLabel?o.selectedPaperFormat.PromotionPriceLabel:"Spc. Price"),t.xp6(2),t.AsE("",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(14,8,(null==w||null==w.getSelectedPromotion?null:w.getSelectedPromotion.getUnitPrice)-(null==w||null==w.getSelectedPromotion?null:w.getSelectedPromotion.getUnitPrice)*(null==w||null==w.getSelectedPromotion?null:w.getSelectedPromotion.getDiscount)/100),"")}}function tt(p,g){if(1&p&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&p){const w=t.oxw(3).$implicit,o=t.oxw();t.xp6(1),t.AsE(" ",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==w?null:w.getCustomPrice,o.tax))," ")}}function Oe(p,g){if(1&p&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&p){const w=t.oxw(4).$implicit,o=t.oxw();t.xp6(1),t.AsE(" ",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==w?null:w.getUnitPrice,o.tax))," ")}}function Ee(p,g){if(1&p&&t.YNc(0,Oe,4,7,"ng-container",20),2&p){t.oxw();const w=t.MAs(5),o=t.oxw(3);t.Q6J("ngIf",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.PriceWithTax)&&o.tax&&0!=o.tax)("ngIfElse",w)}}function ut(p,g){if(1&p&&(t._uU(0),t.ALo(1,"number")),2&p){const w=t.oxw(3).$implicit,o=t.oxw();t.AsE(" ",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(1,2,null==w?null:w.getUnitPrice)," ")}}function Ce(p,g){if(1&p&&(t.TgZ(0,"strong"),t.YNc(1,tt,4,7,"ng-container",20),t.YNc(2,Ee,1,2,"ng-template",null,29,t.W1O),t.YNc(4,ut,2,4,"ng-template",null,30,t.W1O),t.qZA()),2&p){const w=t.MAs(3),o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",0!==(null==o?null:o.getCustomPrice)&&void 0!==(null==o?null:o.getCustomPrice))("ngIfElse",w)}}function ct(p,g){if(1&p&&(t.TgZ(0,"span",19),t.YNc(1,et,15,10,"ng-container",20),t.YNc(2,Ce,6,2,"ng-template",null,21,t.W1O),t.qZA()),2&p){const w=t.MAs(3),o=t.oxw().$implicit,c=t.oxw();t.Udp("font-size",(null==c.selectedPaperFormat?null:c.selectedPaperFormat.PriceFontSize)+"px"),t.xp6(1),t.Q6J("ngIf",o.getSelectedPromotion)("ngIfElse",w)}}function dt(p,g){if(1&p&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&p){const w=t.oxw().$implicit,o=t.oxw();t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=o.selectedPaperFormat&&o.selectedPaperFormat.ProductNamePrefix?(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNamePrefix)+" "+w.getName:w.getName,0,null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameMaxLength)," ")}}function ht(p,g){if(1&p&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.ALo(3,"date"),t.qZA(),t.BQk()),2&p){const w=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.xi3(3,3,w.getReleaseDate,"dd MMM yy")," ")}}function Ie(p,g){if(1&p&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&p){const w=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",w.getPriceDiscount,"% Off ")}}function nt(p,g){if(1&p&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&p){const w=t.oxw(2);t.xp6(1),t.Udp("font-size",(null==w.selectedPaperFormat?null:w.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==w.selectedPaperFormat?null:w.selectedPaperFormat.StoreName," ")}}function Le(p,g){if(1&p&&(t.ynx(0),t.TgZ(1,"div",32)(2,"div"),t._uU(3),t.qZA(),t.TgZ(4,"div",33),t._uU(5,"-"),t.qZA(),t.TgZ(6,"div"),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"div",33),t._uU(10,"-"),t.qZA(),t.TgZ(11,"div"),t._uU(12),t.ALo(13,"number"),t.qZA()(),t.BQk()),2&p){const w=g.$implicit,o=t.oxw(3);t.xp6(1),t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.PricebookFontSize)+"px"),t.xp6(2),t.Oqu(null==w?null:w.Name),t.xp6(4),t.hij("Min. ",t.lcZ(8,5,null==w?null:w.MinimumQuantity),""),t.xp6(5),t.Oqu(t.lcZ(13,7,null==w?null:w.UnitPrice))}}function it(p,g){if(1&p&&(t.ynx(0),t.YNc(1,Le,14,9,"ng-container",31),t.BQk()),2&p){const w=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==w?null:w.getPricebooks)}}function Re(p,g){if(1&p&&(t.ynx(0),t.TgZ(1,"div",34)(2,"div",35),t._uU(3),t.qZA()(),t.BQk()),2&p){const w=t.oxw(2);t.xp6(2),t.Udp("height",(null==w.selectedPaperFormat?null:w.selectedPaperFormat.StickerHeight)+"px")("font-size",(null==w.selectedPaperFormat?null:w.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==w.selectedPaperFormat?null:w.selectedPaperFormat.StoreName," ")}}function mt(p,g){if(1&p&&(t.TgZ(0,"li")(1,"div",13),t.YNc(2,we,1,4,"ngx-barcode6",14),t.TgZ(3,"div",15),t.YNc(4,De,2,3,"span",16),t.YNc(5,ze,3,7,"span",16),t.YNc(6,ct,4,4,"span",16),t.YNc(7,dt,3,7,"span",16),t.YNc(8,ht,4,6,"ng-container",17),t.YNc(9,Ie,3,3,"ng-container",17),t.YNc(10,nt,3,3,"ng-container",17),t.YNc(11,it,2,1,"ng-container",17),t.qZA(),t.YNc(12,Re,4,5,"ng-container",17),t.qZA()()),2&p){const w=g.index,o=t.oxw();t.Udp("width",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.StickerWidth)+"px")("height",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.StickerHeight)+"px")("margin-right",(w+1)%o.totalStickerPerRow==0?0:(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ColumnSpacing)+"px")("margin-bottom",w>=o.productPreview.length-o.lastIndex?0:(null==o.selectedPaperFormat?null:o.selectedPaperFormat.RowSpacing)+"px"),t.xp6(2),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.BarcodeVisible),t.xp6(2),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CodeVisible),t.xp6(1),t.Q6J("ngIf",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.NameVisible)&&(null==o.selectedPaperFormat?null:o.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.PriceVisible),t.xp6(1),t.Q6J("ngIf",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.NameVisible)&&!(null!=o.selectedPaperFormat&&o.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.ShowReleasedDate),t.xp6(1),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.ShowPriceDiscount),t.xp6(1),t.Q6J("ngIf",0==(null==o.selectedPaperFormat?null:o.selectedPaperFormat.Orientation)),t.xp6(1),t.Q6J("ngIf",o.selectedPaperFormat.PricebookVisible),t.xp6(1),t.Q6J("ngIf",1==(null==o.selectedPaperFormat?null:o.selectedPaperFormat.Orientation))}}let gt=(()=>{var p;class g{constructor(o,c,_,V,W,te,re){this.dialog=o,this.productStateService=c,this.productService=_,this.barcodeService=V,this.toastService=W,this.authService=te,this.route=re,this.paperFormatOptions=[],this.optionSelected={id:1,name:"Continuous - 3 Column"},this.paperFormats=[],this.totalStickerPerRow=0,this.lastIndex=0,this.destroy$=new y.x,this.productPreview=[],this.taxs=[];const ie=this.route.snapshot.queryParams?.ID;ie&&this.productService.getProductById(ie).pipe((0,X.b)(fe=>this.productStateService.setState([fe]))).subscribe(),(()=>{const fe=localStorage.getItem("Token");if(n.gT.IsNotEmpty(fe)){var Ge=n.gT.parseJwt(fe);this.outletView=Ge["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"].includes("Out")}})()}ngOnInit(){this.getPaperFormats(),this.checkAuthTax(),this.subscribeToObsproducts()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}checkAuthTax(){this.authService.getRoles().find(_=>"StpE"===_)?(this.getProductTax(),this.authTax=!0):this.authTax=!1}subscribeToObsproducts(){this.productStateService.getState().pipe((0,l.R)(this.destroy$)).subscribe(o=>{this.productPreview=o,this.relayout()})}getProductTax(){this.productService.getTax().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&(this.taxs=o)})}getPaperFormats(){this.barcodeService.getPaperFormatConfig().pipe((0,l.R)(this.destroy$)).subscribe({next:o=>{o.paperFormat&&(this.paperFormats=o.paperFormat,this.outlets=o.outlets,this.setSelectedPaperFormat(o.paperFormat[0]),this.initOptionFormat(),this.initOptionSelected(this.selectedPaperFormat))},error:o=>{console.error(o)}})}initOptionFormat(){this.paperFormatOptions=[],this.paperFormats.forEach((o,c)=>{this.paperFormatOptions=[...this.paperFormatOptions,{id:c+1,name:o.Name}]})}initOptionSelected(o){this.optionSelected=this.paperFormatOptions.find(c=>c.name===o.Name)}openSettingModal(){this.dialog.open(H,{width:"850px",data:{paperFormat:this.selectedPaperFormat,taxs:this.taxs,authTax:this.authTax,outlets:this.outlets,outletRole:this.outletView}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&this.selectedPaperFormat&&(this.updatePaperFormatSource(o),this.updatePaperFormat(),this.setSelectedPaperFormat(o))})}onSelectPaperFormat(){this.getPaperFormatBarcode()}getPaperFormatBarcode(){let c=this.findPaperFormatByName(this.optionSelected.name);this.setSelectedPaperFormat(c)}updatePaperFormat(){this.barcodeService.updatePaperFormatConfig(this.paperFormats).pipe((0,l.R)(this.destroy$)).subscribe({next:()=>{this.toastService.success("Success Update Paper Format","Success")},error:o=>{console.error(o)}})}setSelectedPaperFormat(o){this.selectedPaperFormat=o,this.barcodeService.setBarcodeConfigState(o),this.relayout(),this.getPPnVal(o)}findPaperFormatByName(o){return this.paperFormats.find(_=>_.Name==o)}updatePaperFormatSource(o){this.paperFormats=this.paperFormats.map(c=>(o.Name===c.Name&&(c=o),c))}getPPnVal(o){this.tax=o.TaxType?o.TaxType.Rate:null}relayout(){let o=this.selectedPaperFormat?.PaperWidth?this.selectedPaperFormat?.PaperWidth:0,c=this.selectedPaperFormat?.StickerWidth?this.selectedPaperFormat?.StickerWidth:0,_=this.selectedPaperFormat?.ColumnSpacing?this.selectedPaperFormat?.ColumnSpacing:0,W=Math.floor((o+_)/(c+_));this.totalStickerPerRow=W;let re=Math.floor(this.productPreview.length/W),ie=this.productPreview.length-re*W;this.lastIndex=0===ie?W:ie,this.productPreview=this.productPreview.map(ge=>(ge.setBarcodeTitle=this.selectedPaperFormat?.DescriptionAsCode&&ge.getDescription?ge.getDescription:ge.getCode,ge))}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(m.uw),t.Y36(R),t.Y36(ue),t.Y36(de),t.Y36(Ve._W),t.Y36(T.$),t.Y36(A.gz))},p.\u0275cmp=t.Xpm({type:p,selectors:[["app-print-preview"]],decls:15,vars:10,consts:[[1,"mt-3","d-print-none"],[1,"card","mt-0","mb-0","paper-barcode"],[1,"card-header","d-flex","justify-content-between","align-items-center","border-bottom","pb-5","d-print-none"],[1,"fw-light"],["align","right",2,"width","400px"],[1,"d-inline-block","fw-light","text-info","fst-italic"],["align","left","bindLabel","name","placeholder","Select Column",1,"d-inline-block","ms-4",3,"items","ngModel","clearable","ngModelChange","change"],[1,"btn","btn","btn-outline-secondary","ms-4",3,"click"],["aria-hidden","true",1,"fa","fa-cog"],[1,"card-body","d-print-block",2,"padding","0"],[1,"canvas"],[1,"barcodes"],[3,"width","height","margin-right","margin-bottom",4,"ngFor","ngForOf"],[1,"position-relative"],[3,"bc-value","bc-element-type","bc-width","bc-height",4,"ngIf"],[2,"margin-top","-4px","line-height","1"],["class","d-block",3,"font-size",4,"ngIf"],[4,"ngIf"],[3,"bc-value","bc-element-type","bc-width","bc-height"],[1,"d-block"],[4,"ngIf","ngIfElse"],["WITHOUT_PROMOTION",""],[1,"d-flex","justify-content-between"],[1,"ms-12"],[1,"me-12"],[1,"text-danger",2,"text-decoration","line-through","text-decoration-thickness","1.5px"],[1,"text-dark"],[1,"d-flex","justify-content-between","mt-1"],[1,"me-12","text-danger"],["WITH_TAX",""],["WITHOUT_TAX",""],[4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","justify-content-center","fw-bold"],[1,"mx-1"],[1,"h-100"],[1,"vertical-text"]],template:function(o,c){1&o&&(t._UZ(0,"div",0),t.TgZ(1,"div",1)(2,"div",2)(3,"h1",3),t._uU(4," Print Preview "),t.qZA(),t.TgZ(5,"div",4)(6,"h5",5),t._uU(7,"Paper Source"),t.qZA(),t.TgZ(8,"ng-select",6),t.NdJ("ngModelChange",function(V){return c.optionSelected=V})("change",function(){return c.onSelectPaperFormat()}),t.qZA(),t.TgZ(9,"button",7),t.NdJ("click",function(){return c.openSettingModal()}),t._UZ(10,"i",8),t.qZA()()(),t.TgZ(11,"div",9)(12,"div",10)(13,"ul",11),t.YNc(14,mt,13,18,"li",12),t.qZA()()()()),2&o&&(t.xp6(8),t.Q6J("items",c.paperFormatOptions)("ngModel",c.optionSelected)("clearable",!1),t.xp6(4),t.Udp("width",(null==c.selectedPaperFormat?null:c.selectedPaperFormat.PaperWidth)+"px")("margin-top",(null==c.selectedPaperFormat?null:c.selectedPaperFormat.MarginTop)+"px")("margin-left",(null==c.selectedPaperFormat?null:c.selectedPaperFormat.MarginLeft)+"px"),t.xp6(2),t.Q6J("ngForOf",c.productPreview))},dependencies:[F.sg,F.O5,b.JJ,b.On,U.w9,he,F.OU,F.JJ,F.uU,oe],styles:["ng-select[_ngcontent-%COMP%]{width:50%}.card-header[_ngcontent-%COMP%]{height:65px} div.barcode>img{text-align:center;max-width:100%;border:none;outline:none}@media (max-width: 480px){ div.barcode>img{border:none!important}} div.canvas ul.barcodes li img{display:block;margin:0 auto}.vertical-text[_ngcontent-%COMP%]{transform:rotate(180deg);writing-mode:vertical-rl;position:absolute;right:0;top:0%;text-align:center}"]}),g})(),pt=(()=>{var p;class g{constructor(o,c,_){this.variantServiceState=o,this.authService=c,this.queryParamService=_,this.domainName=localStorage.getItem("Domain")}onLogout(){this.variantServiceState.setState([]),this.queryParamService.setState(null),this.authService.logout()}}return(p=g).\u0275fac=function(o){return new(o||p)(t.Y36(R),t.Y36(T.$),t.Y36(D.U))},p.\u0275cmp=t.Xpm({type:p,selectors:[["app-pages"]],decls:20,vars:2,consts:[[1,"container"],[1,"row"],[1,"col-4","d-print-none"],[1,"col-8","p-0"],[1,"d-md-block","d-print-none"],[1,"row","justify-content-between","align-items-center"],[1,"col-auto","d-inline-flex"],[1,"pt-1rem","me-3"],["target","_blank","href","https://www.dealpos.com"],["src","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid"],[1,"col-auto"],[1,"logout","d-print-none"],[3,"href"],[3,"click"],[1,"fa","fa-sign-out-alt"]],template:function(o,c){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"app-list-products"),t.qZA(),t.TgZ(4,"div",3),t._UZ(5,"app-print-preview"),t.qZA()()(),t.TgZ(6,"footer",4)(7,"div",5)(8,"div",6)(9,"p",7),t._uU(10,"Powered by : "),t.qZA(),t.TgZ(11,"a",8),t._UZ(12,"img",9),t.qZA()(),t.TgZ(13,"div",10)(14,"div",11)(15,"a",12),t._uU(16),t.qZA(),t.TgZ(17,"h5",13),t.NdJ("click",function(){return c.onLogout()}),t._UZ(18,"span",14),t._uU(19,"\xa0Logout"),t.qZA()()()()()),2&o&&(t.xp6(15),t.MGl("href","https://",c.domainName,"",t.LSH),t.xp6(1),t.Oqu(c.domainName))},dependencies:[He,gt],styles:[".logout[_ngcontent-%COMP%]{position:relative;left:2.5vw;top:-5px;font-size:14px;cursor:pointer}footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:-1%}@media (min-height: 720px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:12%}}@media (min-height: 768px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:16%}}"]}),g})();var ft=E(4007);const vt=[{path:"",component:pt}];let yt=(()=>{var p;class g{}return(p=g).\u0275fac=function(o){return new(o||p)},p.\u0275mod=t.oAB({type:p}),p.\u0275inj=t.cJS({imports:[F.ez,ft.m,Be,me,Z,A.Bz.forChild(vt)]}),g})()},6608:function(J){var E;E=()=>(()=>{var F={d:(s,k)=>{for(var I in k)F.o(k,I)&&!F.o(s,I)&&Object.defineProperty(s,I,{enumerable:!0,get:k[I]})},o:(s,k)=>Object.prototype.hasOwnProperty.call(s,k)},A={};F.d(A,{default:()=>lt});var t={allowedTagList:["b","caption","cite","code","const","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","input","ins","kdb","label","li","option","output","p","q","s","sample","span","strong","td","th","u"]};Object.freeze(t.allowedTagList),Object.defineProperty(t,"allowedTagList",{configurable:!1,writable:!1}),t.fromCharCodeKeyCode={0:"LaunchCalculator",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",91:"OS",92:"OSRight",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",173:"-",182:"MyComputer",183:"MyCalculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta",225:"AltGraph"},Object.freeze(t.fromCharCodeKeyCode),Object.defineProperty(t,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),t.keyName={Unidentified:"Unidentified",AndroidDefault:"AndroidDefault",Alt:"Alt",AltGr:"AltGraph",CapsLock:"CapsLock",Ctrl:"Control",Fn:"Fn",FnLock:"FnLock",Hyper:"Hyper",Meta:"Meta",OSLeft:"OS",OSRight:"OS",Command:"OS",NumLock:"NumLock",ScrollLock:"ScrollLock",Shift:"Shift",Super:"Super",Symbol:"Symbol",SymbolLock:"SymbolLock",Enter:"Enter",Tab:"Tab",Space:" ",LeftArrow:"ArrowLeft",UpArrow:"ArrowUp",RightArrow:"ArrowRight",DownArrow:"ArrowDown",End:"End",Home:"Home",PageUp:"PageUp",PageDown:"PageDown",Backspace:"Backspace",Clear:"Clear",Copy:"Copy",CrSel:"CrSel",Cut:"Cut",Delete:"Delete",EraseEof:"EraseEof",ExSel:"ExSel",Insert:"Insert",Paste:"Paste",Redo:"Redo",Undo:"Undo",Accept:"Accept",Again:"Again",Attn:"Attn",Cancel:"Cancel",ContextMenu:"ContextMenu",Esc:"Escape",Execute:"Execute",Find:"Find",Finish:"Finish",Help:"Help",Pause:"Pause",Play:"Play",Props:"Props",Select:"Select",ZoomIn:"ZoomIn",ZoomOut:"ZoomOut",BrightnessDown:"BrightnessDown",BrightnessUp:"BrightnessUp",Eject:"Eject",LogOff:"LogOff",Power:"Power",PowerOff:"PowerOff",PrintScreen:"PrintScreen",Hibernate:"Hibernate",Standby:"Standby",WakeUp:"WakeUp",Compose:"Compose",Dead:"Dead",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",Print:"Print",num0:"0",num1:"1",num2:"2",num3:"3",num4:"4",num5:"5",num6:"6",num7:"7",num8:"8",num9:"9",a:"a",b:"b",c:"c",d:"d",e:"e",f:"f",g:"g",h:"h",i:"i",j:"j",k:"k",l:"l",m:"m",n:"n",o:"o",p:"p",q:"q",r:"r",s:"s",t:"t",u:"u",v:"v",w:"w",x:"x",y:"y",z:"z",A:"A",B:"B",C:"C",D:"D",E:"E",F:"F",G:"G",H:"H",I:"I",J:"J",K:"K",L:"L",M:"M",N:"N",O:"O",P:"P",Q:"Q",R:"R",S:"S",T:"T",U:"U",V:"V",W:"W",X:"X",Y:"Y",Z:"Z",Semicolon:";",Equal:"=",Comma:",",Hyphen:"-",Minus:"-",Plus:"+",Dot:".",Slash:"/",Backquote:"`",LeftParenthesis:"(",RightParenthesis:")",LeftBracket:"[",RightBracket:"]",Backslash:"\\",Quote:"'",numpad0:"0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",NumpadDot:".",NumpadDotAlt:",",NumpadMultiply:"*",NumpadPlus:"+",NumpadMinus:"-",NumpadSubtract:"-",NumpadSlash:"/",NumpadDotObsoleteBrowsers:"Decimal",NumpadMultiplyObsoleteBrowsers:"Multiply",NumpadPlusObsoleteBrowsers:"Add",NumpadMinusObsoleteBrowsers:"Subtract",NumpadSlashObsoleteBrowsers:"Divide",_allFnKeys:["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"],_someNonPrintableKeys:["Tab","Enter","Shift","ShiftLeft","ShiftRight","Control","ControlLeft","ControlRight","Alt","AltLeft","AltRight","Pause","CapsLock","Escape"],_directionKeys:["PageUp","PageDown","End","Home","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"]},Object.freeze(t.keyName._allFnKeys),Object.freeze(t.keyName._someNonPrintableKeys),Object.freeze(t.keyName._directionKeys),Object.freeze(t.keyName),Object.defineProperty(t,"keyName",{configurable:!1,writable:!1}),Object.freeze(t);const v=t;function M(s){return function(k){if(Array.isArray(k))return y(k)}(s)||function(k){if(typeof Symbol<"u"&&null!=k[Symbol.iterator]||null!=k["@@iterator"])return Array.from(k)}(s)||D(s)||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 R(){return R=Object.assign?Object.assign.bind():function(s){for(var k=1;k<arguments.length;k++){var I=arguments[k];for(var B in I)Object.prototype.hasOwnProperty.call(I,B)&&(s[B]=I[B])}return s},R.apply(this,arguments)}function T(s,k){return function(I){if(Array.isArray(I))return I}(s)||function(I,B){var e=null==I?null:typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(null!=e){var i,a,r,h,O=[],C=!0,x=!1;try{if(r=(e=e.call(I)).next,0===B){if(Object(e)!==e)return;C=!1}else for(;!(C=(i=r.call(e)).done)&&(O.push(i.value),O.length!==B);C=!0);}catch(Z){x=!0,a=Z}finally{try{if(!C&&null!=e.return&&(h=e.return(),Object(h)!==h))return}finally{if(x)throw a}}return O}}(s,k)||D(s,k)||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 D(s,k){if(s){if("string"==typeof s)return y(s,k);var I=Object.prototype.toString.call(s).slice(8,-1);return"Object"===I&&s.constructor&&(I=s.constructor.name),"Map"===I||"Set"===I?Array.from(s):"Arguments"===I||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I)?y(s,k):void 0}}function y(s,k){(null==k||k>s.length)&&(k=s.length);for(var I=0,B=new Array(k);I<k;I++)B[I]=s[I];return B}function l(s){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}function u(s,k){for(var I=0;I<k.length;I++){var B=k[I];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==l(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==l(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===l(i)?i:String(i)),B)}var i}var n=function(){function s(){!function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}(this,s)}var k,B;return k=s,B=[{key:"isNull",value:function(e){return null===e}},{key:"isUndefined",value:function(e){return void 0===e}},{key:"isUndefinedOrNullOrEmpty",value:function(e){return null==e||""===e}},{key:"isString",value:function(e){return"string"==typeof e||e instanceof String}},{key:"isEmptyString",value:function(e){return""===e}},{key:"isBoolean",value:function(e){return"boolean"==typeof e}},{key:"isTrueOrFalseString",value:function(e){var i=String(e).toLowerCase();return"true"===i||"false"===i}},{key:"isObject",value:function(e){return"object"===l(e)&&null!==e&&!Array.isArray(e)}},{key:"isEmptyObj",value:function(e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))return!1;return!0}},{key:"isNumberStrict",value:function(e){return"number"==typeof e}},{key:"isNumber",value:function(e){return!this.isArray(e)&&!isNaN(parseFloat(e))&&isFinite(e)}},{key:"isDigit",value:function(e){return/\d/.test(e)}},{key:"isNumberOrArabic",value:function(e){var i=this.arabicToLatinNumbers(e,!1,!0,!0);return this.isNumber(i)}},{key:"isInt",value:function(e){return"number"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)}},{key:"isFunction",value:function(e){return"function"==typeof e}},{key:"contains",value:function(e,i){return!(!this.isString(e)||!this.isString(i)||""===e||""===i)&&-1!==e.indexOf(i)}},{key:"isInArray",value:function(e,i){return!(!this.isArray(i)||i===[]||this.isUndefined(e))&&-1!==i.indexOf(e)}},{key:"isArray",value:function(e){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(e)||"object"===l(e)&&"[object Array]"===Object.prototype.toString.call(e);throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(e){return typeof Element<"u"&&e instanceof Element}},{key:"isInputElement",value:function(e){return this.isElement(e)&&"input"===e.tagName.toLowerCase()}},{key:"decimalPlaces",value:function(e){var i=T(e.split("."),2)[1];return this.isUndefined(i)?0:i.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(e){var i=T(String(Math.abs(e)).split("."),2)[1];if(this.isUndefined(i))return 0;var a=i.lastIndexOf("0");return-1===a?a=0:a+=2,a}},{key:"keyCodeNumber",value:function(e){return void 0===e.which?e.keyCode:e.which}},{key:"character",value:function(e){var i;if("Unidentified"===e.key||void 0===e.key||this.isSeleniumBot()){var a=this.keyCodeNumber(e);if(229===a)return v.keyName.AndroidDefault;var r=v.fromCharCodeKeyCode[a];i=s.isUndefinedOrNullOrEmpty(r)?String.fromCharCode(a):r}else switch(e.key){case"Add":i=v.keyName.NumpadPlus;break;case"Apps":i=v.keyName.ContextMenu;break;case"Crsel":i=v.keyName.CrSel;break;case"Decimal":i=e.char?e.char:v.keyName.NumpadDot;break;case"Del":i=v.keyName.Delete;break;case"Divide":i=v.keyName.NumpadSlash;break;case"Down":i=v.keyName.DownArrow;break;case"Esc":i=v.keyName.Esc;break;case"Exsel":i=v.keyName.ExSel;break;case"Left":i=v.keyName.LeftArrow;break;case"Meta":case"Super":i=v.keyName.OSLeft;break;case"Multiply":i=v.keyName.NumpadMultiply;break;case"Right":i=v.keyName.RightArrow;break;case"Spacebar":i=v.keyName.Space;break;case"Subtract":i=v.keyName.NumpadMinus;break;case"Up":i=v.keyName.UpArrow;break;default:i=e.key}return i}},{key:"browser",value:function(){var e,i=navigator.userAgent,a=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(a[1])?{name:"ie",version:(e=/\brv[ :]+(\d+)/g.exec(i)||[])[1]||""}:"Chrome"===a[1]&&null!==(e=i.match(/\b(OPR|Edge)\/(\d+)/))?{name:e[1].replace("OPR","opera"),version:e[2]}:(a=a[2]?[a[1],a[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(e=i.match(/version\/(\d+)/i))&&a.splice(1,1,e[1]),{name:a[0].toLowerCase(),version:a[1]})}},{key:"isSeleniumBot",value:function(){return!0===window.navigator.webdriver}},{key:"isNegative",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e===i||""!==e&&(s.isNumber(e)?e<0:a?this.contains(e,i):this.isNegativeStrict(e,i))}},{key:"isNegativeStrict",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.charAt(0)===i}},{key:"isNegativeWithBrackets",value:function(e,i,a){return e.charAt(0)===i&&this.contains(e,a)}},{key:"isZeroOrHasNoValue",value:function(e){return!/[1-9]/g.test(e)}},{key:"setRawNegativeSign",value:function(e){return this.isNegativeStrict(e,"-")?e:"-".concat(e)}},{key:"replaceCharAt",value:function(e,i,a){return"".concat(e.substr(0,i)).concat(a).concat(e.substr(i+a.length))}},{key:"clampToRangeLimits",value:function(e,i){return Math.max(i.minimumValue,Math.min(i.maximumValue,e))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(e,i,a){for(var r=new RegExp("[0-9".concat(a,"-]")),h=0,O=0;O<i;O++)r.test(e[O])&&h++;return h}},{key:"findCaretPositionInFormattedNumber",value:function(e,i,a,r){var h,O=a.length,C=e.length,x=0;for(h=0;h<O&&x<C&&x<i;h++)(e[x]===a[h]||"."===e[x]&&a[h]===r)&&x++;return h}},{key:"countCharInText",value:function(e,i){for(var a=0,r=0;r<i.length;r++)i[r]===e&&a++;return a}},{key:"convertCharacterCountToIndexPosition",value:function(e){return Math.max(e,e-1)}},{key:"getElementSelection",value:function(e){var i,a={};try{i=this.isUndefined(e.selectionStart)}catch{i=!1}try{if(i){var r=window.getSelection().getRangeAt(0);a.start=r.startOffset,a.end=r.endOffset,a.length=a.end-a.start}else a.start=e.selectionStart,a.end=e.selectionEnd,a.length=a.end-a.start}catch{a.start=0,a.end=0,a.length=0}return a}},{key:"setElementSelection",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(this.isUndefinedOrNullOrEmpty(a)&&(a=i),this.isInputElement(e))e.setSelectionRange(i,a);else if(!s.isNull(e.firstChild)){var r=document.createRange();r.setStart(e.firstChild,i),r.setEnd(e.firstChild,a);var h=window.getSelection();h.removeAllRanges(),h.addRange(r)}}},{key:"throwError",value:function(e){throw new Error(e)}},{key:"warning",value:function(e){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&console.warn("Warning: ".concat(e))}},{key:"isWheelEvent",value:function(e){return e instanceof WheelEvent}},{key:"isWheelUpEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY<0}},{key:"isWheelDownEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY>0}},{key:"forceDecimalPlaces",value:function(e,i){var a=T(String(e).split("."),2),h=a[1];return h?"".concat(a[0],".").concat(h.substr(0,i)):e}},{key:"roundToNearest",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return 0===e?0:(0===i&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(e/i)*i)}},{key:"modifyAndRoundToNearestAuto",value:function(e,i,a){e=Number(this.forceDecimalPlaces(e,a));var r=Math.abs(e);if(r>=0&&r<1){var h,O=Math.pow(10,-a);if(0===e)return i?O:-O;var x=a,Z=this.indexFirstNonZeroDecimalPlace(e);return h=Z>=x-1?O:Math.pow(10,-(Z+1)),this.roundToNearest(i?e+h:e-h,h)}e=parseInt(e,10);var f,L=Math.abs(e).toString().length;switch(L){case 1:f=0;break;case 2:case 3:f=1;break;case 4:case 5:f=2;break;default:f=L-3}var j,q=Math.pow(10,f);return(j=i?e+q:e-q)<=10&&j>=-10?j:this.roundToNearest(j,q)}},{key:"addAndRoundToNearestAuto",value:function(e,i){return this.modifyAndRoundToNearestAuto(e,!0,i)}},{key:"subtractAndRoundToNearestAuto",value:function(e,i){return this.modifyAndRoundToNearestAuto(e,!1,i)}},{key:"arabicToLatinNumbers",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.isNull(e))return e;var h=e.toString();if(""===h)return e;if(null===h.match(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06f4\u06f5\u06f6]/g))return i&&(h=Number(h)),h;a&&(h=h.replace(/\u066b/,".")),r&&(h=h.replace(/\u066c/g,"")),h=h.replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g,function(C){return C.charCodeAt(0)-1632}).replace(/[\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9]/g,function(C){return C.charCodeAt(0)-1776});var O=Number(h);return isNaN(O)?O:(i&&(h=O),h)}},{key:"triggerEvent",value:function(e){var i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,h=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],O=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];window.CustomEvent?i=new CustomEvent(e,{detail:r,bubbles:h,cancelable:O}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,h,O,{detail:r}),a.dispatchEvent(i)}},{key:"parseStr",value:function(e){var i,a,r,h,O={};if(0===e&&1/e<0&&(e="-0"),e=e.toString(),this.isNegativeStrict(e,"-")?(e=e.slice(1),O.s=-1):O.s=1,(i=e.indexOf("."))>-1&&(e=e.replace(".","")),i<0&&(i=e.length),(a=-1===e.search(/[1-9]/i)?e.length:e.search(/[1-9]/i))===(r=e.length))O.e=0,O.c=[0];else{for(h=r-1;"0"===e.charAt(h);h-=1)r-=1;for(r-=1,O.e=i-a-1,O.c=[],i=0;a<=r;a+=1)O.c[i]=+e.charAt(a),i+=1}return O}},{key:"testMinMax",value:function(e,i){var a=i.c,r=e.c,h=i.s,O=e.s,C=i.e,x=e.e;if(!a[0]||!r[0])return a[0]?h:r[0]?-O:0;if(h!==O)return h;var Z=h<0;if(C!==x)return C>x^Z?1:-1;for(h=-1,O=(C=a.length)<(x=r.length)?C:x,h+=1;h<O;h+=1)if(a[h]!==r[h])return a[h]>r[h]^Z?1:-1;return C===x?0:C>x^Z?1:-1}},{key:"randomString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;return Math.random().toString(36).substr(2,e)}},{key:"domElement",value:function(e){return s.isString(e)?document.querySelector(e):e}},{key:"getElementValue",value:function(e){return"input"===e.tagName.toLowerCase()?e.value:this.text(e)}},{key:"setElementValue",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;"input"===e.tagName.toLowerCase()?e.value=i:e.textContent=i}},{key:"setInvalidState",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Invalid";(""===i||this.isNull(i))&&this.throwError("Cannot set the invalid state with an empty message."),e.setCustomValidity(i)}},{key:"setValidState",value:function(e){e.setCustomValidity("")}},{key:"cloneObject",value:function(e){return R({},e)}},{key:"camelize",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(this.isNull(e))return null;a&&(e=e.replace(/^data-/,""));var h=e.split(i).map(function(O){return"".concat(O.charAt(0).toUpperCase()).concat(O.slice(1))});return h=h.join(""),r&&(h="".concat(h.charAt(0).toLowerCase()).concat(h.slice(1))),h}},{key:"text",value:function(e){var i=e.nodeType;return i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e.textContent:i===Node.TEXT_NODE?e.nodeValue:""}},{key:"setText",value:function(e,i){var a=e.nodeType;a!==Node.ELEMENT_NODE&&a!==Node.DOCUMENT_NODE&&a!==Node.DOCUMENT_FRAGMENT_NODE||(e.textContent=i)}},{key:"filterOut",value:function(e,i){var a=this;return e.filter(function(r){return!a.isInArray(r,i)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(e){if(""===(e=String(e)))return"";var i=T(e.split("."),2),a=i[0],r=i[1];if(this.isUndefinedOrNullOrEmpty(r))return a;var h=r.replace(/0+$/g,"");return""===h?a:"".concat(a,".").concat(h)}},{key:"getHoveredElement",value:function(){var e=M(document.querySelectorAll(":hover"));return e[e.length-1]}},{key:"arrayTrim",value:function(e,i){var a=e.length;return 0===a||i>a?e:i<0?[]:(e.length=parseInt(i,10),e)}},{key:"arrayUnique",value:function(){var e;return M(new Set((e=[]).concat.apply(e,arguments)))}},{key:"mergeMaps",value:function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];return new Map(i.reduce(function(r,h){return r.concat(M(h))},[]))}},{key:"objectKeyLookup",value:function(e,i){var a=Object.entries(e).find(function(h){return h[1]===i}),r=null;return void 0!==a&&(r=a[0]),r}},{key:"insertAt",value:function(e,i,a){if(a>(e=String(e)).length)throw new Error("The given index is out of the string range.");if(1!==i.length)throw new Error("The given string `char` should be only one character long.");return""===e&&0===a?i:"".concat(e.slice(0,a)).concat(i).concat(e.slice(a))}},{key:"scientificToDecimal",value:function(e){var i=Number(e);if(isNaN(i))return NaN;if(e=String(e),!this.contains(e,"e")&&!this.contains(e,"E"))return e;var a=T(e.split(/e/i),2),r=a[0],h=a[1],O=r<0;O&&(r=r.replace("-",""));var C=+h<0;C&&(h=h.replace("-",""));var x,Z=T(r.split(/\./),2),f=Z[0],L=Z[1];return C?(x=f.length>h?this.insertAt(f,".",f.length-h):"0.".concat("0".repeat(h-f.length)).concat(f),x="".concat(x).concat(L||"")):L?(r="".concat(f).concat(L),x=h<L.length?this.insertAt(r,".",+h+f.length):"".concat(r).concat("0".repeat(h-L.length))):(r=r.replace(".",""),x="".concat(r).concat("0".repeat(Number(h)))),O&&(x="-".concat(x)),x}}],B&&u(k,B),Object.defineProperty(k,"prototype",{writable:!1}),s}();function d(s){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}var P=function(){function s(e){if(function(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")}(this,s),null===e)throw new Error("Invalid AST")}var k,I;return k=s,(I=[{key:"evaluate",value:function(e){if(null==e)throw new Error("Invalid AST sub-tree");if("number"===e.type)return e.value;if("unaryMinus"===e.type)return-this.evaluate(e.left);var i=this.evaluate(e.left),a=this.evaluate(e.right);switch(e.type){case"op_+":return Number(i)+Number(a);case"op_-":return i-a;case"op_*":return i*a;case"op_/":return i/a;default:throw new Error("Invalid operator '".concat(e.type,"'"))}}}])&&function m(s,k){for(var I=0;I<k.length;I++){var B=k[I];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==d(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==d(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===d(i)?i:String(i)),B)}var i}(k.prototype,I),Object.defineProperty(k,"prototype",{writable:!1}),s}();function b(s){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}function U(s,k){for(var I=0;I<k.length;I++){var B=k[I];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==b(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==b(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===b(i)?i:String(i)),B)}var i}var z=function(){function s(){!function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}(this,s)}var k,B;return k=s,(B=[{key:"createNode",value:function(e,i,a){var r=new s;return r.type=e,r.left=i,r.right=a,r}},{key:"createUnaryNode",value:function(e){var i=new s;return i.type="unaryMinus",i.left=e,i.right=null,i}},{key:"createLeaf",value:function(e){var i=new s;return i.type="number",i.value=e,i}}])&&U(k,B),Object.defineProperty(k,"prototype",{writable:!1}),s}();function G(s){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}function X(s,k){for(var I=0;I<k.length;I++){var B=k[I];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==G(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==G(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===G(i)?i:String(i)),B)}var i}var ce=function pe(s,k,I){return k&&X(s.prototype,k),I&&X(s,I),Object.defineProperty(s,"prototype",{writable:!1}),s}(function s(k,I,B){(function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")})(this,s),this.type=k,this.value=I,this.symbol=B});function de(s){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}var Ne=function(){function s(e){(function(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")})(this,s),this.text=e,this.textLength=e.length,this.index=0,this.token=new ce("Error",0,0)}var k,I;return k=s,I=[{key:"_skipSpaces",value:function(){for(;" "===this.text[this.index]&&this.index<=this.textLength;)this.index++}},{key:"getIndex",value:function(){return this.index}},{key:"getNextToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".";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(e),this.token;switch(this.token.type="Error",this.text[this.index]){case"+":this.token.type="+";break;case"-":this.token.type="-";break;case"*":this.token.type="*";break;case"/":this.token.type="/";break;case"(":this.token.type="(";break;case")":this.token.type=")"}if("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(e){this._skipSpaces();for(var i=this.index;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===e&&this.index++;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;if(this.index===i)throw new Error("No number has been found while it was expected");return this.text.substring(i,this.index).replace(e,".")}}],I&&function ke(s,k){for(var I=0;I<k.length;I++){var B=k[I];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==de(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==de(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===de(i)?i:String(i)),B)}var i}(k.prototype,I),Object.defineProperty(k,"prototype",{writable:!1}),s}();function Q(s){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}var ne=function(){function s(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".";return function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}(this,s),this.text=e,this.decimalCharacter=i,this.lexer=new Ne(e),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}var k,I;return k=s,(I=[{key:"_exp",value:function(){var e=this._term(),i=this._moreExp();return z.createNode("op_+",e,i)}},{key:"_moreExp",value:function(){var e,i;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),i=this._moreExp(),z.createNode("op_+",i,e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),i=this._moreExp(),z.createNode("op_-",i,e)}return z.createLeaf(0)}},{key:"_term",value:function(){var e=this._factor(),i=this._moreTerms();return z.createNode("op_*",e,i)}},{key:"_moreTerms",value:function(){var e,i;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),i=this._moreTerms(),z.createNode("op_*",i,e);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),i=this._moreTerms(),z.createNode("op_/",i,e)}return z.createLeaf(1)}},{key:"_factor",value:function(){var e,i,a;switch(this.token.type){case"num":return a=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),z.createLeaf(a);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),i=this._factor(),z.createUnaryNode(i);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._exp(),this._match(")"),e;default:throw new Error("Unexpected token '".concat(this.token.symbol,"' with type '").concat(this.token.type,"' at position '").concat(this.token.index,"' in the factor function"))}}},{key:"_match",value:function(e){var i=this.lexer.getIndex()-1;if(this.text[i]!==e)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(i,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}])&&function ee(s,k){for(var I=0;I<k.length;I++){var B=k[I];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==Q(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==Q(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===Q(i)?i:String(i)),B)}var i}(k.prototype,I),Object.defineProperty(k,"prototype",{writable:!1}),s}();function Y(s){return function(k){if(Array.isArray(k))return be(k)}(s)||function(k){if(typeof Symbol<"u"&&null!=k[Symbol.iterator]||null!=k["@@iterator"])return Array.from(k)}(s)||se(s)||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 K(s,k){return function(I){if(Array.isArray(I))return I}(s)||function(I,B){var e=null==I?null:typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(null!=e){var i,a,r,h,O=[],C=!0,x=!1;try{if(r=(e=e.call(I)).next,0===B){if(Object(e)!==e)return;C=!1}else for(;!(C=(i=r.call(e)).done)&&(O.push(i.value),O.length!==B);C=!0);}catch(Z){x=!0,a=Z}finally{try{if(!C&&null!=e.return&&(h=e.return(),Object(h)!==h))return}finally{if(x)throw a}}return O}}(s,k)||se(s,k)||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 se(s,k){if(s){if("string"==typeof s)return be(s,k);var I=Object.prototype.toString.call(s).slice(8,-1);return"Object"===I&&s.constructor&&(I=s.constructor.name),"Map"===I||"Set"===I?Array.from(s):"Arguments"===I||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I)?be(s,k):void 0}}function be(s,k){(null==k||k>s.length)&&(k=s.length);for(var I=0,B=new Array(k);I<k;I++)B[I]=s[I];return B}function le(){return le=Object.assign?Object.assign.bind():function(s){for(var k=1;k<arguments.length;k++){var I=arguments[k];for(var B in I)Object.prototype.hasOwnProperty.call(I,B)&&(s[B]=I[B])}return s},le.apply(this,arguments)}function ue(s){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}function qe(s,k){for(var I=0;I<k.length;I++){var B=k[I];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,Ae(B.key),B)}}function xe(s,k,I){return(k=Ae(k))in s?Object.defineProperty(s,k,{value:I,enumerable:!0,configurable:!0,writable:!0}):s[k]=I,s}function Ae(s){var k=function(I,B){if("object"!==ue(I)||null===I)return I;var e=I[Symbol.toPrimitive];if(void 0!==e){var i=e.call(I,"string");if("object"!==ue(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)}(s);return"symbol"===ue(k)?k:String(k)}var ye,N=function(){function s(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(f,L){if(!(f instanceof L))throw new TypeError("Cannot call a class as a function")}(this,s);var h=s._setArgumentsValues(i,a,r),C=h.initialValue,x=h.userOptions;if(this.domElement=h.domElement,this.defaultRawValue="",this._setSettings(x,!1),this._checkElement(),this.savedCancellableValue=null,this.historyTable=[],this.historyTableIndex=-1,this.onGoingRedo=!1,this.parentForm=this._getParentForm(),!this.runOnce&&this.settings.formatOnPageLoad)this._formatDefaultValueOnPageLoad(C);else{var Z;if(n.isNull(C))switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.min:Z=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:Z=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:Z="0";break;case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:Z="";break;case s.options.emptyInputBehavior.null:Z=null;break;default:Z=this.settings.emptyInputBehavior}else Z=C;this._setElementAndRawValue(Z)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(C),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(f){var L=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e.autoNumericLocalList.forEach(function(j){j.set(f,L)})},setUnformatted:function(f){var L=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e.autoNumericLocalList.forEach(function(j){j.setUnformatted(f,L)})},get:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,L=[];return e.autoNumericLocalList.forEach(function(j){L.push(j.get())}),e._executeCallback(L,f),L},getNumericString:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,L=[];return e.autoNumericLocalList.forEach(function(j){L.push(j.getNumericString())}),e._executeCallback(L,f),L},getFormatted:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,L=[];return e.autoNumericLocalList.forEach(function(j){L.push(j.getFormatted())}),e._executeCallback(L,f),L},getNumber:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,L=[];return e.autoNumericLocalList.forEach(function(j){L.push(j.getNumber())}),e._executeCallback(L,f),L},getLocalized:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,L=[];return e.autoNumericLocalList.forEach(function(j){L.push(j.getLocalized())}),e._executeCallback(L,f),L},reformat:function(){e.autoNumericLocalList.forEach(function(f){f.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(f){f.unformat()})},unformatLocalized:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e.autoNumericLocalList.forEach(function(L){L.unformatLocalized(f)})},update:function(){for(var f=arguments.length,L=new Array(f),j=0;j<f;j++)L[j]=arguments[j];e.autoNumericLocalList.forEach(function(q){q.update.apply(q,L)})},isPristine:function(){var f=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],L=!0;return e.autoNumericLocalList.forEach(function(j){L&&!j.isPristine(f)&&(L=!1)}),L},clear:function(){var f=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.autoNumericLocalList.forEach(function(L){L.clear(f)})},remove:function(){e.autoNumericLocalList.forEach(function(f){f.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(f){f.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(f){f.nuke()})},has:function(f){return e.autoNumericLocalList.has(f instanceof s?f.node():f)},addObject:function(f){var L,j;f instanceof s?(L=f.node(),j=f):j=s.getAutoNumericElement(L=f),e._hasLocalList()||e._createLocalList();var q,H=j._getLocalList();0===H.size&&(j._createLocalList(),H=j._getLocalList()),H instanceof Map?q=n.mergeMaps(e._getLocalList(),H):(e._addToLocalList(L,j),q=e._getLocalList()),q.forEach(function($){$._setLocalList(q)})},removeObject:function(f){var L,j,q=arguments.length>1&&void 0!==arguments[1]&&arguments[1];f instanceof s?(L=f.node(),j=f):j=s.getAutoNumericElement(L=f);var H=e.autoNumericLocalList;e.autoNumericLocalList.delete(L),H.forEach(function($){$._setLocalList(e.autoNumericLocalList)}),q||L!==e.node()?j._createLocalList():j._setLocalList(new Map)},empty:function(){var f=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.autoNumericLocalList.forEach(function(L){f?L._createLocalList():L._setLocalList(new Map)})},elements:function(){var f=[];return e.autoNumericLocalList.forEach(function(L){f.push(L.node())}),f},getList:function(){return e.autoNumericLocalList},size:function(){return e.autoNumericLocalList.size}},this.options={reset:function(){return e.settings={rawValue:e.defaultRawValue},e.update(s.defaultSettings),e},allowDecimalPadding:function(f){return e.update({allowDecimalPadding:f}),e},alwaysAllowDecimalCharacter:function(f){return e.update({alwaysAllowDecimalCharacter:f}),e},caretPositionOnFocus:function(f){return e.settings.caretPositionOnFocus=f,e},createLocalList:function(f){return e.settings.createLocalList=f,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(f){return e.update({currencySymbol:f}),e},currencySymbolPlacement:function(f){return e.update({currencySymbolPlacement:f}),e},decimalCharacter:function(f){return e.update({decimalCharacter:f}),e},decimalCharacterAlternative:function(f){return e.settings.decimalCharacterAlternative=f,e},decimalPlaces:function(f){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:f}),e},decimalPlacesRawValue:function(f){return e.update({decimalPlacesRawValue:f}),e},decimalPlacesShownOnBlur:function(f){return e.update({decimalPlacesShownOnBlur:f}),e},decimalPlacesShownOnFocus:function(f){return e.update({decimalPlacesShownOnFocus:f}),e},defaultValueOverride:function(f){return e.update({defaultValueOverride:f}),e},digitalGroupSpacing:function(f){return e.update({digitalGroupSpacing:f}),e},digitGroupSeparator:function(f){return e.update({digitGroupSeparator:f}),e},divisorWhenUnfocused:function(f){return e.update({divisorWhenUnfocused:f}),e},emptyInputBehavior:function(f){return null===e.rawValue&&f!==s.options.emptyInputBehavior.null&&(n.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(f,"), 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:f}),e},eventBubbles:function(f){return e.settings.eventBubbles=f,e},eventIsCancelable:function(f){return e.settings.eventIsCancelable=f,e},failOnUnknownOption:function(f){return e.settings.failOnUnknownOption=f,e},formatOnPageLoad:function(f){return e.settings.formatOnPageLoad=f,e},formulaMode:function(f){return e.settings.formulaMode=f,e},historySize:function(f){return e.settings.historySize=f,e},invalidClass:function(f){return e.settings.invalidClass=f,e},isCancellable:function(f){return e.settings.isCancellable=f,e},leadingZero:function(f){return e.update({leadingZero:f}),e},maximumValue:function(f){return e.update({maximumValue:f}),e},minimumValue:function(f){return e.update({minimumValue:f}),e},modifyValueOnUpDownArrow:function(f){return e.settings.modifyValueOnUpDownArrow=f,e},modifyValueOnWheel:function(f){return e.settings.modifyValueOnWheel=f,e},negativeBracketsTypeOnBlur:function(f){return e.update({negativeBracketsTypeOnBlur:f}),e},negativePositiveSignPlacement:function(f){return e.update({negativePositiveSignPlacement:f}),e},negativeSignCharacter:function(f){return e.update({negativeSignCharacter:f}),e},negativePositiveSignBehavior:function(f){return e.settings.negativePositiveSignBehavior=f,e},noEventListeners:function(f){return f===s.options.noEventListeners.noEvents&&e.settings.noEventListeners===s.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:f}),e},onInvalidPaste:function(f){return e.settings.onInvalidPaste=f,e},outputFormat:function(f){return e.settings.outputFormat=f,e},overrideMinMaxLimits:function(f){return e.update({overrideMinMaxLimits:f}),e},positiveSignCharacter:function(f){return e.update({positiveSignCharacter:f}),e},rawValueDivisor:function(f){return e.update({rawValueDivisor:f}),e},readOnly:function(f){return e.settings.readOnly=f,e._setWritePermissions(),e},roundingMethod:function(f){return e.update({roundingMethod:f}),e},saveValueToSessionStorage:function(f){return e.update({saveValueToSessionStorage:f}),e},symbolWhenUnfocused:function(f){return e.update({symbolWhenUnfocused:f}),e},selectNumberOnly:function(f){return e.settings.selectNumberOnly=f,e},selectOnFocus:function(f){return e.settings.selectOnFocus=f,e},serializeSpaces:function(f){return e.settings.serializeSpaces=f,e},showOnlyNumbersOnFocus:function(f){return e.update({showOnlyNumbersOnFocus:f}),e},showPositiveSign:function(f){return e.update({showPositiveSign:f}),e},showWarnings:function(f){return e.settings.showWarnings=f,e},styleRules:function(f){return e.update({styleRules:f}),e},suffixText:function(f){return e.update({suffixText:f}),e},unformatOnHover:function(f){return e.settings.unformatOnHover=f,e},unformatOnSubmit:function(f){return e.settings.unformatOnSubmit=f,e},upDownStep:function(f){return e.settings.upDownStep=f,e},valuesToStrings:function(f){return e.update({valuesToStrings:f}),e},watchExternalChanges:function(f){return e.update({watchExternalChanges:f}),e},wheelOn:function(f){return e.settings.wheelOn=f,e},wheelStep:function(f){return e.settings.wheelStep=f,e}},this._triggerEvent(s.events.initialized,this.domElement,{newValue:n.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var k,I,B;return k=s,I=[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=n.scientificToDecimal(this.domElement.getAttribute("value")),n.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,n.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this._onFocusInFunc=function(i){e._onFocusIn(i)},this._onFocusInAndMouseEnterFunc=function(i){e._onFocusInAndMouseEnter(i)},this._onFocusFunc=function(){e._onFocus()},this._onKeydownFunc=function(i){e._onKeydown(i)},this._onKeypressFunc=function(i){e._onKeypress(i)},this._onKeyupFunc=function(i){e._onKeyup(i)},this._onFocusOutAndMouseLeaveFunc=function(i){e._onFocusOutAndMouseLeave(i)},this._onPasteFunc=function(i){e._onPaste(i)},this._onWheelFunc=function(i){e._onWheel(i)},this._onDropFunc=function(i){e._onDrop(i)},this._onKeydownGlobalFunc=function(i){e._onKeydownGlobal(i)},this._onKeyupGlobalFunc=function(i){e._onKeyupGlobal(i)},this.domElement.addEventListener("focusin",this._onFocusInFunc,!1),this.domElement.addEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("focus",this._onFocusFunc,!1),this.domElement.addEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("keydown",this._onKeydownFunc,!1),this.domElement.addEventListener("keypress",this._onKeypressFunc,!1),this.domElement.addEventListener("keyup",this._onKeyupFunc,!1),this.domElement.addEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("paste",this._onPasteFunc,!1),this.domElement.addEventListener("wheel",this._onWheelFunc,!1),this.domElement.addEventListener("drop",this._onDropFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,s._doesGlobalListExists()||(document.addEventListener("keydown",this._onKeydownGlobalFunc,!1),document.addEventListener("keyup",this._onKeyupGlobalFunc,!1))}},{key:"_removeEventListeners",value:function(){this.domElement.removeEventListener("focusin",this._onFocusInFunc,!1),this.domElement.removeEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("focus",this._onFocusFunc,!1),this.domElement.removeEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("keydown",this._onKeydownFunc,!1),this.domElement.removeEventListener("keypress",this._onKeypressFunc,!1),this.domElement.removeEventListener("keyup",this._onKeyupFunc,!1),this.domElement.removeEventListener("paste",this._onPasteFunc,!1),this.domElement.removeEventListener("wheel",this._onWheelFunc,!1),this.domElement.removeEventListener("drop",this._onDropFunc,!1),this._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()):e>1?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(){this._getFormElement(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(){this._getFormElement(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(){return"anFormHandler"in this._getFormElement(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null).dataset}},{key:"_getFormElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n.isNull(e)?this.parentForm:e}},{key:"_storeFormHandlerFunction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var i=n.randomString();this._getFormElement(e).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(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.domElement.readOnly||this.settings.readOnly?this._setReadOnly():this._setReadWrite()}},{key:"_setReadOnly",value:function(){this.isInputElement?this.domElement.readOnly=!0:this.domElement.setAttribute("contenteditable",!1)}},{key:"_setReadWrite",value:function(){this.isInputElement?this.domElement.readOnly=!1:this.domElement.setAttribute("contenteditable",!0)}},{key:"_addWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,a=i.set,r=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return r.call(e.domElement)},set:function(h){a.call(e.domElement,h),e.settings.watchExternalChanges&&!e.internalModification&&e.set(h)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,a=i.set,r=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return r.call(e.domElement)},set:function(h){a.call(e.domElement,h)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var i=this.domElement.nodeType;i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":i===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=0===this.historyTable.length;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var i=!0;if(!e){var a=this.historyTableIndex+1;a<this.historyTable.length&&this.rawValue===this.historyTable[a].value?i=!1:n.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,i){var r=n.getElementSelection(this.domElement);this.selectionStart=r.start,this.selectionEnd=r.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),this.historyTable.length>1&&(this.historyTable[this.historyTableIndex-1].start=this.selectionStart,this.historyTable[this.historyTableIndex-1].end=this.selectionEnd)}this.historyTable.length>this.settings.historySize&&this._historyTableForget()}}},{key:"_historyTableUndoOrRedo",value:function(){var e;if(arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?(e=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(e=this.historyTableIndex>0)&&this.historyTableIndex--,e){var i=this.historyTable[this.historyTableIndex];this.set(i.value,null,!1),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(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=[],a=0;a<e;a++)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)||(this.rawValue>=0?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||0===this.settings.styleRules.ranges.length||this.settings.styleRules.ranges.forEach(function(i){e.rawValue>=i.min&&e.rawValue<i.max?e._addCSSClass(i.class):e._removeCSSClass(i.class)}),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||0===this.settings.styleRules.userDefined.length||this.settings.styleRules.userDefined.forEach(function(i){if(n.isFunction(i.callback))if(n.isString(i.classes))i.callback(e.rawValue)?e._addCSSClass(i.classes):e._removeCSSClass(i.classes);else if(n.isArray(i.classes))if(2===i.classes.length)i.callback(e.rawValue)?(e._addCSSClass(i.classes[0]),e._removeCSSClass(i.classes[1])):(e._removeCSSClass(i.classes[0]),e._addCSSClass(i.classes[1]));else if(i.classes.length>2){var a=i.callback(e.rawValue);n.isArray(a)?i.classes.forEach(function(r,h){n.isInArray(h,a)?e._addCSSClass(r):e._removeCSSClass(r)}):n.isInt(a)?i.classes.forEach(function(r,h){h===a?e._addCSSClass(r):e._removeCSSClass(r)}):n.isNull(a)?i.classes.forEach(function(r){e._removeCSSClass(r)}):n.throwError("The callback result is not an array nor a valid array index, ".concat(ue(a)," given."))}else n.throwError("The classes attribute is not valid for the `styleRules` option.");else n.isUndefinedOrNullOrEmpty(i.classes)?i.callback(e):n.throwError("The callback/classes structure is not valid for the `styleRules` option.");else n.warning("The given `styleRules` callback is not a function, ".concat(ue(i.callback)," given."),e.settings.showWarnings)}))}},{key:"_addCSSClass",value:function(e){this.domElement.classList.add(e)}},{key:"_removeCSSClass",value:function(e){this.domElement.classList.remove(e)}},{key:"update",value:function(){for(var e=this,i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];Array.isArray(a)&&Array.isArray(a[0])&&(a=a[0]);var h=n.cloneObject(this.settings),O=this.rawValue,C={};n.isUndefinedOrNullOrEmpty(a)||0===a.length?C=null:a.length>=1&&a.forEach(function(x){e.constructor._isPreDefinedOptionValid(x)&&(x=e.constructor._getOptionObject(x)),le(C,x)});try{this._setSettings(C,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(O)}catch(x){return this._setSettings(h,!0),n.throwError("Unable to update the settings, those are invalid: [".concat(x,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,h=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];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(r)||this._setSettings(r,!0),null===e&&this.settings.emptyInputBehavior!==s.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,h),this._saveValueToPersistentStorage(),this;if(i=this.constructor._toNumericValue(e,this.settings),isNaN(Number(i)))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("",h),this;if(""===i)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:i=0;break;case s.options.emptyInputBehavior.min:i=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:i=this.settings.maximumValue;break;default:n.isNumber(this.settings.emptyInputBehavior)&&(i=Number(this.settings.emptyInputBehavior))}if(""!==i){var O=K(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),C=O[0],x=O[1];if(C&&x&&this.settings.valuesToStrings&&this._checkValuesToStrings(i))return this._setElementAndRawValue(this.settings.valuesToStrings[i],i,h),this._saveValueToPersistentStorage(),this;if(n.isZeroOrHasNoValue(i)&&(i="0"),C&&x){var Z=this.constructor._roundRawValue(i,this.settings);return Z=this._trimLeadingAndTrailingZeros(Z.replace(this.settings.decimalCharacter,".")),i=this._getRawValueToFormat(i),this.isFocused?i=this.constructor._roundFormattedValueShownOnFocus(i,this.settings):(this.settings.divisorWhenUnfocused&&(i=(i/=this.settings.divisorWhenUnfocused).toString()),i=this.constructor._roundFormattedValueShownOnBlur(i,this.settings)),i=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(i,this.settings),i=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue,Z),!this.isFocused&&this.settings.symbolWhenUnfocused&&(i="".concat(i).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(i,Z,h),this._setValidOrInvalidState(Z),this}return this._triggerRangeEvents(C,x),n.throwError("The value [".concat(i,"] being set falls outside of the minimumValue [").concat(this.settings.minimumValue,"] and maximumValue [").concat(this.settings.maximumValue,"] range set for this element")),this._removeValueFromPersistentStorage(),this.setValue("",h),this}return this._setElementAndRawValue(this.settings.emptyInputBehavior===s.options.emptyInputBehavior.always?this.settings.currencySymbol:"","",h),this}},{key:"setUnformatted",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===e||n.isUndefined(e))return this;n.isNull(i)||this._setSettings(i,!0);var a=this.constructor._removeBrackets(e,this.settings),r=this.constructor._stripAllNonNumberCharacters(a,this.settings,!0,this.isFocused);return n.isNumber(r)||n.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(r,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){return this._setElementAndRawValue(e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),this}},{key:"_setRawValue",value:function(e){var i=this,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.rawValue!==e){var r=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(s.events.rawValueModified,this.domElement,{oldRawValue:r,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),a&&window.requestAnimationFrame(function(){return i._historyTableAdd()})}}},{key:"_setElementValue",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=n.getElementValue(this.domElement);return e!==a&&(this.internalModification=!0,n.setElementValue(this.domElement,e),this.internalModification=!1,i&&this._triggerEvent(s.events.formatted,this.domElement,{oldValue:a,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n.isNull(i)?i=e:n.isBoolean(i)&&(a=i,i=e),this._setElementValue(e),this._setRawValue(i,a),this}},{key:"_getRawValueToFormat",value:function(e){return n.isNull(this.settings.rawValueDivisor)||0===this.settings.rawValueDivisor||""===e||null===e?e:e*this.settings.rawValueDivisor}},{key:"_checkValuesToStrings",value:function(e){return this.constructor._checkValuesToStringsArray(e,this.valuesToStringsKeys)}},{key:"_isUserManuallyEditingTheValue",value:function(){return this.isFocused&&this.isEditing||this.isDropEvent}},{key:"_executeCallback",value:function(e,i){!n.isNull(i)&&n.isFunction(i)&&i(e,this)}},{key:"_triggerEvent",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;n.triggerEvent(e,i,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(){return this.getNumericString(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)}},{key:"getNumericString",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(this.rawValue)?null:n.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(e,i),e}},{key:"getFormatted",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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,e),i}},{key:"getNumber",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(e,i),e}},{key:"getLocalized",value:function(){var e,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.isFunction(a)&&n.isNull(r)&&(r=a,a=null),""!=(e=n.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(e)&&this.settings.leadingZero!==s.options.leadingZero.keep&&(e="0"),i=n.isNull(a)?this.settings.outputFormat:a;var h=this.constructor._toLocale(e,i,this.settings);return this._executeCallback(h,r),h}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(){return this._setElementValue(this.getLocalized(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)),this}},{key:"isPristine",value:function(){return arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?this.initialValueHtmlAttribute===this.getFormatted():this.initialValue===this.getNumericString()}},{key:"select",value:function(){return this.settings.selectNumberOnly?this.selectNumber():this._defaultSelectAll(),this}},{key:"_defaultSelectAll",value:function(){n.setElementSelection(this.domElement,0,n.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,i,a=n.getElementValue(this.domElement),r=a.length,h=this.settings.currencySymbol.length,O=this.settings.currencySymbolPlacement,C=n.isNegative(a,this.settings.negativeSignCharacter)?1:0,x=this.settings.suffixText.length;if(e=O===s.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left&&1===C&&h>0?h+1:h,O===s.options.currencySymbolPlacement.prefix)i=r-x;else switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:i=r-(x+h);break;case s.options.negativePositiveSignPlacement.right:i=h>0?r-(h+C+x):r-(h+x);break;default:i=r-(h+x)}return n.setElementSelection(this.domElement,e,i),this}},{key:"selectInteger",value:function(){var e=0,i=this.rawValue>=0;this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&i||!i&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left)&&(e+=1),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(e+=this.settings.currencySymbol.length);var a=n.getElementValue(this.domElement),r=a.indexOf(this.settings.decimalCharacter);return-1===r&&(r=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?a.length-this.settings.currencySymbol.length:a.length,i||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||(r-=1),r-=this.settings.suffixText.length),n.setElementSelection(this.domElement,e,r),this}},{key:"selectDecimal",value:function(){var e,a=n.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return-1===a?(a=0,e=0):e=(a+=1)+Number(this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur),n.setElementSelection(this.domElement,a,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(i)?this.domElement:i.node(),this._removeFromLocalList(e),this}},{key:"attach",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this._addToLocalList(e.node()),i&&e.update(this.settings),this}},{key:"formatOther",value:function(e){return this._formatOrUnformatOther(!0,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"unformatOther",value:function(e){return this._formatOrUnformatOther(!1,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"_formatOrUnformatOther",value:function(e,i){var a,r,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(a=n.isNull(h)?this.settings:this._cloneAndMergeSettings(h),n.isElement(i)){var O=n.getElementValue(i);return r=e?s.format(O,a):s.unformat(O,a),n.setElementValue(i,r),null}return e?s.format(i,a):s.unformat(i,a)}},{key:"init",value:function(e){var i=this,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!1,h=[];if(n.isString(e)?h=Y(document.querySelectorAll(e)):n.isElement(e)?(h.push(e),r=!0):n.isArray(e)?h=e:n.throwError("The given parameters to the 'init' function are invalid."),0===h.length)return n.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var O=this._getLocalList(),C=[];return h.forEach(function(x){var Z=i.settings.createLocalList;a&&(i.settings.createLocalList=!1);var f=new s(x,n.getElementValue(x),i.settings);a&&(f._setLocalList(O),i._addToLocalList(x,f),i.settings.createLocalList=Z),C.push(f)}),r?C[0]:C}},{key:"clear",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.set("",{emptyInputBehavior:s.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(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||n.isUndefinedOrNullOrEmpty(this.parentForm)){var e=this._getParentForm();if(!n.isNull(e)&&e!==this.parentForm){var i=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=i.length,this._hasFormHandlerFunction(e)?this._incrementParentFormCounter(e):(this._storeFormHandlerFunction(e),this._initializeFormCounterToOne(e))}this.parentForm=e}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var i=this,a=Y(e.elements),r=this._getContenteditableElements(e);return n.arrayUnique(a,r).filter(function(h){return i.constructor.isManagedByAutoNumeric(h)})}},{key:"_getContenteditableElements",value:function(e){if(n.isUndefinedOrNullOrEmpty(e)||!e.hasAttribute("id"))return[];var i=Y(e.querySelectorAll("[contenteditable=true]")),a=Y(document.querySelectorAll("*:not(input)[form=".concat(e.id,"][contenteditable=true]")));return n.arrayUnique(i,a)}},{key:"_getParentForm",value:function(){if(!n.isUndefined(this.domElement.form))return this.domElement.form;if("body"===this.domElement.tagName.toLowerCase())return null;var e,i=this.domElement;do{if(n.isNull(i=i.parentNode))return null;if("body"===(e=i.tagName?i.tagName.toLowerCase():""))break}while("form"!==e);return"form"===e?i:null}},{key:"formNumericString",value:function(){return this.constructor._serializeNumericString(this.form(),this.settings.serializeSpaces)}},{key:"formFormatted",value:function(){return this.constructor._serializeFormatted(this.form(),this.settings.serializeSpaces)}},{key:"formLocalized",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,e)}},{key:"formArrayNumericString",value:function(){return this.constructor._serializeNumericStringArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayFormatted",value:function(){return this.constructor._serializeFormattedArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayLocalized",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,e)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(){return JSON.stringify(this.formArrayLocalized(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformat()}),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformatLocalized()}),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).reformat()}),this}},{key:"formSubmitNumericString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n.isNull(e)?(this.formUnformat(),this.form().submit(),this.formReformat()):n.isFunction(e)?e(this.formNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n.isNull(e)?this.form().submit():n.isFunction(e)?e(this.formFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.isNull(i)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):n.isFunction(i)?i(this.formLocalized(e)):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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];le.apply(void 0,[this.settings].concat(i))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return le.apply(void 0,[e,this.settings].concat(a)),e}},{key:"_updatePredefinedOptions",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.isNull(i)?this.update(e):(this._mergeSettings(e,i),this.update(this.settings)),this}},{key:"french",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().French,e),this}},{key:"northAmerican",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().NorthAmerican,e),this}},{key:"british",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().British,e),this}},{key:"swiss",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Swiss,e),this}},{key:"japanese",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Japanese,e),this}},{key:"spanish",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Spanish,e),this}},{key:"chinese",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Chinese,e),this}},{key:"brazilian",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Brazilian,e),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];if("function"==typeof i)this.settings[e]=i(this,e);else{var a="";e in this.domElement.dataset&&(a=this.domElement.dataset[e]),a=n.camelize(a),"function"==typeof this.settings[a]&&(this.settings[e]=a(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.right)}},{key:"_modifyNegativeSignAndDecimalCharacterForRawValue",value:function(e){return"."!==this.settings.decimalCharacter&&(e=e.replace(this.settings.decimalCharacter,".")),"-"!==this.settings.negativeSignCharacter&&this.settings.isNegativeSignAllowed&&(e=e.replace(this.settings.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}},{key:"_initialCaretPosition",value:function(e){n.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===s.options.selectOnFocus.doNotSelect&&n.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var i=this.rawValue<0,a=n.isZeroOrHasNoValue(e),r=e.length,h=0,O=0,C=!1,x=0;this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.start&&(h=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,C=n.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalRight||(C?(O=e.indexOf(this.settings.decimalCharacter),x=this.settings.decimalCharacter.length):(O=h,x=0)));var Z="";i?Z=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!a&&(Z=this.settings.positiveSignCharacter);var f,L=Z.length,j=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:f=L+j;break;case s.options.negativePositiveSignPlacement.suffix:f=j}else f=j;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:f=r;break;case s.options.negativePositiveSignPlacement.suffix:f=j+h}else f=r;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:f=L+j+O;break;case s.options.negativePositiveSignPlacement.suffix:f=j+O}else f=j+O;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:f=L+j+O+x;break;case s.options.negativePositiveSignPlacement.suffix:f=j+O+x}else f=j+O+x}else if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:f=0;break;case s.options.negativePositiveSignPlacement.prefix:f=L}else f=0;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:f=h;break;case s.options.negativePositiveSignPlacement.prefix:f=L+h}else f=h;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:f=O;break;case s.options.negativePositiveSignPlacement.prefix:f=L+O}else f=O;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:f=O+x;break;case s.options.negativePositiveSignPlacement.prefix:f=L+O+x}else f=O+x;return f}},{key:"_triggerRangeEvents",value:function(e,i){e||this._triggerEvent(s.events.minRangeExceeded,this.domElement),i||this._triggerEvent(s.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?n.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(s.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(s.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(e){if(this.settings.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid){var i=this.constructor._isMinimumRangeRespected(e,this.settings),a=this.constructor._isMaximumRangeRespected(e,this.settings);i&&a?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(i,a)}}},{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!==s.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&&sessionStorage.setItem(this.rawValueStorageName,this.rawValue)}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?sessionStorage.getItem(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(){this.settings.saveValueToSessionStorage&&sessionStorage.removeItem(this.rawValueStorageName)}},{key:"_getDefaultValue",value:function(e){var i=e.getAttribute("value");return n.isNull(i)?"":i}},{key:"_onFocusInAndMouseEnter",value:function(e){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&"mouseenter"===e.type&&e.altKey)this.constructor._unformatAltHovered(this);else if("focus"===e.type&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),"focus"===e.type&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),"focus"===e.type||"mouseenter"===e.type&&!this.isFocused){var i=null;this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus&&this.rawValue<0&&null!==this.settings.negativeBracketsTypeOnBlur&&this.settings.isNegativeSignAllowed&&(i=this.constructor._removeBrackets(n.getElementValue(this.domElement),this.settings));var a=this._getRawValueToFormat(this.rawValue);if(""!==a){var r=this.constructor._roundFormattedValueShownOnFocusOrBlur(a,this.settings,this.isFocused);this.settings.showOnlyNumbersOnFocus===s.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",i=r.replace(".",this.settings.decimalCharacter)):i=n.isNull(r)?"":this.constructor._addGroupSeparators(r.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,a)}this.valueOnFocus=n.isNull(i)?"":i,this.lastVal=this.valueOnFocus;var h=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),O=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),C=h&&""!==O&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus;C&&(i=O),n.isNull(i)||this._setElementValue(i),C&&O===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&n.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():n.isNull(this.settings.caretPositionOnFocus)||n.setElementSelection(e.target,this._initialCaretPosition(n.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,n.setElementValue(this.domElement,"="),n.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,i=n.getElementValue(this.domElement);i=i.replace(/^\s*=/,"");try{var a=new ne(i,this.settings.decimalCharacter);e=(new P).evaluate(a)}catch{return this._triggerEvent(s.events.invalidFormula,this.domElement,{formula:i,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(s.events.validFormula,this.domElement,{formula:i,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===v.keyName.Backspace||this.eventKey===v.keyName.Delete||this.eventKey===v.keyName.LeftArrow||this.eventKey===v.keyName.RightArrow||this.eventKey===v.keyName.Home||this.eventKey===v.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===v.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===v.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else{if(this.eventKey===v.keyName.Equal)return void this._enterFormulaMode();if(this.settings.modifyValueOnUpDownArrow&&(this.eventKey===v.keyName.UpArrow||this.eventKey===v.keyName.DownArrow))return void this.upDownArrowAction(e)}if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===v.keyName.Esc&&(e.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(s.events.native.input,e.target)),this.select());var i=n.getElementValue(e.target);if(this.eventKey===v.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(s.events.native.change,e.target),this.valueOnFocus=i,this.rawValueOnFocus=this.rawValue,this.settings.isCancellable&&this._saveCancellableValue()),this._updateInternalProperties(e),this._processNonPrintableKeysAndShortcuts(e))this.processed=!0;else if(this.eventKey===v.keyName.Backspace||this.eventKey===v.keyName.Delete){var a=this._processCharacterDeletion(e);if(this.processed=!0,!a)return void e.preventDefault();this._formatValue(e),(i=n.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(s.events.native.input,e.target),e.preventDefault()),this.lastVal=i,this.throwInput=!0}}}else this.constructor._unformatAltHovered(this)}},{key:"_onKeypress",value:function(e){if(this.formulaMode){if(this._acceptNonPrintableKeysInFormulaMode()||this.settings.formulaChars.test(this.eventKey))return;e.preventDefault()}else if(this.eventKey!==v.keyName.Insert){var i=this.processed;if(this._updateInternalProperties(e),!this._processNonPrintableKeysAndShortcuts(e))if(i)e.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(e);var a=n.getElementValue(e.target);if(a!==this.lastVal&&this.throwInput)this._triggerEvent(s.events.native.input,e.target),e.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&n.getElementSelection(e.target).start===n.getElementSelection(e.target).end&&n.getElementSelection(e.target).start===a.indexOf(this.settings.decimalCharacter)){var r=n.getElementSelection(e.target).start+1;n.setElementSelection(e.target,r)}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===v.keyName.Esc)e.preventDefault();else{if(this._updateEventKeyInfo(e),this.eventKey===v.keyName.Z||this.eventKey===v.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),this._historyTableUndo(),void this._triggerEvent(s.events.native.input,e.target);this.onGoingRedo=!1}}else if((this.eventKey===v.keyName.Y||this.eventKey===v.keyName.y)&&e.ctrlKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&this.eventKey===v.keyName.x){var i=n.getElementSelection(this.domElement).start,a=this.constructor._toNumericValue(n.getElementValue(e.target),this.settings);this.set(a),this._setCaretPosition(i)}if(this.eventKey===v.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==v.keyName.Backspace&&this.eventKey!==v.keyName.Delete){this._updateInternalProperties(e);var r=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var h=n.getElementValue(e.target);if(!(r||""===h&&""===this.initialValueOnFirstKeydown)&&(h===this.settings.currencySymbol?n.setElementSelection(e.target,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?0:this.settings.currencySymbol.length):this.eventKey===v.keyName.Tab&&n.setElementSelection(e.target,0,h.length),(h===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(),h!==this.initialValueOnFirstKeydown&&this._triggerEvent(s.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:h,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),this.historyTable.length>1)){var O=n.getElementSelection(this.domElement);this.selectionStart=O.start,this.selectionEnd=O.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var C=n.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,C))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===v.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===s.options.showOnlyNumbersOnFocus.onlyNumbers&&(this.settings.digitGroupSeparator=this.originalDigitGroupSeparator,this.settings.currencySymbol=this.originalCurrencySymbol,this.settings.suffixText=this.originalSuffixText);var i=this._getRawValueToFormat(this.rawValue),a=n.isNull(i),r=K(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),h=r[0],O=r[1],C=!1;if(""===i||a||(this._triggerRangeEvents(h,O),this.settings.valuesToStrings&&this._checkValuesToStrings(i)&&(this._setElementValue(this.settings.valuesToStrings[i]),C=!0)),!C){var x;if(x=a||""===i?i:String(i),""===i||a){if(""===i)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:this._setRawValue("0"),x=this.constructor._roundValue("0",this.settings,0);break;case s.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),x=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case s.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),x=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:n.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),x=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else h&&O&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(i,this.settings)?(x=this._modifyNegativeSignAndDecimalCharacterForRawValue(x),this.settings.divisorWhenUnfocused&&!n.isNull(x)&&(x=(x/=this.settings.divisorWhenUnfocused).toString()),x=this.constructor._roundFormattedValueShownOnBlur(x,this.settings),x=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(x,this.settings)):this._triggerRangeEvents(h,O);var Z=this.constructor._orderValueCurrencySymbolAndSuffixText(x,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(x,this.settings)||a&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.null||(Z=this.constructor._addGroupSeparators(x,this.settings,!1,i)),Z===i&&""!==i&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&""!==i&&null!==i&&(Z="".concat(Z).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(Z))}this._setValidOrInvalidState(this.rawValue),"blur"===e.type&&this._onBlur(e)}}},{key:"_onPaste",value:function(e){if(e.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i,a;e.clipboardData&&e.clipboardData.getData?i=e.clipboardData.getData("text/plain"):n.throwError("Unable to retrieve the pasted value. Please use a modern browser (i.e. Firefox or Chromium).");var r=n.getElementValue(a=e.target.tagName?e.target:e.explicitOriginalTarget),h=a.selectionStart||0,O=a.selectionEnd||0,C=O-h;if(C===r.length){var x=this._preparePastedText(i),Z=n.arabicToLatinNumbers(x,!1,!1,!1);return"."===Z||""===Z||"."!==Z&&!n.isNumber(Z)?(this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")))):(this.set(Z),this.formatted=!0,void this._triggerEvent(s.events.native.input,a))}var f=n.isNegativeStrict(i,this.settings.negativeSignCharacter);f&&(i=i.slice(1,i.length));var L,j,q=this._preparePastedText(i);if("."!==(L="."===q?".":n.arabicToLatinNumbers(q,!1,!1,!1))&&(!n.isNumber(L)||""===L))return this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")));var H,$,ae=n.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);f&&!ae?(ae=!0,H=!0):H=!1;var he=r.slice(0,h),me=r.slice(O,r.length);$=this._preparePastedText(h!==O?he+me:r),ae&&($=n.setRawNegativeSign($)),j=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,h,this.settings.decimalCharacter)),H&&j++;var oe=$.slice(0,j),we=$.slice(j,$.length),De=!1;"."===L&&(n.contains(oe,".")&&(De=!0,oe=oe.replace(".","")),we=we.replace(".",""));var ze=!1;switch(""===oe&&"-"===we&&(oe="-",we="",ze=!0),this.settings.onInvalidPaste){case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:for(var et=n.parseStr(this.settings.minimumValue),tt=n.parseStr(this.settings.maximumValue),Oe=$,Ee=0,ut=oe;Ee<L.length&&($=(ut+=L[Ee])+we,this.constructor._checkIfInRange($,et,tt));)Oe=$,Ee++;if(j+=Ee,ze&&j++,this.settings.onInvalidPaste===s.options.onInvalidPaste.truncate){$=Oe,De&&j--;break}for(var Ce=j,ct=Oe.length;Ee<L.length&&Ce<ct;)if("."!==Oe[Ce]){if($=n.replaceCharAt(Oe,Ce,L[Ee]),!this.constructor._checkIfInRange($,et,tt))break;Oe=$,Ee++,Ce++}else Ce++;j=Ce,De&&j--,$=Oe;break;default:if($="".concat(oe).concat(L).concat(we),h===O)j=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,h,this.settings.decimalCharacter))+L.length;else if(""===we)j=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,h,this.settings.decimalCharacter))+L.length,ze&&j++;else{var dt=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,O,this.settings.decimalCharacter)),ht=n.getElementValue(a).slice(h,O);j=dt-C+n.countCharInText(this.settings.digitGroupSeparator,ht)+L.length}H&&j++,De&&j--}if(n.isNumber($)&&""!==$){var Ie=!1,nt=!1;try{this.set($),Ie=!0}catch{var Le;switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:Le=n.clampToRangeLimits($,this.settings);try{this.set(Le)}catch{n.throwError("Fatal error: Unable to set the clamped value '".concat(Le,"'."))}nt=!0,Ie=!0,$=Le;break;case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:n.throwError("The pasted value '".concat(i,"' results in a value '").concat($,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));default:return}}var it,Re=n.getElementValue(a);if(Ie)switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:if(nt){n.setElementSelection(a,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?Re.length-this.settings.currencySymbol.length:Re.length);break}default:it=n.findCaretPositionInFormattedNumber($,j,Re,this.settings.decimalCharacter),n.setElementSelection(a,it)}Ie&&r!==Re&&this._triggerEvent(s.events.native.input,a)}else this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' would result into an invalid content '").concat($,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,n.trimPaddedZerosFromDecimalPlaces(this.rawValue)!==n.trimPaddedZerosFromDecimalPlaces(this.rawValueOnFocus)&&this._triggerEvent(s.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_wheelAndUpDownActions",value:function(e,i,a,r){var h,O=e.target.selectionStart||0,C=e.target.selectionEnd||0,x=this.rawValue;if(h=+(h=n.isUndefinedOrNullOrEmpty(x)?this.settings.minimumValue>0||this.settings.maximumValue<0?i?this.settings.minimumValue:this.settings.maximumValue:0:x),n.isNumber(r)){var Z=+r;i?h+=Z:a&&(h-=Z)}else i?h=n.addAndRoundToNearestAuto(h,this.settings.decimalPlacesRawValue):a&&(h=n.subtractAndRoundToNearestAuto(h,this.settings.decimalPlacesRawValue));(h=n.clampToRangeLimits(h,this.settings))!==+x&&(this.set(h),this._triggerEvent(s.events.native.input,e.target)),e.preventDefault(),this._setSelection(O,C)}},{key:"upDownArrowAction",value:function(e){if(!(this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i=!1,a=!1;this.eventKey===v.keyName.UpArrow?i=!0:this.eventKey===v.keyName.DownArrow?a=!0:n.throwError("Something has gone wrong since neither an Up or Down arrow key is detected, but the function was still called!"),this._wheelAndUpDownActions(e,i,a,this.settings.upDownStep)}}},{key:"_onWheel",value:function(e){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===s.options.wheelOn.focus?this.isFocused?e.shiftKey||this.wheelAction(e):e.shiftKey&&this.wheelAction(e):this.settings.wheelOn===s.options.wheelOn.hover?e.shiftKey?(e.preventDefault(),window.scrollBy(0,n.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):n.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var i=!1,a=!1;n.isWheelUpEvent(e)?i=!0:n.isWheelDownEvent(e)?a=!0:n.throwError("The event is not a 'wheel' event."),this._wheelAndUpDownActions(e,i,a,this.settings.wheelStep),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){this.isDropEvent=!0,e.preventDefault();var i=e.dataTransfer.getData("text/plain"),a=this.unformatOther(i),r=this.rawValue;this.set(a),this.isDropEvent=!1;var h=this.constructor._toNumericValue(a,this.settings);isNaN(Number(h))||n.trimPaddedZerosFromDecimalPlaces(r)!==n.trimPaddedZerosFromDecimalPlaces(h)&&this._triggerEvent(s.events.native.change,this.domElement)}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){return i._unformatOnSubmit()}),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){var a=e._getDefaultValue(i.node());setTimeout(function(){return i.set(a)},0)})}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(e){if(n.character(e)===v.keyName.Alt){var i=n.getHoveredElement();if(s.isManagedByAutoNumeric(i)){var a=s.getAutoNumericElement(i);!a.formulaMode&&a.settings.unformatOnHover&&this.constructor._unformatAltHovered(a)}}}},{key:"_onKeyupGlobal",value:function(e){if(n.character(e)===v.keyName.Alt){var i=n.getHoveredElement();if(s.isManagedByAutoNumeric(i)){var a=s.getAutoNumericElement(i);if(a.formulaMode||!a.settings.unformatOnHover)return;this.constructor._reformatAltHovered(a)}}}},{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._isContentEditable(this.domElement))}},{key:"_isContentEditable",value:function(e){return e.hasAttribute("contenteditable")&&"true"===e.getAttribute("contenteditable")}},{key:"_formatDefaultValueOnPageLoad",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=!0;if(n.isNull(i)?(e=n.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",e)):e=i,this.isInputElement||this.isContentEditable){var r=this.constructor._toNumericValue(e,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==e||null===this.settings.defaultValueOverride&&""!==e&&e!==this.domElement.getAttribute("value")||""!==e&&"hidden"===this.domElement.getAttribute("type")&&!n.isNumber(r)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var h=this.constructor._removeBrackets(e,this.settings);(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&""!==this.settings.negativeSignCharacter&&n.isNegative(e,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(h,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(h,this.settings,!0,this.isFocused))}a=!1}}else isNaN(Number(r))||r===1/0?n.throwError("The value [".concat(e,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(r),a=!1);if(""===e)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:break;case s.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case s.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case s.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case s.options.emptyInputBehavior.zero:this.set("0");break;case s.options.emptyInputBehavior.null:this.set(null);break;default:this.set(this.settings.emptyInputBehavior)}else a&&e===this.domElement.getAttribute("value")&&this.set(e)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==e||this.set(e)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=K(this.settings.maximumValue.toString().split("."),1)[0],i=K(this.settings.minimumValue||0===this.settings.minimumValue?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),i=i.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(i.length,1)}},{key:"_calculateValuesToStringsKeys",value:function(){this.valuesToStringsKeys=this.settings.valuesToStrings?Object.keys(this.settings.valuesToStrings):[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];"true"!==i&&"false"!==i||(this.settings[e]="true"===i),"number"==typeof i&&(this.settings[e]=i.toString())}}},{key:"_setSettings",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!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=v.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,i){e=Math.max(e,0),i=Math.min(i,n.getElementValue(this.domElement).length),this.selection={start:e,end:i,length:i-e},n.setElementSelection(this.domElement,e,i)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=n.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=K(this._getLeftAndRightPartAroundTheSelection(),2),i=e[0],a=e[1];if(""===i&&""===a)return["",""];var r=!0;return this.eventKey!==v.keyName.Hyphen&&this.eventKey!==v.keyName.Minus||0!==Number(i)||(r=!1),this.isTrailingNegative&&(n.isNegative(a,this.settings.negativeSignCharacter)&&!n.isNegative(i,this.settings.negativeSignCharacter)||""===a&&n.isNegative(i,this.settings.negativeSignCharacter,!0))&&(i=i.replace(this.settings.negativeSignCharacter,""),a=a.replace(this.settings.negativeSignCharacter,""),i=i.replace("-",""),a=a.replace("-",""),i="-".concat(i)),[i=s._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,r,this.isFocused),a=s._stripAllNonNumberCharactersExceptCustomDecimalChar(a,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,i){var a=!0;this.eventKey!==v.keyName.Hyphen&&this.eventKey!==v.keyName.Minus||0!==Number(e)||(a=!1),this.isTrailingNegative&&n.isNegative(i,this.settings.negativeSignCharacter)&&!n.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),i=i.replace(this.settings.negativeSignCharacter,"")),e=s._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,a,this.isFocused),i=s._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,!1,this.isFocused),this.settings.leadingZero!==s.options.leadingZero.deny||this.eventKey!==v.keyName.num0&&this.eventKey!==v.keyName.numpad0||0!==Number(e)||n.contains(e,this.settings.decimalCharacter)||""===i||(e=e.substring(0,e.length-1));var r=e+i;if(this.settings.decimalCharacter){var h=r.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));h&&(r=(e=e.replace(h[1],h[1]+"0"))+i)}return[e,i,r]}},{key:"_setValueParts",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=K(this._normalizeParts(e,i),3),h=r[0],O=r[1],C=r[2],x=K(s._checkIfInRangeWithOverrideOption(C,this.settings),2),Z=x[0],f=x[1];if(Z&&f){var L=s._truncateDecimalPlaces(C,this.settings,a,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(""===L||L===this.settings.negativeSignCharacter){var j;switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:j="";break;case s.options.emptyInputBehavior.min:j=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:j=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:j="0";break;case s.options.emptyInputBehavior.null:j=null;break;default:j=this.settings.emptyInputBehavior}this._setRawValue(j)}else this._setRawValue(this._trimLeadingAndTrailingZeros(L));var q=s._truncateDecimalPlaces(C,this.settings,a,this.settings.decimalPlacesShownOnFocus),H=h.length;return H>q.length&&(H=q.length),1===H&&"0"===h&&this.settings.leadingZero===s.options.leadingZero.deny&&(H=""===O||"0"===h&&""!==O?1:0),this._setElementValue(q,!1),this._setCaretPosition(H),!0}return this._triggerRangeEvents(Z,f),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var i=this.settings.currencySymbol.length,a=n.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&a&&a.charAt(0)===this.settings.negativeSignCharacter?[1,i+1]:[0,i];else{var r=a.length;e=[r-i,r]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=K(this._getSignPosition(),2),i=e[0],a=e[1],r=this.selection;r.start<a&&r.end>i&&((r.start<i||r.end>a)&&n.getElementValue(this.domElement).substring(Math.max(r.start,i),Math.min(r.end,a)).match(/^\s*$/)?r.start<i?this._setSelection(r.start,i):this._setSelection(a,r.end):this._setSelection(Math.min(r.start,i),Math.max(r.end,a)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!n.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,i=K(this._getLeftAndRightPartAroundTheSelection(),2),a=i[0],r=i[1];delete this.valuePartsBeforePaste;var h=a.substr(0,e[0].length)+s._stripAllNonNumberCharactersExceptCustomDecimalChar(a.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(h,r,!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===v.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===v.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===v.keyName.c||this.eventKey===v.keyName.v||this.eventKey===v.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==v.keyName.v&&this.eventKey!==v.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===v.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===v.keyName.Z||this.eventKey===v.keyName.z);if(this.eventKey===v.keyName.LeftArrow||this.eventKey===v.keyName.RightArrow){if("keydown"===e.type&&!e.shiftKey){var i=n.getElementValue(this.domElement);this.eventKey!==v.keyName.LeftArrow||i.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==v.keyName.RightArrow||i.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start+1)!==this.settings.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)}return!0}return n.isInArray(this.eventKey,v.keyName._directionKeys)}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var i=K(e,2),a=i[0],r=i[1],h=n.getElementValue(this.domElement),O=n.isNegative(h,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix&&(this.eventKey===v.keyName.Backspace?(this.caretFix=this.selection.start>=h.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===h.charAt(this.selection.start-1)?a=a.substring(1):this.selection.start<=h.length-this.settings.suffixText.length&&(a=a.substring(0,a.length-1))):(this.caretFix=this.selection.start>=h.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,this.selection.start>=h.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(r=r.substring(1,r.length)),n.isNegative(a,this.settings.negativeSignCharacter)&&"-"===h.charAt(this.selection.start)&&(a=a.substring(1)))),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===v.keyName.Backspace?this.selection.start===h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&O?a=a.substring(1):"-"!==a&&(this.selection.start<=h.indexOf(this.settings.negativeSignCharacter)||!O)&&(a=a.substring(0,a.length-1)):("-"===a[0]&&(r=r.substring(1)),this.selection.start===h.indexOf(this.settings.negativeSignCharacter)&&O&&(a=a.substring(1)));break;case s.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===v.keyName.Backspace?this.selection.start===h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?a=a.substring(1):"-"!==a&&this.selection.start<=h.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length?a=a.substring(0,a.length-1):""===a||O||(a=a.substring(0,a.length-1)):(this.caretFix=this.selection.start>=h.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===h.indexOf(this.settings.negativeSignCharacter)&&(a=a.substring(1)),r=r.substring(1))}return[a,r]}},{key:"_processCharacterDeletion",value:function(e){var i,a;if(this.selection.length){this._expandSelectionOnSign();var r=K(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);i=r[0],a=r[1]}else{var h=K(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(a=h[1],""===(i=h[0])&&""===a&&(this.throwInput=!1),this.isTrailingNegative&&n.isNegative(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var O=K(this._processCharacterDeletionIfTrailingNegativeSign([i,a]),2);i=O[0],a=O[1]}else this.eventKey===v.keyName.Backspace?i=i.substring(0,i.length-1):a=a.substring(1,a.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(i).concat(a),this.settings)&&n.getElementValue(e.target)!==this.settings.currencySymbol&&(this._setValueParts(i,a),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(s.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(s.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=K(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),i=e[0],a=e[1];if(this.eventKey!==v.keyName.AndroidDefault&&(this.throwInput=!0),this.eventKey===this.settings.decimalCharacter||this.settings.decimalCharacterAlternative&&this.eventKey===this.settings.decimalCharacterAlternative){if(!this._isDecimalCharacterInsertionAllowed()||!this.settings.decimalCharacter)return!1;if(this.settings.alwaysAllowDecimalCharacter)i=i.replace(this.settings.decimalCharacter,""),a=a.replace(this.settings.decimalCharacter,"");else{if(n.contains(i,this.settings.decimalCharacter)||a.indexOf(this.settings.decimalCharacter)>0)return!0;0===a.indexOf(this.settings.decimalCharacter)&&(a=a.substr(1))}return this.settings.negativeSignCharacter&&n.contains(a,this.settings.negativeSignCharacter)&&(i="".concat(this.settings.negativeSignCharacter).concat(i),a=a.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(i+this.settings.decimalCharacter,a),!0}if(("-"===this.eventKey||"+"===this.eventKey)&&this.settings.isNegativeSignAllowed)return""===i&&n.contains(a,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&"+"===this.eventKey)&&(a=a.replace("-","")):n.isNegativeStrict(i,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&"+"===this.eventKey)&&(i=i.replace("-","")):(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&"-"===this.eventKey)&&(i="".concat(this.settings.negativeSignCharacter).concat(i)),this._setValueParts(i,a),!0;var r=Number(this.eventKey);return r>=0&&r<=9?(this.settings.isNegativeSignAllowed&&""===i&&n.contains(a,"-")&&(i="-",a=a.substring(1,a.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!n.contains(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&"0"!==this.eventKey&&(i="-".concat(i)),this._setValueParts("".concat(i).concat(this.eventKey),a),!0):(this.throwInput=!1,!1)}},{key:"_formatValue",value:function(e){var i=n.getElementValue(this.domElement),a=K(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((""===this.settings.digitGroupSeparator||""!==this.settings.digitGroupSeparator&&!n.contains(i,this.settings.digitGroupSeparator))&&(""===this.settings.currencySymbol||""!==this.settings.currencySymbol&&!n.contains(i,this.settings.currencySymbol))){var r=K(i.split(this.settings.decimalCharacter),1)[0],h="";n.isNegative(r,this.settings.negativeSignCharacter)&&(h=this.settings.negativeSignCharacter,r=r.replace(this.settings.negativeSignCharacter,""),a=a.replace("-","")),""===h&&r.length>this.settings.mIntPos&&"0"===a.charAt(0)&&(a=a.slice(1)),h===this.settings.negativeSignCharacter&&r.length>this.settings.mIntNeg&&"0"===a.charAt(0)&&(a=a.slice(1)),this.isTrailingNegative||(a="".concat(h).concat(a))}var O=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue),C=O.length;if(O){var x,Z=a.split("");if((this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&Z[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(Z.shift(),(this.eventKey===v.keyName.Backspace||this.eventKey===v.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix)&&(Z.push(this.settings.negativeSignCharacter),this.caretFix="keydown"===e.type),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.right))){var f=this.settings.currencySymbol.split(""),L=["\\","^","$",".","|","?","*","+","(",")","["],j=[];f.forEach(function($,ae){n.isInArray(ae=f[$],L)?j.push("\\"+ae):j.push(ae)}),this.eventKey===v.keyName.Backspace&&"-"===this.settings.negativeSignCharacter&&j.push("-"),Z.push(j.join("")),this.caretFix="keydown"===e.type}for(var q=0;q<Z.length;q++)Z[q].match("\\d")||(Z[q]="\\"+Z[q]);x=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(Z.join(".*?"))):new RegExp("^.*?[".concat(this.settings.currencySymbol,"]*").concat(Z.join(".*?")));var H=O.match(x);H?(C=H[0].length,this.settings.showPositiveSign&&(0===C&&H.input.charAt(0)===this.settings.positiveSignCharacter&&(C=1===H.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===C&&H.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(C=this.settings.currencySymbol.length+1)),(0===C&&O.charAt(0)!==this.settings.negativeSignCharacter||1===C&&O.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(C=this.settings.currencySymbol.length+(n.isNegativeStrict(O,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(C-=this.settings.currencySymbol.length),this.settings.suffixText&&(C-=this.settings.suffixText.length))}O!==i&&(this._setElementValue(O,!1),this._setCaretPosition(C)),this.formatted=!0}}],B=[{key:"version",value:function(){return"4.10.0"}},{key:"_setArgumentsValues",value:function(e,i,a){n.isNull(e)&&n.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var r,h,O,C=n.isElement(e),x=n.isString(e),Z=n.isObject(i),f=Array.isArray(i)&&i.length>0,L=n.isNumberOrArabic(i)||""===i,j=this._isPreDefinedOptionValid(i),q=n.isNull(i),H=n.isEmptyString(i),$=n.isObject(a),ae=Array.isArray(a)&&a.length>0,he=n.isNull(a),me=this._isPreDefinedOptionValid(a);return C&&q&&he?(r=e,O=null,h=null):C&&L&&he?(r=e,O=i,h=null):C&&Z&&he?(r=e,O=null,h=i):C&&j&&he?(r=e,O=null,h=this._getOptionObject(i)):C&&f&&he?(r=e,O=null,h=this.mergeOptions(i)):C&&(q||H)&&$?(r=e,O=null,h=a):C&&(q||H)&&ae?(r=e,O=null,h=this.mergeOptions(a)):x&&q&&he?(r=document.querySelector(e),O=null,h=null):x&&Z&&he?(r=document.querySelector(e),O=null,h=i):x&&j&&he?(r=document.querySelector(e),O=null,h=this._getOptionObject(i)):x&&f&&he?(r=document.querySelector(e),O=null,h=this.mergeOptions(i)):x&&(q||H)&&$?(r=document.querySelector(e),O=null,h=a):x&&(q||H)&&ae?(r=document.querySelector(e),O=null,h=this.mergeOptions(a)):x&&L&&he?(r=document.querySelector(e),O=i,h=null):x&&L&&$?(r=document.querySelector(e),O=i,h=a):x&&L&&me?(r=document.querySelector(e),O=i,h=this._getOptionObject(a)):x&&L&&ae?(r=document.querySelector(e),O=i,h=this.mergeOptions(a)):C&&L&&$?(r=e,O=i,h=a):C&&L&&me?(r=e,O=i,h=this._getOptionObject(a)):C&&L&&ae?(r=e,O=i,h=this.mergeOptions(a)):n.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(i,"' and '").concat(a,"' given.")),n.isNull(r)&&n.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:r,initialValue:O,userOptions:h}}},{key:"mergeOptions",value:function(e){var i=this,a={};return e.forEach(function(r){le(a,i._getOptionObject(r))}),a}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(s.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var i;return n.isString(e)?null==(i=s.getPredefinedOptions()[e])&&n.warning("The given pre-defined option [".concat(e,"] is not recognized by autoNumeric. Please check that pre-defined option name."),!0):i=e,i}},{key:"_doesFormHandlerListExists",value:function(){var e=ue(window.aNFormHandlerMap);return"undefined"!==e&&"object"===e}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,i){return n.isInArray(String(e),i)}},{key:"_checkValuesToStringsSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.keys(i.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.values(i.valuesToStrings))}},{key:"_unformatAltHovered",value:function(e){e.hoveredWithAlt=!0,e.unformat()}},{key:"_reformatAltHovered",value:function(e){e.hoveredWithAlt=!1,e.reformat()}},{key:"_getChildANInputElement",value:function(e){var i=this,a=e.getElementsByTagName("input"),r=[];return Array.prototype.slice.call(a,0).forEach(function(h){i.test(h)&&r.push(h)}),r}},{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=ue(window[this.autoNumericGlobalListName]);return"undefined"!==e&&"object"===e}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var i=e.node();if(this._isInGlobalList(i)){if(this._getFromGlobalList(i)===this)return;n.warning("A reference to the DOM element you just initialized already exists in the global AutoNumeric element list. Please make sure to not initialize the same DOM element multiple times.",e.getSettings().showWarnings)}window[this.autoNumericGlobalListName].set(i,e)}},{key:"_removeFromGlobalList",value:function(e){this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].delete(e.node())}},{key:"_getFromGlobalList",value:function(e){return this._doesGlobalListExists()?window[this.autoNumericGlobalListName].get(e):null}},{key:"_isInGlobalList",value:function(e){return!!this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].has(e)}},{key:"validate",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!n.isUndefinedOrNullOrEmpty(e)&&n.isObject(e)||n.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var r,h=n.isObject(a);h||n.isNull(a)||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=i?le({},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 O,C=/^[0-9]+$/,x=/[0-9]+/,Z=/^-?[0-9]+(\.?[0-9]+)?$/,f=/^[0-9]+(\.?[0-9]+)?$/;n.isTrueOrFalseString(r.allowDecimalPadding)||n.isBoolean(r.allowDecimalPadding)||r.allowDecimalPadding===s.options.allowDecimalPadding.floats||n.isNumber(r.allowDecimalPadding)&&r.allowDecimalPadding>0||n.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true`, `'floats'` or a positive integer superior to 0, [".concat(r.allowDecimalPadding,"] given.")),n.isNumber(r.allowDecimalPadding)&&r.allowDecimalPadding>r.decimalPlaces&&n.warning("Setting 'allowDecimalPadding' to a number [".concat(r.allowDecimalPadding,"] superior to the current 'decimalPlaces' settings [").concat(r.decimalPlaces,"] is useless, since the padding will not be shown."),r.showWarnings),r.allowDecimalPadding!==s.options.allowDecimalPadding.never&&"false"!==r.allowDecimalPadding||r.decimalPlaces===s.options.decimalPlaces.none&&r.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.none&&r.decimalPlacesShownOnFocus===s.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,[s.options.caretPositionOnFocus.start,s.options.caretPositionOnFocus.end,s.options.caretPositionOnFocus.decimalLeft,s.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.")),O=h?a:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),n.isNull(O)||O.caretPositionOnFocus===s.options.caretPositionOnFocus.doNoForceCaretPosition||O.selectOnFocus!==s.options.selectOnFocus.select||n.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(O.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,[s.options.digitGroupSeparator.comma,s.options.digitGroupSeparator.dot,s.options.digitGroupSeparator.normalSpace,s.options.digitGroupSeparator.thinSpace,s.options.digitGroupSeparator.narrowNoBreakSpace,s.options.digitGroupSeparator.noBreakSpace,s.options.digitGroupSeparator.noSeparator,s.options.digitGroupSeparator.apostrophe,s.options.digitGroupSeparator.arabicThousandsSeparator,s.options.digitGroupSeparator.dotAbove,s.options.digitGroupSeparator.privateUseTwo])||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,[s.options.digitalGroupSpacing.two,s.options.digitalGroupSpacing.twoThree,s.options.digitalGroupSpacing.twoScaled,s.options.digitalGroupSpacing.three,s.options.digitalGroupSpacing.four])||r.digitalGroupSpacing>=2&&r.digitalGroupSpacing<=4||n.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2t', '2s', '3', or '4', [".concat(r.digitalGroupSpacing,"] given.")),n.isInArray(r.decimalCharacter,[s.options.decimalCharacter.comma,s.options.decimalCharacter.dot,s.options.decimalCharacter.middleDot,s.options.decimalCharacter.arabicDecimalSeparator,s.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,[s.options.currencySymbolPlacement.prefix,s.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,[s.options.negativePositiveSignPlacement.prefix,s.options.negativePositiveSignPlacement.suffix,s.options.negativePositiveSignPlacement.left,s.options.negativePositiveSignPlacement.right,s.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)||x.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)||x.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)||x.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 show 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.")),n.isTrueOrFalseString(r.negativePositiveSignBehavior)||n.isBoolean(r.negativePositiveSignBehavior)||n.throwError("The option 'negativePositiveSignBehavior' is invalid ; it should be either 'true' or 'false', [".concat(r.negativePositiveSignBehavior,"] given."));var L=K(n.isNull(r.negativeBracketsTypeOnBlur)?["",""]:r.negativeBracketsTypeOnBlur.split(","),2),j=L[0],q=L[1];(n.contains(r.digitGroupSeparator,r.negativeSignCharacter)||n.contains(r.decimalCharacter,r.negativeSignCharacter)||n.contains(r.decimalCharacterAlternative,r.negativeSignCharacter)||n.contains(j,r.negativeSignCharacter)||n.contains(q,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(j,r.positiveSignCharacter)||n.contains(q,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,[s.options.overrideMinMaxLimits.ceiling,s.options.overrideMinMaxLimits.floor,s.options.overrideMinMaxLimits.ignore,s.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!==s.options.overrideMinMaxLimits.invalid&&r.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.ignore&&(r.minimumValue>0||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 (i.e. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),n.isString(r.maximumValue)&&Z.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)&&Z.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)&&r.decimalPlaces>=0||n.isString(r.decimalPlaces)&&C.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)&&r.decimalPlacesRawValue>=0||n.isString(r.decimalPlacesRawValue)&&C.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)||C.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)||f.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)||C.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,[s.options.onInvalidPaste.error,s.options.onInvalidPaste.ignore,s.options.onInvalidPaste.clamp,s.options.onInvalidPaste.truncate,s.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,[s.options.roundingMethod.halfUpSymmetric,s.options.roundingMethod.halfUpAsymmetric,s.options.roundingMethod.halfDownSymmetric,s.options.roundingMethod.halfDownAsymmetric,s.options.roundingMethod.halfEvenBankersRounding,s.options.roundingMethod.upRoundAwayFromZero,s.options.roundingMethod.downRoundTowardZero,s.options.roundingMethod.toCeilingTowardPositiveInfinity,s.options.roundingMethod.toFloorTowardNegativeInfinity,s.options.roundingMethod.toNearest05,s.options.roundingMethod.toNearest05Alt,s.options.roundingMethod.upToNext05,s.options.roundingMethod.downToNext05])||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,[s.options.negativeBracketsTypeOnBlur.parentheses,s.options.negativeBracketsTypeOnBlur.brackets,s.options.negativeBracketsTypeOnBlur.chevrons,s.options.negativeBracketsTypeOnBlur.curlyBraces,s.options.negativeBracketsTypeOnBlur.angleBrackets,s.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,s.options.negativeBracketsTypeOnBlur.halfBrackets,s.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,s.options.negativeBracketsTypeOnBlur.quotationMarks,s.options.negativeBracketsTypeOnBlur.guillemets])||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,[s.options.emptyInputBehavior.focus,s.options.emptyInputBehavior.press,s.options.emptyInputBehavior.always,s.options.emptyInputBehavior.min,s.options.emptyInputBehavior.max,s.options.emptyInputBehavior.zero,s.options.emptyInputBehavior.null])||Z.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===s.options.emptyInputBehavior.zero&&(r.minimumValue>0||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,"].")),Z.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,[s.options.leadingZero.allow,s.options.leadingZero.deny,s.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.")),C.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||Z.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,[s.options.outputFormat.string,s.options.outputFormat.number,s.options.outputFormat.dot,s.options.outputFormat.negativeDot,s.options.outputFormat.comma,s.options.outputFormat.negativeComma,s.options.outputFormat.dotNegative,s.options.outputFormat.commaNegative])||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.modifyValueOnUpDownArrow)||n.isBoolean(r.modifyValueOnUpDownArrow)||n.throwError("The increment/decrement on up and down arrow keys 'modifyValueOnUpDownArrow' is invalid ; it should be either 'true' or 'false', [".concat(r.modifyValueOnUpDownArrow,"] 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,[s.options.wheelOn.focus,s.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.upDownStep)&&!n.isNumber(r.upDownStep)||"progressive"!==r.upDownStep&&!f.test(r.upDownStep)||0===Number(r.upDownStep))&&n.throwError("The up/down arrow step value option 'upDownStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(r.upDownStep,"] given.")),(!n.isString(r.wheelStep)&&!n.isNumber(r.wheelStep)||"progressive"!==r.wheelStep&&!f.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,[s.options.serializeSpaces.plus,s.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(H){Object.prototype.hasOwnProperty.call(H,"callback")&&!n.isFunction(H.callback)&&n.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(ue(H.callback)," given."))}),(n.isNull(r.rawValueDivisor)||f.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 i=!0;try{this.validate(e,!0)}catch{i=!1}return i}},{key:"getDefaultConfig",value:function(){return s.defaultSettings}},{key:"getPredefinedOptions",value:function(){return s.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var i,a=this;return n.isUndefinedOrNullOrEmpty(e)||0===e.length?i=null:(i={},1===e.length&&Array.isArray(e[0])?e[0].forEach(function(r){le(i,a._getOptionObject(r))}):e.length>=1&&e.forEach(function(r){le(i,a._getOptionObject(r))})),i}},{key:"format",value:function(e){if(n.isUndefined(e)||null===e)return null;var i;i=n.isElement(e)?n.getElementValue(e):e,n.isString(i)||n.isNumber(i)||n.throwError('The value "'.concat(i,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var a=arguments.length,r=new Array(a>1?a-1:0),h=1;h<a;h++)r[h-1]=arguments[h];var O=this._generateOptionsObjectFromOptionsArray(r),C=le({},this.getDefaultConfig(),O);C.isNegativeSignAllowed=i<0,C.isPositiveSignAllowed=i>=0,this._setBrackets(C),this._cachesUsualRegularExpressions(C,{});var x=this._toNumericValue(i,C);return isNaN(Number(x))&&n.throwError("The value [".concat(x,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(x,C)||(n.triggerEvent(s.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(x,"] being set falls outside of the minimumValue [").concat(C.minimumValue,"] and maximumValue [").concat(C.maximumValue,"] range set for this element"))),C.valuesToStrings&&this._checkValuesToStringsSettings(i,C)?C.valuesToStrings[i]:(this._correctNegativePositiveSignPlacementOption(C),this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===x||null===x||(x*=C.rawValueDivisor),x=this._roundFormattedValueShownOnFocus(x,C),x=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(x,C),x=this._addGroupSeparators(x,C,!1,x))}},{key:"formatAndSet",value:function(e){var a=this.format(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return n.setElementValue(e,a),a}},{key:"unformat",value:function(e){if(n.isNumberStrict(e))return e;var i;if(""===(i=n.isElement(e)?n.getElementValue(e):e))return"";if(n.isUndefined(i)||null===i)return null;(n.isArray(i)||n.isObject(i))&&n.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(i,"] given."));for(var a=arguments.length,r=new Array(a>1?a-1:0),h=1;h<a;h++)r[h-1]=arguments[h];var O=this._generateOptionsObjectFromOptionsArray(r),C=le({},this.getDefaultConfig(),O);if(C.isNegativeSignAllowed=!1,C.isPositiveSignAllowed=!0,i=i.toString(),C.valuesToStrings&&this._checkStringsToValuesSettings(i,C))return n.objectKeyLookup(C.valuesToStrings,i);if(n.isNegative(i,C.negativeSignCharacter))C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1;else if(!n.isNull(C.negativeBracketsTypeOnBlur)){var x=K(C.negativeBracketsTypeOnBlur.split(","),2);C.firstBracket=x[0],C.lastBracket=x[1],i.charAt(0)===C.firstBracket&&i.charAt(i.length-1)===C.lastBracket&&(C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1,i=this._removeBrackets(i,C,!1))}return i=this._convertToNumericString(i,C),n.isNumber(Number(i))&&(i=n.scientificToDecimal(i)),new RegExp("[^+-0123456789.]","gi").test(i)?NaN:(this._correctNegativePositiveSignPlacementOption(C),C.originalDecimalPlacesRawValue=C.decimalPlacesRawValue?C.decimalPlacesRawValue:C.decimalPlaces,this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===i||null===i||(i/=C.rawValueDivisor),i=(i=this._roundRawValue(i,C)).replace(C.decimalCharacter,"."),i=this._toLocale(i,C.outputFormat,C))}},{key:"unformatAndSet",value:function(e){var a=this.unformat(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return n.setElementValue(e,a),a}},{key:"localize",value:function(e){var i,a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return""===(i=n.isElement(e)?n.getElementValue(e):e)?"":(n.isNull(r)&&(r=s.defaultSettings),i=this.unformat(i,r),0===Number(i)&&r.leadingZero!==s.options.leadingZero.keep&&(i="0"),a=n.isNull(r)?r.outputFormat:s.defaultSettings.outputFormat,this._toLocale(i,a,r))}},{key:"localizeAndSet",value:function(e){var a=this.localize(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return n.setElementValue(e,a),a}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var i=n.domElement(e);return this.isManagedByAutoNumeric(i)?this._getFromGlobalList(i):null}},{key:"set",value:function(e,i){var a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,h=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],O=n.domElement(e);return this.isManagedByAutoNumeric(O)?this.getAutoNumericElement(O).set(i,r,h):(a=!(!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.",a),null)}},{key:"getNumericString",value:function(e){return this._get(e,"getNumericString",arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"getFormatted",value:function(e){return this._get(e,"getFormatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"getNumber",value:function(e){return this._get(e,"getNumber",arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"_get",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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)[i](a)}},{key:"getLocalized",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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(i,a)}},{key:"_stripAllNonNumberCharacters",value:function(e,i,a,r){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,a,r).replace(i.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,i,a,r){var h=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(i.allowedAutoStrip,"")).match(i.numRegAutoStrip);if(e=h?[h[1],h[2],h[3]].join(""):"",i.leadingZero===s.options.leadingZero.allow||i.leadingZero===s.options.leadingZero.keep){var O="",C=K(e.split(i.decimalCharacter),2),Z=C[1],f=C[0];n.contains(f,i.negativeSignCharacter)&&(O=i.negativeSignCharacter,f=f.replace(i.negativeSignCharacter,"")),""===O&&f.length>i.mIntPos&&"0"===f.charAt(0)&&(f=f.slice(1)),""!==O&&f.length>i.mIntNeg&&"0"===f.charAt(0)&&(f=f.slice(1)),e="".concat(O).concat(f).concat(n.isUndefined(Z)?"":i.decimalCharacter+Z)}return(a&&i.leadingZero===s.options.leadingZero.deny||!r&&i.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(i.stripReg,"$1$2")),e}},{key:"_toggleNegativeBracket",value:function(e,i,a){return a?this._removeBrackets(e,i):this._addBrackets(e,i)}},{key:"_addBrackets",value:function(e,i){return n.isNull(i.negativeBracketsTypeOnBlur)?e:"".concat(i.firstBracket).concat(e.replace(i.negativeSignCharacter,"")).concat(i.lastBracket)}},{key:"_removeBrackets",value:function(e,i){var a,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n.isNull(i.negativeBracketsTypeOnBlur)||e.charAt(0)!==i.firstBracket?a=e:(a=(a=e.replace(i.firstBracket,"")).replace(i.lastBracket,""),r?(a=a.replace(i.currencySymbol,""),a=this._mergeCurrencySignNegativePositiveSignAndValue(a,i,!0,!1)):a="".concat(i.negativeSignCharacter).concat(a)),a}},{key:"_setBrackets",value:function(e){if(n.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var i=K(e.negativeBracketsTypeOnBlur.split(","),2),r=i[1];e.firstBracket=i[0],e.lastBracket=r}}},{key:"_convertToNumericString",value:function(e,i){e=this._removeBrackets(e,i,!1),e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(new RegExp("[".concat(i.digitGroupSeparator,"]"),"g"),""),"."!==i.decimalCharacter&&(e=e.replace(i.decimalCharacter,".")),n.isNegative(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-".concat(e)),i.showPositiveSign&&(e=e.replace(i.positiveSignCharacter,""));var r=n.arabicToLatinNumbers(e,i.leadingZero!==s.options.leadingZero.keep,!1,!1);return isNaN(r)||(e=r.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,i){return e=String(e),i.currencySymbol!==s.options.currencySymbol.none&&(e=e.replace(i.currencySymbol,"")),i.suffixText!==s.options.suffixText.none&&(e=e.replace(i.suffixText,"")),i.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen&&(e=e.replace(i.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,i,a){if(n.isNull(i)||i===s.options.outputFormat.string)return e;var r;switch(i){case s.options.outputFormat.number:r=Number(e);break;case s.options.outputFormat.dotNegative:r=n.isNegative(e)?e.replace("-","")+"-":e;break;case s.options.outputFormat.comma:case s.options.outputFormat.negativeComma:r=e.replace(".",",");break;case s.options.outputFormat.commaNegative:r=e.replace(".",","),r=n.isNegative(r)?r.replace("-","")+"-":r;break;case s.options.outputFormat.dot:case s.options.outputFormat.negativeDot:r=e;break;default:n.throwError("The given outputFormat [".concat(i,"] option is not recognized."))}return i!==s.options.outputFormat.number&&"-"!==a.negativeSignCharacter&&(r=r.replace("-",a.negativeSignCharacter)),r}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,i){return"-"!==i.negativeSignCharacter&&(e=e.replace("-",i.negativeSignCharacter)),"."!==i.decimalCharacter&&(e=e.replace(".",i.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,i){return""===e||e===i.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(e,i,a){var r;if(i.emptyInputBehavior===s.options.emptyInputBehavior.always||a)switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.none:r=e+i.currencySymbol+i.suffixText;break;default:r=i.currencySymbol+e+i.suffixText}else r=e;return r}},{key:"_addGroupSeparators",value:function(e,i,a,r){var h,O=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(h=n.isNull(O)?n.isNegative(e,i.negativeSignCharacter)||n.isNegativeWithBrackets(e,i.firstBracket,i.lastBracket):O<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,!1,a),this._isElementValueEmptyOrOnlyTheNegativeSign(e,i))return this._orderValueCurrencySymbolAndSuffixText(e,i,!0);var C=n.isZeroOrHasNoValue(e);h&&(e=e.replace("-",""));var x,Z=K(e.split(i.decimalCharacter),2),f=Z[0],L=Z[1];if(i.decimalCharacterAlternative&&n.isUndefined(L)){var j=K(e.split(i.decimalCharacterAlternative),2);f=j[0],L=j[1]}if(""!==i.digitGroupSeparator){var q;switch(i.digitalGroupSpacing=i.digitalGroupSpacing.toString(),i.digitalGroupSpacing){case s.options.digitalGroupSpacing.twoThree:q=/(\d)((\d)(\d{2}?)+)$/;break;case s.options.digitalGroupSpacing.twoScaled:q=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;default:q=new RegExp("(\\d)((\\d{".concat(i.digitalGroupSpacing,"}?)+)$"))}for(;q.test(f);)f=f.replace(q,"$1".concat(i.digitGroupSeparator,"$2"))}return 0===(x=a?i.decimalPlacesShownOnFocus:i.decimalPlacesShownOnBlur)||n.isUndefined(L)?e=f:(L.length>x&&(L=L.substring(0,x)),e="".concat(f).concat(i.decimalCharacter).concat(L)),e=s._mergeCurrencySignNegativePositiveSignAndValue(e,i,h,C),n.isNull(O)&&(O=r),null!==i.negativeBracketsTypeOnBlur&&(O<0||n.isNegativeStrict(e,i.negativeSignCharacter))&&(e=this._toggleNegativeBracket(e,i,a)),i.suffixText?"".concat(e).concat(i.suffixText):e}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(e,i,a,r){var h,O="";if(a?O=i.negativeSignCharacter:i.showPositiveSign&&!r&&(O=i.positiveSignCharacter),i.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(a||!a&&i.showPositiveSign&&!r))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:h="".concat(O).concat(i.currencySymbol).concat(e);break;case s.options.negativePositiveSignPlacement.right:h="".concat(i.currencySymbol).concat(O).concat(e);break;case s.options.negativePositiveSignPlacement.suffix:h="".concat(i.currencySymbol).concat(e).concat(O)}else h=i.currencySymbol+e;else if(i.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(a||!a&&i.showPositiveSign&&!r))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:h="".concat(e).concat(i.currencySymbol).concat(O);break;case s.options.negativePositiveSignPlacement.left:h="".concat(e).concat(O).concat(i.currencySymbol);break;case s.options.negativePositiveSignPlacement.prefix:h="".concat(O).concat(e).concat(i.currencySymbol)}else h=e+i.currencySymbol;return h}},{key:"_truncateZeros",value:function(e,i){var a;switch(i){case 0:a=/(\.(?:\d*[1-9])?)0*$/;break;case 1:a=/(\.\d(?:\d*[1-9])?)0*$/;break;default:a=new RegExp("(\\.\\d{".concat(i,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(a,"$1"),0===i&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,i){return this._roundValue(e,i,i.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,i,a){return a?this._roundFormattedValueShownOnFocus(e,i):this._roundFormattedValueShownOnBlur(e,i)}},{key:"_roundValue",value:function(e,i,a){if(n.isNull(e))return e;if(e=""===e?"0":e.toString(),i.roundingMethod===s.options.roundingMethod.toNearest05||i.roundingMethod===s.options.roundingMethod.toNearest05Alt||i.roundingMethod===s.options.roundingMethod.upToNext05||i.roundingMethod===s.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,i);var r,h=K(s._prepareValueForRounding(e,i),2),O=h[0],C=(e=h[1]).lastIndexOf("."),x=-1===C,Z=K(e.split("."),2),f=Z[0];if(!(Z[1]>0||i.allowDecimalPadding!==s.options.allowDecimalPadding.never&&i.allowDecimalPadding!==s.options.allowDecimalPadding.floats))return 0===Number(e)?f:"".concat(O).concat(f);r=i.allowDecimalPadding===s.options.allowDecimalPadding.always||i.allowDecimalPadding===s.options.allowDecimalPadding.floats?a:i.allowDecimalPadding>0?i.allowDecimalPadding:0;var L,q=e.length-1-(x?e.length-1:C),H="";if(q<=a){if(H=e,q<r){x&&(H="".concat(H).concat(i.decimalCharacter));for(var $="000000";q<r;)H+=$=$.substring(0,r-q),q+=$.length}else q>r?H=this._truncateZeros(H,r):0===q&&0===r&&(H=H.replace(/\.$/,""));return 0===Number(H)?H:"".concat(O).concat(H)}L=x?a-1:Number(a)+Number(C);var ae,he=Number(e.charAt(L+1)),me=e.substring(0,L+1).split("");if(ae="."===e.charAt(L)?e.charAt(L-1)%2:e.charAt(L)%2,this._shouldRoundUp(he,i,O,ae))for(var oe=me.length-1;oe>=0;oe-=1)if("."!==me[oe]){if(me[oe]=+me[oe]+1,me[oe]<10)break;oe>0&&(me[oe]="0")}return me=me.slice(0,L+1),H=this._truncateZeros(me.join(""),r),0===Number(H)?H:"".concat(O).concat(H)}},{key:"_roundCloseTo05",value:function(e,i){switch(i.roundingMethod){case s.options.roundingMethod.toNearest05:case s.options.roundingMethod.toNearest05Alt:e=(Math.round(20*e)/20).toString();break;case s.options.roundingMethod.upToNext05:e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}return n.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,i){var a="";return n.isNegativeStrict(e,"-")&&(a="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),0===Number(e)&&(a=""),(Number(e)>0&&i.leadingZero!==s.options.leadingZero.keep||e.length>0&&i.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[a,e]}},{key:"_shouldRoundUp",value:function(e,i,a,r){return e>4&&i.roundingMethod===s.options.roundingMethod.halfUpSymmetric||e>4&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&""===a||e>5&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&"-"===a||e>5&&i.roundingMethod===s.options.roundingMethod.halfDownSymmetric||e>5&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&""===a||e>4&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&"-"===a||e>5&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding||5===e&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding&&1===r||e>0&&i.roundingMethod===s.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===a||e>0&&i.roundingMethod===s.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===a||e>0&&i.roundingMethod===s.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,i,a,r){a&&(e=this._roundFormattedValueShownOnFocus(e,i));var h=K(e.split(i.decimalCharacter),2),O=h[0],C=h[1];if(C&&C.length>r)if(r>0){var x=C.substring(0,r);e="".concat(O).concat(i.decimalCharacter).concat(x)}else e=O;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,i){if(n.isNull(e)&&i.emptyInputBehavior===s.options.emptyInputBehavior.null||i.overrideMinMaxLimits===s.options.overrideMinMaxLimits.ignore||i.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var a,r=n.parseStr(i.minimumValue),h=n.parseStr(i.maximumValue),O=n.parseStr(e);switch(i.overrideMinMaxLimits){case s.options.overrideMinMaxLimits.floor:a=[n.testMinMax(r,O)>-1,!0];break;case s.options.overrideMinMaxLimits.ceiling:a=[!0,n.testMinMax(h,O)<1];break;default:a=[n.testMinMax(r,O)>-1,n.testMinMax(h,O)<1]}return a}},{key:"_isWithinRangeWithOverrideOption",value:function(e,i){var a=K(this._checkIfInRangeWithOverrideOption(e,i),2);return a[0]&&a[1]}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),n.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,i){return n.testMinMax(n.parseStr(i.minimumValue),this._cleanValueForRangeParse(e))>-1}},{key:"_isMaximumRangeRespected",value:function(e,i){return n.testMinMax(n.parseStr(i.maximumValue),this._cleanValueForRangeParse(e))<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=s.options.negativePositiveSignPlacement.left;else switch(e.currencySymbolPlacement){case s.options.currencySymbolPlacement.suffix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.prefix;break;case s.options.currencySymbolPlacement.prefix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(e){return n.isNull(e)?null:(!n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=s.options.selectOnFocus.doNotSelect),n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&e.selectOnFocus===s.options.selectOnFocus.select&&(e.caretPositionOnFocus=s.options.caretPositionOnFocus.doNoForceCaretPosition),e)}},{key:"_calculateDecimalPlacesOnInit",value:function(e){this._validateDecimalPlacesRawValue(e),e.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.useDefault&&(e.decimalPlacesShownOnFocus=e.decimalPlaces),e.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.useDefault&&(e.decimalPlacesShownOnBlur=e.decimalPlaces),e.decimalPlacesRawValue===s.options.decimalPlacesRawValue.useDefault&&(e.decimalPlacesRawValue=e.decimalPlaces);var i=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(i=String(e.rawValueDivisor).length-1)<0&&(i=0),e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+i,Number(e.originalDecimalPlacesRawValue)+i)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._validateDecimalPlacesRawValue(e),n.isNull(i)&&n.throwError("When updating the settings, the previous ones should be passed as an argument.");var a="decimalPlaces"in e;if(a||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){a?("decimalPlacesShownOnFocus"in e&&e.decimalPlacesShownOnFocus!==s.options.decimalPlacesShownOnFocus.useDefault||(e.decimalPlacesShownOnFocus=e.decimalPlaces),"decimalPlacesShownOnBlur"in e&&e.decimalPlacesShownOnBlur!==s.options.decimalPlacesShownOnBlur.useDefault||(e.decimalPlacesShownOnBlur=e.decimalPlaces),"decimalPlacesRawValue"in e&&e.decimalPlacesRawValue!==s.options.decimalPlacesRawValue.useDefault||(e.decimalPlacesRawValue=e.decimalPlaces)):(n.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=i.decimalPlacesShownOnFocus),n.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=i.decimalPlacesShownOnBlur));var r=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(r=String(e.rawValueDivisor).length-1)<0&&(r=0),e.decimalPlacesRawValue=e.decimalPlaces||e.decimalPlacesRawValue?Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+r,Number(e.decimalPlacesRawValue)+r):Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+r,Number(i.originalDecimalPlacesRawValue)+r)}}},{key:"_cachesUsualRegularExpressions",value:function(e,i){var a;a=e.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen?"([-\\".concat(e.negativeSignCharacter,"]?)"):"(-?)",i.aNegRegAutoStrip=a,e.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(e.decimalCharacter,"]"),"g"),e.numRegAutoStrip=new RegExp("".concat(a,"(?:\\").concat(e.decimalCharacter,"?([0-9]+\\").concat(e.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(e.decimalCharacter,"[0-9]*)?))")),e.stripReg=new RegExp("^".concat(i.aNegRegAutoStrip,"0*([0-9])")),e.formulaChars=new RegExp("[0-9".concat(e.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var i={aSep:"digitGroupSeparator",nSep:"showOnlyNumbersOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"decimalPlacesShownOnBlur",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",allowDecimalPadding:!0,alwaysAllowDecimalCharacter:!0,caretPositionOnFocus:!0,createLocalList:!0,currencySymbol:!0,currencySymbolPlacement:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,decimalPlaces:!0,decimalPlacesRawValue:!0,decimalPlacesShownOnBlur:!0,decimalPlacesShownOnFocus:!0,defaultValueOverride:!0,digitalGroupSpacing:!0,digitGroupSeparator:!0,divisorWhenUnfocused:!0,emptyInputBehavior:!0,eventBubbles:!0,eventIsCancelable:!0,failOnUnknownOption:!0,formatOnPageLoad:!0,formulaMode:!0,historySize:!0,isCancellable:!0,leadingZero:!0,maximumValue:!0,minimumValue:!0,modifyValueOnUpDownArrow:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,negativePositiveSignBehavior:!0,noEventListeners:!0,onInvalidPaste:!0,outputFormat:!0,overrideMinMaxLimits:!0,positiveSignCharacter:!0,rawValueDivisor:!0,readOnly:!0,roundingMethod:!0,saveValueToSessionStorage:!0,selectNumberOnly:!0,selectOnFocus:!0,serializeSpaces:!0,showOnlyNumbersOnFocus:!0,showPositiveSign:!0,showWarnings:!0,styleRules:!0,suffixText:!0,symbolWhenUnfocused:!0,upDownStep:!0,unformatOnHover:!0,unformatOnSubmit:!0,valuesToStrings:!0,watchExternalChanges:!0,wheelOn:!0,wheelStep:!0,allowedAutoStrip:!0,formulaChars:!0,isNegativeSignAllowed:!0,isPositiveSignAllowed:!0,mIntNeg:!0,mIntPos:!0,numRegAutoStrip:!0,originalDecimalPlaces:!0,originalDecimalPlacesRawValue:!0,stripReg:!0};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(!0===i[a])continue;Object.prototype.hasOwnProperty.call(i,a)?(n.warning("You are using the deprecated option name '".concat(a,"'. Please use '").concat(i[a],"' instead from now on. The old option name will be dropped very soon\u2122."),!0),e[i[a]]=e[a],delete e[a]):e.failOnUnknownOption&&n.throwError("Option name '".concat(a,"' 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=e.maximumValue>=0}},{key:"_toNumericValue",value:function(e,i){var a;return n.isNumber(Number(e))?(n.isNumberStrict(e)||(e=String(e).trim()),a=n.scientificToDecimal(e)):(a=this._convertToNumericString(e.toString(),i),n.isNumber(Number(a))||(n.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),i.showWarnings),a=NaN)),a}},{key:"_checkIfInRange",value:function(e,i,a){var r=n.parseStr(e);return n.testMinMax(i,r)>-1&&n.testMinMax(a,r)<1}},{key:"_shouldSkipEventKey",value:function(e){var i=n.isInArray(e,v.keyName._allFnKeys),a=e===v.keyName.OSLeft||e===v.keyName.OSRight,r=e===v.keyName.ContextMenu,h=n.isInArray(e,v.keyName._someNonPrintableKeys);return i||a||r||h||e===v.keyName.Unidentified||e===v.keyName.NumLock||e===v.keyName.ScrollLock||e===v.keyName.Insert||e===v.keyName.Command}},{key:"_serialize",value:function(e){var i,a=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unformatted",O=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+",C=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,x=[];return"object"===ue(e)&&"form"===e.nodeName.toLowerCase()&&Array.prototype.slice.call(e.elements).forEach(function(Z){if(Z.name&&!Z.disabled&&-1===["file","reset","submit","button"].indexOf(Z.type))if("select-multiple"===Z.type)Array.prototype.slice.call(Z.options).forEach(function(q){q.selected&&x.push(r?{name:Z.name,value:q.value}:"".concat(encodeURIComponent(Z.name),"=").concat(encodeURIComponent(q.value)))});else if(-1===["checkbox","radio"].indexOf(Z.type)||Z.checked){var f,L;if(a.isManagedByAutoNumeric(Z))switch(h){case"unformatted":L=a.getAutoNumericElement(Z),n.isNull(L)||(f=a.unformat(Z,L.getSettings()));break;case"localized":if(L=a.getAutoNumericElement(Z),!n.isNull(L)){var j=n.cloneObject(L.getSettings());n.isNull(C)||(j.outputFormat=C),f=a.localize(Z,j)}break;default:f=Z.value}else f=Z.value;n.isUndefined(f)&&n.throwError("This error should never be hit. If it has, something really wrong happened!"),x.push(r?{name:Z.name,value:f}:"".concat(encodeURIComponent(Z.name),"=").concat(encodeURIComponent(f)))}}),r?i=x:(i=x.join("&"),"+"===O&&(i=i.replace(/%20/g,"+"))),i}},{key:"_serializeNumericString",value:function(e){return this._serialize(e,!1,"unformatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeFormatted",value:function(e){return this._serialize(e,!1,"formatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeLocalized",value:function(e){return this._serialize(e,!1,"localized",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}},{key:"_serializeNumericStringArray",value:function(e){return this._serialize(e,!0,"unformatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeFormattedArray",value:function(e){return this._serialize(e,!0,"formatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeLocalizedArray",value:function(e){return this._serialize(e,!0,"localized",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}}],I&&qe(k.prototype,I),B&&qe(k,B),Object.defineProperty(k,"prototype",{writable:!1}),s}();xe(N,"options",void 0),xe(N,"events",void 0),xe(N,"defaultSettings",void 0),xe(N,"predefinedOptions",void 0),N.multiple=function(s){var k=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,I=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,B=[];if(n.isObject(k)&&(I=k,k=null),n.isString(s))s=Y(document.querySelectorAll(s));else if(n.isObject(s)){Object.prototype.hasOwnProperty.call(s,"rootElement")||n.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var e=Y(s.rootElement.querySelectorAll("input"));Object.prototype.hasOwnProperty.call(s,"exclude")?(Array.isArray(s.exclude)||n.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),s=n.filterOut(e,s.exclude)):s=e}else n.isArray(s)||n.throwError("The given parameters to the 'multiple' function are invalid.");if(0===s.length){var i=!0;return!n.isNull(I)&&n.isBoolean(I.showWarnings)&&(i=I.showWarnings),n.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",i),[]}var a=n.isArray(k)&&k.length>=1,r=!1,h=!1;if(a){var O=ue(Number(k[0]));(r="number"===O&&!isNaN(Number(k[0])))||("string"===O||isNaN(O)||"object"===O)&&(h=!0)}var C,x=!1;if(n.isArray(I)&&I.length>=1){var Z=ue(I[0]);"string"!==Z&&"object"!==Z||(x=!0)}C=h?N.mergeOptions(k):x?N.mergeOptions(I):I;var f,L=n.isNumber(k);return r&&(f=k.length),s.forEach(function(j,q){B.push(new N(j,L?k:r&&q<=f?k[q]:null,C))}),B},N.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(N.events.native),Object.freeze(N.events),Object.defineProperty(N,"events",{configurable:!1,writable:!1}),N.options={allowDecimalPadding:{always:!0,never:!1,floats:"floats"},alwaysAllowDecimalCharacter:{alwaysAllow:!0,doNotAllow:!1},caretPositionOnFocus:{start:"start",end:"end",decimalLeft:"decimalLeft",decimalRight:"decimalRight",doNoForceCaretPosition:null},createLocalList:{createList:!0,doNotCreateList:!1},currencySymbol:{none:"",currencySign:"\xa4",austral:"\u20b3",australCentavo:"\xa2",baht:"\u0e3f",cedi:"\u20b5",cent:"\xa2",colon:"\u20a1",cruzeiro:"\u20a2",dollar:"$",dong:"\u20ab",drachma:"\u20af",dram:"\u200b\u058f",european:"\u20a0",euro:"\u20ac",florin:"\u0192",franc:"\u20a3",guarani:"\u20b2",hryvnia:"\u20b4",kip:"\u20ad",att:"\u0ead\u0eb1\u0e94",lepton:"\u039b.",lira:"\u20ba",liraOld:"\u20a4",lari:"\u20be",mark:"\u2133",mill:"\u20a5",naira:"\u20a6",peseta:"\u20a7",peso:"\u20b1",pfennig:"\u20b0",pound:"\xa3",real:"R$ ",riel:"\u17db",ruble:"\u20bd",rupee:"\u20b9",rupeeOld:"\u20a8",shekel:"\u20aa",shekelAlt:"\u05e9\u05f4\u05d7\u200e\u200e",taka:"\u09f3",tenge:"\u20b8",togrog:"\u20ae",won:"\u20a9",yen:"\xa5"},currencySymbolPlacement:{prefix:"p",suffix:"s"},decimalCharacter:{comma:",",dot:".",middleDot:"\xb7",arabicDecimalSeparator:"\u066b",decimalSeparatorKeySymbol:"\u2396"},decimalCharacterAlternative:{none:null,comma:",",dot:"."},decimalPlaces:{none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesRawValue:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnBlur:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnFocus:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},defaultValueOverride:{doNotOverride:null},digitalGroupSpacing:{two:"2",twoThree:"2t",twoScaled:"2s",three:"3",four:"4"},digitGroupSeparator:{comma:",",dot:".",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0",noSeparator:"",apostrophe:"'",arabicThousandsSeparator:"\u066c",dotAbove:"\u02d9",privateUseTwo:"\u2019"},divisorWhenUnfocused:{none:null,percentage:100,permille:1e3,basisPoint:1e4},emptyInputBehavior:{focus:"focus",press:"press",always:"always",zero:"zero",min:"min",max:"max",null:"null"},eventBubbles:{bubbles:!0,doesNotBubble:!1},eventIsCancelable:{isCancelable:!0,isNotCancelable:!1},failOnUnknownOption:{fail:!0,ignore:!1},formatOnPageLoad:{format:!0,doNotFormat:!1},formulaMode:{enabled:!0,disabled:!1},historySize:{verySmall:5,small:10,medium:20,large:50,veryLarge:100,insane:Number.MAX_SAFE_INTEGER},invalidClass:"an-invalid",isCancellable:{cancellable:!0,notCancellable:!1},leadingZero:{allow:"allow",deny:"deny",keep:"keep"},maximumValue:{tenTrillions:"10000000000000",oneBillion:"1000000000",zero:"0"},minimumValue:{tenTrillions:"-10000000000000",oneBillion:"-1000000000",zero:"0"},modifyValueOnUpDownArrow:{modifyValue:!0,doNothing:!1},modifyValueOnWheel:{modifyValue:!0,doNothing:!1},negativeBracketsTypeOnBlur:{parentheses:"(,)",brackets:"[,]",chevrons:"<,>",curlyBraces:"{,}",angleBrackets:"\u3008,\u3009",japaneseQuotationMarks:"\uff62,\uff63",halfBrackets:"\u2e24,\u2e25",whiteSquareBrackets:"\u27e6,\u27e7",quotationMarks:"\u2039,\u203a",guillemets:"\xab,\xbb",none:null},negativePositiveSignPlacement:{prefix:"p",suffix:"s",left:"l",right:"r",none:null},negativeSignCharacter:{hyphen:"-",minus:"\u2212",heavyMinus:"\u2796",fullWidthHyphen:"\uff0d",circledMinus:"\u2296",squaredMinus:"\u229f",triangleMinus:"\u2a3a",plusMinus:"\xb1",minusPlus:"\u2213",dotMinus:"\u2238",minusTilde:"\u2242",not:"\xac"},negativePositiveSignBehavior:{toggle:!0,doNotToggle:!1},noEventListeners:{noEvents:!0,addEvents:!1},onInvalidPaste:{error:"error",ignore:"ignore",clamp:"clamp",truncate:"truncate",replace:"replace"},outputFormat:{string:"string",number:"number",dot:".",negativeDot:"-.",comma:",",negativeComma:"-,",dotNegative:".-",commaNegative:",-",none:null},overrideMinMaxLimits:{ceiling:"ceiling",floor:"floor",ignore:"ignore",invalid:"invalid",doNotOverride:null},positiveSignCharacter:{plus:"+",fullWidthPlus:"\uff0b",heavyPlus:"\u2795",doublePlus:"\u29fa",triplePlus:"\u29fb",circledPlus:"\u2295",squaredPlus:"\u229e",trianglePlus:"\u2a39",plusMinus:"\xb1",minusPlus:"\u2213",dotPlus:"\u2214",altHebrewPlus:"\ufb29",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0"},rawValueDivisor:{none:null,percentage:100,permille:1e3,basisPoint:1e4},readOnly:{readOnly:!0,readWrite:!1},roundingMethod:{halfUpSymmetric:"S",halfUpAsymmetric:"A",halfDownSymmetric:"s",halfDownAsymmetric:"a",halfEvenBankersRounding:"B",upRoundAwayFromZero:"U",downRoundTowardZero:"D",toCeilingTowardPositiveInfinity:"C",toFloorTowardNegativeInfinity:"F",toNearest05:"N05",toNearest05Alt:"CHF",upToNext05:"U05",downToNext05:"D05"},saveValueToSessionStorage:{save:!0,doNotSave:!1},selectNumberOnly:{selectNumbersOnly:!0,selectAll:!1},selectOnFocus:{select:!0,doNotSelect:!1},serializeSpaces:{plus:"+",percent:"%20"},showOnlyNumbersOnFocus:{onlyNumbers:!0,showAll:!1},showPositiveSign:{show:!0,hide:!1},showWarnings:{show:!0,hide:!1},styleRules:{none:null,positiveNegative:{positive:"autoNumeric-positive",negative:"autoNumeric-negative"},range0To100With4Steps:{ranges:[{min:0,max:25,class:"autoNumeric-red"},{min:25,max:50,class:"autoNumeric-orange"},{min:50,max:75,class:"autoNumeric-yellow"},{min:75,max:100,class:"autoNumeric-green"}]},evenOdd:{userDefined:[{callback:function(s){return s%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(s){return s>=-1&&s<0?0:0===Number(s)?1:s>0&&s<=1?2:null},classes:["autoNumeric-small-negative","autoNumeric-zero","autoNumeric-small-positive"]}]}},suffixText:{none:"",percentage:"%",permille:"\u2030",basisPoint:"\u2031"},symbolWhenUnfocused:{none:null,percentage:"%",permille:"\u2030",basisPoint:"\u2031"},unformatOnHover:{unformat:!0,doNotUnformat:!1},unformatOnSubmit:{unformat:!0,keepCurrentValue:!1},upDownStep:{progressive:"progressive"},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},ye=N.options,Object.getOwnPropertyNames(ye).forEach(function(s){"valuesToStrings"===s?Object.getOwnPropertyNames(ye.valuesToStrings).forEach(function(k){null!==ye.valuesToStrings[k]&&Object.freeze(ye.valuesToStrings[k])}):"styleRules"!==s&&null!==ye[s]&&Object.freeze(ye[s])}),Object.freeze(ye),Object.defineProperty(N,"options",{configurable:!1,writable:!1}),N.defaultSettings={allowDecimalPadding:N.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:N.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:N.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:N.options.createLocalList.createList,currencySymbol:N.options.currencySymbol.none,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,decimalCharacter:N.options.decimalCharacter.dot,decimalCharacterAlternative:N.options.decimalCharacterAlternative.none,decimalPlaces:N.options.decimalPlaces.two,decimalPlacesRawValue:N.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:N.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:N.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:N.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:N.options.digitalGroupSpacing.three,digitGroupSeparator:N.options.digitGroupSeparator.comma,divisorWhenUnfocused:N.options.divisorWhenUnfocused.none,emptyInputBehavior:N.options.emptyInputBehavior.focus,eventBubbles:N.options.eventBubbles.bubbles,eventIsCancelable:N.options.eventIsCancelable.isCancelable,failOnUnknownOption:N.options.failOnUnknownOption.ignore,formatOnPageLoad:N.options.formatOnPageLoad.format,formulaMode:N.options.formulaMode.disabled,historySize:N.options.historySize.medium,invalidClass:N.options.invalidClass,isCancellable:N.options.isCancellable.cancellable,leadingZero:N.options.leadingZero.deny,maximumValue:N.options.maximumValue.tenTrillions,minimumValue:N.options.minimumValue.tenTrillions,modifyValueOnUpDownArrow:N.options.modifyValueOnUpDownArrow.modifyValue,modifyValueOnWheel:N.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:N.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.none,negativeSignCharacter:N.options.negativeSignCharacter.hyphen,negativePositiveSignBehavior:N.options.negativePositiveSignBehavior.doNotToggle,noEventListeners:N.options.noEventListeners.addEvents,onInvalidPaste:N.options.onInvalidPaste.error,outputFormat:N.options.outputFormat.none,overrideMinMaxLimits:N.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:N.options.positiveSignCharacter.plus,rawValueDivisor:N.options.rawValueDivisor.none,readOnly:N.options.readOnly.readWrite,roundingMethod:N.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:N.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:N.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:N.options.selectOnFocus.select,serializeSpaces:N.options.serializeSpaces.plus,showOnlyNumbersOnFocus:N.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:N.options.showPositiveSign.hide,showWarnings:N.options.showWarnings.show,styleRules:N.options.styleRules.none,suffixText:N.options.suffixText.none,symbolWhenUnfocused:N.options.symbolWhenUnfocused.none,unformatOnHover:N.options.unformatOnHover.unformat,unformatOnSubmit:N.options.unformatOnSubmit.keepCurrentValue,upDownStep:"1",valuesToStrings:N.options.valuesToStrings.none,watchExternalChanges:N.options.watchExternalChanges.doNotWatch,wheelOn:N.options.wheelOn.focus,wheelStep:N.options.wheelStep.progressive},Object.freeze(N.defaultSettings),Object.defineProperty(N,"defaultSettings",{configurable:!1,writable:!1});var ve={digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,decimalCharacterAlternative:N.options.decimalCharacterAlternative.dot,currencySymbol:"\u202f\u20ac",currencySymbolPlacement:N.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.prefix},Te={digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.dollar,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Je={digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.yen,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right};n.cloneObject(ve).formulaMode=N.options.formulaMode.enabled;var We=n.cloneObject(ve);We.minimumValue=0;var Be=n.cloneObject(ve);Be.maximumValue=0,Be.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var Fe=n.cloneObject(ve);Fe.digitGroupSeparator=N.options.digitGroupSeparator.normalSpace;var Ke=n.cloneObject(Fe);Ke.minimumValue=0;var Ve=n.cloneObject(Fe);Ve.maximumValue=0,Ve.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var _e=n.cloneObject(ve);_e.currencySymbol=N.options.currencySymbol.none,_e.suffixText="\u202f".concat(N.options.suffixText.percentage),_e.wheelStep=1e-4,_e.rawValueDivisor=N.options.rawValueDivisor.percentage;var Ue=n.cloneObject(_e);Ue.minimumValue=0;var Me=n.cloneObject(_e);Me.maximumValue=0,Me.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var He=n.cloneObject(_e);He.decimalPlaces=3;var Qe=n.cloneObject(Ue);Qe.decimalPlaces=3;var Se=n.cloneObject(Me);Se.decimalPlaces=3,n.cloneObject(Te).formulaMode=N.options.formulaMode.enabled;var rt=n.cloneObject(Te);rt.minimumValue=0;var Ze=n.cloneObject(Te);Ze.maximumValue=0,Ze.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var at=n.cloneObject(Ze);at.negativeBracketsTypeOnBlur=N.options.negativeBracketsTypeOnBlur.parentheses;var Pe=n.cloneObject(Te);Pe.currencySymbol=N.options.currencySymbol.none,Pe.suffixText=N.options.suffixText.percentage,Pe.wheelStep=1e-4,Pe.rawValueDivisor=N.options.rawValueDivisor.percentage;var $e=n.cloneObject(Pe);$e.minimumValue=0;var je=n.cloneObject(Pe);je.maximumValue=0,je.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var ot=n.cloneObject(Pe);ot.decimalPlaces=3;var Ye=n.cloneObject($e);Ye.decimalPlaces=3;var st=n.cloneObject(je);st.decimalPlaces=3;var Xe=n.cloneObject(ve);Xe.currencySymbol=N.options.currencySymbol.lira,N.predefinedOptions={euro:ve,euroPos:We,euroNeg:Be,euroSpace:Fe,euroSpacePos:Ke,euroSpaceNeg:Ve,percentageEU2dec:_e,percentageEU2decPos:Ue,percentageEU2decNeg:Me,percentageEU3dec:He,percentageEU3decPos:Qe,percentageEU3decNeg:Se,dollar:Te,dollarPos:rt,dollarNeg:Ze,dollarNegBrackets:at,percentageUS2dec:Pe,percentageUS2decPos:$e,percentageUS2decNeg:je,percentageUS3dec:ot,percentageUS3decPos:Ye,percentageUS3decNeg:st,French:ve,Spanish:ve,NorthAmerican:Te,British:{digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.pound,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:N.options.digitGroupSeparator.apostrophe,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:"\u202fCHF",currencySymbolPlacement:N.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.prefix},Japanese:Je,Chinese:Je,Brazilian:{digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,currencySymbol:N.options.currencySymbol.real,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Turkish:Xe,dotDecimalCharCommaSeparator:{digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,decimalCharacterAlternative:N.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:N.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:N.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:N.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:N.options.allowDecimalPadding.never,minimumValue:N.options.minimumValue.zero,maximumValue:N.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:N.options.allowDecimalPadding.never,minimumValue:N.options.minimumValue.tenTrillions,maximumValue:N.options.maximumValue.zero},numeric:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none},numericPos:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none,minimumValue:N.options.minimumValue.zero,maximumValue:N.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none,minimumValue:N.options.minimumValue.tenTrillions,maximumValue:N.options.maximumValue.zero}},Object.getOwnPropertyNames(N.predefinedOptions).forEach(function(s){Object.freeze(N.predefinedOptions[s])}),Object.freeze(N.predefinedOptions),Object.defineProperty(N,"predefinedOptions",{configurable:!1,writable:!1});const lt=N;return A.default})(),J.exports=E()},6387:(J,S,E)=>{"use strict";var A=z(E(4168)),v=z(E(6017)),R=z(E(1301)),D=z(E(7164)),l=z(E(8619)),n=z(E(4866)),m=z(E(3057)),P=E(723),U=z(E(530));function z(Q){return Q&&Q.__esModule?Q:{default:Q}}var G=function(){},X=function(ee,ne,Y){var K=new G;if(typeof ee>"u")throw Error("No element to render on was provided.");return K._renderProperties=(0,l.default)(ee),K._encodings=[],K._options=U.default,K._errorHandler=new m.default(K),typeof ne<"u"&&((Y=Y||{}).format||(Y.format=ke()),K.options(Y)[Y.format](ne,Y).render()),K};for(var pe in X.getModule=function(Q){return A.default[Q]},A.default)A.default.hasOwnProperty(pe)&&ce(A.default,pe);function ce(Q,ee){G.prototype[ee]=G.prototype[ee.toUpperCase()]=G.prototype[ee.toLowerCase()]=function(ne,Y){var K=this;return K._errorHandler.wrapBarcodeCall(function(){Y.text=typeof Y.text>"u"?void 0:""+Y.text;var se=(0,v.default)(K._options,Y);se=(0,n.default)(se);var le=de(ne,Q[ee],se);return K._encodings.push(le),K})}}function de(Q,ee,ne){var Y=new ee(Q=""+Q,ne);if(!Y.valid())throw new P.InvalidInputException(Y.constructor.name,Q);var K=Y.encode();K=(0,R.default)(K);for(var se=0;se<K.length;se++)K[se].options=(0,v.default)(ne,K[se].options);return K}function ke(){return A.default.CODE128?"CODE128":Object.keys(A.default)[0]}function Ne(Q,ee,ne){ee=(0,R.default)(ee);for(var Y=0;Y<ee.length;Y++)ee[Y].options=(0,v.default)(ne,ee[Y].options),(0,D.default)(ee[Y].options);(0,D.default)(ne),new(0,Q.renderer)(Q.element,ee,ne).render(),Q.afterRender&&Q.afterRender()}G.prototype.options=function(Q){return this._options=(0,v.default)(this._options,Q),this},G.prototype.blank=function(Q){var ee=new Array(Q+1).join("0");return this._encodings.push({data:ee}),this},G.prototype.init=function(){var Q;if(this._renderProperties)for(var ee in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){var ne=(0,v.default)(this._options,(Q=this._renderProperties[ee]).options);"auto"==ne.format&&(ne.format=ke()),this._errorHandler.wrapBarcodeCall(function(){var se=de(ne.value,A.default[ne.format.toUpperCase()],ne);Ne(Q,se,ne)})}},G.prototype.render=function(){if(!this._renderProperties)throw new P.NoElementException;if(Array.isArray(this._renderProperties))for(var Q=0;Q<this._renderProperties.length;Q++)Ne(this._renderProperties[Q],this._encodings,this._options);else Ne(this._renderProperties,this._encodings,this._options);return this},G.prototype._defaults=U.default,typeof window<"u"&&(window.JsBarcode=X),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(Q,ee){var ne=[];return jQuery(this).each(function(){ne.push(this)}),X(ne,Q,ee)}),J.exports=X},9418:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function A(t,v){(function E(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")})(this,A),this.data=t,this.text=v.text||t,this.options=v}},8514:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(E(9418)),v=E(9144),y=function(l){function u(n,d){!function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u);var m=function T(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,n.substring(1),d));return m.bytes=n.split("").map(function(P){return P.charCodeAt(0)}),m}return function D(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var d=this.bytes,m=d.shift()-105,P=v.SET_BY_CODE[m];if(void 0===P)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&d.unshift(v.FNC1);var b=u.next(d,1,P);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:u.getBar(m)+b.result+u.getBar((b.checksum+m)%v.MODULO)+u.getBar(v.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var d=this.options.ean128||!1;return"string"==typeof d&&(d="true"===d.toLowerCase()),d}}],[{key:"getBar",value:function(d){return v.BARS[d]?v.BARS[d].toString():""}},{key:"correctIndex",value:function(d,m){if(m===v.SET_A){var P=d.shift();return P<32?P+64:P-32}return m===v.SET_B?d.shift()-32:10*(d.shift()-48)+d.shift()-48}},{key:"next",value:function(d,m,P){if(!d.length)return{result:"",checksum:0};var b=void 0,U=void 0;if(d[0]>=200){U=d.shift()-105;var z=v.SWAP[U];void 0!==z?b=u.next(d,m+1,z):((P===v.SET_A||P===v.SET_B)&&U===v.SHIFT&&(d[0]=P===v.SET_A?d[0]>95?d[0]-96:d[0]:d[0]<32?d[0]+96:d[0]),b=u.next(d,m+1,P))}else U=u.correctIndex(d,P),b=u.next(d,m+1,P);return{result:u.getBar(U)+b.result,checksum:U*m+b.checksum}}}]),u}(t.default);S.default=y},2100:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(E(8514)),v=E(9144),y=function(l){function u(n,d){return function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function T(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,v.A_START_CHAR+n,d))}return function D(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return new RegExp("^"+v.A_CHARS+"+$").test(this.data)}}]),u}(t.default);S.default=y},2943:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(E(8514)),v=E(9144),y=function(l){function u(n,d){return function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function T(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,v.B_START_CHAR+n,d))}return function D(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return new RegExp("^"+v.B_CHARS+"+$").test(this.data)}}]),u}(t.default);S.default=y},5683:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(E(8514)),v=E(9144),y=function(l){function u(n,d){return function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function T(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,v.C_START_CHAR+n,d))}return function D(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return new RegExp("^"+v.C_CHARS+"+$").test(this.data)}}]),u}(t.default);S.default=y},7737:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var A=M(E(8514)),v=M(E(4336));function M(l){return l&&l.__esModule?l:{default:l}}function T(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}var y=function(l){function u(n,d){if(function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var m=T(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,(0,v.default)(n),d));else m=T(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,n,d));return T(m)}return function D(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),u}(A.default);S.default=y},4336:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=E(9144),A=function(D){return D.match(new RegExp("^"+F.A_CHARS+"*"))[0].length},t=function(D){return D.match(new RegExp("^"+F.B_CHARS+"*"))[0].length},v=function(D){return D.match(new RegExp("^"+F.C_CHARS+"*"))[0]};function M(T,D){var y=D?F.A_CHARS:F.B_CHARS,l=T.match(new RegExp("^("+y+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+String.fromCharCode(204)+R(T.substring(l[1].length));var u=T.match(new RegExp("^"+y+"+"))[0];return u.length===T.length?T:u+String.fromCharCode(D?205:206)+M(T.substring(u.length),!D)}function R(T){var D=v(T),y=D.length;if(y===T.length)return T;T=T.substring(y);var l=A(T)>=t(T);return D+String.fromCharCode(l?206:205)+M(T,l)}S.default=function(T){var D=void 0;if(v(T).length>=2)D=F.C_START_CHAR+R(T);else{var l=A(T)>t(T);D=(l?F.A_START_CHAR:F.B_START_CHAR)+M(T,l)}return D.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(u,n){return String.fromCharCode(203)+n})}},9144:(J,S)=>{"use strict";var E;function F(pe,ce,de){return ce in pe?Object.defineProperty(pe,ce,{value:de,enumerable:!0,configurable:!0,writable:!0}):pe[ce]=de,pe}Object.defineProperty(S,"__esModule",{value:!0});var A=S.SET_A=0,t=S.SET_B=1,v=S.SET_C=2,R=(S.SHIFT=98,S.START_A=103),T=S.START_B=104,D=S.START_C=105;S.MODULO=103,S.STOP=106,S.FNC1=207,S.SET_BY_CODE=(F(E={},R,A),F(E,T,t),F(E,D,v),E),S.SWAP={101:A,100:t,99:v},S.A_START_CHAR=String.fromCharCode(208),S.B_START_CHAR=String.fromCharCode(209),S.C_START_CHAR=String.fromCharCode(210),S.A_CHARS="[\0-_\xc8-\xcf]",S.B_CHARS="[ -\x7f\xc8-\xcf]",S.C_CHARS="(\xcf*[0-9]{2}\xcf*)",S.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},8754:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CODE128C=S.CODE128B=S.CODE128A=S.CODE128=void 0;var A=y(E(7737)),v=y(E(2100)),R=y(E(2943)),D=y(E(5683));function y(l){return l&&l.__esModule?l:{default:l}}S.CODE128=A.default,S.CODE128A=v.default,S.CODE128B=R.default,S.CODE128C=D.default},6602:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CODE39=void 0;var F=function(){function b(U,z){for(var G=0;G<z.length;G++){var X=z[G];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(U,X.key,X)}}return function(U,z,G){return z&&b(U.prototype,z),G&&b(U,G),U}}(),D=function(b){function U(z,G){return function M(b,U){if(!(b instanceof U))throw new TypeError("Cannot call a class as a function")}(this,U),z=z.toUpperCase(),G.mod43&&(z+=function d(b){return y[b]}(function P(b){for(var U=0,z=0;z<b.length;z++)U+=m(b[z]);return U%=43}(z))),function R(b,U){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!U||"object"!=typeof U&&"function"!=typeof U?b:U}(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,z,G))}return function T(b,U){if("function"!=typeof U&&null!==U)throw new TypeError("Super expression must either be null or a function, not "+typeof U);b.prototype=Object.create(U&&U.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(b,U):b.__proto__=U)}(U,b),F(U,[{key:"encode",value:function(){for(var G=u("*"),X=0;X<this.data.length;X++)G+=u(this.data[X])+"0";return{data:G+=u("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),U}(function v(b){return b&&b.__esModule?b:{default:b}}(E(9418)).default),y=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],l=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function u(b){return function n(b){return l[b].toString(2)}(m(b))}function m(b){return y.indexOf(b)}S.CODE39=D},4079:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function n(d,m){for(var P=0;P<m.length;P++){var b=m[P];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}return function(d,m,P){return m&&n(d.prototype,m),P&&n(d,P),d}}(),A=E(1392),v=T(E(2651));function T(n){return n&&n.__esModule?n:{default:n}}var u=function(n){function d(m,P){!function D(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}(this,d);var b=function y(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,m,P));return b.fontSize=!P.flat&&P.fontSize>10*P.width?10*P.width:P.fontSize,b.guardHeight=P.height+b.fontSize/2+P.textMargin,b}return function l(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),F(d,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(P,b){return this.text.substr(P,b)}},{key:"leftEncode",value:function(P,b){return(0,v.default)(P,b)}},{key:"rightText",value:function(P,b){return this.text.substr(P,b)}},{key:"rightEncode",value:function(P,b){return(0,v.default)(P,b)}},{key:"encodeGuarded",value:function(){var P={fontSize:this.fontSize},b={height:this.guardHeight};return[{data:A.SIDE_BIN,options:b},{data:this.leftEncode(),text:this.leftText(),options:P},{data:A.MIDDLE_BIN,options:b},{data:this.rightEncode(),text:this.rightText(),options:P},{data:A.SIDE_BIN,options:b}]}},{key:"encodeFlat",value:function(){return{data:[A.SIDE_BIN,this.leftEncode(),A.MIDDLE_BIN,this.rightEncode(),A.SIDE_BIN].join(""),text:this.text}}}]),d}(T(E(9418)).default);S.default=u},9619:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function n(d,m){for(var P=0;P<m.length;P++){var b=m[P];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}return function(d,m,P){return m&&n(d.prototype,m),P&&n(d,P),d}}(),A=function n(d,m,P){null===d&&(d=Function.prototype);var b=Object.getOwnPropertyDescriptor(d,m);if(void 0===b){var U=Object.getPrototypeOf(d);return null===U?void 0:n(U,m,P)}if("value"in b)return b.value;var z=b.get;return void 0===z?void 0:z.call(P)},t=E(1392),M=function R(n){return n&&n.__esModule?n:{default:n}}(E(4079)),l=function(d){return(10-d.substr(0,12).split("").map(function(P){return+P}).reduce(function(P,b,U){return U%2?P+3*b:P+b},0)%10)%10},u=function(n){function d(m,P){(function T(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")})(this,d),-1!==m.search(/^[0-9]{12}$/)&&(m+=l(m));var b=function D(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,m,P));return b.lastChar=P.lastChar,b}return function y(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),F(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return A(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var P=this.data.substr(1,6),b=t.EAN13_STRUCTURE[this.data[0]];return A(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftEncode",this).call(this,P,b)}},{key:"rightText",value:function(){return A(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var P=this.data.substr(7,6);return A(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightEncode",this).call(this,P,"RRRRRR")}},{key:"encodeGuarded",value:function(){var P=A(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(P.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(P.push({data:"00"}),P.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),P}}]),d}(M.default);S.default=u},5754:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function n(d,m){for(var P=0;P<m.length;P++){var b=m[P];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}return function(d,m,P){return m&&n(d.prototype,m),P&&n(d,P),d}}(),A=E(1392),v=T(E(2651));function T(n){return n&&n.__esModule?n:{default:n}}var u=function(n){function d(m,P){return function D(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}(this,d),function y(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,m,P))}return function l(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),F(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var P=A.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,v.default)(this.data,P,"01"),text:this.text}}}]),d}(T(E(9418)).default);S.default=u},1931:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function d(m,P){for(var b=0;b<P.length;b++){var U=P[b];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(m,U.key,U)}}return function(m,P,b){return P&&d(m.prototype,P),b&&d(m,b),m}}(),A=E(1392),v=T(E(2651));function T(d){return d&&d.__esModule?d:{default:d}}var n=function(d){function m(P,b){return function D(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}(this,m),function y(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!m||"object"!=typeof m&&"function"!=typeof m?d:m}(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,P,b))}return function l(d,m){if("function"!=typeof m&&null!==m)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}(m,d),F(m,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var b=A.EAN5_STRUCTURE[function(m){return m.split("").map(function(b){return+b}).reduce(function(b,U,z){return z%2?b+9*U:b+3*U},0)%10}(this.data)];return{data:"1011"+(0,v.default)(this.data,b,"01"),text:this.text}}}]),m}(T(E(9418)).default);S.default=n},3372:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function u(n,d){for(var m=0;m<d.length;m++){var P=d[m];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(n,P.key,P)}}return function(n,d,m){return d&&u(n.prototype,d),m&&u(n,m),n}}(),A=function u(n,d,m){null===n&&(n=Function.prototype);var P=Object.getOwnPropertyDescriptor(n,d);if(void 0===P){var b=Object.getPrototypeOf(n);return null===b?void 0:u(b,d,m)}if("value"in P)return P.value;var U=P.get;return void 0===U?void 0:U.call(m)},v=function M(u){return u&&u.__esModule?u:{default:u}}(E(4079)),y=function(n){return(10-n.substr(0,7).split("").map(function(m){return+m}).reduce(function(m,P,b){return b%2?m+P:m+3*P},0)%10)%10},l=function(u){function n(d,m){return function R(u,n){if(!(u instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),-1!==d.search(/^[0-9]{7}$/)&&(d+=y(d)),function T(u,n){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?u:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,d,m))}return function D(u,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);u.prototype=Object.create(n&&n.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(u,n):u.__proto__=n)}(n,u),F(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===y(this.data)}},{key:"leftText",value:function(){return A(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var m=this.data.substr(0,4);return A(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,m,"LLLL")}},{key:"rightText",value:function(){return A(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var m=this.data.substr(4,4);return A(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,m,"RRRR")}}]),n}(v.default);S.default=l},5821:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function n(d,m){for(var P=0;P<m.length;P++){var b=m[P];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}return function(d,m,P){return m&&n(d.prototype,m),P&&n(d,P),d}}();S.checksum=u;var t=R(E(2651));function R(n){return n&&n.__esModule?n:{default:n}}var l=function(n){function d(m,P){(function T(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")})(this,d),-1!==m.search(/^[0-9]{11}$/)&&(m+=u(m));var b=function D(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,m,P));return b.displayValue=P.displayValue,b.fontSize=P.fontSize>10*P.width?10*P.width:P.fontSize,b.guardHeight=P.height+b.fontSize/2+P.textMargin,b}return function y(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),F(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==u(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var P="";return P+="101",P+=(0,t.default)(this.data.substr(0,6),"LLLLLL"),P+="01010",P+=(0,t.default)(this.data.substr(6,6),"RRRRRR"),{data:P+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var P=[];return this.displayValue&&P.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),P.push({data:"101"+(0,t.default)(this.data[0],"L"),options:{height:this.guardHeight}}),P.push({data:(0,t.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),P.push({data:"01010",options:{height:this.guardHeight}}),P.push({data:(0,t.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),P.push({data:(0,t.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&P.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),P}}]),d}(R(E(9418)).default);function u(n){var m,d=0;for(m=1;m<11;m+=2)d+=parseInt(n[m]);for(m=0;m<11;m+=2)d+=3*parseInt(n[m]);return(10-d%10)%10}S.default=l},1091:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function P(b,U){for(var z=0;z<U.length;z++){var G=U[z];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(b,G.key,G)}}return function(b,U,z){return U&&P(b.prototype,U),z&&P(b,z),b}}(),t=T(E(2651)),M=T(E(9418)),R=E(5821);function T(P){return P&&P.__esModule?P:{default:P}}function y(P,b){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?P:b}var u=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],n=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],d=function(P){function b(U,z){!function D(P,b){if(!(P instanceof b))throw new TypeError("Cannot call a class as a function")}(this,b);var G=y(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,U,z));if(G.isValid=!1,-1!==U.search(/^[0-9]{6}$/))G.middleDigits=U,G.upcA=m(U,"0"),G.text=z.text||""+G.upcA[0]+U+G.upcA[G.upcA.length-1],G.isValid=!0;else{if(-1===U.search(/^[01][0-9]{7}$/))return y(G);if(G.middleDigits=U.substring(1,U.length-1),G.upcA=m(G.middleDigits,U[0]),G.upcA[G.upcA.length-1]!==U[U.length-1])return y(G);G.isValid=!0}return G.displayValue=z.displayValue,G.fontSize=z.fontSize>10*z.width?10*z.width:z.fontSize,G.guardHeight=z.height+G.fontSize/2+z.textMargin,G}return function l(P,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);P.prototype=Object.create(b&&b.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(P,b):P.__proto__=b)}(b,P),F(b,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var z="";return z+="101",z+=this.encodeMiddleDigits(),{data:z+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var z=[];return this.displayValue&&z.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),z.push({data:"101",options:{height:this.guardHeight}}),z.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),z.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&z.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),z}},{key:"encodeMiddleDigits",value:function(){var z=this.upcA[0],X=n[parseInt(this.upcA[this.upcA.length-1])][parseInt(z)];return(0,t.default)(this.middleDigits,X)}}]),b}(M.default);function m(P,b){for(var U=parseInt(P[P.length-1]),z=u[U],G="",X=0,pe=0;pe<z.length;pe++){var ce=z[pe];G+="X"===ce?P[X++]:ce}return(G=""+b+G)+(0,R.checksum)(G)}S.default=d},1392:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SIDE_BIN="101",S.MIDDLE_BIN="01010",S.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},S.EAN2_STRUCTURE=["LL","LG","GL","GG"],S.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],S.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},2651:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=E(1392);S.default=function(v,M,R){var T=v.split("").map(function(y,l){return F.BINARIES[M[l]]}).map(function(y,l){return y?y[v[l]]:""});if(R){var D=v.length-1;T=T.map(function(y,l){return l<D?y+R:y})}return T.join("")}},2708:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UPCE=S.UPC=S.EAN2=S.EAN5=S.EAN8=S.EAN13=void 0;var A=d(E(9619)),v=d(E(3372)),R=d(E(1931)),D=d(E(5754)),l=d(E(5821)),n=d(E(1091));function d(m){return m&&m.__esModule?m:{default:m}}S.EAN13=A.default,S.EAN8=v.default,S.EAN5=R.default,S.EAN2=D.default,S.UPC=l.default,S.UPCE=n.default},8817:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.GenericBarcode=void 0;var F=function(){function y(l,u){for(var n=0;n<u.length;n++){var d=u[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,u,n){return u&&y(l.prototype,u),n&&y(l,n),l}}(),D=function(y){function l(u,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),F(l,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),l}(function v(y){return y&&y.__esModule?y:{default:y}}(E(9418)).default);S.GenericBarcode=D},6065:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),A=E(5168),y=function(l){function u(){return function R(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function T(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return function D(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var d=this,m=this.data.match(/.{2}/g).map(function(P){return d.encodePair(P)}).join("");return{data:A.START_BIN+m+A.END_BIN,text:this.text}}},{key:"encodePair",value:function(d){var m=A.BINARIES[d[1]];return A.BINARIES[d[0]].split("").map(function(P,b){return("1"===P?"111":"1")+("1"===m[b]?"000":"0")}).join("")}}]),u}(function M(l){return l&&l.__esModule?l:{default:l}}(E(9418)).default);S.default=y},9643:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),t=function v(l){return l&&l.__esModule?l:{default:l}}(E(6065)),D=function(u){var n=u.substr(0,13).split("").map(function(d){return parseInt(d,10)}).reduce(function(d,m,P){return d+m*(3-P%2*2)},0);return 10*Math.ceil(n/10)-n},y=function(l){function u(n,d){return function M(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),-1!==n.search(/^[0-9]{13}$/)&&(n+=D(n)),function R(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,n,d))}return function T(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===D(this.data)}}]),u}(t.default);S.default=y},5168:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.START_BIN="1010",S.END_BIN="11101",S.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},8969:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ITF14=S.ITF=void 0;var A=M(E(6065)),v=M(E(9643));function M(R){return R&&R.__esModule?R:{default:R}}S.ITF=A.default,S.ITF14=v.default},7037:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,n){for(var d=0;d<n.length;d++){var m=n[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,n,d){return n&&l(u.prototype,n),d&&l(u,d),u}}(),D=function(l){function u(n,d){return function M(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function R(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,n,d))}return function T(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"encode",value:function(){for(var d="110",m=0;m<this.data.length;m++){var b=parseInt(this.data[m]).toString(2);b=y(b,4-b.length);for(var U=0;U<b.length;U++)d+="0"==b[U]?"100":"110"}return{data:d+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),u}(function v(l){return l&&l.__esModule?l:{default:l}}(E(9418)).default);function y(l,u){for(var n=0;n<u;n++)l="0"+l;return l}S.default=D},3922:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var A=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),D=function(y){function l(u,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u+(0,t.mod10)(u),n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(A.default);S.default=D},8742:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var A=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),D=function(y){function l(u,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),u+=(0,t.mod10)(u),u+=(0,t.mod10)(u),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(A.default);S.default=D},1825:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var A=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),D=function(y){function l(u,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u+(0,t.mod11)(u),n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(A.default);S.default=D},4455:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var A=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),D=function(y){function l(u,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),u+=(0,t.mod11)(u),u+=(0,t.mod10)(u),function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(A.default);S.default=D},6225:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.mod10=function E(A){for(var t=0,v=0;v<A.length;v++){var M=parseInt(A[v]);t+=(v+A.length)%2==0?M:2*M%10+Math.floor(2*M/10)}return(10-t%10)%10},S.mod11=function F(A){for(var t=0,v=[2,3,4,5,6,7],M=0;M<A.length;M++){var R=parseInt(A[A.length-1-M]);t+=v[M%v.length]*R}return(11-t%11)%11}},1122:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.MSI1110=S.MSI1010=S.MSI11=S.MSI10=S.MSI=void 0;var A=u(E(7037)),v=u(E(3922)),R=u(E(1825)),D=u(E(8742)),l=u(E(4455));function u(n){return n&&n.__esModule?n:{default:n}}S.MSI=A.default,S.MSI10=v.default,S.MSI11=R.default,S.MSI1010=D.default,S.MSI1110=l.default},886:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.codabar=void 0;var F=function(){function y(l,u){for(var n=0;n<u.length;n++){var d=u[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,u,n){return u&&y(l.prototype,u),n&&y(l,n),l}}(),D=function(y){function l(u,n){(function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")})(this,l),0===u.search(/^[0-9\-\$\:\.\+\/]+$/)&&(u="A"+u+"A");var d=function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u.toUpperCase(),n));return d.text=d.options.text||d.text.replace(/[A-D]/g,""),d}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),F(l,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var n=[],d=this.getEncodings(),m=0;m<this.data.length;m++)n.push(d[this.data.charAt(m)]),m!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),l}(function v(y){return y&&y.__esModule?y:{default:y}}(E(9418)).default);S.codabar=D},4168:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=E(6602),A=E(8754),t=E(2708),v=E(8969),M=E(1122),R=E(8758),T=E(886),D=E(8817);S.default={CODE39:F.CODE39,CODE128:A.CODE128,CODE128A:A.CODE128A,CODE128B:A.CODE128B,CODE128C:A.CODE128C,EAN13:t.EAN13,EAN8:t.EAN8,EAN5:t.EAN5,EAN2:t.EAN2,UPC:t.UPC,UPCE:t.UPCE,ITF14:v.ITF14,ITF:v.ITF,MSI:M.MSI,MSI10:M.MSI10,MSI11:M.MSI11,MSI1010:M.MSI1010,MSI1110:M.MSI1110,pharmacode:R.pharmacode,codabar:T.codabar,GenericBarcode:D.GenericBarcode}},8758:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.pharmacode=void 0;var F=function(){function y(l,u){for(var n=0;n<u.length;n++){var d=u[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,u,n){return u&&y(l.prototype,u),n&&y(l,n),l}}(),D=function(y){function l(u,n){!function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l);var d=function R(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,n));return d.number=parseInt(u,10),d}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),F(l,[{key:"encode",value:function(){for(var n=this.number,d="";!isNaN(n)&&0!=n;)n%2==0?(d="11100"+d,n=(n-2)/2):(d="100"+d,n=(n-1)/2);return{data:d=d.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),l}(function v(y){return y&&y.__esModule?y:{default:y}}(E(9418)).default);S.pharmacode=D},3057:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var E=function(){function t(v,M){for(var R=0;R<M.length;R++){var T=M[R];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,T.key,T)}}return function(v,M,R){return M&&t(v.prototype,M),R&&t(v,R),v}}(),A=function(){function t(v){(function F(t,v){if(!(t instanceof v))throw new TypeError("Cannot call a class as a function")})(this,t),this.api=v}return E(t,[{key:"handleCatch",value:function(M){if("InvalidInputException"!==M.name)throw M;if(this.api._options.valid===this.api._defaults.valid)throw M.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(M){try{var R=M.apply(void 0,arguments);return this.api._options.valid(!0),R}catch(T){return this.handleCatch(T),this.api}}}]),t}();S.default=A},723:(J,S)=>{"use strict";function E(R,T){if(!(R instanceof T))throw new TypeError("Cannot call a class as a function")}function F(R,T){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!T||"object"!=typeof T&&"function"!=typeof T?R:T}function A(R,T){if("function"!=typeof T&&null!==T)throw new TypeError("Super expression must either be null or a function, not "+typeof T);R.prototype=Object.create(T&&T.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(R,T):R.__proto__=T)}Object.defineProperty(S,"__esModule",{value:!0});var t=function(R){function T(D,y){E(this,T);var l=F(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return l.name="InvalidInputException",l.symbology=D,l.input=y,l.message='"'+l.input+'" is not a valid input for '+l.symbology,l}return A(T,Error),T}(),v=function(R){function T(){E(this,T);var D=F(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return D.name="InvalidElementException",D.message="Not supported type to render on",D}return A(T,Error),T}(),M=function(R){function T(){E(this,T);var D=F(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return D.name="NoElementException",D.message="No element to render on.",D}return A(T,Error),T}();S.InvalidInputException=t,S.InvalidElementException=v,S.NoElementException=M},7164:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function E(F){return F.marginTop=F.marginTop||F.margin,F.marginBottom=F.marginBottom||F.margin,F.marginRight=F.marginRight||F.margin,F.marginLeft=F.marginLeft||F.margin,F}},7020:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var A=M(E(4866)),v=M(E(530));function M(T){return T&&T.__esModule?T:{default:T}}S.default=function R(T){var D={};for(var y in v.default)v.default.hasOwnProperty(y)&&(T.hasAttribute("jsbarcode-"+y.toLowerCase())&&(D[y]=T.getAttribute("jsbarcode-"+y.toLowerCase())),T.hasAttribute("data-"+y.toLowerCase())&&(D[y]=T.getAttribute("data-"+y.toLowerCase())));return D.value=T.getAttribute("jsbarcode-value")||T.getAttribute("data-value"),(0,A.default)(D)}},8619:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},t=T(E(7020)),M=T(E(2233)),R=E(723);function T(u){return u&&u.__esModule?u:{default:u}}S.default=function D(u){if("string"==typeof u)return function y(u){var n=document.querySelectorAll(u);if(0!==n.length){for(var d=[],m=0;m<n.length;m++)d.push(D(n[m]));return d}}(u);if(Array.isArray(u)){for(var n=[],d=0;d<u.length;d++)n.push(D(u[d]));return n}if(typeof HTMLCanvasElement<"u"&&u instanceof HTMLImageElement)return function l(u){var n=document.createElement("canvas");return{element:n,options:(0,t.default)(u),renderer:M.default.CanvasRenderer,afterRender:function(){u.setAttribute("src",n.toDataURL())}}}(u);if(u&&u.nodeName&&"svg"===u.nodeName.toLowerCase()||typeof SVGElement<"u"&&u instanceof SVGElement)return{element:u,options:(0,t.default)(u),renderer:M.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&u instanceof HTMLCanvasElement)return{element:u,options:(0,t.default)(u),renderer:M.default.CanvasRenderer};if(u&&u.getContext)return{element:u,renderer:M.default.CanvasRenderer};if(u&&"object"===(typeof u>"u"?"undefined":F(u))&&!u.nodeName)return{element:u,renderer:M.default.ObjectRenderer};throw new R.InvalidElementException}},1301:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function E(F){var A=[];return function t(v){if(Array.isArray(v))for(var M=0;M<v.length;M++)t(v[M]);else v.text=v.text||"",v.data=v.data||"",A.push(v)}(F),A}},6017:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var E=Object.assign||function(F){for(var A=1;A<arguments.length;A++){var t=arguments[A];for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(F[v]=t[v])}return F};S.default=function(F,A){return E({},F,A)}},4866:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function E(F){var A=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in A)A.hasOwnProperty(t)&&"string"==typeof F[t=A[t]]&&(F[t]=parseInt(F[t],10));return"string"==typeof F.displayValue&&(F.displayValue="false"!=F.displayValue),F}},530:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}}},1799:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function D(y,l){for(var u=0;u<l.length;u++){var n=l[u];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(y,n.key,n)}}return function(y,l,u){return l&&D(y.prototype,l),u&&D(y,u),y}}(),t=function M(D){return D&&D.__esModule?D:{default:D}}(E(6017)),v=E(4358),T=function(){function D(y,l,u){(function R(D,y){if(!(D instanceof y))throw new TypeError("Cannot call a class as a function")})(this,D),this.canvas=y,this.encodings=l,this.options=u}return F(D,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var l=0;l<this.encodings.length;l++){var u=(0,t.default)(this.options,this.encodings[l].options);this.drawCanvasBarcode(u,this.encodings[l]),this.drawCanvasText(u,this.encodings[l]),this.moveCanvasDrawing(this.encodings[l])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var l=this.canvas.getContext("2d");l.save(),(0,v.calculateEncodingAttributes)(this.encodings,this.options,l);var u=(0,v.getTotalWidthOfEncodings)(this.encodings),n=(0,v.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=u+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,l.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(l.fillStyle=this.options.background,l.fillRect(0,0,this.canvas.width,this.canvas.height)),l.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(l,u){var m,n=this.canvas.getContext("2d"),d=u.data;m="top"==l.textPosition?l.marginTop+l.fontSize+l.textMargin:l.marginTop,n.fillStyle=l.lineColor;for(var P=0;P<d.length;P++){var b=P*l.width+u.barcodePadding;"1"===d[P]?n.fillRect(b,m,l.width,l.height):d[P]&&n.fillRect(b,m,l.width,l.height*d[P])}}},{key:"drawCanvasText",value:function(l,u){var m,P,n=this.canvas.getContext("2d");l.displayValue&&(P="top"==l.textPosition?l.marginTop+l.fontSize-l.textMargin:l.height+l.textMargin+l.marginTop+l.fontSize,n.font=l.fontOptions+" "+l.fontSize+"px "+l.font,"left"==l.textAlign||u.barcodePadding>0?(m=0,n.textAlign="left"):"right"==l.textAlign?(m=u.width-1,n.textAlign="right"):(m=u.width/2,n.textAlign="center"),n.fillText(u.text,m,P))}},{key:"moveCanvasDrawing",value:function(l){this.canvas.getContext("2d").translate(l.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),D}();S.default=T},2233:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var A=T(E(1799)),v=T(E(5794)),R=T(E(1138));function T(D){return D&&D.__esModule?D:{default:D}}S.default={CanvasRenderer:A.default,SVGRenderer:v.default,ObjectRenderer:R.default}},1138:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var E=function(){function t(v,M){for(var R=0;R<M.length;R++){var T=M[R];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,T.key,T)}}return function(v,M,R){return M&&t(v.prototype,M),R&&t(v,R),v}}(),A=function(){function t(v,M,R){(function F(t,v){if(!(t instanceof v))throw new TypeError("Cannot call a class as a function")})(this,t),this.object=v,this.encodings=M,this.options=R}return E(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();S.default=A},4358:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.getTotalWidthOfEncodings=S.calculateEncodingAttributes=S.getBarcodePadding=S.getEncodingHeight=S.getMaximumHeightOfEncodings=void 0;var A=function t(l){return l&&l.__esModule?l:{default:l}}(E(6017));function v(l,u){return u.height+(u.displayValue&&l.text.length>0?u.fontSize+u.textMargin:0)+u.marginTop+u.marginBottom}function M(l,u,n){if(n.displayValue&&u<l){if("center"==n.textAlign)return Math.floor((l-u)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(l-u)}return 0}function y(l,u,n){var d;if(n)d=n;else{if(!(typeof document<"u"))return 0;d=document.createElement("canvas").getContext("2d")}d.font=u.fontOptions+" "+u.fontSize+"px "+u.font;var m=d.measureText(l);return m?m.width:0}S.getMaximumHeightOfEncodings=function D(l){for(var u=0,n=0;n<l.length;n++)l[n].height>u&&(u=l[n].height);return u},S.getEncodingHeight=v,S.getBarcodePadding=M,S.calculateEncodingAttributes=function R(l,u,n){for(var d=0;d<l.length;d++){var b,m=l[d],P=(0,A.default)(u,m.options);b=P.displayValue?y(m.text,P,n):0;var U=m.data.length*P.width;m.width=Math.ceil(Math.max(b,U)),m.height=v(m,P),m.barcodePadding=M(b,U,P)}},S.getTotalWidthOfEncodings=function T(l){for(var u=0,n=0;n<l.length;n++)u+=l[n].width;return u}},5794:(J,S,E)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function y(l,u){for(var n=0;n<u.length;n++){var d=u[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,u,n){return u&&y(l.prototype,u),n&&y(l,n),l}}(),t=function M(y){return y&&y.__esModule?y:{default:y}}(E(6017)),v=E(4358),T="http://www.w3.org/2000/svg",D=function(){function y(l,u,n){(function R(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")})(this,y),this.svg=l,this.encodings=u,this.options=n,this.document=n.xmlDocument||document}return F(y,[{key:"render",value:function(){var u=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var d=this.encodings[n],m=(0,t.default)(this.options,d.options),P=this.createGroup(u,m.marginTop,this.svg);this.setGroupOptions(P,m),this.drawSvgBarcode(P,m,d),this.drawSVGText(P,m,d),u+=d.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,v.calculateEncodingAttributes)(this.encodings,this.options);var u=(0,v.getTotalWidthOfEncodings)(this.encodings),n=(0,v.getMaximumHeightOfEncodings)(this.encodings),d=u+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(d,n),this.options.background&&this.drawRect(0,0,d,n,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(u,n,d){var P,m=d.data;P="top"==n.textPosition?n.fontSize+n.textMargin:0;for(var b=0,U=0,z=0;z<m.length;z++)U=z*n.width+d.barcodePadding,"1"===m[z]?b++:b>0&&(this.drawRect(U-n.width*b,P,n.width*b,n.height,u),b=0);b>0&&this.drawRect(U-n.width*(b-1),P,n.width*b,n.height,u)}},{key:"drawSVGText",value:function(u,n,d){var P,b,m=this.document.createElementNS(T,"text");n.displayValue&&(m.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),b="top"==n.textPosition?n.fontSize-n.textMargin:n.height+n.textMargin+n.fontSize,"left"==n.textAlign||d.barcodePadding>0?(P=0,m.setAttribute("text-anchor","start")):"right"==n.textAlign?(P=d.width-1,m.setAttribute("text-anchor","end")):(P=d.width/2,m.setAttribute("text-anchor","middle")),m.setAttribute("x",P),m.setAttribute("y",b),m.appendChild(this.document.createTextNode(d.text)),u.appendChild(m))}},{key:"setSvgAttributes",value:function(u,n){var d=this.svg;d.setAttribute("width",u+"px"),d.setAttribute("height",n+"px"),d.setAttribute("x","0px"),d.setAttribute("y","0px"),d.setAttribute("viewBox","0 0 "+u+" "+n),d.setAttribute("xmlns",T),d.setAttribute("version","1.1"),d.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(u,n,d){var m=this.document.createElementNS(T,"g");return m.setAttribute("transform","translate("+u+", "+n+")"),d.appendChild(m),m}},{key:"setGroupOptions",value:function(u,n){u.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(u,n,d,m,P){var b=this.document.createElementNS(T,"rect");return b.setAttribute("x",u),b.setAttribute("y",n),b.setAttribute("width",d),b.setAttribute("height",m),P.appendChild(b),b}}]),y}();S.default=D}}]);