import{a as u}from"./chunk-6YTTYMQH.js";import{e as l}from"./chunk-EUBQAFPM.js";import{l as n,m}from"./chunk-PKG2ZGKG.js";import{r as a}from"./chunk-SNUDA6WI.js";import{d as r}from"./chunk-LVEUCBCY.js";import{da as o,ha as c,ma as h,r as i}from"./chunk-NDNQDXRJ.js";var x=(()=>{class t extends u{get model$(){return this._model$}get attachments$(){return this._attachments$}get connections$(){return this._connections$}get chatLog$(){return this._chatLog$}get isEditMode(){return a.isSet(this.model?.id)}constructor(s,e){super(),this.http=s,this.apiService=e,this.model=null,this.modelS=new i(1),this._model$=this.modelS.asObservable(),this.attachmentsS=new i(1),this._attachments$=this.attachmentsS.asObservable(),this.connectionsS=new i(1),this._connections$=this.connectionsS.asObservable(),this.chatLogS=new i(1),this._chatLog$=this.chatLogS.asObservable(),this.selectedDocuments=[]}unset(){this.formGroup=void 0}unsetModel(){this.model=null,this.modelS.next(null),this.attachmentsS.next(null),this.connectionsS.next(null),this.chatLogS.next(null)}fetch(s){this.apiService.get(n.tasks.fetch(s)).subscribe(e=>{this.formGroup=new l([]),this.model=e,this.modelS.next(e)})}fetchChatLogList(s){return this.apiService.post(n.tasks.fetchChatLogList,{DocumentQid:s,TaskQid:this.model?.id,TakeAll:!0}).pipe(o(e=>{this.chatLogS.next(e)}))}fetchAttachmentsList(s){this.apiService.get(n.attachments.fetchAttachmentsList(s)).subscribe(e=>{this.attachmentsS.next(e)})}fetchConnectionsList(s){return this.apiService.get(n.documents.fetchConnectionsList(s)).pipe(o(e=>{this.connectionsS.next(e)}))}static{this.\u0275fac=function(e){return new(e||t)(h(r),h(m))}}static{this.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var d=function(t){return t[t.AllTasks=1]="AllTasks",t[t.AllUnfinishedTasks=2]="AllUnfinishedTasks",t[t.UserTasks=3]="UserTasks",t[t.UnfinishedUserTasks=4]="UnfinishedUserTasks",t}(d||{});export{x as a,d as b};
