import{Qo as v,ko as U,no as l,qo as g,to as u,wo as I}from"./chunk-RQDYBYBM.js";import{$d as S,Ce as d,E as m,Ge as h,N as f,ae as c,be as s,la as p,oa as n}from"./chunk-N6B2OJOY.js";var b=s(v,r=>r.vmmState.vmm),A=s(b,r=>r.data),L=s(b,r=>r.loading||!1);var $=(()=>{let o=class o{constructor(e,t){this.foerchStore=e,this.userIdService=t}getLatestUnits(){return this.foerchStore.pipe(c(A))}isUnitPageLoading(){return this.foerchStore.pipe(c(L))}loadChildUnitsOfParent(e,t=0,i=null){this.foerchStore.dispatch(U({customerCode:e,parentUnitId:t||0,params:i}))}createUnit(e,t,i,a){this.foerchStore.dispatch(g({customerCode:e,unit:t,updateUnitId:i,params:a}))}createUnitReport(e){this.userIdService.getUserId().pipe(m(t=>t!==d),f(1)).subscribe(t=>this.foerchStore.dispatch(I({userId:t,unitId:e})))}deleteUnit(e,t,i,a){this.foerchStore.dispatch(l({customerCode:e,unitId:t,parentUnitId:i,params:a}))}moveUnitTo(e,t,i){this.foerchStore.dispatch(u({customerCode:e,parentUnitId:t,unitId:i}))}buildPagination(e,t){return`?pageNumber=${e}&pageSize=${t}&sort=by_name:asc`}};o.\u0275fac=function(t){return new(t||o)(n(S),n(h))},o.\u0275prov=p({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();export{$ as a};