import{a as k}from"./chunk-4KBZKTAT.js";import{a as j,b as V,c as D,d as O,e as E,f as P}from"./chunk-4SPCN7T5.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 u,Yc as _,Z as d,Za as f,Zc as m,cb as C,da as n,gb as g,k as h,ka as l,la as o,mb as v,nb as b,vb as y}from"./chunk-LVXYIJUI.js";var N=(()=>{class e extends R{constructor(i,r,a,s,B,U){super(i,r),this.repairTypesFacade=a,this.repairTypeGroupsFacade=s,this.router=B,this.checkpointScanFrameService=U,this.class="abs-menu-option-variable-charges-frame",this.repairTypeCounts=[],this.repairTypeGroups=[],this.destroySubject=new h,this.unsavedChanges=!1}ngOnInit(){this.scannedItemInfo=this.checkpointScanFrameService.getCheckpointScannedItem(),this.repairTypeGroupsFacade.getServiceChargesRepairTypeGroups().pipe(d(this.destroySubject),u(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.checkpointScanFrameService.variableChargesAdded(),this.unsavedChanges=!1,this.router.navigate([p.MainPanel.path,p.Dialogs.CheckpointScan.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(E),t(D),t(_),t(k))}}static{this.\u0275cmp=l({type:e,selectors:[["abs-menu-option-variable-charges-frame"]],hostVars:2,hostBindings:function(r,a){r&2&&g(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),y("variableChargesConfirmed",function(){return a.onVariableChargesConfirmed()})("variableChargesChanged",function(){return a.variableChargesChanged()}),b()),r&2&&C("repairTypeGroups",a.repairTypeGroups)("variableCharges",a.repairTypeCounts)("scannedItemInfo",a.scannedItemInfo)},dependencies:[j],encapsulation:2})}}return e})();var H=[{path:"",component:N,providers:[c],canDeactivate:[c]}],w=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275mod=o({type:e})}static{this.\u0275inj=n({imports:[m.forChild(H),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,w,P,O,V]})}}return e})();export{Me as MenuOptionVariableChargesModule};
