import {d,n as n$1}from'./chunk-BOHjEH8F.js';import {J,c as tS,cX as Ht,H as ul,ib as f,L as w,ii as F,cY as yi,N as Sr,aP as N,bJ as F$1,ad as ce}from'./main-WUGO6e7n.js';import {i as ie,j}from'./chunk-B-6eD0Fy.js';var v,V,P=J(()=>{tS();Ht();ul();ie();d();f();tS();v={appendTo:"body",closable:!0,closeOnEscape:!0,height:"90vh",maximizable:!0,modal:!0,width:"95vw"},V=(()=>{class o{constructor(){this.dateFormatPipe=w(F),this.dialogService=w(yi),this.recordingService=w(j),this.translatorService=w(Sr);}open(i){return N(this,null,function*(){let e=yield this.recordingService.getRecordingData(i.recordingId,i.isActive);if(!e)return;let t=yield this.findSessionRecordingLog(e.pullUrl);return t.kind==="found"?this.openLogViewer(i,e,t.artifact):this.openPlayer(i,e)})}openLogViewer(i,e,t){return N(this,null,function*(){let r=yield n$1.load(()=>import('./chunk-D_U9csfY.js'),"RecordingLogViewerComponent");if(r)return this.dialogService.open(r,F$1({data:{duration:t.duration,fileName:t.fileName,isActive:e.isActive,pullUrl:e.pullUrl,recording:i.summary},header:this.buildHeader(i.summary,e.isActive)},v))})}openPlayer(i,e){return N(this,null,function*(){let t=yield n$1.load(()=>import('./chunk-BbAMtNY9.js'),"RecordingPlayerComponent");if(t)return this.dialogService.open(t,F$1({data:{isActive:e.isActive,pullUrl:e.pullUrl},header:this.buildHeader(i.summary,e.isActive)},v))})}buildHeader(i,e){if(e)return this.translatorService.translate("lblLiveSessionRecording");let t=this.translatorService.translate("lblSessionRecording"),r=i?.creationDate;if(!r)return t;let n=this.dateFormatPipe.transform(r instanceof Date?r.toISOString():r,"datetime");return n?`${t} - ${n}`:t}findSessionRecordingLog(i){return N(this,null,function*(){try{let[{GatewayRecordingApi:e},{isSessionRecordingLogFileName:t}]=yield Promise.all([import('./chunk-CtNTQBEN.js'),import('./chunk-pwVAIeJQ.js')]),n=yield e.fromPullUrl(i).fetchMetadata(),s=n.files?.find(y=>t(y.fileName));return s?{kind:"found",artifact:{duration:s.duration??n.duration,fileName:s.fileName}}:{kind:"not-found"}}catch(e){return console.error("Failed to read the Gateway recording manifest.",e),{kind:"not-found"}}})}static{this.\u0275fac=function(e){return new(e||o)};}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"});}}return o})();});export{P,V};