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

@waline/client

Package Overview
Dependencies
Maintainers
2
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 2.3.1 to 2.3.2

2

dist/component.esm.js

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

import{getCurrentScope as e,onScopeDispose as t,ref as n,unref as o,isRef as l,watch as r,readonly as a,shallowRef as i,h as s,computed as c,defineComponent as u,inject as m,onMounted as d,onUnmounted as p,resolveComponent as v,openBlock as g,createElementBlock as f,createElementVNode as w,createVNode as h,toDisplayString as y,createCommentVNode as b,normalizeClass as k,Fragment as C,renderList as $,withDirectives as I,vModelDynamic as x,vModelText as j,vShow as S,createTextVNode as E,createBlock as L,provide as R}from"vue";import A from"autosize";import{marked as z}from"marked";function M(n){return!!e()&&(t(n),!0)}const O="undefined"!=typeof window,P=()=>{};const U=e=>e();var N=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;function F(e,t,n={}){const o=n,{eventFilter:l=U}=o,a=((e,t)=>{var n={};for(var o in e)_.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&N)for(var o of N(e))t.indexOf(o)<0&&B.call(e,o)&&(n[o]=e[o]);return n})(o,["eventFilter"]);return r(e,(i=l,s=t,function(...e){i((()=>s.apply(this,e)),{fn:s,thisArg:this,args:e})}),a);var i,s}var T=Object.defineProperty,D=Object.defineProperties,W=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,J=(e,t,n)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function K(e,t,o={}){const l=o,{eventFilter:r}=l,a=((e,t)=>{var n={};for(var o in e)V.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&H)for(var o of H(e))t.indexOf(o)<0&&q.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:s,resume:c,isActive:u}=function(e=U){const t=n(!0);return{isActive:t,pause:function(){t.value=!1},resume:function(){t.value=!0},eventFilter:(...n)=>{t.value&&e(...n)}}}(r),m=F(e,t,(d=((e,t)=>{for(var n in t||(t={}))V.call(t,n)&&J(e,n,t[n]);if(H)for(var n of H(t))q.call(t,n)&&J(e,n,t[n]);return e})({},a),D(d,W({eventFilter:i}))));var d;return{stop:m,pause:s,resume:c,isActive:u}}const Y=O?window:void 0,G=O?window.document:void 0;function X(...e){let t,n,l,a;if("string"==typeof e[0]?([n,l,a]=e,t=Y):[t,n,l,a]=e,!t)return P;let i=P;const s=r((()=>function(e){var t;const n=o(e);return null!=(t=null==n?void 0:n.$el)?t:n}(t)),(e=>{i(),e&&(e.addEventListener(n,l,a),i=()=>{e.removeEventListener(n,l,a),i=P})}),{immediate:!0,flush:"post"}),c=()=>{s(),i()};return M(c),c}O&&window.navigator,O&&window.location;const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Z="__vueuse_ssr_handlers__";Q[Z]=Q[Z]||{};const ee=Q[Z];const te={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function ne(e,t,l,r={}){var a;const{flush:s="pre",deep:c=!0,listenToStorageChanges:u=!0,writeDefaults:m=!0,shallow:d,window:p=Y,eventFilter:v,onError:g=(e=>{console.error(e)})}=r,f=(d?i:n)(t);if(!l)try{l=function(e,t){return ee[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=Y)?void 0:e.localStorage}))()}catch(e){g(e)}if(!l)return f;const w=o(t),h=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(w),y=null!=(a=r.serializer)?a:te[h],{pause:b,resume:k}=K(f,(()=>function(t){try{null==t?l.removeItem(e):l.setItem(e,y.write(t))}catch(e){g(e)}}(f.value)),{flush:s,deep:c,eventFilter:v});return p&&u&&X(p,"storage",C),C(),f;function C(t){t&&t.key!==e||(f.value=function(t){if(!t||t.key===e){b();try{const n=t?t.newValue:l.getItem(e);return null==n?(m&&null!==w&&l.setItem(e,y.write(w)),w):"string"!=typeof n?n:y.read(n)}catch(e){g(e)}finally{k()}}}(t))}}var oe,le,re=Object.defineProperty,ae=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,ce=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function ue(e={}){const{controls:t=!1,interval:a="requestAnimationFrame"}=e,i=n(new Date),s=()=>i.value=new Date,c="requestAnimationFrame"===a?function(e,t={}){const{immediate:o=!0,window:l=Y}=t,r=n(!1);let a=null;function i(){r.value&&l&&(e(),a=l.requestAnimationFrame(i))}function s(){!r.value&&l&&(r.value=!0,i())}function c(){r.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return o&&s(),M(c),{isActive:r,pause:c,resume:s}}(s,{immediate:!0}):function(e,t=1e3,a={}){const{immediate:i=!0,immediateCallback:s=!1}=a;let c=null;const u=n(!1);function m(){c&&(clearInterval(c),c=null)}function d(){u.value=!1,m()}function p(){t<=0||(u.value=!0,s&&e(),m(),c=setInterval(e,o(t)))}i&&O&&p(),l(t)&&M(r(t,(()=>{i&&O&&p()})));return M(d),{isActive:u,pause:d,resume:p}}(s,a,{immediate:!0});return t?((e,t)=>{for(var n in t||(t={}))ie.call(t,n)&&ce(e,n,t[n]);if(ae)for(var n of ae(t))se.call(t,n)&&ce(e,n,t[n]);return e})({now:i},c):i}O&&(null==window?void 0:window.navigator)&&(null==(oe=null==window?void 0:window.navigator)?void 0:oe.platform)&&/iP(ad|hone|od)/.test(null==(le=null==window?void 0:window.navigator)?void 0:le.platform);let me=0;const de=({size:e})=>s("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},s("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},s("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),pe=["nick","mail","link"],ve=e=>e.filter((e=>pe.includes(e))),ge=e=>new Promise(((t,n)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{var e;return t((null===(e=o.result)||void 0===e?void 0:e.toString())||"")},o.onerror=n})),fe=e=>!0===e?'<p class="wl-tex">Tex is not available in preview</p>':'<span class="wl-tex">Tex is not available in preview</span>',we=new RegExp(`(${/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source}|${/</.source})|((?:${/(?:^|\s)\/\/(.+?)$/gm.source})|(?:${/\/\*([\S\s]*?)\*\//gm.source}))`,"gmi"),he=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],ye={},be=e=>{let t=0;return e.replace(we,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;ye[n]?l=ye[n]:(l=he[t],ye[n]=l);const r=`<span style="color: #${l}">${n}</span>`;return t=++t%he.length,r}))},ke=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","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"],Ce=e=>Object.fromEntries(e.map(((e,t)=>[ke[t],e])));var $e=Ce(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","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!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar"]),Ie=Ce(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名"]),xe=Ce(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说"]),je=Ce(["暱稱","郵箱","網址","可選","暱稱不能少於3個字元","請填寫正確的郵件地址","歡迎評論","來發評論吧~","提交","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說"]),Se=Ce(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras","Favor enviar comentário com $0 a $1 palavras!\n Número de palavras atuais: $2","Anônimo"]),Ee=Ce(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный"]);const Le={zh:xe,"zh-cn":xe,"zh-CN":xe,"zh-tw":je,"zh-TW":je,en:$e,"en-US":$e,"en-us":$e,jp:Ie,"jp-jp":Ie,"jp-JP":Ie,"pt-br":Se,"pt-BR":Se,ru:Ee,"ru-ru":Ee,"ru-RU":Ee},Re=e=>{try{e=decodeURI(e)}catch(e){}return e},Ae=(e="")=>e.replace(/\/$/u,""),ze=e=>/^(https?:)?\/\//.test(e),Me=e=>{const t=Ae(e);return ze(t)?t:`https://${t}`},Oe=e=>Array.isArray(e)?e:!!e&&[0,e],Pe=(e,t)=>"function"==typeof e?e:!1!==e&&t,Ue="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",Ne=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},_e=(e,t,n)=>{if(!e)return"";const o="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,l=t.getTime()-o.getTime(),r=Math.floor(l/864e5);if(0===r){const e=l%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,o=Math.floor(t/6e4);if(0===o){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${o} ${n.minutes}`}return`${t} ${n.hours}`}return r<0?n.now:r<8?`${r} ${n.days}`:(e=>{const t=Ne(e.getDate(),2),n=Ne(e.getMonth()+1,2);return`${Ne(e.getFullYear(),2)}-${n}-${t}`})(o)},Be=e=>{const t=ne("WALINE_EMOJI",{}),n=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(n){const n=t.value[e];if(n)return Promise.resolve(n)}return fetch(`${e}/info.json`).then((e=>e.json())).then((o=>{const l={folder:e,...o};return n&&(t.value[e]=l),l}))},Fe=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,Te=({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:r,token:a})=>{const i={};return a&&(i.Authorization=`Bearer ${a}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:r,headers:i}).then((e=>e.json())).then((e=>((e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e})(e,"comment list")))},De=e=>e.type.includes("image"),We=e=>{const t=Array.from(e).find(De);return t?t.getAsFile():null},He=/\$.*?\$/,Ve=/^\$(.*?)\$/,qe=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Je=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),Ke=(e,{emojiMap:t,highlighter:n,texRenderer:o})=>{if(z.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),o){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=qe.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(e){const t=e.search(He);return-1!==t?t:e.length},tokenizer(t){const n=Ve.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(o);z.use({extensions:e})}return z.parse(Je(e,t))},Ye=()=>ne("USER_KEY",{});var Ge=u({name:"CommentBox",components:{CloseIcon:({size:e})=>s("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[s("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"}),s("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"})]),EmojiIcon:()=>s("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},s("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"})),ImageIcon:()=>s("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[s("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"}),s("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"})]),MarkdownIcon:()=>s("svg",{width:"16",height:"16",ariaHidden:"true"},s("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"})),PreviewIcon:()=>s("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[s("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"}),s("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"})]),LoadingIcon:de},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(e,{emit:t}){const o=m("config"),l=ne("WALINE_COMMENT_BOX_EDITOR",""),a=ne("WALINE_USER_META",{nick:"",mail:"",link:""}),i=Ye(),s=n({}),u=n(null),v=n(null),g=n(null),f=n(null),w=n({tabs:[],map:{}}),h=n(0),y=n(!1),b=n(!1),k=n(""),C=n(0),$=n(0),I=n(!1),x=n(""),j=n(!1),S=c((()=>o.value.locale)),E=c((()=>{var e;return Boolean(null===(e=i.value)||void 0===e?void 0:e.token)})),L=c((()=>!1!==o.value.imageUploader)),R=e=>{const t=u.value,n=t.selectionStart,o=t.selectionEnd||0,r=t.scrollTop;l.value=t.value.substring(0,n)+e+t.value.substring(o,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=r},z=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return R(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{l.value=l.value.replace(t,`\r\n![${e.name}](${n})`)}))},M=()=>{var n,r,c,m,d;const{serverURL:p,lang:v,login:g,wordLimit:f,requiredMeta:h}=o.value,y={comment:x.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:o.value.path};if(null===(n=i.value)||void 0===n?void 0:n.token)y.nick=i.value.display_name,y.mail=i.value.email,y.link=i.value.url;else{if("force"===g)return;if(h.indexOf("nick")>-1&&!y.nick)return null===(r=s.value.nick)||void 0===r||r.focus(),alert(S.value.nickError);if(h.indexOf("mail")>-1&&!y.mail||y.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.){0,2}\w+$/.exec(y.mail))return null===(c=s.value.mail)||void 0===c||c.focus(),alert(S.value.mailError);if(!y.comment)return void(null===(m=u.value)||void 0===m||m.focus());y.nick||(y.nick=S.value.anonymous)}if(!I.value)return alert(S.value.wordHint.replace("$0",f[0].toString()).replace("$1",f[1].toString()).replace("$2",C.value.toString()));y.comment=Je(y.comment,w.value.map),e.replyId&&e.rootId&&(y.pid=e.replyId,y.rid=e.rootId,y.at=e.replyUser),j.value=!0,(({serverURL:e,lang:t,token:n,comment:o})=>{const l={"Content-Type":"application/json"};return n&&(l.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:l,body:JSON.stringify(o)}).then((e=>e.json()))})({serverURL:p,lang:v,token:null===(d=i.value)||void 0===d?void 0:d.token,comment:y}).then((n=>{if(j.value=!1,n.errmsg)return alert(n.errmsg);t("submit",n.data),l.value="",k.value="",e.replyId&&t("cancel-reply")})).catch((e=>{j.value=!1,alert(e.message)}))},O=e=>{g.value.contains(e.target)||f.value.contains(e.target)||(y.value=!1)};return r([o,C],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?($.value=n[0],I.value=!1):t>n[1]?($.value=n[1],I.value=!1):($.value=n[1],I.value=!0):($.value=0,I.value=!0)}),{immediate:!0}),d((()=>{document.body.addEventListener("click",O),r((()=>l.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;x.value=e,k.value=Ke(e,{emojiMap:w.value.map,highlighter:t,texRenderer:n}),C.value=(e=>(e=>e.match(/[\w\d\s\u00C0-\u024F]+/giu)||[])(e).reduce(((e,t)=>e+(""===t.trim()?0:t.trim().split(/\s+/u).length)),0)+(e=>e.match(/[\u4E00-\u9FA5]/gu)||[])(e).length)(e),e?A(u.value):A.destroy(u.value)}),{immediate:!0}),r((()=>o.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?Be(Ae(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:r,type:a,items:i}=e;t.tabs.push({name:n,icon:Fe(l,o,r,a),items:i.map((e=>{const n=`${r||""}${e}`;return t.map[n]=Fe(e,o,r,a),n}))})})),t}))).then((e=>{w.value=e}));var t}),{immediate:!0})})),p((()=>{document.body.removeEventListener("click",O)})),{config:o,locale:S,insert:R,onChange:()=>{const e=v.value;e.files&&L.value&&z(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{var t;if(null===(t=e.dataTransfer)||void 0===t?void 0:t.items){const t=We(e.dataTransfer.items);t&&L.value&&(z(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&M()},onPaste:e=>{if(e.clipboardData){const t=We(e.clipboardData.items);t&&L.value&&z(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,r=(window.innerHeight-450)/2,a=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:null},"*");const s=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(null==a||a.close(),i.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",s))};window.addEventListener("message",s)},onLogout:()=>{i.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-800)/2,r=(window.innerHeight-800)/2,a=window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:i.value.token},"*");const s=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))),window.removeEventListener("message",s))};window.addEventListener("message",s)},submitComment:M,isLogin:E,userInfo:i,isSubmitting:j,wordNumber:C,wordLimit:$,isWordNumberLegal:I,editor:l,userMeta:a,emoji:w,emojiTabIndex:h,showEmoji:y,canUploadImage:L,previewText:k,showPreview:b,inputRefs:s,editorRef:u,emojiButtonRef:g,emojiPopupRef:f,imageUploadRef:v}}});const Xe={class:"wl-comment"},Qe={key:0,class:"wl-login-info"},Ze={class:"wl-avatar"},et=["title"],tt=["src"],nt=["textContent"],ot={class:"wl-panel"},lt=["for","textContent"],rt=["id","name","type","onUpdate:modelValue"],at=["placeholder"],it={class:"wl-preview"},st=w("hr",null,null,-1),ct=["innerHTML"],ut={class:"wl-footer"},mt={class:"wl-actions"},dt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},pt=["title"],vt=["title"],gt=["title"],ft={class:"wl-info"},wt={class:"wl-text-number"},ht={key:0},yt=E("  /  "),bt=["textContent"],kt=["textContent"],Ct=["disabled"],$t={key:0,class:"wl-tab-wrapper"},It=["title","onClick"],xt=["src","alt"],jt={key:0,class:"wl-tabs"},St=["onClick"],Et=["src","alt","title"],Lt=["title"];Ge.render=function(e,t,n,o,l,r){const a=v("CloseIcon"),i=v("MarkdownIcon"),s=v("EmojiIcon"),c=v("ImageIcon"),u=v("PreviewIcon"),m=v("LoadingIcon");return g(),f("div",Xe,["disable"!==e.config.login&&e.isLogin?(g(),f("div",Qe,[w("div",Ze,[w("button",{class:"wl-logout-btn",title:e.locale.logout,onClick:t[0]||(t[0]=(...t)=>e.onLogout&&e.onLogout(...t))},[h(a,{size:14})],8,et),w("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,tt)]),w("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",onClick:t[1]||(t[1]=(...t)=>e.onProfile&&e.onProfile(...t)),textContent:y(e.userInfo.display_name)},null,8,nt)])):b("v-if",!0),w("div",ot,["force"!==e.config.login&&e.config.meta.length&&!e.isLogin?(g(),f("div",{key:0,class:k(["wl-header",`item${e.config.meta.length}`])},[(g(!0),f(C,null,$(e.config.meta,(t=>(g(),f("div",{class:"wl-header-item",key:t},[w("label",{for:t,textContent:y(e.locale[t]+(e.config.requiredMeta.includes(t)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,lt),I(w("input",{ref_for:!0,ref:n=>{n&&(e.inputRefs[t]=n)},id:`wl-${t}`,class:k(["wl-input",`wl-${t}`]),name:t,type:"mail"===t?"email":"text","onUpdate:modelValue":n=>e.userMeta[t]=n},null,10,rt),[[x,e.userMeta[t]]])])))),128))],2)):b("v-if",!0),I(w("textarea",{class:"wl-editor",ref:"editorRef",id:"wl-edit",placeholder:e.replyUser?`@${e.replyUser}`:e.locale.placeholder,"onUpdate:modelValue":t[2]||(t[2]=t=>e.editor=t),onKeydown:t[3]||(t[3]=(...t)=>e.onKeyDown&&e.onKeyDown(...t)),onDrop:t[4]||(t[4]=(...t)=>e.onDrop&&e.onDrop(...t)),onPaste:t[5]||(t[5]=(...t)=>e.onPaste&&e.onPaste(...t))},null,40,at),[[j,e.editor]]),I(w("div",it,[st,w("h4",null,y(e.locale.preview)+":",1),w("div",{class:"wl-content",innerHTML:e.previewText},null,8,ct)],512),[[S,e.showPreview]]),w("div",ut,[w("div",mt,[w("a",dt,[h(i)]),I(w("button",{ref:"emojiButtonRef",class:k(["wl-action",{actived:e.showEmoji}]),title:e.locale.emoji,onClick:t[6]||(t[6]=t=>e.showEmoji=!e.showEmoji)},[h(s)],10,pt),[[S,e.emoji.tabs.length]]),w("input",{ref:"imageUploadRef",class:"upload",id:"wl-image-upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:t[7]||(t[7]=(...t)=>e.onChange&&e.onChange(...t))},null,544),e.canUploadImage?(g(),f("label",{key:0,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[h(c)],8,vt)):b("v-if",!0),w("button",{class:k(["wl-action",{actived:e.showPreview}]),title:e.locale.preview,onClick:t[8]||(t[8]=t=>e.showPreview=!e.showPreview)},[h(u)],10,gt)]),w("div",ft,[w("div",wt,[E(y(e.wordNumber)+" ",1),e.config.wordLimit?(g(),f("span",ht,[yt,w("span",{class:k({illegal:!e.isWordNumberLegal}),textContent:y(e.wordLimit)},null,10,bt)])):b("v-if",!0),E("  "+y(e.locale.word),1)]),"disable"===e.config.login||e.isLogin?b("v-if",!0):(g(),f("button",{key:0,class:"wl-btn",onClick:t[9]||(t[9]=(...t)=>e.onLogin&&e.onLogin(...t)),textContent:y(e.locale.login)},null,8,kt)),"force"!==e.config.login||e.isLogin?(g(),f("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:t[10]||(t[10]=(...t)=>e.submitComment&&e.submitComment(...t))},[e.isSubmitting?(g(),L(m,{key:0,size:16})):(g(),f(C,{key:1},[E(y(e.locale.submit),1)],2112))],8,Ct)):b("v-if",!0)]),w("div",{ref:"emojiPopupRef",class:k(["wl-emoji-popup",{display:e.showEmoji}])},[(g(!0),f(C,null,$(e.emoji.tabs,((t,n)=>(g(),f(C,{key:t.name},[n===e.emojiTabIndex?(g(),f("div",$t,[(g(!0),f(C,null,$(t.items,(t=>(g(),f("button",{key:t,title:t,onClick:n=>e.insert(`:${t}:`)},[e.showEmoji?(g(),f("img",{key:0,class:"wl-emoji",src:e.emoji.map[t],alt:t,loading:"lazy",referrerPolicy:"no-referrer"},null,8,xt)):b("v-if",!0)],8,It)))),128))])):b("v-if",!0)],64)))),128)),e.emoji.tabs.length>1?(g(),f("div",jt,[(g(!0),f(C,null,$(e.emoji.tabs,((t,n)=>(g(),f("button",{key:t.name,class:k(["wl-tab",{active:e.emojiTabIndex===n}]),onClick:t=>e.emojiTabIndex=n},[w("img",{class:"wl-emoji",src:t.icon,alt:t.name,title:t.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Et)],10,St)))),128))])):b("v-if",!0)],2)])]),e.replyId?(g(),f("button",{key:1,class:"wl-close",title:e.locale.cancelReply,onClick:t[11]||(t[11]=t=>e.$emit("cancel-reply"))},[h(a,{size:24})],8,Lt)):b("v-if",!0)])},Ge.__file="src/components/CommentBox.vue";var Rt=u({props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object}},components:{CommentBox:Ge,ReplyIcon:()=>s("svg",{viewBox:"0 0 1024 1024",width:"18",height:"18"},s("path",{d:"M1019.2 720C1001.6 625.6 968 566.4 904 497.6c-89.6-89.6-214.4-150.4-347.2-176v-120c0-25.6-8-51.2-25.6-64-33.6-30.4-81.6-30.4-112-4.8L33.6 441.6C12.8 459.2 0 484.8 0 510.4c0 25.6 12.8 51.2 30.4 68.8l385.6 312c17.6 12.8 33.6 17.6 51.2 17.6 12.8 0 25.6-4.8 38.4-8C536 888 552 857.6 552 824v-99.2c124.8 20.8 248 86.4 339.2 140.8 25.6 17.6 59.2 17.6 89.6 0 25.6-17.6 43.2-46.4 43.2-76.8 0-33.6 0-56-4.8-68.8zm-500.8-89.6-46.4-4.8v193.6L86.4 510.4 472 201.6V400l38.4 4.8c128 12.8 248 68.8 334.4 153.6 51.2 56 76.8 102.4 94.4 179.2 0 4.8 4.8 20.8 4.8 51.2C835.2 720 672 640 518.4 630.4z",fill:"currentColor"})),VerifiedIcon:()=>s("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},s("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"}))},emits:["submit","reply"],setup(e){const t=m("config"),n=c((()=>t.value.locale)),o=c((()=>{let{link:t}=e.comment;return t?ze(t)?t:`https://${t}`:""})),l=((e,t)=>{const n=ue();return c((()=>_e(e,n.value,t)))})(e.comment.insertedAt,n.value),r=c((()=>{var t;return e.comment.objectId===(null===(t=e.reply)||void 0===t?void 0:t.objectId)}));return{config:t,locale:n,isReplyingCurrent:r,link:o,time:l}}});const At=["id"],zt={class:"wl-user","aria-hidden":"true"},Mt=["src"],Ot={class:"wl-card"},Pt={class:"wl-head"},Ut=["href"],Nt={key:1,class:"wl-nick"},_t=["textContent"],Bt=["textContent"],Ft=["textContent"],Tt=["textContent"],Dt=["textContent"],Wt=["title"],Ht={class:"wl-meta","aria-hidden":"true"},Vt=["textContent"],qt=["textContent"],Jt=["textContent"],Kt=["innerHTML"],Yt={key:0,class:"wl-reply-wrapper"},Gt={key:1,class:"wl-quote"};Rt.render=function(e,t,n,o,l,r){const a=v("VerifiedIcon"),i=v("ReplyIcon"),s=v("CommentBox"),c=v("CommentCard",!0);return g(),f("div",{class:"wl-item",id:e.comment.objectId},[w("div",zt,[e.comment.avatar?(g(),f("img",{key:0,src:e.comment.avatar},null,8,Mt)):b("v-if",!0),e.comment.type?(g(),L(a,{key:1})):b("v-if",!0)]),w("div",Ot,[w("div",Pt,[e.link?(g(),f("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noreferrer"},y(e.comment.nick),9,Ut)):(g(),f("span",Nt,y(e.comment.nick),1)),"administrator"===e.comment.type?(g(),f("span",{key:2,class:"wl-badge",textContent:y(e.locale.admin)},null,8,_t)):b("v-if",!0),e.comment.label?(g(),f("span",{key:3,class:"wl-badge",textContent:y(e.comment.label)},null,8,Bt)):b("v-if",!0),e.comment.sticky?(g(),f("span",{key:4,class:"wl-badge",textContent:y(e.locale.sticky)},null,8,Ft)):b("v-if",!0),e.comment.level>=0?(g(),f("span",{key:5,class:k(`wl-badge level${e.comment.level}`),textContent:y(e.locale[`level${e.comment.level}`]||`Level ${e.comment.level}`)},null,10,Tt)):b("v-if",!0),w("span",{class:"wl-time",textContent:y(e.time)},null,8,Dt),w("button",{class:k(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:t[0]||(t[0]=t=>e.$emit("reply",e.isReplyingCurrent?null:e.comment))},[h(i)],10,Wt)]),w("div",Ht,[e.comment.addr?(g(),f("span",{key:0,textContent:y(e.comment.addr)},null,8,Vt)):b("v-if",!0),e.comment.browser?(g(),f("span",{key:1,textContent:y(e.comment.browser)},null,8,qt)):b("v-if",!0),e.comment.os?(g(),f("span",{key:2,textContent:y(e.comment.os)},null,8,Jt)):b("v-if",!0)]),w("div",{class:"wl-content",innerHTML:e.comment.comment},null,8,Kt),e.isReplyingCurrent?(g(),f("div",Yt,[h(s,{replyId:e.comment.objectId,replyUser:e.comment.nick,rootId:e.rootId,onSubmit:t[1]||(t[1]=t=>e.$emit("submit",t)),onCancelReply:t[2]||(t[2]=t=>e.$emit("reply",null))},null,8,["replyId","replyUser","rootId"])])):b("v-if",!0),e.comment.children?(g(),f("div",Gt,[(g(!0),f(C,null,$(e.comment.children,(n=>(g(),L(c,{key:n.objectId,comment:n,reply:e.reply,rootId:e.rootId,onReply:t[3]||(t[3]=t=>e.$emit("reply",t)),onSubmit:t[4]||(t[4]=t=>e.$emit("submit",t))},null,8,["comment","reply","rootId"])))),128))])):b("v-if",!0)])],8,At)},Rt.__file="src/components/CommentCard.vue";var Xt=u({name:"WalineRoot",components:{CommentBox:Ge,CommentCard:Rt,LoadingIcon:de},props:{serverURL:{type:String,required:!0},path:{type:String,required:!0},meta:{type:Array},requiredMeta:{type:Array},dark:[String,Boolean],lang:{type:String},locale:Object,pageSize:Number,wordLimit:{type:[Number,Array]},emoji:{type:[Array,Boolean]},login:String,highlighter:Function,imageUploader:[Function,Boolean],texRenderer:[Function,Boolean],copyright:Boolean},setup(e){const t=c((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:o,emoji:l=["//unpkg.com/@waline/emojis@1.0.1/weibo"],meta:r=["nick","mail","link"],requiredMeta:a=[],dark:i=!1,pageSize:s=10,wordLimit:c,imageUploader:u,highlighter:m,texRenderer:d,copyright:p=!0,login:v="enable",...g})=>({serverURL:Me(e),path:Re(t),locale:{...Le[n]||Le["zh-CN"],..."object"==typeof o?o:{}},wordLimit:Oe(c),meta:ve(r),requiredMeta:ve(a),imageUploader:Pe(u,ge),highlighter:Pe(m,be),texRenderer:Pe(d,fe),lang:n,dark:i,emoji:l,pageSize:s,login:v,copyright:p,...g}))(e))),o=Ye(),l=n("loading"),i=n(0),s=n(1),u=n(0),m=n([]),p=n(null),v=c((()=>{return"string"==typeof(e=t.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${Ue}}`:`${e}${Ue}`:!0===e?`:root${Ue}`:"";var e}));let g;!function(e,t={}){const o=n(!1),{document:l=G,immediate:i=!0,manual:s=!1,id:c="vueuse_styletag_"+ ++me}=t,u=n(e);let m=()=>{};const d=()=>{if(!l)return;const e=l.getElementById(c)||l.createElement("style");e.type="text/css",e.id=c,t.media&&(e.media=t.media),l.head.appendChild(e),o.value||(m=r(u,(t=>{e.innerText=t}),{immediate:!0}),o.value=!0)},p=()=>{l&&o.value&&(m(),l.head.removeChild(l.getElementById(c)),o.value=!1)};i&&!s&&d(),s||M(p),a(o)}(v);const f=e=>{var n;const{serverURL:r,path:a,pageSize:c}=t.value,d=new AbortController;l.value="loading",null==g||g(),Te({serverURL:r,lang:t.value.lang,path:a,pageSize:c,page:e,signal:d.signal,token:null===(n=o.value)||void 0===n?void 0:n.token}).then((t=>{l.value="success",i.value=t.count,m.value.push(...t.data),s.value=e,u.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),l.value="error")})),g=d.abort.bind(d)},w=()=>{i.value=0,m.value=[],f(1)};return R("config",t),r((()=>e.path),w),d((()=>w())),{config:t,darkmodeStyle:v,i18n:c((()=>t.value.locale)),status:l,count:i,page:s,totalPages:u,data:m,reply:p,loadMore:()=>f(s.value+1),refresh:w,onReply:e=>{p.value=e},onSubmit:e=>{if(e.rid){const t=m.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else m.value.unshift(e)},version:"2.3.1"}}});const Qt={"data-waline":""},Zt={class:"wl-count"},en=["textContent"],tn={class:"wl-cards"},nn={key:1,class:"wl-operation"},on=["textContent"],ln={key:0,class:"wl-loading"},rn=["textContent"],an={class:"wl-operation"},sn=["textContent"],cn={key:3,class:"wl-power"},un=E(" Powered by "),mn=w("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);Xt.render=function(e,t,n,o,l,r){const a=v("CommentBox"),i=v("CommentCard"),s=v("LoadingIcon");return g(),f("div",Qt,[e.reply?b("v-if",!0):(g(),L(a,{key:0,onSubmit:e.onSubmit},null,8,["onSubmit"])),w("div",Zt,[e.count?(g(),f("span",{key:0,class:"wl-num",textContent:y(e.count)},null,8,en)):b("v-if",!0),E(" "+y(e.i18n.comment),1)]),w("div",tn,[(g(!0),f(C,null,$(e.data,(t=>(g(),L(i,{key:t.objectId,"root-id":t.objectId,comment:t,reply:e.reply,onReply:e.onReply,onSubmit:e.onSubmit},null,8,["root-id","comment","reply","onReply","onSubmit"])))),128))]),"error"===e.status?(g(),f("div",nn,[w("button",{type:"button",class:"wl-btn",onClick:t[0]||(t[0]=(...t)=>e.refresh&&e.refresh(...t)),textContent:y(e.i18n.refresh)},null,8,on)])):(g(),f(C,{key:2},["loading"===e.status?(g(),f("div",ln,[h(s,{size:30})])):e.data.length?e.page<e.totalPages?(g(),f(C,{key:2},[b(" Load more button "),w("div",an,[w("button",{type:"button",class:"wl-btn",onClick:t[1]||(t[1]=(...t)=>e.loadMore&&e.loadMore(...t)),textContent:y(e.i18n.more)},null,8,sn)])],2112)):b("v-if",!0):(g(),f("div",{key:1,class:"wl-empty",textContent:y(e.i18n.sofa)},null,8,rn))],2112)),b(" Copyright Information "),e.config.copyright?(g(),f("div",cn,[un,mn,E(" v"+y(e.version),1)])):b("v-if",!0)])},Xt.__file="src/components/Waline.vue";const dn="2.3.1";export{Xt as Waline,dn as version};
import{getCurrentScope as e,onScopeDispose as t,ref as n,unref as o,isRef as l,watch as r,readonly as a,shallowRef as i,h as s,computed as c,defineComponent as u,inject as m,onMounted as d,onUnmounted as v,resolveComponent as p,openBlock as g,createElementBlock as f,createElementVNode as w,createVNode as h,toDisplayString as y,createCommentVNode as b,normalizeClass as k,Fragment as C,renderList as $,withDirectives as I,vModelDynamic as x,vModelText as j,vShow as E,createTextVNode as S,createBlock as L,provide as R}from"vue";import z from"autosize";import{marked as M}from"marked";function A(n){return!!e()&&(t(n),!0)}const O="undefined"!=typeof window,P=()=>{};const U=e=>e();var N=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;function F(e,t,n={}){const o=n,{eventFilter:l=U}=o,a=((e,t)=>{var n={};for(var o in e)_.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&N)for(var o of N(e))t.indexOf(o)<0&&T.call(e,o)&&(n[o]=e[o]);return n})(o,["eventFilter"]);return r(e,(i=l,s=t,function(...e){i((()=>s.apply(this,e)),{fn:s,thisArg:this,args:e})}),a);var i,s}var B=Object.defineProperty,D=Object.defineProperties,W=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,J=(e,t,n)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function K(e,t,o={}){const l=o,{eventFilter:r}=l,a=((e,t)=>{var n={};for(var o in e)V.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&H)for(var o of H(e))t.indexOf(o)<0&&q.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:s,resume:c,isActive:u}=function(e=U){const t=n(!0);return{isActive:t,pause:function(){t.value=!1},resume:function(){t.value=!0},eventFilter:(...n)=>{t.value&&e(...n)}}}(r),m=F(e,t,(d=((e,t)=>{for(var n in t||(t={}))V.call(t,n)&&J(e,n,t[n]);if(H)for(var n of H(t))q.call(t,n)&&J(e,n,t[n]);return e})({},a),D(d,W({eventFilter:i}))));var d;return{stop:m,pause:s,resume:c,isActive:u}}const Y=O?window:void 0,G=O?window.document:void 0;function X(...e){let t,n,l,a;if("string"==typeof e[0]?([n,l,a]=e,t=Y):[t,n,l,a]=e,!t)return P;let i=P;const s=r((()=>function(e){var t;const n=o(e);return null!=(t=null==n?void 0:n.$el)?t:n}(t)),(e=>{i(),e&&(e.addEventListener(n,l,a),i=()=>{e.removeEventListener(n,l,a),i=P})}),{immediate:!0,flush:"post"}),c=()=>{s(),i()};return A(c),c}O&&window.navigator,O&&window.location;const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Z="__vueuse_ssr_handlers__";Q[Z]=Q[Z]||{};const ee=Q[Z];const te={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function ne(e,t,l,r={}){var a;const{flush:s="pre",deep:c=!0,listenToStorageChanges:u=!0,writeDefaults:m=!0,shallow:d,window:v=Y,eventFilter:p,onError:g=(e=>{console.error(e)})}=r,f=(d?i:n)(t);if(!l)try{l=function(e,t){return ee[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=Y)?void 0:e.localStorage}))()}catch(e){g(e)}if(!l)return f;const w=o(t),h=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(w),y=null!=(a=r.serializer)?a:te[h],{pause:b,resume:k}=K(f,(()=>function(t){try{null==t?l.removeItem(e):l.setItem(e,y.write(t))}catch(e){g(e)}}(f.value)),{flush:s,deep:c,eventFilter:p});return v&&u&&X(v,"storage",C),C(),f;function C(t){t&&t.key!==e||(f.value=function(t){if(!t||t.key===e){b();try{const n=t?t.newValue:l.getItem(e);return null==n?(m&&null!==w&&l.setItem(e,y.write(w)),w):"string"!=typeof n?n:y.read(n)}catch(e){g(e)}finally{k()}}}(t))}}var oe,le,re=Object.defineProperty,ae=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,ce=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function ue(e={}){const{controls:t=!1,interval:a="requestAnimationFrame"}=e,i=n(new Date),s=()=>i.value=new Date,c="requestAnimationFrame"===a?function(e,t={}){const{immediate:o=!0,window:l=Y}=t,r=n(!1);let a=null;function i(){r.value&&l&&(e(),a=l.requestAnimationFrame(i))}function s(){!r.value&&l&&(r.value=!0,i())}function c(){r.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return o&&s(),A(c),{isActive:r,pause:c,resume:s}}(s,{immediate:!0}):function(e,t=1e3,a={}){const{immediate:i=!0,immediateCallback:s=!1}=a;let c=null;const u=n(!1);function m(){c&&(clearInterval(c),c=null)}function d(){u.value=!1,m()}function v(){t<=0||(u.value=!0,s&&e(),m(),c=setInterval(e,o(t)))}i&&O&&v(),l(t)&&A(r(t,(()=>{i&&O&&v()})));return A(d),{isActive:u,pause:d,resume:v}}(s,a,{immediate:!0});return t?((e,t)=>{for(var n in t||(t={}))ie.call(t,n)&&ce(e,n,t[n]);if(ae)for(var n of ae(t))se.call(t,n)&&ce(e,n,t[n]);return e})({now:i},c):i}O&&(null==window?void 0:window.navigator)&&(null==(oe=null==window?void 0:window.navigator)?void 0:oe.platform)&&/iP(ad|hone|od)/.test(null==(le=null==window?void 0:window.navigator)?void 0:le.platform);let me=0;const de=({size:e})=>s("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},s("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},s("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),ve=["nick","mail","link"],pe=e=>e.filter((e=>ve.includes(e))),ge=e=>new Promise(((t,n)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{var e;return t((null===(e=o.result)||void 0===e?void 0:e.toString())||"")},o.onerror=n})),fe=e=>!0===e?'<p class="wl-tex">Tex is not available in preview</p>':'<span class="wl-tex">Tex is not available in preview</span>',we=new RegExp(`(${/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source}|${/</.source})|((?:${/(?:^|\s)\/\/(.+?)$/gm.source})|(?:${/\/\*([\S\s]*?)\*\//gm.source}))`,"gmi"),he=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],ye={},be=e=>{let t=0;return e.replace(we,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;ye[n]?l=ye[n]:(l=he[t],ye[n]=l);const r=`<span style="color: #${l}">${n}</span>`;return t=++t%he.length,r}))},ke=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","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"],Ce=e=>Object.fromEntries(e.map(((e,t)=>[ke[t],e])));var $e=Ce(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","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!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar"]),Ie=Ce(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名"]),xe=Ce(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说"]),je=Ce(["暱稱","郵箱","網址","可選","暱稱不能少於3個字元","請填寫正確的郵件地址","歡迎評論","來發評論吧~","提交","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說"]),Ee=Ce(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras","Favor enviar comentário com $0 a $1 palavras!\n Número de palavras atuais: $2","Anônimo"]),Se=Ce(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный"]);const Le={zh:xe,"zh-cn":xe,"zh-CN":xe,"zh-tw":je,"zh-TW":je,en:$e,"en-US":$e,"en-us":$e,jp:Ie,"jp-jp":Ie,"jp-JP":Ie,"pt-br":Ee,"pt-BR":Ee,ru:Se,"ru-ru":Se,"ru-RU":Se},Re=e=>{try{e=decodeURI(e)}catch(e){}return e},ze=(e="")=>e.replace(/\/$/u,""),Me=e=>/^(https?:)?\/\//.test(e),Ae=e=>{const t=ze(e);return Me(t)?t:`https://${t}`},Oe=e=>Array.isArray(e)?e:!!e&&[0,e],Pe=(e,t)=>"function"==typeof e?e:!1!==e&&t,Ue="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",Ne=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},_e=(e,t,n)=>{if(!e)return"";const o="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,l=t.getTime()-o.getTime(),r=Math.floor(l/864e5);if(0===r){const e=l%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,o=Math.floor(t/6e4);if(0===o){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${o} ${n.minutes}`}return`${t} ${n.hours}`}return r<0?n.now:r<8?`${r} ${n.days}`:(e=>{const t=Ne(e.getDate(),2),n=Ne(e.getMonth()+1,2);return`${Ne(e.getFullYear(),2)}-${n}-${t}`})(o)},Te=e=>{const t=ne("WALINE_EMOJI",{}),n=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(n){const n=t.value[e];if(n)return Promise.resolve(n)}return fetch(`${e}/info.json`).then((e=>e.json())).then((o=>{const l={folder:e,...o};return n&&(t.value[e]=l),l}))},Fe=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,Be=({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:r,token:a})=>{const i={};return a&&(i.Authorization=`Bearer ${a}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:r,headers:i}).then((e=>e.json())).then((e=>((e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e})(e,"comment list")))},De=e=>e.type.includes("image"),We=e=>{const t=Array.from(e).find(De);return t?t.getAsFile():null},He=/\$.*?\$/,Ve=/^\$(.*?)\$/,qe=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Je=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),Ke=(e,{emojiMap:t,highlighter:n,texRenderer:o})=>{if(M.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),o){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=qe.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(e){const t=e.search(He);return-1!==t?t:e.length},tokenizer(t){const n=Ve.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(o);M.use({extensions:e})}return M.parse(Je(e,t))},Ye=()=>ne("USER_KEY",{});var Ge=u({name:"CommentBox",components:{CloseIcon:({size:e})=>s("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[s("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"}),s("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"})]),EmojiIcon:()=>s("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},s("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"})),ImageIcon:()=>s("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[s("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"}),s("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"})]),MarkdownIcon:()=>s("svg",{width:"16",height:"16",ariaHidden:"true"},s("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"})),PreviewIcon:()=>s("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[s("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"}),s("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"})]),LoadingIcon:de},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(e,{emit:t}){const o=m("config"),l=ne("WALINE_COMMENT_BOX_EDITOR",""),a=ne("WALINE_USER_META",{nick:"",mail:"",link:""}),i=Ye(),s=n({}),u=n(null),p=n(null),g=n(null),f=n(null),w=n({tabs:[],map:{}}),h=n(0),y=n(!1),b=n(!1),k=n(""),C=n(0),$=n(0),I=n(!1),x=n(""),j=n(!1),E=c((()=>o.value.locale)),S=c((()=>{var e;return Boolean(null===(e=i.value)||void 0===e?void 0:e.token)})),L=c((()=>!1!==o.value.imageUploader)),R=e=>{const t=u.value,n=t.selectionStart,o=t.selectionEnd||0,r=t.scrollTop;l.value=t.value.substring(0,n)+e+t.value.substring(o,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=r},M=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return R(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{l.value=l.value.replace(t,`\r\n![${e.name}](${n})`)}))},A=()=>{var n,r,c,m,d;const{serverURL:v,lang:p,login:g,wordLimit:f,requiredMeta:h}=o.value,y={comment:x.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:o.value.path};if(null===(n=i.value)||void 0===n?void 0:n.token)y.nick=i.value.display_name,y.mail=i.value.email,y.link=i.value.url;else{if("force"===g)return;if(h.indexOf("nick")>-1&&!y.nick)return null===(r=s.value.nick)||void 0===r||r.focus(),alert(E.value.nickError);if(h.indexOf("mail")>-1&&!y.mail||y.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(y.mail))return null===(c=s.value.mail)||void 0===c||c.focus(),alert(E.value.mailError);if(!y.comment)return void(null===(m=u.value)||void 0===m||m.focus());y.nick||(y.nick=E.value.anonymous)}if(!I.value)return alert(E.value.wordHint.replace("$0",f[0].toString()).replace("$1",f[1].toString()).replace("$2",C.value.toString()));y.comment=Je(y.comment,w.value.map),e.replyId&&e.rootId&&(y.pid=e.replyId,y.rid=e.rootId,y.at=e.replyUser),j.value=!0,(({serverURL:e,lang:t,token:n,comment:o})=>{const l={"Content-Type":"application/json"};return n&&(l.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:l,body:JSON.stringify(o)}).then((e=>e.json()))})({serverURL:v,lang:p,token:null===(d=i.value)||void 0===d?void 0:d.token,comment:y}).then((n=>{if(j.value=!1,n.errmsg)return alert(n.errmsg);t("submit",n.data),l.value="",k.value="",e.replyId&&t("cancel-reply")})).catch((e=>{j.value=!1,alert(e.message)}))},O=e=>{g.value.contains(e.target)||f.value.contains(e.target)||(y.value=!1)};return r([o,C],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?($.value=n[0],I.value=!1):t>n[1]?($.value=n[1],I.value=!1):($.value=n[1],I.value=!0):($.value=0,I.value=!0)}),{immediate:!0}),d((()=>{document.body.addEventListener("click",O),r((()=>l.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;x.value=e,k.value=Ke(e,{emojiMap:w.value.map,highlighter:t,texRenderer:n}),C.value=(e=>(e=>e.match(/[\w\d\s\u00C0-\u024F]+/giu)||[])(e).reduce(((e,t)=>e+(""===t.trim()?0:t.trim().split(/\s+/u).length)),0)+(e=>e.match(/[\u4E00-\u9FA5]/gu)||[])(e).length)(e),e?z(u.value):z.destroy(u.value)}),{immediate:!0}),r((()=>o.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?Te(ze(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:r,type:a,items:i}=e;t.tabs.push({name:n,icon:Fe(l,o,r,a),items:i.map((e=>{const n=`${r||""}${e}`;return t.map[n]=Fe(e,o,r,a),n}))})})),t}))).then((e=>{w.value=e}));var t}),{immediate:!0})})),v((()=>{document.body.removeEventListener("click",O)})),{config:o,locale:E,insert:R,onChange:()=>{const e=p.value;e.files&&L.value&&M(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{var t;if(null===(t=e.dataTransfer)||void 0===t?void 0:t.items){const t=We(e.dataTransfer.items);t&&L.value&&(M(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&A()},onPaste:e=>{if(e.clipboardData){const t=We(e.clipboardData.items);t&&L.value&&M(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,r=(window.innerHeight-450)/2,a=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:null},"*");const s=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(null==a||a.close(),i.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",s))};window.addEventListener("message",s)},onLogout:()=>{i.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-800)/2,r=(window.innerHeight-800)/2,a=window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:i.value.token},"*");const s=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))),window.removeEventListener("message",s))};window.addEventListener("message",s)},submitComment:A,isLogin:S,userInfo:i,isSubmitting:j,wordNumber:C,wordLimit:$,isWordNumberLegal:I,editor:l,userMeta:a,emoji:w,emojiTabIndex:h,showEmoji:y,canUploadImage:L,previewText:k,showPreview:b,inputRefs:s,editorRef:u,emojiButtonRef:g,emojiPopupRef:f,imageUploadRef:p}}});const Xe={class:"wl-comment"},Qe={key:0,class:"wl-login-info"},Ze={class:"wl-avatar"},et=["title"],tt=["src"],nt=["textContent"],ot={class:"wl-panel"},lt=["for","textContent"],rt=["id","name","type","onUpdate:modelValue"],at=["placeholder"],it={class:"wl-preview"},st=w("hr",null,null,-1),ct=["innerHTML"],ut={class:"wl-footer"},mt={class:"wl-actions"},dt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},vt=["title"],pt=["title"],gt=["title"],ft={class:"wl-info"},wt={class:"wl-text-number"},ht={key:0},yt=S("  /  "),bt=["textContent"],kt=["textContent"],Ct=["disabled"],$t={key:0,class:"wl-tab-wrapper"},It=["title","onClick"],xt=["src","alt"],jt={key:0,class:"wl-tabs"},Et=["onClick"],St=["src","alt","title"],Lt=["title"];Ge.render=function(e,t,n,o,l,r){const a=p("CloseIcon"),i=p("MarkdownIcon"),s=p("EmojiIcon"),c=p("ImageIcon"),u=p("PreviewIcon"),m=p("LoadingIcon");return g(),f("div",Xe,["disable"!==e.config.login&&e.isLogin?(g(),f("div",Qe,[w("div",Ze,[w("button",{class:"wl-logout-btn",title:e.locale.logout,onClick:t[0]||(t[0]=(...t)=>e.onLogout&&e.onLogout(...t))},[h(a,{size:14})],8,et),w("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,tt)]),w("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",onClick:t[1]||(t[1]=(...t)=>e.onProfile&&e.onProfile(...t)),textContent:y(e.userInfo.display_name)},null,8,nt)])):b("v-if",!0),w("div",ot,["force"!==e.config.login&&e.config.meta.length&&!e.isLogin?(g(),f("div",{key:0,class:k(["wl-header",`item${e.config.meta.length}`])},[(g(!0),f(C,null,$(e.config.meta,(t=>(g(),f("div",{class:"wl-header-item",key:t},[w("label",{for:t,textContent:y(e.locale[t]+(e.config.requiredMeta.includes(t)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,lt),I(w("input",{ref_for:!0,ref:n=>{n&&(e.inputRefs[t]=n)},id:`wl-${t}`,class:k(["wl-input",`wl-${t}`]),name:t,type:"mail"===t?"email":"text","onUpdate:modelValue":n=>e.userMeta[t]=n},null,10,rt),[[x,e.userMeta[t]]])])))),128))],2)):b("v-if",!0),I(w("textarea",{class:"wl-editor",ref:"editorRef",id:"wl-edit",placeholder:e.replyUser?`@${e.replyUser}`:e.locale.placeholder,"onUpdate:modelValue":t[2]||(t[2]=t=>e.editor=t),onKeydown:t[3]||(t[3]=(...t)=>e.onKeyDown&&e.onKeyDown(...t)),onDrop:t[4]||(t[4]=(...t)=>e.onDrop&&e.onDrop(...t)),onPaste:t[5]||(t[5]=(...t)=>e.onPaste&&e.onPaste(...t))},null,40,at),[[j,e.editor]]),I(w("div",it,[st,w("h4",null,y(e.locale.preview)+":",1),w("div",{class:"wl-content",innerHTML:e.previewText},null,8,ct)],512),[[E,e.showPreview]]),w("div",ut,[w("div",mt,[w("a",dt,[h(i)]),I(w("button",{ref:"emojiButtonRef",class:k(["wl-action",{actived:e.showEmoji}]),title:e.locale.emoji,onClick:t[6]||(t[6]=t=>e.showEmoji=!e.showEmoji)},[h(s)],10,vt),[[E,e.emoji.tabs.length]]),w("input",{ref:"imageUploadRef",class:"upload",id:"wl-image-upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:t[7]||(t[7]=(...t)=>e.onChange&&e.onChange(...t))},null,544),e.canUploadImage?(g(),f("label",{key:0,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[h(c)],8,pt)):b("v-if",!0),w("button",{class:k(["wl-action",{actived:e.showPreview}]),title:e.locale.preview,onClick:t[8]||(t[8]=t=>e.showPreview=!e.showPreview)},[h(u)],10,gt)]),w("div",ft,[w("div",wt,[S(y(e.wordNumber)+" ",1),e.config.wordLimit?(g(),f("span",ht,[yt,w("span",{class:k({illegal:!e.isWordNumberLegal}),textContent:y(e.wordLimit)},null,10,bt)])):b("v-if",!0),S("  "+y(e.locale.word),1)]),"disable"===e.config.login||e.isLogin?b("v-if",!0):(g(),f("button",{key:0,class:"wl-btn",onClick:t[9]||(t[9]=(...t)=>e.onLogin&&e.onLogin(...t)),textContent:y(e.locale.login)},null,8,kt)),"force"!==e.config.login||e.isLogin?(g(),f("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:t[10]||(t[10]=(...t)=>e.submitComment&&e.submitComment(...t))},[e.isSubmitting?(g(),L(m,{key:0,size:16})):(g(),f(C,{key:1},[S(y(e.locale.submit),1)],2112))],8,Ct)):b("v-if",!0)]),w("div",{ref:"emojiPopupRef",class:k(["wl-emoji-popup",{display:e.showEmoji}])},[(g(!0),f(C,null,$(e.emoji.tabs,((t,n)=>(g(),f(C,{key:t.name},[n===e.emojiTabIndex?(g(),f("div",$t,[(g(!0),f(C,null,$(t.items,(t=>(g(),f("button",{key:t,title:t,onClick:n=>e.insert(`:${t}:`)},[e.showEmoji?(g(),f("img",{key:0,class:"wl-emoji",src:e.emoji.map[t],alt:t,loading:"lazy",referrerPolicy:"no-referrer"},null,8,xt)):b("v-if",!0)],8,It)))),128))])):b("v-if",!0)],64)))),128)),e.emoji.tabs.length>1?(g(),f("div",jt,[(g(!0),f(C,null,$(e.emoji.tabs,((t,n)=>(g(),f("button",{key:t.name,class:k(["wl-tab",{active:e.emojiTabIndex===n}]),onClick:t=>e.emojiTabIndex=n},[w("img",{class:"wl-emoji",src:t.icon,alt:t.name,title:t.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,St)],10,Et)))),128))])):b("v-if",!0)],2)])]),e.replyId?(g(),f("button",{key:1,class:"wl-close",title:e.locale.cancelReply,onClick:t[11]||(t[11]=t=>e.$emit("cancel-reply"))},[h(a,{size:24})],8,Lt)):b("v-if",!0)])},Ge.__file="src/components/CommentBox.vue";var Rt=u({props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object}},components:{CommentBox:Ge,ReplyIcon:()=>s("svg",{viewBox:"0 0 1024 1024",width:"18",height:"18"},s("path",{d:"M1019.2 720C1001.6 625.6 968 566.4 904 497.6c-89.6-89.6-214.4-150.4-347.2-176v-120c0-25.6-8-51.2-25.6-64-33.6-30.4-81.6-30.4-112-4.8L33.6 441.6C12.8 459.2 0 484.8 0 510.4c0 25.6 12.8 51.2 30.4 68.8l385.6 312c17.6 12.8 33.6 17.6 51.2 17.6 12.8 0 25.6-4.8 38.4-8C536 888 552 857.6 552 824v-99.2c124.8 20.8 248 86.4 339.2 140.8 25.6 17.6 59.2 17.6 89.6 0 25.6-17.6 43.2-46.4 43.2-76.8 0-33.6 0-56-4.8-68.8zm-500.8-89.6-46.4-4.8v193.6L86.4 510.4 472 201.6V400l38.4 4.8c128 12.8 248 68.8 334.4 153.6 51.2 56 76.8 102.4 94.4 179.2 0 4.8 4.8 20.8 4.8 51.2C835.2 720 672 640 518.4 630.4z",fill:"currentColor"})),VerifiedIcon:()=>s("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},s("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"}))},emits:["submit","reply"],setup(e){const t=m("config"),n=c((()=>t.value.locale)),o=c((()=>{let{link:t}=e.comment;return t?Me(t)?t:`https://${t}`:""})),l=((e,t)=>{const n=ue();return c((()=>_e(e,n.value,t)))})(e.comment.insertedAt,n.value),r=c((()=>{var t;return e.comment.objectId===(null===(t=e.reply)||void 0===t?void 0:t.objectId)}));return{config:t,locale:n,isReplyingCurrent:r,link:o,time:l}}});const zt=["id"],Mt={class:"wl-user","aria-hidden":"true"},At=["src"],Ot={class:"wl-card"},Pt={class:"wl-head"},Ut=["href"],Nt={key:1,class:"wl-nick"},_t=["textContent"],Tt=["textContent"],Ft=["textContent"],Bt=["textContent"],Dt=["textContent"],Wt=["title"],Ht={class:"wl-meta","aria-hidden":"true"},Vt=["textContent"],qt=["textContent"],Jt=["textContent"],Kt=["innerHTML"],Yt={key:0,class:"wl-reply-wrapper"},Gt={key:1,class:"wl-quote"};Rt.render=function(e,t,n,o,l,r){const a=p("VerifiedIcon"),i=p("ReplyIcon"),s=p("CommentBox"),c=p("CommentCard",!0);return g(),f("div",{class:"wl-item",id:e.comment.objectId},[w("div",Mt,[e.comment.avatar?(g(),f("img",{key:0,src:e.comment.avatar},null,8,At)):b("v-if",!0),e.comment.type?(g(),L(a,{key:1})):b("v-if",!0)]),w("div",Ot,[w("div",Pt,[e.link?(g(),f("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noreferrer"},y(e.comment.nick),9,Ut)):(g(),f("span",Nt,y(e.comment.nick),1)),"administrator"===e.comment.type?(g(),f("span",{key:2,class:"wl-badge",textContent:y(e.locale.admin)},null,8,_t)):b("v-if",!0),e.comment.label?(g(),f("span",{key:3,class:"wl-badge",textContent:y(e.comment.label)},null,8,Tt)):b("v-if",!0),e.comment.sticky?(g(),f("span",{key:4,class:"wl-badge",textContent:y(e.locale.sticky)},null,8,Ft)):b("v-if",!0),e.comment.level>=0?(g(),f("span",{key:5,class:k(`wl-badge level${e.comment.level}`),textContent:y(e.locale[`level${e.comment.level}`]||`Level ${e.comment.level}`)},null,10,Bt)):b("v-if",!0),w("span",{class:"wl-time",textContent:y(e.time)},null,8,Dt),w("button",{class:k(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:t[0]||(t[0]=t=>e.$emit("reply",e.isReplyingCurrent?null:e.comment))},[h(i)],10,Wt)]),w("div",Ht,[e.comment.addr?(g(),f("span",{key:0,textContent:y(e.comment.addr)},null,8,Vt)):b("v-if",!0),e.comment.browser?(g(),f("span",{key:1,textContent:y(e.comment.browser)},null,8,qt)):b("v-if",!0),e.comment.os?(g(),f("span",{key:2,textContent:y(e.comment.os)},null,8,Jt)):b("v-if",!0)]),w("div",{class:"wl-content",innerHTML:e.comment.comment},null,8,Kt),e.isReplyingCurrent?(g(),f("div",Yt,[h(s,{replyId:e.comment.objectId,replyUser:e.comment.nick,rootId:e.rootId,onSubmit:t[1]||(t[1]=t=>e.$emit("submit",t)),onCancelReply:t[2]||(t[2]=t=>e.$emit("reply",null))},null,8,["replyId","replyUser","rootId"])])):b("v-if",!0),e.comment.children?(g(),f("div",Gt,[(g(!0),f(C,null,$(e.comment.children,(n=>(g(),L(c,{key:n.objectId,comment:n,reply:e.reply,rootId:e.rootId,onReply:t[3]||(t[3]=t=>e.$emit("reply",t)),onSubmit:t[4]||(t[4]=t=>e.$emit("submit",t))},null,8,["comment","reply","rootId"])))),128))])):b("v-if",!0)])],8,zt)},Rt.__file="src/components/CommentCard.vue";var Xt=u({name:"WalineRoot",components:{CommentBox:Ge,CommentCard:Rt,LoadingIcon:de},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","copyright"],setup(e){const t=c((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:o,emoji:l=["//unpkg.com/@waline/emojis@1.0.1/weibo"],meta:r=["nick","mail","link"],requiredMeta:a=[],dark:i=!1,pageSize:s=10,wordLimit:c,imageUploader:u,highlighter:m,texRenderer:d,copyright:v=!0,login:p="enable",...g})=>({serverURL:Ae(e),path:Re(t),locale:{...Le[n]||Le["zh-CN"],..."object"==typeof o?o:{}},wordLimit:Oe(c),meta:pe(r),requiredMeta:pe(a),imageUploader:Pe(u,ge),highlighter:Pe(m,be),texRenderer:Pe(d,fe),lang:n,dark:i,emoji:l,pageSize:s,login:p,copyright:v,...g}))(e))),o=Ye(),l=n("loading"),i=n(0),s=n(1),u=n(0),m=n([]),v=n(null),p=c((()=>{return"string"==typeof(e=t.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${Ue}}`:`${e}${Ue}`:!0===e?`:root${Ue}`:"";var e}));let g;!function(e,t={}){const o=n(!1),{document:l=G,immediate:i=!0,manual:s=!1,id:c="vueuse_styletag_"+ ++me}=t,u=n(e);let m=()=>{};const d=()=>{if(!l)return;const e=l.getElementById(c)||l.createElement("style");e.type="text/css",e.id=c,t.media&&(e.media=t.media),l.head.appendChild(e),o.value||(m=r(u,(t=>{e.innerText=t}),{immediate:!0}),o.value=!0)},v=()=>{l&&o.value&&(m(),l.head.removeChild(l.getElementById(c)),o.value=!1)};i&&!s&&d(),s||A(v),a(o)}(p);const f=e=>{var n;const{serverURL:r,path:a,pageSize:c}=t.value,d=new AbortController;l.value="loading",null==g||g(),Be({serverURL:r,lang:t.value.lang,path:a,pageSize:c,page:e,signal:d.signal,token:null===(n=o.value)||void 0===n?void 0:n.token}).then((t=>{l.value="success",i.value=t.count,m.value.push(...t.data),s.value=e,u.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),l.value="error")})),g=d.abort.bind(d)},w=()=>{i.value=0,m.value=[],f(1)};return R("config",t),r((()=>e.path),w),d((()=>w())),{config:t,darkmodeStyle:p,i18n:c((()=>t.value.locale)),status:l,count:i,page:s,totalPages:u,data:m,reply:v,loadMore:()=>f(s.value+1),refresh:w,onReply:e=>{v.value=e},onSubmit:e=>{if(e.rid){const t=m.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else m.value.unshift(e)},version:"2.3.2"}}});const Qt={"data-waline":""},Zt={class:"wl-count"},en=["textContent"],tn={class:"wl-cards"},nn={key:1,class:"wl-operation"},on=["textContent"],ln={key:0,class:"wl-loading"},rn=["textContent"],an={class:"wl-operation"},sn=["textContent"],cn={key:3,class:"wl-power"},un=S(" Powered by "),mn=w("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);Xt.render=function(e,t,n,o,l,r){const a=p("CommentBox"),i=p("CommentCard"),s=p("LoadingIcon");return g(),f("div",Qt,[e.reply?b("v-if",!0):(g(),L(a,{key:0,onSubmit:e.onSubmit},null,8,["onSubmit"])),w("div",Zt,[e.count?(g(),f("span",{key:0,class:"wl-num",textContent:y(e.count)},null,8,en)):b("v-if",!0),S(" "+y(e.i18n.comment),1)]),w("div",tn,[(g(!0),f(C,null,$(e.data,(t=>(g(),L(i,{key:t.objectId,"root-id":t.objectId,comment:t,reply:e.reply,onReply:e.onReply,onSubmit:e.onSubmit},null,8,["root-id","comment","reply","onReply","onSubmit"])))),128))]),"error"===e.status?(g(),f("div",nn,[w("button",{type:"button",class:"wl-btn",onClick:t[0]||(t[0]=(...t)=>e.refresh&&e.refresh(...t)),textContent:y(e.i18n.refresh)},null,8,on)])):(g(),f(C,{key:2},["loading"===e.status?(g(),f("div",ln,[h(s,{size:30})])):e.data.length?e.page<e.totalPages?(g(),f(C,{key:2},[b(" Load more button "),w("div",an,[w("button",{type:"button",class:"wl-btn",onClick:t[1]||(t[1]=(...t)=>e.loadMore&&e.loadMore(...t)),textContent:y(e.i18n.more)},null,8,sn)])],2112)):b("v-if",!0):(g(),f("div",{key:1,class:"wl-empty",textContent:y(e.i18n.sofa)},null,8,rn))],2112)),b(" Copyright Information "),e.config.copyright?(g(),f("div",cn,[un,mn,S(" v"+y(e.version),1)])):b("v-if",!0)])},Xt.__file="src/components/Waline.vue";const dn="2.3.2";export{Xt as Waline,dn as version};
//# sourceMappingURL=component.esm.js.map

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("autosize"),n=require("marked");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(t);function r(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}const a="undefined"!=typeof window,i=()=>{};const c=e=>e();var s=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function d(t,n,o={}){const l=o,{eventFilter:r=c}=l,a=((e,t)=>{var n={};for(var o in e)m.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&s)for(var o of s(e))t.indexOf(o)<0&&u.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]);return e.watch(t,(i=r,d=n,function(...e){i((()=>d.apply(this,e)),{fn:d,thisArg:this,args:e})}),a);var i,d}var p=Object.defineProperty,v=Object.defineProperties,g=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,y=(e,t,n)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function k(t,n,o={}){const l=o,{eventFilter:r}=l,a=((e,t)=>{var n={};for(var o in e)h.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&f)for(var o of f(e))t.indexOf(o)<0&&w.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:s,resume:m,isActive:u}=function(t=c){const n=e.ref(!0);return{isActive:n,pause:function(){n.value=!1},resume:function(){n.value=!0},eventFilter:(...e)=>{n.value&&t(...e)}}}(r),p=d(t,n,(k=((e,t)=>{for(var n in t||(t={}))h.call(t,n)&&y(e,n,t[n]);if(f)for(var n of f(t))w.call(t,n)&&y(e,n,t[n]);return e})({},a),v(k,g({eventFilter:i}))));var k;return{stop:p,pause:s,resume:m,isActive:u}}const b=a?window:void 0,C=a?window.document:void 0;function E(...t){let n,o,l,a;if("string"==typeof t[0]?([o,l,a]=t,n=b):[n,o,l,a]=t,!n)return i;let c=i;const s=e.watch((()=>function(t){var n;const o=e.unref(t);return null!=(n=null==o?void 0:o.$el)?n:o}(n)),(e=>{c(),e&&(e.addEventListener(o,l,a),c=()=>{e.removeEventListener(o,l,a),c=i})}),{immediate:!0,flush:"post"}),m=()=>{s(),c()};return r(m),m}a&&window.navigator,a&&window.location;const B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},N="__vueuse_ssr_handlers__";B[N]=B[N]||{};const S=B[N];const $={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function V(t,n,o,l={}){var r;const{flush:a="pre",deep:i=!0,listenToStorageChanges:c=!0,writeDefaults:s=!0,shallow:m,window:u=b,eventFilter:d,onError:p=(e=>{console.error(e)})}=l,v=(m?e.shallowRef:e.ref)(n);if(!o)try{o=function(e,t){return S[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=b)?void 0:e.localStorage}))()}catch(e){p(e)}if(!o)return v;const g=e.unref(n),f=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(g),h=null!=(r=l.serializer)?r:$[f],{pause:w,resume:y}=k(v,(()=>function(e){try{null==e?o.removeItem(t):o.setItem(t,h.write(e))}catch(e){p(e)}}(v.value)),{flush:a,deep:i,eventFilter:d});return u&&c&&E(u,"storage",C),C(),v;function C(e){e&&e.key!==t||(v.value=function(e){if(!e||e.key===t){w();try{const n=e?e.newValue:o.getItem(t);return null==n?(s&&null!==g&&o.setItem(t,h.write(g)),g):"string"!=typeof n?n:h.read(n)}catch(e){p(e)}finally{y()}}}(e))}}var x,I,j=Object.defineProperty,L=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,M=(e,t,n)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function A(t={}){const{controls:n=!1,interval:o="requestAnimationFrame"}=t,l=e.ref(new Date),i=()=>l.value=new Date,c="requestAnimationFrame"===o?function(t,n={}){const{immediate:o=!0,window:l=b}=n,a=e.ref(!1);let i=null;function c(){a.value&&l&&(t(),i=l.requestAnimationFrame(c))}function s(){!a.value&&l&&(a.value=!0,c())}function m(){a.value=!1,null!=i&&l&&(l.cancelAnimationFrame(i),i=null)}return o&&s(),r(m),{isActive:a,pause:m,resume:s}}(i,{immediate:!0}):function(t,n=1e3,o={}){const{immediate:l=!0,immediateCallback:i=!1}=o;let c=null;const s=e.ref(!1);function m(){c&&(clearInterval(c),c=null)}function u(){s.value=!1,m()}function d(){n<=0||(s.value=!0,i&&t(),m(),c=setInterval(t,e.unref(n)))}l&&a&&d(),e.isRef(n)&&r(e.watch(n,(()=>{l&&a&&d()})));return r(u),{isActive:s,pause:u,resume:d}}(i,o,{immediate:!0});return n?((e,t)=>{for(var n in t||(t={}))R.call(t,n)&&M(e,n,t[n]);if(L)for(var n of L(t))z.call(t,n)&&M(e,n,t[n]);return e})({now:l},c):l}a&&(null==window?void 0:window.navigator)&&(null==(x=null==window?void 0:window.navigator)?void 0:x.platform)&&/iP(ad|hone|od)/.test(null==(I=null==window?void 0:window.navigator)?void 0:I.platform);let D=0;const O=({size:t})=>e.h("svg",{width:t,height:t,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},e.h("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},e.h("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),P=["nick","mail","link"],U=e=>e.filter((e=>P.includes(e))),F=e=>new Promise(((t,n)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{var e;return t((null===(e=o.result)||void 0===e?void 0:e.toString())||"")},o.onerror=n})),T=e=>!0===e?'<p class="wl-tex">Tex is not available in preview</p>':'<span class="wl-tex">Tex is not available in preview</span>',_=new RegExp(`(${/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source}|${/</.source})|((?:${/(?:^|\s)\/\/(.+?)$/gm.source})|(?:${/\/\*([\S\s]*?)\*\//gm.source}))`,"gmi"),W=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],q={},H=e=>{let t=0;return e.replace(_,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;q[n]?l=q[n]:(l=W[t],q[n]=l);const r=`<span style="color: #${l}">${n}</span>`;return t=++t%W.length,r}))},J=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","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"],K=e=>Object.fromEntries(e.map(((e,t)=>[J[t],e])));var Y=K(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","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!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar"]),G=K(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名"]),X=K(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说"]),Q=K(["暱稱","郵箱","網址","可選","暱稱不能少於3個字元","請填寫正確的郵件地址","歡迎評論","來發評論吧~","提交","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說"]),Z=K(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras","Favor enviar comentário com $0 a $1 palavras!\n Número de palavras atuais: $2","Anônimo"]),ee=K(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный"]);const te={zh:X,"zh-cn":X,"zh-CN":X,"zh-tw":Q,"zh-TW":Q,en:Y,"en-US":Y,"en-us":Y,jp:G,"jp-jp":G,"jp-JP":G,"pt-br":Z,"pt-BR":Z,ru:ee,"ru-ru":ee,"ru-RU":ee},ne=e=>{try{e=decodeURI(e)}catch(e){}return e},oe=(e="")=>e.replace(/\/$/u,""),le=e=>/^(https?:)?\/\//.test(e),re=e=>{const t=oe(e);return le(t)?t:`https://${t}`},ae=e=>Array.isArray(e)?e:!!e&&[0,e],ie=(e,t)=>"function"==typeof e?e:!1!==e&&t,ce="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",se=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},me=(e,t,n)=>{if(!e)return"";const o="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,l=t.getTime()-o.getTime(),r=Math.floor(l/864e5);if(0===r){const e=l%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,o=Math.floor(t/6e4);if(0===o){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${o} ${n.minutes}`}return`${t} ${n.hours}`}return r<0?n.now:r<8?`${r} ${n.days}`:(e=>{const t=se(e.getDate(),2),n=se(e.getMonth()+1,2);return`${se(e.getFullYear(),2)}-${n}-${t}`})(o)},ue=e=>{const t=V("WALINE_EMOJI",{}),n=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(n){const n=t.value[e];if(n)return Promise.resolve(n)}return fetch(`${e}/info.json`).then((e=>e.json())).then((o=>{const l={folder:e,...o};return n&&(t.value[e]=l),l}))},de=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,pe=({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:r,token:a})=>{const i={};return a&&(i.Authorization=`Bearer ${a}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:r,headers:i}).then((e=>e.json())).then((e=>((e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e})(e,"comment list")))},ve=e=>e.type.includes("image"),ge=e=>{const t=Array.from(e).find(ve);return t?t.getAsFile():null},fe=/\$.*?\$/,he=/^\$(.*?)\$/,we=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,ye=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),ke=(e,{emojiMap:t,highlighter:o,texRenderer:l})=>{if(n.marked.setOptions({highlight:o||void 0,breaks:!0,smartLists:!0,smartypants:!0}),l){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=we.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(e){const t=e.search(fe);return-1!==t?t:e.length},tokenizer(t){const n=he.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(l);n.marked.use({extensions:e})}return n.marked.parse(ye(e,t))},be=()=>V("USER_KEY",{});var Ce=e.defineComponent({name:"CommentBox",components:{CloseIcon:({size:t})=>e.h("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:t,height:t},[e.h("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"}),e.h("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"})]),EmojiIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("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"})),ImageIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("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"}),e.h("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"})]),MarkdownIcon:()=>e.h("svg",{width:"16",height:"16",ariaHidden:"true"},e.h("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"})),PreviewIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("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"}),e.h("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"})]),LoadingIcon:O},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(t,{emit:n}){const o=e.inject("config"),r=V("WALINE_COMMENT_BOX_EDITOR",""),a=V("WALINE_USER_META",{nick:"",mail:"",link:""}),i=be(),c=e.ref({}),s=e.ref(null),m=e.ref(null),u=e.ref(null),d=e.ref(null),p=e.ref({tabs:[],map:{}}),v=e.ref(0),g=e.ref(!1),f=e.ref(!1),h=e.ref(""),w=e.ref(0),y=e.ref(0),k=e.ref(!1),b=e.ref(""),C=e.ref(!1),E=e.computed((()=>o.value.locale)),B=e.computed((()=>{var e;return Boolean(null===(e=i.value)||void 0===e?void 0:e.token)})),N=e.computed((()=>!1!==o.value.imageUploader)),S=e=>{const t=s.value,n=t.selectionStart,o=t.selectionEnd||0,l=t.scrollTop;r.value=t.value.substring(0,n)+e+t.value.substring(o,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=l},$=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return S(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{r.value=r.value.replace(t,`\r\n![${e.name}](${n})`)}))},x=()=>{var e,l,m,u,d;const{serverURL:v,lang:g,login:f,wordLimit:y,requiredMeta:B}=o.value,N={comment:b.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:o.value.path};if(null===(e=i.value)||void 0===e?void 0:e.token)N.nick=i.value.display_name,N.mail=i.value.email,N.link=i.value.url;else{if("force"===f)return;if(B.indexOf("nick")>-1&&!N.nick)return null===(l=c.value.nick)||void 0===l||l.focus(),alert(E.value.nickError);if(B.indexOf("mail")>-1&&!N.mail||N.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.){0,2}\w+$/.exec(N.mail))return null===(m=c.value.mail)||void 0===m||m.focus(),alert(E.value.mailError);if(!N.comment)return void(null===(u=s.value)||void 0===u||u.focus());N.nick||(N.nick=E.value.anonymous)}if(!k.value)return alert(E.value.wordHint.replace("$0",y[0].toString()).replace("$1",y[1].toString()).replace("$2",w.value.toString()));N.comment=ye(N.comment,p.value.map),t.replyId&&t.rootId&&(N.pid=t.replyId,N.rid=t.rootId,N.at=t.replyUser),C.value=!0,(({serverURL:e,lang:t,token:n,comment:o})=>{const l={"Content-Type":"application/json"};return n&&(l.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:l,body:JSON.stringify(o)}).then((e=>e.json()))})({serverURL:v,lang:g,token:null===(d=i.value)||void 0===d?void 0:d.token,comment:N}).then((e=>{if(C.value=!1,e.errmsg)return alert(e.errmsg);n("submit",e.data),r.value="",h.value="",t.replyId&&n("cancel-reply")})).catch((e=>{C.value=!1,alert(e.message)}))},I=e=>{u.value.contains(e.target)||d.value.contains(e.target)||(g.value=!1)};return e.watch([o,w],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(y.value=n[0],k.value=!1):t>n[1]?(y.value=n[1],k.value=!1):(y.value=n[1],k.value=!0):(y.value=0,k.value=!0)}),{immediate:!0}),e.onMounted((()=>{document.body.addEventListener("click",I),e.watch((()=>r.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;b.value=e,h.value=ke(e,{emojiMap:p.value.map,highlighter:t,texRenderer:n}),w.value=(e=>(e=>e.match(/[\w\d\s\u00C0-\u024F]+/giu)||[])(e).reduce(((e,t)=>e+(""===t.trim()?0:t.trim().split(/\s+/u).length)),0)+(e=>e.match(/[\u4E00-\u9FA5]/gu)||[])(e).length)(e),e?l.default(s.value):l.default.destroy(s.value)}),{immediate:!0}),e.watch((()=>o.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?ue(oe(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:r,type:a,items:i}=e;t.tabs.push({name:n,icon:de(l,o,r,a),items:i.map((e=>{const n=`${r||""}${e}`;return t.map[n]=de(e,o,r,a),n}))})})),t}))).then((e=>{p.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",I)})),{config:o,locale:E,insert:S,onChange:()=>{const e=m.value;e.files&&N.value&&$(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{var t;if(null===(t=e.dataTransfer)||void 0===t?void 0:t.items){const t=ge(e.dataTransfer.items);t&&N.value&&($(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&x()},onPaste:e=>{if(e.clipboardData){const t=ge(e.clipboardData.items);t&&N.value&&$(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,r=(window.innerHeight-450)/2,a=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:null},"*");const c=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(null==a||a.close(),i.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",c))};window.addEventListener("message",c)},onLogout:()=>{i.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-800)/2,r=(window.innerHeight-800)/2,a=window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:i.value.token},"*");const c=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))),window.removeEventListener("message",c))};window.addEventListener("message",c)},submitComment:x,isLogin:B,userInfo:i,isSubmitting:C,wordNumber:w,wordLimit:y,isWordNumberLegal:k,editor:r,userMeta:a,emoji:p,emojiTabIndex:v,showEmoji:g,canUploadImage:N,previewText:h,showPreview:f,inputRefs:c,editorRef:s,emojiButtonRef:u,emojiPopupRef:d,imageUploadRef:m}}});const Ee={class:"wl-comment"},Be={key:0,class:"wl-login-info"},Ne={class:"wl-avatar"},Se=["title"],$e=["src"],Ve=["textContent"],xe={class:"wl-panel"},Ie=["for","textContent"],je=["id","name","type","onUpdate:modelValue"],Le=["placeholder"],Re={class:"wl-preview"},ze=e.createElementVNode("hr",null,null,-1),Me=["innerHTML"],Ae={class:"wl-footer"},De={class:"wl-actions"},Oe={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},Pe=["title"],Ue=["title"],Fe=["title"],Te={class:"wl-info"},_e={class:"wl-text-number"},We={key:0},qe=e.createTextVNode("  /  "),He=["textContent"],Je=["textContent"],Ke=["disabled"],Ye={key:0,class:"wl-tab-wrapper"},Ge=["title","onClick"],Xe=["src","alt"],Qe={key:0,class:"wl-tabs"},Ze=["onClick"],et=["src","alt","title"],tt=["title"];Ce.render=function(t,n,o,l,r,a){const i=e.resolveComponent("CloseIcon"),c=e.resolveComponent("MarkdownIcon"),s=e.resolveComponent("EmojiIcon"),m=e.resolveComponent("ImageIcon"),u=e.resolveComponent("PreviewIcon"),d=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",Ee,["disable"!==t.config.login&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",Ne,[e.createElementVNode("button",{class:"wl-logout-btn",title:t.locale.logout,onClick:n[0]||(n[0]=(...e)=>t.onLogout&&t.onLogout(...e))},[e.createVNode(i,{size:14})],8,Se),e.createElementVNode("img",{src:t.userInfo.avatar,alt:"avatar"},null,8,$e)]),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",onClick:n[1]||(n[1]=(...e)=>t.onProfile&&t.onProfile(...e)),textContent:e.toDisplayString(t.userInfo.display_name)},null,8,Ve)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",xe,["force"!==t.config.login&&t.config.meta.length&&!t.isLogin?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wl-header",`item${t.config.meta.length}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.config.meta,(n=>(e.openBlock(),e.createElementBlock("div",{class:"wl-header-item",key:n},[e.createElementVNode("label",{for:n,textContent:e.toDisplayString(t.locale[n]+(t.config.requiredMeta.includes(n)||!t.config.requiredMeta.length?"":`(${t.locale.optional})`))},null,8,Ie),e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:e=>{e&&(t.inputRefs[n]=e)},id:`wl-${n}`,class:e.normalizeClass(["wl-input",`wl-${n}`]),name:n,type:"mail"===n?"email":"text","onUpdate:modelValue":e=>t.userMeta[n]=e},null,10,je),[[e.vModelDynamic,t.userMeta[n]]])])))),128))],2)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",{class:"wl-editor",ref:"editorRef",id:"wl-edit",placeholder:t.replyUser?`@${t.replyUser}`:t.locale.placeholder,"onUpdate:modelValue":n[2]||(n[2]=e=>t.editor=e),onKeydown:n[3]||(n[3]=(...e)=>t.onKeyDown&&t.onKeyDown(...e)),onDrop:n[4]||(n[4]=(...e)=>t.onDrop&&t.onDrop(...e)),onPaste:n[5]||(n[5]=(...e)=>t.onPaste&&t.onPaste(...e))},null,40,Le),[[e.vModelText,t.editor]]),e.withDirectives(e.createElementVNode("div",Re,[ze,e.createElementVNode("h4",null,e.toDisplayString(t.locale.preview)+":",1),e.createElementVNode("div",{class:"wl-content",innerHTML:t.previewText},null,8,Me)],512),[[e.vShow,t.showPreview]]),e.createElementVNode("div",Ae,[e.createElementVNode("div",De,[e.createElementVNode("a",Oe,[e.createVNode(c)]),e.withDirectives(e.createElementVNode("button",{ref:"emojiButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showEmoji}]),title:t.locale.emoji,onClick:n[6]||(n[6]=e=>t.showEmoji=!t.showEmoji)},[e.createVNode(s)],10,Pe),[[e.vShow,t.emoji.tabs.length]]),e.createElementVNode("input",{ref:"imageUploadRef",class:"upload",id:"wl-image-upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:n[7]||(n[7]=(...e)=>t.onChange&&t.onChange(...e))},null,544),t.canUploadImage?(e.openBlock(),e.createElementBlock("label",{key:0,for:"wl-image-upload",class:"wl-action",title:t.locale.uploadImage},[e.createVNode(m)],8,Ue)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:e.normalizeClass(["wl-action",{actived:t.showPreview}]),title:t.locale.preview,onClick:n[8]||(n[8]=e=>t.showPreview=!t.showPreview)},[e.createVNode(u)],10,Fe)]),e.createElementVNode("div",Te,[e.createElementVNode("div",_e,[e.createTextVNode(e.toDisplayString(t.wordNumber)+" ",1),t.config.wordLimit?(e.openBlock(),e.createElementBlock("span",We,[qe,e.createElementVNode("span",{class:e.normalizeClass({illegal:!t.isWordNumberLegal}),textContent:e.toDisplayString(t.wordLimit)},null,10,He)])):e.createCommentVNode("v-if",!0),e.createTextVNode("  "+e.toDisplayString(t.locale.word),1)]),"disable"===t.config.login||t.isLogin?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn",onClick:n[9]||(n[9]=(...e)=>t.onLogin&&t.onLogin(...e)),textContent:e.toDisplayString(t.locale.login)},null,8,Je)),"force"!==t.config.login||t.isLogin?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:t.isSubmitting,onClick:n[10]||(n[10]=(...e)=>t.submitComment&&t.submitComment(...e))},[t.isSubmitting?(e.openBlock(),e.createBlock(d,{key:0,size:16})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.locale.submit),1)],2112))],8,Ke)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{ref:"emojiPopupRef",class:e.normalizeClass(["wl-emoji-popup",{display:t.showEmoji}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.emoji.tabs,((n,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.name},[o===t.emojiTabIndex?(e.openBlock(),e.createElementBlock("div",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(n=>(e.openBlock(),e.createElementBlock("button",{key:n,title:n,onClick:e=>t.insert(`:${n}:`)},[t.showEmoji?(e.openBlock(),e.createElementBlock("img",{key:0,class:"wl-emoji",src:t.emoji.map[n],alt:n,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Xe)):e.createCommentVNode("v-if",!0)],8,Ge)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),t.emoji.tabs.length>1?(e.openBlock(),e.createElementBlock("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.emoji.tabs,((n,o)=>(e.openBlock(),e.createElementBlock("button",{key:n.name,class:e.normalizeClass(["wl-tab",{active:t.emojiTabIndex===o}]),onClick:e=>t.emojiTabIndex=o},[e.createElementVNode("img",{class:"wl-emoji",src:n.icon,alt:n.name,title:n.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,et)],10,Ze)))),128))])):e.createCommentVNode("v-if",!0)],2)])]),t.replyId?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-close",title:t.locale.cancelReply,onClick:n[11]||(n[11]=e=>t.$emit("cancel-reply"))},[e.createVNode(i,{size:24})],8,tt)):e.createCommentVNode("v-if",!0)])},Ce.__file="src/components/CommentBox.vue";var nt=e.defineComponent({props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object}},components:{CommentBox:Ce,ReplyIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"18",height:"18"},e.h("path",{d:"M1019.2 720C1001.6 625.6 968 566.4 904 497.6c-89.6-89.6-214.4-150.4-347.2-176v-120c0-25.6-8-51.2-25.6-64-33.6-30.4-81.6-30.4-112-4.8L33.6 441.6C12.8 459.2 0 484.8 0 510.4c0 25.6 12.8 51.2 30.4 68.8l385.6 312c17.6 12.8 33.6 17.6 51.2 17.6 12.8 0 25.6-4.8 38.4-8C536 888 552 857.6 552 824v-99.2c124.8 20.8 248 86.4 339.2 140.8 25.6 17.6 59.2 17.6 89.6 0 25.6-17.6 43.2-46.4 43.2-76.8 0-33.6 0-56-4.8-68.8zm-500.8-89.6-46.4-4.8v193.6L86.4 510.4 472 201.6V400l38.4 4.8c128 12.8 248 68.8 334.4 153.6 51.2 56 76.8 102.4 94.4 179.2 0 4.8 4.8 20.8 4.8 51.2C835.2 720 672 640 518.4 630.4z",fill:"currentColor"})),VerifiedIcon:()=>e.h("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},e.h("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"}))},emits:["submit","reply"],setup(t){const n=e.inject("config"),o=e.computed((()=>n.value.locale)),l=e.computed((()=>{let{link:e}=t.comment;return e?le(e)?e:`https://${e}`:""})),r=((t,n)=>{const o=A();return e.computed((()=>me(t,o.value,n)))})(t.comment.insertedAt,o.value),a=e.computed((()=>{var e;return t.comment.objectId===(null===(e=t.reply)||void 0===e?void 0:e.objectId)}));return{config:n,locale:o,isReplyingCurrent:a,link:l,time:r}}});const ot=["id"],lt={class:"wl-user","aria-hidden":"true"},rt=["src"],at={class:"wl-card"},it={class:"wl-head"},ct=["href"],st={key:1,class:"wl-nick"},mt=["textContent"],ut=["textContent"],dt=["textContent"],pt=["textContent"],vt=["textContent"],gt=["title"],ft={class:"wl-meta","aria-hidden":"true"},ht=["textContent"],wt=["textContent"],yt=["textContent"],kt=["innerHTML"],bt={key:0,class:"wl-reply-wrapper"},Ct={key:1,class:"wl-quote"};nt.render=function(t,n,o,l,r,a){const i=e.resolveComponent("VerifiedIcon"),c=e.resolveComponent("ReplyIcon"),s=e.resolveComponent("CommentBox"),m=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{class:"wl-item",id:t.comment.objectId},[e.createElementVNode("div",lt,[t.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.comment.avatar},null,8,rt)):e.createCommentVNode("v-if",!0),t.comment.type?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",at,[e.createElementVNode("div",it,[t.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"wl-nick",href:t.link,target:"_blank",rel:"nofollow noreferrer"},e.toDisplayString(t.comment.nick),9,ct)):(e.openBlock(),e.createElementBlock("span",st,e.toDisplayString(t.comment.nick),1)),"administrator"===t.comment.type?(e.openBlock(),e.createElementBlock("span",{key:2,class:"wl-badge",textContent:e.toDisplayString(t.locale.admin)},null,8,mt)):e.createCommentVNode("v-if",!0),t.comment.label?(e.openBlock(),e.createElementBlock("span",{key:3,class:"wl-badge",textContent:e.toDisplayString(t.comment.label)},null,8,ut)):e.createCommentVNode("v-if",!0),t.comment.sticky?(e.openBlock(),e.createElementBlock("span",{key:4,class:"wl-badge",textContent:e.toDisplayString(t.locale.sticky)},null,8,dt)):e.createCommentVNode("v-if",!0),t.comment.level>=0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(`wl-badge level${t.comment.level}`),textContent:e.toDisplayString(t.locale[`level${t.comment.level}`]||`Level ${t.comment.level}`)},null,10,pt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(t.time)},null,8,vt),e.createElementVNode("button",{class:e.normalizeClass(["wl-reply",{active:t.isReplyingCurrent}]),title:t.isReplyingCurrent?t.locale.cancelReply:t.locale.reply,onClick:n[0]||(n[0]=e=>t.$emit("reply",t.isReplyingCurrent?null:t.comment))},[e.createVNode(c)],10,gt)]),e.createElementVNode("div",ft,[t.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.addr)},null,8,ht)):e.createCommentVNode("v-if",!0),t.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,textContent:e.toDisplayString(t.comment.browser)},null,8,wt)):e.createCommentVNode("v-if",!0),t.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,textContent:e.toDisplayString(t.comment.os)},null,8,yt)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{class:"wl-content",innerHTML:t.comment.comment},null,8,kt),t.isReplyingCurrent?(e.openBlock(),e.createElementBlock("div",bt,[e.createVNode(s,{replyId:t.comment.objectId,replyUser:t.comment.nick,rootId:t.rootId,onSubmit:n[1]||(n[1]=e=>t.$emit("submit",e)),onCancelReply:n[2]||(n[2]=e=>t.$emit("reply",null))},null,8,["replyId","replyUser","rootId"])])):e.createCommentVNode("v-if",!0),t.comment.children?(e.openBlock(),e.createElementBlock("div",Ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment.children,(o=>(e.openBlock(),e.createBlock(m,{key:o.objectId,comment:o,reply:t.reply,rootId:t.rootId,onReply:n[3]||(n[3]=e=>t.$emit("reply",e)),onSubmit:n[4]||(n[4]=e=>t.$emit("submit",e))},null,8,["comment","reply","rootId"])))),128))])):e.createCommentVNode("v-if",!0)])],8,ot)},nt.__file="src/components/CommentCard.vue";var Et=e.defineComponent({name:"WalineRoot",components:{CommentBox:Ce,CommentCard:nt,LoadingIcon:O},props:{serverURL:{type:String,required:!0},path:{type:String,required:!0},meta:{type:Array},requiredMeta:{type:Array},dark:[String,Boolean],lang:{type:String},locale:Object,pageSize:Number,wordLimit:{type:[Number,Array]},emoji:{type:[Array,Boolean]},login:String,highlighter:Function,imageUploader:[Function,Boolean],texRenderer:[Function,Boolean],copyright:Boolean},setup(t){const n=e.computed((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:o,emoji:l=["//unpkg.com/@waline/emojis@1.0.1/weibo"],meta:r=["nick","mail","link"],requiredMeta:a=[],dark:i=!1,pageSize:c=10,wordLimit:s,imageUploader:m,highlighter:u,texRenderer:d,copyright:p=!0,login:v="enable",...g})=>({serverURL:re(e),path:ne(t),locale:{...te[n]||te["zh-CN"],..."object"==typeof o?o:{}},wordLimit:ae(s),meta:U(r),requiredMeta:U(a),imageUploader:ie(m,F),highlighter:ie(u,H),texRenderer:ie(d,T),lang:n,dark:i,emoji:l,pageSize:c,login:v,copyright:p,...g}))(t))),o=be(),l=e.ref("loading"),a=e.ref(0),i=e.ref(1),c=e.ref(0),s=e.ref([]),m=e.ref(null),u=e.computed((()=>{return"string"==typeof(e=n.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${ce}}`:`${e}${ce}`:!0===e?`:root${ce}`:"";var e}));let d;!function(t,n={}){const o=e.ref(!1),{document:l=C,immediate:a=!0,manual:i=!1,id:c="vueuse_styletag_"+ ++D}=n,s=e.ref(t);let m=()=>{};const u=()=>{if(!l)return;const t=l.getElementById(c)||l.createElement("style");t.type="text/css",t.id=c,n.media&&(t.media=n.media),l.head.appendChild(t),o.value||(m=e.watch(s,(e=>{t.innerText=e}),{immediate:!0}),o.value=!0)},d=()=>{l&&o.value&&(m(),l.head.removeChild(l.getElementById(c)),o.value=!1)};a&&!i&&u(),i||r(d),e.readonly(o)}(u);const p=e=>{var t;const{serverURL:r,path:m,pageSize:u}=n.value,p=new AbortController;l.value="loading",null==d||d(),pe({serverURL:r,lang:n.value.lang,path:m,pageSize:u,page:e,signal:p.signal,token:null===(t=o.value)||void 0===t?void 0:t.token}).then((t=>{l.value="success",a.value=t.count,s.value.push(...t.data),i.value=e,c.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),l.value="error")})),d=p.abort.bind(p)},v=()=>{a.value=0,s.value=[],p(1)};return e.provide("config",n),e.watch((()=>t.path),v),e.onMounted((()=>v())),{config:n,darkmodeStyle:u,i18n:e.computed((()=>n.value.locale)),status:l,count:a,page:i,totalPages:c,data:s,reply:m,loadMore:()=>p(i.value+1),refresh:v,onReply:e=>{m.value=e},onSubmit:e=>{if(e.rid){const t=s.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else s.value.unshift(e)},version:"2.3.1"}}});const Bt={"data-waline":""},Nt={class:"wl-count"},St=["textContent"],$t={class:"wl-cards"},Vt={key:1,class:"wl-operation"},xt=["textContent"],It={key:0,class:"wl-loading"},jt=["textContent"],Lt={class:"wl-operation"},Rt=["textContent"],zt={key:3,class:"wl-power"},Mt=e.createTextVNode(" Powered by "),At=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);Et.render=function(t,n,o,l,r,a){const i=e.resolveComponent("CommentBox"),c=e.resolveComponent("CommentCard"),s=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",Bt,[t.reply?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,onSubmit:t.onSubmit},null,8,["onSubmit"])),e.createElementVNode("div",Nt,[t.count?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(t.count)},null,8,St)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.i18n.comment),1)]),e.createElementVNode("div",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(n=>(e.openBlock(),e.createBlock(c,{key:n.objectId,"root-id":n.objectId,comment:n,reply:t.reply,onReply:t.onReply,onSubmit:t.onSubmit},null,8,["root-id","comment","reply","onReply","onSubmit"])))),128))]),"error"===t.status?(e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:n[0]||(n[0]=(...e)=>t.refresh&&t.refresh(...e)),textContent:e.toDisplayString(t.i18n.refresh)},null,8,xt)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===t.status?(e.openBlock(),e.createElementBlock("div",It,[e.createVNode(s,{size:30})])):t.data.length?t.page<t.totalPages?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createCommentVNode(" Load more button "),e.createElementVNode("div",Lt,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:n[1]||(n[1]=(...e)=>t.loadMore&&t.loadMore(...e)),textContent:e.toDisplayString(t.i18n.more)},null,8,Rt)])],2112)):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(t.i18n.sofa)},null,8,jt))],2112)),e.createCommentVNode(" Copyright Information "),t.config.copyright?(e.openBlock(),e.createElementBlock("div",zt,[Mt,At,e.createTextVNode(" v"+e.toDisplayString(t.version),1)])):e.createCommentVNode("v-if",!0)])},Et.__file="src/components/Waline.vue";exports.Waline=Et,exports.version="2.3.1";
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("autosize"),n=require("marked");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(t);function r(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}const a="undefined"!=typeof window,i=()=>{};const c=e=>e();var s=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function d(t,n,o={}){const l=o,{eventFilter:r=c}=l,a=((e,t)=>{var n={};for(var o in e)m.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&s)for(var o of s(e))t.indexOf(o)<0&&u.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]);return e.watch(t,(i=r,d=n,function(...e){i((()=>d.apply(this,e)),{fn:d,thisArg:this,args:e})}),a);var i,d}var p=Object.defineProperty,v=Object.defineProperties,f=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,y=(e,t,n)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function k(t,n,o={}){const l=o,{eventFilter:r}=l,a=((e,t)=>{var n={};for(var o in e)h.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&g)for(var o of g(e))t.indexOf(o)<0&&w.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:s,resume:m,isActive:u}=function(t=c){const n=e.ref(!0);return{isActive:n,pause:function(){n.value=!1},resume:function(){n.value=!0},eventFilter:(...e)=>{n.value&&t(...e)}}}(r),p=d(t,n,(k=((e,t)=>{for(var n in t||(t={}))h.call(t,n)&&y(e,n,t[n]);if(g)for(var n of g(t))w.call(t,n)&&y(e,n,t[n]);return e})({},a),v(k,f({eventFilter:i}))));var k;return{stop:p,pause:s,resume:m,isActive:u}}const b=a?window:void 0,C=a?window.document:void 0;function E(...t){let n,o,l,a;if("string"==typeof t[0]?([o,l,a]=t,n=b):[n,o,l,a]=t,!n)return i;let c=i;const s=e.watch((()=>function(t){var n;const o=e.unref(t);return null!=(n=null==o?void 0:o.$el)?n:o}(n)),(e=>{c(),e&&(e.addEventListener(o,l,a),c=()=>{e.removeEventListener(o,l,a),c=i})}),{immediate:!0,flush:"post"}),m=()=>{s(),c()};return r(m),m}a&&window.navigator,a&&window.location;const B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},N="__vueuse_ssr_handlers__";B[N]=B[N]||{};const $=B[N];const S={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function V(t,n,o,l={}){var r;const{flush:a="pre",deep:i=!0,listenToStorageChanges:c=!0,writeDefaults:s=!0,shallow:m,window:u=b,eventFilter:d,onError:p=(e=>{console.error(e)})}=l,v=(m?e.shallowRef:e.ref)(n);if(!o)try{o=function(e,t){return $[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=b)?void 0:e.localStorage}))()}catch(e){p(e)}if(!o)return v;const f=e.unref(n),g=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(f),h=null!=(r=l.serializer)?r:S[g],{pause:w,resume:y}=k(v,(()=>function(e){try{null==e?o.removeItem(t):o.setItem(t,h.write(e))}catch(e){p(e)}}(v.value)),{flush:a,deep:i,eventFilter:d});return u&&c&&E(u,"storage",C),C(),v;function C(e){e&&e.key!==t||(v.value=function(e){if(!e||e.key===t){w();try{const n=e?e.newValue:o.getItem(t);return null==n?(s&&null!==f&&o.setItem(t,h.write(f)),f):"string"!=typeof n?n:h.read(n)}catch(e){p(e)}finally{y()}}}(e))}}var x,I,j=Object.defineProperty,L=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,M=(e,t,n)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function D(t={}){const{controls:n=!1,interval:o="requestAnimationFrame"}=t,l=e.ref(new Date),i=()=>l.value=new Date,c="requestAnimationFrame"===o?function(t,n={}){const{immediate:o=!0,window:l=b}=n,a=e.ref(!1);let i=null;function c(){a.value&&l&&(t(),i=l.requestAnimationFrame(c))}function s(){!a.value&&l&&(a.value=!0,c())}function m(){a.value=!1,null!=i&&l&&(l.cancelAnimationFrame(i),i=null)}return o&&s(),r(m),{isActive:a,pause:m,resume:s}}(i,{immediate:!0}):function(t,n=1e3,o={}){const{immediate:l=!0,immediateCallback:i=!1}=o;let c=null;const s=e.ref(!1);function m(){c&&(clearInterval(c),c=null)}function u(){s.value=!1,m()}function d(){n<=0||(s.value=!0,i&&t(),m(),c=setInterval(t,e.unref(n)))}l&&a&&d(),e.isRef(n)&&r(e.watch(n,(()=>{l&&a&&d()})));return r(u),{isActive:s,pause:u,resume:d}}(i,o,{immediate:!0});return n?((e,t)=>{for(var n in t||(t={}))R.call(t,n)&&M(e,n,t[n]);if(L)for(var n of L(t))z.call(t,n)&&M(e,n,t[n]);return e})({now:l},c):l}a&&(null==window?void 0:window.navigator)&&(null==(x=null==window?void 0:window.navigator)?void 0:x.platform)&&/iP(ad|hone|od)/.test(null==(I=null==window?void 0:window.navigator)?void 0:I.platform);let A=0;const O=({size:t})=>e.h("svg",{width:t,height:t,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},e.h("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},e.h("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),P=["nick","mail","link"],U=e=>e.filter((e=>P.includes(e))),T=e=>new Promise(((t,n)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{var e;return t((null===(e=o.result)||void 0===e?void 0:e.toString())||"")},o.onerror=n})),F=e=>!0===e?'<p class="wl-tex">Tex is not available in preview</p>':'<span class="wl-tex">Tex is not available in preview</span>',_=new RegExp(`(${/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source}|${/</.source})|((?:${/(?:^|\s)\/\/(.+?)$/gm.source})|(?:${/\/\*([\S\s]*?)\*\//gm.source}))`,"gmi"),W=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],H={},q=e=>{let t=0;return e.replace(_,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;H[n]?l=H[n]:(l=W[t],H[n]=l);const r=`<span style="color: #${l}">${n}</span>`;return t=++t%W.length,r}))},J=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","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"],K=e=>Object.fromEntries(e.map(((e,t)=>[J[t],e])));var Y=K(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","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!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar"]),G=K(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名"]),X=K(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说"]),Q=K(["暱稱","郵箱","網址","可選","暱稱不能少於3個字元","請填寫正確的郵件地址","歡迎評論","來發評論吧~","提交","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說"]),Z=K(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras","Favor enviar comentário com $0 a $1 palavras!\n Número de palavras atuais: $2","Anônimo"]),ee=K(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный"]);const te={zh:X,"zh-cn":X,"zh-CN":X,"zh-tw":Q,"zh-TW":Q,en:Y,"en-US":Y,"en-us":Y,jp:G,"jp-jp":G,"jp-JP":G,"pt-br":Z,"pt-BR":Z,ru:ee,"ru-ru":ee,"ru-RU":ee},ne=e=>{try{e=decodeURI(e)}catch(e){}return e},oe=(e="")=>e.replace(/\/$/u,""),le=e=>/^(https?:)?\/\//.test(e),re=e=>{const t=oe(e);return le(t)?t:`https://${t}`},ae=e=>Array.isArray(e)?e:!!e&&[0,e],ie=(e,t)=>"function"==typeof e?e:!1!==e&&t,ce="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",se=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},me=(e,t,n)=>{if(!e)return"";const o="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,l=t.getTime()-o.getTime(),r=Math.floor(l/864e5);if(0===r){const e=l%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,o=Math.floor(t/6e4);if(0===o){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${o} ${n.minutes}`}return`${t} ${n.hours}`}return r<0?n.now:r<8?`${r} ${n.days}`:(e=>{const t=se(e.getDate(),2),n=se(e.getMonth()+1,2);return`${se(e.getFullYear(),2)}-${n}-${t}`})(o)},ue=e=>{const t=V("WALINE_EMOJI",{}),n=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(n){const n=t.value[e];if(n)return Promise.resolve(n)}return fetch(`${e}/info.json`).then((e=>e.json())).then((o=>{const l={folder:e,...o};return n&&(t.value[e]=l),l}))},de=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,pe=({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:r,token:a})=>{const i={};return a&&(i.Authorization=`Bearer ${a}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:r,headers:i}).then((e=>e.json())).then((e=>((e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e})(e,"comment list")))},ve=e=>e.type.includes("image"),fe=e=>{const t=Array.from(e).find(ve);return t?t.getAsFile():null},ge=/\$.*?\$/,he=/^\$(.*?)\$/,we=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,ye=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),ke=(e,{emojiMap:t,highlighter:o,texRenderer:l})=>{if(n.marked.setOptions({highlight:o||void 0,breaks:!0,smartLists:!0,smartypants:!0}),l){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=we.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(e){const t=e.search(ge);return-1!==t?t:e.length},tokenizer(t){const n=he.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(l);n.marked.use({extensions:e})}return n.marked.parse(ye(e,t))},be=()=>V("USER_KEY",{});var Ce=e.defineComponent({name:"CommentBox",components:{CloseIcon:({size:t})=>e.h("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:t,height:t},[e.h("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"}),e.h("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"})]),EmojiIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("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"})),ImageIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("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"}),e.h("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"})]),MarkdownIcon:()=>e.h("svg",{width:"16",height:"16",ariaHidden:"true"},e.h("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"})),PreviewIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("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"}),e.h("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"})]),LoadingIcon:O},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(t,{emit:n}){const o=e.inject("config"),r=V("WALINE_COMMENT_BOX_EDITOR",""),a=V("WALINE_USER_META",{nick:"",mail:"",link:""}),i=be(),c=e.ref({}),s=e.ref(null),m=e.ref(null),u=e.ref(null),d=e.ref(null),p=e.ref({tabs:[],map:{}}),v=e.ref(0),f=e.ref(!1),g=e.ref(!1),h=e.ref(""),w=e.ref(0),y=e.ref(0),k=e.ref(!1),b=e.ref(""),C=e.ref(!1),E=e.computed((()=>o.value.locale)),B=e.computed((()=>{var e;return Boolean(null===(e=i.value)||void 0===e?void 0:e.token)})),N=e.computed((()=>!1!==o.value.imageUploader)),$=e=>{const t=s.value,n=t.selectionStart,o=t.selectionEnd||0,l=t.scrollTop;r.value=t.value.substring(0,n)+e+t.value.substring(o,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=l},S=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return $(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{r.value=r.value.replace(t,`\r\n![${e.name}](${n})`)}))},x=()=>{var e,l,m,u,d;const{serverURL:v,lang:f,login:g,wordLimit:y,requiredMeta:B}=o.value,N={comment:b.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:o.value.path};if(null===(e=i.value)||void 0===e?void 0:e.token)N.nick=i.value.display_name,N.mail=i.value.email,N.link=i.value.url;else{if("force"===g)return;if(B.indexOf("nick")>-1&&!N.nick)return null===(l=c.value.nick)||void 0===l||l.focus(),alert(E.value.nickError);if(B.indexOf("mail")>-1&&!N.mail||N.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(N.mail))return null===(m=c.value.mail)||void 0===m||m.focus(),alert(E.value.mailError);if(!N.comment)return void(null===(u=s.value)||void 0===u||u.focus());N.nick||(N.nick=E.value.anonymous)}if(!k.value)return alert(E.value.wordHint.replace("$0",y[0].toString()).replace("$1",y[1].toString()).replace("$2",w.value.toString()));N.comment=ye(N.comment,p.value.map),t.replyId&&t.rootId&&(N.pid=t.replyId,N.rid=t.rootId,N.at=t.replyUser),C.value=!0,(({serverURL:e,lang:t,token:n,comment:o})=>{const l={"Content-Type":"application/json"};return n&&(l.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:l,body:JSON.stringify(o)}).then((e=>e.json()))})({serverURL:v,lang:f,token:null===(d=i.value)||void 0===d?void 0:d.token,comment:N}).then((e=>{if(C.value=!1,e.errmsg)return alert(e.errmsg);n("submit",e.data),r.value="",h.value="",t.replyId&&n("cancel-reply")})).catch((e=>{C.value=!1,alert(e.message)}))},I=e=>{u.value.contains(e.target)||d.value.contains(e.target)||(f.value=!1)};return e.watch([o,w],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(y.value=n[0],k.value=!1):t>n[1]?(y.value=n[1],k.value=!1):(y.value=n[1],k.value=!0):(y.value=0,k.value=!0)}),{immediate:!0}),e.onMounted((()=>{document.body.addEventListener("click",I),e.watch((()=>r.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;b.value=e,h.value=ke(e,{emojiMap:p.value.map,highlighter:t,texRenderer:n}),w.value=(e=>(e=>e.match(/[\w\d\s\u00C0-\u024F]+/giu)||[])(e).reduce(((e,t)=>e+(""===t.trim()?0:t.trim().split(/\s+/u).length)),0)+(e=>e.match(/[\u4E00-\u9FA5]/gu)||[])(e).length)(e),e?l.default(s.value):l.default.destroy(s.value)}),{immediate:!0}),e.watch((()=>o.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?ue(oe(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:r,type:a,items:i}=e;t.tabs.push({name:n,icon:de(l,o,r,a),items:i.map((e=>{const n=`${r||""}${e}`;return t.map[n]=de(e,o,r,a),n}))})})),t}))).then((e=>{p.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",I)})),{config:o,locale:E,insert:$,onChange:()=>{const e=m.value;e.files&&N.value&&S(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{var t;if(null===(t=e.dataTransfer)||void 0===t?void 0:t.items){const t=fe(e.dataTransfer.items);t&&N.value&&(S(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&x()},onPaste:e=>{if(e.clipboardData){const t=fe(e.clipboardData.items);t&&N.value&&S(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,r=(window.innerHeight-450)/2,a=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:null},"*");const c=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(null==a||a.close(),i.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",c))};window.addEventListener("message",c)},onLogout:()=>{i.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-800)/2,r=(window.innerHeight-800)/2,a=window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:i.value.token},"*");const c=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))),window.removeEventListener("message",c))};window.addEventListener("message",c)},submitComment:x,isLogin:B,userInfo:i,isSubmitting:C,wordNumber:w,wordLimit:y,isWordNumberLegal:k,editor:r,userMeta:a,emoji:p,emojiTabIndex:v,showEmoji:f,canUploadImage:N,previewText:h,showPreview:g,inputRefs:c,editorRef:s,emojiButtonRef:u,emojiPopupRef:d,imageUploadRef:m}}});const Ee={class:"wl-comment"},Be={key:0,class:"wl-login-info"},Ne={class:"wl-avatar"},$e=["title"],Se=["src"],Ve=["textContent"],xe={class:"wl-panel"},Ie=["for","textContent"],je=["id","name","type","onUpdate:modelValue"],Le=["placeholder"],Re={class:"wl-preview"},ze=e.createElementVNode("hr",null,null,-1),Me=["innerHTML"],De={class:"wl-footer"},Ae={class:"wl-actions"},Oe={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},Pe=["title"],Ue=["title"],Te=["title"],Fe={class:"wl-info"},_e={class:"wl-text-number"},We={key:0},He=e.createTextVNode("  /  "),qe=["textContent"],Je=["textContent"],Ke=["disabled"],Ye={key:0,class:"wl-tab-wrapper"},Ge=["title","onClick"],Xe=["src","alt"],Qe={key:0,class:"wl-tabs"},Ze=["onClick"],et=["src","alt","title"],tt=["title"];Ce.render=function(t,n,o,l,r,a){const i=e.resolveComponent("CloseIcon"),c=e.resolveComponent("MarkdownIcon"),s=e.resolveComponent("EmojiIcon"),m=e.resolveComponent("ImageIcon"),u=e.resolveComponent("PreviewIcon"),d=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",Ee,["disable"!==t.config.login&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",Ne,[e.createElementVNode("button",{class:"wl-logout-btn",title:t.locale.logout,onClick:n[0]||(n[0]=(...e)=>t.onLogout&&t.onLogout(...e))},[e.createVNode(i,{size:14})],8,$e),e.createElementVNode("img",{src:t.userInfo.avatar,alt:"avatar"},null,8,Se)]),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",onClick:n[1]||(n[1]=(...e)=>t.onProfile&&t.onProfile(...e)),textContent:e.toDisplayString(t.userInfo.display_name)},null,8,Ve)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",xe,["force"!==t.config.login&&t.config.meta.length&&!t.isLogin?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wl-header",`item${t.config.meta.length}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.config.meta,(n=>(e.openBlock(),e.createElementBlock("div",{class:"wl-header-item",key:n},[e.createElementVNode("label",{for:n,textContent:e.toDisplayString(t.locale[n]+(t.config.requiredMeta.includes(n)||!t.config.requiredMeta.length?"":`(${t.locale.optional})`))},null,8,Ie),e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:e=>{e&&(t.inputRefs[n]=e)},id:`wl-${n}`,class:e.normalizeClass(["wl-input",`wl-${n}`]),name:n,type:"mail"===n?"email":"text","onUpdate:modelValue":e=>t.userMeta[n]=e},null,10,je),[[e.vModelDynamic,t.userMeta[n]]])])))),128))],2)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",{class:"wl-editor",ref:"editorRef",id:"wl-edit",placeholder:t.replyUser?`@${t.replyUser}`:t.locale.placeholder,"onUpdate:modelValue":n[2]||(n[2]=e=>t.editor=e),onKeydown:n[3]||(n[3]=(...e)=>t.onKeyDown&&t.onKeyDown(...e)),onDrop:n[4]||(n[4]=(...e)=>t.onDrop&&t.onDrop(...e)),onPaste:n[5]||(n[5]=(...e)=>t.onPaste&&t.onPaste(...e))},null,40,Le),[[e.vModelText,t.editor]]),e.withDirectives(e.createElementVNode("div",Re,[ze,e.createElementVNode("h4",null,e.toDisplayString(t.locale.preview)+":",1),e.createElementVNode("div",{class:"wl-content",innerHTML:t.previewText},null,8,Me)],512),[[e.vShow,t.showPreview]]),e.createElementVNode("div",De,[e.createElementVNode("div",Ae,[e.createElementVNode("a",Oe,[e.createVNode(c)]),e.withDirectives(e.createElementVNode("button",{ref:"emojiButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showEmoji}]),title:t.locale.emoji,onClick:n[6]||(n[6]=e=>t.showEmoji=!t.showEmoji)},[e.createVNode(s)],10,Pe),[[e.vShow,t.emoji.tabs.length]]),e.createElementVNode("input",{ref:"imageUploadRef",class:"upload",id:"wl-image-upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:n[7]||(n[7]=(...e)=>t.onChange&&t.onChange(...e))},null,544),t.canUploadImage?(e.openBlock(),e.createElementBlock("label",{key:0,for:"wl-image-upload",class:"wl-action",title:t.locale.uploadImage},[e.createVNode(m)],8,Ue)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:e.normalizeClass(["wl-action",{actived:t.showPreview}]),title:t.locale.preview,onClick:n[8]||(n[8]=e=>t.showPreview=!t.showPreview)},[e.createVNode(u)],10,Te)]),e.createElementVNode("div",Fe,[e.createElementVNode("div",_e,[e.createTextVNode(e.toDisplayString(t.wordNumber)+" ",1),t.config.wordLimit?(e.openBlock(),e.createElementBlock("span",We,[He,e.createElementVNode("span",{class:e.normalizeClass({illegal:!t.isWordNumberLegal}),textContent:e.toDisplayString(t.wordLimit)},null,10,qe)])):e.createCommentVNode("v-if",!0),e.createTextVNode("  "+e.toDisplayString(t.locale.word),1)]),"disable"===t.config.login||t.isLogin?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn",onClick:n[9]||(n[9]=(...e)=>t.onLogin&&t.onLogin(...e)),textContent:e.toDisplayString(t.locale.login)},null,8,Je)),"force"!==t.config.login||t.isLogin?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:t.isSubmitting,onClick:n[10]||(n[10]=(...e)=>t.submitComment&&t.submitComment(...e))},[t.isSubmitting?(e.openBlock(),e.createBlock(d,{key:0,size:16})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.locale.submit),1)],2112))],8,Ke)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{ref:"emojiPopupRef",class:e.normalizeClass(["wl-emoji-popup",{display:t.showEmoji}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.emoji.tabs,((n,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.name},[o===t.emojiTabIndex?(e.openBlock(),e.createElementBlock("div",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(n=>(e.openBlock(),e.createElementBlock("button",{key:n,title:n,onClick:e=>t.insert(`:${n}:`)},[t.showEmoji?(e.openBlock(),e.createElementBlock("img",{key:0,class:"wl-emoji",src:t.emoji.map[n],alt:n,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Xe)):e.createCommentVNode("v-if",!0)],8,Ge)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),t.emoji.tabs.length>1?(e.openBlock(),e.createElementBlock("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.emoji.tabs,((n,o)=>(e.openBlock(),e.createElementBlock("button",{key:n.name,class:e.normalizeClass(["wl-tab",{active:t.emojiTabIndex===o}]),onClick:e=>t.emojiTabIndex=o},[e.createElementVNode("img",{class:"wl-emoji",src:n.icon,alt:n.name,title:n.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,et)],10,Ze)))),128))])):e.createCommentVNode("v-if",!0)],2)])]),t.replyId?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-close",title:t.locale.cancelReply,onClick:n[11]||(n[11]=e=>t.$emit("cancel-reply"))},[e.createVNode(i,{size:24})],8,tt)):e.createCommentVNode("v-if",!0)])},Ce.__file="src/components/CommentBox.vue";var nt=e.defineComponent({props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object}},components:{CommentBox:Ce,ReplyIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"18",height:"18"},e.h("path",{d:"M1019.2 720C1001.6 625.6 968 566.4 904 497.6c-89.6-89.6-214.4-150.4-347.2-176v-120c0-25.6-8-51.2-25.6-64-33.6-30.4-81.6-30.4-112-4.8L33.6 441.6C12.8 459.2 0 484.8 0 510.4c0 25.6 12.8 51.2 30.4 68.8l385.6 312c17.6 12.8 33.6 17.6 51.2 17.6 12.8 0 25.6-4.8 38.4-8C536 888 552 857.6 552 824v-99.2c124.8 20.8 248 86.4 339.2 140.8 25.6 17.6 59.2 17.6 89.6 0 25.6-17.6 43.2-46.4 43.2-76.8 0-33.6 0-56-4.8-68.8zm-500.8-89.6-46.4-4.8v193.6L86.4 510.4 472 201.6V400l38.4 4.8c128 12.8 248 68.8 334.4 153.6 51.2 56 76.8 102.4 94.4 179.2 0 4.8 4.8 20.8 4.8 51.2C835.2 720 672 640 518.4 630.4z",fill:"currentColor"})),VerifiedIcon:()=>e.h("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},e.h("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"}))},emits:["submit","reply"],setup(t){const n=e.inject("config"),o=e.computed((()=>n.value.locale)),l=e.computed((()=>{let{link:e}=t.comment;return e?le(e)?e:`https://${e}`:""})),r=((t,n)=>{const o=D();return e.computed((()=>me(t,o.value,n)))})(t.comment.insertedAt,o.value),a=e.computed((()=>{var e;return t.comment.objectId===(null===(e=t.reply)||void 0===e?void 0:e.objectId)}));return{config:n,locale:o,isReplyingCurrent:a,link:l,time:r}}});const ot=["id"],lt={class:"wl-user","aria-hidden":"true"},rt=["src"],at={class:"wl-card"},it={class:"wl-head"},ct=["href"],st={key:1,class:"wl-nick"},mt=["textContent"],ut=["textContent"],dt=["textContent"],pt=["textContent"],vt=["textContent"],ft=["title"],gt={class:"wl-meta","aria-hidden":"true"},ht=["textContent"],wt=["textContent"],yt=["textContent"],kt=["innerHTML"],bt={key:0,class:"wl-reply-wrapper"},Ct={key:1,class:"wl-quote"};nt.render=function(t,n,o,l,r,a){const i=e.resolveComponent("VerifiedIcon"),c=e.resolveComponent("ReplyIcon"),s=e.resolveComponent("CommentBox"),m=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{class:"wl-item",id:t.comment.objectId},[e.createElementVNode("div",lt,[t.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.comment.avatar},null,8,rt)):e.createCommentVNode("v-if",!0),t.comment.type?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",at,[e.createElementVNode("div",it,[t.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"wl-nick",href:t.link,target:"_blank",rel:"nofollow noreferrer"},e.toDisplayString(t.comment.nick),9,ct)):(e.openBlock(),e.createElementBlock("span",st,e.toDisplayString(t.comment.nick),1)),"administrator"===t.comment.type?(e.openBlock(),e.createElementBlock("span",{key:2,class:"wl-badge",textContent:e.toDisplayString(t.locale.admin)},null,8,mt)):e.createCommentVNode("v-if",!0),t.comment.label?(e.openBlock(),e.createElementBlock("span",{key:3,class:"wl-badge",textContent:e.toDisplayString(t.comment.label)},null,8,ut)):e.createCommentVNode("v-if",!0),t.comment.sticky?(e.openBlock(),e.createElementBlock("span",{key:4,class:"wl-badge",textContent:e.toDisplayString(t.locale.sticky)},null,8,dt)):e.createCommentVNode("v-if",!0),t.comment.level>=0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(`wl-badge level${t.comment.level}`),textContent:e.toDisplayString(t.locale[`level${t.comment.level}`]||`Level ${t.comment.level}`)},null,10,pt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(t.time)},null,8,vt),e.createElementVNode("button",{class:e.normalizeClass(["wl-reply",{active:t.isReplyingCurrent}]),title:t.isReplyingCurrent?t.locale.cancelReply:t.locale.reply,onClick:n[0]||(n[0]=e=>t.$emit("reply",t.isReplyingCurrent?null:t.comment))},[e.createVNode(c)],10,ft)]),e.createElementVNode("div",gt,[t.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.addr)},null,8,ht)):e.createCommentVNode("v-if",!0),t.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,textContent:e.toDisplayString(t.comment.browser)},null,8,wt)):e.createCommentVNode("v-if",!0),t.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,textContent:e.toDisplayString(t.comment.os)},null,8,yt)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{class:"wl-content",innerHTML:t.comment.comment},null,8,kt),t.isReplyingCurrent?(e.openBlock(),e.createElementBlock("div",bt,[e.createVNode(s,{replyId:t.comment.objectId,replyUser:t.comment.nick,rootId:t.rootId,onSubmit:n[1]||(n[1]=e=>t.$emit("submit",e)),onCancelReply:n[2]||(n[2]=e=>t.$emit("reply",null))},null,8,["replyId","replyUser","rootId"])])):e.createCommentVNode("v-if",!0),t.comment.children?(e.openBlock(),e.createElementBlock("div",Ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment.children,(o=>(e.openBlock(),e.createBlock(m,{key:o.objectId,comment:o,reply:t.reply,rootId:t.rootId,onReply:n[3]||(n[3]=e=>t.$emit("reply",e)),onSubmit:n[4]||(n[4]=e=>t.$emit("submit",e))},null,8,["comment","reply","rootId"])))),128))])):e.createCommentVNode("v-if",!0)])],8,ot)},nt.__file="src/components/CommentCard.vue";var Et=e.defineComponent({name:"WalineRoot",components:{CommentBox:Ce,CommentCard:nt,LoadingIcon:O},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","copyright"],setup(t){const n=e.computed((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:o,emoji:l=["//unpkg.com/@waline/emojis@1.0.1/weibo"],meta:r=["nick","mail","link"],requiredMeta:a=[],dark:i=!1,pageSize:c=10,wordLimit:s,imageUploader:m,highlighter:u,texRenderer:d,copyright:p=!0,login:v="enable",...f})=>({serverURL:re(e),path:ne(t),locale:{...te[n]||te["zh-CN"],..."object"==typeof o?o:{}},wordLimit:ae(s),meta:U(r),requiredMeta:U(a),imageUploader:ie(m,T),highlighter:ie(u,q),texRenderer:ie(d,F),lang:n,dark:i,emoji:l,pageSize:c,login:v,copyright:p,...f}))(t))),o=be(),l=e.ref("loading"),a=e.ref(0),i=e.ref(1),c=e.ref(0),s=e.ref([]),m=e.ref(null),u=e.computed((()=>{return"string"==typeof(e=n.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${ce}}`:`${e}${ce}`:!0===e?`:root${ce}`:"";var e}));let d;!function(t,n={}){const o=e.ref(!1),{document:l=C,immediate:a=!0,manual:i=!1,id:c="vueuse_styletag_"+ ++A}=n,s=e.ref(t);let m=()=>{};const u=()=>{if(!l)return;const t=l.getElementById(c)||l.createElement("style");t.type="text/css",t.id=c,n.media&&(t.media=n.media),l.head.appendChild(t),o.value||(m=e.watch(s,(e=>{t.innerText=e}),{immediate:!0}),o.value=!0)},d=()=>{l&&o.value&&(m(),l.head.removeChild(l.getElementById(c)),o.value=!1)};a&&!i&&u(),i||r(d),e.readonly(o)}(u);const p=e=>{var t;const{serverURL:r,path:m,pageSize:u}=n.value,p=new AbortController;l.value="loading",null==d||d(),pe({serverURL:r,lang:n.value.lang,path:m,pageSize:u,page:e,signal:p.signal,token:null===(t=o.value)||void 0===t?void 0:t.token}).then((t=>{l.value="success",a.value=t.count,s.value.push(...t.data),i.value=e,c.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),l.value="error")})),d=p.abort.bind(p)},v=()=>{a.value=0,s.value=[],p(1)};return e.provide("config",n),e.watch((()=>t.path),v),e.onMounted((()=>v())),{config:n,darkmodeStyle:u,i18n:e.computed((()=>n.value.locale)),status:l,count:a,page:i,totalPages:c,data:s,reply:m,loadMore:()=>p(i.value+1),refresh:v,onReply:e=>{m.value=e},onSubmit:e=>{if(e.rid){const t=s.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else s.value.unshift(e)},version:"2.3.2"}}});const Bt={"data-waline":""},Nt={class:"wl-count"},$t=["textContent"],St={class:"wl-cards"},Vt={key:1,class:"wl-operation"},xt=["textContent"],It={key:0,class:"wl-loading"},jt=["textContent"],Lt={class:"wl-operation"},Rt=["textContent"],zt={key:3,class:"wl-power"},Mt=e.createTextVNode(" Powered by "),Dt=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);Et.render=function(t,n,o,l,r,a){const i=e.resolveComponent("CommentBox"),c=e.resolveComponent("CommentCard"),s=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",Bt,[t.reply?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,onSubmit:t.onSubmit},null,8,["onSubmit"])),e.createElementVNode("div",Nt,[t.count?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(t.count)},null,8,$t)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.i18n.comment),1)]),e.createElementVNode("div",St,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(n=>(e.openBlock(),e.createBlock(c,{key:n.objectId,"root-id":n.objectId,comment:n,reply:t.reply,onReply:t.onReply,onSubmit:t.onSubmit},null,8,["root-id","comment","reply","onReply","onSubmit"])))),128))]),"error"===t.status?(e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:n[0]||(n[0]=(...e)=>t.refresh&&t.refresh(...e)),textContent:e.toDisplayString(t.i18n.refresh)},null,8,xt)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===t.status?(e.openBlock(),e.createElementBlock("div",It,[e.createVNode(s,{size:30})])):t.data.length?t.page<t.totalPages?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createCommentVNode(" Load more button "),e.createElementVNode("div",Lt,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:n[1]||(n[1]=(...e)=>t.loadMore&&t.loadMore(...e)),textContent:e.toDisplayString(t.i18n.more)},null,8,Rt)])],2112)):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(t.i18n.sofa)},null,8,jt))],2112)),e.createCommentVNode(" Copyright Information "),t.config.copyright?(e.openBlock(),e.createElementBlock("div",zt,[Mt,Dt,e.createTextVNode(" v"+e.toDisplayString(t.version),1)])):e.createCommentVNode("v-if",!0)])},Et.__file="src/components/Waline.vue";exports.Waline=Et,exports.version="2.3.2";
//# sourceMappingURL=component.js.map

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=e=>{"AbortError"!==e.name&&console.error(e.message)},t=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},r=({serverURL:e,lang:r,paths:n,signal:o})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${r}`,{signal:o}).then((e=>e.json())).then((e=>t(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),n=({serverURL:e,lang:r,path:n})=>fetch(`${e}/article?lang=${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>t(e,"visit count"))),o=e=>e.dataset.path||e.getAttribute("id"),a=(e,t)=>{t.forEach(((t,r)=>{t.innerText=e[r].toString()}))};exports.pageviewCount=({serverURL:t,path:s=window.location.pathname,selector:i=".waline-pageview-count",update:l=!0,lang:h="zh-CN"})=>{const c=new AbortController,p=Array.from(document.querySelectorAll(i)),g=e=>{const t=o(e);return null!==t&&s!==t},u=n=>r({serverURL:t,paths:n.map((e=>o(e)||s)),lang:h,signal:c.signal}).then((e=>a(e,n))).catch(e);if(l){const e=p.filter((e=>!g(e))),r=p.filter(g);n({serverURL:t,path:s,lang:h}).then((t=>a(new Array(e.length).fill(t),e))),r.length&&u(r)}else u(p);return c.abort.bind(c)},exports.version="2.3.1";
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=e=>{"AbortError"!==e.name&&console.error(e.message)},t=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},r=({serverURL:e,lang:r,paths:n,signal:o})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${r}`,{signal:o}).then((e=>e.json())).then((e=>t(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),n=({serverURL:e,lang:r,path:n})=>fetch(`${e}/article?lang=${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>t(e,"visit count"))),o=e=>e.dataset.path||e.getAttribute("id"),a=(e,t)=>{t.forEach(((t,r)=>{t.innerText=e[r].toString()}))};exports.pageviewCount=({serverURL:t,path:s=window.location.pathname,selector:i=".waline-pageview-count",update:l=!0,lang:h="zh-CN"})=>{const c=new AbortController,p=Array.from(document.querySelectorAll(i)),g=e=>{const t=o(e);return null!==t&&s!==t},u=n=>r({serverURL:t,paths:n.map((e=>o(e)||s)),lang:h,signal:c.signal}).then((e=>a(e,n))).catch(e);if(l){const e=p.filter((e=>!g(e))),r=p.filter(g);n({serverURL:t,path:s,lang:h}).then((t=>a(new Array(e.length).fill(t),e))),r.length&&u(r)}else u(p);return c.abort.bind(c)},exports.version="2.3.2";
//# sourceMappingURL=pageview.cjs.js.map

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

