1import{a as Ce}from"./chunk-XLUHOXTY.js";import{a as ge}from"./chunk-BLK2LKKQ.js";import{a as fe}from"./chunk-K476KKJZ.js";import"./chunk-JNJVSAX4.js";import{a as ve}from"./chunk-EYGJMYDD.js";import{c as De}from"./chunk-PMI2WQAS.js";import"./chunk-KUQLWNHJ.js";import"./chunk-2OURCR3L.js";import{b as de,c as Oe}from"./chunk-LQJB4OYZ.js";import{a as Se}from"./chunk-C7Y6RABB.js";import"./chunk-S5FXQJQU.js";import{a as le}from"./chunk-ACXLTRWN.js";import"./chunk-SX5E4KPZ.js";import"./chunk-YTA6444Z.js";import"./chunk-6UUAXWY5.js";import{A as _e,B as ae,g as ee,h as ie,m as te,p as oe,q as ne,s as re}from"./chunk-ILKNWOFZ.js";import{a as pe}from"./chunk-NVBWSSMM.js";import{A as w,Ab as H,Ba as l,Bb as W,Ca as m,Ef as me,Ja as F,Jb as K,Lc as Q,Ma as M,Tf as Ee,Ua as s,Uf as ce,X as k,Ze as se,_ as v,_c as Y,aa as L,ae as f,ag as Te,bb as n,bd as Z,cb as o,db as c,eb as G,fb as x,kg as ue,lb as a,mb as X,nb as z,pb as j,qb as B,rc as q,rg as Ie,sc as J}from"./chunk-NI3LE45J.js";import{j as E,k as b}from"./chunk-7AP3UAUQ.js";var I=class I{constructor(T,t){this.authHttp=T;this.restExtractor=t;}editVideo(T,t){let i=De.BASE_VIDEO_URL+"/"+T+"/studio/edit",r=me({tasks:t});return this.authHttp.post(i,r).pipe(w(d=>this.restExtractor.handleError(d)));}};E(I,"\u0275fac",function(t){return new(t||I)(v(Q),v(ce));}),E(I,"\u0275prov",k({token:I,factory:I.ɵfac}));var S=I;function $e(g,T){if(g&1&&(n(0,"li"),H(1),o()),g&2){let t=T.$implicit;l(),W(t);}}function Re(g,T){if(g&1&&(n(0,"div",37)(1,"div",34),a(2,12),o(),n(3,"ol"),M(4,$e,2,1,"li",38),o()()),g&2){let t=B();l(4),s("ngForOf",t.getTasksSummary());}}var O=class O extends Oe{constructor(t,i,e,r,d,p,u,C){super();this.formReactiveService=t;this.serverService=i;this.notifier=e;this.router=r;this.route=d;this.videoStudioService=p;this.loadingBar=u;this.confirmService=C;E(this,"isRunningEdition",!1);E(this,"video");}ngOnInit(){this.video=this.route.snapshot.data.video;let t={cut:{start:0,end:this.video.duration}};this.buildForm({cut:{start:null,end:null},"add-intro":{file:null},"add-outro":{file:null},"add-watermark":{file:null}},t);}get videoExtensions(){return this.serverService.getHTMLConfig().video.file.extensions;}get imageExtensions(){return this.serverService.getHTMLConfig().video.image.extensions;}runEdition(){return b(this,null,function*(){if(this.isRunningEdition||!this.form.valid||this.noEdition())return;let t="Are you sure you want to edit \""+this.video.name+"\"?",i=this.getTasksSummary().map(d=>`<li>${d}</li>`).join(""),e="The current video will be overwritten by this edited video and <strong>you won't be able to recover it</strong>.<br /><br />"+("As a reminder, the following tasks will be executed: <ol>"+i+"</ol>");if((yield this.confirmService.confirm(e,t))!==!0)return;this.isRunningEdition=!0;let r=this.buildTasks();return this.loadingBar.useRef().start(),this.videoStudioService.editVideo(this.video.uuid,r).subscribe({next:()=>{this.notifier.success("Edition tasks created."),this.router.navigateByUrl("/my-library/videos");},error:d=>{this.loadingBar.useRef().complete(),this.isRunningEdition=!1,this.notifier.error(d.message),se.error(d);}});});}getIntroOutroTooltip(){return"(extensions: "+this.videoExtensions.join(", ")+")";}getWatermarkTooltip(){return"(extensions: "+this.imageExtensions.join(", ")+")";}noEdition(){return this.buildTasks().length===0;}getTasksSummary(){return this.buildTasks().map(i=>{if(i.name==="add-intro")return"\""+this.getFilename(i.options.file)+"\" will be added at the beginning of the video";if(i.name==="add-outro")return"\""+this.getFilename(i.options.file)+"\" will be added at the end of the video";if(i.name==="add-watermark")return"\""+this.getFilename(i.options.file)+"\" image watermark will be added to the video";if(i.name==="cut"){let{start:e,end:r}=i.options;if(e!==void 0&&r!==void 0)return"Video will begin at "+f(e)+" and stop at "+f(r)+"";if(e!==void 0)return"Video will begin at "+f(e)+"";if(r!==void 0)return"Video will stop at "+f(r)+"";}return"";});}getFilename(t){return t.name;}buildTasks(){var r,d,p;let t=[],i=this.form.value,e=i.cut;if(e.start!==0||e.end!==this.video.duration){let u={};e.start!==0&&(u.start=e.start),e.end!==this.video.duration&&(u.end=e.end),t.push({name:"cut",options:u});}return(r=i["add-intro"])!=null&&r.file&&t.push({name:"add-intro",options:{file:i["add-intro"].file}}),(d=i["add-outro"])!=null&&d.file&&t.push({name:"add-outro",options:{file:i["add-outro"].file}}),(p=i["add-watermark"])!=null&&p.file&&t.push({name:"add-watermark",options:{file:i["add-watermark"].file}}),t;}};E(O,"\u0275fac",function(i){return new(i||O)(m(de),m(ue),m(Ee),m(Z),m(Y),m(S),m(le),m(Te));}),E(O,"\u0275cmp",L({type:O,selectors:[["my-video-studio-edit"]],standalone:!0,features:[F,K],decls:47,vars:19,consts:()=>{let t;t="Select the intro video file";let i;i="Select the outro video file";let e;e="Select watermark image file";let r;r="Run video edition";let d;d="Studio for "+"\uFFFD0\uFFFD"+"";let p;p="CUT VIDEO";let u;u="Set a new start/end.";let C;C="New start";let N;N="New end";let P;P="ADD INTRO";let $;$="Concatenate a file at the beginning of the video.";let R;R="ADD OUTRO";let V;V="Concatenate a file at the end of the video.";let h;h="ADD WATERMARK";let A;A="Add a watermark image to the video.";let y;y="Video before edition";let U;return U="Edition tasks:",[d,p,u,C,N,P,$,R,V,h,A,y,U,[1,"margin-content"],[1,"title-page"],["iconName","film"],[1,"grid-container"],[3,"formGroup"],["formGroupName","cut",1,"section","cut"],[1,"section-label"],[1,"description"],[1,"form-group"],["for","cutStart"],["inputName","cutStart","enableBorder","true","formControlName","start",3,"maxTimestamp"],["for","cutEnd"],["inputName","cutEnd","enableBorder","true","formControlName","end",3,"maxTimestamp"],["formGroupName","add-intro",1,"section"],["formControlName","file","inputName","addIntroFile","input
1Label",t,3,"extensions","displayFilename","displayReset","buttonTooltip"],["formGroupName","add-outro",1,"section"],["formControlName","file","inputName","addOutroFile","inputLabel",i,3,"extensions","displayFilename","displayReset","buttonTooltip"],["formGroupName","add-watermark",1,"section"],["formControlName","file","inputName","addWatermarkFile","inputLabel",e,3,"extensions","displayFilename","displayReset","buttonTooltip"],["theme","primary","label",r,"icon","circle-tick",3,"click","keydown.enter","disabled"],[1,"embed-container"],[1,"mb-1","fw-bold"],[3,"video"],["class","tasks-container",4,"ngIf"],[1,"tasks-container"],[4,"ngFor","ngForOf"]];},template:function(i,e){i&1&&(n(0,"div",13)(1,"h1",14),c(2,"my-global-icon",15),G(3),a(4,0),x(),o(),n(5,"div",16)(6,"form",17)(7,"div",18)(8,"h2",19),a(9,1),o(),n(10,"div",20),a(11,2),o(),n(12,"div",21)(13,"label",22),a(14,3),o(),c(15,"my-timestamp-input",23),o(),n(16,"div",21)(17,"label",24),a(18,4),o(),c(19,"my-timestamp-input",25),o()(),n(20,"div",26)(21,"h2",19),a(22,5),o(),n(23,"div",20),a(24,6),o(),n(25,"div",21),c(26,"my-reactive-file",27),o()(),n(27,"div",28)(28,"h2",19),a(29,7),o(),n(30,"div",20),a(31,8),o(),n(32,"div",21),c(33,"my-reactive-file",29),o()(),n(34,"div",30)(35,"h2",19),a(36,9),o(),n(37,"div",20),a(38,10),o(),n(39,"div",21),c(40,"my-reactive-file",31),o()(),n(41,"my-button",32),j("click",function(){return e.runEdition();})("keydown.enter",function(){return e.runEdition();}),o()(),n(42,"div",33)(43,"div",34),a(44,11),o(),c(45,"my-embed",35),o(),M(46,Re,5,1,"div",36),o()()),i&2&&(l(4),X(e.video.name),z(4),l(2),s("formGroup",e.form),l(9),s("maxTimestamp",e.video.duration),l(4),s("maxTimestamp",e.video.duration),l(7),s("extensions",e.videoExtensions)("displayFilename",!0)("displayReset",!0)("buttonTooltip",e.getIntroOutroTooltip()),l(7),s("extensions",e.videoExtensions)("displayFilename",!0)("displayReset",!0)("buttonTooltip",e.getIntroOutroTooltip()),l(7),s("extensions",e.imageExtensions)("displayFilename",!0)("displayReset",!0)("buttonTooltip",e.getWatermarkTooltip()),l(),s("disabled",!e.form.valid||e.isRunningEdition||e.noEdition()),l(4),s("video",e.video),l(),s("ngIf",!e.noEdition()));},dependencies:[_e,te,ee,ie,ae,oe,re,ne,ge,Ce,Se,fe,J,q,pe],styles:["my-timestamp-input[_ngcontent-%COMP%]{display:block;width:100px}.grid-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;column-gap:calc(1.425rem + 2.1vw);row-gap:calc(1.325rem + .9vw)}@media (min-width: 1200px){.grid-container[_ngcontent-%COMP%]{column-gap:3rem}}@media (min-width: 1200px){.grid-container[_ngcontent-%COMP%]{row-gap:2rem}}.grid-container[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{grid-column:1;grid-row:1/3}.grid-container[_ngcontent-%COMP%] .embed-container[_ngcontent-%COMP%]{grid-column:2;grid-row:1}.grid-container[_ngcontent-%COMP%] .tasks-container[_ngcontent-%COMP%]{grid-column:2;grid-row:2}@media screen and (max-width: 800px){.grid-container[_ngcontent-%COMP%]{grid-template-columns:1fr;grid-template-rows:auto auto 1fr}.grid-container[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{grid-column:1;grid-row:2}.grid-container[_ngcontent-%COMP%] .embed-container[_ngcontent-%COMP%]{grid-column:1;grid-row:1}.grid-container[_ngcontent-%COMP%] .tasks-container[_ngcontent-%COMP%]{grid-column:1;grid-row:3}}h2[_ngcontent-%COMP%]{font-weight:700;font-size:16px;padding:0 5px;width:fit-content;margin-top:.5rem}.section[_ngcontent-%COMP%]{min-width:600px;margin-bottom:50px;border:1px solid transparent;background:var(--bg-secondary-400);border-radius:5px;width:fit-content;padding-inline-start:.625rem}.section[_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%], .section[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin-inline-start:.3125rem}.section[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{color:var(--fg-300);margin-top:5px;margin-bottom:15px}@media screen and (max-width: 600px){.section[_ngcontent-%COMP%]{min-width:100%}}my-embed[_ngcontent-%COMP%]{display:block;max-width:500px;width:100%}my-reactive-file[_ngcontent-%COMP%]{display:block;width:fit-content}"]}));var D=O;var _i=[{path:"",canActivateChild:[Ie],providers:[S],children:[{path:"edit/:videoId",component:D,data:{meta:{title:"Studio"}},resolve:{video:ve}}]}];export{_i as default};/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.