import{D as B,E}from"./chunk-I7GW4F3B.js";import{a as U,c as A,d as T}from"./chunk-U46PHU2W.js";import{a as D,b as y,m as j,n as R}from"./chunk-SM7EQ7ST.js";import{c as O,d as k}from"./chunk-RWCAFOHA.js";import{Gk as I,Hk as M,eh as w,fh as G}from"./chunk-BPZQKZKD.js";import{b as f,c as W}from"./chunk-YBNTOQCK.js";import{Na as v,R as S,Sa as C,T as g,be as b,g as d,h as m,ha as l,ka as a,na as x,ta as u,x as o,xa as p,ya as s}from"./chunk-WL5U2YIT.js";import{a as h,b as c,e as $}from"./chunk-ADEKKGI2.js";var _,F=$(()=>{b();M();G();C();y();x();T();E();R();b();W();k();_=(()=>{let i=class i extends D{constructor(e,t){super(e,t),this.assetsService=s(I),this.currentUserService=s(B),this.privateServerInformationChange=s(j).privateServerInformationChange,this.showOnboarding$=new m(!1),this.enableOnboarding=A(this.privateServerInformationChange.pipe(o(r=>r.enableOnboarding))),this.steps=v([]),this.save$=new d,this.loadSteps(),this.save$.pipe(S(1e3),U(),l(()=>this.updateOnBoardingStepDone())).subscribe()}toggleOnboarding(){if(this.enableOnboarding()){let e=this.currentUserService.webSettingsSnapshot.clone();e.hideOnboarding=!e.hideOnboarding,this.currentUserService.saveUserWebSettings(e)}else this.showOnboarding$.next(!this.showOnboarding$.value)}loadSteps(){this.getSteps().pipe(g(1)).subscribe(e=>this.steps.set(e))}getSteps(){return this.assetsService.GetAllOnBoardingStep().pipe(a(e=>this.handleGetApiResult(e)),o(e=>this.returnWhenSuccessful(e,()=>e.data)))}toggleStepIsDone(e){return this.steps.update(t=>t.map(r=>new w(r.id===e?c(h({},r),{isDone:!r.isDone}):r))),this.save$.next(),!!this.steps().find(t=>t.id===e)?.isDone}updateOnBoardingStepDone(){let e=this.steps().filter(t=>t.isDone).map(t=>t.id);return this.assetsService.UpdateOnBoardingStepDone(e).pipe(a(t=>this.handleGetApiResult(t)))}};i.\u0275fac=function(t){return new(t||i)(p(f),p(O))},i.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})()});export{_ as a,F as b};
