import{a as ee}from"./chunk-JDNPKJOH.js";import"./chunk-GLU5B42A.js";import{r as K}from"./chunk-CKNOD7HV.js";import{A as H,g as j,l as Q}from"./chunk-7VHQBARM.js";import{a as Z}from"./chunk-ZJ7WKAH3.js";import{Ab as v,Da as m,Ea as p,Eg as J,Fc as V,Hb as W,Ib as w,Jb as b,Lb as k,Oa as N,Wa as C,Wf as q,Zb as x,_e as f,af as Y,ba as L,db as i,eb as r,ed as z,fb as d,jb as y,la as u,lb as S,ma as g,mb as A,nb as T,ng as B,ob as $,pb as I,rb as M,sb as O,ta as h,uc as X,yb as G,zb as U}from"./chunk-QXV2GR6R.js";import{i as o}from"./chunk-JJ4RDTEF.js";var te=["modal"];function ne(_,l){_&1&&(i(0,"li"),S(1,5),d(2,"strong"),A(),r());}function oe(_,l){_&1&&(i(0,"li"),S(1,6),d(2,"strong"),A(),r());}function ie(_,l){if(_&1){let n=y();i(0,"div",7)(1,"h4",8),T(2,1),r(),i(3,"button",9),M("click",function(){let t=u(n).close;return g(t());}),d(4,"my-global-icon",10),r()(),i(5,"div",11),d(6,"img",12),i(7,"div",13),T(8,2),r(),i(9,"p"),S(10,3),d(11,"strong"),A(),r(),i(12,"ul"),N(13,ne,3,0,"li",14)(14,oe,3,0,"li",14),r()(),i(15,"div",15)(16,"my-peertube-checkbox",16),b("ngModelChange",function(t){u(n);let a=O();return w(a.stopDisplayModal,t)||(a.stopDisplayModal=t),g(t);}),r(),i(17,"input",17),M("click",function(){let t=u(n).close;return g(t());})("key.enter",function(){let t=u(n).close;return g(t());}),r(),i(18,"a",18),M("click",function(){let t=u(n).close;return g(t());})("key.enter",function(){let t=u(n).close;return g(t());}),T(19,4),r()();}if(_&2){let n=O();m(2),$(n.instanceName),I(2),m(11),C("ngIf",!n.hasAccountAvatar(n.user)),m(),C("ngIf",!n.hasAccountDescription(n.user)),m(2),W("ngModel",n.stopDisplayModal);}}var Ce=(()=>{let l=class l{constructor(e,t,a,c){o(this,"userService");o(this,"modalService");o(this,"notifier");o(this,"serverService");o(this,"modal");o(this,"created",new h());o(this,"stopDisplayModal",!1);o(this,"ref");o(this,"user");o(this,"LS_KEYS",{NO_ACCOUNT_SETUP_WARNING_MODAL:"no_account_setup_warning_modal"});this.userService=e,this.modalService=t,this.notifier=a,this.serverService=c;}ngOnInit(){this.created.emit();}get instanceName(){return this.serverService.getHTMLConfig().instance.name;}hasAccountAvatar(e){return e.account.avatars.length!==0;}hasAccountDescription(e){return!!e.account.description;}shouldOpen(e){return!(this.modalService.hasOpenModals()||e.noAccountSetupWarningModal===!0||f.getItem(this.LS_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL)==="true"||this.hasAccountAvatar(e)&&this.hasAccountDescription(e)||this.userService.hasSignupInThisSession());}show(e){this.user=e,!this.ref&&(this.ref=this.modalService.open(this.modal,{centered:!0,backdrop:"static",keyboard:!1,size:"md"}),this.ref.result.finally(()=>{this.stopDisplayModal===!0&&this.doNotOpenAgain();}));}doNotOpenAgain(){f.setItem(this.LS_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL,"true"),this.userService.updateMyProfile({noAccountSetupWarningModal:!0}).subscribe({next:()=>Y.info("We will not open the account setup modal again."),error:e=>this.notifier.error(e.message)});}};o(l,"\u0275fac",function(t){return new(t||l)(p(J),p(K),p(q),p(B));}),o(l,"\u0275cmp",L({type:l,selectors:[["my-account-setup-warning-modal"]],viewQuery:function(t,a){if(t&1&&G(te,7),t&2){let c;U(c=v())&&(a.modal=c.first);}},outputs:{created:"created"},standalone:!0,features:[k],decls:2,vars:0,consts:()=>{let e;e="Close this modal";let t;t="Don't show me this anymore";let a;a="Mbylle";let c;c="Welcome to "+"\uFFFD0\uFFFD"+", dear user!";let E;E="It's time to set up your account profile!";let F;F="Help moderators and other users to know "+"\uFFFD#11\uFFFD"+"who you are"+"\uFFFD/#11\uFFFD"+" by:";let P;P=" Set up ";let D;D="Uploading an "+"\uFFFD#2\uFFFD"+"avatar"+"\uFFFD/#2\uFFFD"+"";let R;return R="Writing a "+"\uFFFD#2\uFFFD"+"description"+"\uFFFD/#2\uFFFD"+"",[["modal",""],c,E,F,P,D,R,[1,"modal-header"],[1,"modal-title"],["title",e,1,"border-0","p-0",3,"click"],["iconName","cross"],[1,"modal-body"],["src","/client/assets/images/mascot/happy.svg","alt","",1,"mascot"],[1,"subtitle"],[4,"ngIf"],[1,"modal-footer","inputs"],["inputName","stopDisplayModal","labelText",t,3,"ngModelChange","ngModel"],["type","button","role","button","value",a,1,"peertube-button","secondary-button",3,"click","key.enter"],["routerLink","/my-account","rel","noopener noreferrer","ngbAutofocus","",1,"peertube-button-link","primary-button",3,"click","key.enter"]];},template:function(t,a){t&1&&N(0,ie,20,4,"ng-template",null,0,x);},dependencies:[V,X,Z,ee,H,j,Q,z],styles:[`.modal-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center}.mascot-fw[_ngcontent-%COMP%]{width:170px}.mascot[_ngcontent-%COMP%]{display:block;width:170px;height:220px;margin-inline-end:calc(1.325rem + .9vw)}@media (min-width: 1200px){.mascot[_ngcontent-%COMP%]{margin-inline-end:2rem}}.subtitle[_ngcontent-%COMP%]{font-weight:600;margin-bottom:10px}li[_ngcontent-%COMP%]{margin-bottom:10px}
/*# sourceMappingURL=account-setup-warning-modal.component-Q2VUPGJ6.css.map */`]}));let _=l;return _;})();export{Ce as AccountSetupWarningModalComponent};/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*///# sourceMappingURL=chunk-EWPKN3HF.js.map