import{Z}from'./chunk-DmY7bGyL.js';import{K as qp,bK as sn,b_ as Ex,bR as ye,dK as aIe,g,a as rc,_ as _pe,aL as Ye,b as Pa,J as Jn,V as Zn,a0 as $n,cn as rn,Q as Qn,s as sp,e as Fp,v as vV,d as lb,f as Pp,m as zH,W as WB,a3 as H0,y as qH}from'./main-DEZ5cZzu.js';import{o as or,m as mn,f as fn,c as cn,g as gn,E as En}from'./chunk-I7o41Fka.js';var c=(()=>{class r{myFormInputError=qp.required();hasError(){return this.myFormInputError().touched()&&this.myFormInputError().invalid();}static ɵfac=function(t){return new(t||r)();};static ɵdir=sn({type:r,selectors:[["","myFormInputError",""]],hostVars:2,hostBindings:function(t,m){t&2&&Ex("input-error",m.hasError());},inputs:{myFormInputError:[1,"myFormInputError"]}});}return r;})();/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/var Y={VALIDATORS:[ye.required,ye.minLength(1),ye.maxLength(120)],MESSAGES:{required:"\u8BF7\u8F93\u5165\u663E\u793A\u540D\u79F0\u3002",minlength:"\u663E\u793A\u540D\u79F0\u5E94\u81F3\u5C11 1 \u4E2A\u5B57\u7B26\u3002",maxlength:"\u663E\u793A\u540D\u79F0\u4E0D\u80FD\u8D85\u8FC7 120 \u4E2A\u5B57\u7B26\u3002"}};function N(e){mn(e,{message:"\u8BF7\u8F93\u5165\u663E\u793A\u540D\u79F0\u3002"}),fn(e,1,{message:"\u663E\u793A\u540D\u79F0\u5E94\u81F3\u5C11 1 \u4E2A\u5B57\u7B26\u3002"}),cn(e,120,{message:"\u663E\u793A\u540D\u79F0\u4E0D\u80FD\u8D85\u8FC7 120 \u4E2A\u5B57\u7B26\u3002"});}var H={VALIDATORS:[ye.required],MESSAGES:{required:"\u8BF7\u9009\u62E9\u9690\u79C1\u8BBE\u7F6E\u3002"}},q={VALIDATORS:[ye.minLength(3),ye.maxLength(1e3)],MESSAGES:{minlength:"\u8BF4\u660E\u5E94\u81F3\u5C11 3 \u4E2A\u5B57\u7B26\u3002",maxlength:"\u8BF4\u660E\u4E0D\u80FD\u8D85\u8FC7 1000 \u4E2A\u5B57\u7B26\u3002"}},w={VALIDATORS:[],MESSAGES:{required:"\u516C\u5F00\u7684\u64AD\u653E\u5217\u8868\u5FC5\u987B\u6307\u5B9A\u9891\u9053\u3002"}};function G(e,V){V.toString()===aIe.PUBLIC.toString()?e.setValidators([ye.required]):e.setValidators(null),e.markAsDirty(),e.updateValueAndValidity();}var re=(()=>{class e{notifier=g(rc);videoPlaylistService=g(Z);playlistCreated=_pe();playlistModel=Ye({displayName:""});playlistForm=or(this.playlistModel,r=>{N(r.displayName);});createPlaylist(){let t={displayName:this.playlistModel().displayName.trim(),privacy:aIe.PRIVATE};this.videoPlaylistService.createVideoPlaylist(t).subscribe({next:()=>{this.playlistCreated.emit();},error:i=>this.notifier.handleError(i)});}static ɵfac=function(t){return new(t||e)();};static ɵcmp=Pa({type:e,selectors:[["my-playlist-create-block"]],outputs:{playlistCreated:"playlistCreated"},decls:7,vars:4,consts:()=>{let r;r="\u521B\u5EFA";let t;return t="\u663E\u793A\u540D\u79F0",[t,[3,"ngSubmit"],[1,"form-group"],["for","displayName"],["type","text","id","displayName",1,"form-control",3,"formField","myFormInputError"],[3,"field"],["type","submit","value",r,1,"peertube-button","primary-button",3,"disabled"]];},template:function(t,i){t&1&&(sp(0,"form",1),Fp("ngSubmit",function(){return i.createPlaylist();}),sp(1,"div",2)(2,"label",3),vV(3,0),lb(),Pp(4,"input",4),zH(),Pp(5,"my-form-error",5),lb(),Pp(6,"input",6),lb()),t&2&&(WB(4),H0("formField",i.playlistForm.displayName)("myFormInputError",i.playlistForm.displayName()),qH(),WB(),H0("field",i.playlistForm.displayName()),WB(),H0("disabled",!i.playlistForm().valid()));},dependencies:[Jn,Zn,$n,rn,Qn,c,gn,En],styles:["my-global-icon[_ngcontent-%COMP%]{position:relative;left:-1px;top:-1px;width:21px;height:21px;line-height:21px;display:inline-block;color:var(--fg-400);margin-inline-end:.8125rem}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;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{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){input[type=text][_ngcontent-%COMP%]{width:100%}}"],changeDetection:1});}return e;})();/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{G,H,Y,c,q,re as r,w};//# sourceMappingURL=chunk-DrcGS1J7.js.map