import{ca as d,k as s,l}from"./chunk-LVXYIJUI.js";var h=(()=>{class a{constructor(){this.checkpointItemScannedSubject=new s,this.checkpointItemScanned$=this.checkpointItemScannedSubject.asObservable(),this.existingFlagsSubject=new l([]),this.existingFlags$=this.existingFlagsSubject.asObservable(),this.newlyAddedFlagsSubject=new l([]),this.newlyAddedFlags$=this.newlyAddedFlagsSubject.asObservable(),this.newFlagAddedSubject=new s,this.newFlagAdded$=this.newFlagAddedSubject.asObservable(),this.handleFlagsSubject=new s,this.handleFlags$=this.handleFlagsSubject.asObservable(),this.clearScanSubject=new s,this.clearScanSubject$=this.clearScanSubject.asObservable(),this.variableChargesAddedSubject=new s,this.variableChargesAdded$=this.variableChargesAddedSubject.asObservable(),this.screenWidgetsList=[]}setCheckpointScannedItem(e){if(e){let t=e?.customerID;this.customerChanged=this.lastCustomerID!==t,this.customerChanged&&(this.lastCustomerID=t)}this.checkpointScannedItem=e,this.checkpointItemScannedSubject.next()}getCheckpointScannedItem(){return this.checkpointScannedItem}setExistingFlags(e){this.existingFlagsSubject.next([...e])}addNewFlag(e){let t=this.newlyAddedFlagsSubject.getValue();this.newlyAddedFlagsSubject.next([...t,e])}removeNewlyAddedFlag(e){let i=this.newlyAddedFlagsSubject.getValue().filter(n=>!this.isSameFlag(n.uniqueItemFlag,e));this.newlyAddedFlagsSubject.next(i)}removeNewlyAddedFlags(){this.newlyAddedFlagsSubject.next([])}removeExistingFlag(e){let i=this.existingFlagsSubject.getValue().filter(n=>!this.isSameFlag(n.uniqueItemFlag,e));this.existingFlagsSubject.next(i)}isSameFlag(e,t){return e.flag.id===t.flag.id}newFlagAdded(){this.newFlagAddedSubject.next()}handleFlags(e){this.handleFlagsSubject.next(e)}clearScan(){this.clearScanSubject.next()}variableChargesAdded(){this.variableChargesAddedSubject.next()}hasCustomerChanged(){return this.customerChanged}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=d({token:a,factory:a.\u0275fac})}}return a})();export{h as a};
