import{a as N,b as re}from"./chunk-SRTXDZWA.js";import{a as v}from"./chunk-S3EOECWM.js";import{d as ne}from"./chunk-O4NWZCXV.js";import{b as W,c as te}from"./chunk-BNV6WX3E.js";import{A as B,B as Q,c as K,g as z,h as w,m as j,p as H,s as J,x as Z}from"./chunk-7VHQBARM.js";import{Bb as G,Cb as Y,Da as E,Db as b,Ea as S,La as h,Lb as g,Nb as x,Oa as f,Wa as c,Wf as R,Yf as ee,Zb as D,ad as k,ba as A,db as a,eb as _,ed as X,fb as p,gb as P,hb as y,jb as F,la as O,lb as L,ma as U,mb as V,nb as u,ng as M,rb as $,sb as C,sc as q,uc as I,ug as ie}from"./chunk-QXV2GR6R.js";import{i as n}from"./chunk-JJ4RDTEF.js";var me=i=>({"input-error":i});function ue(i,t){if(i&1&&(a(0,"div",13),Y(1),_()),i&2){let s=C(2);E(),b(s.formErrors["verify-email-email"]);}}function Ee(i,t){if(i&1){let s=F();a(0,"form",7),$("ngSubmit",function(){O(s);let e=C();return U(e.askSendVerifyEmail());}),a(1,"div",8)(2,"label",9),u(3,2),_(),p(4,"input",10),f(5,ue,2,1,"div",11),_(),p(6,"input",12),_();}if(i&2){let s=C();c("formGroup",s.form),E(4),c("ngClass",x(4,me,s.formErrors["verify-email-email"])),E(),c("ngIf",s.formErrors["verify-email-email"]),E(),c("disabled",!s.form.valid);}}function Se(i,t){i&1&&(a(0,"div"),u(1,3),_());}var _e=(()=>{let t=class t extends te{constructor(e,r,m,l,d){super();n(this,"formReactiveService");n(this,"signupService");n(this,"serverService");n(this,"notifier");n(this,"redirectService");n(this,"requiresEmailVerification",!1);this.formReactiveService=e,this.signupService=r,this.serverService=m,this.notifier=l,this.redirectService=d;}ngOnInit(){this.serverService.getConfig().subscribe(e=>this.requiresEmailVerification=e.signup.requiresEmailVerification),this.buildForm({"verify-email-email":ne});}askSendVerifyEmail(){let e=this.form.value["verify-email-email"];this.signupService.askSendVerifyEmail(e).subscribe({next:()=>{this.notifier.success("Imayl s use\u0263wen n usenqed ad yettwazen \u0263er "+e+"."),this.redirectService.redirectToHomepage();},error:r=>this.notifier.error(r.message)});}};n(t,"\u0275fac",function(r){return new(r||t)(S(W),S(N),S(M),S(R),S(ie));}),n(t,"\u0275cmp",A({type:t,selectors:[["my-verify-account-ask-send-email"]],standalone:!0,features:[h,g],decls:6,vars:2,consts:()=>{let e;e="Request email for account verification";let r;r="Tansa email";let m;m="Azen imayl n usenqed";let l;l="Imayl";let d;return d="Tummant-a ur te\u1E25wa\u01E7 ara imayl n usenqed.",[["emailVerificationNotRequired",""],e,l,d,[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",r,"required","","formControlName","verify-email-email",1,"form-control",3,"ngClass"],["class","form-error","role","alert",4,"ngIf"],["type","submit","value",m,1,"peertube-button","primary-button",3,"disabled"],["role","alert",1,"form-error"]];},template:function(r,m){if(r&1&&(a(0,"div",4)(1,"h1",5),u(2,1),_(),f(3,Ee,7,6,"form",6)(4,Se,2,0,"ng-template",null,0,D),_()),r&2){let l=G(5);E(3),c("ngIf",m.requiresEmailVerification)("ngIfElse",l);}},dependencies:[I,B,j,K,z,w,Z,Q,H,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%]{opacity:.4}@media screen and (max-width: 380px){input[type=email][_ngcontent-%COMP%]{width:100%}}
/*# sourceMappingURL=verify-account-ask-send-email.component-FGSZ2LOU.css.map */`]}));let i=t;return i;})();function de(i,t){i&1&&(P(0),a(1,"p"),u(2,1),_(),a(3,"p"),u(4,2),_(),y());}function fe(i,t){i&1&&(P(0),a(1,"p"),u(2,3),_(),a(3,"p"),L(4,4),p(5,"a",8),V(),_(),y());}var ae=(()=>{let t=class t{constructor(){n(this,"requiresApproval");}};n(t,"\u0275fac",function(e){return new(e||t)();}),n(t,"\u0275cmp",A({type:t,selectors:[["my-signup-success-after-email"]],inputs:{requiresApproval:"requiresApproval"},standalone:!0,features:[g],decls:6,vars:2,consts:()=>{let o;o="Email verified!";let e;e="Your email has been verified and your account request has been sent!";let r;r=" A moderator will check your registration request soon and you'll receive an email when it is accepted or rejected. ";let m;m="Your email has been verified and your account has been created!";let l;return l=" If you need help using PeerTube, you can have a look at the "+"\uFFFD#5\uFFFD"+"documentation"+"\uFFFD/#5\uFFFD"+". ",[o,e,r,m,l,["mascotImageName","success"],["type","primary"],[4,"ngIf"],["href","https://docs.joinpeertube.org/use/setup-account","target","_blank","rel","noopener noreferrer",1,"link-primary"]];},template:function(e,r){e&1&&(a(0,"my-signup-step-title",5)(1,"strong"),u(2,0),_()(),a(3,"my-alert",6),f(4,de,5,0,"ng-container",7)(5,fe,6,0,"ng-container",7),_()),e&2&&(E(4),c("ngIf",r.requiresApproval),E(),c("ngIf",!r.requiresApproval));},dependencies:[re,I,v],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 i=t;return i;})();function pe(i,t){if(i&1&&p(0,"my-signup-success-after-email",10),i&2){let s=C(2);c("requiresApproval",s.isRegistrationRequest()&&s.requiresApproval);}}function Ce(i,t){i&1&&(a(0,"my-alert",11),u(1,1),_());}function Ae(i,t){i&1&&(a(0,"my-alert",12)(1,"span"),u(2,2),_(),a(3,"a",13),u(4,3),_()());}function ge(i,t){if(i&1&&(a(0,"div",5)(1,"h1",6),u(2,0),_(),f(3,pe,1,1,"my-signup-success-after-email",7)(4,Ce,2,0,"my-alert",8)(5,Ae,5,0,"my-alert",9),_()),i&2){let s=C();E(3),c("ngIf",s.displaySignupSuccess()),E(),c("ngIf",!s.isRegistrationRequest()&&s.isPendingEmail&&s.success),E(),c("ngIf",s.failed);}}var se=(()=>{let t=class t{constructor(o,e,r,m,l){n(this,"signupService");n(this,"server");n(this,"authService");n(this,"notifier");n(this,"route");n(this,"success",!1);n(this,"failed",!1);n(this,"isPendingEmail",!1);n(this,"requiresApproval");n(this,"loaded",!1);n(this,"userId");n(this,"registrationId");n(this,"verificationString");this.signupService=o,this.server=e,this.authService=r,this.notifier=m,this.route=l;}get instanceName(){return this.server.getHTMLConfig().instance.name;}ngOnInit(){let o=this.route.snapshot.queryParams;if(this.server.getConfig().subscribe(e=>{this.requiresApproval=e.signup.requiresApproval,this.loaded=!0;}),this.userId=o.userId,this.registrationId=o.registrationId,this.verificationString=o.verificationString,this.isPendingEmail=o.isPendingEmail==="true",!this.verificationString){this.notifier.error("Unable to find verification string in URL query.");return;}if(!this.userId&&!this.registrationId){this.notifier.error("Unable to find user id or registration id in URL query.");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 o={userId:this.userId,verificationString:this.verificationString,isPendingEmail:this.isPendingEmail};this.signupService.verifyUserEmail(o).subscribe({next:()=>{this.authService.isLoggedIn()&&this.authService.refreshUserInformation(),this.success=!0;},error:e=>{this.failed=!0,this.notifier.error(e.message);}});}verifyRegistrationEmail(){let o={registrationId:this.registrationId,verificationString:this.verificationString};this.signupService.verifyRegistrationEmail(o).subscribe({next:()=>{this.success=!0;},error:e=>{this.failed=!0,this.notifier.error(e.message);}});}};n(t,"\u0275fac",function(e){return new(e||t)(S(N),S(M),S(ee),S(R),S(k));}),n(t,"\u0275cmp",A({type:t,selectors:[["my-verify-account-email"]],standalone:!0,features:[g],decls:1,vars:1,consts:()=>{let o;o="Verify email";let e;e="Yettwaleqqem yimayl.";let r;r="Tella-d tucc\u1E0Da.";let m;return m=" Request a new verification email ",[o,e,r,m,["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(e,r){e&1&&f(0,ge,6,3,"div",4),e&2&&c("ngIf",r.loaded);},dependencies:[I,ae,X,v],encapsulation:2}));let i=t;return i;})();var Ke=[{path:"",providers:[N],children:[{path:"email",component:se,data:{meta:{title:"Senqed ami\u1E0Dan s yimayl"}}},{path:"ask-send-email",component:_e,data:{meta:{title:"Ask to send an email to verify your account"}}}]}];export{Ke as default};/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*///# sourceMappingURL=chunk-HIJ47N5I.js.map