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:"Isem yettwaskanen yettusra.",minlength:"Isem yettwaskanen ilaq ad yesεu ma drus 1 usekkil.",maxlength:"Isem yettwaskanen ur ilaq ara ad iεeddi nnig 120 yisekkilen."}};function M(e){bn(e,{message:"Isem yettwaskanen yettusra."}),yn(e,1,{message:"Isem yettwaskanen ilaq ad yesεu ma drus 1 usekkil."}),gn(e,120,{message:"Isem yettwaskanen ur ilaq ara ad iεeddi nnig 120 yisekkilen."})}var k={VALIDATORS:[ye.required],MESSAGES:{required:"Tabaḍnit tettwasra."}};var w={VALIDATORS:[ye.minLength(3),ye.maxLength(1e3)],MESSAGES:{minlength:"Aglam ilaq ad ilin deg-s ma drus 3 yisekkilen.",maxlength:"Aglam ur ilaq ara ad iεeddi 1000 yisekkilen."}};var G={VALIDATORS:[],MESSAGES:{required:"Abadu yettusra mi ara tili tebdart n tɣuri d tazayezt."}};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="Snulfu-d";let i;return i="Isem n uskan",[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=b89e5ebf-aefd-5cba-b519-eda9b0654d30
//# sourceMappingURL=chunk-CavZcndn2.js.map