`+n+""+s+`>
`}listitem(e){return`${this.parser.parse(e.tokens)}
`}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`${this.parser.parseInline(e)}
`}table(e){let t="",r="";for(let t=0;t${n}`),`
`}tablerow({text:e}){return`
${e}
`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`${r}>
`}strong({tokens:e}){return`${this.parser.parseInline(e)} `}em({tokens:e}){return`${this.parser.parseInline(e)} `}codespan({text:e}){return`${eG(e,!0)}`}br(e){return" "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=eO(e);if(null===s)return n;let i='"+n+" "}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let s=eO(e);if(null===s)return eG(r);e=s;let i=` "}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:eG(e.text)}},eP=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},eH=class e{options;renderer;textRenderer;constructor(e){this.options=e||D,this.options.renderer=this.options.renderer||new eL,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new eP}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let r=0;r{let s=e[n].flat(1/0);r=r.concat(this.walkTokens(s,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];r?t.renderers[e.name]=function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new eL(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let n=e.renderer[r],s=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=s.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ez(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let n=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=s.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new eV;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let n=e.hooks[r],s=t[r];eV.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async&&eV.passThroughHooksRespectAsync.has(r))return(async()=>{let r=await n.call(t,e);return s.call(t,r)})();let i=n.call(t,e);return s.call(t,i)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let r=await n.apply(t,e);return!1===r&&(r=await s.apply(t,e)),r})();let r=n.apply(t,e);return!1===r&&(r=s.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return eZ.lex(e,t??this.defaults)}parser(e,t){return eH.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},s={...this.defaults,...n},i=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===n.async)return i(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return i(Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let r=s.hooks?await s.hooks.preprocess(t):t,n=await (s.hooks?await s.hooks.provideLexer(e):e?eZ.lex:eZ.lexInline)(r,s),i=s.hooks?await s.hooks.processAllTokens(n):n;s.walkTokens&&await Promise.all(this.walkTokens(i,s.walkTokens));let o=await (s.hooks?await s.hooks.provideParser(e):e?eH.parse:eH.parseInline)(i,s);return s.hooks?await s.hooks.postprocess(o):o})().catch(i);try{s.hooks&&(t=s.hooks.preprocess(t));let r=(s.hooks?s.hooks.provideLexer(e):e?eZ.lex:eZ.lexInline)(t,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let n=(s.hooks?s.hooks.provideParser(e):e?eH.parse:eH.parseInline)(r,s);return s.hooks&&(n=s.hooks.postprocess(n)),n}catch(e){return i(e)}}}onError(e,t){return r=>{if(r.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let e="An error occurred:
"+eG(r.message+"",!0)+" ";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function eq(e,t){return eX.parse(e,t)}eq.options=eq.setOptions=function(e){return eX.setOptions(e),eq.defaults=eX.defaults,D=eq.defaults,eq},eq.getDefaults=E,eq.defaults=D,eq.use=function(...e){return eX.use(...e),eq.defaults=eX.defaults,D=eq.defaults,eq},eq.walkTokens=function(e,t){return eX.walkTokens(e,t)},eq.parseInline=eX.parseInline,eq.Parser=eH,eq.parser=eH.parse,eq.Renderer=eL,eq.TextRenderer=eP,eq.Lexer=eZ,eq.lexer=eZ.lex,eq.Tokenizer=ez,eq.Hooks=eV,eq.parse=eq,eq.options,eq.setOptions,eq.walkTokens,eq.parseInline,eH.parse,eZ.lex;var e_=e.i(44821);let e$={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 e0(e){if(!e)return"";try{let t=eq.parse(e);return(0,e_.default)(t,e$)}catch{return(0,e_.default)(e.replace(/\n/g," "),e$)}}function e1({onOpenModal:e,onReport:n}){let{currentUser:s,sort:i,setSort:o,openPost:l,openUser:c,navigate:h,refreshKey:A}=p(),{t:d}=(0,f.useTranslation)(),{toast:u,confirmAction:g}=(0,y.useToast)(),[x,b]=(0,r.useState)(null),[w,I]=(0,r.useState)(null),[C,v]=(0,r.useState)(!0),[k,S]=(0,r.useState)(1),[B,E]=(0,r.useState)(1),[D,N]=(0,r.useState)(null),[R,F]=(0,r.useState)(i),[Q,T]=(0,r.useState)("idle"),W=(0,r.useRef)(null),K=(0,r.useRef)(null),G=(0,r.useRef)(null),O=(0,r.useCallback)(async e=>{I(null);try{let t=await a.getPosts(i,null,e,20);b(t.data||[]),E(t.pagination?.totalPages||1),S(t.pagination?.page||1)}catch(e){I(e.message),b([])}finally{G.current===i&&requestAnimationFrame(()=>{T("opening"),K.current=setTimeout(()=>{G.current=null,T("idle")},360)})}},[i,A]);(0,r.useEffect)(()=>{O(k)},[O]),(0,r.useEffect)(()=>{x&&0!==x.length&&W.current&&W.current.querySelectorAll(".post-content").forEach(e=>{e.scrollHeight>e.clientHeight+4?e.classList.add("has-fade"):e.classList.remove("has-fade")})},[x]),(0,r.useEffect)(()=>{S(1)},[i]),(0,r.useEffect)(()=>()=>clearTimeout(K.current),[]);let M=e=>{if(e!==R){if(F(e),clearTimeout(K.current),e===i){G.current=null,T("opening"),K.current=setTimeout(()=>T("idle"),360);return}T("closing"),K.current=setTimeout(()=>{G.current=e,T("closed"),o(e)},220)}},Y=async e=>{if(await g(d("feed.confirmDelete")))try{await a.deletePost(e),O(k)}catch(e){u(d("feed.deleteFailed",{msg:e.message}),"error")}};return(0,t.jsxs)("main",{id:"feed",children:[(0,t.jsxs)("div",{className:"feed-header",children:[(0,t.jsxs)("div",{className:"feed-header-left",children:[(0,t.jsx)("button",{className:"tab"+("latest"===R?" active":""),onClick:()=>M("latest"),children:d("feed.latest")}),(0,t.jsx)("button",{className:"tab"+("hot"===R?" active":""),onClick:()=>M("hot"),children:d("feed.hot")})]}),(0,t.jsxs)("button",{className:"btn-primary fab-btn",onClick:()=>{s?h("new"):u(d("newPost.pleaseLogin"),"warning")},children:[(0,t.jsx)(m.Icon,{name:"plus"})," ",d("feed.newPost")]})]}),(0,t.jsx)("div",{className:"feed-posts-drawer "+Q,children:(0,t.jsx)("div",{className:"feed-posts-drawer-inner",children:(0,t.jsx)("div",{id:"postList",ref:W,children:null===x?(0,t.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:"40px 0"},children:[(0,t.jsx)("span",{className:"spinner-sm"}),d("feed.loading")]}):w?(0,t.jsx)("div",{style:{textAlign:"center",color:"#ef4444",padding:"40px 0"},children:d("feed.loadFailed",{msg:w})}):0===x.length?(0,t.jsx)("div",{style:{textAlign:"center",color:"#94a3b8",padding:"60px 0"},children:d("feed.empty")}):x.map(e=>{let r=e.created_at?new Date(e.created_at).toLocaleString("zh-CN"):"";return(0,t.jsxs)("div",{className:"post-card","data-post-id":e.id,style:{cursor:"pointer"},onClick:t=>l(e.id,t.currentTarget,e),children:[e.is_pinned&&(0,t.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,t.jsx)(m.Icon,{name:"pin",size:12})," ",d("feed.pinned")]}),(0,t.jsxs)("div",{className:"post-header",children:[(0,t.jsx)("img",{src:e.avatar_url||"https://ui-avatars.com/api/?name="+encodeURIComponent(e.username||"匿名用户")+"&background=6366f1&color=fff&size=64",className:"post-avatar",alt:""}),(0,t.jsx)("span",{className:"post-username",style:{cursor:"pointer",color:"var(--primary)"},onClick:t=>{t.stopPropagation(),c(e.username)},children:e.username||d("feed.anonymous")}),(0,t.jsx)("span",{className:"post-time",children:r}),e.edited_at&&(0,t.jsx)("span",{className:"post-edited-state",style:{fontSize:11,color:"var(--text-light)",marginLeft:6},children:d("feed.deleted")})]}),(0,t.jsx)("div",{className:"post-title",children:e.title||d("feed.noTitle")}),(0,t.jsx)("div",{className:"post-content",dangerouslySetInnerHTML:{__html:e0(e.content)}}),e.images&&e.images.length>0&&(0,t.jsx)("div",{className:"post-images",children:e.images.map((e,r)=>(0,t.jsx)("img",{src:e,className:"post-image",alt:"",style:{cursor:"pointer"},onClick:t=>{t.stopPropagation(),N(e)}},r))}),(0,t.jsxs)("div",{className:"post-actions",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)(m.Icon,{name:"message",size:14})," ",e.reply_count||0]}),(0,t.jsxs)("button",{className:"action-report",onClick:t=>{(t.stopPropagation(),s)?n(e.id):u(d("newPost.pleaseLogin"),"warning")},children:[(0,t.jsx)(m.Icon,{name:"flag",size:14})," ",d("feed.report")]}),s&&(s.id===e.user_id||"admin"===s.role)&&(0,t.jsxs)("button",{className:"action-delete",onClick:t=>{t.stopPropagation(),Y(e.id)},children:[(0,t.jsx)(m.Icon,{name:"trash",size:14})," ",d("feed.delete")]})]})]},e.id)})})})}),B>1&&x&&x.length>0&&(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:6,padding:"16px 0",marginTop:8,borderTop:"1px solid var(--border)",flexWrap:"wrap"},children:[(0,t.jsx)("button",{className:"page-btn",disabled:k<=1,onClick:()=>O(k-1),style:{padding:"6px 12px",border:"1px solid var(--border)",borderRadius:4,background:"var(--surface)",color:"var(--text)",cursor:k<=1?"not-allowed":"pointer",fontSize:13,opacity:k<=1?.4:1},children:"«"}),Array.from({length:B},(e,t)=>t+1).map(e=>(0,t.jsx)("button",{className:"page-btn",disabled:e===k,onClick:()=>O(e),style:{padding:"6px 10px",border:"1px solid var(--border)",borderRadius:4,fontSize:13,minWidth:32,textAlign:"center",background:e===k?"var(--primary)":"var(--surface)",color:e===k?"#fff":"var(--text)",cursor:e===k?"default":"pointer",borderColor:e===k?"var(--primary)":"var(--border)"},children:e},e)),(0,t.jsx)("button",{className:"page-btn",disabled:k>=B,onClick:()=>O(k+1),style:{padding:"6px 12px",border:"1px solid var(--border)",borderRadius:4,background:"var(--surface)",color:"var(--text)",cursor:k>=B?"not-allowed":"pointer",fontSize:13,opacity:k>=B?.4:1},children:"»"})]}),D&&(0,t.jsx)(j,{src:D,onClose:()=>N(null)})]})}function e2({captcha:e,onRefresh:n}){let s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let t=s.current;if(!t||!e)return;let r=t.getContext("2d"),n=t.width,i=t.height;r.clearRect(0,0,n,i),r.fillStyle="rgba(91, 155, 213, 0.10)",r.fillRect(0,0,n,i);for(let e=0;e<4;e++)r.strokeStyle=`rgba(${80+120*Math.random()}, ${80+120*Math.random()}, 200, ${.2+.3*Math.random()})`,r.lineWidth=1+Math.random(),r.beginPath(),r.moveTo(Math.random()*n,Math.random()*i),r.lineTo(Math.random()*n,Math.random()*i),r.stroke();for(let e=0;e<30;e++)r.fillStyle=`rgba(${200*Math.random()}, ${200*Math.random()}, 220, ${.3+.5*Math.random()})`,r.beginPath(),r.arc(Math.random()*n,Math.random()*i,1+1.5*Math.random(),0,2*Math.PI),r.fill();let o=(e.text||e.question||"").replace(" = ?","").split(""),a=Math.floor(.52*i),l=n/(o.length+1);o.forEach((e,t)=>{r.save(),r.translate(l*(t+1)+(Math.random()-.5)*6,i/2+(Math.random()-.5)*6),r.rotate((Math.random()-.5)*.25),r.font=`bold ${a}px -apple-system, "SF Pro Display", "Segoe UI", Roboto, sans-serif`,r.fillStyle=`rgba(${40+60*Math.random()}, ${50+50*Math.random()}, 90, 0.9)`,r.textAlign="center",r.textBaseline="middle",r.fillText(e,0,0),r.restore()})},[e]),(0,t.jsx)("canvas",{ref:s,width:120,height:40,onClick:n,title:"看不清?点击刷新",style:{cursor:"pointer",borderRadius:6,border:"1px solid var(--glass-border)",verticalAlign:"middle"}})}function e4({postId:e,onRefresh:n}){let s,i,{currentUser:o,openUser:l}=p(),{toast:c,confirmAction:h}=(0,y.useToast)(),[A,d]=(0,r.useState)([]),[u,g]=(0,r.useState)(""),[f,x]=(0,r.useState)(null),[b,w]=(0,r.useState)(""),[I,C]=(0,r.useState)(null),v=(0,r.useRef)(null),k=(0,r.useRef)(null),S=(0,r.useCallback)(async()=>{try{let t=await a.getReplies(e);d(t||[])}catch{d([])}},[e]);(0,r.useEffect)(()=>{S()},[S]),(0,r.useEffect)(()=>{a.getCaptcha().then(e=>x(e)).catch(()=>{})},[e]);let B=async()=>{if(!o)return void c("请先登录","warning");if(!u.trim())return void c("请填写回复内容","warning");if(!f||!b.trim())return void c("请填写验证码","warning");try{await a.createReply(e,u.trim(),{id:f.id,answer:b.trim(),sig:f.sig},I),g(""),w(""),C(null),a.getCaptcha().then(e=>x(e)).catch(()=>{}),S(),n()}catch(e){c("回复失败:"+e.message,"error"),a.getCaptcha().then(e=>x(e)).catch(()=>{}),w("")}},j=async e=>{if(await h("确定要删除这条回复吗?"))try{await a.deleteReply(e),S()}catch(e){c("删除失败:"+e.message,"error")}},E=(s={},i=e=>{if(void 0!==s[e.id])return s[e.id];if(!e.reply_to_id)return s[e.id]=0,0;let t=A.find(t=>t.id===e.reply_to_id),r=t?i(t)+1:0;return s[e.id]=r,r},A.forEach(e=>i(e)),s),D=I?A.find(e=>e.id===I):null;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"post-reply-count",style:{marginTop:20,fontSize:14,color:"#64748b"},children:[(0,t.jsx)(m.Icon,{name:"message",size:14})," ",A.length," 条回复"]}),(0,t.jsx)("div",{style:{marginTop:12},children:0===A.length?(0,t.jsxs)("div",{style:{color:"#94a3b8",padding:"20px 0",textAlign:"center"},children:[(0,t.jsx)(m.Icon,{name:"message",size:16})," 还没有回复,快来发表第一条回复吧"]}):A.map(e=>{let r=e.created_at?new Date(e.created_at).toLocaleString("zh-CN"):"",n=Math.min(E[e.id]||0,5);return(0,t.jsxs)("div",{className:"reply-item","data-username":e.username,"data-reply-id":e.id,style:{marginLeft:n?18*n:0},children:[(0,t.jsxs)("div",{className:"reply-header",children:[(0,t.jsx)("img",{src:e.avatar_url||"https://ui-avatars.com/api/?name="+encodeURIComponent(e.username||"匿名用户")+"&background=6366f1&color=fff&size=64",className:"reply-avatar",alt:""}),(0,t.jsx)("span",{className:"reply-username",style:{cursor:"pointer",color:"var(--primary)"},onClick:()=>l(e.username),children:e.username||"匿名用户"}),(0,t.jsx)("span",{className:"reply-time",children:r}),(0,t.jsx)("button",{className:"reply-btn",onClick:()=>{C(e.id),setTimeout(()=>{v.current?.scrollIntoView({behavior:"smooth",block:"center"}),k.current?.focus()},120)},title:"回复",children:(0,t.jsx)(m.Icon,{name:"reply",size:13})}),o&&(o.id===e.user_id||"admin"===o.role)&&(0,t.jsxs)("button",{className:"btn-sm btn-danger reply-delete-btn",onClick:()=>j(e.id),children:[(0,t.jsx)(m.Icon,{name:"trash",size:12})," 删除"]})]}),(0,t.jsx)("div",{className:"reply-content",dangerouslySetInnerHTML:{__html:e0(e.content)}})]},e.id)})}),(0,t.jsxs)("div",{id:"replyArea",ref:v,style:{marginTop:24,borderTop:"1px solid var(--border)",paddingTop:20},children:[(0,t.jsxs)("h3",{style:{fontSize:16,marginBottom:12},children:[(0,t.jsx)(m.Icon,{name:"message",size:16})," 发表回复"]}),I&&D&&(0,t.jsxs)("div",{className:"reply-preview-bar",children:[(0,t.jsx)(m.Icon,{name:"reply",size:13}),(0,t.jsx)("span",{children:"回复"}),(0,t.jsxs)("strong",{children:["@",D.username]}),(0,t.jsx)("button",{className:"reply-preview-cancel",onClick:()=>C(null),children:"取消"})]}),(0,t.jsx)("textarea",{ref:k,rows:3,placeholder:"写下你的回复...",style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,fontFamily:"inherit",resize:"vertical",background:"var(--bg)",color:"var(--text)"},value:u,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&B()}}),(0,t.jsxs)("div",{className:"captcha-row",style:{margin:"10px 0",display:"flex",alignItems:"center",gap:10},children:[f?(0,t.jsx)(e2,{captcha:f,onRefresh:()=>{a.getCaptcha().then(e=>x(e)).catch(()=>{}),w("")}}):(0,t.jsx)("span",{style:{color:"var(--text-light)"},children:"验证码加载中..."}),(0,t.jsx)("input",{type:"text",placeholder:"答案",style:{width:80,padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)",color:"var(--text)",outline:"none"},value:b,onChange:e=>w(e.target.value)})]}),(0,t.jsx)("button",{className:"btn-primary",style:{padding:"8px 24px"},onClick:B,children:"提交回复"})]})]})}function e3({postId:e,initialPost:n=null}){let{currentUser:s,navigate:i,openUser:o,refreshKey:c}=p(),{toast:h,confirmAction:A}=(0,y.useToast)(),[d,u]=(0,r.useState)(n),[g,f]=(0,r.useState)(null),[x,b]=(0,r.useState)(null),[w,I]=(0,r.useState)(!1),[C,v]=(0,r.useState)(""),[k,S]=(0,r.useState)(""),[E,D]=(0,r.useState)([]),[N,R]=(0,r.useState)(!1),F=(0,r.useRef)(null),[Q,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(d&&!Q){let e=setTimeout(()=>T(!0),60);return()=>clearTimeout(e)}},[d]);let W=(0,r.useCallback)(async()=>{f(null);try{let t=await a.getPost(e);u(t)}catch(e){f(e.message)}},[e,c]),K=(0,r.useRef)(c);(0,r.useEffect)(()=>{(n?.id!==e||c!==K.current)&&W()},[n?.id,W,e,c]);let G=(0,r.useMemo)(()=>e0(d?.content),[d?.content]),O=(0,r.useMemo)(()=>e0(d?.signature),[d?.signature]);if(g)return(0,t.jsxs)("div",{id:"pagePost",className:"page-slide active",style:{padding:"40px 0",textAlign:"center",color:"#ef4444"},children:["加载失败:",g]});if(!d)return(0,t.jsxs)("div",{id:"pagePost",className:"page-slide active",style:{textAlign:"center",color:"#94a3b8"},children:[(0,t.jsx)("span",{className:"spinner-sm"}),"加载中..."]});let M=d.created_at?new Date(d.created_at).toLocaleString("zh-CN"):"",Y=s&&(s.id===d.user_id||"admin"===s.role),U=s&&s.id===d.user_id,J=async()=>{if(await A("确定要删除这条帖子吗?"))try{await a.deletePost(e),h("删除成功","success"),i("feed")}catch(e){h("删除失败:"+e.message,"error")}},z=async()=>{if(await A("确定要"+(d.is_pinned?"取消":"")+"置顶吗?",{danger:!1}))try{await a.togglePinPost(e),W()}catch(e){h("操作失败:"+e.message,"error")}},Z=async()=>{if(!k.trim())return void h("请填写内容","warning");try{await a.updatePost(e,C.trim()||"无标题",k.trim(),E),I(!1),W()}catch(e){h("编辑失败:"+e.message,"error")}},L=async e=>{if(e){if(!e.type.startsWith("image/"))return void h("请选择图片文件","warning");if(e.size>5242880)return void h("图片不能超过 5MB","warning");R(!0);try{let t=await l(e);D(e=>[...e,t])}catch(e){h("上传失败:"+e.message,"error")}finally{R(!1)}}};return(0,t.jsxs)("div",{id:"pagePost",className:"page-slide active",children:[(0,t.jsxs)("div",{className:"page-header post-page-header",children:[(0,t.jsxs)("button",{className:"back-btn",onClick:()=>i("feed"),children:[(0,t.jsx)(m.Icon,{name:"back",size:16})," 返回"]}),(0,t.jsx)("h2",{children:d.title||"帖子详情"})]}),(0,t.jsxs)("div",{className:"post-page-layout",children:[(0,t.jsx)(B,{id:"postSidebar"}),(0,t.jsxs)("div",{id:"postDetailContent",className:"post-page-main",children:[(0,t.jsxs)("div",{className:"post-detail-card",children:[(0,t.jsxs)("div",{className:"post-header",children:[(0,t.jsx)("img",{src:d.avatar_url||"https://ui-avatars.com/api/?name="+encodeURIComponent(d.username||"匿名用户")+"&background=6366f1&color=fff&size=64",className:"post-avatar",alt:""}),(0,t.jsx)("span",{className:"post-username",style:{cursor:"pointer",color:"var(--primary)"},onClick:()=>o(d.username),children:d.username||"匿名用户"}),(0,t.jsx)("span",{className:"post-time",children:M}),d.edited_at&&(0,t.jsxs)("span",{className:"post-edited-state",style:{fontSize:12,color:"var(--text-light)",marginLeft:8},children:["(已编辑 ",new Date(d.edited_at).toLocaleString("zh-CN"),")"]}),d.is_pinned&&(0,t.jsxs)("span",{className:"post-pin-state",style:{fontSize:12,color:"var(--primary)",marginLeft:8,display:"inline-flex",alignItems:"center",gap:3},children:[(0,t.jsx)(m.Icon,{name:"pin",size:12})," 置顶"]}),(0,t.jsxs)("div",{className:"post-detail-controls",style:{display:"flex",gap:4,marginLeft:"auto"},children:[s&&"admin"===s.role&&(0,t.jsxs)("button",{className:"btn-sm btn-secondary",style:{padding:"4px 10px"},onClick:z,children:[(0,t.jsx)(m.Icon,{name:"pin",size:12})," ",d.is_pinned?"取消置顶":"置顶"]}),U&&(0,t.jsxs)("button",{className:"btn-sm btn-secondary",style:{padding:"4px 10px"},onClick:()=>{v(d.title||""),S(d.content||""),D(d.images||[]),I(!0)},children:[(0,t.jsx)(m.Icon,{name:"edit",size:12})," 编辑"]}),Y&&(0,t.jsxs)("button",{className:"btn-sm btn-danger",style:{padding:"4px 10px"},onClick:J,children:[(0,t.jsx)(m.Icon,{name:"trash",size:14})," 删除"]})]})]}),(0,t.jsx)("div",{className:"post-content",dangerouslySetInnerHTML:{__html:G}}),d.images&&d.images.length>0&&(0,t.jsx)("div",{className:"post-images",children:d.images.map((e,r)=>(0,t.jsx)("img",{src:e,className:"post-image",alt:"",style:{cursor:"pointer"},onClick:()=>b(e)},r))}),d.signature&&(0,t.jsx)("div",{className:"post-detail-signature",style:{marginTop:16,paddingTop:12,borderTop:"1px solid var(--border-light)",fontSize:12,color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:O}})]}),(0,t.jsx)("div",{style:{maxWidth:700,margin:"0 auto",width:"100%",marginTop:16},children:(0,t.jsx)("div",{className:"replies-drawer"+(Q?" open":""),children:(0,t.jsx)("div",{className:"replies-drawer-inner",children:(0,t.jsx)(e4,{postId:e,onRefresh:W})})})})]})]}),w&&(0,t.jsx)("div",{className:"modal active",style:{display:"flex"},onClick:e=>{e.target===e.currentTarget&&I(!1)},children:(0,t.jsxs)("div",{className:"modal-content",style:{maxWidth:600,position:"relative"},children:[(0,t.jsx)("span",{className:"close",style:{position:"absolute",top:12,right:16,cursor:"pointer",color:"var(--text-light)"},onClick:()=>I(!1),children:(0,t.jsx)(m.Icon,{name:"close",size:20})}),(0,t.jsxs)("h2",{style:{marginBottom:16},children:[(0,t.jsx)(m.Icon,{name:"edit",size:20})," 编辑帖子"]}),(0,t.jsx)("input",{type:"text",placeholder:"标题",value:C,onChange:e=>v(e.target.value),style:{width:"100%",padding:"10px 14px",border:"1px solid var(--border)",borderRadius:6,fontSize:15,fontWeight:600,marginBottom:12,background:"var(--bg)",color:"var(--text)"}}),(0,t.jsx)("textarea",{rows:6,placeholder:"说点什么...",value:k,onChange:e=>S(e.target.value),style:{width:"100%",padding:12,border:"1px solid var(--border)",borderRadius:6,fontSize:15,fontFamily:"inherit",resize:"vertical",background:"var(--bg)",color:"var(--text)"}}),E.length>0&&(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginTop:10},children:E.map((e,r)=>(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsx)("img",{src:e,alt:"",style:{width:72,height:72,objectFit:"cover",borderRadius:6,border:"1px solid var(--border)"}}),(0,t.jsx)("button",{type:"button",title:"删除图片",onClick:()=>{D(t=>t.filter(t=>t!==e))},style:{position:"absolute",top:-6,right:-6,width:20,height:20,borderRadius:"50%",background:"#ef4444",color:"#fff",border:"none",cursor:"pointer",lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,t.jsx)(m.Icon,{name:"close",size:12})})]},e+r))}),(0,t.jsxs)("div",{style:{display:"flex",gap:8,marginTop:12},children:[(0,t.jsx)("button",{type:"button",className:"btn-secondary",style:{padding:"8px 16px",border:"1px solid var(--border)",borderRadius:4,background:"var(--surface)",cursor:"pointer",color:"var(--text)"},onClick:()=>F.current?.click(),children:N?"上传中...":(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.Icon,{name:"camera",size:14})," 上传图片"]})}),(0,t.jsx)("input",{type:"file",ref:F,accept:"image/*",multiple:!0,style:{display:"none"},onChange:e=>{let t=e.target.files;t&&t.length>0&&([...t].forEach(e=>L(e)),e.target.value="")}})]}),(0,t.jsx)("button",{className:"btn-primary",style:{padding:"10px 32px",fontSize:15,marginTop:12,width:"100%"},onClick:Z,children:"保存"})]})}),x&&(0,t.jsx)(j,{src:x,onClose:()=>b(null)})]})}function e8(){let{currentUser:e,navigate:n,refresh:s}=p(),{t:i}=(0,f.useTranslation)(),{toast:o}=(0,y.useToast)(),[c,h]=(0,r.useState)(""),[A,d]=(0,r.useState)(""),[u,g]=(0,r.useState)([]),[x,b]=(0,r.useState)([]),[w,I]=(0,r.useState)(null),[C,v]=(0,r.useState)(""),[k,S]=(0,r.useState)(!1);(0,r.useEffect)(()=>{a.getCaptcha().then(e=>I(e)).catch(()=>{})},[]);let B=async e=>{S(!0);try{let t=[];for(let r of e){if(!r.type.startsWith("image/"))continue;if(r.size>5242880){o("图片 "+r.name+" 超过 5MB,请压缩后上传","warning");continue}let e=await new Promise(e=>{let t=new FileReader;t.onload=t=>e(t.target.result),t.readAsDataURL(r)});t.push(e);let n=await l(r);g(e=>[...e,n])}b(e=>[...e,...t])}catch(e){o("上传失败:"+e.message,"error")}finally{S(!1)}},[j,E]=(0,r.useState)(!1),D=(0,r.useRef)(null),N=async()=>{if(!e||!e.id){o("请先登录","error"),n("feed");return}if(!A.trim())return void o("请填写内容","error");if(!w||!C.trim())return void o("请填写验证码","error");try{await a.createPost(c.trim()||"无标题",A.trim(),u,{id:w.id,answer:C.trim(),sig:w.sig}),o("发布成功","success"),n("feed"),s()}catch(e){o("发布失败:"+e.message,"error")}};return(0,t.jsxs)("div",{className:"page-slide active",children:[(0,t.jsx)("div",{className:"page-header",style:{maxWidth:600,margin:"0 auto",width:"100%"},children:(0,t.jsxs)("h2",{children:[(0,t.jsx)(m.Icon,{name:"plus",size:20})," ",i("newPost.title")]})}),(0,t.jsxs)("div",{style:{maxWidth:600,margin:"0 auto",width:"100%"},children:[(0,t.jsx)("input",{type:"text",placeholder:i("newPost.title"),style:{width:"100%",padding:"10px 14px",border:"1.5px solid var(--border)",borderRadius:6,fontSize:15,fontWeight:600,marginBottom:12,fontFamily:"inherit",background:"var(--bg)",color:"var(--text)"},value:c,onChange:e=>h(e.target.value)}),(0,t.jsx)("textarea",{rows:6,placeholder:i("newPost.content"),style:{width:"100%",padding:12,border:"1.5px solid var(--border)",borderRadius:6,fontSize:15,fontFamily:"inherit",resize:"vertical",background:"var(--bg)",color:"var(--text)"},value:A,onChange:e=>d(e.target.value)}),(0,t.jsx)("div",{id:"imagePreview",style:{display:"flex",flexWrap:"wrap",gap:8,margin:"8px 0"},children:x.map((e,r)=>(0,t.jsx)("img",{src:e,alt:"",style:{width:80,height:80,objectFit:"cover",borderRadius:4,border:"1px solid var(--border)"}},r))}),(0,t.jsxs)("div",{id:"dropZone",style:{border:"2px dashed "+(j?"var(--primary)":"var(--border)"),borderRadius:8,padding:24,textAlign:"center",cursor:"pointer",transition:"all 0.3s",margin:"8px 0 12px",background:j?"var(--primary-bg)":"var(--bg)"},onClick:()=>D.current?.click(),onDragOver:e=>{e.preventDefault(),E(!0)},onDragLeave:e=>{e.preventDefault(),E(!1)},onDrop:e=>{e.preventDefault(),E(!1),e.dataTransfer.files&&B(Array.from(e.dataTransfer.files))},children:[!k&&!j&&(0,t.jsx)(m.Icon,{name:"image",size:32,style:{display:"block",margin:"0 auto 8px",color:"var(--text-secondary)"}}),(0,t.jsx)("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:i(k?"newPost.uploading":j?"newPost.drop":"newPost.dropHint")})]}),(0,t.jsx)("input",{type:"file",id:"fileInput",accept:"image/*",multiple:!0,ref:D,style:{display:"none"},onChange:e=>{e.target.files&&B(Array.from(e.target.files))}}),(0,t.jsxs)("div",{className:"captcha-row",style:{margin:"12px 0",display:"flex",alignItems:"center",gap:10},children:[w?(0,t.jsx)(e2,{captcha:w,onRefresh:()=>{a.getCaptcha().then(e=>I(e)).catch(()=>{}),v("")}}):(0,t.jsx)("span",{style:{color:"var(--text-light)"},children:i("newPost.captchaLoading")}),(0,t.jsx)("input",{type:"text",placeholder:i("newPost.answer"),style:{width:80,padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)",color:"var(--text)",outline:"none"},value:C,onChange:e=>v(e.target.value)})]}),(0,t.jsx)("button",{className:"btn-primary",style:{padding:"10px 32px",fontSize:15},onClick:N,children:i(k?"newPost.uploading":"newPost.publish")})]})]})}function e6(){let{t:e}=(0,f.useTranslation)(),{toast:n,confirmAction:s}=(0,y.useToast)(),[i,o]=(0,r.useState)(null),[l,c]=(0,r.useState)(null),h=()=>{a.getReports().then(e=>{o(e||[]),c(null)}).catch(e=>{c(e.message),o([])})};(0,r.useEffect)(h,[]);let A=async(t,r)=>{let i="approve"===r?e("admin.report.approvedNote"):e("admin.report.rejectedNote");if("approve"!==r||await s(e("admin.report.confirmApprove")))try{await a.updateReport(t.id,"approve"===r?"approved":"rejected",i),"approve"===r&&t.post_id&&a.deletePost(t.post_id).catch(()=>{}),h()}catch(t){n(e("admin.common.operationFailed",{msg:t.message}),"error")}};if(l)return(0,t.jsx)("div",{style:{textAlign:"center",color:"#ef4444",padding:20},children:e("admin.common.loadFailed",{msg:l})});if(!i)return(0,t.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:20},children:[(0,t.jsx)("span",{className:"spinner-sm"}),e("admin.common.loading")]});if(0===i.length)return(0,t.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:40},children:[(0,t.jsx)(m.Icon,{name:"success",size:16})," ",e("admin.report.empty")]});let d={pending:e("admin.report.statusPending"),approved:e("admin.report.statusApproved"),rejected:e("admin.report.statusRejected")},u={pending:"pending",approved:"success",rejected:"error"};return i.map(r=>(0,t.jsxs)("div",{className:"report-item",children:[(0,t.jsx)("div",{children:e("admin.report.reportedPost",{name:r.reporter_name||e("admin.report.anonymous")})}),(0,t.jsx)("div",{style:{fontSize:13,color:"#64748b",margin:"4px 0"},children:e("admin.report.reason",{reason:r.reason})}),(0,t.jsx)("div",{style:{fontSize:13,color:"#64748b",margin:"4px 0"},children:e("admin.report.post",{title:r.post_title||e("admin.report.untitled"),content:(r.post_content||"").substring(0,30)+((r.post_content||"").length>30?"...":"")})}),(0,t.jsxs)("div",{style:{fontSize:13,fontWeight:600,display:"flex",alignItems:"center",gap:4},children:[u[r.status]&&(0,t.jsx)(m.Icon,{name:u[r.status],size:13})," ",e("admin.common.status"),": ",d[r.status]||r.status]}),r.handler_name&&(0,t.jsxs)("div",{style:{fontSize:12,color:"#94a3b8"},children:[e("admin.report.handler",{name:r.handler_name}),r.handler_note?" ("+r.handler_note+")":""]}),"pending"===r.status&&(0,t.jsxs)("div",{className:"report-actions",children:[(0,t.jsxs)("button",{className:"btn-sm btn-danger",onClick:()=>A(r,"approve"),children:[(0,t.jsx)(m.Icon,{name:"trash",size:12})," ",e("admin.report.deletePost")]}),(0,t.jsxs)("button",{className:"btn-sm btn-secondary",onClick:()=>A(r,"reject"),children:[(0,t.jsx)(m.Icon,{name:"close",size:12})," ",e("admin.report.reject")]})]})]},r.id))}function e5(){let{currentUser:e}=p(),{t:n,i18n:s}=(0,f.useTranslation)(),{toast:i,confirmAction:o}=(0,y.useToast)(),[l,c]=(0,r.useState)(null),[h,A]=(0,r.useState)(null),d=()=>{a.getUsers().then(e=>{c(e||[]),A(null)}).catch(e=>{A(e.message),c([])})};(0,r.useEffect)(d,[]);let u=async(e,t)=>{let r="admin"===t?n("admin.user.roleAdmin"):n("admin.user.roleUser");if(await o(n("admin.user.confirmRole",{role:r}),{danger:!1}))try{await a.updateUserRole(e.id,t),d()}catch(e){i(n("admin.common.operationFailed",{msg:e.message}),"error")}};if(h)return(0,t.jsx)("div",{style:{textAlign:"center",color:"#ef4444",padding:20},children:n("admin.common.loadFailed",{msg:h})});if(!l)return(0,t.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:20},children:[(0,t.jsx)("span",{className:"spinner-sm"}),n("admin.common.loading")]});let g="en"===s.resolvedLanguage?"en-US":"zh-CN";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{marginBottom:12,fontSize:13,color:"#94a3b8"},children:n("admin.user.count",{count:l.length})}),(0,t.jsx)("div",{style:{overflowX:"auto"},children:(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{textAlign:"left",borderBottom:"2px solid var(--border)"},children:[(0,t.jsx)("th",{style:{padding:"10px 12px"},children:n("admin.user.user")}),(0,t.jsx)("th",{style:{padding:"10px 12px"},children:n("admin.user.role")}),(0,t.jsx)("th",{style:{padding:"10px 12px"},children:n("admin.user.registeredAt")}),(0,t.jsx)("th",{style:{padding:"10px 12px",textAlign:"center"},children:n("admin.common.actions")})]})}),(0,t.jsx)("tbody",{children:l.map(r=>{let s="admin"===r.role,i=e&&e.id===r.id;return(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f5f9"},children:[(0,t.jsx)("td",{style:{padding:"10px 12px"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)("img",{src:r.avatar_url||"https://ui-avatars.com/api/?name="+encodeURIComponent(r.username)+"&background=6366f1&color=fff&size=64",style:{width:28,height:28,borderRadius:"50%",objectFit:"cover"},alt:""}),(0,t.jsx)("span",{style:{fontWeight:500},children:r.username}),i&&(0,t.jsx)("span",{style:{fontSize:11,color:"#94a3b8",background:"#eef2ff",padding:"1px 8px",borderRadius:4},children:n("admin.user.you")})]})}),(0,t.jsx)("td",{style:{padding:"10px 12px"},children:(0,t.jsx)("span",{style:{display:"inline-block",padding:"2px 10px",borderRadius:4,fontSize:12,fontWeight:500,...s?{background:"#6366f1",color:"#fff"}:{background:"var(--border)",color:"var(--text-secondary)"}},children:s?r.is_super?n("admin.user.roleSuper"):n("admin.user.roleAdmin"):n("admin.user.roleUser")})}),(0,t.jsx)("td",{style:{padding:"10px 12px",color:"#94a3b8",fontSize:13},children:r.created_at?new Date(r.created_at).toLocaleDateString(g):"—"}),(0,t.jsx)("td",{style:{padding:"10px 12px",textAlign:"center"},children:i?(0,t.jsx)("span",{style:{fontSize:12,color:"#94a3b8"},children:n("admin.user.cannotSelf")}):s?(0,t.jsx)("button",{className:"btn-sm btn-secondary",style:{padding:"4px 12px"},onClick:()=>u(r,"user"),children:n("admin.user.makeUser")}):(0,t.jsx)("button",{className:"btn-sm btn-primary",style:{padding:"4px 12px",background:"#6366f1",color:"#fff",border:"none",borderRadius:4,cursor:"pointer"},onClick:()=>u(r,"admin"),children:n("admin.user.makeAdmin")})})]},r.id)})})]})})]})}function e9(){let{t:e,i18n:n}=(0,f.useTranslation)(),[s,i]=(0,r.useState)(null),[o,l]=(0,r.useState)(null);if((0,r.useEffect)(()=>{a.getEventLogs().then(e=>{i(e||[]),l(null)}).catch(e=>{l(e.message),i([])})},[]),o)return(0,t.jsx)("div",{style:{textAlign:"center",color:"#ef4444",padding:20},children:e("admin.common.loadFailed",{msg:o})});if(!s)return(0,t.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:20},children:[(0,t.jsx)("span",{className:"spinner-sm"}),e("admin.common.loading")]});if(0===s.length)return(0,t.jsx)("div",{style:{textAlign:"center",color:"#94a3b8",padding:40},children:e("admin.log.empty")});let c="en"===n.resolvedLanguage?"en-US":"zh-CN";return(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{textAlign:"left",borderBottom:"1px solid var(--border)"},children:[(0,t.jsx)("th",{children:e("admin.log.time")}),(0,t.jsx)("th",{children:e("admin.log.user")}),(0,t.jsx)("th",{children:e("admin.log.action")})]})}),(0,t.jsx)("tbody",{children:s.map(r=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f5f9"},children:[(0,t.jsx)("td",{style:{padding:"6px 0"},children:new Date(r.created_at).toLocaleString(c)}),(0,t.jsx)("td",{style:{padding:"6px 0"},children:r.username||e("admin.log.system")}),(0,t.jsx)("td",{style:{padding:"6px 0"},children:r.action})]},r.id))})]})}function e7(){let{t:e}=(0,f.useTranslation)(),{toast:n,confirmAction:s}=(0,y.useToast)(),[i,o]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[h,A]=(0,r.useState)(""),d=()=>{a.getLinks().then(o).catch(()=>{})};(0,r.useEffect)(d,[]);let u=async()=>{if(!l.trim()||!h.trim())return void n(e("admin.link.incomplete"),"warning");try{await a.addLink(l.trim(),h.trim()),c(""),A(""),d()}catch(t){n(e("admin.link.addFailed",{msg:t.message}),"error")}},p=async t=>{if(await s(e("admin.link.confirmDelete")))try{await a.deleteLink(t),d()}catch(t){n(e("admin.common.deleteFailed",{msg:t.message}),"error")}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{marginBottom:16,display:"flex",gap:8,flexWrap:"wrap"},children:[(0,t.jsx)("input",{type:"text",placeholder:e("admin.link.namePlaceholder"),style:{flex:1,minWidth:120,padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)",color:"var(--text)"},value:l,onChange:e=>c(e.target.value)}),(0,t.jsx)("input",{type:"url",placeholder:e("admin.link.urlPlaceholder"),style:{flex:2,minWidth:160,padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)",color:"var(--text)"},value:h,onChange:e=>A(e.target.value)}),(0,t.jsx)("button",{className:"btn-primary",style:{padding:"8px 16px"},onClick:u,children:e("admin.link.add")})]}),(0,t.jsx)("div",{id:"linkList",children:0===i.length?(0,t.jsx)("div",{style:{color:"#94a3b8",fontSize:13},children:e("admin.link.empty")}):i.map(r=>(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid var(--border)"},children:[(0,t.jsx)("span",{children:(0,t.jsx)("a",{href:r.url,target:"_blank",rel:"noreferrer",style:{color:"#6366f1",textDecoration:"none"},children:r.title})}),(0,t.jsxs)("button",{className:"btn-sm btn-danger",onClick:()=>p(r.id),children:[(0,t.jsx)(m.Icon,{name:"trash",size:12})," ",e("admin.common.delete")]})]},r.id))})]})}function te(){let{updateForumName:e}=p(),{t:n}=(0,f.useTranslation)(),{toast:s}=(0,y.useToast)(),[i,o]=(0,r.useState)(""),[l,c]=(0,r.useState)(null);(0,r.useEffect)(()=>{a.getSettings().then(e=>{e.forum_name&&o(e.forum_name)}).catch(()=>{})},[]);let h=async()=>{if(!i.trim())return void s(n("admin.forum.nameRequired"),"warning");try{await a.updateSettings(i.trim()),e(i.trim()),c({ok:!0,msg:n("admin.forum.saved")})}catch{c({ok:!1,msg:n("admin.forum.saveFailed")})}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("h3",{style:{marginBottom:16},children:[(0,t.jsx)(m.Icon,{name:"settings",size:16})," ",n("admin.forum.title")]}),(0,t.jsxs)("div",{style:{maxWidth:400},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:14,display:"block",marginBottom:6},children:n("admin.forum.nameLabel")}),(0,t.jsx)("input",{type:"text",style:{width:"100%",padding:"10px 14px",border:"1.5px solid var(--border)",borderRadius:6,fontSize:15,marginBottom:12,fontFamily:"inherit",background:"var(--bg)",color:"var(--text)"},value:i,onChange:e=>o(e.target.value)}),(0,t.jsxs)("button",{className:"btn-primary",style:{padding:"10px 24px"},onClick:h,children:[(0,t.jsx)(m.Icon,{name:"save",size:14})," ",n("admin.forum.save")]}),l&&(0,t.jsxs)("span",{style:{marginLeft:12,fontSize:14,color:l.ok?"#22c55e":"#ef4444"},children:[(0,t.jsx)(m.Icon,{name:l.ok?"success":"error",size:14})," ",l.msg]})]})]})}function tt({page:e,onClose:n,onSaved:s}){let{t:i}=(0,f.useTranslation)(),{toast:o}=(0,y.useToast)(),l=!!e,[c,h]=(0,r.useState)(e?.name||""),[A,d]=(0,r.useState)(e?.title||""),[u,p]=(0,r.useState)(e?.content||""),[g,x]=(0,r.useState)(e?.enabled!==!1),b=async()=>{if(!c.trim())return void o(i("admin.page.nameRequired"),"warning");if(!A.trim())return void o(i("admin.page.titleRequired"),"warning");if(!u.trim())return void o(i("admin.page.contentRequired"),"warning");if(!/^[a-zA-Z0-9\-_]+$/.test(c.trim()))return void o(i("admin.page.nameInvalid"),"warning");try{l?await a.adminUpdateCustomPage(e.id,A.trim(),u.trim(),g):await a.adminCreateCustomPage(c.trim(),A.trim(),u.trim()),s()}catch(e){o(i("admin.common.saveFailed",{msg:e.message}),"error")}};return(0,t.jsx)("div",{className:"modal active",style:{display:"flex"},onClick:e=>{e.target===e.currentTarget&&n()},children:(0,t.jsxs)("div",{className:"modal-content",style:{maxWidth:600,maxHeight:"90vh",overflowY:"auto",position:"relative"},children:[(0,t.jsx)("span",{className:"close",style:{position:"absolute",top:12,right:16,cursor:"pointer",color:"var(--text-light)"},onClick:n,children:(0,t.jsx)(m.Icon,{name:"close",size:20})}),(0,t.jsxs)("h2",{style:{marginBottom:16},children:[(0,t.jsx)(m.Icon,{name:l?"edit":"file",size:20})," ",l?i("admin.page.editTitle"):i("admin.page.addTitle")]}),(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:14,display:"block",marginBottom:4},children:i("admin.page.nameLabel")}),(0,t.jsx)("input",{type:"text",value:c,readOnly:l,placeholder:i("admin.page.namePlaceholder"),style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:l?"var(--border-light)":"var(--bg)",color:"var(--text)"},onChange:e=>h(e.target.value)}),l?(0,t.jsxs)("div",{style:{fontSize:12,color:"var(--text-light)",marginTop:2},children:[(0,t.jsx)(m.Icon,{name:"warning",size:12})," ",i("admin.page.nameLocked")]}):(0,t.jsx)("div",{style:{fontSize:12,color:"var(--text-light)",marginTop:2},children:i("admin.page.nameHint")})]}),(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:14,display:"block",marginBottom:4},children:i("admin.page.navTitleLabel")}),(0,t.jsx)("input",{type:"text",value:A,placeholder:i("admin.page.navTitlePlaceholder"),style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:"var(--bg)",color:"var(--text)"},onChange:e=>d(e.target.value)})]}),(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:14,display:"block",marginBottom:4},children:i("admin.common.status")}),(0,t.jsxs)("select",{value:String(g),style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:"var(--bg)",color:"var(--text)"},onChange:e=>x("true"===e.target.value),children:[(0,t.jsx)("option",{value:"true",children:i("admin.common.enabled")}),(0,t.jsx)("option",{value:"false",children:i("admin.common.disabled")})]})]}),(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:14,display:"block",marginBottom:4},children:i("admin.page.contentLabel")}),(0,t.jsx)("textarea",{rows:12,value:u,style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:13,fontFamily:"monospace",background:"var(--bg)",color:"var(--text)",resize:"vertical"},onChange:e=>p(e.target.value)}),(0,t.jsx)("div",{style:{fontSize:12,color:"var(--text-light)",marginTop:2},children:i("admin.page.contentHelp")})]}),(0,t.jsx)("button",{className:"btn-primary",style:{padding:"10px 24px",width:"100%"},onClick:b,children:i("admin.common.save")})]})})}function tr(){let{t:e}=(0,f.useTranslation)(),{toast:n,confirmAction:s}=(0,y.useToast)(),[i,o]=(0,r.useState)(null),[l,c]=(0,r.useState)(null),[h,A]=(0,r.useState)(null),d=()=>{a.adminGetCustomPages().then(e=>{o(e||[]),c(null)}).catch(e=>{c(e.message),o([])})};(0,r.useEffect)(d,[]);let u=async t=>{if(await s(e("admin.page.confirmDelete")))try{await a.adminDeleteCustomPage(t.id),d()}catch(t){n(e("admin.common.deleteFailed",{msg:t.message}),"error")}};return l?(0,t.jsx)("div",{style:{textAlign:"center",color:"#ef4444",padding:20},children:e("admin.common.loadFailed",{msg:l})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[(0,t.jsxs)("h3",{style:{margin:0},children:[(0,t.jsx)(m.Icon,{name:"file",size:16})," ",e("admin.page.title")]}),(0,t.jsxs)("button",{className:"btn-primary",style:{padding:"8px 16px"},onClick:()=>A("new"),children:[(0,t.jsx)(m.Icon,{name:"plus",size:14})," ",e("admin.page.add")]})]}),(0,t.jsx)("div",{id:"customPageList",children:null===i?(0,t.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:20},children:[(0,t.jsx)("span",{className:"spinner-sm"}),e("admin.common.loading")]}):0===i.length?(0,t.jsx)("div",{style:{textAlign:"center",color:"#94a3b8",padding:20},children:e("admin.page.empty")}):(0,t.jsx)("div",{style:{overflowX:"auto"},children:(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{textAlign:"left",borderBottom:"2px solid var(--border)"},children:[(0,t.jsx)("th",{style:{padding:"8px 12px"},children:e("admin.page.name")}),(0,t.jsx)("th",{style:{padding:"8px 12px"},children:e("admin.page.columnTitle")}),(0,t.jsx)("th",{style:{padding:"8px 12px"},children:e("admin.page.url")}),(0,t.jsx)("th",{style:{padding:"8px 12px"},children:e("admin.common.status")}),(0,t.jsx)("th",{style:{padding:"8px 12px",textAlign:"center"},children:e("admin.common.actions")})]})}),(0,t.jsx)("tbody",{children:i.map(r=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[(0,t.jsx)("td",{style:{padding:"8px 12px"},children:(0,t.jsx)("code",{style:{background:"var(--bg)",padding:"2px 6px",borderRadius:4,fontSize:12},children:r.name})}),(0,t.jsx)("td",{style:{padding:"8px 12px"},children:r.title}),(0,t.jsx)("td",{style:{padding:"8px 12px"},children:(0,t.jsxs)("code",{style:{background:"var(--bg)",padding:"2px 6px",borderRadius:4,fontSize:12},children:["?custom=",r.name]})}),(0,t.jsx)("td",{style:{padding:"8px 12px"},children:(0,t.jsxs)("span",{style:{color:r.enabled?"#22c55e":"#ef4444",display:"inline-flex",alignItems:"center",gap:4},children:[(0,t.jsx)(m.Icon,{name:r.enabled?"success":"error",size:13})," ",r.enabled?e("admin.common.enabled"):e("admin.common.disabled")]})}),(0,t.jsxs)("td",{style:{padding:"8px 12px",textAlign:"center",display:"flex",gap:6,justifyContent:"center"},children:[(0,t.jsx)("button",{className:"btn-sm btn-secondary",title:e("admin.page.edit"),"aria-label":e("admin.page.edit"),onClick:()=>A(r),children:(0,t.jsx)(m.Icon,{name:"edit",size:13})}),(0,t.jsx)("button",{className:"btn-sm btn-danger",title:e("admin.page.delete"),"aria-label":e("admin.page.delete"),onClick:()=>u(r),children:(0,t.jsx)(m.Icon,{name:"trash",size:13})})]})]},r.id))})]})})}),h&&(0,t.jsx)(tt,{page:"new"===h?null:h,onClose:()=>A(null),onSaved:()=>{A(null),d()}})]})}function tn(){let{t:e}=(0,f.useTranslation)(),{confirmAction:n}=(0,y.useToast)(),[s,i]=(0,r.useState)(null),[o,l]=(0,r.useState)(!1),[c,h]=(0,r.useState)(null),A=(0,r.useRef)(null),d=async t=>{if(t){if("style.css"!==t.name)return void i({ok:!1,msg:e("admin.css.filenameInvalid")});if(t.size>1048576)return void i({ok:!1,msg:e("admin.css.sizeInvalid")});h(t)}},u=async()=>{try{await a.uploadCustomCss(c),i({ok:!0,msg:e("admin.css.active")});let t=document.getElementById("custom-css-link");t&&(t.href="/api/custom-css?t="+Date.now())}catch(e){i({ok:!1,msg:e.message})}finally{h(null)}},p=async()=>{if(await n(e("admin.css.confirmDelete")))try{await a.deleteCustomCss(),i({ok:!0,msg:e("admin.css.deleted")});let t=document.getElementById("custom-css-link");t&&t.remove()}catch(e){i({ok:!1,msg:e.message})}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("h3",{style:{marginBottom:16},children:[(0,t.jsx)(m.Icon,{name:"code",size:16})," ",e("admin.css.title")]}),(0,t.jsx)("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:12},children:e("admin.css.description")}),(0,t.jsx)("div",{style:{border:"2px dashed "+(o?"var(--primary)":"var(--border)"),borderRadius:8,padding:32,textAlign:"center",cursor:"pointer",transition:"all 0.3s",background:o?"var(--primary-bg)":"var(--bg)"},onClick:()=>A.current?.click(),onDragOver:e=>{e.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:e=>{e.preventDefault(),l(!1),e.dataTransfer.files?.[0]&&d(e.dataTransfer.files[0])},children:(0,t.jsxs)("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:[(0,t.jsx)(m.Icon,{name:"upload",size:14})," ",o?e("admin.css.releaseUpload"):e("admin.css.uploadHint")]})}),(0,t.jsx)("input",{type:"file",ref:A,accept:".css",style:{display:"none"},onChange:e=>{e.target.files?.[0]&&d(e.target.files[0])}}),s&&(0,t.jsxs)("div",{style:{fontSize:13,marginTop:8,color:s.ok?"#22c55e":"#ef4444",display:"flex",alignItems:"center",gap:5},children:[(0,t.jsx)(m.Icon,{name:s.ok?"success":"error",size:14})," ",s.msg]}),(0,t.jsxs)("div",{style:{display:"flex",gap:8,marginTop:16},children:[(0,t.jsxs)("button",{className:"btn-primary",style:{padding:"8px 20px"},onClick:()=>A.current?.click(),children:[(0,t.jsx)(m.Icon,{name:"save",size:14})," ",e("admin.css.save")]}),(0,t.jsxs)("button",{className:"btn-secondary",style:{padding:"8px 20px",border:"1px solid var(--border)",borderRadius:4,background:"var(--surface)",cursor:"pointer",color:"var(--text)"},onClick:p,children:[(0,t.jsx)(m.Icon,{name:"trash",size:14})," ",e("admin.css.delete")]})]}),c&&(0,t.jsx)("div",{className:"modal active",style:{display:"flex"},onClick:()=>h(null),children:(0,t.jsxs)("div",{className:"modal-content",style:{maxWidth:420},onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("h2",{style:{marginBottom:12},children:[(0,t.jsx)(m.Icon,{name:"warning",size:20})," ",e("admin.css.warningTitle")]}),(0,t.jsx)("p",{style:{fontSize:14,color:"var(--text-secondary)",marginBottom:16},children:e("admin.css.warningBody")}),(0,t.jsx)("p",{style:{fontSize:13,color:"var(--text-light)",marginBottom:20},children:e("admin.css.warningHelp")}),(0,t.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,t.jsxs)("button",{className:"btn-primary",style:{padding:"8px 24px"},onClick:u,children:[(0,t.jsx)(m.Icon,{name:"upload",size:14})," ",e("admin.css.continueUpload")]}),(0,t.jsx)("button",{className:"btn-secondary",style:{padding:"8px 24px",border:"1px solid var(--border)",borderRadius:4,background:"var(--surface)",cursor:"pointer",color:"var(--text)"},onClick:()=>h(null),children:e("admin.common.cancel")})]})]})})]})}let ts=[{key:"reports",labelKey:"admin.reports",icon:"shieldAlert"},{key:"users",labelKey:"admin.users",icon:"users"},{key:"logs",labelKey:"admin.logs",icon:"file"},{key:"links",labelKey:"admin.links",icon:"link"},{key:"settings",labelKey:"admin.forumSettings",icon:"settings"},{key:"custom",labelKey:"admin.customPages",icon:"file"},{key:"css",labelKey:"admin.customCss",icon:"file"}];function ti(){let{t:e}=(0,f.useTranslation)(),[n,s]=(0,r.useState)("reports");return(0,t.jsxs)("div",{className:"page-slide active",children:[(0,t.jsx)("div",{className:"page-header",style:{maxWidth:1200,margin:"0 auto",width:"100%"},children:(0,t.jsxs)("h2",{children:[(0,t.jsx)(m.Icon,{name:"shieldAlert",size:20})," ",e("admin.title")]})}),(0,t.jsxs)("div",{className:"admin-layout",style:{maxWidth:1200,margin:"0 auto",width:"100%"},children:[(0,t.jsx)("aside",{className:"admin-sidebar",children:(0,t.jsx)("nav",{className:"admin-nav",children:ts.map(r=>(0,t.jsxs)("a",{href:"#",className:"admin-nav-item"+(n===r.key?" active":""),"data-tab":r.key,onClick:e=>{e.preventDefault(),s(r.key)},children:[(0,t.jsx)("span",{className:"nav-icon",children:(0,t.jsx)(m.Icon,{name:r.icon,size:18})}),e(r.labelKey)]},r.key))})}),(0,t.jsxs)("main",{className:"admin-content",id:"adminContent",children:["reports"===n&&(0,t.jsx)(e6,{}),"users"===n&&(0,t.jsx)(e5,{}),"logs"===n&&(0,t.jsx)(e9,{}),"links"===n&&(0,t.jsx)(e7,{}),"custom"===n&&(0,t.jsx)(tr,{}),"css"===n&&(0,t.jsx)(tn,{}),"settings"===n&&(0,t.jsx)(te,{})]})]})]})}var to=e.i(16166);function ta(){let{currentUser:e,setCurrentUser:n}=p(),{t:s,i18n:i}=(0,f.useTranslation)(),{toast:o}=(0,y.useToast)(),[c,h]=(0,r.useState)(e?.username||""),[A,d]=(0,r.useState)(e?.bio||""),[u,g]=(0,r.useState)(e?.signature||""),[x,b]=(0,r.useState)(e?.avatar_url||""),[w,I]=(0,r.useState)(null),C=(0,r.useRef)(null),v=async t=>{if(t){if(!t.type.startsWith("image/"))return void I({ok:!1,msg:s("settings.avatarFileRequired")});if(t.size>5242880)return void I({ok:!1,msg:s("settings.avatarTooLarge")});try{let r=await l(t);await a.updateAvatar(e.id,r),b(r),n({...e,avatar_url:r}),I({ok:!0,msg:s("settings.avatarUpdated")})}catch(e){I({ok:!1,msg:e.message})}}},k=async()=>{if(!e)return void o(s("settings.pleaseLogin"),"warning");if(!c.trim())return void o(s("settings.usernameRequired"),"warning");try{let t=await a.updateProfile(e.id,c.trim(),A.trim(),u.trim());if(t.error)throw Error(t.error);n({...e,username:c.trim(),bio:A.trim(),signature:u.trim()}),o(s("settings.saved"),"success")}catch(e){o(s("settings.saveFailed",{msg:e.message}),"error")}},S=x||"https://ui-avatars.com/api/?name="+encodeURIComponent(e?.username||"U")+"&background=6366f1&color=fff&size=128";return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{textAlign:"center",marginBottom:24},children:[(0,t.jsxs)("div",{style:{position:"relative",display:"inline-block"},children:[(0,t.jsx)("img",{src:S,style:{width:100,height:100,borderRadius:"50%",objectFit:"cover",border:"3px solid var(--primary)"},alt:""}),(0,t.jsx)("button",{style:{position:"absolute",bottom:0,right:0,background:"var(--primary)",color:"#fff",border:"none",borderRadius:"50%",width:32,height:32,cursor:"pointer",fontSize:16,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 8px rgba(99,102,241,0.4)"},onClick:()=>C.current?.click(),"aria-label":s("settings.changeAvatar"),title:s("settings.changeAvatar"),children:(0,t.jsx)(m.Icon,{name:"camera",size:16})})]}),(0,t.jsx)("input",{type:"file",ref:C,accept:"image/*",style:{display:"none"},onChange:e=>{e.target.files?.[0]&&v(e.target.files[0])}}),(0,t.jsx)("h2",{style:{margin:"12px 0 4px"},children:e?.username}),(0,t.jsx)("p",{style:{color:"var(--text-secondary)",fontSize:14},children:A||s("user.bioEmpty")}),w&&(0,t.jsxs)("div",{style:{fontSize:13,marginTop:8,color:w.ok?"#22c55e":"#ef4444",display:"flex",alignItems:"center",justifyContent:"center",gap:5},children:[(0,t.jsx)(m.Icon,{name:w.ok?"success":"error",size:14})," ",w.msg]})]}),(0,t.jsxs)("div",{style:{background:"var(--surface)",border:"1px solid var(--border)",borderRadius:8,padding:20},children:[(0,t.jsxs)("div",{style:{marginBottom:16},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:14,display:"block",marginBottom:4},children:s("settings.username")}),(0,t.jsx)("input",{type:"text",value:c,style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:"var(--bg)",color:"var(--text)"},onChange:e=>h(e.target.value)})]}),(0,t.jsxs)("div",{style:{marginBottom:16},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:14,display:"block",marginBottom:4},children:s("settings.bio")}),(0,t.jsx)("textarea",{rows:3,value:A,style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:"var(--bg)",color:"var(--text)",resize:"vertical"},onChange:e=>d(e.target.value)})]}),(0,t.jsxs)("div",{style:{marginBottom:16},children:[(0,t.jsxs)("label",{style:{fontWeight:600,fontSize:14,display:"block",marginBottom:4},children:[s("settings.signature")," ",(0,t.jsxs)("span",{style:{color:"var(--text-light)",fontWeight:400},children:["(",s("settings.signatureHint"),")"]})]}),(0,t.jsx)("textarea",{rows:2,value:u,placeholder:s("settings.signaturePlaceholder"),style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:"var(--bg)",color:"var(--text)",resize:"vertical",fontFamily:"inherit"},onChange:e=>g(e.target.value)})]}),(0,t.jsx)("button",{className:"btn-primary",style:{width:"100%",padding:10},onClick:k,children:s("settings.save")})]}),(0,t.jsxs)("div",{style:{background:"var(--surface)",border:"1px solid var(--border)",borderRadius:8,padding:20,marginTop:16},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:14,display:"block",marginBottom:8},children:s("settings.language")}),(0,t.jsxs)("div",{className:"feed-header-left language-toggle",style:{display:"inline-flex"},children:[(0,t.jsx)("button",{className:"tab"+(i.language.startsWith("zh")?" active":""),"aria-pressed":i.language.startsWith("zh"),onClick:()=>(0,to.setAppLanguage)("zh"),children:s("settings.languageZh")}),(0,t.jsx)("button",{className:"tab"+(i.language.startsWith("en")?" active":""),"aria-pressed":i.language.startsWith("en"),onClick:()=>(0,to.setAppLanguage)("en"),children:s("settings.languageEn")})]})]})]})}function tl(){let{currentUser:e}=p(),{t:n}=(0,f.useTranslation)(),{toast:s}=(0,y.useToast)(),[i,o]=(0,r.useState)(""),[l,c]=(0,r.useState)(""),[h,A]=(0,r.useState)(null),[d,u]=(0,r.useState)(""),[g,x]=(0,r.useState)(""),[b,w]=(0,r.useState)(null),I=async()=>{if(!i||!l)return void s(n("security.fillAll"),"warning");if(l.length<6)return void s(n("security.pwMin"),"warning");try{await a.updatePassword(e.id,i,l),A({ok:!0,msg:n("security.pwChanged")}),o(""),c("")}catch(e){A({ok:!1,msg:e.message})}},C=async()=>{if(!d||!g)return void s(n("security.fillAll"),"warning");try{await a.updateEmail(e.id,d,g),w({ok:!0,msg:n("security.emailChanged")}),u(""),x("")}catch(e){w({ok:!1,msg:e.message})}};return(0,t.jsxs)("div",{style:{marginTop:16,background:"var(--surface)",border:"1px solid var(--border)",borderRadius:8,padding:20},children:[(0,t.jsxs)("h3",{style:{fontSize:16,marginBottom:12},children:[(0,t.jsx)(m.Icon,{name:"lock",size:16})," ",n("security.title")]}),(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:13,display:"block",marginBottom:4},children:n("security.currentPw")}),(0,t.jsx)("input",{type:"password",value:i,style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:"var(--bg)",color:"var(--text)"},onChange:e=>o(e.target.value)})]}),(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:13,display:"block",marginBottom:4},children:n("security.newPw")}),(0,t.jsx)("input",{type:"password",value:l,style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:"var(--bg)",color:"var(--text)"},onChange:e=>c(e.target.value)})]}),(0,t.jsx)("button",{className:"btn-secondary",style:{padding:"8px 16px",border:"1px solid var(--border)",borderRadius:4,background:"var(--surface)",cursor:"pointer",color:"var(--text)"},onClick:I,children:n("security.changePw")}),h&&(0,t.jsxs)("div",{style:{fontSize:13,marginTop:6,color:h.ok?"#22c55e":"#ef4444",display:"flex",alignItems:"center",gap:5},children:[(0,t.jsx)(m.Icon,{name:h.ok?"success":"error",size:14})," ",h.msg]}),(0,t.jsx)("div",{style:{borderTop:"1px solid var(--border)",margin:"16px 0"}}),(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:13,display:"block",marginBottom:4},children:n("security.currentPwVerify")}),(0,t.jsx)("input",{type:"password",value:d,style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:"var(--bg)",color:"var(--text)"},onChange:e=>u(e.target.value)})]}),(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsx)("label",{style:{fontWeight:600,fontSize:13,display:"block",marginBottom:4},children:n("security.newEmail")}),(0,t.jsx)("input",{type:"email",value:g,style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,fontSize:14,background:"var(--bg)",color:"var(--text)"},onChange:e=>x(e.target.value)})]}),(0,t.jsx)("button",{className:"btn-secondary",style:{padding:"8px 16px",border:"1px solid var(--border)",borderRadius:4,background:"var(--surface)",cursor:"pointer",color:"var(--text)"},onClick:C,children:n("security.changeEmail")}),b&&(0,t.jsxs)("div",{style:{fontSize:13,marginTop:6,color:b.ok?"#22c55e":"#ef4444",display:"flex",alignItems:"center",gap:5},children:[(0,t.jsx)(m.Icon,{name:b.ok?"success":"error",size:14})," ",b.msg]})]})}function tc(){let{t:e}=(0,f.useTranslation)(),{toast:n,confirmAction:s}=(0,y.useToast)(),[i,o]=(0,r.useState)(0),[l,c]=(0,r.useState)(null),[h,A]=(0,r.useState)(!1),d=()=>{A(!0),setTimeout(()=>{c(null),A(!1)},340)},u=()=>{a.getRecoveryCodeCount().then(e=>o(e.count||0)).catch(()=>{})};(0,r.useEffect)(u,[]);let p=async()=>{if(await s(e("recovery.confirmRegenerate")))try{let e=await a.generateRecoveryCodes();c({codes:e.codes||[],isNew:!0}),u()}catch(t){n(e("recovery.genFailed",{msg:t.message}),"error")}},g=async()=>{try{let e=await a.generateRecoveryCodes();c({codes:e.codes||[],isNew:!1}),u()}catch(t){n(e("recovery.fetchFailed",{msg:t.message}),"error")}};return(0,t.jsxs)("div",{style:{marginTop:16,background:"var(--surface)",border:"1px solid var(--border)",borderRadius:8,padding:20},children:[(0,t.jsxs)("h3",{style:{fontSize:16,marginBottom:8},children:[(0,t.jsx)(m.Icon,{name:"key",size:16})," ",e("recovery.title")]}),(0,t.jsx)("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:12},children:e("recovery.desc")}),(0,t.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,t.jsxs)("button",{className:"btn-secondary",style:{padding:"8px 16px",border:"1px solid var(--border)",borderRadius:4,background:"var(--surface)",cursor:"pointer",color:"var(--text)"},onClick:g,children:[(0,t.jsx)(m.Icon,{name:"list",size:14})," ",e("recovery.view")]}),(0,t.jsxs)("button",{className:"btn-secondary",style:{padding:"8px 16px",border:"1px solid var(--border)",borderRadius:4,background:"var(--surface)",cursor:"pointer",color:"var(--text)"},onClick:p,children:[(0,t.jsx)(m.Icon,{name:"refresh",size:14})," ",e("recovery.regenerate")]})]}),(0,t.jsx)("div",{id:"recoveryCodesStatus",style:{fontSize:13,color:"var(--text-light)",marginTop:8},children:e("recovery.remaining",{count:i})}),l&&(0,t.jsx)("div",{className:"modal active"+(h?" closing":""),style:{display:"flex"},onClick:e=>{e.target===e.currentTarget&&d()},children:(0,t.jsxs)("div",{className:"modal-content",style:{maxWidth:480,position:"relative"},children:[(0,t.jsx)("span",{className:"close",style:{position:"absolute",top:12,right:16,cursor:"pointer",color:"var(--text-light)"},onClick:d,children:(0,t.jsx)(m.Icon,{name:"close",size:20})}),(0,t.jsx)("h2",{style:{marginBottom:12},children:l.isNew?e("recovery.newCodes"):e("recovery.title")}),(0,t.jsxs)("p",{style:{fontSize:13,color:"#ef4444",marginBottom:12,display:"flex",alignItems:"flex-start",gap:6},children:[(0,t.jsx)(m.Icon,{name:"warning",size:14})," ",e("recovery.saveWarning")]}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:l.codes.map((e,r)=>(0,t.jsx)("code",{style:{background:"var(--bg)",padding:"8px 12px",borderRadius:6,fontSize:13,textAlign:"center",userSelect:"all"},children:e},r))}),(0,t.jsx)("button",{className:"btn-primary",style:{width:"100%",padding:10,marginTop:16},onClick:d,children:e("recovery.saved")})]})})]})}let th=[{key:"profile",labelKey:"settings.profile",icon:"user"},{key:"security",labelKey:"settings.security",icon:"shieldAlert"},{key:"recovery",labelKey:"settings.recovery",icon:"lock"}];function tA(){let{t:e}=(0,f.useTranslation)(),[n,s]=(0,r.useState)("profile"),i=(0,r.useRef)(null),o=(0,r.useRef)(!1),a=(0,r.useCallback)(()=>{let e=i.current;e&&!o.current&&(o.current=!0,requestAnimationFrame(()=>{o.current=!1;let t=Math.round(e.scrollTop/e.clientHeight),r=th[Math.min(Math.max(t,0),th.length-1)]?.key;r&&s(r)}))},[]);return(0,t.jsxs)("div",{className:"page-slide active",style:{overflow:"hidden",height:"100vh",display:"flex",flexDirection:"column"},children:[(0,t.jsx)("div",{className:"page-header",style:{width:"100%",flexShrink:0},children:(0,t.jsxs)("h2",{children:[(0,t.jsx)(m.Icon,{name:"settings",size:20})," ",e("settings.title")]})}),(0,t.jsxs)("div",{className:"settings-layout",style:{width:"100%",display:"flex",gap:28,alignItems:"flex-start",flex:1,minHeight:0},children:[(0,t.jsx)("aside",{className:"settings-sidebar",style:{width:200,flexShrink:0},children:(0,t.jsx)("nav",{className:"settings-nav",children:th.map(r=>(0,t.jsxs)("a",{href:"#",className:"settings-nav-item"+(n===r.key?" active":""),"data-settings-tab":r.key,onClick:e=>((e,t)=>{t&&t.preventDefault(),s(e);let r=i.current;if(!r)return;let n=th.findIndex(t=>t.key===e);r.scrollTo({top:n*r.clientHeight,behavior:"smooth"})})(r.key,e),children:[(0,t.jsx)("span",{className:"nav-icon",children:(0,t.jsx)(m.Icon,{name:r.icon,size:18})}),e(r.labelKey)]},r.key))})}),(0,t.jsx)("main",{className:"settings-content",id:"settingsContent",style:{overflow:"hidden",padding:0,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0},children:(0,t.jsxs)("div",{ref:i,onScroll:a,style:{flex:1,minHeight:0,overflowY:"auto",scrollSnapType:"y mandatory",scrollBehavior:"smooth",scrollbarWidth:"none",msOverflowStyle:"none"},children:[(0,t.jsx)("div",{style:{scrollSnapAlign:"start",minHeight:"100%",padding:"20px 24px"},"data-panel":"profile",children:(0,t.jsx)(ta,{})}),(0,t.jsx)("div",{style:{scrollSnapAlign:"start",minHeight:"100%",padding:"20px 24px",borderTop:"1px solid var(--glass-border)"},"data-panel":"security",children:(0,t.jsx)(tl,{})}),(0,t.jsx)("div",{style:{scrollSnapAlign:"start",minHeight:"100%",padding:"20px 24px",borderTop:"1px solid var(--glass-border)"},"data-panel":"recovery",children:(0,t.jsx)(tc,{})})]})})]})]})}function td({username:e}){let{currentUser:n,openPost:s}=p(),i=function(){let{currentUser:e}=p(),{toast:t}=(0,y.useToast)();return async(r,n)=>{if(!e)return void t("请先登录","warning");try{let e=await a.getOrCreateConversation(r);window.dispatchEvent(new CustomEvent("forumlify-open-chat",{detail:{conversationId:e.id,otherUserId:r,otherUsername:n}}))}catch(e){t("打开私信失败:"+e.message,"error")}}}(),[o,l]=(0,r.useState)(null),[c,h]=(0,r.useState)([]),[A,d]=(0,r.useState)(null),u=(0,r.useCallback)(async()=>{d(null);try{let t=await a.getUserProfile(e);if(t.error||!t.id)return void d(t.error||"用户不存在");l(t);let r=await a.getPosts("latest",t.id);h(r.data||[])}catch(e){d(e.message||"加载失败")}},[e]);return((0,r.useEffect)(()=>{u()},[u]),A)?(0,t.jsx)("div",{className:"page-slide active",children:(0,t.jsxs)("div",{style:{textAlign:"center",color:"#ef4444",padding:"40px 0"},children:["加载失败:",A]})}):o?(0,t.jsxs)("div",{className:"page-slide active",children:[(0,t.jsx)("div",{className:"page-header",style:{maxWidth:700,margin:"0 auto",width:"100%"},children:(0,t.jsxs)("h2",{children:[(0,t.jsx)(m.Icon,{name:"users",size:20})," 用户主页"]})}),(0,t.jsxs)("div",{style:{maxWidth:700,margin:"0 auto",width:"100%"},children:[(0,t.jsxs)("div",{style:{background:"var(--surface)",border:"1px solid var(--border)",borderRadius:8,padding:32,textAlign:"center"},children:[(0,t.jsx)("img",{src:o.avatar_url||function(e,t=128){return"https://ui-avatars.com/api/?name="+encodeURIComponent(e||"U")+"&background=6366f1&color=fff&size="+t}(o.username),style:{width:96,height:96,borderRadius:"50%",objectFit:"cover",border:"3px solid var(--primary)"},alt:""}),(0,t.jsx)("h2",{style:{margin:"16px 0 4px",fontSize:24},children:o.username}),(0,t.jsx)("p",{style:{color:"var(--text-secondary)",fontSize:14},children:o.bio||"这个人很懒,什么都没写"}),n&&n.id!==o.id&&(0,t.jsxs)("button",{className:"btn-primary",style:{marginTop:12,padding:"8px 20px"},onClick:()=>i(o.id,o.username),children:[(0,t.jsx)(m.Icon,{name:"message",size:14})," 发私信"]}),(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"center",gap:32,marginTop:16,fontSize:14,color:"var(--text-secondary)",flexWrap:"wrap"},children:[(0,t.jsxs)("span",{children:[(0,t.jsx)(m.Icon,{name:"calendar",size:14})," 加入于 ",o.created_at?new Date(o.created_at).toLocaleDateString("zh-CN"):"未知"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)(m.Icon,{name:"file",size:14})," 发了 ",c.length," 个帖子"]}),"admin"===o.role&&(0,t.jsxs)("span",{style:{color:"var(--primary)",fontWeight:600},children:[(0,t.jsx)(m.Icon,{name:"shield",size:14})," 管理员"]})]})]}),(0,t.jsxs)("h3",{style:{margin:"24px 0 16px",fontSize:18},children:[(0,t.jsx)(m.Icon,{name:"file",size:18})," 发布的帖子"]}),0===c.length?(0,t.jsx)("div",{style:{color:"#94a3b8",padding:"20px 0",textAlign:"center"},children:"还没有发帖"}):c.map(e=>{let r=e.created_at?new Date(e.created_at).toLocaleString("zh-CN"):"";return(0,t.jsxs)("div",{className:"post-card",style:{cursor:"pointer"},onClick:t=>s(e.id,t.currentTarget,e),children:[(0,t.jsx)("div",{className:"post-title",style:{fontSize:16,fontWeight:600},children:e.title||"无标题"}),(0,t.jsxs)("div",{className:"post-content",style:{fontSize:14,color:"var(--text-secondary)"},children:[(e.content||"").substring(0,100),(e.content||"").length>100?"...":""]}),(0,t.jsx)("div",{style:{fontSize:12,color:"var(--text-light)",marginTop:8},children:r})]},e.id)})]})]}):(0,t.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:"40px 0"},children:[(0,t.jsx)("span",{className:"spinner-sm"}),"加载中..."]})}function tu({pageName:e}){let[n,s]=(0,r.useState)(null),[i,o]=(0,r.useState)(null);if((0,r.useEffect)(()=>{s(null),o(null),a.getCustomPage(e).then(e=>s(e.content)).catch(e=>o(e.message))},[e]),i)return(0,t.jsxs)("div",{style:{padding:"84px 32px",textAlign:"center",color:"#ef4444"},children:["页面加载失败:",i]});if(null===n)return(0,t.jsxs)("div",{style:{padding:"84px 32px",textAlign:"center",color:"#94a3b8"},children:[(0,t.jsx)("span",{className:"spinner-sm"}),"加载中..."]});let l=`
${n}
`;return(0,t.jsx)("div",{className:"custom-page-container",style:{padding:"84px 32px 40px",background:"var(--bg)",minHeight:"100vh"},children:(0,t.jsx)("iframe",{style:{width:"100%",minHeight:"70vh",border:"none",borderRadius:8,background:"var(--surface)"},sandbox:"allow-scripts allow-modals allow-same-origin",srcDoc:l,title:e})})}let tp={reply:"message",post_deleted:"trash",report_handled:"shield",system:"megaphone"};function tg(){let{currentUser:e}=p(),[n,s]=(0,r.useState)(null),[i,o]=(0,r.useState)(null);return((0,r.useEffect)(()=>{e&&a.getNotifications().then(e=>{s(e||[]),o(null),a.markAllNotificationsRead().catch(()=>{})}).catch(e=>{o(e.message),s([])})},[e]),e)?(0,t.jsxs)("div",{className:"page-slide active",children:[(0,t.jsx)("div",{className:"page-header",style:{maxWidth:700,margin:"0 auto",width:"100%"},children:(0,t.jsxs)("h2",{children:[(0,t.jsx)(m.Icon,{name:"message",size:20})," 消息"]})}),(0,t.jsx)("div",{style:{maxWidth:700,margin:"0 auto",width:"100%"},children:i?(0,t.jsxs)("div",{style:{textAlign:"center",color:"#ef4444",padding:20},children:["加载失败:",i]}):null===n?(0,t.jsx)("div",{style:{textAlign:"center",color:"#94a3b8",padding:"40px 0"},children:"加载中..."}):0===n.length?(0,t.jsxs)("div",{style:{textAlign:"center",color:"#94a3b8",padding:"60px 0"},children:[(0,t.jsx)(m.Icon,{name:"message",size:48}),(0,t.jsx)("p",{style:{fontSize:16},children:"暂无消息"}),(0,t.jsx)("p",{style:{fontSize:13},children:"当有人回复你的帖子或处理你的举报时,会在这里通知你"})]}):n.map(e=>{let r=tp[e.type]||"pin",n=e.created_at?new Date(e.created_at).toLocaleString("zh-CN"):"";return(0,t.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,t.jsx)("span",{style:{color:"var(--text-secondary)",paddingTop:2},children:(0,t.jsx)(m.Icon,{name:r,size:20})}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontWeight:600,fontSize:14},children:e.title}),(0,t.jsx)("div",{style:{color:"var(--text-secondary)",fontSize:13,marginTop:2},children:e.content}),e.link&&(0,t.jsx)("a",{href:e.link,style:{color:"var(--primary)",fontSize:13,textDecoration:"none",marginTop:4,display:"inline-block"},children:"查看详情 →"}),(0,t.jsx)("div",{style:{fontSize:12,color:"var(--text-light)",marginTop:4},children:n})]})]},e.id)})})]}):(0,t.jsx)("div",{className:"page-slide active",style:{textAlign:"center",color:"#94a3b8",padding:"40px 0"},children:"请先登录"})}function tf({modal:e,onClose:n,reportPostId:s}){let{login:i,register:o,currentUser:l,refresh:c}=p(),{t:h}=(0,f.useTranslation)(),{toast:A}=(0,y.useToast)(),[d,u]=(0,r.useState)(""),[g,x]=(0,r.useState)(""),[b,w]=(0,r.useState)(""),[I,C]=(0,r.useState)(""),[v,k]=(0,r.useState)(""),[S,B]=(0,r.useState)(null),[j,E]=(0,r.useState)(""),[D,N]=(0,r.useState)("spam");if((0,r.useEffect)(()=>{"register"===e&&a.getCaptcha().then(e=>B(e)).catch(()=>{})},[e]),!e)return null;let R=e=>{e&&e.target!==e.currentTarget||n()},F=async()=>{if(!d.trim()||!g)return void A("请填写完整信息","warning");try{(await i(d.trim(),g)).user&&(n(),u(""),x(""),c())}catch(e){A("登录失败:"+e.message,"error")}},Q=async()=>{if(!b.trim()||!I.trim()||!v)return void A("请填写完整信息","warning");if(v.length<6)return void A("密码至少6位","warning");if(!S||!j.trim())return void A("请填写验证码","warning");try{await o(I.trim(),v,b.trim(),{id:S.id,answer:j.trim(),sig:S.sig}),n(),w(""),C(""),k(""),E(""),A("注册成功!","success"),c()}catch(e){A("注册失败:"+e.message,"error"),a.getCaptcha().then(e=>B(e)).catch(()=>{}),E("")}},T=async()=>{if(s)try{await a.createReport(s,D),n(),A("举报已提交,管理员将尽快处理","success")}catch(e){A("举报失败:"+e.message,"error")}};return(0,t.jsxs)(t.Fragment,{children:["login"===e&&(0,t.jsx)("div",{className:"modal active",onClick:R,children:(0,t.jsxs)("div",{className:"modal-content",children:[(0,t.jsx)("span",{className:"close",onClick:n,children:(0,t.jsx)(m.Icon,{name:"close",size:20})}),(0,t.jsx)("h2",{style:{marginBottom:16},children:h("auth.login")}),(0,t.jsx)("input",{type:"email",placeholder:h("auth.email"),value:d,onChange:e=>u(e.target.value)}),(0,t.jsx)("input",{type:"password",placeholder:h("auth.password"),value:g,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"===e.key&&F()}}),(0,t.jsx)("button",{className:"btn-primary",style:{width:"100%"},onClick:F,children:h("auth.login")})]})}),"register"===e&&(0,t.jsx)("div",{className:"modal active",onClick:R,children:(0,t.jsxs)("div",{className:"modal-content",children:[(0,t.jsx)("span",{className:"close",onClick:n,children:(0,t.jsx)(m.Icon,{name:"close",size:20})}),(0,t.jsx)("h2",{style:{marginBottom:16},children:h("auth.register")}),(0,t.jsx)("input",{type:"text",placeholder:h("auth.username"),value:b,onChange:e=>w(e.target.value)}),(0,t.jsx)("input",{type:"email",placeholder:h("auth.email"),value:I,onChange:e=>C(e.target.value)}),(0,t.jsx)("input",{type:"password",placeholder:h("auth.passwordHint"),value:v,onChange:e=>k(e.target.value)}),(0,t.jsxs)("div",{className:"captcha-row",style:{display:"flex",alignItems:"center",gap:10,margin:"12px 0"},children:[S?(0,t.jsx)(e2,{captcha:S,onRefresh:()=>{a.getCaptcha().then(e=>B(e)).catch(()=>{}),E("")}}):(0,t.jsx)("span",{style:{color:"var(--text-light)"},children:h("newPost.captchaLoading")}),(0,t.jsx)("input",{type:"text",placeholder:"答案",style:{width:80,background:"var(--bg)",color:"var(--text)",border:"1px solid var(--border)",padding:"8px 12px",borderRadius:4},value:j,onChange:e=>E(e.target.value)})]}),(0,t.jsx)("button",{className:"btn-primary",style:{width:"100%"},onClick:Q,children:h("auth.register")})]})}),"report"===e&&l&&(0,t.jsx)("div",{className:"modal active",onClick:R,children:(0,t.jsxs)("div",{className:"modal-content",children:[(0,t.jsx)("span",{className:"close",onClick:n,children:(0,t.jsx)(m.Icon,{name:"close",size:20})}),(0,t.jsxs)("h2",{style:{marginBottom:16},children:[(0,t.jsx)(m.Icon,{name:"shieldAlert",size:20})," ",h("post.reportTitle")]}),(0,t.jsx)("p",{style:{fontSize:14,color:"#64748b",marginBottom:12},children:h("post.reportReason")}),(0,t.jsxs)("select",{style:{width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:4,marginBottom:16,background:"var(--bg)",color:"var(--text)"},value:D,onChange:e=>N(e.target.value),children:[(0,t.jsx)("option",{value:"spam",children:h("report.spam")}),(0,t.jsx)("option",{value:"abuse",children:h("report.abuse")}),(0,t.jsx)("option",{value:"illegal",children:h("report.illegal")}),(0,t.jsx)("option",{value:"nsfw",children:h("report.nsfw")}),(0,t.jsx)("option",{value:"other",children:h("report.other")})]}),(0,t.jsx)("button",{className:"btn-primary",style:{width:"100%"},onClick:T,children:h("post.submitReport")})]})})]})}function tm({forumName:e,forumNameLoaded:r}){return(0,t.jsx)("div",{className:"loading-screen",children:(0,t.jsxs)("div",{className:"loading-inner",children:[(0,t.jsx)("div",{className:"loading-spinner"}),(0,t.jsx)("div",{className:"loading-title"+(r?" loading-title-appear":""),id:"loadingTitle",suppressHydrationWarning:!0,children:r&&e}),(0,t.jsx)("div",{className:"loading-sub",children:"加载中..."})]})})}function tx(){let{view:e,currentPostId:n,currentPostPreview:s,currentUsername:i,currentPageName:o,ready:a,forumName:l,forumNameLoaded:c}=p(),[h,A]=(0,r.useState)(null),[d,u]=(0,r.useState)(null),g=e=>A(e);return a?(0,t.jsxs)("div",{className:"app-fade-in",children:[(0,t.jsx)(C,{onOpenModal:g}),(0,t.jsx)(I,{}),(0,t.jsxs)("div",{id:"app",style:{display:"feed"===e?void 0:"none"},children:[(0,t.jsx)(B,{}),(0,t.jsx)(e1,{onOpenModal:g,onReport:e=>{u(e),A("report")}})]}),(0,t.jsxs)("div",{style:{display:"feed"!==e?"block":"none"},children:["post"===e&&n&&(0,t.jsx)(e3,{postId:n,initialPost:s}),"user"===e&&i&&(0,t.jsx)(td,{username:i}),"custom"===e&&o&&(0,t.jsx)(tu,{pageName:o}),"new"===e&&(0,t.jsx)(e8,{}),"admin"===e&&(0,t.jsx)(ti,{}),"settings"===e&&(0,t.jsx)(tA,{}),"messages"===e&&(0,t.jsx)(tg,{})]}),(0,t.jsx)(tf,{modal:h,onClose:()=>A(null),reportPostId:d})]}):(0,t.jsx)(tm,{forumName:l,forumNameLoaded:c})}e.s(["default",0,function({cachedName:e=""}){return(0,t.jsx)(g,{cachedName:e,children:(0,t.jsx)(tx,{})})}],8671)},47963,e=>{"use strict";let t=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function r(e){let t=atob(e),r=-2&t.length,n=new Uint16Array(r/2);for(let e=0,s=0;e=e6.ZERO&&e<=e6.NINE}(eX=e8||(e8={}))[eX.VALUE_LENGTH=49152]="VALUE_LENGTH",eX[eX.FLAG13=8192]="FLAG13",eX[eX.BRANCH_LENGTH=8064]="BRANCH_LENGTH",eX[eX.JUMP_TABLE=127]="JUMP_TABLE",(eq=e6||(e6={}))[eq.NUM=35]="NUM",eq[eq.SEMI=59]="SEMI",eq[eq.EQUALS=61]="EQUALS",eq[eq.ZERO=48]="ZERO",eq[eq.NINE=57]="NINE",eq[eq.LOWER_A=97]="LOWER_A",eq[eq.LOWER_F=102]="LOWER_F",eq[eq.LOWER_X=120]="LOWER_X",eq[eq.LOWER_Z=122]="LOWER_Z",eq[eq.UPPER_A=65]="UPPER_A",eq[eq.UPPER_F=70]="UPPER_F",eq[eq.UPPER_Z=90]="UPPER_Z",(e_=e5||(e5={}))[e_.EntityStart=0]="EntityStart",e_[e_.NumericStart=1]="NumericStart",e_[e_.NumericDecimal=2]="NumericDecimal",e_[e_.NumericHex=3]="NumericHex",e_[e_.NamedEntity=4]="NamedEntity",(e$=e9||(e9={}))[e$.Legacy=0]="Legacy",e$[e$.Strict=1]="Strict",e$[e$.Attribute=2]="Attribute";class o{decodeTree;emitCodePoint;errors;constructor(e,t,r){this.decodeTree=e,this.emitCodePoint=t,this.errors=r}state=e5.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=e9.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=e5.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case e5.EntityStart:if(e.charCodeAt(t)===e6.NUM)return this.state=e5.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1);return this.state=e5.NamedEntity,this.stateNamedEntity(e,t);case e5.NumericStart:return this.stateNumericStart(e,t);case e5.NumericDecimal:return this.stateNumericDecimal(e,t);case e5.NumericHex:return this.stateNumericHex(e,t);case e5.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===e6.LOWER_X?(this.state=e5.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=e5.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t=e6.UPPER_A)||!(r<=e6.UPPER_F))&&(!(r>=e6.LOWER_A)||!(r<=e6.LOWER_F)))return this.emitNumericEntity(n,3);{let e=n<=e6.NINE?n-e6.ZERO:(32|n)-e6.LOWER_A+10;this.result=16*this.result+e,this.consumed++,t++}}return -1}stateNumericDecimal(e,t){for(;t=55296&&n<=57343||n>1114111?65533:t.get(n)??n,this.consumed),this.errors&&(e!==e6.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:r}=this,n=r[this.treeIndex],s=(n&e8.VALUE_LENGTH)>>14;for(;t>7;if(0===this.runConsumed){let r=n&e8.JUMP_TABLE;if(e.charCodeAt(t)!==r)return 0===this.result?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return -1;let n=this.runConsumed-1,s=r[this.treeIndex+1+(n>>1)],i=n%2==0?255&s:s>>8&255;if(e.charCodeAt(t)!==i)return this.runConsumed=0,0===this.result?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(i>>1),s=((n=r[this.treeIndex])&e8.VALUE_LENGTH)>>14}if(t>=e.length)break;let o=e.charCodeAt(t);if(o===e6.SEMI&&0!==s&&(n&e8.FLAG13)!=0)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);if(this.treeIndex=function(e,t,r,n){let s=(t&e8.BRANCH_LENGTH)>>7,i=t&e8.JUMP_TABLE;if(0===s)return 0!==i&&n===i?r:-1;if(i){let t=n-i;return t<0||t>=s?-1:e[r+t]-1}let o=s+1>>1,a=0,l=s-1;for(;a<=l;){let t=a+l>>>1,s=e[r+(t>>1)]>>(1&t)*8&255;if(sn))return e[r+o+t];l=t-1}}return -1}(r,n,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return 0===this.result||this.decodeMode===e9.Attribute&&(0===s||function(e){var t;return e===e6.EQUALS||(t=e)>=e6.UPPER_A&&t<=e6.UPPER_Z||t>=e6.LOWER_A&&t<=e6.LOWER_Z||i(t)}(o))?0:this.emitNotTerminatedNamedEntity();if(0!=(s=((n=r[this.treeIndex])&e8.VALUE_LENGTH)>>14)){if(o===e6.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==e9.Strict&&(n&e8.FLAG13)==0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return -1}emitNotTerminatedNamedEntity(){let{result:e,decodeTree:t}=this,r=(t[e]&e8.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,r,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,r){let{decodeTree:n}=this;return this.emitCodePoint(1===t?n[e]&~(e8.VALUE_LENGTH|e8.FLAG13):n[e+1],r),3===t&&this.emitCodePoint(n[e+2],r),r}end(){switch(this.state){case e5.NamedEntity:return 0!==this.result&&(this.decodeMode!==e9.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case e5.NumericDecimal:return this.emitNumericEntity(0,2);case e5.NumericHex:return this.emitNumericEntity(0,3);case e5.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case e5.EntityStart:return 0}}}function a(e){return e===e7.Space||e===e7.NewLine||e===e7.Tab||e===e7.FormFeed||e===e7.CarriageReturn}function l(e){return e===e7.Slash||e===e7.Gt||a(e)}(e0=e7||(e7={}))[e0.Tab=9]="Tab",e0[e0.NewLine=10]="NewLine",e0[e0.FormFeed=12]="FormFeed",e0[e0.CarriageReturn=13]="CarriageReturn",e0[e0.Space=32]="Space",e0[e0.ExclamationMark=33]="ExclamationMark",e0[e0.Number=35]="Number",e0[e0.Amp=38]="Amp",e0[e0.SingleQuote=39]="SingleQuote",e0[e0.DoubleQuote=34]="DoubleQuote",e0[e0.Dash=45]="Dash",e0[e0.Slash=47]="Slash",e0[e0.Zero=48]="Zero",e0[e0.Nine=57]="Nine",e0[e0.Semi=59]="Semi",e0[e0.Lt=60]="Lt",e0[e0.Eq=61]="Eq",e0[e0.Gt=62]="Gt",e0[e0.Questionmark=63]="Questionmark",e0[e0.UpperA=65]="UpperA",e0[e0.LowerA=97]="LowerA",e0[e0.UpperF=70]="UpperF",e0[e0.LowerF=102]="LowerF",e0[e0.UpperZ=90]="UpperZ",e0[e0.LowerZ=122]="LowerZ",e0[e0.LowerX=120]="LowerX",e0[e0.OpeningSquareBracket=91]="OpeningSquareBracket",(e1=te||(te={}))[e1.Text=1]="Text",e1[e1.BeforeTagName=2]="BeforeTagName",e1[e1.InTagName=3]="InTagName",e1[e1.InSelfClosingTag=4]="InSelfClosingTag",e1[e1.BeforeClosingTagName=5]="BeforeClosingTagName",e1[e1.InClosingTagName=6]="InClosingTagName",e1[e1.AfterClosingTagName=7]="AfterClosingTagName",e1[e1.BeforeAttributeName=8]="BeforeAttributeName",e1[e1.InAttributeName=9]="InAttributeName",e1[e1.AfterAttributeName=10]="AfterAttributeName",e1[e1.BeforeAttributeValue=11]="BeforeAttributeValue",e1[e1.InAttributeValueDq=12]="InAttributeValueDq",e1[e1.InAttributeValueSq=13]="InAttributeValueSq",e1[e1.InAttributeValueNq=14]="InAttributeValueNq",e1[e1.BeforeDeclaration=15]="BeforeDeclaration",e1[e1.InDeclaration=16]="InDeclaration",e1[e1.InProcessingInstruction=17]="InProcessingInstruction",e1[e1.BeforeComment=18]="BeforeComment",e1[e1.CDATASequence=19]="CDATASequence",e1[e1.DeclarationSequence=20]="DeclarationSequence",e1[e1.InSpecialComment=21]="InSpecialComment",e1[e1.InCommentLike=22]="InCommentLike",e1[e1.SpecialStartSequence=23]="SpecialStartSequence",e1[e1.InSpecialTag=24]="InSpecialTag",e1[e1.InPlainText=25]="InPlainText",e1[e1.InEntity=26]="InEntity",(e2=tt||(tt={}))[e2.NoValue=0]="NoValue",e2[e2.Unquoted=1]="Unquoted",e2[e2.Single=2]="Single",e2[e2.Double=3]="Double";let c={Empty:new Uint8Array(0),Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,33,62]),Doctype:new Uint8Array([100,111,99,116,121,112,101]),IframeEnd:new Uint8Array([60,47,105,102,114,97,109,101]),NoembedEnd:new Uint8Array([60,47,110,111,101,109,98,101,100]),NoframesEnd:new Uint8Array([60,47,110,111,102,114,97,109,101,115]),Plaintext:new Uint8Array([60,47,112,108,97,105,110,116,101,120,116]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])},h=new Map([[c.IframeEnd[2],c.IframeEnd],[c.NoembedEnd[2],c.NoembedEnd],[c.Plaintext[2],c.Plaintext],[c.ScriptEnd[2],c.ScriptEnd],[c.TitleEnd[2],c.TitleEnd],[c.XmpEnd[2],c.XmpEnd]]);class A{cbs;state=te.Text;buffer="";sectionStart=0;index=0;entityStart=0;baseState=te.Text;isSpecial=!1;running=!0;offset=0;xmlMode;decodeEntities;recognizeSelfClosing;entityDecoder;constructor({xmlMode:e=!1,decodeEntities:t=!0,recognizeSelfClosing:r=e},i){this.cbs=i,this.xmlMode=e,this.decodeEntities=t,this.recognizeSelfClosing=r,this.entityDecoder=new o(e?s:n,(e,t)=>this.emitCodePoint(e,t))}reset(){this.state=te.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=te.Text,this.isSpecial=!1,this.currentSequence=c.Empty,this.sequenceIndex=0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.indexthis.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=te.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===e7.Amp&&this.startEntity()}currentSequence=c.Empty;sequenceIndex=0;enterTagBody(){this.currentSequence===c.Plaintext?(this.currentSequence=c.Empty,this.state=te.InPlainText):this.isSpecial?(this.state=te.InSpecialTag,this.sequenceIndex=0):this.state=te.Text}stateSpecialStartSequence(e){let t=32|e;if(this.sequenceIndex=e7.LowerA&&e<=e7.LowerZ||e>=e7.UpperA&&e<=e7.UpperZ}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(l(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart=0)this.state=this.baseState,0===t&&(this.index-=1);else{if(e=e))switch(this.state){case te.InTagName:case te.BeforeAttributeName:case te.BeforeAttributeValue:case te.AfterAttributeName:case te.InAttributeName:case te.InAttributeValueSq:case te.InAttributeValueDq:case te.InAttributeValueNq:case te.InClosingTagName:break;default:this.cbs.ontext(this.sectionStart,e)}}emitCodePoint(e,t){this.baseState!==te.Text&&this.baseState!==te.InSpecialTag?(this.sectionStart1){let e=v.get(r);if(void 0!==e&&this.stack.includes(e))return e}return this.isInForeignContext()?r:"image"===r?"img":r}onopentagname(e,t){this.endIndex=t,this.emitOpenTag(this.readTagName(e,t))}emitOpenTag(e){if(this.openTagStart=this.startIndex,this.tagname=e,this.htmlMode&&"form"===e&&this.stack.includes("form")){this.tagname="";return}let t=this.htmlMode&&y.get(e);if(t)for(;this.stack.length>0&&t.has(this.stack[0]);)this.popElement(!0);!this.isVoidElement(e)&&(this.stack.unshift(e),this.htmlMode&&("svg"===e?this.foreignContext.unshift(tr.Svg):"math"===e?this.foreignContext.unshift(tr.MathML):C.has(e)&&this.foreignContext.unshift(tr.None))),this.cbs.onopentagname?.(e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){this.startIndex=this.openTagStart,this.attribs&&(this.cbs.onopentag?.(this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){this.endIndex=t;let r=this.readTagName(e,t);if(this.isVoidElement(r))this.htmlMode&&"br"===r&&(this.cbs.onopentagname?.("br"),this.cbs.onopentag?.("br",{},!0),this.cbs.onclosetag?.("br",!1));else{let e=this.stack.indexOf(r);if(-1!==e){for(let t=0;t=this.buffers[0].length;)this.shiftBuffer();let r=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),r+=this.buffers[0].slice(0,t-this.bufferOffset);return r}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){this.ended?this.cbs.onerror?.(Error(".write() after done!")):(this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++))}end(e){this.ended?this.cbs.onerror?.(Error(".end() after done!")):(e&&this.write(e),this.ended=!0,this.tokenizer.end())}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}}class J extends U{type=tn.CDATA;get nodeType(){return 4}}class z extends U{type=tn.Root;get nodeType(){return 9}}class Z extends U{name;attribs;type;constructor(e,t,r=[],n="script"===e?tn.Script:"style"===e?tn.Style:tn.Tag){super(r),this.name=e,this.attribs=t,this.type=n}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map(e=>({name:e,value:this.attribs[e],namespace:this["x-attribsNamespace"]?.[e],prefix:this["x-attribsPrefix"]?.[e]}))}namespace;"x-attribsNamespace";"x-attribsPrefix"}function L(e){return B(e)}function P(e){return e.type===tn.CDATA}function H(e){return e.type===tn.Text}function V(e){return e.type===tn.Comment}function X(e){return Object.hasOwn(e,"children")}function q(e,t=!1){let r;if(H(e))r=new O(e.data);else if(V(e))r=new M(e.data);else if(B(e)){let n=t?_(e.children):[],s=new Z(e.name,{...e.attribs},n);for(let e of n)e.parent=s;null!=e.namespace&&(s.namespace=e.namespace),e["x-attribsNamespace"]&&(s["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(s["x-attribsPrefix"]={...e["x-attribsPrefix"]}),r=s}else if(P(e)){let n=t?_(e.children):[],s=new J(n);for(let e of n)e.parent=s;r=s}else if(e.type===tn.Root){let n=t?_(e.children):[],s=new z(n);for(let e of n)e.parent=s;e["x-mode"]&&(s["x-mode"]=e["x-mode"]),r=s}else if(e.type===tn.Directive){let t=new Y(e.name,e.data);null!=e["x-name"]&&(t["x-name"]=e["x-name"],t["x-publicId"]=e["x-publicId"],t["x-systemId"]=e["x-systemId"]),r=t}else throw Error(`Not implemented yet: ${e.type}`);return r.startIndex=e.startIndex,r.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(r.sourceCodeLocation=e.sourceCodeLocation),r}function _(e){let t=e.map(e=>q(e,!0));for(let e=1;e=i[0].length){if(1===o.length)return s;i.shift(),o.shift();continue}let t=i[0][o[0]++];if(e(t)&&(s.push(t),--n<=0))return s;r&&X(t)&&t.children.length>0&&(o.unshift(0),i.unshift(t.children))}}function en(e,t,r=!0){for(let n of Array.isArray(t)?t:[t]){if(B(n)&&e(n))return n;if(r&&X(n)&&n.children.length>0){let t=en(e,n.children,!0);if(t)return t}}return null}function es(e,t){return(Array.isArray(t)?t:[t]).some(t=>B(t)&&e(t)||X(t)&&es(e,t.children))}function ei(e,t){let r=[],n=[Array.isArray(t)?t:[t]],s=[0];for(;;){if(s[0]>=n[0].length){if(1===n.length)return r;n.shift(),s.shift();continue}let t=n[0][s[0]++];B(t)&&e(t)&&r.push(t),X(t)&&t.children.length>0&&(s.unshift(0),n.unshift(t.children))}}e.s(["existsOne",0,es,"filter",0,et,"find",0,er,"findAll",0,ei,"findOne",0,en],66543);let eo={tag_name:e=>"function"==typeof e?t=>B(t)&&e(t.name):"*"===e?L:t=>B(t)&&t.name===e,tag_type:e=>"function"==typeof e?t=>e(t.type):t=>t.type===e,tag_contains:e=>"function"==typeof e?t=>H(t)&&e(t.data):t=>H(t)&&t.data===e};function ea(e,t){return"function"==typeof t?r=>B(r)&&t(r.attribs[e]):r=>B(r)&&r.attribs[e]===t}function el(e,t){return r=>e(r)||t(r)}function ec(e){let t=Object.keys(e).map(t=>{let r=e[t];return Object.hasOwn(eo,t)?eo[t](r):ea(t,r)});return 0===t.length?null:t.reduce(el)}function eh(e,t){let r=ec(e);return!r||r(t)}function eA(e,t,r,n=1/0){let s=ec(e);return s?et(s,t,r,n):[]}function ed(e,t,r=!0){return Array.isArray(t)||(t=[t]),en(ea("id",e),t,r)}function eu(e,t,r=!0,n=1/0){return et(eo.tag_name(e),t,r,n)}function ep(e,t,r=!0,n=1/0){return et(ea("class",e),t,r,n)}function eg(e,t,r=!0,n=1/0){return et(eo.tag_type(e),t,r,n)}e.s(["getElementById",0,ed,"getElements",0,eA,"getElementsByClassName",0,ep,"getElementsByTagName",0,eu,"getElementsByTagType",0,eg,"testElement",0,eh],62807);let ef=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),em="function"==typeof String.prototype.codePointAt?(e,t)=>e.codePointAt(t):(e,t)=>(64512&e.charCodeAt(t))==55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t);function ex(e){let t,r=0,{length:n}=e;for(let s=0;s>>n&1)==0||n>=64||n<32))continue;if(void 0===t?t=e.substring(0,s):r!==s&&(t+=e.substring(r,s)),n<64){t+=ef.get(n),r=s+1;continue}let i=em(e,s);t+=`${i.toString(16)};`,i!==n&&s++,r=s+1}return void 0===t?e:(r\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])),eI=new Map("altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath".split(" ").map(e=>[e.toLowerCase(),e])),eC=new Map("definitionURL attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits diffuseConstant edgeMode filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" ").map(e=>[e.toLowerCase(),e])),ev=new Set("style script xmp iframe noembed noframes plaintext noscript".split(" ")),ek=new Set("area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr".split(" ")),eS=new Set(["svg","math"]),eB=new Set("mi mo mn ms mtext annotation-xml foreignObject desc title".split(" ")),ej=function(e,t={}){let r="length"in e?e:[e],n=t.xmlMode??!1,s="";for(let e=0;e`;case N:return``;case T:return``;case R:case F:case Q:return function(e,t,r){"foreign"===r&&(e.name=eI.get(e.name)??e.name,e.parent&&eB.has(e.parent.name)&&(r=!1)),!r&&eS.has(e.name)&&(r="foreign");let{name:n,children:s}=e,i=!r&&ek.has(n),o=`<${n}${function(e,t,r){if(!e)return"";let n=(t.encodeEntities??t.decodeEntities)===!1?eN:r||"utf8"!==t.encodeEntities?ex:eb,s="foreign"===r,i=!!(t.emptyAttrs??r),o="";for(let t in e){if(!Object.hasOwn(e,t))continue;let r=e[t],a=s?eC.get(t)??t:t;o+=i||null!=r&&""!==r?` ${a}="${n(null==r?"":String(r))}"`:` ${a}`}return o}(e.attribs,t,r)}`;return 0===s.length&&(r?!1!==t.selfClosingTags:t.selfClosingTags&&i)?o+=r?"/>":" />":(o+=">",s.length>0&&(o+=eE(s,t,r)),i||(o+=`${n}>`)),o}(e,t,r);case E:{let n=e.data||"";if((t.encodeEntities??t.decodeEntities)!==!1&&!(!r&&e.parent&&ev.has(e.parent.name)))return r||"utf8"!==t.encodeEntities?ex(n):ew(n);return n}}}function eN(e){return e.replaceAll('"',""")}function eR(e,t){return ej(e,t)}function eF(e,t){return X(e)?e.children.map(e=>eR(e,t)).join(""):""}function eQ(e){return Array.isArray(e)?e.map(eQ).join(""):B(e)?"br"===e.name?"\n":eQ(e.children):P(e)?eQ(e.children):H(e)?e.data:""}function eT(e){return Array.isArray(e)?e.map(eT).join(""):X(e)&&!V(e)?eT(e.children):H(e)?e.data:""}function eW(e){return Array.isArray(e)?e.map(eW).join(""):X(e)&&(e.type===tn.Tag||P(e))?eW(e.children):H(e)?e.data:""}function eK(e){var t;let r,n,s,i,o,a,l,c=eY(ez,e);return c?"feed"===c.name?(n={type:"atom",items:eu("entry",r=c.children).map(e=>{let{children:t}=e,r={media:eM(t)};eJ(r,"id","id",t),eJ(r,"title","title",t);let n=eY("link",t)?.attribs.href;n&&(r.link=n);let s=eU("summary",t)||eU("content",t);s&&(r.description=s);let i=eU("updated",t);return i&&(r.pubDate=new Date(i)),r})},eJ(n,"id","id",r),eJ(n,"title","title",r),(s=eY("link",r)?.attribs.href)&&(n.link=s),eJ(n,"description","subtitle",r),(i=eU("updated",r))&&(n.updated=new Date(i)),eJ(n,"author","email",r,!0),n):(t=c,o=eY("channel",t.children)?.children??[],a={type:t.name.substr(0,3),id:"",items:eu("item",t.children).map(e=>{let{children:t}=e,r={media:eM(t)};eJ(r,"id","guid",t),eJ(r,"title","title",t),eJ(r,"link","link",t),eJ(r,"description","description",t);let n=eU("pubDate",t)||eU("dc:date",t);return n&&(r.pubDate=new Date(n)),r})},eJ(a,"title","title",o),eJ(a,"link","link",o),eJ(a,"description","description",o),(l=eU("lastBuildDate",o))&&(a.updated=new Date(l)),eJ(a,"author","managingEditor",o,!0),a):null}e.s(["getInnerHTML",0,eF,"getOuterHTML",0,eR,"getText",0,eQ,"innerText",0,eW,"textContent",0,eT],75190);let eG=["url","type","lang"],eO=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function eM(e){return eu("media:content",e).map(e=>{let{attribs:t}=e,r={medium:t.medium,isDefault:!!t.isDefault};for(let e of eG)t[e]&&(r[e]=t[e]);for(let e of eO)t[e]&&(r[e]=Number.parseInt(t[e],10));return t.expression&&(r.expression=t.expression),r})}function eY(e,t){return eu(e,t,!0,1)[0]}function eU(e,t,r=!1){return eT(eu(e,t,r,1)).trim()}function eJ(e,t,r,n,s=!1){let i=eU(r,n,s);i&&(e[t]=i)}function ez(e){return"rss"===e||"feed"===e||"rdf:RDF"===e}function eZ(e,t){let r=new ee(void 0,t);return new S(r,t).end(e),r.root}function eL(e,t,r){let n=new ee(t=>e(t,n.root),t,r);return new S(n,t)}e.s(["getFeed",0,eK],39305);let eP={xmlMode:!0};function eH(e,t=eP){return eK(eZ(e,t).children)}e.s(["createDocumentStream",0,eL,"parseDocument",0,eZ,"parseFeed",0,eH],57516),e.i(57516);var eV,eX,eq,e_,e$,e0,e1,e2,e4,e3,e8,e6,e5,e9,e7,te,tt,tr,tn,ts,ti=e.i(52342);function to(e){let t=e.length;for(;--t>=0;){let r=e[t];if(t>0&&e.lastIndexOf(r,t-1)>=0){e.splice(t,1);continue}for(let n=r.parent;n;n=n.parent)if(e.includes(n)){e.splice(t,1);break}}return e}function ta(e,t){let r=[],n=[];if(e===t)return 0;let s=X(e)?e:e.parent;for(;s;)r.unshift(s),s=s.parent;for(s=X(t)?t:t.parent;s;)n.unshift(s),s=s.parent;let i=Math.min(r.length,n.length),o=0;for(;ol.indexOf(h)?a===t?ts.FOLLOWING|ts.CONTAINED_BY:ts.FOLLOWING:a===e?ts.PRECEDING|ts.CONTAINS:ts.PRECEDING}function tl(e){return(e=e.filter((e,t,r)=>!r.includes(e,t+1))).sort((e,t)=>{let r=ta(e,t);return r&ts.PRECEDING?-1:r&ts.FOLLOWING?1:0}),e}function tc(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){let t=e.parent.children,r=t.lastIndexOf(e);-1!==r&&t.splice(r,1)}e.next=null,e.prev=null,e.parent=null}function th(e,t){if(t.prev=e.prev,t.prev&&(t.prev.next=t),t.next=e.next,t.next&&(t.next.prev=t),t.parent=e.parent,t.parent){let{children:r}=t.parent,n=r.lastIndexOf(e);-1!==n&&(r[n]=t,e.parent=null)}}function tA(e,t){if(tc(t),t.next=null,t.parent=e,e.children.push(t)>1){let r=e.children[e.children.length-2];r.next=t,t.prev=r}else t.prev=null}function td(e,t){tc(t);let{parent:r}=e,n=e.next;if(t.next=n,t.prev=e,e.next=t,t.parent=r,n){if(n.prev=t,r){let e=r.children;e.splice(e.lastIndexOf(n),0,t)}}else r&&r.children.push(t)}function tu(e,t){if(tc(t),t.parent=e,t.prev=null,1===e.children.unshift(t))t.next=null;else{let r=e.children[1];r.prev=t,t.next=r}}function tp(e,t){tc(t);let{parent:r}=e;if(r){let n=r.children;n.splice(n.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=r,t.prev=e.prev,t.next=e,e.prev=t}function tg(e){return X(e)?e.children:[]}function tf(e){return e.parent||null}function tm(e){let t=tf(e);if(null!=t)return tg(t);let r=[e],{prev:n,next:s}=e;for(;null!=n;)r.unshift(n),{prev:n}=n;for(;null!=s;)r.push(s),{next:s}=s;return r}function tx(e,t){let{attribs:r}=e;return r?.[t]}function ty(e,t){let{attribs:r}=e;return null!=r&&Object.hasOwn(r,t)&&null!=r[t]}function tb(e){return e.name}function tw(e){let{next:t}=e;for(;null!==t&&!B(t);)({next:t}=t);return t}function tI(e){let{prev:t}=e;for(;null!==t&&!B(t);)({prev:t}=t);return t}e.s([],51294),e.i(51294),e.i(39305),(eV=ts||(ts={}))[eV.DISCONNECTED=1]="DISCONNECTED",eV[eV.PRECEDING=2]="PRECEDING",eV[eV.FOLLOWING=4]="FOLLOWING",eV[eV.CONTAINS=8]="CONTAINS",eV[eV.CONTAINED_BY=16]="CONTAINED_BY",e.s(["DocumentPosition",0,ts,"compareDocumentPosition",0,ta,"removeSubsets",0,to,"uniqueSort",0,tl],89329),e.i(89329),e.i(62807),e.s(["append",0,td,"appendChild",0,tA,"prepend",0,tp,"prependChild",0,tu,"removeElement",0,tc,"replaceElement",0,th],29722),e.i(29722),e.i(66543),e.i(75190),e.s(["getAttributeValue",0,tx,"getChildren",0,tg,"getName",0,tb,"getParent",0,tf,"getSiblings",0,tm,"hasAttrib",0,ty,"nextElementSibling",0,tw,"prevElementSibling",0,tI],19414),e.i(19414),e.s(["DocumentPosition",0,ts,"append",0,td,"appendChild",0,tA,"compareDocumentPosition",0,ta,"existsOne",0,es,"filter",0,et,"find",0,er,"findAll",0,ei,"findOne",0,en,"getAttributeValue",0,tx,"getChildren",0,tg,"getElementById",0,ed,"getElements",0,eA,"getElementsByClassName",0,ep,"getElementsByTagName",0,eu,"getElementsByTagType",0,eg,"getFeed",0,eK,"getInnerHTML",0,eF,"getName",0,tb,"getOuterHTML",0,eR,"getParent",0,tf,"getSiblings",0,tm,"getText",0,eQ,"hasAttrib",0,ty,"innerText",0,eW,"nextElementSibling",0,tw,"prepend",0,tp,"prependChild",0,tu,"prevElementSibling",0,tI,"removeElement",0,tc,"removeSubsets",0,to,"replaceElement",0,th,"testElement",0,eh,"textContent",0,eT,"uniqueSort",0,tl],2150);var tC=e.i(2150);e.s(["DefaultHandler",0,ee,"DomHandler",0,ee,"DomUtils",0,tC,"ElementType",0,ti,"Parser",0,S,"QuoteType",0,tt,"Tokenizer",0,A,"createDocumentStream",0,eL,"getFeed",0,eK,"parseDocument",0,eZ,"parseFeed",0,eH],47963)},64873,(e,t,r)=>{"use strict";t.exports=e=>{if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}},75654,(e,t,r)=>{"use strict";function n(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.isPlainObject=function(e){var t,r;return!1!==n(e)&&(void 0===(t=e.constructor)||!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}},30860,(e,t,r)=>{"use strict";var n=function(e){var t,r,n;return!!(t=e)&&"object"==typeof t&&(r=e,"[object RegExp]"!==(n=Object.prototype.toString.call(r))&&"[object Date]"!==n&&r.$$typeof!==s)},s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c(Array.isArray(e)?[]:{},e,t):e}function o(e,t,r){return e.concat(t).map(function(e){return i(e,r)})}function a(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function l(e,t){try{return t in e}catch(e){return!1}}function c(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=i;var s,h,A=Array.isArray(t);return A!==Array.isArray(e)?i(t,r):A?r.arrayMerge(e,t,r):(h={},(s=r).isMergeableObject(e)&&a(e).forEach(function(t){h[t]=i(e[t],s)}),a(t).forEach(function(r){l(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))||(l(e,r)&&s.isMergeableObject(t[r])?h[r]=(function(e,t){if(!t.customMerge)return c;var r=t.customMerge(e);return"function"==typeof r?r:c})(r,s)(e[r],t[r],s):h[r]=i(t[r],s))}),h)}c.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return c(e,r,t)},{})},t.exports=c},61840,(e,t,r)=>{!function(r,n){if("function"==typeof define&&define.amd){let t;void 0!==(t=n())&&e.v(t)}else t.exports?t.exports=n():r.parseSrcset=n()}(e.e,function(){return function(e){function t(e){return" "===e||" "===e||"\n"===e||"\f"===e||"\r"===e}function r(t){var r,n=t.exec(e.substring(g));if(n)return r=n[0],g+=r.length,r}for(var n,s,i,o,a,l=e.length,c=/^[ \t\n\r\u000c]+/,h=/^[, \t\n\r\u000c]+/,A=/^[^ \t\n\r\u000c]+/,d=/[,]+$/,u=/^\d+$/,p=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,g=0,f=[];;){if(r(h),g>=l)return f;n=r(A),s=[],","===n.slice(-1)?(n=n.replace(d,""),m()):function(){for(r(c),i="",o="in descriptor";;){if(a=e.charAt(g),"in descriptor"===o)if(t(a))i&&(s.push(i),i="",o="after descriptor");else if(","===a){g+=1,i&&s.push(i),m();return}else if("("===a)i+=a,o="in parens";else if(""===a){i&&s.push(i),m();return}else i+=a;else if("in parens"===o)if(")"===a)i+=a,o="in descriptor";else if(""===a){s.push(i),m();return}else i+=a;else if("after descriptor"===o)if(t(a));else{if(""===a)return void m();o="in descriptor",g-=1}g+=1}}()}function m(){var t,r,i,o,a,l,c,h,A,d=!1,g={};for(o=0;o{var n=String,s=function(){return{isColorSupported:!1,reset:n,bold:n,dim:n,italic:n,underline:n,inverse:n,hidden:n,strikethrough:n,black:n,red:n,green:n,yellow:n,blue:n,magenta:n,cyan:n,white:n,gray:n,bgBlack:n,bgRed:n,bgGreen:n,bgYellow:n,bgBlue:n,bgMagenta:n,bgCyan:n,bgWhite:n,blackBright:n,redBright:n,greenBright:n,yellowBright:n,blueBright:n,magentaBright:n,cyanBright:n,whiteBright:n,bgBlackBright:n,bgRedBright:n,bgGreenBright:n,bgYellowBright:n,bgBlueBright:n,bgMagentaBright:n,bgCyanBright:n,bgWhiteBright:n}};t.exports=s(),t.exports.createColors=s},71528,(e,t,r)=>{"use strict";let n=e.r(2031),s={};class i extends Error{constructor(e,t,r,n,s,o){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),o&&(this.plugin=o),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,i)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=n.isColorSupported);let r=e=>e,i=e=>e,o=e=>e;if(e){let{bold:e,gray:t,red:a}=n.createColors(!0);i=t=>e(a(t)),r=e=>t(e),s&&(o=e=>s(e))}let a=t.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),h=String(c).length;return a.slice(l,c).map((e,t)=>{let n=l+1+t,s=" "+(" "+n).slice(-h)+" | ";if(n===this.line){if(e.length>160){let t=Math.max(0,this.column-20),n=Math.max(this.column+20,this.endColumn+20),a=e.slice(t,n),l=r(s.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,19)).replace(/[^\t]/g," ");return i(">")+r(s)+o(a)+"\n "+l+i("^")}let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(s)+o(e)+"\n "+t+i("^")}return" "+r(s)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}t.exports=i,i.default=i},81864,(e,t,r)=>{"use strict";let n=/(<)(\/?style\b)/gi,s=/(<)(!--)/g,i=/[\t\n\f\r "#'()/;[\\\]{}]/;function o(e){return"string"==typeof e&&e.includes("<")?e.replace(n,"\\3c $2").replace(s,"\\3c $2"):e}let a={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function l(e,t){let r="@"+t.name,n=t.params?e.rawValue(t,"params"):"",s=t.raws.afterName;return void 0===s?s=n?" ":"":""===s&&n&&!i.test(n[0])&&(s=" "),r+s+n}function c(e,t,r){let n=r.nodes,s=n.length-1;for(;s>0&&"comment"===n[s].type;)s-=1;let i=e.raw(r,"semicolon"),o="document"===r.type;for(let e=n.length-1;e>=0;e--){let r=n[e],a=s!==e||i;!a&&e{let t=i?e.raw(r,"after"):e.raw(r,"after","emptyBody");t&&e.builder(o(t)),e.builder("}",r,"end"),"rule"===r.type&&r.raws.ownSemicolon&&e.builder(o(r.raws.ownSemicolon),r,"end")};i?(t.push(a),c(e,t,r)):a()}class A{constructor(e){this.builder=e}atrule(e,t){let r=l(this,e);if(e.nodes)this.block(e,r);else{let n=(e.raws.between||"")+(t?";":"");this.builder(o(r+n),e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;ethis[e]===t[e]),n=[];for(c(this,n,e);n.length>0;){let e=n.pop();if("function"==typeof e){e();continue}let t=e.node,s=this.raw(t,"before");s&&this.builder(e.document?s:o(s)),r&&"rule"===t.type?h(this,n,t,this.rawValue(t,"selector")):r&&"atrule"===t.type&&t.nodes?h(this,n,t,l(this,t)):this.stringify(t,e.semicolon)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder(o("/*"+t+e.text+r+"*/"),e)}decl(e,t){let r=e.raws,n=this.raw(e,"between","colon"),s=e.prop+n+this.rawValue(e,"value");e.important&&(s+=r.important||" !important"),t&&(s+=";"),this.builder(o(s),e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&void 0!==(n=e.raws[t]))return n;let s=e.parent;if("before"===r&&(!s||"root"===s.type&&s.first===e||s&&"document"===s.type))return"";if(!s)return a[r];let i=e.root(),o=i.rawCache||(i.rawCache={});if(void 0!==o[r])return o[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{var l;let s="raw"+((l=r)[0].toUpperCase()+l.slice(1));this[s]?n=this[s](i,e):i.walk(e=>{if(void 0!==(n=e.raws[t]))return!1})}return void 0===n&&(n=a[r]),o[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return(t=r.raws.before).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}rawIndent(e){let t;return e.raws.indent?e.raws.indent:(e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=(t=e[e.length-1]).replace(/\S/g,""),!1}}),t)}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,r=e.parent&&"document"===e.parent.type;this.builder(r?t:o(t))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(o(e.raws.ownSemicolon),e,"end")}stringify(e,t){if(!this[e.type])throw Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}t.exports=A,A.default=A},40293,(e,t,r)=>{"use strict";let n=e.r(81864);function s(e,t){new n(t).stringify(e)}t.exports=s,s.default=s},22302,(e,t,r)=>{"use strict";t.exports.isClean=Symbol("isClean"),t.exports.my=Symbol("my")},57612,(e,t,r)=>{"use strict";let n=e.r(71528),s=e.r(81864),i=e.r(40293),{isClean:o,my:a}=e.r(22302);function l(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i0;){let[e,t,n]=r.pop();for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||"proxyCache"===s)continue;let i=e[s],o=typeof i;if("parent"===s&&"object"===o)n&&(t[s]=n);else if("source"===s)t[s]=i;else if(Array.isArray(i)){let e=[];for(let n of(t[s]=e,i)){let s=new n.constructor;e.push(s),r.push([n,s,t])}}else{if("object"===o&&null!==i){let e=new i.constructor;r.push([i,e,void 0]),i=e}t[s]=i}}}return t}(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new n(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>e[t]===r||(e[t]=r,("prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0)}}markClean(){this[o]=!0}markDirty(){if(this[o]){this[o]=!1;let e=this;for(;e=e.parent;)e[o]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:l(t,this.source.start)};if(e.index)r=this.positionInside(e.index);else if(e.word){let n=t.slice(l(t,this.source.start),l(t,this.source.end)).indexOf(e.word);-1!==n&&(r=this.positionInside(n))}return r}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=l(n,this.source.start),i=s+e;for(let e=s;ee.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r={}){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}}t.exports=c,c.default=c},77906,(e,t,r)=>{"use strict";let n=e.r(57612);class s extends n{constructor(e){super(e),this.type="comment"}}t.exports=s,s.default=s},21772,(e,t,r)=>{"use strict";let n=e.r(57612);class s extends n{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}t.exports=s,s.default=s},96045,(e,t,r)=>{"use strict";let n,s,i,o,a=e.r(77906),l=e.r(21772),c=e.r(57612),{isClean:h,my:A}=e.r(22302);class d extends c{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e)for(let e of this.normalize(t,this.last))this.proxyOf.nodes.push(e);return this.markDirty(),this}cleanRaws(e){let t=[this];for(;t.length>0;){let r=t.pop();if(r!==this&&r.cleanRaws!==d.prototype.cleanRaws){r.cleanRaws(e);continue}if(c.prototype.cleanRaws.call(r,e),r.nodes)for(let e of r.nodes)t.push(e)}}each(e){let t,r;if(!this.proxyOf.nodes)return;let n=this.getIterator();for(;this.indexes[n]e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e));if("every"===t||"some"===t)return r=>e[t]((e,...t)=>r(e.toProxy(),...t));if("root"===t)return()=>e.root().toProxy();else if("nodes"===t)return e.nodes.map(e=>e.toProxy());else if("first"===t||"last"===t)return e[t].toProxy();else return e[t]},set:(e,t,r)=>e[t]===r||(e[t]=r,("name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();for(let t of(n=this.index(e),s))this.proxyOf.nodes.splice(n+1,0,t);for(let e in this.indexes)n<(r=this.indexes[e])&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();for(let t of(n=this.index(e),i))this.proxyOf.nodes.splice(n,0,t);for(let e in this.indexes)n<=(r=this.indexes[e])&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function(e){let t=e.slice();for(;t.length>0;){let e=t.pop();if(delete e.source,e.nodes)for(let r of(e.nodes=e.nodes.slice(),e.nodes))t.push(r)}return e.slice()}(s(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(let t of e=e.slice(0))t.parent&&t.parent.removeChild(t,"ignore");else if("root"===e.type&&"document"!==this.type)for(let t of e=e.nodes.slice(0))t.parent&&t.parent.removeChild(t,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new l(e)]}else if(e.selector||e.selectors)e=[new o(e)];else if(e.name)e=[new n(e)];else if(e.text)e=[new a(e)];else throw Error("Unknown node type in node creation");return e.map(e=>(e[A]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[h]&&function(e){let t=[e];for(;t.length>0;){let e=t.pop();if(e[h]=!1,e.proxyOf.nodes)for(let r of e.proxyOf.nodes)t.push(r)}}(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(let t of e=e.reverse()){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;for(let r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[r])>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||(!t.fast||n.value.includes(t.fast))&&(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){if(!this.proxyOf.nodes)return;let t=[{iterator:this.getIterator(),node:this.proxyOf}];for(;t.length>0;){let r,{iterator:n,node:s}=t[t.length-1],i=s.indexes[n];if(i>=s.proxyOf.nodes.length){delete s.indexes[n],t.pop();let e=t[t.length-1];e&&(e.node.indexes[e.iterator]+=1);continue}let o=s.proxyOf.nodes[i];try{r=e(o,i)}catch(e){throw o.addToError(e)}if(!1===r){for(let e of t)delete e.node.indexes[e.iterator];return!1}o.walk&&o.proxyOf.nodes?t.push({iterator:o.getIterator(),node:o}):s.indexes[n]+=1}}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}}d.registerParse=e=>{s=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{n=e},d.registerRoot=e=>{i=e},t.exports=d,d.default=d,d.rebuild=e=>{let t=[e];for(;t.length>0;){let e=t.pop();if("atrule"===e.type?Object.setPrototypeOf(e,n.prototype):"rule"===e.type?Object.setPrototypeOf(e,o.prototype):"decl"===e.type?Object.setPrototypeOf(e,l.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,i.prototype),e[A]=!0,e.nodes)for(let r of e.nodes)t.push(r)}}},70255,(e,t,r)=>{"use strict";let n=e.r(96045);class s extends n{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}t.exports=s,s.default=s,n.registerAtRule(s)},98475,(e,t,r)=>{"use strict";let n,s,i=e.r(96045);class o extends i{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new n(new s,this,e).stringify()}}o.registerLazyResult=e=>{n=e},o.registerProcessor=e=>{s=e},t.exports=o,o.default=o},2658,(e,t,r)=>{t.exports={nanoid:(e=21)=>{let t="",r=0|e;for(;r-- >0;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s-- >0;)n+=e[Math.random()*e.length|0];return n}}},43954,(e,t,r)=>{!function(){"use strict";var e={922:function(e){e.exports=function(e,r,n,s){r=r||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(r);var a=1e3;s&&"number"==typeof s.maxKeys&&(a=s.maxKeys);var l=e.length;a>0&&l>a&&(l=a);for(var c=0;c=0?(h=p.substr(0,g),A=p.substr(g+1)):(h=p,A=""),d=decodeURIComponent(h),u=decodeURIComponent(A),Object.prototype.hasOwnProperty.call(i,d))?t(i[d])?i[d].push(u):i[d]=[i[d],u]:i[d]=u}return i};var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},790:function(e){var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,i,o,a){return(i=i||"&",o=o||"=",null===e&&(e=void 0),"object"==typeof e)?n(s(e),function(s){var a=encodeURIComponent(t(s))+o;return r(e[s])?n(e[s],function(e){return a+encodeURIComponent(t(e))}).join(i):a+encodeURIComponent(t(e[s]))}).join(i):a?encodeURIComponent(t(a))+o+encodeURIComponent(t(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n{var n={221:function(t){"use strict";t.exports=e.r(43954)}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},o=!0;try{n[e](r,r.exports,i),o=!1}finally{o&&delete s[e]}return r.exports}i.ab="/ROOT/node_modules/next/dist/compiled/native-url/";var o={};!function(){var e,t=(e=i(221))&&"object"==typeof e&&"default"in e?e.default:e,r=/https?|ftp|gopher|file/;function n(e){"string"==typeof e&&(e=m(e));var n,s,i,o,a,l,c,h,A,d=(s=(n=e).auth,i=n.hostname,o=n.protocol||"",a=n.pathname||"",l=n.hash||"",c=n.query||"",h=!1,s=s?encodeURIComponent(s).replace(/%3A/i,":")+"@":"",n.host?h=s+n.host:i&&(h=s+(~i.indexOf(":")?"["+i+"]":i),n.port&&(h+=":"+n.port)),c&&"object"==typeof c&&(c=t.encode(c)),A=n.search||c&&"?"+c||"",o&&":"!==o.substr(-1)&&(o+=":"),n.slashes||(!o||r.test(o))&&!1!==h?(h="//"+(h||""),a&&"/"!==a[0]&&(a="/"+a)):h||(h=""),l&&"#"!==l[0]&&(l="#"+l),A&&"?"!==A[0]&&(A="?"+A),{protocol:o,host:h,pathname:a=a.replace(/[?#]/g,encodeURIComponent),search:A=A.replace("#","%23"),hash:l});return""+d.protocol+d.host+d.pathname+d.search+d.hash}var s="http://",a=s+"w.w",l=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,c=/https?|ftp|gopher|file/;function h(e,t){var r="string"==typeof e?m(e):e;e="object"==typeof e?n(e):e;var i=m(t),o="";r.protocol&&!r.slashes&&(o=r.protocol,e=e.replace(r.protocol,""),o+="/"===t[0]||"/"===e[0]?"/":""),o&&i.protocol&&(o="",i.slashes||(o=i.protocol,t=t.replace(i.protocol,"")));var h=e.match(l);h&&!i.protocol&&(e=e.substr((o=h[1]+(h[2]||"")).length),/^\/\/[^/]/.test(t)&&(o=o.slice(0,-1)));var A=new URL(e,a+"/"),d=new URL(t,A).toString().replace(a,""),u=i.protocol||r.protocol;return u+=r.slashes||i.slashes?"//":"",!o&&u?d=d.replace(s,u):o&&(d=d.replace(s,"")),c.test(d)||~t.indexOf(".")||"/"===e.slice(-1)||"/"===t.slice(-1)||"/"!==d.slice(-1)||(d=d.slice(0,-1)),o&&(d=o+("/"===d[0]?d.substr(1):d)),d}function A(){}A.prototype.parse=m,A.prototype.format=n,A.prototype.resolve=h,A.prototype.resolveObject=h;var d=/^https?|ftp|gopher|file/,u=/^(.*?)([#?].*)/,p=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,g=/^([a-z0-9.+-]*:)?\/\/\/*/i,f=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function m(e,r,s){if(void 0===r&&(r=!1),void 0===s&&(s=!1),e&&"object"==typeof e&&e instanceof A)return e;var i=(e=e.trim()).match(u);e=i?i[1].replace(/\\/g,"/")+i[2]:e.replace(/\\/g,"/"),f.test(e)&&"/"!==e.slice(-1)&&(e+="/");var o=!/(^javascript)/.test(e)&&e.match(p),l=g.test(e),c="";o&&(d.test(o[1])||(c=o[1].toLowerCase(),e=""+o[2]+o[3]),o[2]||(l=!1,d.test(o[1])?(c=o[1],e=""+o[3]):e="//"+o[3]),3!==o[2].length&&1!==o[2].length||(c=o[1],e="/"+o[3]));var h,m=(i?i[1]:e).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),x=m&&m[1],y=new A,b="",w="";try{h=new URL(e)}catch(t){b=t,c||s||!/^\/\//.test(e)||/^\/\/.+[@.]/.test(e)||(w="/",e=e.substr(1));try{h=new URL(e,a)}catch(e){return y.protocol=c,y.href=c,y}}y.slashes=l&&!w,y.host="w.w"===h.host?"":h.host,y.hostname="w.w"===h.hostname?"":h.hostname.replace(/(\[|\])/g,""),y.protocol=b?c||null:h.protocol,y.search=h.search.replace(/\\/g,"%5C"),y.hash=h.hash.replace(/\\/g,"%5C");var I=e.split("#");!y.search&&~I[0].indexOf("?")&&(y.search="?"),y.hash||""!==I[1]||(y.hash="#"),y.query=r?t.decode(h.search.substr(1)):y.search.substr(1),y.pathname=w+(o?h.pathname.replace(/['^|`]/g,function(e){return"%"+e.charCodeAt().toString(16).toUpperCase()}).replace(/((?:%[0-9A-F]{2})+)/g,function(e,t){try{return decodeURIComponent(t).split("").map(function(e){var t=e.charCodeAt();return t>256||/^[a-z0-9]$/i.test(e)?e:"%"+t.toString(16).toUpperCase()}).join("")}catch(e){return t}}):h.pathname),"about:"===y.protocol&&"blank"===y.pathname&&(y.protocol="",y.pathname=""),b&&"/"!==e[0]&&(y.pathname=y.pathname.substr(1)),c&&!d.test(c)&&"/"!==e.slice(-1)&&"/"===y.pathname&&(y.pathname=""),y.path=y.pathname+y.search,y.auth=[h.username,h.password].map(decodeURIComponent).filter(Boolean).join(":"),y.port=h.port,x&&!y.host.endsWith(x)&&(y.host+=x,y.port=x.slice(1)),y.href=w?""+y.pathname+y.search+y.hash:n(y);var C=/^(file)/.test(y.href)?["host","hostname"]:[];return Object.keys(y).forEach(function(e){~C.indexOf(e)||(y[e]=y[e]||null)}),y}o.parse=m,o.format=n,o.resolve=h,o.resolveObject=function(e,t){return m(h(e,t))},o.Url=A}(),t.exports=o},67034,(e,t,r)=>{var n={872:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,i=l(e),o=i[0],a=i[1],c=new s((o+a)*3/4-a),h=0,A=a>0?o-4:o;for(r=0;r>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[h++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,s=n%3,i=[],o=0,a=n-s;o >18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return i.join("")}(e,o,o+16383>a?a:o+16383));return 1===s?i.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===s&&i.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),i.join("")};for(var r=[],n=[],s="u">typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=i.length;o 0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(e,t,r){"use strict";var n=r(872),s=r(321),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,s=t;if(("string"!=typeof s||""===s)&&(s="utf8"),!a.isEncoding(s))throw TypeError("Unknown encoding: "+s);var i=0|u(n,s),l=o(i),c=l.write(n,s);return c!==i&&(l=l.slice(0,c)),l}if(ArrayBuffer.isView(e))return A(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(E(e,ArrayBuffer)||e&&E(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(E(e,SharedArrayBuffer)||e&&E(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLengthtypeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return c(e),o(e<0?0:0|d(e))}function A(e){for(var t=e.length<0?0:0|d(e.length),r=o(t),n=0;ntypeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(c(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return h(e)},a.allocUnsafeSlow=function(e){return h(e)};function d(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function u(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||E(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return k(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(e).length;default:if(s)return n?-1:k(e).length;t=(""+t).toLowerCase(),s=!0}}function p(e,t,r){var s,i,o,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var s="",i=t;i0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(s)return -1;else r=e.length-1;else if(r<0)if(!s)return -1;else r=0;if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,s);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(s)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return m(e,[t],r,n,s)}throw TypeError("val must be string, number or Buffer")}function m(e,t,r,n,s){var i,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(s){var h=-1;for(i=r;ia&&(r=a-l),i=r;i>=0;i--){for(var A=!0,d=0;dr&&(e+=" ... "),""},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,s){if(E(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||r>e.length||n<0||s>this.length)throw RangeError("out of range index");if(n>=s&&t>=r)return 0;if(n>=s)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;for(var i=s-n,o=r-t,l=Math.min(i,o),c=this.slice(n,s),h=e.slice(t,r),A=0;A239?4:c>223?3:c>191?2:1;if(s+A<=r)switch(A){case 1:c<128&&(h=c);break;case 2:(192&(i=e[s+1]))==128&&(l=(31&c)<<6|63&i)>127&&(h=l);break;case 3:i=e[s+1],o=e[s+2],(192&i)==128&&(192&o)==128&&(l=(15&c)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:i=e[s+1],o=e[s+2],a=e[s+3],(192&i)==128&&(192&o)==128&&(192&a)==128&&(l=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,A=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),s+=A}var d=n,u=d.length;if(u<=4096)return String.fromCharCode.apply(String,d);for(var p="",g=0;gr)throw RangeError("Trying to access beyond buffer length")}function b(e,t,r,n,s,i){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw RangeError("Index out of range")}function w(e,t,r,n,s,i){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function I(e,t,r,n,i){return t*=1,r>>>=0,i||w(e,t,r,4,34028234663852886e22,-34028234663852886e22),s.write(e,t,r,n,23,4),r+4}function C(e,t,r,n,i){return t*=1,r>>>=0,i||w(e,t,r,8,17976931348623157e292,-17976931348623157e292),s.write(e,t,r,n,52,8),r+8}a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,i,o,a,l,c,h,A,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var u=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o>8,s.push(r%256),s.push(n);return s}(e,this.length-h),this,h,A);default:if(u)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],s=1,i=0;++i>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],s=1,i=0;++i=(s*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=t,s=1,i=this[e+--n];n>0&&(s*=256);)i+=this[e+--n]*s;return i>=(s*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readInt8=function(e,t){return(e>>>=0,t||y(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),s.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),s.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),s.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),s.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;b(this,e,t,r,s,0)}var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;b(this,e,t,r,s,0)}var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var s=Math.pow(2,8*r-1);b(this,e,t,r,s-1,-s)}var i=0,o=1,a=0;for(this[t]=255&e;++i>>=0,!n){var s=Math.pow(2,8*r-1);b(this,e,t,r,s-1,-s)}var i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return I(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return C(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return C(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return s},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var s,i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&r<57344){if(!s){if(r>56319||o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}s=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(t-=3)>-1&&i.push(239,191,189);if(s=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function S(e){for(var t=[],r=0;r=t.length)&&!(s>=e.length);++s)t[s+r]=e[s];return s}function E(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var D=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,s=0;s<16;++s)t[n+s]=e[r]+e[s];return t}()},321:function(e,t){t.read=function(e,t,r,n,s){var i,o,a=8*s-n-1,l=(1<>1,h=-7,A=r?s-1:0,d=r?-1:1,u=e[t+A];for(A+=d,i=u&(1<<-h)-1,u>>=-h,h+=a;h>0;i=256*i+e[t+A],A+=d,h-=8);for(o=i&(1<<-h)-1,i>>=-h,h+=n;h>0;o=256*o+e[t+A],A+=d,h-=8);if(0===i)i=1-c;else{if(i===l)return o?NaN:1/0*(u?-1:1);o+=Math.pow(2,n),i-=c}return(u?-1:1)*o*Math.pow(2,i-n)},t.write=function(e,t,r,n,s,i){var o,a,l,c=8*i-s-1,h=(1<>1,d=5960464477539062e-23*(23===s),u=n?0:i-1,p=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+A>=1?t+=d/l:t+=d*Math.pow(2,1-A),t*l>=2&&(o++,l/=2),o+A>=h?(a=0,o=h):o+A>=1?(a=(t*l-1)*Math.pow(2,s),o+=A):(a=t*Math.pow(2,A-1)*Math.pow(2,s),o=0));s>=8;e[r+u]=255&a,u+=p,a/=256,s-=8);for(o=o<0;e[r+u]=255&o,u+=p,o/=256,c-=8);e[r+u-p]|=128*g}}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},o=!0;try{n[e](r,r.exports,i),o=!1}finally{o&&delete s[e]}return r.exports}i.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=i(230)},4468,(e,t,r)=>{"use strict";var n=e.i(67034);let{existsSync:s,readFileSync:i}={},{dirname:o,isAbsolute:a,join:l,relative:c,sep:h}={},{SourceMapConsumer:A,SourceMapGenerator:d}={};class u{constructor(e,t){if(!1===t.map)return;t.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=o(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new A(this.json||this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r){var s;return s=e.substr(r[0].length),n.Buffer.from(s,"base64").toString()}let i=e.slice(22);throw Error("Unsupported source map encoding "+(i=i.slice(0,i.indexOf(","))))}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e,t,r){if(!r&&!this.unsafeMap){if(!/\.map$/i.test(e)||!t)return;let r=c(o(t),e);if(".."===r||r.startsWith(".."+h)||a(r))return}if(this.root=o(e),s(e))return this.mapFile=e,i(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t)if("string"==typeof t)return t;else if("function"==typeof t){let r=t(e);if(r){let t=this.loadFile(r,e,!0);if(!t)throw Error("Unable to load previous source map: "+r.toString());return t}}else if(t instanceof A)return d.fromSourceMap(t).toString();else if(t instanceof d)return t.toString();else if(this.isMap(t))return JSON.stringify(t);else throw Error("Unsupported previous source map format: "+t.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let t=this.annotation;e&&(t=l(o(e),t));let r=this.loadFile(t,e,!1);if(r)try{this.json=JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return r}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}t.exports=u,u.default=u},2278,(e,t,r)=>{"use strict";let{nanoid:n}=e.r(2658),{isAbsolute:s,resolve:i}={},{SourceMapConsumer:o,SourceMapGenerator:a}={},{fileURLToPath:l,pathToFileURL:c}=e.r(21342),h=e.r(71528),A=e.r(4468),d={},u=Symbol("lineToIndexCache"),p=!!(o&&a),g=!!(i&&s);function f(e){if(e[u])return e[u];let t=e.css.split("\n"),r=Array(t.length),n=0;for(let e=0,s=t.length;e"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o,a,l;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){a=e.offset;let n=this.fromOffset(a);t=n.line,r=n.col}else t=e.line,r=e.column,a=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){o=n.offset;let e=this.fromOffset(o);i=e.line,s=e.col}else i=n.line,s=n.column,o=this.fromLineAndColumn(n.line,n.column)}else if(r)a=this.fromLineAndColumn(t,r);else{a=t;let e=this.fromOffset(a);t=e.line,r=e.col}let A=this.origin(t,r,i,s);return(l=A?new h(e,void 0===A.endLine?A.line:{column:A.column,line:A.line},void 0===A.endLine?A.column:{column:A.endColumn,line:A.endLine},A.source,A.file,n.plugin):new h(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin)).input={column:r,endColumn:s,endLine:i,endOffset:o,line:t,offset:a,source:this.css},this.file&&(c&&(l.input.url=c(this.file).toString()),l.input.file=this.file),l}fromLineAndColumn(e,t){return f(this)[e-1]+t-1}fromOffset(e){let t=f(this),r=t[t.length-1],n=0;if(e>=r)n=t.length-1;else{let r,s=t.length-2;for(;n>1)])s=r-1;else if(e>=t[r+1])n=r+1;else{n=r;break}}return{col:e-t[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){let i,o;if(!this.map)return!1;let a=this.map.consumer(),h=a.originalPositionFor({column:t-1,line:e});if(!h.source)return!1;if("number"==typeof r){let e=a.originalPositionFor({column:n-1,line:r});e.source&&(i=e)}o=s(h.source)?c(h.source):new URL(h.source,this.map.consumer().sourceRoot||c(this.map.mapFile));let A={column:h.column+1,endColumn:i&&i.column+1,endLine:i&&i.line,line:h.line,url:o.toString()};if("file:"===o.protocol)if(l)A.file=l(o);else throw Error("file: protocol is not available in this PostCSS build");let d=a.sourceContentFor(h.source);return d&&(A.source=d),A}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}t.exports=m,m.default=m,d&&d.registerInput&&d.registerInput(m)},51517,(e,t,r)=>{"use strict";let n,s,i=e.r(96045);class o extends i{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=new Set;for(let t of Array.isArray(e)?e:[e])t&&"object"==typeof t&&!t.parent&&t.raws&&void 0!==t.raws.before&&n.add(t.raws);let s=super.normalize(e);if(t){if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of s)n.has(e.raws)||(e.raws.before=t.raws.before)}return s}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new n(new s,this,e).stringify()}}o.registerLazyResult=e=>{n=e},o.registerProcessor=e=>{s=e},t.exports=o,o.default=o,i.registerRoot(o)},50215,(e,t,r)=>{"use strict";let n={comma:e=>n.split(e,[","],!0),space:e=>n.split(e,[" ","\n"," "]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};t.exports=n,n.default=n},93894,(e,t,r)=>{"use strict";let n=e.r(96045),s=e.r(50215);class i extends n{get selectors(){return s.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}t.exports=i,i.default=i,n.registerRule(i)},98729,(e,t,r)=>{"use strict";let n=e.r(70255),s=e.r(77906),i=e.r(21772),o=e.r(2278),a=e.r(4468),l=e.r(51517),c=e.r(93894);function h(e,t){return e.inputs?e.inputs.map(e=>{let t={...e,__proto__:o.prototype};return t.map&&(t.map={...t.map,__proto__:a.prototype}),t}):t}function A(e,t){let r;if(Array.isArray(e))return e.map(e=>A(e));let o=[{childIndex:0,children:[],inputs:h(e,t),json:e}];for(;o.length>0;){let e=o[o.length-1],t=e.json.nodes;if(t&&e.childIndex0?o[o.length-1].children.push(a):r=a}return r}t.exports=A,A.default=A},20194,(e,t,r)=>{"use strict";var n=e.i(67034);let{dirname:s,relative:i,resolve:o,sep:a}={},{SourceMapConsumer:l,SourceMapGenerator:c}={},{pathToFileURL:h}=e.r(21342),A=e.r(2278),d=!!(l&&c),u=!!(s&&o&&i&&a);t.exports=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||s(e.file);!1===this.mapOpts.sourcesContent?(t=new l(e.text)).sourcesContent&&(t.sourcesContent=null):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;-1!==(e=this.css.lastIndexOf("/*#"));){let t=this.css.indexOf("*/",e+3);if(-1===t)break;for(;e>0&&"\n"===this.css[e-1];)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}}generate(){if(this.clearAnnotation(),u&&d&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=c.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new c({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return(this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline())?[this.css]:[this.css,this.map]}generateString(){let e,t;this.css="",this.map=new c({file:this.outputFile(),ignoreInvalidMapping:!0});let r=1,n=1,s="",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1):(i.source=s,i.original.line=1,i.original.column=0),this.map.addMapping(i)),(t=o.match(/\n/g))?(r+=t.length,e=o.lastIndexOf("\n"),n=o.length-e):n+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};(!("decl"===a.type||"atrule"===a.type&&!a.nodes)||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1),this.map.addMapping(i))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?s(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=s(o(r,this.mapOpts.annotation)));let n=i(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new A(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return n.Buffer.from(e).toString("base64")}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(h){let t=h(e).toString();return this.memoizedFileURLs.set(e,t),t}throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===a&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}},46980,(e,t,r)=>{"use strict";let n=/[\t\n\f\r "#'()/;[\\\]{}]/g,s=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,i=/.[\r\n"'(/\\]/,o=/[\da-f]/i;t.exports=function(e,t={}){let r,a,l,c,h,A,d,u,p,g,f=e.css.valueOf(),m=t.ignoreErrors,x=f.length,y=0,b=[],w=[],I=-1;function C(t){throw e.error("Unclosed "+t,y)}return{back:function(e){w.push(e)},endOfFile:function(){return 0===w.length&&y>=x},nextToken:function(e){if(w.length)return w.pop();if(y>=x)return;let t=!!e&&e.ignoreUnclosed;switch(r=f.charCodeAt(y)){case 10:case 32:case 9:case 13:case 12:c=y;do c+=1,r=f.charCodeAt(c);while(32===r||10===r||9===r||13===r||12===r)A=["space",f.slice(y,c)],y=c-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(r);A=[e,e,y];break}case 40:if(g=b.length?b.pop()[1]:"",p=f.charCodeAt(y+1),"url"===g&&39!==p&&34!==p&&32!==p&&10!==p&&9!==p&&12!==p&&13!==p){c=y;do{if(d=!1,-1===(c=f.indexOf(")",c+1)))if(m||t){c=y;break}else C("bracket");for(u=c;92===f.charCodeAt(u-1);)u-=1,d=!d}while(d)A=["brackets",f.slice(y,c+1),y,c],y=c}else y<=I?A=["(","(",y]:(c=f.indexOf(")",y+1),a=f.slice(y,c+1),-1===c||i.test(a)?(I=-1===c?x:c,A=["(","(",y]):(A=["brackets",a,y,c],y=c));break;case 39:case 34:h=39===r?"'":'"',c=y;do{if(d=!1,-1===(c=f.indexOf(h,c+1)))if(m||t){c=y+1;break}else C("string");for(u=c;92===f.charCodeAt(u-1);)u-=1,d=!d}while(d)A=["string",f.slice(y,c+1),y,c],y=c;break;case 64:n.lastIndex=y+1,n.test(f),c=0===n.lastIndex?f.length-1:n.lastIndex-2,A=["at-word",f.slice(y,c+1),y,c],y=c;break;case 92:for(c=y,l=!0;92===f.charCodeAt(c+1);)c+=1,l=!l;if(r=f.charCodeAt(c+1),l&&47!==r&&32!==r&&10!==r&&9!==r&&13!==r&&12!==r&&(c+=1,o.test(f.charAt(c)))){for(;o.test(f.charAt(c+1));)c+=1;32===f.charCodeAt(c+1)&&(c+=1)}A=["word",f.slice(y,c+1),y,c],y=c;break;default:47===r&&42===f.charCodeAt(y+1)?(0===(c=f.indexOf("*/",y+2)+1)&&(m||t?c=f.length:C("comment")),A=["comment",f.slice(y,c+1),y,c]):(s.lastIndex=y+1,s.test(f),c=0===s.lastIndex?f.length-1:s.lastIndex-2,A=["word",f.slice(y,c+1),y,c],b.push(A)),y=c}return y++,A},position:function(){return y}}}},52371,(e,t,r)=>{"use strict";let n=e.r(70255),s=e.r(77906),i=e.r(21772),o=e.r(51517),a=e.r(93894),l=e.r(46980),c={empty:!0,space:!0};function h(e,t,r){let n="";for(let s=t;s0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length)if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}else if("{"===t){a=!0;break}else if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t,r=this.colon(e);if(!1===r)return;let n=0;for(let s=r-1;s>=0&&("space"===(t=e[s])[0]||2!==(n+=1));s--);throw this.input.error("Missed semicolon","word"===t[0]?t[3]+1:t[2])}colon(e){let t,r,n=0;for(let[s,i]of e.entries()){if("("===(r=i[0])&&(n+=1),")"===r&&(n-=1),0===n&&":"===r)if(t)if("word"===t[0]&&"progid"===t[1])continue;else return s;else this.doubleColon(i);t=i}return!1}comment(e){let t=new s;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(r.trim()){let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}else t.text="",t.raws.left=r,t.raws.right=""}createTokenizer(){this.tokenizer=l(this.input)}decl(e,t){let r,n=new i;this.init(n,e[0][2]);let s=e[e.length-1];";"===s[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),n.source.end.offset++;let o=0;for(;"word"!==e[o][0];)o===e.length-1&&this.unknownWord([e[o]]),o++;n.raws.before+=h(e,0,o),n.source.start=this.getPosition(e[o][2]);let a=o;for(;o=0;t--){if("!important"===(r=e[t])[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);" !important"!==(r=this.spacesFromEnd(e)+r)&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=A.map(e=>e[1]).join(""),A=[]),this.raw(n,"value",A.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length)if(";"===r)if(n)return void this.decl(a,o);else break;else if("{"===r)return void this.rule(a);else if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}else":"===r&&(n=!0);else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let s,i,o,a,l=r.length,h="",A=!0;for(let e=0;ee+t[1],"");e.raws[t]={raw:n,value:h}}e[t]=h}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(e,t){let r="";for(let n=t;n{"use strict";e.i(47167);let n=e.r(96045),s=e.r(2278),i=e.r(52371);function o(e,t){let r=new i(new s(e,t));try{r.parse()}catch(e){throw e}return r.root}t.exports=o,o.default=o,n.registerParse(o)},83078,(e,t,r)=>{"use strict";let n=e.r(96045),{my:s}=e.r(22302);class i{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){t.node[s]||n.rebuild(t.node);let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}t.exports=i,i.default=i},48665,(e,t,r)=>{"use strict";let n=e.r(83078);class s{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){!t.plugin&&this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new n(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}}t.exports=s,s.default=s},80698,(e,t,r)=>{"use strict";let n={};t.exports=function(e){!n[e]&&(n[e]=!0,"u">typeof console&&console.warn&&console.warn(e))}},9249,(e,t,r)=>{"use strict";e.i(47167);let n=e.r(96045),s=e.r(98475),i=e.r(20194),o=e.r(57373),a=e.r(48665),l=e.r(51517),c=e.r(40293),{isClean:h,my:A}=e.r(22302);e.r(80698);let d={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},u={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0};function g(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=d[e.type];return("decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append)?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function m(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function x(e){let t=[e];for(;t.length>0;){let e=t.pop();if(e[h]=!1,e.nodes)for(let r of e.nodes)t.push(r)}return e}let y={};class b{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,t,r){let s;if(this.stringified=!1,this.processed=!1,"object"==typeof t&&null!==t&&("root"===t.type||"document"===t.type))s=x(t);else if(t instanceof b||t instanceof a)s=x(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=o;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{s=e(t,r)}catch(e){this.processed=!0,this.error=e}s&&!s[A]&&n.rebuild(s)}this.result=new a(e,s,r),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?r.postcssVersion:(e.plugin=r.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!u[r]&&/^[A-Z]/.test(r))throw Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let e=this.visitTick(t);if(g(e))try{await e}catch(r){let e=t[t.length-1].node;throw this.handleError(r,e)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));if(g(t[0]))return Promise.all(t);return t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=c;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=this.result.root.source;if(void 0===e.map&&!(r&&r.input&&r.input.map)){let e="";return t(this.result.root,t=>{e+=t}),this.result.css=e,this.result}let n=new i(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(g(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[h];)e[h]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(g(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex0;){let e=t[t.length-1],r=e.node;if(0!==e.iterator){let n,s=e.iterator,i=!1;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[h]){n[h]=!0,t.push({eventIndex:0,events:f(n),iterator:0,node:n}),i=!0;break}if(i)continue;e.iterator=0,delete r.indexes[s]}if(e.eventIndex{y=e},t.exports=b,b.default=b,l.registerLazyResult(b),s.registerLazyResult(b)},11589,(e,t,r)=>{"use strict";e.i(47167);let n=e.r(20194),s=e.r(57373),i=e.r(48665),o=e.r(40293);e.r(80698);class a{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){let e;if(this._root)return this._root;try{e=s(this._css,this._opts)}catch(e){this.error=e}if(!this.error)return this._root=e,e;throw this.error}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0,this.result=new i(this._processor,void 0,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get:()=>s.root});let a=new n(o,void 0,this._opts,t);if(a.isMap()){let[e,t]=a.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}t.exports=a,a.default=a},11902,(e,t,r)=>{"use strict";e.i(47167);let n=e.r(98475),s=e.r(9249),i=e.r(11589),o=e.r(51517);class a{constructor(e=[]){this.version="8.5.23",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else if("object"==typeof r&&(r.parse||r.stringify));else throw Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new s(this,e,t):new i(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}t.exports=a,a.default=a,o.registerProcessor(a),n.registerProcessor(a)},85243,(e,t,r)=>{"use strict";var n=e.i(47167);let s=e.r(70255),i=e.r(77906),o=e.r(96045),a=e.r(71528),l=e.r(21772),c=e.r(98475),h=e.r(98729),A=e.r(2278),d=e.r(9249),u=e.r(50215),p=e.r(57612),g=e.r(57373),f=e.r(11902),m=e.r(48665),x=e.r(51517),y=e.r(93894),b=e.r(40293),w=e.r(83078);function I(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new f(e)}I.plugin=function(e,t){let r,s=!1;function i(...r){console&&console.warn&&!s&&(s=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),n.default.env.LANG&&n.default.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=new f().version,o}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return I([i(r)]).process(e,t)},i},I.stringify=b,I.parse=g,I.fromJSON=h,I.list=u,I.comment=e=>new i(e),I.atRule=e=>new s(e),I.decl=e=>new l(e),I.rule=e=>new y(e),I.root=e=>new x(e),I.document=e=>new c(e),I.CssSyntaxError=a,I.Declaration=l,I.Container=o,I.Processor=f,I.Document=c,I.Comment=i,I.Warning=w,I.AtRule=s,I.Result=m,I.Input=A,I.Rule=y,I.Root=x,I.Node=p,d.registerPostcss(I),t.exports=I,I.default=I},22315,(e,t,r)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",r="minute",n="hour",s="week",i="month",o="quarter",a="year",l="date",c="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},u="en",p={};p[u]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}};var g="$isDayjsObject",f=function(e){return e instanceof b||!(!e||!e[g])},m=function e(t,r,n){var s;if(!t)return u;if("string"==typeof t){var i=t.toLowerCase();p[i]&&(s=i),r&&(p[i]=r,s=i);var o=t.split("-");if(!s&&o.length>1)return e(o[0])}else{var a=t.name;p[a]=t,s=a}return!n&&s&&(u=s),s||!n&&u},x=function(e,t){if(f(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new b(r)},y={s:d,z:function(e){var t=-e.utcOffset(),r=Math.abs(t);return(t<=0?"+":"-")+d(Math.floor(r/60),2,"0")+":"+d(r%60,2,"0")},m:function e(t,r){if(t.date(){let n=e.r(22315);function s(e){for(e=e.replace(/[\x00-\x20]+/g,"");;){let t=e.indexOf("",t+4);if(-1===r)break;e=e.substring(0,t)+e.substring(r+3)}return e}function i(e,t){let r=(t=t||{}).allowedSchemes||["http","https","ftp","mailto","tel","sms"],n=!1!==t.allowProtocolRelative;if("string"!=typeof e)return!1;let i=(e=s(e)).match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!i)return!!e.match(/^[/\\]{2}/)&&!n;let o=i[1].toLowerCase();return -1===r.indexOf(o)}t.exports=function(e){let t={};return t.options=e||{},t.filterTag=t.options.filterTag||function(e){return(e=e.trim()).toLowerCase()},t.string=function(e,t){return"string"!=typeof e&&("number"==typeof e||"boolean"==typeof e?e+="":e=""),e=e.trim(),void 0!==t&&""===e&&(e=t),e},t.strings=function(e){return Array.isArray(e)?e.map(function(e){return t.string(e)}):[]},t.integer=function(e,t,r,n){if(void 0===t&&(t=0),"number"==typeof e)e=Math.floor(e);else try{e=parseInt(e,10),isNaN(e)&&(e=t)}catch(r){e=t}return"number"==typeof r&&en&&(e=n),e},t.padInteger=function(e,t){let r=e+"";for(;r.lengthn&&(e=n),e},t.naughtyHref=i,t.url=function(e,r,n){var o;return(e=t.string(e,r))===r?e:i(e=s(e))||null===(e=(o=e).match(/^(((https?|ftp):\/\/)|((mailto|tel|sms):)|#|([^/.]+)?\/|[^/.]+$)/)?o:o.match(/^[^/.]+\.[^/.]+/)?(n?"https://":"http://")+o:null)?r:e},t.select=function(e,r,n){let s;return(e=t.string(e),r&&r.length)?"object"==typeof r[0]?null!=(s=r.find(function(t){return null!==t.value&&void 0!==t.value&&t.value.toString()===e}))?s.value:n:void 0!==(s=r.find(function(t){return null!=t&&t.toString()===e}))?s:n:n},t.boolean=function(e,r){return!0===e||!1!==e&&((e=t.string(e,r))===r?void 0!==e&&e:""!==(e=e.toLowerCase().charAt(0))&&"n"!==e&&"0"!==e&&"f"!==e&&("t"===e||"y"===e||"1"===e))},t.addBooleanFilterToCriteria=function(e,r,n,s){void 0===s&&(s=null);let i="object"==typeof e&&null!==e?e[r]:e;i=void 0===i?s:i,null===(i=t.booleanOrNull(i))||(i?n[r]=!0:n[r]={$ne:!0})},t.booleanOrNull=function(e,r){return!0===e||!1===e||null===e?e:(e=t.string(e,r))===r?void 0===r?null:e:"null"===e?null:""!==(e=e.toLowerCase().charAt(0))&&"n"!==e&&"0"!==e&&"f"!==e&&("t"===e||"y"===e||"1"===e||("a"===e?null:r))},t.date=function(e,r,s){let i;function o(){return void 0===r&&(r=n().format("YYYY-MM-DD")),r}if("string"==typeof e){if(e.match(/\//)){if(2===(i=e.split("/")).length)return(s||new Date).getFullYear()+"-"+t.padInteger(i[0],2)+"-"+t.padInteger(i[1],2);if(3!==i.length)return o();if(i[2]<100){let e=s||new Date,t=e.getFullYear()%100,r=e.getFullYear()-t,n=parseInt(i[2])+r;n-e.getFullYear()>50&&(n-=100),i[2]=n}return t.padInteger(i[2],4)+"-"+t.padInteger(i[0],2)+"-"+t.padInteger(i[1],2)}else if(e.match(/-/))return 2===(i=e.split("-")).length?(s||new Date).getFullYear()+"-"+t.padInteger(i[0],2)+"-"+t.padInteger(i[1],2):3===i.length?t.padInteger(i[0],4)+"-"+t.padInteger(i[1],2)+"-"+t.padInteger(i[2],2):o()}try{if(null===e||(e=s||new Date(e),isNaN(e.getTime())))return o();return e.getFullYear()+"-"+t.padInteger(e.getMonth()+1,2)+"-"+t.padInteger(e.getDate(),2)}catch(e){return o()}},t.formatDate=function(e){return n(e).format("YYYY-MM-DD")},t.time=function(e,r){let s=(e=(e=t.string(e).toLowerCase()).trim()).match(/^(\d+)([:|.](\d+))?([:|.](\d+))?\s*(am|pm|AM|PM|a|p|A|M)?$/);if(s){let e=parseInt(s[1],10),r=void 0!==s[3]?parseInt(s[3],10):0,n=void 0!==s[5]?parseInt(s[5],10):0,i=s[6]?s[6].toLowerCase():s[6];return i=i&&i.charAt(0),12===e&&"a"===i?e-=12:12===e&&"p"===i||"p"===i&&(e+=12),(24===e||"24"===e)&&(e=0),t.padInteger(e,2)+":"+t.padInteger(r,2)+":"+t.padInteger(n,2)}return void 0!==r?r:n().format("HH:mm")},t.formatTime=function(e){return n(e).format("HH:mm:ss")},t.tags=function(e,r){return("string"==typeof e&&(e=e.split(/,\s*/)),Array.isArray(e))?e.map(e=>t.string(e)).map(r||t.filterTag).filter(e=>e.length>0):[]},t.idRegExp=t.options.idRegExp||/^[A-Za-z0-9_]+$/,t.id=function(e,r){let n=t.string(e,r);return n===r||n.match(t.idRegExp)?n:r},t.ids=function(e){return Array.isArray(e)?e.filter(function(e){return void 0!==t.id(e)}):[]},t},t.exports.naughtyHref=i},44821,(e,t,r)=>{let n=e.r(47963),s=e.r(64873),{isPlainObject:i}=e.r(75654),o=e.r(30860),a=e.r(61840),{parse:l}=e.r(85243),{naughtyHref:c}=e.r(82004),h=["img","audio","video","picture","svg","object","map","iframe","embed"],A=["script","style"];function d(e,t){e&&Object.keys(e).forEach(function(r){t(e[r],r)})}function u(e,t){return({}).hasOwnProperty.call(e,t)}function p(e,t){let r=[];return d(e,function(e){t(e)&&r.push(e)}),r}t.exports=f;let g=/^[^\0\t\n\f\r /<=>]+$/;function f(e,t,r){let x,y,b,w,I,C,v,k,S;if(null==e)return"";"number"==typeof e&&(e=e.toString());let B="",j="";function E(e,t){let r=this;this.tag=e,this.attribs=t||{},this.tagPosition=B.length,this.text="",this.openingTagLength=0,this.mediaChildren=[],this.updateParentNodeText=function(){if(I.length){let e=I[I.length-1];e.text+=r.text}},this.updateParentNodeMediaChildren=function(){I.length&&h.includes(this.tag)&&I[I.length-1].mediaChildren.push(this.tag)}}(t=Object.assign({},f.defaults,t)).parser=Object.assign({},m,t.parser);let D=function(e){return!1===t.allowedTags||(t.allowedTags||[]).indexOf(e)>-1};A.forEach(function(e){D(e)&&!t.allowVulnerableTags&&console.warn(`
⚠️ Your \`allowedTags\` option includes, \`${e}\`, 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 N=t.nonTextTags||["script","style","textarea","option","xmp"];t.allowedAttributes&&(x={},y={},d(t.allowedAttributes,function(e,t){x[t]=[];let r=[];e.forEach(function(e){"string"==typeof e&&e.indexOf("*")>=0?r.push(s(e).replace(/\\\*/g,".*")):x[t].push(e)}),r.length&&(y[t]=RegExp("^("+r.join("|")+")$"))}));let R={},F={},Q={};d(t.allowedClasses,function(e,t){if(x&&(u(x,t)||(x[t]=[]),x[t].push("class")),R[t]=e,Array.isArray(e)){let r=[];R[t]=[],Q[t]=[],e.forEach(function(e){"string"==typeof e&&e.indexOf("*")>=0?r.push(s(e).replace(/\\\*/g,".*")):e instanceof RegExp?Q[t].push(e):R[t].push(e)}),r.length&&(F[t]=RegExp("^("+r.join("|")+")$"))}});let T={};d(t.transformTags,function(e,t){let r;"function"==typeof e?r=e:"string"==typeof e&&(r=f.simpleTransform(e)),"*"===t?b=r:T[t]=r});let W=!1;G();let K=new n.Parser({onopentag:function(e,r){let n;if(t.onOpenTag&&t.onOpenTag(e,r),t.enforceHtmlBoundary&&"html"===e&&G(),k)return void S++;let s=new E(e,r);I.push(s);let c=!1,h=!!s.text;if(u(T,e)&&(s.attribs=r=(n=T[e](e,r)).attribs,void 0!==n.text&&(s.innerText=n.text),e!==n.tagName&&(s.name=e=n.tagName,v[w]=n.tagName)),b&&(s.attribs=r=(n=b(e,r)).attribs,e!==n.tagName&&(s.name=e=n.tagName,v[w]=n.tagName)),(!D(e)||"recursiveEscape"===t.disallowedTagsMode&&!function(e){for(let t in e)if(u(e,t))return!1;return!0}(C)||null!=t.nestingLimit&&w>=t.nestingLimit)&&(c=!0,C[w]=!0,("discard"===t.disallowedTagsMode||"completelyDiscard"===t.disallowedTagsMode)&&-1!==N.indexOf(e)&&(k=!0,S=1)),w++,c){if("discard"===t.disallowedTagsMode||"completelyDiscard"===t.disallowedTagsMode){if(s.innerText&&!h){let r=O(s.innerText);t.textFilter?B+=t.textFilter(r,e):B+=r,W=!0}return}j=B,B=""}if(B+="<"+e,"script"===e&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(s.innerText=""),c&&("escape"===t.disallowedTagsMode||"recursiveEscape"===t.disallowedTagsMode)&&t.preserveEscapedAttributes?d(r,function(e,t){B+=" "+t+'="'+O(e||"",!0)+'"'}):(!x||u(x,e)||x["*"])&&d(r,function(r,n){if(!g.test(n)||""===r&&!t.allowedEmptyAttributes.includes(n)&&(t.nonBooleanAttributes.includes(n)||t.nonBooleanAttributes.includes("*")))return void delete s.attribs[n];let c=!1;if(!x||u(x,e)&&-1!==x[e].indexOf(n)||x["*"]&&-1!==x["*"].indexOf(n)||u(y,e)&&y[e].test(n)||y["*"]&&y["*"].test(n))c=!0;else if(x&&x[e]){for(let t of x[e])if(i(t)&&t.name&&t.name===n){c=!0;let e="";if(!0===t.multiple)for(let n of r.split(" "))-1!==t.values.indexOf(n)&&(""===e?e=n:e+=" "+n);else t.values.indexOf(r)>=0&&(e=r);r=e}}if(c){if(-1!==t.allowedSchemesAppliedToAttributes.indexOf(n)&&M(e,r))return void delete s.attribs[n];if("script"===e&&"src"===n){let e=!0;try{let n=Y(r);if(t.allowedScriptHostnames||t.allowedScriptDomains){let r=(t.allowedScriptHostnames||[]).find(function(e){return e===n.url.hostname}),s=(t.allowedScriptDomains||[]).find(function(e){return n.url.hostname===e||n.url.hostname.endsWith(`.${e}`)});e=r||s}}catch(t){e=!1}if(!e)return void delete s.attribs[n]}if("iframe"===e&&"src"===n){let e=!0;try{let n=Y(r);if(n.isRelativeUrl)e=u(t,"allowIframeRelativeUrls")?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){let r=(t.allowedIframeHostnames||[]).find(function(e){return e===n.url.hostname}),s=(t.allowedIframeDomains||[]).find(function(e){return n.url.hostname===e||n.url.hostname.endsWith(`.${e}`)});e=r||s}}catch(t){e=!1}if(!e)return void delete s.attribs[n]}if("srcset"===n||"imagesrcset"===n)try{let e=a(r);if(e.forEach(function(e){M(n,e.url)&&(e.evil=!0)}),!(e=p(e,function(e){return!e.evil})).length)return void delete s.attribs[n];r=p(e,function(e){return!e.evil}).map(function(e){if(!e.url)throw Error("URL missing");return e.url+(e.w?` ${e.w}w`:"")+(e.h?` ${e.h}h`:"")+(e.d?` ${e.d}x`:"")}).join(", "),s.attribs[n]=r}catch(e){delete s.attribs[n];return}if("class"===n){let t=R[e],i=R["*"],a=F[e],l=Q[e],c=Q["*"],h=[a,F["*"]].concat(l,c).filter(function(e){return e});if(!(r=t&&i?U(r,o(t,i),h):U(r,t||i,h)).length)return void delete s.attribs[n]}if("style"===n){if(t.parseStyleAttributes)try{let i=l(e+" {"+r+"}",{map:!1});if(r=(function(e,t){var r;let n;if(!t)return e;let s=e.nodes[0];return(n=t[s.selector]&&t["*"]?o(t[s.selector],t["*"]):t[s.selector]||t["*"])&&(e.nodes[0].nodes=s.nodes.reduce((r=n,function(e,t){return u(r,t.prop)&&r[t.prop].some(function(e){return e.test(t.value)})&&e.push(t),e}),[])),e})(i,t.allowedStyles).nodes[0].nodes.reduce(function(e,t){return e.push(`${t.prop}:${t.value}${t.important?" !important":""}`),e},[]).join(";"),0===r.length)return void delete s.attribs[n]}catch(t){"u">typeof window&&console.warn('Failed to parse "'+e+" {"+r+"}\", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547"),delete s.attribs[n];return}else if(t.allowedStyles)throw Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}B+=" "+n,r&&r.length?B+='="'+O(r,!0)+'"':t.allowedEmptyAttributes.includes(n)&&(B+='=""')}else delete s.attribs[n]}),-1!==t.selfClosing.indexOf(e))B+=" />";else if(B+=">",s.innerText&&!h){let r=O(s.innerText);t.textFilter?B+=t.textFilter(r,e):B+=r,W=!0}c&&(B=j+O(B),j=""),s.openingTagLength=B.length-s.tagPosition},ontext:function(e){let r;if(k)return;let n=I[I.length-1];if(n&&(r=n.tag,e=void 0!==n.innerText?n.innerText:e),"completelyDiscard"!==t.disallowedTagsMode||D(r)){if(r&&D(r)&&("discard"===t.disallowedTagsMode||"completelyDiscard"===t.disallowedTagsMode)&&("script"===r||"style"===r))B+=e;else if(r&&D(r)&&("discard"===t.disallowedTagsMode||"completelyDiscard"===t.disallowedTagsMode)&&("textarea"===r||"xmp"===r))"xmp"===r?B+=e.replace(//g,">"):B+=O(e,!1);else if(!W){let n=O(e,!1);t.textFilter?B+=t.textFilter(n,r):B+=n}}else e="";if(I.length){let t=I[I.length-1];t.text+=e}},onclosetag:function(e,r){if(t.onCloseTag&&t.onCloseTag(e,r),k){if(--S)return;k=!1}let n=I.pop();if(!n)return;if(n.tag!==e)return void I.push(n);k=!!t.enforceHtmlBoundary&&"html"===e;let s=C[--w];if(s){if(delete C[w],"discard"===t.disallowedTagsMode||"completelyDiscard"===t.disallowedTagsMode)return void n.updateParentNodeText();j=B,B=""}if(v[w]&&(e=v[w],delete v[w]),t.exclusiveFilter){let e=t.exclusiveFilter(n);if("excludeTag"===e){s&&(B=j,j=""),B=B.substring(0,n.tagPosition)+B.substring(n.tagPosition+n.openingTagLength);return}if(e){B=B.substring(0,n.tagPosition);return}}if(n.updateParentNodeMediaChildren(),n.updateParentNodeText(),-1!==t.selfClosing.indexOf(e)||r&&!D(e)&&["escape","recursiveEscape"].indexOf(t.disallowedTagsMode)>=0){s&&(B=j,j="");return}B+=""+e+">",s&&(B=j+O(B),j=""),W=!1}},t.parser);if(K.write(e),K.end(),"escape"===t.disallowedTagsMode||"recursiveEscape"===t.disallowedTagsMode){let t=K.endIndex;if(null!=t&&t>=0&&t0&&""===B&&(B=O(e))}return B;function G(){B="",w=0,I=[],C={},v={},k=!1,S=0}function O(e,r){return"string"!=typeof e&&(e+=""),t.parser.decodeEntities&&(e=e.replace(/&/g,"&").replace(//g,">"),r&&(e=e.replace(/"/g,"""))),e=e.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(//g,">"),r&&(e=e.replace(/"/g,""")),e}function M(e,r){return c(r,{allowedSchemes:u(t.allowedSchemesByTag,e)?t.allowedSchemesByTag[e]:t.allowedSchemes||[],allowProtocolRelative:t.allowProtocolRelative})}function Y(e){if((e=e.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//")).startsWith("relative:"))throw Error("relative: exploit attempt");let t="relative://relative-site";for(let e=0;e<100;e++)t+=`/${e}`;let r=new URL(e,t);return{isRelativeUrl:r&&"relative-site"===r.hostname&&"relative:"===r.protocol,url:r}}function U(e,t,r){return t?(e=e.split(/\s+/)).filter(function(e){return -1!==t.indexOf(e)||r.some(function(t){return t.test(e)})}).join(" "):e}}let m={decodeEntities:!0};f.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta","col"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite","action","formaction","data","xlink:href","poster","background","ping","longdesc","usemap","codebase","classid","archive","profile","manifest","itemid","dynsrc","lowsrc"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1},f.simpleTransform=function(e,t,r){return r=void 0===r||r,t=t||{},function(n,s){let i;if(r)for(i in t)s[i]=t[i];else s=t;return{tagName:e,attribs:s}}}}]);