Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@waline/client

Package Overview
Dependencies
Maintainers
0
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waline/client - npm Package Compare versions

Comparing version 3.2.5 to 3.2.6

2

dist/comment.js

@@ -1,2 +0,2 @@

const h=t=>`${t.replace(/\/?$/,"/")}api/`,i=(t,e="")=>{if(typeof t=="object"&&t.errno)throw new TypeError(`${e} failed with ${t.errno}: ${t.errmsg}`);return t},g=({serverURL:t,lang:e,paths:r,signal:o})=>fetch(`${h(t)}comment?type=count&url=${encodeURIComponent(r.join(","))}&lang=${e}`,{signal:o}).then(n=>n.json()).then(n=>i(n,"Get comment count").data),p=t=>{try{t=decodeURI(t)}catch{}return t},m=(t="")=>t.replace(/\/$/u,""),u=t=>/^(https?:)?\/\//.test(t),d=t=>{const e=m(t);return u(e)?e:`https://${e}`},$=t=>{t.name!=="AbortError"&&console.error(t.message)},f=t=>{const{path:e}=t.dataset;return e!=null&&e.length?e:null},v=({serverURL:t,path:e=window.location.pathname,selector:r=".waline-comment-count",lang:o=navigator.language})=>{const n=new AbortController,a=document.querySelectorAll(r);return a.length&&g({serverURL:d(t),paths:Array.from(a).map(c=>p(f(c)??e)),lang:o,signal:n.signal}).then(c=>{a.forEach((s,l)=>{s.innerText=c[l].toString()})}).catch($),n.abort.bind(n)},w="3.2.5";export{v as commentCount,w as version};
const h=t=>`${t.replace(/\/?$/,"/")}api/`,i=(t,e="")=>{if(typeof t=="object"&&t.errno)throw new TypeError(`${e} failed with ${t.errno}: ${t.errmsg}`);return t},g=({serverURL:t,lang:e,paths:r,signal:o})=>fetch(`${h(t)}comment?type=count&url=${encodeURIComponent(r.join(","))}&lang=${e}`,{signal:o}).then(n=>n.json()).then(n=>i(n,"Get comment count").data),p=t=>{try{t=decodeURI(t)}catch{}return t},m=(t="")=>t.replace(/\/$/u,""),u=t=>/^(https?:)?\/\//.test(t),d=t=>{const e=m(t);return u(e)?e:`https://${e}`},$=t=>{t.name!=="AbortError"&&console.error(t.message)},f=t=>{const{path:e}=t.dataset;return e!=null&&e.length?e:null},v=({serverURL:t,path:e=window.location.pathname,selector:r=".waline-comment-count",lang:o=navigator.language})=>{const n=new AbortController,a=document.querySelectorAll(r);return a.length&&g({serverURL:d(t),paths:Array.from(a).map(c=>p(f(c)??e)),lang:o,signal:n.signal}).then(c=>{a.forEach((s,l)=>{s.innerText=c[l].toString()})}).catch($),n.abort.bind(n)},w="3.2.6";export{v as commentCount,w as version};
//# sourceMappingURL=comment.js.map

