import{a as P}from"./chunk-GRTHVQJW.js";import{a as j,b as O,c as D,d as E}from"./chunk-XZV2RKPZ.js";import{a as V}from"./chunk-I2IU2RIS.js";import{a as G}from"./chunk-TC3S442Y.js";import"./chunk-OKK2V3LR.js";import"./chunk-Q2WCAKHJ.js";import{e as R,f as c}from"./chunk-RZX3K5HT.js";import"./chunk-3TM4PNYS.js";import"./chunk-QZHSUPXF.js";import"./chunk-MPIXEIKK.js";import"./chunk-YFLLMV2L.js";import"./chunk-J363ANGI.js";import"./chunk-RKWKUAWW.js";import"./chunk-YA55SA6Z.js";import"./chunk-EE2S3MYD.js";import"./chunk-7EAWKBIV.js";import"./chunk-V64RF3DS.js";import{$b as I,na as p,qd as _}from"./chunk-ATD4AEXQ.js";import{Kc as y,Oa as t,Pb as S,Ta as h,Ua as s,Xa as f,Y as d,Z as u,_c as M,bd as T,da as n,gd as F,id as m,k as l,nb as g,ob as C,pb as v,zb as b}from"./chunk-BXH3QC5E.js";var w=(()=>{class e extends R{repairTypesFacade;repairTypeGroupsFacade;router;soilScanFrameService;class="abs-menu-option-variable-charges-frame";repairTypeCounts=[];repairTypeGroups=[];scannedItemInfo;destroySubject=new l;unsavedChanges=!1;constructor(r,a,i,o,U,B){super(r,a),this.repairTypesFacade=i,this.repairTypeGroupsFacade=o,this.router=U,this.soilScanFrameService=B}ngOnInit(){this.scannedItemInfo=this.soilScanFrameService.getSoilScannedItem(),this.repairTypeGroupsFacade.getServiceChargesRepairTypeGroups().pipe(u(this.destroySubject),d(r=>(this.repairTypeGroups=r,this.repairTypesFacade.getServiceChargeRepairTypeCounts(this.scannedItemInfo.customerID,this.scannedItemInfo.uniqueItemID,this.scannedItemInfo.distributionPointID)))).subscribe(r=>{this.repairTypeCounts=r})}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}onVariableChargesConfirmed(r){r?this.soilScanFrameService.variableChargesRemoved():this.soilScanFrameService.variableChargesUpdated(),this.unsavedChanges=!1,this.router.navigate([p.MainPanel.path,p.Dialogs.SoilScan.path,G.Scan.path]).catch(I.EMPTY_REJECTION_HANDLER)}variableChargesChanged(){this.unsavedChanges=!0}isSomethingChanged(){return this.unsavedChanges}static \u0275fac=function(a){return new(a||e)(t(_),t(M),t(V),t(D),t(F),t(P))};static \u0275cmp=h({type:e,selectors:[["abs-menu-option-variable-charges-frame"]],hostVars:2,hostBindings:function(a,i){a&2&&S(i.class)},standalone:!1,features:[f],decls:1,vars:3,consts:[[3,"variableChargesConfirmed","variableChargesRemoved","variableChargesChanged","repairTypeGroups","variableCharges","scannedItemInfo"]],template:function(a,i){a&1&&(C(0,"abs-variable-charges-panel",0),b("variableChargesConfirmed",function(){return i.onVariableChargesConfirmed(!1)})("variableChargesRemoved",function(){return i.onVariableChargesConfirmed(!0)})("variableChargesChanged",function(){return i.variableChargesChanged()}),v()),a&2&&g("repairTypeGroups",i.repairTypeGroups)("variableCharges",i.repairTypeCounts)("scannedItemInfo",i.scannedItemInfo)},dependencies:[j],encapsulation:2})}return e})();var H=[{path:"",component:w,providers:[c],canDeactivate:[c]}],A=(()=>{class e{static \u0275fac=function(a){return new(a||e)};static \u0275mod=s({type:e});static \u0275inj=n({imports:[m.forChild(H),m]})}return e})();var be=(()=>{class e{static \u0275fac=function(a){return new(a||e)};static \u0275mod=s({type:e});static \u0275inj=n({imports:[y,T,A,E,O]})}return e})();export{be as MenuOptionVariableChargesModule};
