import{Z}from'./chunk-BvvoatGa.js';import{L as qp,bJ as sn,bZ as vx,bQ as ye,dK as sIe,g,a as rc,C as Cpe,aL as Ye,b as Pa,J as Jn,Z as Zn,a0 as $n,cm as rn,Q as Qn,s as sp,F as Fp,y as yV,u as ub,e as Pp,t as GH,z as zB,a3 as B0,W as WH}from'./main-WLWfNrEm.js';import{o as or,m as mn,f as fn,c as cn,g as gn,E as En}from'./chunk-CsfI8Z3C.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&&vx("input-error",m.hasError());},inputs:{myFormInputError:[1,"myFormInputError"]}});}return r;})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/var Y={VALIDATORS:[ye.required,ye.minLength(1),ye.maxLength(120)],MESSAGES:{required:"\u8868\u793A\u540D\u306F\u5FC5\u9808\u3067\u3059\u3002",minlength:"\u8868\u793A\u540D\u306F\u5FC5\u305A1\u6587\u5B57\u4EE5\u4E0A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",maxlength:"\u8868\u793A\u540D\u306F\u3001120\u6587\u5B57\u4EE5\u5185\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093\u3002"}};function N(e){mn(e,{message:"\u8868\u793A\u540D\u306F\u5FC5\u9808\u3067\u3059\u3002"}),fn(e,1,{message:"\u8868\u793A\u540D\u306F\u5FC5\u305A1\u6587\u5B57\u4EE5\u4E0A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}),cn(e,120,{message:"\u8868\u793A\u540D\u306F\u3001120\u6587\u5B57\u4EE5\u5185\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093\u3002"});}var H={VALIDATORS:[ye.required],MESSAGES:{required:"\u516C\u958B\u8A2D\u5B9A\u304C\u5FC5\u8981\u3067\u3059\u3002"}},q={VALIDATORS:[ye.minLength(3),ye.maxLength(1e3)],MESSAGES:{minlength:"\u8AAC\u660E\u306F3\u6587\u5B57\u4EE5\u4E0A\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002",maxlength:"\u8AAC\u660E\u306F1000\u6587\u5B57\u4EE5\u4E0A\u5165\u529B\u3067\u304D\u307E\u305B\u3093\u3002"}},w={VALIDATORS:[],MESSAGES:{required:"\u30D7\u30EC\u30A4\u30EA\u30B9\u30C8\u304C\u516C\u958B\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30C1\u30E3\u30F3\u30CD\u30EB\u306F\u5FC5\u9808\u3067\u3059\u3002"}};function G(e,V){V.toString()===sIe.PUBLIC.toString()?e.setValidators([ye.required]):e.setValidators(null),e.markAsDirty(),e.updateValueAndValidity();}var re=(()=>{class e{notifier=g(rc);videoPlaylistService=g(Z);playlistCreated=Cpe();playlistModel=Ye({displayName:""});playlistForm=or(this.playlistModel,r=>{N(r.displayName);});createPlaylist(){let t={displayName:this.playlistModel().displayName.trim(),privacy:sIe.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="\u4F5C\u6210";let t;return t="\u8868\u793A\u540D",[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),yV(3,0),ub(),Pp(4,"input",4),GH(),Pp(5,"my-form-error",5),ub(),Pp(6,"input",6),ub()),t&2&&(zB(4),B0("formField",i.playlistForm.displayName)("myFormInputError",i.playlistForm.displayName()),WH(),zB(),B0("field",i.playlistForm.displayName()),zB(),B0("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:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{G,H,Y,c,q,re as r,w};//# sourceMappingURL=chunk-ePnOtFGE.js.map