@@ -10,3 +10,3 @@ import{h as C,defineComponent as ue,inject as Ce,ref as b,computed as U,onMounted as he,watch as Q,onUnmounted as He,openBlock as i,createElementBlock as a,createElementVNode as u,toDisplayString as _,Fragment as V,renderList as O,normalizeClass as P,createBlock as $,createCommentVNode as k,onBeforeUnmount as ft,nextTick as Pe,normalizeStyle as Ne,reactive as wt,createVNode as W,withDirectives as fe,vModelDynamic as yt,vModelText as bt,vShow as We,createTextVNode as ee,resolveComponent as kt,provide as _t}from"vue";import{useStorage as ae,useScriptTag as Ct,useDebounceFn as pt,useEventListener as De,useNow as It,useStyleTag as Lt}from"@vueuse/core";import{getArticleCounter as Et,updateArticleCounter as Be,updateComment as we,addComment as xt,login as Rt,getComment as St,deleteComment as jt}from"@waline/api";import Fe from"autosize";import{Marked as Mt}from"marked";import{markedHighlight as At}from"marked-highlight";import{load as zt}from"recaptcha-v3";const Ut=({size:o})=>C("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:o,height:o},[C("path",{d:"M697.173 85.333h-369.92c-144.64 0-241.92 101.547-241.92 252.587v348.587c0 150.613 97.28 252.16 241.92 252.16h369.92c144.64 0 241.494-101.547 241.494-252.16V337.92c0-151.04-96.854-252.587-241.494-252.587z",fill:"currentColor"}),C("path",{d:"m640.683 587.52-75.947-75.861 75.904-75.862a37.29 37.29 0 0 0 0-52.778 37.205 37.205 0 0 0-52.779 0l-75.946 75.818-75.862-75.946a37.419 37.419 0 0 0-52.821 0 37.419 37.419 0 0 0 0 52.821l75.947 75.947-75.776 75.733a37.29 37.29 0 1 0 52.778 52.821l75.776-75.776 75.947 75.947a37.376 37.376 0 0 0 52.779-52.821z",fill:"#888"})]),Vt=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),Tt=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"M563.2 463.3 677 540c1.7 1.2 3.7 1.8 5.8 1.8.7 0 1.4-.1 2-.2 2.7-.5 5.1-2.1 6.6-4.4l25.3-37.8c1.5-2.3 2.1-5.1 1.6-7.8s-2.1-5.1-4.4-6.6l-73.6-49.1 73.6-49.1c2.3-1.5 3.9-3.9 4.4-6.6.5-2.7 0-5.5-1.6-7.8l-25.3-37.8a10.1 10.1 0 0 0-6.6-4.4c-.7-.1-1.3-.2-2-.2-2.1 0-4.1.6-5.8 1.8l-113.8 76.6c-9.2 6.2-14.7 16.4-14.7 27.5.1 11 5.5 21.3 14.7 27.4zM387 348.8h-45.5c-5.7 0-10.4 4.7-10.4 10.4v153.3c0 5.7 4.7 10.4 10.4 10.4H387c5.7 0 10.4-4.7 10.4-10.4V359.2c0-5.7-4.7-10.4-10.4-10.4zm333.8 241.3-41-20a10.3 10.3 0 0 0-8.1-.5c-2.6.9-4.8 2.9-5.9 5.4-30.1 64.9-93.1 109.1-164.4 115.2-5.7.5-9.9 5.5-9.5 11.2l3.9 45.5c.5 5.3 5 9.5 10.3 9.5h.9c94.8-8 178.5-66.5 218.6-152.7 2.4-5 .3-11.2-4.8-13.6zm186-186.1c-11.9-42-30.5-81.4-55.2-117.1-24.1-34.9-53.5-65.6-87.5-91.2-33.9-25.6-71.5-45.5-111.6-59.2-41.2-14-84.1-21.1-127.8-21.1h-1.2c-75.4 0-148.8 21.4-212.5 61.7-63.7 40.3-114.3 97.6-146.5 165.8-32.2 68.1-44.3 143.6-35.1 218.4 9.3 74.8 39.4 145 87.3 203.3.1.2.3.3.4.5l36.2 38.4c1.1 1.2 2.5 2.1 3.9 2.6 73.3 66.7 168.2 103.5 267.5 103.5 73.3 0 145.2-20.3 207.7-58.7 37.3-22.9 70.3-51.5 98.1-85 27.1-32.7 48.7-69.5 64.2-109.1 15.5-39.7 24.4-81.3 26.6-123.8 2.4-43.6-2.5-87-14.5-129zm-60.5 181.1c-8.3 37-22.8 72-43 104-19.7 31.1-44.3 58.6-73.1 81.7-28.8 23.1-61 41-95.7 53.4-35.6 12.7-72.9 19.1-110.9 19.1-82.6 0-161.7-30.6-222.8-86.2l-34.1-35.8c-23.9-29.3-42.4-62.2-55.1-97.7-12.4-34.7-18.8-71-19.2-107.9-.4-36.9 5.4-73.3 17.1-108.2 12-35.8 30-69.2 53.4-99.1 31.7-40.4 71.1-72 117.2-94.1 44.5-21.3 94-32.6 143.4-32.6 49.3 0 97 10.8 141.8 32 34.3 16.3 65.3 38.1 92 64.8 26.1 26 47.5 56 63.6 89.2 16.2 33.2 26.6 68.5 31 105.1 4.6 37.5 2.7 75.3-5.6 112.3z",fill:"currentColor"})),Ht=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[C("path",{d:"M784 112H240c-88 0-160 72-160 160v480c0 88 72 160 160 160h544c88 0 160-72 160-160V272c0-88-72-160-160-160zm96 640c0 52.8-43.2 96-96 96H240c-52.8 0-96-43.2-96-96V272c0-52.8 43.2-96 96-96h544c52.8 0 96 43.2 96 96v480z",fill:"currentColor"}),C("path",{d:"M352 480c52.8 0 96-43.2 96-96s-43.2-96-96-96-96 43.2-96 96 43.2 96 96 96zm0-128c17.6 0 32 14.4 32 32s-14.4 32-32 32-32-14.4-32-32 14.4-32 32-32zm462.4 379.2-3.2-3.2-177.6-177.6c-25.6-25.6-65.6-25.6-91.2 0l-80 80-36.8-36.8c-25.6-25.6-65.6-25.6-91.2 0L200 728c-4.8 6.4-8 14.4-8 24 0 17.6 14.4 32 32 32 9.6 0 16-3.2 22.4-9.6L380.8 640l134.4 134.4c6.4 6.4 14.4 9.6 24 9.6 17.6 0 32-14.4 32-32 0-9.6-4.8-17.6-9.6-24l-52.8-52.8 80-80L769.6 776c6.4 4.8 12.8 8 20.8 8 17.6 0 32-14.4 32-32 0-8-3.2-16-8-20.8z",fill:"currentColor"})]),Pt=({active:o=!1})=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[C("path",{d:`M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z${o?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"}`,fill:o?"red":"currentColor"})]),Nt=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[C("path",{d:"M710.816 654.301c70.323-96.639 61.084-230.578-23.705-314.843-46.098-46.098-107.183-71.109-172.28-71.109-65.008 0-126.092 25.444-172.28 71.109-45.227 46.098-70.756 107.183-70.756 172.106 0 64.923 25.444 126.007 71.194 172.106 46.099 46.098 107.184 71.109 172.28 71.109 51.414 0 100.648-16.212 142.824-47.404l126.53 126.006c7.058 7.06 16.297 10.979 26.406 10.979 10.105 0 19.343-3.919 26.402-10.979 14.467-14.467 14.467-38.172 0-52.723L710.816 654.301zm-315.107-23.265c-65.88-65.88-65.88-172.54 0-238.42 32.069-32.07 74.245-49.149 119.471-49.149 45.227 0 87.407 17.603 119.472 49.149 65.88 65.879 65.88 172.539 0 238.42-63.612 63.178-175.242 63.178-238.943 0zm0 0",fill:"currentColor"}),C("path",{d:"M703.319 121.603H321.03c-109.8 0-199.469 89.146-199.469 199.38v382.034c0 109.796 89.236 199.38 199.469 199.38h207.397c20.653 0 37.384-16.645 37.384-37.299 0-20.649-16.731-37.296-37.384-37.296H321.03c-68.582 0-124.352-55.77-124.352-124.267V321.421c0-68.496 55.77-124.267 124.352-124.267h382.289c68.582 0 124.352 55.771 124.352 124.267V524.72c0 20.654 16.736 37.299 37.385 37.299 20.654 0 37.384-16.645 37.384-37.299V320.549c-.085-109.8-89.321-198.946-199.121-198.946zm0 0",fill:"currentColor"})]),Wt=()=>C("svg",{width:"16",height:"16",ariaHidden:"true"},C("path",{d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",fill:"currentColor"})),Dt=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),Bt=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),Ft=()=>C("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},C("path",{d:"m894.4 461.56-54.4-63.2c-10.4-12-18.8-34.4-18.8-50.4v-68c0-42.4-34.8-77.2-77.2-77.2h-68c-15.6 0-38.4-8.4-50.4-18.8l-63.2-54.4c-27.6-23.6-72.8-23.6-100.8 0l-62.8 54.8c-12 10-34.8 18.4-50.4 18.4h-69.2c-42.4 0-77.2 34.8-77.2 77.2v68.4c0 15.6-8.4 38-18.4 50l-54 63.6c-23.2 27.6-23.2 72.4 0 100l54 63.6c10 12 18.4 34.4 18.4 50v68.4c0 42.4 34.8 77.2 77.2 77.2h69.2c15.6 0 38.4 8.4 50.4 18.8l63.2 54.4c27.6 23.6 72.8 23.6 100.8 0l63.2-54.4c12-10.4 34.4-18.8 50.4-18.8h68c42.4 0 77.2-34.8 77.2-77.2v-68c0-15.6 8.4-38.4 18.8-50.4l54.4-63.2c23.2-27.6 23.2-73.2-.4-100.8zm-216-25.2-193.2 193.2a30 30 0 0 1-42.4 0l-96.8-96.8a30.16 30.16 0 0 1 0-42.4c11.6-11.6 30.8-11.6 42.4 0l75.6 75.6 172-172c11.6-11.6 30.8-11.6 42.4 0 11.6 11.6 11.6 30.8 0 42.4z",fill:"#27ae60"})),ye=({size:o=100})=>C("svg",{width:o,height:o,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},C("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},C("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Ot=()=>C("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[C("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),C("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})]),Gt=()=>ae("WALINE_USER_META",{nick:"",mail:"",link:""}),qt=()=>ae("WALINE_COMMENT_BOX_EDITOR",""),Kt="WALINE_LIKE";let Oe=null;const Ge=()=>Oe??(Oe=ae(Kt,[])),Zt="WALINE_REACTION";let qe=null;const Xt=()=>qe??(qe=ae(Zt,{})),Ke={},Yt=o=>{const n=Ke[o]??(Ke[o]=zt(o,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:t=>n.then(e=>e.execute(t))}},Jt=o=>({execute:async n=>{const{load:t}=Ct("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await t();const e=window==null?void 0:window.turnstile;return new Promise(r=>{e==null||e.ready(()=>{e==null||e.render(".wl-captcha-container",{sitekey:o,action:n,size:"compact",callback:r})})})}}),Qt="WALINE_USER";let Ze=null;const pe=()=>Ze??(Ze=ae(Qt,{}));var $t=ue({__name:"ArticleReaction",setup(o,{expose:n}){n();const t=Xt(),e=Ce("config"),r=b(-1),s=b([]),d=U(()=>e.value.locale),h=U(()=>e.value.reaction.length>0),l=U(()=>{const{reaction:g,path:R}=e.value;return g.map((x,p)=>({icon:x,desc:d.value[`reaction${p}`],active:t.value[R]===p}))});let c;const y=async()=>{if(!h.value)return;const{serverURL:g,lang:R,path:x,reaction:p}=e.value,E=new AbortController;c=E.abort.bind(E);const T=await Et({serverURL:g,lang:R,paths:[x],type:p.map((S,G)=>`reaction${G}`),signal:E.signal});s.value=p.map((S,G)=>T[0][`reaction${G}`])},I=async g=>{if(r.value===-1){const{serverURL:R,lang:x,path:p}=e.value,E=t.value[p];r.value=g,E!==void 0&&(await Be({serverURL:R,lang:x,path:p,type:`reaction${E}`,action:"desc"}),s.value[E]=Math.max(s.value[E]-1,0)),E!==g&&(await Be({serverURL:R,lang:x,path:p,type:`reaction${g}`}),s.value[g]=(s.value[g]||0)+1),E===g?delete t.value[p]:t.value[p]=g,r.value=-1}};he(()=>{Q(()=>[e.value.serverURL,e.value.path],()=>{y()},{immediate:!0})}),He(()=>c==null?void 0:c());const A={reactionStorage:t,config:e,votingIndex:r,voteNumbers:s,locale:d,isReactionEnabled:h,reactionsInfo:l,get abort(){return c},set abort(g){c=g},fetchReaction:y,vote:I,get LoadingIcon(){return ye}};return Object.defineProperty(A,"__isScriptSetup",{enumerable:!1,value:!0}),A}}),me=(o,n)=>{const t=o.__vccOpts||o;for(const[e,r]of n)t[e]=r;return t};const en={key:0,class:"wl-reaction"},tn=["textContent"],nn={class:"wl-reaction-list"},on=["onClick"],ln={class:"wl-reaction-img"},an=["src","alt"],rn=["textContent"],cn=["textContent"];function sn(o,n,t,e,r,s){return e.reactionsInfo.length?(i(),a("div",en,[u("div",{class:"wl-reaction-title",textContent:_(e.locale.reactionTitle)},null,8,tn),u("ul",nn,[(i(!0),a(V,null,O(e.reactionsInfo,({active:d,icon:h,desc:l},c)=>(i(),a("li",{key:c,class:P(["wl-reaction-item",{active:d}]),onClick:y=>e.vote(c)},[u("div",ln,[u("img",{src:h,alt:l},null,8,an),e.votingIndex===c?(i(),$(e.LoadingIcon,{key:0,class:"wl-reaction-loading"})):(i(),a("div",{key:1,class:"wl-reaction-votes",textContent:_(e.voteNumbers[c]||0)},null,8,rn))]),u("div",{class:"wl-reaction-text",textContent:_(l)},null,8,cn)],10,on))),128))])])):k("v-if",!0)}var dn=me($t,[["render",sn],["__file","ArticleReaction.vue"]]),un=ue({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(o,{expose:n}){const t=o;n();let e=null;const r=b(null),s=b({}),d=b([]),h=()=>{const g=Math.floor((r.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return g>0?g:1},l=g=>new Array(g).fill(null).map(()=>[]),c=async g=>{var R;if(g>=t.items.length)return;await Pe();const x=Array.from(((R=r.value)==null?void 0:R.children)??[]).reduce((p,E)=>E.getBoundingClientRect().height<p.getBoundingClientRect().height?E:p);d.value[Number(x.dataset.index)].push(g),await c(g+1)},y=async(g=!1)=>{if(d.value.length===h()&&!g)return;d.value=l(h());const R=window.scrollY;await c(0),window.scrollTo({top:R})},I=g=>{s.value[g.target.src]=!0};he(()=>{y(!0),e=new ResizeObserver(()=>{y()}),e.observe(r.value),Q(()=>[t.items],()=>{s.value={},y(!0)}),Q(()=>[t.columnWidth,t.gap],()=>{y()})}),ft(()=>e.unobserve(r.value));const A={props:t,get resizeObserver(){return e},set resizeObserver(g){e=g},wall:r,state:s,columns:d,getColumnCount:h,createColumns:l,fillColumns:c,redraw:y,imageLoad:I,get LoadingIcon(){return ye}};return Object.defineProperty(A,"__isScriptSetup",{enumerable:!1,value:!0}),A}});const mn=["data-index"],vn=["src","title","onClick"];function gn(o,n,t,e,r,s){return i(),a("div",{ref:"wall",class:"wl-gallery",style:Ne({gap:`${t.gap}px`})},[(i(!0),a(V,null,O(e.columns,(d,h)=>(i(),a("div",{key:h,class:"wl-gallery-column","data-index":h,style:Ne({gap:`${t.gap}px`})},[(i(!0),a(V,null,O(d,l=>(i(),a(V,{key:l},[e.state[t.items[l].src]?k("v-if",!0):(i(),$(e.LoadingIcon,{key:0,size:36,style:{margin:"20px auto"}})),u("img",{class:"wl-gallery-item",src:t.items[l].src,title:t.items[l].title,loading:"lazy",onLoad:e.imageLoad,onClick:c=>o.$emit("insert",`![](${t.items[l].src})`)},null,40,vn)],64))),128))],12,mn))),128))],4)}var hn=me(un,[["render",gn],["__file","ImageWall.vue"]]);const fn=o=>{try{o=decodeURI(o)}catch{}return o},Xe=(o="")=>o.replace(/\/$/u,""),Ye=o=>/^(https?:)?\/\//.test(o),wn=["nick","mail","link"],Je=o=>o.filter(n=>wn.includes(n)),Qe=["//unpkg.com/@waline/emojis@1.1.0/weibo"],yn=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],bn=o=>new Promise((n,t)=>{if(o.size>128e3)return t(new Error("File too large! File size limit 128KB"));const e=new FileReader;e.readAsDataURL(o),e.onload=()=>{var r;return n(((r=e.result)==null?void 0:r.toString())??"")},e.onerror=t}),kn=o=>o===!0?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',_n=o=>{const n=async(t,e={})=>fetch(`https://api.giphy.com/v1/gifs/${t}?${new URLSearchParams({lang:o,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...e}).toString()}`).then(r=>r.json()).then(({data:r})=>r.map(s=>({title:s.title,src:s.images.downsized_medium.url})));return{search:t=>n("search",{q:t,offset:"0"}),default:()=>n("trending",{}),more:(t,e=0)=>n("search",{q:t,offset:e.toString()})}},Cn=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,pn=/</,In=/(?:^|\s)\/\/(.+?)$/gm,Ln=/\/\*([\S\s]*?)\*\//gm,En=new RegExp(`(${Cn.source}|${pn.source})|((?:${In.source})|(?:${Ln.source}))`,"gmi"),$e=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],Ie={},xn=o=>{let n=0;return o.replace(En,(t,e,r)=>{if(r)return`<span style="color: slategray">${r}</span>`;if(e==="<")return"&lt;";let s;Ie[e]?s=Ie[e]:(s=$e[n],Ie[e]=s);const d=`<span style="color: #${s}">${e}</span>`;return n=++n%$e.length,d})},Rn=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],te=o=>Object.fromEntries(o.map((n,t)=>[Rn[t],n]));var et=te(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words!

目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const at="en-US",Le={zh:it,"zh-cn":it,"zh-tw":jn,en:et,"en-us":et,fr:tt,"fr-fr":tt,jp:nt,"jp-jp":nt,"pt-br":Sn,ru:ot,"ru-ru":ot,vi:lt,"vi-vn":lt},Mn=o=>Le[o.toLowerCase()]||Le[at],An=o=>Object.keys(Le).includes(o.toLowerCase())?o:at,zn=o=>{const n=Xe(o);return Ye(n)?n:`https://${n}`},Un=o=>Array.isArray(o)?o:o?[0,o]:!1,Ee=(o,n)=>typeof o=="function"?o:o===!1?!1:n,Vn=({serverURL:o,path:n=location.pathname,lang:t=typeof navigator>"u"?"en-US":navigator.language,locale:e,emoji:r=Qe,meta:s=["nick","mail","link"],requiredMeta:d=[],dark:h=!1,pageSize:l=10,wordLimit:c,imageUploader:y,highlighter:I,texRenderer:A,copyright:g=!0,login:R="enable",search:x,reaction:p,recaptchaV3Key:E="",turnstileKey:T="",commentSorting:S="latest",...G})=>({serverURL:zn(o),path:fn(n),lang:An(t),locale:{...Mn(t),...typeof e=="object"?e:{}},wordLimit:Un(c),meta:Je(s),requiredMeta:Je(d),imageUploader:Ee(y,bn),highlighter:Ee(I,xn),texRenderer:Ee(A,kn),dark:h,emoji:typeof r=="boolean"?r?Qe:[]:r,pageSize:l,login:R,copyright:g,search:x===!1?!1:typeof x=="object"?x:_n(t),recaptchaV3Key:E,turnstileKey:T,reaction:Array.isArray(p)?p:p===!0?yn:[],commentSorting:S,...G}),xe=o=>typeof o=="string",Re="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bg-color:#1e1e1e;--waline-bg-color-light:#272727;--waline-bg-color-hover: #444;--waline-border-color:#333;--waline-disable-bg-color:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bg-color:#272727;--waline-info-color:#666}",Tn=o=>xe(o)?o==="auto"?`@media(prefers-color-scheme:dark){body${Re}}`:`${o}${Re}`:o===!0?`:root${Re}`:"",Se=(o,n)=>{let t=o.toString();for(;t.length<n;)t="0"+t;return t},Hn=o=>{const n=Se(o.getDate(),2),t=Se(o.getMonth()+1,2);return`${Se(o.getFullYear(),2)}-${t}-${n}`},Pn=(o,n,t)=>{if(!o)return"";const e=xe(o)?new Date(o.indexOf(" ")!==-1?o.replace(/-/g,"/"):o):o,r=n.getTime()-e.getTime(),s=Math.floor(r/(24*3600*1e3));if(s===0){const d=r%864e5,h=Math.floor(d/(3600*1e3));if(h===0){const l=d%36e5,c=Math.floor(l/(60*1e3));if(c===0){const y=l%6e4;return`${Math.round(y/1e3)} ${t.seconds}`}return`${c} ${t.minutes}`}return`${h} ${t.hours}`}return s<0?t.now:s<8?`${s} ${t.days}`:Hn(e)},Nn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Wn=o=>Nn.test(o),Dn=o=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(o),Bn=o=>{const n=ae("WALINE_EMOJI",{}),t=Dn(o);if(t){const e=n.value[o];if(e)return Promise.resolve(e)}return fetch(`${o}/info.json`).then(e=>e.json()).then(e=>{const r={folder:o,...e};return t&&(n.value[o]=r),r})},rt=(o,n="",t="",e="")=>`${n?`${n}/`:""}${t}${o}${e?`.${e}`:""}`,Fn=o=>Promise.all(o.map(n=>xe(n)?Bn(Xe(n)):Promise.resolve(n))).then(n=>{const t={tabs:[],map:{}};return n.forEach(e=>{const{name:r,folder:s,icon:d,prefix:h="",type:l,items:c}=e;t.tabs.push({name:r,icon:rt(d,s,h,l),items:c.map(y=>{const I=`${h}${y}`;return t.map[I]=rt(y,s,h,l),I})})}),t}),On=o=>o.type.includes("image"),ct=o=>{const n=Array.from(o).find(On);return n?n.getAsFile():null},Gn=/\$.*?\$/,qn=/^\$(.*?)\$/,Kn=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Zn=o=>[{name:"blockMath",level:"block",tokenizer(n){const t=Kn.exec(n);if(t!==null)return{type:"html",raw:t[0],text:o(!0,t[1])}}},{name:"inlineMath",level:"inline",start(n){const t=n.search(Gn);return t!==-1?t:n.length},tokenizer(n){const t=qn.exec(n);if(t!==null)return{type:"html",raw:t[0],text:o(!1,t[1])}}}],st=(o="",n={})=>o.replace(/:(.+?):/g,(t,e)=>n[e]?`<img class="wl-emoji" src="${n[e]}" alt="${e}">`:t),Xn=(o,{emojiMap:n,highlighter:t,texRenderer:e})=>{const r=new Mt;if(r.setOptions({breaks:!0}),t&&r.use(At({highlight:t})),e){const s=Zn(e);r.use({extensions:s})}return r.parse(st(o,n))},Yn=o=>o.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),Jn=o=>o.match(/[\u4E00-\u9FD5]/gu),Qn=o=>{var n,t;return(((n=Yn(o))==null?void 0:n.reduce((e,r)=>e+(["",",","."].includes(r.trim())?0:r.trim().split(/\s+/u).length),0))??0)+(((t=Jn(o))==null?void 0:t.length)??0)},$n=async()=>{if(!navigator)return"";const{userAgentData:o}=navigator;let n=navigator.userAgent;if(!o||o.platform!=="Windows")return n;const{platformVersion:t}=await o.getHighEntropyValues(["platformVersion"]);return t&&parseInt(t.split(".")[0])>=13&&(n=n.replace("Windows NT 10.0","Windows NT 11.0")),n};var eo=ue({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(o,{expose:n,emit:t}){n();const e=o,r=t,s=Ce("config"),d=qt(),h=Gt(),l=pe(),c=b({}),y=b(null),I=b(null),A=b(null),g=b(null),R=b(null),x=b(null),p=b(null),E=b({tabs:[],map:{}}),T=b(0),S=b(!1),G=b(!1),re=b(!1),ce=b(""),oe=b(0),H=wt({loading:!0,list:[]}),ne=b(0),Z=b(!1),se=b(""),X=b(!1),le=b(!1),Y=U(()=>s.value.locale),w=U(()=>{var m;return!!((m=l.value)!=null&&m.token)}),L=U(()=>s.value.imageUploader!==!1),N=m=>{const v=y.value,f=v.selectionStart,j=v.selectionEnd||0,F=v.scrollTop;d.value=v.value.substring(0,f)+m+v.value.substring(j,v.value.length),v.focus(),v.selectionStart=f+m.length,v.selectionEnd=f+m.length,v.scrollTop=F},q=m=>{const v=m.key;(m.ctrlKey||m.metaKey)&&v==="Enter"&&be()},z=m=>{const v=`![${s.value.locale.uploading} ${m.name}]()`;return N(v),X.value=!0,Promise.resolve().then(()=>s.value.imageUploader(m)).then(f=>{d.value=d.value.replace(v,`\r
![${m.name}](${f})`)}).catch(f=>{alert(f.message),d.value=d.value.replace(v,"")}).then(()=>{X.value=!1})},B=m=>{var v;if((v=m.dataTransfer)!=null&&v.items){const f=ct(m.dataTransfer.items);f&&L.value&&(z(f),m.preventDefault())}},D=m=>{if(m.clipboardData){const v=ct(m.clipboardData.items);v&&L.value&&z(v)}},de=()=>{const m=I.value;m.files&&L.value&&z(m.files[0]).then(()=>{m.value=""})},be=async()=>{var m,v,f,j,F,ie;const{serverURL:K,lang:J,login:ve,wordLimit:ze,requiredMeta:Ue,recaptchaV3Key:Ve,turnstileKey:Te}=s.value,ht=await $n(),M={comment:se.value,nick:h.value.nick,mail:h.value.mail,link:h.value.link,url:s.value.path,ua:ht};if((m=l.value)!=null&&m.token&&!e.edit)M.nick=l.value.display_name,M.mail=l.value.email,M.link=l.value.url;else{if(ve==="force")return;if(Ue.indexOf("nick")>-1&&!M.nick)return(v=c.value.nick)==null||v.focus(),alert(Y.value.nickError);if(Ue.indexOf("mail")>-1&&!M.mail||M.mail&&!Wn(M.mail))return(f=c.value.mail)==null||f.focus(),alert(Y.value.mailError);M.nick||(M.nick=Y.value.anonymous)}if(!M.comment){(j=y.value)==null||j.focus();return}if(!Z.value)return alert(Y.value.wordHint.replace("$0",ze[0].toString()).replace("$1",ze[1].toString()).replace("$2",oe.value.toString()));M.comment=st(M.comment,E.value.map),e.replyId&&e.rootId&&(M.pid=e.replyId,M.rid=e.rootId,M.at=e.replyUser),X.value=!0;try{Ve&&(M.recaptchaV3=await Yt(Ve).execute("social")),Te&&(M.turnstile=await Jt(Te).execute("social"));const ge={serverURL:K,lang:J,token:(F=l.value)==null?void 0:F.token,comment:M},_e=await(e.edit?we({objectId:e.edit.objectId,...ge}):xt(ge));if(X.value=!1,_e.errmsg)return alert(_e.errmsg);r("submit",_e.data),d.value="",ce.value="",await Pe(),e.replyId&&r("cancelReply"),(ie=e.edit)!=null&&ie.objectId&&r("cancelEdit")}catch(ge){X.value=!1,alert(ge.message)}},ke=m=>{m.preventDefault();const{lang:v,serverURL:f}=s.value;Rt({serverURL:f,lang:v}).then(j=>{l.value=j,(j.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(j)),r("log")})},mt=()=>{l.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),r("log")},vt=m=>{m.preventDefault();const{lang:v,serverURL:f}=s.value,j=800,F=800,ie=(window.innerWidth-j)/2,K=(window.innerHeight-F)/2,J=new URLSearchParams({lng:v,token:l.value.token}),ve=window.open(`${f}/ui/profile?${J.toString()}`,"_blank",`width=${j},height=${F},left=${ie},top=${K},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);ve==null||ve.postMessage({type:"TOKEN",data:l.value.token},"*")},je=m=>{var v,f,j,F;!((v=A.value)!=null&&v.contains(m.target))&&!((f=g.value)!=null&&f.contains(m.target))&&(S.value=!1),!((j=R.value)!=null&&j.contains(m.target))&&!((F=x.value)!=null&&F.contains(m.target))&&(G.value=!1)},Me=async m=>{var v;const{scrollTop:f,clientHeight:j,scrollHeight:F}=m.target,ie=(j+f)/F,K=s.value.search,J=((v=p.value)==null?void 0:v.value)??"";ie<.9||H.loading||le.value||(H.loading=!0,(K.more&&H.list.length?await K.more(J,H.list.length):await K.search(J)).length?H.list=[...H.list,...K.more&&H.list.length?await K.more(J,H.list.length):await K.search(J)]:le.value=!0,H.loading=!1,setTimeout(()=>{m.target.scrollTop=f},50))},gt=pt(m=>{H.list=[],le.value=!1,Me(m)},300);Q([s,oe],([m,v])=>{const{wordLimit:f}=m;f?v<f[0]&&f[0]!==0?(ne.value=f[0],Z.value=!1):v>f[1]?(ne.value=f[1],Z.value=!1):(ne.value=f[1],Z.value=!0):(ne.value=0,Z.value=!0)},{immediate:!0}),De("click",je),De("message",({data:m})=>{!m||m.type!=="profile"||(l.value={...l.value,...m.data},[localStorage,sessionStorage].filter(v=>v.getItem("WALINE_USER")).forEach(v=>v.setItem("WALINE_USER",JSON.stringify(l))))}),Q(G,async m=>{var v;if(!m)return;const f=s.value.search;p.value&&(p.value.value=""),H.loading=!0,H.list=await(((v=f.default)==null?void 0:v.call(f))??f.search("")),H.loading=!1}),he(()=>{var m;(m=e.edit)!=null&&m.objectId&&(d.value=e.edit.orig),Q(()=>d.value,v=>{const{highlighter:f,texRenderer:j}=s.value;se.value=v,ce.value=Xn(v,{emojiMap:E.value.map,highlighter:f,texRenderer:j}),oe.value=Qn(v),v?Fe(y.value):Fe.destroy(y.value)},{immediate:!0}),Q(()=>s.value.emoji,v=>Fn(v).then(f=>{E.value=f}),{immediate:!0})});const Ae={props:e,emit:r,config:s,editor:d,userMeta:h,userInfo:l,inputRefs:c,editorRef:y,imageUploadRef:I,emojiButtonRef:A,emojiPopupRef:g,gifButtonRef:R,gifPopupRef:x,gifSearchInputRef:p,emoji:E,emojiTabIndex:T,showEmoji:S,showGif:G,showPreview:re,previewText:ce,wordNumber:oe,searchResults:H,wordLimit:ne,isWordNumberLegal:Z,content:se,isSubmitting:X,isImageListEnd:le,locale:Y,isLogin:w,canUploadImage:L,insert:N,onKeyDown:q,uploadImage:z,onDrop:B,onPaste:D,onChange:de,submitComment:be,onLogin:ke,onLogout:mt,onProfile:vt,popupHandler:je,onImageWallScroll:Me,onGifSearch:gt,get CloseIcon(){return Ut},get EmojiIcon(){return Tt},get GifIcon(){return Ot},get ImageIcon(){return Ht},get LoadingIcon(){return ye},get MarkdownIcon(){return Wt},get PreviewIcon(){return Nt},ImageWall:hn};return Object.defineProperty(Ae,"__isScriptSetup",{enumerable:!1,value:!0}),Ae}});const to={key:0,class:"wl-login-info"},no={class:"wl-avatar"},oo=["title"],lo=["title"],io=["src"],ao=["title","textContent"],ro={class:"wl-panel"},co=["for","textContent"],so=["id","onUpdate:modelValue","name","type"],uo=["placeholder"],mo={class:"wl-preview"},vo=u("hr",null,null,-1),go=["innerHTML"],ho={class:"wl-footer"},fo={class:"wl-actions"},wo={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},yo=["title"],bo=["title"],ko=["title"],_o=["title"],Co={class:"wl-info"},po=u("div",{class:"wl-captcha-container"},null,-1),Io={class:"wl-text-number"},Lo={key:0},Eo=["textContent"],xo=["textContent"],Ro=["disabled"],So=["placeholder"],jo={key:1,class:"wl-loading"},Mo={key:0,class:"wl-tab-wrapper"},Ao=["title","onClick"],zo=["src","alt"],Uo={key:0,class:"wl-tabs"},Vo=["onClick"],To=["src","alt","title"],Ho=["title"];function Po(o,n,t,e,r,s){var d,h;return i(),a("div",{key:Number(e.isLogin),class:"wl-comment"},[e.config.login!=="disable"&&e.isLogin&&!((d=t.edit)!=null&&d.objectId)?(i(),a("div",to,[u("div",no,[u("button",{type:"submit",class:"wl-logout-btn",title:e.locale.logout,onClick:e.onLogout},[W(e.CloseIcon,{size:14})],8,oo),u("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:e.onProfile},[u("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,io)],8,lo)]),u("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:e.onProfile,textContent:_(e.userInfo.display_name)},null,8,ao)])):k("v-if",!0),u("div",ro,[e.config.login!=="force"&&e.config.meta.length&&!e.isLogin?(i(),a("div",{key:0,class:P(["wl-header",`item${e.config.meta.length}`])},[(i(!0),a(V,null,O(e.config.meta,l=>(i(),a("div",{key:l,class:"wl-header-item"},[u("label",{for:`wl-${l}`,textContent:_(e.locale[l]+(e.config.requiredMeta.includes(l)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,co),fe(u("input",{id:`wl-${l}`,ref_for:!0,ref:c=>{c&&(e.inputRefs[l]=c)},"onUpdate:modelValue":c=>e.userMeta[l]=c,class:P(["wl-input",`wl-${l}`]),name:l,type:l==="mail"?"email":"text"},null,10,so),[[yt,e.userMeta[l]]])]))),128))],2)):k("v-if",!0),fe(u("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":n[0]||(n[0]=l=>e.editor=l),class:"wl-editor",placeholder:t.replyUser?`@${t.replyUser}`:e.locale.placeholder,onKeydown:e.onKeyDown,onDrop:e.onDrop,onPaste:e.onPaste},null,40,uo),[[bt,e.editor]]),fe(u("div",mo,[vo,u("h4",null,_(e.locale.preview)+":",1),u("div",{class:"wl-content",innerHTML:e.previewText},null,8,go)],512),[[We,e.showPreview]]),u("div",ho,[u("div",fo,[u("a",wo,[W(e.MarkdownIcon)]),fe(u("button",{ref:"emojiButtonRef",type:"button",class:P(["wl-action",{active:e.showEmoji}]),title:e.locale.emoji,onClick:n[1]||(n[1]=l=>e.showEmoji=!e.showEmoji)},[W(e.EmojiIcon)],10,yo),[[We,e.emoji.tabs.length]]),e.config.search?(i(),a("button",{key:0,ref:"gifButtonRef",type:"button",class:P(["wl-action",{active:e.showGif}]),title:e.locale.gif,onClick:n[2]||(n[2]=l=>e.showGif=!e.showGif)},[W(e.GifIcon)],10,bo)):k("v-if",!0),u("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:e.onChange},null,544),e.canUploadImage?(i(),a("label",{key:1,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[W(e.ImageIcon)],8,ko)):k("v-if",!0),u("button",{type:"button",class:P(["wl-action",{active:e.showPreview}]),title:e.locale.preview,onClick:n[3]||(n[3]=l=>e.showPreview=!e.showPreview)},[W(e.PreviewIcon)],10,_o)]),u("div",Co,[po,u("div",Io,[ee(_(e.wordNumber)+" ",1),e.config.wordLimit?(i(),a("span",Lo,[ee("  /  "),u("span",{class:P({illegal:!e.isWordNumberLegal}),textContent:_(e.wordLimit)},null,10,Eo)])):k("v-if",!0),ee("  "+_(e.locale.word),1)]),e.config.login!=="disable"&&!e.isLogin?(i(),a("button",{key:0,type:"button",class:"wl-btn",onClick:e.onLogin,textContent:_(e.locale.login)},null,8,xo)):k("v-if",!0),e.config.login!=="force"||e.isLogin?(i(),a("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:e.submitComment},[e.isSubmitting?(i(),$(e.LoadingIcon,{key:0,size:16})):(i(),a(V,{key:1},[ee(_(e.locale.submit),1)],64))],8,Ro)):k("v-if",!0)]),u("div",{ref:"gifPopupRef",class:P(["wl-gif-popup",{display:e.showGif}])},[u("input",{ref:"gifSearchInputRef",type:"text",placeholder:e.locale.gifSearchPlaceholder,onInput:n[4]||(n[4]=(...l)=>e.onGifSearch&&e.onGifSearch(...l))},null,40,So),e.searchResults.list.length?(i(),$(e.ImageWall,{key:0,items:e.searchResults.list,"column-width":200,gap:6,onInsert:n[5]||(n[5]=l=>e.insert(l)),onScroll:e.onImageWallScroll},null,8,["items"])):k("v-if",!0),e.searchResults.loading?(i(),a("div",jo,[W(e.LoadingIcon,{size:30})])):k("v-if",!0)],2),u("div",{ref:"emojiPopupRef",class:P(["wl-emoji-popup",{display:e.showEmoji}])},[(i(!0),a(V,null,O(e.emoji.tabs,(l,c)=>(i(),a(V,{key:l.name},[c===e.emojiTabIndex?(i(),a("div",Mo,[(i(!0),a(V,null,O(l.items,y=>(i(),a("button",{key:y,type:"button",title:y,onClick:I=>e.insert(`:${y}:`)},[e.showEmoji?(i(),a("img",{key:0,class:"wl-emoji",src:e.emoji.map[y],alt:y,loading:"lazy",referrerPolicy:"no-referrer"},null,8,zo)):k("v-if",!0)],8,Ao))),128))])):k("v-if",!0)],64))),128)),e.emoji.tabs.length>1?(i(),a("div",Uo,[(i(!0),a(V,null,O(e.emoji.tabs,(l,c)=>(i(),a("button",{key:l.name,type:"button",class:P(["wl-tab",{active:e.emojiTabIndex===c}]),onClick:y=>e.emojiTabIndex=c},[u("img",{class:"wl-emoji",src:l.icon,alt:l.name,title:l.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,To)],10,Vo))),128))])):k("v-if",!0)],2)])]),t.replyId||(h=t.edit)!=null&&h.objectId?(i(),a("button",{key:1,type:"button",class:"wl-close",title:e.locale.cancelReply,onClick:n[6]||(n[6]=l=>t.replyId?e.emit("cancelReply"):e.emit("cancelEdit"))},[W(e.CloseIcon,{size:24})],8,Ho)):k("v-if",!0)])}var dt=me(eo,[["render",Po],["__file","CommentBox.vue"]]),No=ue({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(o,{expose:n,emit:t}){n();const e=o,r=t,s=["approved","waiting","spam"],d=Ce("config"),h=Ge(),l=It(),c=pe(),y=U(()=>d.value.locale),I=U(()=>{const{link:S}=e.comment;return S?Ye(S)?S:`https://${S}`:""}),A=U(()=>h.value.includes(e.comment.objectId)),g=U(()=>Pn(new Date(e.comment.time),l.value,y.value)),R=U(()=>c.value.type==="administrator"),x=U(()=>e.comment.user_id&&c.value.objectId===e.comment.user_id),p=U(()=>{var S;return e.comment.objectId===((S=e.reply)==null?void 0:S.objectId)}),E=U(()=>{var S;return e.comment.objectId===((S=e.edit)==null?void 0:S.objectId)}),T={props:e,emit:r,commentStatus:s,config:d,likes:h,now:l,userInfo:c,locale:y,link:I,like:A,time:g,isAdmin:R,isOwner:x,isReplyingCurrent:p,isEditingCurrent:E,CommentBox:dt,get DeleteIcon(){return Vt},get EditIcon(){return Bt},get LikeIcon(){return Pt},get ReplyIcon(){return Dt},get VerifiedIcon(){return Ft}};return Object.defineProperty(T,"__isScriptSetup",{enumerable:!1,value:!0}),T}});const Wo=["id"],Do={class:"wl-user","aria-hidden":"true"},Bo=["src"],Fo={class:"wl-card"},Oo={class:"wl-head"},Go=["href"],qo={key:1,class:"wl-nick"},Ko=["textContent"],Zo=["textContent"],Xo=["textContent"],Yo=["textContent"],Jo=["textContent"],Qo={class:"wl-comment-actions"},$o=["title"],el=["title"],tl={class:"wl-meta","aria-hidden":"true"},nl=["data-value","textContent"],ol={key:0,class:"wl-content"},ll={key:0},il=["href"],al=u("span",null,": ",-1),rl=["innerHTML"],cl={key:1,class:"wl-admin-actions"},sl={class:"wl-comment-status"},dl=["disabled","onClick","textContent"],ul={key:3,class:"wl-quote"};function ml(o,n,t,e,r,s){var h;const d=kt("CommentCard",!0);return i(),a("div",{id:t.comment.objectId,class:"wl-card-item"},[u("div",Do,[t.comment.avatar?(i(),a("img",{key:0,class:"wl-user-avatar",src:t.comment.avatar},null,8,Bo)):k("v-if",!0),t.comment.type?(i(),$(e.VerifiedIcon,{key:1})):k("v-if",!0)]),u("div",Fo,[u("div",Oo,[e.link?(i(),a("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noopener noreferrer"},_(t.comment.nick),9,Go)):(i(),a("span",qo,_(t.comment.nick),1)),t.comment.type==="administrator"?(i(),a("span",{key:2,class:"wl-badge",textContent:_(e.locale.admin)},null,8,Ko)):k("v-if",!0),t.comment.label?(i(),a("span",{key:3,class:"wl-badge",textContent:_(t.comment.label)},null,8,Zo)):k("v-if",!0),t.comment.sticky?(i(),a("span",{key:4,class:"wl-badge",textContent:_(e.locale.sticky)},null,8,Xo)):k("v-if",!0),typeof t.comment.level=="number"?(i(),a("span",{key:5,class:P(`wl-badge level${t.comment.level}`),textContent:_(e.locale[`level${t.comment.level}`]||`Level ${t.comment.level}`)},null,10,Yo)):k("v-if",!0),u("span",{class:"wl-time",textContent:_(e.time)},null,8,Jo),u("div",Qo,[e.isAdmin||e.isOwner?(i(),a(V,{key:0},[u("button",{type:"button",class:"wl-edit",onClick:n[0]||(n[0]=l=>e.emit("edit",t.comment))},[W(e.EditIcon)]),u("button",{type:"button",class:"wl-delete",onClick:n[1]||(n[1]=l=>e.emit("delete",t.comment))},[W(e.DeleteIcon)])],64)):k("v-if",!0),u("button",{type:"button",class:"wl-like",title:e.like?e.locale.cancelLike:e.locale.like,onClick:n[2]||(n[2]=l=>e.emit("like",t.comment))},[W(e.LikeIcon,{active:e.like},null,8,["active"]),ee(" "+_("like"in t.comment?t.comment.like:""),1)],8,$o),u("button",{type:"button",class:P(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:n[3]||(n[3]=l=>e.emit("reply",e.isReplyingCurrent?null:t.comment))},[W(e.ReplyIcon)],10,el)])]),u("div",tl,[(i(),a(V,null,O(["addr","browser","os"],l=>(i(),a(V,null,[t.comment[l]?(i(),a("span",{key:l,class:P(`wl-${l}`),"data-value":t.comment[l],textContent:_(t.comment[l])},null,10,nl)):k("v-if",!0)],64))),64))]),e.isEditingCurrent?k("v-if",!0):(i(),a("div",ol,[t.comment.reply_user?(i(),a("p",ll,[u("a",{href:"#"+t.comment.pid},"@"+_(t.comment.reply_user.nick),9,il),al])):k("v-if",!0),u("div",{innerHTML:t.comment.comment},null,8,rl)])),e.isAdmin&&!e.isEditingCurrent?(i(),a("div",cl,[u("span",sl,[(i(),a(V,null,O(e.commentStatus,l=>u("button",{key:l,type:"submit",class:P(`wl-btn wl-${l}`),disabled:t.comment.status===l,onClick:c=>e.emit("status",{status:l,comment:t.comment}),textContent:_(e.locale[l])},null,10,dl)),64))]),e.isAdmin&&!("rid"in t.comment)?(i(),a("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:n[4]||(n[4]=l=>e.emit("sticky",t.comment))},_(t.comment.sticky?e.locale.unsticky:e.locale.sticky),1)):k("v-if",!0)])):k("v-if",!0),e.isReplyingCurrent||e.isEditingCurrent?(i(),a("div",{key:2,class:P({"wl-reply-wrapper":e.isReplyingCurrent,"wl-edit-wrapper":e.isEditingCurrent})},[W(e.CommentBox,{edit:t.edit,"reply-id":(h=t.reply)==null?void 0:h.objectId,"reply-user":t.comment.nick,"root-id":t.rootId,onLog:n[5]||(n[5]=l=>e.emit("log")),onCancelReply:n[6]||(n[6]=l=>e.emit("reply",null)),onCancelEdit:n[7]||(n[7]=l=>e.emit("edit",null)),onSubmit:n[8]||(n[8]=l=>e.emit("submit",l))},null,8,["edit","reply-id","reply-user","root-id"])],2)):k("v-if",!0),"children"in t.comment?(i(),a("div",ul,[(i(!0),a(V,null,O(t.comment.children,l=>(i(),$(d,{key:l.objectId,comment:l,reply:t.reply,edit:t.edit,"root-id":t.rootId,onLog:n[9]||(n[9]=c=>e.emit("log")),onDelete:n[10]||(n[10]=c=>e.emit("delete",c)),onEdit:n[11]||(n[11]=c=>e.emit("edit",c)),onLike:n[12]||(n[12]=c=>e.emit("like",c)),onReply:n[13]||(n[13]=c=>e.emit("reply",c)),onStatus:n[14]||(n[14]=c=>e.emit("status",c)),onSticky:n[15]||(n[15]=c=>e.emit("sticky",c)),onSubmit:n[16]||(n[16]=c=>e.emit("submit",c))},null,8,["comment","reply","edit","root-id"]))),128))])):k("v-if",!0)])],8,Wo)}var vl=me(No,[["render",ml],["__file","CommentCard.vue"]]);const ut="3.2.5";var gl=ue({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(o,{expose:n}){n();const t=o,e={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},r=Object.keys(e),s=pe(),d=Ge(),h=b("loading"),l=b(0),c=b(1),y=b(0),I=U(()=>Vn(t)),A=b(I.value.commentSorting),g=b([]),R=b(null),x=b(null),p=U(()=>Tn(I.value.dark)),E=U(()=>I.value.locale);Lt(p,{id:"waline-darkmode"});let T;const S=w=>{var L;const{serverURL:N,path:q,pageSize:z}=I.value,B=new AbortController;h.value="loading",T==null||T(),St({serverURL:N,lang:I.value.lang,path:q,pageSize:z,sortBy:e[A.value],page:w,signal:B.signal,token:(L=s.value)==null?void 0:L.token}).then(D=>{h.value="success",l.value=D.count,g.value.push(...D.data),c.value=w,y.value=D.totalPages}).catch(D=>{D.name!=="AbortError"&&(console.error(D.message),h.value="error")}),T=B.abort.bind(B)},G=()=>S(c.value+1),re=()=>{l.value=0,g.value=[],S(1)},ce=w=>{A.value!==w&&(A.value=w,re())},oe=w=>{R.value=w},H=w=>{x.value=w},ne=w=>{if(x.value)x.value.comment=w.comment,x.value.orig=w.orig;else if("rid"in w){const L=g.value.find(({objectId:N})=>N===w.rid);if(!L)return;Array.isArray(L.children)||(L.children=[]),L.children.push(w)}else g.value.unshift(w),l.value+=1},Z=async({comment:w,status:L})=>{var N;if(w.status===L)return;const{serverURL:q,lang:z}=I.value;await we({serverURL:q,lang:z,token:(N=s.value)==null?void 0:N.token,objectId:w.objectId,comment:{status:L}}),w.status=L},se=async w=>{var L;if("rid"in w)return;const{serverURL:N,lang:q}=I.value;await we({serverURL:N,lang:q,token:(L=s.value)==null?void 0:L.token,objectId:w.objectId,comment:{sticky:w.sticky?0:1}}),w.sticky=!w.sticky},X=async({objectId:w})=>{var L;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:N,lang:q}=I.value;await jt({serverURL:N,lang:q,token:(L=s.value)==null?void 0:L.token,objectId:w}),g.value.some((z,B)=>z.objectId===w?(g.value=g.value.filter((D,de)=>de!==B),!0):z.children.some((D,de)=>D.objectId===w?(g.value[B].children=z.children.filter((be,ke)=>ke!==de),!0):!1))},le=async w=>{var L;const{serverURL:N,lang:q}=I.value,{objectId:z}=w,B=d.value.includes(z);await we({serverURL:N,lang:q,objectId:z,token:(L=s.value)==null?void 0:L.token,comment:{like:!B}}),B?d.value=d.value.filter(D=>D!==z):(d.value=[...d.value,z],d.value.length>50&&(d.value=d.value.slice(-50))),w.like=(w.like||0)+(B?-1:1)};_t("config",I),he(()=>{Q(()=>[t.serverURL,t.path],()=>re(),{immediate:!0})}),He(()=>T==null?void 0:T());const Y={props:t,sortKeyMap:e,sortingMethods:r,userInfo:s,likeStorage:d,status:h,count:l,page:c,totalPages:y,config:I,commentSortingRef:A,data:g,reply:R,edit:x,darkmodeStyle:p,i18n:E,get abort(){return T},set abort(w){T=w},getCommentData:S,loadMore:G,refresh:re,onSortByChange:ce,onReply:oe,onEdit:H,onSubmit:ne,onStatusChange:Z,onSticky:se,onDelete:X,onLike:le,Reaction:dn,CommentBox:dt,CommentCard:vl,get LoadingIcon(){return ye},get version(){return ut}};return Object.defineProperty(Y,"__isScriptSetup",{enumerable:!1,value:!0}),Y}});const hl={"data-waline":""},fl={class:"wl-meta-head"},wl={class:"wl-count"},yl=["textContent"],bl={class:"wl-sort"},kl=["onClick"],_l={class:"wl-cards"},Cl={key:1,class:"wl-operation"},pl=["textContent"],Il={key:2,class:"wl-loading"},Ll=["textContent"],El={key:4,class:"wl-operation"},xl=["textContent"],Rl={key:5,class:"wl-power"},Sl=u("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);function jl(o,n,t,e,r,s){return i(),a("div",hl,[W(e.Reaction),e.reply?k("v-if",!0):(i(),$(e.CommentBox,{key:0,onLog:e.refresh,onSubmit:e.onSubmit})),u("div",fl,[u("div",wl,[e.count?(i(),a("span",{key:0,class:"wl-num",textContent:_(e.count)},null,8,yl)):k("v-if",!0),ee(" "+_(e.i18n.comment),1)]),u("ul",bl,[(i(!0),a(V,null,O(e.sortingMethods,d=>(i(),a("li",{key:d,class:P([d===e.commentSortingRef?"active":""]),onClick:h=>e.onSortByChange(d)},_(e.i18n[d]),11,kl))),128))])]),u("div",_l,[(i(!0),a(V,null,O(e.data,d=>(i(),$(e.CommentCard,{key:d.objectId,"root-id":d.objectId,comment:d,reply:e.reply,edit:e.edit,onLog:e.refresh,onReply:e.onReply,onEdit:e.onEdit,onSubmit:e.onSubmit,onStatus:e.onStatusChange,onDelete:e.onDelete,onSticky:e.onSticky,onLike:e.onLike},null,8,["root-id","comment","reply","edit"]))),128))]),e.status==="error"?(i(),a("div",Cl,[u("button",{type:"button",class:"wl-btn",onClick:e.refresh,textContent:_(e.i18n.refresh)},null,8,pl)])):e.status==="loading"?(i(),a("div",Il,[W(e.LoadingIcon,{size:30})])):e.data.length?e.page<e.totalPages?(i(),a("div",El,[u("button",{type:"button",class:"wl-btn",onClick:e.loadMore,textContent:_(e.i18n.more)},null,8,xl)])):k("v-if",!0):(i(),a("div",{key:3,class:"wl-empty",textContent:_(e.i18n.sofa)},null,8,Ll)),e.config.copyright?(i(),a("div",Rl,[ee(" Powered by "),Sl,ee(" v"+_(e.version),1)])):k("v-if",!0)])}var Ml=me(gl,[["render",jl],["__file","WalineComment.vue"]]);export{Ml as Waline,ut as version};
![${m.name}](${f})`)}).catch(f=>{alert(f.message),d.value=d.value.replace(v,"")}).then(()=>{X.value=!1})},B=m=>{var v;if((v=m.dataTransfer)!=null&&v.items){const f=ct(m.dataTransfer.items);f&&L.value&&(z(f),m.preventDefault())}},D=m=>{if(m.clipboardData){const v=ct(m.clipboardData.items);v&&L.value&&z(v)}},de=()=>{const m=I.value;m.files&&L.value&&z(m.files[0]).then(()=>{m.value=""})},be=async()=>{var m,v,f,j,F,ie;const{serverURL:K,lang:J,login:ve,wordLimit:ze,requiredMeta:Ue,recaptchaV3Key:Ve,turnstileKey:Te}=s.value,ht=await $n(),M={comment:se.value,nick:h.value.nick,mail:h.value.mail,link:h.value.link,url:s.value.path,ua:ht};if((m=l.value)!=null&&m.token&&!e.edit)M.nick=l.value.display_name,M.mail=l.value.email,M.link=l.value.url;else{if(ve==="force")return;if(Ue.indexOf("nick")>-1&&!M.nick)return(v=c.value.nick)==null||v.focus(),alert(Y.value.nickError);if(Ue.indexOf("mail")>-1&&!M.mail||M.mail&&!Wn(M.mail))return(f=c.value.mail)==null||f.focus(),alert(Y.value.mailError);M.nick||(M.nick=Y.value.anonymous)}if(!M.comment){(j=y.value)==null||j.focus();return}if(!Z.value)return alert(Y.value.wordHint.replace("$0",ze[0].toString()).replace("$1",ze[1].toString()).replace("$2",oe.value.toString()));M.comment=st(M.comment,E.value.map),e.replyId&&e.rootId&&(M.pid=e.replyId,M.rid=e.rootId,M.at=e.replyUser),X.value=!0;try{Ve&&(M.recaptchaV3=await Yt(Ve).execute("social")),Te&&(M.turnstile=await Jt(Te).execute("social"));const ge={serverURL:K,lang:J,token:(F=l.value)==null?void 0:F.token,comment:M},_e=await(e.edit?we({objectId:e.edit.objectId,...ge}):xt(ge));if(X.value=!1,_e.errmsg)return alert(_e.errmsg);r("submit",_e.data),d.value="",ce.value="",await Pe(),e.replyId&&r("cancelReply"),(ie=e.edit)!=null&&ie.objectId&&r("cancelEdit")}catch(ge){X.value=!1,alert(ge.message)}},ke=m=>{m.preventDefault();const{lang:v,serverURL:f}=s.value;Rt({serverURL:f,lang:v}).then(j=>{l.value=j,(j.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(j)),r("log")})},mt=()=>{l.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),r("log")},vt=m=>{m.preventDefault();const{lang:v,serverURL:f}=s.value,j=800,F=800,ie=(window.innerWidth-j)/2,K=(window.innerHeight-F)/2,J=new URLSearchParams({lng:v,token:l.value.token}),ve=window.open(`${f}/ui/profile?${J.toString()}`,"_blank",`width=${j},height=${F},left=${ie},top=${K},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);ve==null||ve.postMessage({type:"TOKEN",data:l.value.token},"*")},je=m=>{var v,f,j,F;!((v=A.value)!=null&&v.contains(m.target))&&!((f=g.value)!=null&&f.contains(m.target))&&(S.value=!1),!((j=R.value)!=null&&j.contains(m.target))&&!((F=x.value)!=null&&F.contains(m.target))&&(G.value=!1)},Me=async m=>{var v;const{scrollTop:f,clientHeight:j,scrollHeight:F}=m.target,ie=(j+f)/F,K=s.value.search,J=((v=p.value)==null?void 0:v.value)??"";ie<.9||H.loading||le.value||(H.loading=!0,(K.more&&H.list.length?await K.more(J,H.list.length):await K.search(J)).length?H.list=[...H.list,...K.more&&H.list.length?await K.more(J,H.list.length):await K.search(J)]:le.value=!0,H.loading=!1,setTimeout(()=>{m.target.scrollTop=f},50))},gt=pt(m=>{H.list=[],le.value=!1,Me(m)},300);Q([s,oe],([m,v])=>{const{wordLimit:f}=m;f?v<f[0]&&f[0]!==0?(ne.value=f[0],Z.value=!1):v>f[1]?(ne.value=f[1],Z.value=!1):(ne.value=f[1],Z.value=!0):(ne.value=0,Z.value=!0)},{immediate:!0}),De("click",je),De("message",({data:m})=>{!m||m.type!=="profile"||(l.value={...l.value,...m.data},[localStorage,sessionStorage].filter(v=>v.getItem("WALINE_USER")).forEach(v=>v.setItem("WALINE_USER",JSON.stringify(l))))}),Q(G,async m=>{var v;if(!m)return;const f=s.value.search;p.value&&(p.value.value=""),H.loading=!0,H.list=await(((v=f.default)==null?void 0:v.call(f))??f.search("")),H.loading=!1}),he(()=>{var m;(m=e.edit)!=null&&m.objectId&&(d.value=e.edit.orig),Q(()=>d.value,v=>{const{highlighter:f,texRenderer:j}=s.value;se.value=v,ce.value=Xn(v,{emojiMap:E.value.map,highlighter:f,texRenderer:j}),oe.value=Qn(v),v?Fe(y.value):Fe.destroy(y.value)},{immediate:!0}),Q(()=>s.value.emoji,v=>Fn(v).then(f=>{E.value=f}),{immediate:!0})});const Ae={props:e,emit:r,config:s,editor:d,userMeta:h,userInfo:l,inputRefs:c,editorRef:y,imageUploadRef:I,emojiButtonRef:A,emojiPopupRef:g,gifButtonRef:R,gifPopupRef:x,gifSearchInputRef:p,emoji:E,emojiTabIndex:T,showEmoji:S,showGif:G,showPreview:re,previewText:ce,wordNumber:oe,searchResults:H,wordLimit:ne,isWordNumberLegal:Z,content:se,isSubmitting:X,isImageListEnd:le,locale:Y,isLogin:w,canUploadImage:L,insert:N,onKeyDown:q,uploadImage:z,onDrop:B,onPaste:D,onChange:de,submitComment:be,onLogin:ke,onLogout:mt,onProfile:vt,popupHandler:je,onImageWallScroll:Me,onGifSearch:gt,get CloseIcon(){return Ut},get EmojiIcon(){return Tt},get GifIcon(){return Ot},get ImageIcon(){return Ht},get LoadingIcon(){return ye},get MarkdownIcon(){return Wt},get PreviewIcon(){return Nt},ImageWall:hn};return Object.defineProperty(Ae,"__isScriptSetup",{enumerable:!1,value:!0}),Ae}});const to={key:0,class:"wl-login-info"},no={class:"wl-avatar"},oo=["title"],lo=["title"],io=["src"],ao=["title","textContent"],ro={class:"wl-panel"},co=["for","textContent"],so=["id","onUpdate:modelValue","name","type"],uo=["placeholder"],mo={class:"wl-preview"},vo=u("hr",null,null,-1),go=["innerHTML"],ho={class:"wl-footer"},fo={class:"wl-actions"},wo={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},yo=["title"],bo=["title"],ko=["title"],_o=["title"],Co={class:"wl-info"},po=u("div",{class:"wl-captcha-container"},null,-1),Io={class:"wl-text-number"},Lo={key:0},Eo=["textContent"],xo=["textContent"],Ro=["disabled"],So=["placeholder"],jo={key:1,class:"wl-loading"},Mo={key:0,class:"wl-tab-wrapper"},Ao=["title","onClick"],zo=["src","alt"],Uo={key:0,class:"wl-tabs"},Vo=["onClick"],To=["src","alt","title"],Ho=["title"];function Po(o,n,t,e,r,s){var d,h;return i(),a("div",{key:e.userInfo.token,class:"wl-comment"},[e.config.login!=="disable"&&e.isLogin&&!((d=t.edit)!=null&&d.objectId)?(i(),a("div",to,[u("div",no,[u("button",{type:"submit",class:"wl-logout-btn",title:e.locale.logout,onClick:e.onLogout},[W(e.CloseIcon,{size:14})],8,oo),u("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:e.onProfile},[u("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,io)],8,lo)]),u("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:e.onProfile,textContent:_(e.userInfo.display_name)},null,8,ao)])):k("v-if",!0),u("div",ro,[e.config.login!=="force"&&e.config.meta.length&&!e.isLogin?(i(),a("div",{key:0,class:P(["wl-header",`item${e.config.meta.length}`])},[(i(!0),a(V,null,O(e.config.meta,l=>(i(),a("div",{key:l,class:"wl-header-item"},[u("label",{for:`wl-${l}`,textContent:_(e.locale[l]+(e.config.requiredMeta.includes(l)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,co),fe(u("input",{id:`wl-${l}`,ref_for:!0,ref:c=>{c&&(e.inputRefs[l]=c)},"onUpdate:modelValue":c=>e.userMeta[l]=c,class:P(["wl-input",`wl-${l}`]),name:l,type:l==="mail"?"email":"text"},null,10,so),[[yt,e.userMeta[l]]])]))),128))],2)):k("v-if",!0),fe(u("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":n[0]||(n[0]=l=>e.editor=l),class:"wl-editor",placeholder:t.replyUser?`@${t.replyUser}`:e.locale.placeholder,onKeydown:e.onKeyDown,onDrop:e.onDrop,onPaste:e.onPaste},null,40,uo),[[bt,e.editor]]),fe(u("div",mo,[vo,u("h4",null,_(e.locale.preview)+":",1),u("div",{class:"wl-content",innerHTML:e.previewText},null,8,go)],512),[[We,e.showPreview]]),u("div",ho,[u("div",fo,[u("a",wo,[W(e.MarkdownIcon)]),fe(u("button",{ref:"emojiButtonRef",type:"button",class:P(["wl-action",{active:e.showEmoji}]),title:e.locale.emoji,onClick:n[1]||(n[1]=l=>e.showEmoji=!e.showEmoji)},[W(e.EmojiIcon)],10,yo),[[We,e.emoji.tabs.length]]),e.config.search?(i(),a("button",{key:0,ref:"gifButtonRef",type:"button",class:P(["wl-action",{active:e.showGif}]),title:e.locale.gif,onClick:n[2]||(n[2]=l=>e.showGif=!e.showGif)},[W(e.GifIcon)],10,bo)):k("v-if",!0),u("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:e.onChange},null,544),e.canUploadImage?(i(),a("label",{key:1,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[W(e.ImageIcon)],8,ko)):k("v-if",!0),u("button",{type:"button",class:P(["wl-action",{active:e.showPreview}]),title:e.locale.preview,onClick:n[3]||(n[3]=l=>e.showPreview=!e.showPreview)},[W(e.PreviewIcon)],10,_o)]),u("div",Co,[po,u("div",Io,[ee(_(e.wordNumber)+" ",1),e.config.wordLimit?(i(),a("span",Lo,[ee("  /  "),u("span",{class:P({illegal:!e.isWordNumberLegal}),textContent:_(e.wordLimit)},null,10,Eo)])):k("v-if",!0),ee("  "+_(e.locale.word),1)]),e.config.login!=="disable"&&!e.isLogin?(i(),a("button",{key:0,type:"button",class:"wl-btn",onClick:e.onLogin,textContent:_(e.locale.login)},null,8,xo)):k("v-if",!0),e.config.login!=="force"||e.isLogin?(i(),a("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:e.submitComment},[e.isSubmitting?(i(),$(e.LoadingIcon,{key:0,size:16})):(i(),a(V,{key:1},[ee(_(e.locale.submit),1)],64))],8,Ro)):k("v-if",!0)]),u("div",{ref:"gifPopupRef",class:P(["wl-gif-popup",{display:e.showGif}])},[u("input",{ref:"gifSearchInputRef",type:"text",placeholder:e.locale.gifSearchPlaceholder,onInput:n[4]||(n[4]=(...l)=>e.onGifSearch&&e.onGifSearch(...l))},null,40,So),e.searchResults.list.length?(i(),$(e.ImageWall,{key:0,items:e.searchResults.list,"column-width":200,gap:6,onInsert:n[5]||(n[5]=l=>e.insert(l)),onScroll:e.onImageWallScroll},null,8,["items"])):k("v-if",!0),e.searchResults.loading?(i(),a("div",jo,[W(e.LoadingIcon,{size:30})])):k("v-if",!0)],2),u("div",{ref:"emojiPopupRef",class:P(["wl-emoji-popup",{display:e.showEmoji}])},[(i(!0),a(V,null,O(e.emoji.tabs,(l,c)=>(i(),a(V,{key:l.name},[c===e.emojiTabIndex?(i(),a("div",Mo,[(i(!0),a(V,null,O(l.items,y=>(i(),a("button",{key:y,type:"button",title:y,onClick:I=>e.insert(`:${y}:`)},[e.showEmoji?(i(),a("img",{key:0,class:"wl-emoji",src:e.emoji.map[y],alt:y,loading:"lazy",referrerPolicy:"no-referrer"},null,8,zo)):k("v-if",!0)],8,Ao))),128))])):k("v-if",!0)],64))),128)),e.emoji.tabs.length>1?(i(),a("div",Uo,[(i(!0),a(V,null,O(e.emoji.tabs,(l,c)=>(i(),a("button",{key:l.name,type:"button",class:P(["wl-tab",{active:e.emojiTabIndex===c}]),onClick:y=>e.emojiTabIndex=c},[u("img",{class:"wl-emoji",src:l.icon,alt:l.name,title:l.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,To)],10,Vo))),128))])):k("v-if",!0)],2)])]),t.replyId||(h=t.edit)!=null&&h.objectId?(i(),a("button",{key:1,type:"button",class:"wl-close",title:e.locale.cancelReply,onClick:n[6]||(n[6]=l=>t.replyId?e.emit("cancelReply"):e.emit("cancelEdit"))},[W(e.CloseIcon,{size:24})],8,Ho)):k("v-if",!0)])}var dt=me(eo,[["render",Po],["__file","CommentBox.vue"]]),No=ue({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(o,{expose:n,emit:t}){n();const e=o,r=t,s=["approved","waiting","spam"],d=Ce("config"),h=Ge(),l=It(),c=pe(),y=U(()=>d.value.locale),I=U(()=>{const{link:S}=e.comment;return S?Ye(S)?S:`https://${S}`:""}),A=U(()=>h.value.includes(e.comment.objectId)),g=U(()=>Pn(new Date(e.comment.time),l.value,y.value)),R=U(()=>c.value.type==="administrator"),x=U(()=>e.comment.user_id&&c.value.objectId===e.comment.user_id),p=U(()=>{var S;return e.comment.objectId===((S=e.reply)==null?void 0:S.objectId)}),E=U(()=>{var S;return e.comment.objectId===((S=e.edit)==null?void 0:S.objectId)}),T={props:e,emit:r,commentStatus:s,config:d,likes:h,now:l,userInfo:c,locale:y,link:I,like:A,time:g,isAdmin:R,isOwner:x,isReplyingCurrent:p,isEditingCurrent:E,CommentBox:dt,get DeleteIcon(){return Vt},get EditIcon(){return Bt},get LikeIcon(){return Pt},get ReplyIcon(){return Dt},get VerifiedIcon(){return Ft}};return Object.defineProperty(T,"__isScriptSetup",{enumerable:!1,value:!0}),T}});const Wo=["id"],Do={class:"wl-user","aria-hidden":"true"},Bo=["src"],Fo={class:"wl-card"},Oo={class:"wl-head"},Go=["href"],qo={key:1,class:"wl-nick"},Ko=["textContent"],Zo=["textContent"],Xo=["textContent"],Yo=["textContent"],Jo=["textContent"],Qo={class:"wl-comment-actions"},$o=["title"],el=["title"],tl={class:"wl-meta","aria-hidden":"true"},nl=["data-value","textContent"],ol={key:0,class:"wl-content"},ll={key:0},il=["href"],al=u("span",null,": ",-1),rl=["innerHTML"],cl={key:1,class:"wl-admin-actions"},sl={class:"wl-comment-status"},dl=["disabled","onClick","textContent"],ul={key:3,class:"wl-quote"};function ml(o,n,t,e,r,s){var h;const d=kt("CommentCard",!0);return i(),a("div",{id:t.comment.objectId,class:"wl-card-item"},[u("div",Do,[t.comment.avatar?(i(),a("img",{key:0,class:"wl-user-avatar",src:t.comment.avatar},null,8,Bo)):k("v-if",!0),t.comment.type?(i(),$(e.VerifiedIcon,{key:1})):k("v-if",!0)]),u("div",Fo,[u("div",Oo,[e.link?(i(),a("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noopener noreferrer"},_(t.comment.nick),9,Go)):(i(),a("span",qo,_(t.comment.nick),1)),t.comment.type==="administrator"?(i(),a("span",{key:2,class:"wl-badge",textContent:_(e.locale.admin)},null,8,Ko)):k("v-if",!0),t.comment.label?(i(),a("span",{key:3,class:"wl-badge",textContent:_(t.comment.label)},null,8,Zo)):k("v-if",!0),t.comment.sticky?(i(),a("span",{key:4,class:"wl-badge",textContent:_(e.locale.sticky)},null,8,Xo)):k("v-if",!0),typeof t.comment.level=="number"?(i(),a("span",{key:5,class:P(`wl-badge level${t.comment.level}`),textContent:_(e.locale[`level${t.comment.level}`]||`Level ${t.comment.level}`)},null,10,Yo)):k("v-if",!0),u("span",{class:"wl-time",textContent:_(e.time)},null,8,Jo),u("div",Qo,[e.isAdmin||e.isOwner?(i(),a(V,{key:0},[u("button",{type:"button",class:"wl-edit",onClick:n[0]||(n[0]=l=>e.emit("edit",t.comment))},[W(e.EditIcon)]),u("button",{type:"button",class:"wl-delete",onClick:n[1]||(n[1]=l=>e.emit("delete",t.comment))},[W(e.DeleteIcon)])],64)):k("v-if",!0),u("button",{type:"button",class:"wl-like",title:e.like?e.locale.cancelLike:e.locale.like,onClick:n[2]||(n[2]=l=>e.emit("like",t.comment))},[W(e.LikeIcon,{active:e.like},null,8,["active"]),ee(" "+_("like"in t.comment?t.comment.like:""),1)],8,$o),u("button",{type:"button",class:P(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:n[3]||(n[3]=l=>e.emit("reply",e.isReplyingCurrent?null:t.comment))},[W(e.ReplyIcon)],10,el)])]),u("div",tl,[(i(),a(V,null,O(["addr","browser","os"],l=>(i(),a(V,null,[t.comment[l]?(i(),a("span",{key:l,class:P(`wl-${l}`),"data-value":t.comment[l],textContent:_(t.comment[l])},null,10,nl)):k("v-if",!0)],64))),64))]),e.isEditingCurrent?k("v-if",!0):(i(),a("div",ol,[t.comment.reply_user?(i(),a("p",ll,[u("a",{href:"#"+t.comment.pid},"@"+_(t.comment.reply_user.nick),9,il),al])):k("v-if",!0),u("div",{innerHTML:t.comment.comment},null,8,rl)])),e.isAdmin&&!e.isEditingCurrent?(i(),a("div",cl,[u("span",sl,[(i(),a(V,null,O(e.commentStatus,l=>u("button",{key:l,type:"submit",class:P(`wl-btn wl-${l}`),disabled:t.comment.status===l,onClick:c=>e.emit("status",{status:l,comment:t.comment}),textContent:_(e.locale[l])},null,10,dl)),64))]),e.isAdmin&&!("rid"in t.comment)?(i(),a("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:n[4]||(n[4]=l=>e.emit("sticky",t.comment))},_(t.comment.sticky?e.locale.unsticky:e.locale.sticky),1)):k("v-if",!0)])):k("v-if",!0),e.isReplyingCurrent||e.isEditingCurrent?(i(),a("div",{key:2,class:P({"wl-reply-wrapper":e.isReplyingCurrent,"wl-edit-wrapper":e.isEditingCurrent})},[W(e.CommentBox,{edit:t.edit,"reply-id":(h=t.reply)==null?void 0:h.objectId,"reply-user":t.comment.nick,"root-id":t.rootId,onLog:n[5]||(n[5]=l=>e.emit("log")),onCancelReply:n[6]||(n[6]=l=>e.emit("reply",null)),onCancelEdit:n[7]||(n[7]=l=>e.emit("edit",null)),onSubmit:n[8]||(n[8]=l=>e.emit("submit",l))},null,8,["edit","reply-id","reply-user","root-id"])],2)):k("v-if",!0),"children"in t.comment?(i(),a("div",ul,[(i(!0),a(V,null,O(t.comment.children,l=>(i(),$(d,{key:l.objectId,comment:l,reply:t.reply,edit:t.edit,"root-id":t.rootId,onLog:n[9]||(n[9]=c=>e.emit("log")),onDelete:n[10]||(n[10]=c=>e.emit("delete",c)),onEdit:n[11]||(n[11]=c=>e.emit("edit",c)),onLike:n[12]||(n[12]=c=>e.emit("like",c)),onReply:n[13]||(n[13]=c=>e.emit("reply",c)),onStatus:n[14]||(n[14]=c=>e.emit("status",c)),onSticky:n[15]||(n[15]=c=>e.emit("sticky",c)),onSubmit:n[16]||(n[16]=c=>e.emit("submit",c))},null,8,["comment","reply","edit","root-id"]))),128))])):k("v-if",!0)])],8,Wo)}var vl=me(No,[["render",ml],["__file","CommentCard.vue"]]);const ut="3.2.6";var gl=ue({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(o,{expose:n}){n();const t=o,e={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},r=Object.keys(e),s=pe(),d=Ge(),h=b("loading"),l=b(0),c=b(1),y=b(0),I=U(()=>Vn(t)),A=b(I.value.commentSorting),g=b([]),R=b(null),x=b(null),p=U(()=>Tn(I.value.dark)),E=U(()=>I.value.locale);Lt(p,{id:"waline-darkmode"});let T;const S=w=>{var L;const{serverURL:N,path:q,pageSize:z}=I.value,B=new AbortController;h.value="loading",T==null||T(),St({serverURL:N,lang:I.value.lang,path:q,pageSize:z,sortBy:e[A.value],page:w,signal:B.signal,token:(L=s.value)==null?void 0:L.token}).then(D=>{h.value="success",l.value=D.count,g.value.push(...D.data),c.value=w,y.value=D.totalPages}).catch(D=>{D.name!=="AbortError"&&(console.error(D.message),h.value="error")}),T=B.abort.bind(B)},G=()=>S(c.value+1),re=()=>{l.value=0,g.value=[],S(1)},ce=w=>{A.value!==w&&(A.value=w,re())},oe=w=>{R.value=w},H=w=>{x.value=w},ne=w=>{if(x.value)x.value.comment=w.comment,x.value.orig=w.orig;else if("rid"in w){const L=g.value.find(({objectId:N})=>N===w.rid);if(!L)return;Array.isArray(L.children)||(L.children=[]),L.children.push(w)}else g.value.unshift(w),l.value+=1},Z=async({comment:w,status:L})=>{var N;if(w.status===L)return;const{serverURL:q,lang:z}=I.value;await we({serverURL:q,lang:z,token:(N=s.value)==null?void 0:N.token,objectId:w.objectId,comment:{status:L}}),w.status=L},se=async w=>{var L;if("rid"in w)return;const{serverURL:N,lang:q}=I.value;await we({serverURL:N,lang:q,token:(L=s.value)==null?void 0:L.token,objectId:w.objectId,comment:{sticky:w.sticky?0:1}}),w.sticky=!w.sticky},X=async({objectId:w})=>{var L;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:N,lang:q}=I.value;await jt({serverURL:N,lang:q,token:(L=s.value)==null?void 0:L.token,objectId:w}),g.value.some((z,B)=>z.objectId===w?(g.value=g.value.filter((D,de)=>de!==B),!0):z.children.some((D,de)=>D.objectId===w?(g.value[B].children=z.children.filter((be,ke)=>ke!==de),!0):!1))},le=async w=>{var L;const{serverURL:N,lang:q}=I.value,{objectId:z}=w,B=d.value.includes(z);await we({serverURL:N,lang:q,objectId:z,token:(L=s.value)==null?void 0:L.token,comment:{like:!B}}),B?d.value=d.value.filter(D=>D!==z):(d.value=[...d.value,z],d.value.length>50&&(d.value=d.value.slice(-50))),w.like=(w.like||0)+(B?-1:1)};_t("config",I),he(()=>{Q(()=>[t.serverURL,t.path],()=>re(),{immediate:!0})}),He(()=>T==null?void 0:T());const Y={props:t,sortKeyMap:e,sortingMethods:r,userInfo:s,likeStorage:d,status:h,count:l,page:c,totalPages:y,config:I,commentSortingRef:A,data:g,reply:R,edit:x,darkmodeStyle:p,i18n:E,get abort(){return T},set abort(w){T=w},getCommentData:S,loadMore:G,refresh:re,onSortByChange:ce,onReply:oe,onEdit:H,onSubmit:ne,onStatusChange:Z,onSticky:se,onDelete:X,onLike:le,Reaction:dn,CommentBox:dt,CommentCard:vl,get LoadingIcon(){return ye},get version(){return ut}};return Object.defineProperty(Y,"__isScriptSetup",{enumerable:!1,value:!0}),Y}});const hl={"data-waline":""},fl={class:"wl-meta-head"},wl={class:"wl-count"},yl=["textContent"],bl={class:"wl-sort"},kl=["onClick"],_l={class:"wl-cards"},Cl={key:1,class:"wl-operation"},pl=["textContent"],Il={key:2,class:"wl-loading"},Ll=["textContent"],El={key:4,class:"wl-operation"},xl=["textContent"],Rl={key:5,class:"wl-power"},Sl=u("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);function jl(o,n,t,e,r,s){return i(),a("div",hl,[W(e.Reaction),e.reply?k("v-if",!0):(i(),$(e.CommentBox,{key:0,onLog:e.refresh,onSubmit:e.onSubmit})),u("div",fl,[u("div",wl,[e.count?(i(),a("span",{key:0,class:"wl-num",textContent:_(e.count)},null,8,yl)):k("v-if",!0),ee(" "+_(e.i18n.comment),1)]),u("ul",bl,[(i(!0),a(V,null,O(e.sortingMethods,d=>(i(),a("li",{key:d,class:P([d===e.commentSortingRef?"active":""]),onClick:h=>e.onSortByChange(d)},_(e.i18n[d]),11,kl))),128))])]),u("div",_l,[(i(!0),a(V,null,O(e.data,d=>(i(),$(e.CommentCard,{key:d.objectId,"root-id":d.objectId,comment:d,reply:e.reply,edit:e.edit,onLog:e.refresh,onReply:e.onReply,onEdit:e.onEdit,onSubmit:e.onSubmit,onStatus:e.onStatusChange,onDelete:e.onDelete,onSticky:e.onSticky,onLike:e.onLike},null,8,["root-id","comment","reply","edit"]))),128))]),e.status==="error"?(i(),a("div",Cl,[u("button",{type:"button",class:"wl-btn",onClick:e.refresh,textContent:_(e.i18n.refresh)},null,8,pl)])):e.status==="loading"?(i(),a("div",Il,[W(e.LoadingIcon,{size:30})])):e.data.length?e.page<e.totalPages?(i(),a("div",El,[u("button",{type:"button",class:"wl-btn",onClick:e.loadMore,textContent:_(e.i18n.more)},null,8,xl)])):k("v-if",!0):(i(),a("div",{key:3,class:"wl-empty",textContent:_(e.i18n.sofa)},null,8,Ll)),e.config.copyright?(i(),a("div",Rl,[ee(" Powered by "),Sl,ee(" v"+_(e.version),1)])):k("v-if",!0)])}var Ml=me(gl,[["render",jl],["__file","WalineComment.vue"]]);export{Ml as Waline,ut as version};
//# sourceMappingURL=component.js.map

@@ -1,2 +0,2 @@

const v="3.2.5",$={"Content-Type":"application/json"},h=e=>`${e.replace(/\/?$/,"/")}api/`,u=(e,t="")=>{if(typeof e=="object"&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},f=({serverURL:e,lang:t,paths:r,type:o,signal:a})=>fetch(`${h(e)}article?path=${encodeURIComponent(r.join(","))}&type=${encodeURIComponent(o.join(","))}&lang=${t}`,{signal:a}).then(n=>n.json()).then(n=>u(n,"Get counter").data),U=({serverURL:e,lang:t,path:r,type:o,action:a})=>fetch(`${h(e)}article?lang=${t}`,{method:"POST",headers:$,body:JSON.stringify({path:r,type:o,action:a})}).then(n=>n.json()).then(n=>u(n,"Update counter").data),R=({serverURL:e,lang:t,paths:r,signal:o})=>f({serverURL:e,lang:t,paths:r,type:["time"],signal:o}),w=e=>U({...e,type:"time",action:"inc"}),L=(e="")=>e.replace(/\/$/u,""),b=e=>/^(https?:)?\/\//.test(e),d=e=>{const t=L(e);return b(t)?t:`https://${t}`},j=e=>{e.name!=="AbortError"&&console.error(e.message)},m=e=>{const{path:t}=e.dataset;return t!=null&&t.length?t:null},y=(e,t)=>{t.forEach((r,o)=>{const a=e[o].time;typeof a=="number"&&(r.innerText=a.toString())})},S=({serverURL:e,path:t=window.location.pathname,selector:r=".waline-pageview-count",update:o=!0,lang:a=navigator.language})=>{const n=new AbortController,i=Array.from(document.querySelectorAll(r)),p=l=>{const s=m(l);return s!==null&&t!==s},g=l=>R({serverURL:d(e),paths:l.map(s=>m(s)??t),lang:a,signal:n.signal}).then(s=>y(s,l)).catch(j);if(o){const l=i.filter(c=>!p(c)),s=i.filter(p);w({serverURL:d(e),path:t,lang:a}).then(c=>y(c,l)),s.length&&g(s)}else g(i);return n.abort.bind(n)};export{S as pageviewCount,v as version};
const v="3.2.6",$={"Content-Type":"application/json"},h=e=>`${e.replace(/\/?$/,"/")}api/`,u=(e,t="")=>{if(typeof e=="object"&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},f=({serverURL:e,lang:t,paths:r,type:o,signal:a})=>fetch(`${h(e)}article?path=${encodeURIComponent(r.join(","))}&type=${encodeURIComponent(o.join(","))}&lang=${t}`,{signal:a}).then(n=>n.json()).then(n=>u(n,"Get counter").data),U=({serverURL:e,lang:t,path:r,type:o,action:a})=>fetch(`${h(e)}article?lang=${t}`,{method:"POST",headers:$,body:JSON.stringify({path:r,type:o,action:a})}).then(n=>n.json()).then(n=>u(n,"Update counter").data),R=({serverURL:e,lang:t,paths:r,signal:o})=>f({serverURL:e,lang:t,paths:r,type:["time"],signal:o}),w=e=>U({...e,type:"time",action:"inc"}),L=(e="")=>e.replace(/\/$/u,""),b=e=>/^(https?:)?\/\//.test(e),d=e=>{const t=L(e);return b(t)?t:`https://${t}`},j=e=>{e.name!=="AbortError"&&console.error(e.message)},m=e=>{const{path:t}=e.dataset;return t!=null&&t.length?t:null},y=(e,t)=>{t.forEach((r,o)=>{const a=e[o].time;typeof a=="number"&&(r.innerText=a.toString())})},S=({serverURL:e,path:t=window.location.pathname,selector:r=".waline-pageview-count",update:o=!0,lang:a=navigator.language})=>{const n=new AbortController,i=Array.from(document.querySelectorAll(r)),p=l=>{const s=m(l);return s!==null&&t!==s},g=l=>R({serverURL:d(e),paths:l.map(s=>m(s)??t),lang:a,signal:n.signal}).then(s=>y(s,l)).catch(j);if(o){const l=i.filter(c=>!p(c)),s=i.filter(p);w({serverURL:d(e),path:t,lang:a}).then(c=>y(c,l)),s.length&&g(s)}else g(i);return n.abort.bind(n)};export{S as pageviewCount,v as version};
//# sourceMappingURL=pageview.js.map

@@ -1,2 +0,2 @@

import{fetchCommentCount as Et,getArticleCounter as St,updateArticleCounter as We,updateComment as fe,addComment as xt,login as jt,getComment as Mt,deleteComment as At,updatePageview as Ut,getPageview as zt,getRecentComment as Tt,getUserList as Vt}from"@waline/api";export*from"@waline/api";import{h as C,defineComponent as me,inject as Re,ref as p,computed as T,onMounted as we,watch as Q,onUnmounted as Be,openBlock as c,createElementBlock as d,createElementVNode as m,toDisplayString as L,Fragment as V,renderList as O,normalizeClass as P,createBlock as $,createCommentVNode as k,onBeforeUnmount as Ht,nextTick as Fe,normalizeStyle as Oe,reactive as Ee,createVNode as D,withDirectives as ye,vModelDynamic as Pt,vModelText as Nt,vShow as qe,createTextVNode as ee,resolveComponent as Dt,provide as Wt,createApp as Bt,watchEffect as Ge}from"vue";import{useStorage as ie,useScriptTag as Ft,useDebounceFn as Ot,useEventListener as Ke,useNow as qt,useStyleTag as Gt}from"@vueuse/core";import Ze from"autosize";import{Marked as Kt}from"marked";import{markedHighlight as Zt}from"marked-highlight";import{load as Xt}from"recaptcha-v3";const Yt=["nick","mail","link"],Xe=n=>n.filter(o=>Yt.includes(o)),Ye=["//unpkg.com/@waline/emojis@1.1.0/weibo"],Jt=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],Qt=n=>new Promise((o,t)=>{if(n.size>128e3)return t(new Error("File too large! File size limit 128KB"));const e=new FileReader;e.readAsDataURL(n),e.onload=()=>{var i;return o(((i=e.result)==null?void 0:i.toString())??"")},e.onerror=t}),$t=n=>n===!0?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',en=n=>{const o=async(t,e={})=>fetch(`https://api.giphy.com/v1/gifs/${t}?${new URLSearchParams({lang:n,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...e}).toString()}`).then(i=>i.json()).then(({data:i})=>i.map(s=>({title:s.title,src:s.images.downsized_medium.url})));return{search:t=>o("search",{q:t,offset:"0"}),default:()=>o("trending",{}),more:(t,e=0)=>o("search",{q:t,offset:e.toString()})}},tn=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,nn=/</,on=/(?:^|\s)\/\/(.+?)$/gm,ln=/\/\*([\S\s]*?)\*\//gm,an=new RegExp(`(${tn.source}|${nn.source})|((?:${on.source})|(?:${ln.source}))`,"gmi"),Je=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],Se={},rn=n=>{let o=0;return n.replace(an,(t,e,i)=>{if(i)return`<span style="color: slategray">${i}</span>`;if(e==="<")return"&lt;";let s;Se[e]?s=Se[e]:(s=Je[o],Se[e]=s);const r=`<span style="color: #${s}">${e}</span>`;return o=++o%Je.length,r})},sn=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],te=n=>Object.fromEntries(n.map((o,t)=>[sn[t],o]));var Qe=te(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words!
import{fetchCommentCount as Et,getArticleCounter as St,updateArticleCounter as We,updateComment as fe,addComment as xt,login as jt,getComment as Mt,deleteComment as At,updatePageview as Ut,getPageview as zt,getRecentComment as Tt,getUserList as Vt}from"@waline/api";export*from"@waline/api";import{h as C,defineComponent as me,inject as Re,ref as p,computed as T,onMounted as we,watch as Q,onUnmounted as Be,openBlock as c,createElementBlock as d,createElementVNode as m,toDisplayString as I,Fragment as V,renderList as O,normalizeClass as P,createBlock as $,createCommentVNode as k,onBeforeUnmount as Ht,nextTick as Fe,normalizeStyle as Oe,reactive as Ee,createVNode as D,withDirectives as ye,vModelDynamic as Pt,vModelText as Nt,vShow as qe,createTextVNode as ee,resolveComponent as Dt,provide as Wt,createApp as Bt,watchEffect as Ge}from"vue";import{useStorage as ie,useScriptTag as Ft,useDebounceFn as Ot,useEventListener as Ke,useNow as qt,useStyleTag as Gt}from"@vueuse/core";import Ze from"autosize";import{Marked as Kt}from"marked";import{markedHighlight as Zt}from"marked-highlight";import{load as Xt}from"recaptcha-v3";const Yt=["nick","mail","link"],Xe=n=>n.filter(o=>Yt.includes(o)),Ye=["//unpkg.com/@waline/emojis@1.1.0/weibo"],Jt=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],Qt=n=>new Promise((o,t)=>{if(n.size>128e3)return t(new Error("File too large! File size limit 128KB"));const e=new FileReader;e.readAsDataURL(n),e.onload=()=>{var i;return o(((i=e.result)==null?void 0:i.toString())??"")},e.onerror=t}),$t=n=>n===!0?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',en=n=>{const o=async(t,e={})=>fetch(`https://api.giphy.com/v1/gifs/${t}?${new URLSearchParams({lang:n,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...e}).toString()}`).then(i=>i.json()).then(({data:i})=>i.map(s=>({title:s.title,src:s.images.downsized_medium.url})));return{search:t=>o("search",{q:t,offset:"0"}),default:()=>o("trending",{}),more:(t,e=0)=>o("search",{q:t,offset:e.toString()})}},tn=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,nn=/</,on=/(?:^|\s)\/\/(.+?)$/gm,ln=/\/\*([\S\s]*?)\*\//gm,an=new RegExp(`(${tn.source}|${nn.source})|((?:${on.source})|(?:${ln.source}))`,"gmi"),Je=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],Se={},rn=n=>{let o=0;return n.replace(an,(t,e,i)=>{if(i)return`<span style="color: slategray">${i}</span>`;if(e==="<")return"&lt;";let s;Se[e]?s=Se[e]:(s=Je[o],Se[e]=s);const r=`<span style="color: #${s}">${e}</span>`;return o=++o%Je.length,r})},sn=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],te=n=>Object.fromEntries(n.map((o,t)=>[sn[t],o]));var Qe=te(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words!
Current word number: $2`,"Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest","What do you think?"]),$e=te(["Pseudo","Le pseudo ne peut pas faire moins de 3 octets.","E-mail","Veuillez confirmer votre adresse e-mail.","Site Web","Optionnel","Commentez ici...","Aucun commentaire pour l'instant.","Envoyer","J'aime","Annuler le j'aime","Répondre","Annuler la réponse","Commentaires","Actualiser","Charger plus...","Aperçu","Emoji","Télécharger une image","Il y a quelques secondes","Il y a quelques minutes","Il y a quelques heures","Il y a quelques jours","À l'instant","Téléchargement en cours","Connexion","Déconnexion","Admin","Épinglé","Mots",`Veuillez saisir des commentaires entre $0 et $1 mots !

@@ -9,4 +9,4 @@ Nombre actuel de mots : $2`,"Anonyme","Nains","Hobbits","Ents","Mages","Elfes","Maïar","GIF","Rechercher un GIF","Profil","Approuvé","En attente","Indésirable","Détacher","Le plus ancien","Dernier","Le plus populaire","Qu'en pensez-vous ?"]),et=te(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません!

当前字数:$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),un=te(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎留言","來發留言吧~","送出","喜歡","取消喜歡","回覆","取消回覆","留言","重整","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登入","登出","管理者","置頂","字",`留言字數應在 $0 到 $1 字之間!
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const lt="en-US",be={zh:ot,"zh-cn":ot,"zh-tw":un,en:Qe,"en-us":Qe,fr:$e,"fr-fr":$e,jp:et,"jp-jp":et,"pt-br":cn,ru:tt,"ru-ru":tt,vi:nt,"vi-vn":nt},at=n=>be[n.toLowerCase()]||be[lt],dn=n=>Object.keys(be).includes(n.toLowerCase())?n:lt,it=n=>{try{n=decodeURI(n)}catch{}return n},rt=(n="")=>n.replace(/\/$/u,""),st=n=>/^(https?:)?\/\//.test(n),pe=n=>{const o=rt(n);return st(o)?o:`https://${o}`},mn=n=>Array.isArray(n)?n:n?[0,n]:!1,xe=(n,o)=>typeof n=="function"?n:n===!1?!1:o,vn=({serverURL:n,path:o=location.pathname,lang:t=typeof navigator>"u"?"en-US":navigator.language,locale:e,emoji:i=Ye,meta:s=["nick","mail","link"],requiredMeta:r=[],dark:u=!1,pageSize:l=10,wordLimit:a,imageUploader:g,highlighter:b,texRenderer:j,copyright:f=!0,login:S="enable",search:R,reaction:_,recaptchaV3Key:I="",turnstileKey:M="",commentSorting:x="latest",...q})=>({serverURL:pe(n),path:it(o),lang:dn(t),locale:{...at(t),...typeof e=="object"?e:{}},wordLimit:mn(a),meta:Xe(s),requiredMeta:Xe(r),imageUploader:xe(g,Qt),highlighter:xe(b,rn),texRenderer:xe(j,$t),dark:u,emoji:typeof i=="boolean"?i?Ye:[]:i,pageSize:l,login:S,copyright:f,search:R===!1?!1:typeof R=="object"?R:en(t),recaptchaV3Key:I,turnstileKey:M,reaction:Array.isArray(_)?_:_===!0?Jt:[],commentSorting:x,...q}),re=n=>typeof n=="string",je="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bg-color:#1e1e1e;--waline-bg-color-light:#272727;--waline-bg-color-hover: #444;--waline-border-color:#333;--waline-disable-bg-color:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bg-color:#272727;--waline-info-color:#666}",gn=n=>re(n)?n==="auto"?`@media(prefers-color-scheme:dark){body${je}}`:`${n}${je}`:n===!0?`:root${je}`:"",Me=(n,o)=>{let t=n.toString();for(;t.length<o;)t="0"+t;return t},hn=n=>{const o=Me(n.getDate(),2),t=Me(n.getMonth()+1,2);return`${Me(n.getFullYear(),2)}-${t}-${o}`},fn=(n,o,t)=>{if(!n)return"";const e=re(n)?new Date(n.indexOf(" ")!==-1?n.replace(/-/g,"/"):n):n,i=o.getTime()-e.getTime(),s=Math.floor(i/(24*3600*1e3));if(s===0){const r=i%864e5,u=Math.floor(r/(3600*1e3));if(u===0){const l=r%36e5,a=Math.floor(l/(60*1e3));if(a===0){const g=l%6e4;return`${Math.round(g/1e3)} ${t.seconds}`}return`${a} ${t.minutes}`}return`${u} ${t.hours}`}return s<0?t.now:s<8?`${s} ${t.days}`:hn(e)},wn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yn=n=>wn.test(n),bn=n=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(n),pn=n=>{const o=ie("WALINE_EMOJI",{}),t=bn(n);if(t){const e=o.value[n];if(e)return Promise.resolve(e)}return fetch(`${n}/info.json`).then(e=>e.json()).then(e=>{const i={folder:n,...e};return t&&(o.value[n]=i),i})},ct=(n,o="",t="",e="")=>`${o?`${o}/`:""}${t}${n}${e?`.${e}`:""}`,kn=n=>Promise.all(n.map(o=>re(o)?pn(rt(o)):Promise.resolve(o))).then(o=>{const t={tabs:[],map:{}};return o.forEach(e=>{const{name:i,folder:s,icon:r,prefix:u="",type:l,items:a}=e;t.tabs.push({name:i,icon:ct(r,s,u,l),items:a.map(g=>{const b=`${u}${g}`;return t.map[b]=ct(g,s,u,l),b})})}),t}),ut=n=>{n.name!=="AbortError"&&console.error(n.message)},Ae=n=>n instanceof HTMLElement?n:re(n)?document.querySelector(n):null,_n=n=>n.type.includes("image"),dt=n=>{const o=Array.from(n).find(_n);return o?o.getAsFile():null},Cn=/\$.*?\$/,Ln=/^\$(.*?)\$/,In=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Rn=n=>[{name:"blockMath",level:"block",tokenizer(o){const t=In.exec(o);if(t!==null)return{type:"html",raw:t[0],text:n(!0,t[1])}}},{name:"inlineMath",level:"inline",start(o){const t=o.search(Cn);return t!==-1?t:o.length},tokenizer(o){const t=Ln.exec(o);if(t!==null)return{type:"html",raw:t[0],text:n(!1,t[1])}}}],mt=(n="",o={})=>n.replace(/:(.+?):/g,(t,e)=>o[e]?`<img class="wl-emoji" src="${o[e]}" alt="${e}">`:t),En=(n,{emojiMap:o,highlighter:t,texRenderer:e})=>{const i=new Kt;if(i.setOptions({breaks:!0}),t&&i.use(Zt({highlight:t})),e){const s=Rn(e);i.use({extensions:s})}return i.parse(mt(n,o))},Ue=n=>{const{path:o}=n.dataset;return o!=null&&o.length?o:null},Sn=n=>n.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),xn=n=>n.match(/[\u4E00-\u9FD5]/gu),jn=n=>{var o,t;return(((o=Sn(n))==null?void 0:o.reduce((e,i)=>e+(["",",","."].includes(i.trim())?0:i.trim().split(/\s+/u).length),0))??0)+(((t=xn(n))==null?void 0:t.length)??0)},Mn=async()=>{if(!navigator)return"";const{userAgentData:n}=navigator;let o=navigator.userAgent;if(!n||n.platform!=="Windows")return o;const{platformVersion:t}=await n.getHighEntropyValues(["platformVersion"]);return t&&parseInt(t.split(".")[0])>=13&&(o=o.replace("Windows NT 10.0","Windows NT 11.0")),o},vt=({serverURL:n,path:o=window.location.pathname,selector:t=".waline-comment-count",lang:e=navigator.language})=>{const i=new AbortController,s=document.querySelectorAll(t);return s.length&&Et({serverURL:pe(n),paths:Array.from(s).map(r=>it(Ue(r)??o)),lang:e,signal:i.signal}).then(r=>{s.forEach((u,l)=>{u.innerText=r[l].toString()})}).catch(ut),i.abort.bind(i)},An=({size:n})=>C("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:n,height:n},[C("path",{d:"M697.173 85.333h-369.92c-144.64 0-241.92 101.547-241.92 252.587v348.587c0 150.613 97.28 252.16 241.92 252.16h369.92c144.64 0 241.494-101.547 241.494-252.16V337.92c0-151.04-96.854-252.587-241.494-252.587z",fill:"currentColor"}),C("path",{d:"m640.683 587.52-75.947-75.861 75.904-75.862a37.29 37.29 0 0 0 0-52.778 37.205 37.205 0 0 0-52.779 0l-75.946 75.818-75.862-75.946a37.419 37.419 0 0 0-52.821 0 37.419 37.419 0 0 0 0 52.821l75.947 75.947-75.776 75.733a37.29 37.29 0 1 0 52.778 52.821l75.776-75.776 75.947 75.947a37.376 37.376 0 0 0 52.779-52.821z",fill:"#888"})]),Un=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),zn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"M563.2 463.3 677 540c1.7 1.2 3.7 1.8 5.8 1.8.7 0 1.4-.1 2-.2 2.7-.5 5.1-2.1 6.6-4.4l25.3-37.8c1.5-2.3 2.1-5.1 1.6-7.8s-2.1-5.1-4.4-6.6l-73.6-49.1 73.6-49.1c2.3-1.5 3.9-3.9 4.4-6.6.5-2.7 0-5.5-1.6-7.8l-25.3-37.8a10.1 10.1 0 0 0-6.6-4.4c-.7-.1-1.3-.2-2-.2-2.1 0-4.1.6-5.8 1.8l-113.8 76.6c-9.2 6.2-14.7 16.4-14.7 27.5.1 11 5.5 21.3 14.7 27.4zM387 348.8h-45.5c-5.7 0-10.4 4.7-10.4 10.4v153.3c0 5.7 4.7 10.4 10.4 10.4H387c5.7 0 10.4-4.7 10.4-10.4V359.2c0-5.7-4.7-10.4-10.4-10.4zm333.8 241.3-41-20a10.3 10.3 0 0 0-8.1-.5c-2.6.9-4.8 2.9-5.9 5.4-30.1 64.9-93.1 109.1-164.4 115.2-5.7.5-9.9 5.5-9.5 11.2l3.9 45.5c.5 5.3 5 9.5 10.3 9.5h.9c94.8-8 178.5-66.5 218.6-152.7 2.4-5 .3-11.2-4.8-13.6zm186-186.1c-11.9-42-30.5-81.4-55.2-117.1-24.1-34.9-53.5-65.6-87.5-91.2-33.9-25.6-71.5-45.5-111.6-59.2-41.2-14-84.1-21.1-127.8-21.1h-1.2c-75.4 0-148.8 21.4-212.5 61.7-63.7 40.3-114.3 97.6-146.5 165.8-32.2 68.1-44.3 143.6-35.1 218.4 9.3 74.8 39.4 145 87.3 203.3.1.2.3.3.4.5l36.2 38.4c1.1 1.2 2.5 2.1 3.9 2.6 73.3 66.7 168.2 103.5 267.5 103.5 73.3 0 145.2-20.3 207.7-58.7 37.3-22.9 70.3-51.5 98.1-85 27.1-32.7 48.7-69.5 64.2-109.1 15.5-39.7 24.4-81.3 26.6-123.8 2.4-43.6-2.5-87-14.5-129zm-60.5 181.1c-8.3 37-22.8 72-43 104-19.7 31.1-44.3 58.6-73.1 81.7-28.8 23.1-61 41-95.7 53.4-35.6 12.7-72.9 19.1-110.9 19.1-82.6 0-161.7-30.6-222.8-86.2l-34.1-35.8c-23.9-29.3-42.4-62.2-55.1-97.7-12.4-34.7-18.8-71-19.2-107.9-.4-36.9 5.4-73.3 17.1-108.2 12-35.8 30-69.2 53.4-99.1 31.7-40.4 71.1-72 117.2-94.1 44.5-21.3 94-32.6 143.4-32.6 49.3 0 97 10.8 141.8 32 34.3 16.3 65.3 38.1 92 64.8 26.1 26 47.5 56 63.6 89.2 16.2 33.2 26.6 68.5 31 105.1 4.6 37.5 2.7 75.3-5.6 112.3z",fill:"currentColor"})),Tn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[C("path",{d:"M784 112H240c-88 0-160 72-160 160v480c0 88 72 160 160 160h544c88 0 160-72 160-160V272c0-88-72-160-160-160zm96 640c0 52.8-43.2 96-96 96H240c-52.8 0-96-43.2-96-96V272c0-52.8 43.2-96 96-96h544c52.8 0 96 43.2 96 96v480z",fill:"currentColor"}),C("path",{d:"M352 480c52.8 0 96-43.2 96-96s-43.2-96-96-96-96 43.2-96 96 43.2 96 96 96zm0-128c17.6 0 32 14.4 32 32s-14.4 32-32 32-32-14.4-32-32 14.4-32 32-32zm462.4 379.2-3.2-3.2-177.6-177.6c-25.6-25.6-65.6-25.6-91.2 0l-80 80-36.8-36.8c-25.6-25.6-65.6-25.6-91.2 0L200 728c-4.8 6.4-8 14.4-8 24 0 17.6 14.4 32 32 32 9.6 0 16-3.2 22.4-9.6L380.8 640l134.4 134.4c6.4 6.4 14.4 9.6 24 9.6 17.6 0 32-14.4 32-32 0-9.6-4.8-17.6-9.6-24l-52.8-52.8 80-80L769.6 776c6.4 4.8 12.8 8 20.8 8 17.6 0 32-14.4 32-32 0-8-3.2-16-8-20.8z",fill:"currentColor"})]),Vn=({active:n=!1})=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[C("path",{d:`M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z${n?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"}`,fill:n?"red":"currentColor"})]),Hn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[C("path",{d:"M710.816 654.301c70.323-96.639 61.084-230.578-23.705-314.843-46.098-46.098-107.183-71.109-172.28-71.109-65.008 0-126.092 25.444-172.28 71.109-45.227 46.098-70.756 107.183-70.756 172.106 0 64.923 25.444 126.007 71.194 172.106 46.099 46.098 107.184 71.109 172.28 71.109 51.414 0 100.648-16.212 142.824-47.404l126.53 126.006c7.058 7.06 16.297 10.979 26.406 10.979 10.105 0 19.343-3.919 26.402-10.979 14.467-14.467 14.467-38.172 0-52.723L710.816 654.301zm-315.107-23.265c-65.88-65.88-65.88-172.54 0-238.42 32.069-32.07 74.245-49.149 119.471-49.149 45.227 0 87.407 17.603 119.472 49.149 65.88 65.879 65.88 172.539 0 238.42-63.612 63.178-175.242 63.178-238.943 0zm0 0",fill:"currentColor"}),C("path",{d:"M703.319 121.603H321.03c-109.8 0-199.469 89.146-199.469 199.38v382.034c0 109.796 89.236 199.38 199.469 199.38h207.397c20.653 0 37.384-16.645 37.384-37.299 0-20.649-16.731-37.296-37.384-37.296H321.03c-68.582 0-124.352-55.77-124.352-124.267V321.421c0-68.496 55.77-124.267 124.352-124.267h382.289c68.582 0 124.352 55.771 124.352 124.267V524.72c0 20.654 16.736 37.299 37.385 37.299 20.654 0 37.384-16.645 37.384-37.299V320.549c-.085-109.8-89.321-198.946-199.121-198.946zm0 0",fill:"currentColor"})]),Pn=()=>C("svg",{width:"16",height:"16",ariaHidden:"true"},C("path",{d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",fill:"currentColor"})),Nn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),Dn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),Wn=()=>C("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},C("path",{d:"m894.4 461.56-54.4-63.2c-10.4-12-18.8-34.4-18.8-50.4v-68c0-42.4-34.8-77.2-77.2-77.2h-68c-15.6 0-38.4-8.4-50.4-18.8l-63.2-54.4c-27.6-23.6-72.8-23.6-100.8 0l-62.8 54.8c-12 10-34.8 18.4-50.4 18.4h-69.2c-42.4 0-77.2 34.8-77.2 77.2v68.4c0 15.6-8.4 38-18.4 50l-54 63.6c-23.2 27.6-23.2 72.4 0 100l54 63.6c10 12 18.4 34.4 18.4 50v68.4c0 42.4 34.8 77.2 77.2 77.2h69.2c15.6 0 38.4 8.4 50.4 18.8l63.2 54.4c27.6 23.6 72.8 23.6 100.8 0l63.2-54.4c12-10.4 34.4-18.8 50.4-18.8h68c42.4 0 77.2-34.8 77.2-77.2v-68c0-15.6 8.4-38.4 18.8-50.4l54.4-63.2c23.2-27.6 23.2-73.2-.4-100.8zm-216-25.2-193.2 193.2a30 30 0 0 1-42.4 0l-96.8-96.8a30.16 30.16 0 0 1 0-42.4c11.6-11.6 30.8-11.6 42.4 0l75.6 75.6 172-172c11.6-11.6 30.8-11.6 42.4 0 11.6 11.6 11.6 30.8 0 42.4z",fill:"#27ae60"})),ke=({size:n=100})=>C("svg",{width:n,height:n,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},C("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},C("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Bn=()=>C("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[C("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),C("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})]),Fn=()=>ie("WALINE_USER_META",{nick:"",mail:"",link:""}),On=()=>ie("WALINE_COMMENT_BOX_EDITOR",""),qn="WALINE_LIKE";let gt=null;const ht=()=>gt??(gt=ie(qn,[])),Gn="WALINE_REACTION";let ft=null;const Kn=()=>ft??(ft=ie(Gn,{})),wt={},Zn=n=>{const o=wt[n]??(wt[n]=Xt(n,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:t=>o.then(e=>e.execute(t))}},Xn=n=>({execute:async o=>{const{load:t}=Ft("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await t();const e=window==null?void 0:window.turnstile;return new Promise(i=>{e==null||e.ready(()=>{e==null||e.render(".wl-captcha-container",{sitekey:n,action:o,size:"compact",callback:i})})})}}),Yn="WALINE_USER";let yt=null;const _e=()=>yt??(yt=ie(Yn,{}));var Jn=me({__name:"ArticleReaction",setup(n,{expose:o}){o();const t=Kn(),e=Re("config"),i=p(-1),s=p([]),r=T(()=>e.value.locale),u=T(()=>e.value.reaction.length>0),l=T(()=>{const{reaction:f,path:S}=e.value;return f.map((R,_)=>({icon:R,desc:r.value[`reaction${_}`],active:t.value[S]===_}))});let a;const g=async()=>{if(!u.value)return;const{serverURL:f,lang:S,path:R,reaction:_}=e.value,I=new AbortController;a=I.abort.bind(I);const M=await St({serverURL:f,lang:S,paths:[R],type:_.map((x,q)=>`reaction${q}`),signal:I.signal});s.value=_.map((x,q)=>M[0][`reaction${q}`])},b=async f=>{if(i.value===-1){const{serverURL:S,lang:R,path:_}=e.value,I=t.value[_];i.value=f,I!==void 0&&(await We({serverURL:S,lang:R,path:_,type:`reaction${I}`,action:"desc"}),s.value[I]=Math.max(s.value[I]-1,0)),I!==f&&(await We({serverURL:S,lang:R,path:_,type:`reaction${f}`}),s.value[f]=(s.value[f]||0)+1),I===f?delete t.value[_]:t.value[_]=f,i.value=-1}};we(()=>{Q(()=>[e.value.serverURL,e.value.path],()=>{g()},{immediate:!0})}),Be(()=>a==null?void 0:a());const j={reactionStorage:t,config:e,votingIndex:i,voteNumbers:s,locale:r,isReactionEnabled:u,reactionsInfo:l,get abort(){return a},set abort(f){a=f},fetchReaction:g,vote:b,get LoadingIcon(){return ke}};return Object.defineProperty(j,"__isScriptSetup",{enumerable:!1,value:!0}),j}}),ve=(n,o)=>{const t=n.__vccOpts||n;for(const[e,i]of o)t[e]=i;return t};const Qn={key:0,class:"wl-reaction"},$n=["textContent"],eo={class:"wl-reaction-list"},to=["onClick"],no={class:"wl-reaction-img"},oo=["src","alt"],lo=["textContent"],ao=["textContent"];function io(n,o,t,e,i,s){return e.reactionsInfo.length?(c(),d("div",Qn,[m("div",{class:"wl-reaction-title",textContent:L(e.locale.reactionTitle)},null,8,$n),m("ul",eo,[(c(!0),d(V,null,O(e.reactionsInfo,({active:r,icon:u,desc:l},a)=>(c(),d("li",{key:a,class:P(["wl-reaction-item",{active:r}]),onClick:g=>e.vote(a)},[m("div",no,[m("img",{src:u,alt:l},null,8,oo),e.votingIndex===a?(c(),$(e.LoadingIcon,{key:0,class:"wl-reaction-loading"})):(c(),d("div",{key:1,class:"wl-reaction-votes",textContent:L(e.voteNumbers[a]||0)},null,8,lo))]),m("div",{class:"wl-reaction-text",textContent:L(l)},null,8,ao)],10,to))),128))])])):k("v-if",!0)}var ro=ve(Jn,[["render",io],["__file","ArticleReaction.vue"]]),so=me({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(n,{expose:o}){const t=n;o();let e=null;const i=p(null),s=p({}),r=p([]),u=()=>{const f=Math.floor((i.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return f>0?f:1},l=f=>new Array(f).fill(null).map(()=>[]),a=async f=>{var S;if(f>=t.items.length)return;await Fe();const R=Array.from(((S=i.value)==null?void 0:S.children)??[]).reduce((_,I)=>I.getBoundingClientRect().height<_.getBoundingClientRect().height?I:_);r.value[Number(R.dataset.index)].push(f),await a(f+1)},g=async(f=!1)=>{if(r.value.length===u()&&!f)return;r.value=l(u());const S=window.scrollY;await a(0),window.scrollTo({top:S})},b=f=>{s.value[f.target.src]=!0};we(()=>{g(!0),e=new ResizeObserver(()=>{g()}),e.observe(i.value),Q(()=>[t.items],()=>{s.value={},g(!0)}),Q(()=>[t.columnWidth,t.gap],()=>{g()})}),Ht(()=>e.unobserve(i.value));const j={props:t,get resizeObserver(){return e},set resizeObserver(f){e=f},wall:i,state:s,columns:r,getColumnCount:u,createColumns:l,fillColumns:a,redraw:g,imageLoad:b,get LoadingIcon(){return ke}};return Object.defineProperty(j,"__isScriptSetup",{enumerable:!1,value:!0}),j}});const co=["data-index"],uo=["src","title","onClick"];function mo(n,o,t,e,i,s){return c(),d("div",{ref:"wall",class:"wl-gallery",style:Oe({gap:`${t.gap}px`})},[(c(!0),d(V,null,O(e.columns,(r,u)=>(c(),d("div",{key:u,class:"wl-gallery-column","data-index":u,style:Oe({gap:`${t.gap}px`})},[(c(!0),d(V,null,O(r,l=>(c(),d(V,{key:l},[e.state[t.items[l].src]?k("v-if",!0):(c(),$(e.LoadingIcon,{key:0,size:36,style:{margin:"20px auto"}})),m("img",{class:"wl-gallery-item",src:t.items[l].src,title:t.items[l].title,loading:"lazy",onLoad:e.imageLoad,onClick:a=>n.$emit("insert",`![](${t.items[l].src})`)},null,40,uo)],64))),128))],12,co))),128))],4)}var vo=ve(so,[["render",mo],["__file","ImageWall.vue"]]),go=me({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(n,{expose:o,emit:t}){o();const e=n,i=t,s=Re("config"),r=On(),u=Fn(),l=_e(),a=p({}),g=p(null),b=p(null),j=p(null),f=p(null),S=p(null),R=p(null),_=p(null),I=p({tabs:[],map:{}}),M=p(0),x=p(!1),q=p(!1),se=p(!1),ce=p(""),oe=p(0),H=Ee({loading:!0,list:[]}),ne=p(0),Z=p(!1),ue=p(""),X=p(!1),le=p(!1),Y=T(()=>s.value.locale),y=T(()=>{var v;return!!((v=l.value)!=null&&v.token)}),E=T(()=>s.value.imageUploader!==!1),N=v=>{const h=g.value,w=h.selectionStart,A=h.selectionEnd||0,F=h.scrollTop;r.value=h.value.substring(0,w)+v+h.value.substring(A,h.value.length),h.focus(),h.selectionStart=w+v.length,h.selectionEnd=w+v.length,h.scrollTop=F},G=v=>{const h=v.key;(v.ctrlKey||v.metaKey)&&h==="Enter"&&Ce()},z=v=>{const h=`![${s.value.locale.uploading} ${v.name}]()`;return N(h),X.value=!0,Promise.resolve().then(()=>s.value.imageUploader(v)).then(w=>{r.value=r.value.replace(h,`\r
![${v.name}](${w})`)}).catch(w=>{alert(w.message),r.value=r.value.replace(h,"")}).then(()=>{X.value=!1})},B=v=>{var h;if((h=v.dataTransfer)!=null&&h.items){const w=dt(v.dataTransfer.items);w&&E.value&&(z(w),v.preventDefault())}},W=v=>{if(v.clipboardData){const h=dt(v.clipboardData.items);h&&E.value&&z(h)}},de=()=>{const v=b.value;v.files&&E.value&&z(v.files[0]).then(()=>{v.value=""})},Ce=async()=>{var v,h,w,A,F,ae;const{serverURL:K,lang:J,login:ge,wordLimit:He,requiredMeta:Pe,recaptchaV3Key:Ne,turnstileKey:De}=s.value,Rt=await Mn(),U={comment:ue.value,nick:u.value.nick,mail:u.value.mail,link:u.value.link,url:s.value.path,ua:Rt};if((v=l.value)!=null&&v.token&&!e.edit)U.nick=l.value.display_name,U.mail=l.value.email,U.link=l.value.url;else{if(ge==="force")return;if(Pe.indexOf("nick")>-1&&!U.nick)return(h=a.value.nick)==null||h.focus(),alert(Y.value.nickError);if(Pe.indexOf("mail")>-1&&!U.mail||U.mail&&!yn(U.mail))return(w=a.value.mail)==null||w.focus(),alert(Y.value.mailError);U.nick||(U.nick=Y.value.anonymous)}if(!U.comment){(A=g.value)==null||A.focus();return}if(!Z.value)return alert(Y.value.wordHint.replace("$0",He[0].toString()).replace("$1",He[1].toString()).replace("$2",oe.value.toString()));U.comment=mt(U.comment,I.value.map),e.replyId&&e.rootId&&(U.pid=e.replyId,U.rid=e.rootId,U.at=e.replyUser),X.value=!0;try{Ne&&(U.recaptchaV3=await Zn(Ne).execute("social")),De&&(U.turnstile=await Xn(De).execute("social"));const he={serverURL:K,lang:J,token:(F=l.value)==null?void 0:F.token,comment:U},Ie=await(e.edit?fe({objectId:e.edit.objectId,...he}):xt(he));if(X.value=!1,Ie.errmsg)return alert(Ie.errmsg);i("submit",Ie.data),r.value="",ce.value="",await Fe(),e.replyId&&i("cancelReply"),(ae=e.edit)!=null&&ae.objectId&&i("cancelEdit")}catch(he){X.value=!1,alert(he.message)}},Le=v=>{v.preventDefault();const{lang:h,serverURL:w}=s.value;jt({serverURL:w,lang:h}).then(A=>{l.value=A,(A.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(A)),i("log")})},Ct=()=>{l.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),i("log")},Lt=v=>{v.preventDefault();const{lang:h,serverURL:w}=s.value,A=800,F=800,ae=(window.innerWidth-A)/2,K=(window.innerHeight-F)/2,J=new URLSearchParams({lng:h,token:l.value.token}),ge=window.open(`${w}/ui/profile?${J.toString()}`,"_blank",`width=${A},height=${F},left=${ae},top=${K},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);ge==null||ge.postMessage({type:"TOKEN",data:l.value.token},"*")},ze=v=>{var h,w,A,F;!((h=j.value)!=null&&h.contains(v.target))&&!((w=f.value)!=null&&w.contains(v.target))&&(x.value=!1),!((A=S.value)!=null&&A.contains(v.target))&&!((F=R.value)!=null&&F.contains(v.target))&&(q.value=!1)},Te=async v=>{var h;const{scrollTop:w,clientHeight:A,scrollHeight:F}=v.target,ae=(A+w)/F,K=s.value.search,J=((h=_.value)==null?void 0:h.value)??"";ae<.9||H.loading||le.value||(H.loading=!0,(K.more&&H.list.length?await K.more(J,H.list.length):await K.search(J)).length?H.list=[...H.list,...K.more&&H.list.length?await K.more(J,H.list.length):await K.search(J)]:le.value=!0,H.loading=!1,setTimeout(()=>{v.target.scrollTop=w},50))},It=Ot(v=>{H.list=[],le.value=!1,Te(v)},300);Q([s,oe],([v,h])=>{const{wordLimit:w}=v;w?h<w[0]&&w[0]!==0?(ne.value=w[0],Z.value=!1):h>w[1]?(ne.value=w[1],Z.value=!1):(ne.value=w[1],Z.value=!0):(ne.value=0,Z.value=!0)},{immediate:!0}),Ke("click",ze),Ke("message",({data:v})=>{!v||v.type!=="profile"||(l.value={...l.value,...v.data},[localStorage,sessionStorage].filter(h=>h.getItem("WALINE_USER")).forEach(h=>h.setItem("WALINE_USER",JSON.stringify(l))))}),Q(q,async v=>{var h;if(!v)return;const w=s.value.search;_.value&&(_.value.value=""),H.loading=!0,H.list=await(((h=w.default)==null?void 0:h.call(w))??w.search("")),H.loading=!1}),we(()=>{var v;(v=e.edit)!=null&&v.objectId&&(r.value=e.edit.orig),Q(()=>r.value,h=>{const{highlighter:w,texRenderer:A}=s.value;ue.value=h,ce.value=En(h,{emojiMap:I.value.map,highlighter:w,texRenderer:A}),oe.value=jn(h),h?Ze(g.value):Ze.destroy(g.value)},{immediate:!0}),Q(()=>s.value.emoji,h=>kn(h).then(w=>{I.value=w}),{immediate:!0})});const Ve={props:e,emit:i,config:s,editor:r,userMeta:u,userInfo:l,inputRefs:a,editorRef:g,imageUploadRef:b,emojiButtonRef:j,emojiPopupRef:f,gifButtonRef:S,gifPopupRef:R,gifSearchInputRef:_,emoji:I,emojiTabIndex:M,showEmoji:x,showGif:q,showPreview:se,previewText:ce,wordNumber:oe,searchResults:H,wordLimit:ne,isWordNumberLegal:Z,content:ue,isSubmitting:X,isImageListEnd:le,locale:Y,isLogin:y,canUploadImage:E,insert:N,onKeyDown:G,uploadImage:z,onDrop:B,onPaste:W,onChange:de,submitComment:Ce,onLogin:Le,onLogout:Ct,onProfile:Lt,popupHandler:ze,onImageWallScroll:Te,onGifSearch:It,get CloseIcon(){return An},get EmojiIcon(){return zn},get GifIcon(){return Bn},get ImageIcon(){return Tn},get LoadingIcon(){return ke},get MarkdownIcon(){return Pn},get PreviewIcon(){return Hn},ImageWall:vo};return Object.defineProperty(Ve,"__isScriptSetup",{enumerable:!1,value:!0}),Ve}});const ho={key:0,class:"wl-login-info"},fo={class:"wl-avatar"},wo=["title"],yo=["title"],bo=["src"],po=["title","textContent"],ko={class:"wl-panel"},_o=["for","textContent"],Co=["id","onUpdate:modelValue","name","type"],Lo=["placeholder"],Io={class:"wl-preview"},Ro=m("hr",null,null,-1),Eo=["innerHTML"],So={class:"wl-footer"},xo={class:"wl-actions"},jo={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},Mo=["title"],Ao=["title"],Uo=["title"],zo=["title"],To={class:"wl-info"},Vo=m("div",{class:"wl-captcha-container"},null,-1),Ho={class:"wl-text-number"},Po={key:0},No=["textContent"],Do=["textContent"],Wo=["disabled"],Bo=["placeholder"],Fo={key:1,class:"wl-loading"},Oo={key:0,class:"wl-tab-wrapper"},qo=["title","onClick"],Go=["src","alt"],Ko={key:0,class:"wl-tabs"},Zo=["onClick"],Xo=["src","alt","title"],Yo=["title"];function Jo(n,o,t,e,i,s){var r,u;return c(),d("div",{key:Number(e.isLogin),class:"wl-comment"},[e.config.login!=="disable"&&e.isLogin&&!((r=t.edit)!=null&&r.objectId)?(c(),d("div",ho,[m("div",fo,[m("button",{type:"submit",class:"wl-logout-btn",title:e.locale.logout,onClick:e.onLogout},[D(e.CloseIcon,{size:14})],8,wo),m("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:e.onProfile},[m("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,bo)],8,yo)]),m("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:e.onProfile,textContent:L(e.userInfo.display_name)},null,8,po)])):k("v-if",!0),m("div",ko,[e.config.login!=="force"&&e.config.meta.length&&!e.isLogin?(c(),d("div",{key:0,class:P(["wl-header",`item${e.config.meta.length}`])},[(c(!0),d(V,null,O(e.config.meta,l=>(c(),d("div",{key:l,class:"wl-header-item"},[m("label",{for:`wl-${l}`,textContent:L(e.locale[l]+(e.config.requiredMeta.includes(l)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,_o),ye(m("input",{id:`wl-${l}`,ref_for:!0,ref:a=>{a&&(e.inputRefs[l]=a)},"onUpdate:modelValue":a=>e.userMeta[l]=a,class:P(["wl-input",`wl-${l}`]),name:l,type:l==="mail"?"email":"text"},null,10,Co),[[Pt,e.userMeta[l]]])]))),128))],2)):k("v-if",!0),ye(m("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":o[0]||(o[0]=l=>e.editor=l),class:"wl-editor",placeholder:t.replyUser?`@${t.replyUser}`:e.locale.placeholder,onKeydown:e.onKeyDown,onDrop:e.onDrop,onPaste:e.onPaste},null,40,Lo),[[Nt,e.editor]]),ye(m("div",Io,[Ro,m("h4",null,L(e.locale.preview)+":",1),m("div",{class:"wl-content",innerHTML:e.previewText},null,8,Eo)],512),[[qe,e.showPreview]]),m("div",So,[m("div",xo,[m("a",jo,[D(e.MarkdownIcon)]),ye(m("button",{ref:"emojiButtonRef",type:"button",class:P(["wl-action",{active:e.showEmoji}]),title:e.locale.emoji,onClick:o[1]||(o[1]=l=>e.showEmoji=!e.showEmoji)},[D(e.EmojiIcon)],10,Mo),[[qe,e.emoji.tabs.length]]),e.config.search?(c(),d("button",{key:0,ref:"gifButtonRef",type:"button",class:P(["wl-action",{active:e.showGif}]),title:e.locale.gif,onClick:o[2]||(o[2]=l=>e.showGif=!e.showGif)},[D(e.GifIcon)],10,Ao)):k("v-if",!0),m("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:e.onChange},null,544),e.canUploadImage?(c(),d("label",{key:1,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[D(e.ImageIcon)],8,Uo)):k("v-if",!0),m("button",{type:"button",class:P(["wl-action",{active:e.showPreview}]),title:e.locale.preview,onClick:o[3]||(o[3]=l=>e.showPreview=!e.showPreview)},[D(e.PreviewIcon)],10,zo)]),m("div",To,[Vo,m("div",Ho,[ee(L(e.wordNumber)+" ",1),e.config.wordLimit?(c(),d("span",Po,[ee("  /  "),m("span",{class:P({illegal:!e.isWordNumberLegal}),textContent:L(e.wordLimit)},null,10,No)])):k("v-if",!0),ee("  "+L(e.locale.word),1)]),e.config.login!=="disable"&&!e.isLogin?(c(),d("button",{key:0,type:"button",class:"wl-btn",onClick:e.onLogin,textContent:L(e.locale.login)},null,8,Do)):k("v-if",!0),e.config.login!=="force"||e.isLogin?(c(),d("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:e.submitComment},[e.isSubmitting?(c(),$(e.LoadingIcon,{key:0,size:16})):(c(),d(V,{key:1},[ee(L(e.locale.submit),1)],64))],8,Wo)):k("v-if",!0)]),m("div",{ref:"gifPopupRef",class:P(["wl-gif-popup",{display:e.showGif}])},[m("input",{ref:"gifSearchInputRef",type:"text",placeholder:e.locale.gifSearchPlaceholder,onInput:o[4]||(o[4]=(...l)=>e.onGifSearch&&e.onGifSearch(...l))},null,40,Bo),e.searchResults.list.length?(c(),$(e.ImageWall,{key:0,items:e.searchResults.list,"column-width":200,gap:6,onInsert:o[5]||(o[5]=l=>e.insert(l)),onScroll:e.onImageWallScroll},null,8,["items"])):k("v-if",!0),e.searchResults.loading?(c(),d("div",Fo,[D(e.LoadingIcon,{size:30})])):k("v-if",!0)],2),m("div",{ref:"emojiPopupRef",class:P(["wl-emoji-popup",{display:e.showEmoji}])},[(c(!0),d(V,null,O(e.emoji.tabs,(l,a)=>(c(),d(V,{key:l.name},[a===e.emojiTabIndex?(c(),d("div",Oo,[(c(!0),d(V,null,O(l.items,g=>(c(),d("button",{key:g,type:"button",title:g,onClick:b=>e.insert(`:${g}:`)},[e.showEmoji?(c(),d("img",{key:0,class:"wl-emoji",src:e.emoji.map[g],alt:g,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Go)):k("v-if",!0)],8,qo))),128))])):k("v-if",!0)],64))),128)),e.emoji.tabs.length>1?(c(),d("div",Ko,[(c(!0),d(V,null,O(e.emoji.tabs,(l,a)=>(c(),d("button",{key:l.name,type:"button",class:P(["wl-tab",{active:e.emojiTabIndex===a}]),onClick:g=>e.emojiTabIndex=a},[m("img",{class:"wl-emoji",src:l.icon,alt:l.name,title:l.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Xo)],10,Zo))),128))])):k("v-if",!0)],2)])]),t.replyId||(u=t.edit)!=null&&u.objectId?(c(),d("button",{key:1,type:"button",class:"wl-close",title:e.locale.cancelReply,onClick:o[6]||(o[6]=l=>t.replyId?e.emit("cancelReply"):e.emit("cancelEdit"))},[D(e.CloseIcon,{size:24})],8,Yo)):k("v-if",!0)])}var bt=ve(go,[["render",Jo],["__file","CommentBox.vue"]]),Qo=me({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(n,{expose:o,emit:t}){o();const e=n,i=t,s=["approved","waiting","spam"],r=Re("config"),u=ht(),l=qt(),a=_e(),g=T(()=>r.value.locale),b=T(()=>{const{link:x}=e.comment;return x?st(x)?x:`https://${x}`:""}),j=T(()=>u.value.includes(e.comment.objectId)),f=T(()=>fn(new Date(e.comment.time),l.value,g.value)),S=T(()=>a.value.type==="administrator"),R=T(()=>e.comment.user_id&&a.value.objectId===e.comment.user_id),_=T(()=>{var x;return e.comment.objectId===((x=e.reply)==null?void 0:x.objectId)}),I=T(()=>{var x;return e.comment.objectId===((x=e.edit)==null?void 0:x.objectId)}),M={props:e,emit:i,commentStatus:s,config:r,likes:u,now:l,userInfo:a,locale:g,link:b,like:j,time:f,isAdmin:S,isOwner:R,isReplyingCurrent:_,isEditingCurrent:I,CommentBox:bt,get DeleteIcon(){return Un},get EditIcon(){return Dn},get LikeIcon(){return Vn},get ReplyIcon(){return Nn},get VerifiedIcon(){return Wn}};return Object.defineProperty(M,"__isScriptSetup",{enumerable:!1,value:!0}),M}});const $o=["id"],el={class:"wl-user","aria-hidden":"true"},tl=["src"],nl={class:"wl-card"},ol={class:"wl-head"},ll=["href"],al={key:1,class:"wl-nick"},il=["textContent"],rl=["textContent"],sl=["textContent"],cl=["textContent"],ul=["textContent"],dl={class:"wl-comment-actions"},ml=["title"],vl=["title"],gl={class:"wl-meta","aria-hidden":"true"},hl=["data-value","textContent"],fl={key:0,class:"wl-content"},wl={key:0},yl=["href"],bl=m("span",null,": ",-1),pl=["innerHTML"],kl={key:1,class:"wl-admin-actions"},_l={class:"wl-comment-status"},Cl=["disabled","onClick","textContent"],Ll={key:3,class:"wl-quote"};function Il(n,o,t,e,i,s){var u;const r=Dt("CommentCard",!0);return c(),d("div",{id:t.comment.objectId,class:"wl-card-item"},[m("div",el,[t.comment.avatar?(c(),d("img",{key:0,class:"wl-user-avatar",src:t.comment.avatar},null,8,tl)):k("v-if",!0),t.comment.type?(c(),$(e.VerifiedIcon,{key:1})):k("v-if",!0)]),m("div",nl,[m("div",ol,[e.link?(c(),d("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noopener noreferrer"},L(t.comment.nick),9,ll)):(c(),d("span",al,L(t.comment.nick),1)),t.comment.type==="administrator"?(c(),d("span",{key:2,class:"wl-badge",textContent:L(e.locale.admin)},null,8,il)):k("v-if",!0),t.comment.label?(c(),d("span",{key:3,class:"wl-badge",textContent:L(t.comment.label)},null,8,rl)):k("v-if",!0),t.comment.sticky?(c(),d("span",{key:4,class:"wl-badge",textContent:L(e.locale.sticky)},null,8,sl)):k("v-if",!0),typeof t.comment.level=="number"?(c(),d("span",{key:5,class:P(`wl-badge level${t.comment.level}`),textContent:L(e.locale[`level${t.comment.level}`]||`Level ${t.comment.level}`)},null,10,cl)):k("v-if",!0),m("span",{class:"wl-time",textContent:L(e.time)},null,8,ul),m("div",dl,[e.isAdmin||e.isOwner?(c(),d(V,{key:0},[m("button",{type:"button",class:"wl-edit",onClick:o[0]||(o[0]=l=>e.emit("edit",t.comment))},[D(e.EditIcon)]),m("button",{type:"button",class:"wl-delete",onClick:o[1]||(o[1]=l=>e.emit("delete",t.comment))},[D(e.DeleteIcon)])],64)):k("v-if",!0),m("button",{type:"button",class:"wl-like",title:e.like?e.locale.cancelLike:e.locale.like,onClick:o[2]||(o[2]=l=>e.emit("like",t.comment))},[D(e.LikeIcon,{active:e.like},null,8,["active"]),ee(" "+L("like"in t.comment?t.comment.like:""),1)],8,ml),m("button",{type:"button",class:P(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:o[3]||(o[3]=l=>e.emit("reply",e.isReplyingCurrent?null:t.comment))},[D(e.ReplyIcon)],10,vl)])]),m("div",gl,[(c(),d(V,null,O(["addr","browser","os"],l=>(c(),d(V,null,[t.comment[l]?(c(),d("span",{key:l,class:P(`wl-${l}`),"data-value":t.comment[l],textContent:L(t.comment[l])},null,10,hl)):k("v-if",!0)],64))),64))]),e.isEditingCurrent?k("v-if",!0):(c(),d("div",fl,[t.comment.reply_user?(c(),d("p",wl,[m("a",{href:"#"+t.comment.pid},"@"+L(t.comment.reply_user.nick),9,yl),bl])):k("v-if",!0),m("div",{innerHTML:t.comment.comment},null,8,pl)])),e.isAdmin&&!e.isEditingCurrent?(c(),d("div",kl,[m("span",_l,[(c(),d(V,null,O(e.commentStatus,l=>m("button",{key:l,type:"submit",class:P(`wl-btn wl-${l}`),disabled:t.comment.status===l,onClick:a=>e.emit("status",{status:l,comment:t.comment}),textContent:L(e.locale[l])},null,10,Cl)),64))]),e.isAdmin&&!("rid"in t.comment)?(c(),d("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:o[4]||(o[4]=l=>e.emit("sticky",t.comment))},L(t.comment.sticky?e.locale.unsticky:e.locale.sticky),1)):k("v-if",!0)])):k("v-if",!0),e.isReplyingCurrent||e.isEditingCurrent?(c(),d("div",{key:2,class:P({"wl-reply-wrapper":e.isReplyingCurrent,"wl-edit-wrapper":e.isEditingCurrent})},[D(e.CommentBox,{edit:t.edit,"reply-id":(u=t.reply)==null?void 0:u.objectId,"reply-user":t.comment.nick,"root-id":t.rootId,onLog:o[5]||(o[5]=l=>e.emit("log")),onCancelReply:o[6]||(o[6]=l=>e.emit("reply",null)),onCancelEdit:o[7]||(o[7]=l=>e.emit("edit",null)),onSubmit:o[8]||(o[8]=l=>e.emit("submit",l))},null,8,["edit","reply-id","reply-user","root-id"])],2)):k("v-if",!0),"children"in t.comment?(c(),d("div",Ll,[(c(!0),d(V,null,O(t.comment.children,l=>(c(),$(r,{key:l.objectId,comment:l,reply:t.reply,edit:t.edit,"root-id":t.rootId,onLog:o[9]||(o[9]=a=>e.emit("log")),onDelete:o[10]||(o[10]=a=>e.emit("delete",a)),onEdit:o[11]||(o[11]=a=>e.emit("edit",a)),onLike:o[12]||(o[12]=a=>e.emit("like",a)),onReply:o[13]||(o[13]=a=>e.emit("reply",a)),onStatus:o[14]||(o[14]=a=>e.emit("status",a)),onSticky:o[15]||(o[15]=a=>e.emit("sticky",a)),onSubmit:o[16]||(o[16]=a=>e.emit("submit",a))},null,8,["comment","reply","edit","root-id"]))),128))])):k("v-if",!0)])],8,$o)}var Rl=ve(Qo,[["render",Il],["__file","CommentCard.vue"]]);const pt="3.2.5";var El=me({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(n,{expose:o}){o();const t=n,e={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},i=Object.keys(e),s=_e(),r=ht(),u=p("loading"),l=p(0),a=p(1),g=p(0),b=T(()=>vn(t)),j=p(b.value.commentSorting),f=p([]),S=p(null),R=p(null),_=T(()=>gn(b.value.dark)),I=T(()=>b.value.locale);Gt(_,{id:"waline-darkmode"});let M;const x=y=>{var E;const{serverURL:N,path:G,pageSize:z}=b.value,B=new AbortController;u.value="loading",M==null||M(),Mt({serverURL:N,lang:b.value.lang,path:G,pageSize:z,sortBy:e[j.value],page:y,signal:B.signal,token:(E=s.value)==null?void 0:E.token}).then(W=>{u.value="success",l.value=W.count,f.value.push(...W.data),a.value=y,g.value=W.totalPages}).catch(W=>{W.name!=="AbortError"&&(console.error(W.message),u.value="error")}),M=B.abort.bind(B)},q=()=>x(a.value+1),se=()=>{l.value=0,f.value=[],x(1)},ce=y=>{j.value!==y&&(j.value=y,se())},oe=y=>{S.value=y},H=y=>{R.value=y},ne=y=>{if(R.value)R.value.comment=y.comment,R.value.orig=y.orig;else if("rid"in y){const E=f.value.find(({objectId:N})=>N===y.rid);if(!E)return;Array.isArray(E.children)||(E.children=[]),E.children.push(y)}else f.value.unshift(y),l.value+=1},Z=async({comment:y,status:E})=>{var N;if(y.status===E)return;const{serverURL:G,lang:z}=b.value;await fe({serverURL:G,lang:z,token:(N=s.value)==null?void 0:N.token,objectId:y.objectId,comment:{status:E}}),y.status=E},ue=async y=>{var E;if("rid"in y)return;const{serverURL:N,lang:G}=b.value;await fe({serverURL:N,lang:G,token:(E=s.value)==null?void 0:E.token,objectId:y.objectId,comment:{sticky:y.sticky?0:1}}),y.sticky=!y.sticky},X=async({objectId:y})=>{var E;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:N,lang:G}=b.value;await At({serverURL:N,lang:G,token:(E=s.value)==null?void 0:E.token,objectId:y}),f.value.some((z,B)=>z.objectId===y?(f.value=f.value.filter((W,de)=>de!==B),!0):z.children.some((W,de)=>W.objectId===y?(f.value[B].children=z.children.filter((Ce,Le)=>Le!==de),!0):!1))},le=async y=>{var E;const{serverURL:N,lang:G}=b.value,{objectId:z}=y,B=r.value.includes(z);await fe({serverURL:N,lang:G,objectId:z,token:(E=s.value)==null?void 0:E.token,comment:{like:!B}}),B?r.value=r.value.filter(W=>W!==z):(r.value=[...r.value,z],r.value.length>50&&(r.value=r.value.slice(-50))),y.like=(y.like||0)+(B?-1:1)};Wt("config",b),we(()=>{Q(()=>[t.serverURL,t.path],()=>se(),{immediate:!0})}),Be(()=>M==null?void 0:M());const Y={props:t,sortKeyMap:e,sortingMethods:i,userInfo:s,likeStorage:r,status:u,count:l,page:a,totalPages:g,config:b,commentSortingRef:j,data:f,reply:S,edit:R,darkmodeStyle:_,i18n:I,get abort(){return M},set abort(y){M=y},getCommentData:x,loadMore:q,refresh:se,onSortByChange:ce,onReply:oe,onEdit:H,onSubmit:ne,onStatusChange:Z,onSticky:ue,onDelete:X,onLike:le,Reaction:ro,CommentBox:bt,CommentCard:Rl,get LoadingIcon(){return ke},get version(){return pt}};return Object.defineProperty(Y,"__isScriptSetup",{enumerable:!1,value:!0}),Y}});const Sl={"data-waline":""},xl={class:"wl-meta-head"},jl={class:"wl-count"},Ml=["textContent"],Al={class:"wl-sort"},Ul=["onClick"],zl={class:"wl-cards"},Tl={key:1,class:"wl-operation"},Vl=["textContent"],Hl={key:2,class:"wl-loading"},Pl=["textContent"],Nl={key:4,class:"wl-operation"},Dl=["textContent"],Wl={key:5,class:"wl-power"},Bl=m("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);function Fl(n,o,t,e,i,s){return c(),d("div",Sl,[D(e.Reaction),e.reply?k("v-if",!0):(c(),$(e.CommentBox,{key:0,onLog:e.refresh,onSubmit:e.onSubmit})),m("div",xl,[m("div",jl,[e.count?(c(),d("span",{key:0,class:"wl-num",textContent:L(e.count)},null,8,Ml)):k("v-if",!0),ee(" "+L(e.i18n.comment),1)]),m("ul",Al,[(c(!0),d(V,null,O(e.sortingMethods,r=>(c(),d("li",{key:r,class:P([r===e.commentSortingRef?"active":""]),onClick:u=>e.onSortByChange(r)},L(e.i18n[r]),11,Ul))),128))])]),m("div",zl,[(c(!0),d(V,null,O(e.data,r=>(c(),$(e.CommentCard,{key:r.objectId,"root-id":r.objectId,comment:r,reply:e.reply,edit:e.edit,onLog:e.refresh,onReply:e.onReply,onEdit:e.onEdit,onSubmit:e.onSubmit,onStatus:e.onStatusChange,onDelete:e.onDelete,onSticky:e.onSticky,onLike:e.onLike},null,8,["root-id","comment","reply","edit"]))),128))]),e.status==="error"?(c(),d("div",Tl,[m("button",{type:"button",class:"wl-btn",onClick:e.refresh,textContent:L(e.i18n.refresh)},null,8,Vl)])):e.status==="loading"?(c(),d("div",Hl,[D(e.LoadingIcon,{size:30})])):e.data.length?e.page<e.totalPages?(c(),d("div",Nl,[m("button",{type:"button",class:"wl-btn",onClick:e.loadMore,textContent:L(e.i18n.more)},null,8,Dl)])):k("v-if",!0):(c(),d("div",{key:3,class:"wl-empty",textContent:L(e.i18n.sofa)},null,8,Pl)),e.config.copyright?(c(),d("div",Wl,[ee(" Powered by "),Bl,ee(" v"+L(e.version),1)])):k("v-if",!0)])}var Ol=ve(El,[["render",Fl],["__file","WalineComment.vue"]]);const kt=(n,o)=>{o.forEach((t,e)=>{const i=n[e].time;typeof i=="number"&&(t.innerText=i.toString())})},_t=({serverURL:n,path:o=window.location.pathname,selector:t=".waline-pageview-count",update:e=!0,lang:i=navigator.language})=>{const s=new AbortController,r=Array.from(document.querySelectorAll(t)),u=a=>{const g=Ue(a);return g!==null&&o!==g},l=a=>zt({serverURL:pe(n),paths:a.map(g=>Ue(g)??o),lang:i,signal:s.signal}).then(g=>kt(g,a)).catch(ut);if(e){const a=r.filter(b=>!u(b)),g=r.filter(u);Ut({serverURL:pe(n),path:o,lang:i}).then(b=>kt(b,a)),g.length&&l(g)}else l(r);return s.abort.bind(s)},ql=({el:n="#waline",path:o=window.location.pathname,comment:t=!1,pageview:e=!1,...i})=>{const s=n?Ae(n):null;if(n&&!s)throw new Error("Option 'el' do not match any domElement!");if(!i.serverURL)throw new Error("Option 'serverURL' is missing!");const r=Ee({...i}),u=Ee({comment:t,pageview:e,path:o}),l=()=>{u.comment&&vt({serverURL:r.serverURL,path:u.path,...re(u.comment)?{selector:u.comment}:{}})},a=()=>{u.pageview&&_t({serverURL:r.serverURL,path:u.path,...re(u.pageview)?{selector:u.pageview}:{}})},g=s?Bt(()=>C(Ol,{path:u.path,...r})):null;g&&g.mount(s);const b=Ge(l),j=Ge(a);return{el:s,update:({comment:f,pageview:S,path:R=window.location.pathname,..._}={})=>{Object.entries(_).forEach(([I,M])=>{r[I]=M}),u.path=R,f!==void 0&&(u.comment=f),S!==void 0&&(u.pageview=S)},destroy:()=>{g==null||g.unmount(),b(),j()}}},Gl=({el:n,serverURL:o,count:t,lang:e=navigator.language})=>{var i;const s=_e(),r=Ae(n),u=new AbortController;return Tt({serverURL:o,count:t,lang:e,signal:u.signal,token:(i=s.value)==null?void 0:i.token}).then(l=>r&&l.length?(r.innerHTML=`<ul class="wl-recent-list">${l.map(a=>`<li class="wl-recent-item"><a href="${a.url}">${a.nick}</a>:${a.comment}</li>`).join("")}</ul>`,{comments:l,destroy:()=>{u.abort(),r.innerHTML=""}}):{comments:l,destroy:()=>u.abort()})},Kl=({el:n,serverURL:o,count:t,locale:e,lang:i=navigator.language,mode:s="list"})=>{const r=Ae(n),u=new AbortController;return Vt({serverURL:o,pageSize:t,lang:i,signal:u.signal}).then(l=>!r||!l.length?{users:l,destroy:()=>u.abort()}:(e={...at(i),...typeof e=="object"?e:{}},r.innerHTML=`<ul class="wl-user-${s}">${l.map((a,g)=>[`<li class="wl-user-item" aria-label="${a.nick}">`,a.link&&`<a href="${a.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${a.avatar}" alt="${a.nick}">`,`<span class="wl-user-badge">${g+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',a.nick,a.level&&`<span class="wl-badge">${e?e[`level${a.level}`]:`Level ${a.level}`}</span>`,a.label&&`<span class="wl-badge">${a.label}</span>`,"</div>",a.link&&a.link,"</div>",a.link&&"</a>","</li>"].filter(b=>b).join("")).join("")}</ul>`,{users:l,destroy:()=>{u.abort(),r.innerHTML=""}}))};export{Gl as RecentComments,Kl as UserList,vt as commentCount,be as defaultLocales,ql as init,_t as pageviewCount,pt as version};
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const lt="en-US",be={zh:ot,"zh-cn":ot,"zh-tw":un,en:Qe,"en-us":Qe,fr:$e,"fr-fr":$e,jp:et,"jp-jp":et,"pt-br":cn,ru:tt,"ru-ru":tt,vi:nt,"vi-vn":nt},at=n=>be[n.toLowerCase()]||be[lt],dn=n=>Object.keys(be).includes(n.toLowerCase())?n:lt,it=n=>{try{n=decodeURI(n)}catch{}return n},rt=(n="")=>n.replace(/\/$/u,""),st=n=>/^(https?:)?\/\//.test(n),pe=n=>{const o=rt(n);return st(o)?o:`https://${o}`},mn=n=>Array.isArray(n)?n:n?[0,n]:!1,xe=(n,o)=>typeof n=="function"?n:n===!1?!1:o,vn=({serverURL:n,path:o=location.pathname,lang:t=typeof navigator>"u"?"en-US":navigator.language,locale:e,emoji:i=Ye,meta:s=["nick","mail","link"],requiredMeta:r=[],dark:u=!1,pageSize:l=10,wordLimit:a,imageUploader:g,highlighter:b,texRenderer:j,copyright:f=!0,login:S="enable",search:R,reaction:_,recaptchaV3Key:L="",turnstileKey:M="",commentSorting:x="latest",...q})=>({serverURL:pe(n),path:it(o),lang:dn(t),locale:{...at(t),...typeof e=="object"?e:{}},wordLimit:mn(a),meta:Xe(s),requiredMeta:Xe(r),imageUploader:xe(g,Qt),highlighter:xe(b,rn),texRenderer:xe(j,$t),dark:u,emoji:typeof i=="boolean"?i?Ye:[]:i,pageSize:l,login:S,copyright:f,search:R===!1?!1:typeof R=="object"?R:en(t),recaptchaV3Key:L,turnstileKey:M,reaction:Array.isArray(_)?_:_===!0?Jt:[],commentSorting:x,...q}),re=n=>typeof n=="string",je="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bg-color:#1e1e1e;--waline-bg-color-light:#272727;--waline-bg-color-hover: #444;--waline-border-color:#333;--waline-disable-bg-color:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bg-color:#272727;--waline-info-color:#666}",gn=n=>re(n)?n==="auto"?`@media(prefers-color-scheme:dark){body${je}}`:`${n}${je}`:n===!0?`:root${je}`:"",Me=(n,o)=>{let t=n.toString();for(;t.length<o;)t="0"+t;return t},hn=n=>{const o=Me(n.getDate(),2),t=Me(n.getMonth()+1,2);return`${Me(n.getFullYear(),2)}-${t}-${o}`},fn=(n,o,t)=>{if(!n)return"";const e=re(n)?new Date(n.indexOf(" ")!==-1?n.replace(/-/g,"/"):n):n,i=o.getTime()-e.getTime(),s=Math.floor(i/(24*3600*1e3));if(s===0){const r=i%864e5,u=Math.floor(r/(3600*1e3));if(u===0){const l=r%36e5,a=Math.floor(l/(60*1e3));if(a===0){const g=l%6e4;return`${Math.round(g/1e3)} ${t.seconds}`}return`${a} ${t.minutes}`}return`${u} ${t.hours}`}return s<0?t.now:s<8?`${s} ${t.days}`:hn(e)},wn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yn=n=>wn.test(n),bn=n=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(n),pn=n=>{const o=ie("WALINE_EMOJI",{}),t=bn(n);if(t){const e=o.value[n];if(e)return Promise.resolve(e)}return fetch(`${n}/info.json`).then(e=>e.json()).then(e=>{const i={folder:n,...e};return t&&(o.value[n]=i),i})},ct=(n,o="",t="",e="")=>`${o?`${o}/`:""}${t}${n}${e?`.${e}`:""}`,kn=n=>Promise.all(n.map(o=>re(o)?pn(rt(o)):Promise.resolve(o))).then(o=>{const t={tabs:[],map:{}};return o.forEach(e=>{const{name:i,folder:s,icon:r,prefix:u="",type:l,items:a}=e;t.tabs.push({name:i,icon:ct(r,s,u,l),items:a.map(g=>{const b=`${u}${g}`;return t.map[b]=ct(g,s,u,l),b})})}),t}),ut=n=>{n.name!=="AbortError"&&console.error(n.message)},Ae=n=>n instanceof HTMLElement?n:re(n)?document.querySelector(n):null,_n=n=>n.type.includes("image"),dt=n=>{const o=Array.from(n).find(_n);return o?o.getAsFile():null},Cn=/\$.*?\$/,In=/^\$(.*?)\$/,Ln=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Rn=n=>[{name:"blockMath",level:"block",tokenizer(o){const t=Ln.exec(o);if(t!==null)return{type:"html",raw:t[0],text:n(!0,t[1])}}},{name:"inlineMath",level:"inline",start(o){const t=o.search(Cn);return t!==-1?t:o.length},tokenizer(o){const t=In.exec(o);if(t!==null)return{type:"html",raw:t[0],text:n(!1,t[1])}}}],mt=(n="",o={})=>n.replace(/:(.+?):/g,(t,e)=>o[e]?`<img class="wl-emoji" src="${o[e]}" alt="${e}">`:t),En=(n,{emojiMap:o,highlighter:t,texRenderer:e})=>{const i=new Kt;if(i.setOptions({breaks:!0}),t&&i.use(Zt({highlight:t})),e){const s=Rn(e);i.use({extensions:s})}return i.parse(mt(n,o))},Ue=n=>{const{path:o}=n.dataset;return o!=null&&o.length?o:null},Sn=n=>n.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),xn=n=>n.match(/[\u4E00-\u9FD5]/gu),jn=n=>{var o,t;return(((o=Sn(n))==null?void 0:o.reduce((e,i)=>e+(["",",","."].includes(i.trim())?0:i.trim().split(/\s+/u).length),0))??0)+(((t=xn(n))==null?void 0:t.length)??0)},Mn=async()=>{if(!navigator)return"";const{userAgentData:n}=navigator;let o=navigator.userAgent;if(!n||n.platform!=="Windows")return o;const{platformVersion:t}=await n.getHighEntropyValues(["platformVersion"]);return t&&parseInt(t.split(".")[0])>=13&&(o=o.replace("Windows NT 10.0","Windows NT 11.0")),o},vt=({serverURL:n,path:o=window.location.pathname,selector:t=".waline-comment-count",lang:e=navigator.language})=>{const i=new AbortController,s=document.querySelectorAll(t);return s.length&&Et({serverURL:pe(n),paths:Array.from(s).map(r=>it(Ue(r)??o)),lang:e,signal:i.signal}).then(r=>{s.forEach((u,l)=>{u.innerText=r[l].toString()})}).catch(ut),i.abort.bind(i)},An=({size:n})=>C("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:n,height:n},[C("path",{d:"M697.173 85.333h-369.92c-144.64 0-241.92 101.547-241.92 252.587v348.587c0 150.613 97.28 252.16 241.92 252.16h369.92c144.64 0 241.494-101.547 241.494-252.16V337.92c0-151.04-96.854-252.587-241.494-252.587z",fill:"currentColor"}),C("path",{d:"m640.683 587.52-75.947-75.861 75.904-75.862a37.29 37.29 0 0 0 0-52.778 37.205 37.205 0 0 0-52.779 0l-75.946 75.818-75.862-75.946a37.419 37.419 0 0 0-52.821 0 37.419 37.419 0 0 0 0 52.821l75.947 75.947-75.776 75.733a37.29 37.29 0 1 0 52.778 52.821l75.776-75.776 75.947 75.947a37.376 37.376 0 0 0 52.779-52.821z",fill:"#888"})]),Un=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),zn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"M563.2 463.3 677 540c1.7 1.2 3.7 1.8 5.8 1.8.7 0 1.4-.1 2-.2 2.7-.5 5.1-2.1 6.6-4.4l25.3-37.8c1.5-2.3 2.1-5.1 1.6-7.8s-2.1-5.1-4.4-6.6l-73.6-49.1 73.6-49.1c2.3-1.5 3.9-3.9 4.4-6.6.5-2.7 0-5.5-1.6-7.8l-25.3-37.8a10.1 10.1 0 0 0-6.6-4.4c-.7-.1-1.3-.2-2-.2-2.1 0-4.1.6-5.8 1.8l-113.8 76.6c-9.2 6.2-14.7 16.4-14.7 27.5.1 11 5.5 21.3 14.7 27.4zM387 348.8h-45.5c-5.7 0-10.4 4.7-10.4 10.4v153.3c0 5.7 4.7 10.4 10.4 10.4H387c5.7 0 10.4-4.7 10.4-10.4V359.2c0-5.7-4.7-10.4-10.4-10.4zm333.8 241.3-41-20a10.3 10.3 0 0 0-8.1-.5c-2.6.9-4.8 2.9-5.9 5.4-30.1 64.9-93.1 109.1-164.4 115.2-5.7.5-9.9 5.5-9.5 11.2l3.9 45.5c.5 5.3 5 9.5 10.3 9.5h.9c94.8-8 178.5-66.5 218.6-152.7 2.4-5 .3-11.2-4.8-13.6zm186-186.1c-11.9-42-30.5-81.4-55.2-117.1-24.1-34.9-53.5-65.6-87.5-91.2-33.9-25.6-71.5-45.5-111.6-59.2-41.2-14-84.1-21.1-127.8-21.1h-1.2c-75.4 0-148.8 21.4-212.5 61.7-63.7 40.3-114.3 97.6-146.5 165.8-32.2 68.1-44.3 143.6-35.1 218.4 9.3 74.8 39.4 145 87.3 203.3.1.2.3.3.4.5l36.2 38.4c1.1 1.2 2.5 2.1 3.9 2.6 73.3 66.7 168.2 103.5 267.5 103.5 73.3 0 145.2-20.3 207.7-58.7 37.3-22.9 70.3-51.5 98.1-85 27.1-32.7 48.7-69.5 64.2-109.1 15.5-39.7 24.4-81.3 26.6-123.8 2.4-43.6-2.5-87-14.5-129zm-60.5 181.1c-8.3 37-22.8 72-43 104-19.7 31.1-44.3 58.6-73.1 81.7-28.8 23.1-61 41-95.7 53.4-35.6 12.7-72.9 19.1-110.9 19.1-82.6 0-161.7-30.6-222.8-86.2l-34.1-35.8c-23.9-29.3-42.4-62.2-55.1-97.7-12.4-34.7-18.8-71-19.2-107.9-.4-36.9 5.4-73.3 17.1-108.2 12-35.8 30-69.2 53.4-99.1 31.7-40.4 71.1-72 117.2-94.1 44.5-21.3 94-32.6 143.4-32.6 49.3 0 97 10.8 141.8 32 34.3 16.3 65.3 38.1 92 64.8 26.1 26 47.5 56 63.6 89.2 16.2 33.2 26.6 68.5 31 105.1 4.6 37.5 2.7 75.3-5.6 112.3z",fill:"currentColor"})),Tn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[C("path",{d:"M784 112H240c-88 0-160 72-160 160v480c0 88 72 160 160 160h544c88 0 160-72 160-160V272c0-88-72-160-160-160zm96 640c0 52.8-43.2 96-96 96H240c-52.8 0-96-43.2-96-96V272c0-52.8 43.2-96 96-96h544c52.8 0 96 43.2 96 96v480z",fill:"currentColor"}),C("path",{d:"M352 480c52.8 0 96-43.2 96-96s-43.2-96-96-96-96 43.2-96 96 43.2 96 96 96zm0-128c17.6 0 32 14.4 32 32s-14.4 32-32 32-32-14.4-32-32 14.4-32 32-32zm462.4 379.2-3.2-3.2-177.6-177.6c-25.6-25.6-65.6-25.6-91.2 0l-80 80-36.8-36.8c-25.6-25.6-65.6-25.6-91.2 0L200 728c-4.8 6.4-8 14.4-8 24 0 17.6 14.4 32 32 32 9.6 0 16-3.2 22.4-9.6L380.8 640l134.4 134.4c6.4 6.4 14.4 9.6 24 9.6 17.6 0 32-14.4 32-32 0-9.6-4.8-17.6-9.6-24l-52.8-52.8 80-80L769.6 776c6.4 4.8 12.8 8 20.8 8 17.6 0 32-14.4 32-32 0-8-3.2-16-8-20.8z",fill:"currentColor"})]),Vn=({active:n=!1})=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[C("path",{d:`M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z${n?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"}`,fill:n?"red":"currentColor"})]),Hn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[C("path",{d:"M710.816 654.301c70.323-96.639 61.084-230.578-23.705-314.843-46.098-46.098-107.183-71.109-172.28-71.109-65.008 0-126.092 25.444-172.28 71.109-45.227 46.098-70.756 107.183-70.756 172.106 0 64.923 25.444 126.007 71.194 172.106 46.099 46.098 107.184 71.109 172.28 71.109 51.414 0 100.648-16.212 142.824-47.404l126.53 126.006c7.058 7.06 16.297 10.979 26.406 10.979 10.105 0 19.343-3.919 26.402-10.979 14.467-14.467 14.467-38.172 0-52.723L710.816 654.301zm-315.107-23.265c-65.88-65.88-65.88-172.54 0-238.42 32.069-32.07 74.245-49.149 119.471-49.149 45.227 0 87.407 17.603 119.472 49.149 65.88 65.879 65.88 172.539 0 238.42-63.612 63.178-175.242 63.178-238.943 0zm0 0",fill:"currentColor"}),C("path",{d:"M703.319 121.603H321.03c-109.8 0-199.469 89.146-199.469 199.38v382.034c0 109.796 89.236 199.38 199.469 199.38h207.397c20.653 0 37.384-16.645 37.384-37.299 0-20.649-16.731-37.296-37.384-37.296H321.03c-68.582 0-124.352-55.77-124.352-124.267V321.421c0-68.496 55.77-124.267 124.352-124.267h382.289c68.582 0 124.352 55.771 124.352 124.267V524.72c0 20.654 16.736 37.299 37.385 37.299 20.654 0 37.384-16.645 37.384-37.299V320.549c-.085-109.8-89.321-198.946-199.121-198.946zm0 0",fill:"currentColor"})]),Pn=()=>C("svg",{width:"16",height:"16",ariaHidden:"true"},C("path",{d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",fill:"currentColor"})),Nn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),Dn=()=>C("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},C("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),Wn=()=>C("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},C("path",{d:"m894.4 461.56-54.4-63.2c-10.4-12-18.8-34.4-18.8-50.4v-68c0-42.4-34.8-77.2-77.2-77.2h-68c-15.6 0-38.4-8.4-50.4-18.8l-63.2-54.4c-27.6-23.6-72.8-23.6-100.8 0l-62.8 54.8c-12 10-34.8 18.4-50.4 18.4h-69.2c-42.4 0-77.2 34.8-77.2 77.2v68.4c0 15.6-8.4 38-18.4 50l-54 63.6c-23.2 27.6-23.2 72.4 0 100l54 63.6c10 12 18.4 34.4 18.4 50v68.4c0 42.4 34.8 77.2 77.2 77.2h69.2c15.6 0 38.4 8.4 50.4 18.8l63.2 54.4c27.6 23.6 72.8 23.6 100.8 0l63.2-54.4c12-10.4 34.4-18.8 50.4-18.8h68c42.4 0 77.2-34.8 77.2-77.2v-68c0-15.6 8.4-38.4 18.8-50.4l54.4-63.2c23.2-27.6 23.2-73.2-.4-100.8zm-216-25.2-193.2 193.2a30 30 0 0 1-42.4 0l-96.8-96.8a30.16 30.16 0 0 1 0-42.4c11.6-11.6 30.8-11.6 42.4 0l75.6 75.6 172-172c11.6-11.6 30.8-11.6 42.4 0 11.6 11.6 11.6 30.8 0 42.4z",fill:"#27ae60"})),ke=({size:n=100})=>C("svg",{width:n,height:n,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},C("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},C("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Bn=()=>C("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[C("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),C("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})]),Fn=()=>ie("WALINE_USER_META",{nick:"",mail:"",link:""}),On=()=>ie("WALINE_COMMENT_BOX_EDITOR",""),qn="WALINE_LIKE";let gt=null;const ht=()=>gt??(gt=ie(qn,[])),Gn="WALINE_REACTION";let ft=null;const Kn=()=>ft??(ft=ie(Gn,{})),wt={},Zn=n=>{const o=wt[n]??(wt[n]=Xt(n,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:t=>o.then(e=>e.execute(t))}},Xn=n=>({execute:async o=>{const{load:t}=Ft("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await t();const e=window==null?void 0:window.turnstile;return new Promise(i=>{e==null||e.ready(()=>{e==null||e.render(".wl-captcha-container",{sitekey:n,action:o,size:"compact",callback:i})})})}}),Yn="WALINE_USER";let yt=null;const _e=()=>yt??(yt=ie(Yn,{}));var Jn=me({__name:"ArticleReaction",setup(n,{expose:o}){o();const t=Kn(),e=Re("config"),i=p(-1),s=p([]),r=T(()=>e.value.locale),u=T(()=>e.value.reaction.length>0),l=T(()=>{const{reaction:f,path:S}=e.value;return f.map((R,_)=>({icon:R,desc:r.value[`reaction${_}`],active:t.value[S]===_}))});let a;const g=async()=>{if(!u.value)return;const{serverURL:f,lang:S,path:R,reaction:_}=e.value,L=new AbortController;a=L.abort.bind(L);const M=await St({serverURL:f,lang:S,paths:[R],type:_.map((x,q)=>`reaction${q}`),signal:L.signal});s.value=_.map((x,q)=>M[0][`reaction${q}`])},b=async f=>{if(i.value===-1){const{serverURL:S,lang:R,path:_}=e.value,L=t.value[_];i.value=f,L!==void 0&&(await We({serverURL:S,lang:R,path:_,type:`reaction${L}`,action:"desc"}),s.value[L]=Math.max(s.value[L]-1,0)),L!==f&&(await We({serverURL:S,lang:R,path:_,type:`reaction${f}`}),s.value[f]=(s.value[f]||0)+1),L===f?delete t.value[_]:t.value[_]=f,i.value=-1}};we(()=>{Q(()=>[e.value.serverURL,e.value.path],()=>{g()},{immediate:!0})}),Be(()=>a==null?void 0:a());const j={reactionStorage:t,config:e,votingIndex:i,voteNumbers:s,locale:r,isReactionEnabled:u,reactionsInfo:l,get abort(){return a},set abort(f){a=f},fetchReaction:g,vote:b,get LoadingIcon(){return ke}};return Object.defineProperty(j,"__isScriptSetup",{enumerable:!1,value:!0}),j}}),ve=(n,o)=>{const t=n.__vccOpts||n;for(const[e,i]of o)t[e]=i;return t};const Qn={key:0,class:"wl-reaction"},$n=["textContent"],eo={class:"wl-reaction-list"},to=["onClick"],no={class:"wl-reaction-img"},oo=["src","alt"],lo=["textContent"],ao=["textContent"];function io(n,o,t,e,i,s){return e.reactionsInfo.length?(c(),d("div",Qn,[m("div",{class:"wl-reaction-title",textContent:I(e.locale.reactionTitle)},null,8,$n),m("ul",eo,[(c(!0),d(V,null,O(e.reactionsInfo,({active:r,icon:u,desc:l},a)=>(c(),d("li",{key:a,class:P(["wl-reaction-item",{active:r}]),onClick:g=>e.vote(a)},[m("div",no,[m("img",{src:u,alt:l},null,8,oo),e.votingIndex===a?(c(),$(e.LoadingIcon,{key:0,class:"wl-reaction-loading"})):(c(),d("div",{key:1,class:"wl-reaction-votes",textContent:I(e.voteNumbers[a]||0)},null,8,lo))]),m("div",{class:"wl-reaction-text",textContent:I(l)},null,8,ao)],10,to))),128))])])):k("v-if",!0)}var ro=ve(Jn,[["render",io],["__file","ArticleReaction.vue"]]),so=me({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(n,{expose:o}){const t=n;o();let e=null;const i=p(null),s=p({}),r=p([]),u=()=>{const f=Math.floor((i.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return f>0?f:1},l=f=>new Array(f).fill(null).map(()=>[]),a=async f=>{var S;if(f>=t.items.length)return;await Fe();const R=Array.from(((S=i.value)==null?void 0:S.children)??[]).reduce((_,L)=>L.getBoundingClientRect().height<_.getBoundingClientRect().height?L:_);r.value[Number(R.dataset.index)].push(f),await a(f+1)},g=async(f=!1)=>{if(r.value.length===u()&&!f)return;r.value=l(u());const S=window.scrollY;await a(0),window.scrollTo({top:S})},b=f=>{s.value[f.target.src]=!0};we(()=>{g(!0),e=new ResizeObserver(()=>{g()}),e.observe(i.value),Q(()=>[t.items],()=>{s.value={},g(!0)}),Q(()=>[t.columnWidth,t.gap],()=>{g()})}),Ht(()=>e.unobserve(i.value));const j={props:t,get resizeObserver(){return e},set resizeObserver(f){e=f},wall:i,state:s,columns:r,getColumnCount:u,createColumns:l,fillColumns:a,redraw:g,imageLoad:b,get LoadingIcon(){return ke}};return Object.defineProperty(j,"__isScriptSetup",{enumerable:!1,value:!0}),j}});const co=["data-index"],uo=["src","title","onClick"];function mo(n,o,t,e,i,s){return c(),d("div",{ref:"wall",class:"wl-gallery",style:Oe({gap:`${t.gap}px`})},[(c(!0),d(V,null,O(e.columns,(r,u)=>(c(),d("div",{key:u,class:"wl-gallery-column","data-index":u,style:Oe({gap:`${t.gap}px`})},[(c(!0),d(V,null,O(r,l=>(c(),d(V,{key:l},[e.state[t.items[l].src]?k("v-if",!0):(c(),$(e.LoadingIcon,{key:0,size:36,style:{margin:"20px auto"}})),m("img",{class:"wl-gallery-item",src:t.items[l].src,title:t.items[l].title,loading:"lazy",onLoad:e.imageLoad,onClick:a=>n.$emit("insert",`![](${t.items[l].src})`)},null,40,uo)],64))),128))],12,co))),128))],4)}var vo=ve(so,[["render",mo],["__file","ImageWall.vue"]]),go=me({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(n,{expose:o,emit:t}){o();const e=n,i=t,s=Re("config"),r=On(),u=Fn(),l=_e(),a=p({}),g=p(null),b=p(null),j=p(null),f=p(null),S=p(null),R=p(null),_=p(null),L=p({tabs:[],map:{}}),M=p(0),x=p(!1),q=p(!1),se=p(!1),ce=p(""),oe=p(0),H=Ee({loading:!0,list:[]}),ne=p(0),Z=p(!1),ue=p(""),X=p(!1),le=p(!1),Y=T(()=>s.value.locale),y=T(()=>{var v;return!!((v=l.value)!=null&&v.token)}),E=T(()=>s.value.imageUploader!==!1),N=v=>{const h=g.value,w=h.selectionStart,A=h.selectionEnd||0,F=h.scrollTop;r.value=h.value.substring(0,w)+v+h.value.substring(A,h.value.length),h.focus(),h.selectionStart=w+v.length,h.selectionEnd=w+v.length,h.scrollTop=F},G=v=>{const h=v.key;(v.ctrlKey||v.metaKey)&&h==="Enter"&&Ce()},z=v=>{const h=`![${s.value.locale.uploading} ${v.name}]()`;return N(h),X.value=!0,Promise.resolve().then(()=>s.value.imageUploader(v)).then(w=>{r.value=r.value.replace(h,`\r
![${v.name}](${w})`)}).catch(w=>{alert(w.message),r.value=r.value.replace(h,"")}).then(()=>{X.value=!1})},B=v=>{var h;if((h=v.dataTransfer)!=null&&h.items){const w=dt(v.dataTransfer.items);w&&E.value&&(z(w),v.preventDefault())}},W=v=>{if(v.clipboardData){const h=dt(v.clipboardData.items);h&&E.value&&z(h)}},de=()=>{const v=b.value;v.files&&E.value&&z(v.files[0]).then(()=>{v.value=""})},Ce=async()=>{var v,h,w,A,F,ae;const{serverURL:K,lang:J,login:ge,wordLimit:He,requiredMeta:Pe,recaptchaV3Key:Ne,turnstileKey:De}=s.value,Rt=await Mn(),U={comment:ue.value,nick:u.value.nick,mail:u.value.mail,link:u.value.link,url:s.value.path,ua:Rt};if((v=l.value)!=null&&v.token&&!e.edit)U.nick=l.value.display_name,U.mail=l.value.email,U.link=l.value.url;else{if(ge==="force")return;if(Pe.indexOf("nick")>-1&&!U.nick)return(h=a.value.nick)==null||h.focus(),alert(Y.value.nickError);if(Pe.indexOf("mail")>-1&&!U.mail||U.mail&&!yn(U.mail))return(w=a.value.mail)==null||w.focus(),alert(Y.value.mailError);U.nick||(U.nick=Y.value.anonymous)}if(!U.comment){(A=g.value)==null||A.focus();return}if(!Z.value)return alert(Y.value.wordHint.replace("$0",He[0].toString()).replace("$1",He[1].toString()).replace("$2",oe.value.toString()));U.comment=mt(U.comment,L.value.map),e.replyId&&e.rootId&&(U.pid=e.replyId,U.rid=e.rootId,U.at=e.replyUser),X.value=!0;try{Ne&&(U.recaptchaV3=await Zn(Ne).execute("social")),De&&(U.turnstile=await Xn(De).execute("social"));const he={serverURL:K,lang:J,token:(F=l.value)==null?void 0:F.token,comment:U},Le=await(e.edit?fe({objectId:e.edit.objectId,...he}):xt(he));if(X.value=!1,Le.errmsg)return alert(Le.errmsg);i("submit",Le.data),r.value="",ce.value="",await Fe(),e.replyId&&i("cancelReply"),(ae=e.edit)!=null&&ae.objectId&&i("cancelEdit")}catch(he){X.value=!1,alert(he.message)}},Ie=v=>{v.preventDefault();const{lang:h,serverURL:w}=s.value;jt({serverURL:w,lang:h}).then(A=>{l.value=A,(A.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(A)),i("log")})},Ct=()=>{l.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),i("log")},It=v=>{v.preventDefault();const{lang:h,serverURL:w}=s.value,A=800,F=800,ae=(window.innerWidth-A)/2,K=(window.innerHeight-F)/2,J=new URLSearchParams({lng:h,token:l.value.token}),ge=window.open(`${w}/ui/profile?${J.toString()}`,"_blank",`width=${A},height=${F},left=${ae},top=${K},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);ge==null||ge.postMessage({type:"TOKEN",data:l.value.token},"*")},ze=v=>{var h,w,A,F;!((h=j.value)!=null&&h.contains(v.target))&&!((w=f.value)!=null&&w.contains(v.target))&&(x.value=!1),!((A=S.value)!=null&&A.contains(v.target))&&!((F=R.value)!=null&&F.contains(v.target))&&(q.value=!1)},Te=async v=>{var h;const{scrollTop:w,clientHeight:A,scrollHeight:F}=v.target,ae=(A+w)/F,K=s.value.search,J=((h=_.value)==null?void 0:h.value)??"";ae<.9||H.loading||le.value||(H.loading=!0,(K.more&&H.list.length?await K.more(J,H.list.length):await K.search(J)).length?H.list=[...H.list,...K.more&&H.list.length?await K.more(J,H.list.length):await K.search(J)]:le.value=!0,H.loading=!1,setTimeout(()=>{v.target.scrollTop=w},50))},Lt=Ot(v=>{H.list=[],le.value=!1,Te(v)},300);Q([s,oe],([v,h])=>{const{wordLimit:w}=v;w?h<w[0]&&w[0]!==0?(ne.value=w[0],Z.value=!1):h>w[1]?(ne.value=w[1],Z.value=!1):(ne.value=w[1],Z.value=!0):(ne.value=0,Z.value=!0)},{immediate:!0}),Ke("click",ze),Ke("message",({data:v})=>{!v||v.type!=="profile"||(l.value={...l.value,...v.data},[localStorage,sessionStorage].filter(h=>h.getItem("WALINE_USER")).forEach(h=>h.setItem("WALINE_USER",JSON.stringify(l))))}),Q(q,async v=>{var h;if(!v)return;const w=s.value.search;_.value&&(_.value.value=""),H.loading=!0,H.list=await(((h=w.default)==null?void 0:h.call(w))??w.search("")),H.loading=!1}),we(()=>{var v;(v=e.edit)!=null&&v.objectId&&(r.value=e.edit.orig),Q(()=>r.value,h=>{const{highlighter:w,texRenderer:A}=s.value;ue.value=h,ce.value=En(h,{emojiMap:L.value.map,highlighter:w,texRenderer:A}),oe.value=jn(h),h?Ze(g.value):Ze.destroy(g.value)},{immediate:!0}),Q(()=>s.value.emoji,h=>kn(h).then(w=>{L.value=w}),{immediate:!0})});const Ve={props:e,emit:i,config:s,editor:r,userMeta:u,userInfo:l,inputRefs:a,editorRef:g,imageUploadRef:b,emojiButtonRef:j,emojiPopupRef:f,gifButtonRef:S,gifPopupRef:R,gifSearchInputRef:_,emoji:L,emojiTabIndex:M,showEmoji:x,showGif:q,showPreview:se,previewText:ce,wordNumber:oe,searchResults:H,wordLimit:ne,isWordNumberLegal:Z,content:ue,isSubmitting:X,isImageListEnd:le,locale:Y,isLogin:y,canUploadImage:E,insert:N,onKeyDown:G,uploadImage:z,onDrop:B,onPaste:W,onChange:de,submitComment:Ce,onLogin:Ie,onLogout:Ct,onProfile:It,popupHandler:ze,onImageWallScroll:Te,onGifSearch:Lt,get CloseIcon(){return An},get EmojiIcon(){return zn},get GifIcon(){return Bn},get ImageIcon(){return Tn},get LoadingIcon(){return ke},get MarkdownIcon(){return Pn},get PreviewIcon(){return Hn},ImageWall:vo};return Object.defineProperty(Ve,"__isScriptSetup",{enumerable:!1,value:!0}),Ve}});const ho={key:0,class:"wl-login-info"},fo={class:"wl-avatar"},wo=["title"],yo=["title"],bo=["src"],po=["title","textContent"],ko={class:"wl-panel"},_o=["for","textContent"],Co=["id","onUpdate:modelValue","name","type"],Io=["placeholder"],Lo={class:"wl-preview"},Ro=m("hr",null,null,-1),Eo=["innerHTML"],So={class:"wl-footer"},xo={class:"wl-actions"},jo={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},Mo=["title"],Ao=["title"],Uo=["title"],zo=["title"],To={class:"wl-info"},Vo=m("div",{class:"wl-captcha-container"},null,-1),Ho={class:"wl-text-number"},Po={key:0},No=["textContent"],Do=["textContent"],Wo=["disabled"],Bo=["placeholder"],Fo={key:1,class:"wl-loading"},Oo={key:0,class:"wl-tab-wrapper"},qo=["title","onClick"],Go=["src","alt"],Ko={key:0,class:"wl-tabs"},Zo=["onClick"],Xo=["src","alt","title"],Yo=["title"];function Jo(n,o,t,e,i,s){var r,u;return c(),d("div",{key:e.userInfo.token,class:"wl-comment"},[e.config.login!=="disable"&&e.isLogin&&!((r=t.edit)!=null&&r.objectId)?(c(),d("div",ho,[m("div",fo,[m("button",{type:"submit",class:"wl-logout-btn",title:e.locale.logout,onClick:e.onLogout},[D(e.CloseIcon,{size:14})],8,wo),m("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:e.onProfile},[m("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,bo)],8,yo)]),m("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:e.onProfile,textContent:I(e.userInfo.display_name)},null,8,po)])):k("v-if",!0),m("div",ko,[e.config.login!=="force"&&e.config.meta.length&&!e.isLogin?(c(),d("div",{key:0,class:P(["wl-header",`item${e.config.meta.length}`])},[(c(!0),d(V,null,O(e.config.meta,l=>(c(),d("div",{key:l,class:"wl-header-item"},[m("label",{for:`wl-${l}`,textContent:I(e.locale[l]+(e.config.requiredMeta.includes(l)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,_o),ye(m("input",{id:`wl-${l}`,ref_for:!0,ref:a=>{a&&(e.inputRefs[l]=a)},"onUpdate:modelValue":a=>e.userMeta[l]=a,class:P(["wl-input",`wl-${l}`]),name:l,type:l==="mail"?"email":"text"},null,10,Co),[[Pt,e.userMeta[l]]])]))),128))],2)):k("v-if",!0),ye(m("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":o[0]||(o[0]=l=>e.editor=l),class:"wl-editor",placeholder:t.replyUser?`@${t.replyUser}`:e.locale.placeholder,onKeydown:e.onKeyDown,onDrop:e.onDrop,onPaste:e.onPaste},null,40,Io),[[Nt,e.editor]]),ye(m("div",Lo,[Ro,m("h4",null,I(e.locale.preview)+":",1),m("div",{class:"wl-content",innerHTML:e.previewText},null,8,Eo)],512),[[qe,e.showPreview]]),m("div",So,[m("div",xo,[m("a",jo,[D(e.MarkdownIcon)]),ye(m("button",{ref:"emojiButtonRef",type:"button",class:P(["wl-action",{active:e.showEmoji}]),title:e.locale.emoji,onClick:o[1]||(o[1]=l=>e.showEmoji=!e.showEmoji)},[D(e.EmojiIcon)],10,Mo),[[qe,e.emoji.tabs.length]]),e.config.search?(c(),d("button",{key:0,ref:"gifButtonRef",type:"button",class:P(["wl-action",{active:e.showGif}]),title:e.locale.gif,onClick:o[2]||(o[2]=l=>e.showGif=!e.showGif)},[D(e.GifIcon)],10,Ao)):k("v-if",!0),m("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:e.onChange},null,544),e.canUploadImage?(c(),d("label",{key:1,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[D(e.ImageIcon)],8,Uo)):k("v-if",!0),m("button",{type:"button",class:P(["wl-action",{active:e.showPreview}]),title:e.locale.preview,onClick:o[3]||(o[3]=l=>e.showPreview=!e.showPreview)},[D(e.PreviewIcon)],10,zo)]),m("div",To,[Vo,m("div",Ho,[ee(I(e.wordNumber)+" ",1),e.config.wordLimit?(c(),d("span",Po,[ee("  /  "),m("span",{class:P({illegal:!e.isWordNumberLegal}),textContent:I(e.wordLimit)},null,10,No)])):k("v-if",!0),ee("  "+I(e.locale.word),1)]),e.config.login!=="disable"&&!e.isLogin?(c(),d("button",{key:0,type:"button",class:"wl-btn",onClick:e.onLogin,textContent:I(e.locale.login)},null,8,Do)):k("v-if",!0),e.config.login!=="force"||e.isLogin?(c(),d("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:e.submitComment},[e.isSubmitting?(c(),$(e.LoadingIcon,{key:0,size:16})):(c(),d(V,{key:1},[ee(I(e.locale.submit),1)],64))],8,Wo)):k("v-if",!0)]),m("div",{ref:"gifPopupRef",class:P(["wl-gif-popup",{display:e.showGif}])},[m("input",{ref:"gifSearchInputRef",type:"text",placeholder:e.locale.gifSearchPlaceholder,onInput:o[4]||(o[4]=(...l)=>e.onGifSearch&&e.onGifSearch(...l))},null,40,Bo),e.searchResults.list.length?(c(),$(e.ImageWall,{key:0,items:e.searchResults.list,"column-width":200,gap:6,onInsert:o[5]||(o[5]=l=>e.insert(l)),onScroll:e.onImageWallScroll},null,8,["items"])):k("v-if",!0),e.searchResults.loading?(c(),d("div",Fo,[D(e.LoadingIcon,{size:30})])):k("v-if",!0)],2),m("div",{ref:"emojiPopupRef",class:P(["wl-emoji-popup",{display:e.showEmoji}])},[(c(!0),d(V,null,O(e.emoji.tabs,(l,a)=>(c(),d(V,{key:l.name},[a===e.emojiTabIndex?(c(),d("div",Oo,[(c(!0),d(V,null,O(l.items,g=>(c(),d("button",{key:g,type:"button",title:g,onClick:b=>e.insert(`:${g}:`)},[e.showEmoji?(c(),d("img",{key:0,class:"wl-emoji",src:e.emoji.map[g],alt:g,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Go)):k("v-if",!0)],8,qo))),128))])):k("v-if",!0)],64))),128)),e.emoji.tabs.length>1?(c(),d("div",Ko,[(c(!0),d(V,null,O(e.emoji.tabs,(l,a)=>(c(),d("button",{key:l.name,type:"button",class:P(["wl-tab",{active:e.emojiTabIndex===a}]),onClick:g=>e.emojiTabIndex=a},[m("img",{class:"wl-emoji",src:l.icon,alt:l.name,title:l.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Xo)],10,Zo))),128))])):k("v-if",!0)],2)])]),t.replyId||(u=t.edit)!=null&&u.objectId?(c(),d("button",{key:1,type:"button",class:"wl-close",title:e.locale.cancelReply,onClick:o[6]||(o[6]=l=>t.replyId?e.emit("cancelReply"):e.emit("cancelEdit"))},[D(e.CloseIcon,{size:24})],8,Yo)):k("v-if",!0)])}var bt=ve(go,[["render",Jo],["__file","CommentBox.vue"]]),Qo=me({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(n,{expose:o,emit:t}){o();const e=n,i=t,s=["approved","waiting","spam"],r=Re("config"),u=ht(),l=qt(),a=_e(),g=T(()=>r.value.locale),b=T(()=>{const{link:x}=e.comment;return x?st(x)?x:`https://${x}`:""}),j=T(()=>u.value.includes(e.comment.objectId)),f=T(()=>fn(new Date(e.comment.time),l.value,g.value)),S=T(()=>a.value.type==="administrator"),R=T(()=>e.comment.user_id&&a.value.objectId===e.comment.user_id),_=T(()=>{var x;return e.comment.objectId===((x=e.reply)==null?void 0:x.objectId)}),L=T(()=>{var x;return e.comment.objectId===((x=e.edit)==null?void 0:x.objectId)}),M={props:e,emit:i,commentStatus:s,config:r,likes:u,now:l,userInfo:a,locale:g,link:b,like:j,time:f,isAdmin:S,isOwner:R,isReplyingCurrent:_,isEditingCurrent:L,CommentBox:bt,get DeleteIcon(){return Un},get EditIcon(){return Dn},get LikeIcon(){return Vn},get ReplyIcon(){return Nn},get VerifiedIcon(){return Wn}};return Object.defineProperty(M,"__isScriptSetup",{enumerable:!1,value:!0}),M}});const $o=["id"],el={class:"wl-user","aria-hidden":"true"},tl=["src"],nl={class:"wl-card"},ol={class:"wl-head"},ll=["href"],al={key:1,class:"wl-nick"},il=["textContent"],rl=["textContent"],sl=["textContent"],cl=["textContent"],ul=["textContent"],dl={class:"wl-comment-actions"},ml=["title"],vl=["title"],gl={class:"wl-meta","aria-hidden":"true"},hl=["data-value","textContent"],fl={key:0,class:"wl-content"},wl={key:0},yl=["href"],bl=m("span",null,": ",-1),pl=["innerHTML"],kl={key:1,class:"wl-admin-actions"},_l={class:"wl-comment-status"},Cl=["disabled","onClick","textContent"],Il={key:3,class:"wl-quote"};function Ll(n,o,t,e,i,s){var u;const r=Dt("CommentCard",!0);return c(),d("div",{id:t.comment.objectId,class:"wl-card-item"},[m("div",el,[t.comment.avatar?(c(),d("img",{key:0,class:"wl-user-avatar",src:t.comment.avatar},null,8,tl)):k("v-if",!0),t.comment.type?(c(),$(e.VerifiedIcon,{key:1})):k("v-if",!0)]),m("div",nl,[m("div",ol,[e.link?(c(),d("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noopener noreferrer"},I(t.comment.nick),9,ll)):(c(),d("span",al,I(t.comment.nick),1)),t.comment.type==="administrator"?(c(),d("span",{key:2,class:"wl-badge",textContent:I(e.locale.admin)},null,8,il)):k("v-if",!0),t.comment.label?(c(),d("span",{key:3,class:"wl-badge",textContent:I(t.comment.label)},null,8,rl)):k("v-if",!0),t.comment.sticky?(c(),d("span",{key:4,class:"wl-badge",textContent:I(e.locale.sticky)},null,8,sl)):k("v-if",!0),typeof t.comment.level=="number"?(c(),d("span",{key:5,class:P(`wl-badge level${t.comment.level}`),textContent:I(e.locale[`level${t.comment.level}`]||`Level ${t.comment.level}`)},null,10,cl)):k("v-if",!0),m("span",{class:"wl-time",textContent:I(e.time)},null,8,ul),m("div",dl,[e.isAdmin||e.isOwner?(c(),d(V,{key:0},[m("button",{type:"button",class:"wl-edit",onClick:o[0]||(o[0]=l=>e.emit("edit",t.comment))},[D(e.EditIcon)]),m("button",{type:"button",class:"wl-delete",onClick:o[1]||(o[1]=l=>e.emit("delete",t.comment))},[D(e.DeleteIcon)])],64)):k("v-if",!0),m("button",{type:"button",class:"wl-like",title:e.like?e.locale.cancelLike:e.locale.like,onClick:o[2]||(o[2]=l=>e.emit("like",t.comment))},[D(e.LikeIcon,{active:e.like},null,8,["active"]),ee(" "+I("like"in t.comment?t.comment.like:""),1)],8,ml),m("button",{type:"button",class:P(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:o[3]||(o[3]=l=>e.emit("reply",e.isReplyingCurrent?null:t.comment))},[D(e.ReplyIcon)],10,vl)])]),m("div",gl,[(c(),d(V,null,O(["addr","browser","os"],l=>(c(),d(V,null,[t.comment[l]?(c(),d("span",{key:l,class:P(`wl-${l}`),"data-value":t.comment[l],textContent:I(t.comment[l])},null,10,hl)):k("v-if",!0)],64))),64))]),e.isEditingCurrent?k("v-if",!0):(c(),d("div",fl,[t.comment.reply_user?(c(),d("p",wl,[m("a",{href:"#"+t.comment.pid},"@"+I(t.comment.reply_user.nick),9,yl),bl])):k("v-if",!0),m("div",{innerHTML:t.comment.comment},null,8,pl)])),e.isAdmin&&!e.isEditingCurrent?(c(),d("div",kl,[m("span",_l,[(c(),d(V,null,O(e.commentStatus,l=>m("button",{key:l,type:"submit",class:P(`wl-btn wl-${l}`),disabled:t.comment.status===l,onClick:a=>e.emit("status",{status:l,comment:t.comment}),textContent:I(e.locale[l])},null,10,Cl)),64))]),e.isAdmin&&!("rid"in t.comment)?(c(),d("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:o[4]||(o[4]=l=>e.emit("sticky",t.comment))},I(t.comment.sticky?e.locale.unsticky:e.locale.sticky),1)):k("v-if",!0)])):k("v-if",!0),e.isReplyingCurrent||e.isEditingCurrent?(c(),d("div",{key:2,class:P({"wl-reply-wrapper":e.isReplyingCurrent,"wl-edit-wrapper":e.isEditingCurrent})},[D(e.CommentBox,{edit:t.edit,"reply-id":(u=t.reply)==null?void 0:u.objectId,"reply-user":t.comment.nick,"root-id":t.rootId,onLog:o[5]||(o[5]=l=>e.emit("log")),onCancelReply:o[6]||(o[6]=l=>e.emit("reply",null)),onCancelEdit:o[7]||(o[7]=l=>e.emit("edit",null)),onSubmit:o[8]||(o[8]=l=>e.emit("submit",l))},null,8,["edit","reply-id","reply-user","root-id"])],2)):k("v-if",!0),"children"in t.comment?(c(),d("div",Il,[(c(!0),d(V,null,O(t.comment.children,l=>(c(),$(r,{key:l.objectId,comment:l,reply:t.reply,edit:t.edit,"root-id":t.rootId,onLog:o[9]||(o[9]=a=>e.emit("log")),onDelete:o[10]||(o[10]=a=>e.emit("delete",a)),onEdit:o[11]||(o[11]=a=>e.emit("edit",a)),onLike:o[12]||(o[12]=a=>e.emit("like",a)),onReply:o[13]||(o[13]=a=>e.emit("reply",a)),onStatus:o[14]||(o[14]=a=>e.emit("status",a)),onSticky:o[15]||(o[15]=a=>e.emit("sticky",a)),onSubmit:o[16]||(o[16]=a=>e.emit("submit",a))},null,8,["comment","reply","edit","root-id"]))),128))])):k("v-if",!0)])],8,$o)}var Rl=ve(Qo,[["render",Ll],["__file","CommentCard.vue"]]);const pt="3.2.6";var El=me({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(n,{expose:o}){o();const t=n,e={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},i=Object.keys(e),s=_e(),r=ht(),u=p("loading"),l=p(0),a=p(1),g=p(0),b=T(()=>vn(t)),j=p(b.value.commentSorting),f=p([]),S=p(null),R=p(null),_=T(()=>gn(b.value.dark)),L=T(()=>b.value.locale);Gt(_,{id:"waline-darkmode"});let M;const x=y=>{var E;const{serverURL:N,path:G,pageSize:z}=b.value,B=new AbortController;u.value="loading",M==null||M(),Mt({serverURL:N,lang:b.value.lang,path:G,pageSize:z,sortBy:e[j.value],page:y,signal:B.signal,token:(E=s.value)==null?void 0:E.token}).then(W=>{u.value="success",l.value=W.count,f.value.push(...W.data),a.value=y,g.value=W.totalPages}).catch(W=>{W.name!=="AbortError"&&(console.error(W.message),u.value="error")}),M=B.abort.bind(B)},q=()=>x(a.value+1),se=()=>{l.value=0,f.value=[],x(1)},ce=y=>{j.value!==y&&(j.value=y,se())},oe=y=>{S.value=y},H=y=>{R.value=y},ne=y=>{if(R.value)R.value.comment=y.comment,R.value.orig=y.orig;else if("rid"in y){const E=f.value.find(({objectId:N})=>N===y.rid);if(!E)return;Array.isArray(E.children)||(E.children=[]),E.children.push(y)}else f.value.unshift(y),l.value+=1},Z=async({comment:y,status:E})=>{var N;if(y.status===E)return;const{serverURL:G,lang:z}=b.value;await fe({serverURL:G,lang:z,token:(N=s.value)==null?void 0:N.token,objectId:y.objectId,comment:{status:E}}),y.status=E},ue=async y=>{var E;if("rid"in y)return;const{serverURL:N,lang:G}=b.value;await fe({serverURL:N,lang:G,token:(E=s.value)==null?void 0:E.token,objectId:y.objectId,comment:{sticky:y.sticky?0:1}}),y.sticky=!y.sticky},X=async({objectId:y})=>{var E;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:N,lang:G}=b.value;await At({serverURL:N,lang:G,token:(E=s.value)==null?void 0:E.token,objectId:y}),f.value.some((z,B)=>z.objectId===y?(f.value=f.value.filter((W,de)=>de!==B),!0):z.children.some((W,de)=>W.objectId===y?(f.value[B].children=z.children.filter((Ce,Ie)=>Ie!==de),!0):!1))},le=async y=>{var E;const{serverURL:N,lang:G}=b.value,{objectId:z}=y,B=r.value.includes(z);await fe({serverURL:N,lang:G,objectId:z,token:(E=s.value)==null?void 0:E.token,comment:{like:!B}}),B?r.value=r.value.filter(W=>W!==z):(r.value=[...r.value,z],r.value.length>50&&(r.value=r.value.slice(-50))),y.like=(y.like||0)+(B?-1:1)};Wt("config",b),we(()=>{Q(()=>[t.serverURL,t.path],()=>se(),{immediate:!0})}),Be(()=>M==null?void 0:M());const Y={props:t,sortKeyMap:e,sortingMethods:i,userInfo:s,likeStorage:r,status:u,count:l,page:a,totalPages:g,config:b,commentSortingRef:j,data:f,reply:S,edit:R,darkmodeStyle:_,i18n:L,get abort(){return M},set abort(y){M=y},getCommentData:x,loadMore:q,refresh:se,onSortByChange:ce,onReply:oe,onEdit:H,onSubmit:ne,onStatusChange:Z,onSticky:ue,onDelete:X,onLike:le,Reaction:ro,CommentBox:bt,CommentCard:Rl,get LoadingIcon(){return ke},get version(){return pt}};return Object.defineProperty(Y,"__isScriptSetup",{enumerable:!1,value:!0}),Y}});const Sl={"data-waline":""},xl={class:"wl-meta-head"},jl={class:"wl-count"},Ml=["textContent"],Al={class:"wl-sort"},Ul=["onClick"],zl={class:"wl-cards"},Tl={key:1,class:"wl-operation"},Vl=["textContent"],Hl={key:2,class:"wl-loading"},Pl=["textContent"],Nl={key:4,class:"wl-operation"},Dl=["textContent"],Wl={key:5,class:"wl-power"},Bl=m("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);function Fl(n,o,t,e,i,s){return c(),d("div",Sl,[D(e.Reaction),e.reply?k("v-if",!0):(c(),$(e.CommentBox,{key:0,onLog:e.refresh,onSubmit:e.onSubmit})),m("div",xl,[m("div",jl,[e.count?(c(),d("span",{key:0,class:"wl-num",textContent:I(e.count)},null,8,Ml)):k("v-if",!0),ee(" "+I(e.i18n.comment),1)]),m("ul",Al,[(c(!0),d(V,null,O(e.sortingMethods,r=>(c(),d("li",{key:r,class:P([r===e.commentSortingRef?"active":""]),onClick:u=>e.onSortByChange(r)},I(e.i18n[r]),11,Ul))),128))])]),m("div",zl,[(c(!0),d(V,null,O(e.data,r=>(c(),$(e.CommentCard,{key:r.objectId,"root-id":r.objectId,comment:r,reply:e.reply,edit:e.edit,onLog:e.refresh,onReply:e.onReply,onEdit:e.onEdit,onSubmit:e.onSubmit,onStatus:e.onStatusChange,onDelete:e.onDelete,onSticky:e.onSticky,onLike:e.onLike},null,8,["root-id","comment","reply","edit"]))),128))]),e.status==="error"?(c(),d("div",Tl,[m("button",{type:"button",class:"wl-btn",onClick:e.refresh,textContent:I(e.i18n.refresh)},null,8,Vl)])):e.status==="loading"?(c(),d("div",Hl,[D(e.LoadingIcon,{size:30})])):e.data.length?e.page<e.totalPages?(c(),d("div",Nl,[m("button",{type:"button",class:"wl-btn",onClick:e.loadMore,textContent:I(e.i18n.more)},null,8,Dl)])):k("v-if",!0):(c(),d("div",{key:3,class:"wl-empty",textContent:I(e.i18n.sofa)},null,8,Pl)),e.config.copyright?(c(),d("div",Wl,[ee(" Powered by "),Bl,ee(" v"+I(e.version),1)])):k("v-if",!0)])}var Ol=ve(El,[["render",Fl],["__file","WalineComment.vue"]]);const kt=(n,o)=>{o.forEach((t,e)=>{const i=n[e].time;typeof i=="number"&&(t.innerText=i.toString())})},_t=({serverURL:n,path:o=window.location.pathname,selector:t=".waline-pageview-count",update:e=!0,lang:i=navigator.language})=>{const s=new AbortController,r=Array.from(document.querySelectorAll(t)),u=a=>{const g=Ue(a);return g!==null&&o!==g},l=a=>zt({serverURL:pe(n),paths:a.map(g=>Ue(g)??o),lang:i,signal:s.signal}).then(g=>kt(g,a)).catch(ut);if(e){const a=r.filter(b=>!u(b)),g=r.filter(u);Ut({serverURL:pe(n),path:o,lang:i}).then(b=>kt(b,a)),g.length&&l(g)}else l(r);return s.abort.bind(s)},ql=({el:n="#waline",path:o=window.location.pathname,comment:t=!1,pageview:e=!1,...i})=>{const s=n?Ae(n):null;if(n&&!s)throw new Error("Option 'el' do not match any domElement!");if(!i.serverURL)throw new Error("Option 'serverURL' is missing!");const r=Ee({...i}),u=Ee({comment:t,pageview:e,path:o}),l=()=>{u.comment&&vt({serverURL:r.serverURL,path:u.path,...re(u.comment)?{selector:u.comment}:{}})},a=()=>{u.pageview&&_t({serverURL:r.serverURL,path:u.path,...re(u.pageview)?{selector:u.pageview}:{}})},g=s?Bt(()=>C(Ol,{path:u.path,...r})):null;g&&g.mount(s);const b=Ge(l),j=Ge(a);return{el:s,update:({comment:f,pageview:S,path:R=window.location.pathname,..._}={})=>{Object.entries(_).forEach(([L,M])=>{r[L]=M}),u.path=R,f!==void 0&&(u.comment=f),S!==void 0&&(u.pageview=S)},destroy:()=>{g==null||g.unmount(),b(),j()}}},Gl=({el:n,serverURL:o,count:t,lang:e=navigator.language})=>{var i;const s=_e(),r=Ae(n),u=new AbortController;return Tt({serverURL:o,count:t,lang:e,signal:u.signal,token:(i=s.value)==null?void 0:i.token}).then(l=>r&&l.length?(r.innerHTML=`<ul class="wl-recent-list">${l.map(a=>`<li class="wl-recent-item"><a href="${a.url}">${a.nick}</a>:${a.comment}</li>`).join("")}</ul>`,{comments:l,destroy:()=>{u.abort(),r.innerHTML=""}}):{comments:l,destroy:()=>u.abort()})},Kl=({el:n,serverURL:o,count:t,locale:e,lang:i=navigator.language,mode:s="list"})=>{const r=Ae(n),u=new AbortController;return Vt({serverURL:o,pageSize:t,lang:i,signal:u.signal}).then(l=>!r||!l.length?{users:l,destroy:()=>u.abort()}:(e={...at(i),...typeof e=="object"?e:{}},r.innerHTML=`<ul class="wl-user-${s}">${l.map((a,g)=>[`<li class="wl-user-item" aria-label="${a.nick}">`,a.link&&`<a href="${a.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${a.avatar}" alt="${a.nick}">`,`<span class="wl-user-badge">${g+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',a.nick,a.level&&`<span class="wl-badge">${e?e[`level${a.level}`]:`Level ${a.level}`}</span>`,a.label&&`<span class="wl-badge">${a.label}</span>`,"</div>",a.link&&a.link,"</div>",a.link&&"</a>","</li>"].filter(b=>b).join("")).join("")}</ul>`,{users:l,destroy:()=>{u.abort(),r.innerHTML=""}}))};export{Gl as RecentComments,Kl as UserList,vt as commentCount,be as defaultLocales,ql as init,_t as pageviewCount,pt as version};
//# sourceMappingURL=slim.js.map
{
"name": "@waline/client",
"version": "3.2.5",
"version": "3.2.6",
"description": "client for waline comment system",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc