import{$ as Ehe,Eo as kb,Fo as l$,Gr as Va,Ht as Je,Is as rh,Lr as Uj,Oo as kj,Wa as g,Za as gx,_s as ph,ao as hn,ec as th,en as Kx,it as FB,ka as eIe,ta as bi,vc as wp}from"./chunk-B_pj7Jpm.js";import{F as ye,N as rn,_ as Zn,s as Jn,t as $n,u as Qn}from"./chunk-BPHMC4rz.js";import{t as Z}from"./chunk-TcpfKQW12.js";import{a as gn,l as vn,o as lr,r as bn,t as $t,u as yn}from"./chunk-DU192T682.js";var e=class t{myFormInputError=ph.required();hasError(){return this.myFormInputError().touched()&&this.myFormInputError().invalid()}static ɵfac=function(r){return new(r||t)};static ɵdir=hn({type:t,selectors:[[``,`myFormInputError`,``]],hostVars:2,hostBindings:function(r,s){r&2&&Kx(`input-error`,s.hasError())},inputs:{myFormInputError:[1,`myFormInputError`]}})};var q={VALIDATORS:[ye.required,ye.minLength(1),ye.maxLength(120)],MESSAGES:{required:"Necesas prezenta nomo.",minlength:"Prezenta nomo devas havi almenaŭ 1 signon.",maxlength:"Prezenta nomo ne povas havi pli ol 120 signojn."}};function M(e){bn(e,{message:"Necesas prezenta nomo."}),yn(e,1,{message:"Prezenta nomo devas havi almenaŭ 1 signon."}),gn(e,120,{message:"Prezenta nomo ne povas havi pli ol 120 signojn."})}var k={VALIDATORS:[ye.required],MESSAGES:{required:"Privateco estas postulata."}};var w={VALIDATORS:[ye.minLength(3),ye.maxLength(1e3)],MESSAGES:{minlength:"Priskribo havu almenaŭ 3 signojn.",maxlength:"Priskribo ne povas havi pli ol 1000 signojn."}};var G={VALIDATORS:[],MESSAGES:{required:"Tiu ĉi kanalo estas postulata kiam la ludlisto estas publika."}};function K(e,t){t.toString()===eIe.PUBLIC.toString()?e.setValidators([ye.required]):e.setValidators(null),e.markAsDirty(),e.updateValueAndValidity()}var R=class e$1{notifier=g(bi);videoPlaylistService=g(Z);playlistCreated=Ehe();playlistModel=Je({displayName:``});playlistForm=lr(this.playlistModel,t=>{M(t.displayName)});createPlaylist(){let i={displayName:this.playlistModel().displayName.trim(),privacy:eIe.PRIVATE};this.videoPlaylistService.createVideoPlaylist(i).subscribe({next:()=>{this.playlistCreated.emit()},error:r=>this.notifier.handleError(r)})}static ɵfac=function(i){return new(i||e$1)};static ɵcmp=Va({type:e$1,selectors:[[`my-playlist-create-block`]],outputs:{playlistCreated:`playlistCreated`},decls:7,vars:4,consts:()=>{let t;t="Krei";let i;return i="Prezenta nomo",[i,[3,`ngSubmit`],[1,`form-group`],[`for`,`displayName`],[`type`,`text`,`id`,`displayName`,1,`form-control`,3,`formField`,`myFormInputError`],[3,`field`],[`type`,`submit`,`value`,t,1,`peertube-button`,`primary-button`,3,`disabled`]]},template:function(i,r){i&1&&(wp(0,`form`,1),rh(`ngSubmit`,function(){return r.createPlaylist()}),wp(1,`div`,2)(2,`label`,3),l$(3,0),kb(),th(4,`input`,4),kj(),th(5,`my-form-error`,5),kb(),th(6,`input`,6),kb()),i&2&&(FB(4),gx(`formField`,r.playlistForm.displayName)(`myFormInputError`,r.playlistForm.displayName()),Uj(),FB(),gx(`field`,r.playlistForm.displayName()),FB(),gx(`disabled`,!r.playlistForm().valid()))},dependencies:[Jn,Zn,$n,rn,Qn,e,vn,$t],styles:[`my-global-icon[_ngcontent-%COMP%]{position:relative;left:-1px;top:-1px;width:21px;height:21px;line-height:21px;display:inline-block;color:var(--%NS%fg-400);margin-inline-end:.8125rem}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--%NS%input-y-padding) var(--%NS%input-x-padding);width:100%;max-width:100%;color:var(--%NS%input-fg);background-color:var(--%NS%input-bg);border:var(--%NS%input-border-width) solid var(--%NS%input-border-color);border-radius:var(--%NS%input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--%NS%input-placeholder-color);font-size:var(--%NS%input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--%NS%fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--%NS%fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--%NS%fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){input[type=text][_ngcontent-%COMP%]{width:100%}}`],changeDetection:1})};export{q as a,k as i,K as n,w as o,R as r,e as s,G as t};
//# debugId=e02b4eaa-d881-58ea-98e7-b92a51092ab2
//# sourceMappingURL=chunk-CavZcndn2.js.map