import{C as D}from"./chunk-UE3TNESI.js";import{a as Q}from"./chunk-HQLPBHYW.js";import{Da as C,Db as O,Eb as _,Fc as z,Ha as a,Ja as x,Kc as L,Ke as R,Le as $,Nb as k,Pb as S,Qa as y,Qb as I,Sa as b,Ua as w,Za as s,ba as H,fb as M,ga as v,gb as i,ha as g,ia as h,lc as E,pb as u,pc as N,qb as f,rb as d,ta as r,vb as P}from"./chunk-XD25PYOU.js";import{i as c}from"./chunk-FPVLB6PA.js";var T=(()=>{let t=class t{template=H(x);name=r(void 0,{alias:"ptTemplate"});};c(t,"\u0275fac",function(n){return new(n||t)();}),c(t,"\u0275dir",w({type:t,selectors:[["","ptTemplate",""]],inputs:{name:[1,"ptTemplate","name"]}}));let e=t;return e;})();function F(e,t){}function j(e,t){e&1&&s(0,F,0,0,"ng-template");}function U(e,t){if(e&1&&(u(0,"p"),s(1,j,1,0,null,6),f()),e&2){let o=_(2);a(),i("ngTemplateOutlet",o.preHtmlTemplate);}}function G(e,t){e&1&&d(0,"div",7);}function q(e,t){}function X(e,t){e&1&&s(0,q,0,0,"ng-template");}function B(e,t){if(e&1&&(u(0,"p"),s(1,X,1,0,null,6),f()),e&2){let o=_(2);a(),i("ngTemplateOutlet",o.customHtmlTemplate);}}function J(e,t){if(e&1&&d(0,"p",8),e&2){let o=_(2);i("innerHTML",o.mainHtml,C);}}function K(e,t){e&1&&d(0,"div",7);}function W(e,t){}function Y(e,t){e&1&&s(0,W,0,0,"ng-template");}function Z(e,t){if(e&1&&(u(0,"p"),s(1,Y,1,0,null,6),f()),e&2){let o=_(2);a(),i("ngTemplateOutlet",o.postHtmlTemplate);}}function ee(e,t){if(e&1&&s(0,U,2,1,"p",3)(1,G,1,0,"div",4)(2,B,2,1,"p",3)(3,J,1,1,"p",5)(4,K,1,0,"div",4)(5,Z,2,1,"p",3),e&2){let o=_();i("ngIf",o.preHtmlTemplate),a(),i("ngIf",o.preHtmlTemplate&&(o.customHtmlTemplate||o.mainHtml||o.postHtmlTemplate)),a(),i("ngIf",o.customHtmlTemplate),a(),i("ngIf",o.mainHtml),a(),i("ngIf",(o.customHtmlTemplate||o.mainHtml)&&o.postHtmlTemplate),a(),i("ngIf",o.postHtmlTemplate);}}var _e=(()=>{let t=class t{helpType=r("custom");tooltipPlacement=r("right auto");iconName=r("help");title=r("\u83B7\u53D6\u5E2E\u52A9");autoClose=r("outside");supportRelMe=r(!1,{transform:N});templates=y(T);isPopoverOpened=!1;mainHtml="";preHtmlTemplate;customHtmlTemplate;postHtmlTemplate;ngOnInit(){this.init();}ngAfterContentInit(){{let p=this.templates().find(n=>n.name()==="preHtml");p&&(this.preHtmlTemplate=p.template);}{let p=this.templates().find(n=>n.name()==="customHtml");p&&(this.customHtmlTemplate=p.template);}{let p=this.templates().find(n=>n.name()==="postHtml");p&&(this.postHtmlTemplate=p.template);}}ngOnChanges(){this.init();}onPopoverHidden(){this.isPopoverOpened=!1;}onPopoverShown(){this.isPopoverOpened=!0;}init(){let p=this.helpType();if(p==="markdownText"){this.mainHtml=this.formatMarkdownSupport(R);return;}if(p==="markdownEnhanced"){this.mainHtml=this.formatMarkdownSupport($);return;}}formatMarkdownSupport(p){let n="<a href=\"https://zh.wikipedia.org/wiki/Markdown#\u793A\u4F8B\" target=\"_blank\" rel=\"noopener noreferrer\"\u517C\u5BB9 >Markdown</a> \u5E76\u652F\u6301\uFF1A"+this.createMarkdownList(p);return this.supportRelMe()&&(n+="<a href=\"https://docs.joinmastodon.org/user/profile/#verification\" target=\"_blank\" rel=\"noopener noreferrer\">\u8FD8\u652F\u6301 Mastodon \u9A8C\u8BC1\u94FE\u63A5</a> \u3002"),n;}createMarkdownList(p){let n={emphasis:"\u5F3A\u8C03",link:"\u94FE\u63A5",newline:"\u6362\u884C",list:"\u5217\u8868",image:"\u56FE\u50CF"};return"<ul>"+p.map(l=>n[l]).filter(l=>l).map(l=>"<li>"+l+"</li>").join("")+"</ul>";}};c(t,"\u0275fac",function(n){return new(n||t)();}),c(t,"\u0275cmp",b({type:t,selectors:[["my-help"]],contentQueries:function(n,m,l){n&1&&k(l,m.templates,T,4),n&2&&S();},inputs:{helpType:[1,"helpType"],tooltipPlacement:[1,"tooltipPlacement"],iconName:[1,"iconName"],title:[1,"title"],autoClose:[1,"autoClose"],supportRelMe:[1,"supportRelMe"]},features:[v],decls:4,vars:6,consts:[["tooltipTemplate",""],["popoverClass","help-popover","type","button",1,"help-tooltip-button","p-0","border-0","mx-1",3,"onHidden","onShown","title","ngbPopover","placement","autoClose"],[3,"iconName"],[4,"ngIf"],["class","mb-2",4,"ngIf"],[3,"innerHTML",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"mb-2"],[3,"innerHTML"]],template:function(n,m){if(n&1){let l=P();s(0,ee,6,6,"ng-template",null,0,E),u(2,"button",1),O("onHidden",function(){return g(l),h(m.onPopoverHidden());})("onShown",function(){return g(l),h(m.onPopoverShown());}),d(3,"my-global-icon",2),f();}if(n&2){let l=I(1);a(2),i("title",m.title())("ngbPopover",l)("placement",m.tooltipPlacement())("autoClose",m.autoClose()),M("aria-pressed",m.isPopoverOpened),a(),i("iconName",m.iconName());}},dependencies:[z,L,D,Q],styles:[`.help-tooltip-button[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{width:17px;height:17px;line-height:17px;display:inline-block;position:relative;top:-1px;color:var(--fg-400)}[_nghost-%COMP%]     .help-popover{min-width:200px;max-width:300px}[_nghost-%COMP%]     .help-popover .popover-body{padding:10px;font-size:13px;border-radius:3px}[_nghost-%COMP%]     .help-popover .popover-body p{margin-bottom:0}[_nghost-%COMP%]     .help-popover .popover-body ul{margin-bottom:0;padding-inline-start:1.25rem}
/*# sourceMappingURL=help.component-Q4PQMMFH.css.map */`]}));let e=t;return e;})();export{T as a,_e as b};/**i18n:fc817608a00477e18624cf8be5badc6c9afae12f0946c7c1548c95cf79bd0e7b*///# sourceMappingURL=chunk-FZLVSCIB.js.map