PageSourceSearch

https://neat.tube/client/en-US/chunk-KSMKAP3L.js

js neat.tube collected 2026-10-05 10:32:57 UTC 349,695 bytes, 37 lines download raw bytes

1import{a as tl}from"./chunk-2MWSZKMP.js";import{a as nl}from"./chunk-S4WRAL26.js";import{a as Hi,b as ji,c as Ya,d as Za,e as al,f as dl,g as cl,h as po}from"./chunk-NS2ZJFK5.js";import{a as $t,b as _l,c as sl}from"./chunk-HAPKDW77.js";import{a as La,b as ya}from"./chunk-VY7URCCF.js";import{a as $a,b as Wn}from"./chunk-JXKTNGMD.js";import{a as wa}from"./chunk-VZAELX7W.js";import{b as xa}from"./chunk-C2KV35ZG.js";import"./chunk-FM5PYVED.js";import{a as Rn}from"./chunk-HNYWPJQG.js";import{e as ka,g as Xa}from"./chunk-ECGNRZAO.js";import{a as Ca,b as Ea,c as ga,d as Na,e as Sa,f as Ma,g as Li,h as yi,i as fa,j as Aa,k as Ia,l as Oa,m as Ta,n as $i,o as Pa,p as Ra,q as ha,s as va,t as xi,u as wi,v as Ue,w as Qt,x as si}from"./chunk-KWVSCH2H.js";import{b as On,c as jt}from"./chunk-ZY32XQLH.js";import{a as Fa}from"./chunk-HY4QHXNE.js";import"./chunk-OPRQNONW.js";import"./chunk-G6JMM6YH.js";import"./chunk-THGGAECT.js";import{a as Qa,b as qa,c as Ja,d as qi,e as Ki}from"./chunk-4YCBVEHN.js";import{a as ll}from"./chunk-QBE7TA47.js";import{c as Ka}from"./chunk-YMJUFDU5.js";import{a as jn,c as je,d as Wi}from"./chunk-X34HFSAT.js";import"./chunk-GRECWXSU.js";import{a as ja}from"./chunk-AQEMCWZ4.js";import{c as Qn}from"./chunk-BVBJUU3U.js";import{a as Je}from"./chunk-WD3ZVVJS.js";import"./chunk-WOFXRQ4V.js";import{a as il}from"./chunk-XJN7VZ2J.js";import{b as Xi,c as Pn,g as Va,h as Bn}from"./chunk-QLOAR54U.js";import{a as Bi}from"./chunk-XOTV7GJG.js";import{a as pt}from"./chunk-DVYB3SDD.js";import{a as Ba,b as Ha,k as ol,l as rl}from"./chunk-NKAZMGCL.js";import{a as Wa}from"./chunk-Q3D5PUAM.js";import{a as Tn}from"./chunk-N57YLHBF.js";import"./chunk-Y7Q577DU.js";import{a as el}from"./chunk-CLSEWCAF.js";import{a as Ji}from"./chunk-GZPJHEDD.js";import"./chunk-2XSXSKOZ.js";import{a as Xn}from"./chunk-LE3BFIWM.js";import"./chunk-3IJB6NNK.js";import{a as qt}from"./chunk-TLSMBXOV.js";import{a as He}from"./chunk-PCNKN7TU.js";import{a as Kt}from"./chunk-7WRF56BE.js";import{a as Hn}from"./chunk-52NAGQAE.js";import{a as Qi}from"./chunk-NSCPFWDX.js";import{a as pa}from"./chunk-6QI3LCLL.js";import{a as zi,b as za}from"./chunk-G3J3JU5I.js";import"./chunk-RWFRRD6F.js";import{a as Ua}from"./chunk-JF6CNN2A.js";import"./chunk-2HNNT2VT.js";import{a as ua}from"./chunk-PXFOMLNX.js";import{a as ma}from"./chunk-2IPYKLQX.js";import"./chunk-GXA3YMKZ.js";import"./chunk-I5ANGE3H.js";import{a as zn}from"./chunk-MS5AUBUA.js";import"./chunk-BVVUPDCB.js";import{a as bi,b as Gi}from"./chunk-UIX23F7I.js";import"./chunk-J3MTDSU3.js";import"./chunk-5G7CLTD4.js";import{c as nn}from"./chunk-SGCHCWLM.js";import{a as st}from"./chunk-76SWT53P.js";import{b as Da,c as ba,d as Ui,h as Vi,i as Ga,k as Vn,l as kn,m as ki}from"./chunk-ATXMW3M2.js";import{h as It}from"./chunk-KYFYXE3K.js";import"./chunk-XSS37KCJ.js";import"./chunk-BJVL6ZJ5.js";import{b as Me}from"./chunk-MBQWFBKS.js";import{a as Di}from"./chunk-XU6VXSM7.js";import"./chunk-WYO57RHC.js";import"./chunk-F3H57332.js";import"./chunk-VI342OHG.js";import{a as ca}from"./chunk-DEGXQ3R2.js";import"./chunk-5TE7477A.js";import{c as Ft}from"./chunk-VQCVCUXF.js";import"./chunk-PR244PNT.js";import{a as Un,b as Ke}from"./chunk-MS2CS6MN.js";import{a as wn}from"./chunk-KLZQNCJY.js";import{A as Wt,B as Xr,E as le,F as he,a as Ur,c as Le,d as Ai,g as de,h as Ne,i as Vr,m as kr,o as zt,p as Se,q as yn,t as zr,u as ht,w as ye,x as Re,y as Xt,z as Bt}from"./chunk-7JTNILXC.js";import{G as Ti,u as Oi}from"./chunk-CUOYDGDO.js";import{a as qe}from"./chunk-TTJW756Y.js";import{$b as en,$d as ut,$g as ia,Aa as at,Ab as Mi,Ae as ai,Af as Ii,Bb as z,Be as jr,Bf as Ot,C as ke,Cb as X,D as un,Da as _,Db as s,Dc as Gn,De as bn,E as pn,Eb as $,Ec as ue,Ef as ee,F as Ni,Fb as x,Fc as me,Gb as W,Gd as xe,Hb as P,Hd as Sn,Hh as Xe,I as Rr,Ih as xn,Jb as d,Jc as wr,Jf as _i,Kb as br,Kd as Mn,Kf as ea,Lb as lo,Ld as Pe,M as hr,Mc as fi,Mh as hi,Na as R,Nh as In,Oh as vi,Pa as Dr,Qd as Ln,Qg as ta,Qh as Fi,R as We,Rb as Oe,Rh as sa,Sb as Te,Sg as na,Sh as da,T as Si,Ta as Ct,Tb as pe,Td as Br,Te as _o,Tg as Z,Ua as k,Vb as Gr,Wc as ge,Wd as Dn,Xb as Lr,Y as vr,Yb as g,Z as Tt,Zb as A,Zg as u_,_b as D,_c as Nn,_d as _t,ah as oa,ba as E,bf as Qr,bh as ra,cb as Cn,cc as Nt,ce as fn,cf as qr,d as ii,dc as St,de as oi,ec as Mt,ef as Kr,eh as aa,fd as $e,ff as Jr,ga as L,gb as p,ha as y,hb as C,he as Y,hf as li,hg as uo,ic as kt,ie as ft,ih as vt,j as mn,jb as Ie,je as $n,jf as Yr,jh as At,k as gi,kb as Ce,kc as yr,kh as Pi,lb as Ee,lc as mt,lh as la,mb as c,mc as w,mh as Ri,nb as l,nc as $r,nd as Pt,nh as Ht,o as lt,ob as o,pb as m,pc as xr,pe as Wr,ph as we,qb as Et,qd as Rt,ra as Fr,rb as gt,rf as so,s as Pr,sa as Vt,sb as Fn,sf as Zr,sh as tn,tb as S,tc as K,tf as co,ub as M,uc as ze,vb as ao,vc as se,vh as q,wb as En,we as Hr,wh as _a,xb as gn,xc as F,ye as ri,yf as mo,za as Zt,zb as Q,ze as An}from"./chunk-NY4TI4KT.js";import{a as fe,b as Be,c as Ei,g as m_,i as f,j as _e}from"./chunk-IQVXR75E.js";function p_(e,r){e&1&&(l(0,"my-alert",9),s(1,2),o());}function C_(e,r){if(e&1&&(l(0,"li"),g(1),o()),e&2){let n=r.$implicit;_(),A(n);}}function E_(e,r){if(e&1&&(l(0,"my-alert",10),S(1),s(2,3),M(),l(3,"ul",11),Ce(4,C_,2,1,"li",null,Ie),o()()),e&2){let n=d();_(4),Ee(n.grabAllErrors());}}function g_(e,r){if(e&1&&(l(0,"my-alert",10),g(1),o()),e&2){let n=d();_(),A(n.inconsistentOptions());}}var dt=(()=>{let r=class r{formReactiveService=E(Me);server=E(q);headerService=E(da);screenService=E(xn);peertubeModal=E(pa);title=ue.required();form=ue.required();formErrors=ue.required();validationMessages=ue.required();inconsistentOptions=ue();save=Gn();displayFormErrors=!1;ngOnInit(){this.screenService.isInMobileView()&&this.headerService.setSearchHidden(!0);}
1ngOnDestroy(){this.headerService.setSearchHidden(!1);}isUpdateAllowed(){return this.server.getHTMLConfig().webadmin.configuration.edition.allowed===!0;}canUpdate(){return!this.isUpdateAllowed()||this.inconsistentOptions()?!1:this.form().dirty;}grabAllErrors(){return this.formReactiveService.grabAllErrors(this.formErrors());}openConfigWizard(){this.peertubeModal.openAdminConfigWizardSubject.next({showWelcome:!1});}onSave(t){if(this.displayFormErrors=!1,this.formReactiveService.forceCheck(this.form(),this.formErrors(),this.validationMessages()),this.form().valid){this.save.emit();return;}t.preventDefault(),this.displayFormErrors=!0;}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-save-bar"]],inputs:{title:[1,"title"],form:[1,"form"],formErrors:[1,"formErrors"],validationMessages:[1,"validationMessages"],inconsistentOptions:[1,"inconsistentOptions"]},outputs:{save:"save"},decls:12,vars:4,consts:()=>{let t;t="Open config wizard";let a;a="Save";let i;i=" Updating platform configuration from the web interface is disabled by the system administrator. ";let u;return u="There are errors in the configuration:",[t,a,i,u,[1,"root"],[1,"root-bar"],[1,"buttons"],["theme","secondary",1,"pre-config",3,"click"],["form","admin-config-form","theme","primary","icon","circle-tick",1,"save-button",3,"click","disabled"],["type","primary",1,"d-block","mt-3"],["type","danger",1,"d-block","mt-3"],[1,"mb-0"]];},template:function(a,i){a&1&&(l(0,"div",4)(1,"div",5)(2,"h2"),g(3),o(),l(4,"div",6)(5,"my-button",7),P("click",function(){return i.openConfigWizard();}),s(6,0),o(),l(7,"my-button",8),P("click",function(N){return i.onSave(N);}),s(8,1),o()()(),p(9,p_,2,0,"my-alert",9)(10,E_,6,0,"my-alert",10),p(11,g_,2,1,"my-alert",10),o()),a&2&&(_(3),A(i.title()),_(4),c("disabled",!i.canUpdate()),_(2),C(i.isUpdateAllowed()?i.displayFormErrors&&!i.form().valid?10:-1:9),_(2),C(i.inconsistentOptions()?11:-1));},dependencies:[Ln,Ft,st],styles:[`.root[_ngcontent-%COMP%]{position:sticky;top:var(--header-height);z-index:11;background-color:var(--bg);margin-bottom:calc(1.425rem + 2.1vw)}@media(min-width:1200px){.root[_ngcontent-%COMP%]{margin-bottom:3rem}}.root-bar[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%;min-width:0;justify-content:center;border-radius:14px;background-color:var(--bg-secondary-350);padding:calc(1.275rem + .3vw)}@media(min-width:1200px){.root-bar[_ngcontent-%COMP%]{padding:1.5rem}}.buttons[_ngcontent-%COMP%]{margin-inline-start:auto}.pre-config[_ngcontent-%COMP%]{display:inline-block;margin-inline-end:.5rem}h2[_ngcontent-%COMP%]{flex-shrink:1;color:var(--fg-350);font-weight:700;margin-bottom:0;line-height:normal;margin-inline-start:auto;font-size:calc(1.275rem + .3vw)}@media(min-width:1200px){h2[_ngcontent-%COMP%]{font-size:1.5rem}}h2[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media screen and (max-width:800px){.root-bar[_ngcontent-%COMP%]{flex-direction:column;align-items:center;padding:.5rem}.buttons[_ngcontent-%COMP%], h2[_ngcontent-%COMP%]{margin-inline-start:0}}
2/*# sourceMappingURL=admin-save-bar.component-JLFW6YVP.css.map */`]}));let e=r;return e;})();var N_=e=>({"input-error":e});function S_(e,r){if(e&1&&(l(0,"div",21),g(1),o()),e&2){let n=d();_(),A(n.formErrors.services.twitter.username);}}var ml=(()=>{let r=class r{route=E(xe);formReactiveService=E(Me);adminConfigService=E(Ue);form;formErrors={};validationMessages={};customConfig;customConfigSub;ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig,this.buildForm(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(t=>{this.customConfig=t,this.form.patchValue(this.customConfig);});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}canDeactivate(){return{canDeactivate:!this.form.dirty};}buildForm(){let t={services:{twitter:{username:ga}}},a=this.customConfig,{form:i,formErrors:u,validationMessages:N}=this.formReactiveService.buildForm(t,a);this.form=i,this.formErrors=u,this.validationMessages=N;}save(){this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:this.form.value,success:"Advanced configuration updated."});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-config-advanced"]],decls:27,vars:8,consts:()=>{let t;t="Advanced configuration";let a;a="CACHE";let i;i=" Some files are not federated, and fetched when necessary. Define their caching policies. ";let u;u="TWITTER/X";let N;N=" Extra configuration required by Twitter/X. All other social media (Facebook, Mastodon, etc.) are supported out of the box. ";let I;I="Your Twitter/X username";let T;T="Indicates the Twitter/X account for the website or platform where the content was published.";let h;return h="This is just an extra information injected in PeerTube HTML that is required by Twitter/X. If you don't have a Twitter/X account, just leave the default value.",[a,i,u,N,I,T,h,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"inner-form-description"],[1,"pt-two-cols","mt-4"],[1,"content-col"],["formGroupName","services"],["formGroupName","twitter"],[1,"form-group"],["for","servicesTwitterUsername"],[1,"form-group-description"],[1,"mb-0"],["type","text","id","servicesTwitterUsername","formControlName","username",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"]];},template:function(a,i){a&1&&(l(0,"my-admin-save-bar",7),P("save",function(){return i.save();}),o(),l(1,"form",8)(2,"div",9)(3,"div",10)(4,"h2"),s(5,0),o(),l(6,"div",11),s(7,1),o()()(),l(8,"div",12)(9,"div",10)(10,"h2"),s(11,2),o(),l(12,"div",11),s(13,3),o()(),l(14,"div",13),S(15,14)(16,15),l(17,"div",16)(18,"label",17),s(19,4),o(),l(20,"div",18)(21,"p",19),s(22,5),o(),l(23,"p"),s(24,6),o()(),m(25,"input",20),p(26,S_,2,1,"div",21),o(),M()(),o()()()),a&2&&(c("form",i.form)("formErrors",i.formErrors)("validationMessages",i.validationMessages),_(),c("formGroup",i.form),_(24),c("ngClass",w(6,N_,i.formErrors.services.twitter.username)),_(),C(i.formErrors.services.twitter.username?26:-1));},dependencies:[$e,ge,le,Se,Le,de,Ne,he,Re,ye,ht,dt],styles:[`form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player
2-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}
3/*# sourceMappingURL=admin-config-common-H5GGBR3J.css.map */`]}));let e=r;return e;})();function M_(e,r){if(e&1&&(l(0,"span",3),g(1),o()),e&2){let n=d(2);_(),A(n.inputSuffix());}}function f_(e,r){if(e&1){let n=Q();l(0,"input",2),Mt("ngModelChange",function(a){L(n);let i=d();return St(i.customValue,a)||(i.customValue=a),y(a);}),P("ngModelChange",function(){L(n);let a=d();return y(a.onModelChange());}),o(),p(1,M_,2,1,"span",3);}if(e&2){let n=d();Nt("ngModel",n.customValue),c("type",n.inputType()),Cn("aria-labelledby",n.labelId()),_(),C(n.inputSuffix()?1:-1);}}var Dt=(()=>{let r=class r{inputId=ue.required();labelId=ue.required();items=ue([]);clearable=ue(!1);searchable=ue(!1);inputSuffix=ue(void 0);inputType=ue("text");customValue="";selectedId;disabled=!1;itemsWithCustom=[];ngOnChanges(){this.itemsWithCustom=this.getItems();}propagateChange=t=>{};writeValue(t){this.selectedId=t,this.isSelectedIdInItems()!==!0&&(this.selectedId="other",this.customValue=t);}registerOnChange(t){this.propagateChange=t;}registerOnTouched(){}onModelChange(){return this.selectedId==="other"?this.propagateChange(this.customValue):this.propagateChange(this.selectedId);}isSelectedIdInItems(){return!!this.items().find(t=>t.id===this.selectedId);}getItems(){let t={id:"other",label:"Custom value..."};return this.items().concat([t]);}isCustomValue(){return this.selectedId==="other";}setDisabledState(t){this.disabled=t;}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-select-custom-value"]],hostVars:2,hostBindings:function(a,i){a&2&&Gr("has-custom-value",i.isCustomValue());},inputs:{inputId:[1,"inputId"],labelId:[1,"labelId"],items:[1,"items"],clearable:[1,"clearable"],searchable:[1,"searchable"],inputSuffix:[1,"inputSuffix"],inputType:[1,"inputType"]},features:[yr([{provide:Ur,useExisting:vr(()=>r),multi:!0}]),Fr],decls:3,vars:5,consts:[[1,"d-flex","align-items-center"],[1,"flex-grow-1",3,"ngModelChange","inputId","disabled","items","ngModel"],[1,"ms-2","form-control","pt-input-text",3,"ngModelChange","ngModel","type"],[1,"ms-1"]],template:function(a,i){a&1&&(l(0,"div",0)(1,"my-select-options",1),Mt("ngModelChange",function(N){return St(i.selectedId,N)||(i.selectedId=N),N;}),P("ngModelChange",function(){return i.onModelChange();}),o(),p(2,f_,2,4),o()),a&2&&(_(),c("inputId",i.inputId())("disabled",i.disabled)("items",i.itemsWithCustom),Nt("ngModel",i.selectedId),_(),C(i.isCu
3stomValue()?2:-1));},dependencies:[It,le,Le,de,zt],encapsulation:2}));let e=r;return e;})();function A_(e,r){if(e&1&&(En(0),s(1,1),K(2,"bytes"),gn()),e&2){let n=d(2);_(2),$(se(2,1,n.computeQuotaWithTranscoding(),0)),x(1);}}function I_(e,r){if(e&1&&(Et(0,"div"),En(1),z(2,0),Fn(3,"strong"),X(),gn(),Fn(4,"br"),p(5,A_,3,4,"ng-container"),gt()),e&2){let n=d();_(5),C(n.isTranscodingInformationDisplayed()?5:-1);}}var qn=(()=>{let r=class r{server=E(q);videoQuota=ue(void 0);serverConfig;ngOnInit(){this.serverConfig=this.server.getHTMLConfig();}isTranscodingInformationDisplayed(){return this.serverConfig.transcoding.enabledResolutions.length!==0;}computeQuotaWithTranscoding(){let t=this.serverConfig.transcoding,a=t.enabledResolutions,i=Wr.H_4K,u=1;for(let N of a)u+=N/i;return t.hls.enabled&&(u*=2),Math.round(u*this.getQuotaAsNumber());}getQuotaAsNumber(){return parseInt(this.videoQuota()+"",10);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-user-real-quota-info"]],inputs:{videoQuota:[1,"videoQuota"]},decls:1,vars:1,consts:()=>{let t;t=" The video quota only takes into account the size of "+"\uFFFD#3\uFFFD"+"uploaded"+"\uFFFD/#3\uFFFD"+" videos, not transcoded files or user export archives (which may contain video files). ";let a;return a=" Transcoding is enabled so real videos size can be at most ~ "+"\uFFFD0\uFFFD"+". ",[t,a];},template:function(a,i){a&1&&p(0,I_,6,1,"div"),a&2&&C(i.getQuotaAsNumber()>0?0:-1);},dependencies:[pt],encapsulation:2}));let e=r;return e;})();var Kn=e=>({"input-error":e}),O_=e=>({"disabled-checkbox-extra":e});function T_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.defaultClientRoute);}}function P_(e,r){e&1&&(l(0,"span"),s(1,75),o());}function R_(e,r){e&1&&(l(0,"span"),s(1,76),o());}function h_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.client.browseVideos.defaultSort);}}function v_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.client.browseVideos.defaultScope);}}function F_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.trending.videos.algorithms.default);}}function D_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.broadcastMessage.level);}}function b_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.broadcastMessage.message);}}function G_(e,r){if(e&1&&(l(0,"my-alert",124),g(1),o()),e&2){let n=d();_(),A(n.signupAlertMessage);}}function L_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.signup.limit);}}function y_(e,r){e&1&&(l(0,"small",133),s(1,77),o());}function $_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.signup.minimumAge);}}function x_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.user.videoQuota);}}function w_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.user.videoQuotaDaily);}}function U_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.import.videos.concurrency);}}function V_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.import.videoChannelSynchronization.maxPerUser," ");}}function k_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.defaults.publish.privacy);}}function z_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.defaults.publish.licence);}}function X_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.defaults.publish.commentsPolicy);}}function B_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.defaults.publish.downloadPolicy);}}function W_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.videoChannels.maxPerUser);}}function H_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.followings.instance.autoFollowIndex.indexUrl," ");}}function j_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.search.searchIndex.url);}}function Q_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.export.users.maxUserVideoQuota);}}function q_(e,r){if(e&1&&(l(0,"div",86),g(1),o()),e&2){let n=d();_(),A(n.formErrors.export.users.exportExpiration);}}var ul=(()=>{let r=class r{server=E(q);route=E(xe);formReactiveService=E(Me);adminConfigService=E(Ue);videoService=E(nn);form;formErrors={};validationMessages={};signupAlertMessage;defaultLandingPageOptions=[];exportExpirationOptions=[];exportMaxUserVideoQuotaOptions=[];privacyOptions=[];commentPoliciesOptions=[];downloadPoliciesOptions=[{id:"allowed",label:"Allowed"},{id:"disabled",label:"Disabled"}];licenceOptions=[];customConfig;customConfigSub;ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig;
3let t=this.route.snapshot.data;this.privacyOptions=this.videoService.explainedPrivacyLabels(t.privacies).videoPrivacies,this.licenceOptions=t.licences,this.commentPoliciesOptions=t.commentPolicies,this.buildLandingPageOptions(),this.exportExpirationOptions=[{id:1e3*3600*24,label:"1 day"},{id:1e3*3600*24*2,label:"2 days"},{id:1e3*3600*24*7,label:"7 days"},{id:1e3*3600*24*30,label:"30 days"}],this.exportMaxUserVideoQuotaOptions=this.getVideoQuotaOptions().filter(a=>a.id>=1),this.buildForm(),this.subscribeToSignupChanges(),this.subscribeToImportSyncChanges(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(a=>{this.customConfig=a,this.form.patchValue(this.buildFormValue(this.customConfig));});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={instance:{defaultClientRoute:null},client:{browseVideos:{defaultSort:null,defaultScope:null},menu:{login:{redirectOnSingleExternalAuth:null}}},signup:{enabled:null,limit:Na,requiresApproval:null,requiresEmailVerification:null,minimumAge:Sa},import:{videos:{concurrency:$i,http:{enabled:null},torrent:{enabled:null}},videoChannelSynchronization:{enabled:null,maxPerUser:Ta},users:{enabled:null}},export:{users:{enabled:null,maxUserVideoQuota:Ra,exportExpiration:Pa}},trending:{videos:{algorithms:{enabled:null,default:null}}},user:{history:{videos:{enabled:null}},videoQuota:Vn,videoQuotaDaily:kn},videoChannels:{maxPerUser:Oa},videoTranscription:{enabled:null,remoteRunners:{enabled:null}},videoFile:{update:{enabled:null}},autoBlacklist:{videos:{ofUsers:{enabled:null}}},followers:{instance:{enabled:null,manualApproval:null},channels:{enabled:null}},followings:{instance:{autoFollowBack:{enabled:null},autoFollowIndex:{enabled:null,indexUrl:On}}},broadcastMessage:{enabled:null,level:null,dismissable:null,message:null},search:{remoteUri:{users:null,anonymous:null},searchIndex:{enabled:null,url:On,disableLocalSearch:null,isDefaultSearch:null}},storyboards:{enabled:null,remoteRunners:{enabled:null}},defaults:{publish:{downloadPolicy:null,commentsPolicy:null,privacy:null,licence:null},p2p:{webapp:{enabled:null},embed:{enabled:null}},player:{autoPlay:null}},videoComments:{acceptRemoteComments:null}},a=this.buildFormValue(this.customConfig),{form:i,formErrors:u,validationMessages:N}=this.formReactiveService.buildForm(t,a);this.form=i,this.formErrors=u,this.validationMessages=N;}buildFormValue(t){return _i(t,{defaults:{publish:{downloadPolicy:t.defaults.publish.downloadEnabled?"allowed":"disabled"}}});}canDeactivate(){return{canDeactivate:!this.form.dirty};}countExternalAuth(){return this.server.getHTMLConfig().plugin.registeredExternalAuths.length;}getVideoQuotaOptions(){return xi();}getVideoQuotaDailyOptions(){return wi();}doesTrendingVideosAlgorithmsEnabledInclude(t){let a=this.form.value.trending.videos.algorithms.enabled;return Array.isArray(a)?!!a.find(i=>i===t):!1;}getUserVideoQuota(){return this.form.value.user.videoQuota;}isExportUsersEnabled(){return this.form.value.export.users.enabled===!0;}getDisabledExportUsersClass(){return{"disabled-checkbox-extra":!this.isExportUsersEnabled()};}isSignupEnabled(){return this.form.value.signup.enabled===!0;}getDisabledSignupClass(){return{"disabled-checkbox-extra":!this.isSignupEnabled()};}isImportVideosHttpEnabled(){return this.form.value.import.videos.http.enabled===!0;}importSynchronizationChecked(){return this.isImportVideosHttpEnabled()&&this.form.value.import.videoChannelSynchronization.enabled;}hasUnlimitedSignup(){return this.form.value.signup.limit===-1;}isSearchIndexEnabled(){return this.form.value.search.searchIndex.enabled===!0;}getDisabledSearchIndexClass(){return{"disabled-checkbox-extra":!this.isSearchIndexEnabled()};}isTranscriptionEnabled(){return this.form.value.videoTranscription.enabled===!0;}getTranscriptionRunnerDisabledClass(){return{"disabled-checkbox-extra":!this.isTranscriptionEnabled()};}isStoryboardEnabled(){return this.form.value.storyboards.enabled===!0;}getStoryboardRunnerDisabledClass(){return{"disabled-checkbox-extra":!this.isStoryboardEnabled()};}isAutoFollowIndexEnabled(){return this.form.value.followings.instance.autoFollowIndex.enabled===!0;}buildLandingPageOptions(){let t=[];this.server.getHTMLConfig().homepage.enabled&&t.push({label:"Home",path:"/home"}),t=t.concat([{label:"Discover",path:"/videos/overview"},{label:"Browse all videos",path:"/videos/browse"},{label:"Browse local videos",path:"/videos/browse?scope=local"}]),this.defaultLandingPageOptions=t.map(a=>({id:a.path,label:a.label,description:a.path}));}subscribeToImportSyncChanges(){let t=this.form.controls,a=t.import.controls.videoChannelSynchronization.controls.enabled;t.import.controls.videos.controls.http.controls.enabled.valueChanges.subscribe(u=>{a.setValue(u&&a.value),u?a.enable():a.disable();});}subscribeToSignupChanges(){let t=this.form.controls.signup.controls.enabled;t.valueChanges.pipe(hr()).subscribe(([a,i])=>{a===!1&&i===!0&&(this.signupAlertMessage="You enabled signup: we automatically enabled the \"Block new videos automatically\" checkbox of the \"Videos\" section just below.",this.form.patchValue({autoBlacklist:{videos:{ofUsers:{enabled:!0}}}}));}),t.updateValueAndValidity();}save(){this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:_i(this.form.value,{defaults:{publish:{downloadEnabled:this.form.value.defaults.publish.downloadPolicy==="allowed"}}}),success:"General configuration updated."});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-config-general"]],decls:404,vars:80,consts:()=>{let t;t="General configuration";let a;
3a="Redirect users on single external auth when users click on the login button in menu";let i;i="Enable broadcast message";let u;u="Allow users to dismiss the broadcast message ";let N;N="Enable Signup";let I;I="Signup requires approval by moderators";let T;T="Signup requires email verification";let h;h="bytes";let b;b="bytes";let G;G="Automatically enable video history for a new user";let U;U="Allow import with HTTP URL (e.g. YouTube)";let J;J="Allow import with a torrent file or a magnet URI";let V;V="Allow channel synchronization with channel of other platforms like YouTube";let te;te="Block new videos automatically";let oe;oe="Allow users to upload a new version of their video";let De;De="Enable video storyboards";let ve;ve="Enable remote runners to generate storyboards";let ce;ce="Enable video transcription";let be;be="Enable remote runners for transcription";let Fe;Fe="Accept comments made on remote platforms";let Ae;Ae="Remote actors can follow channels of your platform";let Ge;Ge="Remote actors can follow your platform";let ie;ie="Manually approve new followers that follow your platform";let Ve;Ve="Automatically follow back followers that follow your platform";let re;re="Automatically follow platforms of a public index";let Qe;Qe="Automatically play videos in the player";let ae;ae="Enable P2P streaming by default on your platform";let Ze;Ze="Enable P2P streaming by default for videos embedded on external websites";let et;et="Allow users to do remote URI/handle search";let tt;tt="Allow anonymous to do remote URI/handle search";let nt;nt="Enable global search";let it;it="Disable local search in search bar";let ot;ot="Search bar uses the global search index by default";let rt;rt="Allow your users to import a data archive";let v;v="Allow your users to export their data";let Gt;Gt="bytes";let Lt;Lt="BEHAVIOR";let yt;yt="Landing page";let ne;ne="BROWSE VIDEOS";let rn;rn="Default sort";let an;an="Default scope";let ln;ln="Default trending algorithm";let _n;_n="Hot videos";let sn;sn="Recent views";let Ut;Ut="Most liked videos";let dn;dn="Global views";let cn;cn="BROADCAST MESSAGE";let H;H=" Display a message on your platform ";let ei;ei="Broadcast message level";let ti;ti="info";let ni;ni="warning";let B;B="error";let Io;Io="Message";let Oo;Oo="NEW USERS";let To;To="\u26A0\uFE0F This functionality requires a lot of attention and extra moderation";let Po;Po="Signup limit";let Ro;Ro="When the total number of users in your platform reaches this limit, registrations are disabled. -1 = unlimited";let ci;ci="{VAR_PLURAL, plural, =1 {user} other {users}}",ci=W(ci,{VAR_PLURAL:"\uFFFD0\uFFFD"});let ho;ho="Minimum required age to create an account";let mi;mi="{VAR_PLURAL, plural, =1 {year old} other {years old}}",mi=W(mi,{VAR_PLURAL:"\uFFFD0\uFFFD"});let vo;vo="Default video quota for a new user";let Fo;Fo="Default daily upload limit for a new user";let Do;Do="VIDEO IMPORTS";let bo;bo="Import jobs concurrency";let Go;Go="allows to import multiple videos in parallel";let Lo;Lo="jobs in parallel";let yo;yo="\u26A0\uFE0F If enabled, we recommend to use "+"\uFFFD#157\uFFFD"+"a HTTP proxy"+"\uFFFD/#157\uFFFD"+" to prevent private URL access from your PeerTube server";let $o;$o="\u26A0\uFE0F We don't recommend to enable this feature if you don't trust your users";let xo;xo=" \u26D4 You need to allow import with HTTP URL to be able to activate this feature. ";let wo;wo="Max channel synchronization per user";let ui;ui="{VAR_PLURAL, plural, =1 {sync} other {syncs}}",ui=W(ui,{VAR_PLURAL:"\uFFFD0\uFFFD"});let Uo;Uo="VIDEOS";let Vo;Vo="Unless a user is marked as trusted, their videos will stay private until a moderator reviews them.";let ko;ko="Generate storyboards of local videos using ffmpeg so users can see the video preview in the player while scrubbing the video";let zo;zo="Use "+"\uFFFD#206\uFFFD"+"remote runners"+"\uFFFD/#206\uFFFD"+" to generate storyboards.";let Xo;Xo="Remote runners have to register on your instance first.";let Bo;Bo=""+"\uFFFD#215\uFFFD"+"Automatically create subtitles"+"\uFFFD/#215\uFFFD"+" for uploaded/imported VOD videos";let Wo;Wo="Use "+"\uFFFD#222\uFFFD"+"remote runners"+"\uFFFD/#222\uFFFD"+" to process transcription tasks.";let Ho;Ho="Remote runners have to register on your instance first.";let jo;jo="Default video privacy";let Qo;Qo="Default video licence";let qo;qo="Default comment policy";let Ko;Ko="Default download policy";let Jo;
3Jo="VIDEO CHANNELS";let Yo;Yo="Max video channels per user";let pi;pi="{VAR_PLURAL, plural, =1 {channel} other {channels}}",pi=W(pi,{VAR_PLURAL:"\uFFFD0\uFFFD"});let Zo;Zo="FEDERATION";let er;er=" Manage "+"\uFFFD#266\uFFFD"+"relations"+"\uFFFD/#266\uFFFD"+" with other platforms. ";let tr;tr="This setting is not retroactive: current comments from remote platforms will not be deleted";let nr;nr="This setting is not retroactive: current followers of channels of your platform will not be affected";let ir;ir="This setting is not retroactive: current followers of your platform will not be affected";let or;or="\u26A0\uFE0F This functionality requires a lot of attention and extra moderation";let rr;rr="\u26A0\uFE0F This functionality requires a lot of attention and extra moderation.";let ar;ar=" See "+"\uFFFD#305\uFFFD"+"the documentation"+"\uFFFD/#305\uFFFD"+" for more information about the expected URL ";let lr;lr="Index URL";let _r;_r="PLAYER";let sr;sr="SEARCH";let dr;dr="Allow "+"\uFFFD#338\uFFFD"+"your users"+"\uFFFD/#338\uFFFD"+" to look up remote videos/actors that may not be federated with your platform";let cr;cr="Allow "+"\uFFFD#344\uFFFD"+"anonymous users"+"\uFFFD/#344\uFFFD"+" to look up remote videos/actors that may not be federated with your platform";let mr;mr="\u26A0\uFE0F This functionality depends heavily on the moderation of platforms followed by the search index you select";let ur;ur="Search index URL";let Ci;Ci=" Use "+"\uFFFD#357\uFFFD"+"your own search index"+"[\uFFFD/#357\uFFFD|\uFFFD/#358\uFFFD]"+" or choose the official one, "+"\uFFFD#358\uFFFD"+"https://sepiasearch.org"+"[\uFFFD/#357\uFFFD|\uFFFD/#358\uFFFD]"+", that is not moderated. ",Ci=W(Ci);let pr;pr="Otherwise, the local search will be used by default";let Cr;Cr="USER IMPORT/EXPORT";let Er;Er="Video quota is checked on import so the user doesn't upload a too big archive file";let gr;gr="Video quota (daily quota is not taken into account) is also checked for each video when PeerTube is processing the import";let Nr;Nr="Users can export their PeerTube data in a .zip for backup or re-import. Only one export at a time is allowed per user";let Sr;Sr="Max user video quota allowed to generate the export";let Mr;Mr="If the user decides to include the video files in the archive";let fr;fr="User export expiration";let Ar;Ar="The archive file is deleted after this period";let Ir;Ir="\u26A0\uFE0F You don't have any external auth plugin enabled";let Or;Or="\u26A0\uFE0F You have multiple external auth plugins enabled";let Tr;return Tr="Signup won't be limited to a fixed number of users",[Lt,yt,ne,rn,an,ln,_n,sn,Ut,dn,cn,H,ei,ti,ni,B,Io,Oo,To,Po,Ro,ci,ho,mi,vo,Fo,Do,bo,Go,Lo,yo,$o,xo,wo,ui,Uo,Vo,ko,zo,Xo,Bo,Wo,Ho,jo,Qo,qo,Ko,Jo,Yo,pi,Zo,er,tr,nr,ir,or,rr,ar,lr,_r,sr,dr,cr,mr,ur,Ci,pr,Cr,Er,gr,Nr,Sr,Mr,fr,Ar,Ir,Or,Tr,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"content-col"],["formGroupName","instance",1,"form-group"],["id","instanceDefaultClientRouteLabel","for","instanceDefaultClientRoute"],["labelId","instanceDefaultClientRouteLabel","inputId","instanceDefaultClientRoute","formControlName","defaultClientRoute","inputType","text",3,"items","clearable"],["role","alert",1,"form-error"],["formGroupName","client"],["formGroupName","menu"],["formGroupName","login"],[1,"form-group"],["inputName","clientMenuLoginRedirectOnSingleExternalAuth","formControlName","redirectOnSingleExternalAuth","labelText",a],["ngProjectAs","description",5,["description"]],[1,"pt-two-cols","mt-4"],["formGroupName","client",1,"form-group"],["formGroupName","browseVideos"],["for","browseVideosDefaultSort"],["inputId","browseVideosDefaultSort","formControlName","defaultSort"],["for","browseVideosDefaultScope"],["inputId","browseVideosDefaultScope","formControlName","defaultScope"],["formGroupName","trending",1,"form-group"],["formGroupName","videos"],["formGroupName","algorithms"],["for","trendingVideosAlgorithmsDefault"],[1,"peertube-select-container"],["id","trendingVideosAlgorithmsDefault","formControlName","default",1,"form-control"],["value","hot"],["value","most-viewed"],["value","most-liked"],["value","views"],[1,"inner-form-description"],["formGroupName","broadcastMessage"],["inputName","broadcastMessageEnabled","formControlName","enabled","labelText",i],["inputName","broadcastMessageDismissable","formControlName","dismissable","labelText",u],["for","broadcastMessageLevel"],["id","broadcastMessageLevel","formControlName","level",1,"form-control"],["value","info"],["value","warning"],["value","error"],["for","broadcastMessageMessage"],["helpType","markdownText"],["inputId","broadcastMessageMessage","formControlName","message","markdownType","to-unsafe-html",3,"formError"],["formGroupName","signup"],["inputName","signupEnabled","formControlName","enabled","labelText",N],["type","primary",1,"d-block","mt-2"],["ngProjectAs","extra",5,["extra"]],["inputName","signupRequiresApproval","formControlName","requiresApproval","labelText",I,3,"ngClass"],["
3inputName","signupRequiresEmailVerification","formControlName","requiresEmailVerification","labelText",T,3,"ngClass"],[3,"ngClass"],["for","signupLimit"],[1,"small","muted","ms-1"],[1,"number-with-unit"],["type","number","min","-1","id","signupLimit","formControlName","limit",1,"form-control",3,"ngClass"],[1,"muted","small"],[1,"mt-3",3,"ngClass"],["for","signupMinimumAge"],["type","number","min","1","id","signupMinimumAge","formControlName","minimumAge",1,"form-control",3,"ngClass"],["formGroupName","user"],["id","userVideoQuotaLabel","for","userVideoQuota"],["labelId","userVideoQuotaLabel","inputId","userVideoQuota","formControlName","videoQuota","inputSuffix",h,"inputType","number",3,"items","clearable"],[1,"mt-2","d-block","small","muted",3,"videoQuota"],["id","userVideoQuotaDaily","for","userVideoQuotaDaily"],["labelId","userVideoQuotaDailyLabel","inputId","userVideoQuotaDaily","formControlName","videoQuotaDaily","inputSuffix",b,"inputType","number",3,"items","clearable"],["formGroupName","history"],["inputName","videosHistoryEnabled","formControlName","enabled","labelText",G],["formGroupName","import"],["for","importConcurrency"],["type","number","id","importConcurrency","formControlName","concurrency"],["formGroupName","http",1,"form-group"],["inputName","importVideosHttpEnabled","formControlName","enabled","labelText",U],["href","https://docs.joinpeertube.org/maintain/configuration#security",1,"link-primary"],["formGroupName","torrent",1,"form-group"],["inputName","importVideosTorrentEnabled","formControlName","enabled","labelText",J],["formGroupName","videoChannelSynchronization"],["inputName","importSynchronizationEnabled","formControlName","enabled","labelText",V],[3,"hidden"],["for","videoChannelSynchronizationMaxPerUser"],["type","number","min","1","id","videoChannelSynchronizationMaxPerUser","formControlName","maxPerUser",1,"form-control",3,"ngClass"],["formGroupName","autoBlacklist"],["formGroupName","ofUsers"],["inputName","autoBlacklistVideosOfUsersEnabled","formControlName","enabled","labelText",te],["formGroupName","videoFile"],["formGroupName","update"],["inputName","videoFileUpdateEnabled","formControlName","enabled","labelText",oe],["formGroupName","storyboards"],["inputName","storyboardsEnabled","formControlName","enabled","labelText",De],["formGroupName","remoteRunners",1,"form-group",3,"ngClass"],["inputName","storyboardsRemoteRunnersEnabled","formControlName","enabled","labelText",ve],["routerLink","/admin/settings/system/runners/runners-list"],["formGroupName","videoTranscription"],["inputName","videoTranscriptionEnabled","formControlName","enabled","labelText",ce],["href","https://docs.joinpeertube.org/admin/configuration#automatic-transcription","target","_blank"],["inputName","videoTranscriptionRemoteRunnersEnabled","formControlName","enabled","labelText",be],["formGroupName","defaults"],["formGroupName","publish"],["for","defaultsPublishPrivacy"],["inputId","defaultsPublishPrivacy","formControlName","privacy",3,"items"],["for","defaultsPublishLicence"],["inputId","defaultsPublishLicence","formControlName","licence","clearable","true",3,"items"],["for","defaultsPublishCommentsPolicy"],["inputId","defaultsPublishCommentsPolicy","formControlName","commentsPolicy",3,"items"],["for","defaultsDownloadPolicy"],["inputId","defaultsDownloadPolicy","formControlName","downloadPolicy",3,"items"],["formGroupName","videoChannels",1,"form-group"],["for","videoChannelsMaxPerUser"],["type","number","min","1","id","videoChannelsMaxPerUser","formControlName","maxPerUser",1,"form-control",3,"ngClass"],["routerLink","/admin/settings/follows",1,"link-primary"],["formGroupName","videoComments"],["inputName","videoCommentsAcceptRemoteComments","formControlName","acceptRemoteComments","labelText",Fe],["formGroupName","followers"],["formGroupName","channels"],["inputName","followersChannelsEnabled","formControlName","enabled","labelText",Ae],["formGroupName","instance"],["inputName","followersInstanceEnabled","formControlName","enabled","labelText",Ge],["inputName","followersInstanceManualApproval","formControlName","manualApproval","labelText",ie],["formGroupName","followings"],["formGroupName","autoF
3ollowBack"],["inputName","followingsInstanceAutoFollowBackEnabled","formControlName","enabled","labelText",Ve],["formGroupName","autoFollowIndex"],["inputName","followingsInstanceAutoFollowIndexEnabled","formControlName","enabled","labelText",re],["href","https://docs.joinpeertube.org/admin/following-instances#automatically-follow-other-instances","rel","noopener noreferrer","target","_blank",1,"link-primary"],["for","followingsInstanceAutoFollowIndexUrl"],["type","text","id","followingsInstanceAutoFollowIndexUrl","formControlName","indexUrl",1,"form-control",3,"ngClass"],["formGroupName","player"],["inputName","defaultsPlayerAutoplay","formControlName","autoPlay","labelText",Qe],["formGroupName","p2p"],["formGroupName","webapp",1,"form-group"],["inputName","defaultsP2PWebappEnabled","formControlName","enabled","labelText",ae],["formGroupName","embed",1,"form-group"],["inputName","defaultsP2PEmbedEnabled","formControlName","enabled","labelText",Ze],["formGroupName","search"],["formGroupName","remoteUri"],["inputName","searchRemoteUriUsers","formControlName","users","labelText",et],["inputName","searchRemoteUriAnonymous","formControlName","anonymous","labelText",tt],["formGroupName","searchIndex"],["
3inputName","searchIndexEnabled","formControlName","enabled","labelText",nt],["for","searchIndexUrl"],[1,"form-group-description"],["target","_blank","href","https://framagit.org/framasoft/peertube/search-index",1,"link-primary"],["target","_blank","href","https://sepiasearch.org",1,"link-primary"],["type","text","id","searchIndexUrl","formControlName","url",1,"form-control",3,"ngClass"],[1,"mt-3"],["inputName","searchIndexDisableLocalSearch","formControlName","disableLocalSearch","labelText",it,3,"ngClass"],["inputName","searchIndexIsDefaultSearch","formControlName","isDefaultSearch","labelText",ot,3,"ngClass"],["formGroupName","users"],["inputName","importUsersEnabled","formControlName","enabled","labelText",rt],["formGroupName","export"],["inputName","exportUsersEnabled","formControlName","enabled","labelText",v],[1,"form-group",3,"ngClass"],["id","exportUsersMaxUserVideoQuota","for","exportUsersMaxUserVideoQuota"],[1,"ms-2","small","muted"],["labelId","exportUsersMaxUserVideoQuota","inputId","exportUsersMaxUserVideoQuota","formControlName","maxUserVideoQuota","inputSuffix",Gt,"inputType","number",3,"items","clearable"],["for","exportUsersExportExpiration"],["inputId","exportUsersExportExpiration","formControlName","exportExpiration",3,"items"],[1,"mt-1","small","muted"]];},template:function(a,i){a&1&&(l(0,"my-admin-save-bar",78),P("save",function(){return i.save();}),o(),l(1,"form",79)(2,"div",80)(3,"div",81)(4,"h2"),s(5,0),o()(),l(6,"div",82)(7,"div",83)(8,"label",84),s(9,1),o(),m(10,"my-select-custom-value",85),p(11,T_,2,1,"div",86),o(),S(12,87)(13,88)(14,89),l(15,"div",90)(16,"my-peertube-checkbox",91),S(17,92),p(18,P_,2,0,"span")(19,R_,2,0,"span"),M(),o()(),M()()(),o()(),l(20,"div",93)(21,"div",81)(22,"h2"),s(23,2),o()(),l(24,"div",82)(25,"div",94),S(26,95),l(27,"div",90)(28,"label",96),s(29,3),o(),m(30,"my-select-videos-sort",97),p(31,h_,2,1,"div",86),o(),l(32,"div",90)(33,"label",98),s(34,4),o(),m(35,"my-select-videos-scope",99),p(36,v_,2,1,"div",86),o(),M(),o(),l(37,"div",100),S(38,101)(39,102),l(40,"label",103),s(41,5),o(),l(42,"div",104)(43,"select",105)(44,"option",106),s(45,6),o(),l(46,"option",107),s(47,7),o(),l(48,"option",108),s(49,8),o(),l(50,"option",109),s(51,9),o()()(),p(52,F_,2,1,"div",86),M()(),o()()(),l(53,"div",93)(54,"div",81)(55,"h2"),s(56,10),o(),l(57,"div",110),s(58,11),o()(),l(59,"div",82),S(60,111),l(61,"div",90),m(62,"my-peertube-checkbox",112),o(),l(63,"div",90),m(64,"my-peertube-checkbox",113),o(),l(65,"div",90)(66,"label",114),s(67,12),o(),l(68,"div",104)(69,"select",115)(70,"option",116),s(71,13),o(),l(72,"option",117),s(73,14),o(),l(74,"option",118),s(75,15),o()()(),p(76,D_,2,1,"div",86),o(),l(77,"div",90)(78,"label",119),s(79,16),o(),m(80,"my-help",120)(81,"my-markdown-textarea",121),p(82,b_,2,1,"div",86),o(),M(),o()(),l(83,"div",93)(84,"div",81)(85,"h2"),s(86,17),o()(),l(87,"div",82),S(88,122),l(89,"div",90)(90,"my-peertube-checkbox",123),S(91,92),l(92,"span"),s(93,18),o(),p(94,G_,2,1,"my-alert",124),M(),S(95,125),l(96,"div",90),m(97,"my-peertube-checkbox",126),o(),l(98,"div",90),m(99,"my-peertube-checkbox",127),o(),l(100,"div",128)(101,"label",129),s(102,19),o(),l(103,"span",130),s(104,20),o(),l(105,"div",131),m(106,"input",132),l(107,"span"),s(108,21),o()(),p(109,L_,2,1,"div",86),p(110,y_,2,0,"small",133),o(),l(111,"div",134)(112,"label",135),s(113,22),o(),l(114,"div",131),m(115,"input",136),l(116,"span"),s(117,23),o()(),p(118,$_,2,1,"div",86),o(),M(),o()(),M(),S(119,137),l(120,"div",90)(121,"label",138),s(122,24),o(),m(123,"my-select-custom-value",139)(124,"my-user-real-quota-info",140),p(125,x_,2,1,"div",86),o(),l(126,"div",90)(127,"label",141),s(128,25),o(),m(129,"my-select-custom-value",142),p(130,w_,2,1,"div",86),o(),l(131,"div",90),S(132,143)(133,101),m(134,"my-peertube-checkbox",144),M()(),o(),M(),o()(),l(135,"div",93)(136,"div",81)(137,"h2"),s(138,26),o()(),l(139,"div",82),S(140,145)(141,101),l(142,"div",90)(143,"label",146),s(144,27),o(),l(145,"span",130),s(146,28),o(),l(147,"div",131),m(148,"input",147),l(149,"span"),s(150,29),o()(),p(151,U_,2,1,"div",86),o(),l(152,"div",148)(153,"my-peertube-checkbox",149),S(154,92),l(155,"span"),z(156,30),m(157,"a",150),X(),o(),M(),o()(),l(158,"div",151)(159,"my-peertube-checkbox",152),S(160,92),l(161,"span"),s(162,31),o(),M(),o()(),M(),S(163,153),l(164,"div",90)(165,"my-peertube-checkbox",154),S(166,92),l(167,"span",155),s(168,32),o(),M(),o()(),l(169,"div",90)(170,"label",156),s(171,33),o(),l(172,"div",131),m(173,"input",157),l(174,"span"),s(175,34),o()(),p(176,V_,2,1,"div",86),o(),M()(),o()(),l(177,"div",93)(178,"div",81)(179,"h2"),s(180,35),o()(),l(181,"div",82),S(182,158)(183,101)(184,159),l(185,"div",90)(186,"my-peertube-checkbox",160),S(187,92),l(188,"span"),s(189,36),o(),M(),o()(),M()()(),S(190,161)(191,162),l(192,"div",90),m(193,"my-peertube-checkbox",163),o(),M()(),S(194,164),l(195,"div",90)(196,"my-peertube-checkbox",165),S(197,92),l(198,"span"),s(199,37),o(),M(),S(200,125),l(201,"div",166)(202,"my-peertube-checkbox",167),S(203,92),l(204,"div"),z(205,38),m(206,"a",168),X(),o(),l(207,"div"),s(208,39),o(),M(),o()(),M(),o()(),M(),S(209,169),l(210,"div",90)(211,"my-peertube-checkbox",170),S(212,92),l(213,"span"),z(214,40),m(215,"a",171),X(),o(),M(),S(216,125),l(217,"div",166)(218,"my-peertube-checkbox",172),S(219,92),l(220,"div"),z(221,41),m(222,"a",168),X(),o(),l(223,"div"),s(224,42),o(),M(),o()(),M(),o()(),M(),S(225,173)(226,174),l(227,"div",90)(228,"label",175),s(229,43),o(),m(230,"my-select-options",176),p(231,k_,2,1,"div",86),o(),l(232,"div",90)(233,"label",177),s(234,44),o(),m(235,"my-select-options",178),p(236,z_,2,1,"div",86),o(),l(237,"div",90)(238,"label",179),s(239,45),o(),m(240,"my-select-options",180),p(241,X_,2,1,"div",86),o(),l(242,"div",90)(243,"label",181),s(244,46),o(),m(245,"my-select-options",182),p(246,B_,2,1,"div",86),o(),M()(),o()(),l(247,"div",93)(248,"div",81)(249,"h2"),s(250,47),o()(),l(251,"div",82)(252,"div",183)(253,"label",184),s(254,48),o(),l(255,"div",131),m(256,"input",185),l(257,"span"),s(258,49),o()(),p(259,W_,2,1,"div",86),o()()(),l(260,"div",93)(261,"div",81)(262,"h2"),s(263,50),o(),l(264,"div",110),z(265,51),m(266,"a",186),X(),o()(),l(267,"div",82),S(268,187),l(269,"div",90)(270,"my-peertube-checkbox",188),S(271,92),l(272,"span"),s(273,52),o(),M(),o()(),M(),S(274,189)(275,190),l(276,"div",90)(277,"my-peertube-checkbox",191),S(278,92),l(279,"span"),s(280,53),o(),M(),o()(),M(),S(281,192),l(282,"div",90)(283,"my-peertube-checkbox",193),S(284,92),l(285,"span"),s(286,54),o(),M(),o()(),l(287,"div",90),m(288,"my-peertube-checkbox",194),o(),M()(),S(289,195)(290,192)(291,196),l(292,"div",90)(293,"my-peertube-checkbox",197),S(294,92),l(295,"span"),s(296,55),o(),M(),o()(),M(),S(297,198),l(298,"div",90)(299,"my-peertube-checkbox",199),S(300,92),l(301,"div"),s(302,56),o(),l(303,"span"),z(304,57),m(305,"a",200),X(),o(),M(),S(306,125),l(307,"div",128)(308,"label",201),s(309,58),o(),m(310,"input",202),p(311,H_,2,1,"div",86),o(),M(),o()(),M()()(),o()(),l(312,"div",93)(313,"div",81)(314,"h2"),s(315,59),o()(),l(316,"div",82),S(317,173)(318,203),l(319,"div",90),m(320,"my-peertube-checkbox",204),o(),M(),S(321,205),l(322,"div",206),m(323,"my-peertube-checkbox",207),o(),l(324,"div",208),m(325,"my-peertube-checkbox",209),o(),M()(),o()(),l(326,"div",93)(327,"div",81)(328,"h2"),s(329,60),o()(),l(330,"div",82),S(331,210)(332,211),l(333,"div",90)(334,"my-peertube-checkbox",212),S(335,92),l(336,"span"),z(337,61),m(338,"strong"),X(),o(),M(),o()(),l(339,"div",90)(340,"my-peertube-checkbox",213),S(341,92),l(342,"span"),z(343,62),m(344,"strong"),X(),o(),M(),o()(),M(),S(345,214),l(346,"div",90)(347,"my-peertube-checkbox",215),S(348,92),l(349,"div"),s(350,63),o(),M(),S(351,125),l(352,"div",128)(353,"label",216),s(354,64),o(),l(355,"div",217),z(356,65),m(357,"a",218)(358,"a",219),X(),o(),m(359,"input",220),p(360,j_,2,1,"div",86),o(),l(361,"div",221),m(362,"my-peertube-checkbox",222),o(),l(363,"div",221)(364,"my-peertube-checkbox",223),S(365,92),l(366,"span"),s(367,66),o(),M(),o()(),M(),o()(),M()(),o()(),l(368,"div",93)(369,"div",81)(370,"h2"),s(371,67),o()(),l(372,"div",82),S(373,145)(374,224),l(375,"div",90)(376,"my-peertube-checkbox",225),S(377,92),l(378,"div"),s(379,68),o(),l(380,"div"),s(381,69),o(),M(),o()(),M()(),S(382,226)(383,224),l(384,"div",90)(385,"my-peertube-checkbox",227),S(386,92),l(387,"span"),s(388,70),o(),M(),S(389,125),l(390,"div",228)(391,"label",229),s(392,71),o(),l(393,"span",230),s(394,72),o(),m(395,"my-select-custom-value",231),p(396,Q_,2,1,"div",86),o(),l(397,"div",228)(398,"label",232),s(399,73),o(),m(400,"my-select-options",233),l(401,"div",234),s(402,74),o(),p(403,q_,2,1,"div",86),o(),M(),o()(),M()(),o()()()),a&2&&(c("form",i.form)("formErrors",i.formErrors)("validationMessages",i.validationMessages),_(),c("formGroup",i.form),_(9),c("items",i.defaultLandingPageOptions)("clearable",!1),_(),C(i.formErrors.instance.defaultClientRoute?11:-1),_(7),C(i.countExternalAuth()===0?18:i.countExternalAuth()>1?19:-1),_(13),C(i.formErrors.client.browseVideos.defaultSort?31:-1),_(5),C(i.formErrors.client.browseVideos.defaultScope?36:-1),_(16),C(i.formErrors.trending.videos.algorithms.default?52:-1),_(24),C(i.formErrors.broadcastMessage.level?76:-1),_(5),c("formError",i.formErrors.broadcastMessage.message),_(),C(i.formErrors.broadcastMessage.message?82:-1),_(12),C(i.signupAlertMessage?94:-1),_(3),c("ngClass",i.getDisabledSignupClass()),_(2),c("ngClass",i.getDisabledSignupClass()),_(),c("ngClass",i.getDisabledSignupClass()),_(6),c("ngClass",w(66,Kn,i.formErrors.signup.limit)),_(2),$(i.form.value.signup.limit),x(108),_(),C(i.formErrors.signup.limit?109:-1),_(),C(i.hasUnlimitedSignup()?110:-1),_(),c("ngClass",i.getDisabledSignupClass()),_(4),c("ngClass",w(68,Kn,i.formErrors.signup.minimumAge)),_(2),$(i.form.value.signup.minimumAge),x(117),_(),C(i.formErrors.signup.minimumAge?118:-1),_(5),c("items",i.getVideoQuotaOptions())("clearable",!1),_(),c("videoQuota",i.getUserVideoQuota()),_(),C(i.formErrors.user.videoQuota?125:-1),_(4),c("items",i.getVideoQuotaDailyOptions())("clearable",!1),_(),C(i.formErrors.user.videoQuotaDaily?130:-1),_(21),C(i.formErrors.import.videos.concurrency?151:-1),_(16),c("hidden",i.isImportVideosHttpEnabled()),_(6),c("ngClass",w(70,Kn,i.formErrors.import.videoChannelSynchronization.maxPerUser)),_(2),$(i.form.value.import.videoChannelSynchronization.maxPerUser),x(175),_(),C(i.formErrors.import.videoChannelSynchronization.maxPerUser?176:-1),_(25),c("ngClass",i.getStoryboardRunnerDisabledClass()),_(16),c("ngClass",i.getTranscriptionRunnerDisabledClass()),_(13),c("items",i.privacyOptions),_(),C(i.formErrors.defaults.publish.privacy?231:-1),_(4),c("items",i.licenceOptions),_(),C(i.formErrors.defaults.publish.licence?236:-1),_(4),c("items",i.commentPoliciesOptions),_(),C(i.formErrors.defaults.publish.commentsPolicy?241:-1),_(4),c("items",i.downloadPoliciesOptions),_(),C(i.formErrors.defaults.publish.downloadPolicy?246:-1),_(10),c("ngClass",w(72,Kn,i.formErrors.videoChannels.maxPerUser)),_(2),$(i.form.value.videoChannels.maxPerUser),x(258),_(),C(i.formErrors.videoChannels.maxPerUser?259:-1),_(48),
3c("ngClass",w(74,O_,!i.isAutoFollowIndexEnabled())),_(3),c("ngClass",w(76,Kn,i.formErrors.followings.instance.autoFollowIndex.indexUrl)),_(),C(i.formErrors.followings.instance.autoFollowIndex.indexUrl?311:-1),_(41),c("ngClass",i.getDisabledSearchIndexClass()),_(7),c("ngClass",w(78,Kn,i.formErrors.search.searchIndex.url)),_(),C(i.formErrors.search.searchIndex.url?360:-1),_(2),c("ngClass",i.getDisabledSearchIndexClass()),_(2),c("ngClass",i.getDisabledSearchIndexClass()),_(26),c("ngClass",i.getDisabledExportUsersClass()),_(5),c("items",i.exportMaxUserVideoQuotaOptions)("clearable",!1),_(),C(i.formErrors.export.users.maxUserVideoQuota?396:-1),_(),c("ngClass",i.getDisabledExportUsersClass()),_(3),c("items",i.exportExpirationOptions),_(3),C(i.formErrors.export.users.exportExpiration?403:-1));},dependencies:[$e,ge,le,Se,Bt,Wt,Le,yn,Xt,de,Ne,Xr,he,Re,ye,ht,Pe,Dt,Ke,wn,Xn,qn,It,st,dt,ya,La],styles:[`form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}
4/*# sourceMappingURL=admin-config-common-H5GGBR3J.css.map */`]}));let e=r;return e;})();function K_(e,r){e&1&&(Fn(0,"br"),En(1),z(2,1),Fn(3,"a",4),X(),gn());}var Yi=(()=>{let r=class r{supportRelMe=ue(!1,{transform:fi});};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-custom-markup-help"]],inputs:{supportRelMe:[1,"supportRelMe"]},decls:5,vars:1,consts:()=>{let t;t=""+"\uFFFD#2\uFFFD"+"Markdown compatible"+"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"+" that also supports "+"\uFFFD#3\uFFFD"+"custom PeerTube HTML tags"+"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"+".\n",t=W(t);let a;return a=""+"\uFFFD#3\uFFFD"+"Mastodon verification link"+"\uFFFD/#3\uFFFD"+" is also supported. ",[t,a,["href","https://en.wikipedia.org/wiki/Markdown#Example","target","_blank","rel","noreferrer noopener",1,"text-decoration-underline"],["href","https://docs.joinpeertube.org/api/custom-client-markup","target","_blank","rel","noreferrer noopener",1,"text-decoration-underline"],["href","https://docs.joinmastodon.org/user/profile/#verification","target","_blank","rel","noopener noreferrer"]];},template:function(a,i){a&1&&(En(0),z(1,0),Fn(2,"a",2)(3,"a",3),X(),gn(),p(4,K_,4,0)),a&2&&(_(4),C(i.supportRelMe()?4:-1));},encapsulation:2}));let e=r;return e;})();function J_(e,r){if(e&1&&(l(0,"div",10),g(1),o()),e&2){let n=d();_(),A(n.formErrors.homepageContent);}}var pl=(()=>{let r=class r{formReactiveService=E(Me);notifier=E(Z);route=E(xe);customMarkup=E(Wn);customPage=E(Hn);form;formErrors={};validationMessages={};ngOnInit(){this.buildForm();}canDeactivate(){return{canDeactivate:!this.form.dirty};}getCustomMarkdownRenderer(){return this.customMarkup.getCustomMarkdownRenderer();}save(){this.customPage.updateInstanceHomepage(this.form.value.homepageContent).subscribe({next:()=>{this.form.markAsPristine(),this.notifier.success("Homepage updated.");},error:t=>this.notifier.handleError(t)});}buildForm(){let t={homepageContent:null},{form:a,formErrors:i,validationMessages:u}=this.formReactiveService.buildForm(t,{homepageContent:this.route.snapshot.data.homepageContent});this.form=a,this.formErrors=i,this.validationMessages=u;}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-config-homepage"]],decls:13,vars:8,consts:()=>{let t;t="Edit your homepage";let a;a="HOMEPAGE";let i;return i="Homepage content",[a,i,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",1,"homepage","pt-two-cols",3,"formGroup"],[1,"title-col"],[1,"content-col"],[1,"form-group"],["for","homepageContent"],[1,"form-group-description"],["inputId","homepageContent","formControlName","homepageContent","dir","ltr","monospace","true",3,"customMarkdownRenderer","debounceTime","formError"],["role","alert",1,"form-error"]];},template:function(a,i){a&1&&(l(0,"my-admin-save-bar",2),P("save",function(){return i.save();}),o(),l(1,"form",3)(2,"div",4)(3,"h2"),s(4,0),o()(),l(5,"div",5)(6,"div",6)(7,"label",7),s(8,1),o(),l(9,"div",8),m(10,"my-custom-markup-help"),o(),m(11,"my-markdown-textarea",9),p(12,J_,2,1,"div",10),o()()()),a&2&&(c("form",i.form)("formErrors",i.formErrors)("validationMessages",i.validationMessages),_(),c("formGroup",i.form),_(10),c("customMarkdownRenderer",i.getCustomMarkdownRenderer())("debounceTime",500)("formError",i.formErrors.homepageContent),_(),C(i.formErrors.homepageContent?12:-1));},dependencies:[le,Se,de,Ne,he,Re,ye,Yi,Xn,dt],styles:[`form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player
4-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}
5/*# sourceMappingURL=admin-config-common-H5GGBR3J.css.map */`]}));let e=r;return e;})();var hn=e=>({"input-error":e});function Y_(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.admin.email);}}function Z_(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.name);}}function es(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.shortDescription);}}function ts(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.serverCountry);}}function ns(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.social.externalLink);}}function is(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.social.mastodonLink);}}function os(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.social.xLink);}}function rs(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.social.blueskyLink);}}function as(e,r){e&1&&(S(0),s(1,40),M());}function ls(e,r){e&1&&(S(0),z(1,41),m(2,"br"),X(),M());}function _s(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.defaultNSFWPolicy);}}var Cl=(()=>{let r=class r{customMarkup=E(Wn);server=E(q);route=E(xe);formReactiveService=E(Me);adminConfigService=E(Ue);form;formErrors={};validationMessages={};languageItems=[];categoryItems=[];instanceBannerUrl;instanceAvatars=[];nsfwItems=[{id:"do_not_list",label:"Hide"},{id:"warn",label:"Warn"},{id:"blur",label:"Blur"},{id:"display",label:"Display"}];defaultLanguageItems=[];customConfig;customConfigSub;get instanceName(){return this.server.getHTMLConfig().instance.name;}ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig;let t=this.route.snapshot.data;this.languageItems=t.languages.map(a=>({label:a.label,id:a.id})),this.categoryItems=t.categories.map(a=>({label:a.label,id:a.id})),this.defaultLanguageItems=Object.entries(Jr).map(([a,i])=>({label:i,id:a})),this.buildForm(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(a=>{this.customConfig=a,this.form.patchValue(this.customConfig);});}
5ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={admin:{email:Ma},contactForm:{enabled:null},instance:{name:Ca,shortDescription:Ea,description:null,isNSFW:null,defaultNSFWPolicy:null,terms:null,codeOfConduct:null,creationReason:null,moderationInformation:null,administrator:null,maintenanceLifetime:null,businessModel:null,hardwareInformation:null,defaultLanguage:null,categories:null,languages:null,serverCountry:null,support:{text:null},social:{externalLink:On,mastodonLink:On,blueskyLink:On,xLink:On}}},a=_i(this.customConfig,{instance:{defaultLanguage:Yr(this.customConfig.instance.defaultLanguage)}}),{form:i,formErrors:u,validationMessages:N}=this.formReactiveService.buildForm(t,a);this.form=i,this.formErrors=u,this.validationMessages=N;}canDeactivate(){return{canDeactivate:!this.form.dirty};}getCustomMarkdownRenderer(){return this.customMarkup.getCustomMarkdownRenderer();}save(){this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:this.form.value,success:"Information updated."});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-config-information"]],decls:177,vars:55,consts:()=>{let t;t="Platform information";let a;a="Enable contact form";let i;i="Add a new category";let u;u="Add a new language";let N;N="Policy on videos containing sensitive content";let I;I="ADMINISTRATORS";let T;T="Admin email";let h;h="PLATFORM";let b;b="Name";let G;G="Short description";let U;U="Description";let J;J="Default language";let V;V="Default language used for users, in emails for example.";let te;te="The web interface still uses the web browser preferred language if not overridden by user preference";let oe;oe="Main instance categories";let De;De="Main languages you/your moderators speak";let ve;ve="Server country";let ce;ce="PeerTube uses this setting to explain to your users which law they must follow in the \"About\" pages";let be;be="SOCIAL";let Fe;Fe=" Social links and support information displayed in the "+"\uFFFD#69\uFFFD"+"About"+"\uFFFD/#69\uFFFD"+" pages ";let Ae;Ae="Support text";let Ge;Ge="Explain to your users how to support your platform. If set, PeerTube will display a \"Support\" button in \"About\" instance pages";let ie;ie="External link";let Ve;Ve="Link to your main website";let re;re="Mastodon link";let Qe;Qe="X link";let ae;ae="Bluesky link";let Ze;Ze="MODERATION & SENSITIVE CONTENT";let et;et=" Manage "+"\uFFFD#107\uFFFD"+"users"+"\uFFFD/#107\uFFFD"+" to build a moderation team. ";let tt;tt="Terms";let nt;nt="Code of conduct";let it;it="Moderation information";let ot;ot="Who moderates the instance? What is the policy regarding sensitive content? Political videos? etc";let rt;rt="YOU AND YOUR PLATFORM";let v;v="Who is behind the instance?";let Gt;Gt="A single person? A non-profit? A company?";let Lt;Lt="Why did you create this instance?";let yt;yt="To share your personal videos? To open registrations and allow people to upload what they want?";let ne;ne="How long do you plan to maintain this instance?";let rn;rn="It's important to know for users who want to register on your instance";let an;an="How will you finance the PeerTube server?";let ln;ln="With your own funds? With user donations? Advertising?";let _n;_n="OTHER INFORMATION";let sn;sn="What server/hardware does the instance run on?";let Ut;Ut="i.e. 2vCore 2GB RAM, a direct the link to the server you rent, etc.";let dn;dn="This instance is dedicated to sensitive content";let cn;return cn=" Enabling it will allow other administrators to know that you are mainly federating sensitive content."+"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"+" Moreover, the \"sensitive content\" checkbox on video upload will be automatically checked by default. ",[I,T,h,b,G,U,J,V,te,oe,De,ve,ce,be,Fe,Ae,Ge,ie,Ve,re,Qe,ae,Ze,et,tt,nt,it,ot,rt,v,Gt,Lt,yt,ne,rn,an,ln,_n,sn,Ut,dn,cn,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols","mt-4"],[1,"title-col"],[1,"content-col"],["formGroupName","admin",1,"form-group"],["for","adminEmail"],["type","text","id","adminEmail","formControlName","email",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["formGroupName","contactForm",1,"form-group"],["inputName","enableContactForm","formControlName","enabled","labelText",a],["formGroupName","instance"],[1,"pt-two-cols"],[1,"form-group"],["for","instanceName"],["type","text","id","instanceName","formControlName","name",1,"form-control",3,"ngClass"],["for","instanceShortDe
5scription"],["id","instanceShortDescription","formControlName","shortDescription",1,"form-control","small",3,"ngClass"],["for","instanceDescription"],[1,"form-group-description"],["supportRelMe","true"],["inputId","instanceDescription","formControlName","description",3,"customMarkdownRenderer","debounceTime","formError"],["for","instanceDefaultLanguage"],["inputId","instanceDefaultLanguage","formControlName","defaultLanguage",3,"items"],["for","instanceCategories"],["inputId","instanceCategories","formControlName","categories","placeholder",i,3,"availableItems","selectableGroup"],["for","instanceLanguages"],["inputId","instanceLanguages","formControlName","languages","placeholder",u,3,"availableItems","selectableGroup"],["for","instanceServerCountry"],["type","text","id","instanceServerCountry","formControlName","serverCountry",1,"form-control",3,"ngClass"],[1,"inner-form-description"],["formGroupName","support",1,"form-group"],["for","instanceSupportText"],["helpType","markdownText"],["inputId","instanceSupportText","formControlName","text","markdownType","enhanced",3,"formError"],["formGroupName","social"],["for","instanceSocialExternalLink"],["type","text","id","instanceSocialExternalLink","formControlName","externalLink",1,"form-control",3,"ngClass"],["for","instanceSocialMastodonLink"],["type","text","id","instanceSocialMastodonLink","formControlName","mastodonLink",1,"form-control",3,"ngClass"],["for","instanceSocialXLink"],["type","text","id","instanceSocialXLink","formControlName","xLink",1,"form-control",3,"ngClass"],["for","instanceSocialBlueskyLink"],["type","text","id","instanceSocialBlueskyLink","formControlName","blueskyLink",1,"form-control",3,"ngClass"],["routerLink","/admin/overview/users",1,"link-primary"],["inputName","instanceIsNSFW","formControlName","isNSFW"],["ptTemplate","label"],["ptTemplate","help"],["inputId","instanceDefaultNSFWPolicy","isGroup","true","label",N,"formControlName","defaultNSFWPolicy",3,"items"],["for","instanceTerms"],["inputId","instanceTerms","formControlName","terms","markdownType","enhanced",3,"formError"],["for","instanceCodeOfConduct"],["inputId","instanceCodeOfConduct","formControlName","codeOfConduct","markdownType","enhanced",3,"formError"],["for","instanceModerationInformation"],["inputId","instanceModerationInformation","formControlName","moderationInformation","markdownType","enhanced",3,"formError"],["for","instanceAdministrator"],["inputId","instanceAdministrator","formControlName","administrator","markdownType","enhanced",3,"formError"],["for","instanceCreationReason"],["inputId","instanceCreationReason","formControlName","creationReason","markdownType","enhanced",3,"formError"],["for","instanceMaintenanceLifetime"],["inputId","instanceMaintenanceLifetime","formControlName","maintenanceLifetime","markdownType","enhanced",3,"formError"],["for","instanceBusinessModel"],["inputId","instanceBusinessModel","formControlName","businessModel","markdownType","enhanced",3,"formError"],["for","instanceHardwareInformation"],["inputId","instanceHardwareInformation","formControlName","hardwareInformation","markdownType","enhanced",3,"formError"]];},template:function(a,i){a&1&&(l(0,"my-admin-save-bar",42),P("save",function(){return i.save();}),o(),l(1,"form",43)(2,"div",44)(3,"div",45)(4,"h2"),s(5,0),o()(),l(6,"div",46)(7,"div",47)(8,"label",48),s(9,1),o(),m(10,"input",49),p(11,Y_,2,1,"div",50),o(),l(12,"div",51),m(13,"my-peertube-checkbox",52),o()()(),S(14,53),l(15,"div",54)(16,"div",45)(17,"h2"),s(18,2),o()(),l(19,"div",46)(20,"div",55)(21,"label",56),s(22,3),o(),m(23,"input",57),p(24,Z_,2,1,"div",50),o(),l(25,"div",55)(26,"label",58),s(27,4),o(),m(28,"textarea",59),p(29,es,2,1,"div",50),o(),l(30,"div",55)(31,"label",60),s(32,5),o(),l(33,"div",61),m(34,"my-custom-markup-help",62),o(),m(35,"my-markdown-textarea",63),o(),l(36,"div",55)(37,"label",64),s(38,6),o(),l(39,"div",61)(40,"div"),s(41,7),o(),l(42,"div"),s(43,8),o()(),l(44,"div"),m(45,"my-select-options",65),o()(),l(46,"div",55)(47,"label",66),s(48,9),o(),l(49,"div"),m(50,"my-select-checkbox",67),o()(),l(51,"div",55)(52,"label",68),s(53,10),o(),l(54,"div"),m(55,"my-select-checkbox",69),o()(),l(56,"div",55)(57,"label",70),s(58,11),o(),l(59,"div",61),s(60,12),o(),m(61,"input",71),p(62,ts,2,1,"div",50),o()()(),l(63,"div",44)(64,"div",45)(65,"h2"),s(66,13),o(),l(67,"div",72),z(68,14),m(69,"em"),X(),o()(),l(70,"div",46)(71,"div",73)(72,"label",74),s(73,15),o(),m(74,"my-help",75),l(75,"div",61),s(76,16),o(),m(77,"my-markdown-textarea",76),o(),S(78,77),l(79,"div",55)(80,"label",78),s(81,17),o(),l(82,"div",61),s(83,18),o(),m(84,"input",79),p(85,ns,2,1,"div",50),o(),l(86,"div",55)(87,"label",80),s(88,19),o(),m(89,"input",81),p(90,is,2,1,"div",50),o(),l(91,"div",55)(92,"label",82),s(93,20),o(),m(94,"input",83),p(95,os,2,1,"div",50),o(),l(96,"div",55)(97,"label",84),s(98,21),o(),m(99,"input",85),p(100,rs,2,1,"div",50),o(),M(),o()(),l(101,"div",44)(102,"div",45)(103,"h2"),s(104,22),o(),l(105,"div",72),z(106,23),m(107,"a",86),X(),o()(),l(108,"div",46)(109,"div",55)(110,"my-peertube-checkbox",87),k(111,as,2,0,"ng-template",88)(112,ls,3,0,"ng-template",89),o()(),l(113,"div",55),m(114,"my-select-radio",90),p(115,_s,2,1,"div",50),o(),l(116,"div",55)(117,"label",91),s(118,24),o(),m(119,"my-help",75)(120,"my-markdown-textarea",92),o(),l(121,"div",55)(122,"label",93),s(123,25),o(),m(124,"my-help",75)(125,"my-markdown-textarea",94),o(),l(126,"div",55)(127,"label",95),s(128,26),o(),m(129,"my-help",75),l(130,"div",61),s(131,27),o(),m(132,"my-markdown-textarea",96),o()()(),l(133,"div",44)(134,"div",45)(135,"h2"),s(136,28),o()(),l(137,"div",46)(138,"div",55)(139,"label",97),s(140,29),o(),m(141,"my-help",75),l(142,"div",61),s(143,30),o(),m(144,"my-markdown-textarea",98),o(),l(145,"div",55)(146,"label",99),s(147,31),o(),m(148,"my-help",75),l(149,"div",61),s(150,32),o(),m(151,"my-markdown-textarea",100),o(),l(152,"div",55)(153,"label",101),s(154,33),o(),m(155,"my-help",75),l(156,"div",61),s(157,34),o(),m(158,"my-markdown-textarea",102),o(),l(159,"div",55)(160,"label",103),s(161,35),o(),m(162,"my-help",75),l(163,"div",61),s(164,36),o(),m(165,"my-markdown-textarea",104),o()()(),l(166,"div",44)(167,"div",45)(168,"h2"),s(169,37),o()(),l(170,"div",46)(171,"div",55)(172,"label",105),s(173,38),o(),l(174,"div",61),s(175,39),o(),m(176,"my-markdown-textarea",106),o()()(),M(),o()),a&2&&(c("form",i.form)("formErrors",i.formErrors)("validationMessages",i.validationMessages),_(),c("formGroup",i.form),_(9),c("ngClass",w(39,hn,i.formErrors.admin.email)),_(),C(i.formErrors.admin.email?11:-1),_(12),c("ngClass",w(41,hn,i.formErrors.instance.name)),_(),C(i.formErrors.instance.name?24:-1),_(4),c("ngClass",w(43,hn,i.formErrors.instance.shortDe
5scription)),_(),C(i.formErrors.instance.shortDescription?29:-1),_(6),c("customMarkdownRenderer",i.getCustomMarkdownRenderer())("debounceTime",500)("formError",i.formErrors.instance.description),_(10),c("items",i.defaultLanguageItems),_(5),c("availableItems",i.categoryItems)("selectableGroup",!1),_(5),c("availableItems",i.languageItems)("selectableGroup",!1),_(6),c("ngClass",w(45,hn,i.formErrors.instance.serverCountry)),_(),C(i.formErrors.instance.serverCountry?62:-1),_(15),c("formError",i.formErrors.instance.support.text),_(7),c("ngClass",w(47,hn,i.formErrors.instance.social.externalLink)),_(),C(i.formErrors.instance.social.externalLink?85:-1),_(4),c("ngClass",w(49,hn,i.formErrors.instance.social.mastodonLink)),_(),C(i.formErrors.instance.social.mastodonLink?90:-1),_(4),c("ngClass",w(51,hn,i.formErrors.instance.social.xLink)),_(),C(i.formErrors.instance.social.xLink?95:-1),_(4),c("ngClass",w(53,hn,i.formErrors.instance.social.blueskyLink)),_(),C(i.formErrors.instance.social.blueskyLink?100:-1),_(14),c("items",i.nsfwItems),_(),C(i.formErrors.instance.defaultNSFWPolicy?115:-1),_(5),c("formError",i.formErrors.instance.terms),_(5),c("formError",i.formErrors.instance.codeOfConduct),_(7),c("formError",i.formErrors.instance.moderationInformation),_(12),c("formError",i.formErrors.instance.administrator),_(7),c("formError",i.formErrors.instance.creationReason),_(7),c("formError",i.formErrors.instance.maintenanceLifetime),_(7),c("formError",i.formErrors.instance.businessModel),_(11),c("formError",i.formErrors.instance.hardwareInformation));},dependencies:[le,Se,Le,de,Ne,he,Re,ye,ht,ua,$e,ge,Yi,Xn,ma,Pe,Ke,Un,wn,dt,It],styles:[`form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}
6/*# sourceMappingURL=admin-config-common-H5GGBR3J.css.map */`]}));let e=r;return e;})();function ss(e,r){e&1&&(S(0),s(1,27),M());}function ds(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.live.dvr.maxWindow);}}function cs(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.live.maxInstanceLives);}}function ms(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.live.maxUserLives);}}function us(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.live.maxDuration);}}function ps(e,r){e&1&&(S(0),s(1,28),M());}function Cs(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.live.transcoding.fps.max);}}function Es(e,r){if(e&1&&m(0,"div",85),e&2){let n=d(2).$implicit;c("innerHTML",n.description,Zt);}}function gs(e,r){e&1&&k(0,Es,1,1,"ng-template",84);}function Ns(e,r){if(e&1&&(l(0,"div",72)(1,"my-peertube-checkbox",83),p(2,gs,1,0,null,84),o()()),e&2){let n=r.$implicit,t=d();_(),c("labelText",kt(n.label))("inputName",t.getResolutionKey(n.id))("formControlName",n.id),_(),C(n.description?2:-1);}}function Ss(e,r){if(e&1&&(S(0),s(1,29),M()),e&2){let n=d();_(),$(n.getTotalTranscodingThreads().value)(n.getTotalTranscodingThreads().unit),x(1);}}function Ms(e,r){if(e&1&&(S(0),s(1,30),M()),e&2){let n=d();_(),$(n.getTotalTranscodingThreads().value)(n.getTotalTranscodingThreads().unit),x(1);}}function fs(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.live.transcoding.threads);}}function As(e,r){if(e&1&&(l(0,"div",50),g(1),o()),e&2){let n=d();_(),A(n.formErrors.live.transcoding.profile);}}var El=(()=>{let r=class r{configService=E(Ue);server=E(q);route=E(xe);formReactiveService=E(Me);adminConfigService=E(Ue);form;formErrors={};validationMessages={};transcodingThreadOptions=[];transcodingProfiles=[];liveMaxDurationOptions=[];liveResolutions=[];customConfig;customConfigSub;ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig,this.transcodingThreadOptions=this.configService.transcodingThreadOptions,this.liveMaxDurationOptions=[{id:-1,label:"No limit"},{id:1e3*3600,label:"1 hour"},{id:1e3*3600*3,label:"3 hours"},{id:1e3*3600*5,label:"5 hours"},{id:1e3*3600*10,label:"10 hours"}],this.liveResolutions=this.adminConfigService.getTranscodingOptions("live"),this.transcodingProfiles=this.adminConfigService.buildTranscodingProfiles(this.server.getHTMLConfig().live.transcoding.availableProfiles),this.buildForm(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(t=>{this.customConfig=t,this.form.patchValue(this.buildFormValue(this.customConfig));});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={live:{enabled:null,allowReplay:null,maxDuration:fa,maxInstanceLives:Aa,maxUserLives:Ia,latencySetting:{enabled:null},transcoding:{enabled:null,threads:Li,profile:null,resolutions:this.adminConfigService.buildFormResolutions("live"),alwaysTranscodeOriginalResolution:null,remoteRunners:{enabled:null},fps:{max:yi}},dvr:{enabled:null,maxWindow:ha}},defaults:{live:{saveReplay:null}}},a=this.buildFormValue(this.customConfig),{form:i,formErrors:u,validationMessages:N}=this.formReactiveService.buildForm(t,a);this.form=i,this.formErrors=u,this.validationMessages=N;}canDeactivate(){return{canDeactivate:!this.form.dirty};}getResolutionKey(t){return"live.transcoding.resolutions."+t;}getLiveRTMPPort(){return this.server.getHTMLConfig().live.rtmp.port;}get defaultsLiveSaveReplayControl(){return this.form.controls.defaults.controls.live.controls.saveReplay;}isLiveEnabled(){return this.form.value.live.enabled===!0;}isDvrEnabled(){return this.form.value.live.dvr.enabled===!0;}isRemoteRunnerLiveEnabled(){return this.form.value.live.transcoding.remoteRunners.enabled===!0;}getDisabledLiveClass(){return{"disabled-checkbox-extra":!this.isLiveEnabled()};}getDisabledLiveDVRClass(){return{"disabled-checkbox-extra":!this.isLiveEnabled()||!this.isDvrEnabled()};}getDisabledLiveTranscodingClass(){return{"disabled-checkbox-extra":!this.isLiveEnabled()||!this.isLiveTranscodingEnabled()};}getDisabledLiveLocalTranscodingClass(){return{"disabled-checkbox-extra":!this.isLiveEnabled()||!this.isLiveTranscodingEnabled()||this.isRemoteRunnerLiveEnabled()};}isLiveTranscodingEnabled(){return this.form.value.live.transcoding.enabled===!0;}getTotalTranscodingThreads(){return this.adminConfigService.getTotalTranscodingThreads({transcoding:this.customConfig.transcoding,live:{transcoding:{enabled:this.form.value.live.transcoding.enabled,threads:this.form.value.live.transcoding.threads}}});}save(){let t=Be(fe({},this.form.value),{live:Be(fe({},this.form.value.live),{dvr:{maxWindow:this.form.value.live.dvr.enabled&&this.form.value.live.dvr.maxWindow?this.form.value.live.dvr.maxWindow*60:0}})});this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:t,success:"Live configuration updated."});}checkTranscodingConsistentOptions(){return this.adminConfigService.checkTranscodingConsistentOptions({transcoding:this.customConfig.transcoding,live:{enabled:this.form.value.live.enabled,allowReplay:this.form.value.live.allowReplay}});}buildFormValue(t){return Be(fe({},t),{live:Be(fe({},t.live),{dvr:{enabled:t.live.dvr.maxWindow>0,maxWindow:Math.round(t.live.dvr.maxWindow/60)}})});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-config-live"]],decls:125,vars:36,consts:()=>{let t;t="Live configuration";let a;a="Allow your users to automatically publish a replay of their live";let i;i="Allow your users to enable DVR (pause/rewind live)";let u;u="Automatically publish a replay by default";let N;N="Allow your users to change live latency";let I;I="Also transcode original resolution";let T;T="Enable remote runners for lives";let h;h="LIVE";let b;b=" Enable users of your platform to stream a live. ";let G;G="\u26A0\uFE0F Enabling live streaming requires trust in your users and extra moderation work";let U;U="If enabled, your server needs to accept incoming TCP traffic on port "+"\uFFFD0\uFFFD"+"";let J;
6J="Allow video streamers to set the DVR window up to";let V;V="{VAR_PLURAL, plural, =1 {minute} other {minutes}}",V=W(V,{VAR_PLURAL:"\uFFFD0\uFFFD"});let te;te=" Default value for the \"automatically publish a replay when your live ends\" checkbox when creating a new live ";let oe;oe=" Small latency disables P2P and high latency can increase P2P ratio ";let De;De="Max simultaneous lives created on your platform";let ve;ve="(-1 for \"unlimited\")";let ce;ce="{VAR_PLURAL, plural, =1 {live} other {lives}}",ce=W(ce,{VAR_PLURAL:"\uFFFD0\uFFFD"});let be;be="Max simultaneous lives created per user";let Fe;Fe="(-1 for \"unlimited\")";let Ae;Ae="{VAR_PLURAL, plural, =1 {live} other {lives}}",Ae=W(Ae,{VAR_PLURAL:"\uFFFD0\uFFFD"});let Ge;Ge="Max live duration";let ie;ie="TRANSCODING";let Ve;Ve=" Same as VOD transcoding, transcoding live streams so that they are in a streamable form that any device can play. Requires a beefy CPU, and then some. ";let re;re="Output formats";let Qe;Qe="Max live FPS";let ae;ae="Cap transcoded live FPS. Max resolution stream still keeps the original FPS.";let Ze;Ze="Live resolutions to generate";let et;et=" Even if it's above your maximum enabled resolution ";let tt;tt="Use "+"\uFFFD#107\uFFFD"+"remote runners"+"\uFFFD/#107\uFFFD"+" to process live transcoding.";let nt;nt="Remote runners have to register on your instance first.";let it;it="Live transcoding threads";let ot;ot="Live transcoding profile";let rt;rt="new live transcoding profiles can be added by PeerTube plugins";let v;v="Allow live streaming";let Gt;Gt="Transcoding enabled for live streams";let Lt;Lt=" will claim at most "+"\uFFFD0\uFFFD"+" "+"\uFFFD1\uFFFD"+" with VOD transcoding ";let yt;return yt=" will claim at least "+"\uFFFD0\uFFFD"+" "+"\uFFFD1\uFFFD"+" with VOD transcoding ",[h,b,G,U,J,V,te,oe,De,ve,ce,be,Fe,Ae,Ge,ie,Ve,re,Qe,ae,Ze,et,tt,nt,it,ot,rt,v,Gt,Lt,yt,["title",t,3,"save","form","formErrors","validationMessages","inconsistentOptions"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"inner-form-description"],[1,"content-col"],["formGroupName","live"],[1,"form-group"],["inputName","liveEnabled","formControlName","enabled"],["ptTemplate","label"],["ngProjectAs","description",5,["description"]],["ngProjectAs","extra",5,["extra"]],[1,"form-group",3,"ngClass"],["inputName","liveAllowReplay","formControlName","allowReplay","labelText",a],["formGroupName","dvr",1,"form-group",3,"ngClass"],["inputName","liveAllowDVR","formControlName","enabled","labelText",i],["for","liveDvrMaxWindow"],[1,"number-with-unit"],["type","number","id","liveDvrMaxWindow","formControlName","maxWindow"],["role","alert",1,"form-error"],["inputName","liveSaveReplay","labelText",u,3,"formControl"],["formGroupName","latencySetting",1,"form-group",3,"ngClass"],["inputName","liveLatencySettingEnabled","formControlName","enabled","labelText",N],["for","liveMaxInstanceLives"],[1,"ms-2","small","muted"],["type","number","id","liveMaxInstanceLives","formControlName","maxInstanceLives"],["for","liveMaxUserLives"],["type","number","id","liveMaxUserLives","formControlName","maxUserLives"],["for","liveMaxDuration"],["inputId","liveMaxDuration","formControlName","maxDuration",3,"items"],["formGroupName","transcoding"],["inputName","liveTranscodingEnabled","formControlName","enabled"],[1,"callout","callout-light","pt-2","mt-2","pb-0"],[1,"callout-title"],[3,"ngClass"],["formGroupName","fps",1,"form-group"],["for","liveTranscodingFPSMax"],["type","number","name","liveTranscodingFPSMax","formControlName","max"],[1,"ms-2","mt-3"],[1,"mt-3"],["formGroupName","resolutions"],[1,"form-group","mb-2"],["inputName","liveTranscodingAlwaysTranscodeOriginalResolution","formControlName","alwaysTranscodeOriginalResolution","labelText",I],["formGroupName","remoteRunners",1,"form-group","mt-4",3,"ngClass"],["inputName","liveTranscodingRemoteRunnersEnabled","formControlName","enabled","labelText",T],["routerLink","/admin/settings/system/runners/runners-list"],["id","liveTranscodingThreadsLabel","for","liveTranscodingThreads"],[1,"small","muted","ms-1"],["labelId","liveTranscodingThreadsLabel","inputId","liveTranscodingThreads","formControlName","threads",3,"items","clearable"],[1,"form-group","mt-4",3,"ngClass"],["for","liveTranscodingProfile"],["inputId","liveTranscodingProfile","formControlName","profile",3,"items"],[3,"inputName","formControlName","labelText"],["ptTemplate","help"],[3,"innerHTML"]];},template:function(a,i){a&1&&(l(0,"my-admin-save-bar",31),P("save",function(){return i.save();}),o(),l(1,"form",32)(2,"div",33)(3,"div",34)(4,"h2"),s(5,0),o(),l(6,"div",35),s(7,1),o()(),l(8,"div",36),S(9,37),l(10,"div",38)(11,"my-peertube-checkbox",39),k(12,ss,2,0,"ng-template",40),S(13,41),l(14,"div"),s(15,2),o(),l(16,"div"),s(17,3),o(),M(),S(18,42),l(19,"div",43),m(20,"my-peertube-checkbox",44),o(),l(21,"div",45)(22,"my-peertube-checkbox",46),S(23,42),l(24,"div",43)(25,"label",47),s(26,4),o(),l(27,"div",48),m(28,"input",49),l(29,"span"),s(30,5),o()(),p(31,ds,2,1,"div",50),o(),M(),o()(),l(32,"div",43)(33,"my-peertube-checkbox",51),S(34,41),s(35,6),M(),o()(),l(36,"div",52)(37,"my-peertube-checkbox",53),S(38,41),s(39,7),M(),o()(),l(40,"div",43)(41,"label",54),s(42,8),o(),l(43,"span",55),s(44,9),o(),l(45,"div",48),m(46,"input",56),l(47,"span"),s(48,10),o()(),p(49,cs,2,1,"div",50),o(),l(50,"div",43)(51,"label",57),s(52,11),o(),l(53,"span",55),s(54,12),o(),l(55,"div",48),m(56,"input",58),l(57,"span"),s(58,13),o()(),p(59,ms,2,1,"div",50),o(),l(60,"div",43)(61,"label",59),s(62,14),o(),m(63,"my-select-options",60),p(64,us,2,1,"div",50),o(),M(),o()(),M(),o()(),l(65,"div",33)(66,"div",34)(67,"h2"),s(68,15),o(),l(69,"div",35),s(70,16),o()(),l(71,"div",36),S(72,37)(73,61),l(74,"div",43)(75,"my-peertube-checkbox",62),k(76,ps,2,0,"ng-template",40),o()(),l(77,"div",63)(78,"h3",64),s(79,17),o(),l(80,"div",65)(81,"div",66)(82,"label",67),s(83,18),o(),l(84,"span",55),s(85,19),o(),l(86,"div",48),m(87,"input",68),l(88,"span"),g(89,"FPS"),o()(),p(90,Cs,2,1,"div",50),o(),l(91,"div",69)(92,"h4"),s(93,20),o(),l(94,"div",70),S(95,71),Ce(96,Ns,3,5,"div",72,Ie),M(),l(98,"div",38)(99,"my-peertube-checkbox",73),S(100,41),s(101,21),M(),o()()()()()(),l(102,"div",74)(103,"my-peertube-checkbox",75),S(104,41),l(105,"div"),z(106,22),m(107,"a",76),X(),o(),l(108,"div"),s(109,23),o(),M(),o()(),l(110,"div",43)(111,"label",77),s(112,24),o(),l(113,"span",78),p(114,Ss,2,2,"ng-container"),p(115,Ms,2,2,"ng-container"),o(),m(116,"my-select-custom-value",79),p(117,fs,2,1,"div",50),o(),l(118,"div",80)(119,"label",81),s(120,25),o(),l(121,"span",78),s(122,26),o(),m(123,"my-select-options",82),p(124,As,2,1,"div",50),o(),M()(),o()()()),a&2&&(c("form",i.form)("formErrors",i.formErrors)("validationMessages",i.validationMessages)("inconsistentOptions",i.checkTranscodingConsistentOptions()),_(),c("formGroup",i.form),_(16),$(i.getLiveRTMPPort()),x(17
6),_(2),c("ngClass",i.getDisabledLiveClass()),_(2),c("ngClass",i.getDisabledLiveClass()),_(3),c("ngClass",i.getDisabledLiveDVRClass()),_(6),$(i.form.value.live.dvr.maxWindow),x(30),_(),C(i.formErrors.live.dvr.maxWindow?31:-1),_(),c("ngClass",i.getDisabledLiveClass()),_(),c("formControl",i.defaultsLiveSaveReplayControl),_(3),c("ngClass",i.getDisabledLiveClass()),_(4),c("ngClass",i.getDisabledLiveClass()),_(8),$(i.form.value.live.maxInstanceLives),x(48),_(),C(i.formErrors.live.maxInstanceLives?49:-1),_(),c("ngClass",i.getDisabledLiveClass()),_(8),$(i.form.value.live.maxUserLives),x(58),_(),C(i.formErrors.live.maxUserLives?59:-1),_(),c("ngClass",i.getDisabledLiveClass()),_(3),c("items",i.liveMaxDurationOptions),_(),C(i.formErrors.live.maxDuration?64:-1),_(10),c("ngClass",i.getDisabledLiveClass()),_(6),c("ngClass",i.getDisabledLiveTranscodingClass()),_(10),C(i.formErrors.live.transcoding.fps.max?90:-1),_(6),Ee(i.liveResolutions),_(6),c("ngClass",i.getDisabledLiveTranscodingClass()),_(8),c("ngClass",i.getDisabledLiveLocalTranscodingClass()),_(4),C(i.getTotalTranscodingThreads().atMost?114:-1),_(),C(i.getTotalTranscodingThreads().atMost?-1:115),_(),c("items",i.transcodingThreadOptions)("clearable",!1),_(),C(i.formErrors.live.transcoding.threads?117:-1),_(),c("ngClass",i.getDisabledLiveLocalTranscodingClass()),_(5),c("items",i.transcodingProfiles),_(),C(i.formErrors.live.transcoding.profile?124:-1));},dependencies:[$e,ge,le,Se,Le,yn,de,Ne,he,zr,Re,ye,ht,Ke,Un,It,Pe,Dt,dt],styles:[`form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}
7/*# sourceMappingURL=admin-config-common-H5GGBR3J.css.map */`]}));let e=r;return e;})();function Is(e,r){e&1&&(S(0),s(1,31),M());}function Os(e,r){e&1&&(S(0),z(1,32),m(2,"strong")(3,"p"),l(4,"ul"),m(5,"li")(6,"li")(7,"li"),o(),X(),M());}function Ts(e,r){e&1&&(S(0),s(1,33),M(),m(2,"br"),S(3),s(4,34),M(),m(5,"br"),S(6),s(7,35),M());}function Ps(e,r){if(e&1&&(l(0,"div",74),g(1),o()),e&2){let n=d();_(),A(n.formErrors.transcoding.fps.max);}}function Rs(e,r){if(e&1&&m(0,"div",97),e&2){let n=d(2).$implicit;c("innerHTML",n.description,Zt);}}function hs(e,r){e&1&&k(0,Rs,1,1,"ng-template",64);}function vs(e,r){if(e&1&&(l(0,"div",78)(1,"my-peertube-checkbox",96),p(2,hs,1,0,null,64),o()()),e&2){let n=r.$implicit,t=d();_(),c("labelText",kt(n.label))("inputName",t.getResolutionKey(n.id))("formControlName",n.id),_(),C(n.description?2:-1);}}function Fs(e,r){if(e&1&&(S(0),s(1,36),M()),e&2){let n=d();_(),$(n.getTotalTranscodingThreads().value)(n.getTotalTranscodingThreads().unit),x(1);}}function Ds(e,r){if(e&1&&(S(0),s(1,37),M()),e&2){let n=d();_(),$(n.getTotalTranscodingThreads().value)(n.getTotalTranscodingThreads().unit),x(1);}}function bs(e,r){if(e&1&&(l(0,"div",74),g(1),o()),e&2){let n=d();_(),A(n.formErrors.transcoding.threads);}}function Gs(e,r){if(e&1&&(l(0,"div",74),g(1),o()),e&2){let n=d();_(),A(n.formErrors.transcoding.concurrency);}}function Ls(e,r){if(e&1&&(l(0,"div",74),g(1),o()),e&2){let n=d();_(),A(n.formErrors.transcoding.profile);}}function ys(e,r){e&1&&(S(0,55),l(1,"span"),s(2,38),o(),M());}var gl=(()=>{let r=class r{configService=E(Ue);notifier=E(Z);server=E(q);route=E(xe);formReactiveService=E(Me);adminConfigService=E(Ue);form;formErrors={};validationMessages={};transcodingThreadOptions=[];transcodingProfiles=[];resolutions=[];additionalVideoExtensions="";customConfig;customConfigSub;ngOnInit(){let t=this.server.getHTMLConfig();this.customConfig=this.route.parent.snapshot.data.customConfig,this.transcodingThreadOptions=this.configService.transcodingThreadOptions,this.resolutions=this.adminConfigService.getTranscodingOptions("vod"),this.additionalVideoExtensions=t.video.file.extensions.join(" "),this.transcodingProfiles=this.adminConfigService.buildTranscodingProfiles(t.transcoding.availableProfiles),this.buildForm(),this.subscribeToTranscodingChanges(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(a=>{this.customConfig=a,this.form.patchValue(this.customConfig);});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={transcoding:{enabled:null,allowAdditionalExtensions:null,allowAudioFiles:null,originalFile:{keep:null},webVideos:{enabled:null},hls:{enabled:null,splitAudioAndVideo:null},fps:{max:yi},resolutions:this.adminConfigService.buildFormResolutions("vod"),alwaysTranscodeOriginalResolution:null,alwaysTranscodePodcastOptimizedAudio:null,remoteRunners:{enabled:null},threads:Li,profile:null,concurrency:$i},videoStudio:{enabled:null,remoteRunners:{enabled:null}}},a=this.customConfig,{form:i,formErrors:u,validationMessages:N}=this.formReactiveService.buildForm(t,a);this.form=i,this.formErrors=u,this.validationMessages=N;}canDeactivate(){return{canDeactivate:!this.form.dirty};}getResolutionKey(t){return"transcoding.resolutions."+t;}isRemoteRunnerVODEnabled(){return this.form.value.transcoding.remoteRunners.enabled===!0;}isTranscodingEnabled(){return this.form.value.transcoding.enabled===!0;}isHLSEnabled(){return this.form.value.transcoding.hls.enabled===!0;}isStudioEnabled(){return this.form.value.videoStudio.enabled===!0;}getTranscodingDisabledClass(){return{"disabled-checkbox-extra":!this.isTranscodingEnabled()};}getHLSDisabledClass(){return{"disabled-checkbox-extra":!this.isHLSEnabled()};}getLocalTranscodingDisabledClass(){return{"disabled-checkbox-extra":!this.isTranscodingEnabled()||this.isRemoteRunnerVODEnabled()};}getStudioRunnerDisabledClass(){return{"disabled-checkbox-extra":!this.isStudioEnabled()};}getTotalTranscodingThreads(){return this.adminConfigService.getTotalTranscodingThreads({live:this.customConfig.live,transcoding:{enabled:this.form.value.transcoding.enabled,threads:this.form.value.transcoding.threads}});}subscribeToTranscodingChanges(){let t=this.form.controls,a=t.transcoding.controls.enabled,i=t.videoStudio.controls.enabled,u=t.transcoding.controls.hls.controls.enabled,N=t.transcoding.controls.webVideos.controls.enabled;N.valueChanges.subscribe(I=>{I===!1&&u.value===!1&&(u.setValue(!0),this.notifier.info("Automatically enable HLS transcoding because at least 1 output format must be enabled when transcoding is enabled","",1e4));}),u.valueChanges.subscribe(I=>{I===!1&&N.value===!1&&(N.setValue(!0),this.notifier.info("Automatically enable Web Videos transcoding because at least 1 output format must be enabled when transcoding is enabled","",1e4));}),a.valueChanges.subscribe(I=>{I===!1&&i.setValue(!1);}
7),a.updateValueAndValidity(),N.updateValueAndValidity(),i.updateValueAndValidity(),u.updateValueAndValidity();}save(){this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:this.form.value,success:"VOD configuration updated."});}checkTranscodingConsistentOptions(){return this.adminConfigService.checkTranscodingConsistentOptions({transcoding:{enabled:this.form.value.transcoding.enabled},live:this.customConfig.live});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-config-vod"]],decls:144,vars:31,consts:()=>{let t;t="VOD configuration";let a;a="Allow additional extensions";let i;i="Allow audio files upload";let u;u="Keep a version of the input file";let N;N="Web Videos enabled";let I;I="HLS with P2P support enabled";let T;T="Split audio and video streams";let h;h="Always generate an audio file optimized for podcast applications";let b;b="Also transcode original resolution";let G;G="Enable remote runners for VOD";let U;U="Enable video studio";let J;J="Enable remote runners for studio";let V;V="TRANSCODING";let te;te=" Process uploaded videos so that they are streamable on any device. Although this is costly in terms of resources, it is a critical part of PeerTube, so proceed with caution. ";let oe;oe=" Estimating a server's capacity to transcode and stream videos isn't easy and we can't tune PeerTube automatically. ";let De;De=" However, you may want to read "+"\uFFFD#15\uFFFD"+"our guidelines"+"\uFFFD/#15\uFFFD"+" before tweaking the following values. ";let ve;ve="Input";let ce;ce="Allows users to upload videos with additional extensions than .mp4, .ogv and .webm (for example: .avi, .mov, .mkv etc).";let be;be="Allows users to upload .mp3, .ogg, .wma, .flac, .aac, or .ac3 audio files.";let Fe;Fe="The file will be merged in a still image video with the preview file on upload.";let Ae;Ae="If enabled, the input file is not deleted after transcoding but moved in a dedicated folder or object storage";let Ge;Ge="Output";let ie;ie="If you also enable HLS output, video storage will be multiplied by 2";let Ve;Ve="If you also enable Web Videos output, video storage will be multiplied by 2";let re;re="If enabled, remote PeerTube instances < 6.3.0 won't be able to play these videos";let Qe;Qe="HLS audio files are not always played correctly by podcast applications";let ae;ae="This option ensures that an optimized audio file is generated for podcast applications, even if Web Videos output is disabled";let Ze;Ze="Max video FPS";let et;et="Cap transcoded video FPS. Max resolution file still keeps the original FPS.";let tt;tt="Resolutions to generate";let nt;nt="Even if it's above your maximum enabled resolution";let it;it="Use "+"\uFFFD#96\uFFFD"+"remote runners"+"\uFFFD/#96\uFFFD"+" to process VOD transcoding.";let ot;ot="Remote runners have to register on your instance first.";let rt;rt="Transcoding threads";let v;v="Transcoding jobs concurrency";let Gt;Gt="allows to transcode multiple files in parallel";let Lt;Lt="jobs in parallel";let yt;yt="Transcoding profile";let ne;ne="new transcoding profiles can be added by PeerTube plugins";let rn;rn="VIDEO STUDIO";let an;an=" Allows your users to edit their video (cut, add intro/outro, add a watermark etc) ";let ln;ln="Use "+"\uFFFD#141\uFFFD"+"remote runners"+"\uFFFD/#141\uFFFD"+" to process studio transcoding tasks.";let _n;_n="Remote runners have to register on your instance first.";let sn;sn="Transcoding enabled";let Ut;Ut=""+"\uFFFD#2\uFFFD"+"Requires ffmpeg >= 4.1"+"\uFFFD/#2\uFFFD"+""+"\uFFFD#3\uFFFD"+"Generate HLS playlists and fragmented MP4 files resulting in a better playback than with Web Videos:"+"\uFFFD/#3\uFFFD"+""+"\uFFFD#4\uFFFD"+""+"[\uFFFD#5\uFFFD|\uFFFD#6\uFFFD|\uFFFD#7\uFFFD]"+"Resolution change is smoother"+"[\uFFFD/#5\uFFFD|\uFFFD/#6\uFFFD|\uFFFD/#7\uFFFD]"+""+"[\uFFFD#5\uFFFD|\uFFFD#6\uFFFD|\uFFFD#7\uFFFD]"+"Faster playback especially with long videos"+"[\uFFFD/#5\uFFFD|\uFFFD/#6\uFFFD|\uFFFD/#7\uFFFD]"+""+"[\uFFFD#5\uFFFD|\uFFFD#6\uFFFD|\uFFFD#7\uFFFD]"+"More stable playback (less bugs/infinite loading)"+"[\uFFFD/#5\uFFFD|\uFFFD/#6\uFFFD|\uFFFD/#7\uFFFD]"+""+"\uFFFD/#4\uFFFD"+"",Ut=W(Ut);let dn;dn="Store the audio stream in a separate file from the video.";let cn;cn="This option adds the ability for the HLS player to propose the \"Audio only\" qual
7ity to users.";let H;H="It also saves disk space by not duplicating the audio stream in each resolution file";let ei;ei=" will claim at most "+"\uFFFD0\uFFFD"+" "+"\uFFFD1\uFFFD"+" with live transcoding ";let ti;ti=" will claim at least "+"\uFFFD0\uFFFD"+" "+"\uFFFD1\uFFFD"+" with live transcoding ";let ni;return ni="\u26A0\uFE0F You need to enable transcoding first to enable video studio",[V,te,oe,De,ve,ce,be,Fe,Ae,Ge,ie,Ve,re,Qe,ae,Ze,et,tt,nt,it,ot,rt,v,Gt,Lt,yt,ne,rn,an,ln,_n,sn,Ut,dn,cn,H,ei,ti,ni,["title",t,3,"save","form","formErrors","validationMessages","inconsistentOptions"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"inner-form-description"],[1,"content-col"],[1,"callout","callout-primary","mb-4"],["target","_blank","rel","noopener noreferrer","href","https://docs.joinpeertube.org/admin/configuration#vod-transcoding",1,"link-primary"],["formGroupName","transcoding"],["inputName","transcodingEnabled","formControlName","enabled",3,"recommended"],["ptTemplate","label"],["ngProjectAs","extra",5,["extra"]],[1,"callout","callout-light","pt-2","pb-0"],[1,"callout-title"],[1,"form-group",3,"ngClass"],["inputName","transcodingAllowAdditionalExtensions","formControlName","allowAdditionalExtensions","labelText",a],["ngProjectAs","description",5,["description"]],["inputName","transcodingAllowAudioFiles","formControlName","allowAudioFiles","labelText",i],["formGroupName","originalFile",1,"form-group",3,"ngClass"],["inputName","transcodingOriginalFileKeep","formControlName","keep","labelText",u],[1,"callout","callout-light","pt-2","mt-2","pb-0"],["formGroupName","webVideos"],["inputName","transcodingWebVideosEnabled","formControlName","enabled","labelText",N],["formGroupName","hls"],["inputName","transcodingHlsEnabled","formControlName","enabled","labelText",I,3,"recommended"],["ptTemplate","help"],[1,"mb-0",3,"ngClass"],["inputName","transcodingHlsSplitAudioAndVideo","formControlName","splitAudioAndVideo","labelText",T],[1,"form-group"],["inputName","transcodingAlwaysTranscodePodcastOptimizedAudio","formControlName","alwaysTranscodePodcastOptimizedAudio","labelText",h],["formGroupName","fps",1,"form-group",3,"ngClass"],["for","transcodingFPSMax"],[1,"ms-2","small","muted"],[1,"number-with-unit"],["type","number","name","transcodingFPSMax","formControlName","max"],["role","alert",1,"form-error"],[1,"mb-2","fw-bold"],[1,"ms-2","d-flex","flex-column"],["formGroupName","resolutions"],[1,"form-group","mb-2"],["inputName","transcodingAlwaysTranscodeOriginalResolution","formControlName","alwaysTranscodeOriginalResolution","labelText",b],["formGroupName","remoteRunners",1,"form-group","mt-4",3,"ngClass"],["inputName","transcodingRemoteRunnersEnabled","formControlName","enabled","labelText",G],["routerLink","/admin/settings/system/runners/runners-list"],[1,"form-group","mt-4",3,"ngClass"],["id","transcodingThreadsLabel","for","transcodingThreads"],[1,"small","muted","ms-1"],["labelId","transcodingThreadsLabel","inputId","transcodingThreads","formControlName","threads",3,"items","clearable"],["for","transcodingConcurrency"],["type","number","id","transcodingConcurrency","formControlName","concurrency"],["for","transcodingProfile"],["inputId","transcodingProfile","formControlName","profile",3,"items"],[1,"pt-two-cols","mt-2"],["formGroupName","videoStudio"],["inputName","videoStudioEnabled","formControlName","enabled","labelText",U],["formGroupName","remoteRunners",1,"form-group",3,"ngClass"],["inputName","videoStudioRemoteRunnersEnabled","formControlName","enabled","labelText",J],[3,"inputName","formControlName","labelText"],[3,"innerHTML"]];},template:function(a,i){a&1&&(l(0,"my-admin-save-bar",39),P("save",function(){return i.save();}),o(),l(1,"form",40)(2,"div",41)(3,"div",42)(4,"h2"),s(5,0),o(),l(6,"div",43),s(7,1),o()(),l(8,"div",44)(9,"div",45)(10,"span"),s(11,2),o(),m(12,"br"),l(13,"span"),z(14,3),m(15,"a",46),X(),o()(),S(16,47),l(17,"div")(18,"my-peertube-checkbox",48),k(19,Is,2,0,"ng-template",49),S(20,50),l(21,"div",51)(22,"h3",52),s(23,4),o(),l(24,"div",53)(25,"my-peertube-checkbox",54),S(26,55),l(27,"span"),s(28,5),o(),M(),o()(),l(29,"div",53)(30,"my-peertube-checkbox",56),S(31,55),l(32,"div"),s(33,6),o(),l(34,"div"),s(35,7),o(),M(),o()(),l(36,"div",57)(37,"my-peertube-checkbox",58),S(38,55),l(39,"div"),s(40,8),o(),M(),o()()(),l(41,"div",59)(42,"h3",52),s(43,9),o(),S(44,60),l(45,"div",53)(46,"my-peertube-checkbox",61),S(47,55)(48),l(49,"div"),s(50,10),o(),M()(),o()(),M(),S(51,62),l(52,"div",53)(53,"my-peertube-checkbox",63),S(54,55),l(55,"div"),s(56,11),o(),M(),k(57,Os,8,0,"ng-template",64),S(58,50),l(59,"div",65)(60,"my-peertube-checkbox",66),S(61,55),s(62,12),M(),k(63,Ts,8,0,"ng-template",64),o()(),M(),o()(),M(),l(64,"div",67)(65,"my-peertube-checkbox",68),S(66,55),l(67,"div"),s(68,13),o(),l(69,"div"),s(70,14),o(),M(),o()(),l(71,"div",69)(72,"label",70),s(73,15),o(),l(74,"span",71),s(75,16),o(),l(76,"div",72),m(77,"input",73),l(78,"span"),g(79,"FPS"),o()(),p(80,Ps,2,1,"div",74),o(),l(81,"div",53)(82,"div",75),s(83,17),o(),l(84,"div",76),S(85,77),Ce(86,vs,3,5,"div",78,Ie),M(),l(88,"my-peertube-checkbox",79),S(89,55),s(90,18),M(),o()()()(),M(),o()(),l(91,"div",80)(92,"my-peertube-checkbox",81),S(93,55),l(94,"div"),z(95,19),m(96,"a",82),X(),o(),l(97,"div"),s(98,20),o(),M(),o()(),l(99,"div",83)(100,"label",84),s(101,21),o(),l(102,"span",85),p(103,Fs,2,2,"ng-container"),p(104,Ds,2,2,"ng-container"),o(),m(105,"my-select-custom-value",86),p(106,bs,2,1,"div",74),o(),l(107,"div",53)(108,"label",87),s(109,22),o(),l(110,"span",85),s(111,23),o(),l(112,"div",72),m(113,"input",88),l(114,"span"),s(115,24),o()(),p(116,Gs,2,1,"div",74),o(),l(117,"div",53)(118,"label",89),s(119,25),o(),l(120,"span",85),s(121,26),o(),m(122,"my-select-options",90),p(123,Ls,2,1,"div",74),o(),M(),o()(),l(124,"div",91)(125,"div",42)(126,"h2"),s(127,27),o(),l(128,"div",43),s(129,28),o()(),l(130,"div",44),S(131,92),l(132,"div",53)(133,"my-peertube-checkbox",93),p(134,ys,3,0,"ng-container",55),S(135,50),l(136,"div",94)(137,"my-peertube-checkbox",95),S(138,55),l(139,"div"),z(140,29),m(141,"a",82),X(),o(),l(142,"div"),s(143,30),o(),M(),o()(),M(),o()(),M(),o()()()),a&2&&(c("form",i.form)("formErrors",i.formErrors)("validationMessages",i.validationMessages)("inconsistentOptions",i.checkTranscodingConsistentOptions()),_(),c("formGroup",i.form),_(17),c("recommended",!0),_(6),c("ngClass",i.getTranscodingDisabledClass()),_(5),c("ngClass",i.getTranscodingDisabledClass()),_(7),c("ngClass",i.getTranscodingDisabledClass()),_(9),c("ngClass",i.getTranscodingDisabledClass()),_(7),c("ngClass",i.getTranscodingDisabledClass()),_(),c("recommended",!0),_(6),c("ngClass",i.getHLSDisabledClass()),_(12),c("ngClass",i.getTranscodingDisabledClass()),_(9),C(i.formErrors.transcoding.fps.max?80:-1),_(),c("ngClass",i.getTranscodingDisabledClass()),_(5),Ee(i.resolutions),_(5),c("ngClass",i.getTranscodingDisabledClass()),_(8),c("ngClass",i.getLocalTranscodingDisabledClass()),_(4),C(i.getTotalTranscodingThreads().atMost?103:-1),_(),C(i.getTotalTranscodingThreads().atMost?-1:104),_(),c("items",i.transcodingThreadOptions)("clearable",!1),_(),C(i.formErrors.transcoding.threads?106:-1),_(),c("ngClass",i.getLocalTranscodingDisabledClass()),_(9),C(i.formErrors.transcoding.concurrency?116:-1),_(),c("ngClass",i.getLocalTranscodingDisabledClass()),_(5),c("items",i.transcodingProfiles),_(),C(i.formErrors.transcoding.profile?123:-1),_(9),c("ngClass",i.getTranscodingDisabledClass()),_(2),C(i.isTranscodingEnabled()?-1:134),_(2),c("ngClass",i.getStudioRunnerDisabledClass()));},dependencies:[$e,ge,le,Se,Le,yn,de,Ne,he,Re,ye,ht,Ke,Un,Pe,Dt,It,dt],styles:[`form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player
7-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}
8/*# sourceMappingURL=admin-config-common-H5GGBR3J.css.map */`]}));let e=r;return e;})();var Nl=(()=>{let r=class r{menuConfig;ngOnInit(){this.menuConfig={title:"Configuration",entries:[{type:"link",label:"Information",routerLink:"information"},{type:"link",label:"Logo",routerLink:"logo"},{type:"link",label:"General",routerLink:"general"},{type:"link",label:"Homepage",routerLink:"homepage"},{type:"link",label:"Customization",routerLink:"customization"},{type:"separator"},{type:"link",label:"VOD",routerLink:"vod"},{type:"link",label:"Live",routerLink:"live"},{type:"separator"},{type:"link",label:"Advanced",routerLink:"advanced"}]};}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-config"]],decls:5,vars:1,consts:[[1,"root"],[3,"config"],[1,"flex-grow-1"]],template:function(a,i){a&1&&(l(0,"div",0)(1,"div"),m(2,"my-lateral-menu",1),o(),l(3,"div",2),m(4,"router-outlet"),o()()),a&2&&(_(2),c("config",i.menuConfig));},dependencies:[Ln,Sn,Ba],styles:[`.root[_ngcontent-%COMP%]{display:flex}@media screen and (max-width:1000px){.root[_ngcontent-%COMP%]{margin-bottom:150px}}
9/*# sourceMappingURL=admin-config.component-AJFJQIDZ.css.map */`]}));let e=r;return e;})();var Sl=m_(u_());var di=e=>({"input-error":e}),xs=(e,r)=>r.name;function ws(e,r){e&1&&(l(0,"div"),s(1,17),o());}function Us(e,r){}function Vs(e,r){e&1&&k(0,Us,0,0,"ng-template");}function ks(e,r){if(e&1&&(l(0,"my-alert",44),k(1,Vs,1,0,null,64),l(2,"div"),s(3,18),o(),l(4,"div"),z(5,19),m(6,"strong"),X(),o(),l(7,"div"),z(8,20),m(9,"strong"),X(),o()()),e&2){let n=d(),t=pe(32);
9_(),c("ngTemplateOutlet",t),_(5),$(n.getCurrentThemeLabel()),x(5),_(3),$(n.getDefaultThemeLabel()),x(8);}}function zs(e,r){}function Xs(e,r){e&1&&k(0,zs,0,0,"ng-template");}function Bs(e,r){if(e&1&&(l(0,"my-alert",45),k(1,Xs,1,0,null,64),l(2,"div"),z(3,21),m(4,"strong"),X(),o()()),e&2){d();let n=pe(32);_(),c("ngTemplateOutlet",n);}}function Ws(e,r){if(e&1){let n=Q();l(0,"button",70),P("click",function(){L(n);let a=d().$implicit,i=d();return y(i.resetCustomizationField(a.name));}),s(1,22),o();}}function Hs(e,r){if(e&1&&(l(0,"div",39),g(1),o()),e&2){let n=d().$implicit;_(),A(n.description);}}function js(e,r){if(e&1&&m(0,"my-peertube-color-picker",67),e&2){let n=d().$implicit,t=d();c("inputId",n.inputId)("formControlName",n.name)("formError",t.formErrors.theme.customization[n.name]);}}function Qs(e,r){if(e&1&&m(0,"my-select-custom-value",68),e&2){let n=d().$implicit;c("labelId",n.inputId)("inputId",n.inputId)("items",n.items)("formControlName",n.name)("clearable",!1);}}function qs(e,r){if(e&1&&m(0,"input",69),e&2){let n=d().$implicit,t=d();c("id",n.inputId)("name",n.inputId)("formControlName",n.name)("ngClass",w(4,di,t.formErrors.theme.customization[n.name]));}}function Ks(e,r){if(e&1&&(l(0,"div",37)(1,"label",65),g(2),o(),p(3,Ws,2,0,"button",66),p(4,Hs,2,1,"div",39),p(5,js,1,3,"my-peertube-color-picker",67)(6,Qs,1,5,"my-select-custom-value",68)(7,qs,1,6,"input",69),o()),e&2){let n=r.$implicit,t=d();_(),c("for",n.inputId),_(),A(n.label),_(),C(t.hasDefaultCustomizationValue(n.name)?-1:3),_(),C(n.description?4:-1),_(),C(n.type==="color"?5:n.type==="radius"?6:7);}}function Js(e,r){if(e&1&&(l(0,"div",52),g(1),o()),e&2){let n=d();_(),A(n.formErrors.email.subject.prefix);}}function Ys(e,r){if(e&1&&(l(0,"div",52),g(1),o()),e&2){let n=d();_(),A(n.formErrors.email.body.signature);}}function Zs(e,r){if(e&1&&(l(0,"div",52),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.customizations.javascript);}}function ed(e,r){if(e&1&&(l(0,"div",52),g(1),o()),e&2){let n=d();_(),A(n.formErrors.instance.customizations.css);}}var td=(0,Sl.default)("peertube:config"),Ml=(()=>{let r=class r{formReactiveService=E(Me);adminConfigService=E(Ue);serverService=E(q);themeService=E(sa);route=E(xe);form;formErrors={};validationMessages={};customizationFormFields=[];availableThemes;availablePlayerThemes=[];customizationResetFields=new Set();customConfig;customConfigSub;formFieldsObject={primaryColor:{label:"Primary color",type:"color"},onPrimaryColor:{label:"On primary color",type:"color"},foregroundColor:{label:"Foreground color",type:"color"},backgroundColor:{label:"Background color",type:"color"},backgroundSecondaryColor:{label:"Secondary background color",description:"Used as a background for inputs, overlays...",type:"color"},menuForegroundColor:{label:"Menu foreground color",type:"color"},menuBackgroundColor:{label:"Menu background color",type:"color"},menuBorderRadius:{label:"Menu rounding",type:"radius",items:[{id:"0",label:"Not rounded"},{id:"6px",label:"Slightly rounded"},{id:"14px",label:"Moderately rounded (default)"},{id:"60px",label:"Rounded"}]},headerForegroundColor:{label:"Header foreground color",type:"color"},headerBackgroundColor:{label:"Header background color",type:"color"},inputBorderRadius:{label:"Input rounding",type:"radius",items:[{id:"0",label:"Not rounded"},{id:"4px",label:"Slightly rounded (default)"},{id:"10px",label:"Moderately rounded"},{id:"20px",label:"Rounded"}]}};ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig,this.availableThemes=[this.themeService.getDefaultThemeItem(),...this.themeService.buildAvailableThemes()],this.availablePlayerThemes=[{id:"galaxy",label:"Galaxy",description:"Original theme"},{id:"lucide",label:"Lucide",description:"A clean and modern theme"}],this.buildForm(),this.subscribeToCustomizationChanges(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(t=>{this.customConfig=t,this.form.patchValue(this.getDefaultFormValues(),{emitEvent:!1}),this.form.setErrors(this.form.errors);});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe(),this.themeService.updateColorPalette
9(fe({builtIn:this.serverService.getHTMLConfig().theme.builtIn},this.customConfig.theme));}canDeactivate(){return{canDeactivate:!this.form.dirty};}subscribeToCustomizationChanges(){let t;this.form.get("theme.customization").valueChanges.pipe(Ni(250)).subscribe(a=>{t&&(cancelAnimationFrame(t),t=null),t=requestAnimationFrame(()=>{this.themeService.updateColorPalette(Be(fe({},this.customConfig.theme),{builtIn:this.serverService.getHTMLConfig().theme.builtIn,customization:this.buildNewCustomization(a)}));});});for(let[a,i]of Object.entries(this.form.get("theme.customization").controls))i.events.subscribe(u=>{u instanceof Vr&&(td(`Deleting "${a}" from reset fields`),this.customizationResetFields.delete(a));});}buildForm(){for(let[N,I]of Object.entries(this.formFieldsObject)){let T=N;this.customizationFormFields.push({label:I.label,type:I.type,inputId:`themeCustomization${ia(T)}`,name:T,items:I.items}),this.customConfig.theme.customization[T]||this.customizationResetFields.add(T);}let t={client:{videos:{miniature:{preferAuthorDisplayName:null}}},email:{subject:{prefix:null},body:{signature:null}},instance:{customizations:{css:null,javascript:null}},theme:{default:null,customization:{primaryColor:jt,onPrimaryColor:jt,foregroundColor:jt,backgroundColor:jt,backgroundSecondaryColor:jt,menuForegroundColor:jt,menuBackgroundColor:jt,menuBorderRadius:null,headerForegroundColor:jt,headerBackgroundColor:jt,inputBorderRadius:null}},defaults:{player:{theme:null}}},{form:a,formErrors:i,validationMessages:u}=this.formReactiveService.buildForm(t,this.getDefaultFormValues());this.form=a,this.formErrors=i,this.validationMessages=u;}getCurrentThemeName(){return this.themeService.getCurrentThemeName();}getCurrentThemeLabel(){return this.availableThemes.find(t=>t.id===this.themeService.getCurrentThemeName())?.label;}getDefaultThemeName(){return this.serverService.getHTMLConfig().theme.default;}getDefaultThemeLabel(){return this.availableThemes.find(t=>t.id===this.getDefaultThemeName())?.label;}isUsingDefaultTheme(){this.themeService.isUsingDefaultTheme({currentTheme:this.getCurrentThemeName(),config:this.serverService.getHTMLConfig().theme});}hasDefaultCustomizationValue(t){return this.customizationResetFields.has(t);}resetCustomizationField(t){this.customizationResetFields.add(t),this.themeService.updateColorPalette(Be(fe({},this.customConfig.theme),{builtIn:this.serverService.getHTMLConfig().theme.builtIn,customization:this.buildNewCustomization(this.form.get("theme.customization").value)}));let a=this.formatCustomizationFieldForForm(t,this.themeService.getCSSConfigValue(t)),i=this.getCustomizationControl(t);i.patchValue(a,{emitEvent:!1}),i.markAsDirty(),i.setErrors(i.errors);}save(){let t=this.form.value;t.theme.customization=this.buildNewCustomization(t.theme.customization),this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:this.form.value,success:"Platform customization updated."});}getCustomizationControl(t){return this.form.get("theme.customization").get(t);}getDefaultFormValues(){return Be(fe({},this.customConfig),{theme:{default:this.customConfig.theme.default,customization:this.getDefaultCustomization()}});}getDefaultCustomization(){let t=this.customConfig.theme.customization;return _o(this.formFieldsObject).reduce((a,i)=>(a[i]=t[i]?this.formatCustomizationFieldForForm(i,t[i]):this.formatCustomizationFieldForForm(i,this.themeService.getCSSConfigValue(i)),a),{});}formatCustomizationFieldForForm(t,a){return this.formFieldsObject[t].type==="color"?this.themeService.formatColorForForm(a):a;}buildNewCustomization(t){return _o(this.customConfig.theme.customization).reduce((a,i)=>(a[i]=this.formatCustomizationFieldForTheme(i,t[i]),a),{});}formatCustomizationFieldForTheme(t,a){return this.customizationResetFields.has(t)?null:a;}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-config-customization"]],decls:94,vars:28,consts:()=>{let t;t="Platform customization";let a;a="Prefer author display name in video miniature";let i;i="APPEARANCE";let u;u="Theme";let N;N="Player Theme";let I;I="Only used by the web player";let T;T="CUSTOMIZATION";let h;h=" Use "+"\uFFFD#29\uFFFD"+"plugins & themes"+"\uFFFD/#29\uFFFD"+" for more involved changes ";let b;b="EMAIL";let G;G="Subject prefix";let U;U="Support "+"\uFFFD#50\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#50\uFFFD"+" template variable";let J;J="Body signature";let V;V="Support "+"\uFFFD#58\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#58\uFFFD"+" template variable";let te;te="ADVANCED";let oe;oe=" Advanced modifications to your PeerTube platform if creating a plugin or a theme is overkill. ";let De;De="JavaScript";let ve;ve=""+"\uFFFD#77\uFFFD"+"Write JavaScript code directly. Example:"+"\uFFFD/#77\uFFFD"+""+"\uFFFD#78\uFFFD"+"console.log('my instance is amazing');"+"\uFFFD/#78\uFFFD"+"";let ce;ce=""+"[\uFFFD#87\uFFFD|\uFFFD#89\uFFFD]"+"Write CSS code directly. Example:"+"[\uFFFD/#87\uFFFD|\uFFFD/#89\uFFFD]"+""+"[\uFFFD#88\uFFFD|\uFFFD#91\uFFFD]"+"  #custom-css "+"[\uFFFD0\uFFFD|\uFFFD2\uFFFD]"+"\n  color: red;\n  "+"[\uFFFD1\uFFFD|\uFFFD3\uFFFD]"+"\n  "+"[\uFFFD/#88\uFFFD|\uFFFD/#91\uFFFD]"+""+"[\uFFFD#87\uFFFD|\uFFFD#89\uFFFD]"+"Prepend with "+"\uFFFD#90\uFFFD"+"#custom-css"+"\uFFFD/#90\uFFFD"+" to override styles. Example:"+"[\uFFFD/#87\uFFFD|\uFFFD/#89\uFFFD]"+""+"[\uFFFD#88\uFFFD|\uFFFD#91\uFFFD]"+"  #custom-css .logged-in-email "+"[\uFFFD0\uFFFD|\uFFFD2\uFFFD]"+"\n  color: red;\n  "+"[\uFFFD1\uFFFD|\uFFFD3\uFFFD]"+"\n  "+"[\uFFFD/#88\uFFFD|\uFFFD/#91\uFFFD]"+"",ce=W(ce);let be;be="UI customization only applies if the user is using the default platform theme.";let Fe;
9Fe="You can't preview the changes because you aren't using your platform's default theme.";let Ae;Ae="Current theme: "+"\uFFFD#6\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#6\uFFFD"+"";let Ge;Ge="Platform theme: "+"\uFFFD#9\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#9\uFFFD"+".";let ie;ie="You can preview your UI customization but "+"\uFFFD#4\uFFFD"+"don't forget to save your changes"+"\uFFFD/#4\uFFFD"+" once you are happy with the results.";let Ve;return Ve=" Reset ",[["alertIntro",""],i,u,N,I,T,h,b,G,U,J,V,te,oe,De,ve,ce,be,Fe,Ae,Ge,ie,Ve,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"content-col"],["formGroupName","theme",1,"form-group"],["for","themeDefault"],["formControlName","default","inputId","themeDefault",3,"items"],["formGroupName","client"],["formGroupName","videos"],["formGroupName","miniature",1,"form-group"],["inputName","clientVideosMiniaturePreferAuthorDisplayName","formControlName","preferAuthorDisplayName","labelText",a],["formGroupName","defaults"],["formGroupName","player"],[1,"form-group"],["for","defaultsPlayerTheme"],[1,"form-group-description"],["mode","instance","formControlName","theme","inputId","defaultsPlayerTheme"],[1,"pt-two-cols","mt-4"],[1,"inner-form-description"],["routerLink","/admin/settings/plugins",1,"link-primary"],["type","warning"],["type","info"],["formGroupName","customization"],["formGroupName","email"],["formGroupName","subject",1,"form-group"],["for","emailSubjectPrefix"],[1,"d-inline"],["type","text","id","emailSubjectPrefix","formControlName","prefix",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["formGroupName","body",1,"form-group"],["for","emailBodySignature"],["type","text","id","emailBodySignature","formControlName","signature",1,"form-control",3,"ngClass"],["id","customizations",1,"anchor"],["formGroupName","instance"],["formGroupName","customizations"],["for","customizationJavascript"],[1,"mb-2"],["id","customizationJavascript","formControlName","javascript","dir","ltr",1,"form-control",3,"ngClass"],["for","customizationCSS"],["id","customizationCSS","formControlName","css","dir","ltr",1,"form-control",3,"ngClass"],[4,"ngTemplateOutlet"],[3,"for"],["type","button",1,"reset-button","reset-button-small"],[3,"inputId","formControlName","formError"],["inputType","text",3,"labelId","inputId","items","formControlName","clearable"],["type","text",1,"form-control",3,"id","name","formControlName","ngClass"],["type","button",1,"reset-button","reset-button-small",3,"click"]];},template:function(a,i){a&1&&(l(0,"my-admin-save-bar",23),P("save",function(){return i.save();}),o(),l(1,"form",24)(2,"div",25)(3,"div",26)(4,"h2"),s(5,1),o()(),l(6,"div",27)(7,"div",28)(8,"label",29),s(9,2),o(),m(10,"my-select-options",30),o(),S(11,31)(12,32),l(13,"div",33),m(14,"my-peertube-checkbox",34),o(),M()(),S(15,35)(16,36),l(17,"div",37)(18,"label",38),s(19,3),o(),l(20,"div",39),s(21,4),o(),m(22,"my-select-player-theme",40),o(),M()(),o()(),l(23,"div",41)(24,"div",26)(25,"h2"),s(26,5),o(),l(27,"div",42),z(28,6),m(29,"a",43),X(),o()(),l(30,"div",27),k(31,ws,2,0,"ng-template",null,0,F),p(33,ks,10,3,"my-alert",44)(34,Bs,5,1,"my-alert",45),l(35,"div",28),S(36,46),Ce(37,Ks,8,5,"div",37,xs),M(),o()()(),l(39,"div",25)(40,"div",26)(41,"h2"),s(42,7),o()(),S(43,47),l(44,"div",27)(45,"div",48)(46,"label",49),s(47,8),o(),l(48,"div",39),z(49,9),m(50,"pre",50),X(),o(),m(51,"input",51),p(52,Js,2,1,"div",52),o(),l(53,"div",53)(54,"label",54),s(55,10),o(),l(56,"div",39),z(57,11),m(58,"pre",50),X(),o(),m(59,"input",55),p(60,Ys,2,1,"div",52),o()(),M(),o(),l(61,"div",41)(62,"div",26),m(63,"div",56),l(64,"h2"),s(65,12),o(),l(66,"div",42),s(67,13),o()(),l(68,"div",27),S(69,57)(70,58),l(71,"div",37)(72,"label",59),s(73,14),o(),l(74,"my-help"),S(75),z(76,15),m(77,"p",60)(78,"pre"),X(),M(),o(),m(79,"textarea",61),p(80,Zs,2,1,"div",52),o(),l(81,"div",37)(82,"label",62),g(83,"CSS"),o(),l(84,"my-help"),S(85),z(86,16),m(87,"p",60)(88,"pre"),l(89,"p",60),m(90,"em"),o(),m(91,"pre"),X(),M(),o(),m(92,"textarea",63),p(93,ed,2,1,"div",52),o(),M()(),o()()()),a&2&&(c("form",i.form)("formErrors",i.formErrors)("validationMessages",i.validationMessages),_(),c("formGroup",i.form),_(9),c("items",i.availableThemes),_(23),C(i.getCurrentThemeName()!==i.getDefaultThemeName()?33:34),_(4),Ee(i.customizationFormFields),_(13),$("{{instanceName}}"),x(49),_(),c("ngClass",w(20,di,i.formErrors.email.subject.prefix)),_(),C(i.formErrors.email.subject.prefix?52:-1),_(6),$("{{instanceName}}"),x(57),_(),c("ngClass",w(22,di,i.formErrors.email.body.signature)),_(),C(i.formErrors.email.body.signature?60:-1),_(19),c("ngClass",w(24,di,i.formErrors.instance.customizations.javascript)),_(),C(i.formErrors.instance.customizations.javascript?80:-1),_(11),$("{")("}")("{")("}"),x(86),_(),c("ngClass",w(26,di,i.formErrors.instance.customizations.css)),_(),C(i.formErrors.instance.customizations.css?93:-1));},dependencies:[$e,ge,Nn,le,Se,Le,de,Ne,Ln,Pe,he,Re,ye,ht,dt,va,st,It,wn,Ke,Dt,Ha],styles:[`form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player
9-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}
10/*# sourceMappingURL=admin-config-common-H5GGBR3J.css.map */`]}));let e=r;return e;})();var nd=()=>({height:"32px",width:"32px"}),id=()=>({height:"48px",width:"auto"}),od=()=>({height:"48px",width:"48px"}),fl=(()=>{let r=class r{notifier=E(Z);logoService=E(si);server=E(q);route=E(xe);formReactiveService=E(Me);serverService=E(q);adminConfigService=E(Ue);form;formErrors={};validationMessages={};customConfig;customConfigSub;get instanceName(){return this.server.getHTMLConfig().instance.name;}get avatarFileConstraints(){return this.server.getHTMLConfig().avatar.file;}get logoFileConstraints(){return this.server.getHTMLConfig().logo.file;}ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig,this.buildForm(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(t=>{this.customConfig=t,this.form.patchValue({hideInstanceName:t.client.header.hideInstanceName});});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={hideInstanceName:null,avatar:null,banner:null,favicon:null,"header-square":null,"header-wide":null,opengraph:null},a=fe({hideInstanceName:this.customConfig.client.header.hideInstanceName},this.route.snapshot.data.logos),{form:i,formErrors:u,validationMessages:N}=this.formReactiveService.buildForm(t,a);this.form=i,this.formErrors=u,this.validationMessages=N;}canDeactivate(){return{canDeactivate:!this.form.dirty};}save(){this.adminConfigService.updateCustomConfig({client:{header:{hideInstanceName:this.form.value.hideInstanceName}}}).pipe(We(()=>this.serverService.resetConfig()),Si(t=>Object.assign(this.customConfig,t)),We(()=>this.buildSaveAvatar()),We(()=>this.saveBanner()),We(()=>this.saveLogo("favicon")),We(()=>this.saveLogo("header-square")),We(()=>this.saveLogo("header-wide")),We(()=>this.saveLogo("opengraph")),We(()=>this.serverService.resetConfig()),We(()=>this.logoService.getAllLogos())).subscribe({next:t=>{this.notifier.success("Logos updated"),this.form.patchValue(t),this.form.markAsPristine();},error:t=>this.notifier.handleError(t)});}buildSaveAvatar(){if(this.form.controls.avatar.pristine)return gi(!0);let t=this.form.value.avatar;return t?this.logoService.updateAvatar(t):this.logoService.deleteAvatar();}saveBanner(){if(this.form.controls.banner.pristine)return gi(!0);let t=this.form.value.banner;return t?this.logoService.updateBanner(t):this.logoService.deleteBanner();}saveLogo(t){let a=this.form.get(t);if(a.pristine)return gi(!0);let i=a.value;return i?this.logoService.updateLogo(i,t):this.logoService.deleteLogo(t);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-config-logo"]],decls:84,vars:16,consts:()=>{let t;t="Upload logos";let a;a="Hide the name of your platform in the header on desktop (wide screens)";let i;i="LOGO";let u;u="Square icon";let N;N="Square icon is used in the mobile application and can be used on your custom homepage.";let I;I="It's also used as a fallback for the favicon, header icon and social media logo.";let T;T="Banner";let h;h="Banner is displayed in the about, login and registration pages and be used on your custom homepage.";let b;b=" It can also be displayed on external websites to promote your instance, such as "+"\uFFFD#25\uFFFD"+"JoinPeerTube.org"+"\uFFFD/#25\uFFFD"+". ";let G;G="Favicon";let U;U="Favicon is the icon displayed in web browser tab. ";let J;J="If not set, the "+"\uFFFD#36\uFFFD"+"Square icon"+"\uFFFD/#36\uFFFD"+" will be used.";let V;V="If the image is not in .svg format, it will be resized to 32x32 pixels and converted to .png format.";let te;te="Desktop header logo";let oe;oe="Logo displayed in the header on large screens such as desktop computers.";let De;De="If not set, the "+"\uFFFD#49\uFFFD"+"Square icon"+"\uFFFD/#49\uFFFD"+" will be used.";let ve;ve="If the image is not in .svg format, its height will be reduced to 48 pixels and the width will be calculated based on the original file ratio.";let ce;ce="Useful for example if your \"Desktop header logo\" already includes your platform name";let be;be="Mobile header logo";let Fe;
10Fe="Logo displayed in the header on small screens such as mobile devices. ";let Ae;Ae="If not set, the "+"\uFFFD#67\uFFFD"+"Square icon"+"\uFFFD/#67\uFFFD"+" will be used.";let Ge;Ge="If the image is not in .svg format, it will be resized to 48x48 pixels.";let ie;ie="Social media logo";let Ve;Ve="Default logo displayed on social media. ";let re;re="If not set, the "+"\uFFFD#80\uFFFD"+"Square icon"+"\uFFFD/#80\uFFFD"+" will be used.";let Qe;return Qe="If the image is not in .svg format, it will be resized to 1200x650 pixels.",[i,u,N,I,T,h,b,G,U,J,V,te,oe,De,ve,ce,be,Fe,Ae,Ge,ie,Ve,re,Qe,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols","mt-4"],[1,"title-col"],[1,"content-col"],[1,"form-group"],["for","avatarfile"],[1,"form-group-description"],[1,"mb-0"],["formControlName","avatar","inputName","avatar","displayDelete","true",1,"avatar-preview",3,"fileConstraints"],["for","bannerfile"],["target","_blank","href","https://joinpeertube.org/instances"],["formControlName","banner","inputName","banner","displayDelete","true",1,"banner-preview",3,"fileConstraints"],["for","favicon"],["formControlName","favicon","inputName","favicon","displayDelete","true","buttonsAside","true",1,"favicon-preview",3,"previewSize","fileConstraints"],["for","header-wide"],["formControlName","header-wide","inputName","header-wide","displayDelete","true","buttonsAside","true",1,"header-wide-preview",3,"previewSize","fileConstraints"],["inputName","hideInstanceName","formControlName","hideInstanceName","labelText",a],["ngProjectAs","description",5,["description"]],["for","header-square"],["formControlName","header-square","inputName","header-square","displayDelete","true","buttonsAside","true",1,"header-square-preview",3,"previewSize","fileConstraints"],["for","opengraph"],["formControlName","opengraph","inputName","opengraph","displayDelete","true",1,"opengraph-preview",3,"fileConstraints"]];},template:function(a,i){a&1&&(l(0,"my-admin-save-bar",24),P("save",function(){return i.save();}),o(),l(1,"form",25)(2,"div",26)(3,"div",27)(4,"h2"),s(5,0),o()(),l(6,"div",28)(7,"div",29)(8,"label",30),s(9,1),o(),l(10,"div",31)(11,"div",32)(12,"div"),s(13,2),o(),l(14,"div"),s(15,3),o()()(),m(16,"my-image-input",33),o(),l(17,"div",29)(18,"label",34),s(19,4),o(),l(20,"div",31)(21,"p",32),s(22,5),o(),l(23,"p"),z(24,6),m(25,"a",35),X(),o()(),m(26,"my-image-input",36),o(),l(27,"div",29)(28,"label",37),s(29,7),o(),l(30,"div",31)(31,"p",32),S(32),s(33,8),M(),S(34),z(35,9),m(36,"strong"),X(),M(),o(),l(37,"p"),s(38,10),o()(),m(39,"my-image-input",38),o(),l(40,"div",29)(41,"label",39),s(42,11),o(),l(43,"div",31)(44,"p",32),S(45),s(46,12),M(),S(47),z(48,13),m(49,"strong"),X(),M(),o(),l(50,"p"),s(51,14),o()(),m(52,"my-image-input",40),o(),l(53,"div",29)(54,"my-peertube-checkbox",41),S(55,42),l(56,"div"),s(57,15),o(),M(),o()(),l(58,"div",29)(59,"label",43),s(60,16),o(),l(61,"div",31)(62,"p",32),S(63),s(64,17),M(),S(65),z(66,18),m(67,"strong"),X(),M(),o(),l(68,"p"),s(69,19),o()(),m(70,"my-image-input",44),o(),l(71,"div",29)(72,"label",45),s(73,20),o(),l(74,"div",31)(75,"p",32),S(76),s(77,21),M(),S(78),z(79,22),m(80,"strong"),X(),M(),o(),l(81,"p"),s(82,23),o()(),m(83,"my-image-input",46),o()()()()),a&2&&(c("form",i.form)("formErrors",i.formErrors)("validationMessages",i.validationMessages),_(),c("formGroup",i.form),_(15),c("fileConstraints",i.avatarFileConstraints),_(10),c("fileConstraints",i.avatarFileConstraints),_(13),c("previewSize",mt(13,nd))("fileConstraints",i.logoFileConstraints),_(13),c("previewSize",mt(14,id))("fileConstraints",i.logoFileConstraints),_(18),c("previewSize",mt(15,od))("fileConstraints",i.logoFileConstraints),_(13),c("fileConstraints",i.logoFileConstraints));},dependencies:[le,Se,de,Ne,he,Re,ye,dt,Fa,Ke],styles:[`.banner-preview[_ngcontent-%COMP%]{max-width:500px;aspect-ratio:6;width:100%;height:auto}.avatar-preview[_ngcontent-%COMP%], .header-square-preview[_ngcontent-%COMP%]{width:128px;height:128px}.header-wide-preview[_ngcontent-%COMP%]{width:auto;height:128px;max-width:500px}.opengraph-preview[_ngcontent-%COMP%]{max-width:500px;aspect-ratio:1.9047619048;width:100%;height:auto}
11/*# sourceMappingURL=admin-config-logo.component-BJWLDKGL.css.map */`,`form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player
11-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}
12/*# sourceMappingURL=admin-config-common-H5GGBR3J.css.map */`]}));let e=r;return e;})();var rd=(e,r)=>E(Ue).getCustomConfig(),ad=(e,r)=>E(Hn).getInstanceHomepage().pipe(lt(({content:n})=>n)),ld=(e,r)=>E(q).getVideoCategories(),_d=(e,r)=>E(q).getVideoLanguages(),sd=(e,r)=>E(q).getVideoLicences(),dd=(e,r)=>E(q).getVideoPrivacies(),cd=(e,r)=>E(q).getCommentPolicies(),md=(e,r)=>E(si).getAllLogos(),Al=[{path:"config",canActivate:[Xe],data:{userRight:Y.MANAGE_CONFIGURATION},resolve:{customConfig:rd},providers:[si,Wa],component:Nl,children:[{path:"edit-custom",redirectTo:"information",pathMatch:"full"},{path:"",redirectTo:"information",pathMatch:"full"},{path:"homepage",component:pl,canDeactivate:[tn],resolve:{homepageContent:ad},data:{meta:{title:"Edit your platform homepage"}}},{path:"customization",component:Ml,canDeactivate:[tn],data:{meta:{title:"Platform customization"}}},{path:"information",component:Cl,canDeactivate:[tn],resolve:{categories:ld,languages:_d},data:{meta:{title:"Platform information"}}},{path:"logo",component:fl,canDeactivate:[tn],resolve:{logos:md},data:{meta:{title:"Platform logos"}}},{path:"general",component:ul,canDeactivate:[tn],resolve:{privacies:dd,licences:sd,commentPolicies:cd},data:{meta:{title:"General configuration"}}},{path:"vod",component:gl,canDeactivate:[tn],data:{meta:{title:"VOD configuration"}}},{path:"live",component:El,canDeactivate:[tn],data:{meta:{title:"Live configuration"}}},{path:"advanced",component:ml,canDeactivate:[tn],data:{meta:{title:"Advanced configuration"}}}]}];var Il=(()=>{let r=class r{};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-abuse-list"]],decls:1,vars:0,consts:[["viewType","admin"]],template:function(a,i){a&1&&m(0,"my-abuse-list-table",0);},dependencies:[Qa],encapsulation:2}));let e=r;return e;})();var Ol=(()=>{let r=class r{mode=Xi.Instance;};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-instance-account-blocklist"]],decls:1,vars:1,consts:[["key","InstanceAccountBlocklistComponent",3,"mode"]],template:function(a,i){a&1&&m(0,"my-generic-account-blocklist",0),a&2&&c("mode",i.mode);},dependencies:[qa],encapsulation:2}));let e=r;return e;})();var Tl=(()=>{let r=class r{mode=Xi.Instance;};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-instance-server-blocklist"]],decls:1,vars:1,consts:[["key","InstanceServerBlocklistComponent",3,"mode"]],template:function(a,i){a&1&&m(0,"my-generic-server-blocklist",0),a&2&&c("mode",i.mode);},dependencies:[Ja],encapsulation:2}));let e=r;return e;})();var ud=["table"];function pd(e,r){if(e&1&&(S(0),s(1,6),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function Cd(e,r){e&1&&(l(0,"span",14),s(1,7),o());}function Ed(e,r){e&1&&(l(0,"span",17),s(1,8),o());}function gd(e,r){if(e&1&&(l(0,"td")(1,"my-video-cell",13)(2,"div"),p(3,Cd,2,0,"span",14),o()()(),l(4,"td"),m(5,"my-privacy-badge",15),o(),l(6,"td"),m(7,"my-video-nsfw-badge",16),o(),l(8,"td"),p(9,Ed,2,0,"span",17),o(),l(10,"td"),g(11),K(12,"ptDate"),o()),e&2){let n=r.$implicit,t=d();_(),c("video",n.video)("accountBlockBadges",n.video.account?t.accountBlocklist.get(n.video.account.id):void 0),_(2),C(n.type===2?3:-1),_(2),c("video",n.video),_(2),c("video",n.video),_(2),C(n.unfederated?9:-1),_(2),D(" ",se(12,7,n.createdAt,"short")," ");}}function Nd(e,r){if(e&1&&m(0,"my-action-dropdown",18),e&2){let n=r.$implicit,t=d();c("actions",t.videoBlocklistActions)("entry",n);}}function Sd(e,r){if(e&1&&(l(0,"span",22),s(1,9),o(),m(2,"span",23)),e&2){let n=d(2).$implicit;_(2),c("innerHTML",n.reasonHtml,Zt);}}function Md(e,r){if(e&1&&(l(0,"div",19)(1,"div",20),p(2,Sd,3,1),o(),l(3,"div",21),m(4,"my-embed",15),o()()),e&2){let n=d().$implicit;_(2),C(n.reasonHtml?2:-1),_(2),c("video",n.video);}}function fd(e,r){if(e&1&&p(0,Md,5,2,"div",19),e&2){let n=r.$implicit;C(n?0:-1);}}function Ad(e,r){e&1&&(S(0),s(1,10),M());}function Id(e,r){e&1&&(S(0),s(1,11),M());}function Od(e,r){if(e&1&&p(0,Ad,2,0,"ng-container")(1,Id,2,0,"ng-container"),e&2){let n=r.search,t=r.hasFilters;C(n||t?0:1);}}var Pl=(()=>{let r=class r{notifier=E(Z);serverService=E(q);confirmService=E(we);videoBlocklistService=E(Bn);blocklistService=E(Pn);markdownRenderer=E(hi);videoService=E(nn);table=me("table");blocklistTypeFilter;videoBlocklistActions=[];bulkActions=[];inputFilters=[{type:"options",key:"type",title:"Block type",options:[{value:"all",label:"All"},{value:$n.AUTO_BEFORE_PUBLISHED,label:"Automatic blocks"},{value:$n.MANUAL,label:"Manual blocks"}]}];columns=[{id:"name",label:"Video",sortable:!0},{id:"privacy",label:"Privacy",sortable:!1},{id:"sensitive",label:"Sensitive",sortable:!1},{id:"unfederated",label:"Unfederated",sortable:!1},{id:"createdAt",label:"Date",sortable:!0}];accountBlocklist=new Map();dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);let{simpleActions:t,bulkActions:a}=jn([[{label:()=>"Internal actions",isHeader:!0,isDisplayed:i=>
12i.type===$n.AUTO_BEFORE_PUBLISHED,enableBulk:!0},{label:()=>"Switch to manual block",handler:i=>this.switchVideosBlockToManual(i),isDisplayed:i=>i.type===$n.AUTO_BEFORE_PUBLISHED,enableBulk:!0}],[{label:()=>"Actions for videos",isHeader:!0,enableBulk:!0},{label:()=>"Unblock",handler:i=>this.unblockVideos(i),enableBulk:!0},{label:i=>ee("{count, plural, =1 {Delete video} other {Delete videos}}",{count:i.length}),handler:i=>this.deleteVideos(i),isDisplayed:i=>i.video?.isLocal===!0,enableBulk:!0}]]);this.videoBlocklistActions=t,this.bulkActions=a;}ngOnInit(){this.serverService.getHTMLConfig().autoBlacklist.videos.ofUsers.enabled&&(this.blocklistTypeFilter=$n.MANUAL);}toHtml(t){return this.markdownRenderer.textMarkdownToHTML({markdown:t});}unblockVideo(t){return _e(this,null,function*(){let a="Do you really want to unblock this video? It will be available again in the videos list.";(yield this.confirmService.confirm(a,"Unblock"))!==!1&&this.videoBlocklistService.unblockVideos([t.video.id]).subscribe({next:()=>{this.notifier.success("Video "+t.video.name+" unblocked."),this.table().loadData();},error:u=>this.notifier.handleError(u)});});}unblockVideos(t){return _e(this,null,function*(){let a=ee("Do you really want to unblock {count, plural, =1 {this video?} other {these {count} videos?}}",{count:t.length});(yield this.confirmService.confirm(a,"Unblock"))!==!1&&this.videoBlocklistService.unblockVideos(t.map(u=>u.video.id)).subscribe({next:()=>{this.notifier.success(ee("{count, plural, =1 {Video unblocked.} other {{count} videos unblocked.}}",{count:t.length})),this.table().loadData();},error:u=>this.notifier.handleError(u)});});}switchVideosBlockToManual(t){return _e(this,null,function*(){if((yield this.confirmService.confirm(ee("Switch {count, plural, =1 {this auto block to manual?} other {{count} auto blocks to manual?}}",{count:t.length}),"Switch"))===!1)return;let i=t.map(u=>u.video.id);this.videoBlocklistService.unblockVideos(i).pipe(We(()=>this.videoBlocklistService.blockVideos(i.map(u=>({videoId:u,unfederate:!0}))))).subscribe({next:()=>{this.notifier.success(ee("{count, plural, =1 {Video switched to manual block.} other {{count} videos switched to manual block.}}",{count:t.length})),this.table().loadData();},error:u=>this.notifier.handleError(u)});});}deleteVideos(t){return _e(this,null,function*(){(yield this.confirmService.confirm(ee("Do you really want to delete {count, plural, =1 {this video?} other {{count} videos?}}",{count:t.length}),"Delete"))!==!1&&this.videoService.removeVideo(t.map(i=>i.video.id)).subscribe({next:()=>{this.notifier.success(ee("{count, plural, =1 {Video deleted.} other {{count} videos deleted.}}",{count:t.length})),this.table().loadData();},error:i=>this.notifier.handleError(i)});});}getVideoEmbed(t){return ra({embedUrl:qr({url:Qr(t.video,Ot.originServerUrl),title:!1,warningTitle:!1}),aspectRatio:t.video.aspectRatio,embedTitle:t.video.name});}onDataLoaded(){this.loadBlockStatus();}loadBlockStatus(){let t=this.table().data.map(u=>u.video),a=this.getUniqueAccounts(t),i=this.getUniqueHosts(a);this.blocklistService.getStatus({accounts:a.map(u=>u.name+"@"+u.host),hosts:i}).subscribe(u=>{this.accountBlocklist=new Map();for(let N of a){let I=N.name+"@"+N.host;this.accountBlocklist.set(N.id,{mutedByInstance:u.accounts[I]?.blockedByServer??!1,mutedServerByInstance:u.hosts[N.host]?.blockedByServer??!1});}});}getUniqueAccounts(t){let a=new Set();return t.map(i=>!i.account||a.has(i.account.id)?null:(a.add(i.account.id),i.account)).filter(i=>!!i);}getUniqueHosts(t){return Array.from(new Set(t.map(a=>a.host)));}_dataLoader(t){return this.videoBlocklistService.listBlocks(t).pipe(We(a=>_e(this,null,function*(){for(let i of a.data)i.reasonHtml=yield this.toHtml(i.reason);return a;})));}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-video-block-list"]],viewQuery:function(a,i){a&1&&Oe(i.table,ud,5),a&2&&Te();},decls:12,vars:4,consts:()=>{let t;t="videos per page";let a;a="{VAR_PLURAL, plural, =0 {No video} =1 {1 video} other {{INTERPOLATION} videos}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="The video was blocked due to automatic blocking of new videos";let u;u="Auto block";let N;N="Unfederated";let I;I="Actions";let T;T="Block reason:";let h;
12h="No blocked video found matching current filters.";let b;return b="No blocked video found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],a,u,N,T,h,b,["key","VideoBlockListComponent","paginatorText",t,"columnConfig","false","searchInput","true",3,"dataLoaded","defaultColumns","dataLoader","inputFilters","bulkActions"],["accountBlockBadgesPlatformOnly","true","size","small",3,"video","accountBlockBadges"],["title",i,1,"pt-badge","badge-info","badge-small"],[3,"video"],["theme","red",3,"video"],[1,"pt-badge","badge-blue"],["placement","bottom-right auto","container","body","label",I,3,"actions","entry"],[1,"d-flex","moderation-expanded"],[1,"left"],[1,"right"],[1,"moderation-expanded-label"],[1,"moderation-expanded-text",3,"innerHTML"]];},template:function(a,i){a&1&&(l(0,"my-table",12,0),P("dataLoaded",function(){return i.onDataLoaded();}),k(2,pd,3,4,"ng-template",null,1,F)(4,gd,13,10,"ng-template",null,2,F)(6,Nd,1,2,"ng-template",null,3,F)(8,fd,1,1,"ng-template",null,4,F)(10,Od,2,1,"ng-template",null,5,F),o()),a&2&&c("defaultColumns",i.columns)("dataLoader",i.dataLoader)("inputFilters",i.inputFilters)("bulkActions",i.bulkActions);},dependencies:[qt,Wi,Bi,ji,je,Hi,Je,He],styles:[`.moderation-expanded[_ngcontent-%COMP%]{font-size:90%;display:flex;flex-wrap:wrap;justify-content:space-between}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-label[_ngcontent-%COMP%]{font-weight:600;display:inline-block;vertical-align:top;text-align:end;min-width:100px;margin-inline-end:.3125rem}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-text[_ngcontent-%COMP%]{display:inline-flex;word-wrap:break-word}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-text[_ngcontent-%COMP%]     p:last-child{margin-bottom:0!important}.moderation-expanded[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{width:50%;max-width:500px}@media screen and (max-width:1000px){.moderation-expanded[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{width:100%}}.table-comment-link[_ngcontent-%COMP%], .table-account-link[_ngcontent-%COMP%]{text-decoration:none;color:var(--fg)}.table-comment-link[_ngcontent-%COMP%]:focus:not(:focus-visible), .table-account-link[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none!important}.table-comment-link[_ngcontent-%COMP%]     p:last-child, .table-account-link[_ngcontent-%COMP%]     p:last-child{margin:0}my-abuse-details[_ngcontent-%COMP%]{width:100%}@media screen and (max-width:1000px){.abuse-messages[_ngcontent-%COMP%]{justify-content:flex-start!important}}
13/*# sourceMappingURL=moderation-GBT6NJBZ.css.map */`]}));let e=r;return e;})();var bt=class bt{authHttp=E(Rt);restExtractor=E(vt);restService=E(Ht);listRegistrations(r){let{pagination:n,sort:t,search:a,stateOneOf:i}=r,u=bt.BASE_REGISTRATION_URL,N=new Pt();return N=this.restService.addRestGetParams(N,n,t),a&&(N=N.append("search",a)),N=this.restService.addObjectParams(N,{stateOneOf:i}),this.authHttp.get(u,{params:N}).pipe(ke(I=>this.restExtractor.handleError(I)));}acceptRegistration(r){let{registration:n,moderationResponse:t,preventEmailDelivery:a}=r,i=bt.BASE_REGISTRATION_URL+"/"+n.id+"/accept",u={moderationResponse:t,preventEmailDelivery:a};return this.authHttp.post(i,u).pipe(ke(N=>this.restExtractor.handleError(N)));}rejectRegistration(r){let{registration:n,moderationResponse:t,preventEmailDelivery:a}=r,i=bt.BASE_REGISTRATION_URL+"/"+n.id+"/reject",u={moderationResponse:t,preventEmailDelivery:a};return this.authHttp.post(i,u).pipe(ke(N=>this.restExtractor.handleError(N)));}removeRegistrations(r){let n=bn(r);return mn(n).pipe(pn(t=>this.authHttp.delete(bt.BASE_REGISTRATION_URL+"/"+t.id)),un(),ke(t=>this.restExtractor.handleError(t)));}};f(bt,"BASE_REGISTRATION_URL",Ot.apiUrl+"/api/v1/users/registrations"),f(bt,"\u0275fac",function(n){return new(n||bt)();}),f(bt,"\u0275prov",Tt({token:bt,factory:bt.ɵfac}));var vn=bt;var Rl={VALIDATORS:[Ai.required,Ai.minLength(2),Ai.maxLength(3e3)],MESSAGES:{required:"Moderation response is required.",minlength:"Moderation response must be at least 2 characters long.",maxlength:"Moderation response cannot be more than 3000 characters long."}};var Td=["modal"],Pd=e=>({"input-error":e});function Rd(e,r){e&1&&(l(0,"my-alert",10),s(1,2),o());}function hd(e,r){e&1&&(l(0,"my-alert",10),s(1,3),o());}function vd(e,r){if(e&1&&p(0,Rd,2,0,"my-alert",10)(1,hd,2,0,"my-alert",10),e&2){let n=d();C(n.hasMultipleRegistrations()?0:1);}}function Fd(e,r){if(e&1&&(z(0,5,1),m(1,"strong")(2,"em"),X()),e&2){let n=d(3);_(2),$(n.registrations.length),x(0);}}function Dd(e,r){if(e&1&&(z(0,5,2),m(1,"strong")(2,"em"),X()),e&2){let n=d(3);_(2),$(n.registration.username),x(0);}}function bd(e,r){e&1&&ao(0);}function Gd(e,r){if(e&1&&k(0,bd,1,0,"ng-container",26),e&2){d(4);let n=pe(1);c("ngTemplateOutlet",n);}}function Ld(e,r){e&1&&s(0,6,1);}function yd(e,r){if(e&1&&(z(0,6,2),m(1,"em"),X()),e&2){let n=d(5);_(),$(n.registration.email),x(0);}}function $d(e,r){if(e&1&&(l(0,"p"),z(1,6),p(2,Ld,1,0)(3,yd,2,1),X(),o()),e&2){let n=d(4);_(2),C(n.hasMultipleRegistrations()?2:3);}}function xd(e,r){if(e&1&&p(0,Gd,1,1,"ng-container")(1,$d,4,1,"p"),e&2){let n=d(3);C(n.hasUnverifiedEmails()?0:1);}}function wd(e,r){e&1&&(l(0,"my-alert",10),s(1,7),o());}function Ud(e,r){if(e&1&&(l(0,"p"),z(1,5),p(2,Fd,3,1)(3,Dd,3,1),X(),o(),p(4,xd,2,1)(5,wd,2,0,"my-alert",10)),e&2){let n=d(2);_(2),C(n.hasMultipleRegistrations()?2:3),_(2),C(n.isEmailEnabled()?4:5);}}
13function Vd(e,r){e&1&&ao(0);}function kd(e,r){if(e&1&&k(0,Vd,1,0,"ng-container",26),e&2){d(4);let n=pe(1);c("ngTemplateOutlet",n);}}function zd(e,r){e&1&&(z(0,8,1),m(1,"strong"),X());}function Xd(e,r){if(e&1&&(z(0,8,2),m(1,"em")(2,"strong"),X()),e&2){let n=d(5);_(2),$(n.registration.email),x(0);}}function Bd(e,r){if(e&1&&(l(0,"p"),z(1,8),p(2,zd,2,0)(3,Xd,3,1),X(),o()),e&2){let n=d(4);_(2),C(n.hasMultipleRegistrations()?2:3);}}function Wd(e,r){if(e&1&&p(0,kd,1,1,"ng-container")(1,Bd,4,1,"p"),e&2){let n=d(3);C(n.hasUnverifiedEmails()?0:1);}}function Hd(e,r){e&1&&(l(0,"my-alert",10),s(1,9),o());}function jd(e,r){if(e&1&&p(0,Wd,2,1)(1,Hd,2,0,"my-alert",10),e&2){let n=d(2);C(n.isEmailEnabled()?0:1);}}function Qd(e,r){if(e&1&&(l(0,"div",21),g(1),o()),e&2){let n=d(2);_(),D(" ",n.formErrors.moderationResponse," ");}}function qd(e,r){if(e&1){let n=Q();l(0,"div",11)(1,"h4",12),g(2),o(),l(3,"button",13),P("click",function(){L(n);let a=d();return y(a.hide());}),m(4,"my-global-icon",14),o()(),l(5,"form",15),P("ngSubmit",function(){L(n);let a=d();return y(a.processRegistration());}),l(6,"div",16)(7,"div",17),p(8,Ud,6,2)(9,jd,2,1),o(),l(10,"div",18)(11,"label",19),s(12,4),o(),m(13,"textarea",20),p(14,Qd,2,1,"div",21),o(),l(15,"div",18),m(16,"my-peertube-checkbox",22),o()(),l(17,"div",23)(18,"input",24),P("click",function(){L(n);let a=d();return y(a.hide());})("key.enter",function(){L(n);let a=d();return y(a.hide());}),o(),m(19,"input",25),o()();}if(e&2){let n=d();_(2),D(" ",n.getModalTitle()," "),_(3),c("formGroup",n.form),_(3),C(n.isAccept()?8:n.isReject()?9:-1),_(5),c("ngClass",w(7,Pd,n.formErrors.moderationResponse)),_(),C(n.formErrors.moderationResponse?14:-1),_(5),c("value",n.getSubmitValue())("disabled",!n.form.valid);}}var hl=(()=>{let r=class r extends Kt{formReactiveService=E(Me);server=E(q);modalService=E(Oi);notifier=E(Z);registrationService=E(vn);modal=me("modal");registrationProcessed=Gn();registrations=[];openedModal;processMode;ngOnInit(){this.buildForm({moderationResponse:Rl,preventEmailDelivery:null});}isAccept(){return this.processMode==="accept";}isReject(){return this.processMode==="reject";}openModal(t,a){this.processMode=a,this.registrations=bn(t),this.shouldDisableEmailDelivery()?(this.form.get("preventEmailDelivery").disable(),this.form.patchValue({preventEmailDelivery:!0})):(this.form.get("preventEmailDelivery").enable(),this.form.patchValue({preventEmailDelivery:!1})),this.openedModal=this.modalService.open(this.modal(),{centered:!0});}hide(){this.form.reset(),this.registrations=[],this.openedModal.close();}getSubmitValue(){let t=this.registrations.length,a=this.isAccept()?"{count, plural, =1 {Accept registration} other {Accept registrations}}":"{count, plural, =1 {Reject registration} other {Reject registrations}}";return ee(a,{count:t});}getModalTitle(){let t=this.registrations.length,a=this.isAccept()?"{count, plural, =1 {Accept registration} other {Accept {count} registrations}}":"{count, plural, =1 {Reject registration} other {Reject {count} registrations}}";return ee(a,{count:t});}hasMultipleRegistrations(){return this.registrations.length>1;}get registration(){return this.registrations[0];}processRegistration(){return this.isAccept()?this.acceptRegistration():this.rejectRegistration();}isEmailEnabled(){return this.server.getHTMLConfig().email.enabled;}hasUnverifiedEmails(){return this.registrations.some(t=>t.emailVerified!==!0);}shouldDisableEmailDelivery(){return!this.isEmailEnabled()||this.hasUnverifiedEmails();}acceptRegistration(){let t=this.form.value.moderationResponse,a=this.form.value.preventEmailDelivery;mn(this.registrations).pipe(pn(i=>this.registrationService.acceptRegistration({registration:i,moderationResponse:t,preventEmailDelivery:a})),un()).subscribe({next:()=>{let i=this.registrations.length,u=ee("{count, plural, =1 {{username} account created} other {{count} accounts created}}",{count:i,username:this.registration?.username});this.notifier.success(u),this.registrationProcessed.emit(),this.hide();},error:i=>this.notifier.handleError(i)});}rejectRegistration(){let t=this.form.value.moderationResponse,a=this.form.value.preventEmailDelivery;mn(this.registrations).pipe(pn(i=>this.registrationService.rejectRegistration({registration:i,moderationResponse:t,preventEmailDelivery:a})),un()).subscribe({next:()=>{let i=this.registrations.length,u=ee("{count, plural, =1 {{username} registration rejected} other {{count} registrations rejected}}",{count:i,username:this.registration?.username});
13this.notifier.success(u),this.registrationProcessed.emit(),this.hide();},error:i=>this.notifier.handleError(i)});}};f(r,"\u0275fac",(()=>{let t;return function(i){return(t||(t=Vt(r)))(i||r);};})()),f(r,"\u0275cmp",R({type:r,selectors:[["my-process-registration-modal"]],viewQuery:function(a,i){a&1&&Oe(i.modal,Td,5),a&2&&Te();},outputs:{registrationProcessed:"registrationProcessed"},features:[Ct],decls:4,vars:0,consts:()=>{let t;t=" At least one registration email has not been verified. Email delivery has been disabled by default. ";let a;a=" The registration email has not been verified. Email delivery has been disabled by default. ";let i;i="Close this modal";let u;u="Prevent email from being sent to the user";let N;N="Cancel";let I;I="Send a message to the user";let T;T=""+"\uFFFD*2:1\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+"Accepting"+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+"\xA0"+"[\uFFFD#2:1\uFFFD|\uFFFD#2:2\uFFFD]"+""+"\uFFFD0:1\uFFFD"+""+"[\uFFFD/#2:1\uFFFD|\uFFFD/#2:2\uFFFD]"+" registrations will create the accounts and channels. "+"\uFFFD/*2:1\uFFFD"+""+"\uFFFD*3:2\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+"Accepting"+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+"\xA0"+"[\uFFFD#2:1\uFFFD|\uFFFD#2:2\uFFFD]"+""+"\uFFFD0:2\uFFFD"+""+"[\uFFFD/#2:1\uFFFD|\uFFFD/#2:2\uFFFD]"+" registration will create the account and channel. "+"\uFFFD/*3:2\uFFFD"+"",T=W(T);let h;h=""+"\uFFFD*2:1\uFFFD"+" An email will be sent to each user explaining its account has been created with the moderation response you'll write below. "+"\uFFFD/*2:1\uFFFD"+""+"\uFFFD*3:2\uFFFD"+" An email will be sent to "+"\uFFFD#1:2\uFFFD"+""+"\uFFFD0:2\uFFFD"+""+"\uFFFD/#1:2\uFFFD"+" explaining its account has been created with the moderation response you'll write below. "+"\uFFFD/*3:2\uFFFD"+"";let b;b=" Emails are not enabled on this instance so PeerTube won't be able to send an email explaining accounts have been created. ";let G;G=""+"\uFFFD*2:1\uFFFD"+" An email will be sent to each user explaining its registration request has been "+"[\uFFFD#1:1\uFFFD|\uFFFD#2:2\uFFFD]"+"rejected"+"[\uFFFD/#1:1\uFFFD|\uFFFD/#2:2\uFFFD]"+" with the moderation response you'll write below. "+"\uFFFD/*2:1\uFFFD"+""+"\uFFFD*3:2\uFFFD"+" An email will be sent to "+"\uFFFD#1:2\uFFFD"+""+"\uFFFD0:2\uFFFD"+""+"\uFFFD/#1:2\uFFFD"+" explaining its registration request has been "+"[\uFFFD#1:1\uFFFD|\uFFFD#2:2\uFFFD]"+"rejected"+"[\uFFFD/#1:1\uFFFD|\uFFFD/#2:2\uFFFD]"+" with the moderation response you'll write below. "+"\uFFFD/*3:2\uFFFD"+"",G=W(G);let U;return U=" Emails are not enabled on this instance so PeerTube won't be able to send an email explaining registration requests have been rejected. ",[["unverifiedEmailsMessage",""],["modal",""],t,a,I,T,h,b,G,U,["type","warning"],[1,"modal-header"],[1,"modal-title"],["title",i,1,"border-0","p-0",3,"click"],["iconName","cross"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-body","mb-3"],[1,"description"],[1,"form-group"],["for","moderationResponse"],["formControlName","moderationResponse","ngbAutofocus","","name","moderationResponse","id","moderationResponse",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["inputName","preventEmailDelivery","formControlName","preventEmailDelivery","labelText",u],[1,"modal-footer","inputs"],["type","button","role","button","value",N,1,"peertube-button","secondary-button",3,"click","key.enter"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],[4,"ngTemplateOutlet"]];},template:function(a,i){a&1&&k(0,vd,2,1,"ng-template",null,0,F)(2,qd,20,9,"ng-template",null,1,F);},dependencies:[$e,ge,Nn,qe,le,Se,Le,de,Ne,he,Re,ye,Ke,st],encapsulation:2}));let e=r;return e;})();function Kd(e,r){if(e&1&&g(0),e&2){let n=d(2);D(" \u2713 ",n.entry().email," ");}}function Jd(e,r){if(e&1&&(Et(0,"em"),g(1),gt()),e&2){let n=d(3);_(),D("? ",n.entry().email);}}function Yd(e,r){if(e&1&&p(0,Jd,2,1,"em"),e&2){let n=d(2);C(n.entry().emailVerified?-1:0);}}function Zd(e,r){if(e&1&&p(0,Kd,1,1)(1,Yd,1,1),e&2){let n=d();C(n.entry().emailVerified===!0?0:1);}}function ec(e,r){if(e&1&&g(0),e&2){let n=d();D(" ",n.entry().email," ");}}var Zi=(()=>{let r=class r{entry=ue(void 0);
13showEmailVerifyInformation=ue(void 0,{transform:fi});getTitle(){return this.entry().emailVerified?"User email has been verified":"User email hasn't been verified";}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-user-email-info"]],inputs:{entry:[1,"entry"],showEmailVerifyInformation:[1,"showEmailVerifyInformation"]},decls:4,vars:3,consts:[[3,"href","title"]],template:function(a,i){a&1&&(En(0),Et(1,"a",0),p(2,Zd,2,1)(3,ec,1,1),gt(),gn()),a&2&&(_(),Mi("href","mailto:"+i.entry().email,at)("title",i.getTitle()),_(),C(i.showEmailVerifyInformation()?2:3));},styles:[`a[_ngcontent-%COMP%]{color:var(--fg)}a[_ngcontent-%COMP%]:hover{text-decoration:underline}
14/*# sourceMappingURL=user-email-info.component-XUD35GY4.css.map */`]}));let e=r;return e;})();var tc=["processRegistrationModal"],nc=["table"],vl=e=>({state:e});function ic(e,r){if(e&1&&(S(0),s(1,7),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function oc(e,r){if(e&1&&(l(0,"td")(1,"div",16)(2,"div")(3,"span"),g(4),o(),l(5,"span",17),g(6),o()()()()),e&2){let n=d().$implicit;_(4),A(n.username),_(2),A(n.accountDisplayName);}}function rc(e,r){if(e&1&&(l(0,"td"),m(1,"my-user-email-info",18),o()),e&2){let n=d().$implicit,t=d();_(),c("entry",n)("showEmailVerifyInformation",t.requiresEmailVerification);}}function ac(e,r){if(e&1&&(l(0,"td")(1,"div",16)(2,"div")(3,"span"),g(4),o(),l(5,"span",17),g(6),o()()()()),e&2){let n=d().$implicit;_(4),A(n.channelHandle),_(2),A(n.channelDisplayName);}}function lc(e,r){if(e&1&&(l(0,"td",14),g(1),o()),e&2){let n=d().$implicit;c("ngbTooltip",n.registrationReason),_(),D(" ",n.registrationReason," ");}}function _c(e,r){if(e&1&&(l(0,"a",19),m(1,"my-global-icon",21),o()),e&2){let n=d(2).$implicit,t=d();c("queryParams",w(2,vl,n.state.id))("title",t.getStateFilterTitle(n.state.label));}}function sc(e,r){if(e&1&&(l(0,"a",20),m(1,"my-global-icon",22),o()),e&2){let n=d(2).$implicit,t=d();c("queryParams",w(2,vl,n.state.id))("title",t.getStateFilterTitle(n.state.label));}}function dc(e,r){if(e&1&&(l(0,"td",15),p(1,_c,2,4,"a",19)(2,sc,2,4,"a",20),o()),e&2){let n=d().$implicit,t=d();_(),C(t.isRegistrationAccepted(n)?1:t.isRegistrationRejected(n)?2:-1);}}function cc(e,r){if(e&1&&(l(0,"td",14),g(1),o()),e&2){let n=d().$implicit;c("ngbTooltip",n.moderationResponse),_(),D(" ",n.moderationResponse," ");}}function mc(e,r){if(e&1&&(l(0,"td"),g(1),K(2,"ptDate"),o()),e&2){let n=d().$implicit;_(),A(se(2,1,n.createdAt,"short"));}}function uc(e,r){if(e&1&&(p(0,oc,7,2,"td"),p(1,rc,2,2,"td"),p(2,ac,7,2,"td"),p(3,lc,2,2,"td",14),p(4,dc,3,1,"td",15),p(5,cc,2,2,"td",14),p(6,mc,3,4,"td")),e&2){d();let n=pe(1);C(n.isColumnDisplayed("account")?0:-1),_(),C(n.isColumnDisplayed("email")?1:-1),_(),C(n.isColumnDisplayed("channel")?2:-1),_(),C(n.isColumnDisplayed("registrationReason")?3:-1),_(),C(n.isColumnDisplayed("state")?4:-1),_(),C(n.isColumnDisplayed("moderationResponse")?5:-1),_(),C(n.isColumnDisplayed("createdAt")?6:-1);}}function pc(e,r){if(e&1&&m(0,"my-action-dropdown",23),e&2){let n=r.$implicit,t=d();c("actions",t.registrationActions)("entry",n);}}function Cc(e,r){if(e&1&&(l(0,"div")(1,"span",27),s(2,9),o(),m(3,"span",28),o()),e&2){let n=d().$implicit;_(3),c("innerHTML",n.moderationResponseHTML,Zt);}}function Ec(e,r){if(e&1&&(l(0,"div",24)(1,"div",25)(2,"div",26)(3,"span",27),s(4,8),o(),m(5,"span",28),o(),p(6,Cc,4,1,"div"),o()()),e&2){let n=r.$implicit;_(5),c("innerHTML",n.registrationReasonHTML,Zt),_(),C(n.moderationResponse?6:-1);}}function gc(e,r){e&1&&(S(0),s(1,10),M());}function Nc(e,r){e&1&&(S(0),s(1,11),M());}function Sc(e,r){if(e&1&&p(0,gc,2,0,"ng-container")(1,Nc,2,0,"ng-container"),e&2){let n=r.search,t=r.hasFilters;C(n||t?0:1);}}var Fl=(()=>{let r=class r{server=E(q);notifier=E(Z);markdownRenderer=E(hi);confirmService=E(we);adminRegistrationService=E(vn);processRegistrationModal=me("processRegistrationModal");table=me("table");registrationActions=[];bulkActions=[];requiresEmailVerification;columns=[{id:"account",label:"Account",sortable:!1},{id:"email",label:"Email",sortable:!1},{id:"channel",label:"Channel",sortable:!1},{id:"registrationReason",label:"Registration reason",sortable:!1},{id:"state",label:"State",sortable:!0},{id:"moderationResponse",label:"Moderation response",sortable:!1},{id:"createdAt",label:"Requested on",sortable:!0}];dataLoader;inputFilters=[{type:"options",key:"state",title:"Registration state",options:[{value:"all",label:"All registrations"},{value:fn.ACCEPTED,label:"Accepted registrations"},{value:fn.REJECTED,label:"Rejected registrations"}
14,{value:fn.PENDING,label:"Pending registrations"}]}];constructor(){this.dataLoader=this._dataLoader.bind(this);let{simpleActions:t,bulkActions:a}=jn([[{label:()=>"Accept",handler:i=>this.openRegistrationRequestProcessModal(i,"accept"),isDisplayed:i=>i.state.id===fn.PENDING,enableBulk:!0},{label:()=>"Reject",handler:i=>this.openRegistrationRequestProcessModal(i,"reject"),isDisplayed:i=>i.state.id===fn.PENDING,enableBulk:!0}],[{label:()=>"Remove",description:"Remove the request from the list. User can register again.",handler:i=>this.removeRegistrations(i),enableBulk:!0}]]);this.registrationActions=t,this.bulkActions=a;}ngOnInit(){this.server.getConfig().subscribe(t=>{this.requiresEmailVerification=t.signup.requiresEmailVerification;});}isRegistrationAccepted(t){return t.state.id===fn.ACCEPTED;}isRegistrationRejected(t){return t.state.id===fn.REJECTED;}onRegistrationProcessed(){this.table().loadData();}getStateFilterTitle(t){return"Filter by state: "+t+"";}_dataLoader(t){let N=t,{state:a}=N,i=Ei(N,["state"]),u;return a&&(u=[a]),this.adminRegistrationService.listRegistrations(Be(fe({},i),{stateOneOf:u})).pipe(We(I=>_e(this,null,function*(){for(let T of I.data)T.registrationReasonHTML=yield this.toHtml(T.registrationReason),T.moderationResponseHTML=yield this.toHtml(T.moderationResponse);return I;})));}openRegistrationRequestProcessModal(t,a){this.processRegistrationModal().openModal(t,a);}removeRegistrations(t){return _e(this,null,function*(){let a={count:t.length,username:t[0].username},i=ee("Do you really want to delete {count, plural, =1 {{username} registration request?} other {{count} registration requests?}}",a);(yield this.confirmService.confirm(i,"Delete"))!==!1&&this.adminRegistrationService.removeRegistrations(t).subscribe({next:()=>{let N=ee("Removed {count, plural, =1 {{username} registration request} other {{count} registration requests}}",a);this.notifier.success(N),this.table().loadData();},error:N=>this.notifier.handleError(N)});});}toHtml(t){return this.markdownRenderer.textMarkdownToHTML({markdown:t});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-registration-list"]],viewQuery:function(a,i){a&1&&Oe(i.processRegistrationModal,tc,5)(i.table,nc,5),a&2&&Te(2);},decls:14,vars:4,consts:()=>{let t;t="registrations per page";let a;a="{VAR_PLURAL, plural, =0 {No registration} =1 {1 registration} other {{INTERPOLATION} registrations}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Actions";let u;u="Registration reason:";let N;N="Moderation response:";let I;I="No registrations found matching current filters.";let T;return T="No registrations found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],["processRegistrationModal",""],a,u,N,I,T,["key","RegistrationListComponent","paginatorText",t,"columnConfig","true","searchInput","true",3,"defaultColumns","dataLoader","bulkActions","inputFilters"],[3,"registrationProcessed"],["container","body","placement","left auto",1,"max-width-300px","ellipsis",3,"ngbTooltip"],[1,"abuse-states"],[1,"chip","two-lines"],[1,"muted"],[3,"entry","showEmailVerifyInformation"],["routerLink",".",1,"pt-badge","badge-success",3,"queryParams","title"],["routerLink",".",1,"pt-badge","badge-danger",3,"queryParams","title"],["iconName","tick"],["iconName","cross"],["placement","bottom-right top-right left auto","container","body","label",i,3,"actions","entry"],[1,"moderation-expanded"],[1,"left"],[1,"d-flex"],[1,"moderation-expanded-label"],[1,"moderation-expanded-text",3,"innerHTML"]];},template:function(a,i){a&1&&(l(0,"my-table",12,0),k(2,ic,3,4,"ng-template",null,1,F)(4,uc,7,7,"ng-template",null,2,F)(6,pc,1,2,"ng-template",null,3,F)(8,Ec,7,2,"ng-template",null,4,F)(10,Sc,2,1,"ng-template",null,5,F),o(),l(12,"my-process-registration-modal",13,6),P("registrationProcessed",function(){return i.onRegistrationProcessed();}),o()),a&2&&c("defaultColumns",i.columns)("dataLoader",i.dataLoader)("bulkActions",i.bulkActions)("inputFilters",i.inputFilters);},dependencies:[Pe,qe,qt,Ti,Zi,hl,je,Je,He],styles:[`.moderation-expanded[_ngcontent-%COMP%]{font-size:90%;display:flex;flex-wrap:wrap;justify-content:space-between}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-label[_ngcontent-%COMP%]{font-weight:600;display:inline-block;vertical-align:top;text-align:end;min-width:100px;margin-inline-end:.3125rem}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-text[_ngcontent-%COMP%]{display:inline-flex;word-wrap:break-word}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-text[_ngcontent-%COMP%]     p:last-child{margin-bottom:0!important}.moderation-expanded[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{width:50%;max-width:500px}@media screen and (max-width:1000px){.moderation-expanded[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{width:100%}}.table-comment-link[_ngcontent-%COMP%], .table-account-link[_ngcontent-%COMP%]{text-decoration:none;color:var(--fg)}.table-comment-link[_ngcontent-%COMP%]:focus:not(:focus-visible), .table-account-link[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none!important}.table-comment-link[_ngcontent-%COMP%]     p:last-child, .table-account-link[_ngcontent-%COMP%]     p:last-child{margin:0}my-abuse-details[_ngcontent-%COMP%]{width:100%}@media screen and (max-width:1000px){.abuse-messages[_ngcontent-%COMP%]{justify-content:flex-start!important}}
15/*# sourceMappingURL=moderation-GBT6NJBZ.css.map */`,`my-global-icon[_ngcontent-%COMP%]{width:24px;height:24px}
16/*# sourceMappingURL=registration-list.component-OM3BB2H7.css.map */`]}));let e=r;return e;})();var Dl=(()=>{let r=class r{};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["ng-component"]],decls:5,vars:0,consts:()=>{let t;t="Video name/description and comments that contain any of the watched words are automatically tagged with the name of the list.";let a;return a="These automatic tags can be used to filter comments and videos.",[t,a,[1,"d-block"],[1,"d-block","mb-3"],["mode","admin"]];},template:function(a,i){a&1&&(l(0,"em",2),s(1,0),o(),l(2,"em",3),s(3,1),o(),m(4,"my-watched-words-list-admin-owner",4));},dependencies:[Za],encapsulation:2}));let e=r;return e;})();
16var Co=[{path:"moderation",children:[{path:"",redirectTo:"abuses/list",pathMatch:"full"},{path:"video-abuses",redirectTo:"abuses/list",pathMatch:"full"},{path:"video-abuses/list",redirectTo:"abuses/list",pathMatch:"full"},{path:"abuses/list",component:Il,canActivate:[Xe],data:{userRight:Y.MANAGE_ABUSES,meta:{title:"Reports"}}},{path:"video-blacklist",redirectTo:"video-blocks/list",pathMatch:"full"},{path:"video-auto-blacklist",redirectTo:"video-blocks/list",pathMatch:"full"},{path:"video-auto-blacklist/list",redirectTo:"video-blocks/list",pathMatch:"full"},{path:"video-blacklist",redirectTo:"video-blocks/list",pathMatch:"full"},{path:"video-blocks/list",component:Pl,canActivate:[Xe],data:{userRight:Y.MANAGE_VIDEO_BLACKLIST,meta:{title:"Blocked videos"}}},{path:"registrations/list",component:Fl,canActivate:[Xe],data:{userRight:Y.MANAGE_REGISTRATIONS,meta:{title:"User registrations"}}},{path:"video-comments",redirectTo:"video-comments/list",pathMatch:"full"},{path:"video-comments/list",redirectTo:"/admin/overview/comments/list",pathMatch:"full"},{path:"blocklist/accounts",component:Ol,canActivate:[Xe],data:{userRight:Y.MANAGE_ACCOUNTS_BLOCKLIST,meta:{title:"Muted accounts"}}},{path:"blocklist/servers",component:Tl,canActivate:[Xe],data:{userRight:Y.MANAGE_SERVERS_BLOCKLIST,meta:{title:"Muted platforms"}}},{path:"watched-words/list",component:Dl,canActivate:[Xe],data:{userRight:Y.MANAGE_INSTANCE_WATCHED_WORDS,meta:{title:"Watched words"}}}]}];var Mc=[[["badges"]],[["buttons"]]],fc=["badges","buttons"],eo=(()=>{let r=class r{pluginApiService=E(Qt);plugin=ue(void 0);version=ue(void 0);pluginType=ue(void 0);getPluginOrThemeHref(t){return this.pluginApiService.getPluginOrThemeHref(this.pluginType(),t);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-plugin-card"]],inputs:{plugin:[1,"plugin"],version:[1,"version"],pluginType:[1,"pluginType"]},ngContentSelectors:fc,decls:17,vars:5,consts:()=>{let t;t="Homepage (new window)";let a;return a="NPM page (new window)",[[1,"card","plugin"],[1,"card-body"],[1,"first-row"],[1,"plugin-name"],[1,"plugin-version"],["target","_blank","rel","noopener noreferrer","title",t,1,"plugin-icon",3,"href"],["iconName","home"],["target","_blank","rel","noopener noreferrer","title",a,1,"plugin-icon",3,"href"],["iconName","registry"],[1,"buttons"],[1,"second-row"],["dir","auto",1,"description"]];},template:function(a,i){a&1&&(br(Mc),l(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),g(4),o(),l(5,"span",4),g(6),o(),l(7,"a",5),m(8,"my-global-icon",6),o(),l(9,"a",7),m(10,"my-global-icon",8),o(),lo(11),l(12,"div",9),lo(13,1),o()(),l(14,"div",10)(15,"div",11),g(16),o()()()()),a&2&&(_(4),A(i.plugin().name),_(2),A(i.version()),_(),c("href",i.plugin().homepage,at),_(2),c("href",i.getPluginOrThemeHref(i.plugin().name),at),_(7),A(i.plugin().description));},dependencies:[qe],styles:[`.plugin[_ngcontent-%COMP%]{margin:15px 0;background-color:var(--bg-secondary-400)}.first-row[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:10px}.first-row[_ngcontent-%COMP%]   .plugin-name[_ngcontent-%COMP%]{font-weight:600;margin-inline-end:.625rem}.first-row[_ngcontent-%COMP%]   .plugin-version[_ngcontent-%COMP%]{opacity:.7}.first-row[_ngcontent-%COMP%]   .plugin-icon[_ngcontent-%COMP%]{margin-inline-start:.625rem}.first-row[_ngcontent-%COMP%]   .plugin-icon[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{color:var(--fg-400)}.first-row[_ngcontent-%COMP%]   .plugin-icon[_ngcontent-%COMP%]   my-global-icon[iconName=npm][_ngcontent-%COMP%]     svg path{fill:var(--fg-400)}.first-row[_ngcontent-%COMP%]   .buttons[_ngcontent-%COMP%]{width:max-content;margin-inline-start:auto}.second-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;align-items:center;justify-content:space-between}.second-row[_ngcontent-%COMP%]   .description[_ngcontent-%COMP%]{opacity:.8}@media screen and (max-width:800px){.first-row[_ngcontent-%COMP%]{flex-wrap:wrap}.first-row[_ngcontent-%COMP%]   .buttons[_ngcontent-%COMP%]{flex-basis:100%;margin-top:10px}}
17/*# sourceMappingURL=plugin-card.component-WUEVVBQH.css.map */`]}));let e=r;return e;})();function Ac(e,r){if(e&1&&(l(0,"div",0),g(1),o()),e&2){let n=d();_(),D(" ",n.getNoResultMessage()," ");}}function Ic(e,r){if(e&1&&m(0,"my-button",4),e&2){let n=d().$implicit,t=d();c("ptRouterLink",t.getShowRouterLink(n))("responsiveLabel",!0);}}function Oc(e,r){if(e&1){let n=Q();l(0,"my-button",7),P("click",function(){L(n);let a=d().$implicit,i=d();return y(i.update(a));}),o();}if(e&2){let n=d().$implicit,t=d();c("loading",t.isUpdating(n))("label",t.getUpdateLabel(n))("responsiveLabel",!0),Cn("disabled",t.isUpdating(n)||t.isUninstalling(n));}}function Tc(e,r){if(e&1){let n=Q();l(0,"my-plugin-card",2)(1,"div",3),p(2,Ic,1,2,"my-button",4),p(3,Oc,1,4,"my-button",5),l(4,"my-delete-button",6),P("click",function(){let a=L(n).$implicit,i=d();return y(i.uninstall(a));}),o()()();}if(e&2){let n=r.$implicit,t=d();c("plugin",n)("version",n.version)("pluginType",t.pluginType),_(2),C(t.isTheme(n)?-1:2),_(),C(t.isU
17pdateAvailable(n)?3:-1),_(),c("responsiveLabel",!0)("disabled",t.isUpdating(n)||t.isUninstalling(n));}}var bl=(()=>{let r=class r{pluginService=E(In);pluginApiService=E(Qt);notifier=E(Z);confirmService=E(we);router=E(Mn);route=E(xe);pluginType;pagination={currentPage:1,itemsPerPage:10,totalItems:null};sort="name";plugins=[];updating={};uninstalling={};onDataSubject=new ii();ngOnInit(){if(!this.route.snapshot.queryParams.pluginType){let t={pluginType:_t.PLUGIN};this.router.navigate([],{queryParams:t,replaceUrl:!0});}this.route.queryParams.subscribe(t=>{t.pluginType&&(this.pluginType=parseInt(t.pluginType,10),this.reloadPlugins());});}reloadPlugins(){this.plugins=[],Ri(this.pagination),this.loadMorePlugins();}loadMorePlugins(){this.pluginApiService.getPlugins(this.pluginType,this.pagination,this.sort).subscribe({next:t=>{this.plugins=this.plugins.concat(t.data),this.pagination.totalItems=t.total,this.onDataSubject.next(t.data);},error:t=>this.notifier.handleError(t)});}onNearOfBottom(){Pi(this.pagination)&&(this.pagination.currentPage+=1,this.loadMorePlugins());}getNoResultMessage(){return this.pluginType===_t.PLUGIN?"You don't have plugins installed yet.":"You don't have themes installed yet.";}isUpdateAvailable(t){return t.latestVersion&&Kr(t.latestVersion,t.version)>0;}getUpdateLabel(t){return"Update to "+t.latestVersion+"";}isUpdating(t){return!!this.updating[this.getPluginKey(t)];}isUninstalling(t){return!!this.uninstalling[this.getPluginKey(t)];}isTheme(t){return t.type===_t.THEME;}uninstall(t){return _e(this,null,function*(){let a=this.getPluginKey(t);this.uninstalling[a]||(yield this.confirmService.confirm("Do you really want to uninstall "+t.name+"?","Uninstall"))===!1||(this.uninstalling[a]=!0,this.pluginApiService.uninstall(t.name,t.type).subscribe({next:()=>{this.notifier.success(""+t.name+" uninstalled."),this.plugins=this.plugins.filter(u=>u.name!==t.name),la(this.pagination),this.uninstalling[a]=!1;},error:u=>{this.notifier.handleError(u),this.uninstalling[a]=!1;}}));});}update(t){return _e(this,null,function*(){let a=this.getPluginKey(t);this.updating[a]||this.isMajorUpgrade(t)&&(yield this.confirmService.confirm("This is a major plugin upgrade. Please go on the plugin homepage to check potential release notes.","Upgrade",{confirmButtonText:"Proceed upgrade"}))===!1||(this.updating[a]=!0,this.pluginApiService.update(t.name,t.type).pipe().subscribe({next:i=>{this.updating[a]=!1,this.notifier.success(""+t.name+" updated."),Object.assign(t,i);},error:i=>{this.notifier.handleError(i),this.updating[a]=!1;}}));});}getShowRouterLink(t){return["/admin","settings","plugins","show",this.pluginService.nameToNpmName(t.name,t.type)];}getPluginOrThemeHref(t){return this.pluginApiService.getPluginOrThemeHref(this.pluginType,t);}getPluginKey(t){return t.name+t.type;}isMajorUpgrade(t){if(!t.latestVersion)return!1;let a=parseInt(t.latestVersion.split(".")[0]),i=parseInt(t.version.split(".")[0]);return a>i;}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-plugin-list-installed"]],decls:4,vars:2,consts:()=>{let t;t="Settings";let a;return a="Uninstall",[[1,"no-results"],["myInfiniteScroller","",1,"plugins",3,"nearOfBottom","dataObservable"],[3,"plugin","version","pluginType"],["ngProjectAs","buttons",5,["buttons"]],["label",t,"icon","config",3,"ptRouterLink","responsiveLabel"],["icon","refresh",1,"update-button",3,"loading","label","responsiveLabel"],["label",a,3,"click","responsiveLabel","disabled"],["icon","refresh",1,"update-button",3,"click","loading","label","responsiveLabel"]];},template:function(a,i){a&1&&(p(0,Ac,2,1,"div",0),l(1,"div",1),P("nearOfBottom",function(){return i.onNearOfBottom();}),Ce(2,Tc,5,7,"my-plugin-card",2,Ie),o()),a&2&&(C(i.pagination.totalItems===0?0:-1),_(),c("dataObservable",i.onDataSubject.asObservable()),_(),Ee(i.plugins));},dependencies:[Di,eo,Ft,Tn],styles:[`.update-button[disabled=true][_ngcontent-%COMP%]     .action-button{cursor:default!important}my-edit-button[_ngcontent-%COMP%], my-button[_ngcontent-%COMP%]{margin-inline-end:.625rem}
18/*# sourceMappingURL=plugin-list-installed.component-7CWFRCGK.css.map */`]}));let e=r;return e;})();function Pc(e,r){e&1&&(l(0,"my-alert",8),s(1,0),o());}function Rc(e,r){e&1&&(S(0),s(1,1),M());}function hc(e,r){e&1&&(S(0),s(1,2),M());}function vc(e,r){if(e&1&&(l(0,"div"),m(1,"my-global-icon",15),p(2,Rc,2,0,"ng-container")(3,hc,2,0,"ng-container"),o()),e&2){let n=d();_(2),C(n.isThemeSearch()?2:3);}}function Fc(e,r){if(e&1&&(l(0,"div"),m(1,"my-global-icon",16),S(2),s(3,3),M(),o()),e&2){let n=d();_(3),$(n.pagination.totalItems)(n.pagination.totalItems)(n.search),x(3);}}function Dc(e,r){e&1&&(l(0,"div",12),s(1,4),o());}function bc(e,r){e&1&&(l(0,"span",18),s(1,5),o());}function Gc(e,r){e&1&&(l(0,"span",19),s(1,6),o());}function Lc(e,r){e&1&&(l(0,"span",20),s(1,7),o());}function yc(e,r){if(e&1&&m(0,"my-edit-button",22),e&2){let n=d().$implicit,t=d();c("ptRouterLink",t.getShowRouterLink(n))("responsiveLabel",!0);}}function $c(e,r){if(e&1){let n=Q();l(0,"my-button",24),P("click",function(){L(n);let a=d().$implicit,i=d();return y(i.install(a));}),o();}if(e&2){let n=d().$implicit,t=d();c("loading",t.isInstalling(n))("responsiveLabel",!0),Cn("disabled",t.isInstalling(n));}}function xc(e,r){if(e&1&&(l(0,"my-plugin-card",14)(1,"div",17),p(2,bc,2,0,"span",18),p(3,Gc,2,0,"span",19),p(4,Lc,2,0,"span",20),o(),l(5,"div",21),p(6,yc,1,2,"my-edit-button",22),p(7,$c,1,3,"my-button",23),o()()),e&2){let n=r.$implicit,t=d();c("plugin",n)("version",n.latestVersion)("pluginType",t.pluginType),_(2),C(n.installed?2:-1),_(),C(n.official?3:-1),_(),C(n.recommended?4:-1),_(2),C(n.installed===!0&&!t.isThemeSearch()?6:-1),_(),C(n.installed===!1?7:-1);}}var Gl=(()=>{let r=class r{pluginService=E(In);pluginApiService=E(Qt);notifier=E(Z);confirmService=E(we);router=E(Mn);route=E(xe);pluginType;pagination={currentPage:1,itemsPerPage:10,totalItems:null};sort="-trending";search="";isSearching=!1;plugins=[];installing={};pluginInstalled=!1;
18onDataSubject=new ii();searchSubject=new ii();ngOnInit(){if(!this.route.snapshot.queryParams.pluginType){let t={pluginType:_t.PLUGIN};this.router.navigate([],{queryParams:t});}this.route.queryParams.subscribe(t=>{t.pluginType&&(this.pluginType=parseInt(t.pluginType,10),this.search=t.search||"",this.reloadPlugins());}),this.searchSubject.asObservable().pipe(Ni(400),Rr()).subscribe(t=>this.router.navigate([],{queryParams:{search:t},queryParamsHandling:"merge"}));}onSearchChange(t){let a=t.target;this.searchSubject.next(a.value);}reloadPlugins(){Ri(this.pagination),this.plugins=[],this.loadMorePlugins();}loadMorePlugins(){this.isSearching=!0,this.pluginApiService.searchAvailablePlugins(this.pluginType,this.pagination,this.sort,this.search).subscribe({next:t=>{this.isSearching=!1,this.plugins=this.plugins.concat(t.data),this.pagination.totalItems=t.total,this.onDataSubject.next(t.data);},error:t=>{Ii.error(t);let a="The plugin index is not available. Please retry later.";this.notifier.error(a);}});}onNearOfBottom(){Pi(this.pagination)&&(this.pagination.currentPage+=1,this.loadMorePlugins());}isInstalling(t){return!!this.installing[t.npmName];}getShowRouterLink(t){return["/admin","settings","plugins","show",this.pluginService.nameToNpmName(t.name,this.pluginType)];}isThemeSearch(){return this.pluginType===_t.THEME;}install(t){return _e(this,null,function*(){this.installing[t.npmName]||(yield this.confirmService.confirm("Please only install plugins or themes you trust, since they can execute any code on your platform.","Install "+t.name+"?"))===!1||(this.installing[t.npmName]=!0,this.pluginApiService.install(t.npmName).subscribe({next:()=>{this.installing[t.npmName]=!1,this.pluginInstalled=!0,this.notifier.success(""+t.name+" installed."),t.installed=!0;},error:i=>{this.installing[t.npmName]=!1,this.notifier.handleError(i);}}));});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-plugin-search"]],decls:10,vars:5,consts:()=>{let t;t="Search...";let a;a=" To load your new installed plugins or themes, refresh the page. ";let i;i="Popular themes";let u;u="Popular plugins";let N;N="{VAR_PLURAL, plural, =1 {result} other {results}}",N=W(N,{VAR_PLURAL:"\uFFFD1\uFFFD"});let I;I=" "+"\uFFFD0\uFFFD"+" "+N+" for \""+"\uFFFD2\uFFFD"+"\" ";let T;T="No results.";let h;h="This plugin is developed by Framasoft, the not-for-profit that develops PeerTube";let b;b="This plugin is recommended by Framasoft, the not-for-profit that develops PeerTube";let G;G="Settings";let U;U="Installed";let J;J="Official";let V;return V="Recommended",[a,i,u,I,T,U,J,V,["type","primary",1,"mt-3"],[1,"result-and-search"],[1,"search-bar"],["type","text","placeholder",t,"myAutofocus","",3,"input"],[1,"no-results"],["myInfiniteScroller","",1,"plugins",3,"nearOfBottom","dataObservable"],[3,"plugin","version","pluginType"],["iconName","trending","aria-hidden","true"],["iconName","search"],["ngProjectAs","badges",5,["badges"]],[1,"pt-badge","badge-success"],["title",h,1,"pt-badge","badge-primary"],["title",b,1,"pt-badge","badge-primary"],["ngProjectAs","buttons",5,["buttons"]],["label",G,3,"ptRouterLink","responsiveLabel"],["label","Install","icon","cloud-download",3,"loading","responsiveLabel"],["label","Install","icon","cloud-download",3,"click","loading","responsiveLabel"]];},template:function(a,i){a&1&&(p(0,Pc,2,0,"my-alert",8),l(1,"div",9),p(2,vc,4,1,"div"),p(3,Fc,4,3,"div"),l(4,"div",10)(5,"input",11),P("input",function(N){return i.onSearchChange(N);}),o()()(),p(6,Dc,2,0,"div",12),l(7,"div",13),P("nearOfBottom",function(){return i.onNearOfBottom();}),Ce(8,xc,8,8,"my-plugin-card",14,Ie),o()),a&2&&(C(i.pluginInstalled?0:-1),_(2),C(i.search?-1:2),_(),C(i.search&&!i.isSearching?3:-1),_(3),C(i.pagination.totalItems===0?6:-1),_(),c("dataObservable",i.onDataSubject.asObservable()),_(),Ee(i.plugins));},dependencies:[qe,tl,Di,eo,el,Ft,st],styles:[`.result-and-search[_ngcontent-%COMP%]{font-size:22px;font-weight:600;margin:30px 0 15px;display:flex;flex-wrap:wrap;row-gap:.5rem;justify-content:space-between}.result-and-search[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{display:inline-block;width:24px;height:24px;line-height:24px;margin-inline-end:.3125rem}
18.search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}.search-bar[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.search-bar[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){.search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}}.pt-badge[_ngcontent-%COMP%]{font-size:13px;margin-inline-start:.9375rem}
19/*# sourceMappingURL=plugin-search.component-FZP6ZMUI.css.map */`]}));let e=r;return e;})();function wc(e,r){if(e&1&&(l(0,"div",5),m(1,"my-dynamic-form-field",7),o()),e&2){let n=r.$implicit,t=d(3);c("id",t.getWrapperId(n)),_(),c("hidden",t.isSettingHidden(n))("form",t.form)("setting",n)("formErrors",t.formErrors);}}function Uc(e,r){if(e&1){let n=Q();l(0,"form",4),P("ngSubmit",function(){L(n);let a=d(2);return y(a.formValidated());}),Ce(1,wc,2,5,"div",5,Ie),m(3,"input",6),o();}if(e&2){let n=d(2);c("formGroup",n.form),_(),Ee(n.registeredSettings),_(2),c("disabled",!n.form.valid);}}function Vc(e,r){e&1&&(l(0,"div",8),s(1,0),o());}function kc(e,r){e&1&&(l(0,"div",8),s(1,1),o());}function zc(e,r){if(e&1&&p(0,Vc,2,0,"div",8)(1,kc,2,0,"div",8),e&2){let n=d(2);C(n.isPlugin()?0:n.isTheme()?1:-1);}}function Xc(e,r){if(e&1&&(l(0,"h2",2),S(1),g(2),M(),g(3),o(),p(4,Uc,4,2,"form",3),p(5,zc,2,1)),e&2){let n=d();_(2),A(n.pluginTypeLabel),_(),D(" ",n.plugin.name," "),_(),C(n.hasRegisteredSettings()?4:-1),_(),C(n.hasRegisteredSettings()?-1:5);}}var Ll=(()=>{let r=class r extends Kt{formReactiveService=E(Me);pluginService=E(In);pluginAPIService=E(Qt);notifier=E(Z);hooks=E(vi);route=E(xe);server=E(q);plugin;registeredSettings=[];pluginTypeLabel;sub;npmName;ngOnInit(){this.sub=this.route.params.subscribe(t=>{this.npmName=t.npmName,this.loadPlugin(this.npmName);});}ngOnDestroy(){this.sub&&this.sub.unsubscribe();}formValidated(){let t=this.form.value;this.pluginAPIService.updatePluginSettings(this.plugin.name,this.plugin.type,t).pipe(We(()=>this.server.resetConfig())).subscribe({next:()=>{this.notifier.success("Settings updated.");},error:a=>this.notifier.handleError(a)});}hasRegisteredSettings(){return Array.isArray(this.registeredSettings)&&this.registeredSettings.length!==0;}isSettingHidden(t){let a=this.pluginService.getRegisteredSettingsScript(this.npmName);return a?.isSettingHidden?a.isSettingHidden({setting:t,formValues:this.form.value}):!1;}getWrapperId(t){if(t.name)return t.name+"-wrapper";}isTheme(){return this.plugin.type===_t.THEME;}isPlugin(){return this.plugin.type===_t.PLUGIN;}loadPlugin(t){this.pluginAPIService.getPlugin(t).pipe(We(a=>
19this.pluginAPIService.getPluginRegisteredSettings(a.name,a.type).pipe(lt(i=>({plugin:a,registeredSettings:i.registeredSettings}))))).subscribe({next:u=>_e(this,[u],function*({plugin:a,registeredSettings:i}){this.plugin=a,this.registeredSettings=yield this.translateSettings(i),this.pluginTypeLabel=this.pluginAPIService.getPluginTypeLabel(this.plugin.type),this.buildSettingsForm();}),error:a=>this.notifier.handleError(a)});}buildSettingsForm(){let t={},a={};for(let i of this.registeredSettings)t[i.name]=null,a[i.name]=this.getSetting(i.name);this.buildForm(t),this.form.patchValue(a),this.hooks.runAction("action:admin-plugin-settings.init","admin-plugin",{npmName:this.npmName});}getSetting(t){let a=this.plugin.settings;return a?.[t]!==void 0?a[t]:this.registeredSettings.find(u=>u.name===t).default;}translateSettings(t){return _e(this,null,function*(){for(let a of t)yield this.pluginService.translateSetting(this.npmName,a);return t;});}};f(r,"\u0275fac",(()=>{let t;return function(i){return(t||(t=Vt(r)))(i||r);};})()),f(r,"\u0275cmp",R({type:r,selectors:[["my-plugin-show-installed"]],features:[Ct],decls:1,vars:1,consts:()=>{let t;t="This plugin does not have settings.";let a;return a="This theme does not have settings.",[t,a,[1,"mb-4"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[3,"id"],["type","submit","value","Update plugin settings",1,"peertube-button","primary-button","mt-3",3,"disabled"],[3,"hidden","form","setting","formErrors"],[1,"no-settings"]];},template:function(a,i){a&1&&p(0,Xc,6,4),a&2&&C(i.plugin?0:-1);},dependencies:[le,Se,Ne,he,Re,nl],encapsulation:2}));let e=r;return e;})();var yl=[{path:"plugins",canActivate:[Xe],data:{userRight:Y.MANAGE_PLUGINS},children:[{path:"",redirectTo:"list-installed?pluginType=1",pathMatch:"full"},{path:"list-installed",component:bl,data:{meta:{title:"List installed plugins"}}},{path:"search",component:Gl,data:{meta:{title:"Search plugins"}}},{path:"show/:npmName",component:Ll,data:{meta:{title:"Show plugin"}}}]}];var Jt=class Jt{authHttp=E(Rt);restExtractor=E(vt);getDebug(){return this.authHttp.get(Jt.BASE_DEBUG_URL).pipe(ke(r=>this.restExtractor.handleError(r)));}testEmails(r){let n={command:"test-emails",email:r};return this.authHttp.post(Jt.BASE_DEBUG_URL+"/run-command",n).pipe(ke(t=>this.restExtractor.handleError(t)));}};f(Jt,"BASE_DEBUG_URL",Ot.apiUrl+"/api/v1/server/debug"),f(Jt,"\u0275fac",function(n){return new(n||Jt)();}),f(Jt,"\u0275prov",Tt({token:Jt,factory:Jt.ɵfac}));var Jn=Jt;var $l=(()=>{let r=class r{debugService=E(Jn);notifier=E(Z);server=E(q);debug;testEmail;ngOnInit(){this.load();}isEmailDisabled(){return this.server.getHTMLConfig().email.enabled===!1;}load(){this.debugService.getDebug().subscribe({next:t=>this.debug=t,error:t=>this.notifier.handleError(t)});}sendTestEmails(){this.debugService.testEmails(this.testEmail).subscribe({next:()=>{this.testEmail="",this.notifier.success("Emails will be sent!");},error:t=>this.notifier.handleError(t)});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["ng-component"]],decls:34,vars:4,consts:()=>{let t;t="Send test emails";let a;a="IP address";let i;i="PeerTube thinks your web browser public IP is "+"\uFFFD#6\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#6\uFFFD"+".";let u;u="If this is not your correct public IP, please consider fixing it because:";let N;N="Views may not be counted correctly (reduced compared to what they should be)";let I;I="Anti brute force system could be overzealous";let T;T="P2P system could not work correctly";let h;h="To fix it:";let b;b="Check the "+"\uFFFD#22\uFFFD"+"trust_proxy"+"\uFFFD/#22\uFFFD"+" configuration key";let G;G="Emails";let U;U="Send test emails to this address";let J;return J="PeerTube can send all available email templates to the following email address",[a,i,u,N,I,T,h,b,G,U,J,[1,"root"],[1,"fs-5"],[1,"mt-4",3,"hidden"],[3,"ngSubmit"],[1,"form-group"],["for","fromName"],[1,"form-group-description"],["type","email","id","test-email","name","test-email",1,"form-control",3,"ngModelChange","ngModel"],["type","submit","value",t,1,"peertube-button","primary-button",3,"disabled"]];},template:function(a,i){a&1&&(l(0,"div",11)(1,"div")(2,"h2",12),s(3,0),o(),l(4,"p"),z(5,1),m(6,"strong"),X(),o(),l(7,"p"),s(8,2),o(),l(9,"ul")(10,"li"),s(11,3),o(),l(12,"li"),s(13,4),o(),l(14,"li"),s(15,5),o()(),l(16,"p"),s(17,6),o(),m(18,"p"),l(19,"ul")(20,"li"),z(21,7),m(22,"code"),X(),o()()(),l(23,"div",13)(24,"h2",12),s(25,8),o(),l(26,"form",14),P("ngSubmit",function(){return i.sendTestEmails();}),l(27,"div",15)(28,"label",16),s(29,9),o(),l(30,"div",17),s(31,10),o(),l(32,"input",18),Mt("ngModelChange",function(N){return St(i.testEmail,N)||(i.testEmail=N),N;}),o()(),m(33,"input",19),o()()()),a&2&&(_(6),$(i.debug==null?null:i.debug.ip),x(5),_(17),c("hidden",i.isEmailDisabled()),_(9),Nt("ngModel",i.testEmail),_(),c("disabled",!i.testEmail));},dependencies:[le,Se,Le,de,Ne,zt,kr],styles:[`code[_ngcontent-%COMP%]{font-size:14px;font-weight:600}.root[_ngcontent-%COMP%]{max-width:500px}
20/*# sourceMappingURL=debug.component-UNJEH4J6.css.map */`]}));let e=r;return e;})();var on=class on{authHttp=E(Rt);restService=E(Ht);restExtractor=E(vt);listJobs(r){let{jobState:n,jobType:t,pagination:a,sort:i}=r,u=new Pt();return u=this.restService.addRestGetParams(u,a,i),t&&(u=u.append("jobType",t)),this.authHttp.get(on.BASE_JOB_URL+`/${n||""}`,{params:u}).pipe(lt(N=>this.restExtractor.convertResultListDateToHuman(N,["createdAt","processedOn","finishedOn"],"precise")),lt(N=>this.restExtractor.applyToResultListData(N,this.prettyPrintData.bind(this))),lt(N=>this.restExtractor.applyToResultListData(N,this.buildUniqId.bind(this))),ke(N=>this.restExtractor.handleError(N)));}prettyPrintData(r){let n=JSON.stringify(r.data,null,2);return Object.assign(r,{data:n});}buildUniqId(r){return Object.assign(r,{uniqId:`${r.id}-${r.type}`});}};f(on,"BASE_JOB_URL",Ot.apiUrl+"/api/v1/jobs"),f(on,"\u0275fac",function(n){return new(n||on)();}),f(on,"\u0275prov",Tt({token:on,factory:on.ɵfac}));var Yn=on;var Bc=["table"],Wc=e=>({type:e}),Hc=e=>({state:e}),jc=(e,r,n,t)=>[e,r,n,t];function Qc(e,r){e&1&&(l(0,"div",9),z(1,5),m(2,"a",11),X(),o());}function qc(e,r){if(e&1&&(S(0),s(1,6),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function Kc(e,r){if(e&1&&(l(0,"td",12),g(1),o()),e&2){let n=d().$implicit;c("title",n.id),_(),A(n.id);}}
20function Jc(e,r){if(e&1&&(l(0,"td",13)(1,"a",19),g(2),o()()),e&2){let n=d().$implicit,t=d();_(),c("queryParams",w(4,Wc,n.type))("title",t.getTypeFilterTitle(n.type))("ngClass",t.getRandomJobTypeBadge(n.type)),_(),A(n.type);}}function Yc(e,r){if(e&1&&(l(0,"td",14),g(1),o()),e&2){let n=d().$implicit;_(),A(n.priority);}}function Zc(e,r){if(e&1&&(l(0,"td",15)(1,"a",20),g(2),o()()),e&2){let n=d().$implicit,t=d();_(),c("queryParams",w(4,Hc,n.state))("ngClass",t.getJobStateClasses(n.state))("title",t.getStateFilterTitle(n.state)),_(),A(n.state);}}function em(e,r){if(e&1&&g(0),e&2){let n=d(2).$implicit,t=d();D(" ",t.getProgress(n)," ");}}function tm(e,r){if(e&1&&(l(0,"td",16),p(1,em,1,1),o()),e&2){let n=d().$implicit,t=d();_(),C(t.hasProgress(n)?1:-1);}}function nm(e,r){if(e&1&&(l(0,"td",17),g(1),o()),e&2){let n=d().$implicit;_(),A(n.createdAt);}}function im(e,r){if(e&1&&(l(0,"td",18)(1,"div"),g(2),o(),l(3,"div"),g(4),o()()),e&2){let n=d().$implicit;_(2),A(n.processedOn),_(2),A(n.finishedOn);}}function om(e,r){if(e&1&&(p(0,Kc,2,2,"td",12),p(1,Jc,3,6,"td",13),p(2,Yc,2,1,"td",14),p(3,Zc,3,6,"td",15),p(4,tm,2,1,"td",16),p(5,nm,2,1,"td",17),p(6,im,5,2,"td",18)),e&2){d();let n=pe(2);C(n.isColumnDisplayed("id")?0:-1),_(),C(n.isColumnDisplayed("type")?1:-1),_(),C(n.isColumnDisplayed("priority")?2:-1),_(),C(n.isColumnDisplayed("state")&&n.isColumnDisplayed("state")?3:-1),_(),C(n.isColumnDisplayed("progress")?4:-1),_(),C(n.isColumnDisplayed("createdAt")?5:-1),_(),C(n.isColumnDisplayed("processed")?6:-1);}}function rm(e,r){if(e&1&&(l(0,"div")(1,"pre"),g(2),o()(),l(3,"div")(4,"pre"),g(5),o()(),l(6,"div")(7,"pre"),g(8),o()()),e&2){let n=r.$implicit;_(2),A(xr(3,jc,"Job: "+n.id,"Type: "+n.type,"Processed on "+(n.processedOn||"-"),"Finished on "+(n.finishedOn||"-")).join(`
21`)),_(3),A(n.data),_(3),A(n.error);}}function am(e,r){e&1&&(S(0),s(1,7),M());}function lm(e,r){e&1&&(S(0),s(1,8),M());}function _m(e,r){if(e&1&&(l(0,"div"),p(1,am,2,0,"ng-container")(2,lm,2,0,"ng-container"),o()),e&2){let n=r.search,t=r.filters;_(),C(n||t?1:2);}}var xl=(()=>{let r=class r{server=E(q);jobsService=E(Yn);peertubeBadgeService=E(Qi);table=me("table");jobStates=["active","completed","failed","waiting","delayed"];jobTypes=["activitypub-cleaner","activitypub-follow","activitypub-http-broadcast-parallel","activitypub-http-broadcast","activitypub-http-fetcher","activitypub-http-unicast","activitypub-refresher","actor-keys","after-video-channel-import","create-user-export","email","federate-video","generate-video-storyboard","manage-video-torrent","move-to-file-system","move-to-object-storage","notify","transcoding-job-builder","video-channel-import","video-file-import","video-import","video-live-ending","video-redundancy","video-studio-edition","video-transcoding","video-transcription","videos-stats"];inputFilters=[{type:"select",key:"type",title:"Job type",clearable:!0,filter:!0,items:this.jobTypes.map(t=>({id:t,label:t.toLocaleUpperCase(),classes:["pt-badge",this.getRandomJobTypeBadge(t)]}))},{type:"select",key:"state",title:"Job state",clearable:!0,items:this.jobStates.map(t=>({id:t,label:t.toLocaleUpperCase(),classes:this.getJobStateClasses(t)}))}];columns=[{id:"id",class:"job-id",label:"ID",sortable:!1},{id:"type",class:"job-type",label:"Type",sortable:!1},{id:"priority",class:"job-priority",label:"Priority",labelSmall:"(1 = highest priority)",sortable:!1},{id:"state",class:"job-state",label:"State",sortable:!1},{id:"progress",class:"job-progress",label:"Progress",isDisplayed:()=>this.displayGlobalProgress,sortable:!1},{id:"createdAt",class:"job-date",label:"Created",sortable:!0},{id:"processed",label:"Processed/Finished",sortable:!1}];dataLoader;displayGlobalProgress=!0;constructor(){this.dataLoader=this._dataLoader.bind(this);}getJobStateClasses(t){switch(t){case void 0:case null:return[];case"active":return["pt-badge","badge-blue"];case"completed":return["pt-badge","badge-green"];case"delayed":case"prioritized":case"paused":return["pt-badge","badge-brown"];case"failed":return["pt-badge","badge-red"];case"waiting":case"waiting-children":return["pt-badge","badge-yellow"];}return t;}hasProgress(t){return t.type==="video-transcoding";}getProgress(t){return t.state==="active"?t.progress+"%":"";}getRandomJobTypeBadge(t){return this.peertubeBadgeService.getRandomBadge("type",t);}getStateFilterTitle(t){return"Filter by state: "+t.toLocaleUpperCase()+"";}getTypeFilterTitle(t){return"Filter by type: "+t.toLocaleUpperCase()+"";}isRunnerEnabled(){return this.server.isRemoteRunnersEnabled();}_dataLoader(t){let{pagination:a,sort:i,type:u,state:N}=t;return this.displayGlobalProgress=!u||u==="video-transcoding",this.jobsService.listJobs({jobState:N,jobType:u,pagination:a,sort:i});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-jobs"]],viewQuery:function(a,i){a&1&&Oe(i.table,Bc,5),a&2&&Te();},decls:11,vars:4,consts:()=>{let t;t="jobs per page";let a;a="Some jobs are also processed by "+"\uFFFD#2\uFFFD"+"remote runners"+"\uFFFD/#2\uFFFD"+".";let i;i="{VAR_PLURAL, plural, =0 {No job} =1 {1 job}
21 other {{INTERPOLATION} jobs}}",i=W(i,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let u;u="No job found for the current filters.";let N;return N="No job found.",[["table",""],["totalTitle",""],["tableCells",""],["expandedRow",""],["noResults",""],a,i,u,N,[1,"callout","callout-primary","mb-4"],["key","JobsComponent","dataKey","uniqId","paginatorText",t,"columnConfig","true","refreshButton","true",3,"defaultColumns","dataLoader","inputFilters"],["routerLink","/admin/settings/system/runners/jobs-list"],[1,"job-id",3,"title"],[1,"job-type"],[1,"job-priority"],[1,"job-state"],[1,"job-progress"],[1,"job-date"],[1,"fs-7"],["routerLink",".",1,"pt-badge","ellipsis",3,"queryParams","title","ngClass"],["routerLink",".",1,"ellipsis",3,"queryParams","ngClass","title"]];},template:function(a,i){a&1&&(p(0,Qc,3,0,"div",9),l(1,"my-table",10,0),k(3,qc,3,4,"ng-template",null,1,F)(5,om,7,7,"ng-template",null,2,F)(7,rm,9,8,"ng-template",null,3,F)(9,_m,3,1,"ng-template",null,4,F),o()),a&2&&(C(i.isRunnerEnabled()?0:-1),_(),c("defaultColumns",i.columns)("dataLoader",i.dataLoader)("inputFilters",i.inputFilters));},dependencies:[$e,ge,le,je,Pe,He],styles:[`@media screen and (min-width:1000px){.job-id[_ngcontent-%COMP%]{max-width:30vw!important}.job-type[_ngcontent-%COMP%], .job-state[_ngcontent-%COMP%], .job-priority[_ngcontent-%COMP%]{width:150px!important}.job-date[_ngcontent-%COMP%]{width:200px!important}}pre[_ngcontent-%COMP%]{font-size:11px}.job-error[_ngcontent-%COMP%]{color:var(--red)}
22/*# sourceMappingURL=jobs.component-RERADFXZ.css.map */`]}));let e=r;return e;})();var to=class{date;localeDate;level;message;meta;by;domain;action;constructor(r){this.date=new Date(r.timestamp),this.localeDate=this.date.toLocaleString(),this.level=r.level,this.message=r.message;let n=ea(r,"timestamp","level","message","label");if(Object.keys(n).length!==0&&(this.meta=JSON.stringify(n,void 0,2)),r.level==="audit")try{let t=JSON.parse(r.message);this.by=t.user,this.domain=t.domain,this.action=t.action,this.meta=JSON.stringify(t,null,2),this.message="";}catch(t){Ii.error("Cannot parse audit message.",t);}}};var wt=class wt{authHttp=E(Rt);restService=E(Ht);restExtractor=E(vt);getLogs(r){let{isAuditLog:n,startDate:t,endDate:a,tagsOneOf:i}=r,u=new Pt();u=u.append("startDate",t),n||(u=u.append("level",r.level)),a&&(u=u.append("endDate",r.endDate)),i&&(u=this.restService.addArrayParams(u,"tagsOneOf",i));let N=n?wt.BASE_AUDIT_LOG_URL:wt.BASE_LOG_URL;return this.authHttp.get(N,{params:u}).pipe(lt(I=>I.map(T=>new to(T))),ke(I=>this.restExtractor.handleError(I)));}};f(wt,"BASE_LOG_URL",Ot.apiUrl+"/api/v1/server/logs"),f(wt,"BASE_AUDIT_LOG_URL",Ot.apiUrl+"/api/v1/server/audit-logs"),f(wt,"\u0275fac",function(n){return new(n||wt)();}),f(wt,"\u0275prov",Tt({token:wt,factory:wt.ɵfac}));var Zn=wt;var sm=["logsElement"],dm=["logsContent"],cm=(e,r)=>({error:e,warn:r});function mm(e,r){if(e&1&&(l(0,"option",15),g(1),o()),e&2){let n=r.$implicit;c("value",n.id),_(),A(n.label);}}function um(e,r){if(e&1&&(g(0),K(1,"ptDate"),l(2,"span"),s(3,6),o(),g(4,") ")),e&2){let n=r.$implicit;en(" ",n.label," (",se(1,2,n.id,n.dateFormat)," - ");}}function pm(e,r){if(e&1&&(l(0,"span",24),g(1,"\u2B24"),o(),g(2)),e&2){let n=r.$implicit;c("ngClass",n.id),_(2),D(" ",n.label," ");}}function Cm(e,r){if(e&1){let n=Q();l(0,"div")(1,"label",25),s(2,7),o(),l(3,"my-select-tags",26),Mt("ngModelChange",function(a){L(n);let i=d(2);return St(i.tagsOneOf,a)||(i.tagsOneOf=a),y(a);}),P("ngModelChange",function(){L(n);let a=d(2);return y(a.refresh());}),o()();}if(e&2){let n=d(2);_(3),Nt("ngModel",n.tagsOneOf);}}function Em(e,r){if(e&1){let n=Q();l(0,"div")(1,"label",20),s(2,4),o(),l(3,"my-select-options",21),Mt("ngModelChange",function(a){L(n);let i=d();return St(i.startDate,a)||(i.startDate=a),y(a);}),P("ngModelChange",function(){L(n);let a=d();return y(a.refresh());}),k(4,um,5,5,"ng-template",null,2,F),o()(),l(6,"div")(7,"label",22),s(8,5),o(),l(9,"my-select-options",23),Mt("ngModelChange",function(a){L(n);let i=d();return St(i.level,a)||(i.level=a),y(a);}),P("ngModelChange",function(){L(n);let a=d();return y(a.refresh());}),k(10,pm,3,2,"ng-template",null,2,F),o()(),p(12,Cm,4,1,"div");}if(e&2){let n=d();_(3),c("items",n.timeChoices),Nt("ngModel",n.startDate),_(6),c("items",n.levelChoices),Nt("ngModel",n.level),_(3),C(n.isAuditLog()?-1:12);}}function gm(e,r){e&1&&(l(0,"div"),s(1,8),o());}function Nm(e,r){if(e&1&&m(0,"my-copy-button",18),e&2){d();let n=pe(17);c("elementContent",n);}}function Sm(e,r){e&1&&(l(0,"div"),s(1,9),o());}function Mm(e,r){if(e&1&&(l(0,"strong",29),s(1,10),o()),e&2){let n=d().$implicit;_(),$(n.by),x(1);}}function fm(e,r){if(e&1&&(l(0,"strong",30),g(1),o()),e&2){let n=d().$implicit;_(),en("",n.domain," -> ",n.action);}}function Am(e,r){if(e&1&&(l(0,"div",19)(1,"span",27),g(2),o(),l(3,"span",28),g(4),o(),p(
225,Mm,2,1,"strong",29),p(6,fm,2,2,"strong",30),g(7),l(8,"pre"),g(9),o()()),e&2){let n=r.$implicit;c("ngClass",$r(7,cm,n.level==="error",n.level==="warn")),_(2),A(n.level),_(2),D("[",n.localeDate,"]"),_(),C(n.by?5:-1),_(),C(n.domain?6:-1),_(),D(" ",n.message," "),_(2),A(n.meta);}}var wl=(()=>{let r=class r{logsService=E(Zn);notifier=E(Z);localStorage=E(_a);logsElement=me("logsElement");logsContent=me("logsContent");loading=!1;rawLogs;logs=[];timeChoices=[];levelChoices=[];logTypeChoices=[];startDate;level;logType;tagsOneOf=[];ngOnInit(){this.buildTimeChoices(),this.buildLevelChoices(),this.buildLogTypeChoices(),this.loadPreviousChoices(),this.load();}refresh(){this.logs=[],this.localStorage.setItem(r.LS_LOG_TYPE_CHOICE_KEY,this.logType),this.load();}load(){this.loading=!0;let t=this.tagsOneOf.length!==0?this.tagsOneOf:void 0;this.logsService.getLogs({isAuditLog:this.isAuditLog(),level:this.level,startDate:this.startDate,tagsOneOf:t}).subscribe({next:a=>{this.logs=a,this.rawLogs=this.logs.map(i=>`${i.level} ${i.localeDate} ${i.message} ${i.meta}`).join(`
23`),setTimeout(()=>{this.logsElement().nativeElement.scrollIntoView({block:"end",inline:"nearest"});});},error:a=>this.notifier.handleError(a),complete:()=>this.loading=!1});}isAuditLog(){return this.logType==="audit";}buildTimeChoices(){let t=new Date();t.setHours(t.getHours()-1);let a=new Date();a.setDate(a.getDate()-1);let i=new Date();i.setDate(i.getDate()-7),this.timeChoices=[{id:i.toISOString(),label:"Last week",dateFormat:"shortDate"},{id:a.toISOString(),label:"Last day",dateFormat:"short"},{id:t.toISOString(),label:"Last hour",dateFormat:"mediumTime"}],this.startDate=t.toISOString();}buildLevelChoices(){this.levelChoices=[{id:"debug",label:"debug"},{id:"info",label:"info"},{id:"warn",label:"warning"},{id:"error",label:"error"}],this.level="warn";}buildLogTypeChoices(){this.logTypeChoices=[{id:"standard",label:"Standard logs"},{id:"audit",label:"Audit logs"}];}loadPreviousChoices(){this.logType=this.localStorage.getItem(r.LS_LOG_TYPE_CHOICE_KEY),this.logType!=="standard"&&this.logType!=="audit"&&(this.logType="audit");}};f(r,"LS_LOG_TYPE_CHOICE_KEY","admin-logs-log-type-choice"),f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["ng-component"]],viewQuery:function(a,i){a&1&&Oe(i.logsElement,sm,5)(i.logsContent,dm,5),a&2&&Te(2);},decls:20,vars:5,consts:()=>{let t;t="Refresh";let a;a="Logs copied";let i;i="Copy logs";let u;u="Log type";let N;N="Start date";let I;I="Log level";let T;T="now";let h;h="Example: ffmpeg, api";let b;b="Filter logs by tags";let G;G="Loading...";let U;U="No log.";let J;return J="By "+"\uFFFD0\uFFFD"+" ->",[["logsElement",""],["logsContent",""],["selectOption",""],u,N,I,T,b,G,U,J,[1,"header"],["for","log-type"],[1,"peertube-select-container"],["id","log-type",1,"form-control",3,"ngModelChange","ngModel"],[3,"value"],["label",t,"icon","refresh",1,"mt-auto",3,"click"],[1,"logs"],["notification",a,"title",i,"withBorder","true",3,"elementContent"],[1,"log-row",3,"ngClass"],["for","log-start-date"],["inputId","log-start-date",3,"ngModelChange","items","ngModel"],["for","log-level"],["inputId","log-level",3,"ngModelChange","items","ngModel"],[1,"level-choice","me-1",3,"ngClass"],["for","log-tags"],["inputId","log-tags","placeholder",h,3,"ngModelChange","ngModel"],[1,"log-level"],[1,"log-date"],[1,"log-by"],[1,"log-domain-action"]];},template:function(a,i){if(a&1){let u=Q();l(0,"div",11)(1,"div")(2,"label",12),s(3,3),o(),l(4,"div",13)(5,"select",14),Mt("ngModelChange",function(I){return L(u),St(i.logType,I)||(i.logType=I),y(I);}),P("ngModelChange",function(){return i.refresh();}),Ce(6,mm,2,2,"option",15,Ie),o()()(),p(8,Em,13,5),l(9,"my-button",16),P("click",function(){return i.refresh();}),o()(),l(10,"div",17),p(11,gm,2,0,"div"),l(12,"div",null,0),p(14,Nm,1,1,"my-copy-button",18),p(15,Sm,2,0,"div"),l(16,"div",null,1),Ce(18,Am,10,10,"div",19,Ie),o()()();}a&2&&(_(5),Nt("ngModel",i.logType),_(),Ee(i.logTypeChoices),_(2),C(i.isAuditLog()?-1:8),_(3),C(i.loading?11:-1),_(3),C(i.logs.length!==0?14:-1),_(),C(!i.loading&&i.logs.length===0?15:-1),_(3),Ee(i.logs));},dependencies:[le,Bt,Wt,Xt,de,zt,ge,ja,Ft,bi,It,Je],styles:[`.logs[_ngcontent-%COMP%]{font-family:monospace;font-size:13px;max-height:500px;overflow-y:auto;color:#000;background:#fafafa;padding:20px}.logs[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{position:relative}.logs[_ngcontent-%COMP%]   .log-row[_ngcontent-%COMP%]{margin-top:1px;word-break:break-word}.logs[_ngcontent-%COMP%]   .log-row[_ngcontent-%COMP%]:hover{background:#00000012}.logs[_ngcontent-%COMP%]   .log-level[_ngcontent-%COMP%]{font-weight:600;margin-inline-end:.3125rem}.logs[_ngcontent-%COMP%]   .log-by[_ngcontent-%COMP%]{margin:0 5px}.logs[_ngcontent-%COMP%]   .warn[_ngcontent-%COMP%]{color:#c74801}.logs[_ngcontent-%COMP%]   .error[_ngcontent-%COMP%]{color:#dc262b}.logs[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%]{margin-bottom:5px;white-space:pre-wrap;word-wrap:break-word}.header[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;flex-wrap:wrap;margin-bottom:10px}.header[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{width:150px}@media screen and (max-width:180px){.header[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.header[_ngcontent-%COMP%]   my-select-tags[_ngcontent-%COMP%]{display:block;width:325px}.header[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-bottom:10px;margin-inline-start:.625rem}.level-choice[_ngcontent-%COMP%]{font-size:14px;position:relative;top:-1px}.level-choice.debug[_ngcontent-%COMP%]{color:#c5c5c5}.level-choice.info[_ngcontent-%COMP%]{color:#88ccf7}.level-choice.warn[_ngcontent-%COMP%]{color:#fca607}.level-choice.error[_ngcontent-%COMP%]{color:var(--red)}my-copy-button[_ngcontent-%COMP%]{position:absolute;right:5px;background:var(--bg-secondary-300)}@media screen and (max-width:800px){.header[_ngcontent-%COMP%]{flex-direction:column}.header[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%!important;margin-inline-start:0!important}.header[_ngcontent-%COMP%]   my-button[_ngcontent-%COMP%]{text-align:center}}
24/*# sourceMappingURL=logs.component-T42ROY5Y.css.map */`]}));let e=r;return e;})();var ct=class ct{authHttp=E(Rt);server=E(q);restService=E(Ht);restExtractor=E(vt);listRegistrationTokens(r){let{pagination:n,sort:t}=r,a=new Pt();return a=this.restService.addRestGetParams(a,n,t),this.authHttp.get(ct.BASE_RUNNER_URL+"/registration-tokens",{params:a}).pipe(ke(i=>this.restExtractor.handleError(i)));}generateToken(){return this.authHttp.post(ct.BASE_RUNNER_URL+"/registration-tokens/generate",{}).pipe(ke(r=>this.restExtractor.handleError(r)));}removeToken(r){return this.authHttp.delete(ct.BASE_RUNNER_URL+"/registration-tokens/"+r.id).pipe(ke(n=>this.restExtractor.handleError(n)));}listRunnerJobs(r){let{pagination:n,sort:t,search:a,stateOneOf:i,typeOneOf:u}=r,N=new Pt();return N=this.restService.addRestGetParams(N,n,t),a&&(N=N.append("search",a)),N=this.restService.addObjectParam
24s(N,{stateOneOf:i,typeOneOf:u}),Pr([this.authHttp.get(ct.BASE_RUNNER_URL+"/jobs",{params:N}),this.server.getServerLocale()]).pipe(lt(([I,T])=>{let h=I.data.map(b=>Be(fe({},b),{state:{id:b.state.id,label:li(b.state.label,T)},payload:JSON.stringify(b.payload,null,2),privatePayload:JSON.stringify(b.privatePayload,null,2)}));return{total:I.total,data:h};}),lt(I=>this.restExtractor.convertResultListDateToHuman(I,["createdAt","startedAt","finishedAt"],"precise")),ke(I=>this.restExtractor.handleError(I)));}cancelJobs(r){let n=bn(r);return mn(n).pipe(pn(t=>this.authHttp.post(ct.BASE_RUNNER_URL+"/jobs/"+t.uuid+"/cancel",{})),un(),ke(t=>this.restExtractor.handleError(t)));}removeJobs(r){let n=bn(r);return mn(n).pipe(pn(t=>this.authHttp.delete(ct.BASE_RUNNER_URL+"/jobs/"+t.uuid)),un(),ke(t=>this.restExtractor.handleError(t)));}listRunners(r){let{pagination:n,sort:t}=r,a=new Pt();return a=this.restService.addRestGetParams(a,n,t),this.authHttp.get(ct.BASE_RUNNER_URL+"/",{params:a}).pipe(ke(i=>this.restExtractor.handleError(i)));}deleteRunner(r){return this.authHttp.delete(ct.BASE_RUNNER_URL+"/"+r.id).pipe(ke(n=>this.restExtractor.handleError(n)));}};f(ct,"BASE_RUNNER_URL",Ot.apiUrl+"/api/v1/runners"),f(ct,"\u0275fac",function(n){return new(n||ct)();}),f(ct,"\u0275prov",Tt({token:ct,factory:ct.ɵfac}));var Yt=ct;var Im=["table"],Om=e=>({type:e}),Tm=e=>({state:e});function Pm(e,r){if(e&1&&(S(0),s(1,6),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function Rm(e,r){if(e&1&&(l(0,"td"),g(1),o()),e&2){let n=d().$implicit;_(),A(n.uuid);}}function hm(e,r){if(e&1&&(l(0,"td")(1,"a",12),g(2),o()()),e&2){let n=d().$implicit,t=d();_(),c("queryParams",w(4,Om,n.type))("title",t.getTypeFilterTitle(n.type))("ngClass",t.getRandomRunnerTypeBadge(n.type)),_(),A(n.type);}}function vm(e,r){if(e&1&&(l(0,"td")(1,"a",12),g(2),o()()),e&2){let n=d().$implicit,t=d();_(),c("queryParams",w(4,Tm,n.state.id))("title",t.getStateFilterTitle(n.state.label))("ngClass",t.getStateBadgeColor(n)),_(),A(n.state.label);}}function Fm(e,r){if(e&1&&(l(0,"td"),g(1),o()),e&2){let n=d().$implicit;_(),A(n.priority);}}function Dm(e,r){if(e&1&&g(0),e&2){let n=d(2).$implicit;D(" ",n.progress,"% ");}}function bm(e,r){if(e&1&&(l(0,"td"),p(1,Dm,1,1),o()),e&2){let n=d().$implicit;_(),C(n.progress?1:-1);}}function Gm(e,r){if(e&1&&(l(0,"div",13),g(1),o()),e&2){let n=d(2).$implicit,t=d();c("ngClass",t.getRandomRunnerNameBadge(n.runner.name)),_(),D(" ",n.runner.name," ");}}function Lm(e,r){if(e&1&&(l(0,"td"),p(1,Gm,2,2,"div",13),o()),e&2){let n=d().$implicit;_(),C(n.runner!=null&&n.runner.name?1:-1);}}function ym(e,r){if(e&1&&(l(0,"td"),g(1),o()),e&2){let n=d().$implicit;_(),A(n.createdAt);}}function $m(e,r){if(e&1&&(l(0,"td",11)(1,"div"),g(2),o(),l(3,"div"),g(4),o()()),e&2){let n=d().$implicit;_(2),A(n.startedAt),_(2),A(n.finishedAt);}}function xm(e,r){if(e&1&&(p(0,Rm,2,1,"td"),p(1,hm,3,6,"td"),p(2,vm,3,6,"td"),p(3,Fm,2,1,"td"),p(4,bm,2,1,"td"),p(5,Lm,2,1,"td"),p(6,ym,2,1,"td"),p(7,$m,5,2,"td",11)),e&2){d();let n=pe(1);C(n.isColumnDisplayed("uuid")?0:-1),_(),C(n.isColumnDisplayed("type")?1:-1),_(),C(n.isColumnDisplayed("state")?2:-1),_(),C(n.isColumnDisplayed("priority")?3:-1),_(),C(n.isColumnDisplayed("progress")?4:-1),_(),C(n.isColumnDisplayed("runner")?5:-1),_(),C(n.isColumnDisplayed("createdAt")?6:-1),_(),C(n.isColumnDisplayed("processed")?7:-1);}}function wm(e,r){if(e&1&&m(0,"my-action-dropdown",14),e&2){let n=r.$implicit,t=d();c("actions",t.actions)("entry",n);}}function Um(e,r){if(e&1&&(l(0,"pre",17),g(1),o()),e&2){let n=d().$implicit;_(),A(n.error);}}function Vm(e,r){if(e&1&&(l(0,"div",15),g(1),m(2,"br"),g(3),m(4,"br"),g(5),m(6,"br"),o(),l(7,"div",16)(8,"strong"),s(9,7),o(),l(10,"pre"),g(11),o()(),l(12,"div",16)(13,"strong"),s(14,8),o(),l(15,"pre"),g(16),o()(),p(17,Um,2,1,"pre",17)),e&2){let n=r.$implicit;_(),D(" Parent job: ",(n.parent==null?null:n.parent.uuid)||"-"," "),_(2),D(" Processed on ",n.startedAt||"-"," "),_(2),D(" Finished on ",n.finishedAt||"-"," "),_(6),A(n.payload),_(5),A(n.privatePayload),_(),C(n.error?17:-1);}}function km(e,r){e&1&&(S(0),s(1,9),M());}var Ul=(()=>{let r=class r{runnerService=E(Yt);notifier=E(Z);confirmService=E(we);peertubeBadgeService=E(Qi);table=me("table");actions=[];bulkActions=[];jobStates=["completed","pending","processing","errored"];jobTypes=["vod-web-video-transcoding","vod-hls-transcoding","vod-audio-merge-transcoding","live-rtmp-hls-transcoding","video-studio-transcoding","video-transcription","generate-video-storyboard"];inputFilters=[{type:"select",key:"type",title:"Job type",clearable:!0,items:this.jobTypes.map(t=>({id:t,label:t.toLocaleUpperCase(),classes:["pt-badge",this.getRandomRunnerTypeBadge(t)]}))},{type:"select",key:"state",title:"Job state",clearable:!0,items:this.jobStates.map(t=>({id:t,label:t.toLocaleUpperCase(),classes:["pt-badge",this.getRandomRunnerNameBadge(t)]}))}];columns=[{id:"uuid",label:"UUID",sortable:!1},{id:"type",label:"Type",sortable:!1},{id:"state",label:"State",sortable:!0},{id:"priority",label:"Priority",sortable:!0},{id:"progress",label:"Progress",sortable:!0},{id:"runner",label:"Runner",sortable:!1},{id:"createdAt",label:"Created",sortable:!0},{id:"processed",label:"Processed/Finished",sortable:!1}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){let{simpleActions:t,bulkActions:a}=jn([[{label:()=>"Cancel",handler:i=>this.cancelJobs(i),isDisplayed:i=>
24this.canCancelJob(i),enableBulk:!0}],[{label:()=>"Delete",handler:i=>this.removeJobs(i),enableBulk:!0}]]);this.actions=t,this.bulkActions=a;}cancelJobs(t){return _e(this,null,function*(){let a=ee("Do you really want to cancel {count, plural, =1 {this job} other {{count} jobs}}? Children jobs will also be cancelled.",{count:t.length});(yield this.confirmService.confirm(a,"Cancel"))!==!1&&this.runnerService.cancelJobs(t).subscribe({next:()=>{this.table().loadData(),this.notifier.success(ee("{count, plural, =1 {Job cancelled} other {{count} jobs cancelled}}",{count:t.length}));},error:u=>this.notifier.handleError(u)});});}removeJobs(t){return _e(this,null,function*(){let a=ee("Do you really want to remove {count, plural, =1 {this job} other {{count} jobs}}? Children jobs will also be removed.",{count:t.length});(yield this.confirmService.confirm(a,"Remove"))!==!1&&this.runnerService.removeJobs(t).subscribe({next:()=>{this.table().loadData(),this.notifier.success(ee("{count, plural, =1 {Job removed} other {{count} jobs removed}}",{count:t.length}));},error:u=>this.notifier.handleError(u)});});}getStateBadgeColor(t){switch(t.state.id){case ut.ERRORED:case ut.PARENT_ERRORED:return"badge-danger";case ut.COMPLETED:return"badge-success";case ut.PENDING:case ut.WAITING_FOR_PARENT_JOB:return"badge-warning";default:return"badge-info";}}getRandomRunnerNameBadge(t){return this.peertubeBadgeService.getRandomBadge("runner",t);}getRandomRunnerTypeBadge(t){return this.peertubeBadgeService.getRandomBadge("type",t);}getTypeFilterTitle(t){return"Filter jobs by type: "+t.toLocaleUpperCase()+"";}getStateFilterTitle(t){return"Filter jobs by state: "+t.toLocaleUpperCase()+"";}_dataLoader(t){let{pagination:a,sort:i,search:u,state:N,type:I}=t,T,h;return N&&(T=[],N==="completed"?T.push(ut.COMPLETED):N==="pending"?(T.pu
24sh(ut.PENDING),T.push(ut.WAITING_FOR_PARENT_JOB)):N==="processing"?T.push(ut.PROCESSING):N==="errored"&&(T.push(ut.ERRORED),T.push(ut.PARENT_ERRORED))),I&&(h=[I]),this.runnerService.listRunnerJobs({pagination:a,sort:i,search:u,stateOneOf:T,typeOneOf:h});}canCancelJob(t){return t.state.id===ut.PENDING||t.state.id===ut.PROCESSING||t.state.id===ut.WAITING_FOR_PARENT_JOB;}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-runner-job-list"]],viewQuery:function(a,i){a&1&&Oe(i.table,Im,5),a&2&&Te();},decls:12,vars:4,consts:()=>{let t;t="jobs per page";let a;a="{VAR_PLURAL, plural, =0 {No job} =1 {1 job} other {{INTERPOLATION} jobs}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Actions";let u;u="Payload:";let N;N="Private payload:";let I;return I="No runner jobs found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],a,u,N,I,["key","RunnerJobListComponent","dataKey","uuid","paginatorText",t,"columnConfig","true","searchInput","true","refreshButton","true",3,"defaultColumns","dataLoader","bulkActions","inputFilters"],[1,"fs-7"],["routerLink",".",1,"pt-badge","ellipsis",3,"queryParams","title","ngClass"],[1,"pt-badge",3,"ngClass"],["placement","bottom-right top-right left auto","container","body","label",i,3,"actions","entry"],[1,"mt-2","fs-7","font-monospace"],[1,"mt-2"],[1,"text-danger"]];},template:function(a,i){a&1&&(l(0,"my-table",10,0),k(2,Pm,3,4,"ng-template",null,1,F)(4,xm,8,8,"ng-template",null,2,F)(6,wm,1,2,"ng-template",null,3,F)(8,Vm,18,6,"ng-template",null,4,F)(10,km,2,0,"ng-template",null,5,F),o()),a&2&&c("defaultColumns",i.columns)("dataLoader",i.dataLoader)("bulkActions",i.bulkActions)("inputFilters",i.inputFilters);},dependencies:[$e,ge,Pe,qt,je,He],encapsulation:2}));let e=r;return e;})();var zm=["table"];function Xm(e,r){if(e&1&&(S(0),s(1,5),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function Bm(e,r){if(e&1&&(l(0,"td"),g(1),o(),l(2,"td",8),g(3),o(),l(4,"td"),g(5),o(),l(6,"td"),g(7),o(),l(8,"td"),g(9),K(10,"ptDate"),o(),l(11,"td"),g(12),K(13,"ptDate"),o()),e&2){let n=r.$implicit;_(),A(n.name),_(2),A(n.description),_(2),A(n.ip),_(2),A(n.version),_(2),A(se(10,6,n.lastContact,"short")),_(3),A(se(13,9,n.createdAt,"short"));}}function Wm(e,r){if(e&1&&m(0,"my-action-dropdown",9),e&2){let n=r.$implicit,t=d();c("actions",t.actions)("entry",n);}}function Hm(e,r){e&1&&(S(0),s(1,6),M());}var Vl=(()=>{let r=class r{runnerService=E(Yt);notifier=E(Z);confirmService=E(we);table=me("table");actions=[];columns=[{id:"name",label:"Name",sortable:!1},{id:"description",label:"Description",sortable:!1},{id:"ip",label:"IP",sortable:!1},{id:"version",label:"Version",sortable:!1},{id:"lastContact",label:"Last contact",sortable:!1},{id:"createdAt",label:"Created",sortable:!0}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.actions=[[{label:"Remove",handler:t=>this.deleteRunner(t)}]];}deleteRunner(t){return _e(this,null,function*(){(yield this.confirmService.confirm("Do you really want to delete this runner? It won't be able to process jobs anymore.","Remove "+t.name+""))!==!1&&this.runnerService.deleteRunner(t).subscribe({next:()=>{this.table().loadData(),this.notifier.success("Runner removed.");},error:i=>this.notifier.handleError(i)});});}_dataLoader(t){return this.runnerService.listRunners(t);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-runner-list"]],viewQuery:function(a,i){a&1&&Oe(i.table,zm,5),a&2&&Te();},decls:10,vars:2,consts:()=>{let t;t="runners per page";let a;a="{VAR_PLURAL, plural, =0 {No runner} =1 {1 runner} other {{INTERPOLATION} runners}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Actions";let u;return u="No remote runners found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],a,u,["key","RunnerListComponent","paginatorText",t,"columnConfig","false",3,"defaultColumns","dataLoader"],[1,"max-width-300px","ellipsis"],["placement","bottom-right top-right left auto","container","body","label",i,3,"actions","entry"]];},template:function(a,i){a&1&&(l(0,"my-table",7,0),k(2,Xm,3,4,"ng-template",null,1,F)(4,Bm,14,12,"ng-template",null,2,F)(6,Wm,1,2,"ng-template",null,3,F)(8,Hm,2,0,"ng-template",null,4,F),o()),a&2&&c("defaultColumns",i.columns)("dataLoader",i.dataLoader);},dependencies:[qt,je,Je,He],encapsulation:2}));let e=r;return e;})();var jm=["table"];function Qm(e,r){if(e&1&&(S(0),s(1,6),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function qm(e,r){if(e&1){let n=Q();
24l(0,"my-button",9),P("click",function(){L(n);let a=d();return y(a.generateToken());}),o();}}function Km(e,r){if(e&1&&(l(0,"td"),g(1),m(2,"my-copy-button",10),o(),l(3,"td"),g(4),K(5,"ptDate"),o(),l(6,"td"),g(7),o()),e&2){let n=r.$implicit;_(),D(" ",n.registrationToken," "),_(),c("value",n.registrationToken),_(2),A(se(5,4,n.createdAt,"short")),_(3),A(n.registeredRunnersCount);}}function Jm(e,r){if(e&1&&m(0,"my-action-dropdown",11),e&2){let n=r.$implicit,t=d();c("actions",t.actions)("entry",n);}}function Ym(e,r){e&1&&(S(0),s(1,7),M());}var kl=(()=>{let r=class r{runnerService=E(Yt);notifier=E(Z);confirmService=E(we);table=me("table");actions=[];columns=[{id:"token",label:"Token",sortable:!1},{id:"createdAt",label:"Created",sortable:!0},{id:"runners",label:"Associated runners",sortable:!1}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.actions=[[{label:"Remove this token",handler:t=>this.removeToken(t)}]];}generateToken(){this.runnerService.generateToken().subscribe({next:()=>{this.table().loadData(),this.notifier.success("Registration token generated.");},error:t=>this.notifier.handleError(t)});}removeToken(t){return _e(this,null,function*(){(yield this.confirmService.confirm("Do you really want to remove this registration token? All associated runners will also be removed.","Remove registration token"))!==!1&&this.runnerService.removeToken(t).subscribe({next:()=>{this.table().loadData(),this.notifier.success("Registration token removed.");},error:i=>this.notifier.handleError(i)});});}_dataLoader(t){return this.runnerService.listRegistrationTokens(t);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-runner-registration-token-list"]],viewQuery:function(a,i){a&1&&Oe(i.table,jm,5),a&2&&Te();},decls:12,vars:2,consts:()=>{let t;t="tokens per page";let a;a="{VAR_PLURAL, plural, =0 {No token} =1 {1 token} other {{INTERPOLATION} tokens}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Generate token";let u;u="Registration token copied";let N;N="Copy registration token";let I;I="Actions";let T;return T="No registration token found for remote runners.",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["noResults",""],a,T,["key","RunnerRegistrationTokenListComponent","paginatorText",t,"columnConfig","false",3,"defaultColumns","dataLoader"],["theme","primary","label",i,"icon","add",3,"click"],["notification",u,"title",N,3,"value"],["placement","bottom-right top-right left auto","container","body","label",I,3,"actions","entry"]];},template:function(a,i){a&1&&(l(0,"my-table",8,0),k(2,Qm,3,4,"ng-template",null,1,F)(4,qm,1,0,"ng-template",null,2,F)(6,Km,8,7,"ng-template",null,3,F)(8,Jm,1,2,"ng-template",null,4,F)(10,Ym,2,0,"ng-template",null,5,F),o()),a&2&&c("defaultColumns",i.columns)("dataLoader",i.dataLoader);},dependencies:[Ft,qt,bi,je,Je,He],styles:[`my-copy-button[_ngcontent-%COMP%]{margin-inline-start:.1875rem}my-table[_ngcontent-%COMP%]     tr:not(:hover) my-copy-button{opacity:0}
25/*# sourceMappingURL=runner-registration-token-list.component-2F7CKZUH.css.map */`]}));let e=r;return e;})();var zl=[{path:"runners",canActivate:[Xe],data:{userRight:Y.MANAGE_RUNNERS},children:[{path:"",redirectTo:"jobs-list",pathMatch:"full"},{path:"jobs-list",component:Ul,data:{meta:{title:"List runner jobs"}}},{path:"runners-list",component:Vl,data:{meta:{title:"List remote runners"}}},{path:"registration-tokens-list",component:kl,data:{meta:{title:"List registration runner tokens"}}}]}];var Xl=[{path:"system",children:[{path:"",redirectTo:"jobs",pathMatch:"full"},{path:"jobs",canActivate:[Xe],component:xl,data:{meta:{userRight:Y.MANAGE_JOBS,title:"Jobs"}}},{path:"logs",canActivate:[Xe],component:wl,data:{meta:{userRight:Y.MANAGE_LOGS,title:"Logs"}}},{path:"debug",canActivate:[Xe],component:$l,data:{meta:{userRight:Y.MANAGE_DEBUG,title:"Debug"}}},...zl]}];var Bl=(()=>{let r=class r{auth=E(At);server=E(q);menuEntries=[];ngOnInit(){this.server.configReloaded.subscribe(()=>this.buildMenu()),this.buildMenu();}
25buildMenu(){if(this.menuEntries=[],this.hasRight(Y.MANAGE_ABUSES)&&this.menuEntries.push({label:"Reports",routerLink:"/admin/moderation/abuses/list"}),this.hasRight(Y.MANAGE_REGISTRATIONS)&&this.menuEntries.push({label:"Registrations",routerLink:"/admin/moderation/registrations/list"}),this.hasRight(Y.MANAGE_VIDEO_BLACKLIST)&&this.menuEntries.push({label:"Video blocks",routerLink:"/admin/moderation/video-blocks/list"}),this.hasRight(Y.MANAGE_ACCOUNTS_BLOCKLIST)||this.hasRight(Y.MANAGE_SERVERS_BLOCKLIST)){let t={label:"Mutes",routerLink:"",children:[]};this.hasRight(Y.MANAGE_ACCOUNTS_BLOCKLIST)&&t.children.push({label:"Muted accounts",routerLink:"/admin/moderation/blocklist/accounts"}),this.hasRight(Y.MANAGE_SERVERS_BLOCKLIST)&&t.children.push({label:"Muted servers",routerLink:"/admin/moderation/blocklist/servers"}),t.routerLink=t.children[0].routerLink,this.menuEntries.push(t);}this.hasRight(Y.MANAGE_INSTANCE_WATCHED_WORDS)&&this.menuEntries.push({label:"Watched words",routerLink:"/admin/moderation/watched-words/list"});}hasRight(t){return this.auth.getUser().hasRight(t);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-moderation"]],decls:8,vars:1,consts:()=>{let t;t="Moderation";let a;return a="Skip the sub menu",[["adminContent",""],a,[1,"root"],["href","#admin-moderation-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],[1,"margin-content"],["h1",t,"h1Icon","moderation",3,"menuEntries"],["tabindex","-1","id","admin-moderation-content",1,"margin-content","outline-0"]];},template:function(a,i){if(a&1){let u=Q();l(0,"div",2)(1,"a",3),P("click",function(I){L(u);let T=pe(6);return I.preventDefault(),y(T.focus());}),s(2,1),o(),l(3,"div",4),m(4,"my-horizontal-menu",5),o(),l(5,"div",6,0),m(7,"router-outlet"),o()();}a&2&&(_(4),c("menuEntries",i.menuEntries));},dependencies:[zn,Sn],encapsulation:2}));let e=r;return e;})();var Wl=(()=>{let r=class r{auth=E(At);menuEntries=[];ngOnInit(){this.buildMenu();}buildMenu(){this.menuEntries=[],this.hasRight(Y.MANAGE_USERS)&&this.menuEntries.push({label:"Users",routerLink:"/admin/overview/users"}),this.hasRight(Y.SEE_ALL_VIDEOS)&&this.menuEntries.push({label:"Videos",routerLink:"/admin/overview/videos"}),this.hasRight(Y.SEE_ALL_COMMENTS)&&this.menuEntries.push({label:"Comments",routerLink:"/admin/overview/comments"});}hasRight(t){return this.auth.getUser().hasRight(t);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-overview"]],decls:8,vars:1,consts:()=>{let t;t="Overview";let a;return a="Skip the sub menu",[["adminContent",""],a,[1,"root"],["href","#admin-overview-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],[1,"margin-content"],["h1",t,"h1Icon","overview",3,"menuEntries"],["tabindex","-1","id","admin-overview-content",1,"margin-content","outline-0"]];},template:function(a,i){if(a&1){let u=Q();l(0,"div",2)(1,"a",3),P("click",function(I){L(u);let T=pe(6);return I.preventDefault(),y(T.focus());}),s(2,1),o(),l(3,"div",4),m(4,"my-horizontal-menu",5),o(),l(5,"div",6,0),m(7,"router-outlet"),o()();}a&2&&(_(4),c("menuEntries",i.menuEntries));},dependencies:[zn,Sn],encapsulation:2}));let e=r;return e;})();var Hl=(()=>{let r=class r{auth=E(At);server=E(q);menuEntries=[];ngOnInit(){this.server.configReloaded.subscribe(()=>this.buildMenu()),this.buildMenu();}buildMenu(){this.menuEntries=[],this.buildConfigurationItems(),this.buildFederationItems(),this.buildPluginItems(),this.buildRunnerItems(),this.buildSystemItems();}buildFederationItems(){this.hasRight(Y.MANAGE_SERVER_FOLLOW)&&this.menuEntries.push({label:"Federation",routerLink:"/admin/settings/follows/following-list",children:[{label:"Following",routerLink:"/admin/settings/follows/following-list"},{label:"Followers",routerLink:"/admin/settings/follows/followers-list"},{label:"Video redundancies",routerLink:"/admin/settings/follows/video-redundancies-list"}]});}buildConfigurationItems(){this.hasRight(Y.MANAGE_CONFIGURATION)&&this.menuEntries.push({label:"Configuration",routerLink:"/admin/settings/config"});}buildPluginItems(){this.hasRight(Y.MANAGE_PLUGINS)&&this.menuEntries.push({label:"Plugins/Themes",routerLink:"/admin/settings/plugins",queryParams:{pluginType:_t.PLUGIN},children:[{label:"Installed plugins",routerLink:"/admin/settings/plugins/list-installed",queryParams:{pluginType:_t.PLUGIN}},{label:"Search plugins",routerLink:"/admin/settings/plugins/search",queryParams:{pluginType:_t.PLUGIN}},{label:"Installed themes",routerLink:"/admin/settings/plugins/list-installed",queryParams:{pluginType:_t.THEME}},{label:"Search themes",routerLink:"/admin/settings/plugins/search",queryParams:{pluginType:_t.THEME}}]});}buildRunnerItems(){!this.server.isRemoteRunnersEnabled()||!this.hasRight(Y.MANAGE_RUNNERS)||this.menuEntries.push({label:"Runners",routerLink:"/admin/settings/system/runners/jobs-list",children:[{label:"Runner jobs",routerLink:"/admin/settings/system/runners/jobs-list"},{label:"Remote runners",routerLink:"/admin/settings/system/runners/runners-list"},{label:"Registration tokens",routerLink:"/admin/settings/system/runners/registration-tokens-list"}]});}buildSystemItems(){let t={label:"System",routerLink:"",children:[]};this.hasRight(Y.MANAGE_JOBS)&&t.children.push({label:"Local jobs",routerLink:"/admin/settings/system/jobs"}),this.hasRight(Y.MANAGE_LOGS)&&t.children.push({label:"Logs",routerLink:"/admin/settings/system/logs"}),this.hasRight(Y.MANAGE_DEBUG)&&t.children.push({label:"Debug",routerLink:"/admin/settings/system/debug"}),t.children.length!==0&&(t.routerLink=t.children[0].routerLink,this.menuEntries.push(t));}hasRight(t){return this.auth.getUser().hasRight(t);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-admin-settings"]],decls:8,vars:1,consts:()=>{let t;t="Settings";let a;return a="Skip the sub menu",[["adminContent",""],a,[1,"root"],["href","#admin-settings-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],[1,"margin-content"],["h1",t,"h1Icon","config",3,"menuEntries"],["tabindex","-1","id","admin-settings-content",1,"margin-content","outline-0"]];},template:function(a,i){if(a&1){let u=Q();l(0,"div",2)(1,"a",3),P("click",function(I){L(u);let T=pe(6);return I.preventDefault(),y(T.focus());}),s(2,1),o(),l(3,"div",4),m(4,"my-horizontal-menu",5),o(),l(5,"div",6,0),m(7,"router-outlet"),o()();}a&2&&(_(4),c("menuEntries",i.menuEntries));},dependencies:[zn,Sn],encapsulation:2}));let e=r;return e;})();var Zm=["table"],Eo=e=>({state:e});function eu(e,r){if(e&1&&(S(0),s(1,5),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function tu(e,r){if(e&1&&(l(0,"a",14),s(1,6),o()),e&2){let n=d().$implicit;c("queryParams",w(1,Eo,n.state));}}function nu(e,r){if(e&1&&(l(0,"a",15),s(1,7),o()),e&2){let n=d().$implicit;c("queryParams",w(1,Eo,n.state));}}function iu(e,r){if(e&1&&(l(0,"a",16),s(1,8),o()),e&2){let n=d().$implicit;c("queryParams",w(1,Eo,n.state));}}function ou(e,r){if(e&1&&(l(0,"td")(1,"a",12),g(2),m(3,"my-global-icon",13),o()(),l(4,"td"),p(5,tu,2,3,"a",14)(6,nu,2,3,"a",15)(7,iu,2,3,"a",16),o(),l(8,"td"),g(9),o(),l(10,"td"),g(11),K(12,"ptDate"),o()),e&2){let n=r.$implicit,t=d();_(),c("href",n.follower.url,at),_(),D(" ",t.buildFollowerName(n)," "),_(3),C(n.state==="accepted"?5:n.state==="pending"?6:n.state==="rejected"?7:-1),_(4),D("",n.score/1e4*100,"%"),_(2),A(se(12,5,n.createdAt,"short"));}}function ru(e,r){if(e&1){let n=Q();l(0,"my-button",19),P("click",function(){L(n);let a=d().$implicit,i=d();return y(i.acceptFollower([a]));}),o();}}function au(e,r){if(e&1){let n=Q();l(0,"my-button",20),P("click",function(){L(n);let a=d().$implicit,i=d();return y(i.rejectFollower([a]));}),o();}}function lu(e,r){if(e&1){let n=Q();l(0,"my-delete-button",21),P("click",function(){L(n);let a=d().$implicit,i=d();return y(i.deleteFollowers([a]));}),o();}}function _u(e,r){if(e&1&&(p(0,ru,1,0,"my-button",17),p(1,au,1,0,"my-button",18),p(2,lu,1,0,"my-delete-button")),e&2){let n=r.$implicit;C(n.state!=="accepted"?0:-1),_(),C(n.state!=="rejected"?1:-1),_(),C(n.state==="rejected"?2:-1);}}function su(e,r){e&1&&(S(0),s(1,9),M());}function du(e,r){e&1&&(S(0),s(1,10),M());}function cu(e,r){if(e&1&&p(0,su,2,0,"ng-container")(1,du,2,0,"ng-container"),e&2){let n=r.search,t=r.hasFilters;C(n||t?0:1);}}var jl=(()=>
25{let r=class r{confirmService=E(we);notifier=E(Z);followService=E(Rn);table=me("table");inputFilters=[];bulkActions=[];columns=[{id:"follower",label:"Follower",sortable:!1},{id:"state",label:"State",sortable:!0},{id:"score",label:"Reliability",sortable:!0},{id:"createdAt",label:"Created",sortable:!0}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.inputFilters=this.followService.buildFollowsListFilters(),this.bulkActions=[{label:"Reject",handler:t=>this.rejectFollower(t),isDisplayed:t=>t.every(a=>a.state!=="rejected")},{label:"Accept",handler:t=>this.acceptFollower(t),isDisplayed:t=>t.every(a=>a.state!=="accepted")},{label:"Delete",handler:t=>this.deleteFollowers(t),isDisplayed:t=>t.every(a=>a.state==="rejected")}];}acceptFollower(t){this.followService.acceptFollower(t).subscribe({next:()=>{let a=ee("Accepted {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}",{count:t.length,followerName:this.buildFollowerName(t[0])});this.notifier.success(a),this.table().loadData();},error:a=>this.notifier.handleError(a)});}rejectFollower(t){return _e(this,null,function*(){let a=ee("Do you really want to reject {count, plural, =1 {{followerName} follow request?} other {{count} follow requests?}}",{count:t.length,followerName:this.buildFollowerName(t[0])});(yield this.confirmService.confirm(a,"Reject"))!==!1&&this.followService.rejectFollower(t).subscribe({next:()=>{let u=ee("Rejected {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}",{count:t.length,followerName:this.buildFollowerName(t[0])});this.notifier.success(u),this.table().loadData();},error:u=>this.notifier.handleError(u)});});}deleteFollowers(t){return _e(this,null,function*(){let a={count:t.length,followerName:this.buildFollowerName(t[0])},i="Deleted followers will be able to send again a follow request.";i+="<br /><br />",i+=ee("Do you really want to delete {count, plural, =1 {{followerName} follow request?} other {{count} follow requests?}}",a),(yield this.confirmService.confirm(i,"Delete"))!==!1&&this.followService.removeFollower(t).subscribe({next:()=>{let N=ee("Removed {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}",a);this.notifier.success(N),this.table().loadData();},error:N=>this.notifier.handleError(N)});});}buildFollowerName(t){return t.follower.name+"@"+t.follower.host;}_dataLoader(t){return this.followService.listFollowers(t);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-followers-list"]],viewQuery:function(a,i){a&1&&Oe(i.table,Zm,5),a&2&&Te();},decls:10,vars:4,consts:()=>{let t;t="followers per page";let a;a="{VAR_PLURAL, plural, =0 {No follower} =1 {1 follower} other {{INTERPOLATION} followers}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Open actor page in a new tab";let u;u="Accepted";let N;N="Pending";let I;I="Rejected";let T;T="Accept";let h;h="Reject";let b;b="No follower found matching current filters.";let G;return G="Your instance doesn't have any follower.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],a,u,N,I,b,G,["key","FollowersListComponent","paginatorText",t,"columnConfig","false","refreshButton","true","searchInput","true",3,"defaultColumns","dataLoader","bulkActions","inputFilters"],["title",i,"target","_blank","rel","noopener noreferrer",3,"href"],["iconName","external-link"],["routerLink",".","title","Filter by state: Accepted",1,"pt-badge","badge-green",3,"queryParams"],["routerLink",".","title","Filter by state: Pending",1,"pt-badge","badge-yellow",3,"queryParams"],["routerLink",".","title","Filter by state: Rejected",1,"pt-badge","badge-red",3,"queryParams"],["title",T,"icon","tick"],["title",h,"icon","cross"],["title",T,"icon","tick",3,"click"],["title",h,"icon","cross",3,"click"],[3,"click"]];},template:function(a,i){a&1&&(l(0,"my-table",11,0),k(2,eu,3,4,"ng-template",null,1,F)(4,ou,13,8,"ng-template",null,2,F)(6,_u,3,3,"ng-template",null,3,F)(8,cu,2,1,"ng-template",null,4,F),o()),a&2&&c("defaultColumns",i.columns)("dataLoader",i.dataLoader)("bulkActions",i.bulkActions)("inputFilters",i.inputFilters);},dependencies:[Pe,qe,Ft,Tn,je,Je,He],styles:[`my-delete-button[_ngcontent-%COMP%]{max-width:130px}
26/*# sourceMappingURL=followers-list.component-HIC3QN7V.css.map */`]}));let e=r;return e;})();var mu=["modal"],uu=e=>({"input-error":e});function pu(e,r){if(e&1&&(l(0,"div"),g(1),o()),e&2){let n=d(3);_(),D(" ",n.form.controls.hostsOrHandles.errors.validHostsOrHandles.value," ");}}function Cu(e,r){if(e&1&&(l(0,"div",13),g(1),p(2,pu,2,1,"div"),o()),e&2){let n=d(2);_(),D(" ",n.formErrors.hostsOrHandles," "),_(),C(n.form.controls.hostsOrHandles.errors.validHostsOrHandles?2:-1);}}function Eu(e,r){e&1&&(l(0,"my-alert",14),s(1,3),o());}function gu(e,r){if(e&1){let n=Q();l(0,"div",4)(1,"h4",5),s(2,1),o(),l(3,"button",6),P("click",function(){L(n);let a=d();return y(a.hide());}),m(4,"my-global-icon",7),o()(),l(5,"div",8)(6,"form",9),P("ngSubmit",function(){L(n);let a=d();return y(a.submit());}),l(7,"div",10)(8,"label",11),s(9,2),o(),m(10,"textarea",12),p(11,Cu,3,2,"div",13),o(),p(12,Eu,2,0,"my-alert",14),l(13,"div",15)(14,"input",16),P("click",function(){L(n);let a=d();return y(a.hide());})("key.enter",function(){L(n);let a=d();return y(a.hide());}),o(),m(15,"input",17),o()()();}if(e&2){let n=d();_(6),c("formGroup",n.form),_(4),c("placeholder",n.placeholder)("ngClass",w(6,uu,n.formErrors.hostsOrHandles)),_(),C(n.formErrors.hostsOrHandles?11:-1),_(),C(n.httpEnabled()===!1?12:-1),_(3),c("disabled",!n.form.valid);}}var Ql=(()=>{let r=class r extends Kt{formReactiveService=E(Me);modalService=E(Oi);followService=E(Rn);notifier=E(Z);modal=me("modal");newFollow=Gn();placeholder=`example.com
27[email protected]
28[email protected]`;openedModal;ngOnInit(){this.buildForm({hostsOrHandles:Ka});}openModal(){this.openedModal=this.modalService.open(this.modal(),{centered:!0});}hide(){this.openedModal.close();}submit(){this.addFollowing(),this.form.reset(),this.hide();}httpEnabled(){return window.location.protocol==="https:";}
28addFollowing(){let t=oa(this.form.value.hostsOrHandles);this.followService.follow(t).subscribe({next:()=>{this.notifier.success(ee("{count, plural, =1 {Follow request sent!} other {Follow requests sent!}}",{count:t.length})),this.newFollow.emit();},error:a=>this.notifier.handleError(a)});}};f(r,"\u0275fac",(()=>{let t;return function(i){return(t||(t=Vt(r)))(i||r);};})()),f(r,"\u0275cmp",R({type:r,selectors:[["my-follow-modal"]],viewQuery:function(a,i){a&1&&Oe(i.modal,mu,5),a&2&&Te();},outputs:{newFollow:"newFollow"},features:[Ct],decls:2,vars:0,consts:()=>{let t;t="Close this modal";let a;a="Cancel";let i;i="Follow";let u;u="Follow";let N;N="1 domain (without \"http://\"), account handle or channel handle per line";let I;return I=" It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers. ",[["modal",""],u,N,I,[1,"modal-header"],[1,"modal-title"],["title",t,1,"border-0","p-0",3,"click"],["iconName","cross"],[1,"modal-body"],["novalidate","",3,"ngSubmit","formGroup"],[1,"form-group"],["for","hostsOrHandles"],["formControlName","hostsOrHandles","type","text","id","hostsOrHandles","name","hostsOrHandles","ngbAutofocus","",1,"form-control",3,"placeholder","ngClass"],["role","alert",1,"form-error"],["type","warning"],[1,"form-group","inputs"],["type","button","role","button","value",a,1,"peertube-button","secondary-button",3,"click","key.enter"],["type","submit","value",i,1,"peertube-button","primary-button",3,"disabled"]];},template:function(a,i){a&1&&k(0,gu,16,8,"ng-template",null,0,F);},dependencies:[qe,le,Se,Le,de,Ne,he,Re,ye,ge,st],styles:[`textarea[_ngcontent-%COMP%]{height:200px}
29/*# sourceMappingURL=follow-modal.component-E5VWE4B4.css.map */`]}));let e=r;return e;})();var ql=(()=>{let r=class r{notifier=E(Z);redundancyService=E(zi);host=ue(void 0);redundancyAllowed=wr(void 0);updateRedundancyState(){this.redundancyService.updateRedundancy(this.host(),this.redundancyAllowed()).subscribe({next:()=>{let t=this.redundancyAllowed()?"enabled":"disabled";this.notifier.success("Redundancy for "+this.host()+" is "+t+"");},error:t=>this.notifier.handleError(t)});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-redundancy-checkbox"]],inputs:{host:[1,"host"],redundancyAllowed:[1,"redundancyAllowed"]},outputs:{redundancyAllowed:"redundancyAllowedChange"},decls:1,vars:2,consts:[[3,"ngModelChange","inputName","ngModel"]],template:function(a,i){a&1&&(l(0,"my-peertube-checkbox",0),Mt("ngModelChange",function(N){return St(i.redundancyAllowed,N)||(i.redundancyAllowed=N),N;}),P("ngModelChange",function(){return i.updateRedundancyState();}),o()),a&2&&(c("inputName",i.host()+"-redundancy-allowed"),Nt("ngModel",i.redundancyAllowed));},dependencies:[Ke,le,de,zt],encapsulation:2}));let e=r;return e;})();var Nu=["followModal"],Su=["table"],go=e=>({state:e});function Mu(e,r){if(e&1&&(S(0),s(1,7),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function fu(e,r){if(e&1){let n=Q();l(0,"button",15),P("click",function(){L(n);let a=d();return y(a.openFollowModal());}),m(1,"my-global-icon",16),S(2),s(3,8),M(),o();}}function Au(e,r){if(e&1&&(l(0,"a",19),s(1,9),o()),e&2){let n=d().$implicit;c("queryParams",w(1,go,n.state));}}function Iu(e,r){if(e&1&&(l(0,"a",20),s(1,10),o()),e&2){let n=d().$implicit;c("queryParams",w(1,go,n.state));}}function Ou(e,r){if(e&1&&(l(0,"a",21),s(1,11),o()),e&2){let n=d().$implicit;c("queryParams",w(1,go,n.state));}}function Tu(e,r){if(e&1&&m(0,"my-redundancy-checkbox",22),e&2){let n=d().$implicit;c("host",n.following.host)("redundancyAllowed",n.following.hostRedundancyAllowed);}}function Pu(e,r){if(e&1&&(l(0,"td")(1,"a",17),g(2),m(3,"my-global-icon",18),o()(),l(4,"td"),p(5,Au,2,3,"a",19)(6,Iu,2,3,"a",20)(7,Ou,2,3,"a",21),o(),l(8,"td"),g(9),K(10,"ptDate"),o(),l(11,"td"),p(12,Tu,1,2,"my-redundancy-checkbox",22),o()),e&2){let n=r.$implicit,t=d();_(),c("href",n.following.url,at),_(),D(" ",t.buildFollowingName(n)," "),_(3),C(n.state==="accepted"?5:n.state==="pending"?6:n.state==="rejected"?7:-1),_(4),A(se(10,5,n.createdAt,"short")),_(3),C(t.isInstanceFollowing(n)?12:-1);}}function Ru(e,r){if(e&1){let n=Q();l(0,"my-delete-button",23),P("click",function(){let a=L(n).$implicit,i=d();return y(i.removeFollowing([a]));}),o();}}function hu(e,r){e&1&&(S(0),s(1,12),M());}function vu(e,r){e&1&&(S(0),s(1,13),M());}function Fu(e,r){if(e&1&&p(0,hu,2,0,"ng-container")(1,vu,2,0,"ng-container"),e&2){let n=r.search,t=r.hasFilters;C(n||t?0:1);}}var Kl=(()=>{let r=class r{notifier=E(Z);confirmService=E(we);followService=E(Rn);followModal=me("followModal");table=me("table");inputFilters=[];bulkActions=[];columns=[{id:"following",label:"Following",sortable:!1},{id:"state",label:"State",sortable:!0},{id:"createdAt",label:"Created",sortable:!0},{id:"redundancyAllowed",label:"Redundancy allowed",sortable:!0}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.inputFilters=this.followService.buildFollowsListFilters(),this.bulkActions=[{label:"Delete",handler:t=>this.removeFollowing(t)}];}openFollowModal(){this.followModal().openModal();}isInstanceFollowing(t){return t.following.name==="peertube";}buildFollowingName(t){return t.following.name+"@"+t.following.host;}removeFollowing(t){return _e(this,null,function*(){let a={count:t.length,entryName:this.buildFollowingName(t[0])},i=ee("Do you really want to unfollow {count, plural, =1 {{entryName}?} other {{count} entries?}}",a);(yield this.confirmService.confirm(i,"Unfollow"))!==!1&&this.followService.unfollow(t).subscribe({next:()=>{let N=ee("You are not following {count, plural, =1 {{entryName} anymore.} other {these {count} entries anymore.}}",a);
29this.notifier.success(N),this.table().loadData();},error:N=>this.notifier.handleError(N)});});}_dataLoader(t){return this.followService.listSubscriptions(t);}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["ng-component"]],viewQuery:function(a,i){a&1&&Oe(i.followModal,Nu,5)(i.table,Su,5),a&2&&Te(2);},decls:14,vars:4,consts:()=>{let t;t="subscriptions per page";let a;a="{VAR_PLURAL, plural, =0 {No subscription} =1 {1 subscription} other {{INTERPOLATION} subscriptions}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Follow";let u;u="Open instance in a new tab";let N;N="Accepted";let I;I="Pending";let T;T="Rejected";let h;h="No host found matching current filters.";let b;return b="Your instance is not following anyone.",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["noResults",""],["followModal",""],a,i,N,I,T,h,b,["key","FollowingListComponent","paginatorText",t,"columnConfig","false","refreshButton","true","searchInput","true",3,"defaultColumns","dataLoader","bulkActions","inputFilters"],[1,"peertube-create-button",3,"click"],["iconName","following","aria-hidden","true"],["title",u,"target","_blank","rel","noopener noreferrer",3,"href"],["iconName","external-link"],["routerLink",".","title","Filter by state: Accepted",1,"pt-badge","badge-green",3,"queryParams"],["routerLink",".","title","Filter by state: Pending",1,"pt-badge","badge-yellow",3,"queryParams"],["routerLink",".","title","Filter by state: Rejected",1,"pt-badge","badge-red",3,"queryParams"],[3,"host","redundancyAllowed"],["label","",3,"click"]];},template:function(a,i){a&1&&(l(0,"my-table",14,0),k(2,Mu,3,4,"ng-template",null,1,F)(4,fu,4,0,"ng-template",null,2,F)(6,Pu,13,8,"ng-template",null,3,F)(8,Ru,1,0,"ng-template",null,4,F)(10,Fu,2,1,"ng-template",null,5,F),o(),m(12,"my-follow-modal",null,6)),a&2&&c("defaultColumns",i.columns)("dataLoader",i.dataLoader)("bulkActions",i.bulkActions)("inputFilters",i.inputFilters);},dependencies:[Pe,qe,Tn,ql,Ql,je,Je,He],styles:[`my-delete-button[_ngcontent-%COMP%]{max-width:130px}
30/*# sourceMappingURL=following-list.component-VOGZIINQ.css.map */`]}));let e=r;return e;})();var Jl=(()=>{let r=class r{redundancyElement=ue(void 0);};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-video-redundancy-information"]],inputs:{redundancyElement:[1,"redundancyElement"]},decls:23,vars:14,consts:[["target","_blank","rel","noopener noreferrer",3,"href"]],template:function(a,i){a&1&&(Et(0,"div")(1,"strong"),g(2,"Url"),gt(),Et(3,"a",0),g(4),gt()(),Et(5,"div")(6,"strong"),g(7,"Created on"),gt(),Et(8,"span"),g(9),K(10,"ptDate"),gt()(),Et(11,"div")(12,"strong"),g(13,"Expires on"),gt(),Et(14,"span"),g(15),K(16,"ptDate"),gt()(),Et(17,"div")(18,"strong"),g(19,"Size"),gt(),Et(20,"span"),g(21),K(22,"bytes"),gt()()),a&2&&(_(3),Mi("href",i.redundancyElement().fileUrl,at),_(),A(i.redundancyElement().fileUrl),_(5),A(se(10,5,i.redundancyElement().createdAt,"medium")),_(6),A(se(16,8,i.redundancyElement().expiresOn,"medium")),_(6),A(se(22,11,i.redundancyElement().size,1)));},dependencies:[Je,pt],styles:[`strong[_ngcontent-%COMP%]{display:inline-block;min-width:100px;font-weight:600;color:var(--fg-300)}
31/*# sourceMappingURL=video-redundancy-information.component-ZVKGEQJJ.css.map */`]}));let e=r;return e;})();var Du=["table"];function bu(e,r){if(e&1&&(S(0),s(1,7),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function Gu(e,r){if(e&1){let n=Q();l(0,"div",17)(1,"label",18),s(2,8),o(),l(3,"div",19)(4,"select",20),Mt("ngModelChange",function(a){L(n);let i=d();return St(i.displayType,a)||(i.displayType=a),y(a);}),P("ngModelChange",function(){L(n);let a=d();return y(a.onDisplayTypeChanged());}),l(5,"option",21),s(6,9),o(),l(7,"option",22),s(8,10),o()()()();}if(e&2){let n=d();_(4),Nt("ngModel",n.displayType);}}function Lu(e,r){if(e&1&&(l(0,"td"),g(1),o()),e&2){let n=d().$implicit,t=d();_(),A(t.getRedundancyStrategy(n));}}function yu(e,r){if(e&1&&(l(0,"td"),g(1),K(2,"bytes"),o()),e&2){let n=d().$implicit,t=d();_(),A(se(2,1,t.getTotalSize(n),1));}}function $u(e,r){if(e&1&&(p(0,Lu,2,1,"td"),l(1,"td")(2,"a",23),g(3),m(4,"my-global-icon",24),o()(),p(5,yu,3,4,"td")),e&2){let n=r.$implicit,t=d();C(t.isDisplayingRemoteVideos()?0:-1),_(2),c("href",n.url,at),_(),D(" ",n.name," "),_(2),C(t.isDisplayingRemoteVideos()?5:-1);}}function xu(e,r){if(e&1){let n=Q();l(0,"my-delete-button",25),P("click",function(){let a=L(n).$implicit,i=d();return y(i.removeRedundancy(a));}),o();}}function wu(e,r){if(e&1&&(l(0,"div"),m(1,"my-video-redundancy-information",26),o()),e&2){let n=r.$implicit;_(),c("redundancyElement",n);}}function Uu(e,r){if(e&1&&Ce(0,wu,2,1,"div",null,Ie),e&2){let n=r.$implicit;Ee(n.redundancies.streamingPlaylists);}}
31function Vu(e,r){e&1&&(S(0),s(1,11),M());}function ku(e,r){e&1&&(S(0),s(1,12),M());}function zu(e,r){if(e&1&&p(0,Vu,2,0,"ng-container")(1,ku,2,0,"ng-container"),e&2){let n=d();C(n.isDisplayingRemoteVideos()?0:1);}}function Xu(e,r){e&1&&(l(0,"div",28),s(1,14),o());}function Bu(e,r){if(e&1&&(l(0,"div",29),m(1,"p-chart",30),o()),e&2){let n=r.$implicit;_(),c("ariaLabel",n.ariaLabel)("data",n.graphData)("options",n.options);}}function Wu(e,r){if(e&1&&(l(0,"div",16)(1,"h6"),s(2,13),o(),l(3,"div",27),p(4,Xu,2,0,"div",28),Ce(5,Bu,2,3,"div",29,Ie),o()()),e&2){let n=d();_(4),C(n.noRedundancies?4:-1),_(),Ee(n.redundanciesGraphsData);}}var Yl=(()=>{let r=class r{notifier=E(Z);confirmService=E(we);redundancyService=E(zi);serverService=E(q);table=me("table");displayType="my-videos";redundanciesGraphsData=[];noRedundancies=!1;dataLoaded=!1;bytesPipe;columns;dataLoader;customUpdateUrl;customParseQueryParams;constructor(){this.bytesPipe=new pt(),this.customUpdateUrl=this._customUpdateUrl.bind(this),this.customParseQueryParams=this._customParseQueryParams.bind(this),this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.loadSelectLocalStorage(),this.buildColumns(),this.serverService.getServerStats().subscribe(t=>{let a=t.videosRedundancy;a.length===0&&(this.noRedundancies=!0);for(let i of a)this.buildPieData(i);});}isDisplayingRemoteVideos(){return this.displayType==="remote-videos";}getTotalSize(t){return t.redundancies.streamingPlaylists.reduce((a,i)=>a+i.size,0);}onDisplayTypeChanged(){this.dataLoaded=!1,this.saveSelectLocalStorage(),this.buildColumns(),this.table().reloadData();}getRedundancyStrategy(t){return t.redundancies.streamingPlaylists.length!==0?t.redundancies.streamingPlaylists[0].strategy:"";}buildPieData(t){if(t.totalSize===0)return;let a=t.totalSize?t.totalSize-t.totalUsed:null,i=["Used ("+this.bytesToHuman(t.totalUsed)+")"],u=[t.totalUsed];a&&(i.push("Available ("+this.bytesToHuman(a)+")"),u.push(a)),this.redundanciesGraphsData.push({stats:t,ariaLabel:"Redundancy strategy \""+t.strategy+"\". "+i.join(". "),graphData:{labels:i,datasets:[{data:u,backgroundColor:["#FF6384","#36A2EB"],hoverBackgroundColor:["#FF6384","#36A2EB"]}]},options:{plugins:{title:{display:!0,text:t.strategy},tooltip:{callbacks:{label:N=>N.label}}}}});}removeRedundancy(t){return _e(this,null,function*(){let a="Do you really want to remove this video redundancy?";(yield this.confirmService.confirm(a,"Remove redundancy"))!==!1&&this.redundancyService.removeVideoRedundancies(t).subscribe({next:()=>{this.notifier.success("Video redundancies removed!"),this.table().loadData();},error:u=>this.notifier.handleError(u)});});}_dataLoader(t){return this.redundancyService.listVideoRedundancies(Be(fe({},t),{target:this.displayType})).pipe(Si(()=>this.dataLoaded=!0));}_customUpdateUrl(){return{displayType:this.displayType};}_customParseQueryParams(t){t.displayType&&(this.displayType=t.displayType);}buildColumns(){this.columns=[{id:"name",label:"Name",sortable:!0}],this.isDisplayingRemoteVideos()&&(this.columns=[{id:"strategy",label:"Strategy",sortable:!1},...this.columns,{id:"totalSize",label:"Total size",sortable:!1}]);}loadSelectLocalStorage(){let t=mo.getItem(r.LS_DISPLAY_TYPE);t&&(this.displayType=t);}saveSelectLocalStorage(){mo.setItem(r.LS_DISPLAY_TYPE,this.displayType);}bytesToHuman(t){return this.bytesPipe.transform(t,1);}};f(r,"LS_DISPLAY_TYPE","video-redundancies-list-display-type"),f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-video-redundancies-list"]],viewQuery:function(a,i){a&1&&Oe(i.table,Du,5),a&2&&Te();},decls:15,vars:5,consts:()=>{let t;t="redundancies per page";let a;a="{VAR_PLURAL, plural, =0 {No redundancy} =1 {1 redundancy} other {{INTERPOLATION} redundancies}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Display";let u;u="My videos duplicated by remote instances";let N;N="Remote videos duplicated by my instance";let I;I="Open video in a new tab";let T;T="Your instance doesn't mirror any video.";let h;h="Your instance has no mirrored videos.";let b;b="Enabled strategies stats";let G;return G="No redundancy strategy is enabled on your instance.",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],a,i,u,N,T,h,b,G,["key","VideoRedundanciesListComponent","defaultSort","name","defaultSortOrder","asc","paginatorText",t,"columnConfig","false",3,"defaultColumns","dataLoader","customParseQueryParams","customUpdateUrl"],[1,"redundancies-charts"],[1,"select-filter-block"],["for","displayType"],[1,"peertube-select-container"],["id","displayType","name","displayType",1,"form-control",3,"ngModelChange","ngModel"],["value","my-videos"],["value","remote-videos"],["title",I,"target","_blank","rel","noopener noreferrer",3,"href"],["iconName","external-link"],["label","",3,"click"],[3,"redundancyElement"],[1,"chart-blocks"],[1,"n
31o-results"],[1,"chart-block"],["type","pie","width","300px","height","300px",3,"ariaLabel","data","options"]];},template:function(a,i){a&1&&(l(0,"my-table",15,0),k(2,bu,3,4,"ng-template",null,1,F)(4,Gu,9,1,"ng-template",null,2,F)(6,$u,6,4,"ng-template",null,3,F)(8,xu,1,0,"ng-template",null,4,F)(10,Uu,2,0,"ng-template",null,5,F)(12,zu,2,1,"ng-template",null,6,F),o(),p(14,Wu,7,1,"div",16)),a&2&&(c("defaultColumns",i.columns)("dataLoader",i.dataLoader)("customParseQueryParams",i.customParseQueryParams)("customUpdateUrl",i.customUpdateUrl),_(14),C(i.isDisplayingRemoteVideos()&&i.dataLoaded?14:-1));},dependencies:[qe,le,Bt,Wt,Xt,de,zt,Tn,Jl,rl,ol,je,pt,He],styles:[`.redundancies-charts[_ngcontent-%COMP%]{margin-top:50px}.redundancies-charts[_ngcontent-%COMP%]   .chart-blocks[_ngcontent-%COMP%]{display:flex;justify-content:center}.redundancies-charts[_ngcontent-%COMP%]   .chart-blocks[_ngcontent-%COMP%]   .chart-block[_ngcontent-%COMP%]{margin:0 20px}
32/*# sourceMappingURL=video-redundancies-list.component-56YK2XB4.css.map */`]}));let e=r;return e;})();var Zl=[{path:"follows",canActivate:[Xe],data:{userRight:Y.MANAGE_SERVER_FOLLOW},children:[{path:"",redirectTo:"following-list",pathMatch:"full"},{path:"following-list",component:Kl,data:{meta:{title:"Following"}}},{path:"followers-list",component:jl,data:{meta:{title:"Followers"}}},{path:"following-add",redirectTo:"following-list"},{path:"video-redundancies-list",component:Yl,data:{meta:{title:"Redundancy"}}}]}];var e_=(()=>{let r=class r{syndicationItems=[{format:Dn.RSS,label:"media rss 2.0",url:Qn.BASE_FEEDS_URL+Dn.RSS.toLowerCase()},{format:Dn.ATOM,label:"atom 1.0",url:Qn.BASE_FEEDS_URL+Dn.ATOM.toLowerCase()},{format:Dn.JSON,label:"json 1.0",url:Qn.BASE_FEEDS_URL+Dn.JSON.toLowerCase()}];};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-video-comment-list"]],decls:1,vars:0,consts:[["mode","admin","key","AdminVideoCommentList"]],template:function(a,i){a&1&&m(0,"my-video-comment-list-admin-owner",0);},dependencies:[al],encapsulation:2}));let e=r;return e;})();var no=(()=>{let r=class r extends Kt{videoQuotaOptions=[];videoQuotaDailyOptions=[];username;user;roles=[];serverConfig;ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.buildRoles();}get subscribersCount(){let t=this.user?this.user.account.followersCount:0,a=this.user?this.user.videoChannels.map(i=>i.followersCount).reduce((i,u)=>i+u,0):0;return t+a;}getAuthPlugins(){return this.serverConfig.plugin.registeredIdAndPassAuths.map(t=>t.npmName).concat(this.serverConfig.plugin.registeredExternalAuths.map(t=>t.npmName));}buildRoles(){let t=this.auth.getUser();this.serverService.getServerLocale().subscribe(a=>{if(t.role.id===ft.ADMINISTRATOR){this.roles=Object.entries(so).map(([i,u])=>({value:i.toString(),label:li(u,a)}));return;}this.roles=[{value:ft.USER.toString(),label:li(so[ft.USER],a)}];});}displayPasswordZone(){return!(this.isCreation()||!this.user||this.user.pluginAuth||this.auth.getUser().id===this.user.id);}displayTokenSessions(){return!(this.isCreation()||!this.user);}resetPassword(){}disableTwoFactorAuth(){}getUserVideoQuota(){return this.form.value.videoQuota;}buildAdminFlags(t){return t.byPassAutoBlock?oi.BYPASS_VIDEO_AUTO_BLACKLIST:oi.NONE;}buildQuotaOptions(){this.videoQuotaOptions=xi(),this.videoQuotaDailyOptions=wi();}};f(r,"\u0275fac",(()=>{let t;return function(i){return(t||(t=Vt(r)))(i||r);};})()),f(r,"\u0275dir",Dr({type:r,features:[Ct]}));let e=r;return e;})();var Hu=e=>({"input-error":e});function ju(e,r){e&1&&(S(0),s(1,0),M());}function Qu(e,r){e&1&&(S(0),s(1,1),M());}function qu(e,r){if(e&1&&(l(0,"div",6),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.password," ");}}var io=(()=>{let r=class r extends Kt{formReactiveService=E(Me);notifier=E(Z);userAdminService=E($t);serverService=E(q);userId=ue(void 0);username=ue(void 0);error;showPassword=!1;ngOnInit(){let{minLength:t,maxLength:a}=this.serverService.getHTMLConfig().fieldsConstraints.users.password;this.buildForm({password:Vi(t,a)});}formValidated(){this.error=void 0;let t=this.form.value;this.userAdminService.updateUser(this.userId(),t).subscribe({next:()=>this.notifier.success("Password changed for user "+this.username()+"."),error:a=>{this.error=a.message;}});}togglePasswordVisibility(){this.showPassword=!this.showPassword;}getFormButtonTitle(){return"Update user password";}};f(r,"\u0275fac",(()=>{let t;return function(i){return(t||(t=Vt(r)))(i||r);};})()),f(r,"\u0275cmp",R({type:r,selectors:[["my-user-password"]],inputs:{userId:[1,"userId"],username:[1,"username"]},features:[Ct],decls:8,vars:10,consts:()=>{let t;t="Hide";let a;return a="Show",[t,a,[3,"ngSubmit","formGroup"],[1,"input-group"],["id","password","formControlName","password","autocomplete","new-password",1,"form-control",3,"ngClass"],["type","button",1,"btn",3,"click"],["role","alert",1,"form-error"],["type","submit",1,"peertube-button","danger-button","mt-2",3,"value","disabled"]];},template:function(a,i){a&1&&(l(0,"form",2),P("ngSubmit",function(){return i.formValidated();}),l(1,"div",3),m(2,"input",4),l(3,"button",5),P("click",function(){return i.togglePasswordVisibility();}),p(4,ju,2,0,"ng-container")(5,Qu,2,0,"ng-container"),o()(),p(6,qu,2,1,"div",6),m(7,"input",7),o()),a&2&&(c("formGroup",i.form),_(2),c("ngClass",w(8,Hu,i.formErrors.password)),Cn("type",i.showPassword?"text":"password"),_(2),C(i.showPassword?4:5),_(2),C(i.formErrors.password?6:-1),_(),c("value",kt(i.getFormButtonTitle()))("disabled",!i.form.valid));},dependencies:[le,Se,Le,de,Ne,he,Re,ye,ge],styles:[`input[type=text][_ngcontent-%COMP%], input[type=password][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=password][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=password][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=password][_ngcontent-%COMP%]:focus, input[type=password][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=password][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=password][_ngcontent-%COMP%]{width:100%}}.btn[_ngcontent-%COMP%]{background-color:var(--input-bg);border-left:1px solid var(--bg)}.btn[_ngcontent-%COMP%]:hover{opacity:.8}
33/*# sourceMappingURL=user-password.component-3ABU6TK3.css.map */`]}));let e=r;return e;})();var No=e=>({"input-error":e}),Ku=e=>["/a",e],t_=()=>["/admin/moderation/abuses/list"],n_=e=>({search:e});function Ju(e,r){e&1&&(l(0,"li",31),s(1,7),o());}function Yu(e,r){if(e&1&&(l(0,"a",63),g(1),o()),e&2){let n=d(2);c("routerLink",w(2,Ku,n.user==null?null:n.user.username)),_(),A(n.user==null?null:n.user.username);}}function Zu(e,r){if(e&1&&(l(0,"li",31),s(1,8),o(),l(2,"li",62),p(3,Yu,2,4,"a",63),o()),e&2){let n=d();_(3),C(n.user?3:-1);}}function e0(e,r){if(e&1&&(l(0,"div",64)(1,"div")(2,"a")(3,"div",65),g(4),K(5,"bytes"),o(),l(6,"div",66),s(7,9),o()()(),l(8,"div")(9,"a")(10,"div",65),g(11),o(),l(12,"div",66),s(13,10),o()()(),l(14,"div")(15,"a")(16,"div",65),g(17),o(),l(18,"div",66),s(19,11),o()()(),l(20,"div")(21,"a",67)(22,"div",65),g(23),o(),l(24,"div",66),s(25,12),o()()(),l(26,"div")(27,"a",67)(28,"div",65),g(29),o(),l(30,"div",66),s(31,13),o()()(),l(32,"div")(33,"a")(34,"div",65),g(35),o(),l(36,"div",66),s(37,14),o()()()()),e&2){let n=d(2);
33_(4),en("",n.user.videosCount," (",se(5,16,n.user.videoQuotaUsed,0),")"),_(3),$(n.user.videosCount),x(7),_(4),A(n.user.videoChannels.length||0),_(2),$(n.user.videoChannels.length),x(13),_(4),A(n.subscribersCount),_(2),$(n.subscribersCount),x(19),_(2),c("routerLink",mt(19,t_))("queryParams",w(20,n_,'reportee:"'+(n.user==null?null:n.user.account.displayName)+'"')),_(2),A(n.user.abusesCount),_(4),c("routerLink",mt(22,t_))("queryParams",w(23,n_,'reporter:"'+(n.user==null?null:n.user.account.displayName)+'" state:accepted')),_(2),en("",n.user.abusesAcceptedCount," / ",n.user.abusesCreatedCount),_(6),A(n.user.videoCommentsCount),_(2),$(n.user.videoCommentsCount),x(37);}}function t0(e,r){if(e&1&&p(0,e0,38,25,"div",64),e&2){let n=d();C(!n.isCreation()&&n.user?0:-1);}}function n0(e,r){if(e&1&&(l(0,"my-alert",33),g(1),o()),e&2){let n=d();_(),A(n.error);}}function i0(e,r){}function o0(e,r){e&1&&k(0,i0,0,0,"ng-template");}function r0(e,r){e&1&&(l(0,"h2"),s(1,15),o());}function a0(e,r){if(e&1&&(l(0,"h2",68),g(1),o(),m(2,"my-actor-avatar-edit",69)),e&2){let n=d();_(),D("EDIT USER ",n.user.username),_(),c("displayName",n.user.account.displayName)("avatars",n.user.account.avatars)("username",n.user.username);}}function l0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d(2);_(),D(" ",n.formErrors.username," ");}}function _0(e,r){if(e&1&&(l(0,"div",44)(1,"label",70),s(2,16),o(),m(3,"input",71),p(4,l0,2,1,"div",47),o()),e&2){let n=d();_(3),c("ngClass",w(2,No,n.formErrors.username)),_(),C(n.formErrors.username?4:-1);}}function s0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d(2);_(),D(" ",n.formErrors.channelName," ");}}function d0(e,r){if(e&1&&(l(0,"div",44)(1,"label",72),s(2,17),o(),m(3,"input",73),p(4,s0,2,1,"div",47),o()),e&2){let n=d();_(3),c("ngClass",w(2,No,n.formErrors.channelName)),_(),C(n.formErrors.channelName?4:-1);}}function c0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.email," ");}}function m0(e,r){e&1&&(l(0,"div",75),s(1,19),o());}function u0(e,r){if(e&1&&(l(0,"div",44)(1,"label",74),s(2,18),o(),p(3,m0,2,0,"div",75),m(4,"my-input-text",76),o()),e&2){let n=d();_(3),C(n.isPasswordOptional()?3:-1),_(),c("formError",n.formErrors.password);}}function p0(e,r){if(e&1&&(l(0,"option",51),g(1),o()),e&2){let n=r.$implicit;c("value",n.value),_(),D(" ",n.label," ");}}function C0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.role," ");}}function E0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.videoQuota," ");}}function g0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.videoQuotaDaily," ");}}function N0(e,r){if(e&1&&(l(0,"option",51),g(1),o()),e&2){let n=r.$implicit;c("value",n),_(),A(n);}}function S0(e,r){if(e&1&&(l(0,"div",44)(1,"label",77),s(2,20),o(),l(3,"div",49)(4,"select",78)(5,"option",51),s(6,21),o(),Ce(7,N0,2,2,"option",51,Ie),o()()()),e&2){let n=d();_(5),c("value",null),_(2),Ee(n.getAuthPlugins());}}function M0(e,r){}function f0(e,r){e&1&&k(0,M0,0,0,"ng-template");}function A0(e,r){if(e&1&&(l(0,"div",61)(1,"div",39),m(2,"div",79),l(3,"h2"),s(4,22),o()(),l(5,"div",41),m(6,"my-account-token-sessions",80),o()()),e&2){let n=d();_(6),c("user",n.user);}}function I0(e,r){if(e&1){let n=Q();l(0,"div",44)(1,"div",83),s(2,27),o(),l(3,"button",84),P("click",function(){L(n);let a=d(2);return y(a.disableTwoFactorAuth());}),s(4,28),o()();}}function O0(e,r){if(e&1){let n=Q();l(0,"div",61)(1,"div",39),m(2,"div",81),l(3,"h2",82),s(4,23),o()(),l(5,"div",41)(6,"div",44)(7,"div",83),s(8,24),o(),l(9,"button",84),P("click",function(){L(n);let a=d();return y(a.resetPassword());}),s(10,25),o()(),l(11,"div",44)(12,"div",83),s(13,26),o(),m(14,"my-user-password",85),o(),p(15,I0,5,0,"div",44),o()();}if(e&2){let n=d();_(14),c("userId",n.user.id)("username",n.user.username),_(),C(n.user.twoFactorEnabled?15:-1);}}var i_=(()=>{let r=class r extends no{serverService=E(q);formReactiveService=E(Me);configService=E(Ue);screenService=E(xn);auth=E(At);router=E(Mn);notifier=E(Z);userAdminService=E($t);error;constructor(){super(),this.buildQuotaOptions();}
33ngOnInit(){super.ngOnInit();let t={role:ft.USER.toString(),videoQuota:-1,videoQuotaDaily:-1},a=this.serverService.getHTMLConfig().fieldsConstraints.users.password;this.buildForm({username:Da,channelName:ba,email:Ui,password:this.isPasswordOptional()?Ga(a.minLength,a.maxLength):Vi(a.minLength,a.maxLength),role:ki,videoQuota:Vn,videoQuotaDaily:kn,byPassAutoBlock:null},t);}formValidated(){this.error=void 0;let t=this.form.value;t.adminFlags=this.buildAdminFlags(this.form.value),t.videoQuota=parseInt(this.form.value.videoQuota,10),t.videoQuotaDaily=parseInt(this.form.value.videoQuotaDaily,10),this.userAdminService.addUser(t).subscribe({next:()=>{this.notifier.success("User "+t.username+" created."),this.router.navigate(["/admin/overview/users/list"]);},error:a=>{this.error=a.message;}});}isCreation(){return!0;}isPasswordOptional(){return this.serverConfig.email.enabled;}getFormButtonTitle(){return"Create user";}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-user-create"]],features:[Ct],decls:59,vars:28,consts:()=>{let t;t="[email protected]";let a;a="bytes";let i;i="bytes";let u;u="User bypasses video validation by moderators";let N;N="Users";let I;I="Email";let T;T="Role";let h;h="Video quota";let b;b="Daily video quota";let G;G=" Enable this checkbox if this user doesn't need to have its videos reviewed by moderators. ";let U;U="Create";let J;J="Edit";let V;V="{VAR_PLURAL, plural, =1 {Video} other {Videos}}",V=W(V,{VAR_PLURAL:"\uFFFD0\uFFFD"});let te;te="{VAR_PLURAL, plural, =1 {Channel} other {Channels}}",te=W(te,{VAR_PLURAL:"\uFFFD0\uFFFD"});let oe;oe="{VAR_PLURAL, plural, =1 {Subscriber} other {Subscribers}}",oe=W(oe,{VAR_PLURAL:"\uFFFD0\uFFFD"});let De;De="Incriminated in reports";let ve;ve="Authored reports accepted";let ce;ce="{VAR_PLURAL, plural, =1 {Comment} other {Comments}}",ce=W(ce,{VAR_PLURAL:"\uFFFD0\uFFFD"});let be;be="NEW USER";let Fe;Fe="john";let Ae;Ae="Username";let Ge;Ge="john_channel";let ie;ie="Channel name";let Ve;Ve="Password";let re;re=" If you leave the password empty, an email will be sent to the user. ";let Qe;Qe="Auth plugin";let ae;ae="None (local authentication)";let Ze;Ze="TOKEN SESSIONS";let et;et="DANGER ZONE";let tt;tt="Send a link to reset the password by email to the user";let nt;nt="Ask for new password";let it;it="Manually set the user password";let ot;ot="This user has two factor authentication enabled";let rt;return rt="Disable two factor authentication",[["dashboard",""],N,I,T,h,b,G,U,J,V,te,oe,De,ve,ce,be,Ae,ie,Ve,re,Qe,ae,Ze,et,tt,nt,it,ot,rt,["aria-label","breadcrumb"],[1,"pt-breadcrumb"],[1,"breadcrumb-item"],["routerLink","/admin/overview/users"],["type","danger"],[1,"pt-two-cols","d-xxl-none"],[1,"col-0","col-xl-3"],[1,"col-12","col-xl-9"],[4,"ngTemplateOutlet"],[1,"pt-two-cols","mt-4"],[1,"title-col"],["id","user",1,"anchor"],[1,"content-col"],[1,"row"],[1,"col",3,"ngSubmit","formGroup"],[1,"form-group"],["for","email"],["type","text","id","email","placeholder",t,"formControlName","email","autocomplete","off",1,"form-control",3,"ngClass","readonly"],["role","alert",1,"form-error"],["for","role"],[1,"peertube-select-container"],["id","role","formControlName","role",1,"form-control"],[3,"value"],["id","videoQuotaLabel","for","videoQuota"],["labelId","videoQuotaLabel","inputId","videoQuota","formControlName","videoQuota","inputSuffix",a,"inputType","number",3,"items","clearable"],[3,"videoQuota"],["id","videoQuotaDailyLabel","for","videoQuotaDaily"],["labelId","videoQuotaDailyLabel","inputId","videoQuotaDaily","formControlName","videoQuotaDaily","inputSuffix",i,"inputType","number",3,"items","clearable"],["inputName","byPassAutoBlock","formControlName","byPassAutoBlock","labelText",u],["ngProjectAs","description",5,["description"]],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],[1,"d-none","d-xxl-block","col-7"],[1,"pt-two-cols","mt-5"],["aria-current","page",1,"breadcrumb-item"],[3,"routerLink"],[1,"dashboard"],[1,"dashboard-num"],[1,"dashboard-label"],[3,"routerLink","queryParams"],[1,"visually-hidden"],["actorType","account","editable","false","displayUsern
33ame","false",3,"displayName","avatars","username"],["for","username"],["type","text","id","username","placeholder",Fe,"formControlName","username",1,"form-control",3,"ngClass"],["for","channelName"],["type","text","id","channelName","placeholder",Ge,"formControlName","channelName",1,"form-control",3,"ngClass"],["for","password"],[1,"form-group-description"],["formControlName","password","inputId","password","autocomplete","new-password",3,"formError"],["for","pluginAuth"],["id","pluginAuth","formControlName","pluginAuth",1,"form-control"],["id","token-sessions",1,"anchor"],[3,"user"],["id","danger",1,"anchor"],[1,"pt-title-danger"],[1,"mb-1","fw-bold"],[1,"peertube-button","danger-button",3,"click"],[3,"userId","username"]];},template:function(a,i){if(a&1&&(l(0,"nav",29)(1,"ol",30)(2,"li",31)(3,"a",32),s(4,1),o()(),p(5,Ju,2,0,"li",31)(6,Zu,4,1),o()(),k(7,t0,1,1,"ng-template",null,0,F),p(9,n0,2,1,"my-alert",33),l(10,"div",34),m(11,"div",35),l(12,"div",36),k(13,o0,1,0,null,37),o()(),l(14,"div",38)(15,"div",39),m(16,"div",40),p(17,r0,2,0,"h2")(18,a0,3,4),o(),l(19,"div",41)(20,"div",42)(21,"form",43),P("ngSubmit",function(){return i.formValidated();}),p(22,_0,5,4,"div",44),p(23,d0,5,4,"div",44),l(24,"div",44)(25,"label",45),s(26,2),o(),m(27,"input",46),p(28,c0,2,1,"div",47),o(),p(29,u0,5,2,"div",44),l(30,"div",44)(31,"label",48),s(32,3),o(),l(33,"div",49)(34,"select",50),Ce(35,p0,2,2,"option",51,Ie),o()(),p(37,C0,2,1,"div",47),o(),l(38,"div",44)(39,"label",52),s(40,4),o(),m(41,"my-select-custom-value",53)(42,"my-user-real-quota-info",54),p(43,E0,2,1,"div",47),o(),l(44,"div",44)(45,"label",55),s(46,5),o(),m(47,"my-select-custom-value",56),p(48,g0,2,1,"div",47),o(),p(49,S0,9,1,"div",44),l(50,"div",44)(51,"my-peertube-checkbox",57),S(52,58),s(53,6),M(),o()(),m(54,"input",59),o(),l(55,"div",60),k(56,f0,1,0,null,37),o()()()(),p(57,A0,7,1,"div",61),p(58,O0,16,3,"div",61)),a&2){let u=pe(8);_(5),C(i.isCreation()?5:6),_(4),C(i.error?9:-1),_(4),c("ngTemplateOutlet",u),_(4),C(i.isCreation()?17:i.user?18:-1),_(4),c("formGroup",i.form),_(),C(i.isCreation()?22:-1),_(),C(i.isCreation()?23:-1),_(4),c("ngClass",w(26,No,i.formErrors.email))("readonly",i.user&&i.user.pluginAuth!==null),_(),C(i.formErrors.email?28:-1),_(),C(i.isCreation()?29:-1),_(6),Ee(i.roles),_(2),C(i.formErrors.role?37:-1),_(4),c("items",i.videoQuotaOptions)("clearable",!1),_(),c("videoQuota",i.getUserVideoQuota()),_(),C(i.formErrors.videoQuota?43:-1),_(4),c("items",i.videoQuotaDailyOptions)("clearable",!1),_(),C(i.formErrors.videoQuotaDaily?48:-1),_(),C(!i.isCreation()&&i.getAuthPlugins().length!==0?49:-1),_(5),c("value",kt(i.getFormButtonTitle()))("disabled",!i.form.valid),_(2),c("ngTemplateOutlet",u),_(),C(i.displayTokenSessions()?57:-1),_(),C(i.displayPasswordZone()?58:-1);}},dependencies:[Pe,$e,ge,Nn,Ji,le,Se,Bt,Wt,Le,Xt,de,Ne,he,Re,ye,Gi,Dt,qn,Ke,io,Ki,st,pt],styles:[`input[_ngcontent-%COMP%]:not([type=submit]){font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[_ngcontent-%COMP%]:not([type=submit])::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[_ngcontent-%COMP%]:not([type=submit])[readonly]{color:var(--fg-300)}input[_ngcontent-%COMP%]:not([type=submit]):focus, input[_ngcontent-%COMP%]:not([type=submit]):focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[_ngcontent-%COMP%]:not([type=submit])[disabled]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[_ngcontent-%COMP%]:not([type=submit]){width:100%}}my-input-text[_ngcontent-%COMP%]{display:block;width:340px}@media screen and (max-width:370px){my-input-text[_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.dashboard[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;margin:0 -5px;max-width:900px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{box-sizing:border-box;flex:0 0 33.3333333333%;padding:0 5px;margin-bottom:10px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none;color:inherit;display:block;font-size:18px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:active{text-decoration:none}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:active, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{opacity:.8}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{padding:20px;background:var(--bg-secondary-400);border-radius:4px;box-sizing:border-box;height:100%}
33.dashboard[_ngcontent-%COMP%]   .dashboard-num[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%]   .dashboard-text[_ngcontent-%COMP%]{text-align:center;font-size:130%;color:var(--fg);line-height:30px;margin-bottom:20px}.dashboard[_ngcontent-%COMP%]   .dashboard-label[_ngcontent-%COMP%]{font-size:90%;color:var(--fg-300);text-align:center}
34/*# sourceMappingURL=user-edit.component-DAVJPQNX.css.map */`]}));let e=r;return e;})();var So=e=>({"input-error":e}),T0=e=>["/a",e],o_=()=>["/admin/moderation/abuses/list"],r_=e=>({search:e});function P0(e,r){e&1&&(l(0,"li",31),s(1,7),o());}function R0(e,r){if(e&1&&(l(0,"a",63),g(1),o()),e&2){let n=d(2);c("routerLink",w(2,T0,n.user==null?null:n.user.username)),_(),A(n.user==null?null:n.user.username);}}function h0(e,r){if(e&1&&(l(0,"li",31),s(1,8),o(),l(2,"li",62),p(3,R0,2,4,"a",63),o()),e&2){let n=d();_(3),C(n.user?3:-1);}}function v0(e,r){if(e&1&&(l(0,"div",64)(1,"div")(2,"a")(3,"div",65),g(4),K(5,"bytes"),o(),l(6,"div",66),s(7,9),o()()(),l(8,"div")(9,"a")(10,"div",65),g(11),o(),l(12,"div",66),s(13,10),o()()(),l(14,"div")(15,"a")(16,"div",65),g(17),o(),l(18,"div",66),s(19,11),o()()(),l(20,"div")(21,"a",67)(22,"div",65),g(23),o(),l(24,"div",66),s(25,12),o()()(),l(26,"div")(27,"a",67)(28,"div",65),g(29),o(),l(30,"div",66),s(31,13),o()()(),l(32,"div")(33,"a")(34,"div",65),g(35),o(),l(36,"div",66),s(37,14),o()()()()),e&2){let n=d(2);_(4),en("",n.user.videosCount," (",se(5,16,n.user.videoQuotaUsed,0),")"),_(3),$(n.user.videosCount),x(7),_(4),A(n.user.videoChannels.length||0),_(2),$(n.user.videoChannels.length),x(13),_(4),A(n.subscribersCount),_(2),$(n.subscribersCount),x(19),_(2),c("routerLink",mt(19,o_))("queryParams",w(20,r_,'reportee:"'+(n.user==null?null:n.user.account.displayName)+'"')),_(2),A(n.user.abusesCount),_(4),c("routerLink",mt(22,o_))("queryParams",w(23,r_,'reporter:"'+(n.user==null?null:n.user.account.displayName)+'" state:accepted')),_(2),en("",n.user.abusesAcceptedCount," / ",n.user.abusesCreatedCount),_(6),A(n.user.videoCommentsCount),_(2),$(n.user.videoCommentsCount),x(37);}}function F0(e,r){if(e&1&&p(0,v0,38,25,"div",64),e&2){let n=d();C(!n.isCreation()&&n.user?0:-1);}}function D0(e,r){if(e&1&&(l(0,"my-alert",33),g(1),o()),e&2){let n=d();_(),A(n.error);}}function b0(e,r){}function G0(e,r){e&1&&k(0,b0,0,0,"ng-template");}function L0(e,r){e&1&&(l(0,"h2"),s(1,15),o());}function y0(e,r){if(e&1&&(l(0,"h2",68),g(1),o(),m(2,"my-actor-avatar-edit",69)),e&2){let n=d();_(),D("EDIT USER ",n.user.username),_(),c("displayName",n.user.account.displayName)("avatars",n.user.account.avatars)("username",n.user.username);}}function $0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d(2);_(),D(" ",n.formErrors.username," ");}}function x0(e,r){if(e&1&&(l(0,"div",44)(1,"label",70),s(2,16),o(),m(3,"input",71),p(4,$0,2,1,"div",47),o()),e&2){let n=d();_(3),c("ngClass",w(2,So,n.formErrors.username)),_(),C(n.formErrors.username?4:-1);}}function w0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d(2);_(),D(" ",n.formErrors.channelName," ");}}function U0(e,r){if(e&1&&(l(0,"div",44)(1,"label",72),s(2,17),o(),m(3,"input",73),p(4,w0,2,1,"div",47),o()),e&2){let n=d();_(3),c("ngClass",w(2,So,n.formErrors.channelName)),_(),C(n.formErrors.channelName?4:-1);}}function V0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.email," ");}}function k0(e,r){e&1&&(l(0,"div",75),s(1,19),o());}function z0(e,r){if(e&1&&(l(0,"div",44)(1,"label",74),s(2,18),o(),p(3,k0,2,0,"div",75),m(4,"my-input-text",76),o()),e&2){let n=d();_(3),C(n.isPasswordOptional()?3:-1),_(),c("formError",n.formErrors.password);}}function X0(e,r){if(e&1&&(l(0,"option",51),g(1),o()),e&2){let n=r.$implicit;c("value",n.value),_(),D(" ",n.label," ");}}function B0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.role," ");}}function W0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.videoQuota," ");}}function H0(e,r){if(e&1&&(l(0,"div",47),g(1),o()),e&2){let n=d();_(),D(" ",n.formErrors.videoQuotaDaily," ");}}function j0(e,r){if(e&1&&(l(0,"option",51),g(1),o()),e&2){let n=r.$implicit;c("value",n),_(),A(n);}}function Q0(e,r){if(e&1&&(l(0,"div",44)(1,"label",77),s(2,20),o(),l(3,"div",49)(4,"select",78)(5,"option",51),s(6,21),o(),Ce(7,j0,2,2,"option",51,Ie),o()()()),e&2){let n=d();_(5),c("value",null),_(2),Ee(n.getAuthPlugins());}}function q0(e,r){}function K0(e,r){e&1&&k(0,q0,0,0,"ng-template");}function J0(e,r){if(e&1&&(l(0,"div",61)(1,"div",39),m(2,"div",79),l(3,"h2"),s(4,22),o()(),l(5,"div",41),m(6,"my-account-token-sessions",80),o()()),e&2){let n=d();_(6),c("user",n.user);}}function Y0(e,r){if(e&1){let n=Q();l(0,"div",44)(1,"div",83),s(2,27),o(),l(3,"button",84),P("click",function(){L(n);let a=d(2);return y(a.disableTwoFactorAuth());}),s(4,28),o()();}}function Z0(e,r){if(e&1){let n=Q();l(0,"div",61)(1,"div",39),m(2,"div",81),l(3,"h2",82),s(4,23),o()(),l(5,"div",41)(6,"div",44)(7,"div",83),s(8,24),o(),l(9,"button",84),P("click",function(){L(n);let a=d();return y(a.resetPassword());}),s(10,25),o()(),l(11,"div",44)(12,"div",83),s(13,26),o(),m(14,"my-user-password",85),o(),p(15,Y0,5,0,"div",44),o()();}if(e&2){let n=d();
34_(14),c("userId",n.user.id)("username",n.user.username),_(),C(n.user.twoFactorEnabled?15:-1);}}var a_=(()=>{let r=class r extends no{formReactiveService=E(Me);serverService=E(q);configService=E(Ue);screenService=E(xn);auth=E(At);route=E(xe);router=E(Mn);notifier=E(Z);userService=E(Fi);twoFactorService=E(qi);userAdminService=E($t);error;paramsSub;constructor(){super(),this.buildQuotaOptions();}ngOnInit(){super.ngOnInit();let t={role:ft.USER.toString(),videoQuota:"-1",videoQuotaDaily:"-1"};this.buildForm({email:Ui,role:ki,videoQuota:Vn,videoQuotaDaily:kn,byPassAutoBlock:null,pluginAuth:null},t),this.paramsSub=this.route.params.subscribe(a=>{let i=a.id;this.userService.getUser(i,!0).subscribe({next:u=>this.onUserFetched(u),error:u=>{this.error=u.message;}});});}ngOnDestroy(){this.paramsSub.unsubscribe();}formValidated(){this.error=void 0;let t=this.form.value;t.adminFlags=this.buildAdminFlags(this.form.value),t.videoQuota=parseInt(this.form.value.videoQuota,10),t.videoQuotaDaily=parseInt(this.form.value.videoQuotaDaily,10),t.pluginAuth==="null"&&(t.pluginAuth=null),this.userAdminService.updateUser(this.user.id,t).subscribe({next:()=>{this.notifier.success("User "+this.user.username+" updated."),this.router.navigate(["/admin/overview/users/list"]);},error:a=>{this.error=a.message;}});}isCreation(){return!1;}isPasswordOptional(){return!1;}getFormButtonTitle(){return"Update user";}resetPassword(){this.userService.askResetPassword(this.user.email).subscribe({next:()=>{this.notifier.success("An email asking for password reset has been sent to "+this.user.username+".");},error:t=>this.notifier.handleError(t)});}disableTwoFactorAuth(){this.twoFactorService.disableTwoFactor({userId:this.user.id}).subscribe({next:()=>{this.user.twoFactorEnabled=!1,this.notifier.success("Two factor authentication of "+this.user.username+" disabled.");},error:t=>this.notifier.handleError(t)});}onUserFetched(t){this.user=new na(t),this.form.patchValue({email:t.email,role:t.role.id.toString(),videoQuota:t.videoQuota,videoQuotaDaily:t.videoQuotaDaily,pluginAuth:t.pluginAuth,byPassAutoBlock:t.adminFlags&oi.BYPASS_VIDEO_AUTO_BLACKLIST});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-user-update"]],features:[Ct],decls:59,vars:28,consts:()=>{let t;t="[email protected]";let a;a="bytes";let i;i="bytes";let u;u="User bypasses video validation by moderators";let N;N="Users";let I;I="Email";let T;T="Role";let h;h="Video quota";let b;b="Daily video quota";let G;G=" Enable this checkbox if this user doesn't need to have its videos reviewed by moderators. ";let U;U="Create";let J;J="Edit";let V;V="{VAR_PLURAL, plural, =1 {Video} other {Videos}}",V=W(V,{VAR_PLURAL:"\uFFFD0\uFFFD"});let te;te="{VAR_PLURAL, plural, =1 {Channel} other {Channels}}",te=W(te,{VAR_PLURAL:"\uFFFD0\uFFFD"});let oe;oe="{VAR_PLURAL, plural, =1 {Subscriber} other {Subscribers}}",oe=W(oe,{VAR_PLURAL:"\uFFFD0\uFFFD"});let De;De="Incriminated in reports";let ve;ve="Authored reports accepted";let ce;ce="{VAR_PLURAL, plural, =1 {Comment} other {Comments}}",ce=W(ce,{VAR_PLURAL:"\uFFFD0\uFFFD"});let be;be="NEW USER";let Fe;Fe="john";let Ae;Ae="Username";let Ge;Ge="john_channel";let ie;ie="Channel name";let Ve;Ve="Password";let re;re=" If you leave the password empty, an email will be sent to the user. ";let Qe;Qe="Auth plugin";let ae;ae="None (local authentication)";let Ze;Ze="TOKEN SESSIONS";let et;et="DANGER ZONE";let tt;tt="Send a link to reset the password by email to the user";let nt;nt="Ask for new password";let it;it="Manually set the user password";let ot;ot="This user has two factor authentication enabled";let rt;return rt="Disable two factor authentication",[["dashboard",""],N,I,T,h,b,G,U,J,V,te,oe,De,ve,ce,be,Ae,ie,Ve,re,Qe,ae,Ze,et,tt,nt,it,ot,rt,["aria-label","breadcrumb"],[1,"pt-breadcrumb"],[1,"breadcrumb-item"],["routerLink","/admin/overview/users"],["type","danger"],[1,"pt-two-cols","d-xxl-none"],[1,"col-0","col-xl-3"],[1,"col-12","col-xl-9"],[4,"ngTemplateOutlet"],[1,"pt-two-cols","mt-4"],[1,"title-col"],["id","user",1,"anchor"],[1,"content-col"],[1,"row"],[1,"col",3,"ngSubmit","formGroup"],[1,"form-group"],["for","email"],["type","text","id","email","placeholder",t,"formControlName","email","autocomplete","off",1,"form-control",3,"ngClass","readonly"],["role","alert",1,"form-error"],["for","role"],[1,"peertube-select-container"],["id","role","formControlName","role",1,"form-control"],[3,"value"],["id","videoQuotaLabel","for","videoQuota"],["labelId","videoQuotaLabel","inputId","videoQuota","formControlName","videoQuota","inputSuffix",a,"inputType","number",3,"items","clearable"],[3,"videoQuota"],["id","videoQuotaDailyLabel","for","videoQuotaDaily"],["labelId","videoQuotaDailyLabel","inputId","videoQuotaDaily","formControlName","videoQuotaDaily","inputSuffix",i,"inputType","number",3,"items","clearable"],["inputName","byPassAutoBlock","formControlName","byPassAutoBlock","labelText",u],["ngProjectAs","de
34scription",5,["description"]],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],[1,"d-none","d-xxl-block","col-7"],[1,"pt-two-cols","mt-5"],["aria-current","page",1,"breadcrumb-item"],[3,"routerLink"],[1,"dashboard"],[1,"dashboard-num"],[1,"dashboard-label"],[3,"routerLink","queryParams"],[1,"visually-hidden"],["actorType","account","editable","false","displayUsername","false",3,"displayName","avatars","username"],["for","username"],["type","text","id","username","placeholder",Fe,"formControlName","username",1,"form-control",3,"ngClass"],["for","channelName"],["type","text","id","channelName","placeholder",Ge,"formControlName","channelName",1,"form-control",3,"ngClass"],["for","password"],[1,"form-group-description"],["formControlName","password","inputId","password","autocomplete","new-password",3,"formError"],["for","pluginAuth"],["id","pluginAuth","formControlName","pluginAuth",1,"form-control"],["id","token-sessions",1,"anchor"],[3,"user"],["id","danger",1,"anchor"],[1,"pt-title-danger"],[1,"mb-1","fw-bold"],[1,"peertube-button","danger-button",3,"click"],[3,"userId","username"]];},template:function(a,i){if(a&1&&(l(0,"nav",29)(1,"ol",30)(2,"li",31)(3,"a",32),s(4,1),o()(),p(5,P0,2,0,"li",31)(6,h0,4,1),o()(),k(7,F0,1,1,"ng-template",null,0,F),p(9,D0,2,1,"my-alert",33),l(10,"div",34),m(11,"div",35),l(12,"div",36),k(13,G0,1,0,null,37),o()(),l(14,"div",38)(15,"div",39),m(16,"div",40),p(17,L0,2,0,"h2")(18,y0,3,4),o(),l(19,"div",41)(20,"div",42)(21,"form",43),P("ngSubmit",function(){return i.formValidated();}),p(22,x0,5,4,"div",44),p(23,U0,5,4,"div",44),l(24,"div",44)(25,"label",45),s(26,2),o(),m(27,"input",46),p(28,V0,2,1,"div",47),o(),p(29,z0,5,2,"div",44),l(30,"div",44)(31,"label",48),s(32,3),o(),l(33,"div",49)(34,"select",50),Ce(35,X0,2,2,"option",51,Ie),o()(),p(37,B0,2,1,"div",47),o(),l(38,"div",44)(39,"label",52),s(40,4),o(),m(41,"my-select-custom-value",53)(42,"my-user-real-quota-info",54),p(43,W0,2,1,"div",47),o(),l(44,"div",44)(45,"label",55),s(46,5),o(),m(47,"my-select-custom-value",56),p(48,H0,2,1,"div",47),o(),p(49,Q0,9,1,"div",44),l(50,"div",44)(51,"my-peertube-checkbox",57),S(52,58),s(53,6),M(),o()(),m(54,"input",59),o(),l(55,"div",60),k(56,K0,1,0,null,37),o()()()(),p(57,J0,7,1,"div",61),p(58,Z0,16,3,"div",61)),a&2){let u=pe(8);_(5),C(i.isCreation()?5:6),_(4),C(i.error?9:-1),_(4),c("ngTemplateOutlet",u),_(4),C(i.isCreation()?17:i.user?18:-1),_(4),c("formGroup",i.form),_(),C(i.isCreation()?22:-1),_(),C(i.isCreation()?23:-1),_(4),c("ngClass",w(26,So,i.formErrors.email))("readonly",i.user&&i.user.pluginAuth!==null),_(),C(i.formErrors.email?28:-1),_(),C(i.isCreation()?29:-1),_(6),Ee(i.roles),_(2),C(i.formErrors.role?37:-1),_(4),c("items",i.videoQuotaOptions)("clearable",!1),_(),c("videoQuota",i.getUserVideoQuota()),_(),C(i.formErrors.videoQuota?43:-1),_(4),c("items",i.videoQuotaDailyOptions)("clearable",!1),_(),C(i.formErrors.videoQuotaDaily?48:-1),_(),C(!i.isCreation()&&i.getAuthPlugins().length!==0?49:-1),_(5),c("value",kt(i.getFormButtonTitle()))("disabled",!i.form.valid),_(2),c("ngTemplateOutlet",u),_(),C(i.displayTokenSessions()?57:-1),_(),C(i.displayPasswordZone()?58:-1);}},dependencies:[Pe,Nn,Ji,le,Se,Bt,Wt,Le,Xt,de,Ne,he,Re,ye,$e,ge,Gi,Dt,qn,Ke,io,Ki,st,pt],styles:[`input[_ngcontent-%COMP%]:not([type=submit]){font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[_ngcontent-%COMP%]:not([type=submit])::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[_ngcontent-%COMP%]:not([type=submit])[readonly]{color:var(--fg-300)}input[_ngcontent-%COMP%]:not([type=submit]):focus, input[_ngcontent-%COMP%]:not([type=submit]):focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[_ngcontent-%COMP%]:not([type=submit])[disabled]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[_ngcontent-%COMP%]:not([type=submit]){width:100%}}my-input-text[_ngcontent-%COMP%]{display:block;width:340px}@media screen and (max-width:370px){my-input-text[_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.dashboard[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;margin:0 -5px;max-width:900px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{box-sizing:border-box;flex:0 0 33.3333333333%;padding:0 5px;margin-bottom:10px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none;color:inherit;display:block;font-size:18px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:active{text-decoration:none}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:active, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{opacity:.8}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{padding:20px;background:var(--bg-secondary-400);border-radius:4px;box-sizing:border-box;height:100%}
34.dashboard[_ngcontent-%COMP%]   .dashboard-num[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%]   .dashboard-text[_ngcontent-%COMP%]{text-align:center;font-size:130%;color:var(--fg);line-height:30px;margin-bottom:20px}.dashboard[_ngcontent-%COMP%]   .dashboard-label[_ngcontent-%COMP%]{font-size:90%;color:var(--fg-300);text-align:center}
35/*# sourceMappingURL=user-edit.component-DAVJPQNX.css.map */`]}));let e=r;return e;})();var ep=["userBanModal"],tp=["table"],np=e=>[e],l_=()=>({blocked:!0}),ip=e=>({role:e});function op(e,r){if(e&1&&(S(0),s(1,7),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function rp(e,r){e&1&&(l(0,"a",16),m(1,"my-global-icon",17),S(2),s(3,8),M(),o());}function ap(e,r){e&1&&(l(0,"div",24),s(1,9),o());}function lp(e,r){e&1&&(l(0,"a",25),s(1,10),o()),e&2&&c("queryParams",mt(1,l_));}function _p(e,r){if(e&1&&(l(0,"td",18)(1,"a",20)(2,"div",21),m(3,"my-actor-avatar",22),l(4,"div")(5,"span"),g(6),o(),l(7,"span",23),g(8),o()()()(),p(9,ap,2,0,"div",24),p(10,lp,2,2,"a",25),o()),e&2){let n=d().$implicit;_(),c("routerLink",w(6,np,"/a/"+n.username)),_(2),c("actor",n==null?null:n.account),_(3),A(n.account.displayName),_(2),A(n.username),_(),C(n.accountMutedStatus.mutedByInstance?9:-1),_(),C(n.blocked?10:-1);}}function sp(e,r){if(e&1&&(l(0,"a",26),g(1),o()),e&2){let n=d(2).$implicit;c("queryParams",mt(2,l_)),_(),A(n.role.label);}}function dp(e,r){if(e&1&&(l(0,"a",27),g(1),o()),e&2){let n=d(2).$implicit,t=d();c("queryParams",w(4,ip,n.role.id))("title",t.getRoleFilterTitle(n.role.label))("ngClass",t.getRoleClass(n.role.id)),_(),A(n.role.label);}}function cp(e,r){if(e&1&&(l(0,"td"),p(1,sp,2,3,"a",26)(2,dp,2,6,"a",27),o()),e&2){let n=d().$implicit;_(),C(n.blocked?1:2);}}function mp(e,r){if(e&1&&(l(0,"td"),m(1,"my-user-email-info",28),o()),e&2){let n=d().$implicit;_(),c("entry",n);}}function up(e,r){if(e&1&&(l(0,"td"),m(1,"my-progress-bar",29),o()),e&2){let n=d().$implicit;_(),c("max",n.rawVideoQuota)("value",n.rawVideoQuotaUsed)("valueFormatted",n.videoQuotaUsed)("maxFormatted",n.videoQuota);}}function pp(e,r){if(e&1&&(l(0,"td"),m(1,"my-progress-bar",30),o()),e&2){let n=d().$implicit;_(),c("max",n.rawVideoQuotaDaily)("value",n.rawVideoQuotaUsedDaily)("valueFormatted",n.videoQuotaUsedDaily)("maxFormatted",n.videoQuotaDaily);}}function Cp(e,r){if(e&1&&(l(0,"td"),g(1),K(2,"bytes"),o()),e&2){let n=d().$implicit;_(),D(" ",ze(2,1,n.totalVideoFileSize)," ");}}function Ep(e,r){e&1&&(l(0,"span",31),s(1,11),o());}function gp(e,r){if(e&1&&(l(0,"td"),p(1,Ep,2,0,"span",31),o()),e&2){let n=d().$implicit;_(),C(n.twoFactorEnabled?1:-1);}}function Np(e,r){if(e&1&&(l(0,"span",32),g(1),o()),e&2){let n=d(2).$implicit;c("ngbTooltip",n.pluginAuth),_(),A(n.pluginAuth.replace("peertube-plugin-",""));}}function Sp(e,r){if(e&1&&(l(0,"td"),p(1,Np,2,2,"span",32),o()),e&2){let n=d().$implicit;_(),C(n.pluginAuth?1:-1);}}function Mp(e,r){if(e&1&&(l(0,"td",19),g(1),K(2,"ptDate"),o()),e&2){let n=d().$implicit;c("title",n.createdAt),_(),A(se(2,2,n.createdAt,"short"));}}function fp(e,r){if(e&1&&(g(0),K(1,"ptDate")),e&2){let n=d(2).$implicit;D(" ",se(1,1,n.lastLoginDate,"short")," ");}}function Ap(e,r){e&1&&(l(0,"span"),s(1,12),o());}function Ip(e,r){if(e&1&&(l(0,"td",19),p(1,fp,2,4)(2,Ap,2,0,"span"),o()),e&2){let n=d().$implicit;c("title",n.lastLoginDate),_(),C(n.lastLoginDate?1:2);}}function Op(e,r){if(e&1&&(p(0,_p,11,8,"td",18),p(1,cp,3,1,"td"),p(2,mp,2,1,"td"),p(3,up,2,4,"td"),p(4,pp,2,4,"td"),p(5,Cp,3,3,"td"),p(6,gp,2,1,"td"),p(7,Sp,2,1,"td"),p(8,Mp,3,5,"td",19),p(9,Ip,3,2,"td",19)),e&2){d();let n=pe(1);C(n.isColumnDisplayed("username")?0:-1),_(),C(n.isColumnDisplayed("role")?1:-1),_(),C(n.isColumnDisplayed("email")?2:-1),_(),C(n.isColumnDisplayed("videoQuotaUsed")?3:-1),_(),C(n.isColumnDisplayed("videoQuotaDailyUsed")?4:-1),_(),C(n.isColumnDisplayed("totalVideoFileSize")?5:-1),_(),C(n.isColumnDisplayed("twoFactorEnabled")?6:-1),_(),C(n.isColumnDisplayed("pluginAuth")?7:-1),_(),C(n.isColumnDisplayed("createdAt")?8:-1),_(),C(n.isColumnDisplayed("lastLoginDate")?9:-1);}}function Tp(e,r){if(e&1){let n=Q();l(0,"my-user-moderation-dropdown",33),P("userChanged",function(){L(n);let a=d();return y(a.onUserChanged());})("userDeleted",function(){L(n);let a=d();return y(a.onUserChanged());}),o();}if(e&2){let n=r.$implicit,t=d();c("user",n)("account",n.accountMutedStatus)("displayOptions",t.userModerationDisplayOptions);}}function Pp(e,r){if(e&1&&(l(0,"span",34),s(1,13),o(),g(2)),e&2){let n=r.$implicit;_(2),D(" ",n.blockedReason," ");}}var __=(()=>{let r=class r{notifier=E(Z);confirmService=E(we);auth=E(At);blocklist=E(Pn);userAdminService=E($t);hooks=E(vi);pluginService=E(In);userService=E(Fi);userBanModal=me("userBanModal");table=me("table");bulkActions=[];inputFilters=[{type:"options",key:"blocked",title:"Ban status",options:[{value:"all",label:"All"},{value:!0,label:"Banned"},{value:!1,label:"Not banned"}]},{type:"options",key:"role",title:"Role",options:[{value:"all",label:"All"},{value:ft.ADMINISTRATOR,label:"Administrator"},{value:ft.MODERATOR,label:"Moderator"},{value:ft.USER,label:"User"}]}];userModerationDisplayOptions={instanceAccount:!0,instanceUser:!0,myAccount:!1};columns=[{id:"username",label:"Username",sortable:!0},{id:"role",label:"Role",sortable:!0},{id:"email",label:"Email",sortable:!1},{id:"videoQuotaUsed",label:"Video quota",sortable:!0},{id:"videoQuotaDailyUsed",label:"Daily quota",sortable:!1},{id:"totalVideoFileSize",label:"Total size",sortable:!1},{id:"twoFactorEnabled",label:"2FA",sortable:!1},{id:"pluginAuth",label:"Auth plugin",sortable:!1},{id:"createdAt",label:"Created",sortable:!0},{id:"lastLoginDate",label:"Last login",sortable:!0}];dataLoader;hasExpandedRow;constructor(){this.dataLoader=this._dataLoader.bind(this),this.hasExpandedRow=this._hasExpandedRow.bind(this);}get authUser(){return this.auth.getUser();}ngOnInit(){return _e(this,null,function*(){this.pluginService.addAction("admin-users-l
35ist:load-data",()=>this.table().loadData());let t=[[{label:"Delete",description:"Videos will be deleted, comments will be tombstoned.",handler:a=>this.removeUsers(a),isDisplayed:a=>a.every(i=>this.authUser.canManageUser(i))},{label:"Ban",description:"User won't be able to login anymore, but videos and comments will be kept as is.",handler:a=>this.openBanUserModal(a),isDisplayed:a=>a.every(i=>this.authUser.canManageUser(i)&&i.blocked===!1)},{label:"Unban",handler:a=>this.unbanUsers(a),isDisplayed:a=>a.every(i=>this.authUser.canManageUser(i)&&i.blocked===!0)}],[{label:"Set email as verified",handler:a=>this.setEmailsAsVerified(a),isDisplayed:a=>a.every(i=>this.authUser.canManageUser(i)&&!i.blocked&&i.emailVerified!==!0)},{label:"Re-send verification emails",handler:a=>this.resendVerificationEmails(a),isDisplayed:a=>a.every(i=>this.authUser.canManageUser(i)&&!i.blocked&&i.emailVerified!==!0&&!i.pluginAuth)}]];this.bulkActions=yield this.hooks.wrapObject(t,"admin-users","filter:admin-users-list.bulk-actions.create.result");});}ngOnDestroy(){this.pluginService.removeAction("admin-users-list:load-data");}getRoleClass(t){switch(t){case ft.ADMINISTRATOR:return"badge-purple";case ft.MODERATOR:return"badge-blue";default:return"badge-yellow";}}openBanUserModal(t){for(let a of t)if(a.username==="root"){this.notifier.error("You cannot ban root.");return;}this.userBanModal().openModal(t);}onUserChanged(){this.table().loadData();}unbanUsers(t){return _e(this,null,function*(){(yield this.confirmService.confirm(ee("Do you really want to unban {count, plural, =1 {1 user} other {{count} users}}?",{count:t.length}),"Unban"))!==!1&&this.userAdminService.unbanUsers(t).subscribe({next:()=>{this.notifier.success(ee("{count, plural, =1 {1 user unbanned.} other {{count} users unbanned.}}",{count:t.length})),this.table().loadData();},error:i=>this.notifier.handleError(i)});});}removeUsers(t){return _e(this,null,function*(){if(t.some(u=>u.username==="root")){this.notifier.error("You cannot delete root.");return;}let a="<p>You can't create users or channels with a username that already used by a deleted user/channel.</p>"+"It means the following usernames will be permanently deleted and cannot be recovered:"+"<ul>"+t.map(u=>"<li>"+u.username+"</li>").join("")+"</ul>";(yield this.confirmService.confirm(a,"Delete"))!==!1&&this.userAdminService.removeUsers(t).subscribe({next:()=>{this.notifier.success(ee("{count, plural, =1 {1 user deleted.} other {{count} users deleted.}}",{count:t.length})),this.table().loadData();},error:u=>this.notifier.handleError(u)});});}setEmailsAsVerified(t){this.userAdminService.updateUsers(t,{emailVerified:!0}).subscribe({next:()=>{this.notifier.success(ee("{count, plural, =1 {1 user email set as verified.} other {{count} user emails set as verified.}}",{count:t.length})),this.table().loadData();},error:a=>this.notifier.handleError(a)});}resendVerificationEmails(t){this.userService.askSendVerifyEmail(t.map(a=>a.email)).subscribe({next:()=>{this.notifier.success(ee("{count, plural, =1 {1 verification email sent.} other {{count} verification emails sent.}}",{count:t.length}));},error:a=>this.notifier.handleError(a)});}getRoleFilterTitle(t){return"Filter by role: "+t+"";}_dataLoader(t){return this.userAdminService.listUsers(t).pipe(We(a=>this.blocklist.getStatus({accounts:a.data.map(i=>i.username+"@"+uo())}).pipe(lt(i=>({result:a,blockStatus:i})))),lt(({result:a,blockStatus:i})=>({total:a.total,data:a.data.map(u=>Be(fe({},u),{accountMutedStatus:Be(fe({},u.account),{nameWithHost:ta.CREATE_BY_STRING(u.account.name,u.account.host),mutedByInstance:i.accounts[u.username+"@"+uo()].blockedByServer,mutedByUser:!1,mutedServerByInstance:!1,mutedServerByUser:!1})}))})));}_hasExpandedRow(t){return!!t.blockedReason;}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-user-list"]],viewQuery:function(a,i){a&1&&Oe(i.userBanModal,ep,5)(i.table,tp,5),a&2&&Te(2);},decls:14,vars:5,consts:()=>{let t;t="users per page";let a;a="{VAR_PLURAL, plural, =0 {No users} =1 {1 user} other {{INTERPOLATION} users}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Create user";let u;u="Open account in a new tab";let N;N="Filter by banned users";let I;I="Muted";let T;T="Banned";let h;h="Filter by banned users";let b;b="Total video quota";let G;G="Total daily video quota";let U;U="Two factor authentication is enabled";let J;J="2FA";let V;V="never";let te;return te="Ban reason:",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["expandedRow",""],["userBanModal",""],a,i,I,T,J,V,te,["key","UserListComponent","defaultSort","createdAt","paginatorText",t,"defaultRowsPerPage","10","columnConfig","true","searchInput","true",3,"defaultColumns","bulkActions","dataLoader","hasExpandedRow","inputFilters"],[3,"userBanned"],["routerLink","/admin/overview/users/create",1,"peertube-create-button"],["
35iconName","user-add","aria-hidden","true"],[1,"cell-username"],[3,"title"],["title",u,"target","_blank","rel","noopener noreferrer",3,"routerLink"],[1,"chip","two-lines"],["actorType","account","size","32",3,"actor"],[1,"muted"],[1,"pt-badge","badge-red"],["routerLink",".","title",N,1,"pt-badge","badge-red",3,"queryParams"],["routerLink",".","title",h,1,"pt-badge","badge-banned",3,"queryParams"],["routerLink",".",1,"pt-badge",3,"queryParams","title","ngClass"],["showEmailVerifyInformation","true",3,"entry"],["label",b,"size","small",3,"max","value","valueFormatted","maxFormatted"],["label",G,"size","small",3,"max","value","valueFormatted","maxFormatted"],["ngbTooltip",U,1,"pt-badge","badge-green"],[3,"ngbTooltip"],["container","body",3,"userChanged","userDeleted","user","account","displayOptions"],[1,"ban-reason-label"]];},template:function(a,i){a&1&&(l(0,"my-table",14,0),k(2,op,3,4,"ng-template",null,1,F)(4,rp,4,0,"ng-template",null,2,F)(6,Op,10,10,"ng-template",null,3,F)(8,Tp,1,3,"ng-template",null,4,F)(10,Pp,3,1,"ng-template",null,5,F),o(),l(12,"my-user-ban-modal",15,6),P("userBanned",function(){return i.onUserChanged();}),o()),a&2&&c("defaultColumns",i.columns)("bulkActions",i.bulkActions)("dataLoader",i.dataLoader)("hasExpandedRow",i.hasExpandedRow)("inputFilters",i.inputFilters);},dependencies:[qe,$e,ge,Pe,le,Ti,sl,ca,Zi,_l,ll,je,Je,pt,He],styles:[`.banned-info[_ngcontent-%COMP%]{font-style:italic}.ban-reason-label[_ngcontent-%COMP%]{font-weight:600}.cell-username[_ngcontent-%COMP%]   .pt-badge[_ngcontent-%COMP%]{margin-inline-start:.9375rem}my-progress-bar[_ngcontent-%COMP%]{display:block;min-width:120px}
36/*# sourceMappingURL=user-list.component-M7G7BWSD.css.map */`]}));let e=r;return e;})();var oo=(()=>{let r=class r{videoService=E(nn);authHttp=E(Rt);restExtractor=E(vt);restService=E(Ht);listAdminVideos(t){let G=t,{pagination:a,search:i,excludeMuted:u,excludePublic:N}=G,I=Ei(G,["pagination","search","excludeMuted","excludePublic"]),T=new Pt();T=this.videoService.buildVideoListParams(fe({params:T},I));let h=An.BLACKLISTED|An.BLOCKED_OWNER|An.NOT_PUBLISHED_STATE|An.FILES|An.SOURCE|An.AUTOMATIC_TAGS,b=Zr();return u&&(h&=~An.BLOCKED_OWNER),N&&(b=[ri.PRIVATE,ri.UNLISTED,ri.INTERNAL,ri.PASSWORD_PROTECTED]),T=this.restService.addObjectParams(T,{include:h,privacyOneOf:b,search:i,start:a.start,count:a.count}),this.authHttp.get(nn.BASE_VIDEO_URL,{params:T}).pipe(We(U=>this.videoService.extractVideos(U)),ke(U=>this.restExtractor.handleError(U)));}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275prov",Tt({token:r,factory:r.ɵfac}));let e=r;return e;})();var Rp=["videoBlockModal"],hp=["table"],vp=()=>["."],Fp=e=>({autoTagOneOf:e});function Dp(e,r){if(e&1&&(S(0),s(1,7),K(2,"myNumberFormatter"),M()),e&2){let n=r.$implicit;_(2),$(n)(ze(2,2,n)),x(1);}}function bp(e,r){e&1&&(l(0,"span",24),s(1,8),o());}function Gp(e,r){e&1&&(l(0,"span",25),s(1,9),o());}function Lp(e,r){if(e&1&&(l(0,"span"),g(1),o()),e&2){let n=d().$implicit,t=d();Lr(t.getVideoStateBadgeClass(n.state.id)),_(),A(n.state.label);}}function yp(e,r){e&1&&(l(0,"span",29),s(1,10),o());}function $p(e,r){if(e&1&&(l(0,"a",30),g(1),o()),e&2){let n=r.$implicit;c("routerLink",mt(3,vp))("queryParams",w(4,Fp,n)),_(),A(n);}}function xp(e,r){e&1&&(l(0,"span",24),s(1,11),o());}function wp(e,r){e&1&&(l(0,"span",24),s(1,12),o());}function Up(e,r){if(e&1&&(l(0,"span",24),s(1,13),o()),e&2){let n=d().$implicit;_(),$(n.files.length),x(1);}}function Vp(e,r){e&1&&(l(0,"span",24),s(1,14),o());}function kp(e,r){e&1&&(l(0,"span",25),s(1,15),o());}function zp(e,r){if(e&1&&(l(0,"span"),g(1),K(2,"bytes"),o()),e&2){let n=d().$implicit,t=d();_(),A(se(2,1,t.getFilesSize(n),1));}}function Xp(e,r){if(e&1&&(l(0,"td"),m(1,"my-video-cell",23),o(),l(2,"td")(3,"div"),p(4,bp,2,0,"span",24)(5,Gp,2,0,"span",25),m(6,"my-privacy-badge",26)(7,"my-video-nsfw-badge",27),p(8,Lp,2,3,"span",28),p(9,yp,2,0,"span",29),o(),l(10,"div"),Ce(11,$p,2,6,"a",30,Ie),o()(),l(13,"td"),p(14,xp,2,0,"span",24),p(15,wp,2,0,"span",24),p(16,Up,2,1,"span",24),p(17,Vp,2,0,"span",24),p(18,kp,2,0,"span",25),p(19,zp,3,4,"span"),o(),l(20,"td"),g(21),K(22,"ptDate"),o()),e&2){let n=r.$implicit,t=d();_(),c("video",n)("accountBlockBadges",t.accountBlocklist.get(n.account.id)),_(3),C(n.isLocal?4:5),_(2),c("video",n),_(),c("video",n),_(),C(t.isUnpublished(n)?8:-1),_(),C(t.isVideoBlocked(n)?9:-1),_(2),Ee(n.automaticTags),_(3),C(t.hasOriginalFile(n)?14:-1),_(),C(t.hasHLS(n)?15:-1),_(),C(t.hasWebVideos(n)?16:-1),_(),C(n.isLive?17:-1),_(),C(t.hasObjectStorage(n)?18:-1),_(),C(!t.isImport(n)&&!n.isLive&&n.isLocal?19:-1),_(2),D(" ",se(22,14,n.publishedAt,"short")," ");}}function Bp(e,r){if(e&1){let n=Q();l(0,"my-video-actions-dropdown",31),P("videoRemoved",function(){L(n),d();let a=pe(1);return y(a.loadData());})("videoFilesRemoved",function(){L(n),d();let a=pe(1);return y(a.loadData());})("transcodingCreated",function(){L(n),d();let a=pe(1);return y(a.loadData());})("muted",function(){L(n);let a=d();return y(a.loadBlockStatus());})("unmuted",function(){L(n);let a=d();return y(a.loadBlockStatus());}),o();}if(e&2){let n=r.$implicit,t=d();c("video",n)("displayOptions",t.videoActionsOptions)("muteStatus",t.accountBlocklist.get(n.account.id));}}function Wp(e,r){if(e&1){let n=Q();l(0,"div",33),S(1),s(2,16),M(),l(3,"ul")(4,"li")(5,"a",35),g(6),o(),g(7),K(8,"bytes"),l(9,"button",36),P("click",function(){L(n);let a=d().$implicit,i=d();return y(i.removeVideoSourceFile(a));}),m(10,"my-global-icon",37),o()()()();}if(e&2){let n=d().$implicit,t=d();_(5),c("href",t.getDownloadUrl(n,n.videoSource.fileDownloadUrl),at),_(),A(n.videoSource.inputFilename),_(
36),D(": ",se(8,3,n.videoSource.size,1)," ");}}function Hp(e,r){if(e&1){let n=Q();l(0,"button",40),P("click",function(){L(n);let a=d().$implicit,i=d(2).$implicit,u=d();return y(u.removeVideoFile(i,a,"web-videos"));}),m(1,"my-global-icon",37),o();}}function jp(e,r){if(e&1&&(l(0,"li")(1,"a",38),g(2),o(),g(3),K(4,"bytes"),p(5,Hp,2,0,"button",39),o()),e&2){let n=r.$implicit,t=d(2).$implicit,a=d();_(),c("href",a.getDownloadUrl(t,n.fileDownloadUrl),at),_(),A(n.resolution.label),_(),D(": ",se(4,4,n.size,1)," "),_(2),C(a.canRemoveOneFile(t)?5:-1);}}function Qp(e,r){if(e&1&&(l(0,"div",33),S(1),s(2,17),M(),l(3,"ul"),Ce(4,jp,6,7,"li",null,Ie),o()()),e&2){let n=d().$implicit;_(4),Ee(n.files);}}function qp(e,r){if(e&1){let n=Q();l(0,"button",43),P("click",function(){L(n);let a=d().$implicit,i=d(2).$implicit,u=d();return y(u.removeVideoFile(i,a,"hls"));}),m(1,"my-global-icon",37),o();}}function Kp(e,r){if(e&1&&(l(0,"li")(1,"a",41),g(2),o(),g(3),K(4,"bytes"),p(5,qp,2,0,"button",42),o()),e&2){let n=r.$implicit,t=d(2).$implicit,a=d();_(),c("href",a.getDownloadUrl(t,n.fileDownloadUrl),at),_(),A(n.resolution.label),_(),D(": ",se(4,4,n.size,1)," "),_(2),C(a.canRemoveOneFile(t)?5:-1);}}function Jp(e,r){if(e&1&&(l(0,"div"),S(1),s(2,18),M(),l(3,"ul"),Ce(4,Kp,6,7,"li",null,Ie),o()()),e&2){let n=d().$implicit;_(4),Ee(n.streamingPlaylists[0].files);}}function Yp(e,r){if(e&1&&(l(0,"div",32),p(1,Wp,11,6,"div",33),p(2,Qp,6,0,"div",33),p(3,Jp,6,0,"div"),m(4,"my-embed",34),o()),e&2){let n=r.$implicit,t=d();_(),C(t.hasOriginalFile(n)?1:-1),_(),C(t.hasWebVideos(n)?2:-1),_(),C(t.hasHLS(n)?3:-1),_(),c("video",n);}}function Zp(e,r){e&1&&(S(0),s(1,19),M());}function e1(e,r){e&1&&(S(0),s(1,20),M());}function t1(e,r){if(e&1&&p(0,Zp,2,0,"ng-container")(1,e1,2,0,"ng-container"),e&2){let n=r.search,t=r.hasFilters;C(n||t?0:1);}}var s_=(()=>{let r=class r{confirmService=E(we);auth=E(At);notifier=E(Z);videoService=E(nn);videoAdminService=E(oo);videoBlockService=E(Bn);videoCaptionService=E(Ua);server=E(q);videoFileTokenService=E(za);blocklistService=E(Pn);videoBlockModal=me("videoBlockModal");table=me("table");bulkActions=[];defaultInputFilterValues={};inputFilters=[];videoActionsOptions={playlist:!1,download:!1,update:!0,blacklist:!0,delete:!0,report:!1,duplicate:!0,muteByUser:!1,muteByServer:!0,liveInfo:!1,removeFiles:!0,transcoding:!0,generateTranscription:!0};columns=[{id:"video",label:"Video",sortable:!1},{id:"info",label:"Info",sortable:!1},{id:"localVideoFilesSize",label:"Files",sortable:!0},{id:"publishedAt",label:"Published",sortable:!0}];accountBlocklist=new Map();videoFileTokens={};dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}get authUser(){return this.auth.getUser();}get serverConfig(){return this.server.getHTMLConfig();}ngOnInit(){this.defaultInputFilterValues={isLocal:!0},this.inputFilters=[{type:"options",key:"isLocal",title:"Videos scope",options:[{value:"all",label:"All"},{value:!1,label:"Remote videos"},{value:!0,label:"Local videos"}]},{type:"options",key:"nsfw",title:"Sensitive videos",options:[{value:"all",label:"All"},{value:"true",label:"Sensitive"},{value:"false",label:"Non sensitive"}]},{type:"title",title:"Moderation"},{type:"checkbox",key:"excludeMuted",label:"Exclude muted accounts"},{type:"checkbox",key:"excludePublic",label:"Exclude public videos"},{type:"options",key:"isLive",title:"Video type",options:[{value:"all",label:"All"},{value:!1,label:"VOD"},{value:!0,label:"Live"}]},{type:"select",key:"state",title:"Video state",clearable:!0,filter:!0,items:dl().map(t=>({id:t+"",label:cl(t).toLocaleUpperCase(),classes:["pt-badge",po(t)]}))},{type:"options",key:"hasWebVideoFiles",title:"Web files (local only)",options:[{value:"all",label:"All"},{value:!0,label:"With Web Videos files"},{value:!1,label:"Without Web Videos files"}]},{type:"options",key:"hasHLSFiles",title:"HLS files (local only)",options:[{value:"all",label:"All"},{value:!0,label:"With HLS files"},{value:!1,label:"Without HLS files"}]},{type:"tags",key:"autoTagOneOf",title:"Auto tags"}],this.bulkActions=[[{label:"Delete",handler:t=>this.removeVideos(t),isDisplayed:()=>this.authUser.hasRight(Y.REMOVE_ANY_VIDEO),iconName:"delete"},{label:"Block",handler:t=>this.videoBlockModal().show(t),isDisplayed:t=>this.authUser.hasRight(Y.MANAGE_VIDEO_BLACKLIST)&&t.every(a=>!a.blacklisted),iconName:"no"},{label:"Unblock",handler:t=>this.unblockVideos(t),isDisplayed:t=>this.authUser.hasRight(Y.MANAGE_VIDEO_BLACKLIST)&&t.every(a=>a.blacklisted),iconName:"undo"}],[{label:"Run HLS transcoding",handler:t=>this.runTranscoding(t,"hls"),isDisplayed:t=>t.every(a=>
36a.canRunTranscoding(this.authUser)),iconName:"cog"},{label:"Run Web Video transcoding",handler:t=>this.runTranscoding(t,"web-video"),isDisplayed:t=>t.every(a=>a.canRunTranscoding(this.authUser)),iconName:"cog"},{label:"Delete HLS files",handler:t=>this.removeVideoFiles(t,"hls"),isDisplayed:t=>t.every(a=>a.canRemoveAllHLSOrWebFiles(this.authUser)),iconName:"delete"},{label:"Delete Web Video files",handler:t=>this.removeVideoFiles(t,"web-videos"),isDisplayed:t=>t.every(a=>a.canRemoveAllHLSOrWebFiles(this.authUser)),iconName:"delete"}],[{label:"Generate caption",handler:t=>this.generateCaption(t),isDisplayed:t=>t.every(a=>a.canGenerateTranscription(this.authUser,this.serverConfig.videoTranscription.enabled)),iconName:"video-lang"}]];}isUnpublished(t){return t.state.id!==ai.LIVE_ENDED&&t.state.id!==ai.PUBLISHED;}isVideoBlocked(t){return t.blacklisted;}isImport(t){let a=t.state.id;return a===ai.TO_IMPORT||a===ai.TO_IMPORT_FAILED;}hasOriginalFile(t){return!!t.videoSource?.fileDownloadUrl;}hasHLS(t){let a=t.streamingPlaylists.find(i=>i.type===jr.HLS);return a?a.files.length!==0:!1;}hasWebVideos(t){return t.files.length!==0;}hasObjectStorage(t){return t.isLocal?co(t).some(i=>i.storage===Br.OBJECT_STORAGE):!1;}canRemoveOneFile(t){return t.canRemoveOneFile(this.authUser);}getFilesSize(t){let a=co(t).reduce((i,u)=>i+=u.size,0);return t.videoSource?.fileDownloadUrl&&(a+=t.videoSource.size||0),a;}getVideoStateBadgeClass(t){return"pt-badge "+po(t);}removeVideoFile(t,a,i){return _e(this,null,function*(){let u="Are you sure you want to delete this "+a.resolution.label+" file?";(yield this.confirmService.confirm(u,"Delete file"))!==!1&&this.videoService.removeFile(t.uuid,a.id,i).subscribe({next:()=>{this.notifier.success("File removed."),this.table().loadData();},error:I=>this.notifier.handleError(I)});});}removeVideoSourceFile(t){return _e(this,null,function*(){let a="Are you sure you want to delete the original file of this video?";(yield this.confirmService.confirm(a,"Delete original file"))!==!1&&this.videoService.removeSourceFile(t.uuid).subscribe({next:()=>{this.notifier.success("Original file removed."),this.table().loadData();},error:u=>this.notifier.handleError(u)});});}onRowExpand(t){let a=t.data;!a.videoSource?.inputFilename&&!aa(a)||this.videoFileTokenService.getVideoFileToken({videoUUID:a.uuid}).subscribe(({token:i})=>{this.videoFileTokens[a.id]=i;});}getDownloadUrl(t,a){let i=this.videoFileTokens[t.id];return i?a+`?videoFileToken=${i}`:a;}onDataLoaded(){this.loadBlockStatus();}loadBlockStatus(){let t=this.table().data,a=this.getUniqueAccounts(t),i=this.getUniqueHosts(t);this.blocklistService.getStatus({accounts:a.map(u=>u.name+"@"+u.host),hosts:i}).subscribe(u=>{this.accountBlocklist=new Map();for(let N of a){let I=N.name+"@"+N.host;this.accountBlocklist.set(N.id,{mutedByInstance:u.accounts[I].blockedByServer,mutedServerByInstance:u.hosts[N.host].blockedByServer});}});}getUniqueAccounts(t){let a=new Set();return t.map(i=>!i.account||a.has(i.account.id)?null:(a.add(i.account.id),i.account)).filter(i=>!!i);}getUniqueHosts(t){return Array.from(new Set(t.map(a=>a.account.host)));}_dataLoader(t){return this.videoAdminService.listAdminVideos(fe({nsfwFlagsExcluded:Hr.NONE,nsfw:"both",stateOneOf:t.state?[t.state]:void 0},t));}removeVideos(t){return _e(this,null,function*(){let a=ee("Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?",{count:t.length});(yield this.confirmService.confirm(a,"Delete"))!==!1&&this.videoService.removeVideo(t.map(u=>u.id)).subscribe({next:()=>{this.notifier.success(ee("Deleted {count, plural, =1 {1 video} other {{count} videos}}.",{count:t.length})),this.table().loadData();},error:u=>this.notifier.handleError(u)});});}unblockVideos(t){this.videoBlockService.unblockVideos(t.map(a=>a.id)).subscribe({next:()=>{this.notifier.success(ee("Unblocked {count, plural, =1 {1 video} other {{count} videos}}.",{count:t.length})),this.table().loadData();},error:a=>this.notifier.handleError(a)});}removeVideoFiles(t,a){return _e(this,null,function*(){let i;a==="hls"?i=ee("Are you sure you want to delete {count, plural, =1 {1 HLS streaming playlist} other {{count} HLS streaming playlists}}?",{count:t.length}):i=ee("Are you sure you want to delete Web Video files of {count, plural, =1 {1 video} other {{count} videos}}?",{count:t.length}),(yield this.confirmService.confirm(i,"Delete"))!==!1&&this.videoService.removeVideoFiles(t.map(N=>N.id),a).subscribe({next:()=>{this.notifier.success("Files were removed."),this.table().loadD
36ata();},error:N=>this.notifier.handleError(N)});});}runTranscoding(t,a){this.videoService.runTranscoding({videos:t,type:a}).subscribe({next:()=>{this.notifier.success("Transcoding jobs created."),this.table().loadData();},error:i=>this.notifier.handleError(i)});}generateCaption(t){this.videoCaptionService.generateCaption({videos:t}).subscribe({next:a=>{a.success&&this.notifier.success(ee("{count, plural, =1 {1 transcription job created.} other {{count} transcription jobs created.}}",{count:a.success})),a.alreadyHasCaptions&&this.notifier.info(ee("{count, plural, =1 {1 video already has captions.} other {{count} videos already have captions.}}",{count:a.alreadyHasCaptions})),a.alreadyBeingTranscribed&&this.notifier.info(ee("{count, plural, =1 {1 video is already being transcribed.} other {{count} videos are already being transcribed.}}",{count:a.alreadyBeingTranscribed}));},error:a=>this.notifier.handleError(a)});}};f(r,"\u0275fac",function(a){return new(a||r)();}),f(r,"\u0275cmp",R({type:r,selectors:[["my-video-list"]],viewQuery:function(a,i){a&1&&Oe(i.videoBlockModal,Rp,5)(i.table,hp,5),a&2&&Te(2);},decls:14,vars:5,consts:()=>{let t;t="videos per page";let a;a="{VAR_PLURAL, plural, =0 {No videos} =1 {1 video} other {{INTERPOLATION} videos}}",a=W(a,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Only display videos with this tag";let u;u="Local";let N;N="Remote";let I;I="Blocked";let T;T="Original file";let h;h="HLS";let b;b="Web Videos ("+"\uFFFD0\uFFFD"+")";let G;G="Live";let U;U="Object storage";let J;J="Download this file";let V;V="Delete this file";let te;te="Original file:";let oe;oe="Web Videos:";let De;De="Download this file";let ve;ve="Delete this file";let ce;ce="HLS:";let be;be="Download this file";let Fe;Fe="Delete this file";let Ae;Ae="No videos found matching current filters.";let Ge;return Ge="Your platform doesn't have videos.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],["videoBlockModal",""],a,u,N,I,T,h,b,G,U,te,oe,ce,Ae,Ge,["key","VideoAdminListComponent","defaultSort","publishedAt","paginatorText",t,"defaultRowsPerPage","10","columnConfig","false","refreshButton","true","searchInput","true",3,"rowExpand","dataLoaded","defaultColumns","bulkActions","dataLoader","inputFilters","defaultInputFilterValues"],[3,"videoBlocked"],["accountBlockBadgesPlatformOnly","true","size","small",3,"video","accountBlockBadges"],[1,"pt-badge","badge-blue"],[1,"pt-badge","badge-purple"],[3,"video"],["theme","red",3,"video"],[3,"class"],[1,"pt-badge","badge-red"],["title",i,"queryParamsHandling","merge",1,"pt-badge","badge-secondary","me-1",3,"routerLink","queryParams"],["placement","bottom auto","buttonIcon","more-horizontal","buttonStyled","true",3,"videoRemoved","videoFilesRemoved","transcodingCreated","muted","unmuted","video","displayOptions","muteStatus"],[1,"video-expanded-info"],[1,"me-3"],[1,"ms-auto",3,"video"],["title",J,3,"href"],["title",V,1,"border-0","p-0",3,"click"],["iconName","delete"],["title",De,3,"href"],["title",ve,1,"border-0","p-0"],["title",ve,1,"border-0","p-0",3,"click"],["title",be,3,"href"],["title",Fe,1,"border-0","p-0"],["title",Fe,1,"border-0","p-0",3,"click"]];},template:function(a,i){if(a&1){let u=Q();l(0,"my-table",21,0),P("rowExpand",function(I){return i.onRowExpand(I);})("dataLoaded",function(){return i.onDataLoaded();}),k(2,Dp,3,4,"ng-template",null,1,F)(4,Xp,23,17,"ng-template",null,2,F)(6,Bp,1,3,"ng-template",null,3,F)(8,Yp,5,4,"ng-template",null,4,F)(10,t1,2,1,"ng-template",null,5,F),o(),l(12,"my-video-block",22,6),P("videoBlocked",function(){L(u);let I=pe(1);return y(I.loadData());}),o();}a&2&&c("defaultColumns",i.columns)("bulkActions",i.bulkActions)("dataLoader",i.dataLoader)("inputFilters",i.inputFilters)("defaultInputFilterValues",i.defaultInputFilterValues);},dependencies:[qe,Xa,Wi,Bi,ka,Pe,Hi,ji,je,Je,pt,He],styles:[`my-embed[_ngcontent-%COMP%]{display:block;max-width:500px;width:50%}.pt-badge[_ngcontent-%COMP%], my-privacy-badge[_ngcontent-%COMP%], my-video-nsfw-badge[_ngcontent-%COMP%]{margin-inline-end:.3125rem}.video-expanded-info[_ngcontent-%COMP%]{display:flex}.video-expanded-info[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{position:relative;top:-2px;display:inline-block;width:16px;height:16px;line-height:16px;margin-inline-start:.1875rem}
37/*# sourceMappingURL=video-list.component-TVF7OBWU.css.map */`]}));let e=r;return e;})();function Mo({url:e}){return`/admin/overview/${e.map(r=>r.path).join("/")}`;}var fo=[{path:"comments",pathMatch:"prefix",redirectTo:Mo},{path:"videos",pathMatch:"prefix",redirectTo:Mo},{path:"users",pathMatch:"prefix",redirectTo:Mo},{path:"overview",children:[{path:"",pathMatch:"full",redirectTo:"users"},{path:"comments",canActivate:[Xe],data:{userRight:Y.SEE_ALL_COMMENTS},children:[{path:"",redirectTo:"list",pathMatch:"full"},{path:"list",component:e_,data:{meta:{title:"Comments list"}}}]},{path:"users",canActivate:[Xe],data:{userRight:Y.MANAGE_USERS},children:[{path:"",redirectTo:"list",pathMatch:"full"},{path:"list",component:__,data:{meta:{title:"Users list"}}},{path:"create",component:i_,data:{meta:{title:"Create a user"}}},{path:"update/:id",component:a_,data:{meta:{title:"Update a user"}}}]}
37,{path:"videos",canActivate:[Xe],data:{userRight:Y.SEE_ALL_VIDEOS},children:[{path:"",redirectTo:"list",pathMatch:"full"},{path:"list",component:s_,data:{meta:{title:"Videos list"}}}]}]}];var Ao={path:"",providers:[Pn,$t,il,vn,Wn,Hn,Jn,Rn,Yn,Zn,Qt,Yt,qi,$t,oo,Bn,Qn,Ue,Va,$a,wa,xa,Ya]};function d_(e){if(e.length===0)return!1;let r=e[0].path;return fo.some(n=>n.path===r||n.path.startsWith(`${r}/`));}function c_(e){if(e.length===0)return!1;let r=e[0].path;return Co.some(n=>n.path===r||n.path.startsWith(`${r}/`));}function ro({url:e}){return`/admin/settings/${e.map(r=>r.path).join("/")}`;}var d2=[{path:"",pathMatch:"full",redirectTo:"overview"},Be(fe({},Ao),{component:Bl,canMatch:[(e,r)=>c_(r)],children:Co}),Be(fe({},Ao),{component:Wl,canMatch:[(e,r)=>d_(r)],children:fo}),{path:"config",pathMatch:"prefix",redirectTo:ro},{path:"follows",pathMatch:"prefix",redirectTo:ro},{path:"system",pathMatch:"prefix",redirectTo:ro},{path:"plugins",pathMatch:"prefix",redirectTo:ro},Be(fe({},Ao),{path:"settings",component:Hl,canMatch:[(e,r)=>!d_(r)&&!c_(r)],children:[{path:"",redirectTo:"config",pathMatch:"full"},...Al,...Zl,...Xl,...yl]})];export{d2 as default};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-KSMKAP3L.js.map

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.