ci: GHCR docker build for Lite branch + compose updates

- .github/workflows/docker-lite.yml: build & push ghcr.io/lezi-fun/
  forumlify-deploy:lite on Lite branch push (linux/amd64+arm64)
- docker-compose.yml: pull :lite image from GHCR, add PORT / ENABLE_
  CAPTCHA env, restart: unless-stopped on both services
This commit is contained in:
lezi-fun committed 2026-08-12 09:21:12 +08:00
1 parent 8f88f803f5
commit 9e407d0a2d
1532 files changed
+645187 -1

No files matched your search

@@ -0,0 +1,93 @@
module.exports=[47616,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(35112);let e=null;function f(a){e=a,a?localStorage.setItem("forumlify-token",a):localStorage.removeItem("forumlify-token")}async function g(a,b={}){let c={...b.headers||{}};b.body&&"string"==typeof b.body&&(c["Content-Type"]="application/json"),e&&(c.Authorization="Bearer "+e);let d=await fetch("/api"+a,{...b,headers:c}),f=await d.json().catch(()=>({}));if(!d.ok||f.error){let a=Error(f.error||"请求失败");throw a.status=d.status,a}return f}let h={async login(a,b){let c=await g("/auth/login",{method:"POST",body:JSON.stringify({email:a,password:b})});return c.token&&f(c.token),c},getCaptcha:()=>g("/captcha"),register:(a,b,c,d)=>g("/auth/register",{method:"POST",body:JSON.stringify({email:a,password:b,username:c,captcha_id:d?.id,captcha_answer:d?.answer,captcha_sig:d?.sig})}),logout(){f(null)},getMe:()=>g("/auth/me"),getPosts(a,b,c=1,d=20){let e="/posts?sort="+(a||"latest")+"&page="+c+"&limit="+d;return b&&(e+="&user_id="+b),g(e)},getPost:a=>g("/posts/"+a),createPost:(a,b,c,d)=>g("/posts",{method:"POST",body:JSON.stringify({title:a,content:b,images:c||[],captcha_id:d?.id,captcha_answer:d?.answer,captcha_sig:d?.sig})}),updatePost:(a,b,c,d)=>g("/posts/"+a,{method:"PUT",body:JSON.stringify({title:b,content:c,images:d})}),togglePinPost:a=>g("/posts/"+a+"/pin",{method:"PUT"}),deletePost:a=>g("/posts/"+a,{method:"DELETE"}),getReplies:a=>g("/posts/"+a+"/replies"),createReply:(a,b,c,d)=>g("/posts/"+a+"/replies",{method:"POST",body:JSON.stringify({content:b,captcha_id:c?.id,captcha_answer:c?.answer,captcha_sig:c?.sig,reply_to_id:d||null})}),deleteReply:a=>g("/replies/"+a,{method:"DELETE"}),getUsers:()=>g("/users"),getUsersByUsername:a=>g("/users?username="+encodeURIComponent(a)),getUserProfile:a=>g("/users/profile/"+encodeURIComponent(a)),updateUserRole:(a,b)=>g("/users/"+a+"/role",{method:"PUT",body:JSON.stringify({role:b})}),updateProfile:(a,b,c,d)=>g("/users/"+a,{method:"PUT",body:JSON.stringify({username:b,bio:c,signature:d})}),updateAvatar:(a,b)=>g("/users/"+a+"/avatar",{method:"PUT",body:JSON.stringify({avatar_url:b})}),updatePassword:(a,b,c)=>g("/users/"+a+"/password",{method:"PUT",body:JSON.stringify({oldPassword:b,newPassword:c})}),updateEmail:(a,b,c)=>g("/users/"+a+"/email",{method:"PUT",body:JSON.stringify({password:b,newEmail:c})}),getReports:()=>g("/reports"),createReport:(a,b)=>g("/reports",{method:"POST",body:JSON.stringify({post_id:a,reason:b})}),updateReport:(a,b,c)=>g("/reports/"+a,{method:"PUT",body:JSON.stringify({status:b,note:c})}),getStats:()=>g("/stats"),getSettings:()=>g("/settings"),updateSettings:a=>g("/settings",{method:"PUT",body:JSON.stringify({forum_name:a})}),getLinks:()=>g("/links"),addLink:(a,b)=>g("/links",{method:"POST",body:JSON.stringify({title:a,url:b})}),deleteLink:a=>g("/links/"+a,{method:"DELETE"}),getEventLogs:()=>g("/event-logs"),logEvent:a=>g("/event-logs",{method:"POST",body:JSON.stringify({action:a})}).catch(()=>{}),getConversations:()=>g("/conversations"),getOrCreateConversation:a=>g("/conversations",{method:"POST",body:JSON.stringify({other_user_id:a})}),getMessages:a=>g("/conversations/"+a+"/messages"),sendMessage:(a,b)=>g("/conversations/"+a+"/messages",{method:"POST",body:JSON.stringify({content:b})}),markMessageRead:a=>g("/messages/"+a+"/read",{method:"PUT"}),getCustomPages:()=>g("/custom-pages"),getCustomPage:a=>g("/custom-pages/"+a),adminGetCustomPages:()=>g("/admin/custom-pages"),adminCreateCustomPage:(a,b,c)=>g("/admin/custom-pages",{method:"POST",body:JSON.stringify({name:a,title:b,content:c})}),adminUpdateCustomPage:(a,b,c,d)=>g("/admin/custom-pages/"+a,{method:"PUT",body:JSON.stringify({title:b,content:c,enabled:d})}),adminDeleteCustomPage:a=>g("/admin/custom-pages/"+a,{method:"DELETE"}),uploadCustomCss(a){let b=new FormData;b.append("file",a);let c={};return e&&(c.Authorization="Bearer "+e),fetch("/api/admin/custom-css",{method:"POST",body:b,headers:c}).then(async a=>{let b=await a.json().catch(()=>({}));if(!a.ok||b.error)throw Error(b.error||"上传失败");return b})},deleteCustomCss:()=>g("/admin/custom-css",{method:"DELETE"}),getNotifications:()=>g("/notifications"),markNotificationRead:a=>g("/notifications/"+a+"/read",{method:"PUT"}),markAllNotificationsRead:()=>g("/notifications/read-all",{method:"PUT"}),generateRecoveryCodes:()=>g("/auth/recovery-codes/generate",{method:"POST"}),getRecoveryCodeCount:()=>g("/auth/recovery-codes/count"),resetPassword:(a,b,c)=>g("/auth/reset-password",{method:"POST",body:JSON.stringify({email:a,recoveryCode:b,newPassword:c})})};async function i(a){let b=new FormData;b.append("file",a);let c={};e&&(c.Authorization="Bearer "+e);let d=await fetch("/api/upload",{method:"POST",body:b,headers:c}),f=await d.json().catch(()=>({}));if(!d.ok||f.error)throw Error(f.error||"上传失败");return f.url}let j=(0,c.createContext)(null),k=[[".post-avatar","post-avatar"],[".post-username","post-author"],[".post-title","post-heading"],[".post-time","post-time"],Line truncated
]`).replace("lheading",N).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ab=/^( {2,}|\\)\n(?!\s*$)/,ac=/[\p{P}\p{S}]/u,ad=/[\s\p{P}\p{S}]/u,ae=/[^\s\p{P}\p{S}]/u,af=H(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ad).getRegex(),ag=/(?!~)[\p{P}\p{S}]/u,ah=H(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",I?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ai=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,aj=H(ai,"u").replace(/punct/g,ac).getRegex(),ak=H(ai,"u").replace(/punct/g,ag).getRegex(),al=H(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,"u").replace(/openQuote/g,/[\p{Pi}\p{Ps}"']/u).replace(/punct/g,ac).getRegex(),am="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",an=H(am,"gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,ad).replace(/punct/g,ac).getRegex(),ao=H(am,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,ag).getRegex(),ap=H("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,ad).replace(/punct/g,ac).getRegex(),aq=H("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,ad).replace(/punct/g,ac).getRegex(),ar=H("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,ad).replace(/punct/g,ac).getRegex(),as=H(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ac).getRegex(),at=H("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,ad).replace(/punct/g,ac).getRegex(),au=H(/\\(punct)/,"gu").replace(/punct/g,ac).getRegex(),av=H(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),aw=H(U).replace("(?:-->|$)","-->").getRegex(),ax=H("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",aw).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ay=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,az=H(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ay).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),aA=H(/^!?\[(label)\]\[(ref)\]/).replace("label",ay).replace("ref",Q).getRegex(),aB=H(/^!?\[(ref)\](?:\[\])?/).replace("ref",Q).getRegex(),aC=H("reflink|nolink(?!\\()","g").replace("reflink",aA).replace("nolink",aB).getRegex(),aD=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,aE={_backpedal:F,anyPunctuation:au,autolink:av,blockSkip:ah,br:ab,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:F,delLDelim:F,delRDelim:F,emStrongLDelim:aj,emStrongRDelimAst:an,emStrongRDelimUnd:aq,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:az,nolink:aB,punctuation:af,reflink:aA,reflinkSearch:aC,tag:ax,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:F},aF={...aE,emStrongLDelim:al,emStrongRDelimAst:ap,emStrongRDelimUnd:ar,link:H(/^!?\[(label)\]\((.*?)\)/).replace("label",ay).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ay).getRegex()},aG={...aE,emStrongRDelimAst:ao,emStrongLDelim:ak,delLDelim:as,delRDelim:at,url:H(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",aD).replace("email",/Line truncated
`),c=b.length-1;for(;c>=0&&J.blankLine.test(b[c]);)c--;return b.length-c<=2?a:b.slice(0,c+1).join(`
`)}function aR(a,b,c,d,e){let f=b.href,g=b.title||null,h=a[1].replace(e.other.outputLinkReplace,"$1");d.state.inLink=!0;let i={type:"!"===a[0].charAt(0)?"image":"link",raw:c,href:f,title:g,text:h,tokens:d.inlineTokens(h)};return d.state.inLink=!1,i}var aS=class{options;rules;lexer;constructor(a){this.options=a||E}space(a){let b=this.rules.block.newline.exec(a);if(b&&b[0].length>0)return{type:"space",raw:b[0]}}code(a){let b=this.rules.block.code.exec(a);if(b){let a=this.options.pedantic?b[0]:aQ(b[0]),c=a.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:a,codeBlockStyle:"indented",text:c}}}fences(a){let b=this.rules.block.fences.exec(a);if(b){let a=b[0],c=function(a,b,c){let d=a.match(c.other.indentCodeCompensation);if(null===d)return b;let e=d[1];return b.split(`
`).map(a=>{let b=a.match(c.other.beginningSpace);if(null===b)return a;let[d]=b;return d.length>=e.length?a.slice(e.length):a}).join(`
`)}(a,b[3]||"",this.rules);return{type:"code",raw:a,lang:b[2]?b[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):b[2],text:c}}}heading(a){let b=this.rules.block.heading.exec(a);if(b){let a=b[2].trim();if(this.rules.other.endingHash.test(a)){let b=aP(a,"#");(this.options.pedantic||!b||this.rules.other.endingSpaceChar.test(b))&&(a=b.trim())}return{type:"heading",raw:aP(b[0],`
`),depth:b[1].length,text:a,tokens:this.lexer.inline(a)}}}hr(a){let b=this.rules.block.hr.exec(a);if(b)return{type:"hr",raw:aP(b[0],`
`)}}blockquote(a){let b=this.rules.block.blockquote.exec(a);if(b){let a=aP(b[0],`
`).split(`
`),c="",d="",e=[];for(;a.length>0;){let b=!1,f=[],g;for(g=0;g<a.length;g++)if(this.rules.other.blockquoteStart.test(a[g]))f.push(a[g]),b=!0;else if(b)break;else f.push(a[g]);a=a.slice(g);let h=f.join(`
`),i=h.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
${h}`:h,d=d?`${d}
${i}`:i;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(i,e,!0),this.lexer.state.top=j,0===a.length)break;let k=e.at(-1);if(k?.type==="code")break;if(k?.type==="blockquote"){let b=a.join(`
`),f=k.raw+`
`+b.replace(this.rules.other.blockquoteSetextReplace2,""),g=this.blockquote(f);e[e.length-1]=g,c=`${c}
${b}`,d=d.substring(0,d.length-k.text.length)+g.text;break}if(k?.type==="list"){let b=k.raw+`
`+a.join(`
`),f=this.list(b);e[e.length-1]=f,c=c.substring(0,c.length-k.raw.length)+f.raw,d=d.substring(0,d.length-k.raw.length)+f.raw,a=b.substring(e.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:c,tokens:e,text:d}}}list(a){let b=this.rules.block.list.exec(a);if(b){let c=b[1].trim(),d=c.length>1,e={type:"list",raw:"",ordered:d,start:d?+c.slice(0,-1):"",loose:!1,items:[]};c=d?`\\d{1,9}\\${c.slice(-1)}`:`\\${c}`,this.options.pedantic&&(c=d?c:"[*+-]");let f=this.rules.other.listItemRegex(c),g=!1;for(;a;){let c=!1,d="",h="";if(!(b=f.exec(a))||this.rules.block.hr.test(a))break;d=b[0],a=a.substring(d.length);let i=function(a,b=0){let c=b,d="";for(let b of a)if(" "===b){let a=4-c%4;d+=" ".repeat(a),c+=a}else d+=b,c++;return d}(b[2].split(`
`,1)[0],b[1].length),j=a.split(`
`,1)[0],k=!i.trim(),l=0;if(this.options.pedantic?(l=2,h=i.trimStart()):k?l=b[1].length+1:(l=(l=i.search(this.rules.other.nonSpaceChar))>4?1:l,h=i.slice(l),l+=b[1].length),k&&this.rules.other.blankLine.test(j)&&(d+=j+`
`,a=a.substring(j.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(l),c=this.rules.other.hrRegex(l),e=this.rules.other.fencesBeginRegex(l),f=this.rules.other.headingBeginRegex(l),g=this.rules.other.htmlBeginRegex(l),m=this.rules.other.blockquoteBeginRegex(l);for(;a;){let n=a.split(`
`,1)[0],o;if(j=n,o=this.options.pedantic?j=j.replace(this.rules.other.listReplaceNesting," "):j.replace(this.rules.other.tabCharGlobal," "),e.test(j)||f.test(j)||g.test(j)||m.test(j)||b.test(j)||c.test(j))break;if(o.search(this.rules.other.nonSpaceChar)>=l||!j.trim())h+=`
`+o.slice(l);else{if(k||i.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||e.test(i)||f.test(i)||c.test(i))break;h+=`
`+j}k=!j.trim(),d+=n+`
`,a=a.substring(n.length+1),i=o.slice(l)}}e.loose||(g?e.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(g=!0)),e.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),e.raw+=d}let h=e.items.at(-1);if(!h)return;for(let a of(h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd(),e.raw=e.raw.trimEnd(),e.items)){this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]);let b=a.tokens[0];if(a.task&&(b?.type==="text"||b?.type==="paragraph")){a.text=a.text.replace(this.rules.other.listReplaceTask,""),b.raw=b.raw.replace(this.rules.other.listReplaceTask,""),b.text=b.text.replace(this.rules.other.listReplaceTask,"");for(let a=this.lexer.inlineQueue.length-1;a>=0;a--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[a].src)){this.lexer.inlineQueue[a].src=this.lexer.inlineQueue[a].src.replace(this.rules.other.listReplaceTask,"");break}let c=this.rules.other.listTaskCheckbox.exec(a.raw);if(c){let b={type:"checkbox",raw:c[0]+" ",checked:"[ ]"!==c[0]};a.checked=b.checked,e.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=b.raw+a.tokens[0].raw,a.tokens[0].text=b.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(b)):a.tokens.unshift({type:"paragraph",raw:b.raw,text:b.raw,tokens:[b]}):a.tokens.unshift(b)}}else a.task&&(a.task=!1);if(!e.loose){let b=a.tokens.filter(a=>"space"===a.type);e.loose=b.length>0&&b.some(a=>this.rules.other.anyLine.test(a.raw))}}if(e.loose)for(let a of e.items)for(let b of(a.loose=!0,a.tokens))"text"===b.type&&(b.type="paragraph");return e}}html(a){let b=this.rules.block.html.exec(a);if(b){let a=aQ(b[0]);return{type:"html",block:!0,raw:a,pre:"pre"===b[1]||"script"===b[1]||"style"===b[1],text:a}}}def(a){let b=this.rules.block.def.exec(a);if(b){let a=b[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=b[2]?b[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=b[3]?b[3].substring(1,b[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):b[3];return{type:"def",tag:a,raw:aP(b[0],`
`),href:c,title:d}}}table(a){let b=this.rules.block.table.exec(a);if(!b||!this.rules.other.tableDelimiter.test(b[2]))return;let c=aO(b[1]),d=b[2].replace(this.rules.other.tableAlignChars,"").split("|"),e=b[3]?.trim()?b[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],f={type:"table",raw:aP(b[0],`
`),header:[],align:[],rows:[]};if(c.length===d.length){for(let a of d)this.rules.other.tableAlignRight.test(a)?f.align.push("right"):this.rules.other.tableAlignCenter.test(a)?f.align.push("center"):this.rules.other.tableAlignLeft.test(a)?f.align.push("left"):f.align.push(null);for(let a=0;a<c.length;a++)f.header.push({text:c[a],tokens:this.lexer.inline(c[a]),header:!0,align:f.align[a]});for(let a of e)f.rows.push(aO(a,f.header.length).map((a,b)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:f.align[b]})));return f}}lheading(a){let b=this.rules.block.lheading.exec(a);if(b){let a=b[1].trim();return{type:"heading",raw:aP(b[0],`
`),depth:"="===b[2].charAt(0)?1:2,text:a,tokens:this.lexer.inline(a)}}}paragraph(a){let b=this.rules.block.paragraph.exec(a);if(b){let a=b[1].charAt(b[1].length-1)===`
`?b[1].slice(0,-1):b[1];return{type:"paragraph",raw:b[0],text:a,tokens:this.lexer.inline(a)}}}text(a){let b=this.rules.block.text.exec(a);if(b)return{type:"text",raw:b[0],text:b[0],tokens:this.lexer.inline(b[0])}}escape(a){let b=this.rules.inline.escape.exec(a);if(b)return{type:"escape",raw:b[0],text:b[1]}}tag(a){let b=this.rules.inline.tag.exec(a);if(b)return!this.lexer.state.inLink&&this.rules.other.startATag.test(b[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(b[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(b[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(b[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:b[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:b[0]}}link(a){let b=this.rules.inline.link.exec(a);if(b){let a=b[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let b=aP(a.slice(0,-1),"\\");if((a.length-b.length)%2==0)return}else{let a=function(a){if(-1===a.indexOf(")"))return -1;let b=0;for(let c=0;c<a.length;c++)if("\\"===a[c])c++;else if("("===a[c])b++;else if(")"===a[c]&&--b<0)return c;return b>0?-2:-1}(b[2]);if(-2===a)return;if(a>-1){let c=(0===b[0].indexOf("!")?5:4)+b[1].length+a;b[2]=b[2].substring(0,a),b[0]=b[0].substring(0,c).trim(),b[3]=""}}let c=b[2],d="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(c);a&&(c=a[1],d=a[3])}else d=b[3]?b[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(c=this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?c.slice(1):c.slice(1,-1)),aR(b,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},b[0],this.lexer,this.rules)}}reflink(a,b){let c;if((c=this.rules.inline.reflink.exec(a))||(c=this.rules.inline.nolink.exec(a))){let a=b[(c[2]||c[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!a){let a=c[0].charAt(0);return{type:"text",raw:a,text:a}}return aR(c,a,c[0],this.lexer,this.rules)}}emStrong(a,b,c=""){let d=this.rules.inline.emStrongLDelim.exec(a);if(!(!d||!d[1]&&!d[2]&&!d[3]&&!d[4]||d[4]&&c.match(this.rules.other.unicodeAlphaNumeric))&&(!(d[1]||d[3])||!c||this.rules.inline.punctuation.exec(c))){let e=[...d[0]].length-1,f,g,h=e,i=0,j=d[0][0],k=c===j,l="*"===j?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,b=b.slice(-1*a.length+e);null!==(d=l.exec(b));){if(!(f=d[1]||d[2]||d[3]||d[4]||d[5]||d[6]))continue;if(g=[...f].length,d[3]||d[4]){h+=g;continue}if(d[5]||d[6]){if(e%3&&!((e+g)%3)){i+=g;continue}if(k)break}if((h-=g)>0)continue;g=Math.min(g,g+h+i);let b=[...d[0]][0].length,c=a.slice(0,e+d.index+b+g);if(Math.min(e,g)%2){let a=c.slice(1,-1);return{type:"em",raw:c,text:a,tokens:this.lexer.inlineTokens(a)}}let j=c.slice(2,-2);return{type:"strong",raw:c,text:j,tokens:this.lexer.inlineTokens(j)}}}}codespan(a){let b=this.rules.inline.code.exec(a);if(b){let a=b[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(a),d=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return c&&d&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:b[0],text:a}}}br(a){let b=this.rules.inline.br.exec(a);if(b)return{type:"br",raw:b[0]}}del(a,b,c=""){let d=this.rules.inline.delLDelim.exec(a);if(d&&(!d[1]||!c||this.rules.inline.punctuation.exec(c))){let c=[...d[0]].length-1,e,f,g=c,h=this.rules.inline.delRDelim;for(h.lastIndex=0,b=b.slice(-1*a.length+c);null!==(d=h.exec(b));){if(!(e=d[1]||d[2]||d[3]||d[4]||d[5]||d[6])||(f=[...e].length)!==c)continue;if(d[3]||d[4]){g+=f;continue}if((g-=f)>0)continue;f=Math.min(f,f+g);let b=[...d[0]][0].length,h=a.slice(0,c+d.index+b+f),i=h.slice(c,-c);return{type:"del",raw:h,text:i,tokens:this.lexer.inlineTokens(i)}}}}autolink(a){let b=this.rules.inline.autolink.exec(a);if(b){let a,c;return c="@"===b[2]?"mailto:"+(a=b[1]):a=b[1],{type:"link",raw:b[0],text:a,href:c,tokens:[{type:"text",raw:a,text:a}]}}}url(a){let b;if(b=this.rules.inline.url.exec(a)){let a,c;if("@"===b[2])c="mailto:"+(a=b[0]);else{let d;do d=b[0],b[0]=this.rules.inline._backpedal.exec(b[0])?.[0]??"";while(d!==b[0])a=b[0],c="www."===b[1]?"http://"+b[0]:b[0]}return{type:"link",raw:b[0],text:a,href:c,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(a){let b=this.rules.inline.text.exec(a);if(b){let a=this.lexer.state.inRawBlock;return{type:"text",raw:b[0],text:b[0],escaped:a}}}},aT=class a{tokens;options;state;inlineQueue;tokenizer;constructor(a){this.tokens=[],this.tokens.links=Object.create(null),this.options=a||E,this.options.tokenizer=this.options.tokenizer||new aS,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let b={other:J,block:aI.norm Line truncated
`),this.blockTokens(a,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let b=this.inlineQueue[a];this.inlineTokens(b.src,b.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(a,b=[],c=!1){this.tokenizer.lexer=this,this.options.pedantic&&(a=a.replace(J.tabCharGlobal," ").replace(J.spaceLine,""));let d=1/0;for(;a;){let e;if(a.length<d)d=a.length;else{this.infiniteLoopError(a.charCodeAt(0));break}if(this.options.extensions?.block?.some(c=>!!(e=c.call({lexer:this},a,b))&&(a=a.substring(e.raw.length),b.push(e),!0)))continue;if(e=this.tokenizer.space(a)){a=a.substring(e.raw.length);let c=b.at(-1);1===e.raw.length&&void 0!==c?c.raw+=`
`:b.push(e);continue}if(e=this.tokenizer.code(a)){a=a.substring(e.raw.length);let c=b.at(-1);c?.type==="paragraph"||c?.type==="text"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+e.raw,c.text+=`
`+e.text,this.inlineQueue.at(-1).src=c.text):b.push(e);continue}if((e=this.tokenizer.fences(a))||(e=this.tokenizer.heading(a))||(e=this.tokenizer.hr(a))||(e=this.tokenizer.blockquote(a))||(e=this.tokenizer.list(a))||(e=this.tokenizer.html(a))){a=a.substring(e.raw.length),b.push(e);continue}if(e=this.tokenizer.def(a)){a=a.substring(e.raw.length);let c=b.at(-1);c?.type==="paragraph"||c?.type==="text"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+e.raw,c.text+=`
`+e.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[e.tag]||(this.tokens.links[e.tag]={href:e.href,title:e.title},b.push(e));continue}if((e=this.tokenizer.table(a))||(e=this.tokenizer.lheading(a))){a=a.substring(e.raw.length),b.push(e);continue}let f=a;if(this.options.extensions?.startBlock){let b=1/0,c=a.slice(1),d;this.options.extensions.startBlock.forEach(a=>{"number"==typeof(d=a.call({lexer:this},c))&&d>=0&&(b=Math.min(b,d))}),b<1/0&&b>=0&&(f=a.substring(0,b+1))}if(this.state.top&&(e=this.tokenizer.paragraph(f))){let d=b.at(-1);c&&d?.type==="paragraph"?(d.raw+=(d.raw.endsWith(`
`)?"":`
`)+e.raw,d.text+=`
`+e.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):b.push(e),c=f.length!==a.length,a=a.substring(e.raw.length);continue}if(e=this.tokenizer.text(a)){a=a.substring(e.raw.length);let c=b.at(-1);c?.type==="text"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+e.raw,c.text+=`
`+e.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):b.push(e);continue}if(a){this.infiniteLoopError(a.charCodeAt(0));break}}return this.state.top=!0,b}inline(a,b=[]){return this.inlineQueue.push({src:a,tokens:b}),b}inlineTokens(a,b=[]){this.tokenizer.lexer=this;let c=a;if(this.tokens.links){let a=Object.keys(this.tokens.links);a.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,b=>a.includes(b.slice(b.lastIndexOf("[")+1,-1))?"["+"a".repeat(b.length-2)+"]":b))}c=(c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++")).replace(this.tokenizer.rules.inline.blockSkip,(a,b,c)=>{let d=c?c.length:0;return a.slice(0,d)+"["+"a".repeat(a.length-d-2)+"]"}),c=this.options.hooks?.emStrongMask?.call({lexer:this},c)??c;let d=!1,e="",f=1/0;for(;a;){let g;if(a.length<f)f=a.length;else{this.infiniteLoopError(a.charCodeAt(0));break}if(d||(e=""),d=!1,this.options.extensions?.inline?.some(c=>!!(g=c.call({lexer:this},a,b))&&(a=a.substring(g.raw.length),b.push(g),!0)))continue;if((g=this.tokenizer.escape(a))||(g=this.tokenizer.tag(a))||(g=this.tokenizer.link(a))){a=a.substring(g.raw.length),b.push(g);continue}if(g=this.tokenizer.reflink(a,this.tokens.links)){a=a.substring(g.raw.length);let c=b.at(-1);"text"===g.type&&c?.type==="text"?(c.raw+=g.raw,c.text+=g.text):b.push(g);continue}if((g=this.tokenizer.emStrong(a,c,e))||(g=this.tokenizer.codespan(a))||(g=this.tokenizer.br(a))||(g=this.tokenizer.del(a,c,e))||(g=this.tokenizer.autolink(a))||!this.state.inLink&&(g=this.tokenizer.url(a))){a=a.substring(g.raw.length),b.push(g);continue}let h=a;if(this.options.extensions?.startInline){let b=1/0,c=a.slice(1),d;this.options.extensions.startInline.forEach(a=>{"number"==typeof(d=a.call({lexer:this},c))&&d>=0&&(b=Math.min(b,d))}),b<1/0&&b>=0&&(h=a.substring(0,b+1))}if(g=this.tokenizer.inlineText(h)){a=a.substring(g.raw.length),"_"!==g.raw.slice(-1)&&(e=g.raw.slice(-1)),d=!0;let c=b.at(-1);c?.type==="text"?(c.raw+=g.raw,c.text+=g.text):b.push(g);continue}if(a){this.infiniteLoopError(a.charCodeAt(0));break}}return b}infiniteLoopError(a){let b="Infinite loop on byte: "+a;if(this.options.silent)console.error(b);else throw Error(b)}},aU=class{options;parser;constructor(a){this.options=a||E}space(a){return""}code({text:a,lang:b,escaped:c}){let d=(b||"").match(J.notSpaceStart)?.[0],e=a.replace(J.endingNewline,"")+`
`;return d?'<pre><code class="language-'+aM(d)+'">'+(c?e:aM(e,!0))+`</code></pre>
`:"<pre><code>"+(c?e:aM(e,!0))+`</code></pre>
`}blockquote({tokens:a}){return`<blockquote>
${this.parser.parse(a)}</blockquote>
`}html({text:a}){return a}def(a){return""}heading({tokens:a,depth:b}){return`<h${b}>${this.parser.parseInline(a)}</h${b}>
`}hr(a){return`<hr>
`}list(a){let b=a.ordered,c=a.start,d="";for(let b=0;b<a.items.length;b++){let c=a.items[b];d+=this.listitem(c)}let e=b?"ol":"ul";return"<"+e+(b&&1!==c?' start="'+c+'"':"")+`>
`+d+"</"+e+`>
`}listitem(a){return`<li>${this.parser.parse(a.tokens)}</li>
`}checkbox({checked:a}){return"<input "+(a?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:a}){return`<p>${this.parser.parseInline(a)}</p>
`}table(a){let b="",c="";for(let b=0;b<a.header.length;b++)c+=this.tablecell(a.header[b]);b+=this.tablerow({text:c});let d="";for(let b=0;b<a.rows.length;b++){let e=a.rows[b];c="";for(let a=0;a<e.length;a++)c+=this.tablecell(e[a]);d+=this.tablerow({text:c})}return d&&(d=`<tbody>${d}</tbody>`),`<table>
<thead>
`+b+`</thead>
`+d+`</table>
`}tablerow({text:a}){return`<tr>
${a}</tr>
`}tablecell(a){let b=this.parser.parseInline(a.tokens),c=a.header?"th":"td";return(a.align?`<${c} align="${a.align}">`:`<${c}>`)+b+`</${c}>
`}strong({tokens:a}){return`<strong>${this.parser.parseInline(a)}</strong>`}em({tokens:a}){return`<em>${this.parser.parseInline(a)}</em>`}codespan({text:a}){return`<code>${aM(a,!0)}</code>`}br(a){return"<br>"}del({tokens:a}){return`<del>${this.parser.parseInline(a)}</del>`}link({href:a,title:b,tokens:c}){let d=this.parser.parseInline(c),e=aN(a);if(null===e)return d;let f='<a href="'+(a=e)+'"';return b&&(f+=' title="'+aM(b)+'"'),f+=">"+d+"</a>"}image({href:a,title:b,text:c,tokens:d}){d&&(c=this.parser.parseInline(d,this.parser.textRenderer));let e=aN(a);if(null===e)return aM(c);a=e;let f=`<img src="${a}" alt="${aM(c)}"`;return b&&(f+=` title="${aM(b)}"`),f+=">"}text(a){return"tokens"in a&&a.tokens?this.parser.parseInline(a.tokens):"escaped"in a&&a.escaped?a.text:aM(a.text)}},aV=class{strong({text:a}){return a}em({text:a}){return a}codespan({text:a}){return a}del({text:a}){return a}html({text:a}){return a}text({text:a}){return a}link({text:a}){return""+a}image({text:a}){return""+a}br(){return""}checkbox({raw:a}){return a}},aW=class a{options;renderer;textRenderer;constructor(a){this.options=a||E,this.options.renderer=this.options.renderer||new aU,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new aV}static parse(b,c){return new a(c).parse(b)}static parseInline(b,c){return new a(c).parseInline(b)}parse(a){this.renderer.parser=this;let b="";for(let c=0;c<a.length;c++){let d=a[c];if(this.options.extensions?.renderers?.[d.type]){let a=this.options.extensions.renderers[d.type].call({parser:this},d);if(!1!==a||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(d.type)){b+=a||"";continue}}switch(d.type){case"space":b+=this.renderer.space(d);break;case"hr":b+=this.renderer.hr(d);break;case"heading":b+=this.renderer.heading(d);break;case"code":b+=this.renderer.code(d);break;case"table":b+=this.renderer.table(d);break;case"blockquote":b+=this.renderer.blockquote(d);break;case"list":b+=this.renderer.list(d);break;case"checkbox":b+=this.renderer.checkbox(d);break;case"html":b+=this.renderer.html(d);break;case"def":b+=this.renderer.def(d);break;case"paragraph":b+=this.renderer.paragraph(d);break;case"text":b+=this.renderer.text(d);break;default:{let a='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw Error(a)}}}return b}parseInline(a,b=this.renderer){this.renderer.parser=this;let c="";for(let d=0;d<a.length;d++){let e=a[d];if(this.options.extensions?.renderers?.[e.type]){let a=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==a||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(e.type)){c+=a||"";continue}}switch(e.type){case"escape":case"text":c+=b.text(e);break;case"html":c+=b.html(e);break;case"link":c+=b.link(e);break;case"image":c+=b.image(e);break;case"checkbox":c+=b.checkbox(e);break;case"strong":c+=b.strong(e);break;case"em":c+=b.em(e);break;case"codespan":c+=b.codespan(e);break;case"br":c+=b.br(e);break;case"del":c+=b.del(e);break;default:{let a='Token with "'+e.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw Error(a)}}}return c}},aX=class{options;block;constructor(a){this.options=a||E}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(a){return a}postprocess(a){return a}processAllTokens(a){return a}emStrongMask(a){return a}provideLexer(a=this.block){return a?aT.lex:aT.lexInline}provideParser(a=this.block){return a?aW.parse:aW.parseInline}},aY=new class{defaults=D();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=aW;Renderer=aU;TextRenderer=aV;Lexer=aT;Tokenizer=aS;Hooks=aX;constructor(...a){this.use(...a)}walkTokens(a,b){let c=[];for(let d of a)switch(c=c.concat(b.call(this,d)),d.type){case"table":for(let a of d.header)c=c.concat(this.walkTokens(a.tokens,b));for(let a of d.rows)for(let d of a)c=c.concat(this.walkTokens(d.tokens,b));break;case"list":c=c.concat(this.walkTokens(d.items,b));break;default:{let a=d;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(d=>{let e=a[d].flat(1/0);c=c.concat(this.walkTokens(e,b))}):a.tokens&&(c=c.concat(this.walkTokens(a.tokens,b)))}}return c}use(...a){let b=this.defaults.extensions||{renderers:{},childTokens:{}};return a.forEach(a=>{let c={...a};if(c.async=this.defaults.async||c.async||!1,a.extensions&&(a.extensions.forEach(a=>{if(!a.name)throw Error("extension name required");if("renderer"in a){let c=b.renderers[a.name];c?b.renderers[a.name]=function(...b){let d=a.renderer.apply(this,b);return!1===d&&(d=c.apply(this,b)),d}:b.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||"block"!==a.level&&"inline"!==a.level)throw Error("extension leveLine truncated
Please report this to https://github.com/markedjs/marked.`,a){let a="<p>An error occurred:</p><pre>"+aM(c.message+"",!0)+"</pre>";return b?Promise.resolve(a):a}if(b)return Promise.reject(c);throw c}}};function aZ(a,b){return aY.parse(a,b)}aZ.options=aZ.setOptions=function(a){return aY.setOptions(a),aZ.defaults=aY.defaults,E=aZ.defaults,aZ},aZ.getDefaults=D,aZ.defaults=E,aZ.use=function(...a){return aY.use(...a),aZ.defaults=aY.defaults,E=aZ.defaults,aZ},aZ.walkTokens=function(a,b){return aY.walkTokens(a,b)},aZ.parseInline=aY.parseInline,aZ.Parser=aW,aZ.parser=aW.parse,aZ.Renderer=aU,aZ.TextRenderer=aV,aZ.Lexer=aT,aZ.lexer=aT.lex,aZ.Tokenizer=aS,aZ.Hooks=aX,aZ.parse=aZ,aZ.options,aZ.setOptions,aZ.walkTokens,aZ.parseInline,aW.parse,aT.lex;var a$=a.i(38842);let a_={allowedTags:["p","br","hr","strong","em","b","i","u","s","del","ins","a","img","code","pre","blockquote","ul","ol","li","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","th","td","span","div"],allowedAttributes:{a:["href","target","rel","title"],img:["src","alt","title","width","height"],code:["class"],pre:["class"],span:["class"],div:["class"],th:["align","colspan","rowspan"],td:["align","colspan","rowspan"],table:["align","border","cellpadding","cellspacing"]},allowedSchemes:["http","https","mailto"],allowedSchemesByTag:{img:["http","https"]},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!1,disallowedTagsMode:"discard"};function a0(a){if(!a)return"";try{let b=aZ.parse(a);return(0,a$.default)(b,a_)}catch{return(0,a$.default)(a.replace(/\n/g,"<br>"),a_)}}function a1({onOpenModal:a,onReport:d}){let{currentUser:e,sort:f,setSort:g,openPost:i,openUser:j,navigate:k,refreshKey:l}=o(),{t:m}=(0,q.useTranslation)(),{toast:n,confirmAction:p}=(0,t.useToast)(),[s,u]=(0,c.useState)(null),[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(1),[B,D]=(0,c.useState)(1),[E,F]=(0,c.useState)(null),[G,H]=(0,c.useState)(f),[I,J]=(0,c.useState)("idle"),K=(0,c.useRef)(null),L=(0,c.useRef)(null),M=(0,c.useRef)(null),N=(0,c.useCallback)(async a=>{w(null);try{let b=await h.getPosts(f,null,a,20);u(b.data||[]),D(b.pagination?.totalPages||1),A(b.pagination?.page||1)}catch(a){w(a.message),u([])}finally{M.current===f&&requestAnimationFrame(()=>{J("opening"),L.current=setTimeout(()=>{M.current=null,J("idle")},360)})}},[f,l]);(0,c.useEffect)(()=>{N(z)},[N]),(0,c.useEffect)(()=>{s&&0!==s.length&&K.current&&K.current.querySelectorAll(".post-content").forEach(a=>{a.scrollHeight>a.clientHeight+4?a.classList.add("has-fade"):a.classList.remove("has-fade")})},[s]),(0,c.useEffect)(()=>{A(1)},[f]),(0,c.useEffect)(()=>()=>clearTimeout(L.current),[]);let O=a=>{if(a!==G){if(H(a),clearTimeout(L.current),a===f){M.current=null,J("opening"),L.current=setTimeout(()=>J("idle"),360);return}J("closing"),L.current=setTimeout(()=>{M.current=a,J("closed"),g(a)},220)}},P=async a=>{if(await p(m("feed.confirmDelete")))try{await h.deletePost(a),N(z)}catch(a){n(m("feed.deleteFailed",{msg:a.message}),"error")}};return(0,b.jsxs)("main",{id:"feed",children:[(0,b.jsxs)("div",{className:"feed-header",children:[(0,b.jsxs)("div",{className:"feed-header-left",children:[(0,b.jsx)("button",{className:"tab"+("latest"===G?" active":""),onClick:()=>O("latest"),children:m("feed.latest")}),(0,b.jsx)("button",{className:"tab"+("hot"===G?" active":""),onClick:()=>O("hot"),children:m("feed.hot")})]}),(0,b.jsxs)("button",{className:"btn-primary fab-btn",onClick:()=>{e?k("new"):n(m("newPost.pleaseLogin"),"warning")},children:[(0,b.jsx)(r.Icon,{name:"plus"})," ",m("feed.newPost")]})]}),(0,b.jsx)("div",{className:"feed-posts-drawer "+I,children:(0,b.jsx)("div",{className:"feed-posts-drawer-inner",children:(0,b.jsx)("div",{id:"postList",ref:K,children:null===s?(0,b.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:"40px 0"},children:[(0,b.jsx)("span",{className:"spinner-sm"}),m("feed.loading")]}):v?(0,b.jsx)("div",{style:{textAlign:"center",color:"#ef4444",padding:"40px 0"},children:m("feed.loadFailed",{msg:v})}):0===s.length?(0,b.jsx)("div",{style:{textAlign:"center",color:"#94a3b8",padding:"60px 0"},children:m("feed.empty")}):s.map(a=>{let c=a.created_at?new Date(a.created_at).toLocaleString("zh-CN"):"";return(0,b.jsxs)("div",{className:"post-card","data-post-id":a.id,style:{cursor:"pointer"},onClick:b=>i(a.id,b.currentTarget,a),children:[a.is_pinned&&(0,b.jsxs)("div",{className:"post-pin-state",style:{width:"fit-content",display:"flex",alignItems:"center",gap:3,fontSize:12,color:"var(--primary)",fontWeight:600,marginBottom:4},children:[(0,b.jsx)(r.Icon,{name:"pin",size:12})," ",m("feed.pinned")]}),(0,b.jsxs)("div",{className:"post-header",children:[(0,b.jsx)("img",{src:a.avatar_url||"https://ui-avatars.com/api/?name="+encodeURIComponent(a.username||"匿名用户")+"&background=6366f1&color=fff&size=64",className:"post-avatar",alt:""}),(0,b.jsx)("span",{className:"post-username",style:{cursor:"pointer",color:"var(--primary)"},onClick:b=>{b.stopPropagation Line truncated
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
padding: 24px;
background: var(--bg, #f6f8fc);
color: var(--text, #0a0e1a);
}
@media (prefers-color-scheme: dark) {
body { background: #0f1117; color: #e8edf5; }
}
</style>
</head>
<body>${d}</body>
</html>`;return(0,b.jsx)("div",{className:"custom-page-container",style:{padding:"84px 32px 40px",background:"var(--bg)",minHeight:"100vh"},children:(0,b.jsx)("iframe",{style:{width:"100%",minHeight:"70vh",border:"none",borderRadius:8,background:"var(--surface)"},sandbox:"allow-scripts allow-modals allow-same-origin",srcDoc:i,title:a})})}let bo={reply:"message",post_deleted:"trash",report_handled:"shield",system:"megaphone"};function bp(){let{currentUser:a}=o(),[d,e]=(0,c.useState)(null),[f,g]=(0,c.useState)(null);return((0,c.useEffect)(()=>{a&&h.getNotifications().then(a=>{e(a||[]),g(null),h.markAllNotificationsRead().catch(()=>{})}).catch(a=>{g(a.message),e([])})},[a]),a)?(0,b.jsxs)("div",{className:"page-slide active",children:[(0,b.jsx)("div",{className:"page-header",style:{maxWidth:700,margin:"0 auto",width:"100%"},children:(0,b.jsxs)("h2",{children:[(0,b.jsx)(r.Icon,{name:"message",size:20})," 消息"]})}),(0,b.jsx)("div",{style:{maxWidth:700,margin:"0 auto",width:"100%"},children:f?(0,b.jsxs)("div",{style:{textAlign:"center",color:"#ef4444",padding:20},children:["加载失败:",f]}):null===d?(0,b.jsx)("div",{style:{textAlign:"center",color:"#94a3b8",padding:"40px 0"},children:"加载中..."}):0===d.length?(0,b.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:"60px 0"},children:[(0,b.jsx)(r.Icon,{name:"message",size:48}),(0,b.jsx)("p",{style:{fontSize:16},children:"暂无消息"}),(0,b.jsx)("p",{style:{fontSize:13},children:"当有人回复你的帖子或处理你的举报时,会在这里通知你"})]}):d.map(a=>{let c=bo[a.type]||"pin",d=a.created_at?new Date(a.created_at).toLocaleString("zh-CN"):"";return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:"14px 16px",borderBottom:"1px solid var(--border-light)",background:"var(--surface)",borderRadius:6,marginBottom:6},children:[(0,b.jsx)("span",{style:{color:"var(--text-secondary)",paddingTop:2},children:(0,b.jsx)(r.Icon,{name:c,size:20})}),(0,b.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,b.jsx)("div",{style:{fontWeight:600,fontSize:14},children:a.title}),(0,b.jsx)("div",{style:{color:"var(--text-secondary)",fontSize:13,marginTop:2},children:a.content}),a.link&&(0,b.jsx)("a",{href:a.link,style:{color:"var(--primary)",fontSize:13,textDecoration:"none",marginTop:4,display:"inline-block"},children:"查看详情 →"}),(0,b.jsx)("div",{style:{fontSize:12,color:"var(--text-light)",marginTop:4},children:d})]})]},a.id)})})]}):(0,b.jsx)("div",{className:"page-slide active",style:{textAlign:"center",color:"#94a3b8",padding:"40px 0"},children:"请先登录"})}function bq({modal:a,onClose:d,reportPostId:e}){let{login:f,register:g,currentUser:i,refresh:j}=o(),{t:k}=(0,q.useTranslation)(),{toast:l}=(0,t.useToast)(),[m,n]=(0,c.useState)(""),[p,s]=(0,c.useState)(""),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(""),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(null),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)("spam");if((0,c.useEffect)(()=>{"register"===a&&h.getCaptcha().then(a=>B(a)).catch(()=>{})},[a]),!a)return null;let G=a=>{a&&a.target!==a.currentTarget||d()},H=async()=>{if(!m.trim()||!p)return void l("请填写完整信息","warning");try{(await f(m.trim(),p)).user&&(d(),n(""),s(""),j())}catch(a){l("登录失败:"+a.message,"error")}},I=async()=>{if(!u.trim()||!w.trim()||!y)return void l("请填写完整信息","warning");if(y.length<6)return void l("密码至少6位","warning");if(!A||!C.trim())return void l("请填写验证码","warning");try{await g(w.trim(),y,u.trim(),{id:A.id,answer:C.trim(),sig:A.sig}),d(),v(""),x(""),z(""),D(""),l("注册成功!","success"),j()}catch(a){l("注册失败:"+a.message,"error"),h.getCaptcha().then(a=>B(a)).catch(()=>{}),D("")}},J=async()=>{if(e)try{await h.createReport(e,E),d(),l("举报已提交,管理员将尽快处理","success")}catch(a){l("举报失败:"+a.message,"error")}};return(0,b.jsxs)(b.Fragment,{children:["login"===a&&(0,b.jsx)("div",{className:"modal active",onClick:G,children:(0,b.jsxs)("div",{className:"modal-content",children:[(0,b.jsx)("span",{className:"close",onClick:d,children:(0,b.jsx)(r.Icon,{name:"close",size:20})}),(0,b.jsx)("h2",{style:{marginBottom:16},children:k("auth.login")}),(0,b.jsx)("input",{type:"email",placeholder:k("auth.email"),value:m,onChange:a=>n(a.target.value)}),(0,b.jsx)("input",{type:"password",placeholder:k("auth.password"),value:p,onChange:a=>s(a.target.value),onKeyDown:a=>{"Enter"===a.key&&H()}}),(0,b.jsx)("button",{className:"btn-primary",style:{width:"100%"},onClick:H,children:k("auth.login")})]})}),"register"===a&&(0,b.jsx)("div",{className:"modal active",onClick:G,children:(0,b.jsxs)("div",{className:"modal-content",children:[(0,b.jsx)("span",{className:"close",onClick:d,children:(0,b.jsx)(r.Icon,{name:"close",size:20})}),(0,b.jsx)("h2",{style:{marginBottom:16},children:k("auth.register")}),(0,b.jsx)("input",{type:"text",placeholder:k("auth.username"),value:u,onChange:a=>v(a.target.value)}),(0,b.jsx)("inputLine truncated
⚠️ Your \`allowedTags\` option includes, \`${a}\`, which is inherently
vulnerable to XSS attacks. Please remove it from \`allowedTags\`.
Or, to disable this warning, add the \`allowVulnerableTags\` option
and ensure you are accounting for this risk.
`)});let F=b.nonTextTags||["script","style","textarea","option","xmp"];b.allowedAttributes&&(s={},t={},m(b.allowedAttributes,function(a,b){s[b]=[];let c=[];a.forEach(function(a){"string"==typeof a&&a.indexOf("*")>=0?c.push(e(a).replace(/\\\*/g,".*")):s[b].push(a)}),c.length&&(t[b]=RegExp("^("+c.join("|")+")$"))}));let G={},H={},I={};m(b.allowedClasses,function(a,b){if(s&&(n(s,b)||(s[b]=[]),s[b].push("class")),G[b]=a,Array.isArray(a)){let c=[];G[b]=[],I[b]=[],a.forEach(function(a){"string"==typeof a&&a.indexOf("*")>=0?c.push(e(a).replace(/\\\*/g,".*")):a instanceof RegExp?I[b].push(a):G[b].push(a)}),c.length&&(H[b]=RegExp("^("+c.join("|")+")$"))}});let J={};m(b.transformTags,function(a,b){let c;"function"==typeof a?c=a:"string"==typeof a&&(c=q.simpleTransform(a)),"*"===b?u=c:J[b]=c});let K=!1;M();let L=new d.Parser({onopentag:function(a,c){let d;if(b.onOpenTag&&b.onOpenTag(a,c),b.enforceHtmlBoundary&&"html"===a&&M(),z)return void A++;let e=new D(a,c);w.push(e);let j=!1,k=!!e.text;if(n(J,a)&&(e.attribs=c=(d=J[a](a,c)).attribs,void 0!==d.text&&(e.innerText=d.text),a!==d.tagName&&(e.name=a=d.tagName,y[v]=d.tagName)),u&&(e.attribs=c=(d=u(a,c)).attribs,a!==d.tagName&&(e.name=a=d.tagName,y[v]=d.tagName)),(!E(a)||"recursiveEscape"===b.disallowedTagsMode&&!function(a){for(let b in a)if(n(a,b))return!1;return!0}(x)||null!=b.nestingLimit&&v>=b.nestingLimit)&&(j=!0,x[v]=!0,("discard"===b.disallowedTagsMode||"completelyDiscard"===b.disallowedTagsMode)&&-1!==F.indexOf(a)&&(z=!0,A=1)),v++,j){if("discard"===b.disallowedTagsMode||"completelyDiscard"===b.disallowedTagsMode){if(e.innerText&&!k){let c=N(e.innerText);b.textFilter?B+=b.textFilter(c,a):B+=c,K=!0}return}C=B,B=""}if(B+="<"+a,"script"===a&&(b.allowedScriptHostnames||b.allowedScriptDomains)&&(e.innerText=""),j&&("escape"===b.disallowedTagsMode||"recursiveEscape"===b.disallowedTagsMode)&&b.preserveEscapedAttributes?m(c,function(a,b){B+=" "+b+'="'+N(a||"",!0)+'"'}):(!s||n(s,a)||s["*"])&&m(c,function(c,d){if(!p.test(d)||""===c&&!b.allowedEmptyAttributes.includes(d)&&(b.nonBooleanAttributes.includes(d)||b.nonBooleanAttributes.includes("*")))return void delete e.attribs[d];let j=!1;if(!s||n(s,a)&&-1!==s[a].indexOf(d)||s["*"]&&-1!==s["*"].indexOf(d)||n(t,a)&&t[a].test(d)||t["*"]&&t["*"].test(d))j=!0;else if(s&&s[a]){for(let b of s[a])if(f(b)&&b.name&&b.name===d){j=!0;let a="";if(!0===b.multiple)for(let d of c.split(" "))-1!==b.values.indexOf(d)&&(""===a?a=d:a+=" "+d);else b.values.indexOf(c)>=0&&(a=c);c=a}}if(j){if(-1!==b.allowedSchemesAppliedToAttributes.indexOf(d)&&O(a,c))return void delete e.attribs[d];if("script"===a&&"src"===d){let a=!0;try{let d=P(c);if(b.allowedScriptHostnames||b.allowedScriptDomains){let c=(b.allowedScriptHostnames||[]).find(function(a){return a===d.url.hostname}),e=(b.allowedScriptDomains||[]).find(function(a){return d.url.hostname===a||d.url.hostname.endsWith(`.${a}`)});a=c||e}}catch(b){a=!1}if(!a)return void delete e.attribs[d]}if("iframe"===a&&"src"===d){let a=!0;try{let d=P(c);if(d.isRelativeUrl)a=n(b,"allowIframeRelativeUrls")?b.allowIframeRelativeUrls:!b.allowedIframeHostnames&&!b.allowedIframeDomains;else if(b.allowedIframeHostnames||b.allowedIframeDomains){let c=(b.allowedIframeHostnames||[]).find(function(a){return a===d.url.hostname}),e=(b.allowedIframeDomains||[]).find(function(a){return d.url.hostname===a||d.url.hostname.endsWith(`.${a}`)});a=c||e}}catch(b){a=!1}if(!a)return void delete e.attribs[d]}if("srcset"===d||"imagesrcset"===d)try{let a=h(c);if(a.forEach(function(a){O(d,a.url)&&(a.evil=!0)}),!(a=o(a,function(a){return!a.evil})).length)return void delete e.attribs[d];c=o(a,function(a){return!a.evil}).map(function(a){if(!a.url)throw Error("URL missing");return a.url+(a.w?` ${a.w}w`:"")+(a.h?` ${a.h}h`:"")+(a.d?` ${a.d}x`:"")}).join(", "),e.attribs[d]=c}catch(a){delete e.attribs[d];return}if("class"===d){let b=G[a],f=G["*"],h=H[a],i=I[a],j=I["*"],k=[h,H["*"]].concat(i,j).filter(function(a){return a});if(!(c=b&&f?Q(c,g(b,f),k):Q(c,b||f,k)).length)return void delete e.attribs[d]}if("style"===d){if(b.parseStyleAttributes)try{let f=i(a+" {"+c+"}",{map:!1});if(c=(function(a,b){var c;let d;if(!b)return a;let e=a.nodes[0];return(d=b[e.selector]&&b["*"]?g(b[e.selector],b["*"]):b[e.selector]||b["*"])&&(a.nodes[0].nodes=e.nodes.reduce((c=d,function(a,b){return n(c,b.prop)&&c[b.prop].some(function(a){return a.test(b.value)})&&a.push(b),a}),[])),a})(f,b.allowedStyles).nodes[0].nodes.reduce(function(a,b){return a.push(`${b.prop}:${b.value}${b.important?" !important":""}`),a},[]).join(";"),0===c.length)return void delete e.attribs[d]}catch(a){delete e.attribs[d];return}else if(b.allowedStyles)throw Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}B+=" "+d,c&&c.length?B+='="'+N(c,!0)+'"':b.allowedEmptyAttributes.includes(d)&&(B+='=""')}else delete e.attribs[d]}),-1!==b.selfClosing.indexOf(a))B+=" />";else if(B+=">",e.innerText&&!k){let c=N(e.innerText);b.textFilter?B+=b.textFilter(c,a):B+=c,K=!0}j&&(B=C+N(B Line truncated
//# sourceMappingURL=%5Broot-of-the-server%5D__03xssc3._.js.map