import{a as p,b as X}from"./chunk-FUXEUDZL.js";import{a as y,b as K}from"./chunk-3VPK6L6H.js";import{a,b as U,c as r,d as Q,g as F,h as Y}from"./chunk-6PJUBUUK.js";import{a as T,b as J}from"./chunk-Y3SKC4HP.js";import{Oe as V,Pe as W}from"./chunk-A4G3YPXH.js";import{a as A,b as O}from"./chunk-DJ546A6R.js";import{B as C,C as B,D as E,E as L}from"./chunk-I7GW4F3B.js";import{c as I,d as q}from"./chunk-RWCAFOHA.js";import{Gk as j,Hk as z}from"./chunk-BPZQKZKD.js";import{D as w,I as $}from"./chunk-HTXYTVN4.js";import{b as l,c as x}from"./chunk-YBNTOQCK.js";import{Sa as P,be as g,g as c,ka as v,na as b,r as m,ta as u,x as d,xa as s}from"./chunk-WL5U2YIT.js";import{a as f,b as h,e as S}from"./chunk-ADEKKGI2.js";var k,D=S(()=>{X();U();K();b();Q();g();B();J();x();k=(()=>{let i=class i{constructor(e,t,o){this.dataSourceSettingsService=e,this.dropdownHelper=t,this.translatorService=o,this.subscriptionEdited=new c,this.selectedCheckboxValuesChanged=new c,this.isSaving=!1,this.excludedActions=[r.Created,r.Executed,r.Viewed,r.Copied,r.Exported,r.Synchronized,r.ResetPasswordScheduleAdded,r.ResetPasswordScheduleDeleted,r.InvalidValue,r.DevolutionsGatewayDown]}initCheckboxValues(){let e=this.dataSourceSettingsService.dataSourceSettingsSnapshot?.excludedUserSubscriptionAction.concat(this.excludedActions);return this.dropdownHelper.initComboEnum(p,e).map(t=>h(f({},t),{label:this.translatorService.translate(`NotificationEventAction_${p[t.value]}`)}))}getCheckboxValuesForSessions(){let e=[r.Opened,r.Closed];return this.initCheckboxValues().filter(t=>!e.includes(t.value))}selectedValuesToFilter(e){let t=[];return e.forEach(o=>t.push({filterTarget:a.Action,textSearchModel:{inverseResult:!1,searchItem:y.ExactExpression},value:r[o.value]})),t}toggleIsSaving(){this.isSaving?setTimeout(()=>this.isSaving=!1,1e3):this.isSaving=!0}};i.\u0275fac=function(t){return new(t||i)(s(C),s(T),s(l))},i.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})()});var we,te=S(()=>{O();b();U();P();g();x();q();L();Y();z();D();W();$();we=(()=>{let i=class i extends A{constructor(e,t,o,R,N,M,G,H){super(e,t,o),this.subscriptionService=R,this.assetServices=N,this.userSubscriptionEditService=M,this.connectionService=G,this.router=H,this.viewRequest=new c}view(){this.viewRequest.next()}getUserSubscriptions(e=!1){return this.getCache(e,this.getUserSubscriptionsInternal())}getUserSubscriptionsViewModels(e=!1){return this.getUserSubscriptions(e).pipe(d(t=>this.toViewModels(t)))}getSubscriptionConnectionId(e){let t=e.filters.find(o=>o.filterTarget===a.ID);return t?t.value:null}refreshUserSubscriptions(){this.userSubscriptionEditService.subscriptionEdited.next()}delete(e){return this.subscriptionService.delete(e)}onEntryClick(e){let t=e.filters.find(o=>o.filterTarget===a.ID)?.value;t&&this.connectionService.getPartialConnection(t).subscribe(o=>this.router.navigate([`connections/${o.repositoryId}/${o.id}`]))}toViewModels(e){return this.subscriptionService.toViewModels(e)}getUserSubscriptionsInternal(){return this.currentUserService.isLogged()?this.assetServices.GetSubscriptionsForCurrentUser().pipe(v(e=>this.handleGetApiResult(e)),d(e=>this.returnWhenSuccessful(e,()=>e.data??[]))):m([])}};i.\u0275fac=function(t){return new(t||i)(s(l),s(I),s(E),s(F),s(j),s(k),s(V),s(w))},i.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})()});export{k as a,D as b,we as c,te as d};
