import{b as Z}from"./chunk-ARKMDTQ4.js";import"./chunk-KCS4FZWN.js";import{C as H,g as V,n as z}from"./chunk-UVFMJH3U.js";import{u as Q}from"./chunk-YIKPDULQ.js";import{a as q}from"./chunk-XTZ2Q6VE.js";import{Bb as p,Da as d,Db as C,Dd as X,La as L,Lb as I,Mb as U,Ra as h,Xh as j,Yb as W,Zb as b,_b as v,aa as g,ab as M,bb as N,fa as s,ga as c,hb as o,ib as i,jb as u,pf as O,qi as B,rf as K,sc as w,tb as y,th as Y,vb as m,wb as S,wc as k,xb as A,yb as $,yc as x,zb as G}from"./chunk-HJJWL6RD.js";import{i as T}from"./chunk-H2BCKOF6.js";var J=["modal"];function ee(_,r){_&1&&(o(0,"li"),m(1,5),u(2,"strong"),S(),i());}function te(_,r){_&1&&(o(0,"li"),m(1,6),u(2,"strong"),S(),i());}function ne(_,r){if(_&1){let n=y();o(0,"div",7)(1,"h4",8),A(2,1),i(),o(3,"button",9),p("click",function(){let t=s(n).close;return c(t());}),u(4,"my-global-icon",10),i()(),o(5,"div",11),u(6,"img",12),o(7,"div",13),A(8,2),i(),o(9,"p"),m(10,3),u(11,"strong"),S(),i(),o(12,"ul"),M(13,ee,3,0,"li"),M(14,te,3,0,"li"),i()(),o(15,"div",14)(16,"my-peertube-checkbox",15),v("ngModelChange",function(t){s(n);let a=C();return b(a.stopDisplayModal,t)||(a.stopDisplayModal=t),c(t);}),i(),o(17,"input",16),p("click",function(){let t=s(n).close;return c(t());})("key.enter",function(){let t=s(n).close;return c(t());}),i(),o(18,"a",17),p("click",function(){let t=s(n).close;return c(t());})("key.enter",function(){let t=s(n).close;return c(t());}),A(19,4),i()();}if(_&2){let n=C();d(2),$(n.instanceName),G(2),d(11),N(n.hasAccountAvatar(n.user)?-1:13),d(),N(n.hasAccountDescription(n.user)?-1:14),d(2),W("ngModel",n.stopDisplayModal);}}var Se=(()=>{let r=class r{userService=g(B);modalService=g(Q);notifier=g(Y);serverService=g(j);modal=x("modal");created=k();stopDisplayModal=!1;ref;user;LS_KEYS={NO_ACCOUNT_SETUP_WARNING_MODAL:"no_account_setup_warning_modal"};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;}shouldAutoOpen(e){return!(this.modalService.hasOpenModals()||e.noAccountSetupWarningModal===!0||O.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(){O.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.handleError(e)});}};T(r,"\u0275fac",function(t){return new(t||r)();}),T(r,"\u0275cmp",L({type:r,selectors:[["my-account-setup-warning-modal"]],viewQuery:function(t,a){t&1&&I(a.modal,J,5),t&2&&U();},outputs:{created:"created"},decls:2,vars:0,consts:()=>{let e;e="\u5173\u95ED\u6B64\u6A21\u5F0F";let t;t="\u4E0D\u518D\u5BF9\u6211\u663E\u793A\u6B64\u63D0\u793A";let a;a="\u5173\u95ED";let E;E="\u6B22\u8FCE\u6765\u5230 "+"\uFFFD0\uFFFD"+"\uFF0C\u4EB2\u7231\u7684\u7528\u6237\uFF01";let f;f="\u662F\u65F6\u5019\u8BBE\u7F6E\u4F60\u7684\u8D26\u6237\u8D44\u6599\u4E86\uFF01";let F;F="\u5E2E\u52A9\u5BA1\u6838\u8005\u548C\u5176\u4ED6\u7528\u6237\u8BA4\u8BC6 "+"\uFFFD#11\uFFFD"+"\u4F60\u662F\u8C01"+"\uFFFD/#11\uFFFD"+"\uFF0C\u65B9\u6CD5\u4E3A\uFF1A";let P;P="\u8BBE\u7F6E";let D;D="\u4E0A\u4F20 "+"\uFFFD#2\uFFFD"+"\u5934\u50CF"+"\uFFFD/#2\uFFFD"+"";let R;return R="\u7F16\u5199 "+"\uFFFD#2\uFFFD"+"\u63CF\u8FF0"+"\uFFFD/#2\uFFFD"+"",[["modal",""],E,f,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"],[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&&h(0,ne,20,4,"ng-template",null,0,w);},dependencies:[q,Z,H,V,z,X],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-BRCRW7HZ.css.map */`]}));let _=r;return _;})();export{Se as AccountSetupWarningModalComponent};/**i18n:671d995daee9c68b73ac729b7ab2c3cf3be32c7f1a24d9dfa94e261c45ee5241*///# sourceMappingURL=chunk-SMVKTTRN.js.map