const e="2.3.1",t=e=>{"AbortError"!==e.name&&console.error(e.message)},r=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},n=({serverURL:e,lang:t,paths:n,signal:a})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:a}).then((e=>e.json())).then((e=>r(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),a=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>r(e,"visit count"))),o=e=>e.dataset.path||e.getAttribute("id"),l=(e,t)=>{t.forEach(((t,r)=>{t.innerText=e[r].toString()}))},i=({serverURL:e,path:r=window.location.pathname,selector:i=".waline-pageview-count",update:s=!0,lang:h="zh-CN"})=>{const c=new AbortController,g=Array.from(document.querySelectorAll(i)),p=e=>{const t=o(e);return null!==t&&r!==t},f=a=>n({serverURL:e,paths:a.map((e=>o(e)||r)),lang:h,signal:c.signal}).then((e=>l(e,a))).catch(t);if(s){const t=g.filter((e=>!p(e))),n=g.filter(p);a({serverURL:e,path:r,lang:h}).then((e=>l(new Array(t.length).fill(e),t))),n.length&&f(n)}else f(g);return c.abort.bind(c)};export{i as pageviewCount,e as version};
const e="2.3.2",t=e=>{"AbortError"!==e.name&&console.error(e.message)},r=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},n=({serverURL:e,lang:t,paths:n,signal:a})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:a}).then((e=>e.json())).then((e=>r(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),a=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>r(e,"visit count"))),o=e=>e.dataset.path||e.getAttribute("id"),l=(e,t)=>{t.forEach(((t,r)=>{t.innerText=e[r].toString()}))},i=({serverURL:e,path:r=window.location.pathname,selector:i=".waline-pageview-count",update:s=!0,lang:h="zh-CN"})=>{const c=new AbortController,g=Array.from(document.querySelectorAll(i)),p=e=>{const t=o(e);return null!==t&&r!==t},f=a=>n({serverURL:e,paths:a.map((e=>o(e)||r)),lang:h,signal:c.signal}).then((e=>l(e,a))).catch(t);if(s){const t=g.filter((e=>!p(e))),n=g.filter(p);a({serverURL:e,path:r,lang:h}).then((e=>l(new Array(t.length).fill(e),t))),n.length&&f(n)}else f(g);return c.abort.bind(c)};export{i as pageviewCount,e as version};
//# sourceMappingURL=pageview.esm.js.map

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

!function(e,t){if("function"==typeof define&&define.amd)define("Waline",["exports"],t);else if("undefined"!=typeof exports)t(exports);else{var n={exports:{}};t(n.exports),e.Waline=n.exports}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.pageviewCount=void 0;e.version="2.3.1";const t=e=>{"AbortError"!==e.name&&console.error(e.message)},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("object"==typeof e&&e.errno)throw new TypeError("Fetch ".concat(t," failed with ").concat(e.errno,": ").concat(e.errmsg));return e},o=e=>{let{serverURL:t,lang:o,paths:r,signal:a}=e;return fetch("".concat(t,"/article?path=").concat(encodeURIComponent(r.join(",")),"&lang=").concat(o),{signal:a}).then((e=>e.json())).then((e=>n(e,"visit count"))).then((e=>Array.isArray(e)?e:[e]))},r=e=>{let{serverURL:t,lang:o,path:r}=e;return fetch("".concat(t,"/article?lang=").concat(o),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:r})}).then((e=>e.json())).then((e=>n(e,"visit count")))},a=e=>e.dataset.path||e.getAttribute("id"),i=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))};e.pageviewCount=e=>{let{serverURL:n,path:l=window.location.pathname,selector:s=".waline-pageview-count",update:c=!0,lang:h="zh-CN"}=e;const f=new AbortController,p=Array.from(document.querySelectorAll(s)),d=e=>{const t=a(e);return null!==t&&l!==t},g=e=>o({serverURL:n,paths:e.map((e=>a(e)||l)),lang:h,signal:f.signal}).then((t=>i(t,e))).catch(t);if(c){const e=p.filter((e=>!d(e))),t=p.filter(d);r({serverURL:n,path:l,lang:h}).then((t=>i(new Array(e.length).fill(t),e))),t.length&&g(t)}else g(p);return f.abort.bind(f)}}));
!function(e,t){if("function"==typeof define&&define.amd)define("Waline",["exports"],t);else if("undefined"!=typeof exports)t(exports);else{var n={exports:{}};t(n.exports),e.Waline=n.exports}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.pageviewCount=void 0;e.version="2.3.2";const t=e=>{"AbortError"!==e.name&&console.error(e.message)},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("object"==typeof e&&e.errno)throw new TypeError("Fetch ".concat(t," failed with ").concat(e.errno,": ").concat(e.errmsg));return e},o=e=>{let{serverURL:t,lang:o,paths:r,signal:a}=e;return fetch("".concat(t,"/article?path=").concat(encodeURIComponent(r.join(",")),"&lang=").concat(o),{signal:a}).then((e=>e.json())).then((e=>n(e,"visit count"))).then((e=>Array.isArray(e)?e:[e]))},r=e=>{let{serverURL:t,lang:o,path:r}=e;return fetch("".concat(t,"/article?lang=").concat(o),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:r})}).then((e=>e.json())).then((e=>n(e,"visit count")))},a=e=>e.dataset.path||e.getAttribute("id"),i=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))};e.pageviewCount=e=>{let{serverURL:n,path:l=window.location.pathname,selector:s=".waline-pageview-count",update:c=!0,lang:h="zh-CN"}=e;const f=new AbortController,p=Array.from(document.querySelectorAll(s)),d=e=>{const t=a(e);return null!==t&&l!==t},g=e=>o({serverURL:n,paths:e.map((e=>a(e)||l)),lang:h,signal:f.signal}).then((t=>i(t,e))).catch(t);if(c){const e=p.filter((e=>!d(e))),t=p.filter(d);r({serverURL:n,path:l,lang:h}).then((t=>i(new Array(e.length).fill(t),e))),t.length&&g(t)}else g(p);return f.abort.bind(f)}}));
//# sourceMappingURL=pageview.js.map

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

