import{ca as i,k as a,l as d}from"./chunk-BXH3QC5E.js";var c=(()=>{class s{cleanScannedItemSubject=new a;cleanScannedItem$=this.cleanScannedItemSubject.asObservable();existingFlagsSubject=new d([]);existingFlags$=this.existingFlagsSubject.asObservable();newlyAddedFlagsSubject=new d([]);newlyAddedFlags$=this.newlyAddedFlagsSubject.asObservable();newFlagAddedSubject=new a;newFlagAdded$=this.newFlagAddedSubject.asObservable();handleFlagsSubject=new a;handleFlags$=this.handleFlagsSubject.asObservable();variableChargesUpdatedSubject=new a;variableChargesUpdated$=this.variableChargesUpdatedSubject.asObservable();variableChargesRemovedSubject=new a;variableChargesRemoved$=this.variableChargesRemovedSubject.asObservable();cleanScannedItem;previousAcceptedScannedItem;lastCustomerID;customerChanged;screenWidgetsList=[];setCleanScannedItem(e){if(e)if(e.customerID){let t=e.customerID;this.customerChanged=this.lastCustomerID!==t,this.customerChanged&&(this.lastCustomerID=t)}else this.customerChanged=!1,this.lastCustomerID=-1;else this.customerChanged=!1;this.cleanScannedItem=e,this.cleanScannedItemSubject.next()}getCleanScannedItem(){return this.cleanScannedItem}setExistingFlags(e){this.existingFlagsSubject.next([...e])}addNewFlag(e){let t=this.newlyAddedFlagsSubject.getValue();this.newlyAddedFlagsSubject.next([...t,e])}removeNewlyAddedFlag(e){let l=this.newlyAddedFlagsSubject.getValue().filter(n=>!this.isSameFlag(n.uniqueItemFlag,e));this.newlyAddedFlagsSubject.next(l)}removeNewlyAddedFlags(){this.newlyAddedFlagsSubject.next([])}removeExistingFlag(e){let l=this.existingFlagsSubject.getValue().filter(n=>!this.isSameFlag(n.uniqueItemFlag,e));this.existingFlagsSubject.next(l)}isSameFlag(e,t){return e.flag.id===t.flag.id}newFlagAdded(){this.newFlagAddedSubject.next()}handleFlags(e){this.handleFlagsSubject.next(e)}variableChargesUpdated(){this.variableChargesUpdatedSubject.next()}hasCustomerChanged(){return this.customerChanged}variableChargesRemoved(){this.variableChargesRemovedSubject.next()}static \u0275fac=function(t){return new(t||s)};static \u0275prov=i({token:s,factory:s.\u0275fac})}return s})();export{c as a};
