import{a as N,b as re}from"./chunk-7JTJJBK3.js";import{a as M}from"./chunk-TSYTIONE.js";import{d as ne}from"./chunk-C2T7BCDV.js";import{b as Z,c as te}from"./chunk-DEUNVCPO.js";import{B as Q,C as W,c as K,g as z,h as w,n as H,q as j,t as J,y as B}from"./chunk-XBJAP6TJ.js";import{$b as b,Db as $,Dc as q,Eb as C,Fc as g,Ha as c,Qb as G,Rb as Y,Sa as A,Sb as D,Wa as F,Wf as I,Za as p,ba as m,gb as s,gg as ee,ha as P,ia as y,la as O,lc as x,ld as k,pb as o,qb as r,qd as X,rb as d,rg as T,sb as R,ta as U,tb as v,vb as h,xb as L,xg as ie,yb as V,zb as l}from"./chunk-3MFSOWAK.js";import{i as f}from"./chunk-ASXIZBWV.js";var le=e=>({"input-error":e});function ce(e,n){if(e&1&&(o(0,"div",13),Y(1),r()),e&2){let _=C(2);c(),D(_.formErrors["verify-email-email"]);}}function me(e,n){if(e&1){let _=h();o(0,"form",7),$("ngSubmit",function(){P(_);let i=C();return y(i.askSendVerifyEmail());}),o(1,"div",8)(2,"label",9),l(3,2),r(),d(4,"input",10),p(5,ce,2,1,"div",11),r(),d(6,"input",12),r();}if(e&2){let _=C();s("formGroup",_.form),c(4),s("ngClass",b(4,le,_.formErrors["verify-email-email"])),c(),s("ngIf",_.formErrors["verify-email-email"]),c(),s("disabled",!_.form.valid);}}function ue(e,n){e&1&&(o(0,"div"),l(1,3),r());}var _e=(()=>{let n=class n extends te{formReactiveService=m(Z);signupService=m(N);serverService=m(T);notifier=m(I);redirectService=m(ie);requiresEmailVerification=!1;ngOnInit(){this.serverService.getConfig().subscribe(t=>this.requiresEmailVerification=t.signup.requiresEmailVerification),this.buildForm({"verify-email-email":ne});}askSendVerifyEmail(){let t=this.form.value["verify-email-email"];this.signupService.askSendVerifyEmail(t).subscribe({next:()=>{this.notifier.success("\u5305\u542B\u9A57\u8B49\u9023\u7D50\u7684\u96FB\u5B50\u90F5\u4EF6\u5DF2\u50B3\u9001\u5230 "+t+"\u3002"),this.redirectService.redirectToHomepage();},error:i=>this.notifier.error(i.message)});}};f(n,"\u0275fac",(()=>{let t;return function(a){return(t||(t=O(n)))(a||n);};})()),f(n,"\u0275cmp",A({type:n,selectors:[["my-verify-account-ask-send-email"]],features:[F],decls:6,vars:2,consts:()=>{let t;t="\u8ACB\u6C42\u7528\u65BC\u5E33\u865F\u9A57\u8B49\u7684\u96FB\u5B50\u90F5\u4EF6";let i;i="\u96FB\u5B50\u4FE1\u7BB1";let a;a="\u50B3\u9001\u9A57\u8B49\u96FB\u5B50\u90F5\u4EF6";let u;u="\u96FB\u5B50\u90F5\u4EF6";let E;return E="\u6B64\u7AD9\u81FA\u4E0D\u9700\u8981\u96FB\u5B50\u90F5\u4EF6\u9A57\u8B49\u3002",[["emailVerificationNotRequired",""],t,u,E,[1,"margin-content"],[1,"title-page"],[3,"formGroup","ngSubmit",4,"ngIf","ngIfElse"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","verify-email-email"],["type","email","id","verify-email-email","placeholder",i,"required","","formControlName","verify-email-email",1,"form-control",3,"ngClass"],["class","form-error","role","alert",4,"ngIf"],["type","submit","value",a,1,"peertube-button","primary-button",3,"disabled"],["role","alert",1,"form-error"]];},template:function(i,a){if(i&1&&(o(0,"div",4)(1,"h1",5),l(2,1),r(),p(3,me,7,6,"form",6)(4,ue,2,0,"ng-template",null,0,x),r()),i&2){let u=G(5);c(3),s("ngIf",a.requiresEmailVerification)("ngIfElse",u);}},dependencies:[g,Q,H,K,z,w,B,W,j,J,q],styles:[`input[type=email][_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:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=email][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}input[type=email][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=email][_ngcontent-%COMP%]:focus, input[type=email][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=email][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: 380px){input[type=email][_ngcontent-%COMP%]{width:100%}}
/*# sourceMappingURL=verify-account-ask-send-email.component-3MD6JD6E.css.map */`]}));let e=n;return e;})();function Ee(e,n){e&1&&(R(0),o(1,"p"),l(2,1),r(),o(3,"p"),l(4,2),r(),v());}function Se(e,n){e&1&&(R(0),o(1,"p"),l(2,3),r(),o(3,"p"),L(4,4),d(5,"a",8),V(),r(),v());}var ae=(()=>{let n=class n{requiresApproval=U(void 0);};f(n,"\u0275fac",function(i){return new(i||n)();}),f(n,"\u0275cmp",A({type:n,selectors:[["my-signup-success-after-email"]],inputs:{requiresApproval:[1,"requiresApproval"]},decls:6,vars:2,consts:()=>{let t;t="\u5DF2\u9A57\u8B49\u96FB\u5B50\u90F5\u4EF6\uFF01";let i;i="\u5DF2\u9A57\u8B49\u60A8\u7684\u96FB\u5B50\u90F5\u4EF6\uFF0C\u800C\u60A8\u7684\u5E33\u865F\u8ACB\u6C42\u4E5F\u5DF2\u50B3\u9001\uFF01";let a;a="\u7BA1\u7406\u54E1\u5F88\u5FEB\u5C31\u6703\u6AA2\u67E5\u60A8\u7684\u8A3B\u518A\u8ACB\u6C42\uFF0C\u7576\u60A8\u7684\u8A3B\u518A\u8ACB\u6C42\u88AB\u63A5\u53D7\u6216\u62D2\u7D55\u6642\uFF0C\u60A8\u5C07\u6703\u6536\u5230\u96FB\u5B50\u90F5\u4EF6\u3002";let u;u="\u60A8\u7684\u96FB\u5B50\u90F5\u4EF6\u5DF2\u901A\u904E\u9A57\u8B49\uFF0C\u800C\u60A8\u7684\u5E33\u865F\u5DF2\u5EFA\u7ACB\uFF01";let E;return E="\u82E5\u60A8\u9700\u8981\u4F7F\u7528 PeerTube \u7684\u5354\u52A9\uFF0C\u60A8\u53EF\u80FD\u6703\u60F3\u8981\u770B\u770B"+"\uFFFD#5\uFFFD"+"\u6587\u4EF6"+"\uFFFD/#5\uFFFD"+"\u3002 ",[t,i,a,u,E,["mascotImageName","success"],["type","primary"],[4,"ngIf"],["href","https://docs.joinpeertube.org/use/setup-account","target","_blank","rel","noopener noreferrer",1,"link-primary"]];},template:function(i,a){i&1&&(o(0,"my-signup-step-title",5)(1,"strong"),l(2,0),r()(),o(3,"my-alert",6),p(4,Ee,5,0,"ng-container",7)(5,Se,6,0,"ng-container",7),r()),i&2&&(c(4),s("ngIf",a.requiresApproval()),c(),s("ngIf",!a.requiresApproval()));},dependencies:[re,g,M],styles:[`my-alert[_ngcontent-%COMP%]{display:block;font-size:18px;max-width:900px;text-align:center;margin:auto}
/*# sourceMappingURL=signup-success.component-LNJKY4EL.css.map */`]}));let e=n;return e;})();function fe(e,n){if(e&1&&d(0,"my-signup-success-after-email",10),e&2){let _=C(2);s("requiresApproval",_.isRegistrationRequest()&&_.requiresApproval);}}function pe(e,n){e&1&&(o(0,"my-alert",11),l(1,1),r());}function de(e,n){e&1&&(o(0,"my-alert",12)(1,"span"),l(2,2),r(),o(3,"a",13),l(4,3),r()());}function Ce(e,n){if(e&1&&(o(0,"div",5)(1,"h1",6),l(2,0),r(),p(3,fe,1,1,"my-signup-success-after-email",7)(4,pe,2,0,"my-alert",8)(5,de,5,0,"my-alert",9),r()),e&2){let _=C();c(3),s("ngIf",_.displaySignupSuccess()),c(),s("ngIf",!_.isRegistrationRequest()&&_.isPendingEmail&&_.success),c(),s("ngIf",_.failed);}}var se=(()=>{let n=class n{signupService=m(N);server=m(T);authService=m(ee);notifier=m(I);route=m(k);success=!1;failed=!1;isPendingEmail=!1;requiresApproval;loaded=!1;userId;registrationId;verificationString;get instanceName(){return this.server.getHTMLConfig().instance.name;}ngOnInit(){let t=this.route.snapshot.queryParams;if(this.server.getConfig().subscribe(i=>{this.requiresApproval=i.signup.requiresApproval,this.loaded=!0;}),this.userId=t.userId,this.registrationId=t.registrationId,this.verificationString=t.verificationString,this.isPendingEmail=t.isPendingEmail==="true",!this.verificationString){this.notifier.error("\u5728 URL \u67E5\u8A62\u4E2D\u627E\u4E0D\u5230\u9A57\u8B49\u5B57\u4E32\u3002");return;}if(!this.userId&&!this.registrationId){this.notifier.error("\u5728 URL \u67E5\u8A62\u4E2D\u627E\u4E0D\u5230\u4F7F\u7528\u8005 ID \u6216\u8A3B\u518A ID\u3002");return;}this.verifyEmail();}isRegistrationRequest(){return!!this.registrationId;}displaySignupSuccess(){return!(!this.success||!this.isRegistrationRequest()&&this.isPendingEmail);}verifyEmail(){return this.isRegistrationRequest()?this.verifyRegistrationEmail():this.verifyUserEmail();}verifyUserEmail(){let t={userId:this.userId,verificationString:this.verificationString,isPendingEmail:this.isPendingEmail};this.signupService.verifyUserEmail(t).subscribe({next:()=>{this.authService.isLoggedIn()&&this.authService.refreshUserInformation(),this.success=!0;},error:i=>{this.failed=!0,this.notifier.error(i.message);}});}verifyRegistrationEmail(){let t={registrationId:this.registrationId,verificationString:this.verificationString};this.signupService.verifyRegistrationEmail(t).subscribe({next:()=>{this.success=!0;},error:i=>{this.failed=!0,this.notifier.error(i.message);}});}};f(n,"\u0275fac",function(i){return new(i||n)();}),f(n,"\u0275cmp",A({type:n,selectors:[["my-verify-account-email"]],decls:1,vars:1,consts:()=>{let t;t="\u9A57\u8B49\u96FB\u5B50\u90F5\u4EF6";let i;i="\u96FB\u5B50\u90F5\u4EF6\u5DF2\u66F4\u65B0\u3002";let a;a="\u9047\u5230\u932F\u8AA4\u3002";let u;return u="\u8ACB\u6C42\u65B0\u7684\u9A57\u8B49\u96FB\u5B50\u90F5\u4EF6",[t,i,a,u,["class","margin-content",4,"ngIf"],[1,"margin-content"],[1,"title-page"],[3,"requiresApproval",4,"ngIf"],["type","success",4,"ngIf"],["type","danger",4,"ngIf"],[3,"requiresApproval"],["type","success"],["type","danger"],["routerLink","/verify-account/ask-send-email",1,"ms-1","link-primary"]];},template:function(i,a){i&1&&p(0,Ce,6,3,"div",4),i&2&&s("ngIf",a.loaded);},dependencies:[g,ae,X,M],encapsulation:2}));let e=n;return e;})();var Qe=[{path:"",providers:[N],children:[{path:"email",component:se,data:{meta:{title:"\u900F\u904E\u96FB\u5B50\u90F5\u4EF6\u9A57\u8B49\u5E33\u865F"}}},{path:"ask-send-email",component:_e,data:{meta:{title:"\u8981\u6C42\u50B3\u9001\u96FB\u5B50\u90F5\u4EF6\u4EE5\u9A57\u8B49\u60A8\u7684\u5E33\u865F"}}}]}];export{Qe as default};/**i18n:a80de7963c3a1ee38e5afb7317b8dafa5dd6a0c8b3d465be96b90b317d6167e1*///# sourceMappingURL=chunk-BQDCTM4O.js.map