import{a as ee}from"./chunk-4CFVWR6A.js";import"./chunk-6I6EA4VV.js";import{r as H}from"./chunk-XYUXA3LT.js";import{A as Y,g as j,l as Q}from"./chunk-K34LZIA3.js";import{a as J}from"./chunk-BUPI2ADN.js";import{$e as K,Bg as Z,Ca as m,Da as p,Ec as V,Gb as W,Hb as w,Ib as b,Kb as k,Na as N,Va as C,Vf as q,Yb as x,Ze as f,ba as L,cb as i,db as r,dd as z,eb as d,ib as y,kb as S,kg as B,la as u,lb as A,ma as g,mb as T,nb as $,ob as I,qb as M,rb as O,sa as h,tc as X,xb as G,yb as U,zb as v}from"./chunk-X3RCWQ3R.js";import{i as o}from"./chunk-SR6RTMQI.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:()=>K.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(Z),p(H),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="Zatvori ovaj modal";let t;t="Ovo mi vi\u0161e nemoj prikazivati";let a;a="Zatvori";let c;c="Dobro do\u0161ao, dobro do\u0161la u "+"\uFFFD0\uFFFD"+"!";let E;E="Vrijeme je za postavljanje profila tvog ra\u010Duna!";let F;F="Pomogni moderatorima i drugim korisnicima da znaju "+"\uFFFD#11\uFFFD"+"tko si"+"\uFFFD/#11\uFFFD"+":";let P;P="Postavi";let D;D="Prenesi "+"\uFFFD#2\uFFFD"+"avatar"+"\uFFFD/#2\uFFFD"+"";let R;return R="Napi\u0161i "+"\uFFFD#2\uFFFD"+"opis"+"\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,J,ee,Y,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-PUR2R7YZ.css.map */`]}));let _=l;return _;})();export{Ce as AccountSetupWarningModalComponent};/**i18n:3d16453f213eb5db982e7e7dd90631843ac5d3f860726a614777c3e9e3f9b57e*///# sourceMappingURL=chunk-QWWJ4KNE.js.map