import{a as V,b as D,c as O,d as E,e as P,f as A}from"./chunk-4SPCN7T5.js";import{a as j}from"./chunk-622MCY7F.js";import"./chunk-T2ZXHDV7.js";import{a as G}from"./chunk-W3T7TSU6.js";import{e as R,f as c}from"./chunk-UOH2CMSN.js";import"./chunk-4F4MHU5U.js";import"./chunk-PSDZIEHT.js";import"./chunk-BFIBXLWL.js";import"./chunk-DFIFTGMN.js";import"./chunk-IDTJ2LL2.js";import"./chunk-CXVAGXS5.js";import"./chunk-XLLQ6366.js";import"./chunk-MANB3PJC.js";import"./chunk-A4FSGNM7.js";import{Ad as F,ca as p,uc as S}from"./chunk-CBXQYRPM.js";import{Bc as M,La as t,Rc as I,Tc as T,Y as l,Yc as _,Z as u,Za as f,Zc as m,cb as C,da as n,gb as g,k as h,ka as d,la as o,mb as v,nb as b,vb as y}from"./chunk-LVXYIJUI.js";var w=(()=>{class e extends R{constructor(a,r,i,s,U,H){super(a,r),this.repairTypesFacade=i,this.repairTypeGroupsFacade=s,this.router=U,this.cleanScanFrameService=H,this.class="abs-menu-option-variable-charges-frame",this.repairTypeCounts=[],this.repairTypeGroups=[],this.destroySubject=new h,this.unsavedChanges=!1}ngOnInit(){this.scannedItemInfo=this.cleanScanFrameService.getCleanScannedItem(),this.repairTypeGroupsFacade.getServiceChargesRepairTypeGroups().pipe(u(this.destroySubject),l(a=>(this.repairTypeGroups=a,this.repairTypesFacade.getServiceChargeRepairTypeCounts(this.scannedItemInfo.customerID,this.scannedItemInfo.uniqueItemID,this.scannedItemInfo.distributionPointID)))).subscribe(a=>{this.repairTypeCounts=a})}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}onVariableChargesConfirmed(){this.cleanScanFrameService.variableChargesAdded(),this.unsavedChanges=!1,this.router.navigate([p.MainPanel.path,p.Dialogs.CleanScan.path,G.Scan.path]).catch(S.EMPTY_REJECTION_HANDLER)}variableChargesChanged(){this.unsavedChanges=!0}isSomethingChanged(){return this.unsavedChanges}static{this.\u0275fac=function(r){return new(r||e)(t(F),t(I),t(P),t(O),t(_),t(j))}}static{this.\u0275cmp=d({type:e,selectors:[["abs-menu-option-variable-charges-frame"]],hostVars:2,hostBindings:function(r,i){r&2&&g(i.class)},features:[f],decls:1,vars:3,consts:[[3,"variableChargesConfirmed","variableChargesChanged","repairTypeGroups","variableCharges","scannedItemInfo"]],template:function(r,i){r&1&&(v(0,"abs-variable-charges-panel",0),y("variableChargesConfirmed",function(){return i.onVariableChargesConfirmed()})("variableChargesChanged",function(){return i.variableChargesChanged()}),b()),r&2&&C("repairTypeGroups",i.repairTypeGroups)("variableCharges",i.repairTypeCounts)("scannedItemInfo",i.scannedItemInfo)},dependencies:[V],encapsulation:2})}}return e})();var W=[{path:"",component:w,providers:[c],canDeactivate:[c]}],B=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275mod=o({type:e})}static{this.\u0275inj=n({imports:[m.forChild(W),m]})}}return e})();var Me=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275mod=o({type:e})}static{this.\u0275inj=n({imports:[M,T,B,E,A,D]})}}return e})();export{Me as MenuOptionVariableChargesModule};
