dealposbarcode 1.5.6 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/barcode/3rdpartylicenses.txt +1 -1
- package/barcode/407.a70f6aaba5538210.js +1 -0
- package/barcode/57.e28634802a076e59.js +1 -0
- package/barcode/index.html +5 -6
- package/barcode/main.955791da8a0abcad.js +1 -0
- package/barcode/ngsw-worker.js +3 -3
- package/barcode/ngsw.json +14 -14
- package/barcode/polyfills.622f624b069adc1f.js +1 -0
- package/barcode/runtime.b8dfc3e682dd2d9b.js +1 -0
- package/barcode/safety-worker.js +1845 -19
- package/barcode/{styles.bd5ae8adaf96fe66.css → styles.d47d2853fe454281.css} +1 -1
- package/barcode/worker-basic.min.js +1845 -19
- package/package.json +1 -1
- package/barcode/466.d892f92556c0beba.js +0 -1
- package/barcode/571.dc48640de4d6f9c6.js +0 -1
- package/barcode/main.18be3f77b2d039db.js +0 -1
- package/barcode/polyfills.999d6a0a9d2945ad.js +0 -1
- package/barcode/runtime.6c75520468715637.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkbarcode_app=self.webpackChunkbarcode_app||[]).push([[571],{571:(J,P,C)=>{"use strict";C.r(P),C.d(P,{PagesModule:()=>pt});var M=C(6814),F=C(915),t=C(5879),A=C(5619),V=C(2181);let E=(()=>{var y;class f{constructor(){this.store=new A.X([])}getState(){return this.store.asObservable().pipe((0,V.h)(a=>void 0!==a))}setState(a){this.store.next(a)}}return(y=f).\u0275fac=function(a){return new(a||y)},y.\u0275prov=t.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),f})();var T=C(9049),D=C(2262),S=C(8645),s=C(9773),l=C(7398),d=C(6013),n=function(y){return y[y.SUPPLIER_BILL=0]="SUPPLIER_BILL",y[y.OUTLET_DELIVERY=1]="OUTLET_DELIVERY",y}(n||{}),g=C(8189),w=C(5141),O=C(95),U=C(9717),j=C(4211);let z=(()=>{var y;class f{constructor(a,m){this.data=a,this.dialogRef=m,this.outlets=a.outlets}ngOnInit(){this.initModalConfig(),this.initTransactionType()}initModalConfig(){this.modalConfig=new w.O,this.modalConfig.title="Choose your transaction",this.modalConfig.hideMoreButton=!0}initTransactionType(){this.transactionTypes=[{title:"Supplier Bill",type:n.SUPPLIER_BILL},{title:"Transfer Order",type:n.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(y=f).\u0275fac=function(a){return new(a||y)(t.Y36(g.WI),t.Y36(g.so))},y.\u0275cmp=t.Xpm({type:y,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(a,m){1&a&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return m.onOk()})("onCancel",function(){return m.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(L){return m.selectedTransactionType=L}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td",6)(11,"ng-select",7),t.NdJ("ngModelChange",function(L){return m.selectedOutlet=L}),t.qZA()()(),t.TgZ(12,"tr",4)(13,"td",6)(14,"div",8)(15,"input",9),t.NdJ("ngModelChange",function(L){return m.poNumber=L}),t.qZA(),t.TgZ(16,"label",10),t._uU(17,"Invoice Number"),t.qZA()()()()()()()()()()),2&a&&(t.Q6J("config",m.modalConfig),t.xp6(8),t.Q6J("items",m.transactionTypes)("ngModel",m.selectedTransactionType)("clearable",!1)("appendTo","body"),t.xp6(3),t.Q6J("items",m.outlets)("ngModel",m.selectedOutlet)("clearable",!1)("appendTo","body"),t.xp6(4),t.Q6J("ngModel",m.poNumber))},dependencies:[O.Fj,O.JJ,O.On,U.w9,j.M]}),f})();var H=C(9397),ce=C(7081),se=C(631);let ie=(()=>{var y;class f{constructor(a){this.httpService=a,this.barcodeConfigState=new A.X(null)}updatePaperFormatConfig(a){let m=localStorage.getItem("Domain");return this.httpService.post("/api/Config/SaveConfig",{SubDomain:m,Version:this.paperFormatVersion,PaperFormats:a})}getPaperFormatConfig(){let a=localStorage.getItem("Domain"),m=[];return this.httpService.post("/api/Config/PaperConfig",{SubDomain:a}).pipe((0,l.U)(K=>(this.paperFormatVersion=K.version,m=K.PaperFormats,{paperFormat:m,outlets:K.Outlets})),(0,ce.d)(1))}setBarcodeConfigState(a){this.barcodeConfigState.next(a)}getBarcodeConfigState(){return this.barcodeConfigState.asObservable().pipe((0,V.h)(a=>d.gT.IsNotEmpty(a)))}}return(y=f).\u0275fac=function(a){return new(a||y)(t.LFG(se.O))},y.\u0275prov=t.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),f})();var he=C(9862);class we{constructor(f){f&&(this.AccountID=f.AccountID,this.CalculationTypeID=f.CalculationTypeID,this.ID=f.ID,this.Index=f.Index,this.Label=f.Label,this.MultipleTaxTypeID=f.MultipleTaxTypeID,this.Note=f.Note,this.PrintVisible=f.PrintVisible,this.Rate=f.Rate,this.TypeID=f.TypeID,this.Name=f.Name,this.Type=f.Type)}get getID(){return this.ID}get getType(){return this.Type}get getName(){return this.Name}get getAccountID(){return this.AccountID}set setAccountId(f){this.AccountID=f}get getCalculationTypeID(){return this.CalculationTypeID}set setCalculationID(f){this.CalculationTypeID=f}get getRate(){return this.Rate}set setRate(f){this.Rate=f}get getLabel(){return this.Label}}class Q{get getPriceDiscount(){return this.PriceDiscount}set setPriceDiscount(f){this.PriceDiscount=f}get getReleaseDate(){return this.ReleasedDate}set setReleaseDate(f){this.ReleasedDate=f}get getID(){return this.ID}set setID(f){this.ID=f}get getSelectedPromotion(){return this.SelectedPromotion}set setSelectedPromotion(f){this.SelectedPromotion=f}get getDescription(){return this.description}set setDescription(f){this.description=f}set setBarcodeTitle(f){this.barcodeTitle=f}get getBarcodeTitle(){return this.barcodeTitle}set setCustomPrice(f){this.customPrice=f}get getCustomPrice(){return this.customPrice}get getUnitPrice(){return this.UnitPrice}set setUnitPrice(f){this.UnitPrice=f}get getCode(){return this.Code}set setCode(f){this.barcodeTitle=f,this.Code=f}get getModel(){return this.Model}set setModel(f){this.Model=f}get getName(){return this.Name}set setName(f){this.Name=f}get getCurrency(){return this.CurrencySymbol}set setCurrency(f){this.CurrencySymbol=f}}class x{get getCode(){return this.Code}get getName(){return this.Name}get getSuspended(){return this.Suspended}set setCode(f){this.Code=f}set setName(f){this.Name=f}set setSuspended(f){this.Suspended=f}}class ee{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(f){this.Outlet=f}set setNumber(f){this.Number=f}set setDate(f){this.Date=f}set setDueDate(f){this.DueDate=f}set setSupplier(f){this.Supplier=f}set setCreatorID(f){this.CreatorID=f}set setCreated(f){this.Created=f}set setDiscount1(f){this.Discount1=f}set setDiscountAmount(f){this.DiscountAmount=f}set setGross(f){this.Gross=f}set setDiscountTotal(f){this.DiscountTotal=f}set setTaxType(f){this.TaxType=f}set setTax(f){this.Tax=f}set setPurchase(f){this.Purchase=f}set setPurchaseNTax(f){this.PurchaseNTax=f}set setDelivery(f){this.Delivery=f}set setVariants(f){this.Variants=f}set setPayments(f){this.Payments=f}}class $ 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(f){this.VariantID=f}set setQuantity(f){this.Quantity=f}set setPrice(f){this.Price=f}set setDiscount(f){this.Discount=f}set setNettPrice(f){this.NettPrice=f}}class Y{get getID(){return this.ID}set setID(f){this.ID=f}get getName(){return this.Name}set setName(f){this.Name=f}get getDiscount(){return this.Discount}get getExtraCost(){return this.ExtraCost}get getPromotionID(){return this.PromotionID}get getUnitPrice(){return this.UnitPrice}set setDiscount(f){this.Discount=f}set setExtraCost(f){this.ExtraCost=f}set setPromotionID(f){this.PromotionID=f}set setUnitPrice(f){this.UnitPrice=f}}let le=(()=>{var y;class f{constructor(){this.outletID=null,this.outletName=""}}return(y=f).\u0275fac=function(a){return new(a||y)},y.\u0275prov=t.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),f})(),Oe=(()=>{var y;class f{constructor(a){this.outlet=a}getProductModel(a){let m=new Q;m.setID=a.ID,m.setCode=a.Code,m.setCurrency=a.CurrencySymbol,m.setModel=a.Model,m.setName=a.Name,m.setUnitPrice=a.UnitPrice,m.setDescription=a.Description,m.setReleaseDate=a.ReleasedDate,m.setPriceDiscount=a.PriceDiscount;const L=a.OutletPrice?.find(K=>K.Outlet==this.outlet.outletName);return L&&(m.setUnitPrice=L.Price),m}getTaxModel(a){return new we(a)}getOutletModel(a){let m=new x;return m.setCode=a.Code,m.setName=a.Name,m.setSuspended=a.Suspended,m}getVariantModel(a){let m=new $;return m.setCode=a.Code,m.setDiscount=a.Discount,m.setNettPrice=a.NettPrice,m.setPrice=a.Price,m.setUnitPrice=a.UnitPrice,m.setQuantity=a.Quantity,m.setVariantID=a.VariantID,m.setName=a.Name,m}getBillModel(a){let m=new ee;return m.setNumber=a.Number,m.setOutlet=a.Outlet,m.setVariants=a.Variants?a.Variants.map(k=>this.getVariantModel(k)):[],m}getPromotionModel(a){let m=new Y;return m.setDiscount=a.Discount,m.setExtraCost=a.ExtraCost,m.setPromotionID=a.PromotionID,m.setUnitPrice=a.UnitPrice,m.setName=a.Name,m.setID=a.ID,m}}return(y=f).\u0275fac=function(a){return new(a||y)(t.LFG(le))},y.\u0275prov=t.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),f})(),_e=(()=>{var y;class f{constructor(a,m,k){this.httpService=a,this.http=m,this.factoryService=k}getProductById(a){let m=localStorage.getItem("Domain");return this.httpService.post(`https://${m}/API/V3/Variant/ID`,{ID:a}).pipe((0,l.U)(k=>this.factoryService.getProductModel(k)))}getPromotionByProducID(a){let m=localStorage.getItem("Domain");return this.httpService.post(`https://${m}/API/v3/PromotionEvent/GetByVariantID`,{VariantID:a}).pipe((0,l.U)(k=>k.map(K=>this.factoryService.getPromotionModel(K))))}uploadProducts(a){let m=localStorage.getItem("Domain"),k=new FormData;return k.append("file",a,a.name),this.httpService.postFormData(`https://${m}/API/catalog/product/UploadCSVforBarcode`,k).pipe((0,l.U)(L=>L.map(K=>(K.Print=K.Print.map(te=>this.factoryService.getProductModel(te)),K))))}getTax(){let a=localStorage.getItem("Domain"),m=localStorage.getItem("Token"),k=`https://${a}/API/V3/Tax`,L=new he.WM({authorization:"Bearer "+m,"content-type":"application/json","X-ClientId":"dealpos-app"});return this.http.get(k,{headers:L}).pipe((0,l.U)(K=>{if(K)return K.map(te=>this.factoryService.getTaxModel(te))}))}}return(y=f).\u0275fac=function(a){return new(a||y)(t.LFG(se.O),t.LFG(he.eN),t.LFG(Oe))},y.\u0275prov=t.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),f})();var Te=C(6608);let Ie=(()=>{var y;class f{set _max(a){a&&(this.max=a,this.updateNumericSettings())}set _min(a){a&&(this.min=a,this.updateNumericSettings())}constructor(a){this.elementRef=a,this.decimalPlaces=4,this.modifyValueOnWheel=!0,this.max="999999999999999.9999",this.min="-999999999999999.9999",this.propagateChange=k=>{},this.preventNegative=!1,this.numericElement=new Te(this.elementRef.nativeElement,null,{digitGroupSeparator:",",decimalCharacter:".",decimalPlaces:this.decimalPlaces,maximumValue:this.max,minimumValue:this.min,allowDecimalPadding:!1,showWarnings:!1})}ngOnInit(){""==this.percentage&&(this.max="100"),this.preventNegative&&(this.min="0.00"),this.updateNumericSettings()}updateNumericSettings(){const a={maximumValue:this.max,minimumValue:this.min,readOnly:this.isElementDisabled(),decimalPlaces:this.decimalPlaces,modifyValueOnWheel:this.modifyValueOnWheel};this.numericElement.update(a)}onKeyUp(){let a=this.numericElement.getNumber();this.propagateChange(a)}isElementDisabled(){let a=!1;return(!0===this.elementRef.nativeElement.readOnly||!0===this.elementRef.nativeElement.disabled)&&(a=!0),a}writeValue(a){null!=a&&this.numericElement.set(a)}registerOnChange(a){this.propagateChange=a}registerOnTouched(){}}return(y=f).\u0275fac=function(a){return new(a||y)(t.Y36(t.SBq))},y.\u0275dir=t.lG2({type:y,selectors:[["","autoNum",""]],hostBindings:function(a,m){1&a&&t.NdJ("keyup",function(){return m.onKeyUp()})},inputs:{percentage:"percentage",preventNegative:"preventNegative",decimalPlaces:"decimalPlaces",modifyValueOnWheel:"modifyValueOnWheel",_max:["max","_max"],_min:["min","_min"]},features:[t._Bn([{provide:O.JU,useExisting:(0,t.Gpc)(()=>y),multi:!0}])]}),f})();var ke=C(940),ve=C(3620),pe=C(6649);const Ne=["input"];function Be(y,f){if(1&y&&t._UZ(0,"img",10),2&y){const p=t.oxw().$implicit;t.Q6J("src",p.ImgUrl,t.LSH)}}function Ue(y,f){if(1&y){const p=t.EpF();t.TgZ(0,"mat-option",8),t.NdJ("click",function(m){const L=t.CHM(p).$implicit;return t.oxw().changeDisplayName(L),t.KtG(m.stopPropagation())}),t.YNc(1,Be,1,1,"img",9),t._uU(2),t.qZA()}if(2&y){const p=f.$implicit,a=t.oxw();t.Q6J("value",p),t.xp6(1),t.Q6J("ngIf",a.renderThumbnail&&p.ImgUrl),t.xp6(1),t.hij(" ",p.Value," ")}}let Ze=(()=>{var y;class f{set display(a){this.input.nativeElement.value=a}get value(){return this._value}set value(a){this._value=a,this.propagateChange(this._value)}constructor(a,m){this.httpService=a,this.ngZone=m,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 O.p4(""),this.options=[],this.complete=!1,this.foundProduct=!1,this.propagateChange=k=>{},this.termControl.valueChanges.pipe((0,ve.b)(500)).subscribe(k=>{this.options=[],"object"==typeof k?(this.value=k.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(k.Value),this.complete=!0),this.onSelect&&this.onSelect.emit(k.Key),this.options=[],"object"==typeof k&&(this.value=k.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(k.Value),this.complete=!0),this.onOptionSelect)&&this.onOptionSelect.emit(JSON.stringify({Key:k.Key,Value:k.Value}))):"string"==typeof k&&k.length>0?k.length>2&&!this.inputLock&&this.search(k):this.clear()})}ngOnChanges(a){null!=a.ngModel&&null==a.ngModel.currentValue&&this.clear(),null!=a.display&&a.display.currentValue!=a.display.previousValue&&this.termControl.setValue(a.display.currentValue)}ngAfterViewInit(){}search(a){if(this.termControl.value.length>0){let m={};if(this.data&&(m=this.data),m.prefix=a,m.count=100,this.complete)this.complete=!1;else{let k=this.url,L=localStorage.getItem("Domain");L&&(k=`https://${L}${this.url}`),this.httpService.post(k,m).subscribe(K=>{this.options=K,this.foundProduct=this.options.length>0})}}else this.options=null}onblur(){setTimeout(()=>{},600)}changeDisplayName(a){this.input.nativeElement.value=a.Value}onKeydown(a){const m=a.key;"Enter"===m?(this.clearOnSelect&&this.clear(),!this.foundProduct&&this.termControl.value.length>0&&(this.onEnter.emit(this.termControl.value),a.stopPropagation()),null!=this.termControl.value&&(this.input.nativeElement.value=this.termControl.value.Value),this.foundProduct=!1):(this.inputLock&&("Backspace"===m?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(a){return a&&a.Value}writeValue(a){}registerOnChange(a){this.propagateChange=a}registerOnTouched(){}}return(y=f).\u0275fac=function(a){return new(a||y)(t.Y36(se.O),t.Y36(t.R0b))},y.\u0275cmp=t.Xpm({type:y,selectors:[["autocomplete"]],viewQuery:function(a,m){if(1&a&&t.Gf(Ne,7),2&a){let k;t.iGM(k=t.CRH())&&(m.input=k.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:O.JU,useExisting:(0,t.Gpc)(()=>y),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(a,m){if(1&a&&(t.TgZ(0,"mat-form-field",0)(1,"div",1)(2,"input",2,3),t.NdJ("paste",function(L){return m.inputLock?L.preventDefault():""})("keydown",function(L){return m.onKeydown(L)})("blur",function(){return m.onblur()}),t.qZA(),t.TgZ(4,"label",4),t._uU(5),t.qZA()()(),t.TgZ(6,"mat-autocomplete",5,6),t.YNc(8,Ue,3,3,"mat-option",7),t.qZA()),2&a){const k=t.MAs(7);t.xp6(2),t.s9C("placeholder",m.placeholder||""),t.Q6J("matAutocomplete",k)("formControl",m.termControl),t.xp6(3),t.Oqu(m.placeholder||""),t.xp6(3),t.Q6J("ngForOf",m.options)}},dependencies:[ke.XC,pe.ey,ke.ZL,M.sg,M.O5,O.Fj,O.JJ,O.oH],styles:["mat-option[_ngcontent-%COMP%]{font-size:12px}"]}),f})(),je=(()=>{var y;class f{}return(y=f).\u0275fac=function(a){return new(a||y)},y.\u0275mod=t.oAB({type:y}),y.\u0275inj=t.cJS({imports:[ke.Bb,M.ez,O.UX]}),f})(),Ce=(()=>{var y;class f{constructor(a,m,k,L,K){this.dialogRef=a,this.barcodeService=m,this.productService=k,this.authenticationService=L,this.data=K,this.modalConfig=new w.O,this.variantName="",this.hasProductEdit=!0,this.hasPromotion=!1,this.destroy$=new S.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 a=this.authenticationService.getRoles();this.hasProductEdit=-1!==a.findIndex(m=>"ProdE"==m)}initProductUpdate(){d.gT.IsNotEmpty(this.data.variantId)&&this.getProductById(this.data.variantId).subscribe(a=>{this.product.setSelectedPromotion=this.data.promotion,this.hasPromotion=d.gT.IsNotEmpty(this.data.promotion)})}getBarcodeConfig(){this.barcodeService.getBarcodeConfigState().pipe((0,s.R)(this.destroy$)).subscribe(a=>{a&&(this.paperFormat=a)})}initModalConfig(){this.modalConfig.title="Add New Product Barcode?",this.modalConfig.hideMoreButton=!0}onSelectProduct(a){this.getProductById(a).subscribe(m=>{this.customPrice=m.getUnitPrice,this.hasPromotion=!1,this.product.setSelectedPromotion=null})}getProductById(a){return this.productService.getProductById(a).pipe((0,H.b)(m=>{this.product=m,this.getPromotionByProductID(a)}))}getPromotionByProductID(a){this.productService.getPromotionByProducID(a).subscribe(m=>{this.promotions=m})}onCustomPriceChange(a){this.customPrice=a}onSelectPromotion(a){a?(this.product.setSelectedPromotion=this.promotions.find(m=>m.getName==a?.getName),this.customPrice=this.product.getUnitPrice,this.hasPromotion=d.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(y=f).\u0275fac=function(a){return new(a||y)(t.Y36(g.so),t.Y36(ie),t.Y36(_e),t.Y36(T.$),t.Y36(g.WI))},y.\u0275cmp=t.Xpm({type:y,selectors:[["app-form-add-variant"]],features:[t._Bn([M.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(a,m){1&a&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return m.onOk()})("onCancel",function(){return m.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(L){return m.onSelectProduct(L)}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td")(11,"div",6)(12,"input",7),t.NdJ("ngModelChange",function(L){return m.qty=L}),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(L){return m.onSelectPromotion(L)}),t.qZA()()(),t.TgZ(18,"tr",4)(19,"td")(20,"div",6)(21,"input",11),t.NdJ("ngModelChange",function(L){return m.onCustomPriceChange(L)}),t.qZA(),t.TgZ(22,"label",12),t._uU(23,"Price"),t.qZA()()()()()()()()()()),2&a&&(t.Q6J("config",m.modalConfig),t.xp6(8),t.Q6J("display",m.variantName),t.xp6(4),t.Q6J("ngModel",m.qty),t.xp6(5),t.Q6J("items",m.promotions)("ngModel",null==m.product||null==m.product.getSelectedPromotion?null:m.product.getSelectedPromotion.getPromotionID),t.xp6(4),t.Q6J("ngModel",m.customPrice)("readonly",m.hasPromotion||!m.hasProductEdit))},dependencies:[O.Fj,O.JJ,O.On,U.w9,j.M,Ie,Ze]}),f})(),Ge=(()=>{var y;class f{constructor(a,m){this.dialogRef=a,this.data=m,this.event=new t.vpe,this.modalConfig=new w.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(a){a&&(this.files=a.target.files)}}return(y=f).\u0275fac=function(a){return new(a||y)(t.Y36(g.so),t.Y36(g.WI))},y.\u0275cmp=t.Xpm({type:y,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(a,m){1&a&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return m.onOk()})("onCancel",function(){return m.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(L){return m.onUploadFile(L)}),t.qZA()()()()()()()()()),2&a&&t.Q6J("config",m.modalConfig)},dependencies:[j.M]}),f})();var fe=C(8763);let De=(()=>{var y;class f{constructor(a,m){this.httpService=a,this.factoryService=m}get(){let m=localStorage.getItem("Domain");return this.httpService.post(`https://${m}/api/v3/Outlet/p`,{Suspended:!1}).pipe((0,l.U)(k=>{let L=[];return k&&(L=k.map(K=>this.factoryService.getOutletModel(K))),L}))}}return(y=f).\u0275fac=function(a){return new(a||y)(t.LFG(se.O),t.LFG(Oe))},y.\u0275prov=t.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),f})(),xe=(()=>{var y;class f{constructor(a,m){this.httpService=a,this.factoryService=m}get(a){let m=localStorage.getItem("Domain"),k=this.getEndPointByType(a.Type);return this.httpService.post(`https://${m}${k}`,{Outlet:a.Outlet,Number:a.Number}).pipe((0,l.U)(K=>K.map(te=>this.factoryService.getVariantModel(te))))}getEndPointByType(a){let m;return m=a===n.SUPPLIER_BILL?"/API/V3/Barcode/byBillNumber":"/API/V3/Barcode/byOutletDeliveryNumber",m}}return(y=f).\u0275fac=function(a){return new(a||y)(t.LFG(se.O),t.LFG(Oe))},y.\u0275prov=t.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),f})();function ze(y,f){if(1&y){const p=t.EpF();t.TgZ(0,"tr",22),t.NdJ("click",function(){const m=t.CHM(p),k=m.$implicit,L=m.index,K=t.oxw();return t.KtG(K.onUpdateProduct(k,L))}),t.TgZ(1,"td")(2,"i",23),t.NdJ("click",function(){const k=t.CHM(p).index,L=t.oxw();return t.KtG(L.onDeleteProduct(k))}),t.qZA()(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",24),t._uU(6),t.qZA()()}if(2&y){const p=f.$implicit;t.xp6(4),t.AsE(" ",null==p||null==p.Variants[0]?null:p.Variants[0].getName,"- ",null==p||null==p.Variants[0]?null:p.Variants[0].getCode," - "),t.xp6(2),t.Oqu(null==p?null:p.Quantity)}}let qe=(()=>{var y;class f{constructor(a,m,k,L,K,te,ne,oe){this.dialog=a,this.productStateService=m,this.productService=k,this.toastService=L,this.queryParamService=K,this.outletService=te,this.billService=ne,this.barcodeService=oe,this.destroy$=new S.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,s.R)(this.destroy$),(0,V.h)(a=>d.gT.IsEmpty(a))).subscribe(a=>{a?.ID&&this.getProductById(a.ID,5),a.billNumber&&this.getBill({Number:a.billNumber,Outlet:a.outletName,Type:n.SUPPLIER_BILL})})}initOutlets(){this.barcodeService.getPaperFormatConfig().pipe((0,l.U)(a=>a.outlets),(0,s.R)(this.destroy$)).subscribe(a=>{this.outlets=a})}onAddBill(){this.dialog.open(z,{width:"350px",data:{outlets:this.outlets}}).afterClosed().pipe((0,s.R)(this.destroy$)).subscribe(a=>{a&&this.getBill(a)})}getBill(a){this.billService.get(a).pipe((0,s.R)(this.destroy$)).subscribe(m=>{m&&m.forEach(k=>{this.checkAvailableProductCode(k);let L=this.generateProductByQty(k,k.getQuantity);this.productGroups=[...this.productGroups,{VariantID:k.getVariantID,Quantity:k.getQuantity,Variants:L}],this.updateProductsSource()})})}onAddProduct(){this.dialog.open(Ce,{width:"350px",data:{variantName:"",variantId:null,qty:null}}).afterClosed().pipe((0,s.R)(this.destroy$)).subscribe(a=>{a&&(this.customPrice=a.customPrice,this.generateProductBarcode(a.product,a.quantity))})}getProductById(a,m){this.productService.getProductById(a).pipe((0,s.R)(this.destroy$)).subscribe(k=>{k&&this.generateProductBarcode(k,m)})}generateProductBarcode(a,m){this.checkAvailableProductCode(a);let k=this.generateProductByQty(a,m);k=this.updateCustomPriceProducts(k),this.productGroups=[...this.productGroups,{VariantID:a.getID,Quantity:m,Variants:k}],this.updateProductsSource()}checkAvailableProductCode(a){a.getCode||this.toastService.error("Product has no code","Code Not Found")}onUpdateProduct(a,m){this.dialog.open(Ce,{width:"350px",data:{variantName:a.Variants[0].getName+" - "+a.Variants[0].getCode,variantId:a.VariantID,qty:a.Quantity,customPrice:a.Variants[0].getCustomPrice,promotion:a.Variants[0].getSelectedPromotion}}).afterClosed().pipe((0,s.R)(this.destroy$)).subscribe(ge=>{if(ge){this.customPrice=ge.customPrice,this.checkAvailableProductCode(ge.product);let Re=this.generateProductByQty(ge.product,ge.quantity);Re=this.updateCustomPriceProducts(Re),this.productGroups[m].Variants=Re,this.productGroups[m].Quantity=ge.quantity,this.productGroups[m].VariantID=ge.product.getID,this.updateProductsSource()}})}onDeleteProduct(a){this.productGroups=this.productGroups.filter((m,k)=>k!==a),this.updateProductsSource()}updateProductsSource(){this.productSource=[],this.productGroups.forEach(a=>{this.productSource=[...this.productSource,...a.Variants]}),this.stickerTotal=this.productSource.length,this.productStateService.setState(this.productSource)}onUploadProduct(){this.dialog.open(Ge,{width:"350px"}).afterClosed().pipe((0,s.R)(this.destroy$)).subscribe(a=>{if(a){let m;this.productService.uploadProducts(a[0]).pipe((0,s.R)(this.destroy$)).subscribe(k=>{k&&(this.productGroups=[...this.productGroups,...k.map(L=>(m={Quantity:L.Quantity,VariantID:L.VariantID,Variants:L.Print},m))],this.updateProductsSource())})}})}updateCustomPriceProducts(a){let m=a;return this.customPrice&&(m=a.map(k=>(k.setCustomPrice=this.customPrice,k))),m}generateProductByQty(a,m){let k=[];for(let L=1;L<=m;L++)k.push(a);return k}onClear(){this.productGroups=[],this.updateProductsSource()}onPrint(){window.print()}}return(y=f).\u0275fac=function(a){return new(a||y)(t.Y36(g.uw),t.Y36(E),t.Y36(_e),t.Y36(fe._W),t.Y36(D.U),t.Y36(De),t.Y36(xe),t.Y36(ie))},y.\u0275cmp=t.Xpm({type:y,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(a,m){1&a&&(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 m.onAddProduct()}),t._UZ(8,"i",6),t.qZA(),t.TgZ(9,"button",5),t.NdJ("click",function(){return m.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 m.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 m.onClear()}),t._uU(30,"Clear"),t.qZA(),t.TgZ(31,"a",21),t.NdJ("click",function(){return m.onPrint()}),t._uU(32,"Print"),t.qZA()()()()()),2&a&&(t.xp6(5),t.hij("( ",0===m.stickerTotal?"":m.stickerTotal," stickers )"),t.xp6(16),t.Q6J("ngForOf",m.productGroups))},dependencies:[M.sg],styles:["td[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{font-size:12px}.btn[_ngcontent-%COMP%]{font-size:14px!important}"]}),f})();var We=C(3745),be=C(1417);let _=(()=>{class y{constructor(){this._listeners=[]}notify(p,a){for(let m of this._listeners)m(p,a)}listen(p){return this._listeners.push(p),()=>{this._listeners=this._listeners.filter(a=>p!==a)}}ngOnDestroy(){this._listeners=[]}}return y.\u0275fac=function(p){return new(p||y)},y.\u0275prov=t.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),y})();const N=["input"],I=["*"];let G=0;class b{constructor(f,p){this.source=f,this.value=p}}const B={provide:O.JU,useExisting:(0,t.Gpc)(()=>ae),multi:!0},R=new t.OlP("MatRadioGroup"),Z=new t.OlP("mat-radio-default-options",{providedIn:"root",factory:function q(){return{color:"accent"}}});let W=(()=>{class y{get name(){return this._name}set name(p){this._name=p,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(p){this._labelPosition="before"===p?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(p){this._value!==p&&(this._value=p,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(p){this._selected=p,this.value=p?p.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(p){this._disabled=(0,be.Ig)(p),this._markRadiosForCheck()}get required(){return this._required}set required(p){this._required=(0,be.Ig)(p),this._markRadiosForCheck()}constructor(p){this._changeDetector=p,this._value=null,this._name="mat-radio-group-"+G++,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}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(p=>{p.name=this.name,p._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(a=>{a.checked=this.value===a.value,a.checked&&(this._selected=a)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new b(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(p=>p._markForCheck())}writeValue(p){this.value=p,this._changeDetector.markForCheck()}registerOnChange(p){this._controlValueAccessorChangeFn=p}registerOnTouched(p){this.onTouched=p}setDisabledState(p){this.disabled=p,this._changeDetector.markForCheck()}}return y.\u0275fac=function(p){return new(p||y)(t.Y36(t.sBO))},y.\u0275dir=t.lG2({type:y,inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required"},outputs:{change:"change"}}),y})();class X{constructor(f){this._elementRef=f}}const re=(0,pe.Kr)((0,pe.sb)(X));let ue=(()=>{class y extends re{get checked(){return this._checked}set checked(p){const a=(0,be.Ig)(p);this._checked!==a&&(this._checked=a,a&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!a&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),a&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(p){this._value!==p&&(this._value=p,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===p),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(p){this._labelPosition=p}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(p){this._setDisabled((0,be.Ig)(p))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(p){this._required=(0,be.Ig)(p)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(p){this._color=p}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(p,a,m,k,L,K,te,ne){super(a),this._changeDetector=m,this._focusMonitor=k,this._radioDispatcher=L,this._providerOverride=te,this._uniqueId="mat-radio-"+ ++G,this.id=this._uniqueId,this.change=new t.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=p,this._noopAnimations="NoopAnimations"===K,ne&&(this.tabIndex=(0,be.su)(ne,0))}focus(p,a){a?this._focusMonitor.focusVia(this._inputElement,a,p):this._inputElement.nativeElement.focus(p)}_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((p,a)=>{p!==this.id&&a===this.name&&(this.checked=!1)})}ngDoCheck(){this._updateTabIndex()}ngAfterViewInit(){this._updateTabIndex(),this._focusMonitor.monitor(this._elementRef,!0).subscribe(p=>{!p&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new b(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(p){p.stopPropagation()}_onInputInteraction(p){if(p.stopPropagation(),!this.checked&&!this.disabled){const a=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),a&&this.radioGroup._emitChangeEvent())}}_setDisabled(p){this._disabled!==p&&(this._disabled=p,this._changeDetector.markForCheck())}_updateTabIndex(){const p=this.radioGroup;let a;if(a=p&&p.selected&&!this.disabled?p.selected===this?this.tabIndex:-1:this.tabIndex,a!==this._previousTabIndex){const m=this._inputElement?.nativeElement;m&&(m.setAttribute("tabindex",a+""),this._previousTabIndex=a)}}}return y.\u0275fac=function(p){t.$Z()},y.\u0275dir=t.lG2({type:y,viewQuery:function(p,a){if(1&p&&t.Gf(N,5),2&p){let m;t.iGM(m=t.CRH())&&(a._inputElement=m.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]}),y})(),ae=(()=>{class y extends W{}return y.\u0275fac=function(){let f;return function(a){return(f||(f=t.n5z(y)))(a||y)}}(),y.\u0275dir=t.lG2({type:y,selectors:[["mat-radio-group"]],contentQueries:function(p,a,m){if(1&p&&t.Suo(m,ye,5),2&p){let k;t.iGM(k=t.CRH())&&(a._radios=k)}},hostAttrs:["role","radiogroup",1,"mat-mdc-radio-group"],exportAs:["matRadioGroup"],features:[t._Bn([B,{provide:R,useExisting:y}]),t.qOj]}),y})(),ye=(()=>{class y extends ue{constructor(p,a,m,k,L,K,te,ne){super(p,a,m,k,L,K,te,ne)}}return y.\u0275fac=function(p){return new(p||y)(t.Y36(R,8),t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(We.tE),t.Y36(_),t.Y36(t.QbO,8),t.Y36(Z,8),t.$8M("tabindex"))},y.\u0275cmp=t.Xpm({type:y,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-mdc-radio-button"],hostVars:15,hostBindings:function(p,a){1&p&&t.NdJ("focus",function(){return a._inputElement.nativeElement.focus()}),2&p&&(t.uIk("id",a.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),t.ekj("mat-primary","primary"===a.color)("mat-accent","accent"===a.color)("mat-warn","warn"===a.color)("mat-mdc-radio-checked",a.checked)("_mat-animation-noopable",a._noopAnimations))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[t.qOj],ngContentSelectors:I,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"],[3,"for"]],template:function(p,a){if(1&p&&(t.F$t(),t.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3),t.NdJ("click",function(k){return a._onInputInteraction(k)}),t.qZA(),t.TgZ(4,"input",4,5),t.NdJ("change",function(k){return a._onInputInteraction(k)}),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&p){const m=t.MAs(1);t.ekj("mdc-form-field--align-end","before"==a.labelPosition),t.xp6(2),t.ekj("mdc-radio--disabled",a.disabled),t.xp6(2),t.Q6J("id",a.inputId)("checked",a.checked)("disabled",a.disabled)("required",a.required),t.uIk("name",a.name)("value",a.value)("aria-label",a.ariaLabel)("aria-labelledby",a.ariaLabelledby)("aria-describedby",a.ariaDescribedby),t.xp6(5),t.Q6J("matRippleTrigger",m)("matRippleDisabled",a._isRippleDisabled())("matRippleCentered",!0),t.xp6(2),t.Q6J("for",a.inputId)}},dependencies:[pe.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{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size, 40px) - 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, #000)}.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, #000)}.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, 0.38)}.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, 0.38)}.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, #000)}.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, 0.38)}.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, #6200ee)}.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, #6200ee)}.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, #6200ee)}.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, #6200ee)}.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, #6200ee)}.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, #6200ee)}.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, #6200ee)}.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, #6200ee)}.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, #000)}.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, #000)}.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, #000)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size, 40px) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size, 40px) - 20px) / 2);width:var(--mdc-radio-state-layer-size, 40px);height:var(--mdc-radio-state-layer-size, 40px)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size, 40px) - var(--mdc-radio-state-layer-size, 40px)) / 2);right:calc((var(--mdc-radio-state-layer-size, 40px) - var(--mdc-radio-state-layer-size, 40px)) / 2);left:calc((var(--mdc-radio-state-layer-size, 40px) - var(--mdc-radio-state-layer-size, 40px)) / 2);width:var(--mdc-radio-state-layer-size, 40px);height:var(--mdc-radio-state-layer-size, 40px)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-mdc-radio-ripple-color, transparent)}.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-mdc-radio-checked-ripple-color, transparent)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-mdc-radio-checked-ripple-color, transparent)}.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}),y})(),Fe=(()=>{class y{}return y.\u0275fac=function(p){return new(p||y)},y.\u0275mod=t.oAB({type:y}),y.\u0275inj=t.cJS({imports:[pe.BQ,M.ez,pe.si,pe.BQ]}),y})();function Le(y,f){if(1&y){const p=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(m){t.CHM(p);const k=t.oxw();return t.KtG(k.taxOptionSelected=m)})("change",function(){t.CHM(p);const m=t.oxw();return t.KtG(m.onSelectTaxType())}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Applied Tax ex: 100 + 10% = 110"),t.qZA()()()}if(2&y){const p=t.oxw();t.xp6(4),t.Q6J("items",p.taxOptions)("ngModel",p.taxOptionSelected)("clearable",!1)}}function Je(y,f){if(1&y){const p=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(m){t.CHM(p);const k=t.oxw();return t.KtG(k.outletID=m)}),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&y){const p=t.oxw();t.xp6(4),t.Q6J("items",p.outlets)("ngModel",p.outletID)("clearable",!0)}}const me=function(y){return{active:y}};let Se=(()=>{var y;class f{constructor(a,m,k){this.dialogRef=a,this.data=m,this.outlet=k,this.event=new t.vpe,this.modalConfig=new w.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(m.paperFormat)),this.orientationOptions=this.paperFormat.OrientationChoice,this.outlets=m.outlets,this.taxs=m.taxs,this.authTax=m.authTax,this.initTaxOptions(),this.activeTab="paper",this.outletRole=m.outletRole}ngOnInit(){this.initModalConfig(),this.initFormValue(),this.authTax&&this.initTaxOptionSelected()}initTaxOptions(){this.taxOptions=[],this.taxs.forEach((a,m)=>{this.taxOptions=[...this.taxOptions,{id:m+1,name:a.getName,ID:a.getID}]})}initTaxOptionSelected(){this.taxSelected&&(this.taxOptionSelected=this.taxOptions.find(a=>a.ID===this.taxSelected.ID))}onSelectTaxType(){this.taxSelected=this.taxs.find(a=>a.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(a=>a.ID==this.outletID)?.Name)}checkPriceWithTax(){this.priceTax||(this.taxSelected=this.taxs.find(a=>"No Tax"==a.getLabel))}dataTarget(a){this.activeTab=a}}return(y=f).\u0275fac=function(a){return new(a||y)(t.Y36(g.so),t.Y36(g.WI),t.Y36(le))},y.\u0275cmp=t.Xpm({type:y,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(a,m){1&a&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return m.onOk()})("onCancel",function(){return m.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"ul",2,3)(5,"li",4)(6,"a",5),t.NdJ("click",function(){return m.dataTarget("paper")}),t._uU(7,"Paper"),t.qZA()(),t.TgZ(8,"li",4)(9,"a",6),t.NdJ("click",function(){return m.dataTarget("spacing")}),t._uU(10,"Spacing"),t.qZA()(),t.TgZ(11,"li",4)(12,"a",7),t.NdJ("click",function(){return m.dataTarget("sticker-content")}),t._uU(13,"Sticker Content"),t.qZA()(),t.TgZ(14,"li",4)(15,"a",8),t.NdJ("click",function(){return m.dataTarget("price")}),t._uU(16,"Price"),t.qZA()(),t.TgZ(17,"li",4)(18,"a",9),t.NdJ("click",function(){return m.dataTarget("advanced")}),t._uU(19,"Advanced"),t.qZA()(),t.TgZ(20,"li",4)(21,"a",10),t.NdJ("click",function(){return m.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(L){return m.paperWidth=L}),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(L){return m.stickerWidth=L}),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(L){return m.stickerHeight=L}),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(L){return m.marginLeft=L}),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(L){return m.marginTop=L}),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(L){return m.spacingRow=L}),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(L){return m.spacingColumn=L}),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(L){return m.barcodeHeight=L}),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(L){return m.fontSize=L}),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 m.barcode=!1}),t._uU(144,"No "),t.qZA(),t.TgZ(145,"mat-radio-button",23),t.NdJ("change",function(){return m.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 m.code=!1}),t._uU(156,"No "),t.qZA(),t.TgZ(157,"mat-radio-button",23),t.NdJ("change",function(){return m.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 m.price=!1}),t._uU(168,"No "),t.qZA(),t.TgZ(169,"mat-radio-button",23),t.NdJ("change",function(){return m.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 m.name=!1}),t._uU(180,"No "),t.qZA(),t.TgZ(181,"mat-radio-button",23),t.NdJ("change",function(){return m.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 m.move=!1}),t._uU(192,"No "),t.qZA(),t.TgZ(193,"mat-radio-button",23),t.NdJ("change",function(){return m.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 m.relaseDate=!1}),t._uU(204,"No "),t.qZA(),t.TgZ(205,"mat-radio-button",23),t.NdJ("change",function(){return m.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 m.priceDiscount=!1}),t._uU(216,"No "),t.qZA(),t.TgZ(217,"mat-radio-button",23),t.NdJ("change",function(){return m.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 m.priceTax=!1}),t._uU(230," No"),t.qZA(),t.TgZ(231,"mat-radio-button",23),t.NdJ("change",function(){return m.priceTax=!0}),t._uU(232,"Yes"),t.qZA()()(),t.TgZ(233,"td")(234,"span"),t._uU(235),t.qZA()()(),t.YNc(236,Le,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(L){return m.currencySymbol=L}),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(L){return m.PriceFontSize=L}),t.qZA()()(),t.TgZ(252,"td")(253,"span"),t._uU(254,"Change font size for price"),t.qZA()()(),t.YNc(255,Je,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(L){return m.maxChar=L}),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(L){return m.namePrefix=L}),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(L){return m.storeName=L}),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(L){return m.orientationType=L}),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 m.desc=!1}),t._uU(299,"No "),t.qZA(),t.TgZ(300,"mat-radio-button",23),t.NdJ("change",function(){return m.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 m.removeDefault=!1}),t._uU(311,"No "),t.qZA(),t.TgZ(312,"mat-radio-button",23),t.NdJ("change",function(){return m.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(L){return m.basicPriceLabel=L}),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(L){return m.promotionPriceLabel=L}),t.qZA()()(),t.TgZ(334,"td")(335,"span"),t._uU(336,"Custom label promotion price"),t.qZA()()()()()()()()()),2&a&&(t.Q6J("config",m.modalConfig),t.xp6(6),t.Q6J("ngClass",t.VKq(55,me,"paper"===m.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(57,me,"spacing"===m.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(59,me,"sticker-content"===m.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(61,me,"price"===m.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(63,me,"advanced"===m.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(65,me,"promotionLabel"===m.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(67,me,"paper"===m.activeTab)),t.xp6(7),t.Q6J("ngModel",m.paperWidth),t.xp6(12),t.Q6J("ngModel",m.stickerWidth),t.xp6(12),t.Q6J("ngModel",m.stickerHeight),t.xp6(7),t.Q6J("ngClass",t.VKq(69,me,"spacing"===m.activeTab)),t.xp6(7),t.Q6J("ngModel",m.marginLeft),t.xp6(12),t.Q6J("ngModel",m.marginTop),t.xp6(12),t.Q6J("ngModel",m.spacingRow),t.xp6(12),t.Q6J("ngModel",m.spacingColumn),t.xp6(7),t.Q6J("ngClass",t.VKq(71,me,"sticker-content"===m.activeTab)),t.xp6(7),t.Q6J("ngModel",m.barcodeHeight),t.xp6(12),t.Q6J("ngModel",m.fontSize),t.xp6(12),t.Q6J("checked",!m.barcode),t.xp6(2),t.Q6J("checked",m.barcode),t.xp6(10),t.Q6J("checked",!m.code),t.xp6(2),t.Q6J("checked",m.code),t.xp6(10),t.Q6J("checked",!m.price),t.xp6(2),t.Q6J("checked",m.price),t.xp6(10),t.Q6J("checked",!m.name),t.xp6(2),t.Q6J("checked",m.name),t.xp6(10),t.Q6J("checked",!m.move),t.xp6(2),t.Q6J("checked",m.move),t.xp6(10),t.Q6J("checked",!m.relaseDate),t.xp6(2),t.Q6J("checked",m.relaseDate),t.xp6(10),t.Q6J("checked",!m.priceDiscount),t.xp6(2),t.Q6J("checked",m.priceDiscount),t.xp6(5),t.Q6J("ngClass",t.VKq(73,me,"price"===m.activeTab)),t.xp6(7),t.Q6J("checked",!m.priceTax),t.xp6(2),t.Q6J("checked",m.priceTax),t.xp6(4),t.hij("Tax is added to the product base price ",m.authTax,""),t.xp6(1),t.Q6J("ngIf",1==m.priceTax&&1==m.authTax),t.xp6(6),t.Q6J("ngModel",m.currencySymbol),t.xp6(9),t.Q6J("ngModel",m.PriceFontSize),t.xp6(4),t.Q6J("ngIf",m.outletRole),t.xp6(1),t.Q6J("ngClass",t.VKq(75,me,"advanced"===m.activeTab)),t.xp6(7),t.Q6J("ngModel",m.maxChar),t.xp6(9),t.Q6J("ngModel",m.namePrefix),t.xp6(9),t.Q6J("ngModel",m.storeName),t.xp6(8),t.Q6J("items",m.orientationOptions)("ngModel",m.orientationType)("clearable",!1),t.xp6(9),t.Q6J("checked",!m.desc),t.xp6(2),t.Q6J("checked",m.desc),t.xp6(10),t.Q6J("checked",!m.removeDefault),t.xp6(2),t.Q6J("checked",m.removeDefault),t.xp6(5),t.Q6J("ngClass",t.VKq(77,me,"promotionLabel"===m.activeTab)),t.xp6(7),t.Q6J("ngModel",m.basicPriceLabel),t.xp6(9),t.Q6J("ngModel",m.promotionPriceLabel))},dependencies:[M.mk,M.O5,O.Fj,O.wV,O.JJ,O.On,U.w9,j.M,Ie,ae,ye],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}"]}),f})();var Pe=C(6387);const Qe=["bcElement"];let Ee=(()=>{class y{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(p){this.renderer=p,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 p;switch(this.elementType){case"img":p=this.renderer.createElement("img");break;case"canvas":p=this.renderer.createElement("canvas");break;default:p=this.renderer.createElement("svg","svg")}Pe(p,this.value,this.options);for(const a of this.bcElement.nativeElement.childNodes)this.renderer.removeChild(this.bcElement.nativeElement,a);this.renderer.appendChild(this.bcElement.nativeElement,p)}}return y.\u0275fac=function(p){return new(p||y)(t.Y36(t.Qsj))},y.\u0275cmp=t.Xpm({type:y,selectors:[["ngx-barcode6"]],viewQuery:function(p,a){if(1&p&&t.Gf(Qe,5),2&p){let m;t.iGM(m=t.CRH())&&(a.bcElement=m.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(p,a){1&p&&t._UZ(0,"div",null,0),2&p&&t.Tol(a.cssClass)},encapsulation:2}),y})(),$e=(()=>{class y{}return y.\u0275fac=function(p){return new(p||y)},y.\u0275mod=t.oAB({type:y}),y.\u0275inj=t.cJS({}),y})(),Ye=(()=>{var y;class f{transform(a,m){let k=a,L=0;return m&&0!==m&&(L=a*(m/100),k=a+L),k}}return(y=f).\u0275fac=function(a){return new(a||y)},y.\u0275pipe=t.Yjl({name:"taxPipe",type:y,pure:!0}),f})();function Xe(y,f){if(1&y&&t._UZ(0,"ngx-barcode6",18),2&y){const p=t.oxw().$implicit,a=t.oxw();t.Q6J("bc-value",null==p?null:p.getCode)("bc-element-type","img")("bc-width",1)("bc-height",null==a.selectedPaperFormat?null:a.selectedPaperFormat.BarcodeHeight)}}function Ae(y,f){if(1&y&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&y){const p=t.oxw().$implicit,a=t.oxw();t.Udp("font-size",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.Oqu(p.getBarcodeTitle)}}function He(y,f){if(1&y&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&y){const p=t.oxw().$implicit,a=t.oxw();t.Udp("font-size",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=a.selectedPaperFormat&&a.selectedPaperFormat.ProductNamePrefix?(null==a.selectedPaperFormat?null:a.selectedPaperFormat.ProductNamePrefix)+" "+p.getName:p.getName,0,null==a.selectedPaperFormat?null:a.selectedPaperFormat.ProductNameMaxLength)," ")}}function Me(y,f){if(1&y&&(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&y){const p=t.oxw(2).$implicit,a=t.oxw();t.xp6(3),t.Oqu(a.selectedPaperFormat.BasicPriceLabel?a.selectedPaperFormat.BasicPriceLabel:"N. Price"),t.xp6(4),t.AsE("",null==a.selectedPaperFormat?null:a.selectedPaperFormat.CurrencySymbol," ",t.lcZ(8,6,null==p?null:p.getUnitPrice),""),t.xp6(4),t.Oqu(a.selectedPaperFormat.PromotionPriceLabel?a.selectedPaperFormat.PromotionPriceLabel:"Spc. Price"),t.xp6(2),t.AsE("",null==a.selectedPaperFormat?null:a.selectedPaperFormat.CurrencySymbol," ",t.lcZ(14,8,(null==p||null==p.getSelectedPromotion?null:p.getSelectedPromotion.getUnitPrice)-(null==p||null==p.getSelectedPromotion?null:p.getSelectedPromotion.getUnitPrice)*(null==p||null==p.getSelectedPromotion?null:p.getSelectedPromotion.getDiscount)/100),"")}}function Ke(y,f){if(1&y&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&y){const p=t.oxw(3).$implicit,a=t.oxw();t.xp6(1),t.AsE(" ",null==a.selectedPaperFormat?null:a.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==p?null:p.getCustomPrice,a.tax))," ")}}function Ve(y,f){if(1&y&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&y){const p=t.oxw(4).$implicit,a=t.oxw();t.xp6(1),t.AsE(" ",null==a.selectedPaperFormat?null:a.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==p?null:p.getUnitPrice,a.tax))," ")}}function et(y,f){if(1&y&&t.YNc(0,Ve,4,7,"ng-container",20),2&y){t.oxw();const p=t.MAs(5),a=t.oxw(3);t.Q6J("ngIf",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.PriceWithTax)&&a.tax&&0!=a.tax)("ngIfElse",p)}}function tt(y,f){if(1&y&&(t._uU(0),t.ALo(1,"number")),2&y){const p=t.oxw(3).$implicit,a=t.oxw();t.AsE(" ",null==a.selectedPaperFormat?null:a.selectedPaperFormat.CurrencySymbol," ",t.lcZ(1,2,null==p?null:p.getUnitPrice)," ")}}function it(y,f){if(1&y&&(t.TgZ(0,"strong"),t.YNc(1,Ke,4,7,"ng-container",20),t.YNc(2,et,1,2,"ng-template",null,29,t.W1O),t.YNc(4,tt,2,4,"ng-template",null,30,t.W1O),t.qZA()),2&y){const p=t.MAs(3),a=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",0!==(null==a?null:a.getCustomPrice)&&void 0!==(null==a?null:a.getCustomPrice))("ngIfElse",p)}}function rt(y,f){if(1&y&&(t.TgZ(0,"span",19),t.YNc(1,Me,15,10,"ng-container",20),t.YNc(2,it,6,2,"ng-template",null,21,t.W1O),t.qZA()),2&y){const p=t.MAs(3),a=t.oxw().$implicit,m=t.oxw();t.Udp("font-size",(null==m.selectedPaperFormat?null:m.selectedPaperFormat.PriceFontSize)+"px"),t.xp6(1),t.Q6J("ngIf",a.getSelectedPromotion)("ngIfElse",p)}}function at(y,f){if(1&y&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&y){const p=t.oxw().$implicit,a=t.oxw();t.Udp("font-size",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=a.selectedPaperFormat&&a.selectedPaperFormat.ProductNamePrefix?(null==a.selectedPaperFormat?null:a.selectedPaperFormat.ProductNamePrefix)+" "+p.getName:p.getName,0,null==a.selectedPaperFormat?null:a.selectedPaperFormat.ProductNameMaxLength)," ")}}function ot(y,f){if(1&y&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.ALo(3,"date"),t.qZA(),t.BQk()),2&y){const p=t.oxw().$implicit,a=t.oxw();t.xp6(1),t.Udp("font-size",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.xi3(3,3,p.getReleaseDate,"dd MMM yy")," ")}}function st(y,f){if(1&y&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&y){const p=t.oxw().$implicit,a=t.oxw();t.xp6(1),t.Udp("font-size",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",p.getPriceDiscount,"% Off ")}}function lt(y,f){if(1&y&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&y){const p=t.oxw(2);t.xp6(1),t.Udp("font-size",(null==p.selectedPaperFormat?null:p.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==p.selectedPaperFormat?null:p.selectedPaperFormat.StoreName," ")}}function ct(y,f){if(1&y&&(t.ynx(0),t.TgZ(1,"div",31),t._uU(2),t.qZA(),t.BQk()),2&y){const p=t.oxw(2);t.xp6(1),t.Udp("font-size",(null==p.selectedPaperFormat?null:p.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==p.selectedPaperFormat?null:p.selectedPaperFormat.StoreName," ")}}function ut(y,f){if(1&y&&(t.TgZ(0,"li")(1,"div",13),t.YNc(2,Xe,1,4,"ngx-barcode6",14),t.TgZ(3,"div",15),t.YNc(4,Ae,2,3,"span",16),t.YNc(5,He,3,7,"span",16),t.YNc(6,rt,4,4,"span",16),t.YNc(7,at,3,7,"span",16),t.YNc(8,ot,4,6,"ng-container",17),t.YNc(9,st,3,3,"ng-container",17),t.YNc(10,lt,3,3,"ng-container",17),t.qZA(),t.YNc(11,ct,3,3,"ng-container",17),t.qZA()()),2&y){const p=f.index,a=t.oxw();t.Udp("width",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.StickerWidth)+"px")("height",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.StickerHeight)+"px")("margin-right",(p+1)%a.totalStickerPerRow==0?0:(null==a.selectedPaperFormat?null:a.selectedPaperFormat.ColumnSpacing)+"px")("margin-bottom",p>=a.productPreview.length-a.lastIndex?0:(null==a.selectedPaperFormat?null:a.selectedPaperFormat.RowSpacing)+"px"),t.xp6(2),t.Q6J("ngIf",null==a.selectedPaperFormat?null:a.selectedPaperFormat.BarcodeVisible),t.xp6(2),t.Q6J("ngIf",null==a.selectedPaperFormat?null:a.selectedPaperFormat.CodeVisible),t.xp6(1),t.Q6J("ngIf",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.NameVisible)&&(null==a.selectedPaperFormat?null:a.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==a.selectedPaperFormat?null:a.selectedPaperFormat.PriceVisible),t.xp6(1),t.Q6J("ngIf",(null==a.selectedPaperFormat?null:a.selectedPaperFormat.NameVisible)&&!(null!=a.selectedPaperFormat&&a.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==a.selectedPaperFormat?null:a.selectedPaperFormat.ShowReleasedDate),t.xp6(1),t.Q6J("ngIf",null==a.selectedPaperFormat?null:a.selectedPaperFormat.ShowPriceDiscount),t.xp6(1),t.Q6J("ngIf",0==(null==a.selectedPaperFormat?null:a.selectedPaperFormat.Orientation)),t.xp6(1),t.Q6J("ngIf",1==(null==a.selectedPaperFormat?null:a.selectedPaperFormat.Orientation))}}let dt=(()=>{var y;class f{constructor(a,m,k,L,K,te,ne){this.dialog=a,this.productStateService=m,this.productService=k,this.barcodeService=L,this.toastService=K,this.authService=te,this.route=ne,this.paperFormatOptions=[],this.optionSelected={id:1,name:"Continuous - 3 Column"},this.paperFormats=[],this.totalStickerPerRow=0,this.lastIndex=0,this.destroy$=new S.x,this.productPreview=[],this.taxs=[];const oe=this.route.snapshot.queryParams?.ID;oe&&this.productService.getProductById(oe).pipe((0,H.b)(ge=>this.productStateService.setState([ge]))).subscribe(),(()=>{const ge=localStorage.getItem("Token");if(d.gT.IsNotEmpty(ge)){const nt=d.gT.parseJwt(ge)["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];console.log(nt),this.outletView=nt.includes("Out")}})()}ngOnInit(){this.getPaperFormats(),this.checkAuthTax(),this.subscribeToObsproducts()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}checkAuthTax(){this.authService.getRoles().find(k=>"StpE"===k)?(this.getProductTax(),this.authTax=!0):this.authTax=!1}subscribeToObsproducts(){this.productStateService.getState().pipe((0,s.R)(this.destroy$)).subscribe(a=>{this.productPreview=a,this.relayout()})}getProductTax(){this.productService.getTax().pipe((0,s.R)(this.destroy$)).subscribe(a=>{a&&(this.taxs=a)})}getPaperFormats(){this.barcodeService.getPaperFormatConfig().pipe((0,s.R)(this.destroy$)).subscribe({next:a=>{a.paperFormat&&(this.paperFormats=a.paperFormat,this.outlets=a.outlets,this.setSelectedPaperFormat(a.paperFormat[0]),this.initOptionFormat(),this.initOptionSelected(this.selectedPaperFormat))},error:a=>{console.error(a)}})}initOptionFormat(){this.paperFormatOptions=[],this.paperFormats.forEach((a,m)=>{this.paperFormatOptions=[...this.paperFormatOptions,{id:m+1,name:a.Name}]})}initOptionSelected(a){this.optionSelected=this.paperFormatOptions.find(m=>m.name===a.Name)}openSettingModal(){this.dialog.open(Se,{width:"850px",data:{paperFormat:this.selectedPaperFormat,taxs:this.taxs,authTax:this.authTax,outlets:this.outlets,outletRole:this.outletView}}).afterClosed().pipe((0,s.R)(this.destroy$)).subscribe(a=>{a&&this.selectedPaperFormat&&(this.updatePaperFormatSource(a),this.updatePaperFormat(),this.setSelectedPaperFormat(a))})}onSelectPaperFormat(){this.getPaperFormatBarcode()}getPaperFormatBarcode(){let m=this.findPaperFormatByName(this.optionSelected.name);this.setSelectedPaperFormat(m)}updatePaperFormat(){this.barcodeService.updatePaperFormatConfig(this.paperFormats).pipe((0,s.R)(this.destroy$)).subscribe({next:()=>{this.toastService.success("Success Update Paper Format","Success")},error:a=>{console.error(a)}})}setSelectedPaperFormat(a){this.selectedPaperFormat=a,this.barcodeService.setBarcodeConfigState(a),this.relayout(),this.getPPnVal(a)}findPaperFormatByName(a){return this.paperFormats.find(k=>k.Name==a)}updatePaperFormatSource(a){this.paperFormats=this.paperFormats.map(m=>(a.Name===m.Name&&(m=a),m))}getPPnVal(a){this.tax=a.TaxType?a.TaxType.Rate:null}relayout(){let a=this.selectedPaperFormat?.PaperWidth?this.selectedPaperFormat?.PaperWidth:0,m=this.selectedPaperFormat?.StickerWidth?this.selectedPaperFormat?.StickerWidth:0,k=this.selectedPaperFormat?.ColumnSpacing?this.selectedPaperFormat?.ColumnSpacing:0,K=Math.floor((a+k)/(m+k));this.totalStickerPerRow=K;let ne=Math.floor(this.productPreview.length/K),oe=this.productPreview.length-ne*K;this.lastIndex=0===oe?K:oe,this.productPreview=this.productPreview.map(de=>(de.setBarcodeTitle=this.selectedPaperFormat?.DescriptionAsCode&&de.getDescription?de.getDescription:de.getCode,de))}}return(y=f).\u0275fac=function(a){return new(a||y)(t.Y36(g.uw),t.Y36(E),t.Y36(_e),t.Y36(ie),t.Y36(fe._W),t.Y36(T.$),t.Y36(F.gz))},y.\u0275cmp=t.Xpm({type:y,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,"vertical-text"]],template:function(a,m){1&a&&(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(L){return m.optionSelected=L})("change",function(){return m.onSelectPaperFormat()}),t.qZA(),t.TgZ(9,"button",7),t.NdJ("click",function(){return m.openSettingModal()}),t._UZ(10,"i",8),t.qZA()()(),t.TgZ(11,"div",9)(12,"div",10)(13,"ul",11),t.YNc(14,ut,12,17,"li",12),t.qZA()()()()),2&a&&(t.xp6(8),t.Q6J("items",m.paperFormatOptions)("ngModel",m.optionSelected)("clearable",!1),t.xp6(4),t.Udp("width",(null==m.selectedPaperFormat?null:m.selectedPaperFormat.PaperWidth)+"px")("margin-top",(null==m.selectedPaperFormat?null:m.selectedPaperFormat.MarginTop)+"px")("margin-left",(null==m.selectedPaperFormat?null:m.selectedPaperFormat.MarginLeft)+"px"),t.xp6(2),t.Q6J("ngForOf",m.productPreview))},dependencies:[M.sg,M.O5,O.JJ,O.On,U.w9,Ee,M.OU,M.JJ,M.uU,Ye],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;height:100%;top:8%;text-align:center}"]}),f})(),ht=(()=>{var y;class f{constructor(a,m,k){this.variantServiceState=a,this.authService=m,this.queryParamService=k,this.domainName=localStorage.getItem("Domain")}onLogout(){this.variantServiceState.setState([]),this.queryParamService.setState(null),this.authService.logout()}}return(y=f).\u0275fac=function(a){return new(a||y)(t.Y36(E),t.Y36(T.$),t.Y36(D.U))},y.\u0275cmp=t.Xpm({type:y,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(a,m){1&a&&(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 m.onLogout()}),t._UZ(18,"span",14),t._uU(19,"\xa0Logout"),t.qZA()()()()()),2&a&&(t.xp6(15),t.MGl("href","https://",m.domainName,"",t.LSH),t.xp6(1),t.Oqu(m.domainName))},dependencies:[qe,dt],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%}}"]}),f})();var mt=C(4007);const gt=[{path:"",component:ht}];let pt=(()=>{var y;class f{}return(y=f).\u0275fac=function(a){return new(a||y)},y.\u0275mod=t.oAB({type:y}),y.\u0275inj=t.cJS({imports:[M.ez,mt.m,je,$e,Fe,F.Bz.forChild(gt)]}),f})()},6608:function(J){J.exports=function(){return M={},P.m=C=[function(F,t,A){"use strict";A.r(t);var V={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(V.allowedTagList),Object.defineProperty(V,"allowedTagList",{configurable:!1,writable:!1}),V.keyCode={Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,Pause:19,CapsLock:20,Esc:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Insert:45,Delete:46,num0:48,num1:49,num2:50,num3:51,num4:52,num5:53,num6:54,num7:55,num8:56,num9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,OSLeft:91,OSRight:92,ContextMenu:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,MultiplyNumpad:106,PlusNumpad:107,MinusNumpad:109,DotNumpad:110,SlashNumpad:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,HyphenFirefox:173,MyComputer:182,MyCalculator:183,Semicolon:186,Equal:187,Comma:188,Hyphen:189,Dot:190,Slash:191,Backquote:192,LeftBracket:219,Backslash:220,RightBracket:221,Quote:222,Command:224,AltGraph:225,AndroidDefault:229},Object.freeze(V.keyCode),Object.defineProperty(V,"keyCode",{configurable:!1,writable:!1}),V.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(V.fromCharCodeKeyCode),Object.defineProperty(V,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),V.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(V.keyName._allFnKeys),Object.freeze(V.keyName._someNonPrintableKeys),Object.freeze(V.keyName._directionKeys),Object.freeze(V.keyName),Object.defineProperty(V,"keyName",{configurable:!1,writable:!1}),Object.freeze(V);var E=V;function T(o){return function(u){if(Array.isArray(u))return l(u)}(o)||function(u){if(typeof Symbol<"u"&&Symbol.iterator in Object(u))return Array.from(u)}(o)||s(o)||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 D(){return(D=Object.assign||function(o){for(var u=1;u<arguments.length;u++){var v=arguments[u];for(var e in v)Object.prototype.hasOwnProperty.call(v,e)&&(o[e]=v[e])}return o}).apply(this,arguments)}function S(o,u){return function(v){if(Array.isArray(v))return v}(o)||function(v,e){if(typeof Symbol<"u"&&Symbol.iterator in Object(v)){var i=[],r=!0,h=!1,_=void 0;try{for(var c,N=v[Symbol.iterator]();!(r=(c=N.next()).done)&&(i.push(c.value),!e||i.length!==e);r=!0);}catch(I){h=!0,_=I}finally{try{r||null==N.return||N.return()}finally{if(h)throw _}}return i}}(o,u)||s(o,u)||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 s(o,u){if(o){if("string"==typeof o)return l(o,u);var v=Object.prototype.toString.call(o).slice(8,-1);return"Object"===v&&o.constructor&&(v=o.constructor.name),"Map"===v||"Set"===v?Array.from(v):"Arguments"===v||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?l(o,u):void 0}}function l(o,u){(null==u||u>o.length)&&(u=o.length);for(var v=0,e=new Array(u);v<u;v++)e[v]=o[v];return e}function d(o){return(d="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})(o)}var n=function(){function o(){!function(u){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}(this)}return function(u,v){for(var e=0;e<v.length;e++){var i=v[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}(o,[{key:"isNull",value:function(u){return null===u}},{key:"isUndefined",value:function(u){return void 0===u}},{key:"isUndefinedOrNullOrEmpty",value:function(u){return null==u||""===u}},{key:"isString",value:function(u){return"string"==typeof u||u instanceof String}},{key:"isEmptyString",value:function(u){return""===u}},{key:"isBoolean",value:function(u){return"boolean"==typeof u}},{key:"isTrueOrFalseString",value:function(u){var v=String(u).toLowerCase();return"true"===v||"false"===v}},{key:"isObject",value:function(u){return"object"===d(u)&&null!==u&&!Array.isArray(u)}},{key:"isEmptyObj",value:function(u){for(var v in u)if(Object.prototype.hasOwnProperty.call(u,v))return!1;return!0}},{key:"isNumberStrict",value:function(u){return"number"==typeof u}},{key:"isNumber",value:function(u){return!this.isArray(u)&&!isNaN(parseFloat(u))&&isFinite(u)}},{key:"isDigit",value:function(u){return/\d/.test(u)}},{key:"isNumberOrArabic",value:function(u){var v=this.arabicToLatinNumbers(u,!1,!0,!0);return this.isNumber(v)}},{key:"isInt",value:function(u){return"number"==typeof u&&parseFloat(u)===parseInt(u,10)&&!isNaN(u)}},{key:"isFunction",value:function(u){return"function"==typeof u}},{key:"isIE11",value:function(){return typeof window<"u"&&!!window.MSInputMethodContext&&!!document.documentMode}},{key:"contains",value:function(u,v){return!(!this.isString(u)||!this.isString(v)||""===u||""===v)&&-1!==u.indexOf(v)}},{key:"isInArray",value:function(u,v){return!(!this.isArray(v)||v===[]||this.isUndefined(u))&&-1!==v.indexOf(u)}},{key:"isArray",value:function(u){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(u)||"object"===d(u)&&"[object Array]"===Object.prototype.toString.call(u);throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(u){return typeof Element<"u"&&u instanceof Element}},{key:"isInputElement",value:function(u){return this.isElement(u)&&"input"===u.tagName.toLowerCase()}},{key:"decimalPlaces",value:function(u){var v=S(u.split("."),2)[1];return this.isUndefined(v)?0:v.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(u){var v=S(String(Math.abs(u)).split("."),2)[1];if(this.isUndefined(v))return 0;var e=v.lastIndexOf("0");return-1===e?e=0:e+=2,e}},{key:"keyCodeNumber",value:function(u){return void 0===u.which?u.keyCode:u.which}},{key:"character",value:function(u){var v;if("Unidentified"===u.key||void 0===u.key||this.isSeleniumBot()){var e=this.keyCodeNumber(u);if(e===E.keyCode.AndroidDefault)return E.keyName.AndroidDefault;var i=E.fromCharCodeKeyCode[e];v=o.isUndefinedOrNullOrEmpty(i)?String.fromCharCode(e):i}else{var r;switch(u.key){case"Add":v=E.keyName.NumpadPlus;break;case"Apps":v=E.keyName.ContextMenu;break;case"Crsel":v=E.keyName.CrSel;break;case"Decimal":v=u.char?u.char:E.keyName.NumpadDot;break;case"Del":v="firefox"===(r=this.browser()).name&&r.version<=36||"ie"===r.name&&r.version<=9?E.keyName.Dot:E.keyName.Delete;break;case"Divide":v=E.keyName.NumpadSlash;break;case"Down":v=E.keyName.DownArrow;break;case"Esc":v=E.keyName.Esc;break;case"Exsel":v=E.keyName.ExSel;break;case"Left":v=E.keyName.LeftArrow;break;case"Meta":case"Super":v=E.keyName.OSLeft;break;case"Multiply":v=E.keyName.NumpadMultiply;break;case"Right":v=E.keyName.RightArrow;break;case"Spacebar":v=E.keyName.Space;break;case"Subtract":v=E.keyName.NumpadMinus;break;case"Up":v=E.keyName.UpArrow;break;default:v=u.key}}return v}},{key:"browser",value:function(){var u,v=navigator.userAgent,e=v.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(e[1])?{name:"ie",version:(u=/\brv[ :]+(\d+)/g.exec(v)||[])[1]||""}:"Chrome"===e[1]&&null!==(u=v.match(/\b(OPR|Edge)\/(\d+)/))?{name:u[1].replace("OPR","opera"),version:u[2]}:(e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(u=v.match(/version\/(\d+)/i))&&e.splice(1,1,u[1]),{name:e[0].toLowerCase(),version:e[1]})}},{key:"isSeleniumBot",value:function(){return!0===window.navigator.webdriver}},{key:"isNegative",value:function(u,v,e){var i=1<arguments.length&&void 0!==v?v:"-",r=!(2<arguments.length&&void 0!==e)||e;return u===i||""!==u&&(o.isNumber(u)?u<0:r?this.contains(u,i):this.isNegativeStrict(u,i))}},{key:"isNegativeStrict",value:function(u,v){var e=1<arguments.length&&void 0!==v?v:"-";return u.charAt(0)===e}},{key:"isNegativeWithBrackets",value:function(u,v,e){return u.charAt(0)===v&&this.contains(u,e)}},{key:"isZeroOrHasNoValue",value:function(u){return!/[1-9]/g.test(u)}},{key:"setRawNegativeSign",value:function(u){return this.isNegativeStrict(u,"-")?u:"-".concat(u)}},{key:"replaceCharAt",value:function(u,v,e){return"".concat(u.substr(0,v)).concat(e).concat(u.substr(v+e.length))}},{key:"clampToRangeLimits",value:function(u,v){return Math.max(v.minimumValue,Math.min(v.maximumValue,u))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(u,v,e){for(var i=new RegExp("[0-9".concat(e,"-]")),r=0,h=0;h<v;h++)i.test(u[h])&&r++;return r}},{key:"findCaretPositionInFormattedNumber",value:function(u,v,e,i){var r,h=e.length,_=u.length,c=0;for(r=0;r<h&&c<_&&c<v;r++)(u[c]===e[r]||"."===u[c]&&e[r]===i)&&c++;return r}},{key:"countCharInText",value:function(u,v){for(var e=0,i=0;i<v.length;i++)v[i]===u&&e++;return e}},{key:"convertCharacterCountToIndexPosition",value:function(u){return Math.max(u,u-1)}},{key:"getElementSelection",value:function(u){var v,e={};try{v=this.isUndefined(u.selectionStart)}catch{v=!1}try{if(v){var i=window.getSelection().getRangeAt(0);e.start=i.startOffset,e.end=i.endOffset,e.length=e.end-e.start}else e.start=u.selectionStart,e.end=u.selectionEnd,e.length=e.end-e.start}catch{e.start=0,e.end=0,e.length=0}return e}},{key:"setElementSelection",value:function(u,v,e){var i=2<arguments.length&&void 0!==e?e:null;if(this.isUndefinedOrNullOrEmpty(i)&&(i=v),this.isInputElement(u))u.setSelectionRange(v,i);else if(!o.isNull(u.firstChild)){var r=document.createRange();r.setStart(u.firstChild,v),r.setEnd(u.firstChild,i);var h=window.getSelection();h.removeAllRanges(),h.addRange(r)}}},{key:"throwError",value:function(u){throw new Error(u)}},{key:"warning",value:function(u,v){1<arguments.length&&void 0!==v&&!v||console.warn("Warning: ".concat(u))}},{key:"isWheelUpEvent",value:function(u){return u.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(u.type,"' given.")),u.deltaY<0}},{key:"isWheelDownEvent",value:function(u){return u.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(u.type,"' given.")),0<u.deltaY}},{key:"forceDecimalPlaces",value:function(u,v){var e=S(String(u).split("."),2),r=e[1];return r?"".concat(e[0],".").concat(r.substr(0,v)):u}},{key:"roundToNearest",value:function(u,v){var e=1<arguments.length&&void 0!==v?v:1e3;return 0===u?0:(0===e&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(u/e)*e)}},{key:"modifyAndRoundToNearestAuto",value:function(u,v,e){u=Number(this.forceDecimalPlaces(u,e));var i=Math.abs(u);if(0<=i&&i<1){var r,h=Math.pow(10,-e);if(0===u)return v?h:-h;var c=e,N=this.indexFirstNonZeroDecimalPlace(u);return r=c-1<=N?h:Math.pow(10,-(N+1)),this.roundToNearest(v?u+r:u-r,r)}u=parseInt(u,10);var I,G=Math.abs(u).toString().length;switch(G){case 1:I=0;break;case 2:case 3:I=1;break;case 4:case 5:I=2;break;default:I=G-3}var b,B=Math.pow(10,I);return(b=v?u+B:u-B)<=10&&-10<=b?b:this.roundToNearest(b,B)}},{key:"addAndRoundToNearestAuto",value:function(u,v){return this.modifyAndRoundToNearestAuto(u,!0,v)}},{key:"subtractAndRoundToNearestAuto",value:function(u,v){return this.modifyAndRoundToNearestAuto(u,!1,v)}},{key:"arabicToLatinNumbers",value:function(u,v,e,i){var r=!(1<arguments.length&&void 0!==v)||v,h=2<arguments.length&&void 0!==e&&e,_=3<arguments.length&&void 0!==i&&i;if(this.isNull(u))return u;var c=u.toString();if(""===c)return u;if(null===c.match(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06f4\u06f5\u06f6]/g))return r&&(c=Number(c)),c;h&&(c=c.replace(/\u066b/,".")),_&&(c=c.replace(/\u066c/g,"")),c=c.replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g,function(I){return I.charCodeAt(0)-1632}).replace(/[\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9]/g,function(I){return I.charCodeAt(0)-1776});var N=Number(c);return isNaN(N)?N:(r&&(c=N),c)}},{key:"triggerEvent",value:function(u,v,e,i,r){var h,_=1<arguments.length&&void 0!==v?v:document,c=2<arguments.length&&void 0!==e?e:null,N=!(3<arguments.length&&void 0!==i)||i,I=!(4<arguments.length&&void 0!==r)||r;window.CustomEvent?h=new CustomEvent(u,{detail:c,bubbles:N,cancelable:I}):(h=document.createEvent("CustomEvent")).initCustomEvent(u,N,I,{detail:c}),_.dispatchEvent(h)}},{key:"parseStr",value:function(u){var v,e,i,r,h={};if(0===u&&1/u<0&&(u="-0"),u=u.toString(),this.isNegativeStrict(u,"-")?(u=u.slice(1),h.s=-1):h.s=1,-1<(v=u.indexOf("."))&&(u=u.replace(".","")),v<0&&(v=u.length),(e=-1===u.search(/[1-9]/i)?u.length:u.search(/[1-9]/i))===(i=u.length))h.e=0,h.c=[0];else{for(r=i-1;"0"===u.charAt(r);--r)--i;for(--i,h.e=v-e-1,h.c=[],v=0;e<=i;e+=1)h.c[v]=+u.charAt(e),v+=1}return h}},{key:"testMinMax",value:function(u,v){var e=v.c,i=u.c,r=v.s,h=u.s,_=v.e,c=u.e;if(!e[0]||!i[0])return e[0]?r:i[0]?-h:0;if(r!==h)return r;var N=r<0;if(_!==c)return c<_^N?1:-1;for(r=-1,h=(_=e.length)<(c=i.length)?_:c,r+=1;r<h;r+=1)if(e[r]!==i[r])return e[r]>i[r]^N?1:-1;return _===c?0:c<_^N?1:-1}},{key:"randomString",value:function(u){var v=0<arguments.length&&void 0!==u?u:5;return Math.random().toString(36).substr(2,v)}},{key:"domElement",value:function(u){return o.isString(u)?document.querySelector(u):u}},{key:"getElementValue",value:function(u){return"input"===u.tagName.toLowerCase()?u.value:this.text(u)}},{key:"setElementValue",value:function(u,v){var e=1<arguments.length&&void 0!==v?v:null;"input"===u.tagName.toLowerCase()?u.value=e:u.textContent=e}},{key:"setInvalidState",value:function(u,v){var e=1<arguments.length&&void 0!==v?v:"Invalid";""!==e&&!this.isNull(e)||this.throwError("Cannot set the invalid state with an empty message."),u.setCustomValidity(e)}},{key:"setValidState",value:function(u){u.setCustomValidity("")}},{key:"cloneObject",value:function(u){return D({},u)}},{key:"camelize",value:function(u,v,e,i){var r=1<arguments.length&&void 0!==v?v:"-",h=!(2<arguments.length&&void 0!==e)||e,_=!(3<arguments.length&&void 0!==i)||i;if(this.isNull(u))return null;h&&(u=u.replace(/^data-/,""));var c=u.split(r).map(function(N){return"".concat(N.charAt(0).toUpperCase()).concat(N.slice(1))});return c=c.join(""),_&&(c="".concat(c.charAt(0).toLowerCase()).concat(c.slice(1))),c}},{key:"text",value:function(u){var v=u.nodeType;return v===Node.ELEMENT_NODE||v===Node.DOCUMENT_NODE||v===Node.DOCUMENT_FRAGMENT_NODE?u.textContent:v===Node.TEXT_NODE?u.nodeValue:""}},{key:"setText",value:function(u,v){var e=u.nodeType;e!==Node.ELEMENT_NODE&&e!==Node.DOCUMENT_NODE&&e!==Node.DOCUMENT_FRAGMENT_NODE||(u.textContent=v)}},{key:"filterOut",value:function(u,v){var e=this;return u.filter(function(i){return!e.isInArray(i,v)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(u){if(""===(u=String(u)))return"";var v=S(u.split("."),2),e=v[0],i=v[1];if(this.isUndefinedOrNullOrEmpty(i))return e;var r=i.replace(/0+$/g,"");return""===r?e:"".concat(e,".").concat(r)}},{key:"getHoveredElement",value:function(){var u=T(document.querySelectorAll(":hover"));return u[u.length-1]}},{key:"arrayTrim",value:function(u,v){var e=u.length;return 0===e||e<v?u:v<0?[]:(u.length=parseInt(v,10),u)}},{key:"arrayUnique",value:function(){var u;return T(new Set((u=[]).concat.apply(u,arguments)))}},{key:"mergeMaps",value:function(){for(var u=arguments.length,v=new Array(u),e=0;e<u;e++)v[e]=arguments[e];return new Map(v.reduce(function(i,r){return i.concat(T(r))},[]))}},{key:"objectKeyLookup",value:function(u,v){var e=Object.entries(u).find(function(r){return r[1]===v}),i=null;return void 0!==e&&(i=e[0]),i}},{key:"insertAt",value:function(u,v,e){if(e>(u=String(u)).length)throw new Error("The given index is out of the string range.");if(1!==v.length)throw new Error("The given string `char` should be only one character long.");return""===u&&0===e?v:"".concat(u.slice(0,e)).concat(v).concat(u.slice(e))}},{key:"scientificToDecimal",value:function(u){var v=Number(u);if(isNaN(v))return NaN;if(u=String(u),!this.contains(u,"e")&&!this.contains(u,"E"))return u;var e=S(u.split(/e/i),2),i=e[0],r=e[1],h=i<0;h&&(i=i.replace("-",""));var _=+r<0;_&&(r=r.replace("-",""));var c,N=S(i.split(/\./),2),I=N[0],G=N[1];return c=_?(c=I.length>r?this.insertAt(I,".",I.length-r):"0.".concat("0".repeat(r-I.length)).concat(I),"".concat(c).concat(G||"")):G?(i="".concat(I).concat(G),r<G.length?this.insertAt(i,".",+r+I.length):"".concat(i).concat("0".repeat(r-G.length))):(i=i.replace(".",""),"".concat(i).concat("0".repeat(Number(r)))),h&&(c="-".concat(c)),c}}]),o}(),g=function(){function o(u){if(function(v){if(!(v instanceof o))throw new TypeError("Cannot call a class as a function")}(this),null===u)throw new Error("Invalid AST")}return function(u,v){for(var e=0;e<v.length;e++){var i=v[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}(o.prototype,[{key:"evaluate",value:function(u){if(null==u)throw new Error("Invalid AST sub-tree");if("number"===u.type)return u.value;if("unaryMinus"===u.type)return-this.evaluate(u.left);var v=this.evaluate(u.left),e=this.evaluate(u.right);switch(u.type){case"op_+":return Number(v)+Number(e);case"op_-":return v-e;case"op_*":return v*e;case"op_/":return v/e;default:throw new Error("Invalid operator '".concat(u.type,"'"))}}}]),o}(),w=function(){function o(){!function(u){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}(this)}return function(u,v){for(var e=0;e<v.length;e++){var i=v[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}(o,[{key:"createNode",value:function(u,v,e){var i=new o;return i.type=u,i.left=v,i.right=e,i}},{key:"createUnaryNode",value:function(u){var v=new o;return v.type="unaryMinus",v.left=u,v.right=null,v}},{key:"createLeaf",value:function(u){var v=new o;return v.type="number",v.value=u,v}}]),o}();function O(o,u,v){(function(e){if(!(e instanceof O))throw new TypeError("Cannot call a class as a function")})(this),this.type=o,this.value=u,this.symbol=v}var U=function(){function o(u){(function(v){if(!(v instanceof o))throw new TypeError("Cannot call a class as a function")})(this),this.text=u,this.textLength=u.length,this.index=0,this.token=new O("Error",0,0)}return function(u,v){for(var e=0;e<v.length;e++){var i=v[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}(o.prototype,[{key:"_skipSpaces",value:function(){for(;" "===this.text[this.index]&&this.index<=this.textLength;)this.index++}},{key:"getIndex",value:function(){return this.index}},{key:"getNextToken",value:function(u){var v=0<arguments.length&&void 0!==u?u:".";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(v),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(u){this._skipSpaces();for(var v=this.index;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===u&&this.index++;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;if(this.index===v)throw new Error("No number has been found while it was expected");return this.text.substring(v,this.index).replace(u,".")}}]),o}(),j=function(){function o(u){var v=1<arguments.length&&void 0!==arguments[1]?arguments[1]:".";return function(e){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),this.text=u,this.decimalCharacter=v,this.lexer=new U(u),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}return function(u,v){for(var e=0;e<v.length;e++){var i=v[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}(o.prototype,[{key:"_exp",value:function(){var u=this._term(),v=this._moreExp();return w.createNode("op_+",u,v)}},{key:"_moreExp",value:function(){var u,v;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),u=this._term(),v=this._moreExp(),w.createNode("op_+",v,u);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),u=this._term(),v=this._moreExp(),w.createNode("op_-",v,u)}return w.createLeaf(0)}},{key:"_term",value:function(){var u=this._factor(),v=this._moreTerms();return w.createNode("op_*",u,v)}},{key:"_moreTerms",value:function(){var u,v;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),u=this._factor(),v=this._moreTerms(),w.createNode("op_*",v,u);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),u=this._factor(),v=this._moreTerms(),w.createNode("op_/",v,u)}return w.createLeaf(1)}},{key:"_factor",value:function(){var u,v,e;switch(this.token.type){case"num":return e=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),w.createLeaf(e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),v=this._factor(),w.createUnaryNode(v);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),u=this._exp(),this._match(")"),u;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(u){var v=this.lexer.getIndex()-1;if(this.text[v]!==u)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(v,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}]),o}();function z(o){return function(u){if(Array.isArray(u))return se(u)}(o)||function(u){if(typeof Symbol<"u"&&Symbol.iterator in Object(u))return Array.from(u)}(o)||ce(o)||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 H(o,u){return function(v){if(Array.isArray(v))return v}(o)||function(v,e){if(typeof Symbol<"u"&&Symbol.iterator in Object(v)){var i=[],r=!0,h=!1,_=void 0;try{for(var c,N=v[Symbol.iterator]();!(r=(c=N.next()).done)&&(i.push(c.value),!e||i.length!==e);r=!0);}catch(I){h=!0,_=I}finally{try{r||null==N.return||N.return()}finally{if(h)throw _}}return i}}(o,u)||ce(o,u)||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 ce(o,u){if(o){if("string"==typeof o)return se(o,u);var v=Object.prototype.toString.call(o).slice(8,-1);return"Object"===v&&o.constructor&&(v=o.constructor.name),"Map"===v||"Set"===v?Array.from(v):"Arguments"===v||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?se(o,u):void 0}}function se(o,u){(null==u||u>o.length)&&(u=o.length);for(var v=0,e=new Array(u);v<u;v++)e[v]=o[v];return e}function ie(){return(ie=Object.assign||function(o){for(var u=1;u<arguments.length;u++){var v=arguments[u];for(var e in v)Object.prototype.hasOwnProperty.call(v,e)&&(o[e]=v[e])}return o}).apply(this,arguments)}function he(o){return(he="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})(o)}function we(o,u){for(var v=0;v<u.length;v++){var e=u[v];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(o,e.key,e)}}var Q,x=function(){function o(){var e=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,h=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;!function(b){if(!(b instanceof o))throw new TypeError("Cannot call a class as a function")}(this);var _=o._setArgumentsValues(i,r,h),N=_.initialValue,I=_.userOptions;if(this.domElement=_.domElement,this.defaultRawValue="",this._setSettings(I,!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(N);else{var G;if(n.isNull(N))switch(this.settings.emptyInputBehavior){case o.options.emptyInputBehavior.min:G=this.settings.minimumValue;break;case o.options.emptyInputBehavior.max:G=this.settings.maximumValue;break;case o.options.emptyInputBehavior.zero:G="0";break;case o.options.emptyInputBehavior.focus:case o.options.emptyInputBehavior.press:case o.options.emptyInputBehavior.always:case o.options.emptyInputBehavior.null:G="";break;default:G=this.settings.emptyInputBehavior}else G=N;this._setElementAndRawValue(G)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(N),this.sessionStorageAvailable=this.constructor._storageTest(),this.storageNamePrefix="AUTO_",this._setPersistentStorageName(),this.validState=!0,this.isFocused=!1,this.isWheelEvent=!1,this.isDropEvent=!1,this.isEditing=!1,this.rawValueOnFocus=void 0,this.internalModification=!1,this.attributeToWatch=this._getAttributeToWatch(),this.getterSetter=Object.getOwnPropertyDescriptor(this.domElement.__proto__,this.attributeToWatch),this._addWatcher(),this.settings.createLocalList&&this._createLocalList(),this.constructor._addToGlobalList(this),this.global={set:function(b,B){var R=1<arguments.length&&void 0!==B?B:null;e.autoNumericLocalList.forEach(function(Z){Z.set(b,R)})},setUnformatted:function(b,B){var R=1<arguments.length&&void 0!==B?B:null;e.autoNumericLocalList.forEach(function(Z){Z.setUnformatted(b,R)})},get:function(b){var B=0<arguments.length&&void 0!==b?b:null,R=[];return e.autoNumericLocalList.forEach(function(Z){R.push(Z.get())}),e._executeCallback(R,B),R},getNumericString:function(b){var B=0<arguments.length&&void 0!==b?b:null,R=[];return e.autoNumericLocalList.forEach(function(Z){R.push(Z.getNumericString())}),e._executeCallback(R,B),R},getFormatted:function(b){var B=0<arguments.length&&void 0!==b?b:null,R=[];return e.autoNumericLocalList.forEach(function(Z){R.push(Z.getFormatted())}),e._executeCallback(R,B),R},getNumber:function(b){var B=0<arguments.length&&void 0!==b?b:null,R=[];return e.autoNumericLocalList.forEach(function(Z){R.push(Z.getNumber())}),e._executeCallback(R,B),R},getLocalized:function(b){var B=0<arguments.length&&void 0!==b?b:null,R=[];return e.autoNumericLocalList.forEach(function(Z){R.push(Z.getLocalized())}),e._executeCallback(R,B),R},reformat:function(){e.autoNumericLocalList.forEach(function(b){b.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(b){b.unformat()})},unformatLocalized:function(b){var B=0<arguments.length&&void 0!==b?b:null;e.autoNumericLocalList.forEach(function(R){R.unformatLocalized(B)})},update:function(){for(var b=arguments.length,B=new Array(b),R=0;R<b;R++)B[R]=arguments[R];e.autoNumericLocalList.forEach(function(Z){Z.update.apply(Z,B)})},isPristine:function(){var b=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],B=!0;return e.autoNumericLocalList.forEach(function(R){B&&!R.isPristine(b)&&(B=!1)}),B},clear:function(b){var B=0<arguments.length&&void 0!==b&&b;e.autoNumericLocalList.forEach(function(R){R.clear(B)})},remove:function(){e.autoNumericLocalList.forEach(function(b){b.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(b){b.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(b){b.nuke()})},has:function(b){return e.autoNumericLocalList.has(b instanceof o?b.node():b)},addObject:function(b){var B,R;R=b instanceof o?(B=b.node(),b):o.getAutoNumericElement(B=b),e._hasLocalList()||e._createLocalList();var Z,q=R._getLocalList();0===q.size&&(R._createLocalList(),q=R._getLocalList()),(Z=q instanceof Map?n.mergeMaps(e._getLocalList(),q):(e._addToLocalList(B,R),e._getLocalList())).forEach(function(W){W._setLocalList(Z)})},removeObject:function(b,B){var R,Z,q=1<arguments.length&&void 0!==B&&B;Z=b instanceof o?(R=b.node(),b):o.getAutoNumericElement(R=b);var W=e.autoNumericLocalList;e.autoNumericLocalList.delete(R),W.forEach(function(X){X._setLocalList(e.autoNumericLocalList)}),q||R!==e.node()?Z._createLocalList():Z._setLocalList(new Map)},empty:function(b){var B=0<arguments.length&&void 0!==b&&b;e.autoNumericLocalList.forEach(function(R){B?R._createLocalList():R._setLocalList(new Map)})},elements:function(){var b=[];return e.autoNumericLocalList.forEach(function(B){b.push(B.node())}),b},getList:function(){return e.autoNumericLocalList},size:function(){return e.autoNumericLocalList.size}},this.options={reset:function(){return e.settings={rawValue:e.defaultRawValue},e.update(o.defaultSettings),e},allowDecimalPadding:function(b){return e.update({allowDecimalPadding:b}),e},alwaysAllowDecimalCharacter:function(b){return e.update({alwaysAllowDecimalCharacter:b}),e},caretPositionOnFocus:function(b){return e.settings.caretPositionOnFocus=b,e},createLocalList:function(b){return e.settings.createLocalList=b,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(b){return e.update({currencySymbol:b}),e},currencySymbolPlacement:function(b){return e.update({currencySymbolPlacement:b}),e},decimalCharacter:function(b){return e.update({decimalCharacter:b}),e},decimalCharacterAlternative:function(b){return e.settings.decimalCharacterAlternative=b,e},decimalPlaces:function(b){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:b}),e},decimalPlacesRawValue:function(b){return e.update({decimalPlacesRawValue:b}),e},decimalPlacesShownOnBlur:function(b){return e.update({decimalPlacesShownOnBlur:b}),e},decimalPlacesShownOnFocus:function(b){return e.update({decimalPlacesShownOnFocus:b}),e},defaultValueOverride:function(b){return e.update({defaultValueOverride:b}),e},digitalGroupSpacing:function(b){return e.update({digitalGroupSpacing:b}),e},digitGroupSeparator:function(b){return e.update({digitGroupSeparator:b}),e},divisorWhenUnfocused:function(b){return e.update({divisorWhenUnfocused:b}),e},emptyInputBehavior:function(b){return null===e.rawValue&&b!==o.options.emptyInputBehavior.null&&(n.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(b,"), 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:b}),e},eventBubbles:function(b){return e.settings.eventBubbles=b,e},eventIsCancelable:function(b){return e.settings.eventIsCancelable=b,e},failOnUnknownOption:function(b){return e.settings.failOnUnknownOption=b,e},formatOnPageLoad:function(b){return e.settings.formatOnPageLoad=b,e},formulaMode:function(b){return e.settings.formulaMode=b,e},historySize:function(b){return e.settings.historySize=b,e},invalidClass:function(b){return e.settings.invalidClass=b,e},isCancellable:function(b){return e.settings.isCancellable=b,e},leadingZero:function(b){return e.update({leadingZero:b}),e},maximumValue:function(b){return e.update({maximumValue:b}),e},minimumValue:function(b){return e.update({minimumValue:b}),e},modifyValueOnWheel:function(b){return e.settings.modifyValueOnWheel=b,e},negativeBracketsTypeOnBlur:function(b){return e.update({negativeBracketsTypeOnBlur:b}),e},negativePositiveSignPlacement:function(b){return e.update({negativePositiveSignPlacement:b}),e},negativeSignCharacter:function(b){return e.update({negativeSignCharacter:b}),e},noEventListeners:function(b){return b===o.options.noEventListeners.noEvents&&e.settings.noEventListeners===o.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:b}),e},onInvalidPaste:function(b){return e.settings.onInvalidPaste=b,e},outputFormat:function(b){return e.settings.outputFormat=b,e},overrideMinMaxLimits:function(b){return e.update({overrideMinMaxLimits:b}),e},positiveSignCharacter:function(b){return e.update({positiveSignCharacter:b}),e},rawValueDivisor:function(b){return e.update({rawValueDivisor:b}),e},readOnly:function(b){return e.settings.readOnly=b,e._setWritePermissions(),e},roundingMethod:function(b){return e.update({roundingMethod:b}),e},saveValueToSessionStorage:function(b){return e.update({saveValueToSessionStorage:b}),e},symbolWhenUnfocused:function(b){return e.update({symbolWhenUnfocused:b}),e},selectNumberOnly:function(b){return e.settings.selectNumberOnly=b,e},selectOnFocus:function(b){return e.settings.selectOnFocus=b,e},serializeSpaces:function(b){return e.settings.serializeSpaces=b,e},showOnlyNumbersOnFocus:function(b){return e.update({showOnlyNumbersOnFocus:b}),e},showPositiveSign:function(b){return e.update({showPositiveSign:b}),e},showWarnings:function(b){return e.settings.showWarnings=b,e},styleRules:function(b){return e.update({styleRules:b}),e},suffixText:function(b){return e.update({suffixText:b}),e},unformatOnHover:function(b){return e.settings.unformatOnHover=b,e},unformatOnSubmit:function(b){return e.settings.unformatOnSubmit=b,e},valuesToStrings:function(b){return e.update({valuesToStrings:b}),e},watchExternalChanges:function(b){return e.update({watchExternalChanges:b}),e},wheelOn:function(b){return e.settings.wheelOn=b,e},wheelStep:function(b){return e.settings.wheelStep=b,e}},this._triggerEvent(o.events.initialized,this.domElement,{newValue:n.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var u,v;return v=[{key:"version",value:function(){return"4.6.0"}},{key:"_setArgumentsValues",value:function(e,i,r){n.isNull(e)&&n.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var h,_,c,N=n.isElement(e),I=n.isString(e),G=n.isObject(i),b=Array.isArray(i)&&0<i.length,B=n.isNumberOrArabic(i)||""===i,R=this._isPreDefinedOptionValid(i),Z=n.isNull(i),q=n.isEmptyString(i),W=n.isObject(r),X=Array.isArray(r)&&0<r.length,re=n.isNull(r),ue=this._isPreDefinedOptionValid(r);return N&&Z&&re?(h=e,_=c=null):N&&B&&re?(h=e,c=i,_=null):N&&G&&re?(h=e,c=null,_=i):N&&R&&re?(h=e,c=null,_=this._getOptionObject(i)):N&&b&&re?(h=e,c=null,_=this.mergeOptions(i)):N&&(Z||q)&&W?(h=e,c=null,_=r):N&&(Z||q)&&X?(h=e,c=null,_=this.mergeOptions(r)):I&&Z&&re?(h=document.querySelector(e),_=c=null):I&&G&&re?(h=document.querySelector(e),c=null,_=i):I&&R&&re?(h=document.querySelector(e),c=null,_=this._getOptionObject(i)):I&&b&&re?(h=document.querySelector(e),c=null,_=this.mergeOptions(i)):I&&(Z||q)&&W?(h=document.querySelector(e),c=null,_=r):I&&(Z||q)&&X?(h=document.querySelector(e),c=null,_=this.mergeOptions(r)):I&&B&&re?(h=document.querySelector(e),c=i,_=null):I&&B&&W?(h=document.querySelector(e),c=i,_=r):I&&B&&ue?(h=document.querySelector(e),c=i,_=this._getOptionObject(r)):I&&B&&X?(h=document.querySelector(e),c=i,_=this.mergeOptions(r)):N&&B&&W?(h=e,c=i,_=r):N&&B&&ue?(h=e,c=i,_=this._getOptionObject(r)):N&&B&&X?(h=e,c=i,_=this.mergeOptions(r)):n.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(i,"' and '").concat(r,"' given.")),n.isNull(h)&&n.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:h,initialValue:c,userOptions:_}}},{key:"mergeOptions",value:function(e){var i=this,r={};return e.forEach(function(h){ie(r,i._getOptionObject(h))}),r}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(o.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var i;return n.isString(e)?null==(i=o.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=he(window.aNFormHandlerMap);return"undefined"!==e&&"object"===e}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,i){return n.isInArray(String(e),i)}},{key:"_checkValuesToStringsSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.keys(i.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.values(i.valuesToStrings))}},{key:"_unformatAltHovered",value:function(e){e.hoveredWithAlt=!0,e.unformat()}},{key:"_reformatAltHovered",value:function(e){e.hoveredWithAlt=!1,e.reformat()}},{key:"_getChildANInputElement",value:function(e){var i=this,r=e.getElementsByTagName("input"),h=[];return Array.prototype.slice.call(r,0).forEach(function(_){i.test(_)&&h.push(_)}),h}},{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=he(window[this.autoNumericGlobalListName]);return"undefined"!==e&&"object"===e}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var i=e.node();if(this._isInGlobalList(i)){if(this._getFromGlobalList(i)===this)return;n.warning("A reference to the DOM element you just initialized already exists in the global AutoNumeric element list. Please make sure to not initialize the same DOM element multiple times.",e.getSettings().showWarnings)}window[this.autoNumericGlobalListName].set(i,e)}},{key:"_removeFromGlobalList",value:function(e){this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].delete(e.node())}},{key:"_getFromGlobalList",value:function(e){return this._doesGlobalListExists()?window[this.autoNumericGlobalListName].get(e):null}},{key:"_isInGlobalList",value:function(e){return!!this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].has(e)}},{key:"validate",value:function(e,i,r){var h=!(1<arguments.length&&void 0!==i)||i,_=2<arguments.length&&void 0!==r?r:null;!n.isUndefinedOrNullOrEmpty(e)&&n.isObject(e)||n.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var c,N=n.isObject(_);N||n.isNull(_)||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),c=h?ie({},this.getDefaultConfig(),e):e,n.isTrueOrFalseString(c.showWarnings)||n.isBoolean(c.showWarnings)||n.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(c.showWarnings,"] given."));var I,G=/^[0-9]+$/,b=/[0-9]+/,B=/^-?[0-9]+(\.?[0-9]+)?$/,R=/^[0-9]+(\.?[0-9]+)?$/;n.isTrueOrFalseString(c.allowDecimalPadding)||n.isBoolean(c.allowDecimalPadding)||c.allowDecimalPadding===o.options.allowDecimalPadding.floats||n.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true` or `'floats'`, [".concat(c.allowDecimalPadding,"] given.")),c.allowDecimalPadding!==o.options.allowDecimalPadding.never&&"false"!==c.allowDecimalPadding||c.decimalPlaces===o.options.decimalPlaces.none&&c.decimalPlacesShownOnBlur===o.options.decimalPlacesShownOnBlur.none&&c.decimalPlacesShownOnFocus===o.options.decimalPlacesShownOnFocus.none||n.warning("Setting 'allowDecimalPadding' to [".concat(c.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(c.decimalPlaces,", ").concat(c.decimalPlacesShownOnBlur," and ").concat(c.decimalPlacesShownOnFocus,"]."),c.showWarnings),n.isTrueOrFalseString(c.alwaysAllowDecimalCharacter)||n.isBoolean(c.alwaysAllowDecimalCharacter)||n.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(c.alwaysAllowDecimalCharacter,"] given.")),n.isNull(c.caretPositionOnFocus)||n.isInArray(c.caretPositionOnFocus,[o.options.caretPositionOnFocus.start,o.options.caretPositionOnFocus.end,o.options.caretPositionOnFocus.decimalLeft,o.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(c.caretPositionOnFocus,"] given.")),I=N?_:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),n.isNull(I)||I.caretPositionOnFocus===o.options.caretPositionOnFocus.doNoForceCaretPosition||I.selectOnFocus!==o.options.selectOnFocus.select||n.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(I.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),c.showWarnings),n.isInArray(c.digitGroupSeparator,[o.options.digitGroupSeparator.comma,o.options.digitGroupSeparator.dot,o.options.digitGroupSeparator.normalSpace,o.options.digitGroupSeparator.thinSpace,o.options.digitGroupSeparator.narrowNoBreakSpace,o.options.digitGroupSeparator.noBreakSpace,o.options.digitGroupSeparator.noSeparator,o.options.digitGroupSeparator.apostrophe,o.options.digitGroupSeparator.arabicThousandsSeparator,o.options.digitGroupSeparator.dotAbove,o.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(c.digitGroupSeparator,"] given.")),n.isTrueOrFalseString(c.showOnlyNumbersOnFocus)||n.isBoolean(c.showOnlyNumbersOnFocus)||n.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(c.showOnlyNumbersOnFocus,"] given.")),n.isInArray(c.digitalGroupSpacing,[o.options.digitalGroupSpacing.two,o.options.digitalGroupSpacing.twoScaled,o.options.digitalGroupSpacing.three,o.options.digitalGroupSpacing.four])||2<=c.digitalGroupSpacing&&c.digitalGroupSpacing<=4||n.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2s', '3', or '4', [".concat(c.digitalGroupSpacing,"] given.")),n.isInArray(c.decimalCharacter,[o.options.decimalCharacter.comma,o.options.decimalCharacter.dot,o.options.decimalCharacter.middleDot,o.options.decimalCharacter.arabicDecimalSeparator,o.options.decimalCharacter.decimalSeparatorKeySymbol])||n.throwError("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '\xb7', '\u2396' or '\u066b', [".concat(c.decimalCharacter,"] given.")),c.decimalCharacter===c.digitGroupSeparator&&n.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(c.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(c.digitGroupSeparator,"] are the same character.")),n.isNull(c.decimalCharacterAlternative)||n.isString(c.decimalCharacterAlternative)||n.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(c.decimalCharacterAlternative,"] given.")),""===c.currencySymbol||n.isString(c.currencySymbol)||n.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(c.currencySymbol,"] given.")),n.isInArray(c.currencySymbolPlacement,[o.options.currencySymbolPlacement.prefix,o.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(c.currencySymbolPlacement,"] given.")),n.isInArray(c.negativePositiveSignPlacement,[o.options.negativePositiveSignPlacement.prefix,o.options.negativePositiveSignPlacement.suffix,o.options.negativePositiveSignPlacement.left,o.options.negativePositiveSignPlacement.right,o.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(c.negativePositiveSignPlacement,"] given.")),n.isTrueOrFalseString(c.showPositiveSign)||n.isBoolean(c.showPositiveSign)||n.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(c.showPositiveSign,"] given.")),n.isString(c.suffixText)&&(""===c.suffixText||!n.isNegative(c.suffixText,c.negativeSignCharacter)&&!b.test(c.suffixText))||n.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(c.negativeSignCharacter,"' nor any numerical characters, [").concat(c.suffixText,"] given.")),n.isString(c.negativeSignCharacter)&&1===c.negativeSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(c.negativeSignCharacter)&&!b.test(c.negativeSignCharacter)||n.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(c.negativeSignCharacter,"] given.")),n.isString(c.positiveSignCharacter)&&1===c.positiveSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(c.positiveSignCharacter)&&!b.test(c.positiveSignCharacter)||n.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(c.positiveSignCharacter,"] given.\nIf you want to hide the positive sign character, you need to set the `showPositiveSign` option to `true`.")),c.negativeSignCharacter===c.positiveSignCharacter&&n.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(c.negativeSignCharacter,"] given."));var Z=H(n.isNull(c.negativeBracketsTypeOnBlur)?["",""]:c.negativeBracketsTypeOnBlur.split(","),2),q=Z[0],W=Z[1];(n.contains(c.digitGroupSeparator,c.negativeSignCharacter)||n.contains(c.decimalCharacter,c.negativeSignCharacter)||n.contains(c.decimalCharacterAlternative,c.negativeSignCharacter)||n.contains(q,c.negativeSignCharacter)||n.contains(W,c.negativeSignCharacter)||n.contains(c.suffixText,c.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(c.negativeSignCharacter,"] given.")),(n.contains(c.digitGroupSeparator,c.positiveSignCharacter)||n.contains(c.decimalCharacter,c.positiveSignCharacter)||n.contains(c.decimalCharacterAlternative,c.positiveSignCharacter)||n.contains(q,c.positiveSignCharacter)||n.contains(W,c.positiveSignCharacter)||n.contains(c.suffixText,c.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(c.positiveSignCharacter,"] given.")),n.isNull(c.overrideMinMaxLimits)||n.isInArray(c.overrideMinMaxLimits,[o.options.overrideMinMaxLimits.ceiling,o.options.overrideMinMaxLimits.floor,o.options.overrideMinMaxLimits.ignore,o.options.overrideMinMaxLimits.invalid])||n.throwError("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor', 'ignore' or 'invalid', [".concat(c.overrideMinMaxLimits,"] given.")),c.overrideMinMaxLimits!==o.options.overrideMinMaxLimits.invalid&&c.overrideMinMaxLimits!==o.options.overrideMinMaxLimits.ignore&&(0<c.minimumValue||c.maximumValue<0)&&n.warning("You've set a `minimumValue` or a `maximumValue` excluding the value `0`. AutoNumeric will force the users to always have a valid value in the input, hence preventing them to clear the field. If you want to allow for temporary invalid values (ie. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),n.isString(c.maximumValue)&&B.test(c.maximumValue)||n.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(c.maximumValue,"] given.")),n.isString(c.minimumValue)&&B.test(c.minimumValue)||n.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(c.minimumValue,"] given.")),parseFloat(c.minimumValue)>parseFloat(c.maximumValue)&&n.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(c.minimumValue,"] should be smaller than 'maximumValue' [").concat(c.maximumValue,"].")),n.isInt(c.decimalPlaces)&&0<=c.decimalPlaces||n.isString(c.decimalPlaces)&&G.test(c.decimalPlaces)||n.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(c.decimalPlaces,"] given.")),n.isNull(c.decimalPlacesRawValue)||n.isInt(c.decimalPlacesRawValue)&&0<=c.decimalPlacesRawValue||n.isString(c.decimalPlacesRawValue)&&G.test(c.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(c.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(c),n.isNull(c.decimalPlacesShownOnFocus)||G.test(String(c.decimalPlacesShownOnFocus))||n.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(c.decimalPlacesShownOnFocus,"] given.")),!n.isNull(c.decimalPlacesShownOnFocus)&&Number(c.decimalPlaces)>Number(c.decimalPlacesShownOnFocus)&&n.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(c.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(c.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?"),c.showWarnings),(n.isNull(c.divisorWhenUnfocused)||R.test(c.divisorWhenUnfocused))&&0!==c.divisorWhenUnfocused&&"0"!==c.divisorWhenUnfocused&&1!==c.divisorWhenUnfocused&&"1"!==c.divisorWhenUnfocused||n.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(c.divisorWhenUnfocused,"] given.")),n.isNull(c.decimalPlacesShownOnBlur)||G.test(c.decimalPlacesShownOnBlur)||n.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(c.decimalPlacesShownOnBlur,"] given.")),n.isNull(c.symbolWhenUnfocused)||n.isString(c.symbolWhenUnfocused)||n.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(c.symbolWhenUnfocused,"] given.")),n.isTrueOrFalseString(c.saveValueToSessionStorage)||n.isBoolean(c.saveValueToSessionStorage)||n.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(c.saveValueToSessionStorage,"] given.")),n.isInArray(c.onInvalidPaste,[o.options.onInvalidPaste.error,o.options.onInvalidPaste.ignore,o.options.onInvalidPaste.clamp,o.options.onInvalidPaste.truncate,o.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(c.onInvalidPaste,"] given.")),n.isInArray(c.roundingMethod,[o.options.roundingMethod.halfUpSymmetric,o.options.roundingMethod.halfUpAsymmetric,o.options.roundingMethod.halfDownSymmetric,o.options.roundingMethod.halfDownAsymmetric,o.options.roundingMethod.halfEvenBankersRounding,o.options.roundingMethod.upRoundAwayFromZero,o.options.roundingMethod.downRoundTowardZero,o.options.roundingMethod.toCeilingTowardPositiveInfinity,o.options.roundingMethod.toFloorTowardNegativeInfinity,o.options.roundingMethod.toNearest05,o.options.roundingMethod.toNearest05Alt,o.options.roundingMethod.upToNext05,o.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(c.roundingMethod,"] given.")),n.isNull(c.negativeBracketsTypeOnBlur)||n.isInArray(c.negativeBracketsTypeOnBlur,[o.options.negativeBracketsTypeOnBlur.parentheses,o.options.negativeBracketsTypeOnBlur.brackets,o.options.negativeBracketsTypeOnBlur.chevrons,o.options.negativeBracketsTypeOnBlur.curlyBraces,o.options.negativeBracketsTypeOnBlur.angleBrackets,o.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,o.options.negativeBracketsTypeOnBlur.halfBrackets,o.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,o.options.negativeBracketsTypeOnBlur.quotationMarks,o.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(c.negativeBracketsTypeOnBlur,"] given.")),(n.isString(c.emptyInputBehavior)||n.isNumber(c.emptyInputBehavior))&&(n.isInArray(c.emptyInputBehavior,[o.options.emptyInputBehavior.focus,o.options.emptyInputBehavior.press,o.options.emptyInputBehavior.always,o.options.emptyInputBehavior.min,o.options.emptyInputBehavior.max,o.options.emptyInputBehavior.zero,o.options.emptyInputBehavior.null])||B.test(c.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(c.emptyInputBehavior,"] given.")),c.emptyInputBehavior===o.options.emptyInputBehavior.zero&&(0<c.minimumValue||c.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(c.minimumValue,", ").concat(c.maximumValue,"].")),B.test(String(c.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(c.emptyInputBehavior,c)||n.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(c.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(c.minimumValue,", ").concat(c.maximumValue,"]."))),n.isTrueOrFalseString(c.eventBubbles)||n.isBoolean(c.eventBubbles)||n.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(c.eventBubbles,"] given.")),n.isTrueOrFalseString(c.eventIsCancelable)||n.isBoolean(c.eventIsCancelable)||n.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(c.eventIsCancelable,"] given.")),!n.isBoolean(c.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(c.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(c.invalidClass,"] given.")),n.isInArray(c.leadingZero,[o.options.leadingZero.allow,o.options.leadingZero.deny,o.options.leadingZero.keep])||n.throwError("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [".concat(c.leadingZero,"] given.")),n.isTrueOrFalseString(c.formatOnPageLoad)||n.isBoolean(c.formatOnPageLoad)||n.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(c.formatOnPageLoad,"] given.")),n.isTrueOrFalseString(c.formulaMode)||n.isBoolean(c.formulaMode)||n.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(c.formulaMode,"] given.")),G.test(c.historySize)&&0!==c.historySize||n.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(c.historySize,"] given.")),n.isTrueOrFalseString(c.selectNumberOnly)||n.isBoolean(c.selectNumberOnly)||n.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(c.selectNumberOnly,"] given.")),n.isTrueOrFalseString(c.selectOnFocus)||n.isBoolean(c.selectOnFocus)||n.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(c.selectOnFocus,"] given.")),n.isNull(c.defaultValueOverride)||""===c.defaultValueOverride||B.test(c.defaultValueOverride)||n.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(c.defaultValueOverride,"] given.")),n.isTrueOrFalseString(c.unformatOnSubmit)||n.isBoolean(c.unformatOnSubmit)||n.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(c.unformatOnSubmit,"] given.")),n.isNull(c.valuesToStrings)||n.isObject(c.valuesToStrings)||n.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(c.valuesToStrings,"] given.")),n.isNull(c.outputFormat)||n.isInArray(c.outputFormat,[o.options.outputFormat.string,o.options.outputFormat.number,o.options.outputFormat.dot,o.options.outputFormat.negativeDot,o.options.outputFormat.comma,o.options.outputFormat.negativeComma,o.options.outputFormat.dotNegative,o.options.outputFormat.commaNegative])||n.throwError("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [".concat(c.outputFormat,"] given.")),n.isTrueOrFalseString(c.isCancellable)||n.isBoolean(c.isCancellable)||n.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(c.isCancellable,"] given.")),n.isTrueOrFalseString(c.modifyValueOnWheel)||n.isBoolean(c.modifyValueOnWheel)||n.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(c.modifyValueOnWheel,"] given.")),n.isTrueOrFalseString(c.watchExternalChanges)||n.isBoolean(c.watchExternalChanges)||n.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(c.watchExternalChanges,"] given.")),n.isInArray(c.wheelOn,[o.options.wheelOn.focus,o.options.wheelOn.hover])||n.throwError("The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [".concat(c.wheelOn,"] given.")),(n.isString(c.wheelStep)||n.isNumber(c.wheelStep))&&("progressive"===c.wheelStep||R.test(c.wheelStep))&&0!==Number(c.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(c.wheelStep,"] given.")),n.isInArray(c.serializeSpaces,[o.options.serializeSpaces.plus,o.options.serializeSpaces.percent])||n.throwError("The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [".concat(c.serializeSpaces,"] given.")),n.isTrueOrFalseString(c.noEventListeners)||n.isBoolean(c.noEventListeners)||n.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(c.noEventListeners,"] given.")),n.isNull(c.styleRules)||n.isObject(c.styleRules)&&(Object.prototype.hasOwnProperty.call(c.styleRules,"positive")||Object.prototype.hasOwnProperty.call(c.styleRules,"negative")||Object.prototype.hasOwnProperty.call(c.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(c.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(c.styleRules,"] given.")),n.isNull(c.styleRules)||!Object.prototype.hasOwnProperty.call(c.styleRules,"userDefined")||n.isNull(c.styleRules.userDefined)||c.styleRules.userDefined.forEach(function(X){Object.prototype.hasOwnProperty.call(X,"callback")&&!n.isFunction(X.callback)&&n.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(he(X.callback)," given."))}),(n.isNull(c.rawValueDivisor)||R.test(c.rawValueDivisor))&&0!==c.rawValueDivisor&&"0"!==c.rawValueDivisor&&1!==c.rawValueDivisor&&"1"!==c.rawValueDivisor||n.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(c.rawValueDivisor,"] given.")),n.isTrueOrFalseString(c.readOnly)||n.isBoolean(c.readOnly)||n.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(c.readOnly,"] given.")),n.isTrueOrFalseString(c.unformatOnHover)||n.isBoolean(c.unformatOnHover)||n.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(c.unformatOnHover,"] given.")),n.isTrueOrFalseString(c.failOnUnknownOption)||n.isBoolean(c.failOnUnknownOption)||n.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(c.failOnUnknownOption,"] given.")),n.isTrueOrFalseString(c.createLocalList)||n.isBoolean(c.createLocalList)||n.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(c.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 o.defaultSettings}},{key:"getPredefinedOptions",value:function(){return o.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var i,r=this;return n.isUndefinedOrNullOrEmpty(e)||0===e.length?i=null:(i={},1===e.length&&Array.isArray(e[0])?e[0].forEach(function(h){ie(i,r._getOptionObject(h))}):1<=e.length&&e.forEach(function(h){ie(i,r._getOptionObject(h))})),i}},{key:"format",value:function(e){if(n.isUndefined(e)||null===e)return null;var i;i=n.isElement(e)?n.getElementValue(e):e,n.isString(i)||n.isNumber(i)||n.throwError('The value "'.concat(i,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var r=arguments.length,h=new Array(1<r?r-1:0),_=1;_<r;_++)h[_-1]=arguments[_];var c=this._generateOptionsObjectFromOptionsArray(h),N=ie({},this.getDefaultConfig(),c);N.isNegativeSignAllowed=i<0,N.isPositiveSignAllowed=0<=i,this._setBrackets(N),this._cachesUsualRegularExpressions(N,{});var I=this._toNumericValue(i,N);return isNaN(Number(I))&&n.throwError("The value [".concat(I,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(I,N)||(n.triggerEvent(o.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(I,"] being set falls outside of the minimumValue [").concat(N.minimumValue,"] and maximumValue [").concat(N.maximumValue,"] range set for this element"))),N.valuesToStrings&&this._checkValuesToStringsSettings(i,N)?N.valuesToStrings[i]:(this._correctNegativePositiveSignPlacementOption(N),this._calculateDecimalPlacesOnInit(N),n.isUndefinedOrNullOrEmpty(N.rawValueDivisor)||0===N.rawValueDivisor||""===I||null===I||(I*=N.rawValueDivisor),I=this._roundFormattedValueShownOnFocus(I,N),I=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(I,N),I=this._addGroupSeparators(I,N,!1,I))}},{key:"formatAndSet",value:function(e,i){var h=this.format(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,h),h}},{key:"unformat",value:function(e){if(n.isNumberStrict(e))return e;var i;if(""===(i=n.isElement(e)?n.getElementValue(e):e))return"";if(n.isUndefined(i)||null===i)return null;(n.isArray(i)||n.isObject(i))&&n.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(i,"] given."));for(var r=arguments.length,h=new Array(1<r?r-1:0),_=1;_<r;_++)h[_-1]=arguments[_];var c=this._generateOptionsObjectFromOptionsArray(h),N=ie({},this.getDefaultConfig(),c);if(N.isNegativeSignAllowed=!1,N.isPositiveSignAllowed=!0,i=i.toString(),N.valuesToStrings&&this._checkStringsToValuesSettings(i,N))return n.objectKeyLookup(N.valuesToStrings,i);if(n.isNegative(i,N.negativeSignCharacter))N.isNegativeSignAllowed=!0,N.isPositiveSignAllowed=!1;else if(!n.isNull(N.negativeBracketsTypeOnBlur)){var I=H(N.negativeBracketsTypeOnBlur.split(","),2);N.firstBracket=I[0],N.lastBracket=I[1],i.charAt(0)===N.firstBracket&&i.charAt(i.length-1)===N.lastBracket&&(N.isNegativeSignAllowed=!0,N.isPositiveSignAllowed=!1,i=this._removeBrackets(i,N,!1))}return i=this._convertToNumericString(i,N),new RegExp("[^+-0123456789.]","gi").test(i)?NaN:(this._correctNegativePositiveSignPlacementOption(N),N.originalDecimalPlacesRawValue=N.decimalPlacesRawValue?N.decimalPlacesRawValue:N.decimalPlaces,this._calculateDecimalPlacesOnInit(N),n.isUndefinedOrNullOrEmpty(N.rawValueDivisor)||0===N.rawValueDivisor||""===i||null===i||(i/=N.rawValueDivisor),i=(i=this._roundRawValue(i,N)).replace(N.decimalCharacter,"."),i=this._toLocale(i,N.outputFormat,N))}},{key:"unformatAndSet",value:function(e,i){var h=this.unformat(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,h),h}},{key:"localize",value:function(e,i){var r,h,_=1<arguments.length&&void 0!==i?i:null;return""===(r=n.isElement(e)?n.getElementValue(e):e)?"":(n.isNull(_)&&(_=o.defaultSettings),r=this.unformat(r,_),0===Number(r)&&_.leadingZero!==o.options.leadingZero.keep&&(r="0"),h=n.isNull(_)?_.outputFormat:o.defaultSettings.outputFormat,this._toLocale(r,h,_))}},{key:"localizeAndSet",value:function(e,i){var h=this.localize(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,h),h}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var i=n.domElement(e);return this.isManagedByAutoNumeric(i)?this._getFromGlobalList(i):null}},{key:"set",value:function(e,i,r,h){var _,c=2<arguments.length&&void 0!==r?r:null,N=!(3<arguments.length&&void 0!==h)||h,I=n.domElement(e);return this.isManagedByAutoNumeric(I)?this.getAutoNumericElement(I).set(i,c,N):(_=!(!n.isNull(c)&&Object.prototype.hasOwnProperty.call(c,"showWarnings"))||c.showWarnings,n.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",_),null)}},{key:"getNumericString",value:function(e,i){return this._get(e,"getNumericString",1<arguments.length&&void 0!==i?i:null)}},{key:"getFormatted",value:function(e,i){return this._get(e,"getFormatted",1<arguments.length&&void 0!==i?i:null)}},{key:"getNumber",value:function(e,i){return this._get(e,"getNumber",1<arguments.length&&void 0!==i?i:null)}},{key:"_get",value:function(e,i,r){var h=2<arguments.length&&void 0!==r?r:null,_=n.domElement(e);return this.isManagedByAutoNumeric(_)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(_)[i](h)}},{key:"getLocalized",value:function(e,i,r){var h=1<arguments.length&&void 0!==i?i:null,_=2<arguments.length&&void 0!==r?r:null,c=n.domElement(e);return this.isManagedByAutoNumeric(c)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(c).getLocalized(h,_)}},{key:"_stripAllNonNumberCharacters",value:function(e,i,r,h){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,r,h).replace(i.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,i,r,h){var _=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(i.allowedAutoStrip,"")).match(i.numRegAutoStrip);if(e=_?[_[1],_[2],_[3]].join(""):"",i.leadingZero===o.options.leadingZero.allow||i.leadingZero===o.options.leadingZero.keep){var c="",N=H(e.split(i.decimalCharacter),2),G=N[1],b=N[0];n.contains(b,i.negativeSignCharacter)&&(c=i.negativeSignCharacter,b=b.replace(i.negativeSignCharacter,"")),""===c&&b.length>i.mIntPos&&"0"===b.charAt(0)&&(b=b.slice(1)),""!==c&&b.length>i.mIntNeg&&"0"===b.charAt(0)&&(b=b.slice(1)),e="".concat(c).concat(b).concat(n.isUndefined(G)?"":i.decimalCharacter+G)}return(r&&i.leadingZero===o.options.leadingZero.deny||!h&&i.leadingZero===o.options.leadingZero.allow)&&(e=e.replace(i.stripReg,"$1$2")),e}},{key:"_toggleNegativeBracket",value:function(e,i,r){return r?this._removeBrackets(e,i):this._addBrackets(e,i)}},{key:"_addBrackets",value:function(e,i){return n.isNull(i.negativeBracketsTypeOnBlur)?e:"".concat(i.firstBracket).concat(e.replace(i.negativeSignCharacter,"")).concat(i.lastBracket)}},{key:"_removeBrackets",value:function(e,i,r){var h,_=!(2<arguments.length&&void 0!==r)||r;return n.isNull(i.negativeBracketsTypeOnBlur)||e.charAt(0)!==i.firstBracket?e:(h=(h=e.replace(i.firstBracket,"")).replace(i.lastBracket,""),_?(h=h.replace(i.currencySymbol,""),this._mergeCurrencySignNegativePositiveSignAndValue(h,i,!0,!1)):"".concat(i.negativeSignCharacter).concat(h))}},{key:"_setBrackets",value:function(e){if(n.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var i=H(e.negativeBracketsTypeOnBlur.split(","),2),h=i[1];e.firstBracket=i[0],e.lastBracket=h}}},{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 h=n.arabicToLatinNumbers(e,i.leadingZero!==o.options.leadingZero.keep,!1,!1);return isNaN(h)||(e=h.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,i){return e=String(e),i.currencySymbol!==o.options.currencySymbol.none&&(e=e.replace(i.currencySymbol,"")),i.suffixText!==o.options.suffixText.none&&(e=e.replace(i.suffixText,"")),i.negativeSignCharacter!==o.options.negativeSignCharacter.hyphen&&(e=e.replace(i.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,i,r){if(n.isNull(i)||i===o.options.outputFormat.string)return e;var h;switch(i){case o.options.outputFormat.number:h=Number(e);break;case o.options.outputFormat.dotNegative:h=n.isNegative(e)?e.replace("-","")+"-":e;break;case o.options.outputFormat.comma:case o.options.outputFormat.negativeComma:h=e.replace(".",",");break;case o.options.outputFormat.commaNegative:h=e.replace(".",","),h=n.isNegative(h)?h.replace("-","")+"-":h;break;case o.options.outputFormat.dot:case o.options.outputFormat.negativeDot:h=e;break;default:n.throwError("The given outputFormat [".concat(i,"] option is not recognized."))}return i!==o.options.outputFormat.number&&"-"!==r.negativeSignCharacter&&(h=h.replace("-",r.negativeSignCharacter)),h}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,i){return"-"!==i.negativeSignCharacter&&(e=e.replace("-",i.negativeSignCharacter)),"."!==i.decimalCharacter&&(e=e.replace(".",i.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,i){return""===e||e===i.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(e,i,r){var h;if(i.emptyInputBehavior===o.options.emptyInputBehavior.always||r)switch(i.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.left:case o.options.negativePositiveSignPlacement.prefix:case o.options.negativePositiveSignPlacement.none:h=e+i.currencySymbol+i.suffixText;break;default:h=i.currencySymbol+e+i.suffixText}else h=e;return h}},{key:"_addGroupSeparators",value:function(e,i,r,h,_){var c,N=4<arguments.length&&void 0!==_?_:null;if(c=n.isNull(N)?n.isNegative(e,i.negativeSignCharacter)||n.isNegativeWithBrackets(e,i.firstBracket,i.lastBracket):N<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,!1,r),this._isElementValueEmptyOrOnlyTheNegativeSign(e,i))return this._orderValueCurrencySymbolAndSuffixText(e,i,!0);var I,G=n.isZeroOrHasNoValue(e);switch(c&&(e=e.replace("-","")),i.digitalGroupSpacing=i.digitalGroupSpacing.toString(),i.digitalGroupSpacing){case o.options.digitalGroupSpacing.two:I=/(\d)((\d)(\d{2}?)+)$/;break;case o.options.digitalGroupSpacing.twoScaled:I=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case o.options.digitalGroupSpacing.four:I=/(\d)((\d{4}?)+)$/;break;default:I=/(\d)((\d{3}?)+)$/}var b,B=H(e.split(i.decimalCharacter),2),R=B[0],Z=B[1];if(i.decimalCharacterAlternative&&n.isUndefined(Z)){var q=H(e.split(i.decimalCharacterAlternative),2);R=q[0],Z=q[1]}if(""!==i.digitGroupSeparator)for(;I.test(R);)R=R.replace(I,"$1".concat(i.digitGroupSeparator,"$2"));return e=0===(b=r?i.decimalPlacesShownOnFocus:i.decimalPlacesShownOnBlur)||n.isUndefined(Z)?R:(Z.length>b&&(Z=Z.substring(0,b)),"".concat(R).concat(i.decimalCharacter).concat(Z)),e=o._mergeCurrencySignNegativePositiveSignAndValue(e,i,c,G),n.isNull(N)&&(N=h),null!==i.negativeBracketsTypeOnBlur&&(N<0||n.isNegativeStrict(e,i.negativeSignCharacter))&&(e=this._toggleNegativeBracket(e,i,r)),i.suffixText?"".concat(e).concat(i.suffixText):e}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(e,i,r,h){var _,c="";if(r?c=i.negativeSignCharacter:i.showPositiveSign&&!h&&(c=i.positiveSignCharacter),i.currencySymbolPlacement===o.options.currencySymbolPlacement.prefix)if(i.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(r||!r&&i.showPositiveSign&&!h))switch(i.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.prefix:case o.options.negativePositiveSignPlacement.left:_="".concat(c).concat(i.currencySymbol).concat(e);break;case o.options.negativePositiveSignPlacement.right:_="".concat(i.currencySymbol).concat(c).concat(e);break;case o.options.negativePositiveSignPlacement.suffix:_="".concat(i.currencySymbol).concat(e).concat(c)}else _=i.currencySymbol+e;else if(i.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix)if(i.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(r||!r&&i.showPositiveSign&&!h))switch(i.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.suffix:case o.options.negativePositiveSignPlacement.right:_="".concat(e).concat(i.currencySymbol).concat(c);break;case o.options.negativePositiveSignPlacement.left:_="".concat(e).concat(c).concat(i.currencySymbol);break;case o.options.negativePositiveSignPlacement.prefix:_="".concat(c).concat(e).concat(i.currencySymbol)}else _=e+i.currencySymbol;return _}},{key:"_truncateZeros",value:function(e,i){var r;switch(i){case 0:r=/(\.(?:\d*[1-9])?)0*$/;break;case 1:r=/(\.\d(?:\d*[1-9])?)0*$/;break;default:r=new RegExp("(\\.\\d{".concat(i,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(r,"$1"),0===i&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,i){return this._roundValue(e,i,i.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,i,r){return r?this._roundFormattedValueShownOnFocus(e,i):this._roundFormattedValueShownOnBlur(e,i)}},{key:"_roundValue",value:function(e,i,r){if(n.isNull(e))return e;if(e=""===e?"0":e.toString(),i.roundingMethod===o.options.roundingMethod.toNearest05||i.roundingMethod===o.options.roundingMethod.toNearest05Alt||i.roundingMethod===o.options.roundingMethod.upToNext05||i.roundingMethod===o.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,i);var h,_=H(o._prepareValueForRounding(e,i),2),c=_[0],N=(e=_[1]).lastIndexOf("."),I=-1===N,G=H(e.split("."),2),b=G[0];if(!(0<G[1]||i.allowDecimalPadding!==o.options.allowDecimalPadding.never&&i.allowDecimalPadding!==o.options.allowDecimalPadding.floats))return 0===Number(e)?b:"".concat(c).concat(b);h=i.allowDecimalPadding===o.options.allowDecimalPadding.always||i.allowDecimalPadding===o.options.allowDecimalPadding.floats?r:0;var B,Z=e.length-1-(I?e.length-1:N),q="";if(Z<=r){if(q=e,Z<h){I&&(q="".concat(q).concat(i.decimalCharacter));for(var W="000000";Z<h;)q+=W=W.substring(0,h-Z),Z+=W.length}else h<Z?q=this._truncateZeros(q,h):0===Z&&0===h&&(q=q.replace(/\.$/,""));return 0===Number(q)?q:"".concat(c).concat(q)}B=I?r-1:Number(r)+Number(N);var X,re=Number(e.charAt(B+1)),ue=e.substring(0,B+1).split("");if(X="."===e.charAt(B)?e.charAt(B-1)%2:e.charAt(B)%2,this._shouldRoundUp(re,i,c,X))for(var ae=ue.length-1;0<=ae;--ae)if("."!==ue[ae]){if(ue[ae]=+ue[ae]+1,ue[ae]<10)break;0<ae&&(ue[ae]="0")}return ue=ue.slice(0,B+1),q=this._truncateZeros(ue.join(""),h),0===Number(q)?q:"".concat(c).concat(q)}},{key:"_roundCloseTo05",value:function(e,i){switch(i.roundingMethod){case o.options.roundingMethod.toNearest05:case o.options.roundingMethod.toNearest05Alt:e=(Math.round(20*e)/20).toString();break;case o.options.roundingMethod.upToNext05:e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}return n.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,i){var r="";return n.isNegativeStrict(e,"-")&&(r="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),0===Number(e)&&(r=""),(0<Number(e)&&i.leadingZero!==o.options.leadingZero.keep||0<e.length&&i.leadingZero===o.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[r,e]}},{key:"_shouldRoundUp",value:function(e,i,r,h){return 4<e&&i.roundingMethod===o.options.roundingMethod.halfUpSymmetric||4<e&&i.roundingMethod===o.options.roundingMethod.halfUpAsymmetric&&""===r||5<e&&i.roundingMethod===o.options.roundingMethod.halfUpAsymmetric&&"-"===r||5<e&&i.roundingMethod===o.options.roundingMethod.halfDownSymmetric||5<e&&i.roundingMethod===o.options.roundingMethod.halfDownAsymmetric&&""===r||4<e&&i.roundingMethod===o.options.roundingMethod.halfDownAsymmetric&&"-"===r||5<e&&i.roundingMethod===o.options.roundingMethod.halfEvenBankersRounding||5===e&&i.roundingMethod===o.options.roundingMethod.halfEvenBankersRounding&&1===h||0<e&&i.roundingMethod===o.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===r||0<e&&i.roundingMethod===o.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===r||0<e&&i.roundingMethod===o.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,i,r,h){r&&(e=this._roundFormattedValueShownOnFocus(e,i));var _=H(e.split(i.decimalCharacter),2),c=_[0],N=_[1];if(N&&N.length>h)if(0<h){var I=N.substring(0,h);e="".concat(c).concat(i.decimalCharacter).concat(I)}else e=c;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,i){if(n.isNull(e)&&i.emptyInputBehavior===o.options.emptyInputBehavior.null||i.overrideMinMaxLimits===o.options.overrideMinMaxLimits.ignore||i.overrideMinMaxLimits===o.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var r,h=n.parseStr(i.minimumValue),_=n.parseStr(i.maximumValue),c=n.parseStr(e);switch(i.overrideMinMaxLimits){case o.options.overrideMinMaxLimits.floor:r=[-1<n.testMinMax(h,c),!0];break;case o.options.overrideMinMaxLimits.ceiling:r=[!0,n.testMinMax(_,c)<1];break;default:r=[-1<n.testMinMax(h,c),n.testMinMax(_,c)<1]}return r}},{key:"_isWithinRangeWithOverrideOption",value:function(e,i){var r=H(this._checkIfInRangeWithOverrideOption(e,i),2);return r[0]&&r[1]}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),n.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,i){return-1<n.testMinMax(n.parseStr(i.minimumValue),this._cleanValueForRangeParse(e))}},{key:"_isMaximumRangeRespected",value:function(e,i){return n.testMinMax(n.parseStr(i.maximumValue),this._cleanValueForRangeParse(e))<1}},{key:"_readCookie",value:function(e){for(var i=e+"=",r=document.cookie.split(";"),h="",_=0;_<r.length;_+=1){for(h=r[_];" "===h.charAt(0);)h=h.substring(1,h.length);if(0===h.indexOf(i))return h.substring(i.length,h.length)}return null}},{key:"_storageTest",value:function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch{return!1}}},{key:"_correctNegativePositiveSignPlacementOption",value:function(e){if(n.isNull(e.negativePositiveSignPlacement))if(n.isUndefined(e)||!n.isUndefinedOrNullOrEmpty(e.negativePositiveSignPlacement)||n.isUndefinedOrNullOrEmpty(e.currencySymbol))e.negativePositiveSignPlacement=o.options.negativePositiveSignPlacement.left;else switch(e.currencySymbolPlacement){case o.options.currencySymbolPlacement.suffix:e.negativePositiveSignPlacement=o.options.negativePositiveSignPlacement.prefix;break;case o.options.currencySymbolPlacement.prefix:e.negativePositiveSignPlacement=o.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(e){return n.isNull(e)?null:(!n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=o.options.selectOnFocus.doNotSelect),n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&e.selectOnFocus===o.options.selectOnFocus.select&&(e.caretPositionOnFocus=o.options.caretPositionOnFocus.doNoForceCaretPosition),e)}},{key:"_calculateDecimalPlacesOnInit",value:function(e){this._validateDecimalPlacesRawValue(e),e.decimalPlacesShownOnFocus===o.options.decimalPlacesShownOnFocus.useDefault&&(e.decimalPlacesShownOnFocus=e.decimalPlaces),e.decimalPlacesShownOnBlur===o.options.decimalPlacesShownOnBlur.useDefault&&(e.decimalPlacesShownOnBlur=e.decimalPlaces),e.decimalPlacesRawValue===o.options.decimalPlacesRawValue.useDefault&&(e.decimalPlacesRawValue=e.decimalPlaces);var i=0;e.rawValueDivisor&&e.rawValueDivisor!==o.options.rawValueDivisor.none&&(i=String(e.rawValueDivisor).length-1)<0&&(i=0),e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+i,Number(e.originalDecimalPlacesRawValue)+i)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;this._validateDecimalPlacesRawValue(e),n.isNull(r)&&n.throwError("When updating the settings, the previous ones should be passed as an argument.");var h="decimalPlaces"in e;if(h||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){h?("decimalPlacesShownOnFocus"in e&&e.decimalPlacesShownOnFocus!==o.options.decimalPlacesShownOnFocus.useDefault||(e.decimalPlacesShownOnFocus=e.decimalPlaces),"decimalPlacesShownOnBlur"in e&&e.decimalPlacesShownOnBlur!==o.options.decimalPlacesShownOnBlur.useDefault||(e.decimalPlacesShownOnBlur=e.decimalPlaces),"decimalPlacesRawValue"in e&&e.decimalPlacesRawValue!==o.options.decimalPlacesRawValue.useDefault||(e.decimalPlacesRawValue=e.decimalPlaces)):(n.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=r.decimalPlacesShownOnFocus),n.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=r.decimalPlacesShownOnBlur));var _=0;e.rawValueDivisor&&e.rawValueDivisor!==o.options.rawValueDivisor.none&&(_=String(e.rawValueDivisor).length-1)<0&&(_=0),e.decimalPlacesRawValue=e.decimalPlaces||e.decimalPlacesRawValue?Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+_,Number(e.decimalPlacesRawValue)+_):Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+_,Number(r.originalDecimalPlacesRawValue)+_)}}},{key:"_cachesUsualRegularExpressions",value:function(e,i){var r;r=e.negativeSignCharacter!==o.options.negativeSignCharacter.hyphen?"([-\\".concat(e.negativeSignCharacter,"]?)"):"(-?)",i.aNegRegAutoStrip=r,e.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(e.decimalCharacter,"]"),"g"),e.numRegAutoStrip=new RegExp("".concat(r,"(?:\\").concat(e.decimalCharacter,"?([0-9]+\\").concat(e.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(e.decimalCharacter,"[0-9]*)?))")),e.stripReg=new RegExp("^".concat(i.aNegRegAutoStrip,"0*([0-9])")),e.formulaChars=new RegExp("[0-9".concat(e.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var i={aSep:"digitGroupSeparator",nSep:"showOnlyNumbersOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"decimalPlacesShownOnBlur",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",allowDecimalPadding:!0,alwaysAllowDecimalCharacter:!0,caretPositionOnFocus:!0,createLocalList:!0,currencySymbol:!0,currencySymbolPlacement:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,decimalPlaces:!0,decimalPlacesRawValue:!0,decimalPlacesShownOnBlur:!0,decimalPlacesShownOnFocus:!0,defaultValueOverride:!0,digitalGroupSpacing:!0,digitGroupSeparator:!0,divisorWhenUnfocused:!0,emptyInputBehavior:!0,eventBubbles:!0,eventIsCancelable:!0,failOnUnknownOption:!0,formatOnPageLoad:!0,formulaMode:!0,historySize:!0,isCancellable:!0,leadingZero:!0,maximumValue:!0,minimumValue:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,noEventListeners:!0,onInvalidPaste:!0,outputFormat:!0,overrideMinMaxLimits:!0,positiveSignCharacter:!0,rawValueDivisor:!0,readOnly:!0,roundingMethod:!0,saveValueToSessionStorage:!0,selectNumberOnly:!0,selectOnFocus:!0,serializeSpaces:!0,showOnlyNumbersOnFocus:!0,showPositiveSign:!0,showWarnings:!0,styleRules:!0,suffixText:!0,symbolWhenUnfocused:!0,unformatOnHover:!0,unformatOnSubmit:!0,valuesToStrings:!0,watchExternalChanges:!0,wheelOn:!0,wheelStep:!0,allowedAutoStrip:!0,formulaChars:!0,isNegativeSignAllowed:!0,isPositiveSignAllowed:!0,mIntNeg:!0,mIntPos:!0,numRegAutoStrip:!0,originalDecimalPlaces:!0,originalDecimalPlacesRawValue:!0,stripReg:!0};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(!0===i[r])continue;Object.prototype.hasOwnProperty.call(i,r)?(n.warning("You are using the deprecated option name '".concat(r,"'. Please use '").concat(i[r],"' instead from now on. The old option name will be dropped very soon\u2122."),!0),e[i[r]]=e[r],delete e[r]):e.failOnUnknownOption&&n.throwError("Option name '".concat(r,"' is unknown. Please fix the options passed to autoNumeric"))}"mDec"in e&&n.warning("The old `mDec` option has been deprecated in favor of more accurate options ; `decimalPlaces`, `decimalPlacesRawValue`, `decimalPlacesShownOnFocus` and `decimalPlacesShownOnBlur`.",!0)}},{key:"_setNegativePositiveSignPermissions",value:function(e){e.isNegativeSignAllowed=e.minimumValue<0,e.isPositiveSignAllowed=0<=e.maximumValue}},{key:"_toNumericValue",value:function(e,i){var r;return n.isNumber(Number(e))?r=n.scientificToDecimal(e):(r=this._convertToNumericString(e.toString(),i),n.isNumber(Number(r))||(n.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),i.showWarnings),r=NaN)),r}},{key:"_checkIfInRange",value:function(e,i,r){var h=n.parseStr(e);return-1<n.testMinMax(i,h)&&n.testMinMax(r,h)<1}},{key:"_shouldSkipEventKey",value:function(e){var i=n.isInArray(e,E.keyName._allFnKeys),r=e===E.keyName.OSLeft||e===E.keyName.OSRight,h=e===E.keyName.ContextMenu,_=n.isInArray(e,E.keyName._someNonPrintableKeys);return i||r||h||_||e===E.keyName.Unidentified||e===E.keyName.NumLock||e===E.keyName.ScrollLock||e===E.keyName.Insert||e===E.keyName.Command}},{key:"_serialize",value:function(e,i,r,h,_){var c,N=this,I=1<arguments.length&&void 0!==i&&i,G=2<arguments.length&&void 0!==r?r:"unformatted",b=3<arguments.length&&void 0!==h?h:"+",B=4<arguments.length&&void 0!==_?_:null,R=[];return"object"===he(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(re){re.selected&&R.push(I?{name:Z.name,value:re.value}:"".concat(encodeURIComponent(Z.name),"=").concat(encodeURIComponent(re.value)))});else if(-1===["checkbox","radio"].indexOf(Z.type)||Z.checked){var q,W;if(N.isManagedByAutoNumeric(Z))switch(G){case"unformatted":W=N.getAutoNumericElement(Z),n.isNull(W)||(q=N.unformat(Z,W.getSettings()));break;case"localized":if(W=N.getAutoNumericElement(Z),!n.isNull(W)){var X=n.cloneObject(W.getSettings());n.isNull(B)||(X.outputFormat=B),q=N.localize(Z,X)}break;default:q=Z.value}else q=Z.value;n.isUndefined(q)&&n.throwError("This error should never be hit. If it has, something really wrong happened!"),R.push(I?{name:Z.name,value:q}:"".concat(encodeURIComponent(Z.name),"=").concat(encodeURIComponent(q)))}}),I?c=R:(c=R.join("&"),"+"===b&&(c=c.replace(/%20/g,"+"))),c}},{key:"_serializeNumericString",value:function(e,i){return this._serialize(e,!1,"unformatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeFormatted",value:function(e,i){return this._serialize(e,!1,"formatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeLocalized",value:function(e,i,r){return this._serialize(e,!1,"localized",1<arguments.length&&void 0!==i?i:"+",2<arguments.length&&void 0!==r?r:null)}},{key:"_serializeNumericStringArray",value:function(e,i){return this._serialize(e,!0,"unformatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeFormattedArray",value:function(e,i){return this._serialize(e,!0,"formatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeLocalizedArray",value:function(e,i,r){return this._serialize(e,!0,"localized",1<arguments.length&&void 0!==i?i:"+",2<arguments.length&&void 0!==r?r:null)}}],we((u=o).prototype,[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=n.scientificToDecimal(this.domElement.getAttribute("value")),n.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,n.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this._onFocusInFunc=function(i){e._onFocusIn(i)},this._onFocusInAndMouseEnterFunc=function(i){e._onFocusInAndMouseEnter(i)},this._onFocusFunc=function(){e._onFocus()},this._onKeydownFunc=function(i){e._onKeydown(i)},this._onKeypressFunc=function(i){e._onKeypress(i)},this._onKeyupFunc=function(i){e._onKeyup(i)},this._onFocusOutAndMouseLeaveFunc=function(i){e._onFocusOutAndMouseLeave(i)},this._onPasteFunc=function(i){e._onPaste(i)},this._onWheelFunc=function(i){e._onWheel(i)},this._onDropFunc=function(i){e._onDrop(i)},this._onKeydownGlobalFunc=function(i){e._onKeydownGlobal(i)},this._onKeyupGlobalFunc=function(i){e._onKeyupGlobal(i)},this.domElement.addEventListener("focusin",this._onFocusInFunc,!1),this.domElement.addEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("focus",this._onFocusFunc,!1),this.domElement.addEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("keydown",this._onKeydownFunc,!1),this.domElement.addEventListener("keypress",this._onKeypressFunc,!1),this.domElement.addEventListener("keyup",this._onKeyupFunc,!1),this.domElement.addEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("paste",this._onPasteFunc,!1),this.domElement.addEventListener("wheel",this._onWheelFunc,!1),this.domElement.addEventListener("drop",this._onDropFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,o._doesGlobalListExists()||(document.addEventListener("keydown",this._onKeydownGlobalFunc,!1),document.addEventListener("keyup",this._onKeyupGlobalFunc,!1))}},{key:"_removeEventListeners",value:function(){this.domElement.removeEventListener("focusin",this._onFocusInFunc,!1),this.domElement.removeEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("focus",this._onFocusFunc,!1),this.domElement.removeEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("keydown",this._onKeydownFunc,!1),this.domElement.removeEventListener("keypress",this._onKeypressFunc,!1),this.domElement.removeEventListener("keyup",this._onKeyupFunc,!1),this.domElement.removeEventListener("paste",this._onPasteFunc,!1),this.domElement.removeEventListener("wheel",this._onWheelFunc,!1),this.domElement.removeEventListener("drop",this._onDropFunc,!1),this._removeFormListener(),this.hasEventListeners=!1,document.removeEventListener("keydown",this._onKeydownGlobalFunc,!1),document.removeEventListener("keyup",this._onKeyupGlobalFunc,!1)}},{key:"_updateEventListeners",value:function(){this.settings.noEventListeners||this.hasEventListeners||this._createEventListeners(),this.settings.noEventListeners&&this.hasEventListeners&&this._removeEventListeners()}},{key:"_setupFormListener",value:function(){var e=this;n.isNull(this.parentForm)||(this._onFormSubmitFunc=function(){e._onFormSubmit()},this._onFormResetFunc=function(){e._onFormReset()},this._hasParentFormCounter()?this._incrementParentFormCounter():(this._initializeFormCounterToOne(),this.parentForm.addEventListener("submit",this._onFormSubmitFunc,!1),this.parentForm.addEventListener("reset",this._onFormResetFunc,!1),this._storeFormHandlerFunction()))}},{key:"_removeFormListener",value:function(){if(!n.isNull(this.parentForm)){var e=this._getParentFormCounter();1===e?(this.parentForm.removeEventListener("submit",this._getFormHandlerFunction().submitFn,!1),this.parentForm.removeEventListener("reset",this._getFormHandlerFunction().resetFn,!1),this._removeFormDataSetInfo()):1<e?this._decrementParentFormCounter():n.throwError("The AutoNumeric object count on the form is incoherent.")}}},{key:"_hasParentFormCounter",value:function(){return"anCount"in this.parentForm.dataset}},{key:"_getParentFormCounter",value:function(){return Number(this.parentForm.dataset.anCount)}},{key:"_initializeFormCounterToOne",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(e){return"anFormHandler"in this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset}},{key:"_getFormElement",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?this.parentForm:i}},{key:"_storeFormHandlerFunction",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var r=n.randomString();this._getFormElement(i).dataset.anFormHandler=r,window.aNFormHandlerMap.set(r,{submitFn:this._onFormSubmitFunc,resetFn:this._onFormResetFunc})}},{key:"_getFormHandlerKey",value:function(){this._hasFormHandlerFunction()||n.throwError("Unable to retrieve the form handler name");var e=this.parentForm.dataset.anFormHandler;return""===e&&n.throwError("The form handler name is invalid"),e}},{key:"_getFormHandlerFunction",value:function(){var e=this._getFormHandlerKey();return window.aNFormHandlerMap.get(e)}},{key:"_removeFormDataSetInfo",value:function(){this._decrementParentFormCounter(),window.aNFormHandlerMap.delete(this._getFormHandlerKey()),this.parentForm.removeAttribute("data-an-count"),this.parentForm.removeAttribute("data-an-form-handler")}},{key:"_setWritePermissions",value:function(e){0<arguments.length&&void 0!==e&&e&&this.domElement.readOnly||this.settings.readOnly?this._setReadOnly():this._setReadWrite()}},{key:"_setReadOnly",value:function(){this.isInputElement?this.domElement.readOnly=!0:this.domElement.setAttribute("contenteditable",!1)}},{key:"_setReadWrite",value:function(){this.isInputElement?this.domElement.readOnly=!1:this.domElement.setAttribute("contenteditable",!0)}},{key:"_addWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,r=i.set,h=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return h.call(e.domElement)},set:function(_){r.call(e.domElement,_),e.settings.watchExternalChanges&&!e.internalModification&&e.set(_)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,r=i.set,h=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return h.call(e.domElement)},set:function(_){r.call(e.domElement,_)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var i=this.domElement.nodeType;i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":i===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=0===this.historyTable.length;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var i=!0;if(!e){var r=this.historyTableIndex+1;r<this.historyTable.length&&this.rawValue===this.historyTable[r].value?i=!1:n.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,i){var h=n.getElementSelection(this.domElement);this.selectionStart=h.start,this.selectionEnd=h.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),1<this.historyTable.length&&(this.historyTable[this.historyTableIndex-1].start=this.selectionStart,this.historyTable[this.historyTableIndex-1].end=this.selectionEnd)}this.historyTable.length>this.settings.historySize&&this._historyTableForget()}}},{key:"_historyTableUndoOrRedo",value:function(e){var i;if(0<arguments.length&&void 0!==e&&!e?(i=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(i=0<this.historyTableIndex)&&this.historyTableIndex--,i){var r=this.historyTable[this.historyTableIndex];this.set(r.value,null,!1),n.setElementSelection(this.domElement,r.start,r.end)}}},{key:"_historyTableUndo",value:function(){this._historyTableUndoOrRedo(!0)}},{key:"_historyTableRedo",value:function(){this._historyTableUndoOrRedo(!1)}},{key:"_historyTableForget",value:function(e){for(var i=0<arguments.length&&void 0!==e?e:1,r=[],h=0;h<i;h++)r.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return 1===r.length?r[0]:r}},{key:"_historyTableCurrentValueUsed",value:function(){var e=this.historyTableIndex;return e<0&&(e=0),n.isUndefinedOrNullOrEmpty(this.historyTable[e])?"":this.historyTable[e].value}},{key:"_parseStyleRules",value:function(){var e=this;n.isUndefinedOrNullOrEmpty(this.settings.styleRules)||""===this.rawValue||(n.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)||(0<=this.rawValue?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||0===this.settings.styleRules.ranges.length||this.settings.styleRules.ranges.forEach(function(i){e.rawValue>=i.min&&e.rawValue<i.max?e._addCSSClass(i.class):e._removeCSSClass(i.class)}),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||0===this.settings.styleRules.userDefined.length||this.settings.styleRules.userDefined.forEach(function(i){if(n.isFunction(i.callback))if(n.isString(i.classes))i.callback(e.rawValue)?e._addCSSClass(i.classes):e._removeCSSClass(i.classes);else if(n.isArray(i.classes))if(2===i.classes.length)i.callback(e.rawValue)?(e._addCSSClass(i.classes[0]),e._removeCSSClass(i.classes[1])):(e._removeCSSClass(i.classes[0]),e._addCSSClass(i.classes[1]));else if(2<i.classes.length){var r=i.callback(e.rawValue);n.isArray(r)?i.classes.forEach(function(h,_){n.isInArray(_,r)?e._addCSSClass(h):e._removeCSSClass(h)}):n.isInt(r)?i.classes.forEach(function(h,_){_===r?e._addCSSClass(h):e._removeCSSClass(h)}):n.isNull(r)?i.classes.forEach(function(h){e._removeCSSClass(h)}):n.throwError("The callback result is not an array nor a valid array index, ".concat(he(r)," given."))}else n.throwError("The classes attribute is not valid for the `styleRules` option.");else n.isUndefinedOrNullOrEmpty(i.classes)?i.callback(e):n.throwError("The callback/classes structure is not valid for the `styleRules` option.");else n.warning("The given `styleRules` callback is not a function, ".concat(typeof callback>"u"?"undefined":he(callback)," given."),e.settings.showWarnings)}))}},{key:"_addCSSClass",value:function(e){this.domElement.classList.add(e)}},{key:"_removeCSSClass",value:function(e){this.domElement.classList.remove(e)}},{key:"update",value:function(){for(var e=this,i=arguments.length,r=new Array(i),h=0;h<i;h++)r[h]=arguments[h];Array.isArray(r)&&Array.isArray(r[0])&&(r=r[0]);var _=n.cloneObject(this.settings),c=this.rawValue,N={};n.isUndefinedOrNullOrEmpty(r)||0===r.length?N=null:1<=r.length&&r.forEach(function(I){e.constructor._isPreDefinedOptionValid(I)&&(I=e.constructor._getOptionObject(I)),ie(N,I)});try{this._setSettings(N,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(c)}catch(I){return this._setSettings(_,!0),n.throwError("Unable to update the settings, those are invalid: [".concat(I,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e,i,r){var h,_=1<arguments.length&&void 0!==i?i:null,c=!(2<arguments.length&&void 0!==r)||r;if(n.isUndefined(e))return n.warning("You are trying to set an 'undefined' value ; an error could have occurred.",this.settings.showWarnings),this;if(n.isNull(_)||this._setSettings(_,!0),null===e&&this.settings.emptyInputBehavior!==o.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,c),this._saveValueToPersistentStorage(),this;if(h=this.constructor._toNumericValue(e,this.settings),isNaN(Number(h)))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("",c),this;if(""===h)switch(this.settings.emptyInputBehavior){case o.options.emptyInputBehavior.zero:h=0;break;case o.options.emptyInputBehavior.min:h=this.settings.minimumValue;break;case o.options.emptyInputBehavior.max:h=this.settings.maximumValue;break;default:n.isNumber(this.settings.emptyInputBehavior)&&(h=Number(this.settings.emptyInputBehavior))}if(""===h)return this._setElementAndRawValue(this.settings.emptyInputBehavior===o.options.emptyInputBehavior.always?this.settings.currencySymbol:"","",c),this;var I=H(this.constructor._checkIfInRangeWithOverrideOption(h,this.settings),2),G=I[0],b=I[1];if(G&&b&&this.settings.valuesToStrings&&this._checkValuesToStrings(h))return this._setElementAndRawValue(this.settings.valuesToStrings[h],h,c),this._saveValueToPersistentStorage(),this;if(n.isZeroOrHasNoValue(h)&&(h="0"),G&&b){var B=this.constructor._roundRawValue(h,this.settings);return B=this._trimLeadingAndTrailingZeros(B.replace(this.settings.decimalCharacter,".")),h=this._getRawValueToFormat(h),h=this.isFocused?this.constructor._roundFormattedValueShownOnFocus(h,this.settings):(this.settings.divisorWhenUnfocused&&(h=(h/=this.settings.divisorWhenUnfocused).toString()),this.constructor._roundFormattedValueShownOnBlur(h,this.settings)),h=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(h,this.settings),h=this.constructor._addGroupSeparators(h,this.settings,this.isFocused,this.rawValue,B),!this.isFocused&&this.settings.symbolWhenUnfocused&&(h="".concat(h).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(h,B,c),this._setValidOrInvalidState(B),this}return this._triggerRangeEvents(G,b),n.throwError("The value [".concat(h,"] 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("",c),this}},{key:"setUnformatted",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;if(null===e||n.isUndefined(e))return this;n.isNull(r)||this._setSettings(r,!0);var h=this.constructor._removeBrackets(e,this.settings),_=this.constructor._stripAllNonNumberCharacters(h,this.settings,!0,this.isFocused);return n.isNumber(_)||n.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(_,this.settings)?this.setValue(e):n.throwError("The value is out of the range limits [".concat(this.settings.minimumValue,", ").concat(this.settings.maximumValue,"].")),this}},{key:"setValue",value:function(e,i){return this._setElementAndRawValue(e,!(1<arguments.length&&void 0!==i)||i),this}},{key:"_setRawValue",value:function(e,i){var r=!(1<arguments.length&&void 0!==i)||i;if(this.rawValue!==e){var h=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(o.events.rawValueModified,this.domElement,{oldRawValue:h,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),r&&this._historyTableAdd()}}},{key:"_setElementValue",value:function(e,i){var r=!(1<arguments.length&&void 0!==i)||i,h=n.getElementValue(this.domElement);return e!==h&&(this.internalModification=!0,n.setElementValue(this.domElement,e),this.internalModification=!1,r&&this._triggerEvent(o.events.formatted,this.domElement,{oldValue:h,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e,i,r){var h=1<arguments.length&&void 0!==i?i:null,_=!(2<arguments.length&&void 0!==r)||r;return n.isNull(h)?h=e:n.isBoolean(h)&&(_=h,h=e),this._setElementValue(e),this._setRawValue(h,_),this}},{key:"_getRawValueToFormat",value:function(e){return n.isNull(this.settings.rawValueDivisor)||0===this.settings.rawValueDivisor||""===e||null===e?e:e*this.settings.rawValueDivisor}},{key:"_checkValuesToStrings",value:function(e){return this.constructor._checkValuesToStringsArray(e,this.valuesToStringsKeys)}},{key:"_isUserManuallyEditingTheValue",value:function(){return this.isFocused&&this.isEditing||this.isDropEvent}},{key:"_executeCallback",value:function(e,i){!n.isNull(i)&&n.isFunction(i)&&i(e,this)}},{key:"_triggerEvent",value:function(e,i,r){var h=1<arguments.length&&void 0!==i?i:document;n.triggerEvent(e,h,2<arguments.length&&void 0!==r?r:null,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(e){return this.getNumericString(0<arguments.length&&void 0!==e?e:null)}},{key:"getNumericString",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(this.rawValue)?null:n.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(i,r),i}},{key:"getFormatted",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;"value"in this.domElement||"textContent"in this.domElement||n.throwError("Unable to get the formatted string from the element.");var r=n.getElementValue(this.domElement);return this._executeCallback(r,i),r}},{key:"getNumber",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(i,r),i}},{key:"getLocalized",value:function(e,i){var r,h,_=0<arguments.length&&void 0!==e?e:null,c=1<arguments.length&&void 0!==i?i:null;n.isFunction(_)&&n.isNull(c)&&(c=_,_=null),(r=n.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(r)&&this.settings.leadingZero!==o.options.leadingZero.keep&&(r="0"),h=n.isNull(_)?this.settings.outputFormat:_;var N=this.constructor._toLocale(r,h,this.settings);return this._executeCallback(N,c),N}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(e){return this._setElementValue(this.getLocalized(0<arguments.length&&void 0!==e?e:null)),this}},{key:"isPristine",value:function(e){return 0<arguments.length&&void 0!==e&&!e?this.initialValueHtmlAttribute===this.getFormatted():this.initialValue===this.getNumericString()}},{key:"select",value:function(){return this.settings.selectNumberOnly?this.selectNumber():this._defaultSelectAll(),this}},{key:"_defaultSelectAll",value:function(){n.setElementSelection(this.domElement,0,n.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,i,r=n.getElementValue(this.domElement),h=r.length,_=this.settings.currencySymbol.length,c=this.settings.currencySymbolPlacement,N=n.isNegative(r,this.settings.negativeSignCharacter)?1:0,I=this.settings.suffixText.length;if(e=c===o.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.left&&1==N&&0<_?_+1:_,c===o.options.currencySymbolPlacement.prefix)i=h-I;else switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.left:i=h-(I+_);break;case o.options.negativePositiveSignPlacement.right:i=0<_?h-(_+N+I):h-(_+I);break;default:i=h-(_+I)}return n.setElementSelection(this.domElement,e,i),this}},{key:"selectInteger",value:function(){var e=0,i=0<=this.rawValue;this.settings.currencySymbolPlacement!==o.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==o.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&i||!i&&this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.left)&&(e+=1),this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.prefix&&(e+=this.settings.currencySymbol.length);var r=n.getElementValue(this.domElement),h=r.indexOf(this.settings.decimalCharacter);return-1===h&&(h=this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix?r.length-this.settings.currencySymbol.length:r.length,i||this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==o.options.currencySymbolPlacement.suffix||--h,h-=this.settings.suffixText.length),n.setElementSelection(this.domElement,e,h),this}},{key:"selectDecimal",value:function(){var e,r=n.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return e=-1===r?r=0:(r+=1)+Number(this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur),n.setElementSelection(this.domElement,r,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(r)?this.domElement:r.node(),this._removeFromLocalList(i),this}},{key:"attach",value:function(e,i){var r=!(1<arguments.length&&void 0!==i)||i;return this._addToLocalList(e.node()),r&&e.update(this.settings),this}},{key:"formatOther",value:function(e,i){return this._formatOrUnformatOther(!0,e,1<arguments.length&&void 0!==i?i:null)}},{key:"unformatOther",value:function(e,i){return this._formatOrUnformatOther(!1,e,1<arguments.length&&void 0!==i?i:null)}},{key:"_formatOrUnformatOther",value:function(e,i,r){var h,_,c=2<arguments.length&&void 0!==r?r:null;if(h=n.isNull(c)?this.settings:this._cloneAndMergeSettings(c),n.isElement(i)){var N=n.getElementValue(i);return _=e?o.format(N,h):o.unformat(N,h),n.setElementValue(i,_),null}return e?o.format(i,h):o.unformat(i,h)}},{key:"init",value:function(e,i){var r=this,h=!(1<arguments.length&&void 0!==i)||i,_=!1,c=[];if(n.isString(e)?c=z(document.querySelectorAll(e)):n.isElement(e)?(c.push(e),_=!0):n.isArray(e)?c=e:n.throwError("The given parameters to the 'init' function are invalid."),0===c.length)return n.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var N=this._getLocalList(),I=[];return c.forEach(function(G){var b=r.settings.createLocalList;h&&(r.settings.createLocalList=!1);var B=new o(G,n.getElementValue(G),r.settings);h&&(B._setLocalList(N),r._addToLocalList(G,B),r.settings.createLocalList=b),I.push(B)}),_?I[0]:I}},{key:"clear",value:function(e){return 0<arguments.length&&void 0!==e&&e?this.set("",{emptyInputBehavior:o.options.emptyInputBehavior.focus}):this.set(""),this}},{key:"remove",value:function(){this._removeValueFromPersistentStorage(),this._removeEventListeners(),this._removeWatcher(),this._removeFromLocalList(this.domElement),this.constructor._removeFromGlobalList(this)}},{key:"wipe",value:function(){this._setElementValue("",!1),this.remove()}},{key:"nuke",value:function(){this.remove(),this.domElement.parentNode.removeChild(this.domElement)}},{key:"form",value:function(e){if(0<arguments.length&&void 0!==e&&e||n.isUndefinedOrNullOrEmpty(this.parentForm)){var i=this._getParentForm();if(!n.isNull(i)&&i!==this.parentForm){var r=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=r.length,this._hasFormHandlerFunction(i)?this._incrementParentFormCounter(i):(this._storeFormHandlerFunction(i),this._initializeFormCounterToOne(i))}this.parentForm=i}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var i=this;return z(e.querySelectorAll("input")).filter(function(r){return i.constructor.isManagedByAutoNumeric(r)})}},{key:"_getParentForm",value:function(){if("body"===this.domElement.tagName.toLowerCase())return null;var e,i=this.domElement;do{if(n.isNull(i=i.parentNode))return null;if("body"===(e=i.tagName?i.tagName.toLowerCase():""))break}while("form"!==e);return"form"===e?i:null}},{key:"formNumericString",value:function(){return this.constructor._serializeNumericString(this.form(),this.settings.serializeSpaces)}},{key:"formFormatted",value:function(){return this.constructor._serializeFormatted(this.form(),this.settings.serializeSpaces)}},{key:"formLocalized",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(r)?this.settings.outputFormat:r,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,i)}},{key:"formArrayNumericString",value:function(){return this.constructor._serializeNumericStringArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayFormatted",value:function(){return this.constructor._serializeFormattedArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayLocalized",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(r)?this.settings.outputFormat:r,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,i)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(e){return JSON.stringify(this.formArrayLocalized(0<arguments.length&&void 0!==e?e:null))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){o.getAutoNumericElement(e).unformat()}),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){o.getAutoNumericElement(e).unformatLocalized()}),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){o.getAutoNumericElement(e).reformat()}),this}},{key:"formSubmitNumericString",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?(this.formUnformat(),this.form().submit(),this.formReformat()):n.isFunction(i)?i(this.formNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?this.form().submit():n.isFunction(i)?i(this.formFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(e,i){var r=0<arguments.length&&void 0!==e?e:null,h=1<arguments.length&&void 0!==i?i:null;return n.isNull(h)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):n.isFunction(h)?h(this.formLocalized(r)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayNumericString",value:function(e){return n.isFunction(e)?e(this.formArrayNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayFormatted",value:function(e){return n.isFunction(e)?e(this.formArrayFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayLocalized",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;return n.isFunction(e)?e(this.formArrayLocalized(r)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonNumericString",value:function(e){return n.isFunction(e)?e(this.formJsonNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonFormatted",value:function(e){return n.isFunction(e)?e(this.formJsonFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonLocalized",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;return n.isFunction(e)?e(this.formJsonLocalized(r)):n.throwError("The given callback is not a function."),this}},{key:"_createLocalList",value:function(){this.autoNumericLocalList=new Map,this._addToLocalList(this.domElement)}},{key:"_deleteLocalList",value:function(){delete this.autoNumericLocalList}},{key:"_setLocalList",value:function(e){this.autoNumericLocalList=e}},{key:"_getLocalList",value:function(){return this.autoNumericLocalList}},{key:"_hasLocalList",value:function(){return this.autoNumericLocalList instanceof Map&&0!==this.autoNumericLocalList.size}},{key:"_addToLocalList",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;n.isNull(r)&&(r=this),n.isUndefined(this.autoNumericLocalList)?n.throwError("The local list provided does not exists when trying to add an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.set(e,r)}},{key:"_removeFromLocalList",value:function(e){n.isUndefined(this.autoNumericLocalList)?this.settings.createLocalList&&n.throwError("The local list provided does not exists when trying to remove an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.delete(e)}},{key:"_mergeSettings",value:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];ie.apply(void 0,[this.settings].concat(i))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},i=arguments.length,r=new Array(i),h=0;h<i;h++)r[h]=arguments[h];return ie.apply(void 0,[e,this.settings].concat(r)),e}},{key:"_updatePredefinedOptions",value:function(e,i){var r=1<arguments.length&&void 0!==i?i:null;return n.isNull(r)?this.update(e):(this._mergeSettings(e,r),this.update(this.settings)),this}},{key:"french",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(o.getPredefinedOptions().French,i),this}},{key:"northAmerican",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(o.getPredefinedOptions().NorthAmerican,i),this}},{key:"british",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(o.getPredefinedOptions().British,i),this}},{key:"swiss",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(o.getPredefinedOptions().Swiss,i),this}},{key:"japanese",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(o.getPredefinedOptions().Japanese,i),this}},{key:"spanish",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(o.getPredefinedOptions().Spanish,i),this}},{key:"chinese",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(o.getPredefinedOptions().Chinese,i),this}},{key:"brazilian",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(o.getPredefinedOptions().Brazilian,i),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];if("function"==typeof i)this.settings[e]=i(this,e);else{var r=this.domElement.getAttribute(e);r=n.camelize(r),"function"==typeof this.settings[r]&&(this.settings[e]=r(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===o.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===o.options.selectOnFocus.doNotSelect&&n.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var i=this.rawValue<0,r=n.isZeroOrHasNoValue(e),h=e.length,_=0,c=0,N=!1,I=0;this.settings.caretPositionOnFocus!==o.options.caretPositionOnFocus.start&&(_=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,N=n.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==o.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==o.options.caretPositionOnFocus.decimalRight||(I=N?(c=e.indexOf(this.settings.decimalCharacter),this.settings.decimalCharacter.length):(c=_,0)));var G="";i?G=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!r&&(G=this.settings.positiveSignCharacter);var b,B=G.length,R=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===o.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.prefix:case o.options.negativePositiveSignPlacement.left:case o.options.negativePositiveSignPlacement.right:b=B+R;break;case o.options.negativePositiveSignPlacement.suffix:b=R}else b=R;else if(this.settings.caretPositionOnFocus===o.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.prefix:case o.options.negativePositiveSignPlacement.left:case o.options.negativePositiveSignPlacement.right:b=h;break;case o.options.negativePositiveSignPlacement.suffix:b=R+_}else b=h;else if(this.settings.caretPositionOnFocus===o.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.prefix:case o.options.negativePositiveSignPlacement.left:case o.options.negativePositiveSignPlacement.right:b=B+R+c;break;case o.options.negativePositiveSignPlacement.suffix:b=R+c}else b=R+c;else if(this.settings.caretPositionOnFocus===o.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.prefix:case o.options.negativePositiveSignPlacement.left:case o.options.negativePositiveSignPlacement.right:b=B+R+c+I;break;case o.options.negativePositiveSignPlacement.suffix:b=R+c+I}else b=R+c+I}else if(this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix)if(this.settings.caretPositionOnFocus===o.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.suffix:case o.options.negativePositiveSignPlacement.right:case o.options.negativePositiveSignPlacement.left:b=0;break;case o.options.negativePositiveSignPlacement.prefix:b=B}else b=0;else if(this.settings.caretPositionOnFocus===o.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.suffix:case o.options.negativePositiveSignPlacement.right:case o.options.negativePositiveSignPlacement.left:b=_;break;case o.options.negativePositiveSignPlacement.prefix:b=B+_}else b=_;else if(this.settings.caretPositionOnFocus===o.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.suffix:case o.options.negativePositiveSignPlacement.right:case o.options.negativePositiveSignPlacement.left:b=c;break;case o.options.negativePositiveSignPlacement.prefix:b=B+c}else b=c;else if(this.settings.caretPositionOnFocus===o.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.suffix:case o.options.negativePositiveSignPlacement.right:case o.options.negativePositiveSignPlacement.left:b=c+I;break;case o.options.negativePositiveSignPlacement.prefix:b=B+c+I}else b=c+I;return b}},{key:"_triggerRangeEvents",value:function(e,i){e||this._triggerEvent(o.events.minRangeExceeded,this.domElement),i||this._triggerEvent(o.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?n.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(o.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(o.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(e){if(this.settings.overrideMinMaxLimits===o.options.overrideMinMaxLimits.invalid){var i=this.constructor._isMinimumRangeRespected(e,this.settings),r=this.constructor._isMaximumRangeRespected(e,this.settings);i&&r?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(i,r)}}},{key:"_keepAnOriginalSettingsCopy",value:function(){this.originalDigitGroupSeparator=this.settings.digitGroupSeparator,this.originalCurrencySymbol=this.settings.currencySymbol,this.originalSuffixText=this.settings.suffixText}},{key:"_trimLeadingAndTrailingZeros",value:function(e){if(""===e||null===e)return e;if(this.settings.leadingZero!==o.options.leadingZero.keep){if(0===Number(e))return"0";e=e.replace(/^(-)?0+(?=\d)/g,"$1")}return n.contains(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1")),e.replace(/\.$/,"")}},{key:"_setPersistentStorageName",value:function(){this.settings.saveValueToSessionStorage&&(this.rawValueStorageName=""===this.domElement.name||n.isUndefined(this.domElement.name)?"".concat(this.storageNamePrefix).concat(this.domElement.id):"".concat(this.storageNamePrefix).concat(decodeURIComponent(this.domElement.name)))}},{key:"_saveValueToPersistentStorage",value:function(){this.settings.saveValueToSessionStorage&&(this.sessionStorageAvailable?sessionStorage.setItem(this.rawValueStorageName,this.rawValue):document.cookie="".concat(this.rawValueStorageName,"=").concat(this.rawValue,"; expires= ; path=/"))}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?this.sessionStorageAvailable?sessionStorage.getItem(this.rawValueStorageName):this.constructor._readCookie(this.rawValueStorageName):(n.warning("`_getValueFromPersistentStorage()` is called but `settings.saveValueToSessionStorage` is false. There must be an error that needs fixing.",this.settings.showWarnings),null)}},{key:"_removeValueFromPersistentStorage",value:function(){if(this.settings.saveValueToSessionStorage)if(this.sessionStorageAvailable)sessionStorage.removeItem(this.rawValueStorageName);else{var e=new Date;e.setTime(e.getTime()-864e5);var i="; expires=".concat(e.toUTCString());document.cookie="".concat(this.rawValueStorageName,"='' ;").concat(i,"; path=/")}}},{key:"_getDefaultValue",value:function(e){var i=e.getAttribute("value");return n.isNull(i)?"":i}},{key:"_onFocusInAndMouseEnter",value:function(e){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&"mouseenter"===e.type&&e.altKey)this.constructor._unformatAltHovered(this);else if("focus"===e.type&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),"focus"===e.type&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),"focus"===e.type||"mouseenter"===e.type&&!this.isFocused){var i=null;this.settings.emptyInputBehavior===o.options.emptyInputBehavior.focus&&this.rawValue<0&&null!==this.settings.negativeBracketsTypeOnBlur&&this.settings.isNegativeSignAllowed&&(i=this.constructor._removeBrackets(n.getElementValue(this.domElement),this.settings));var r=this._getRawValueToFormat(this.rawValue);if(""!==r){var h=this.constructor._roundFormattedValueShownOnFocusOrBlur(r,this.settings,this.isFocused);i=this.settings.showOnlyNumbersOnFocus===o.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",h.replace(".",this.settings.decimalCharacter)):n.isNull(h)?"":this.constructor._addGroupSeparators(h.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,r)}this.valueOnFocus=n.isNull(i)?"":i,this.lastVal=this.valueOnFocus;var _=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),c=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),N=_&&""!==c&&this.settings.emptyInputBehavior===o.options.emptyInputBehavior.focus;N&&(i=c),n.isNull(i)||this._setElementValue(i),N&&c===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix&&n.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():n.isNull(this.settings.caretPositionOnFocus)||n.setElementSelection(e.target,this._initialCaretPosition(n.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,n.setElementValue(this.domElement,"="),n.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,i=n.getElementValue(this.domElement);i=i.replace(/^\s*=/,"");try{var r=new j(i,this.settings.decimalCharacter);e=(new g).evaluate(r)}catch{return this._triggerEvent(o.events.invalidFormula,this.domElement,{formula:i,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(o.events.validFormula,this.domElement,{formula:i,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===E.keyName.Backspace||this.eventKey===E.keyName.Delete||this.eventKey===E.keyName.LeftArrow||this.eventKey===E.keyName.RightArrow||this.eventKey===E.keyName.Home||this.eventKey===E.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===E.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===E.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else if(this.eventKey===E.keyName.Equal)return void this._enterFormulaMode();if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===E.keyName.Esc&&(e.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(o.events.native.input,e.target)),this.select());var i=n.getElementValue(e.target);if(this.eventKey===E.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(o.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===E.keyName.Backspace||this.eventKey===E.keyName.Delete){var r=this._processCharacterDeletion();if(this.processed=!0,!r)return void e.preventDefault();this._formatValue(e),(i=n.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(o.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!==E.keyName.Insert){var i=this.processed;if(this._updateInternalProperties(e),!this._processNonPrintableKeysAndShortcuts(e))if(i)e.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(e);var r=n.getElementValue(e.target);if(r!==this.lastVal&&this.throwInput)this._triggerEvent(o.events.native.input,e.target),e.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&n.getElementSelection(e.target).start===n.getElementSelection(e.target).end&&n.getElementSelection(e.target).start===r.indexOf(this.settings.decimalCharacter)){var h=n.getElementSelection(e.target).start+1;n.setElementSelection(e.target,h)}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===E.keyName.Esc)e.preventDefault();else{if(this.eventKey===E.keyName.Z||this.eventKey===E.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),void this._historyTableUndo();this.onGoingRedo=!1}}if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&this.eventKey===E.keyName.x){var i=n.getElementSelection(this.domElement).start,r=this.constructor._toNumericValue(n.getElementValue(e.target),this.settings);this.set(r),this._setCaretPosition(i)}if(this.eventKey===E.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==E.keyName.Backspace&&this.eventKey!==E.keyName.Delete){this._updateInternalProperties(e);var h=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var _=n.getElementValue(e.target);if(!(h||""===_&&""===this.initialValueOnFirstKeydown)&&(_===this.settings.currencySymbol?n.setElementSelection(e.target,this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix?0:this.settings.currencySymbol.length):this.eventKey===E.keyName.Tab&&n.setElementSelection(e.target,0,_.length),(_===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(),_!==this.initialValueOnFirstKeydown&&this._triggerEvent(o.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:_,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),1<this.historyTable.length)){var c=n.getElementSelection(this.domElement);this.selectionStart=c.start,this.selectionEnd=c.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var N=n.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,N))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===E.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===o.options.showOnlyNumbersOnFocus.onlyNumbers&&(this.settings.digitGroupSeparator=this.originalDigitGroupSeparator,this.settings.currencySymbol=this.originalCurrencySymbol,this.settings.suffixText=this.originalSuffixText);var i=this._getRawValueToFormat(this.rawValue),r=n.isNull(i),h=H(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),_=h[0],c=h[1],N=!1;if(""===i||r||(this._triggerRangeEvents(_,c),this.settings.valuesToStrings&&this._checkValuesToStrings(i)&&(this._setElementValue(this.settings.valuesToStrings[i]),N=!0)),!N){var I;if(I=r||""===i?i:String(i),""===i||r){if(""===i)switch(this.settings.emptyInputBehavior){case o.options.emptyInputBehavior.zero:this._setRawValue("0"),I=this.constructor._roundValue("0",this.settings,0);break;case o.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),I=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case o.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),I=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:n.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),I=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else _&&c&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(i,this.settings)?(I=this._modifyNegativeSignAndDecimalCharacterForRawValue(I),this.settings.divisorWhenUnfocused&&!n.isNull(I)&&(I=(I/=this.settings.divisorWhenUnfocused).toString()),I=this.constructor._roundFormattedValueShownOnBlur(I,this.settings),I=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(I,this.settings)):this._triggerRangeEvents(_,c);var G=this.constructor._orderValueCurrencySymbolAndSuffixText(I,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(I,this.settings)||r&&this.settings.emptyInputBehavior===o.options.emptyInputBehavior.null||(G=this.constructor._addGroupSeparators(I,this.settings,!1,i)),G===i&&""!==i&&this.settings.allowDecimalPadding!==o.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==o.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&""!==i&&null!==i&&(G="".concat(G).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(G))}this._setValidOrInvalidState(this.rawValue),"blur"===e.type&&this._onBlur(e)}}},{key:"_onPaste",value:function(e){if(e.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i,r;window.clipboardData&&window.clipboardData.getData?i=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?i=e.clipboardData.getData("text/plain"):n.throwError("Unable to retrieve the pasted value. Please use a modern browser (ie. Firefox or Chromium).");var h=n.getElementValue(r=e.target.tagName?e.target:e.explicitOriginalTarget),_=r.selectionStart||0,c=r.selectionEnd||0,N=c-_;if(N===h.length){var I=this._preparePastedText(i),G=n.arabicToLatinNumbers(I,!1,!1,!1);return"."===G||""===G||"."!==G&&!n.isNumber(G)?(this.formatted=!0,void(this.settings.onInvalidPaste===o.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")))):(this.set(G),this.formatted=!0,void this._triggerEvent(o.events.native.input,r))}var b=n.isNegativeStrict(i,this.settings.negativeSignCharacter);b&&(i=i.slice(1,i.length));var B,R,Z=this._preparePastedText(i);if("."!==(B="."===Z?".":n.arabicToLatinNumbers(Z,!1,!1,!1))&&(!n.isNumber(B)||""===B))return this.formatted=!0,void(this.settings.onInvalidPaste===o.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")));var q,W,X=n.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);q=!(!b||X)&&(X=!0);var re=h.slice(0,_),ue=h.slice(c,h.length);W=this._preparePastedText(_!==c?re+ue:h),X&&(W=n.setRawNegativeSign(W)),R=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(h,_,this.settings.decimalCharacter)),q&&R++;var ae=W.slice(0,R),ye=W.slice(R,W.length),Fe=!1;"."===B&&(n.contains(ae,".")&&(Fe=!0,ae=ae.replace(".","")),ye=ye.replace(".",""));var Le=!1;switch(""===ae&&"-"===ye&&(ae="-",Le=!(ye="")),this.settings.onInvalidPaste){case o.options.onInvalidPaste.truncate:case o.options.onInvalidPaste.replace:for(var Je=n.parseStr(this.settings.minimumValue),me=n.parseStr(this.settings.maximumValue),Se=W,Pe=0,Qe=ae;Pe<B.length&&(W=(Qe+=B[Pe])+ye,this.constructor._checkIfInRange(W,Je,me));)Se=W,Pe++;if(R+=Pe,Le&&R++,this.settings.onInvalidPaste===o.options.onInvalidPaste.truncate){W=Se,Fe&&R--;break}for(var Ee=R,$e=Se.length;Pe<B.length&&Ee<$e;)if("."!==Se[Ee]){if(W=n.replaceCharAt(Se,Ee,B[Pe]),!this.constructor._checkIfInRange(W,Je,me))break;Se=W,Pe++,Ee++}else Ee++;R=Ee,Fe&&R--,W=Se;break;default:if(W="".concat(ae).concat(B).concat(ye),_===c)R=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(h,_,this.settings.decimalCharacter))+B.length;else if(""===ye)R=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(h,_,this.settings.decimalCharacter))+B.length,Le&&R++;else{var Ye=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(h,c,this.settings.decimalCharacter)),Xe=n.getElementValue(r).slice(_,c);R=Ye-N+n.countCharInText(this.settings.digitGroupSeparator,Xe)+B.length}q&&R++,Fe&&R--}if(n.isNumber(W)&&""!==W){var Ae=!1,He=!1;try{this.set(W),Ae=!0}catch{var Me;switch(this.settings.onInvalidPaste){case o.options.onInvalidPaste.clamp:Me=n.clampToRangeLimits(W,this.settings);try{this.set(Me)}catch{n.throwError("Fatal error: Unable to set the clamped value '".concat(Me,"'."))}Ae=He=!0,W=Me;break;case o.options.onInvalidPaste.error:case o.options.onInvalidPaste.truncate:case o.options.onInvalidPaste.replace:n.throwError("The pasted value '".concat(i,"' results in a value '").concat(W,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));default:return}}var Ke,Ve=n.getElementValue(r);if(Ae)switch(this.settings.onInvalidPaste){case o.options.onInvalidPaste.clamp:if(He){n.setElementSelection(r,this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix?Ve.length-this.settings.currencySymbol.length:Ve.length);break}default:Ke=n.findCaretPositionInFormattedNumber(W,R,Ve,this.settings.decimalCharacter),n.setElementSelection(r,Ke)}Ae&&h!==Ve&&this._triggerEvent(o.events.native.input,r)}else this.settings.onInvalidPaste===o.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' would result into an invalid content '").concat(W,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,this.rawValue!==this.rawValueOnFocus&&this._triggerEvent(o.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_onWheel",value:function(e){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===o.options.wheelOn.focus?this.isFocused?e.shiftKey||this.wheelAction(e):e.shiftKey&&this.wheelAction(e):this.settings.wheelOn===o.options.wheelOn.hover?e.shiftKey?(e.preventDefault(),window.scrollBy(0,n.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):n.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var i,r=e.target.selectionStart||0,h=e.target.selectionEnd||0,_=this.rawValue;if(n.isUndefinedOrNullOrEmpty(_)?0<this.settings.minimumValue||this.settings.maximumValue<0?n.isWheelUpEvent(e)?i=this.settings.minimumValue:n.isWheelDownEvent(e)?i=this.settings.maximumValue:n.throwError("The event is not a 'wheel' event."):i=0:i=_,i=+i,n.isNumber(this.settings.wheelStep)){var c=+this.settings.wheelStep;n.isWheelUpEvent(e)?i+=c:n.isWheelDownEvent(e)&&(i-=c)}else n.isWheelUpEvent(e)?i=n.addAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue):n.isWheelDownEvent(e)&&(i=n.subtractAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue));(i=n.clampToRangeLimits(i,this.settings))!==+_&&(this.set(i),this._triggerEvent(o.events.native.input,e.target)),e.preventDefault(),this._setSelection(r,h),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){var i;this.isDropEvent=!0,e.preventDefault(),i=n.isIE11()?"text":"text/plain";var r=e.dataTransfer.getData(i),h=this.unformatOther(r);this.set(h),this.isDropEvent=!1}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){return i._unformatOnSubmit()}),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){var r=e._getDefaultValue(i.node());setTimeout(function(){return i.set(r)},0)})}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(e){if(n.character(e)===E.keyName.Alt){var i=n.getHoveredElement();if(o.isManagedByAutoNumeric(i)){var r=o.getAutoNumericElement(i);!r.formulaMode&&r.settings.unformatOnHover&&this.constructor._unformatAltHovered(r)}}}},{key:"_onKeyupGlobal",value:function(e){if(n.character(e)===E.keyName.Alt){var i=n.getHoveredElement();if(o.isManagedByAutoNumeric(i)){var r=o.getAutoNumericElement(i);if(r.formulaMode||!r.settings.unformatOnHover)return;this.constructor._reformatAltHovered(r)}}}},{key:"_isElementTagSupported",value:function(){return n.isElement(this.domElement)||n.throwError("The DOM element is not valid, ".concat(this.domElement," given.")),n.isInArray(this.domElement.tagName.toLowerCase(),this.allowedTagList)}},{key:"_isInputElement",value:function(){return"input"===this.domElement.tagName.toLowerCase()}},{key:"_isInputTypeSupported",value:function(){return"text"===this.domElement.type||"hidden"===this.domElement.type||"tel"===this.domElement.type||n.isUndefinedOrNullOrEmpty(this.domElement.type)}},{key:"_checkElement",value:function(){var e=this.domElement.tagName.toLowerCase();this._isElementTagSupported()||n.throwError("The <".concat(e,"> tag is not supported by autoNumeric")),this._isInputElement()?(this._isInputTypeSupported()||n.throwError('The input type "'.concat(this.domElement.type,'" is not supported by autoNumeric')),this.isInputElement=!0):(this.isInputElement=!1,this.isContentEditable=this.domElement.hasAttribute("contenteditable")&&"true"===this.domElement.getAttribute("contenteditable"))}},{key:"_formatDefaultValueOnPageLoad",value:function(e){var i,r=0<arguments.length&&void 0!==e?e:null,h=!0;if(n.isNull(r)?(i=n.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",i)):i=r,this.isInputElement||this.isContentEditable){var _=this.constructor._toNumericValue(i,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==i||null===this.settings.defaultValueOverride&&""!==i&&i!==this.domElement.getAttribute("value")||""!==i&&"hidden"===this.domElement.getAttribute("type")&&!n.isNumber(_)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var c=this.constructor._removeBrackets(i,this.settings);(this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix)&&""!==this.settings.negativeSignCharacter&&n.isNegative(i,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(c,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(c,this.settings,!0,this.isFocused))}h=!1}}else isNaN(Number(_))||1/0===_?n.throwError("The value [".concat(i,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(_),h=!1);if(""===i)switch(this.settings.emptyInputBehavior){case o.options.emptyInputBehavior.focus:case o.options.emptyInputBehavior.null:case o.options.emptyInputBehavior.press:break;case o.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case o.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case o.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case o.options.emptyInputBehavior.zero:this.set("0");break;default:this.set(this.settings.emptyInputBehavior)}else h&&i===this.domElement.getAttribute("value")&&this.set(i)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==i||this.set(i)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=H(this.settings.maximumValue.toString().split("."),1)[0],i=H(this.settings.minimumValue||0===this.settings.minimumValue?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),i=i.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(i.length,1)}},{key:"_calculateValuesToStringsKeys",value:function(){this.valuesToStringsKeys=this.settings.valuesToStrings?Object.keys(this.settings.valuesToStrings):[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];"true"!==i&&"false"!==i||(this.settings[e]="true"===i),"number"==typeof i&&(this.settings[e]=i.toString())}}},{key:"_setSettings",value:function(e,i){var r=1<arguments.length&&void 0!==i&&i;!r&&n.isNull(e)||this.constructor._convertOldOptionsToNewOnes(e),r?("decimalPlacesRawValue"in e&&(this.settings.originalDecimalPlacesRawValue=e.decimalPlacesRawValue),"decimalPlaces"in e&&(this.settings.originalDecimalPlaces=e.decimalPlaces),this.constructor._calculateDecimalPlacesOnUpdate(e,this.settings),this._mergeSettings(e)):(this.settings={},this._mergeSettings(this.constructor.getDefaultConfig(),this.domElement.dataset,e,{rawValue:this.defaultRawValue}),this.caretFix=!1,this.throwInput=!0,this.allowedTagList=E.allowedTagList,this.runOnce=!1,this.hoveredWithAlt=!1),this._transformOptionsValuesToDefaultTypes(),this._runCallbacksFoundInTheSettingsObject(),this.constructor._correctNegativePositiveSignPlacementOption(this.settings),this.constructor._correctCaretPositionOnFocusAndSelectOnFocusOptions(this.settings),this.constructor._setNegativePositiveSignPermissions(this.settings),r||(this.settings.originalDecimalPlaces=n.isNull(e)||!e.decimalPlaces?null:e.decimalPlaces,this.settings.originalDecimalPlacesRawValue=this.settings.decimalPlacesRawValue,this.constructor._calculateDecimalPlacesOnInit(this.settings)),this._calculateVMinAndVMaxIntegerSizes(),this._setTrailingNegativeSignInfo(),this.regex={},this.constructor._cachesUsualRegularExpressions(this.settings,this.regex),this.constructor._setBrackets(this.settings),this._calculateValuesToStringsKeys(),n.isEmptyObj(this.settings)&&n.throwError("Unable to set the settings, those are invalid ; an empty object was given."),this.constructor.validate(this.settings,!1,e),this._keepAnOriginalSettingsCopy()}},{key:"_preparePastedText",value:function(e){return this.constructor._stripAllNonNumberCharacters(e,this.settings,!0,this.isFocused)}},{key:"_updateInternalProperties",value:function(){this.selection=n.getElementSelection(this.domElement),this.processed=!1}},{key:"_updateEventKeyInfo",value:function(e){this.eventKey=n.character(e)}},{key:"_saveCancellableValue",value:function(){this.savedCancellableValue=this.rawValue}},{key:"_setSelection",value:function(e,i){e=Math.max(e,0),i=Math.min(i,n.getElementValue(this.domElement).length),this.selection={start:e,end:i,length:i-e},n.setElementSelection(this.domElement,e,i)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=n.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=H(this._getLeftAndRightPartAroundTheSelection(),2),i=e[0],r=e[1];if(""===i&&""===r)return["",""];var h=!0;return this.eventKey!==E.keyName.Hyphen&&this.eventKey!==E.keyName.Minus||0!==Number(i)||(h=!1),this.isTrailingNegative&&(n.isNegative(r,this.settings.negativeSignCharacter)&&!n.isNegative(i,this.settings.negativeSignCharacter)||""===r&&n.isNegative(i,this.settings.negativeSignCharacter,!0))&&(i=i.replace(this.settings.negativeSignCharacter,""),r=r.replace(this.settings.negativeSignCharacter,""),i=i.replace("-",""),r=r.replace("-",""),i="-".concat(i)),[i=o._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,h,this.isFocused),r=o._stripAllNonNumberCharactersExceptCustomDecimalChar(r,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,i){var r=!0;this.eventKey!==E.keyName.Hyphen&&this.eventKey!==E.keyName.Minus||0!==Number(e)||(r=!1),this.isTrailingNegative&&n.isNegative(i,this.settings.negativeSignCharacter)&&!n.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),i=i.replace(this.settings.negativeSignCharacter,"")),e=o._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,r,this.isFocused),i=o._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,!1,this.isFocused),this.settings.leadingZero!==o.options.leadingZero.deny||this.eventKey!==E.keyName.num0&&this.eventKey!==E.keyName.numpad0||0!==Number(e)||n.contains(e,this.settings.decimalCharacter)||""===i||(e=e.substring(0,e.length-1));var h=e+i;if(this.settings.decimalCharacter){var _=h.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));_&&(h=(e=e.replace(_[1],_[1]+"0"))+i)}return[e,i,h]}},{key:"_setValueParts",value:function(e,i,r){var h=2<arguments.length&&void 0!==r&&r,_=H(this._normalizeParts(e,i),3),c=_[0],N=_[1],I=_[2],G=H(o._checkIfInRangeWithOverrideOption(I,this.settings),2),b=G[0],B=G[1];if(b&&B){var R=o._truncateDecimalPlaces(I,this.settings,h,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(""===R||R===this.settings.negativeSignCharacter){var Z;switch(this.settings.emptyInputBehavior){case o.options.emptyInputBehavior.focus:case o.options.emptyInputBehavior.press:case o.options.emptyInputBehavior.always:Z="";break;case o.options.emptyInputBehavior.min:Z=this.settings.minimumValue;break;case o.options.emptyInputBehavior.max:Z=this.settings.maximumValue;break;case o.options.emptyInputBehavior.zero:Z="0";break;case o.options.emptyInputBehavior.null:Z=null;break;default:Z=this.settings.emptyInputBehavior}this._setRawValue(Z)}else this._setRawValue(this._trimLeadingAndTrailingZeros(R));var q=o._truncateDecimalPlaces(I,this.settings,h,this.settings.decimalPlacesShownOnFocus),W=c.length;return W>q.length&&(W=q.length),1===W&&"0"===c&&this.settings.leadingZero===o.options.leadingZero.deny&&(W=""===N||"0"===c&&""!==N?1:0),this._setElementValue(q,!1),this._setCaretPosition(W),!0}return this._triggerRangeEvents(b,B),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var i=this.settings.currencySymbol.length,r=n.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&r&&r.charAt(0)===this.settings.negativeSignCharacter?[1,i+1]:[0,i];else{var h=r.length;e=[h-i,h]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=H(this._getSignPosition(),2),i=e[0],r=e[1],h=this.selection;h.start<r&&h.end>i&&((h.start<i||h.end>r)&&n.getElementValue(this.domElement).substring(Math.max(h.start,i),Math.min(h.end,r)).match(/^\s*$/)?h.start<i?this._setSelection(h.start,i):this._setSelection(r,h.end):this._setSelection(Math.min(h.start,i),Math.max(h.end,r)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!n.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,i=H(this._getLeftAndRightPartAroundTheSelection(),2),r=i[0],h=i[1];delete this.valuePartsBeforePaste;var _=r.substr(0,e[0].length)+o._stripAllNonNumberCharactersExceptCustomDecimalChar(r.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(_,h,!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===E.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===E.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===E.keyName.c||this.eventKey===E.keyName.v||this.eventKey===E.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==E.keyName.v&&this.eventKey!==E.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===E.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===E.keyName.Z||this.eventKey===E.keyName.z);if(this.eventKey!==E.keyName.LeftArrow&&this.eventKey!==E.keyName.RightArrow)return n.isInArray(this.eventKey,E.keyName._directionKeys);if("keydown"===e.type&&!e.shiftKey){var i=n.getElementValue(this.domElement);this.eventKey!==E.keyName.LeftArrow||i.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==E.keyName.RightArrow||i.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start+1)!==this.settings.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)}return!0}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var i=H(e,2),r=i[0],h=i[1],_=n.getElementValue(this.domElement),c=n.isNegative(_,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.suffix&&(this.eventKey===E.keyName.Backspace?(this.caretFix=this.selection.start>=_.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===_.charAt(this.selection.start-1)?r=r.substring(1):this.selection.start<=_.length-this.settings.suffixText.length&&(r=r.substring(0,r.length-1))):(this.caretFix=this.selection.start>=_.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,this.selection.start>=_.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(h=h.substring(1,h.length)),n.isNegative(r,this.settings.negativeSignCharacter)&&"-"===_.charAt(this.selection.start)&&(r=r.substring(1)))),this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case o.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=_.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===E.keyName.Backspace?this.selection.start===_.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&c?r=r.substring(1):"-"!==r&&(this.selection.start<=_.indexOf(this.settings.negativeSignCharacter)||!c)&&(r=r.substring(0,r.length-1)):("-"===r[0]&&(h=h.substring(1)),this.selection.start===_.indexOf(this.settings.negativeSignCharacter)&&c&&(r=r.substring(1)));break;case o.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=_.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===E.keyName.Backspace?this.selection.start===_.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?r=r.substring(1):("-"!==r&&this.selection.start<=_.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length||""!==r&&!c)&&(r=r.substring(0,r.length-1)):(this.caretFix=this.selection.start>=_.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===_.indexOf(this.settings.negativeSignCharacter)&&(r=r.substring(1)),h=h.substring(1))}return[r,h]}},{key:"_processCharacterDeletion",value:function(){var e,i;if(this.selection.length){this._expandSelectionOnSign();var r=H(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);e=r[0],i=r[1]}else{var h=H(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(i=h[1],""===(e=h[0])&&""===i&&(this.throwInput=!1),this.isTrailingNegative&&n.isNegative(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var _=H(this._processCharacterDeletionIfTrailingNegativeSign([e,i]),2);e=_[0],i=_[1]}else this.eventKey===E.keyName.Backspace?e=e.substring(0,e.length-1):i=i.substring(1,i.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(e).concat(i),this.settings)&&(this._setValueParts(e,i),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(o.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(o.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=H(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),i=e[0],r=e[1];if(this.eventKey!==E.keyName.AndroidDefault&&(this.throwInput=!0),this.eventKey===this.settings.decimalCharacter||this.settings.decimalCharacterAlternative&&this.eventKey===this.settings.decimalCharacterAlternative){if(!this._isDecimalCharacterInsertionAllowed()||!this.settings.decimalCharacter)return!1;if(this.settings.alwaysAllowDecimalCharacter)i=i.replace(this.settings.decimalCharacter,""),r=r.replace(this.settings.decimalCharacter,"");else{if(n.contains(i,this.settings.decimalCharacter)||0<r.indexOf(this.settings.decimalCharacter))return!0;0===r.indexOf(this.settings.decimalCharacter)&&(r=r.substr(1))}return this.settings.negativeSignCharacter&&n.contains(r,this.settings.negativeSignCharacter)&&(i="".concat(this.settings.negativeSignCharacter).concat(i),r=r.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(i+this.settings.decimalCharacter,r),!0}if(("-"===this.eventKey||"+"===this.eventKey)&&this.settings.isNegativeSignAllowed)return""===i&&n.contains(r,"-")?r=r.replace("-",""):i=n.isNegativeStrict(i,"-")?i.replace("-",""):"".concat(this.settings.negativeSignCharacter).concat(i),this._setValueParts(i,r),!0;var h=Number(this.eventKey);return 0<=h&&h<=9?(this.settings.isNegativeSignAllowed&&""===i&&n.contains(r,"-")&&(i="-",r=r.substring(1,r.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!n.contains(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&"0"!==this.eventKey&&(i="-".concat(i)),this._setValueParts("".concat(i).concat(this.eventKey),r),!0):this.throwInput=!1}},{key:"_formatValue",value:function(e){var i=n.getElementValue(this.domElement),r=H(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 h=H(i.split(this.settings.decimalCharacter),1)[0],_="";n.isNegative(h,this.settings.negativeSignCharacter)&&(_=this.settings.negativeSignCharacter,h=h.replace(this.settings.negativeSignCharacter,""),r=r.replace("-","")),""===_&&h.length>this.settings.mIntPos&&"0"===r.charAt(0)&&(r=r.slice(1)),_===this.settings.negativeSignCharacter&&h.length>this.settings.mIntNeg&&"0"===r.charAt(0)&&(r=r.slice(1)),this.isTrailingNegative||(r="".concat(_).concat(r))}var c=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue),N=c.length;if(c){var I,G=r.split("");if((this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==o.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix)&&G[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(G.shift(),(this.eventKey===E.keyName.Backspace||this.eventKey===E.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.suffix)&&(G.push(this.settings.negativeSignCharacter),this.caretFix="keydown"===e.type),this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===o.options.negativePositiveSignPlacement.right))){var b=this.settings.currencySymbol.split(""),B=["\\","^","$",".","|","?","*","+","(",")","["],R=[];b.forEach(function(W,X){n.isInArray(X=b[W],B)?R.push("\\"+X):R.push(X)}),this.eventKey===E.keyName.Backspace&&"-"===this.settings.negativeSignCharacter&&R.push("-"),G.push(R.join("")),this.caretFix="keydown"===e.type}for(var Z=0;Z<G.length;Z++)G[Z].match("\\d")||(G[Z]="\\"+G[Z]);I=this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(G.join(".*?"))):new RegExp("^.*?".concat(this.settings.currencySymbol).concat(G.join(".*?")));var q=c.match(I);q?(N=q[0].length,this.settings.showPositiveSign&&(0===N&&q.input.charAt(0)===this.settings.positiveSignCharacter&&(N=1===q.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===N&&q.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(N=this.settings.currencySymbol.length+1)),(0===N&&c.charAt(0)!==this.settings.negativeSignCharacter||1===N&&c.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.prefix&&(N=this.settings.currencySymbol.length+(n.isNegativeStrict(c,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===o.options.currencySymbolPlacement.suffix&&(N-=this.settings.currencySymbol.length),this.settings.suffixText&&(N-=this.settings.suffixText.length))}c!==i&&(this._setElementValue(c,!1),this._setCaretPosition(N)),this.formatted=!0}}]),we(u,v),o}();function ee(o,u){u=u||{bubbles:!1,cancelable:!1,detail:void 0};var v=document.createEvent("CustomEvent");return v.initCustomEvent(o,u.bubbles,u.cancelable,u.detail),v}x.multiple=function(o){var u=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,v=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,e=[];if(n.isObject(u)&&(v=u,u=null),n.isString(o))o=z(document.querySelectorAll(o));else if(n.isObject(o)){Object.prototype.hasOwnProperty.call(o,"rootElement")||n.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var i=z(o.rootElement.querySelectorAll("input"));o=Object.prototype.hasOwnProperty.call(o,"exclude")?(Array.isArray(o.exclude)||n.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),n.filterOut(i,o.exclude)):i}else n.isArray(o)||n.throwError("The given parameters to the 'multiple' function are invalid.");if(0===o.length){var r=!0;return!n.isNull(v)&&n.isBoolean(v.showWarnings)&&(r=v.showWarnings),n.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",r),[]}var h=n.isArray(u)&&1<=u.length,_=!1,c=!1;if(h){var N=he(Number(u[0]));(_="number"===N&&!isNaN(Number(u[0])))||"string"!==N&&!isNaN(N)&&"object"!==N||(c=!0)}var I,G=!1;if(n.isArray(v)&&1<=v.length){var b=he(v[0]);"string"!==b&&"object"!==b||(G=!0)}I=c?x.mergeOptions(u):G?x.mergeOptions(v):v;var B,R=n.isNumber(u);return _&&(B=u.length),o.forEach(function(Z,q){e.push(new x(Z,R?u:_&&q<=B?u[q]:null,I))}),e},Array.from||(Array.from=function(o){return[].slice.call(o)}),typeof window<"u"&&"function"!=typeof window.CustomEvent&&(ee.prototype=window.Event.prototype,window.CustomEvent=ee),x.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(x.events.native),Object.freeze(x.events),Object.defineProperty(x,"events",{configurable:!1,writable:!1}),x.options={allowDecimalPadding:{always:!0,never:!1,floats:"floats"},alwaysAllowDecimalCharacter:{alwaysAllow:!0,doNotAllow:!1},caretPositionOnFocus:{start:"start",end:"end",decimalLeft:"decimalLeft",decimalRight:"decimalRight",doNoForceCaretPosition:null},createLocalList:{createList:!0,doNotCreateList:!1},currencySymbol:{none:"",currencySign:"\xa4",austral:"\u20b3",australCentavo:"\xa2",baht:"\u0e3f",cedi:"\u20b5",cent:"\xa2",colon:"\u20a1",cruzeiro:"\u20a2",dollar:"$",dong:"\u20ab",drachma:"\u20af",dram:"\u200b\u058f",european:"\u20a0",euro:"\u20ac",florin:"\u0192",franc:"\u20a3",guarani:"\u20b2",hryvnia:"\u20b4",kip:"\u20ad",att:"\u0ead\u0eb1\u0e94",lepton:"\u039b.",lira:"\u20ba",liraOld:"\u20a4",lari:"\u20be",mark:"\u2133",mill:"\u20a5",naira:"\u20a6",peseta:"\u20a7",peso:"\u20b1",pfennig:"\u20b0",pound:"\xa3",real:"R$",riel:"\u17db",ruble:"\u20bd",rupee:"\u20b9",rupeeOld:"\u20a8",shekel:"\u20aa",shekelAlt:"\u05e9\u05f4\u05d7\u200e\u200e",taka:"\u09f3",tenge:"\u20b8",togrog:"\u20ae",won:"\u20a9",yen:"\xa5"},currencySymbolPlacement:{prefix:"p",suffix:"s"},decimalCharacter:{comma:",",dot:".",middleDot:"\xb7",arabicDecimalSeparator:"\u066b",decimalSeparatorKeySymbol:"\u2396"},decimalCharacterAlternative:{none:null,comma:",",dot:"."},decimalPlaces:{none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesRawValue:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnBlur:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnFocus:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},defaultValueOverride:{doNotOverride:null},digitalGroupSpacing:{two:"2",twoScaled:"2s",three:"3",four:"4"},digitGroupSeparator:{comma:",",dot:".",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0",noSeparator:"",apostrophe:"'",arabicThousandsSeparator:"\u066c",dotAbove:"\u02d9",privateUseTwo:"\u2019"},divisorWhenUnfocused:{none:null,percentage:100,permille:1e3,basisPoint:1e4},emptyInputBehavior:{focus:"focus",press:"press",always:"always",zero:"zero",min:"min",max:"max",null:"null"},eventBubbles:{bubbles:!0,doesNotBubble:!1},eventIsCancelable:{isCancelable:!0,isNotCancelable:!1},failOnUnknownOption:{fail:!0,ignore:!1},formatOnPageLoad:{format:!0,doNotFormat:!1},formulaMode:{enabled:!0,disabled:!1},historySize:{verySmall:5,small:10,medium:20,large:50,veryLarge:100,insane:Number.MAX_SAFE_INTEGER},invalidClass:"an-invalid",isCancellable:{cancellable:!0,notCancellable:!1},leadingZero:{allow:"allow",deny:"deny",keep:"keep"},maximumValue:{tenTrillions:"10000000000000",oneBillion:"1000000000",zero:"0"},minimumValue:{tenTrillions:"-10000000000000",oneBillion:"-1000000000",zero:"0"},modifyValueOnWheel:{modifyValue:!0,doNothing:!1},negativeBracketsTypeOnBlur:{parentheses:"(,)",brackets:"[,]",chevrons:"<,>",curlyBraces:"{,}",angleBrackets:"\u3008,\u3009",japaneseQuotationMarks:"\uff62,\uff63",halfBrackets:"\u2e24,\u2e25",whiteSquareBrackets:"\u27e6,\u27e7",quotationMarks:"\u2039,\u203a",guillemets:"\xab,\xbb",none:null},negativePositiveSignPlacement:{prefix:"p",suffix:"s",left:"l",right:"r",none:null},negativeSignCharacter:{hyphen:"-",minus:"\u2212",heavyMinus:"\u2796",fullWidthHyphen:"\uff0d",circledMinus:"\u2296",squaredMinus:"\u229f",triangleMinus:"\u2a3a",plusMinus:"\xb1",minusPlus:"\u2213",dotMinus:"\u2238",minusTilde:"\u2242",not:"\xac"},noEventListeners:{noEvents:!0,addEvents:!1},onInvalidPaste:{error:"error",ignore:"ignore",clamp:"clamp",truncate:"truncate",replace:"replace"},outputFormat:{string:"string",number:"number",dot:".",negativeDot:"-.",comma:",",negativeComma:"-,",dotNegative:".-",commaNegative:",-",none:null},overrideMinMaxLimits:{ceiling:"ceiling",floor:"floor",ignore:"ignore",invalid:"invalid",doNotOverride:null},positiveSignCharacter:{plus:"+",fullWidthPlus:"\uff0b",heavyPlus:"\u2795",doublePlus:"\u29fa",triplePlus:"\u29fb",circledPlus:"\u2295",squaredPlus:"\u229e",trianglePlus:"\u2a39",plusMinus:"\xb1",minusPlus:"\u2213",dotPlus:"\u2214",altHebrewPlus:"\ufb29",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0"},rawValueDivisor:{none:null,percentage:100,permille:1e3,basisPoint:1e4},readOnly:{readOnly:!0,readWrite:!1},roundingMethod:{halfUpSymmetric:"S",halfUpAsymmetric:"A",halfDownSymmetric:"s",halfDownAsymmetric:"a",halfEvenBankersRounding:"B",upRoundAwayFromZero:"U",downRoundTowardZero:"D",toCeilingTowardPositiveInfinity:"C",toFloorTowardNegativeInfinity:"F",toNearest05:"N05",toNearest05Alt:"CHF",upToNext05:"U05",downToNext05:"D05"},saveValueToSessionStorage:{save:!0,doNotSave:!1},selectNumberOnly:{selectNumbersOnly:!0,selectAll:!1},selectOnFocus:{select:!0,doNotSelect:!1},serializeSpaces:{plus:"+",percent:"%20"},showOnlyNumbersOnFocus:{onlyNumbers:!0,showAll:!1},showPositiveSign:{show:!0,hide:!1},showWarnings:{show:!0,hide:!1},styleRules:{none:null,positiveNegative:{positive:"autoNumeric-positive",negative:"autoNumeric-negative"},range0To100With4Steps:{ranges:[{min:0,max:25,class:"autoNumeric-red"},{min:25,max:50,class:"autoNumeric-orange"},{min:50,max:75,class:"autoNumeric-yellow"},{min:75,max:100,class:"autoNumeric-green"}]},evenOdd:{userDefined:[{callback:function(o){return o%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(o){return-1<=o&&o<0?0:0===Number(o)?1:0<o&&o<=1?2:null},classes:["autoNumeric-small-negative","autoNumeric-zero","autoNumeric-small-positive"]}]}},suffixText:{none:"",percentage:"%",permille:"\u2030",basisPoint:"\u2031"},symbolWhenUnfocused:{none:null,percentage:"%",permille:"\u2030",basisPoint:"\u2031"},unformatOnHover:{unformat:!0,doNotUnformat:!1},unformatOnSubmit:{unformat:!0,keepCurrentValue:!1},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},Q=x.options,Object.getOwnPropertyNames(Q).forEach(function(o){"valuesToStrings"===o?Object.getOwnPropertyNames(Q.valuesToStrings).forEach(function(u){n.isIE11()||null===Q.valuesToStrings[u]||Object.freeze(Q.valuesToStrings[u])}):"styleRules"!==o&&(n.isIE11()||null===Q[o]||Object.freeze(Q[o]))}),Object.freeze(Q),Object.defineProperty(x,"options",{configurable:!1,writable:!1}),x.defaultSettings={allowDecimalPadding:x.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:x.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:x.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:x.options.createLocalList.createList,currencySymbol:x.options.currencySymbol.none,currencySymbolPlacement:x.options.currencySymbolPlacement.prefix,decimalCharacter:x.options.decimalCharacter.dot,decimalCharacterAlternative:x.options.decimalCharacterAlternative.none,decimalPlaces:x.options.decimalPlaces.two,decimalPlacesRawValue:x.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:x.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:x.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:x.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:x.options.digitalGroupSpacing.three,digitGroupSeparator:x.options.digitGroupSeparator.comma,divisorWhenUnfocused:x.options.divisorWhenUnfocused.none,emptyInputBehavior:x.options.emptyInputBehavior.focus,eventBubbles:x.options.eventBubbles.bubbles,eventIsCancelable:x.options.eventIsCancelable.isCancelable,failOnUnknownOption:x.options.failOnUnknownOption.ignore,formatOnPageLoad:x.options.formatOnPageLoad.format,formulaMode:x.options.formulaMode.disabled,historySize:x.options.historySize.medium,invalidClass:x.options.invalidClass,isCancellable:x.options.isCancellable.cancellable,leadingZero:x.options.leadingZero.deny,maximumValue:x.options.maximumValue.tenTrillions,minimumValue:x.options.minimumValue.tenTrillions,modifyValueOnWheel:x.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:x.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:x.options.negativePositiveSignPlacement.none,negativeSignCharacter:x.options.negativeSignCharacter.hyphen,noEventListeners:x.options.noEventListeners.addEvents,onInvalidPaste:x.options.onInvalidPaste.error,outputFormat:x.options.outputFormat.none,overrideMinMaxLimits:x.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:x.options.positiveSignCharacter.plus,rawValueDivisor:x.options.rawValueDivisor.none,readOnly:x.options.readOnly.readWrite,roundingMethod:x.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:x.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:x.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:x.options.selectOnFocus.select,serializeSpaces:x.options.serializeSpaces.plus,showOnlyNumbersOnFocus:x.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:x.options.showPositiveSign.hide,showWarnings:x.options.showWarnings.show,styleRules:x.options.styleRules.none,suffixText:x.options.suffixText.none,symbolWhenUnfocused:x.options.symbolWhenUnfocused.none,unformatOnHover:x.options.unformatOnHover.unformat,unformatOnSubmit:x.options.unformatOnSubmit.keepCurrentValue,valuesToStrings:x.options.valuesToStrings.none,watchExternalChanges:x.options.watchExternalChanges.doNotWatch,wheelOn:x.options.wheelOn.focus,wheelStep:x.options.wheelStep.progressive},Object.freeze(x.defaultSettings),Object.defineProperty(x,"defaultSettings",{configurable:!1,writable:!1});var $={digitGroupSeparator:x.options.digitGroupSeparator.dot,decimalCharacter:x.options.decimalCharacter.comma,decimalCharacterAlternative:x.options.decimalCharacterAlternative.dot,currencySymbol:"\u202f\u20ac",currencySymbolPlacement:x.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:x.options.negativePositiveSignPlacement.prefix},Y={digitGroupSeparator:x.options.digitGroupSeparator.comma,decimalCharacter:x.options.decimalCharacter.dot,currencySymbol:x.options.currencySymbol.dollar,currencySymbolPlacement:x.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:x.options.negativePositiveSignPlacement.right},le={digitGroupSeparator:x.options.digitGroupSeparator.comma,decimalCharacter:x.options.decimalCharacter.dot,currencySymbol:x.options.currencySymbol.yen,currencySymbolPlacement:x.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:x.options.negativePositiveSignPlacement.right};n.cloneObject($).formulaMode=x.options.formulaMode.enabled;var Oe=n.cloneObject($);Oe.minimumValue=0;var _e=n.cloneObject($);_e.maximumValue=0,_e.negativePositiveSignPlacement=x.options.negativePositiveSignPlacement.prefix;var Te=n.cloneObject($);Te.digitGroupSeparator=x.options.digitGroupSeparator.normalSpace;var Ie=n.cloneObject(Te);Ie.minimumValue=0;var ke=n.cloneObject(Te);ke.maximumValue=0,ke.negativePositiveSignPlacement=x.options.negativePositiveSignPlacement.prefix;var ve=n.cloneObject($);ve.currencySymbol=x.options.currencySymbol.none,ve.suffixText="\u202f".concat(x.options.suffixText.percentage),ve.wheelStep=1e-4,ve.rawValueDivisor=x.options.rawValueDivisor.percentage;var pe=n.cloneObject(ve);pe.minimumValue=0;var Ne=n.cloneObject(ve);Ne.maximumValue=0,Ne.negativePositiveSignPlacement=x.options.negativePositiveSignPlacement.prefix;var Be=n.cloneObject(ve);Be.decimalPlaces=3;var Ue=n.cloneObject(pe);Ue.decimalPlaces=3;var Ze=n.cloneObject(Ne);Ze.decimalPlaces=3,n.cloneObject(Y).formulaMode=x.options.formulaMode.enabled;var je=n.cloneObject(Y);je.minimumValue=0;var Ce=n.cloneObject(Y);Ce.maximumValue=0,Ce.negativePositiveSignPlacement=x.options.negativePositiveSignPlacement.prefix;var Ge=n.cloneObject(Ce);Ge.negativeBracketsTypeOnBlur=x.options.negativeBracketsTypeOnBlur.parentheses;var fe=n.cloneObject(Y);fe.currencySymbol=x.options.currencySymbol.none,fe.suffixText=x.options.suffixText.percentage,fe.wheelStep=1e-4,fe.rawValueDivisor=x.options.rawValueDivisor.percentage;var De=n.cloneObject(fe);De.minimumValue=0;var xe=n.cloneObject(fe);xe.maximumValue=0,xe.negativePositiveSignPlacement=x.options.negativePositiveSignPlacement.prefix;var ze=n.cloneObject(fe);ze.decimalPlaces=3;var qe=n.cloneObject(De);qe.decimalPlaces=3;var We=n.cloneObject(xe);We.decimalPlaces=3;var be=n.cloneObject($);be.currencySymbol=x.options.currencySymbol.lira,x.predefinedOptions={euro:$,euroPos:Oe,euroNeg:_e,euroSpace:Te,euroSpacePos:Ie,euroSpaceNeg:ke,percentageEU2dec:ve,percentageEU2decPos:pe,percentageEU2decNeg:Ne,percentageEU3dec:Be,percentageEU3decPos:Ue,percentageEU3decNeg:Ze,dollar:Y,dollarPos:je,dollarNeg:Ce,dollarNegBrackets:Ge,percentageUS2dec:fe,percentageUS2decPos:De,percentageUS2decNeg:xe,percentageUS3dec:ze,percentageUS3decPos:qe,percentageUS3decNeg:We,French:$,Spanish:$,NorthAmerican:Y,British:{digitGroupSeparator:x.options.digitGroupSeparator.comma,decimalCharacter:x.options.decimalCharacter.dot,currencySymbol:x.options.currencySymbol.pound,currencySymbolPlacement:x.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:x.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:x.options.digitGroupSeparator.apostrophe,decimalCharacter:x.options.decimalCharacter.dot,currencySymbol:"\u202fCHF",currencySymbolPlacement:x.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:x.options.negativePositiveSignPlacement.prefix},Japanese:le,Chinese:le,Brazilian:{digitGroupSeparator:x.options.digitGroupSeparator.dot,decimalCharacter:x.options.decimalCharacter.comma,currencySymbol:x.options.currencySymbol.real,currencySymbolPlacement:x.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:x.options.negativePositiveSignPlacement.right},Turkish:be,dotDecimalCharCommaSeparator:{digitGroupSeparator:x.options.digitGroupSeparator.comma,decimalCharacter:x.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:x.options.digitGroupSeparator.dot,decimalCharacter:x.options.decimalCharacter.comma,decimalCharacterAlternative:x.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:x.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:x.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:x.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:x.options.allowDecimalPadding.never,minimumValue:x.options.minimumValue.zero,maximumValue:x.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:x.options.allowDecimalPadding.never,minimumValue:x.options.minimumValue.tenTrillions,maximumValue:x.options.maximumValue.zero},numeric:{digitGroupSeparator:x.options.digitGroupSeparator.noSeparator,decimalCharacter:x.options.decimalCharacter.dot,currencySymbol:x.options.currencySymbol.none},numericPos:{digitGroupSeparator:x.options.digitGroupSeparator.noSeparator,decimalCharacter:x.options.decimalCharacter.dot,currencySymbol:x.options.currencySymbol.none,minimumValue:x.options.minimumValue.zero,maximumValue:x.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:x.options.digitGroupSeparator.noSeparator,decimalCharacter:x.options.decimalCharacter.dot,currencySymbol:x.options.currencySymbol.none,minimumValue:x.options.minimumValue.tenTrillions,maximumValue:x.options.maximumValue.zero}},Object.getOwnPropertyNames(x.predefinedOptions).forEach(function(o){Object.freeze(x.predefinedOptions[o])}),Object.freeze(x.predefinedOptions),Object.defineProperty(x,"predefinedOptions",{configurable:!1,writable:!1}),t.default=x}],P.c=M,P.d=function(F,t,A){P.o(F,t)||Object.defineProperty(F,t,{enumerable:!0,get:A})},P.r=function(F){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})},P.t=function(F,t){if(1&t&&(F=P(F)),8&t||4&t&&"object"==typeof F&&F&&F.__esModule)return F;var A=Object.create(null);if(P.r(A),Object.defineProperty(A,"default",{enumerable:!0,value:F}),2&t&&"string"!=typeof F)for(var V in F)P.d(A,V,function(E){return F[E]}.bind(null,V));return A},P.n=function(F){var t=F&&F.__esModule?function(){return F.default}:function(){return F};return P.d(t,"a",t),t},P.o=function(F,t){return Object.prototype.hasOwnProperty.call(F,t)},P.p="",P(P.s=0).default;function P(F){if(M[F])return M[F].exports;var t=M[F]={i:F,l:!1,exports:{}};return C[F].call(t.exports,t,t.exports,P),t.l=!0,t.exports}var C,M}()},6387:(J,P,C)=>{"use strict";var F=j(C(4168)),A=j(C(6017)),E=j(C(1301)),D=j(C(7164)),s=j(C(8619)),d=j(C(4866)),g=j(C(3057)),w=C(723),U=j(C(530));function j(Q){return Q&&Q.__esModule?Q:{default:Q}}var z=function(){},H=function(x,ee,$){var Y=new z;if(typeof x>"u")throw Error("No element to render on was provided.");return Y._renderProperties=(0,s.default)(x),Y._encodings=[],Y._options=U.default,Y._errorHandler=new g.default(Y),typeof ee<"u"&&(($=$||{}).format||($.format=he()),Y.options($)[$.format](ee,$).render()),Y};for(var ce in H.getModule=function(Q){return F.default[Q]},F.default)F.default.hasOwnProperty(ce)&&se(F.default,ce);function se(Q,x){z.prototype[x]=z.prototype[x.toUpperCase()]=z.prototype[x.toLowerCase()]=function(ee,$){var Y=this;return Y._errorHandler.wrapBarcodeCall(function(){$.text=typeof $.text>"u"?void 0:""+$.text;var le=(0,A.default)(Y._options,$);le=(0,d.default)(le);var _e=ie(ee,Q[x],le);return Y._encodings.push(_e),Y})}}function ie(Q,x,ee){var $=new x(Q=""+Q,ee);if(!$.valid())throw new w.InvalidInputException($.constructor.name,Q);var Y=$.encode();Y=(0,E.default)(Y);for(var le=0;le<Y.length;le++)Y[le].options=(0,A.default)(ee,Y[le].options);return Y}function he(){return F.default.CODE128?"CODE128":Object.keys(F.default)[0]}function we(Q,x,ee){x=(0,E.default)(x);for(var $=0;$<x.length;$++)x[$].options=(0,A.default)(ee,x[$].options),(0,D.default)(x[$].options);(0,D.default)(ee),new(0,Q.renderer)(Q.element,x,ee).render(),Q.afterRender&&Q.afterRender()}z.prototype.options=function(Q){return this._options=(0,A.default)(this._options,Q),this},z.prototype.blank=function(Q){var x=new Array(Q+1).join("0");return this._encodings.push({data:x}),this},z.prototype.init=function(){var Q;if(this._renderProperties)for(var x in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){var ee=(0,A.default)(this._options,(Q=this._renderProperties[x]).options);"auto"==ee.format&&(ee.format=he()),this._errorHandler.wrapBarcodeCall(function(){var le=ie(ee.value,F.default[ee.format.toUpperCase()],ee);we(Q,le,ee)})}},z.prototype.render=function(){if(!this._renderProperties)throw new w.NoElementException;if(Array.isArray(this._renderProperties))for(var Q=0;Q<this._renderProperties.length;Q++)we(this._renderProperties[Q],this._encodings,this._options);else we(this._renderProperties,this._encodings,this._options);return this},z.prototype._defaults=U.default,typeof window<"u"&&(window.JsBarcode=H),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(Q,x){var ee=[];return jQuery(this).each(function(){ee.push(this)}),H(ee,Q,x)}),J.exports=H},9418:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.default=function F(t,A){(function C(F,t){if(!(F instanceof t))throw new TypeError("Cannot call a class as a function")})(this,F),this.data=t,this.text=A.text||t,this.options=A}},8514:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function s(l,d){for(var n=0;n<d.length;n++){var g=d[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}return function(l,d,n){return d&&s(l.prototype,d),n&&s(l,n),l}}(),t=function V(s){return s&&s.__esModule?s:{default:s}}(C(9418)),A=C(9144),S=function(s){function l(d,n){!function E(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l);var g=function T(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?s:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d.substring(1),n));return g.bytes=d.split("").map(function(w){return w.charCodeAt(0)}),g}return function D(s,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}(l,s),M(l,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,g=n.shift()-105,w=A.SET_BY_CODE[g];if(void 0===w)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&n.unshift(A.FNC1);var O=l.next(n,1,w);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:l.getBar(g)+O.result+l.getBar((O.checksum+g)%A.MODULO)+l.getBar(A.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return"string"==typeof n&&(n="true"===n.toLowerCase()),n}}],[{key:"getBar",value:function(n){return A.BARS[n]?A.BARS[n].toString():""}},{key:"correctIndex",value:function(n,g){if(g===A.SET_A){var w=n.shift();return w<32?w+64:w-32}return g===A.SET_B?n.shift()-32:10*(n.shift()-48)+n.shift()-48}},{key:"next",value:function(n,g,w){if(!n.length)return{result:"",checksum:0};var O=void 0,U=void 0;if(n[0]>=200){U=n.shift()-105;var j=A.SWAP[U];void 0!==j?O=l.next(n,g+1,j):((w===A.SET_A||w===A.SET_B)&&U===A.SHIFT&&(n[0]=w===A.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),O=l.next(n,g+1,w))}else U=l.correctIndex(n,w),O=l.next(n,g+1,w);return{result:l.getBar(U)+O.result,checksum:U*g+O.checksum}}}]),l}(t.default);P.default=S},2100:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function s(l,d){for(var n=0;n<d.length;n++){var g=d[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}return function(l,d,n){return d&&s(l.prototype,d),n&&s(l,n),l}}(),t=function V(s){return s&&s.__esModule?s:{default:s}}(C(8514)),A=C(9144),S=function(s){function l(d,n){return function E(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function T(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?s:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,A.A_START_CHAR+d,n))}return function D(s,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}(l,s),M(l,[{key:"valid",value:function(){return new RegExp("^"+A.A_CHARS+"+$").test(this.data)}}]),l}(t.default);P.default=S},2943:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function s(l,d){for(var n=0;n<d.length;n++){var g=d[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}return function(l,d,n){return d&&s(l.prototype,d),n&&s(l,n),l}}(),t=function V(s){return s&&s.__esModule?s:{default:s}}(C(8514)),A=C(9144),S=function(s){function l(d,n){return function E(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function T(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?s:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,A.B_START_CHAR+d,n))}return function D(s,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}(l,s),M(l,[{key:"valid",value:function(){return new RegExp("^"+A.B_CHARS+"+$").test(this.data)}}]),l}(t.default);P.default=S},5683:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function s(l,d){for(var n=0;n<d.length;n++){var g=d[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}return function(l,d,n){return d&&s(l.prototype,d),n&&s(l,n),l}}(),t=function V(s){return s&&s.__esModule?s:{default:s}}(C(8514)),A=C(9144),S=function(s){function l(d,n){return function E(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function T(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?s:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,A.C_START_CHAR+d,n))}return function D(s,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}(l,s),M(l,[{key:"valid",value:function(){return new RegExp("^"+A.C_CHARS+"+$").test(this.data)}}]),l}(t.default);P.default=S},7737:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=V(C(8514)),A=V(C(4336));function V(s){return s&&s.__esModule?s:{default:s}}function T(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?s:l}var S=function(s){function l(d,n){if(function E(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),/^[\x00-\x7F\xC8-\xD3]+$/.test(d))var g=T(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,(0,A.default)(d),n));else g=T(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,n));return T(g)}return function D(s,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}(l,s),l}(F.default);P.default=S},4336:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=C(9144),F=function(D){return D.match(new RegExp("^"+M.A_CHARS+"*"))[0].length},t=function(D){return D.match(new RegExp("^"+M.B_CHARS+"*"))[0].length},A=function(D){return D.match(new RegExp("^"+M.C_CHARS+"*"))[0]};function V(T,D){var S=D?M.A_CHARS:M.B_CHARS,s=T.match(new RegExp("^("+S+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(s)return s[1]+String.fromCharCode(204)+E(T.substring(s[1].length));var l=T.match(new RegExp("^"+S+"+"))[0];return l.length===T.length?T:l+String.fromCharCode(D?205:206)+V(T.substring(l.length),!D)}function E(T){var D=A(T),S=D.length;if(S===T.length)return T;T=T.substring(S);var s=F(T)>=t(T);return D+String.fromCharCode(s?206:205)+V(T,s)}P.default=function(T){var D=void 0;if(A(T).length>=2)D=M.C_START_CHAR+E(T);else{var s=F(T)>t(T);D=(s?M.A_START_CHAR:M.B_START_CHAR)+V(T,s)}return D.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(l,d){return String.fromCharCode(203)+d})}},9144:(J,P)=>{"use strict";var C;function M(ce,se,ie){return se in ce?Object.defineProperty(ce,se,{value:ie,enumerable:!0,configurable:!0,writable:!0}):ce[se]=ie,ce}Object.defineProperty(P,"__esModule",{value:!0});var F=P.SET_A=0,t=P.SET_B=1,A=P.SET_C=2,E=(P.SHIFT=98,P.START_A=103),T=P.START_B=104,D=P.START_C=105;P.MODULO=103,P.STOP=106,P.FNC1=207,P.SET_BY_CODE=(M(C={},E,F),M(C,T,t),M(C,D,A),C),P.SWAP={101:F,100:t,99:A},P.A_START_CHAR=String.fromCharCode(208),P.B_START_CHAR=String.fromCharCode(209),P.C_START_CHAR=String.fromCharCode(210),P.A_CHARS="[\0-_\xc8-\xcf]",P.B_CHARS="[ -\x7f\xc8-\xcf]",P.C_CHARS="(\xcf*[0-9]{2}\xcf*)",P.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,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.CODE128C=P.CODE128B=P.CODE128A=P.CODE128=void 0;var F=S(C(7737)),A=S(C(2100)),E=S(C(2943)),D=S(C(5683));function S(s){return s&&s.__esModule?s:{default:s}}P.CODE128=F.default,P.CODE128A=A.default,P.CODE128B=E.default,P.CODE128C=D.default},6602:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.CODE39=void 0;var M=function(){function O(U,j){for(var z=0;z<j.length;z++){var H=j[z];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(U,H.key,H)}}return function(U,j,z){return j&&O(U.prototype,j),z&&O(U,z),U}}(),D=function(O){function U(j,z){return function V(O,U){if(!(O instanceof U))throw new TypeError("Cannot call a class as a function")}(this,U),j=j.toUpperCase(),z.mod43&&(j+=function n(O){return S[O]}(function w(O){for(var U=0,j=0;j<O.length;j++)U+=g(O[j]);return U%=43}(j))),function E(O,U){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!U||"object"!=typeof U&&"function"!=typeof U?O:U}(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,j,z))}return function T(O,U){if("function"!=typeof U&&null!==U)throw new TypeError("Super expression must either be null or a function, not "+typeof U);O.prototype=Object.create(U&&U.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(O,U):O.__proto__=U)}(U,O),M(U,[{key:"encode",value:function(){for(var z=l("*"),H=0;H<this.data.length;H++)z+=l(this.data[H])+"0";return{data:z+=l("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),U}(function A(O){return O&&O.__esModule?O:{default:O}}(C(9418)).default),S=["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","-","."," ","$","/","+","%","*"],s=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function l(O){return function d(O){return s[O].toString(2)}(g(O))}function g(O){return S.indexOf(O)}P.CODE39=D},4079:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function d(n,g){for(var w=0;w<g.length;w++){var O=g[w];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(n,O.key,O)}}return function(n,g,w){return g&&d(n.prototype,g),w&&d(n,w),n}}(),F=C(1392),A=T(C(2651));function T(d){return d&&d.__esModule?d:{default:d}}var l=function(d){function n(g,w){!function D(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n);var O=function S(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,g,w));return O.fontSize=!w.flat&&w.fontSize>10*w.width?10*w.width:w.fontSize,O.guardHeight=w.height+O.fontSize/2+w.textMargin,O}return function s(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),M(n,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(w,O){return this.text.substr(w,O)}},{key:"leftEncode",value:function(w,O){return(0,A.default)(w,O)}},{key:"rightText",value:function(w,O){return this.text.substr(w,O)}},{key:"rightEncode",value:function(w,O){return(0,A.default)(w,O)}},{key:"encodeGuarded",value:function(){var w={fontSize:this.fontSize},O={height:this.guardHeight};return[{data:F.SIDE_BIN,options:O},{data:this.leftEncode(),text:this.leftText(),options:w},{data:F.MIDDLE_BIN,options:O},{data:this.rightEncode(),text:this.rightText(),options:w},{data:F.SIDE_BIN,options:O}]}},{key:"encodeFlat",value:function(){return{data:[F.SIDE_BIN,this.leftEncode(),F.MIDDLE_BIN,this.rightEncode(),F.SIDE_BIN].join(""),text:this.text}}}]),n}(T(C(9418)).default);P.default=l},9619:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function d(n,g){for(var w=0;w<g.length;w++){var O=g[w];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(n,O.key,O)}}return function(n,g,w){return g&&d(n.prototype,g),w&&d(n,w),n}}(),F=function d(n,g,w){null===n&&(n=Function.prototype);var O=Object.getOwnPropertyDescriptor(n,g);if(void 0===O){var U=Object.getPrototypeOf(n);return null===U?void 0:d(U,g,w)}if("value"in O)return O.value;var j=O.get;return void 0===j?void 0:j.call(w)},t=C(1392),V=function E(d){return d&&d.__esModule?d:{default:d}}(C(4079)),s=function(n){return(10-n.substr(0,12).split("").map(function(w){return+w}).reduce(function(w,O,U){return U%2?w+3*O:w+O},0)%10)%10},l=function(d){function n(g,w){(function T(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")})(this,n),-1!==g.search(/^[0-9]{12}$/)&&(g+=s(g));var O=function D(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,g,w));return O.lastChar=w.lastChar,O}return function S(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),M(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===s(this.data)}},{key:"leftText",value:function(){return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var w=this.data.substr(1,6),O=t.EAN13_STRUCTURE[this.data[0]];return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,w,O)}},{key:"rightText",value:function(){return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var w=this.data.substr(7,6);return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,w,"RRRRRR")}},{key:"encodeGuarded",value:function(){var w=F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(w.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(w.push({data:"00"}),w.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),w}}]),n}(V.default);P.default=l},5754:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function d(n,g){for(var w=0;w<g.length;w++){var O=g[w];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(n,O.key,O)}}return function(n,g,w){return g&&d(n.prototype,g),w&&d(n,w),n}}(),F=C(1392),A=T(C(2651));function T(d){return d&&d.__esModule?d:{default:d}}var l=function(d){function n(g,w){return function D(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),function S(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,g,w))}return function s(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),M(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var w=F.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,A.default)(this.data,w,"01"),text:this.text}}}]),n}(T(C(9418)).default);P.default=l},1931:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function n(g,w){for(var O=0;O<w.length;O++){var U=w[O];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(g,U.key,U)}}return function(g,w,O){return w&&n(g.prototype,w),O&&n(g,O),g}}(),F=C(1392),A=T(C(2651));function T(n){return n&&n.__esModule?n:{default:n}}var d=function(n){function g(w,O){return function D(n,g){if(!(n instanceof g))throw new TypeError("Cannot call a class as a function")}(this,g),function S(n,g){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!g||"object"!=typeof g&&"function"!=typeof g?n:g}(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,w,O))}return function s(n,g){if("function"!=typeof g&&null!==g)throw new TypeError("Super expression must either be null or a function, not "+typeof g);n.prototype=Object.create(g&&g.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(n,g):n.__proto__=g)}(g,n),M(g,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var O=F.EAN5_STRUCTURE[function(g){return g.split("").map(function(O){return+O}).reduce(function(O,U,j){return j%2?O+9*U:O+3*U},0)%10}(this.data)];return{data:"1011"+(0,A.default)(this.data,O,"01"),text:this.text}}}]),g}(T(C(9418)).default);P.default=d},3372:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function l(d,n){for(var g=0;g<n.length;g++){var w=n[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(d,w.key,w)}}return function(d,n,g){return n&&l(d.prototype,n),g&&l(d,g),d}}(),F=function l(d,n,g){null===d&&(d=Function.prototype);var w=Object.getOwnPropertyDescriptor(d,n);if(void 0===w){var O=Object.getPrototypeOf(d);return null===O?void 0:l(O,n,g)}if("value"in w)return w.value;var U=w.get;return void 0===U?void 0:U.call(g)},A=function V(l){return l&&l.__esModule?l:{default:l}}(C(4079)),S=function(d){return(10-d.substr(0,7).split("").map(function(g){return+g}).reduce(function(g,w,O){return O%2?g+w:g+3*w},0)%10)%10},s=function(l){function d(n,g){return function E(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}(this,d),-1!==n.search(/^[0-9]{7}$/)&&(n+=S(n)),function T(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?l:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,n,g))}return function D(l,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}(d,l),M(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===S(this.data)}},{key:"leftText",value:function(){return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var g=this.data.substr(0,4);return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftEncode",this).call(this,g,"LLLL")}},{key:"rightText",value:function(){return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var g=this.data.substr(4,4);return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightEncode",this).call(this,g,"RRRR")}}]),d}(A.default);P.default=s},5821:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function d(n,g){for(var w=0;w<g.length;w++){var O=g[w];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(n,O.key,O)}}return function(n,g,w){return g&&d(n.prototype,g),w&&d(n,w),n}}();P.checksum=l;var t=E(C(2651));function E(d){return d&&d.__esModule?d:{default:d}}var s=function(d){function n(g,w){(function T(d,n){if(!(d instanceof n))throw new TypeError("Cannot call a class as a function")})(this,n),-1!==g.search(/^[0-9]{11}$/)&&(g+=l(g));var O=function D(d,n){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?d:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,g,w));return O.displayValue=w.displayValue,O.fontSize=w.fontSize>10*w.width?10*w.width:w.fontSize,O.guardHeight=w.height+O.fontSize/2+w.textMargin,O}return function S(d,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);d.prototype=Object.create(n&&n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(d,n):d.__proto__=n)}(n,d),M(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==l(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var w="";return w+="101",w+=(0,t.default)(this.data.substr(0,6),"LLLLLL"),w+="01010",w+=(0,t.default)(this.data.substr(6,6),"RRRRRR"),{data:w+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var w=[];return this.displayValue&&w.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),w.push({data:"101"+(0,t.default)(this.data[0],"L"),options:{height:this.guardHeight}}),w.push({data:(0,t.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),w.push({data:"01010",options:{height:this.guardHeight}}),w.push({data:(0,t.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),w.push({data:(0,t.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&w.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),w}}]),n}(E(C(9418)).default);function l(d){var g,n=0;for(g=1;g<11;g+=2)n+=parseInt(d[g]);for(g=0;g<11;g+=2)n+=3*parseInt(d[g]);return(10-n%10)%10}P.default=s},1091:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function w(O,U){for(var j=0;j<U.length;j++){var z=U[j];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(O,z.key,z)}}return function(O,U,j){return U&&w(O.prototype,U),j&&w(O,j),O}}(),t=T(C(2651)),V=T(C(9418)),E=C(5821);function T(w){return w&&w.__esModule?w:{default:w}}function S(w,O){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!O||"object"!=typeof O&&"function"!=typeof O?w:O}var l=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],d=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],n=function(w){function O(U,j){!function D(w,O){if(!(w instanceof O))throw new TypeError("Cannot call a class as a function")}(this,O);var z=S(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,U,j));if(z.isValid=!1,-1!==U.search(/^[0-9]{6}$/))z.middleDigits=U,z.upcA=g(U,"0"),z.text=j.text||""+z.upcA[0]+U+z.upcA[z.upcA.length-1],z.isValid=!0;else{if(-1===U.search(/^[01][0-9]{7}$/))return S(z);if(z.middleDigits=U.substring(1,U.length-1),z.upcA=g(z.middleDigits,U[0]),z.upcA[z.upcA.length-1]!==U[U.length-1])return S(z);z.isValid=!0}return z.displayValue=j.displayValue,z.fontSize=j.fontSize>10*j.width?10*j.width:j.fontSize,z.guardHeight=j.height+z.fontSize/2+j.textMargin,z}return function s(w,O){if("function"!=typeof O&&null!==O)throw new TypeError("Super expression must either be null or a function, not "+typeof O);w.prototype=Object.create(O&&O.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(w,O):w.__proto__=O)}(O,w),M(O,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var j="";return j+="101",j+=this.encodeMiddleDigits(),{data:j+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var j=[];return this.displayValue&&j.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),j.push({data:"101",options:{height:this.guardHeight}}),j.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),j.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&j.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),j}},{key:"encodeMiddleDigits",value:function(){var j=this.upcA[0],H=d[parseInt(this.upcA[this.upcA.length-1])][parseInt(j)];return(0,t.default)(this.middleDigits,H)}}]),O}(V.default);function g(w,O){for(var U=parseInt(w[w.length-1]),j=l[U],z="",H=0,ce=0;ce<j.length;ce++){var se=j[ce];z+="X"===se?w[H++]:se}return(z=""+O+z)+(0,E.checksum)(z)}P.default=n},1392:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.SIDE_BIN="101",P.MIDDLE_BIN="01010",P.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"]},P.EAN2_STRUCTURE=["LL","LG","GL","GG"],P.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],P.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},2651:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=C(1392);P.default=function(A,V,E){var T=A.split("").map(function(S,s){return M.BINARIES[V[s]]}).map(function(S,s){return S?S[A[s]]:""});if(E){var D=A.length-1;T=T.map(function(S,s){return s<D?S+E:S})}return T.join("")}},2708:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.UPCE=P.UPC=P.EAN2=P.EAN5=P.EAN8=P.EAN13=void 0;var F=n(C(9619)),A=n(C(3372)),E=n(C(1931)),D=n(C(5754)),s=n(C(5821)),d=n(C(1091));function n(g){return g&&g.__esModule?g:{default:g}}P.EAN13=F.default,P.EAN8=A.default,P.EAN5=E.default,P.EAN2=D.default,P.UPC=s.default,P.UPCE=d.default},8817:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.GenericBarcode=void 0;var M=function(){function S(s,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}return function(s,l,d){return l&&S(s.prototype,l),d&&S(s,d),s}}(),D=function(S){function s(l,d){return function V(S,s){if(!(S instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),function E(S,s){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?S:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,l,d))}return function T(S,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);S.prototype=Object.create(s&&s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(S,s):S.__proto__=s)}(s,S),M(s,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),s}(function A(S){return S&&S.__esModule?S:{default:S}}(C(9418)).default);P.GenericBarcode=D},6065:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function s(l,d){for(var n=0;n<d.length;n++){var g=d[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}return function(l,d,n){return d&&s(l.prototype,d),n&&s(l,n),l}}(),F=C(5168),S=function(s){function l(){return function E(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function T(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?s:l}(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return function D(s,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}(l,s),M(l,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var n=this,g=this.data.match(/.{2}/g).map(function(w){return n.encodePair(w)}).join("");return{data:F.START_BIN+g+F.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var g=F.BINARIES[n[1]];return F.BINARIES[n[0]].split("").map(function(w,O){return("1"===w?"111":"1")+("1"===g[O]?"000":"0")}).join("")}}]),l}(function V(s){return s&&s.__esModule?s:{default:s}}(C(9418)).default);P.default=S},9643:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function s(l,d){for(var n=0;n<d.length;n++){var g=d[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}return function(l,d,n){return d&&s(l.prototype,d),n&&s(l,n),l}}(),t=function A(s){return s&&s.__esModule?s:{default:s}}(C(6065)),D=function(l){var d=l.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,g,w){return n+g*(3-w%2*2)},0);return 10*Math.ceil(d/10)-d},S=function(s){function l(d,n){return function V(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),-1!==d.search(/^[0-9]{13}$/)&&(d+=D(d)),function E(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?s:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,n))}return function T(s,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}(l,s),M(l,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===D(this.data)}}]),l}(t.default);P.default=S},5168:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.START_BIN="1010",P.END_BIN="11101",P.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},8969:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.ITF14=P.ITF=void 0;var F=V(C(6065)),A=V(C(9643));function V(E){return E&&E.__esModule?E:{default:E}}P.ITF=F.default,P.ITF14=A.default},7037:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function s(l,d){for(var n=0;n<d.length;n++){var g=d[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}return function(l,d,n){return d&&s(l.prototype,d),n&&s(l,n),l}}(),D=function(s){function l(d,n){return function V(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function E(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?s:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,n))}return function T(s,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}(l,s),M(l,[{key:"encode",value:function(){for(var n="110",g=0;g<this.data.length;g++){var O=parseInt(this.data[g]).toString(2);O=S(O,4-O.length);for(var U=0;U<O.length;U++)n+="0"==O[U]?"100":"110"}return{data:n+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),l}(function A(s){return s&&s.__esModule?s:{default:s}}(C(9418)).default);function S(s,l){for(var d=0;d<l;d++)s="0"+s;return s}P.default=D},3922:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=function A(S){return S&&S.__esModule?S:{default:S}}(C(7037)),t=C(6225),D=function(S){function s(l,d){return function V(S,s){if(!(S instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),function E(S,s){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?S:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,l+(0,t.mod10)(l),d))}return function T(S,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);S.prototype=Object.create(s&&s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(S,s):S.__proto__=s)}(s,S),s}(F.default);P.default=D},8742:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=function A(S){return S&&S.__esModule?S:{default:S}}(C(7037)),t=C(6225),D=function(S){function s(l,d){return function V(S,s){if(!(S instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),l+=(0,t.mod10)(l),l+=(0,t.mod10)(l),function E(S,s){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?S:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,l,d))}return function T(S,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);S.prototype=Object.create(s&&s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(S,s):S.__proto__=s)}(s,S),s}(F.default);P.default=D},1825:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=function A(S){return S&&S.__esModule?S:{default:S}}(C(7037)),t=C(6225),D=function(S){function s(l,d){return function V(S,s){if(!(S instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),function E(S,s){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?S:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,l+(0,t.mod11)(l),d))}return function T(S,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);S.prototype=Object.create(s&&s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(S,s):S.__proto__=s)}(s,S),s}(F.default);P.default=D},4455:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=function A(S){return S&&S.__esModule?S:{default:S}}(C(7037)),t=C(6225),D=function(S){function s(l,d){return function V(S,s){if(!(S instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),l+=(0,t.mod11)(l),l+=(0,t.mod10)(l),function E(S,s){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?S:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,l,d))}return function T(S,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);S.prototype=Object.create(s&&s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(S,s):S.__proto__=s)}(s,S),s}(F.default);P.default=D},6225:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.mod10=function C(F){for(var t=0,A=0;A<F.length;A++){var V=parseInt(F[A]);t+=(A+F.length)%2==0?V:2*V%10+Math.floor(2*V/10)}return(10-t%10)%10},P.mod11=function M(F){for(var t=0,A=[2,3,4,5,6,7],V=0;V<F.length;V++){var E=parseInt(F[F.length-1-V]);t+=A[V%A.length]*E}return(11-t%11)%11}},1122:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.MSI1110=P.MSI1010=P.MSI11=P.MSI10=P.MSI=void 0;var F=l(C(7037)),A=l(C(3922)),E=l(C(1825)),D=l(C(8742)),s=l(C(4455));function l(d){return d&&d.__esModule?d:{default:d}}P.MSI=F.default,P.MSI10=A.default,P.MSI11=E.default,P.MSI1010=D.default,P.MSI1110=s.default},886:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.codabar=void 0;var M=function(){function S(s,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}return function(s,l,d){return l&&S(s.prototype,l),d&&S(s,d),s}}(),D=function(S){function s(l,d){(function V(S,s){if(!(S instanceof s))throw new TypeError("Cannot call a class as a function")})(this,s),0===l.search(/^[0-9\-\$\:\.\+\/]+$/)&&(l="A"+l+"A");var n=function E(S,s){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?S:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,l.toUpperCase(),d));return n.text=n.options.text||n.text.replace(/[A-D]/g,""),n}return function T(S,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);S.prototype=Object.create(s&&s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(S,s):S.__proto__=s)}(s,S),M(s,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var d=[],n=this.getEncodings(),g=0;g<this.data.length;g++)d.push(n[this.data.charAt(g)]),g!==this.data.length-1&&d.push("0");return{text:this.text,data:d.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),s}(function A(S){return S&&S.__esModule?S:{default:S}}(C(9418)).default);P.codabar=D},4168:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=C(6602),F=C(8754),t=C(2708),A=C(8969),V=C(1122),E=C(8758),T=C(886),D=C(8817);P.default={CODE39:M.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:A.ITF14,ITF:A.ITF,MSI:V.MSI,MSI10:V.MSI10,MSI11:V.MSI11,MSI1010:V.MSI1010,MSI1110:V.MSI1110,pharmacode:E.pharmacode,codabar:T.codabar,GenericBarcode:D.GenericBarcode}},8758:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.pharmacode=void 0;var M=function(){function S(s,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}return function(s,l,d){return l&&S(s.prototype,l),d&&S(s,d),s}}(),D=function(S){function s(l,d){!function V(S,s){if(!(S instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s);var n=function E(S,s){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?S:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,l,d));return n.number=parseInt(l,10),n}return function T(S,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);S.prototype=Object.create(s&&s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(S,s):S.__proto__=s)}(s,S),M(s,[{key:"encode",value:function(){for(var d=this.number,n="";!isNaN(d)&&0!=d;)d%2==0?(n="11100"+n,d=(d-2)/2):(n="100"+n,d=(d-1)/2);return{data:n=n.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),s}(function A(S){return S&&S.__esModule?S:{default:S}}(C(9418)).default);P.pharmacode=D},3057:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var C=function(){function t(A,V){for(var E=0;E<V.length;E++){var T=V[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(A,T.key,T)}}return function(A,V,E){return V&&t(A.prototype,V),E&&t(A,E),A}}(),F=function(){function t(A){(function M(t,A){if(!(t instanceof A))throw new TypeError("Cannot call a class as a function")})(this,t),this.api=A}return C(t,[{key:"handleCatch",value:function(V){if("InvalidInputException"!==V.name)throw V;if(this.api._options.valid===this.api._defaults.valid)throw V.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(V){try{var E=V.apply(void 0,arguments);return this.api._options.valid(!0),E}catch(T){return this.handleCatch(T),this.api}}}]),t}();P.default=F},723:(J,P)=>{"use strict";function C(E,T){if(!(E instanceof T))throw new TypeError("Cannot call a class as a function")}function M(E,T){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!T||"object"!=typeof T&&"function"!=typeof T?E:T}function F(E,T){if("function"!=typeof T&&null!==T)throw new TypeError("Super expression must either be null or a function, not "+typeof T);E.prototype=Object.create(T&&T.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(E,T):E.__proto__=T)}Object.defineProperty(P,"__esModule",{value:!0});var t=function(E){function T(D,S){C(this,T);var s=M(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return s.name="InvalidInputException",s.symbology=D,s.input=S,s.message='"'+s.input+'" is not a valid input for '+s.symbology,s}return F(T,Error),T}(),A=function(E){function T(){C(this,T);var D=M(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return D.name="InvalidElementException",D.message="Not supported type to render on",D}return F(T,Error),T}(),V=function(E){function T(){C(this,T);var D=M(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return D.name="NoElementException",D.message="No element to render on.",D}return F(T,Error),T}();P.InvalidInputException=t,P.InvalidElementException=A,P.NoElementException=V},7164:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.default=function C(M){return M.marginTop=M.marginTop||M.margin,M.marginBottom=M.marginBottom||M.margin,M.marginRight=M.marginRight||M.margin,M.marginLeft=M.marginLeft||M.margin,M}},7020:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=V(C(4866)),A=V(C(530));function V(T){return T&&T.__esModule?T:{default:T}}P.default=function E(T){var D={};for(var S in A.default)A.default.hasOwnProperty(S)&&(T.hasAttribute("jsbarcode-"+S.toLowerCase())&&(D[S]=T.getAttribute("jsbarcode-"+S.toLowerCase())),T.hasAttribute("data-"+S.toLowerCase())&&(D[S]=T.getAttribute("data-"+S.toLowerCase())));return D.value=T.getAttribute("jsbarcode-value")||T.getAttribute("data-value"),(0,F.default)(D)}},8619:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(l){return typeof l}:function(l){return l&&"function"==typeof Symbol&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},t=T(C(7020)),V=T(C(2233)),E=C(723);function T(l){return l&&l.__esModule?l:{default:l}}P.default=function D(l){if("string"==typeof l)return function S(l){var d=document.querySelectorAll(l);if(0!==d.length){for(var n=[],g=0;g<d.length;g++)n.push(D(d[g]));return n}}(l);if(Array.isArray(l)){for(var d=[],n=0;n<l.length;n++)d.push(D(l[n]));return d}if(typeof HTMLCanvasElement<"u"&&l instanceof HTMLImageElement)return function s(l){var d=document.createElement("canvas");return{element:d,options:(0,t.default)(l),renderer:V.default.CanvasRenderer,afterRender:function(){l.setAttribute("src",d.toDataURL())}}}(l);if(l&&l.nodeName&&"svg"===l.nodeName.toLowerCase()||typeof SVGElement<"u"&&l instanceof SVGElement)return{element:l,options:(0,t.default)(l),renderer:V.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&l instanceof HTMLCanvasElement)return{element:l,options:(0,t.default)(l),renderer:V.default.CanvasRenderer};if(l&&l.getContext)return{element:l,renderer:V.default.CanvasRenderer};if(l&&"object"===(typeof l>"u"?"undefined":M(l))&&!l.nodeName)return{element:l,renderer:V.default.ObjectRenderer};throw new E.InvalidElementException}},1301:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.default=function C(M){var F=[];return function t(A){if(Array.isArray(A))for(var V=0;V<A.length;V++)t(A[V]);else A.text=A.text||"",A.data=A.data||"",F.push(A)}(M),F}},6017:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var C=Object.assign||function(M){for(var F=1;F<arguments.length;F++){var t=arguments[F];for(var A in t)Object.prototype.hasOwnProperty.call(t,A)&&(M[A]=t[A])}return M};P.default=function(M,F){return C({},M,F)}},4866:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.default=function C(M){var F=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in F)F.hasOwnProperty(t)&&"string"==typeof M[t=F[t]]&&(M[t]=parseInt(M[t],10));return"string"==typeof M.displayValue&&(M.displayValue="false"!=M.displayValue),M}},530:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.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,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function D(S,s){for(var l=0;l<s.length;l++){var d=s[l];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(S,d.key,d)}}return function(S,s,l){return s&&D(S.prototype,s),l&&D(S,l),S}}(),t=function V(D){return D&&D.__esModule?D:{default:D}}(C(6017)),A=C(4358),T=function(){function D(S,s,l){(function E(D,S){if(!(D instanceof S))throw new TypeError("Cannot call a class as a function")})(this,D),this.canvas=S,this.encodings=s,this.options=l}return M(D,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var s=0;s<this.encodings.length;s++){var l=(0,t.default)(this.options,this.encodings[s].options);this.drawCanvasBarcode(l,this.encodings[s]),this.drawCanvasText(l,this.encodings[s]),this.moveCanvasDrawing(this.encodings[s])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var s=this.canvas.getContext("2d");s.save(),(0,A.calculateEncodingAttributes)(this.encodings,this.options,s);var l=(0,A.getTotalWidthOfEncodings)(this.encodings),d=(0,A.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=l+this.options.marginLeft+this.options.marginRight,this.canvas.height=d,s.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(s.fillStyle=this.options.background,s.fillRect(0,0,this.canvas.width,this.canvas.height)),s.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(s,l){var g,d=this.canvas.getContext("2d"),n=l.data;g="top"==s.textPosition?s.marginTop+s.fontSize+s.textMargin:s.marginTop,d.fillStyle=s.lineColor;for(var w=0;w<n.length;w++){var O=w*s.width+l.barcodePadding;"1"===n[w]?d.fillRect(O,g,s.width,s.height):n[w]&&d.fillRect(O,g,s.width,s.height*n[w])}}},{key:"drawCanvasText",value:function(s,l){var g,w,d=this.canvas.getContext("2d");s.displayValue&&(w="top"==s.textPosition?s.marginTop+s.fontSize-s.textMargin:s.height+s.textMargin+s.marginTop+s.fontSize,d.font=s.fontOptions+" "+s.fontSize+"px "+s.font,"left"==s.textAlign||l.barcodePadding>0?(g=0,d.textAlign="left"):"right"==s.textAlign?(g=l.width-1,d.textAlign="right"):(g=l.width/2,d.textAlign="center"),d.fillText(l.text,g,w))}},{key:"moveCanvasDrawing",value:function(s){this.canvas.getContext("2d").translate(s.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),D}();P.default=T},2233:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=T(C(1799)),A=T(C(5794)),E=T(C(1138));function T(D){return D&&D.__esModule?D:{default:D}}P.default={CanvasRenderer:F.default,SVGRenderer:A.default,ObjectRenderer:E.default}},1138:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var C=function(){function t(A,V){for(var E=0;E<V.length;E++){var T=V[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(A,T.key,T)}}return function(A,V,E){return V&&t(A.prototype,V),E&&t(A,E),A}}(),F=function(){function t(A,V,E){(function M(t,A){if(!(t instanceof A))throw new TypeError("Cannot call a class as a function")})(this,t),this.object=A,this.encodings=V,this.options=E}return C(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();P.default=F},4358:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.getTotalWidthOfEncodings=P.calculateEncodingAttributes=P.getBarcodePadding=P.getEncodingHeight=P.getMaximumHeightOfEncodings=void 0;var F=function t(s){return s&&s.__esModule?s:{default:s}}(C(6017));function A(s,l){return l.height+(l.displayValue&&s.text.length>0?l.fontSize+l.textMargin:0)+l.marginTop+l.marginBottom}function V(s,l,d){if(d.displayValue&&l<s){if("center"==d.textAlign)return Math.floor((s-l)/2);if("left"==d.textAlign)return 0;if("right"==d.textAlign)return Math.floor(s-l)}return 0}function S(s,l,d){var n;if(d)n=d;else{if(!(typeof document<"u"))return 0;n=document.createElement("canvas").getContext("2d")}n.font=l.fontOptions+" "+l.fontSize+"px "+l.font;var g=n.measureText(s);return g?g.width:0}P.getMaximumHeightOfEncodings=function D(s){for(var l=0,d=0;d<s.length;d++)s[d].height>l&&(l=s[d].height);return l},P.getEncodingHeight=A,P.getBarcodePadding=V,P.calculateEncodingAttributes=function E(s,l,d){for(var n=0;n<s.length;n++){var O,g=s[n],w=(0,F.default)(l,g.options);O=w.displayValue?S(g.text,w,d):0;var U=g.data.length*w.width;g.width=Math.ceil(Math.max(O,U)),g.height=A(g,w),g.barcodePadding=V(O,U,w)}},P.getTotalWidthOfEncodings=function T(s){for(var l=0,d=0;d<s.length;d++)l+=s[d].width;return l}},5794:(J,P,C)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var M=function(){function S(s,l){for(var d=0;d<l.length;d++){var n=l[d];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}return function(s,l,d){return l&&S(s.prototype,l),d&&S(s,d),s}}(),t=function V(S){return S&&S.__esModule?S:{default:S}}(C(6017)),A=C(4358),T="http://www.w3.org/2000/svg",D=function(){function S(s,l,d){(function E(S,s){if(!(S instanceof s))throw new TypeError("Cannot call a class as a function")})(this,S),this.svg=s,this.encodings=l,this.options=d,this.document=d.xmlDocument||document}return M(S,[{key:"render",value:function(){var l=this.options.marginLeft;this.prepareSVG();for(var d=0;d<this.encodings.length;d++){var n=this.encodings[d],g=(0,t.default)(this.options,n.options),w=this.createGroup(l,g.marginTop,this.svg);this.setGroupOptions(w,g),this.drawSvgBarcode(w,g,n),this.drawSVGText(w,g,n),l+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,A.calculateEncodingAttributes)(this.encodings,this.options);var l=(0,A.getTotalWidthOfEncodings)(this.encodings),d=(0,A.getMaximumHeightOfEncodings)(this.encodings),n=l+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,d),this.options.background&&this.drawRect(0,0,n,d,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(l,d,n){var w,g=n.data;w="top"==d.textPosition?d.fontSize+d.textMargin:0;for(var O=0,U=0,j=0;j<g.length;j++)U=j*d.width+n.barcodePadding,"1"===g[j]?O++:O>0&&(this.drawRect(U-d.width*O,w,d.width*O,d.height,l),O=0);O>0&&this.drawRect(U-d.width*(O-1),w,d.width*O,d.height,l)}},{key:"drawSVGText",value:function(l,d,n){var w,O,g=this.document.createElementNS(T,"text");d.displayValue&&(g.setAttribute("style","font:"+d.fontOptions+" "+d.fontSize+"px "+d.font),O="top"==d.textPosition?d.fontSize-d.textMargin:d.height+d.textMargin+d.fontSize,"left"==d.textAlign||n.barcodePadding>0?(w=0,g.setAttribute("text-anchor","start")):"right"==d.textAlign?(w=n.width-1,g.setAttribute("text-anchor","end")):(w=n.width/2,g.setAttribute("text-anchor","middle")),g.setAttribute("x",w),g.setAttribute("y",O),g.appendChild(this.document.createTextNode(n.text)),l.appendChild(g))}},{key:"setSvgAttributes",value:function(l,d){var n=this.svg;n.setAttribute("width",l+"px"),n.setAttribute("height",d+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+l+" "+d),n.setAttribute("xmlns",T),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(l,d,n){var g=this.document.createElementNS(T,"g");return g.setAttribute("transform","translate("+l+", "+d+")"),n.appendChild(g),g}},{key:"setGroupOptions",value:function(l,d){l.setAttribute("style","fill:"+d.lineColor+";")}},{key:"drawRect",value:function(l,d,n,g,w){var O=this.document.createElementNS(T,"rect");return O.setAttribute("x",l),O.setAttribute("y",d),O.setAttribute("width",n),O.setAttribute("height",g),w.appendChild(O),O}}]),S}();P.default=D}}]);
|