import{getCurrentScope as e,onScopeDispose as t,ref as n,unref as o,isRef as l,watch as r,readonly as a,shallowRef as i,computed as s,h as c,defineComponent as u,inject as m,onMounted as d,onUnmounted as p,resolveComponent as v,openBlock as g,createElementBlock as f,createElementVNode as h,createVNode as w,toDisplayString as y,createCommentVNode as b,normalizeClass as k,Fragment as C,renderList as $,withDirectives as I,vModelDynamic as L,vModelText as j,vShow as x,createTextVNode as S,createBlock as E,provide as R,reactive as A,createApp as U,watchEffect as z}from"vue";import M from"autosize";import{marked as O}from"marked";const P=["nick","mail","link"],N=e=>e.filter((e=>P.includes(e))),T=e=>new Promise(((t,n)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{var e;return t((null===(e=o.result)||void 0===e?void 0:e.toString())||"")},o.onerror=n})),B=e=>!0===e?'<p class="wl-tex">Tex is not available in preview</p>':'<span class="wl-tex">Tex is not available in preview</span>',_=new RegExp(`(${/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source}|${/</.source})|((?:${/(?:^|\s)\/\/(.+?)$/gm.source})|(?:${/\/\*([\S\s]*?)\*\//gm.source}))`,"gmi"),F=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],D={},H=e=>{let t=0;return e.replace(_,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;D[n]?l=D[n]:(l=F[t],D[n]=l);const r=`<span style="color: #${l}">${n}</span>`;return t=++t%F.length,r}))},W=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","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"],q=e=>Object.fromEntries(e.map(((e,t)=>[W[t],e])));var V=q(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","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!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar"]),J=q(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名"]),K=q(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说"]),Y=q(["暱稱","郵箱","網址","可選","暱稱不能少於3個字元","請填寫正確的郵件地址","歡迎評論","來發評論吧~","提交","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說"]),G=q(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras","Favor enviar comentário com $0 a $1 palavras!\n Número de palavras atuais: $2","Anônimo"]),X=q(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный"]);const Q={zh:K,"zh-cn":K,"zh-CN":K,"zh-tw":Y,"zh-TW":Y,en:V,"en-US":V,"en-us":V,jp:J,"jp-jp":J,"jp-JP":J,"pt-br":G,"pt-BR":G,ru:X,"ru-ru":X,"ru-RU":X};function Z(n){return!!e()&&(t(n),!0)}const ee="undefined"!=typeof window,te=()=>{};const ne=e=>e();var oe=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;function ae(e,t,n={}){const o=n,{eventFilter:l=ne}=o,a=((e,t)=>{var n={};for(var o in e)le.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&oe)for(var o of oe(e))t.indexOf(o)<0&&re.call(e,o)&&(n[o]=e[o]);return n})(o,["eventFilter"]);return r(e,(i=l,s=t,function(...e){i((()=>s.apply(this,e)),{fn:s,thisArg:this,args:e})}),a);var i,s}var ie=Object.defineProperty,se=Object.defineProperties,ce=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable,pe=(e,t,n)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function ve(e,t,o={}){const l=o,{eventFilter:r}=l,a=((e,t)=>{var n={};for(var o in e)me.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&ue)for(var o of ue(e))t.indexOf(o)<0&&de.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:s,resume:c,isActive:u}=function(e=ne){const t=n(!0);return{isActive:t,pause:function(){t.value=!1},resume:function(){t.value=!0},eventFilter:(...n)=>{t.value&&e(...n)}}}(r),m=ae(e,t,(d=((e,t)=>{for(var n in t||(t={}))me.call(t,n)&&pe(e,n,t[n]);if(ue)for(var n of ue(t))de.call(t,n)&&pe(e,n,t[n]);return e})({},a),se(d,ce({eventFilter:i}))));var d;return{stop:m,pause:s,resume:c,isActive:u}}const ge=ee?window:void 0,fe=ee?window.document:void 0;function he(...e){let t,n,l,a;if("string"==typeof e[0]?([n,l,a]=e,t=ge):[t,n,l,a]=e,!t)return te;let i=te;const s=r((()=>function(e){var t;const n=o(e);return null!=(t=null==n?void 0:n.$el)?t:n}(t)),(e=>{i(),e&&(e.addEventListener(n,l,a),i=()=>{e.removeEventListener(n,l,a),i=te})}),{immediate:!0,flush:"post"}),c=()=>{s(),i()};return Z(c),c}ee&&window.navigator,ee&&window.location;const we="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ye="__vueuse_ssr_handlers__";we[ye]=we[ye]||{};const be=we[ye];const ke={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function Ce(e,t,l,r={}){var a;const{flush:s="pre",deep:c=!0,listenToStorageChanges:u=!0,writeDefaults:m=!0,shallow:d,window:p=ge,eventFilter:v,onError:g=(e=>{console.error(e)})}=r,f=(d?i:n)(t);if(!l)try{l=function(e,t){return be[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=ge)?void 0:e.localStorage}))()}catch(e){g(e)}if(!l)return f;const h=o(t),w=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(h),y=null!=(a=r.serializer)?a:ke[w],{pause:b,resume:k}=ve(f,(()=>function(t){try{null==t?l.removeItem(e):l.setItem(e,y.write(t))}catch(e){g(e)}}(f.value)),{flush:s,deep:c,eventFilter:v});return p&&u&&he(p,"storage",C),C(),f;function C(t){t&&t.key!==e||(f.value=function(t){if(!t||t.key===e){b();try{const n=t?t.newValue:l.getItem(e);return null==n?(m&&null!==h&&l.setItem(e,y.write(h)),h):"string"!=typeof n?n:y.read(n)}catch(e){g(e)}finally{k()}}}(t))}}var $e,Ie,Le=Object.defineProperty,je=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,Ee=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function Re(e={}){const{controls:t=!1,interval:a="requestAnimationFrame"}=e,i=n(new Date),s=()=>i.value=new Date,c="requestAnimationFrame"===a?function(e,t={}){const{immediate:o=!0,window:l=ge}=t,r=n(!1);let a=null;function i(){r.value&&l&&(e(),a=l.requestAnimationFrame(i))}function s(){!r.value&&l&&(r.value=!0,i())}function c(){r.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return o&&s(),Z(c),{isActive:r,pause:c,resume:s}}(s,{immediate:!0}):function(e,t=1e3,a={}){const{immediate:i=!0,immediateCallback:s=!1}=a;let c=null;const u=n(!1);function m(){c&&(clearInterval(c),c=null)}function d(){u.value=!1,m()}function p(){t<=0||(u.value=!0,s&&e(),m(),c=setInterval(e,o(t)))}i&&ee&&p(),l(t)&&Z(r(t,(()=>{i&&ee&&p()})));return Z(d),{isActive:u,pause:d,resume:p}}(s,a,{immediate:!0});return t?((e,t)=>{for(var n in t||(t={}))xe.call(t,n)&&Ee(e,n,t[n]);if(je)for(var n of je(t))Se.call(t,n)&&Ee(e,n,t[n]);return e})({now:i},c):i}ee&&(null==window?void 0:window.navigator)&&(null==($e=null==window?void 0:window.navigator)?void 0:$e.platform)&&/iP(ad|hone|od)/.test(null==(Ie=null==window?void 0:window.navigator)?void 0:Ie.platform);let Ae=0;const Ue=e=>{try{e=decodeURI(e)}catch(e){}return e},ze=(e="")=>e.replace(/\/$/u,""),Me=e=>/^(https?:)?\/\//.test(e),Oe=e=>{const t=ze(e);return Me(t)?t:`https://${t}`},Pe=e=>Array.isArray(e)?e:!!e&&[0,e],Ne=(e,t)=>"function"==typeof e?e:!1!==e&&t,Te="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",Be=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},_e=(e,t,n)=>{if(!e)return"";const o="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,l=t.getTime()-o.getTime(),r=Math.floor(l/864e5);if(0===r){const e=l%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,o=Math.floor(t/6e4);if(0===o){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${o} ${n.minutes}`}return`${t} ${n.hours}`}return r<0?n.now:r<8?`${r} ${n.days}`:(e=>{const t=Be(e.getDate(),2),n=Be(e.getMonth()+1,2);return`${Be(e.getFullYear(),2)}-${n}-${t}`})(o)},Fe=e=>{const t=Ce("WALINE_EMOJI",{}),n=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(n){const n=t.value[e];if(n)return Promise.resolve(n)}return fetch(`${e}/info.json`).then((e=>e.json())).then((o=>{const l={folder:e,...o};return n&&(t.value[e]=l),l}))},De=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,He=e=>{"AbortError"!==e.name&&console.error(e.message)},We=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},qe=({serverURL:e,lang:t,paths:n,signal:o})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o}).then((e=>e.json())).then((e=>We(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),Ve=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>We(e,"visit count"))),Je=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,Ke=e=>e.type.includes("image"),Ye=e=>{const t=Array.from(e).find(Ke);return t?t.getAsFile():null},Ge=/\$.*?\$/,Xe=/^\$(.*?)\$/,Qe=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Ze=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),et=(e,{emojiMap:t,highlighter:n,texRenderer:o})=>{if(O.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),o){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=Qe.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(e){const t=e.search(Ge);return-1!==t?t:e.length},tokenizer(t){const n=Xe.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(o);O.use({extensions:e})}return O.parse(Ze(e,t))},tt=e=>e.dataset.path||e.getAttribute("id"),nt=()=>Ce("USER_KEY",{}),ot=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:o="zh-CN"})=>{var l;const r=new AbortController,a=document.querySelectorAll(n),i=nt();return a.length&&(({serverURL:e,lang:t,paths:n,signal:o,token:l})=>{const r={};return l&&(r.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o,headers:r}).then((e=>e.json())).then((e=>We(e,"comment count"))).then((e=>Array.isArray(e)?e:[e]))})({serverURL:e,paths:Array.from(a).map((e=>Ue(e.dataset.path||e.getAttribute("id")||t))),lang:o,signal:r.signal,token:null===(l=i.value)||void 0===l?void 0:l.token}).then((e=>{a.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(He),r.abort.bind(r)},lt=({size:e})=>c("svg",{width:e,height:e,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"})));var rt=u({name:"CommentBox",components:{CloseIcon:({size:e})=>c("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[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"})]),EmojiIcon:()=>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"})),ImageIcon:()=>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"})]),MarkdownIcon:()=>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"})),PreviewIcon:()=>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"})]),LoadingIcon:lt},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(e,{emit:t}){const o=m("config"),l=Ce("WALINE_COMMENT_BOX_EDITOR",""),a=Ce("WALINE_USER_META",{nick:"",mail:"",link:""}),i=nt(),c=n({}),u=n(null),v=n(null),g=n(null),f=n(null),h=n({tabs:[],map:{}}),w=n(0),y=n(!1),b=n(!1),k=n(""),C=n(0),$=n(0),I=n(!1),L=n(""),j=n(!1),x=s((()=>o.value.locale)),S=s((()=>{var e;return Boolean(null===(e=i.value)||void 0===e?void 0:e.token)})),E=s((()=>!1!==o.value.imageUploader)),R=e=>{const t=u.value,n=t.selectionStart,o=t.selectionEnd||0,r=t.scrollTop;l.value=t.value.substring(0,n)+e+t.value.substring(o,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=r},A=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return R(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{l.value=l.value.replace(t,`\r\n![${e.name}](${n})`)}))},U=()=>{var n,r,s,m,d;const{serverURL:p,lang:v,login:g,wordLimit:f,requiredMeta:w}=o.value,y={comment:L.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:o.value.path};if(null===(n=i.value)||void 0===n?void 0:n.token)y.nick=i.value.display_name,y.mail=i.value.email,y.link=i.value.url;else{if("force"===g)return;if(w.indexOf("nick")>-1&&!y.nick)return null===(r=c.value.nick)||void 0===r||r.focus(),alert(x.value.nickError);if(w.indexOf("mail")>-1&&!y.mail||y.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.){0,2}\w+$/.exec(y.mail))return null===(s=c.value.mail)||void 0===s||s.focus(),alert(x.value.mailError);if(!y.comment)return void(null===(m=u.value)||void 0===m||m.focus());y.nick||(y.nick=x.value.anonymous)}if(!I.value)return alert(x.value.wordHint.replace("$0",f[0].toString()).replace("$1",f[1].toString()).replace("$2",C.value.toString()));y.comment=Ze(y.comment,h.value.map),e.replyId&&e.rootId&&(y.pid=e.replyId,y.rid=e.rootId,y.at=e.replyUser),j.value=!0,(({serverURL:e,lang:t,token:n,comment:o})=>{const l={"Content-Type":"application/json"};return n&&(l.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:l,body:JSON.stringify(o)}).then((e=>e.json()))})({serverURL:p,lang:v,token:null===(d=i.value)||void 0===d?void 0:d.token,comment:y}).then((n=>{if(j.value=!1,n.errmsg)return alert(n.errmsg);t("submit",n.data),l.value="",k.value="",e.replyId&&t("cancel-reply")})).catch((e=>{j.value=!1,alert(e.message)}))},z=e=>{g.value.contains(e.target)||f.value.contains(e.target)||(y.value=!1)};return r([o,C],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?($.value=n[0],I.value=!1):t>n[1]?($.value=n[1],I.value=!1):($.value=n[1],I.value=!0):($.value=0,I.value=!0)}),{immediate:!0}),d((()=>{document.body.addEventListener("click",z),r((()=>l.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;L.value=e,k.value=et(e,{emojiMap:h.value.map,highlighter:t,texRenderer:n}),C.value=(e=>(e=>e.match(/[\w\d\s\u00C0-\u024F]+/giu)||[])(e).reduce(((e,t)=>e+(""===t.trim()?0:t.trim().split(/\s+/u).length)),0)+(e=>e.match(/[\u4E00-\u9FA5]/gu)||[])(e).length)(e),e?M(u.value):M.destroy(u.value)}),{immediate:!0}),r((()=>o.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?Fe(ze(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:r,type:a,items:i}=e;t.tabs.push({name:n,icon:De(l,o,r,a),items:i.map((e=>{const n=`${r||""}${e}`;return t.map[n]=De(e,o,r,a),n}))})})),t}))).then((e=>{h.value=e}));var t}),{immediate:!0})})),p((()=>{document.body.removeEventListener("click",z)})),{config:o,locale:x,insert:R,onChange:()=>{const e=v.value;e.files&&E.value&&A(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{var t;if(null===(t=e.dataTransfer)||void 0===t?void 0:t.items){const t=Ye(e.dataTransfer.items);t&&E.value&&(A(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&U()},onPaste:e=>{if(e.clipboardData){const t=Ye(e.clipboardData.items);t&&E.value&&A(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,r=(window.innerHeight-450)/2,a=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:null},"*");const s=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(null==a||a.close(),i.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",s))};window.addEventListener("message",s)},onLogout:()=>{i.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-800)/2,r=(window.innerHeight-800)/2,a=window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:i.value.token},"*");const s=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))),window.removeEventListener("message",s))};window.addEventListener("message",s)},submitComment:U,isLogin:S,userInfo:i,isSubmitting:j,wordNumber:C,wordLimit:$,isWordNumberLegal:I,editor:l,userMeta:a,emoji:h,emojiTabIndex:w,showEmoji:y,canUploadImage:E,previewText:k,showPreview:b,inputRefs:c,editorRef:u,emojiButtonRef:g,emojiPopupRef:f,imageUploadRef:v}}});const at={class:"wl-comment"},it={key:0,class:"wl-login-info"},st={class:"wl-avatar"},ct=["title"],ut=["src"],mt=["textContent"],dt={class:"wl-panel"},pt=["for","textContent"],vt=["id","name","type","onUpdate:modelValue"],gt=["placeholder"],ft={class:"wl-preview"},ht=h("hr",null,null,-1),wt=["innerHTML"],yt={class:"wl-footer"},bt={class:"wl-actions"},kt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},Ct=["title"],$t=["title"],It=["title"],Lt={class:"wl-info"},jt={class:"wl-text-number"},xt={key:0},St=S("  /  "),Et=["textContent"],Rt=["textContent"],At=["disabled"],Ut={key:0,class:"wl-tab-wrapper"},zt=["title","onClick"],Mt=["src","alt"],Ot={key:0,class:"wl-tabs"},Pt=["onClick"],Nt=["src","alt","title"],Tt=["title"];rt.render=function(e,t,n,o,l,r){const a=v("CloseIcon"),i=v("MarkdownIcon"),s=v("EmojiIcon"),c=v("ImageIcon"),u=v("PreviewIcon"),m=v("LoadingIcon");return g(),f("div",at,["disable"!==e.config.login&&e.isLogin?(g(),f("div",it,[h("div",st,[h("button",{class:"wl-logout-btn",title:e.locale.logout,onClick:t[0]||(t[0]=(...t)=>e.onLogout&&e.onLogout(...t))},[w(a,{size:14})],8,ct),h("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,ut)]),h("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",onClick:t[1]||(t[1]=(...t)=>e.onProfile&&e.onProfile(...t)),textContent:y(e.userInfo.display_name)},null,8,mt)])):b("v-if",!0),h("div",dt,["force"!==e.config.login&&e.config.meta.length&&!e.isLogin?(g(),f("div",{key:0,class:k(["wl-header",`item${e.config.meta.length}`])},[(g(!0),f(C,null,$(e.config.meta,(t=>(g(),f("div",{class:"wl-header-item",key:t},[h("label",{for:t,textContent:y(e.locale[t]+(e.config.requiredMeta.includes(t)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,pt),I(h("input",{ref_for:!0,ref:n=>{n&&(e.inputRefs[t]=n)},id:`wl-${t}`,class:k(["wl-input",`wl-${t}`]),name:t,type:"mail"===t?"email":"text","onUpdate:modelValue":n=>e.userMeta[t]=n},null,10,vt),[[L,e.userMeta[t]]])])))),128))],2)):b("v-if",!0),I(h("textarea",{class:"wl-editor",ref:"editorRef",id:"wl-edit",placeholder:e.replyUser?`@${e.replyUser}`:e.locale.placeholder,"onUpdate:modelValue":t[2]||(t[2]=t=>e.editor=t),onKeydown:t[3]||(t[3]=(...t)=>e.onKeyDown&&e.onKeyDown(...t)),onDrop:t[4]||(t[4]=(...t)=>e.onDrop&&e.onDrop(...t)),onPaste:t[5]||(t[5]=(...t)=>e.onPaste&&e.onPaste(...t))},null,40,gt),[[j,e.editor]]),I(h("div",ft,[ht,h("h4",null,y(e.locale.preview)+":",1),h("div",{class:"wl-content",innerHTML:e.previewText},null,8,wt)],512),[[x,e.showPreview]]),h("div",yt,[h("div",bt,[h("a",kt,[w(i)]),I(h("button",{ref:"emojiButtonRef",class:k(["wl-action",{actived:e.showEmoji}]),title:e.locale.emoji,onClick:t[6]||(t[6]=t=>e.showEmoji=!e.showEmoji)},[w(s)],10,Ct),[[x,e.emoji.tabs.length]]),h("input",{ref:"imageUploadRef",class:"upload",id:"wl-image-upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:t[7]||(t[7]=(...t)=>e.onChange&&e.onChange(...t))},null,544),e.canUploadImage?(g(),f("label",{key:0,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[w(c)],8,$t)):b("v-if",!0),h("button",{class:k(["wl-action",{actived:e.showPreview}]),title:e.locale.preview,onClick:t[8]||(t[8]=t=>e.showPreview=!e.showPreview)},[w(u)],10,It)]),h("div",Lt,[h("div",jt,[S(y(e.wordNumber)+" ",1),e.config.wordLimit?(g(),f("span",xt,[St,h("span",{class:k({illegal:!e.isWordNumberLegal}),textContent:y(e.wordLimit)},null,10,Et)])):b("v-if",!0),S("  "+y(e.locale.word),1)]),"disable"===e.config.login||e.isLogin?b("v-if",!0):(g(),f("button",{key:0,class:"wl-btn",onClick:t[9]||(t[9]=(...t)=>e.onLogin&&e.onLogin(...t)),textContent:y(e.locale.login)},null,8,Rt)),"force"!==e.config.login||e.isLogin?(g(),f("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:t[10]||(t[10]=(...t)=>e.submitComment&&e.submitComment(...t))},[e.isSubmitting?(g(),E(m,{key:0,size:16})):(g(),f(C,{key:1},[S(y(e.locale.submit),1)],2112))],8,At)):b("v-if",!0)]),h("div",{ref:"emojiPopupRef",class:k(["wl-emoji-popup",{display:e.showEmoji}])},[(g(!0),f(C,null,$(e.emoji.tabs,((t,n)=>(g(),f(C,{key:t.name},[n===e.emojiTabIndex?(g(),f("div",Ut,[(g(!0),f(C,null,$(t.items,(t=>(g(),f("button",{key:t,title:t,onClick:n=>e.insert(`:${t}:`)},[e.showEmoji?(g(),f("img",{key:0,class:"wl-emoji",src:e.emoji.map[t],alt:t,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Mt)):b("v-if",!0)],8,zt)))),128))])):b("v-if",!0)],64)))),128)),e.emoji.tabs.length>1?(g(),f("div",Ot,[(g(!0),f(C,null,$(e.emoji.tabs,((t,n)=>(g(),f("button",{key:t.name,class:k(["wl-tab",{active:e.emojiTabIndex===n}]),onClick:t=>e.emojiTabIndex=n},[h("img",{class:"wl-emoji",src:t.icon,alt:t.name,title:t.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Nt)],10,Pt)))),128))])):b("v-if",!0)],2)])]),e.replyId?(g(),f("button",{key:1,class:"wl-close",title:e.locale.cancelReply,onClick:t[11]||(t[11]=t=>e.$emit("cancel-reply"))},[w(a,{size:24})],8,Tt)):b("v-if",!0)])},rt.__file="src/components/CommentBox.vue";var Bt=u({props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object}},components:{CommentBox:rt,ReplyIcon:()=>c("svg",{viewBox:"0 0 1024 1024",width:"18",height:"18"},c("path",{d:"M1019.2 720C1001.6 625.6 968 566.4 904 497.6c-89.6-89.6-214.4-150.4-347.2-176v-120c0-25.6-8-51.2-25.6-64-33.6-30.4-81.6-30.4-112-4.8L33.6 441.6C12.8 459.2 0 484.8 0 510.4c0 25.6 12.8 51.2 30.4 68.8l385.6 312c17.6 12.8 33.6 17.6 51.2 17.6 12.8 0 25.6-4.8 38.4-8C536 888 552 857.6 552 824v-99.2c124.8 20.8 248 86.4 339.2 140.8 25.6 17.6 59.2 17.6 89.6 0 25.6-17.6 43.2-46.4 43.2-76.8 0-33.6 0-56-4.8-68.8zm-500.8-89.6-46.4-4.8v193.6L86.4 510.4 472 201.6V400l38.4 4.8c128 12.8 248 68.8 334.4 153.6 51.2 56 76.8 102.4 94.4 179.2 0 4.8 4.8 20.8 4.8 51.2C835.2 720 672 640 518.4 630.4z",fill:"currentColor"})),VerifiedIcon:()=>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"}))},emits:["submit","reply"],setup(e){const t=m("config"),n=s((()=>t.value.locale)),o=s((()=>{let{link:t}=e.comment;return t?Me(t)?t:`https://${t}`:""})),l=((e,t)=>{const n=Re();return s((()=>_e(e,n.value,t)))})(e.comment.insertedAt,n.value),r=s((()=>{var t;return e.comment.objectId===(null===(t=e.reply)||void 0===t?void 0:t.objectId)}));return{config:t,locale:n,isReplyingCurrent:r,link:o,time:l}}});const _t=["id"],Ft={class:"wl-user","aria-hidden":"true"},Dt=["src"],Ht={class:"wl-card"},Wt={class:"wl-head"},qt=["href"],Vt={key:1,class:"wl-nick"},Jt=["textContent"],Kt=["textContent"],Yt=["textContent"],Gt=["textContent"],Xt=["textContent"],Qt=["title"],Zt={class:"wl-meta","aria-hidden":"true"},en=["textContent"],tn=["textContent"],nn=["textContent"],on=["innerHTML"],ln={key:0,class:"wl-reply-wrapper"},rn={key:1,class:"wl-quote"};Bt.render=function(e,t,n,o,l,r){const a=v("VerifiedIcon"),i=v("ReplyIcon"),s=v("CommentBox"),c=v("CommentCard",!0);return g(),f("div",{class:"wl-item",id:e.comment.objectId},[h("div",Ft,[e.comment.avatar?(g(),f("img",{key:0,src:e.comment.avatar},null,8,Dt)):b("v-if",!0),e.comment.type?(g(),E(a,{key:1})):b("v-if",!0)]),h("div",Ht,[h("div",Wt,[e.link?(g(),f("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noreferrer"},y(e.comment.nick),9,qt)):(g(),f("span",Vt,y(e.comment.nick),1)),"administrator"===e.comment.type?(g(),f("span",{key:2,class:"wl-badge",textContent:y(e.locale.admin)},null,8,Jt)):b("v-if",!0),e.comment.label?(g(),f("span",{key:3,class:"wl-badge",textContent:y(e.comment.label)},null,8,Kt)):b("v-if",!0),e.comment.sticky?(g(),f("span",{key:4,class:"wl-badge",textContent:y(e.locale.sticky)},null,8,Yt)):b("v-if",!0),e.comment.level>=0?(g(),f("span",{key:5,class:k(`wl-badge level${e.comment.level}`),textContent:y(e.locale[`level${e.comment.level}`]||`Level ${e.comment.level}`)},null,10,Gt)):b("v-if",!0),h("span",{class:"wl-time",textContent:y(e.time)},null,8,Xt),h("button",{class:k(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:t[0]||(t[0]=t=>e.$emit("reply",e.isReplyingCurrent?null:e.comment))},[w(i)],10,Qt)]),h("div",Zt,[e.comment.addr?(g(),f("span",{key:0,textContent:y(e.comment.addr)},null,8,en)):b("v-if",!0),e.comment.browser?(g(),f("span",{key:1,textContent:y(e.comment.browser)},null,8,tn)):b("v-if",!0),e.comment.os?(g(),f("span",{key:2,textContent:y(e.comment.os)},null,8,nn)):b("v-if",!0)]),h("div",{class:"wl-content",innerHTML:e.comment.comment},null,8,on),e.isReplyingCurrent?(g(),f("div",ln,[w(s,{replyId:e.comment.objectId,replyUser:e.comment.nick,rootId:e.rootId,onSubmit:t[1]||(t[1]=t=>e.$emit("submit",t)),onCancelReply:t[2]||(t[2]=t=>e.$emit("reply",null))},null,8,["replyId","replyUser","rootId"])])):b("v-if",!0),e.comment.children?(g(),f("div",rn,[(g(!0),f(C,null,$(e.comment.children,(n=>(g(),E(c,{key:n.objectId,comment:n,reply:e.reply,rootId:e.rootId,onReply:t[3]||(t[3]=t=>e.$emit("reply",t)),onSubmit:t[4]||(t[4]=t=>e.$emit("submit",t))},null,8,["comment","reply","rootId"])))),128))])):b("v-if",!0)])],8,_t)},Bt.__file="src/components/CommentCard.vue";var an=u({name:"WalineRoot",components:{CommentBox:rt,CommentCard:Bt,LoadingIcon:lt},props:{serverURL:{type:String,required:!0},path:{type:String,required:!0},meta:{type:Array},requiredMeta:{type:Array},dark:[String,Boolean],lang:{type:String},locale:Object,pageSize:Number,wordLimit:{type:[Number,Array]},emoji:{type:[Array,Boolean]},login:String,highlighter:Function,imageUploader:[Function,Boolean],texRenderer:[Function,Boolean],copyright:Boolean},setup(e){const t=s((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:o,emoji:l=["//unpkg.com/@waline/emojis@1.0.1/weibo"],meta:r=["nick","mail","link"],requiredMeta:a=[],dark:i=!1,pageSize:s=10,wordLimit:c,imageUploader:u,highlighter:m,texRenderer:d,copyright:p=!0,login:v="enable",...g})=>({serverURL:Oe(e),path:Ue(t),locale:{...Q[n]||Q["zh-CN"],..."object"==typeof o?o:{}},wordLimit:Pe(c),meta:N(r),requiredMeta:N(a),imageUploader:Ne(u,T),highlighter:Ne(m,H),texRenderer:Ne(d,B),lang:n,dark:i,emoji:l,pageSize:s,login:v,copyright:p,...g}))(e))),o=nt(),l=n("loading"),i=n(0),c=n(1),u=n(0),m=n([]),p=n(null),v=s((()=>{return"string"==typeof(e=t.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${Te}}`:`${e}${Te}`:!0===e?`:root${Te}`:"";var e}));let g;!function(e,t={}){const o=n(!1),{document:l=fe,immediate:i=!0,manual:s=!1,id:c="vueuse_styletag_"+ ++Ae}=t,u=n(e);let m=()=>{};const d=()=>{if(!l)return;const e=l.getElementById(c)||l.createElement("style");e.type="text/css",e.id=c,t.media&&(e.media=t.media),l.head.appendChild(e),o.value||(m=r(u,(t=>{e.innerText=t}),{immediate:!0}),o.value=!0)},p=()=>{l&&o.value&&(m(),l.head.removeChild(l.getElementById(c)),o.value=!1)};i&&!s&&d(),s||Z(p),a(o)}(v);const f=e=>{var n;const{serverURL:r,path:a,pageSize:s}=t.value,d=new AbortController;l.value="loading",null==g||g(),(({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:r,token:a})=>{const i={};return a&&(i.Authorization=`Bearer ${a}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:r,headers:i}).then((e=>e.json())).then((e=>We(e,"comment list")))})({serverURL:r,lang:t.value.lang,path:a,pageSize:s,page:e,signal:d.signal,token:null===(n=o.value)||void 0===n?void 0:n.token}).then((t=>{l.value="success",i.value=t.count,m.value.push(...t.data),c.value=e,u.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),l.value="error")})),g=d.abort.bind(d)},h=()=>{i.value=0,m.value=[],f(1)};return R("config",t),r((()=>e.path),h),d((()=>h())),{config:t,darkmodeStyle:v,i18n:s((()=>t.value.locale)),status:l,count:i,page:c,totalPages:u,data:m,reply:p,loadMore:()=>f(c.value+1),refresh:h,onReply:e=>{p.value=e},onSubmit:e=>{if(e.rid){const t=m.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else m.value.unshift(e)},version:"2.3.1"}}});const sn={"data-waline":""},cn={class:"wl-count"},un=["textContent"],mn={class:"wl-cards"},dn={key:1,class:"wl-operation"},pn=["textContent"],vn={key:0,class:"wl-loading"},gn=["textContent"],fn={class:"wl-operation"},hn=["textContent"],wn={key:3,class:"wl-power"},yn=S(" Powered by "),bn=h("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);an.render=function(e,t,n,o,l,r){const a=v("CommentBox"),i=v("CommentCard"),s=v("LoadingIcon");return g(),f("div",sn,[e.reply?b("v-if",!0):(g(),E(a,{key:0,onSubmit:e.onSubmit},null,8,["onSubmit"])),h("div",cn,[e.count?(g(),f("span",{key:0,class:"wl-num",textContent:y(e.count)},null,8,un)):b("v-if",!0),S(" "+y(e.i18n.comment),1)]),h("div",mn,[(g(!0),f(C,null,$(e.data,(t=>(g(),E(i,{key:t.objectId,"root-id":t.objectId,comment:t,reply:e.reply,onReply:e.onReply,onSubmit:e.onSubmit},null,8,["root-id","comment","reply","onReply","onSubmit"])))),128))]),"error"===e.status?(g(),f("div",dn,[h("button",{type:"button",class:"wl-btn",onClick:t[0]||(t[0]=(...t)=>e.refresh&&e.refresh(...t)),textContent:y(e.i18n.refresh)},null,8,pn)])):(g(),f(C,{key:2},["loading"===e.status?(g(),f("div",vn,[w(s,{size:30})])):e.data.length?e.page<e.totalPages?(g(),f(C,{key:2},[b(" Load more button "),h("div",fn,[h("button",{type:"button",class:"wl-btn",onClick:t[1]||(t[1]=(...t)=>e.loadMore&&e.loadMore(...t)),textContent:y(e.i18n.more)},null,8,hn)])],2112)):b("v-if",!0):(g(),f("div",{key:1,class:"wl-empty",textContent:y(e.i18n.sofa)},null,8,gn))],2112)),b(" Copyright Information "),e.config.copyright?(g(),f("div",wn,[yn,bn,S(" v"+y(e.version),1)])):b("v-if",!0)])},an.__file="src/components/Waline.vue";const kn=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},Cn=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:o=!0,lang:l="zh-CN"})=>{const r=new AbortController,a=Array.from(document.querySelectorAll(n)),i=e=>{const n=tt(e);return null!==n&&t!==n},s=n=>qe({serverURL:e,paths:n.map((e=>tt(e)||t)),lang:l,signal:r.signal}).then((e=>kn(e,n))).catch(He);if(o){const n=a.filter((e=>!i(e))),o=a.filter(i);Ve({serverURL:e,path:t,lang:l}).then((e=>kn(new Array(n.length).fill(e),n))),o.length&&s(o)}else s(a);return r.abort.bind(r)},$n=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:o=!1,...l})=>{const r=e?Je(e):null;if(e&&!r)throw new Error("Option 'el' do not match any domElement!");if(!l.serverURL)throw new Error("Option 'serverURL' is missing!");const a=A({...l}),i=A({comment:n,pageview:o,path:t}),s=()=>{i.comment&&ot({serverURL:a.serverURL,path:i.path,selector:"string"==typeof i.comment?i.comment:void 0})},u=()=>{i.pageview&&Cn({serverURL:a.serverURL,path:i.path,selector:"string"==typeof i.pageview?i.pageview:void 0})},m=r?U((()=>c(an,{path:i.path,...a}))):null;m&&m.mount(r),s(),u();const d=z(s),p=z(u);return{el:r,update:({comment:e,pageview:t,path:n=window.location.pathname,...o}={})=>{Object.entries(o).forEach((([e,t])=>{a[e]=t})),i.path=n,void 0!==e&&(i.comment=e),void 0!==t&&(i.pageview=t)},destroy:()=>{null==m||m.unmount(),d(),p()}}},In="2.3.1",Ln=({el:e,serverURL:t,count:n,lang:o="zh-CN"})=>{var l;const r=nt(),a=Je(e),i=new AbortController;return(({serverURL:e,lang:t,count:n,signal:o,token:l})=>{const r={};return l&&(r.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:o,headers:r}).then((e=>e.json())).then((e=>We(e,"recent comment")))})({serverURL:t,count:n,lang:o,signal:i.signal,token:null===(l=r.value)||void 0===l?void 0:l.token}).then((e=>a&&e.length?(a.innerHTML=`<ul class="wl-recent-list">${e.map((e=>`<li class="wl-recent-item"><a href="${e.url}">${e.nick}</a>:${e.comment}</li>`)).join("")}</ul>`,{comments:e,destroy:()=>{i.abort(),a.innerHTML=""}}):{comments:e,destroy:()=>i.abort()}))};export{Ln as RecentComments,ot as commentCount,Q as defaultLocales,$n as init,Cn as pageviewCount,In as version};
import{getCurrentScope as e,onScopeDispose as t,ref as n,unref as o,isRef as l,watch as r,readonly as a,shallowRef as i,computed as s,h as c,defineComponent as u,inject as m,onMounted as d,onUnmounted as p,resolveComponent as v,openBlock as g,createElementBlock as f,createElementVNode as h,createVNode as w,toDisplayString as y,createCommentVNode as b,normalizeClass as k,Fragment as C,renderList as $,withDirectives as I,vModelDynamic as L,vModelText as j,vShow as x,createTextVNode as E,createBlock as R,provide as S,reactive as A,createApp as U,watchEffect as z}from"vue";import M from"autosize";import{marked as O}from"marked";const P=["nick","mail","link"],N=e=>e.filter((e=>P.includes(e))),T=e=>new Promise(((t,n)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{var e;return t((null===(e=o.result)||void 0===e?void 0:e.toString())||"")},o.onerror=n})),_=e=>!0===e?'<p class="wl-tex">Tex is not available in preview</p>':'<span class="wl-tex">Tex is not available in preview</span>',B=new RegExp(`(${/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source}|${/</.source})|((?:${/(?:^|\s)\/\/(.+?)$/gm.source})|(?:${/\/\*([\S\s]*?)\*\//gm.source}))`,"gmi"),F=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],D={},H=e=>{let t=0;return e.replace(B,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;D[n]?l=D[n]:(l=F[t],D[n]=l);const r=`<span style="color: #${l}">${n}</span>`;return t=++t%F.length,r}))},W=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","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"],q=e=>Object.fromEntries(e.map(((e,t)=>[W[t],e])));var V=q(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","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!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar"]),J=q(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名"]),K=q(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说"]),Y=q(["暱稱","郵箱","網址","可選","暱稱不能少於3個字元","請填寫正確的郵件地址","歡迎評論","來發評論吧~","提交","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說"]),G=q(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras","Favor enviar comentário com $0 a $1 palavras!\n Número de palavras atuais: $2","Anônimo"]),X=q(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный"]);const Q={zh:K,"zh-cn":K,"zh-CN":K,"zh-tw":Y,"zh-TW":Y,en:V,"en-US":V,"en-us":V,jp:J,"jp-jp":J,"jp-JP":J,"pt-br":G,"pt-BR":G,ru:X,"ru-ru":X,"ru-RU":X};function Z(n){return!!e()&&(t(n),!0)}const ee="undefined"!=typeof window,te=()=>{};const ne=e=>e();var oe=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;function ae(e,t,n={}){const o=n,{eventFilter:l=ne}=o,a=((e,t)=>{var n={};for(var o in e)le.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&oe)for(var o of oe(e))t.indexOf(o)<0&&re.call(e,o)&&(n[o]=e[o]);return n})(o,["eventFilter"]);return r(e,(i=l,s=t,function(...e){i((()=>s.apply(this,e)),{fn:s,thisArg:this,args:e})}),a);var i,s}var ie=Object.defineProperty,se=Object.defineProperties,ce=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable,pe=(e,t,n)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function ve(e,t,o={}){const l=o,{eventFilter:r}=l,a=((e,t)=>{var n={};for(var o in e)me.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&ue)for(var o of ue(e))t.indexOf(o)<0&&de.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:s,resume:c,isActive:u}=function(e=ne){const t=n(!0);return{isActive:t,pause:function(){t.value=!1},resume:function(){t.value=!0},eventFilter:(...n)=>{t.value&&e(...n)}}}(r),m=ae(e,t,(d=((e,t)=>{for(var n in t||(t={}))me.call(t,n)&&pe(e,n,t[n]);if(ue)for(var n of ue(t))de.call(t,n)&&pe(e,n,t[n]);return e})({},a),se(d,ce({eventFilter:i}))));var d;return{stop:m,pause:s,resume:c,isActive:u}}const ge=ee?window:void 0,fe=ee?window.document:void 0;function he(...e){let t,n,l,a;if("string"==typeof e[0]?([n,l,a]=e,t=ge):[t,n,l,a]=e,!t)return te;let i=te;const s=r((()=>function(e){var t;const n=o(e);return null!=(t=null==n?void 0:n.$el)?t:n}(t)),(e=>{i(),e&&(e.addEventListener(n,l,a),i=()=>{e.removeEventListener(n,l,a),i=te})}),{immediate:!0,flush:"post"}),c=()=>{s(),i()};return Z(c),c}ee&&window.navigator,ee&&window.location;const we="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ye="__vueuse_ssr_handlers__";we[ye]=we[ye]||{};const be=we[ye];const ke={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function Ce(e,t,l,r={}){var a;const{flush:s="pre",deep:c=!0,listenToStorageChanges:u=!0,writeDefaults:m=!0,shallow:d,window:p=ge,eventFilter:v,onError:g=(e=>{console.error(e)})}=r,f=(d?i:n)(t);if(!l)try{l=function(e,t){return be[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=ge)?void 0:e.localStorage}))()}catch(e){g(e)}if(!l)return f;const h=o(t),w=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(h),y=null!=(a=r.serializer)?a:ke[w],{pause:b,resume:k}=ve(f,(()=>function(t){try{null==t?l.removeItem(e):l.setItem(e,y.write(t))}catch(e){g(e)}}(f.value)),{flush:s,deep:c,eventFilter:v});return p&&u&&he(p,"storage",C),C(),f;function C(t){t&&t.key!==e||(f.value=function(t){if(!t||t.key===e){b();try{const n=t?t.newValue:l.getItem(e);return null==n?(m&&null!==h&&l.setItem(e,y.write(h)),h):"string"!=typeof n?n:y.read(n)}catch(e){g(e)}finally{k()}}}(t))}}var $e,Ie,Le=Object.defineProperty,je=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Re=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function Se(e={}){const{controls:t=!1,interval:a="requestAnimationFrame"}=e,i=n(new Date),s=()=>i.value=new Date,c="requestAnimationFrame"===a?function(e,t={}){const{immediate:o=!0,window:l=ge}=t,r=n(!1);let a=null;function i(){r.value&&l&&(e(),a=l.requestAnimationFrame(i))}function s(){!r.value&&l&&(r.value=!0,i())}function c(){r.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return o&&s(),Z(c),{isActive:r,pause:c,resume:s}}(s,{immediate:!0}):function(e,t=1e3,a={}){const{immediate:i=!0,immediateCallback:s=!1}=a;let c=null;const u=n(!1);function m(){c&&(clearInterval(c),c=null)}function d(){u.value=!1,m()}function p(){t<=0||(u.value=!0,s&&e(),m(),c=setInterval(e,o(t)))}i&&ee&&p(),l(t)&&Z(r(t,(()=>{i&&ee&&p()})));return Z(d),{isActive:u,pause:d,resume:p}}(s,a,{immediate:!0});return t?((e,t)=>{for(var n in t||(t={}))xe.call(t,n)&&Re(e,n,t[n]);if(je)for(var n of je(t))Ee.call(t,n)&&Re(e,n,t[n]);return e})({now:i},c):i}ee&&(null==window?void 0:window.navigator)&&(null==($e=null==window?void 0:window.navigator)?void 0:$e.platform)&&/iP(ad|hone|od)/.test(null==(Ie=null==window?void 0:window.navigator)?void 0:Ie.platform);let Ae=0;const Ue=e=>{try{e=decodeURI(e)}catch(e){}return e},ze=(e="")=>e.replace(/\/$/u,""),Me=e=>/^(https?:)?\/\//.test(e),Oe=e=>{const t=ze(e);return Me(t)?t:`https://${t}`},Pe=e=>Array.isArray(e)?e:!!e&&[0,e],Ne=(e,t)=>"function"==typeof e?e:!1!==e&&t,Te="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",_e=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},Be=(e,t,n)=>{if(!e)return"";const o="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,l=t.getTime()-o.getTime(),r=Math.floor(l/864e5);if(0===r){const e=l%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,o=Math.floor(t/6e4);if(0===o){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${o} ${n.minutes}`}return`${t} ${n.hours}`}return r<0?n.now:r<8?`${r} ${n.days}`:(e=>{const t=_e(e.getDate(),2),n=_e(e.getMonth()+1,2);return`${_e(e.getFullYear(),2)}-${n}-${t}`})(o)},Fe=e=>{const t=Ce("WALINE_EMOJI",{}),n=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(n){const n=t.value[e];if(n)return Promise.resolve(n)}return fetch(`${e}/info.json`).then((e=>e.json())).then((o=>{const l={folder:e,...o};return n&&(t.value[e]=l),l}))},De=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,He=e=>{"AbortError"!==e.name&&console.error(e.message)},We=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},qe=({serverURL:e,lang:t,paths:n,signal:o})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o}).then((e=>e.json())).then((e=>We(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),Ve=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>We(e,"visit count"))),Je=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,Ke=e=>e.type.includes("image"),Ye=e=>{const t=Array.from(e).find(Ke);return t?t.getAsFile():null},Ge=/\$.*?\$/,Xe=/^\$(.*?)\$/,Qe=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Ze=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),et=(e,{emojiMap:t,highlighter:n,texRenderer:o})=>{if(O.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),o){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=Qe.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(e){const t=e.search(Ge);return-1!==t?t:e.length},tokenizer(t){const n=Xe.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(o);O.use({extensions:e})}return O.parse(Ze(e,t))},tt=e=>e.dataset.path||e.getAttribute("id"),nt=()=>Ce("USER_KEY",{}),ot=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:o="zh-CN"})=>{var l;const r=new AbortController,a=document.querySelectorAll(n),i=nt();return a.length&&(({serverURL:e,lang:t,paths:n,signal:o,token:l})=>{const r={};return l&&(r.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o,headers:r}).then((e=>e.json())).then((e=>We(e,"comment count"))).then((e=>Array.isArray(e)?e:[e]))})({serverURL:e,paths:Array.from(a).map((e=>Ue(e.dataset.path||e.getAttribute("id")||t))),lang:o,signal:r.signal,token:null===(l=i.value)||void 0===l?void 0:l.token}).then((e=>{a.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(He),r.abort.bind(r)},lt=({size:e})=>c("svg",{width:e,height:e,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"})));var rt=u({name:"CommentBox",components:{CloseIcon:({size:e})=>c("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[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"})]),EmojiIcon:()=>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"})),ImageIcon:()=>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"})]),MarkdownIcon:()=>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"})),PreviewIcon:()=>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"})]),LoadingIcon:lt},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(e,{emit:t}){const o=m("config"),l=Ce("WALINE_COMMENT_BOX_EDITOR",""),a=Ce("WALINE_USER_META",{nick:"",mail:"",link:""}),i=nt(),c=n({}),u=n(null),v=n(null),g=n(null),f=n(null),h=n({tabs:[],map:{}}),w=n(0),y=n(!1),b=n(!1),k=n(""),C=n(0),$=n(0),I=n(!1),L=n(""),j=n(!1),x=s((()=>o.value.locale)),E=s((()=>{var e;return Boolean(null===(e=i.value)||void 0===e?void 0:e.token)})),R=s((()=>!1!==o.value.imageUploader)),S=e=>{const t=u.value,n=t.selectionStart,o=t.selectionEnd||0,r=t.scrollTop;l.value=t.value.substring(0,n)+e+t.value.substring(o,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=r},A=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return S(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{l.value=l.value.replace(t,`\r\n![${e.name}](${n})`)}))},U=()=>{var n,r,s,m,d;const{serverURL:p,lang:v,login:g,wordLimit:f,requiredMeta:w}=o.value,y={comment:L.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:o.value.path};if(null===(n=i.value)||void 0===n?void 0:n.token)y.nick=i.value.display_name,y.mail=i.value.email,y.link=i.value.url;else{if("force"===g)return;if(w.indexOf("nick")>-1&&!y.nick)return null===(r=c.value.nick)||void 0===r||r.focus(),alert(x.value.nickError);if(w.indexOf("mail")>-1&&!y.mail||y.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(y.mail))return null===(s=c.value.mail)||void 0===s||s.focus(),alert(x.value.mailError);if(!y.comment)return void(null===(m=u.value)||void 0===m||m.focus());y.nick||(y.nick=x.value.anonymous)}if(!I.value)return alert(x.value.wordHint.replace("$0",f[0].toString()).replace("$1",f[1].toString()).replace("$2",C.value.toString()));y.comment=Ze(y.comment,h.value.map),e.replyId&&e.rootId&&(y.pid=e.replyId,y.rid=e.rootId,y.at=e.replyUser),j.value=!0,(({serverURL:e,lang:t,token:n,comment:o})=>{const l={"Content-Type":"application/json"};return n&&(l.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:l,body:JSON.stringify(o)}).then((e=>e.json()))})({serverURL:p,lang:v,token:null===(d=i.value)||void 0===d?void 0:d.token,comment:y}).then((n=>{if(j.value=!1,n.errmsg)return alert(n.errmsg);t("submit",n.data),l.value="",k.value="",e.replyId&&t("cancel-reply")})).catch((e=>{j.value=!1,alert(e.message)}))},z=e=>{g.value.contains(e.target)||f.value.contains(e.target)||(y.value=!1)};return r([o,C],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?($.value=n[0],I.value=!1):t>n[1]?($.value=n[1],I.value=!1):($.value=n[1],I.value=!0):($.value=0,I.value=!0)}),{immediate:!0}),d((()=>{document.body.addEventListener("click",z),r((()=>l.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;L.value=e,k.value=et(e,{emojiMap:h.value.map,highlighter:t,texRenderer:n}),C.value=(e=>(e=>e.match(/[\w\d\s\u00C0-\u024F]+/giu)||[])(e).reduce(((e,t)=>e+(""===t.trim()?0:t.trim().split(/\s+/u).length)),0)+(e=>e.match(/[\u4E00-\u9FA5]/gu)||[])(e).length)(e),e?M(u.value):M.destroy(u.value)}),{immediate:!0}),r((()=>o.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?Fe(ze(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:r,type:a,items:i}=e;t.tabs.push({name:n,icon:De(l,o,r,a),items:i.map((e=>{const n=`${r||""}${e}`;return t.map[n]=De(e,o,r,a),n}))})})),t}))).then((e=>{h.value=e}));var t}),{immediate:!0})})),p((()=>{document.body.removeEventListener("click",z)})),{config:o,locale:x,insert:S,onChange:()=>{const e=v.value;e.files&&R.value&&A(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{var t;if(null===(t=e.dataTransfer)||void 0===t?void 0:t.items){const t=Ye(e.dataTransfer.items);t&&R.value&&(A(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&U()},onPaste:e=>{if(e.clipboardData){const t=Ye(e.clipboardData.items);t&&R.value&&A(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,r=(window.innerHeight-450)/2,a=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:null},"*");const s=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(null==a||a.close(),i.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",s))};window.addEventListener("message",s)},onLogout:()=>{i.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-800)/2,r=(window.innerHeight-800)/2,a=window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:i.value.token},"*");const s=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))),window.removeEventListener("message",s))};window.addEventListener("message",s)},submitComment:U,isLogin:E,userInfo:i,isSubmitting:j,wordNumber:C,wordLimit:$,isWordNumberLegal:I,editor:l,userMeta:a,emoji:h,emojiTabIndex:w,showEmoji:y,canUploadImage:R,previewText:k,showPreview:b,inputRefs:c,editorRef:u,emojiButtonRef:g,emojiPopupRef:f,imageUploadRef:v}}});const at={class:"wl-comment"},it={key:0,class:"wl-login-info"},st={class:"wl-avatar"},ct=["title"],ut=["src"],mt=["textContent"],dt={class:"wl-panel"},pt=["for","textContent"],vt=["id","name","type","onUpdate:modelValue"],gt=["placeholder"],ft={class:"wl-preview"},ht=h("hr",null,null,-1),wt=["innerHTML"],yt={class:"wl-footer"},bt={class:"wl-actions"},kt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},Ct=["title"],$t=["title"],It=["title"],Lt={class:"wl-info"},jt={class:"wl-text-number"},xt={key:0},Et=E("  /  "),Rt=["textContent"],St=["textContent"],At=["disabled"],Ut={key:0,class:"wl-tab-wrapper"},zt=["title","onClick"],Mt=["src","alt"],Ot={key:0,class:"wl-tabs"},Pt=["onClick"],Nt=["src","alt","title"],Tt=["title"];rt.render=function(e,t,n,o,l,r){const a=v("CloseIcon"),i=v("MarkdownIcon"),s=v("EmojiIcon"),c=v("ImageIcon"),u=v("PreviewIcon"),m=v("LoadingIcon");return g(),f("div",at,["disable"!==e.config.login&&e.isLogin?(g(),f("div",it,[h("div",st,[h("button",{class:"wl-logout-btn",title:e.locale.logout,onClick:t[0]||(t[0]=(...t)=>e.onLogout&&e.onLogout(...t))},[w(a,{size:14})],8,ct),h("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,ut)]),h("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",onClick:t[1]||(t[1]=(...t)=>e.onProfile&&e.onProfile(...t)),textContent:y(e.userInfo.display_name)},null,8,mt)])):b("v-if",!0),h("div",dt,["force"!==e.config.login&&e.config.meta.length&&!e.isLogin?(g(),f("div",{key:0,class:k(["wl-header",`item${e.config.meta.length}`])},[(g(!0),f(C,null,$(e.config.meta,(t=>(g(),f("div",{class:"wl-header-item",key:t},[h("label",{for:t,textContent:y(e.locale[t]+(e.config.requiredMeta.includes(t)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,pt),I(h("input",{ref_for:!0,ref:n=>{n&&(e.inputRefs[t]=n)},id:`wl-${t}`,class:k(["wl-input",`wl-${t}`]),name:t,type:"mail"===t?"email":"text","onUpdate:modelValue":n=>e.userMeta[t]=n},null,10,vt),[[L,e.userMeta[t]]])])))),128))],2)):b("v-if",!0),I(h("textarea",{class:"wl-editor",ref:"editorRef",id:"wl-edit",placeholder:e.replyUser?`@${e.replyUser}`:e.locale.placeholder,"onUpdate:modelValue":t[2]||(t[2]=t=>e.editor=t),onKeydown:t[3]||(t[3]=(...t)=>e.onKeyDown&&e.onKeyDown(...t)),onDrop:t[4]||(t[4]=(...t)=>e.onDrop&&e.onDrop(...t)),onPaste:t[5]||(t[5]=(...t)=>e.onPaste&&e.onPaste(...t))},null,40,gt),[[j,e.editor]]),I(h("div",ft,[ht,h("h4",null,y(e.locale.preview)+":",1),h("div",{class:"wl-content",innerHTML:e.previewText},null,8,wt)],512),[[x,e.showPreview]]),h("div",yt,[h("div",bt,[h("a",kt,[w(i)]),I(h("button",{ref:"emojiButtonRef",class:k(["wl-action",{actived:e.showEmoji}]),title:e.locale.emoji,onClick:t[6]||(t[6]=t=>e.showEmoji=!e.showEmoji)},[w(s)],10,Ct),[[x,e.emoji.tabs.length]]),h("input",{ref:"imageUploadRef",class:"upload",id:"wl-image-upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:t[7]||(t[7]=(...t)=>e.onChange&&e.onChange(...t))},null,544),e.canUploadImage?(g(),f("label",{key:0,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[w(c)],8,$t)):b("v-if",!0),h("button",{class:k(["wl-action",{actived:e.showPreview}]),title:e.locale.preview,onClick:t[8]||(t[8]=t=>e.showPreview=!e.showPreview)},[w(u)],10,It)]),h("div",Lt,[h("div",jt,[E(y(e.wordNumber)+" ",1),e.config.wordLimit?(g(),f("span",xt,[Et,h("span",{class:k({illegal:!e.isWordNumberLegal}),textContent:y(e.wordLimit)},null,10,Rt)])):b("v-if",!0),E("  "+y(e.locale.word),1)]),"disable"===e.config.login||e.isLogin?b("v-if",!0):(g(),f("button",{key:0,class:"wl-btn",onClick:t[9]||(t[9]=(...t)=>e.onLogin&&e.onLogin(...t)),textContent:y(e.locale.login)},null,8,St)),"force"!==e.config.login||e.isLogin?(g(),f("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:t[10]||(t[10]=(...t)=>e.submitComment&&e.submitComment(...t))},[e.isSubmitting?(g(),R(m,{key:0,size:16})):(g(),f(C,{key:1},[E(y(e.locale.submit),1)],2112))],8,At)):b("v-if",!0)]),h("div",{ref:"emojiPopupRef",class:k(["wl-emoji-popup",{display:e.showEmoji}])},[(g(!0),f(C,null,$(e.emoji.tabs,((t,n)=>(g(),f(C,{key:t.name},[n===e.emojiTabIndex?(g(),f("div",Ut,[(g(!0),f(C,null,$(t.items,(t=>(g(),f("button",{key:t,title:t,onClick:n=>e.insert(`:${t}:`)},[e.showEmoji?(g(),f("img",{key:0,class:"wl-emoji",src:e.emoji.map[t],alt:t,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Mt)):b("v-if",!0)],8,zt)))),128))])):b("v-if",!0)],64)))),128)),e.emoji.tabs.length>1?(g(),f("div",Ot,[(g(!0),f(C,null,$(e.emoji.tabs,((t,n)=>(g(),f("button",{key:t.name,class:k(["wl-tab",{active:e.emojiTabIndex===n}]),onClick:t=>e.emojiTabIndex=n},[h("img",{class:"wl-emoji",src:t.icon,alt:t.name,title:t.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Nt)],10,Pt)))),128))])):b("v-if",!0)],2)])]),e.replyId?(g(),f("button",{key:1,class:"wl-close",title:e.locale.cancelReply,onClick:t[11]||(t[11]=t=>e.$emit("cancel-reply"))},[w(a,{size:24})],8,Tt)):b("v-if",!0)])},rt.__file="src/components/CommentBox.vue";var _t=u({props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object}},components:{CommentBox:rt,ReplyIcon:()=>c("svg",{viewBox:"0 0 1024 1024",width:"18",height:"18"},c("path",{d:"M1019.2 720C1001.6 625.6 968 566.4 904 497.6c-89.6-89.6-214.4-150.4-347.2-176v-120c0-25.6-8-51.2-25.6-64-33.6-30.4-81.6-30.4-112-4.8L33.6 441.6C12.8 459.2 0 484.8 0 510.4c0 25.6 12.8 51.2 30.4 68.8l385.6 312c17.6 12.8 33.6 17.6 51.2 17.6 12.8 0 25.6-4.8 38.4-8C536 888 552 857.6 552 824v-99.2c124.8 20.8 248 86.4 339.2 140.8 25.6 17.6 59.2 17.6 89.6 0 25.6-17.6 43.2-46.4 43.2-76.8 0-33.6 0-56-4.8-68.8zm-500.8-89.6-46.4-4.8v193.6L86.4 510.4 472 201.6V400l38.4 4.8c128 12.8 248 68.8 334.4 153.6 51.2 56 76.8 102.4 94.4 179.2 0 4.8 4.8 20.8 4.8 51.2C835.2 720 672 640 518.4 630.4z",fill:"currentColor"})),VerifiedIcon:()=>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"}))},emits:["submit","reply"],setup(e){const t=m("config"),n=s((()=>t.value.locale)),o=s((()=>{let{link:t}=e.comment;return t?Me(t)?t:`https://${t}`:""})),l=((e,t)=>{const n=Se();return s((()=>Be(e,n.value,t)))})(e.comment.insertedAt,n.value),r=s((()=>{var t;return e.comment.objectId===(null===(t=e.reply)||void 0===t?void 0:t.objectId)}));return{config:t,locale:n,isReplyingCurrent:r,link:o,time:l}}});const Bt=["id"],Ft={class:"wl-user","aria-hidden":"true"},Dt=["src"],Ht={class:"wl-card"},Wt={class:"wl-head"},qt=["href"],Vt={key:1,class:"wl-nick"},Jt=["textContent"],Kt=["textContent"],Yt=["textContent"],Gt=["textContent"],Xt=["textContent"],Qt=["title"],Zt={class:"wl-meta","aria-hidden":"true"},en=["textContent"],tn=["textContent"],nn=["textContent"],on=["innerHTML"],ln={key:0,class:"wl-reply-wrapper"},rn={key:1,class:"wl-quote"};_t.render=function(e,t,n,o,l,r){const a=v("VerifiedIcon"),i=v("ReplyIcon"),s=v("CommentBox"),c=v("CommentCard",!0);return g(),f("div",{class:"wl-item",id:e.comment.objectId},[h("div",Ft,[e.comment.avatar?(g(),f("img",{key:0,src:e.comment.avatar},null,8,Dt)):b("v-if",!0),e.comment.type?(g(),R(a,{key:1})):b("v-if",!0)]),h("div",Ht,[h("div",Wt,[e.link?(g(),f("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noreferrer"},y(e.comment.nick),9,qt)):(g(),f("span",Vt,y(e.comment.nick),1)),"administrator"===e.comment.type?(g(),f("span",{key:2,class:"wl-badge",textContent:y(e.locale.admin)},null,8,Jt)):b("v-if",!0),e.comment.label?(g(),f("span",{key:3,class:"wl-badge",textContent:y(e.comment.label)},null,8,Kt)):b("v-if",!0),e.comment.sticky?(g(),f("span",{key:4,class:"wl-badge",textContent:y(e.locale.sticky)},null,8,Yt)):b("v-if",!0),e.comment.level>=0?(g(),f("span",{key:5,class:k(`wl-badge level${e.comment.level}`),textContent:y(e.locale[`level${e.comment.level}`]||`Level ${e.comment.level}`)},null,10,Gt)):b("v-if",!0),h("span",{class:"wl-time",textContent:y(e.time)},null,8,Xt),h("button",{class:k(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:t[0]||(t[0]=t=>e.$emit("reply",e.isReplyingCurrent?null:e.comment))},[w(i)],10,Qt)]),h("div",Zt,[e.comment.addr?(g(),f("span",{key:0,textContent:y(e.comment.addr)},null,8,en)):b("v-if",!0),e.comment.browser?(g(),f("span",{key:1,textContent:y(e.comment.browser)},null,8,tn)):b("v-if",!0),e.comment.os?(g(),f("span",{key:2,textContent:y(e.comment.os)},null,8,nn)):b("v-if",!0)]),h("div",{class:"wl-content",innerHTML:e.comment.comment},null,8,on),e.isReplyingCurrent?(g(),f("div",ln,[w(s,{replyId:e.comment.objectId,replyUser:e.comment.nick,rootId:e.rootId,onSubmit:t[1]||(t[1]=t=>e.$emit("submit",t)),onCancelReply:t[2]||(t[2]=t=>e.$emit("reply",null))},null,8,["replyId","replyUser","rootId"])])):b("v-if",!0),e.comment.children?(g(),f("div",rn,[(g(!0),f(C,null,$(e.comment.children,(n=>(g(),R(c,{key:n.objectId,comment:n,reply:e.reply,rootId:e.rootId,onReply:t[3]||(t[3]=t=>e.$emit("reply",t)),onSubmit:t[4]||(t[4]=t=>e.$emit("submit",t))},null,8,["comment","reply","rootId"])))),128))])):b("v-if",!0)])],8,Bt)},_t.__file="src/components/CommentCard.vue";var an=u({name:"WalineRoot",components:{CommentBox:rt,CommentCard:_t,LoadingIcon:lt},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","copyright"],setup(e){const t=s((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:o,emoji:l=["//unpkg.com/@waline/emojis@1.0.1/weibo"],meta:r=["nick","mail","link"],requiredMeta:a=[],dark:i=!1,pageSize:s=10,wordLimit:c,imageUploader:u,highlighter:m,texRenderer:d,copyright:p=!0,login:v="enable",...g})=>({serverURL:Oe(e),path:Ue(t),locale:{...Q[n]||Q["zh-CN"],..."object"==typeof o?o:{}},wordLimit:Pe(c),meta:N(r),requiredMeta:N(a),imageUploader:Ne(u,T),highlighter:Ne(m,H),texRenderer:Ne(d,_),lang:n,dark:i,emoji:l,pageSize:s,login:v,copyright:p,...g}))(e))),o=nt(),l=n("loading"),i=n(0),c=n(1),u=n(0),m=n([]),p=n(null),v=s((()=>{return"string"==typeof(e=t.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${Te}}`:`${e}${Te}`:!0===e?`:root${Te}`:"";var e}));let g;!function(e,t={}){const o=n(!1),{document:l=fe,immediate:i=!0,manual:s=!1,id:c="vueuse_styletag_"+ ++Ae}=t,u=n(e);let m=()=>{};const d=()=>{if(!l)return;const e=l.getElementById(c)||l.createElement("style");e.type="text/css",e.id=c,t.media&&(e.media=t.media),l.head.appendChild(e),o.value||(m=r(u,(t=>{e.innerText=t}),{immediate:!0}),o.value=!0)},p=()=>{l&&o.value&&(m(),l.head.removeChild(l.getElementById(c)),o.value=!1)};i&&!s&&d(),s||Z(p),a(o)}(v);const f=e=>{var n;const{serverURL:r,path:a,pageSize:s}=t.value,d=new AbortController;l.value="loading",null==g||g(),(({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:r,token:a})=>{const i={};return a&&(i.Authorization=`Bearer ${a}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:r,headers:i}).then((e=>e.json())).then((e=>We(e,"comment list")))})({serverURL:r,lang:t.value.lang,path:a,pageSize:s,page:e,signal:d.signal,token:null===(n=o.value)||void 0===n?void 0:n.token}).then((t=>{l.value="success",i.value=t.count,m.value.push(...t.data),c.value=e,u.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),l.value="error")})),g=d.abort.bind(d)},h=()=>{i.value=0,m.value=[],f(1)};return S("config",t),r((()=>e.path),h),d((()=>h())),{config:t,darkmodeStyle:v,i18n:s((()=>t.value.locale)),status:l,count:i,page:c,totalPages:u,data:m,reply:p,loadMore:()=>f(c.value+1),refresh:h,onReply:e=>{p.value=e},onSubmit:e=>{if(e.rid){const t=m.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else m.value.unshift(e)},version:"2.3.2"}}});const sn={"data-waline":""},cn={class:"wl-count"},un=["textContent"],mn={class:"wl-cards"},dn={key:1,class:"wl-operation"},pn=["textContent"],vn={key:0,class:"wl-loading"},gn=["textContent"],fn={class:"wl-operation"},hn=["textContent"],wn={key:3,class:"wl-power"},yn=E(" Powered by "),bn=h("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);an.render=function(e,t,n,o,l,r){const a=v("CommentBox"),i=v("CommentCard"),s=v("LoadingIcon");return g(),f("div",sn,[e.reply?b("v-if",!0):(g(),R(a,{key:0,onSubmit:e.onSubmit},null,8,["onSubmit"])),h("div",cn,[e.count?(g(),f("span",{key:0,class:"wl-num",textContent:y(e.count)},null,8,un)):b("v-if",!0),E(" "+y(e.i18n.comment),1)]),h("div",mn,[(g(!0),f(C,null,$(e.data,(t=>(g(),R(i,{key:t.objectId,"root-id":t.objectId,comment:t,reply:e.reply,onReply:e.onReply,onSubmit:e.onSubmit},null,8,["root-id","comment","reply","onReply","onSubmit"])))),128))]),"error"===e.status?(g(),f("div",dn,[h("button",{type:"button",class:"wl-btn",onClick:t[0]||(t[0]=(...t)=>e.refresh&&e.refresh(...t)),textContent:y(e.i18n.refresh)},null,8,pn)])):(g(),f(C,{key:2},["loading"===e.status?(g(),f("div",vn,[w(s,{size:30})])):e.data.length?e.page<e.totalPages?(g(),f(C,{key:2},[b(" Load more button "),h("div",fn,[h("button",{type:"button",class:"wl-btn",onClick:t[1]||(t[1]=(...t)=>e.loadMore&&e.loadMore(...t)),textContent:y(e.i18n.more)},null,8,hn)])],2112)):b("v-if",!0):(g(),f("div",{key:1,class:"wl-empty",textContent:y(e.i18n.sofa)},null,8,gn))],2112)),b(" Copyright Information "),e.config.copyright?(g(),f("div",wn,[yn,bn,E(" v"+y(e.version),1)])):b("v-if",!0)])},an.__file="src/components/Waline.vue";const kn=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},Cn=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:o=!0,lang:l="zh-CN"})=>{const r=new AbortController,a=Array.from(document.querySelectorAll(n)),i=e=>{const n=tt(e);return null!==n&&t!==n},s=n=>qe({serverURL:e,paths:n.map((e=>tt(e)||t)),lang:l,signal:r.signal}).then((e=>kn(e,n))).catch(He);if(o){const n=a.filter((e=>!i(e))),o=a.filter(i);Ve({serverURL:e,path:t,lang:l}).then((e=>kn(new Array(n.length).fill(e),n))),o.length&&s(o)}else s(a);return r.abort.bind(r)},$n=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:o=!1,...l})=>{const r=e?Je(e):null;if(e&&!r)throw new Error("Option 'el' do not match any domElement!");if(!l.serverURL)throw new Error("Option 'serverURL' is missing!");const a=A({...l}),i=A({comment:n,pageview:o,path:t}),s=()=>{i.comment&&ot({serverURL:a.serverURL,path:i.path,selector:"string"==typeof i.comment?i.comment:void 0})},u=()=>{i.pageview&&Cn({serverURL:a.serverURL,path:i.path,selector:"string"==typeof i.pageview?i.pageview:void 0})},m=r?U((()=>c(an,{path:i.path,...a}))):null;m&&m.mount(r),s(),u();const d=z(s),p=z(u);return{el:r,update:({comment:e,pageview:t,path:n=window.location.pathname,...o}={})=>{Object.entries(o).forEach((([e,t])=>{a[e]=t})),i.path=n,void 0!==e&&(i.comment=e),void 0!==t&&(i.pageview=t)},destroy:()=>{null==m||m.unmount(),d(),p()}}},In="2.3.2",Ln=({el:e,serverURL:t,count:n,lang:o="zh-CN"})=>{var l;const r=nt(),a=Je(e),i=new AbortController;return(({serverURL:e,lang:t,count:n,signal:o,token:l})=>{const r={};return l&&(r.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:o,headers:r}).then((e=>e.json())).then((e=>We(e,"recent comment")))})({serverURL:t,count:n,lang:o,signal:i.signal,token:null===(l=r.value)||void 0===l?void 0:l.token}).then((e=>a&&e.length?(a.innerHTML=`<ul class="wl-recent-list">${e.map((e=>`<li class="wl-recent-item"><a href="${e.url}">${e.nick}</a>:${e.comment}</li>`)).join("")}</ul>`,{comments:e,destroy:()=>{i.abort(),a.innerHTML=""}}):{comments:e,destroy:()=>i.abort()}))};export{Ln as RecentComments,ot as commentCount,Q as defaultLocales,$n as init,Cn as pageviewCount,In as version};
//# sourceMappingURL=shim.esm.js.map

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("autosize"),n=require("marked");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(t);const r=["nick","mail","link"],a=e=>e.filter((e=>r.includes(e))),i=e=>new Promise(((t,n)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{var e;return t((null===(e=o.result)||void 0===e?void 0:e.toString())||"")},o.onerror=n})),c=e=>!0===e?'<p class="wl-tex">Tex is not available in preview</p>':'<span class="wl-tex">Tex is not available in preview</span>',s=new RegExp(`(${/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source}|${/</.source})|((?:${/(?:^|\s)\/\/(.+?)$/gm.source})|(?:${/\/\*([\S\s]*?)\*\//gm.source}))`,"gmi"),m=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],u={},d=e=>{let t=0;return e.replace(s,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;u[n]?l=u[n]:(l=m[t],u[n]=l);const r=`<span style="color: #${l}">${n}</span>`;return t=++t%m.length,r}))},p=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","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"],v=e=>Object.fromEntries(e.map(((e,t)=>[p[t],e])));var g=v(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","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!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar"]),f=v(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名"]),h=v(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说"]),w=v(["暱稱","郵箱","網址","可選","暱稱不能少於3個字元","請填寫正確的郵件地址","歡迎評論","來發評論吧~","提交","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說"]),y=v(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras","Favor enviar comentário com $0 a $1 palavras!\n Número de palavras atuais: $2","Anônimo"]),k=v(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный"]);const b={zh:h,"zh-cn":h,"zh-CN":h,"zh-tw":w,"zh-TW":w,en:g,"en-US":g,"en-us":g,jp:f,"jp-jp":f,"jp-JP":f,"pt-br":y,"pt-BR":y,ru:k,"ru-ru":k,"ru-RU":k};function C(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}const E="undefined"!=typeof window,B=()=>{};const N=e=>e();var $=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;function L(t,n,o={}){const l=o,{eventFilter:r=N}=l,a=((e,t)=>{var n={};for(var o in e)S.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&$)for(var o of $(e))t.indexOf(o)<0&&x.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]);return e.watch(t,(i=r,c=n,function(...e){i((()=>c.apply(this,e)),{fn:c,thisArg:this,args:e})}),a);var i,c}var V=Object.defineProperty,j=Object.defineProperties,I=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,U=(e,t,n)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function M(t,n,o={}){const l=o,{eventFilter:r}=l,a=((e,t)=>{var n={};for(var o in e)A.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&R)for(var o of R(e))t.indexOf(o)<0&&z.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:c,resume:s,isActive:m}=function(t=N){const n=e.ref(!0);return{isActive:n,pause:function(){n.value=!1},resume:function(){n.value=!0},eventFilter:(...e)=>{n.value&&t(...e)}}}(r),u=L(t,n,(d=((e,t)=>{for(var n in t||(t={}))A.call(t,n)&&U(e,n,t[n]);if(R)for(var n of R(t))z.call(t,n)&&U(e,n,t[n]);return e})({},a),j(d,I({eventFilter:i}))));var d;return{stop:u,pause:c,resume:s,isActive:m}}const O=E?window:void 0,D=E?window.document:void 0;function P(...t){let n,o,l,r;if("string"==typeof t[0]?([o,l,r]=t,n=O):[n,o,l,r]=t,!n)return B;let a=B;const i=e.watch((()=>function(t){var n;const o=e.unref(t);return null!=(n=null==o?void 0:o.$el)?n:o}(n)),(e=>{a(),e&&(e.addEventListener(o,l,r),a=()=>{e.removeEventListener(o,l,r),a=B})}),{immediate:!0,flush:"post"}),c=()=>{i(),a()};return C(c),c}E&&window.navigator,E&&window.location;const T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},F="__vueuse_ssr_handlers__";T[F]=T[F]||{};const _=T[F];const q={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function H(t,n,o,l={}){var r;const{flush:a="pre",deep:i=!0,listenToStorageChanges:c=!0,writeDefaults:s=!0,shallow:m,window:u=O,eventFilter:d,onError:p=(e=>{console.error(e)})}=l,v=(m?e.shallowRef:e.ref)(n);if(!o)try{o=function(e,t){return _[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=O)?void 0:e.localStorage}))()}catch(e){p(e)}if(!o)return v;const g=e.unref(n),f=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(g),h=null!=(r=l.serializer)?r:q[f],{pause:w,resume:y}=M(v,(()=>function(e){try{null==e?o.removeItem(t):o.setItem(t,h.write(e))}catch(e){p(e)}}(v.value)),{flush:a,deep:i,eventFilter:d});return u&&c&&P(u,"storage",k),k(),v;function k(e){e&&e.key!==t||(v.value=function(e){if(!e||e.key===t){w();try{const n=e?e.newValue:o.getItem(t);return null==n?(s&&null!==g&&o.setItem(t,h.write(g)),g):"string"!=typeof n?n:h.read(n)}catch(e){p(e)}finally{y()}}}(e))}}var W,J,K=Object.defineProperty,Y=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,Q=(e,t,n)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function Z(t={}){const{controls:n=!1,interval:o="requestAnimationFrame"}=t,l=e.ref(new Date),r=()=>l.value=new Date,a="requestAnimationFrame"===o?function(t,n={}){const{immediate:o=!0,window:l=O}=n,r=e.ref(!1);let a=null;function i(){r.value&&l&&(t(),a=l.requestAnimationFrame(i))}function c(){!r.value&&l&&(r.value=!0,i())}function s(){r.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return o&&c(),C(s),{isActive:r,pause:s,resume:c}}(r,{immediate:!0}):function(t,n=1e3,o={}){const{immediate:l=!0,immediateCallback:r=!1}=o;let a=null;const i=e.ref(!1);function c(){a&&(clearInterval(a),a=null)}function s(){i.value=!1,c()}function m(){n<=0||(i.value=!0,r&&t(),c(),a=setInterval(t,e.unref(n)))}l&&E&&m(),e.isRef(n)&&C(e.watch(n,(()=>{l&&E&&m()})));return C(s),{isActive:i,pause:s,resume:m}}(r,o,{immediate:!0});return n?((e,t)=>{for(var n in t||(t={}))G.call(t,n)&&Q(e,n,t[n]);if(Y)for(var n of Y(t))X.call(t,n)&&Q(e,n,t[n]);return e})({now:l},a):l}E&&(null==window?void 0:window.navigator)&&(null==(W=null==window?void 0:window.navigator)?void 0:W.platform)&&/iP(ad|hone|od)/.test(null==(J=null==window?void 0:window.navigator)?void 0:J.platform);let ee=0;const te=e=>{try{e=decodeURI(e)}catch(e){}return e},ne=(e="")=>e.replace(/\/$/u,""),oe=e=>/^(https?:)?\/\//.test(e),le=e=>{const t=ne(e);return oe(t)?t:`https://${t}`},re=e=>Array.isArray(e)?e:!!e&&[0,e],ae=(e,t)=>"function"==typeof e?e:!1!==e&&t,ie="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",ce=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},se=(e,t,n)=>{if(!e)return"";const o="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,l=t.getTime()-o.getTime(),r=Math.floor(l/864e5);if(0===r){const e=l%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,o=Math.floor(t/6e4);if(0===o){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${o} ${n.minutes}`}return`${t} ${n.hours}`}return r<0?n.now:r<8?`${r} ${n.days}`:(e=>{const t=ce(e.getDate(),2),n=ce(e.getMonth()+1,2);return`${ce(e.getFullYear(),2)}-${n}-${t}`})(o)},me=e=>{const t=H("WALINE_EMOJI",{}),n=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(n){const n=t.value[e];if(n)return Promise.resolve(n)}return fetch(`${e}/info.json`).then((e=>e.json())).then((o=>{const l={folder:e,...o};return n&&(t.value[e]=l),l}))},ue=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,de=e=>{"AbortError"!==e.name&&console.error(e.message)},pe=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},ve=({serverURL:e,lang:t,paths:n,signal:o})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o}).then((e=>e.json())).then((e=>pe(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),ge=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>pe(e,"visit count"))),fe=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,he=e=>e.type.includes("image"),we=e=>{const t=Array.from(e).find(he);return t?t.getAsFile():null},ye=/\$.*?\$/,ke=/^\$(.*?)\$/,be=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Ce=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),Ee=(e,{emojiMap:t,highlighter:o,texRenderer:l})=>{if(n.marked.setOptions({highlight:o||void 0,breaks:!0,smartLists:!0,smartypants:!0}),l){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=be.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(e){const t=e.search(ye);return-1!==t?t:e.length},tokenizer(t){const n=ke.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(l);n.marked.use({extensions:e})}return n.marked.parse(Ce(e,t))},Be=e=>e.dataset.path||e.getAttribute("id"),Ne=()=>H("USER_KEY",{}),$e=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:o="zh-CN"})=>{var l;const r=new AbortController,a=document.querySelectorAll(n),i=Ne();return a.length&&(({serverURL:e,lang:t,paths:n,signal:o,token:l})=>{const r={};return l&&(r.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o,headers:r}).then((e=>e.json())).then((e=>pe(e,"comment count"))).then((e=>Array.isArray(e)?e:[e]))})({serverURL:e,paths:Array.from(a).map((e=>te(e.dataset.path||e.getAttribute("id")||t))),lang:o,signal:r.signal,token:null===(l=i.value)||void 0===l?void 0:l.token}).then((e=>{a.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(de),r.abort.bind(r)},Se=({size:t})=>e.h("svg",{width:t,height:t,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},e.h("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},e.h("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var xe=e.defineComponent({name:"CommentBox",components:{CloseIcon:({size:t})=>e.h("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:t,height:t},[e.h("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"}),e.h("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"})]),EmojiIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("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"})),ImageIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("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"}),e.h("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"})]),MarkdownIcon:()=>e.h("svg",{width:"16",height:"16",ariaHidden:"true"},e.h("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"})),PreviewIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("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"}),e.h("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"})]),LoadingIcon:Se},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(t,{emit:n}){const o=e.inject("config"),r=H("WALINE_COMMENT_BOX_EDITOR",""),a=H("WALINE_USER_META",{nick:"",mail:"",link:""}),i=Ne(),c=e.ref({}),s=e.ref(null),m=e.ref(null),u=e.ref(null),d=e.ref(null),p=e.ref({tabs:[],map:{}}),v=e.ref(0),g=e.ref(!1),f=e.ref(!1),h=e.ref(""),w=e.ref(0),y=e.ref(0),k=e.ref(!1),b=e.ref(""),C=e.ref(!1),E=e.computed((()=>o.value.locale)),B=e.computed((()=>{var e;return Boolean(null===(e=i.value)||void 0===e?void 0:e.token)})),N=e.computed((()=>!1!==o.value.imageUploader)),$=e=>{const t=s.value,n=t.selectionStart,o=t.selectionEnd||0,l=t.scrollTop;r.value=t.value.substring(0,n)+e+t.value.substring(o,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=l},S=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return $(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{r.value=r.value.replace(t,`\r\n![${e.name}](${n})`)}))},x=()=>{var e,l,m,u,d;const{serverURL:v,lang:g,login:f,wordLimit:y,requiredMeta:B}=o.value,N={comment:b.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:o.value.path};if(null===(e=i.value)||void 0===e?void 0:e.token)N.nick=i.value.display_name,N.mail=i.value.email,N.link=i.value.url;else{if("force"===f)return;if(B.indexOf("nick")>-1&&!N.nick)return null===(l=c.value.nick)||void 0===l||l.focus(),alert(E.value.nickError);if(B.indexOf("mail")>-1&&!N.mail||N.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.){0,2}\w+$/.exec(N.mail))return null===(m=c.value.mail)||void 0===m||m.focus(),alert(E.value.mailError);if(!N.comment)return void(null===(u=s.value)||void 0===u||u.focus());N.nick||(N.nick=E.value.anonymous)}if(!k.value)return alert(E.value.wordHint.replace("$0",y[0].toString()).replace("$1",y[1].toString()).replace("$2",w.value.toString()));N.comment=Ce(N.comment,p.value.map),t.replyId&&t.rootId&&(N.pid=t.replyId,N.rid=t.rootId,N.at=t.replyUser),C.value=!0,(({serverURL:e,lang:t,token:n,comment:o})=>{const l={"Content-Type":"application/json"};return n&&(l.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:l,body:JSON.stringify(o)}).then((e=>e.json()))})({serverURL:v,lang:g,token:null===(d=i.value)||void 0===d?void 0:d.token,comment:N}).then((e=>{if(C.value=!1,e.errmsg)return alert(e.errmsg);n("submit",e.data),r.value="",h.value="",t.replyId&&n("cancel-reply")})).catch((e=>{C.value=!1,alert(e.message)}))},L=e=>{u.value.contains(e.target)||d.value.contains(e.target)||(g.value=!1)};return e.watch([o,w],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(y.value=n[0],k.value=!1):t>n[1]?(y.value=n[1],k.value=!1):(y.value=n[1],k.value=!0):(y.value=0,k.value=!0)}),{immediate:!0}),e.onMounted((()=>{document.body.addEventListener("click",L),e.watch((()=>r.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;b.value=e,h.value=Ee(e,{emojiMap:p.value.map,highlighter:t,texRenderer:n}),w.value=(e=>(e=>e.match(/[\w\d\s\u00C0-\u024F]+/giu)||[])(e).reduce(((e,t)=>e+(""===t.trim()?0:t.trim().split(/\s+/u).length)),0)+(e=>e.match(/[\u4E00-\u9FA5]/gu)||[])(e).length)(e),e?l.default(s.value):l.default.destroy(s.value)}),{immediate:!0}),e.watch((()=>o.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?me(ne(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:r,type:a,items:i}=e;t.tabs.push({name:n,icon:ue(l,o,r,a),items:i.map((e=>{const n=`${r||""}${e}`;return t.map[n]=ue(e,o,r,a),n}))})})),t}))).then((e=>{p.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",L)})),{config:o,locale:E,insert:$,onChange:()=>{const e=m.value;e.files&&N.value&&S(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{var t;if(null===(t=e.dataTransfer)||void 0===t?void 0:t.items){const t=we(e.dataTransfer.items);t&&N.value&&(S(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&x()},onPaste:e=>{if(e.clipboardData){const t=we(e.clipboardData.items);t&&N.value&&S(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,r=(window.innerHeight-450)/2,a=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:null},"*");const c=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(null==a||a.close(),i.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",c))};window.addEventListener("message",c)},onLogout:()=>{i.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-800)/2,r=(window.innerHeight-800)/2,a=window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:i.value.token},"*");const c=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))),window.removeEventListener("message",c))};window.addEventListener("message",c)},submitComment:x,isLogin:B,userInfo:i,isSubmitting:C,wordNumber:w,wordLimit:y,isWordNumberLegal:k,editor:r,userMeta:a,emoji:p,emojiTabIndex:v,showEmoji:g,canUploadImage:N,previewText:h,showPreview:f,inputRefs:c,editorRef:s,emojiButtonRef:u,emojiPopupRef:d,imageUploadRef:m}}});const Le={class:"wl-comment"},Ve={key:0,class:"wl-login-info"},je={class:"wl-avatar"},Ie=["title"],Re=["src"],Ae=["textContent"],ze={class:"wl-panel"},Ue=["for","textContent"],Me=["id","name","type","onUpdate:modelValue"],Oe=["placeholder"],De={class:"wl-preview"},Pe=e.createElementVNode("hr",null,null,-1),Te=["innerHTML"],Fe={class:"wl-footer"},_e={class:"wl-actions"},qe={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},He=["title"],We=["title"],Je=["title"],Ke={class:"wl-info"},Ye={class:"wl-text-number"},Ge={key:0},Xe=e.createTextVNode("  /  "),Qe=["textContent"],Ze=["textContent"],et=["disabled"],tt={key:0,class:"wl-tab-wrapper"},nt=["title","onClick"],ot=["src","alt"],lt={key:0,class:"wl-tabs"},rt=["onClick"],at=["src","alt","title"],it=["title"];xe.render=function(t,n,o,l,r,a){const i=e.resolveComponent("CloseIcon"),c=e.resolveComponent("MarkdownIcon"),s=e.resolveComponent("EmojiIcon"),m=e.resolveComponent("ImageIcon"),u=e.resolveComponent("PreviewIcon"),d=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",Le,["disable"!==t.config.login&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",je,[e.createElementVNode("button",{class:"wl-logout-btn",title:t.locale.logout,onClick:n[0]||(n[0]=(...e)=>t.onLogout&&t.onLogout(...e))},[e.createVNode(i,{size:14})],8,Ie),e.createElementVNode("img",{src:t.userInfo.avatar,alt:"avatar"},null,8,Re)]),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",onClick:n[1]||(n[1]=(...e)=>t.onProfile&&t.onProfile(...e)),textContent:e.toDisplayString(t.userInfo.display_name)},null,8,Ae)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ze,["force"!==t.config.login&&t.config.meta.length&&!t.isLogin?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wl-header",`item${t.config.meta.length}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.config.meta,(n=>(e.openBlock(),e.createElementBlock("div",{class:"wl-header-item",key:n},[e.createElementVNode("label",{for:n,textContent:e.toDisplayString(t.locale[n]+(t.config.requiredMeta.includes(n)||!t.config.requiredMeta.length?"":`(${t.locale.optional})`))},null,8,Ue),e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:e=>{e&&(t.inputRefs[n]=e)},id:`wl-${n}`,class:e.normalizeClass(["wl-input",`wl-${n}`]),name:n,type:"mail"===n?"email":"text","onUpdate:modelValue":e=>t.userMeta[n]=e},null,10,Me),[[e.vModelDynamic,t.userMeta[n]]])])))),128))],2)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",{class:"wl-editor",ref:"editorRef",id:"wl-edit",placeholder:t.replyUser?`@${t.replyUser}`:t.locale.placeholder,"onUpdate:modelValue":n[2]||(n[2]=e=>t.editor=e),onKeydown:n[3]||(n[3]=(...e)=>t.onKeyDown&&t.onKeyDown(...e)),onDrop:n[4]||(n[4]=(...e)=>t.onDrop&&t.onDrop(...e)),onPaste:n[5]||(n[5]=(...e)=>t.onPaste&&t.onPaste(...e))},null,40,Oe),[[e.vModelText,t.editor]]),e.withDirectives(e.createElementVNode("div",De,[Pe,e.createElementVNode("h4",null,e.toDisplayString(t.locale.preview)+":",1),e.createElementVNode("div",{class:"wl-content",innerHTML:t.previewText},null,8,Te)],512),[[e.vShow,t.showPreview]]),e.createElementVNode("div",Fe,[e.createElementVNode("div",_e,[e.createElementVNode("a",qe,[e.createVNode(c)]),e.withDirectives(e.createElementVNode("button",{ref:"emojiButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showEmoji}]),title:t.locale.emoji,onClick:n[6]||(n[6]=e=>t.showEmoji=!t.showEmoji)},[e.createVNode(s)],10,He),[[e.vShow,t.emoji.tabs.length]]),e.createElementVNode("input",{ref:"imageUploadRef",class:"upload",id:"wl-image-upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:n[7]||(n[7]=(...e)=>t.onChange&&t.onChange(...e))},null,544),t.canUploadImage?(e.openBlock(),e.createElementBlock("label",{key:0,for:"wl-image-upload",class:"wl-action",title:t.locale.uploadImage},[e.createVNode(m)],8,We)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:e.normalizeClass(["wl-action",{actived:t.showPreview}]),title:t.locale.preview,onClick:n[8]||(n[8]=e=>t.showPreview=!t.showPreview)},[e.createVNode(u)],10,Je)]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Ye,[e.createTextVNode(e.toDisplayString(t.wordNumber)+" ",1),t.config.wordLimit?(e.openBlock(),e.createElementBlock("span",Ge,[Xe,e.createElementVNode("span",{class:e.normalizeClass({illegal:!t.isWordNumberLegal}),textContent:e.toDisplayString(t.wordLimit)},null,10,Qe)])):e.createCommentVNode("v-if",!0),e.createTextVNode("  "+e.toDisplayString(t.locale.word),1)]),"disable"===t.config.login||t.isLogin?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn",onClick:n[9]||(n[9]=(...e)=>t.onLogin&&t.onLogin(...e)),textContent:e.toDisplayString(t.locale.login)},null,8,Ze)),"force"!==t.config.login||t.isLogin?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:t.isSubmitting,onClick:n[10]||(n[10]=(...e)=>t.submitComment&&t.submitComment(...e))},[t.isSubmitting?(e.openBlock(),e.createBlock(d,{key:0,size:16})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.locale.submit),1)],2112))],8,et)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{ref:"emojiPopupRef",class:e.normalizeClass(["wl-emoji-popup",{display:t.showEmoji}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.emoji.tabs,((n,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.name},[o===t.emojiTabIndex?(e.openBlock(),e.createElementBlock("div",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(n=>(e.openBlock(),e.createElementBlock("button",{key:n,title:n,onClick:e=>t.insert(`:${n}:`)},[t.showEmoji?(e.openBlock(),e.createElementBlock("img",{key:0,class:"wl-emoji",src:t.emoji.map[n],alt:n,loading:"lazy",referrerPolicy:"no-referrer"},null,8,ot)):e.createCommentVNode("v-if",!0)],8,nt)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),t.emoji.tabs.length>1?(e.openBlock(),e.createElementBlock("div",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.emoji.tabs,((n,o)=>(e.openBlock(),e.createElementBlock("button",{key:n.name,class:e.normalizeClass(["wl-tab",{active:t.emojiTabIndex===o}]),onClick:e=>t.emojiTabIndex=o},[e.createElementVNode("img",{class:"wl-emoji",src:n.icon,alt:n.name,title:n.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,at)],10,rt)))),128))])):e.createCommentVNode("v-if",!0)],2)])]),t.replyId?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-close",title:t.locale.cancelReply,onClick:n[11]||(n[11]=e=>t.$emit("cancel-reply"))},[e.createVNode(i,{size:24})],8,it)):e.createCommentVNode("v-if",!0)])},xe.__file="src/components/CommentBox.vue";var ct=e.defineComponent({props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object}},components:{CommentBox:xe,ReplyIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"18",height:"18"},e.h("path",{d:"M1019.2 720C1001.6 625.6 968 566.4 904 497.6c-89.6-89.6-214.4-150.4-347.2-176v-120c0-25.6-8-51.2-25.6-64-33.6-30.4-81.6-30.4-112-4.8L33.6 441.6C12.8 459.2 0 484.8 0 510.4c0 25.6 12.8 51.2 30.4 68.8l385.6 312c17.6 12.8 33.6 17.6 51.2 17.6 12.8 0 25.6-4.8 38.4-8C536 888 552 857.6 552 824v-99.2c124.8 20.8 248 86.4 339.2 140.8 25.6 17.6 59.2 17.6 89.6 0 25.6-17.6 43.2-46.4 43.2-76.8 0-33.6 0-56-4.8-68.8zm-500.8-89.6-46.4-4.8v193.6L86.4 510.4 472 201.6V400l38.4 4.8c128 12.8 248 68.8 334.4 153.6 51.2 56 76.8 102.4 94.4 179.2 0 4.8 4.8 20.8 4.8 51.2C835.2 720 672 640 518.4 630.4z",fill:"currentColor"})),VerifiedIcon:()=>e.h("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},e.h("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"}))},emits:["submit","reply"],setup(t){const n=e.inject("config"),o=e.computed((()=>n.value.locale)),l=e.computed((()=>{let{link:e}=t.comment;return e?oe(e)?e:`https://${e}`:""})),r=((t,n)=>{const o=Z();return e.computed((()=>se(t,o.value,n)))})(t.comment.insertedAt,o.value),a=e.computed((()=>{var e;return t.comment.objectId===(null===(e=t.reply)||void 0===e?void 0:e.objectId)}));return{config:n,locale:o,isReplyingCurrent:a,link:l,time:r}}});const st=["id"],mt={class:"wl-user","aria-hidden":"true"},ut=["src"],dt={class:"wl-card"},pt={class:"wl-head"},vt=["href"],gt={key:1,class:"wl-nick"},ft=["textContent"],ht=["textContent"],wt=["textContent"],yt=["textContent"],kt=["textContent"],bt=["title"],Ct={class:"wl-meta","aria-hidden":"true"},Et=["textContent"],Bt=["textContent"],Nt=["textContent"],$t=["innerHTML"],St={key:0,class:"wl-reply-wrapper"},xt={key:1,class:"wl-quote"};ct.render=function(t,n,o,l,r,a){const i=e.resolveComponent("VerifiedIcon"),c=e.resolveComponent("ReplyIcon"),s=e.resolveComponent("CommentBox"),m=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{class:"wl-item",id:t.comment.objectId},[e.createElementVNode("div",mt,[t.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.comment.avatar},null,8,ut)):e.createCommentVNode("v-if",!0),t.comment.type?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",dt,[e.createElementVNode("div",pt,[t.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"wl-nick",href:t.link,target:"_blank",rel:"nofollow noreferrer"},e.toDisplayString(t.comment.nick),9,vt)):(e.openBlock(),e.createElementBlock("span",gt,e.toDisplayString(t.comment.nick),1)),"administrator"===t.comment.type?(e.openBlock(),e.createElementBlock("span",{key:2,class:"wl-badge",textContent:e.toDisplayString(t.locale.admin)},null,8,ft)):e.createCommentVNode("v-if",!0),t.comment.label?(e.openBlock(),e.createElementBlock("span",{key:3,class:"wl-badge",textContent:e.toDisplayString(t.comment.label)},null,8,ht)):e.createCommentVNode("v-if",!0),t.comment.sticky?(e.openBlock(),e.createElementBlock("span",{key:4,class:"wl-badge",textContent:e.toDisplayString(t.locale.sticky)},null,8,wt)):e.createCommentVNode("v-if",!0),t.comment.level>=0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(`wl-badge level${t.comment.level}`),textContent:e.toDisplayString(t.locale[`level${t.comment.level}`]||`Level ${t.comment.level}`)},null,10,yt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(t.time)},null,8,kt),e.createElementVNode("button",{class:e.normalizeClass(["wl-reply",{active:t.isReplyingCurrent}]),title:t.isReplyingCurrent?t.locale.cancelReply:t.locale.reply,onClick:n[0]||(n[0]=e=>t.$emit("reply",t.isReplyingCurrent?null:t.comment))},[e.createVNode(c)],10,bt)]),e.createElementVNode("div",Ct,[t.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.addr)},null,8,Et)):e.createCommentVNode("v-if",!0),t.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,textContent:e.toDisplayString(t.comment.browser)},null,8,Bt)):e.createCommentVNode("v-if",!0),t.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,textContent:e.toDisplayString(t.comment.os)},null,8,Nt)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{class:"wl-content",innerHTML:t.comment.comment},null,8,$t),t.isReplyingCurrent?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(s,{replyId:t.comment.objectId,replyUser:t.comment.nick,rootId:t.rootId,onSubmit:n[1]||(n[1]=e=>t.$emit("submit",e)),onCancelReply:n[2]||(n[2]=e=>t.$emit("reply",null))},null,8,["replyId","replyUser","rootId"])])):e.createCommentVNode("v-if",!0),t.comment.children?(e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment.children,(o=>(e.openBlock(),e.createBlock(m,{key:o.objectId,comment:o,reply:t.reply,rootId:t.rootId,onReply:n[3]||(n[3]=e=>t.$emit("reply",e)),onSubmit:n[4]||(n[4]=e=>t.$emit("submit",e))},null,8,["comment","reply","rootId"])))),128))])):e.createCommentVNode("v-if",!0)])],8,st)},ct.__file="src/components/CommentCard.vue";var Lt=e.defineComponent({name:"WalineRoot",components:{CommentBox:xe,CommentCard:ct,LoadingIcon:Se},props:{serverURL:{type:String,required:!0},path:{type:String,required:!0},meta:{type:Array},requiredMeta:{type:Array},dark:[String,Boolean],lang:{type:String},locale:Object,pageSize:Number,wordLimit:{type:[Number,Array]},emoji:{type:[Array,Boolean]},login:String,highlighter:Function,imageUploader:[Function,Boolean],texRenderer:[Function,Boolean],copyright:Boolean},setup(t){const n=e.computed((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:o,emoji:l=["//unpkg.com/@waline/emojis@1.0.1/weibo"],meta:r=["nick","mail","link"],requiredMeta:s=[],dark:m=!1,pageSize:u=10,wordLimit:p,imageUploader:v,highlighter:g,texRenderer:f,copyright:h=!0,login:w="enable",...y})=>({serverURL:le(e),path:te(t),locale:{...b[n]||b["zh-CN"],..."object"==typeof o?o:{}},wordLimit:re(p),meta:a(r),requiredMeta:a(s),imageUploader:ae(v,i),highlighter:ae(g,d),texRenderer:ae(f,c),lang:n,dark:m,emoji:l,pageSize:u,login:w,copyright:h,...y}))(t))),o=Ne(),l=e.ref("loading"),r=e.ref(0),s=e.ref(1),m=e.ref(0),u=e.ref([]),p=e.ref(null),v=e.computed((()=>{return"string"==typeof(e=n.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${ie}}`:`${e}${ie}`:!0===e?`:root${ie}`:"";var e}));let g;!function(t,n={}){const o=e.ref(!1),{document:l=D,immediate:r=!0,manual:a=!1,id:i="vueuse_styletag_"+ ++ee}=n,c=e.ref(t);let s=()=>{};const m=()=>{if(!l)return;const t=l.getElementById(i)||l.createElement("style");t.type="text/css",t.id=i,n.media&&(t.media=n.media),l.head.appendChild(t),o.value||(s=e.watch(c,(e=>{t.innerText=e}),{immediate:!0}),o.value=!0)},u=()=>{l&&o.value&&(s(),l.head.removeChild(l.getElementById(i)),o.value=!1)};r&&!a&&m(),a||C(u),e.readonly(o)}(v);const f=e=>{var t;const{serverURL:a,path:i,pageSize:c}=n.value,d=new AbortController;l.value="loading",null==g||g(),(({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:r,token:a})=>{const i={};return a&&(i.Authorization=`Bearer ${a}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:r,headers:i}).then((e=>e.json())).then((e=>pe(e,"comment list")))})({serverURL:a,lang:n.value.lang,path:i,pageSize:c,page:e,signal:d.signal,token:null===(t=o.value)||void 0===t?void 0:t.token}).then((t=>{l.value="success",r.value=t.count,u.value.push(...t.data),s.value=e,m.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),l.value="error")})),g=d.abort.bind(d)},h=()=>{r.value=0,u.value=[],f(1)};return e.provide("config",n),e.watch((()=>t.path),h),e.onMounted((()=>h())),{config:n,darkmodeStyle:v,i18n:e.computed((()=>n.value.locale)),status:l,count:r,page:s,totalPages:m,data:u,reply:p,loadMore:()=>f(s.value+1),refresh:h,onReply:e=>{p.value=e},onSubmit:e=>{if(e.rid){const t=u.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else u.value.unshift(e)},version:"2.3.1"}}});const Vt={"data-waline":""},jt={class:"wl-count"},It=["textContent"],Rt={class:"wl-cards"},At={key:1,class:"wl-operation"},zt=["textContent"],Ut={key:0,class:"wl-loading"},Mt=["textContent"],Ot={class:"wl-operation"},Dt=["textContent"],Pt={key:3,class:"wl-power"},Tt=e.createTextVNode(" Powered by "),Ft=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);Lt.render=function(t,n,o,l,r,a){const i=e.resolveComponent("CommentBox"),c=e.resolveComponent("CommentCard"),s=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",Vt,[t.reply?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,onSubmit:t.onSubmit},null,8,["onSubmit"])),e.createElementVNode("div",jt,[t.count?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(t.count)},null,8,It)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.i18n.comment),1)]),e.createElementVNode("div",Rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(n=>(e.openBlock(),e.createBlock(c,{key:n.objectId,"root-id":n.objectId,comment:n,reply:t.reply,onReply:t.onReply,onSubmit:t.onSubmit},null,8,["root-id","comment","reply","onReply","onSubmit"])))),128))]),"error"===t.status?(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:n[0]||(n[0]=(...e)=>t.refresh&&t.refresh(...e)),textContent:e.toDisplayString(t.i18n.refresh)},null,8,zt)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===t.status?(e.openBlock(),e.createElementBlock("div",Ut,[e.createVNode(s,{size:30})])):t.data.length?t.page<t.totalPages?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createCommentVNode(" Load more button "),e.createElementVNode("div",Ot,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:n[1]||(n[1]=(...e)=>t.loadMore&&t.loadMore(...e)),textContent:e.toDisplayString(t.i18n.more)},null,8,Dt)])],2112)):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(t.i18n.sofa)},null,8,Mt))],2112)),e.createCommentVNode(" Copyright Information "),t.config.copyright?(e.openBlock(),e.createElementBlock("div",Pt,[Tt,Ft,e.createTextVNode(" v"+e.toDisplayString(t.version),1)])):e.createCommentVNode("v-if",!0)])},Lt.__file="src/components/Waline.vue";const _t=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},qt=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:o=!0,lang:l="zh-CN"})=>{const r=new AbortController,a=Array.from(document.querySelectorAll(n)),i=e=>{const n=Be(e);return null!==n&&t!==n},c=n=>ve({serverURL:e,paths:n.map((e=>Be(e)||t)),lang:l,signal:r.signal}).then((e=>_t(e,n))).catch(de);if(o){const n=a.filter((e=>!i(e))),o=a.filter(i);ge({serverURL:e,path:t,lang:l}).then((e=>_t(new Array(n.length).fill(e),n))),o.length&&c(o)}else c(a);return r.abort.bind(r)};exports.RecentComments=({el:e,serverURL:t,count:n,lang:o="zh-CN"})=>{var l;const r=Ne(),a=fe(e),i=new AbortController;return(({serverURL:e,lang:t,count:n,signal:o,token:l})=>{const r={};return l&&(r.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:o,headers:r}).then((e=>e.json())).then((e=>pe(e,"recent comment")))})({serverURL:t,count:n,lang:o,signal:i.signal,token:null===(l=r.value)||void 0===l?void 0:l.token}).then((e=>a&&e.length?(a.innerHTML=`<ul class="wl-recent-list">${e.map((e=>`<li class="wl-recent-item"><a href="${e.url}">${e.nick}</a>:${e.comment}</li>`)).join("")}</ul>`,{comments:e,destroy:()=>{i.abort(),a.innerHTML=""}}):{comments:e,destroy:()=>i.abort()}))},exports.commentCount=$e,exports.defaultLocales=b,exports.init=({el:t="#waline",path:n=window.location.pathname,comment:o=!1,pageview:l=!1,...r})=>{const a=t?fe(t):null;if(t&&!a)throw new Error("Option 'el' do not match any domElement!");if(!r.serverURL)throw new Error("Option 'serverURL' is missing!");const i=e.reactive({...r}),c=e.reactive({comment:o,pageview:l,path:n}),s=()=>{c.comment&&$e({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.comment?c.comment:void 0})},m=()=>{c.pageview&&qt({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.pageview?c.pageview:void 0})},u=a?e.createApp((()=>e.h(Lt,{path:c.path,...i}))):null;u&&u.mount(a),s(),m();const d=e.watchEffect(s),p=e.watchEffect(m);return{el:a,update:({comment:e,pageview:t,path:n=window.location.pathname,...o}={})=>{Object.entries(o).forEach((([e,t])=>{i[e]=t})),c.path=n,void 0!==e&&(c.comment=e),void 0!==t&&(c.pageview=t)},destroy:()=>{null==u||u.unmount(),d(),p()}}},exports.pageviewCount=qt,exports.version="2.3.1";
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("autosize"),n=require("marked");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(t);const r=["nick","mail","link"],a=e=>e.filter((e=>r.includes(e))),i=e=>new Promise(((t,n)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{var e;return t((null===(e=o.result)||void 0===e?void 0:e.toString())||"")},o.onerror=n})),c=e=>!0===e?'<p class="wl-tex">Tex is not available in preview</p>':'<span class="wl-tex">Tex is not available in preview</span>',s=new RegExp(`(${/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source}|${/</.source})|((?:${/(?:^|\s)\/\/(.+?)$/gm.source})|(?:${/\/\*([\S\s]*?)\*\//gm.source}))`,"gmi"),m=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],u={},d=e=>{let t=0;return e.replace(s,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;u[n]?l=u[n]:(l=m[t],u[n]=l);const r=`<span style="color: #${l}">${n}</span>`;return t=++t%m.length,r}))},p=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","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"],v=e=>Object.fromEntries(e.map(((e,t)=>[p[t],e])));var g=v(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","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!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar"]),f=v(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名"]),h=v(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说"]),w=v(["暱稱","郵箱","網址","可選","暱稱不能少於3個字元","請填寫正確的郵件地址","歡迎評論","來發評論吧~","提交","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說"]),y=v(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras","Favor enviar comentário com $0 a $1 palavras!\n Número de palavras atuais: $2","Anônimo"]),k=v(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный"]);const b={zh:h,"zh-cn":h,"zh-CN":h,"zh-tw":w,"zh-TW":w,en:g,"en-US":g,"en-us":g,jp:f,"jp-jp":f,"jp-JP":f,"pt-br":y,"pt-BR":y,ru:k,"ru-ru":k,"ru-RU":k};function C(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}const E="undefined"!=typeof window,B=()=>{};const $=e=>e();var N=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;function L(t,n,o={}){const l=o,{eventFilter:r=$}=l,a=((e,t)=>{var n={};for(var o in e)S.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&N)for(var o of N(e))t.indexOf(o)<0&&x.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]);return e.watch(t,(i=r,c=n,function(...e){i((()=>c.apply(this,e)),{fn:c,thisArg:this,args:e})}),a);var i,c}var V=Object.defineProperty,I=Object.defineProperties,j=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,U=(e,t,n)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function M(t,n,o={}){const l=o,{eventFilter:r}=l,a=((e,t)=>{var n={};for(var o in e)A.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&R)for(var o of R(e))t.indexOf(o)<0&&z.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:c,resume:s,isActive:m}=function(t=$){const n=e.ref(!0);return{isActive:n,pause:function(){n.value=!1},resume:function(){n.value=!0},eventFilter:(...e)=>{n.value&&t(...e)}}}(r),u=L(t,n,(d=((e,t)=>{for(var n in t||(t={}))A.call(t,n)&&U(e,n,t[n]);if(R)for(var n of R(t))z.call(t,n)&&U(e,n,t[n]);return e})({},a),I(d,j({eventFilter:i}))));var d;return{stop:u,pause:c,resume:s,isActive:m}}const O=E?window:void 0,D=E?window.document:void 0;function P(...t){let n,o,l,r;if("string"==typeof t[0]?([o,l,r]=t,n=O):[n,o,l,r]=t,!n)return B;let a=B;const i=e.watch((()=>function(t){var n;const o=e.unref(t);return null!=(n=null==o?void 0:o.$el)?n:o}(n)),(e=>{a(),e&&(e.addEventListener(o,l,r),a=()=>{e.removeEventListener(o,l,r),a=B})}),{immediate:!0,flush:"post"}),c=()=>{i(),a()};return C(c),c}E&&window.navigator,E&&window.location;const T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},F="__vueuse_ssr_handlers__";T[F]=T[F]||{};const _=T[F];const H={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function q(t,n,o,l={}){var r;const{flush:a="pre",deep:i=!0,listenToStorageChanges:c=!0,writeDefaults:s=!0,shallow:m,window:u=O,eventFilter:d,onError:p=(e=>{console.error(e)})}=l,v=(m?e.shallowRef:e.ref)(n);if(!o)try{o=function(e,t){return _[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=O)?void 0:e.localStorage}))()}catch(e){p(e)}if(!o)return v;const g=e.unref(n),f=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(g),h=null!=(r=l.serializer)?r:H[f],{pause:w,resume:y}=M(v,(()=>function(e){try{null==e?o.removeItem(t):o.setItem(t,h.write(e))}catch(e){p(e)}}(v.value)),{flush:a,deep:i,eventFilter:d});return u&&c&&P(u,"storage",k),k(),v;function k(e){e&&e.key!==t||(v.value=function(e){if(!e||e.key===t){w();try{const n=e?e.newValue:o.getItem(t);return null==n?(s&&null!==g&&o.setItem(t,h.write(g)),g):"string"!=typeof n?n:h.read(n)}catch(e){p(e)}finally{y()}}}(e))}}var W,J,K=Object.defineProperty,Y=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,Q=(e,t,n)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function Z(t={}){const{controls:n=!1,interval:o="requestAnimationFrame"}=t,l=e.ref(new Date),r=()=>l.value=new Date,a="requestAnimationFrame"===o?function(t,n={}){const{immediate:o=!0,window:l=O}=n,r=e.ref(!1);let a=null;function i(){r.value&&l&&(t(),a=l.requestAnimationFrame(i))}function c(){!r.value&&l&&(r.value=!0,i())}function s(){r.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return o&&c(),C(s),{isActive:r,pause:s,resume:c}}(r,{immediate:!0}):function(t,n=1e3,o={}){const{immediate:l=!0,immediateCallback:r=!1}=o;let a=null;const i=e.ref(!1);function c(){a&&(clearInterval(a),a=null)}function s(){i.value=!1,c()}function m(){n<=0||(i.value=!0,r&&t(),c(),a=setInterval(t,e.unref(n)))}l&&E&&m(),e.isRef(n)&&C(e.watch(n,(()=>{l&&E&&m()})));return C(s),{isActive:i,pause:s,resume:m}}(r,o,{immediate:!0});return n?((e,t)=>{for(var n in t||(t={}))G.call(t,n)&&Q(e,n,t[n]);if(Y)for(var n of Y(t))X.call(t,n)&&Q(e,n,t[n]);return e})({now:l},a):l}E&&(null==window?void 0:window.navigator)&&(null==(W=null==window?void 0:window.navigator)?void 0:W.platform)&&/iP(ad|hone|od)/.test(null==(J=null==window?void 0:window.navigator)?void 0:J.platform);let ee=0;const te=e=>{try{e=decodeURI(e)}catch(e){}return e},ne=(e="")=>e.replace(/\/$/u,""),oe=e=>/^(https?:)?\/\//.test(e),le=e=>{const t=ne(e);return oe(t)?t:`https://${t}`},re=e=>Array.isArray(e)?e:!!e&&[0,e],ae=(e,t)=>"function"==typeof e?e:!1!==e&&t,ie="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",ce=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},se=(e,t,n)=>{if(!e)return"";const o="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,l=t.getTime()-o.getTime(),r=Math.floor(l/864e5);if(0===r){const e=l%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,o=Math.floor(t/6e4);if(0===o){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${o} ${n.minutes}`}return`${t} ${n.hours}`}return r<0?n.now:r<8?`${r} ${n.days}`:(e=>{const t=ce(e.getDate(),2),n=ce(e.getMonth()+1,2);return`${ce(e.getFullYear(),2)}-${n}-${t}`})(o)},me=e=>{const t=q("WALINE_EMOJI",{}),n=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(n){const n=t.value[e];if(n)return Promise.resolve(n)}return fetch(`${e}/info.json`).then((e=>e.json())).then((o=>{const l={folder:e,...o};return n&&(t.value[e]=l),l}))},ue=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,de=e=>{"AbortError"!==e.name&&console.error(e.message)},pe=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},ve=({serverURL:e,lang:t,paths:n,signal:o})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o}).then((e=>e.json())).then((e=>pe(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),ge=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>pe(e,"visit count"))),fe=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,he=e=>e.type.includes("image"),we=e=>{const t=Array.from(e).find(he);return t?t.getAsFile():null},ye=/\$.*?\$/,ke=/^\$(.*?)\$/,be=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Ce=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),Ee=(e,{emojiMap:t,highlighter:o,texRenderer:l})=>{if(n.marked.setOptions({highlight:o||void 0,breaks:!0,smartLists:!0,smartypants:!0}),l){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=be.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(e){const t=e.search(ye);return-1!==t?t:e.length},tokenizer(t){const n=ke.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(l);n.marked.use({extensions:e})}return n.marked.parse(Ce(e,t))},Be=e=>e.dataset.path||e.getAttribute("id"),$e=()=>q("USER_KEY",{}),Ne=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:o="zh-CN"})=>{var l;const r=new AbortController,a=document.querySelectorAll(n),i=$e();return a.length&&(({serverURL:e,lang:t,paths:n,signal:o,token:l})=>{const r={};return l&&(r.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o,headers:r}).then((e=>e.json())).then((e=>pe(e,"comment count"))).then((e=>Array.isArray(e)?e:[e]))})({serverURL:e,paths:Array.from(a).map((e=>te(e.dataset.path||e.getAttribute("id")||t))),lang:o,signal:r.signal,token:null===(l=i.value)||void 0===l?void 0:l.token}).then((e=>{a.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(de),r.abort.bind(r)},Se=({size:t})=>e.h("svg",{width:t,height:t,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},e.h("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},e.h("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var xe=e.defineComponent({name:"CommentBox",components:{CloseIcon:({size:t})=>e.h("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:t,height:t},[e.h("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"}),e.h("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"})]),EmojiIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("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"})),ImageIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("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"}),e.h("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"})]),MarkdownIcon:()=>e.h("svg",{width:"16",height:"16",ariaHidden:"true"},e.h("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"})),PreviewIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("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"}),e.h("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"})]),LoadingIcon:Se},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(t,{emit:n}){const o=e.inject("config"),r=q("WALINE_COMMENT_BOX_EDITOR",""),a=q("WALINE_USER_META",{nick:"",mail:"",link:""}),i=$e(),c=e.ref({}),s=e.ref(null),m=e.ref(null),u=e.ref(null),d=e.ref(null),p=e.ref({tabs:[],map:{}}),v=e.ref(0),g=e.ref(!1),f=e.ref(!1),h=e.ref(""),w=e.ref(0),y=e.ref(0),k=e.ref(!1),b=e.ref(""),C=e.ref(!1),E=e.computed((()=>o.value.locale)),B=e.computed((()=>{var e;return Boolean(null===(e=i.value)||void 0===e?void 0:e.token)})),$=e.computed((()=>!1!==o.value.imageUploader)),N=e=>{const t=s.value,n=t.selectionStart,o=t.selectionEnd||0,l=t.scrollTop;r.value=t.value.substring(0,n)+e+t.value.substring(o,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=l},S=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return N(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{r.value=r.value.replace(t,`\r\n![${e.name}](${n})`)}))},x=()=>{var e,l,m,u,d;const{serverURL:v,lang:g,login:f,wordLimit:y,requiredMeta:B}=o.value,$={comment:b.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:o.value.path};if(null===(e=i.value)||void 0===e?void 0:e.token)$.nick=i.value.display_name,$.mail=i.value.email,$.link=i.value.url;else{if("force"===f)return;if(B.indexOf("nick")>-1&&!$.nick)return null===(l=c.value.nick)||void 0===l||l.focus(),alert(E.value.nickError);if(B.indexOf("mail")>-1&&!$.mail||$.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec($.mail))return null===(m=c.value.mail)||void 0===m||m.focus(),alert(E.value.mailError);if(!$.comment)return void(null===(u=s.value)||void 0===u||u.focus());$.nick||($.nick=E.value.anonymous)}if(!k.value)return alert(E.value.wordHint.replace("$0",y[0].toString()).replace("$1",y[1].toString()).replace("$2",w.value.toString()));$.comment=Ce($.comment,p.value.map),t.replyId&&t.rootId&&($.pid=t.replyId,$.rid=t.rootId,$.at=t.replyUser),C.value=!0,(({serverURL:e,lang:t,token:n,comment:o})=>{const l={"Content-Type":"application/json"};return n&&(l.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:l,body:JSON.stringify(o)}).then((e=>e.json()))})({serverURL:v,lang:g,token:null===(d=i.value)||void 0===d?void 0:d.token,comment:$}).then((e=>{if(C.value=!1,e.errmsg)return alert(e.errmsg);n("submit",e.data),r.value="",h.value="",t.replyId&&n("cancel-reply")})).catch((e=>{C.value=!1,alert(e.message)}))},L=e=>{u.value.contains(e.target)||d.value.contains(e.target)||(g.value=!1)};return e.watch([o,w],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(y.value=n[0],k.value=!1):t>n[1]?(y.value=n[1],k.value=!1):(y.value=n[1],k.value=!0):(y.value=0,k.value=!0)}),{immediate:!0}),e.onMounted((()=>{document.body.addEventListener("click",L),e.watch((()=>r.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;b.value=e,h.value=Ee(e,{emojiMap:p.value.map,highlighter:t,texRenderer:n}),w.value=(e=>(e=>e.match(/[\w\d\s\u00C0-\u024F]+/giu)||[])(e).reduce(((e,t)=>e+(""===t.trim()?0:t.trim().split(/\s+/u).length)),0)+(e=>e.match(/[\u4E00-\u9FA5]/gu)||[])(e).length)(e),e?l.default(s.value):l.default.destroy(s.value)}),{immediate:!0}),e.watch((()=>o.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?me(ne(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:r,type:a,items:i}=e;t.tabs.push({name:n,icon:ue(l,o,r,a),items:i.map((e=>{const n=`${r||""}${e}`;return t.map[n]=ue(e,o,r,a),n}))})})),t}))).then((e=>{p.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",L)})),{config:o,locale:E,insert:N,onChange:()=>{const e=m.value;e.files&&$.value&&S(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{var t;if(null===(t=e.dataTransfer)||void 0===t?void 0:t.items){const t=we(e.dataTransfer.items);t&&$.value&&(S(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&x()},onPaste:e=>{if(e.clipboardData){const t=we(e.clipboardData.items);t&&$.value&&S(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,r=(window.innerHeight-450)/2,a=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:null},"*");const c=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(null==a||a.close(),i.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",c))};window.addEventListener("message",c)},onLogout:()=>{i.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-800)/2,r=(window.innerHeight-800)/2,a=window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);null==a||a.postMessage({type:"TOKEN",data:i.value.token},"*");const c=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))),window.removeEventListener("message",c))};window.addEventListener("message",c)},submitComment:x,isLogin:B,userInfo:i,isSubmitting:C,wordNumber:w,wordLimit:y,isWordNumberLegal:k,editor:r,userMeta:a,emoji:p,emojiTabIndex:v,showEmoji:g,canUploadImage:$,previewText:h,showPreview:f,inputRefs:c,editorRef:s,emojiButtonRef:u,emojiPopupRef:d,imageUploadRef:m}}});const Le={class:"wl-comment"},Ve={key:0,class:"wl-login-info"},Ie={class:"wl-avatar"},je=["title"],Re=["src"],Ae=["textContent"],ze={class:"wl-panel"},Ue=["for","textContent"],Me=["id","name","type","onUpdate:modelValue"],Oe=["placeholder"],De={class:"wl-preview"},Pe=e.createElementVNode("hr",null,null,-1),Te=["innerHTML"],Fe={class:"wl-footer"},_e={class:"wl-actions"},He={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},qe=["title"],We=["title"],Je=["title"],Ke={class:"wl-info"},Ye={class:"wl-text-number"},Ge={key:0},Xe=e.createTextVNode("  /  "),Qe=["textContent"],Ze=["textContent"],et=["disabled"],tt={key:0,class:"wl-tab-wrapper"},nt=["title","onClick"],ot=["src","alt"],lt={key:0,class:"wl-tabs"},rt=["onClick"],at=["src","alt","title"],it=["title"];xe.render=function(t,n,o,l,r,a){const i=e.resolveComponent("CloseIcon"),c=e.resolveComponent("MarkdownIcon"),s=e.resolveComponent("EmojiIcon"),m=e.resolveComponent("ImageIcon"),u=e.resolveComponent("PreviewIcon"),d=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",Le,["disable"!==t.config.login&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",Ie,[e.createElementVNode("button",{class:"wl-logout-btn",title:t.locale.logout,onClick:n[0]||(n[0]=(...e)=>t.onLogout&&t.onLogout(...e))},[e.createVNode(i,{size:14})],8,je),e.createElementVNode("img",{src:t.userInfo.avatar,alt:"avatar"},null,8,Re)]),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",onClick:n[1]||(n[1]=(...e)=>t.onProfile&&t.onProfile(...e)),textContent:e.toDisplayString(t.userInfo.display_name)},null,8,Ae)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ze,["force"!==t.config.login&&t.config.meta.length&&!t.isLogin?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wl-header",`item${t.config.meta.length}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.config.meta,(n=>(e.openBlock(),e.createElementBlock("div",{class:"wl-header-item",key:n},[e.createElementVNode("label",{for:n,textContent:e.toDisplayString(t.locale[n]+(t.config.requiredMeta.includes(n)||!t.config.requiredMeta.length?"":`(${t.locale.optional})`))},null,8,Ue),e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:e=>{e&&(t.inputRefs[n]=e)},id:`wl-${n}`,class:e.normalizeClass(["wl-input",`wl-${n}`]),name:n,type:"mail"===n?"email":"text","onUpdate:modelValue":e=>t.userMeta[n]=e},null,10,Me),[[e.vModelDynamic,t.userMeta[n]]])])))),128))],2)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",{class:"wl-editor",ref:"editorRef",id:"wl-edit",placeholder:t.replyUser?`@${t.replyUser}`:t.locale.placeholder,"onUpdate:modelValue":n[2]||(n[2]=e=>t.editor=e),onKeydown:n[3]||(n[3]=(...e)=>t.onKeyDown&&t.onKeyDown(...e)),onDrop:n[4]||(n[4]=(...e)=>t.onDrop&&t.onDrop(...e)),onPaste:n[5]||(n[5]=(...e)=>t.onPaste&&t.onPaste(...e))},null,40,Oe),[[e.vModelText,t.editor]]),e.withDirectives(e.createElementVNode("div",De,[Pe,e.createElementVNode("h4",null,e.toDisplayString(t.locale.preview)+":",1),e.createElementVNode("div",{class:"wl-content",innerHTML:t.previewText},null,8,Te)],512),[[e.vShow,t.showPreview]]),e.createElementVNode("div",Fe,[e.createElementVNode("div",_e,[e.createElementVNode("a",He,[e.createVNode(c)]),e.withDirectives(e.createElementVNode("button",{ref:"emojiButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showEmoji}]),title:t.locale.emoji,onClick:n[6]||(n[6]=e=>t.showEmoji=!t.showEmoji)},[e.createVNode(s)],10,qe),[[e.vShow,t.emoji.tabs.length]]),e.createElementVNode("input",{ref:"imageUploadRef",class:"upload",id:"wl-image-upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:n[7]||(n[7]=(...e)=>t.onChange&&t.onChange(...e))},null,544),t.canUploadImage?(e.openBlock(),e.createElementBlock("label",{key:0,for:"wl-image-upload",class:"wl-action",title:t.locale.uploadImage},[e.createVNode(m)],8,We)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:e.normalizeClass(["wl-action",{actived:t.showPreview}]),title:t.locale.preview,onClick:n[8]||(n[8]=e=>t.showPreview=!t.showPreview)},[e.createVNode(u)],10,Je)]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Ye,[e.createTextVNode(e.toDisplayString(t.wordNumber)+" ",1),t.config.wordLimit?(e.openBlock(),e.createElementBlock("span",Ge,[Xe,e.createElementVNode("span",{class:e.normalizeClass({illegal:!t.isWordNumberLegal}),textContent:e.toDisplayString(t.wordLimit)},null,10,Qe)])):e.createCommentVNode("v-if",!0),e.createTextVNode("  "+e.toDisplayString(t.locale.word),1)]),"disable"===t.config.login||t.isLogin?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn",onClick:n[9]||(n[9]=(...e)=>t.onLogin&&t.onLogin(...e)),textContent:e.toDisplayString(t.locale.login)},null,8,Ze)),"force"!==t.config.login||t.isLogin?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:t.isSubmitting,onClick:n[10]||(n[10]=(...e)=>t.submitComment&&t.submitComment(...e))},[t.isSubmitting?(e.openBlock(),e.createBlock(d,{key:0,size:16})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.locale.submit),1)],2112))],8,et)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{ref:"emojiPopupRef",class:e.normalizeClass(["wl-emoji-popup",{display:t.showEmoji}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.emoji.tabs,((n,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.name},[o===t.emojiTabIndex?(e.openBlock(),e.createElementBlock("div",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(n=>(e.openBlock(),e.createElementBlock("button",{key:n,title:n,onClick:e=>t.insert(`:${n}:`)},[t.showEmoji?(e.openBlock(),e.createElementBlock("img",{key:0,class:"wl-emoji",src:t.emoji.map[n],alt:n,loading:"lazy",referrerPolicy:"no-referrer"},null,8,ot)):e.createCommentVNode("v-if",!0)],8,nt)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),t.emoji.tabs.length>1?(e.openBlock(),e.createElementBlock("div",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.emoji.tabs,((n,o)=>(e.openBlock(),e.createElementBlock("button",{key:n.name,class:e.normalizeClass(["wl-tab",{active:t.emojiTabIndex===o}]),onClick:e=>t.emojiTabIndex=o},[e.createElementVNode("img",{class:"wl-emoji",src:n.icon,alt:n.name,title:n.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,at)],10,rt)))),128))])):e.createCommentVNode("v-if",!0)],2)])]),t.replyId?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-close",title:t.locale.cancelReply,onClick:n[11]||(n[11]=e=>t.$emit("cancel-reply"))},[e.createVNode(i,{size:24})],8,it)):e.createCommentVNode("v-if",!0)])},xe.__file="src/components/CommentBox.vue";var ct=e.defineComponent({props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object}},components:{CommentBox:xe,ReplyIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"18",height:"18"},e.h("path",{d:"M1019.2 720C1001.6 625.6 968 566.4 904 497.6c-89.6-89.6-214.4-150.4-347.2-176v-120c0-25.6-8-51.2-25.6-64-33.6-30.4-81.6-30.4-112-4.8L33.6 441.6C12.8 459.2 0 484.8 0 510.4c0 25.6 12.8 51.2 30.4 68.8l385.6 312c17.6 12.8 33.6 17.6 51.2 17.6 12.8 0 25.6-4.8 38.4-8C536 888 552 857.6 552 824v-99.2c124.8 20.8 248 86.4 339.2 140.8 25.6 17.6 59.2 17.6 89.6 0 25.6-17.6 43.2-46.4 43.2-76.8 0-33.6 0-56-4.8-68.8zm-500.8-89.6-46.4-4.8v193.6L86.4 510.4 472 201.6V400l38.4 4.8c128 12.8 248 68.8 334.4 153.6 51.2 56 76.8 102.4 94.4 179.2 0 4.8 4.8 20.8 4.8 51.2C835.2 720 672 640 518.4 630.4z",fill:"currentColor"})),VerifiedIcon:()=>e.h("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},e.h("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"}))},emits:["submit","reply"],setup(t){const n=e.inject("config"),o=e.computed((()=>n.value.locale)),l=e.computed((()=>{let{link:e}=t.comment;return e?oe(e)?e:`https://${e}`:""})),r=((t,n)=>{const o=Z();return e.computed((()=>se(t,o.value,n)))})(t.comment.insertedAt,o.value),a=e.computed((()=>{var e;return t.comment.objectId===(null===(e=t.reply)||void 0===e?void 0:e.objectId)}));return{config:n,locale:o,isReplyingCurrent:a,link:l,time:r}}});const st=["id"],mt={class:"wl-user","aria-hidden":"true"},ut=["src"],dt={class:"wl-card"},pt={class:"wl-head"},vt=["href"],gt={key:1,class:"wl-nick"},ft=["textContent"],ht=["textContent"],wt=["textContent"],yt=["textContent"],kt=["textContent"],bt=["title"],Ct={class:"wl-meta","aria-hidden":"true"},Et=["textContent"],Bt=["textContent"],$t=["textContent"],Nt=["innerHTML"],St={key:0,class:"wl-reply-wrapper"},xt={key:1,class:"wl-quote"};ct.render=function(t,n,o,l,r,a){const i=e.resolveComponent("VerifiedIcon"),c=e.resolveComponent("ReplyIcon"),s=e.resolveComponent("CommentBox"),m=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{class:"wl-item",id:t.comment.objectId},[e.createElementVNode("div",mt,[t.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.comment.avatar},null,8,ut)):e.createCommentVNode("v-if",!0),t.comment.type?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",dt,[e.createElementVNode("div",pt,[t.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"wl-nick",href:t.link,target:"_blank",rel:"nofollow noreferrer"},e.toDisplayString(t.comment.nick),9,vt)):(e.openBlock(),e.createElementBlock("span",gt,e.toDisplayString(t.comment.nick),1)),"administrator"===t.comment.type?(e.openBlock(),e.createElementBlock("span",{key:2,class:"wl-badge",textContent:e.toDisplayString(t.locale.admin)},null,8,ft)):e.createCommentVNode("v-if",!0),t.comment.label?(e.openBlock(),e.createElementBlock("span",{key:3,class:"wl-badge",textContent:e.toDisplayString(t.comment.label)},null,8,ht)):e.createCommentVNode("v-if",!0),t.comment.sticky?(e.openBlock(),e.createElementBlock("span",{key:4,class:"wl-badge",textContent:e.toDisplayString(t.locale.sticky)},null,8,wt)):e.createCommentVNode("v-if",!0),t.comment.level>=0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(`wl-badge level${t.comment.level}`),textContent:e.toDisplayString(t.locale[`level${t.comment.level}`]||`Level ${t.comment.level}`)},null,10,yt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(t.time)},null,8,kt),e.createElementVNode("button",{class:e.normalizeClass(["wl-reply",{active:t.isReplyingCurrent}]),title:t.isReplyingCurrent?t.locale.cancelReply:t.locale.reply,onClick:n[0]||(n[0]=e=>t.$emit("reply",t.isReplyingCurrent?null:t.comment))},[e.createVNode(c)],10,bt)]),e.createElementVNode("div",Ct,[t.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.addr)},null,8,Et)):e.createCommentVNode("v-if",!0),t.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,textContent:e.toDisplayString(t.comment.browser)},null,8,Bt)):e.createCommentVNode("v-if",!0),t.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,textContent:e.toDisplayString(t.comment.os)},null,8,$t)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{class:"wl-content",innerHTML:t.comment.comment},null,8,Nt),t.isReplyingCurrent?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(s,{replyId:t.comment.objectId,replyUser:t.comment.nick,rootId:t.rootId,onSubmit:n[1]||(n[1]=e=>t.$emit("submit",e)),onCancelReply:n[2]||(n[2]=e=>t.$emit("reply",null))},null,8,["replyId","replyUser","rootId"])])):e.createCommentVNode("v-if",!0),t.comment.children?(e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment.children,(o=>(e.openBlock(),e.createBlock(m,{key:o.objectId,comment:o,reply:t.reply,rootId:t.rootId,onReply:n[3]||(n[3]=e=>t.$emit("reply",e)),onSubmit:n[4]||(n[4]=e=>t.$emit("submit",e))},null,8,["comment","reply","rootId"])))),128))])):e.createCommentVNode("v-if",!0)])],8,st)},ct.__file="src/components/CommentCard.vue";var Lt=e.defineComponent({name:"WalineRoot",components:{CommentBox:xe,CommentCard:ct,LoadingIcon:Se},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","copyright"],setup(t){const n=e.computed((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:o,emoji:l=["//unpkg.com/@waline/emojis@1.0.1/weibo"],meta:r=["nick","mail","link"],requiredMeta:s=[],dark:m=!1,pageSize:u=10,wordLimit:p,imageUploader:v,highlighter:g,texRenderer:f,copyright:h=!0,login:w="enable",...y})=>({serverURL:le(e),path:te(t),locale:{...b[n]||b["zh-CN"],..."object"==typeof o?o:{}},wordLimit:re(p),meta:a(r),requiredMeta:a(s),imageUploader:ae(v,i),highlighter:ae(g,d),texRenderer:ae(f,c),lang:n,dark:m,emoji:l,pageSize:u,login:w,copyright:h,...y}))(t))),o=$e(),l=e.ref("loading"),r=e.ref(0),s=e.ref(1),m=e.ref(0),u=e.ref([]),p=e.ref(null),v=e.computed((()=>{return"string"==typeof(e=n.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${ie}}`:`${e}${ie}`:!0===e?`:root${ie}`:"";var e}));let g;!function(t,n={}){const o=e.ref(!1),{document:l=D,immediate:r=!0,manual:a=!1,id:i="vueuse_styletag_"+ ++ee}=n,c=e.ref(t);let s=()=>{};const m=()=>{if(!l)return;const t=l.getElementById(i)||l.createElement("style");t.type="text/css",t.id=i,n.media&&(t.media=n.media),l.head.appendChild(t),o.value||(s=e.watch(c,(e=>{t.innerText=e}),{immediate:!0}),o.value=!0)},u=()=>{l&&o.value&&(s(),l.head.removeChild(l.getElementById(i)),o.value=!1)};r&&!a&&m(),a||C(u),e.readonly(o)}(v);const f=e=>{var t;const{serverURL:a,path:i,pageSize:c}=n.value,d=new AbortController;l.value="loading",null==g||g(),(({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:r,token:a})=>{const i={};return a&&(i.Authorization=`Bearer ${a}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:r,headers:i}).then((e=>e.json())).then((e=>pe(e,"comment list")))})({serverURL:a,lang:n.value.lang,path:i,pageSize:c,page:e,signal:d.signal,token:null===(t=o.value)||void 0===t?void 0:t.token}).then((t=>{l.value="success",r.value=t.count,u.value.push(...t.data),s.value=e,m.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),l.value="error")})),g=d.abort.bind(d)},h=()=>{r.value=0,u.value=[],f(1)};return e.provide("config",n),e.watch((()=>t.path),h),e.onMounted((()=>h())),{config:n,darkmodeStyle:v,i18n:e.computed((()=>n.value.locale)),status:l,count:r,page:s,totalPages:m,data:u,reply:p,loadMore:()=>f(s.value+1),refresh:h,onReply:e=>{p.value=e},onSubmit:e=>{if(e.rid){const t=u.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else u.value.unshift(e)},version:"2.3.2"}}});const Vt={"data-waline":""},It={class:"wl-count"},jt=["textContent"],Rt={class:"wl-cards"},At={key:1,class:"wl-operation"},zt=["textContent"],Ut={key:0,class:"wl-loading"},Mt=["textContent"],Ot={class:"wl-operation"},Dt=["textContent"],Pt={key:3,class:"wl-power"},Tt=e.createTextVNode(" Powered by "),Ft=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);Lt.render=function(t,n,o,l,r,a){const i=e.resolveComponent("CommentBox"),c=e.resolveComponent("CommentCard"),s=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",Vt,[t.reply?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,onSubmit:t.onSubmit},null,8,["onSubmit"])),e.createElementVNode("div",It,[t.count?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(t.count)},null,8,jt)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.i18n.comment),1)]),e.createElementVNode("div",Rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(n=>(e.openBlock(),e.createBlock(c,{key:n.objectId,"root-id":n.objectId,comment:n,reply:t.reply,onReply:t.onReply,onSubmit:t.onSubmit},null,8,["root-id","comment","reply","onReply","onSubmit"])))),128))]),"error"===t.status?(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:n[0]||(n[0]=(...e)=>t.refresh&&t.refresh(...e)),textContent:e.toDisplayString(t.i18n.refresh)},null,8,zt)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===t.status?(e.openBlock(),e.createElementBlock("div",Ut,[e.createVNode(s,{size:30})])):t.data.length?t.page<t.totalPages?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createCommentVNode(" Load more button "),e.createElementVNode("div",Ot,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:n[1]||(n[1]=(...e)=>t.loadMore&&t.loadMore(...e)),textContent:e.toDisplayString(t.i18n.more)},null,8,Dt)])],2112)):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(t.i18n.sofa)},null,8,Mt))],2112)),e.createCommentVNode(" Copyright Information "),t.config.copyright?(e.openBlock(),e.createElementBlock("div",Pt,[Tt,Ft,e.createTextVNode(" v"+e.toDisplayString(t.version),1)])):e.createCommentVNode("v-if",!0)])},Lt.__file="src/components/Waline.vue";const _t=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},Ht=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:o=!0,lang:l="zh-CN"})=>{const r=new AbortController,a=Array.from(document.querySelectorAll(n)),i=e=>{const n=Be(e);return null!==n&&t!==n},c=n=>ve({serverURL:e,paths:n.map((e=>Be(e)||t)),lang:l,signal:r.signal}).then((e=>_t(e,n))).catch(de);if(o){const n=a.filter((e=>!i(e))),o=a.filter(i);ge({serverURL:e,path:t,lang:l}).then((e=>_t(new Array(n.length).fill(e),n))),o.length&&c(o)}else c(a);return r.abort.bind(r)};exports.RecentComments=({el:e,serverURL:t,count:n,lang:o="zh-CN"})=>{var l;const r=$e(),a=fe(e),i=new AbortController;return(({serverURL:e,lang:t,count:n,signal:o,token:l})=>{const r={};return l&&(r.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:o,headers:r}).then((e=>e.json())).then((e=>pe(e,"recent comment")))})({serverURL:t,count:n,lang:o,signal:i.signal,token:null===(l=r.value)||void 0===l?void 0:l.token}).then((e=>a&&e.length?(a.innerHTML=`<ul class="wl-recent-list">${e.map((e=>`<li class="wl-recent-item"><a href="${e.url}">${e.nick}</a>:${e.comment}</li>`)).join("")}</ul>`,{comments:e,destroy:()=>{i.abort(),a.innerHTML=""}}):{comments:e,destroy:()=>i.abort()}))},exports.commentCount=Ne,exports.defaultLocales=b,exports.init=({el:t="#waline",path:n=window.location.pathname,comment:o=!1,pageview:l=!1,...r})=>{const a=t?fe(t):null;if(t&&!a)throw new Error("Option 'el' do not match any domElement!");if(!r.serverURL)throw new Error("Option 'serverURL' is missing!");const i=e.reactive({...r}),c=e.reactive({comment:o,pageview:l,path:n}),s=()=>{c.comment&&Ne({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.comment?c.comment:void 0})},m=()=>{c.pageview&&Ht({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.pageview?c.pageview:void 0})},u=a?e.createApp((()=>e.h(Lt,{path:c.path,...i}))):null;u&&u.mount(a),s(),m();const d=e.watchEffect(s),p=e.watchEffect(m);return{el:a,update:({comment:e,pageview:t,path:n=window.location.pathname,...o}={})=>{Object.entries(o).forEach((([e,t])=>{i[e]=t})),c.path=n,void 0!==e&&(c.comment=e),void 0!==t&&(c.pageview=t)},destroy:()=>{null==u||u.unmount(),d(),p()}}},exports.pageviewCount=Ht,exports.version="2.3.2";
//# sourceMappingURL=shim.js.map
{
"name": "@waline/client",
"version": "2.3.1",
"version": "2.3.2",
"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 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

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 not supported yet

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