import{a as j,b as V,c as D,d as O,e as E,f as P}from"./chunk-4SPCN7T5.js";import{a as A}from"./chunk-V365F2PP.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 M}from"./chunk-CBXQYRPM.js";import{Bc as y,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 g,da as o,gb as C,k as h,ka as d,la as n,mb as v,nb as b,vb as S}from"./chunk-LVXYIJUI.js";var w=(()=>{class e extends R{constructor(i,r,a,s,U,H){super(i,r),this.repairTypesFacade=a,this.repairTypeGroupsFacade=s,this.router=U,this.soilScanFrameService=H,this.class="abs-menu-option-variable-charges-frame",this.repairTypeCounts=[],this.repairTypeGroups=[],this.destroySubject=new h,this.unsavedChanges=!1}ngOnInit(){this.scannedItemInfo=this.soilScanFrameService.getSoilScannedItem(),this.repairTypeGroupsFacade.getServiceChargesRepairTypeGroups().pipe(u(this.destroySubject),l(i=>(this.repairTypeGroups=i,this.repairTypesFacade.getServiceChargeRepairTypeCounts(this.scannedItemInfo.customerID,this.scannedItemInfo.uniqueItemID,this.scannedItemInfo.distributionPointID)))).subscribe(i=>{this.repairTypeCounts=i})}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}onVariableChargesConfirmed(){this.soilScanFrameService.variableChargesAdded(),this.unsavedChanges=!1,this.router.navigate([p.MainPanel.path,p.Dialogs.SoilScan.path,G.Scan.path]).catch(M.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(E),t(D),t(_),t(A))}}static{this.\u0275cmp=d({type:e,selectors:[["abs-menu-option-variable-charges-frame"]],hostVars:2,hostBindings:function(r,a){r&2&&C(a.class)},features:[f],decls:1,vars:3,consts:[[3,"variableChargesConfirmed","variableChargesChanged","repairTypeGroups","variableCharges","scannedItemInfo"]],template:function(r,a){r&1&&(v(0,"abs-variable-charges-panel",0),S("variableChargesConfirmed",function(){return a.onVariableChargesConfirmed()})("variableChargesChanged",function(){return a.variableChargesChanged()}),b()),r&2&&g("repairTypeGroups",a.repairTypeGroups)("variableCharges",a.repairTypeCounts)("scannedItemInfo",a.scannedItemInfo)},dependencies:[j],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=n({type:e})}static{this.\u0275inj=o({imports:[m.forChild(W),m]})}}return e})();var ye=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275mod=n({type:e})}static{this.\u0275inj=o({imports:[y,T,B,P,O,V]})}}return e})();export{ye as MenuOptionVariableChargesModule};
