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.6.4 to 2.7.0

2

dist/component.esm.js

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

import{getCurrentScope as e,onScopeDispose as t,getCurrentInstance as n,onMounted as l,nextTick as o,unref as a,ref as i,isRef as r,watch as s,readonly as c,shallowRef as u,h as m,defineComponent as d,onBeforeUnmount as p,resolveComponent as v,openBlock as f,createElementBlock as g,normalizeStyle as h,Fragment as y,renderList as w,createBlock as b,createCommentVNode as k,createElementVNode as C,computed as I,inject as $,reactive as x,onUnmounted as j,createVNode as S,toDisplayString as L,normalizeClass as E,withDirectives as R,vModelDynamic as O,vModelText as z,vShow as A,createTextVNode as P,provide as M}from"vue";import U from"autosize";import{marked as T}from"marked";var N;const H="undefined"!=typeof window,V=()=>{};function F(e){return"function"==typeof e?e():a(e)}function _(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}H&&(null==(N=null==window?void 0:window.navigator)?void 0:N.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const B=e=>e();function D(n){return!!e()&&(t(n),!0)}function W(e,t=200,n={}){return _(function(e,t={}){let n,l;return o=>{const a=F(e),i=F(t.maxWait);if(n&&clearTimeout(n),a<=0||void 0!==i&&i<=0)return l&&(clearTimeout(l),l=null),o();i&&!l&&(l=setTimeout((()=>{n&&clearTimeout(n),l=null,o()}),i)),n=setTimeout((()=>{l&&clearTimeout(l),l=null,o()}),a)}}(t,n),e)}var G=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;function K(e,t,n={}){const l=n,{eventFilter:o=B}=l,a=((e,t)=>{var n={};for(var l in e)q.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&G)for(var l of G(e))t.indexOf(l)<0&&J.call(e,l)&&(n[l]=e[l]);return n})(l,["eventFilter"]);return s(e,_(o,t),a)}var Q=Object.defineProperty,Y=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,ne=(e,t,n)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function le(e,t,n={}){const l=n,{eventFilter:o}=l,a=((e,t)=>{var n={};for(var l in e)ee.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&X)for(var l of X(e))t.indexOf(l)<0&&te.call(e,l)&&(n[l]=e[l]);return n})(l,["eventFilter"]),{eventFilter:r,pause:s,resume:c,isActive:u}=function(e=B){const t=i(!0);return{isActive:t,pause:function(){t.value=!1},resume:function(){t.value=!0},eventFilter:(...n)=>{t.value&&e(...n)}}}(o),m=K(e,t,(d=((e,t)=>{for(var n in t||(t={}))ee.call(t,n)&&ne(e,n,t[n]);if(X)for(var n of X(t))te.call(t,n)&&ne(e,n,t[n]);return e})({},a),Y(d,Z({eventFilter:r}))));var d;return{stop:m,pause:s,resume:c,isActive:u}}const oe=H?window:void 0,ae=H?window.document:void 0;function ie(...e){let t,n,l,o;if("string"==typeof e[0]?([n,l,o]=e,t=oe):[t,n,l,o]=e,!t)return V;let a=V;const i=s((()=>function(e){var t;const n=F(e);return null!=(t=null==n?void 0:n.$el)?t:n}(t)),(e=>{a(),e&&(e.addEventListener(n,l,o),a=()=>{e.removeEventListener(n,l,o),a=V})}),{immediate:!0,flush:"post"}),r=()=>{i(),a()};return D(r),r}H&&window.navigator,H&&window.location;const re="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},se="__vueuse_ssr_handlers__";re[se]=re[se]||{};const ce=re[se];var ue=Object.defineProperty,me=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,ve=(e,t,n)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fe=(e,t)=>{for(var n in t||(t={}))de.call(t,n)&&ve(e,n,t[n]);if(me)for(var n of me(t))pe.call(t,n)&&ve(e,n,t[n]);return e};const ge={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 he(e,t,n,l={}){var o;const{flush:a="pre",deep:r=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:m=!1,shallow:d,window:p=oe,eventFilter:v,onError:f=(e=>{console.error(e)})}=l,g=(d?u:i)(t);if(!n)try{n=function(e,t){return ce[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=oe)?void 0:e.localStorage}))()}catch(e){f(e)}if(!n)return g;const h=F(t),y=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),w=null!=(o=l.serializer)?o:ge[y],{pause:b,resume:k}=le(g,(()=>function(t){try{null==t?n.removeItem(e):n.setItem(e,w.write(t))}catch(e){f(e)}}(g.value)),{flush:a,deep:r,eventFilter:v});return p&&s&&ie(p,"storage",C),C(),g;function C(t){t&&t.key!==e||(g.value=function(t){if(!t||t.key===e){b();try{const l=t?t.newValue:n.getItem(e);if(null==l)return c&&null!==h&&n.setItem(e,w.write(h)),h;if(!t&&m){const e=w.read(l);return"function"==typeof m?m(e,h):"object"!==y||Array.isArray(e)?e:fe(fe({},h),e)}return"string"!=typeof l?l:w.read(l)}catch(e){f(e)}finally{k()}}}(t))}}var ye,we,be=Object.defineProperty,ke=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,$e=(e,t,n)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function xe(e={}){const{controls:t=!1,interval:n="requestAnimationFrame"}=e,l=i(new Date),o=()=>l.value=new Date,c="requestAnimationFrame"===n?function(e,t={}){const{immediate:n=!0,window:l=oe}=t,o=i(!1);let a=null;function r(){o.value&&l&&(e(),a=l.requestAnimationFrame(r))}function s(){!o.value&&l&&(o.value=!0,r())}function c(){o.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return n&&s(),D(c),{isActive:o,pause:c,resume:s}}(o,{immediate:!0}):function(e,t=1e3,n={}){const{immediate:l=!0,immediateCallback:o=!1}=n;let c=null;const u=i(!1);function m(){c&&(clearInterval(c),c=null)}function d(){u.value=!1,m()}function p(){a(t)<=0||(u.value=!0,o&&e(),m(),c=setInterval(e,F(t)))}l&&H&&p(),r(t)&&D(s(t,(()=>{u.value&&H&&p()})));return D(d),{isActive:u,pause:d,resume:p}}(o,n,{immediate:!0});return t?((e,t)=>{for(var n in t||(t={}))Ce.call(t,n)&&$e(e,n,t[n]);if(ke)for(var n of ke(t))Ie.call(t,n)&&$e(e,n,t[n]);return e})({now:l},c):l}(we=ye||(ye={})).UP="UP",we.RIGHT="RIGHT",we.DOWN="DOWN",we.LEFT="LEFT",we.NONE="NONE";let je=0;function Se(e,t={}){const a=i(!1),{document:r=ae,immediate:u=!0,manual:m=!1,id:d="vueuse_styletag_"+ ++je}=t,p=i(e);let v=()=>{};const f=()=>{if(!r)return;const e=r.getElementById(d)||r.createElement("style");e.type="text/css",e.id=d,t.media&&(e.media=t.media),r.head.appendChild(e),a.value||(v=s(p,(t=>{e.innerText=t}),{immediate:!0}),a.value=!0)},g=()=>{r&&a.value&&(v(),r.head.removeChild(r.getElementById(d)),a.value=!1)};return u&&!m&&function(e,t=!0){n()?l(e):t?e():o(e)}(f),m||D(g),{id:d,css:p,unload:g,load:f,isLoaded:c(a)}}var Le=Object.defineProperty,Ee=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ze=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))Re.call(t,n)&&ze(e,n,t[n]);if(Ee)for(var n of Ee(t))Oe.call(t,n)&&ze(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Ae=({size:e})=>m("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},m("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},m("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Pe=d({name:"ImageWall",components:{LoadingIcon:Ae},props:{items:{type:Array,default:()=>[]},columnWidth:{type:Number,default:300},gap:{type:Number,default:0}},emits:["insert"],setup(e){let t=null;const n=i(null),a=i({}),r=i([]),c=()=>{const t=Math.floor((n.value.getBoundingClientRect().width+e.gap)/(e.columnWidth+e.gap));return t>0?t:1},u=async t=>{if(t>=e.items.length)return;await o();const l=Array.from(n.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));r.value[Number(l.dataset.index)].push(t),await u(t+1)},m=async(e=!1)=>{if(r.value.length===c()&&!e)return;var t;r.value=(t=c(),new Array(t).fill(null).map((()=>[])));const n=window.scrollY;await u(0),window.scrollTo({top:n})};return s((()=>[e.items]),(()=>{a.value={},m(!0)})),s((()=>[e.columnWidth,e.gap]),(()=>m())),l((()=>{m(!0),t=new ResizeObserver((()=>m())),t.observe(n.value)})),p((()=>t.unobserve(n.value))),{columns:r,state:a,wall:n}}}),Me=(e,t)=>{const n=e.__vccOpts||e;for(const[e,l]of t)n[e]=l;return n};const Ue=["data-index"],Te=["src","title","onLoad","onClick"];var Ne=Me(Pe,[["render",function(e,t,n,l,o,a){const i=v("LoadingIcon");return f(),g("div",{ref:"wall",class:"wl-gallery",style:h({gap:`${e.gap}px`})},[(f(!0),g(y,null,w(e.columns,((t,n)=>(f(),g("div",{key:n,class:"wl-gallery-column","data-index":n,style:h({gap:`${e.gap}px`})},[(f(!0),g(y,null,w(t,(t=>(f(),g(y,{key:t},[e.state[e.items[t].src]?k("v-if",!0):(f(),b(i,{key:0,size:36,style:{margin:"20px auto"}})),C("img",{class:"wl-gallery-item",src:e.items[t].src,title:e.items[t].title,loading:"lazy",onLoad:n=>e.state[e.items[t].src]=!0,onClick:n=>e.$emit("insert",`![](${e.items[t].src})`)},null,40,Te)],64)))),128))],12,Ue)))),128))],4)}],["__file","ImageWall.vue"]]);const He=["nick","mail","link"],Ve=e=>e.filter((e=>He.includes(e))),Fe=e=>new Promise(((t,n)=>{if(e.size>128e3)return n(new Error("File too large! File size limit 128KB"));const l=new FileReader;l.readAsDataURL(e),l.onload=()=>t(l.result?.toString()||""),l.onerror=n})),_e=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>',Be=()=>{const e={next:""},t=({keyword:e,pos:t})=>{const n=new URLSearchParams("media_filter=minimal");return n.set("key","PAY5JLFIH6V6"),n.set("limit","20"),n.set("pos",t||""),n.set("q",e),fetch(`https://g.tenor.com/v1/search?${n.toString()}`,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())).catch((()=>({next:t||"",results:[]})))};return{search:(n="")=>t({keyword:n}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url})))))),more:n=>t({keyword:n,pos:e.next}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url}))))))}},De=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"),We=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],Ge={},qe=e=>{let t=0;return e.replace(De,((e,n,l)=>{if(l)return`<span style="color: slategray">${l}</span>`;if("<"===n)return"&lt;";let o;Ge[n]?o=Ge[n]:(o=We[t],Ge[n]=o);const a=`<span style="color: #${o}">${n}</span>`;return t=++t%We.length,a}))},Je=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky"],Ke=e=>Object.fromEntries(e.map(((e,t)=>[Je[t],e])));var Qe=Ke(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words","Please input comments between $0 and $1 words!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky"]),Ye=Ke(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない"]),Ze=Ke(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶"]),Xe=Ke(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂"]),et=Ke(["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","Like","Cancel like","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","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky"]),tt=Ke(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий"]);const nt={zh:Ze,"zh-cn":Ze,"zh-CN":Ze,"zh-tw":Xe,"zh-TW":Xe,en:Qe,"en-US":Qe,"en-us":Qe,jp:Ye,"jp-jp":Ye,"jp-JP":Ye,"pt-br":et,"pt-BR":et,ru:tt,"ru-ru":tt,"ru-RU":tt},lt=e=>{try{e=decodeURI(e)}catch(e){}return e},ot=(e="")=>e.replace(/\/$/u,""),at=e=>/^(https?:)?\/\//.test(e),it=e=>{const t=ot(e);return at(t)?t:`https://${t}`},rt=e=>Array.isArray(e)?e:!!e&&[0,e],st=(e,t)=>"function"==typeof e?e:!1!==e&&t,ct="{--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}",ut=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},mt=(e,t,n)=>{if(!e)return"";const l="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,o=t.getTime()-l.getTime(),a=Math.floor(o/864e5);if(0===a){const e=o%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,l=Math.floor(t/6e4);if(0===l){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${l} ${n.minutes}`}return`${t} ${n.hours}`}return a<0?n.now:a<8?`${a} ${n.days}`:(e=>{const t=ut(e.getDate(),2),n=ut(e.getMonth()+1,2);return`${ut(e.getFullYear(),2)}-${n}-${t}`})(l)},dt=e=>{const t=he("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((l=>{const o={folder:e,...l};return n&&(t.value[e]=o),o}))},pt=(e,t="",n="",l="")=>`${t?`${t}/`:""}${n}${e}${l?`.${l}`:""}`,vt={"Content-Type":"application/json"},ft=({serverURL:e,lang:t,path:n,page:l,pageSize:o,signal:a,token:i})=>{const r={};return i&&(r.Authorization=`Bearer ${i}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${o}&page=${l}&lang=${t}`,{signal:a,headers:r}).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")))},gt=({serverURL:e,lang:t,token:n,objectId:l,...o})=>fetch(`${e}/comment/${l}?lang=${t}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(o)}).then((e=>e.json())),ht=e=>e.type.includes("image"),yt=e=>{const t=Array.from(e).find(ht);return t?t.getAsFile():null},wt=/\$.*?\$/,bt=/^\$(.*?)\$/,kt=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Ct=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),It=(e,{emojiMap:t,highlighter:n,texRenderer:l})=>{if(T.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),l){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=kt.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(wt);return-1!==t?t:e.length},tokenizer(t){const n=bt.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(l);T.use({extensions:e})}return T.parse(Ct(e,t))};let $t=null;const xt=()=>$t||($t=he("WALINE_USER",{}));let jt=null;const St=()=>jt||(jt=he("WALINE_LIKE",[]));var Lt=d({name:"CommentBox",components:{CloseIcon:({size:e})=>m("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[m("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"}),m("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:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},m("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:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[m("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"}),m("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"})]),ImageWall:Ne,MarkdownIcon:()=>m("svg",{width:"16",height:"16",ariaHidden:"true"},m("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:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[m("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"}),m("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:Ae,GifIcon:()=>m("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[m("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),m("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})])},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(e,{emit:t}){const n=$("config"),o=he("WALINE_COMMENT_BOX_EDITOR",""),a=he("WALINE_USER_META",{nick:"",mail:"",link:""}),r=xt(),c=i({}),u=i(null),m=i(null),d=i(null),p=i(null),v=i(null),f=i(null),g=i(null),h=i({tabs:[],map:{}}),y=i(0),w=i(!1),b=i(!1),k=i(!1),C=i(""),S=i(0),L=x({loading:!0,list:[]}),E=i(0),R=i(!1),O=i(""),z=i(!1),A=I((()=>n.value.locale)),P=I((()=>Boolean(r.value?.token))),M=I((()=>!1!==n.value.imageUploader)),T=e=>{const t=u.value,n=t.selectionStart,l=t.selectionEnd||0,a=t.scrollTop;o.value=t.value.substring(0,n)+e+t.value.substring(l,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=a},N=e=>{const t=`![${n.value.locale.uploading} ${e.name}]()`;return T(t),Promise.resolve().then((()=>n.value.imageUploader(e))).then((n=>{o.value=o.value.replace(t,`\r\n![${e.name}](${n})`)})).catch((e=>{alert(e.message),o.value=o.value.replace(t,"")}))},H=()=>{const{serverURL:l,lang:i,login:s,wordLimit:m,requiredMeta:d}=n.value,p={comment:O.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:n.value.path};if(r.value?.token)p.nick=r.value.display_name,p.mail=r.value.email,p.link=r.value.url;else{if("force"===s)return;if(d.indexOf("nick")>-1&&!p.nick)return c.value.nick?.focus(),alert(A.value.nickError);if(d.indexOf("mail")>-1&&!p.mail||p.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(p.mail))return c.value.mail?.focus(),alert(A.value.mailError);if(!p.comment)return void u.value?.focus();p.nick||(p.nick=A.value.anonymous)}if(!R.value)return alert(A.value.wordHint.replace("$0",m[0].toString()).replace("$1",m[1].toString()).replace("$2",S.value.toString()));p.comment=Ct(p.comment,h.value.map),e.replyId&&e.rootId&&(p.pid=e.replyId,p.rid=e.rootId,p.at=e.replyUser),z.value=!0,(({serverURL:e,lang:t,token:n,comment:l})=>{const o={"Content-Type":"application/json"};return n&&(o.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:o,body:JSON.stringify(l)}).then((e=>e.json()))})({serverURL:l,lang:i,token:r.value?.token,comment:p}).then((n=>{if(z.value=!1,n.errmsg)return alert(n.errmsg);t("submit",n.data),o.value="",C.value="",e.replyId&&t("cancel-reply")})).catch((e=>{z.value=!1,alert(e.message)}))},V=e=>{d.value.contains(e.target)||p.value.contains(e.target)||(w.value=!1),v.value.contains(e.target)||f.value.contains(e.target)||(b.value=!1)},F=async e=>{const{scrollTop:t,clientHeight:l,scrollHeight:o}=e.target,a=(l+t)/o,i=n.value.search,r=g.value?.value||"";a<.9||L.loading||(L.loading=!0,L.list.push(...i.more?await i.more(r,L.list.length):await i.search(r)),L.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},_=W((e=>{L.list=[],F(e)}),300);s([n,S],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(E.value=n[0],R.value=!1):t>n[1]?(E.value=n[1],R.value=!1):(E.value=n[1],R.value=!0):(E.value=0,R.value=!0)}),{immediate:!0}),s(b,(async e=>{if(!e)return;const t=n.value.search;g.value&&(g.value.value=""),L.loading=!0,L.list=t.default?await t.default():await t.search(""),L.loading=!1}));const B=({data:e})=>{e&&"profile"===e.type&&(r.value={...r.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(r)))))};return l((()=>{document.body.addEventListener("click",V),window.addEventListener("message",B),s((()=>o.value),(e=>{const{highlighter:t,texRenderer:l}=n.value;O.value=e,C.value=It(e,{emojiMap:h.value.map,highlighter:t,texRenderer:l}),S.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?U(u.value):U.destroy(u.value)}),{immediate:!0}),s((()=>n.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?dt(ot(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:l,icon:o,prefix:a,type:i,items:r}=e;t.tabs.push({name:n,icon:pt(o,l,a,i),items:r.map((e=>{const n=`${a||""}${e}`;return t.map[n]=pt(e,l,a,i),n}))})})),t}))).then((e=>{h.value=e}));var t}),{immediate:!0})})),j((()=>{document.body.removeEventListener("click",V),window.removeEventListener("message",B)})),{config:n,locale:A,insert:T,onChange:()=>{const e=m.value;e.files&&M.value&&N(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{if(e.dataTransfer?.items){const t=yt(e.dataTransfer.items);t&&M.value&&(N(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&H()},onPaste:e=>{if(e.clipboardData){const t=yt(e.clipboardData.items);t&&M.value&&N(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:l}=n.value,o=(window.innerWidth-450)/2,a=(window.innerHeight-450)/2,i=window.open(`${l}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${o},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);i?.postMessage({type:"TOKEN",data:null},"*");const s=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(i?.close(),r.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",s))};window.addEventListener("message",s)},onLogout:()=>{r.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:l}=n.value,o=(window.innerWidth-800)/2,a=(window.innerHeight-800)/2;window.open(`${l}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${o},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`)?.postMessage({type:"TOKEN",data:r.value.token},"*")},submitComment:H,onImageWallScroll:F,onGifSearch:_,isLogin:P,userInfo:r,isSubmitting:z,wordNumber:S,wordLimit:E,isWordNumberLegal:R,editor:o,userMeta:a,emoji:h,emojiTabIndex:y,showEmoji:w,gifData:L,showGif:b,canUploadImage:M,previewText:C,showPreview:k,inputRefs:c,editorRef:u,emojiButtonRef:d,emojiPopupRef:p,gifButtonRef:v,gifPopupRef:f,imageUploadRef:m,gifSearchInputRef:g}}});const Et={class:"wl-comment"},Rt={key:0,class:"wl-login-info"},Ot={class:"wl-avatar"},zt=["title"],At=["title"],Pt=["src"],Mt=["title","textContent"],Ut={class:"wl-panel"},Tt=["for","textContent"],Nt=["id","onUpdate:modelValue","name","type"],Ht=["placeholder"],Vt={class:"wl-preview"},Ft=C("hr",null,null,-1),_t=["innerHTML"],Bt={class:"wl-footer"},Dt={class:"wl-actions"},Wt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},Gt=["title"],qt=["title"],Jt=["title"],Kt=["title"],Qt={class:"wl-info"},Yt={class:"wl-text-number"},Zt={key:0},Xt=P("  /  "),en=["textContent"],tn=["textContent"],nn=["disabled"],ln=["placeholder"],on={key:0,class:"wl-loading"},an={key:0,class:"wl-tab-wrapper"},rn=["title","onClick"],sn=["src","alt"],cn={key:0,class:"wl-tabs"},un=["onClick"],mn=["src","alt","title"],dn=["title"];var pn=Me(Lt,[["render",function(e,t,n,l,o,a){const i=v("CloseIcon"),r=v("MarkdownIcon"),s=v("EmojiIcon"),c=v("GifIcon"),u=v("ImageIcon"),m=v("PreviewIcon"),d=v("LoadingIcon"),p=v("ImageWall");return f(),g("div",Et,["disable"!==e.config.login&&e.isLogin?(f(),g("div",Rt,[C("div",Ot,[C("button",{class:"wl-logout-btn",title:e.locale.logout,onClick:t[0]||(t[0]=(...t)=>e.onLogout&&e.onLogout(...t))},[S(i,{size:14})],8,zt),C("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:t[1]||(t[1]=(...t)=>e.onProfile&&e.onProfile(...t))},[C("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,Pt)],8,At)]),C("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:t[2]||(t[2]=(...t)=>e.onProfile&&e.onProfile(...t)),textContent:L(e.userInfo.display_name)},null,8,Mt)])):k("v-if",!0),C("div",Ut,["force"!==e.config.login&&e.config.meta.length&&!e.isLogin?(f(),g("div",{key:0,class:E(["wl-header",`item${e.config.meta.length}`])},[(f(!0),g(y,null,w(e.config.meta,(t=>(f(),g("div",{key:t,class:"wl-header-item"},[C("label",{for:t,textContent:L(e.locale[t]+(e.config.requiredMeta.includes(t)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,Tt),R(C("input",{id:`wl-${t}`,ref_for:!0,ref:n=>{n&&(e.inputRefs[t]=n)},"onUpdate:modelValue":n=>e.userMeta[t]=n,class:E(["wl-input",`wl-${t}`]),name:t,type:"mail"===t?"email":"text"},null,10,Nt),[[O,e.userMeta[t]]])])))),128))],2)):k("v-if",!0),R(C("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":t[3]||(t[3]=t=>e.editor=t),class:"wl-editor",placeholder:e.replyUser?`@${e.replyUser}`:e.locale.placeholder,onKeydown:t[4]||(t[4]=(...t)=>e.onKeyDown&&e.onKeyDown(...t)),onDrop:t[5]||(t[5]=(...t)=>e.onDrop&&e.onDrop(...t)),onPaste:t[6]||(t[6]=(...t)=>e.onPaste&&e.onPaste(...t))},null,40,Ht),[[z,e.editor]]),R(C("div",Vt,[Ft,C("h4",null,L(e.locale.preview)+":",1),k(" eslint-disable-next-line vue/no-v-html "),C("div",{class:"wl-content",innerHTML:e.previewText},null,8,_t)],512),[[A,e.showPreview]]),C("div",Bt,[C("div",Dt,[C("a",Wt,[S(r)]),R(C("button",{ref:"emojiButtonRef",class:E(["wl-action",{actived:e.showEmoji}]),title:e.locale.emoji,onClick:t[7]||(t[7]=t=>e.showEmoji=!e.showEmoji)},[S(s)],10,Gt),[[A,e.emoji.tabs.length]]),e.config.search?(f(),g("button",{key:0,ref:"gifButtonRef",class:E(["wl-action",{actived:e.showGif}]),title:e.locale.gif,onClick:t[8]||(t[8]=t=>e.showGif=!e.showGif)},[S(c)],10,qt)):k("v-if",!0),C("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:t[9]||(t[9]=(...t)=>e.onChange&&e.onChange(...t))},null,544),e.canUploadImage?(f(),g("label",{key:1,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[S(u)],8,Jt)):k("v-if",!0),C("button",{class:E(["wl-action",{actived:e.showPreview}]),title:e.locale.preview,onClick:t[10]||(t[10]=t=>e.showPreview=!e.showPreview)},[S(m)],10,Kt)]),C("div",Qt,[C("div",Yt,[P(L(e.wordNumber)+" ",1),e.config.wordLimit?(f(),g("span",Zt,[Xt,C("span",{class:E({illegal:!e.isWordNumberLegal}),textContent:L(e.wordLimit)},null,10,en)])):k("v-if",!0),P("  "+L(e.locale.word),1)]),"disable"===e.config.login||e.isLogin?k("v-if",!0):(f(),g("button",{key:0,class:"wl-btn",onClick:t[11]||(t[11]=(...t)=>e.onLogin&&e.onLogin(...t)),textContent:L(e.locale.login)},null,8,tn)),"force"!==e.config.login||e.isLogin?(f(),g("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:t[12]||(t[12]=(...t)=>e.submitComment&&e.submitComment(...t))},[e.isSubmitting?(f(),b(d,{key:0,size:16})):(f(),g(y,{key:1},[P(L(e.locale.submit),1)],64))],8,nn)):k("v-if",!0)]),C("div",{ref:"gifPopupRef",class:E(["wl-gif-popup",{display:e.showGif}])},[C("input",{ref:"gifSearchInputRef",type:"text",placeholder:e.locale.gifSearchPlaceholder,onInput:t[13]||(t[13]=(...t)=>e.onGifSearch&&e.onGifSearch(...t))},null,40,ln),S(p,{items:e.gifData.list,"column-width":200,gap:6,onInsert:t[14]||(t[14]=t=>e.insert(t)),onScroll:e.onImageWallScroll},null,8,["items","onScroll"]),e.gifData.loading?(f(),g("div",on,[S(d,{size:30})])):k("v-if",!0)],2),C("div",{ref:"emojiPopupRef",class:E(["wl-emoji-popup",{display:e.showEmoji}])},[(f(!0),g(y,null,w(e.emoji.tabs,((t,n)=>(f(),g(y,{key:t.name},[n===e.emojiTabIndex?(f(),g("div",an,[(f(!0),g(y,null,w(t.items,(t=>(f(),g("button",{key:t,title:t,onClick:n=>e.insert(`:${t}:`)},[e.showEmoji?(f(),g("img",{key:0,class:"wl-emoji",src:e.emoji.map[t],alt:t,loading:"lazy",referrerPolicy:"no-referrer"},null,8,sn)):k("v-if",!0)],8,rn)))),128))])):k("v-if",!0)],64)))),128)),e.emoji.tabs.length>1?(f(),g("div",cn,[(f(!0),g(y,null,w(e.emoji.tabs,((t,n)=>(f(),g("button",{key:t.name,class:E(["wl-tab",{active:e.emojiTabIndex===n}]),onClick:t=>e.emojiTabIndex=n},[C("img",{class:"wl-emoji",src:t.icon,alt:t.name,title:t.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,mn)],10,un)))),128))])):k("v-if",!0)],2)])]),e.replyId?(f(),g("button",{key:1,class:"wl-close",title:e.locale.cancelReply,onClick:t[15]||(t[15]=t=>e.$emit("cancel-reply"))},[S(i,{size:24})],8,dn)):k("v-if",!0)])}],["__file","CommentBox.vue"]]);const vn=["approved","waiting","spam"];var fn=d({components:{CommentBox:pn,DeleteIcon:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},m("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),LikeIcon:({active:e=!1})=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[m("path",{d:"M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z"+(e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"),fill:e?"red":"currentColor"})]),ReplyIcon:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},m("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),VerifiedIcon:()=>m("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},m("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"}))},props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object,default:null}},emits:["submit","reply","like","delete","status","sticky"],setup(e){const t=$("config"),n=St(),l=xt(),o=I((()=>t.value.locale)),a=I((()=>{const{link:t}=e.comment;return t?at(t)?t:`https://${t}`:""})),i=I((()=>n.value.includes(e.comment.objectId))),r=((e,t)=>{const n=xe();return I((()=>mt(e,n.value,t)))})(e.comment.insertedAt,o.value),s=I((()=>"administrator"===l.value.type)),c=I((()=>e.comment.user_id&&l.value.objectId===e.comment.user_id)),u=I((()=>e.comment.objectId===e.reply?.objectId));return{config:t,locale:o,isReplyingCurrent:u,link:a,like:i,time:r,isAdmin:s,isOwner:c,commentStatus:vn}}});const gn=["id"],hn={class:"wl-user","aria-hidden":"true"},yn=["src"],wn={class:"wl-card"},bn={class:"wl-head"},kn=["href"],Cn={key:1,class:"wl-nick"},In=["textContent"],$n=["textContent"],xn=["textContent"],jn=["textContent"],Sn=["textContent"],Ln={class:"wl-comment-actions"},En=["title"],Rn=["textContent"],On=["title"],zn={class:"wl-meta","aria-hidden":"true"},An=["textContent"],Pn=["textContent"],Mn=["textContent"],Un=["innerHTML"],Tn={key:0,class:"wl-admin-actions"},Nn={class:"wl-comment-status"},Hn=["disabled","onClick","textContent"],Vn={key:1,class:"wl-reply-wrapper"},Fn={key:2,class:"wl-quote"};var _n=d({name:"WalineRoot",components:{CommentBox:pn,CommentCard:Me(fn,[["render",function(e,t,n,l,o,a){const i=v("VerifiedIcon"),r=v("DeleteIcon"),s=v("LikeIcon"),c=v("ReplyIcon"),u=v("CommentBox"),m=v("CommentCard",!0);return f(),g("div",{id:e.comment.objectId,class:"wl-item"},[C("div",hn,[e.comment.avatar?(f(),g("img",{key:0,src:e.comment.avatar},null,8,yn)):k("v-if",!0),e.comment.type?(f(),b(i,{key:1})):k("v-if",!0)]),C("div",wn,[C("div",bn,[e.link?(f(),g("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noreferrer"},L(e.comment.nick),9,kn)):(f(),g("span",Cn,L(e.comment.nick),1)),"administrator"===e.comment.type?(f(),g("span",{key:2,class:"wl-badge",textContent:L(e.locale.admin)},null,8,In)):k("v-if",!0),e.comment.label?(f(),g("span",{key:3,class:"wl-badge",textContent:L(e.comment.label)},null,8,$n)):k("v-if",!0),e.comment.sticky?(f(),g("span",{key:4,class:"wl-badge",textContent:L(e.locale.sticky)},null,8,xn)):k("v-if",!0),void 0!==e.comment.level&&e.comment.level>=0?(f(),g("span",{key:5,class:E(`wl-badge level${e.comment.level}`),textContent:L(e.locale[`level${e.comment.level}`]||`Level ${e.comment.level}`)},null,10,jn)):k("v-if",!0),C("span",{class:"wl-time",textContent:L(e.time)},null,8,Sn),C("div",Ln,[e.isAdmin||e.isOwner?(f(),g("button",{key:0,class:"wl-delete",onClick:t[0]||(t[0]=t=>e.$emit("delete",e.comment))},[S(r)])):k("v-if",!0),C("button",{class:"wl-like",title:e.like?e.locale.cancelLike:e.locale.like,onClick:t[1]||(t[1]=t=>e.$emit("like",e.comment))},[S(s,{active:e.like},null,8,["active"]),"like"in e.comment?(f(),g("span",{key:0,textContent:L(e.comment.like)},null,8,Rn)):k("v-if",!0)],8,En),C("button",{class:E(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:t[2]||(t[2]=t=>e.$emit("reply",e.isReplyingCurrent?null:e.comment))},[S(c)],10,On)])]),C("div",zn,[e.comment.addr?(f(),g("span",{key:0,textContent:L(e.comment.addr)},null,8,An)):k("v-if",!0),e.comment.browser?(f(),g("span",{key:1,textContent:L(e.comment.browser)},null,8,Pn)):k("v-if",!0),e.comment.os?(f(),g("span",{key:2,textContent:L(e.comment.os)},null,8,Mn)):k("v-if",!0)]),k(" eslint-disable-next-line vue/no-v-html "),C("div",{class:"wl-content",innerHTML:e.comment.comment},null,8,Un),e.isAdmin?(f(),g("div",Tn,[C("span",Nn,[(f(!0),g(y,null,w(e.commentStatus,(t=>(f(),g("button",{key:t,class:E(`wl-btn wl-${t}`),disabled:e.comment.status===t,onClick:n=>e.$emit("status",{status:t,comment:e.comment}),textContent:L(e.locale[t])},null,10,Hn)))),128))]),e.isAdmin&&!e.comment.rid?(f(),g("button",{key:0,class:"wl-btn wl-sticky",onClick:t[3]||(t[3]=t=>e.$emit("sticky",e.comment))},L(e.comment.sticky?e.locale.unsticky:e.locale.sticky),1)):k("v-if",!0)])):k("v-if",!0),e.isReplyingCurrent?(f(),g("div",Vn,[S(u,{"reply-id":e.comment.objectId,"reply-user":e.comment.nick,"root-id":e.rootId,onSubmit:t[4]||(t[4]=t=>e.$emit("submit",t)),onCancelReply:t[5]||(t[5]=t=>e.$emit("reply",null))},null,8,["reply-id","reply-user","root-id"])])):k("v-if",!0),e.comment.children?(f(),g("div",Fn,[(f(!0),g(y,null,w(e.comment.children,(n=>(f(),b(m,{key:n.objectId,comment:n,reply:e.reply,"root-id":e.rootId,onReply:t[6]||(t[6]=t=>e.$emit("reply",t)),onSubmit:t[7]||(t[7]=t=>e.$emit("submit",t)),onLike:t[8]||(t[8]=t=>e.$emit("like",t)),onDelete:t[9]||(t[9]=t=>e.$emit("delete",t)),onStatus:t[10]||(t[10]=t=>e.$emit("status",t)),onSticky:t[11]||(t[11]=t=>e.$emit("sticky",t))},null,8,["comment","reply","root-id"])))),128))])):k("v-if",!0)])],8,gn)}],["__file","CommentCard.vue"]]),LoadingIcon:Ae},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright"],setup(e){const t=I((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:l,emoji:o=["//unpkg.com/@waline/emojis@1.1.0/weibo"],meta:a=["nick","mail","link"],requiredMeta:i=[],dark:r=!1,pageSize:s=10,wordLimit:c,imageUploader:u,highlighter:m,texRenderer:d,copyright:p=!0,login:v="enable",search:f=Be(),...g})=>({serverURL:it(e),path:lt(t),locale:{...nt[n]||nt["zh-CN"],..."object"==typeof l?l:{}},wordLimit:rt(c),meta:Ve(a),requiredMeta:Ve(i),imageUploader:st(u,Fe),highlighter:st(m,qe),texRenderer:st(d,_e),lang:n,dark:r,emoji:o,pageSize:s,login:v,copyright:p,search:f,...g}))(e))),n=xt(),o=St(),a=i("loading"),r=i(0),c=i(1),u=i(0),m=i([]),d=i(null),p=I((()=>{return"string"==typeof(e=t.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${ct}}`:`${e}${ct}`:!0===e?`:root${ct}`:"";var e}));let v;Se(p);const f=e=>{const{serverURL:l,path:o,pageSize:i}=t.value,s=new AbortController;a.value="loading",v?.(),ft({serverURL:l,lang:t.value.lang,path:o,pageSize:i,page:e,signal:s.signal,token:n.value?.token}).then((t=>{a.value="success",r.value=t.count,m.value.push(...t.data),c.value=e,u.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),a.value="error")})),v=s.abort.bind(s)},g=()=>{r.value=0,m.value=[],f(1)};return M("config",t),s((()=>e.path),g),l((()=>g())),{config:t,darkmodeStyle:p,i18n:I((()=>t.value.locale)),status:a,count:r,page:c,totalPages:u,data:m,reply:d,loadMore:()=>f(c.value+1),refresh:g,onReply:e=>{d.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)},onStatusChange:async({comment:e,status:l})=>{if(e.status===l)return;const{serverURL:o,lang:a}=t.value;await gt({serverURL:o,lang:a,token:n.value?.token,objectId:e.objectId,status:l}),e.status=l},onDelete:async({objectId:e})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:l,lang:o}=t.value;await(({serverURL:e,lang:t,token:n,objectId:l})=>fetch(`${e}/comment/${l}?lang=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${n}`}}).then((e=>e.json())))({serverURL:l,lang:o,token:n.value?.token,objectId:e}),m.value.some(((t,n)=>t.objectId===e?(m.value=m.value.filter(((e,t)=>t!==n)),!0):t.children.some(((l,o)=>l.objectId===e&&(m.value[n].children=t.children.filter(((e,t)=>t!==o)),!0)))))},onSticky:async e=>{if(e.rid)return;const{serverURL:l,lang:o}=t.value;await gt({serverURL:l,lang:o,token:n.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},onLike:async e=>{const{serverURL:n,lang:l}=t.value,{objectId:a}=e,i=o.value.includes(a);await(({serverURL:e,lang:t,objectId:n,like:l})=>fetch(`${e}/comment/${n}?lang=${t}`,{method:"PUT",headers:vt,body:JSON.stringify({like:l})}).then((e=>e.json())))({serverURL:n,lang:l,objectId:a,like:!i}),i?o.value=o.value.filter((e=>e!==a)):(o.value=[...o.value,a],o.value.length>50&&(o.value=o.value.slice(-50))),e.like=(e.like||0)+(i?-1:1)},version:"2.6.4"}}});const Bn={"data-waline":""},Dn={class:"wl-count"},Wn=["textContent"],Gn={class:"wl-cards"},qn={key:1,class:"wl-operation"},Jn=["textContent"],Kn={key:0,class:"wl-loading"},Qn=["textContent"],Yn={class:"wl-operation"},Zn=["textContent"],Xn={key:3,class:"wl-power"},el=P(" Powered by "),tl=C("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);var nl=Me(_n,[["render",function(e,t,n,l,o,a){const i=v("CommentBox"),r=v("CommentCard"),s=v("LoadingIcon");return f(),g("div",Bn,[e.reply?k("v-if",!0):(f(),b(i,{key:0,onSubmit:e.onSubmit},null,8,["onSubmit"])),C("div",Dn,[e.count?(f(),g("span",{key:0,class:"wl-num",textContent:L(e.count)},null,8,Wn)):k("v-if",!0),P(" "+L(e.i18n.comment),1)]),C("div",Gn,[(f(!0),g(y,null,w(e.data,(t=>(f(),b(r,{key:t.objectId,"root-id":t.objectId,comment:t,reply:e.reply,onReply:e.onReply,onSubmit:e.onSubmit,onStatus:e.onStatusChange,onDelete:e.onDelete,onSticky:e.onSticky,onLike:e.onLike},null,8,["root-id","comment","reply","onReply","onSubmit","onStatus","onDelete","onSticky","onLike"])))),128))]),"error"===e.status?(f(),g("div",qn,[C("button",{type:"button",class:"wl-btn",onClick:t[0]||(t[0]=(...t)=>e.refresh&&e.refresh(...t)),textContent:L(e.i18n.refresh)},null,8,Jn)])):(f(),g(y,{key:2},["loading"===e.status?(f(),g("div",Kn,[S(s,{size:30})])):e.data.length?e.page<e.totalPages?(f(),g(y,{key:2},[k(" Load more button "),C("div",Yn,[C("button",{type:"button",class:"wl-btn",onClick:t[1]||(t[1]=(...t)=>e.loadMore&&e.loadMore(...t)),textContent:L(e.i18n.more)},null,8,Zn)])],2112)):k("v-if",!0):(f(),g("div",{key:1,class:"wl-empty",textContent:L(e.i18n.sofa)},null,8,Qn))],64)),k(" Copyright Information "),e.config.copyright?(f(),g("div",Xn,[el,tl,P(" v"+L(e.version),1)])):k("v-if",!0)])}],["__file","Waline.vue"]]);const ll="2.6.4";export{nl as Waline,ll as version};
import{getCurrentScope as e,onScopeDispose as t,getCurrentInstance as n,onMounted as l,nextTick as o,unref as a,ref as i,isRef as r,watch as s,readonly as c,shallowRef as u,h as m,defineComponent as d,onBeforeUnmount as v,resolveComponent as p,openBlock as f,createElementBlock as g,normalizeStyle as h,Fragment as y,renderList as w,createBlock as b,createCommentVNode as k,createElementVNode as C,computed as I,inject as $,reactive as x,onUnmounted as S,createVNode as j,toDisplayString as L,normalizeClass as E,withDirectives as R,vModelDynamic as O,vModelText as A,vShow as z,createTextVNode as M,provide as P}from"vue";import U from"autosize";import{marked as T}from"marked";var N;const B="undefined"!=typeof window,H=()=>{};function _(e){return"function"==typeof e?e():a(e)}function V(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}B&&(null==(N=null==window?void 0:window.navigator)?void 0:N.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const F=e=>e();function D(n){return!!e()&&(t(n),!0)}function W(e,t=200,n={}){return V(function(e,t={}){let n,l;return o=>{const a=_(e),i=_(t.maxWait);if(n&&clearTimeout(n),a<=0||void 0!==i&&i<=0)return l&&(clearTimeout(l),l=null),o();i&&!l&&(l=setTimeout((()=>{n&&clearTimeout(n),l=null,o()}),i)),n=setTimeout((()=>{l&&clearTimeout(l),l=null,o()}),a)}}(t,n),e)}var G=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;function K(e,t,n={}){const l=n,{eventFilter:o=F}=l,a=((e,t)=>{var n={};for(var l in e)q.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&G)for(var l of G(e))t.indexOf(l)<0&&J.call(e,l)&&(n[l]=e[l]);return n})(l,["eventFilter"]);return s(e,V(o,t),a)}var Q=Object.defineProperty,Y=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,ne=(e,t,n)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function le(e,t,n={}){const l=n,{eventFilter:o}=l,a=((e,t)=>{var n={};for(var l in e)ee.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&X)for(var l of X(e))t.indexOf(l)<0&&te.call(e,l)&&(n[l]=e[l]);return n})(l,["eventFilter"]),{eventFilter:r,pause:s,resume:c,isActive:u}=function(e=F){const t=i(!0);return{isActive:t,pause:function(){t.value=!1},resume:function(){t.value=!0},eventFilter:(...n)=>{t.value&&e(...n)}}}(o),m=K(e,t,(d=((e,t)=>{for(var n in t||(t={}))ee.call(t,n)&&ne(e,n,t[n]);if(X)for(var n of X(t))te.call(t,n)&&ne(e,n,t[n]);return e})({},a),Y(d,Z({eventFilter:r}))));var d;return{stop:m,pause:s,resume:c,isActive:u}}const oe=B?window:void 0,ae=B?window.document:void 0;function ie(...e){let t,n,l,o;if("string"==typeof e[0]?([n,l,o]=e,t=oe):[t,n,l,o]=e,!t)return H;let a=H;const i=s((()=>function(e){var t;const n=_(e);return null!=(t=null==n?void 0:n.$el)?t:n}(t)),(e=>{a(),e&&(e.addEventListener(n,l,o),a=()=>{e.removeEventListener(n,l,o),a=H})}),{immediate:!0,flush:"post"}),r=()=>{i(),a()};return D(r),r}B&&window.navigator,B&&window.location;const re="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},se="__vueuse_ssr_handlers__";re[se]=re[se]||{};const ce=re[se];var ue=Object.defineProperty,me=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,pe=(e,t,n)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fe=(e,t)=>{for(var n in t||(t={}))de.call(t,n)&&pe(e,n,t[n]);if(me)for(var n of me(t))ve.call(t,n)&&pe(e,n,t[n]);return e};const ge={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 he(e,t,n,l={}){var o;const{flush:a="pre",deep:r=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:m=!1,shallow:d,window:v=oe,eventFilter:p,onError:f=(e=>{console.error(e)})}=l,g=(d?u:i)(t);if(!n)try{n=function(e,t){return ce[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=oe)?void 0:e.localStorage}))()}catch(e){f(e)}if(!n)return g;const h=_(t),y=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),w=null!=(o=l.serializer)?o:ge[y],{pause:b,resume:k}=le(g,(()=>function(t){try{null==t?n.removeItem(e):n.setItem(e,w.write(t))}catch(e){f(e)}}(g.value)),{flush:a,deep:r,eventFilter:p});return v&&s&&ie(v,"storage",C),C(),g;function C(t){t&&t.key!==e||(g.value=function(t){if(!t||t.key===e){b();try{const l=t?t.newValue:n.getItem(e);if(null==l)return c&&null!==h&&n.setItem(e,w.write(h)),h;if(!t&&m){const e=w.read(l);return"function"==typeof m?m(e,h):"object"!==y||Array.isArray(e)?e:fe(fe({},h),e)}return"string"!=typeof l?l:w.read(l)}catch(e){f(e)}finally{k()}}}(t))}}var ye,we,be=Object.defineProperty,ke=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,$e=(e,t,n)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function xe(e={}){const{controls:t=!1,interval:n="requestAnimationFrame"}=e,l=i(new Date),o=()=>l.value=new Date,c="requestAnimationFrame"===n?function(e,t={}){const{immediate:n=!0,window:l=oe}=t,o=i(!1);let a=null;function r(){o.value&&l&&(e(),a=l.requestAnimationFrame(r))}function s(){!o.value&&l&&(o.value=!0,r())}function c(){o.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return n&&s(),D(c),{isActive:o,pause:c,resume:s}}(o,{immediate:!0}):function(e,t=1e3,n={}){const{immediate:l=!0,immediateCallback:o=!1}=n;let c=null;const u=i(!1);function m(){c&&(clearInterval(c),c=null)}function d(){u.value=!1,m()}function v(){a(t)<=0||(u.value=!0,o&&e(),m(),c=setInterval(e,_(t)))}l&&B&&v(),r(t)&&D(s(t,(()=>{u.value&&B&&v()})));return D(d),{isActive:u,pause:d,resume:v}}(o,n,{immediate:!0});return t?((e,t)=>{for(var n in t||(t={}))Ce.call(t,n)&&$e(e,n,t[n]);if(ke)for(var n of ke(t))Ie.call(t,n)&&$e(e,n,t[n]);return e})({now:l},c):l}(we=ye||(ye={})).UP="UP",we.RIGHT="RIGHT",we.DOWN="DOWN",we.LEFT="LEFT",we.NONE="NONE";let Se=0;function je(e,t={}){const a=i(!1),{document:r=ae,immediate:u=!0,manual:m=!1,id:d="vueuse_styletag_"+ ++Se}=t,v=i(e);let p=()=>{};const f=()=>{if(!r)return;const e=r.getElementById(d)||r.createElement("style");e.type="text/css",e.id=d,t.media&&(e.media=t.media),r.head.appendChild(e),a.value||(p=s(v,(t=>{e.innerText=t}),{immediate:!0}),a.value=!0)},g=()=>{r&&a.value&&(p(),r.head.removeChild(r.getElementById(d)),a.value=!1)};return u&&!m&&function(e,t=!0){n()?l(e):t?e():o(e)}(f),m||D(g),{id:d,css:v,unload:g,load:f,isLoaded:c(a)}}var Le=Object.defineProperty,Ee=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,Ae=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))Re.call(t,n)&&Ae(e,n,t[n]);if(Ee)for(var n of Ee(t))Oe.call(t,n)&&Ae(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const ze=({size:e})=>m("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},m("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},m("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Me=d({name:"ImageWall",components:{LoadingIcon:ze},props:{items:{type:Array,default:()=>[]},columnWidth:{type:Number,default:300},gap:{type:Number,default:0}},emits:["insert"],setup(e){let t=null;const n=i(null),a=i({}),r=i([]),c=()=>{const t=Math.floor((n.value.getBoundingClientRect().width+e.gap)/(e.columnWidth+e.gap));return t>0?t:1},u=async t=>{if(t>=e.items.length)return;await o();const l=Array.from(n.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));r.value[Number(l.dataset.index)].push(t),await u(t+1)},m=async(e=!1)=>{if(r.value.length===c()&&!e)return;var t;r.value=(t=c(),new Array(t).fill(null).map((()=>[])));const n=window.scrollY;await u(0),window.scrollTo({top:n})};return s((()=>[e.items]),(()=>{a.value={},m(!0)})),s((()=>[e.columnWidth,e.gap]),(()=>m())),l((()=>{m(!0),t=new ResizeObserver((()=>m())),t.observe(n.value)})),v((()=>t.unobserve(n.value))),{columns:r,state:a,wall:n}}}),Pe=(e,t)=>{const n=e.__vccOpts||e;for(const[e,l]of t)n[e]=l;return n};const Ue=["data-index"],Te=["src","title","onLoad","onClick"];var Ne=Pe(Me,[["render",function(e,t,n,l,o,a){const i=p("LoadingIcon");return f(),g("div",{ref:"wall",class:"wl-gallery",style:h({gap:`${e.gap}px`})},[(f(!0),g(y,null,w(e.columns,((t,n)=>(f(),g("div",{key:n,class:"wl-gallery-column","data-index":n,style:h({gap:`${e.gap}px`})},[(f(!0),g(y,null,w(t,(t=>(f(),g(y,{key:t},[e.state[e.items[t].src]?k("v-if",!0):(f(),b(i,{key:0,size:36,style:{margin:"20px auto"}})),C("img",{class:"wl-gallery-item",src:e.items[t].src,title:e.items[t].title,loading:"lazy",onLoad:n=>e.state[e.items[t].src]=!0,onClick:n=>e.$emit("insert",`![](${e.items[t].src})`)},null,40,Te)],64)))),128))],12,Ue)))),128))],4)}],["__file","ImageWall.vue"]]);const Be=["nick","mail","link"],He=e=>e.filter((e=>Be.includes(e))),_e=e=>new Promise(((t,n)=>{if(e.size>128e3)return n(new Error("File too large! File size limit 128KB"));const l=new FileReader;l.readAsDataURL(e),l.onload=()=>t(l.result?.toString()||""),l.onerror=n})),Ve=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>',Fe=()=>{const e={next:""},t=({keyword:e,pos:t})=>{const n=new URLSearchParams("media_filter=minimal");return n.set("key","PAY5JLFIH6V6"),n.set("limit","20"),n.set("pos",t||""),n.set("q",e),fetch(`https://g.tenor.com/v1/search?${n.toString()}`,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())).catch((()=>({next:t||"",results:[]})))};return{search:(n="")=>t({keyword:n}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url})))))),more:n=>t({keyword:n,pos:e.next}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url}))))))}},De=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"),We=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],Ge={},qe=e=>{let t=0;return e.replace(De,((e,n,l)=>{if(l)return`<span style="color: slategray">${l}</span>`;if("<"===n)return"&lt;";let o;Ge[n]?o=Ge[n]:(o=We[t],Ge[n]=o);const a=`<span style="color: #${o}">${n}</span>`;return t=++t%We.length,a}))},Je=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest"],Ke=e=>Object.fromEntries(e.map(((e,t)=>[Je[t],e])));var Qe=Ke(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words","Please input comments between $0 and $1 words!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest"]),Ye=Ke(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順"]),Ze=Ke(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度"]),Xe=Ke(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂","按倒序","按正序","按熱度"]),et=Ke(["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","Like","Cancel like","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","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente"]),tt=Ke(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий"]);const nt={zh:Ze,"zh-cn":Ze,"zh-CN":Ze,"zh-tw":Xe,"zh-TW":Xe,en:Qe,"en-US":Qe,"en-us":Qe,jp:Ye,"jp-jp":Ye,"jp-JP":Ye,"pt-br":et,"pt-BR":et,ru:tt,"ru-ru":tt,"ru-RU":tt},lt=e=>{try{e=decodeURI(e)}catch(e){}return e},ot=(e="")=>e.replace(/\/$/u,""),at=e=>/^(https?:)?\/\//.test(e),it=e=>{const t=ot(e);return at(t)?t:`https://${t}`},rt=e=>Array.isArray(e)?e:!!e&&[0,e],st=(e,t)=>"function"==typeof e?e:!1!==e&&t,ct="{--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}",ut=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},mt=(e,t,n)=>{if(!e)return"";const l="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,o=t.getTime()-l.getTime(),a=Math.floor(o/864e5);if(0===a){const e=o%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,l=Math.floor(t/6e4);if(0===l){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${l} ${n.minutes}`}return`${t} ${n.hours}`}return a<0?n.now:a<8?`${a} ${n.days}`:(e=>{const t=ut(e.getDate(),2),n=ut(e.getMonth()+1,2);return`${ut(e.getFullYear(),2)}-${n}-${t}`})(l)},dt=e=>{const t=he("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((l=>{const o={folder:e,...l};return n&&(t.value[e]=o),o}))},vt=(e,t="",n="",l="")=>`${t?`${t}/`:""}${n}${e}${l?`.${l}`:""}`,pt={"Content-Type":"application/json"},ft=({serverURL:e,lang:t,path:n,page:l,pageSize:o,sortBy:a,signal:i,token:r})=>{const s={};return r&&(s.Authorization=`Bearer ${r}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${o}&page=${l}&lang=${t}&sortBy=${a}`,{signal:i,headers:s}).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")))},gt=({serverURL:e,lang:t,token:n,objectId:l,...o})=>fetch(`${e}/comment/${l}?lang=${t}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(o)}).then((e=>e.json())),ht=e=>e.type.includes("image"),yt=e=>{const t=Array.from(e).find(ht);return t?t.getAsFile():null},wt=/\$.*?\$/,bt=/^\$(.*?)\$/,kt=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Ct=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),It=(e,{emojiMap:t,highlighter:n,texRenderer:l})=>{if(T.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),l){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=kt.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(wt);return-1!==t?t:e.length},tokenizer(t){const n=bt.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(l);T.use({extensions:e})}return T.parse(Ct(e,t))};let $t=null;const xt=()=>$t||($t=he("WALINE_USER",{}));let St=null;const jt=()=>St||(St=he("WALINE_LIKE",[]));var Lt=d({name:"CommentBox",components:{CloseIcon:({size:e})=>m("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[m("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"}),m("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:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},m("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:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[m("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"}),m("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"})]),ImageWall:Ne,MarkdownIcon:()=>m("svg",{width:"16",height:"16",ariaHidden:"true"},m("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:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[m("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"}),m("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:ze,GifIcon:()=>m("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[m("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),m("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})])},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(e,{emit:t}){const n=$("config"),o=he("WALINE_COMMENT_BOX_EDITOR",""),a=he("WALINE_USER_META",{nick:"",mail:"",link:""}),r=xt(),c=i({}),u=i(null),m=i(null),d=i(null),v=i(null),p=i(null),f=i(null),g=i(null),h=i({tabs:[],map:{}}),y=i(0),w=i(!1),b=i(!1),k=i(!1),C=i(""),j=i(0),L=x({loading:!0,list:[]}),E=i(0),R=i(!1),O=i(""),A=i(!1),z=I((()=>n.value.locale)),M=I((()=>Boolean(r.value?.token))),P=I((()=>!1!==n.value.imageUploader)),T=e=>{const t=u.value,n=t.selectionStart,l=t.selectionEnd||0,a=t.scrollTop;o.value=t.value.substring(0,n)+e+t.value.substring(l,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=a},N=e=>{const t=`![${n.value.locale.uploading} ${e.name}]()`;return T(t),Promise.resolve().then((()=>n.value.imageUploader(e))).then((n=>{o.value=o.value.replace(t,`\r\n![${e.name}](${n})`)})).catch((e=>{alert(e.message),o.value=o.value.replace(t,"")}))},B=()=>{const{serverURL:l,lang:i,login:s,wordLimit:m,requiredMeta:d}=n.value,v={comment:O.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:n.value.path};if(r.value?.token)v.nick=r.value.display_name,v.mail=r.value.email,v.link=r.value.url;else{if("force"===s)return;if(d.indexOf("nick")>-1&&!v.nick)return c.value.nick?.focus(),alert(z.value.nickError);if(d.indexOf("mail")>-1&&!v.mail||v.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(v.mail))return c.value.mail?.focus(),alert(z.value.mailError);if(!v.comment)return void u.value?.focus();v.nick||(v.nick=z.value.anonymous)}if(!R.value)return alert(z.value.wordHint.replace("$0",m[0].toString()).replace("$1",m[1].toString()).replace("$2",j.value.toString()));v.comment=Ct(v.comment,h.value.map),e.replyId&&e.rootId&&(v.pid=e.replyId,v.rid=e.rootId,v.at=e.replyUser),A.value=!0,(({serverURL:e,lang:t,token:n,comment:l})=>{const o={"Content-Type":"application/json"};return n&&(o.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:o,body:JSON.stringify(l)}).then((e=>e.json()))})({serverURL:l,lang:i,token:r.value?.token,comment:v}).then((n=>{if(A.value=!1,n.errmsg)return alert(n.errmsg);t("submit",n.data),o.value="",C.value="",e.replyId&&t("cancel-reply")})).catch((e=>{A.value=!1,alert(e.message)}))},H=e=>{d.value.contains(e.target)||v.value.contains(e.target)||(w.value=!1),p.value.contains(e.target)||f.value.contains(e.target)||(b.value=!1)},_=async e=>{const{scrollTop:t,clientHeight:l,scrollHeight:o}=e.target,a=(l+t)/o,i=n.value.search,r=g.value?.value||"";a<.9||L.loading||(L.loading=!0,L.list.push(...i.more?await i.more(r,L.list.length):await i.search(r)),L.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},V=W((e=>{L.list=[],_(e)}),300);s([n,j],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(E.value=n[0],R.value=!1):t>n[1]?(E.value=n[1],R.value=!1):(E.value=n[1],R.value=!0):(E.value=0,R.value=!0)}),{immediate:!0}),s(b,(async e=>{if(!e)return;const t=n.value.search;g.value&&(g.value.value=""),L.loading=!0,L.list=t.default?await t.default():await t.search(""),L.loading=!1}));const F=({data:e})=>{e&&"profile"===e.type&&(r.value={...r.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(r)))))};return l((()=>{document.body.addEventListener("click",H),window.addEventListener("message",F),s((()=>o.value),(e=>{const{highlighter:t,texRenderer:l}=n.value;O.value=e,C.value=It(e,{emojiMap:h.value.map,highlighter:t,texRenderer:l}),j.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?U(u.value):U.destroy(u.value)}),{immediate:!0}),s((()=>n.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?dt(ot(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:l,icon:o,prefix:a,type:i,items:r}=e;t.tabs.push({name:n,icon:vt(o,l,a,i),items:r.map((e=>{const n=`${a||""}${e}`;return t.map[n]=vt(e,l,a,i),n}))})})),t}))).then((e=>{h.value=e}));var t}),{immediate:!0})})),S((()=>{document.body.removeEventListener("click",H),window.removeEventListener("message",F)})),{config:n,locale:z,insert:T,onChange:()=>{const e=m.value;e.files&&P.value&&N(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{if(e.dataTransfer?.items){const t=yt(e.dataTransfer.items);t&&P.value&&(N(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&B()},onPaste:e=>{if(e.clipboardData){const t=yt(e.clipboardData.items);t&&P.value&&N(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:l}=n.value,o=(window.innerWidth-450)/2,a=(window.innerHeight-450)/2,i=window.open(`${l}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${o},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);i?.postMessage({type:"TOKEN",data:null},"*");const s=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(i?.close(),r.value=e.data,(e.data.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e.data)),window.removeEventListener("message",s))};window.addEventListener("message",s)},onLogout:()=>{r.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:l}=n.value,o=(window.innerWidth-800)/2,a=(window.innerHeight-800)/2;window.open(`${l}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${o},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`)?.postMessage({type:"TOKEN",data:r.value.token},"*")},submitComment:B,onImageWallScroll:_,onGifSearch:V,isLogin:M,userInfo:r,isSubmitting:A,wordNumber:j,wordLimit:E,isWordNumberLegal:R,editor:o,userMeta:a,emoji:h,emojiTabIndex:y,showEmoji:w,gifData:L,showGif:b,canUploadImage:P,previewText:C,showPreview:k,inputRefs:c,editorRef:u,emojiButtonRef:d,emojiPopupRef:v,gifButtonRef:p,gifPopupRef:f,imageUploadRef:m,gifSearchInputRef:g}}});const Et={class:"wl-comment"},Rt={key:0,class:"wl-login-info"},Ot={class:"wl-avatar"},At=["title"],zt=["title"],Mt=["src"],Pt=["title","textContent"],Ut={class:"wl-panel"},Tt=["for","textContent"],Nt=["id","onUpdate:modelValue","name","type"],Bt=["placeholder"],Ht={class:"wl-preview"},_t=C("hr",null,null,-1),Vt=["innerHTML"],Ft={class:"wl-footer"},Dt={class:"wl-actions"},Wt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},Gt=["title"],qt=["title"],Jt=["title"],Kt=["title"],Qt={class:"wl-info"},Yt={class:"wl-text-number"},Zt={key:0},Xt=M("  /  "),en=["textContent"],tn=["textContent"],nn=["disabled"],ln=["placeholder"],on={key:0,class:"wl-loading"},an={key:0,class:"wl-tab-wrapper"},rn=["title","onClick"],sn=["src","alt"],cn={key:0,class:"wl-tabs"},un=["onClick"],mn=["src","alt","title"],dn=["title"];var vn=Pe(Lt,[["render",function(e,t,n,l,o,a){const i=p("CloseIcon"),r=p("MarkdownIcon"),s=p("EmojiIcon"),c=p("GifIcon"),u=p("ImageIcon"),m=p("PreviewIcon"),d=p("LoadingIcon"),v=p("ImageWall");return f(),g("div",Et,["disable"!==e.config.login&&e.isLogin?(f(),g("div",Rt,[C("div",Ot,[C("button",{class:"wl-logout-btn",title:e.locale.logout,onClick:t[0]||(t[0]=(...t)=>e.onLogout&&e.onLogout(...t))},[j(i,{size:14})],8,At),C("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:t[1]||(t[1]=(...t)=>e.onProfile&&e.onProfile(...t))},[C("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,Mt)],8,zt)]),C("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:t[2]||(t[2]=(...t)=>e.onProfile&&e.onProfile(...t)),textContent:L(e.userInfo.display_name)},null,8,Pt)])):k("v-if",!0),C("div",Ut,["force"!==e.config.login&&e.config.meta.length&&!e.isLogin?(f(),g("div",{key:0,class:E(["wl-header",`item${e.config.meta.length}`])},[(f(!0),g(y,null,w(e.config.meta,(t=>(f(),g("div",{key:t,class:"wl-header-item"},[C("label",{for:t,textContent:L(e.locale[t]+(e.config.requiredMeta.includes(t)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,Tt),R(C("input",{id:`wl-${t}`,ref_for:!0,ref:n=>{n&&(e.inputRefs[t]=n)},"onUpdate:modelValue":n=>e.userMeta[t]=n,class:E(["wl-input",`wl-${t}`]),name:t,type:"mail"===t?"email":"text"},null,10,Nt),[[O,e.userMeta[t]]])])))),128))],2)):k("v-if",!0),R(C("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":t[3]||(t[3]=t=>e.editor=t),class:"wl-editor",placeholder:e.replyUser?`@${e.replyUser}`:e.locale.placeholder,onKeydown:t[4]||(t[4]=(...t)=>e.onKeyDown&&e.onKeyDown(...t)),onDrop:t[5]||(t[5]=(...t)=>e.onDrop&&e.onDrop(...t)),onPaste:t[6]||(t[6]=(...t)=>e.onPaste&&e.onPaste(...t))},null,40,Bt),[[A,e.editor]]),R(C("div",Ht,[_t,C("h4",null,L(e.locale.preview)+":",1),k(" eslint-disable-next-line vue/no-v-html "),C("div",{class:"wl-content",innerHTML:e.previewText},null,8,Vt)],512),[[z,e.showPreview]]),C("div",Ft,[C("div",Dt,[C("a",Wt,[j(r)]),R(C("button",{ref:"emojiButtonRef",class:E(["wl-action",{actived:e.showEmoji}]),title:e.locale.emoji,onClick:t[7]||(t[7]=t=>e.showEmoji=!e.showEmoji)},[j(s)],10,Gt),[[z,e.emoji.tabs.length]]),e.config.search?(f(),g("button",{key:0,ref:"gifButtonRef",class:E(["wl-action",{actived:e.showGif}]),title:e.locale.gif,onClick:t[8]||(t[8]=t=>e.showGif=!e.showGif)},[j(c)],10,qt)):k("v-if",!0),C("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:t[9]||(t[9]=(...t)=>e.onChange&&e.onChange(...t))},null,544),e.canUploadImage?(f(),g("label",{key:1,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[j(u)],8,Jt)):k("v-if",!0),C("button",{class:E(["wl-action",{actived:e.showPreview}]),title:e.locale.preview,onClick:t[10]||(t[10]=t=>e.showPreview=!e.showPreview)},[j(m)],10,Kt)]),C("div",Qt,[C("div",Yt,[M(L(e.wordNumber)+" ",1),e.config.wordLimit?(f(),g("span",Zt,[Xt,C("span",{class:E({illegal:!e.isWordNumberLegal}),textContent:L(e.wordLimit)},null,10,en)])):k("v-if",!0),M("  "+L(e.locale.word),1)]),"disable"===e.config.login||e.isLogin?k("v-if",!0):(f(),g("button",{key:0,class:"wl-btn",onClick:t[11]||(t[11]=(...t)=>e.onLogin&&e.onLogin(...t)),textContent:L(e.locale.login)},null,8,tn)),"force"!==e.config.login||e.isLogin?(f(),g("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:t[12]||(t[12]=(...t)=>e.submitComment&&e.submitComment(...t))},[e.isSubmitting?(f(),b(d,{key:0,size:16})):(f(),g(y,{key:1},[M(L(e.locale.submit),1)],64))],8,nn)):k("v-if",!0)]),C("div",{ref:"gifPopupRef",class:E(["wl-gif-popup",{display:e.showGif}])},[C("input",{ref:"gifSearchInputRef",type:"text",placeholder:e.locale.gifSearchPlaceholder,onInput:t[13]||(t[13]=(...t)=>e.onGifSearch&&e.onGifSearch(...t))},null,40,ln),j(v,{items:e.gifData.list,"column-width":200,gap:6,onInsert:t[14]||(t[14]=t=>e.insert(t)),onScroll:e.onImageWallScroll},null,8,["items","onScroll"]),e.gifData.loading?(f(),g("div",on,[j(d,{size:30})])):k("v-if",!0)],2),C("div",{ref:"emojiPopupRef",class:E(["wl-emoji-popup",{display:e.showEmoji}])},[(f(!0),g(y,null,w(e.emoji.tabs,((t,n)=>(f(),g(y,{key:t.name},[n===e.emojiTabIndex?(f(),g("div",an,[(f(!0),g(y,null,w(t.items,(t=>(f(),g("button",{key:t,title:t,onClick:n=>e.insert(`:${t}:`)},[e.showEmoji?(f(),g("img",{key:0,class:"wl-emoji",src:e.emoji.map[t],alt:t,loading:"lazy",referrerPolicy:"no-referrer"},null,8,sn)):k("v-if",!0)],8,rn)))),128))])):k("v-if",!0)],64)))),128)),e.emoji.tabs.length>1?(f(),g("div",cn,[(f(!0),g(y,null,w(e.emoji.tabs,((t,n)=>(f(),g("button",{key:t.name,class:E(["wl-tab",{active:e.emojiTabIndex===n}]),onClick:t=>e.emojiTabIndex=n},[C("img",{class:"wl-emoji",src:t.icon,alt:t.name,title:t.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,mn)],10,un)))),128))])):k("v-if",!0)],2)])]),e.replyId?(f(),g("button",{key:1,class:"wl-close",title:e.locale.cancelReply,onClick:t[15]||(t[15]=t=>e.$emit("cancel-reply"))},[j(i,{size:24})],8,dn)):k("v-if",!0)])}],["__file","CommentBox.vue"]]);const pn=["approved","waiting","spam"];var fn=d({components:{CommentBox:vn,DeleteIcon:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},m("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),LikeIcon:({active:e=!1})=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[m("path",{d:"M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z"+(e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"),fill:e?"red":"currentColor"})]),ReplyIcon:()=>m("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},m("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),VerifiedIcon:()=>m("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},m("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"}))},props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object,default:null}},emits:["submit","reply","like","delete","status","sticky"],setup(e){const t=$("config"),n=jt(),l=xt(),o=I((()=>t.value.locale)),a=I((()=>{const{link:t}=e.comment;return t?at(t)?t:`https://${t}`:""})),i=I((()=>n.value.includes(e.comment.objectId))),r=((e,t)=>{const n=xe();return I((()=>mt(e,n.value,t)))})(e.comment.insertedAt,o.value),s=I((()=>"administrator"===l.value.type)),c=I((()=>e.comment.user_id&&l.value.objectId===e.comment.user_id)),u=I((()=>e.comment.objectId===e.reply?.objectId));return{config:t,locale:o,isReplyingCurrent:u,link:a,like:i,time:r,isAdmin:s,isOwner:c,commentStatus:pn}}});const gn=["id"],hn={class:"wl-user","aria-hidden":"true"},yn=["src"],wn={class:"wl-card"},bn={class:"wl-head"},kn=["href"],Cn={key:1,class:"wl-nick"},In=["textContent"],$n=["textContent"],xn=["textContent"],Sn=["textContent"],jn=["textContent"],Ln={class:"wl-comment-actions"},En=["title"],Rn=["textContent"],On=["title"],An={class:"wl-meta","aria-hidden":"true"},zn=["textContent"],Mn=["textContent"],Pn=["textContent"],Un=["innerHTML"],Tn={key:0,class:"wl-admin-actions"},Nn={class:"wl-comment-status"},Bn=["disabled","onClick","textContent"],Hn={key:1,class:"wl-reply-wrapper"},_n={key:2,class:"wl-quote"};const Vn=[{key:"insertedAt_desc",name:"latest"},{key:"insertedAt_asc",name:"oldest"},{key:"like_desc",name:"hottest"}];var Fn=d({name:"WalineRoot",components:{CommentBox:vn,CommentCard:Pe(fn,[["render",function(e,t,n,l,o,a){const i=p("VerifiedIcon"),r=p("DeleteIcon"),s=p("LikeIcon"),c=p("ReplyIcon"),u=p("CommentBox"),m=p("CommentCard",!0);return f(),g("div",{id:e.comment.objectId,class:"wl-item"},[C("div",hn,[e.comment.avatar?(f(),g("img",{key:0,src:e.comment.avatar},null,8,yn)):k("v-if",!0),e.comment.type?(f(),b(i,{key:1})):k("v-if",!0)]),C("div",wn,[C("div",bn,[e.link?(f(),g("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noreferrer"},L(e.comment.nick),9,kn)):(f(),g("span",Cn,L(e.comment.nick),1)),"administrator"===e.comment.type?(f(),g("span",{key:2,class:"wl-badge",textContent:L(e.locale.admin)},null,8,In)):k("v-if",!0),e.comment.label?(f(),g("span",{key:3,class:"wl-badge",textContent:L(e.comment.label)},null,8,$n)):k("v-if",!0),e.comment.sticky?(f(),g("span",{key:4,class:"wl-badge",textContent:L(e.locale.sticky)},null,8,xn)):k("v-if",!0),void 0!==e.comment.level&&e.comment.level>=0?(f(),g("span",{key:5,class:E(`wl-badge level${e.comment.level}`),textContent:L(e.locale[`level${e.comment.level}`]||`Level ${e.comment.level}`)},null,10,Sn)):k("v-if",!0),C("span",{class:"wl-time",textContent:L(e.time)},null,8,jn),C("div",Ln,[e.isAdmin||e.isOwner?(f(),g("button",{key:0,class:"wl-delete",onClick:t[0]||(t[0]=t=>e.$emit("delete",e.comment))},[j(r)])):k("v-if",!0),C("button",{class:"wl-like",title:e.like?e.locale.cancelLike:e.locale.like,onClick:t[1]||(t[1]=t=>e.$emit("like",e.comment))},[j(s,{active:e.like},null,8,["active"]),"like"in e.comment?(f(),g("span",{key:0,textContent:L(e.comment.like)},null,8,Rn)):k("v-if",!0)],8,En),C("button",{class:E(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:t[2]||(t[2]=t=>e.$emit("reply",e.isReplyingCurrent?null:e.comment))},[j(c)],10,On)])]),C("div",An,[e.comment.addr?(f(),g("span",{key:0,textContent:L(e.comment.addr)},null,8,zn)):k("v-if",!0),e.comment.browser?(f(),g("span",{key:1,textContent:L(e.comment.browser)},null,8,Mn)):k("v-if",!0),e.comment.os?(f(),g("span",{key:2,textContent:L(e.comment.os)},null,8,Pn)):k("v-if",!0)]),k(" eslint-disable-next-line vue/no-v-html "),C("div",{class:"wl-content",innerHTML:e.comment.comment},null,8,Un),e.isAdmin?(f(),g("div",Tn,[C("span",Nn,[(f(!0),g(y,null,w(e.commentStatus,(t=>(f(),g("button",{key:t,class:E(`wl-btn wl-${t}`),disabled:e.comment.status===t,onClick:n=>e.$emit("status",{status:t,comment:e.comment}),textContent:L(e.locale[t])},null,10,Bn)))),128))]),e.isAdmin&&!e.comment.rid?(f(),g("button",{key:0,class:"wl-btn wl-sticky",onClick:t[3]||(t[3]=t=>e.$emit("sticky",e.comment))},L(e.comment.sticky?e.locale.unsticky:e.locale.sticky),1)):k("v-if",!0)])):k("v-if",!0),e.isReplyingCurrent?(f(),g("div",Hn,[j(u,{"reply-id":e.comment.objectId,"reply-user":e.comment.nick,"root-id":e.rootId,onSubmit:t[4]||(t[4]=t=>e.$emit("submit",t)),onCancelReply:t[5]||(t[5]=t=>e.$emit("reply",null))},null,8,["reply-id","reply-user","root-id"])])):k("v-if",!0),e.comment.children?(f(),g("div",_n,[(f(!0),g(y,null,w(e.comment.children,(n=>(f(),b(m,{key:n.objectId,comment:n,reply:e.reply,"root-id":e.rootId,onReply:t[6]||(t[6]=t=>e.$emit("reply",t)),onSubmit:t[7]||(t[7]=t=>e.$emit("submit",t)),onLike:t[8]||(t[8]=t=>e.$emit("like",t)),onDelete:t[9]||(t[9]=t=>e.$emit("delete",t)),onStatus:t[10]||(t[10]=t=>e.$emit("status",t)),onSticky:t[11]||(t[11]=t=>e.$emit("sticky",t))},null,8,["comment","reply","root-id"])))),128))])):k("v-if",!0)])],8,gn)}],["__file","CommentCard.vue"]]),LoadingIcon:ze},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright"],setup(e){const t=I((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:l,emoji:o=["//unpkg.com/@waline/emojis@1.1.0/weibo"],meta:a=["nick","mail","link"],requiredMeta:i=[],dark:r=!1,pageSize:s=10,wordLimit:c,imageUploader:u,highlighter:m,texRenderer:d,copyright:v=!0,login:p="enable",search:f=Fe(),...g})=>({serverURL:it(e),path:lt(t),locale:{...nt[n]||nt["zh-CN"],..."object"==typeof l?l:{}},wordLimit:rt(c),meta:He(a),requiredMeta:He(i),imageUploader:st(u,_e),highlighter:st(m,qe),texRenderer:st(d,Ve),lang:n,dark:r,emoji:o,pageSize:s,login:p,copyright:v,search:f,...g}))(e))),n=xt(),o=jt(),a=i("loading"),r=i(0),c=i(1),u=i(0),m=i(Vn[0].key),d=i([]),v=i(null),p=I((()=>{return"string"==typeof(e=t.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${ct}}`:`${e}${ct}`:!0===e?`:root${ct}`:"";var e}));let f;je(p);const g=e=>{const{serverURL:l,path:o,pageSize:i}=t.value,s=new AbortController;a.value="loading",f?.(),ft({serverURL:l,lang:t.value.lang,path:o,pageSize:i,sortBy:m.value,page:e,signal:s.signal,token:n.value?.token}).then((t=>{a.value="success",r.value=t.count,d.value.push(...t.data),c.value=e,u.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),a.value="error")})),f=s.abort.bind(s)},h=()=>{r.value=0,d.value=[],g(1)};return P("config",t),s((()=>e.path),h),l((()=>h())),{config:t,darkmodeStyle:p,i18n:I((()=>t.value.locale)),status:a,count:r,page:c,totalPages:u,sortBy:m,sortByItems:Vn,data:d,reply:v,loadMore:()=>g(c.value+1),refresh:h,onSortByChange:e=>{m.value!==e&&(m.value=e,h())},onReply:e=>{v.value=e},onSubmit:e=>{if(e.rid){const t=d.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else d.value.unshift(e)},onStatusChange:async({comment:e,status:l})=>{if(e.status===l)return;const{serverURL:o,lang:a}=t.value;await gt({serverURL:o,lang:a,token:n.value?.token,objectId:e.objectId,status:l}),e.status=l},onDelete:async({objectId:e})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:l,lang:o}=t.value;await(({serverURL:e,lang:t,token:n,objectId:l})=>fetch(`${e}/comment/${l}?lang=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${n}`}}).then((e=>e.json())))({serverURL:l,lang:o,token:n.value?.token,objectId:e}),d.value.some(((t,n)=>t.objectId===e?(d.value=d.value.filter(((e,t)=>t!==n)),!0):t.children.some(((l,o)=>l.objectId===e&&(d.value[n].children=t.children.filter(((e,t)=>t!==o)),!0)))))},onSticky:async e=>{if(e.rid)return;const{serverURL:l,lang:o}=t.value;await gt({serverURL:l,lang:o,token:n.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},onLike:async e=>{const{serverURL:n,lang:l}=t.value,{objectId:a}=e,i=o.value.includes(a);await(({serverURL:e,lang:t,objectId:n,like:l})=>fetch(`${e}/comment/${n}?lang=${t}`,{method:"PUT",headers:pt,body:JSON.stringify({like:l})}).then((e=>e.json())))({serverURL:n,lang:l,objectId:a,like:!i}),i?o.value=o.value.filter((e=>e!==a)):(o.value=[...o.value,a],o.value.length>50&&(o.value=o.value.slice(-50))),e.like=(e.like||0)+(i?-1:1)},version:"2.7.0"}}});const Dn={"data-waline":""},Wn={class:"wl-head"},Gn={class:"wl-count"},qn=["textContent"],Jn={class:"wl-sort"},Kn=["onClick"],Qn={class:"wl-cards"},Yn={key:1,class:"wl-operation"},Zn=["textContent"],Xn={key:0,class:"wl-loading"},el=["textContent"],tl={class:"wl-operation"},nl=["textContent"],ll={key:3,class:"wl-power"},ol=M(" Powered by "),al=C("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);var il=Pe(Fn,[["render",function(e,t,n,l,o,a){const i=p("CommentBox"),r=p("CommentCard"),s=p("LoadingIcon");return f(),g("div",Dn,[e.reply?k("v-if",!0):(f(),b(i,{key:0,onSubmit:e.onSubmit},null,8,["onSubmit"])),C("div",Wn,[C("div",Gn,[e.count?(f(),g("span",{key:0,class:"wl-num",textContent:L(e.count)},null,8,qn)):k("v-if",!0),M(" "+L(e.i18n.comment),1)]),C("ul",Jn,[(f(!0),g(y,null,w(e.sortByItems,(t=>(f(),g("li",{key:t.key,class:E([t.key===e.sortBy?"active":""]),onClick:n=>e.onSortByChange(t.key)},L(e.i18n[t.name]),11,Kn)))),128))])]),C("div",Qn,[(f(!0),g(y,null,w(e.data,(t=>(f(),b(r,{key:t.objectId,"root-id":t.objectId,comment:t,reply:e.reply,onReply:e.onReply,onSubmit:e.onSubmit,onStatus:e.onStatusChange,onDelete:e.onDelete,onSticky:e.onSticky,onLike:e.onLike},null,8,["root-id","comment","reply","onReply","onSubmit","onStatus","onDelete","onSticky","onLike"])))),128))]),"error"===e.status?(f(),g("div",Yn,[C("button",{type:"button",class:"wl-btn",onClick:t[0]||(t[0]=(...t)=>e.refresh&&e.refresh(...t)),textContent:L(e.i18n.refresh)},null,8,Zn)])):(f(),g(y,{key:2},["loading"===e.status?(f(),g("div",Xn,[j(s,{size:30})])):e.data.length?e.page<e.totalPages?(f(),g(y,{key:2},[k(" Load more button "),C("div",tl,[C("button",{type:"button",class:"wl-btn",onClick:t[1]||(t[1]=(...t)=>e.loadMore&&e.loadMore(...t)),textContent:L(e.i18n.more)},null,8,nl)])],2112)):k("v-if",!0):(f(),g("div",{key:1,class:"wl-empty",textContent:L(e.i18n.sofa)},null,8,el))],64)),k(" Copyright Information "),e.config.copyright?(f(),g("div",ll,[ol,al,M(" v"+L(e.version),1)])):k("v-if",!0)])}],["__file","Waline.vue"]]);const rl="2.7.0";export{il as Waline,rl 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,a=o(t);const r="undefined"!=typeof window,i=()=>{};function c(t){return"function"==typeof t?t():e.unref(t)}function s(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}r&&(null==(l=null==window?void 0:window.navigator)?void 0:l.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const m=e=>e();function u(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}function d(e,t=200,n={}){return s(function(e,t={}){let n,o;return l=>{const a=c(e),r=c(t.maxWait);if(n&&clearTimeout(n),a<=0||void 0!==r&&r<=0)return o&&(clearTimeout(o),o=null),l();r&&!o&&(o=setTimeout((()=>{n&&clearTimeout(n),o=null,l()}),r)),n=setTimeout((()=>{o&&clearTimeout(o),o=null,l()}),a)}}(t,n),e)}var p=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;function g(t,n,o={}){const l=o,{eventFilter:a=m}=l,r=((e,t)=>{var n={};for(var o in e)v.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&p)for(var o of p(e))t.indexOf(o)<0&&f.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]);return e.watch(t,s(a,n),r)}var h=Object.defineProperty,y=Object.defineProperties,k=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,E=(e,t,n)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function B(t,n,o={}){const l=o,{eventFilter:a}=l,r=((e,t)=>{var n={};for(var o in e)b.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&w)for(var o of w(e))t.indexOf(o)<0&&C.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:c,resume:s,isActive:u}=function(t=m){const n=e.ref(!0);return{isActive:n,pause:function(){n.value=!1},resume:function(){n.value=!0},eventFilter:(...e)=>{n.value&&t(...e)}}}(a),d=g(t,n,(p=((e,t)=>{for(var n in t||(t={}))b.call(t,n)&&E(e,n,t[n]);if(w)for(var n of w(t))C.call(t,n)&&E(e,n,t[n]);return e})({},r),y(p,k({eventFilter:i}))));var p;return{stop:d,pause:c,resume:s,isActive:u}}const N=r?window:void 0,I=r?window.document:void 0;function V(...t){let n,o,l,a;if("string"==typeof t[0]?([o,l,a]=t,n=N):[n,o,l,a]=t,!n)return i;let r=i;const s=e.watch((()=>function(e){var t;const n=c(e);return null!=(t=null==n?void 0:n.$el)?t:n}(n)),(e=>{r(),e&&(e.addEventListener(o,l,a),r=()=>{e.removeEventListener(o,l,a),r=i})}),{immediate:!0,flush:"post"}),m=()=>{s(),r()};return u(m),m}r&&window.navigator,r&&window.location;const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},$="__vueuse_ssr_handlers__";S[$]=S[$]||{};const x=S[$];var L=Object.defineProperty,j=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,z=(e,t,n)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t)=>{for(var n in t||(t={}))R.call(t,n)&&z(e,n,t[n]);if(j)for(var n of j(t))O.call(t,n)&&z(e,n,t[n]);return e};const A={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 M(t,n,o,l={}){var a;const{flush:r="pre",deep:i=!0,listenToStorageChanges:s=!0,writeDefaults:m=!0,mergeDefaults:u=!1,shallow:d,window:p=N,eventFilter:v,onError:f=(e=>{console.error(e)})}=l,g=(d?e.shallowRef:e.ref)(n);if(!o)try{o=function(e,t){return x[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=N)?void 0:e.localStorage}))()}catch(e){f(e)}if(!o)return g;const h=c(n),y=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),k=null!=(a=l.serializer)?a:A[y],{pause:w,resume:b}=B(g,(()=>function(e){try{null==e?o.removeItem(t):o.setItem(t,k.write(e))}catch(e){f(e)}}(g.value)),{flush:r,deep:i,eventFilter:v});return p&&s&&V(p,"storage",C),C(),g;function C(e){e&&e.key!==t||(g.value=function(e){if(!e||e.key===t){w();try{const n=e?e.newValue:o.getItem(t);if(null==n)return m&&null!==h&&o.setItem(t,k.write(h)),h;if(!e&&u){const e=k.read(n);return"function"==typeof u?u(e,h):"object"!==y||Array.isArray(e)?e:D(D({},h),e)}return"string"!=typeof n?n:k.read(n)}catch(e){f(e)}finally{b()}}}(e))}}var P,T,U=Object.defineProperty,F=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,W=(e,t,n)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function G(t={}){const{controls:n=!1,interval:o="requestAnimationFrame"}=t,l=e.ref(new Date),a=()=>l.value=new Date,i="requestAnimationFrame"===o?function(t,n={}){const{immediate:o=!0,window:l=N}=n,a=e.ref(!1);let r=null;function i(){a.value&&l&&(t(),r=l.requestAnimationFrame(i))}function c(){!a.value&&l&&(a.value=!0,i())}function s(){a.value=!1,null!=r&&l&&(l.cancelAnimationFrame(r),r=null)}return o&&c(),u(s),{isActive:a,pause:s,resume:c}}(a,{immediate:!0}):function(t,n=1e3,o={}){const{immediate:l=!0,immediateCallback:a=!1}=o;let i=null;const s=e.ref(!1);function m(){i&&(clearInterval(i),i=null)}function d(){s.value=!1,m()}function p(){e.unref(n)<=0||(s.value=!0,a&&t(),m(),i=setInterval(t,c(n)))}l&&r&&p(),e.isRef(n)&&u(e.watch(n,(()=>{s.value&&r&&p()})));return u(d),{isActive:s,pause:d,resume:p}}(a,o,{immediate:!0});return n?((e,t)=>{for(var n in t||(t={}))H.call(t,n)&&W(e,n,t[n]);if(F)for(var n of F(t))_.call(t,n)&&W(e,n,t[n]);return e})({now:l},i):l}(T=P||(P={})).UP="UP",T.RIGHT="RIGHT",T.DOWN="DOWN",T.LEFT="LEFT",T.NONE="NONE";let q=0;function J(t,n={}){const o=e.ref(!1),{document:l=I,immediate:a=!0,manual:r=!1,id:i="vueuse_styletag_"+ ++q}=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)},d=()=>{l&&o.value&&(s(),l.head.removeChild(l.getElementById(i)),o.value=!1)};return a&&!r&&function(t,n=!0){e.getCurrentInstance()?e.onMounted(t):n?t():e.nextTick(t)}(m),r||u(d),{id:i,css:c,unload:d,load:m,isLoaded:e.readonly(o)}}var K=Object.defineProperty,Q=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,X=(e,t,n)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))Y.call(t,n)&&X(e,n,t[n]);if(Q)for(var n of Q(t))Z.call(t,n)&&X(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const ee=({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 te=e.defineComponent({name:"ImageWall",components:{LoadingIcon:ee},props:{items:{type:Array,default:()=>[]},columnWidth:{type:Number,default:300},gap:{type:Number,default:0}},emits:["insert"],setup(t){let n=null;const o=e.ref(null),l=e.ref({}),a=e.ref([]),r=()=>{const e=Math.floor((o.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return e>0?e:1},i=async n=>{if(n>=t.items.length)return;await e.nextTick();const l=Array.from(o.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));a.value[Number(l.dataset.index)].push(n),await i(n+1)},c=async(e=!1)=>{if(a.value.length===r()&&!e)return;var t;a.value=(t=r(),new Array(t).fill(null).map((()=>[])));const n=window.scrollY;await i(0),window.scrollTo({top:n})};return e.watch((()=>[t.items]),(()=>{l.value={},c(!0)})),e.watch((()=>[t.columnWidth,t.gap]),(()=>c())),e.onMounted((()=>{c(!0),n=new ResizeObserver((()=>c())),n.observe(o.value)})),e.onBeforeUnmount((()=>n.unobserve(o.value))),{columns:a,state:l,wall:o}}}),ne=(e,t)=>{const n=e.__vccOpts||e;for(const[e,o]of t)n[e]=o;return n};const oe=["data-index"],le=["src","title","onLoad","onClick"];var ae=ne(te,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",{ref:"wall",class:"wl-gallery",style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,((n,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"wl-gallery-column","data-index":o,style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n,(n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[t.state[t.items[n].src]?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,size:36,style:{margin:"20px auto"}})),e.createElementVNode("img",{class:"wl-gallery-item",src:t.items[n].src,title:t.items[n].title,loading:"lazy",onLoad:e=>t.state[t.items[n].src]=!0,onClick:e=>t.$emit("insert",`![](${t.items[n].src})`)},null,40,le)],64)))),128))],12,oe)))),128))],4)}],["__file","ImageWall.vue"]]);const re=["nick","mail","link"],ie=e=>e.filter((e=>re.includes(e))),ce=e=>new Promise(((t,n)=>{if(e.size>128e3)return n(new Error("File too large! File size limit 128KB"));const o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result?.toString()||""),o.onerror=n})),se=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>',me=()=>{const e={next:""},t=({keyword:e,pos:t})=>{const n=new URLSearchParams("media_filter=minimal");return n.set("key","PAY5JLFIH6V6"),n.set("limit","20"),n.set("pos",t||""),n.set("q",e),fetch(`https://g.tenor.com/v1/search?${n.toString()}`,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())).catch((()=>({next:t||"",results:[]})))};return{search:(n="")=>t({keyword:n}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url})))))),more:n=>t({keyword:n,pos:e.next}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url}))))))}},ue=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"),de=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],pe={},ve=e=>{let t=0;return e.replace(ue,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;pe[n]?l=pe[n]:(l=de[t],pe[n]=l);const a=`<span style="color: #${l}">${n}</span>`;return t=++t%de.length,a}))},fe=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky"],ge=e=>Object.fromEntries(e.map(((e,t)=>[fe[t],e])));var he=ge(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words","Please input comments between $0 and $1 words!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky"]),ye=ge(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない"]),ke=ge(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶"]),we=ge(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂"]),be=ge(["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","Like","Cancel like","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","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky"]),Ce=ge(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий"]);const Ee={zh:ke,"zh-cn":ke,"zh-CN":ke,"zh-tw":we,"zh-TW":we,en:he,"en-US":he,"en-us":he,jp:ye,"jp-jp":ye,"jp-JP":ye,"pt-br":be,"pt-BR":be,ru:Ce,"ru-ru":Ce,"ru-RU":Ce},Be=e=>{try{e=decodeURI(e)}catch(e){}return e},Ne=(e="")=>e.replace(/\/$/u,""),Ie=e=>/^(https?:)?\/\//.test(e),Ve=e=>{const t=Ne(e);return Ie(t)?t:`https://${t}`},Se=e=>Array.isArray(e)?e:!!e&&[0,e],$e=(e,t)=>"function"==typeof e?e:!1!==e&&t,xe="{--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}",Le=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},je=(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(),a=Math.floor(l/864e5);if(0===a){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 a<0?n.now:a<8?`${a} ${n.days}`:(e=>{const t=Le(e.getDate(),2),n=Le(e.getMonth()+1,2);return`${Le(e.getFullYear(),2)}-${n}-${t}`})(o)},Re=e=>{const t=M("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}))},Oe=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,ze={"Content-Type":"application/json"},De=({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:a,token:r})=>{const i={};return r&&(i.Authorization=`Bearer ${r}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:a,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")))},Ae=({serverURL:e,lang:t,token:n,objectId:o,...l})=>fetch(`${e}/comment/${o}?lang=${t}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(l)}).then((e=>e.json())),Me=e=>e.type.includes("image"),Pe=e=>{const t=Array.from(e).find(Me);return t?t.getAsFile():null},Te=/\$.*?\$/,Ue=/^\$(.*?)\$/,Fe=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,He=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),_e=(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=Fe.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(Te);return-1!==t?t:e.length},tokenizer(t){const n=Ue.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(He(e,t))};let We=null;const Ge=()=>We||(We=M("WALINE_USER",{}));let qe=null;const Je=()=>qe||(qe=M("WALINE_LIKE",[]));var Ke=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"})]),ImageWall:ae,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:ee,GifIcon:()=>e.h("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[e.h("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),e.h("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})])},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"),l=M("WALINE_COMMENT_BOX_EDITOR",""),r=M("WALINE_USER_META",{nick:"",mail:"",link:""}),i=Ge(),c=e.ref({}),s=e.ref(null),m=e.ref(null),u=e.ref(null),p=e.ref(null),v=e.ref(null),f=e.ref(null),g=e.ref(null),h=e.ref({tabs:[],map:{}}),y=e.ref(0),k=e.ref(!1),w=e.ref(!1),b=e.ref(!1),C=e.ref(""),E=e.ref(0),B=e.reactive({loading:!0,list:[]}),N=e.ref(0),I=e.ref(!1),V=e.ref(""),S=e.ref(!1),$=e.computed((()=>o.value.locale)),x=e.computed((()=>Boolean(i.value?.token))),L=e.computed((()=>!1!==o.value.imageUploader)),j=e=>{const t=s.value,n=t.selectionStart,o=t.selectionEnd||0,a=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=a},R=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return j(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{l.value=l.value.replace(t,`\r\n![${e.name}](${n})`)})).catch((e=>{alert(e.message),l.value=l.value.replace(t,"")}))},O=()=>{const{serverURL:e,lang:a,login:m,wordLimit:u,requiredMeta:d}=o.value,p={comment:V.value,nick:r.value.nick,mail:r.value.mail,link:r.value.link,ua:navigator.userAgent,url:o.value.path};if(i.value?.token)p.nick=i.value.display_name,p.mail=i.value.email,p.link=i.value.url;else{if("force"===m)return;if(d.indexOf("nick")>-1&&!p.nick)return c.value.nick?.focus(),alert($.value.nickError);if(d.indexOf("mail")>-1&&!p.mail||p.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(p.mail))return c.value.mail?.focus(),alert($.value.mailError);if(!p.comment)return void s.value?.focus();p.nick||(p.nick=$.value.anonymous)}if(!I.value)return alert($.value.wordHint.replace("$0",u[0].toString()).replace("$1",u[1].toString()).replace("$2",E.value.toString()));p.comment=He(p.comment,h.value.map),t.replyId&&t.rootId&&(p.pid=t.replyId,p.rid=t.rootId,p.at=t.replyUser),S.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:e,lang:a,token:i.value?.token,comment:p}).then((e=>{if(S.value=!1,e.errmsg)return alert(e.errmsg);n("submit",e.data),l.value="",C.value="",t.replyId&&n("cancel-reply")})).catch((e=>{S.value=!1,alert(e.message)}))},z=e=>{u.value.contains(e.target)||p.value.contains(e.target)||(k.value=!1),v.value.contains(e.target)||f.value.contains(e.target)||(w.value=!1)},D=async e=>{const{scrollTop:t,clientHeight:n,scrollHeight:l}=e.target,a=(n+t)/l,r=o.value.search,i=g.value?.value||"";a<.9||B.loading||(B.loading=!0,B.list.push(...r.more?await r.more(i,B.list.length):await r.search(i)),B.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},A=d((e=>{B.list=[],D(e)}),300);e.watch([o,E],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(N.value=n[0],I.value=!1):t>n[1]?(N.value=n[1],I.value=!1):(N.value=n[1],I.value=!0):(N.value=0,I.value=!0)}),{immediate:!0}),e.watch(w,(async e=>{if(!e)return;const t=o.value.search;g.value&&(g.value.value=""),B.loading=!0,B.list=t.default?await t.default():await t.search(""),B.loading=!1}));const P=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))))};return e.onMounted((()=>{document.body.addEventListener("click",z),window.addEventListener("message",P),e.watch((()=>l.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;V.value=e,C.value=_e(e,{emojiMap:h.value.map,highlighter:t,texRenderer:n}),E.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.default(s.value):a.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?Re(Ne(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:a,type:r,items:i}=e;t.tabs.push({name:n,icon:Oe(l,o,a,r),items:i.map((e=>{const n=`${a||""}${e}`;return t.map[n]=Oe(e,o,a,r),n}))})})),t}))).then((e=>{h.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",z),window.removeEventListener("message",P)})),{config:o,locale:$,insert:j,onChange:()=>{const e=m.value;e.files&&L.value&&R(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{if(e.dataTransfer?.items){const t=Pe(e.dataTransfer.items);t&&L.value&&(R(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&O()},onPaste:e=>{if(e.clipboardData){const t=Pe(e.clipboardData.items);t&&L.value&&R(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,a=(window.innerHeight-450)/2,r=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);r?.postMessage({type:"TOKEN",data:null},"*");const c=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(r?.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,a=(window.innerHeight-800)/2;window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`)?.postMessage({type:"TOKEN",data:i.value.token},"*")},submitComment:O,onImageWallScroll:D,onGifSearch:A,isLogin:x,userInfo:i,isSubmitting:S,wordNumber:E,wordLimit:N,isWordNumberLegal:I,editor:l,userMeta:r,emoji:h,emojiTabIndex:y,showEmoji:k,gifData:B,showGif:w,canUploadImage:L,previewText:C,showPreview:b,inputRefs:c,editorRef:s,emojiButtonRef:u,emojiPopupRef:p,gifButtonRef:v,gifPopupRef:f,imageUploadRef:m,gifSearchInputRef:g}}});const Qe={class:"wl-comment"},Ye={key:0,class:"wl-login-info"},Ze={class:"wl-avatar"},Xe=["title"],et=["title"],tt=["src"],nt=["title","textContent"],ot={class:"wl-panel"},lt=["for","textContent"],at=["id","onUpdate:modelValue","name","type"],rt=["placeholder"],it={class:"wl-preview"},ct=e.createElementVNode("hr",null,null,-1),st=["innerHTML"],mt={class:"wl-footer"},ut={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"],ft=["title"],gt=["title"],ht={class:"wl-info"},yt={class:"wl-text-number"},kt={key:0},wt=e.createTextVNode("  /  "),bt=["textContent"],Ct=["textContent"],Et=["disabled"],Bt=["placeholder"],Nt={key:0,class:"wl-loading"},It={key:0,class:"wl-tab-wrapper"},Vt=["title","onClick"],St=["src","alt"],$t={key:0,class:"wl-tabs"},xt=["onClick"],Lt=["src","alt","title"],jt=["title"];var Rt=ne(Ke,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("CloseIcon"),c=e.resolveComponent("MarkdownIcon"),s=e.resolveComponent("EmojiIcon"),m=e.resolveComponent("GifIcon"),u=e.resolveComponent("ImageIcon"),d=e.resolveComponent("PreviewIcon"),p=e.resolveComponent("LoadingIcon"),v=e.resolveComponent("ImageWall");return e.openBlock(),e.createElementBlock("div",Qe,["disable"!==t.config.login&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Ye,[e.createElementVNode("div",Ze,[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,Xe),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:t.locale.profile,onClick:n[1]||(n[1]=(...e)=>t.onProfile&&t.onProfile(...e))},[e.createElementVNode("img",{src:t.userInfo.avatar,alt:"avatar"},null,8,tt)],8,et)]),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:t.locale.profile,onClick:n[2]||(n[2]=(...e)=>t.onProfile&&t.onProfile(...e)),textContent:e.toDisplayString(t.userInfo.display_name)},null,8,nt)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ot,["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",{key:n,class:"wl-header-item"},[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,lt),e.withDirectives(e.createElementVNode("input",{id:`wl-${n}`,ref_for:!0,ref:e=>{e&&(t.inputRefs[n]=e)},"onUpdate:modelValue":e=>t.userMeta[n]=e,class:e.normalizeClass(["wl-input",`wl-${n}`]),name:n,type:"mail"===n?"email":"text"},null,10,at),[[e.vModelDynamic,t.userMeta[n]]])])))),128))],2)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":n[3]||(n[3]=e=>t.editor=e),class:"wl-editor",placeholder:t.replyUser?`@${t.replyUser}`:t.locale.placeholder,onKeydown:n[4]||(n[4]=(...e)=>t.onKeyDown&&t.onKeyDown(...e)),onDrop:n[5]||(n[5]=(...e)=>t.onDrop&&t.onDrop(...e)),onPaste:n[6]||(n[6]=(...e)=>t.onPaste&&t.onPaste(...e))},null,40,rt),[[e.vModelText,t.editor]]),e.withDirectives(e.createElementVNode("div",it,[ct,e.createElementVNode("h4",null,e.toDisplayString(t.locale.preview)+":",1),e.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),e.createElementVNode("div",{class:"wl-content",innerHTML:t.previewText},null,8,st)],512),[[e.vShow,t.showPreview]]),e.createElementVNode("div",mt,[e.createElementVNode("div",ut,[e.createElementVNode("a",dt,[e.createVNode(c)]),e.withDirectives(e.createElementVNode("button",{ref:"emojiButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showEmoji}]),title:t.locale.emoji,onClick:n[7]||(n[7]=e=>t.showEmoji=!t.showEmoji)},[e.createVNode(s)],10,pt),[[e.vShow,t.emoji.tabs.length]]),t.config.search?(e.openBlock(),e.createElementBlock("button",{key:0,ref:"gifButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showGif}]),title:t.locale.gif,onClick:n[8]||(n[8]=e=>t.showGif=!t.showGif)},[e.createVNode(m)],10,vt)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:n[9]||(n[9]=(...e)=>t.onChange&&t.onChange(...e))},null,544),t.canUploadImage?(e.openBlock(),e.createElementBlock("label",{key:1,for:"wl-image-upload",class:"wl-action",title:t.locale.uploadImage},[e.createVNode(u)],8,ft)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:e.normalizeClass(["wl-action",{actived:t.showPreview}]),title:t.locale.preview,onClick:n[10]||(n[10]=e=>t.showPreview=!t.showPreview)},[e.createVNode(d)],10,gt)]),e.createElementVNode("div",ht,[e.createElementVNode("div",yt,[e.createTextVNode(e.toDisplayString(t.wordNumber)+" ",1),t.config.wordLimit?(e.openBlock(),e.createElementBlock("span",kt,[wt,e.createElementVNode("span",{class:e.normalizeClass({illegal:!t.isWordNumberLegal}),textContent:e.toDisplayString(t.wordLimit)},null,10,bt)])):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[11]||(n[11]=(...e)=>t.onLogin&&t.onLogin(...e)),textContent:e.toDisplayString(t.locale.login)},null,8,Ct)),"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[12]||(n[12]=(...e)=>t.submitComment&&t.submitComment(...e))},[t.isSubmitting?(e.openBlock(),e.createBlock(p,{key:0,size:16})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.locale.submit),1)],64))],8,Et)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{ref:"gifPopupRef",class:e.normalizeClass(["wl-gif-popup",{display:t.showGif}])},[e.createElementVNode("input",{ref:"gifSearchInputRef",type:"text",placeholder:t.locale.gifSearchPlaceholder,onInput:n[13]||(n[13]=(...e)=>t.onGifSearch&&t.onGifSearch(...e))},null,40,Bt),e.createVNode(v,{items:t.gifData.list,"column-width":200,gap:6,onInsert:n[14]||(n[14]=e=>t.insert(e)),onScroll:t.onImageWallScroll},null,8,["items","onScroll"]),t.gifData.loading?(e.openBlock(),e.createElementBlock("div",Nt,[e.createVNode(p,{size:30})])):e.createCommentVNode("v-if",!0)],2),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",It,[(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,St)):e.createCommentVNode("v-if",!0)],8,Vt)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),t.emoji.tabs.length>1?(e.openBlock(),e.createElementBlock("div",$t,[(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,Lt)],10,xt)))),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[15]||(n[15]=e=>t.$emit("cancel-reply"))},[e.createVNode(i,{size:24})],8,jt)):e.createCommentVNode("v-if",!0)])}],["__file","CommentBox.vue"]]);const Ot=["approved","waiting","spam"];var zt=e.defineComponent({components:{CommentBox:Rt,DeleteIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),LikeIcon:({active:t=!1})=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("path",{d:"M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z"+(t?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"),fill:t?"red":"currentColor"})]),ReplyIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),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"}))},props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object,default:null}},emits:["submit","reply","like","delete","status","sticky"],setup(t){const n=e.inject("config"),o=Je(),l=Ge(),a=e.computed((()=>n.value.locale)),r=e.computed((()=>{const{link:e}=t.comment;return e?Ie(e)?e:`https://${e}`:""})),i=e.computed((()=>o.value.includes(t.comment.objectId))),c=((t,n)=>{const o=G();return e.computed((()=>je(t,o.value,n)))})(t.comment.insertedAt,a.value),s=e.computed((()=>"administrator"===l.value.type)),m=e.computed((()=>t.comment.user_id&&l.value.objectId===t.comment.user_id)),u=e.computed((()=>t.comment.objectId===t.reply?.objectId));return{config:n,locale:a,isReplyingCurrent:u,link:r,like:i,time:c,isAdmin:s,isOwner:m,commentStatus:Ot}}});const Dt=["id"],At={class:"wl-user","aria-hidden":"true"},Mt=["src"],Pt={class:"wl-card"},Tt={class:"wl-head"},Ut=["href"],Ft={key:1,class:"wl-nick"},Ht=["textContent"],_t=["textContent"],Wt=["textContent"],Gt=["textContent"],qt=["textContent"],Jt={class:"wl-comment-actions"},Kt=["title"],Qt=["textContent"],Yt=["title"],Zt={class:"wl-meta","aria-hidden":"true"},Xt=["textContent"],en=["textContent"],tn=["textContent"],nn=["innerHTML"],on={key:0,class:"wl-admin-actions"},ln={class:"wl-comment-status"},an=["disabled","onClick","textContent"],rn={key:1,class:"wl-reply-wrapper"},cn={key:2,class:"wl-quote"};var sn=ne(zt,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("VerifiedIcon"),c=e.resolveComponent("DeleteIcon"),s=e.resolveComponent("LikeIcon"),m=e.resolveComponent("ReplyIcon"),u=e.resolveComponent("CommentBox"),d=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{id:t.comment.objectId,class:"wl-item"},[e.createElementVNode("div",At,[t.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.comment.avatar},null,8,Mt)):e.createCommentVNode("v-if",!0),t.comment.type?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",Pt,[e.createElementVNode("div",Tt,[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,Ut)):(e.openBlock(),e.createElementBlock("span",Ft,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,Ht)):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,_t)):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),void 0!==t.comment.level&&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,Gt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(t.time)},null,8,qt),e.createElementVNode("div",Jt,[t.isAdmin||t.isOwner?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-delete",onClick:n[0]||(n[0]=e=>t.$emit("delete",t.comment))},[e.createVNode(c)])):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:"wl-like",title:t.like?t.locale.cancelLike:t.locale.like,onClick:n[1]||(n[1]=e=>t.$emit("like",t.comment))},[e.createVNode(s,{active:t.like},null,8,["active"]),"like"in t.comment?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.like)},null,8,Qt)):e.createCommentVNode("v-if",!0)],8,Kt),e.createElementVNode("button",{class:e.normalizeClass(["wl-reply",{active:t.isReplyingCurrent}]),title:t.isReplyingCurrent?t.locale.cancelReply:t.locale.reply,onClick:n[2]||(n[2]=e=>t.$emit("reply",t.isReplyingCurrent?null:t.comment))},[e.createVNode(m)],10,Yt)])]),e.createElementVNode("div",Zt,[t.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.addr)},null,8,Xt)):e.createCommentVNode("v-if",!0),t.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,textContent:e.toDisplayString(t.comment.browser)},null,8,en)):e.createCommentVNode("v-if",!0),t.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,textContent:e.toDisplayString(t.comment.os)},null,8,tn)):e.createCommentVNode("v-if",!0)]),e.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),e.createElementVNode("div",{class:"wl-content",innerHTML:t.comment.comment},null,8,nn),t.isAdmin?(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("span",ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.commentStatus,(n=>(e.openBlock(),e.createElementBlock("button",{key:n,class:e.normalizeClass(`wl-btn wl-${n}`),disabled:t.comment.status===n,onClick:e=>t.$emit("status",{status:n,comment:t.comment}),textContent:e.toDisplayString(t.locale[n])},null,10,an)))),128))]),t.isAdmin&&!t.comment.rid?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn wl-sticky",onClick:n[3]||(n[3]=e=>t.$emit("sticky",t.comment))},e.toDisplayString(t.comment.sticky?t.locale.unsticky:t.locale.sticky),1)):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0),t.isReplyingCurrent?(e.openBlock(),e.createElementBlock("div",rn,[e.createVNode(u,{"reply-id":t.comment.objectId,"reply-user":t.comment.nick,"root-id":t.rootId,onSubmit:n[4]||(n[4]=e=>t.$emit("submit",e)),onCancelReply:n[5]||(n[5]=e=>t.$emit("reply",null))},null,8,["reply-id","reply-user","root-id"])])):e.createCommentVNode("v-if",!0),t.comment.children?(e.openBlock(),e.createElementBlock("div",cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment.children,(o=>(e.openBlock(),e.createBlock(d,{key:o.objectId,comment:o,reply:t.reply,"root-id":t.rootId,onReply:n[6]||(n[6]=e=>t.$emit("reply",e)),onSubmit:n[7]||(n[7]=e=>t.$emit("submit",e)),onLike:n[8]||(n[8]=e=>t.$emit("like",e)),onDelete:n[9]||(n[9]=e=>t.$emit("delete",e)),onStatus:n[10]||(n[10]=e=>t.$emit("status",e)),onSticky:n[11]||(n[11]=e=>t.$emit("sticky",e))},null,8,["comment","reply","root-id"])))),128))])):e.createCommentVNode("v-if",!0)])],8,Dt)}],["__file","CommentCard.vue"]]);var mn=e.defineComponent({name:"WalineRoot",components:{CommentBox:Rt,CommentCard:sn,LoadingIcon:ee},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","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.1.0/weibo"],meta:a=["nick","mail","link"],requiredMeta:r=[],dark:i=!1,pageSize:c=10,wordLimit:s,imageUploader:m,highlighter:u,texRenderer:d,copyright:p=!0,login:v="enable",search:f=me(),...g})=>({serverURL:Ve(e),path:Be(t),locale:{...Ee[n]||Ee["zh-CN"],..."object"==typeof o?o:{}},wordLimit:Se(s),meta:ie(a),requiredMeta:ie(r),imageUploader:$e(m,ce),highlighter:$e(u,ve),texRenderer:$e(d,se),lang:n,dark:i,emoji:l,pageSize:c,login:v,copyright:p,search:f,...g}))(t))),o=Ge(),l=Je(),a=e.ref("loading"),r=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${xe}}`:`${e}${xe}`:!0===e?`:root${xe}`:"";var e}));let d;J(u);const p=e=>{const{serverURL:t,path:l,pageSize:m}=n.value,u=new AbortController;a.value="loading",d?.(),De({serverURL:t,lang:n.value.lang,path:l,pageSize:m,page:e,signal:u.signal,token:o.value?.token}).then((t=>{a.value="success",r.value=t.count,s.value.push(...t.data),i.value=e,c.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),a.value="error")})),d=u.abort.bind(u)},v=()=>{r.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:a,count:r,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)},onStatusChange:async({comment:e,status:t})=>{if(e.status===t)return;const{serverURL:l,lang:a}=n.value;await Ae({serverURL:l,lang:a,token:o.value?.token,objectId:e.objectId,status:t}),e.status=t},onDelete:async({objectId:e})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:t,lang:l}=n.value;await(({serverURL:e,lang:t,token:n,objectId:o})=>fetch(`${e}/comment/${o}?lang=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${n}`}}).then((e=>e.json())))({serverURL:t,lang:l,token:o.value?.token,objectId:e}),s.value.some(((t,n)=>t.objectId===e?(s.value=s.value.filter(((e,t)=>t!==n)),!0):t.children.some(((o,l)=>o.objectId===e&&(s.value[n].children=t.children.filter(((e,t)=>t!==l)),!0)))))},onSticky:async e=>{if(e.rid)return;const{serverURL:t,lang:l}=n.value;await Ae({serverURL:t,lang:l,token:o.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},onLike:async e=>{const{serverURL:t,lang:o}=n.value,{objectId:a}=e,r=l.value.includes(a);await(({serverURL:e,lang:t,objectId:n,like:o})=>fetch(`${e}/comment/${n}?lang=${t}`,{method:"PUT",headers:ze,body:JSON.stringify({like:o})}).then((e=>e.json())))({serverURL:t,lang:o,objectId:a,like:!r}),r?l.value=l.value.filter((e=>e!==a)):(l.value=[...l.value,a],l.value.length>50&&(l.value=l.value.slice(-50))),e.like=(e.like||0)+(r?-1:1)},version:"2.6.4"}}});const un={"data-waline":""},dn={class:"wl-count"},pn=["textContent"],vn={class:"wl-cards"},fn={key:1,class:"wl-operation"},gn=["textContent"],hn={key:0,class:"wl-loading"},yn=["textContent"],kn={class:"wl-operation"},wn=["textContent"],bn={key:3,class:"wl-power"},Cn=e.createTextVNode(" Powered by "),En=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);var Bn=ne(mn,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("CommentBox"),c=e.resolveComponent("CommentCard"),s=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",un,[t.reply?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,onSubmit:t.onSubmit},null,8,["onSubmit"])),e.createElementVNode("div",dn,[t.count?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(t.count)},null,8,pn)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.i18n.comment),1)]),e.createElementVNode("div",vn,[(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,onStatus:t.onStatusChange,onDelete:t.onDelete,onSticky:t.onSticky,onLike:t.onLike},null,8,["root-id","comment","reply","onReply","onSubmit","onStatus","onDelete","onSticky","onLike"])))),128))]),"error"===t.status?(e.openBlock(),e.createElementBlock("div",fn,[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,gn)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===t.status?(e.openBlock(),e.createElementBlock("div",hn,[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",kn,[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,wn)])],2112)):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(t.i18n.sofa)},null,8,yn))],64)),e.createCommentVNode(" Copyright Information "),t.config.copyright?(e.openBlock(),e.createElementBlock("div",bn,[Cn,En,e.createTextVNode(" v"+e.toDisplayString(t.version),1)])):e.createCommentVNode("v-if",!0)])}],["__file","Waline.vue"]]);exports.Waline=Bn,exports.version="2.6.4";
"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,a=o(t);const r="undefined"!=typeof window,i=()=>{};function c(t){return"function"==typeof t?t():e.unref(t)}function s(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}r&&(null==(l=null==window?void 0:window.navigator)?void 0:l.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const m=e=>e();function u(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}function d(e,t=200,n={}){return s(function(e,t={}){let n,o;return l=>{const a=c(e),r=c(t.maxWait);if(n&&clearTimeout(n),a<=0||void 0!==r&&r<=0)return o&&(clearTimeout(o),o=null),l();r&&!o&&(o=setTimeout((()=>{n&&clearTimeout(n),o=null,l()}),r)),n=setTimeout((()=>{o&&clearTimeout(o),o=null,l()}),a)}}(t,n),e)}var p=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;function g(t,n,o={}){const l=o,{eventFilter:a=m}=l,r=((e,t)=>{var n={};for(var o in e)v.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&p)for(var o of p(e))t.indexOf(o)<0&&f.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]);return e.watch(t,s(a,n),r)}var h=Object.defineProperty,y=Object.defineProperties,k=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,E=(e,t,n)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function B(t,n,o={}){const l=o,{eventFilter:a}=l,r=((e,t)=>{var n={};for(var o in e)b.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&w)for(var o of w(e))t.indexOf(o)<0&&C.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]),{eventFilter:i,pause:c,resume:s,isActive:u}=function(t=m){const n=e.ref(!0);return{isActive:n,pause:function(){n.value=!1},resume:function(){n.value=!0},eventFilter:(...e)=>{n.value&&t(...e)}}}(a),d=g(t,n,(p=((e,t)=>{for(var n in t||(t={}))b.call(t,n)&&E(e,n,t[n]);if(w)for(var n of w(t))C.call(t,n)&&E(e,n,t[n]);return e})({},r),y(p,k({eventFilter:i}))));var p;return{stop:d,pause:c,resume:s,isActive:u}}const N=r?window:void 0,I=r?window.document:void 0;function S(...t){let n,o,l,a;if("string"==typeof t[0]?([o,l,a]=t,n=N):[n,o,l,a]=t,!n)return i;let r=i;const s=e.watch((()=>function(e){var t;const n=c(e);return null!=(t=null==n?void 0:n.$el)?t:n}(n)),(e=>{r(),e&&(e.addEventListener(o,l,a),r=()=>{e.removeEventListener(o,l,a),r=i})}),{immediate:!0,flush:"post"}),m=()=>{s(),r()};return u(m),m}r&&window.navigator,r&&window.location;const V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},$="__vueuse_ssr_handlers__";V[$]=V[$]||{};const x=V[$];var L=Object.defineProperty,j=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,z=(e,t,n)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A=(e,t)=>{for(var n in t||(t={}))R.call(t,n)&&z(e,n,t[n]);if(j)for(var n of j(t))O.call(t,n)&&z(e,n,t[n]);return e};const D={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 M(t,n,o,l={}){var a;const{flush:r="pre",deep:i=!0,listenToStorageChanges:s=!0,writeDefaults:m=!0,mergeDefaults:u=!1,shallow:d,window:p=N,eventFilter:v,onError:f=(e=>{console.error(e)})}=l,g=(d?e.shallowRef:e.ref)(n);if(!o)try{o=function(e,t){return x[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=N)?void 0:e.localStorage}))()}catch(e){f(e)}if(!o)return g;const h=c(n),y=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),k=null!=(a=l.serializer)?a:D[y],{pause:w,resume:b}=B(g,(()=>function(e){try{null==e?o.removeItem(t):o.setItem(t,k.write(e))}catch(e){f(e)}}(g.value)),{flush:r,deep:i,eventFilter:v});return p&&s&&S(p,"storage",C),C(),g;function C(e){e&&e.key!==t||(g.value=function(e){if(!e||e.key===t){w();try{const n=e?e.newValue:o.getItem(t);if(null==n)return m&&null!==h&&o.setItem(t,k.write(h)),h;if(!e&&u){const e=k.read(n);return"function"==typeof u?u(e,h):"object"!==y||Array.isArray(e)?e:A(A({},h),e)}return"string"!=typeof n?n:k.read(n)}catch(e){f(e)}finally{b()}}}(e))}}var P,T,U=Object.defineProperty,F=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,W=(e,t,n)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function q(t={}){const{controls:n=!1,interval:o="requestAnimationFrame"}=t,l=e.ref(new Date),a=()=>l.value=new Date,i="requestAnimationFrame"===o?function(t,n={}){const{immediate:o=!0,window:l=N}=n,a=e.ref(!1);let r=null;function i(){a.value&&l&&(t(),r=l.requestAnimationFrame(i))}function c(){!a.value&&l&&(a.value=!0,i())}function s(){a.value=!1,null!=r&&l&&(l.cancelAnimationFrame(r),r=null)}return o&&c(),u(s),{isActive:a,pause:s,resume:c}}(a,{immediate:!0}):function(t,n=1e3,o={}){const{immediate:l=!0,immediateCallback:a=!1}=o;let i=null;const s=e.ref(!1);function m(){i&&(clearInterval(i),i=null)}function d(){s.value=!1,m()}function p(){e.unref(n)<=0||(s.value=!0,a&&t(),m(),i=setInterval(t,c(n)))}l&&r&&p(),e.isRef(n)&&u(e.watch(n,(()=>{s.value&&r&&p()})));return u(d),{isActive:s,pause:d,resume:p}}(a,o,{immediate:!0});return n?((e,t)=>{for(var n in t||(t={}))_.call(t,n)&&W(e,n,t[n]);if(F)for(var n of F(t))H.call(t,n)&&W(e,n,t[n]);return e})({now:l},i):l}(T=P||(P={})).UP="UP",T.RIGHT="RIGHT",T.DOWN="DOWN",T.LEFT="LEFT",T.NONE="NONE";let G=0;function J(t,n={}){const o=e.ref(!1),{document:l=I,immediate:a=!0,manual:r=!1,id:i="vueuse_styletag_"+ ++G}=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)},d=()=>{l&&o.value&&(s(),l.head.removeChild(l.getElementById(i)),o.value=!1)};return a&&!r&&function(t,n=!0){e.getCurrentInstance()?e.onMounted(t):n?t():e.nextTick(t)}(m),r||u(d),{id:i,css:c,unload:d,load:m,isLoaded:e.readonly(o)}}var K=Object.defineProperty,Q=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,X=(e,t,n)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))Y.call(t,n)&&X(e,n,t[n]);if(Q)for(var n of Q(t))Z.call(t,n)&&X(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const ee=({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 te=e.defineComponent({name:"ImageWall",components:{LoadingIcon:ee},props:{items:{type:Array,default:()=>[]},columnWidth:{type:Number,default:300},gap:{type:Number,default:0}},emits:["insert"],setup(t){let n=null;const o=e.ref(null),l=e.ref({}),a=e.ref([]),r=()=>{const e=Math.floor((o.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return e>0?e:1},i=async n=>{if(n>=t.items.length)return;await e.nextTick();const l=Array.from(o.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));a.value[Number(l.dataset.index)].push(n),await i(n+1)},c=async(e=!1)=>{if(a.value.length===r()&&!e)return;var t;a.value=(t=r(),new Array(t).fill(null).map((()=>[])));const n=window.scrollY;await i(0),window.scrollTo({top:n})};return e.watch((()=>[t.items]),(()=>{l.value={},c(!0)})),e.watch((()=>[t.columnWidth,t.gap]),(()=>c())),e.onMounted((()=>{c(!0),n=new ResizeObserver((()=>c())),n.observe(o.value)})),e.onBeforeUnmount((()=>n.unobserve(o.value))),{columns:a,state:l,wall:o}}}),ne=(e,t)=>{const n=e.__vccOpts||e;for(const[e,o]of t)n[e]=o;return n};const oe=["data-index"],le=["src","title","onLoad","onClick"];var ae=ne(te,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",{ref:"wall",class:"wl-gallery",style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,((n,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"wl-gallery-column","data-index":o,style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n,(n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[t.state[t.items[n].src]?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,size:36,style:{margin:"20px auto"}})),e.createElementVNode("img",{class:"wl-gallery-item",src:t.items[n].src,title:t.items[n].title,loading:"lazy",onLoad:e=>t.state[t.items[n].src]=!0,onClick:e=>t.$emit("insert",`![](${t.items[n].src})`)},null,40,le)],64)))),128))],12,oe)))),128))],4)}],["__file","ImageWall.vue"]]);const re=["nick","mail","link"],ie=e=>e.filter((e=>re.includes(e))),ce=e=>new Promise(((t,n)=>{if(e.size>128e3)return n(new Error("File too large! File size limit 128KB"));const o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result?.toString()||""),o.onerror=n})),se=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>',me=()=>{const e={next:""},t=({keyword:e,pos:t})=>{const n=new URLSearchParams("media_filter=minimal");return n.set("key","PAY5JLFIH6V6"),n.set("limit","20"),n.set("pos",t||""),n.set("q",e),fetch(`https://g.tenor.com/v1/search?${n.toString()}`,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())).catch((()=>({next:t||"",results:[]})))};return{search:(n="")=>t({keyword:n}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url})))))),more:n=>t({keyword:n,pos:e.next}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url}))))))}},ue=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"),de=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],pe={},ve=e=>{let t=0;return e.replace(ue,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;pe[n]?l=pe[n]:(l=de[t],pe[n]=l);const a=`<span style="color: #${l}">${n}</span>`;return t=++t%de.length,a}))},fe=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest"],ge=e=>Object.fromEntries(e.map(((e,t)=>[fe[t],e])));var he=ge(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words","Please input comments between $0 and $1 words!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest"]),ye=ge(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順"]),ke=ge(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度"]),we=ge(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂","按倒序","按正序","按熱度"]),be=ge(["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","Like","Cancel like","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","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente"]),Ce=ge(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий"]);const Ee={zh:ke,"zh-cn":ke,"zh-CN":ke,"zh-tw":we,"zh-TW":we,en:he,"en-US":he,"en-us":he,jp:ye,"jp-jp":ye,"jp-JP":ye,"pt-br":be,"pt-BR":be,ru:Ce,"ru-ru":Ce,"ru-RU":Ce},Be=e=>{try{e=decodeURI(e)}catch(e){}return e},Ne=(e="")=>e.replace(/\/$/u,""),Ie=e=>/^(https?:)?\/\//.test(e),Se=e=>{const t=Ne(e);return Ie(t)?t:`https://${t}`},Ve=e=>Array.isArray(e)?e:!!e&&[0,e],$e=(e,t)=>"function"==typeof e?e:!1!==e&&t,xe="{--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}",Le=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},je=(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(),a=Math.floor(l/864e5);if(0===a){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 a<0?n.now:a<8?`${a} ${n.days}`:(e=>{const t=Le(e.getDate(),2),n=Le(e.getMonth()+1,2);return`${Le(e.getFullYear(),2)}-${n}-${t}`})(o)},Re=e=>{const t=M("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}))},Oe=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,ze={"Content-Type":"application/json"},Ae=({serverURL:e,lang:t,path:n,page:o,pageSize:l,sortBy:a,signal:r,token:i})=>{const c={};return i&&(c.Authorization=`Bearer ${i}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}&sortBy=${a}`,{signal:r,headers:c}).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=({serverURL:e,lang:t,token:n,objectId:o,...l})=>fetch(`${e}/comment/${o}?lang=${t}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(l)}).then((e=>e.json())),Me=e=>e.type.includes("image"),Pe=e=>{const t=Array.from(e).find(Me);return t?t.getAsFile():null},Te=/\$.*?\$/,Ue=/^\$(.*?)\$/,Fe=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,_e=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),He=(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=Fe.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(Te);return-1!==t?t:e.length},tokenizer(t){const n=Ue.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(_e(e,t))};let We=null;const qe=()=>We||(We=M("WALINE_USER",{}));let Ge=null;const Je=()=>Ge||(Ge=M("WALINE_LIKE",[]));var Ke=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"})]),ImageWall:ae,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:ee,GifIcon:()=>e.h("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[e.h("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),e.h("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})])},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"),l=M("WALINE_COMMENT_BOX_EDITOR",""),r=M("WALINE_USER_META",{nick:"",mail:"",link:""}),i=qe(),c=e.ref({}),s=e.ref(null),m=e.ref(null),u=e.ref(null),p=e.ref(null),v=e.ref(null),f=e.ref(null),g=e.ref(null),h=e.ref({tabs:[],map:{}}),y=e.ref(0),k=e.ref(!1),w=e.ref(!1),b=e.ref(!1),C=e.ref(""),E=e.ref(0),B=e.reactive({loading:!0,list:[]}),N=e.ref(0),I=e.ref(!1),S=e.ref(""),V=e.ref(!1),$=e.computed((()=>o.value.locale)),x=e.computed((()=>Boolean(i.value?.token))),L=e.computed((()=>!1!==o.value.imageUploader)),j=e=>{const t=s.value,n=t.selectionStart,o=t.selectionEnd||0,a=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=a},R=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return j(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{l.value=l.value.replace(t,`\r\n![${e.name}](${n})`)})).catch((e=>{alert(e.message),l.value=l.value.replace(t,"")}))},O=()=>{const{serverURL:e,lang:a,login:m,wordLimit:u,requiredMeta:d}=o.value,p={comment:S.value,nick:r.value.nick,mail:r.value.mail,link:r.value.link,ua:navigator.userAgent,url:o.value.path};if(i.value?.token)p.nick=i.value.display_name,p.mail=i.value.email,p.link=i.value.url;else{if("force"===m)return;if(d.indexOf("nick")>-1&&!p.nick)return c.value.nick?.focus(),alert($.value.nickError);if(d.indexOf("mail")>-1&&!p.mail||p.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(p.mail))return c.value.mail?.focus(),alert($.value.mailError);if(!p.comment)return void s.value?.focus();p.nick||(p.nick=$.value.anonymous)}if(!I.value)return alert($.value.wordHint.replace("$0",u[0].toString()).replace("$1",u[1].toString()).replace("$2",E.value.toString()));p.comment=_e(p.comment,h.value.map),t.replyId&&t.rootId&&(p.pid=t.replyId,p.rid=t.rootId,p.at=t.replyUser),V.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:e,lang:a,token:i.value?.token,comment:p}).then((e=>{if(V.value=!1,e.errmsg)return alert(e.errmsg);n("submit",e.data),l.value="",C.value="",t.replyId&&n("cancel-reply")})).catch((e=>{V.value=!1,alert(e.message)}))},z=e=>{u.value.contains(e.target)||p.value.contains(e.target)||(k.value=!1),v.value.contains(e.target)||f.value.contains(e.target)||(w.value=!1)},A=async e=>{const{scrollTop:t,clientHeight:n,scrollHeight:l}=e.target,a=(n+t)/l,r=o.value.search,i=g.value?.value||"";a<.9||B.loading||(B.loading=!0,B.list.push(...r.more?await r.more(i,B.list.length):await r.search(i)),B.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},D=d((e=>{B.list=[],A(e)}),300);e.watch([o,E],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(N.value=n[0],I.value=!1):t>n[1]?(N.value=n[1],I.value=!1):(N.value=n[1],I.value=!0):(N.value=0,I.value=!0)}),{immediate:!0}),e.watch(w,(async e=>{if(!e)return;const t=o.value.search;g.value&&(g.value.value=""),B.loading=!0,B.list=t.default?await t.default():await t.search(""),B.loading=!1}));const P=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))))};return e.onMounted((()=>{document.body.addEventListener("click",z),window.addEventListener("message",P),e.watch((()=>l.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;S.value=e,C.value=He(e,{emojiMap:h.value.map,highlighter:t,texRenderer:n}),E.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.default(s.value):a.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?Re(Ne(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:a,type:r,items:i}=e;t.tabs.push({name:n,icon:Oe(l,o,a,r),items:i.map((e=>{const n=`${a||""}${e}`;return t.map[n]=Oe(e,o,a,r),n}))})})),t}))).then((e=>{h.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",z),window.removeEventListener("message",P)})),{config:o,locale:$,insert:j,onChange:()=>{const e=m.value;e.files&&L.value&&R(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{if(e.dataTransfer?.items){const t=Pe(e.dataTransfer.items);t&&L.value&&(R(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&O()},onPaste:e=>{if(e.clipboardData){const t=Pe(e.clipboardData.items);t&&L.value&&R(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,a=(window.innerHeight-450)/2,r=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);r?.postMessage({type:"TOKEN",data:null},"*");const c=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(r?.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,a=(window.innerHeight-800)/2;window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`)?.postMessage({type:"TOKEN",data:i.value.token},"*")},submitComment:O,onImageWallScroll:A,onGifSearch:D,isLogin:x,userInfo:i,isSubmitting:V,wordNumber:E,wordLimit:N,isWordNumberLegal:I,editor:l,userMeta:r,emoji:h,emojiTabIndex:y,showEmoji:k,gifData:B,showGif:w,canUploadImage:L,previewText:C,showPreview:b,inputRefs:c,editorRef:s,emojiButtonRef:u,emojiPopupRef:p,gifButtonRef:v,gifPopupRef:f,imageUploadRef:m,gifSearchInputRef:g}}});const Qe={class:"wl-comment"},Ye={key:0,class:"wl-login-info"},Ze={class:"wl-avatar"},Xe=["title"],et=["title"],tt=["src"],nt=["title","textContent"],ot={class:"wl-panel"},lt=["for","textContent"],at=["id","onUpdate:modelValue","name","type"],rt=["placeholder"],it={class:"wl-preview"},ct=e.createElementVNode("hr",null,null,-1),st=["innerHTML"],mt={class:"wl-footer"},ut={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"],ft=["title"],gt=["title"],ht={class:"wl-info"},yt={class:"wl-text-number"},kt={key:0},wt=e.createTextVNode("  /  "),bt=["textContent"],Ct=["textContent"],Et=["disabled"],Bt=["placeholder"],Nt={key:0,class:"wl-loading"},It={key:0,class:"wl-tab-wrapper"},St=["title","onClick"],Vt=["src","alt"],$t={key:0,class:"wl-tabs"},xt=["onClick"],Lt=["src","alt","title"],jt=["title"];var Rt=ne(Ke,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("CloseIcon"),c=e.resolveComponent("MarkdownIcon"),s=e.resolveComponent("EmojiIcon"),m=e.resolveComponent("GifIcon"),u=e.resolveComponent("ImageIcon"),d=e.resolveComponent("PreviewIcon"),p=e.resolveComponent("LoadingIcon"),v=e.resolveComponent("ImageWall");return e.openBlock(),e.createElementBlock("div",Qe,["disable"!==t.config.login&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Ye,[e.createElementVNode("div",Ze,[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,Xe),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:t.locale.profile,onClick:n[1]||(n[1]=(...e)=>t.onProfile&&t.onProfile(...e))},[e.createElementVNode("img",{src:t.userInfo.avatar,alt:"avatar"},null,8,tt)],8,et)]),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:t.locale.profile,onClick:n[2]||(n[2]=(...e)=>t.onProfile&&t.onProfile(...e)),textContent:e.toDisplayString(t.userInfo.display_name)},null,8,nt)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ot,["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",{key:n,class:"wl-header-item"},[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,lt),e.withDirectives(e.createElementVNode("input",{id:`wl-${n}`,ref_for:!0,ref:e=>{e&&(t.inputRefs[n]=e)},"onUpdate:modelValue":e=>t.userMeta[n]=e,class:e.normalizeClass(["wl-input",`wl-${n}`]),name:n,type:"mail"===n?"email":"text"},null,10,at),[[e.vModelDynamic,t.userMeta[n]]])])))),128))],2)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":n[3]||(n[3]=e=>t.editor=e),class:"wl-editor",placeholder:t.replyUser?`@${t.replyUser}`:t.locale.placeholder,onKeydown:n[4]||(n[4]=(...e)=>t.onKeyDown&&t.onKeyDown(...e)),onDrop:n[5]||(n[5]=(...e)=>t.onDrop&&t.onDrop(...e)),onPaste:n[6]||(n[6]=(...e)=>t.onPaste&&t.onPaste(...e))},null,40,rt),[[e.vModelText,t.editor]]),e.withDirectives(e.createElementVNode("div",it,[ct,e.createElementVNode("h4",null,e.toDisplayString(t.locale.preview)+":",1),e.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),e.createElementVNode("div",{class:"wl-content",innerHTML:t.previewText},null,8,st)],512),[[e.vShow,t.showPreview]]),e.createElementVNode("div",mt,[e.createElementVNode("div",ut,[e.createElementVNode("a",dt,[e.createVNode(c)]),e.withDirectives(e.createElementVNode("button",{ref:"emojiButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showEmoji}]),title:t.locale.emoji,onClick:n[7]||(n[7]=e=>t.showEmoji=!t.showEmoji)},[e.createVNode(s)],10,pt),[[e.vShow,t.emoji.tabs.length]]),t.config.search?(e.openBlock(),e.createElementBlock("button",{key:0,ref:"gifButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showGif}]),title:t.locale.gif,onClick:n[8]||(n[8]=e=>t.showGif=!t.showGif)},[e.createVNode(m)],10,vt)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:n[9]||(n[9]=(...e)=>t.onChange&&t.onChange(...e))},null,544),t.canUploadImage?(e.openBlock(),e.createElementBlock("label",{key:1,for:"wl-image-upload",class:"wl-action",title:t.locale.uploadImage},[e.createVNode(u)],8,ft)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:e.normalizeClass(["wl-action",{actived:t.showPreview}]),title:t.locale.preview,onClick:n[10]||(n[10]=e=>t.showPreview=!t.showPreview)},[e.createVNode(d)],10,gt)]),e.createElementVNode("div",ht,[e.createElementVNode("div",yt,[e.createTextVNode(e.toDisplayString(t.wordNumber)+" ",1),t.config.wordLimit?(e.openBlock(),e.createElementBlock("span",kt,[wt,e.createElementVNode("span",{class:e.normalizeClass({illegal:!t.isWordNumberLegal}),textContent:e.toDisplayString(t.wordLimit)},null,10,bt)])):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[11]||(n[11]=(...e)=>t.onLogin&&t.onLogin(...e)),textContent:e.toDisplayString(t.locale.login)},null,8,Ct)),"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[12]||(n[12]=(...e)=>t.submitComment&&t.submitComment(...e))},[t.isSubmitting?(e.openBlock(),e.createBlock(p,{key:0,size:16})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.locale.submit),1)],64))],8,Et)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{ref:"gifPopupRef",class:e.normalizeClass(["wl-gif-popup",{display:t.showGif}])},[e.createElementVNode("input",{ref:"gifSearchInputRef",type:"text",placeholder:t.locale.gifSearchPlaceholder,onInput:n[13]||(n[13]=(...e)=>t.onGifSearch&&t.onGifSearch(...e))},null,40,Bt),e.createVNode(v,{items:t.gifData.list,"column-width":200,gap:6,onInsert:n[14]||(n[14]=e=>t.insert(e)),onScroll:t.onImageWallScroll},null,8,["items","onScroll"]),t.gifData.loading?(e.openBlock(),e.createElementBlock("div",Nt,[e.createVNode(p,{size:30})])):e.createCommentVNode("v-if",!0)],2),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",It,[(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,Vt)):e.createCommentVNode("v-if",!0)],8,St)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),t.emoji.tabs.length>1?(e.openBlock(),e.createElementBlock("div",$t,[(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,Lt)],10,xt)))),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[15]||(n[15]=e=>t.$emit("cancel-reply"))},[e.createVNode(i,{size:24})],8,jt)):e.createCommentVNode("v-if",!0)])}],["__file","CommentBox.vue"]]);const Ot=["approved","waiting","spam"];var zt=e.defineComponent({components:{CommentBox:Rt,DeleteIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),LikeIcon:({active:t=!1})=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("path",{d:"M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z"+(t?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"),fill:t?"red":"currentColor"})]),ReplyIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),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"}))},props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object,default:null}},emits:["submit","reply","like","delete","status","sticky"],setup(t){const n=e.inject("config"),o=Je(),l=qe(),a=e.computed((()=>n.value.locale)),r=e.computed((()=>{const{link:e}=t.comment;return e?Ie(e)?e:`https://${e}`:""})),i=e.computed((()=>o.value.includes(t.comment.objectId))),c=((t,n)=>{const o=q();return e.computed((()=>je(t,o.value,n)))})(t.comment.insertedAt,a.value),s=e.computed((()=>"administrator"===l.value.type)),m=e.computed((()=>t.comment.user_id&&l.value.objectId===t.comment.user_id)),u=e.computed((()=>t.comment.objectId===t.reply?.objectId));return{config:n,locale:a,isReplyingCurrent:u,link:r,like:i,time:c,isAdmin:s,isOwner:m,commentStatus:Ot}}});const At=["id"],Dt={class:"wl-user","aria-hidden":"true"},Mt=["src"],Pt={class:"wl-card"},Tt={class:"wl-head"},Ut=["href"],Ft={key:1,class:"wl-nick"},_t=["textContent"],Ht=["textContent"],Wt=["textContent"],qt=["textContent"],Gt=["textContent"],Jt={class:"wl-comment-actions"},Kt=["title"],Qt=["textContent"],Yt=["title"],Zt={class:"wl-meta","aria-hidden":"true"},Xt=["textContent"],en=["textContent"],tn=["textContent"],nn=["innerHTML"],on={key:0,class:"wl-admin-actions"},ln={class:"wl-comment-status"},an=["disabled","onClick","textContent"],rn={key:1,class:"wl-reply-wrapper"},cn={key:2,class:"wl-quote"};var sn=ne(zt,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("VerifiedIcon"),c=e.resolveComponent("DeleteIcon"),s=e.resolveComponent("LikeIcon"),m=e.resolveComponent("ReplyIcon"),u=e.resolveComponent("CommentBox"),d=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{id:t.comment.objectId,class:"wl-item"},[e.createElementVNode("div",Dt,[t.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.comment.avatar},null,8,Mt)):e.createCommentVNode("v-if",!0),t.comment.type?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",Pt,[e.createElementVNode("div",Tt,[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,Ut)):(e.openBlock(),e.createElementBlock("span",Ft,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,_t)):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),void 0!==t.comment.level&&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,qt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(t.time)},null,8,Gt),e.createElementVNode("div",Jt,[t.isAdmin||t.isOwner?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-delete",onClick:n[0]||(n[0]=e=>t.$emit("delete",t.comment))},[e.createVNode(c)])):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:"wl-like",title:t.like?t.locale.cancelLike:t.locale.like,onClick:n[1]||(n[1]=e=>t.$emit("like",t.comment))},[e.createVNode(s,{active:t.like},null,8,["active"]),"like"in t.comment?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.like)},null,8,Qt)):e.createCommentVNode("v-if",!0)],8,Kt),e.createElementVNode("button",{class:e.normalizeClass(["wl-reply",{active:t.isReplyingCurrent}]),title:t.isReplyingCurrent?t.locale.cancelReply:t.locale.reply,onClick:n[2]||(n[2]=e=>t.$emit("reply",t.isReplyingCurrent?null:t.comment))},[e.createVNode(m)],10,Yt)])]),e.createElementVNode("div",Zt,[t.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.addr)},null,8,Xt)):e.createCommentVNode("v-if",!0),t.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,textContent:e.toDisplayString(t.comment.browser)},null,8,en)):e.createCommentVNode("v-if",!0),t.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,textContent:e.toDisplayString(t.comment.os)},null,8,tn)):e.createCommentVNode("v-if",!0)]),e.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),e.createElementVNode("div",{class:"wl-content",innerHTML:t.comment.comment},null,8,nn),t.isAdmin?(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("span",ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.commentStatus,(n=>(e.openBlock(),e.createElementBlock("button",{key:n,class:e.normalizeClass(`wl-btn wl-${n}`),disabled:t.comment.status===n,onClick:e=>t.$emit("status",{status:n,comment:t.comment}),textContent:e.toDisplayString(t.locale[n])},null,10,an)))),128))]),t.isAdmin&&!t.comment.rid?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn wl-sticky",onClick:n[3]||(n[3]=e=>t.$emit("sticky",t.comment))},e.toDisplayString(t.comment.sticky?t.locale.unsticky:t.locale.sticky),1)):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0),t.isReplyingCurrent?(e.openBlock(),e.createElementBlock("div",rn,[e.createVNode(u,{"reply-id":t.comment.objectId,"reply-user":t.comment.nick,"root-id":t.rootId,onSubmit:n[4]||(n[4]=e=>t.$emit("submit",e)),onCancelReply:n[5]||(n[5]=e=>t.$emit("reply",null))},null,8,["reply-id","reply-user","root-id"])])):e.createCommentVNode("v-if",!0),t.comment.children?(e.openBlock(),e.createElementBlock("div",cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment.children,(o=>(e.openBlock(),e.createBlock(d,{key:o.objectId,comment:o,reply:t.reply,"root-id":t.rootId,onReply:n[6]||(n[6]=e=>t.$emit("reply",e)),onSubmit:n[7]||(n[7]=e=>t.$emit("submit",e)),onLike:n[8]||(n[8]=e=>t.$emit("like",e)),onDelete:n[9]||(n[9]=e=>t.$emit("delete",e)),onStatus:n[10]||(n[10]=e=>t.$emit("status",e)),onSticky:n[11]||(n[11]=e=>t.$emit("sticky",e))},null,8,["comment","reply","root-id"])))),128))])):e.createCommentVNode("v-if",!0)])],8,At)}],["__file","CommentCard.vue"]]);const mn=[{key:"insertedAt_desc",name:"latest"},{key:"insertedAt_asc",name:"oldest"},{key:"like_desc",name:"hottest"}];var un=e.defineComponent({name:"WalineRoot",components:{CommentBox:Rt,CommentCard:sn,LoadingIcon:ee},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","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.1.0/weibo"],meta:a=["nick","mail","link"],requiredMeta:r=[],dark:i=!1,pageSize:c=10,wordLimit:s,imageUploader:m,highlighter:u,texRenderer:d,copyright:p=!0,login:v="enable",search:f=me(),...g})=>({serverURL:Se(e),path:Be(t),locale:{...Ee[n]||Ee["zh-CN"],..."object"==typeof o?o:{}},wordLimit:Ve(s),meta:ie(a),requiredMeta:ie(r),imageUploader:$e(m,ce),highlighter:$e(u,ve),texRenderer:$e(d,se),lang:n,dark:i,emoji:l,pageSize:c,login:v,copyright:p,search:f,...g}))(t))),o=qe(),l=Je(),a=e.ref("loading"),r=e.ref(0),i=e.ref(1),c=e.ref(0),s=e.ref(mn[0].key),m=e.ref([]),u=e.ref(null),d=e.computed((()=>{return"string"==typeof(e=n.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${xe}}`:`${e}${xe}`:!0===e?`:root${xe}`:"";var e}));let p;J(d);const v=e=>{const{serverURL:t,path:l,pageSize:u}=n.value,d=new AbortController;a.value="loading",p?.(),Ae({serverURL:t,lang:n.value.lang,path:l,pageSize:u,sortBy:s.value,page:e,signal:d.signal,token:o.value?.token}).then((t=>{a.value="success",r.value=t.count,m.value.push(...t.data),i.value=e,c.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),a.value="error")})),p=d.abort.bind(d)},f=()=>{r.value=0,m.value=[],v(1)};return e.provide("config",n),e.watch((()=>t.path),f),e.onMounted((()=>f())),{config:n,darkmodeStyle:d,i18n:e.computed((()=>n.value.locale)),status:a,count:r,page:i,totalPages:c,sortBy:s,sortByItems:mn,data:m,reply:u,loadMore:()=>v(i.value+1),refresh:f,onSortByChange:e=>{s.value!==e&&(s.value=e,f())},onReply:e=>{u.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)},onStatusChange:async({comment:e,status:t})=>{if(e.status===t)return;const{serverURL:l,lang:a}=n.value;await De({serverURL:l,lang:a,token:o.value?.token,objectId:e.objectId,status:t}),e.status=t},onDelete:async({objectId:e})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:t,lang:l}=n.value;await(({serverURL:e,lang:t,token:n,objectId:o})=>fetch(`${e}/comment/${o}?lang=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${n}`}}).then((e=>e.json())))({serverURL:t,lang:l,token:o.value?.token,objectId:e}),m.value.some(((t,n)=>t.objectId===e?(m.value=m.value.filter(((e,t)=>t!==n)),!0):t.children.some(((o,l)=>o.objectId===e&&(m.value[n].children=t.children.filter(((e,t)=>t!==l)),!0)))))},onSticky:async e=>{if(e.rid)return;const{serverURL:t,lang:l}=n.value;await De({serverURL:t,lang:l,token:o.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},onLike:async e=>{const{serverURL:t,lang:o}=n.value,{objectId:a}=e,r=l.value.includes(a);await(({serverURL:e,lang:t,objectId:n,like:o})=>fetch(`${e}/comment/${n}?lang=${t}`,{method:"PUT",headers:ze,body:JSON.stringify({like:o})}).then((e=>e.json())))({serverURL:t,lang:o,objectId:a,like:!r}),r?l.value=l.value.filter((e=>e!==a)):(l.value=[...l.value,a],l.value.length>50&&(l.value=l.value.slice(-50))),e.like=(e.like||0)+(r?-1:1)},version:"2.7.0"}}});const dn={"data-waline":""},pn={class:"wl-head"},vn={class:"wl-count"},fn=["textContent"],gn={class:"wl-sort"},hn=["onClick"],yn={class:"wl-cards"},kn={key:1,class:"wl-operation"},wn=["textContent"],bn={key:0,class:"wl-loading"},Cn=["textContent"],En={class:"wl-operation"},Bn=["textContent"],Nn={key:3,class:"wl-power"},In=e.createTextVNode(" Powered by "),Sn=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);var Vn=ne(un,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("CommentBox"),c=e.resolveComponent("CommentCard"),s=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",dn,[t.reply?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,onSubmit:t.onSubmit},null,8,["onSubmit"])),e.createElementVNode("div",pn,[e.createElementVNode("div",vn,[t.count?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(t.count)},null,8,fn)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.i18n.comment),1)]),e.createElementVNode("ul",gn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.sortByItems,(n=>(e.openBlock(),e.createElementBlock("li",{key:n.key,class:e.normalizeClass([n.key===t.sortBy?"active":""]),onClick:e=>t.onSortByChange(n.key)},e.toDisplayString(t.i18n[n.name]),11,hn)))),128))])]),e.createElementVNode("div",yn,[(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,onStatus:t.onStatusChange,onDelete:t.onDelete,onSticky:t.onSticky,onLike:t.onLike},null,8,["root-id","comment","reply","onReply","onSubmit","onStatus","onDelete","onSticky","onLike"])))),128))]),"error"===t.status?(e.openBlock(),e.createElementBlock("div",kn,[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,wn)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===t.status?(e.openBlock(),e.createElementBlock("div",bn,[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",En,[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,Bn)])],2112)):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(t.i18n.sofa)},null,8,Cn))],64)),e.createCommentVNode(" Copyright Information "),t.config.copyright?(e.openBlock(),e.createElementBlock("div",Nn,[In,Sn,e.createTextVNode(" v"+e.toDisplayString(t.version),1)])):e.createCommentVNode("v-if",!0)])}],["__file","Waline.vue"]]);exports.Waline=Vn,exports.version="2.7.0";
//# sourceMappingURL=component.js.map

@@ -121,2 +121,5 @@ interface WalineEmojiInfo {

unsticky: string;
oldest: string;
latest: string;
hottest: string;
}

@@ -123,0 +126,0 @@

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

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

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

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

@@ -189,2 +189,5 @@ interface WalineEmojiInfo {

unsticky: string;
oldest: string;
latest: string;
hottest: string;
}

@@ -191,0 +194,0 @@

@@ -189,2 +189,5 @@ interface WalineEmojiInfo {

unsticky: string;
oldest: string;
latest: string;
hottest: string;
}

@@ -191,0 +194,0 @@

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

import{getCurrentScope as e,onScopeDispose as t,getCurrentInstance as n,onMounted as l,nextTick as o,unref as a,ref as r,isRef as i,watch as s,readonly as c,shallowRef as u,computed as m,h as d,defineComponent as p,onBeforeUnmount as v,resolveComponent as g,openBlock as f,createElementBlock as h,normalizeStyle as w,Fragment as y,renderList as b,createBlock as k,createCommentVNode as C,createElementVNode as I,inject as $,reactive as L,onUnmounted as j,createVNode as S,toDisplayString as x,normalizeClass as R,withDirectives as E,vModelDynamic as O,vModelText as A,vShow as U,createTextVNode as z,provide as M,createApp as P,watchEffect as T}from"vue";import N from"autosize";import{marked as H}from"marked";const B=["nick","mail","link"],V=e=>e.filter((e=>B.includes(e))),F=e=>new Promise(((t,n)=>{if(e.size>128e3)return n(new Error("File too large! File size limit 128KB"));const l=new FileReader;l.readAsDataURL(e),l.onload=()=>t(l.result?.toString()||""),l.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>',D=()=>{const e={next:""},t=({keyword:e,pos:t})=>{const n=new URLSearchParams("media_filter=minimal");return n.set("key","PAY5JLFIH6V6"),n.set("limit","20"),n.set("pos",t||""),n.set("q",e),fetch(`https://g.tenor.com/v1/search?${n.toString()}`,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())).catch((()=>({next:t||"",results:[]})))};return{search:(n="")=>t({keyword:n}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url})))))),more:n=>t({keyword:n,pos:e.next}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url}))))))}},W=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"),G=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],q={},J=e=>{let t=0;return e.replace(W,((e,n,l)=>{if(l)return`<span style="color: slategray">${l}</span>`;if("<"===n)return"&lt;";let o;q[n]?o=q[n]:(o=G[t],q[n]=o);const a=`<span style="color: #${o}">${n}</span>`;return t=++t%G.length,a}))},K=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky"],Q=e=>Object.fromEntries(e.map(((e,t)=>[K[t],e])));var Y=Q(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words","Please input comments between $0 and $1 words!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky"]),Z=Q(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない"]),X=Q(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶"]),ee=Q(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂"]),te=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","Like","Cancel like","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","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky"]),ne=Q(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий"]);const le={zh:X,"zh-cn":X,"zh-CN":X,"zh-tw":ee,"zh-TW":ee,en:Y,"en-US":Y,"en-us":Y,jp:Z,"jp-jp":Z,"jp-JP":Z,"pt-br":te,"pt-BR":te,ru:ne,"ru-ru":ne,"ru-RU":ne};var oe;const ae="undefined"!=typeof window,re=()=>{};function ie(e){return"function"==typeof e?e():a(e)}function se(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}ae&&(null==(oe=null==window?void 0:window.navigator)?void 0:oe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const ce=e=>e();function ue(n){return!!e()&&(t(n),!0)}function me(e,t=200,n={}){return se(function(e,t={}){let n,l;return o=>{const a=ie(e),r=ie(t.maxWait);if(n&&clearTimeout(n),a<=0||void 0!==r&&r<=0)return l&&(clearTimeout(l),l=null),o();r&&!l&&(l=setTimeout((()=>{n&&clearTimeout(n),l=null,o()}),r)),n=setTimeout((()=>{l&&clearTimeout(l),l=null,o()}),a)}}(t,n),e)}var de=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;function ge(e,t,n={}){const l=n,{eventFilter:o=ce}=l,a=((e,t)=>{var n={};for(var l in e)pe.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&de)for(var l of de(e))t.indexOf(l)<0&&ve.call(e,l)&&(n[l]=e[l]);return n})(l,["eventFilter"]);return s(e,se(o,t),a)}var fe=Object.defineProperty,he=Object.defineProperties,we=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable,Ce=(e,t,n)=>t in e?fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function Ie(e,t,n={}){const l=n,{eventFilter:o}=l,a=((e,t)=>{var n={};for(var l in e)be.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&ye)for(var l of ye(e))t.indexOf(l)<0&&ke.call(e,l)&&(n[l]=e[l]);return n})(l,["eventFilter"]),{eventFilter:i,pause:s,resume:c,isActive:u}=function(e=ce){const t=r(!0);return{isActive:t,pause:function(){t.value=!1},resume:function(){t.value=!0},eventFilter:(...n)=>{t.value&&e(...n)}}}(o),m=ge(e,t,(d=((e,t)=>{for(var n in t||(t={}))be.call(t,n)&&Ce(e,n,t[n]);if(ye)for(var n of ye(t))ke.call(t,n)&&Ce(e,n,t[n]);return e})({},a),he(d,we({eventFilter:i}))));var d;return{stop:m,pause:s,resume:c,isActive:u}}const $e=ae?window:void 0,Le=ae?window.document:void 0;function je(...e){let t,n,l,o;if("string"==typeof e[0]?([n,l,o]=e,t=$e):[t,n,l,o]=e,!t)return re;let a=re;const r=s((()=>function(e){var t;const n=ie(e);return null!=(t=null==n?void 0:n.$el)?t:n}(t)),(e=>{a(),e&&(e.addEventListener(n,l,o),a=()=>{e.removeEventListener(n,l,o),a=re})}),{immediate:!0,flush:"post"}),i=()=>{r(),a()};return ue(i),i}ae&&window.navigator,ae&&window.location;const Se="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},xe="__vueuse_ssr_handlers__";Se[xe]=Se[xe]||{};const Re=Se[xe];var Ee=Object.defineProperty,Oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,ze=(e,t,n)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Me=(e,t)=>{for(var n in t||(t={}))Ae.call(t,n)&&ze(e,n,t[n]);if(Oe)for(var n of Oe(t))Ue.call(t,n)&&ze(e,n,t[n]);return e};const Pe={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 Te(e,t,n,l={}){var o;const{flush:a="pre",deep:i=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:m=!1,shallow:d,window:p=$e,eventFilter:v,onError:g=(e=>{console.error(e)})}=l,f=(d?u:r)(t);if(!n)try{n=function(e,t){return Re[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=$e)?void 0:e.localStorage}))()}catch(e){g(e)}if(!n)return f;const h=ie(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!=(o=l.serializer)?o:Pe[w],{pause:b,resume:k}=Ie(f,(()=>function(t){try{null==t?n.removeItem(e):n.setItem(e,y.write(t))}catch(e){g(e)}}(f.value)),{flush:a,deep:i,eventFilter:v});return p&&s&&je(p,"storage",C),C(),f;function C(t){t&&t.key!==e||(f.value=function(t){if(!t||t.key===e){b();try{const l=t?t.newValue:n.getItem(e);if(null==l)return c&&null!==h&&n.setItem(e,y.write(h)),h;if(!t&&m){const e=y.read(l);return"function"==typeof m?m(e,h):"object"!==w||Array.isArray(e)?e:Me(Me({},h),e)}return"string"!=typeof l?l:y.read(l)}catch(e){g(e)}finally{k()}}}(t))}}var Ne,He,Be=Object.defineProperty,Ve=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable,De=(e,t,n)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function We(e={}){const{controls:t=!1,interval:n="requestAnimationFrame"}=e,l=r(new Date),o=()=>l.value=new Date,c="requestAnimationFrame"===n?function(e,t={}){const{immediate:n=!0,window:l=$e}=t,o=r(!1);let a=null;function i(){o.value&&l&&(e(),a=l.requestAnimationFrame(i))}function s(){!o.value&&l&&(o.value=!0,i())}function c(){o.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return n&&s(),ue(c),{isActive:o,pause:c,resume:s}}(o,{immediate:!0}):function(e,t=1e3,n={}){const{immediate:l=!0,immediateCallback:o=!1}=n;let c=null;const u=r(!1);function m(){c&&(clearInterval(c),c=null)}function d(){u.value=!1,m()}function p(){a(t)<=0||(u.value=!0,o&&e(),m(),c=setInterval(e,ie(t)))}l&&ae&&p(),i(t)&&ue(s(t,(()=>{u.value&&ae&&p()})));return ue(d),{isActive:u,pause:d,resume:p}}(o,n,{immediate:!0});return t?((e,t)=>{for(var n in t||(t={}))Fe.call(t,n)&&De(e,n,t[n]);if(Ve)for(var n of Ve(t))_e.call(t,n)&&De(e,n,t[n]);return e})({now:l},c):l}(He=Ne||(Ne={})).UP="UP",He.RIGHT="RIGHT",He.DOWN="DOWN",He.LEFT="LEFT",He.NONE="NONE";let Ge=0;function qe(e,t={}){const a=r(!1),{document:i=Le,immediate:u=!0,manual:m=!1,id:d="vueuse_styletag_"+ ++Ge}=t,p=r(e);let v=()=>{};const g=()=>{if(!i)return;const e=i.getElementById(d)||i.createElement("style");e.type="text/css",e.id=d,t.media&&(e.media=t.media),i.head.appendChild(e),a.value||(v=s(p,(t=>{e.innerText=t}),{immediate:!0}),a.value=!0)},f=()=>{i&&a.value&&(v(),i.head.removeChild(i.getElementById(d)),a.value=!1)};return u&&!m&&function(e,t=!0){n()?l(e):t?e():o(e)}(g),m||ue(f),{id:d,css:p,unload:f,load:g,isLoaded:c(a)}}var Je=Object.defineProperty,Ke=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Ze=(e,t,n)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))Qe.call(t,n)&&Ze(e,n,t[n]);if(Ke)for(var n of Ke(t))Ye.call(t,n)&&Ze(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Xe=e=>{try{e=decodeURI(e)}catch(e){}return e},et=(e="")=>e.replace(/\/$/u,""),tt=e=>/^(https?:)?\/\//.test(e),nt=e=>{const t=et(e);return tt(t)?t:`https://${t}`},lt=e=>Array.isArray(e)?e:!!e&&[0,e],ot=(e,t)=>"function"==typeof e?e:!1!==e&&t,at="{--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}",rt=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},it=(e,t,n)=>{if(!e)return"";const l="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,o=t.getTime()-l.getTime(),a=Math.floor(o/864e5);if(0===a){const e=o%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,l=Math.floor(t/6e4);if(0===l){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${l} ${n.minutes}`}return`${t} ${n.hours}`}return a<0?n.now:a<8?`${a} ${n.days}`:(e=>{const t=rt(e.getDate(),2),n=rt(e.getMonth()+1,2);return`${rt(e.getFullYear(),2)}-${n}-${t}`})(l)},st=e=>{const t=Te("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((l=>{const o={folder:e,...l};return n&&(t.value[e]=o),o}))},ct=(e,t="",n="",l="")=>`${t?`${t}/`:""}${n}${e}${l?`.${l}`:""}`,ut=e=>{"AbortError"!==e.name&&console.error(e.message)},mt={"Content-Type":"application/json"},dt=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},pt=({serverURL:e,lang:t,token:n,objectId:l,...o})=>fetch(`${e}/comment/${l}?lang=${t}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(o)}).then((e=>e.json())),vt=({serverURL:e,lang:t,paths:n,signal:l})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:l}).then((e=>e.json())).then((e=>dt(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),gt=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:mt,body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>dt(e,"visit count"))),ft=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,ht=e=>e.type.includes("image"),wt=e=>{const t=Array.from(e).find(ht);return t?t.getAsFile():null},yt=/\$.*?\$/,bt=/^\$(.*?)\$/,kt=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Ct=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),It=(e,{emojiMap:t,highlighter:n,texRenderer:l})=>{if(H.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),l){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=kt.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(yt);return-1!==t?t:e.length},tokenizer(t){const n=bt.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(l);H.use({extensions:e})}return H.parse(Ct(e,t))},$t=e=>e.dataset.path||e.getAttribute("id");let Lt=null;const jt=()=>Lt||(Lt=Te("WALINE_USER",{}));let St=null;const xt=()=>St||(St=Te("WALINE_LIKE",[])),Rt=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:l="zh-CN"})=>{const o=new AbortController,a=document.querySelectorAll(n),r=jt();return a.length&&(({serverURL:e,lang:t,paths:n,signal:l,token:o})=>{const a={};return o&&(a.Authorization=`Bearer ${o}`),fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:l,headers:a}).then((e=>e.json())).then((e=>dt(e,"comment count"))).then((e=>Array.isArray(e)?e:[e]))})({serverURL:nt(e),paths:Array.from(a).map((e=>Xe(e.dataset.path||e.getAttribute("id")||t))),lang:l,signal:o.signal,token:r.value?.token}).then((e=>{a.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(ut),o.abort.bind(o)},Et=({size:e})=>d("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},d("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},d("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Ot=p({name:"ImageWall",components:{LoadingIcon:Et},props:{items:{type:Array,default:()=>[]},columnWidth:{type:Number,default:300},gap:{type:Number,default:0}},emits:["insert"],setup(e){let t=null;const n=r(null),a=r({}),i=r([]),c=()=>{const t=Math.floor((n.value.getBoundingClientRect().width+e.gap)/(e.columnWidth+e.gap));return t>0?t:1},u=async t=>{if(t>=e.items.length)return;await o();const l=Array.from(n.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));i.value[Number(l.dataset.index)].push(t),await u(t+1)},m=async(e=!1)=>{if(i.value.length===c()&&!e)return;var t;i.value=(t=c(),new Array(t).fill(null).map((()=>[])));const n=window.scrollY;await u(0),window.scrollTo({top:n})};return s((()=>[e.items]),(()=>{a.value={},m(!0)})),s((()=>[e.columnWidth,e.gap]),(()=>m())),l((()=>{m(!0),t=new ResizeObserver((()=>m())),t.observe(n.value)})),v((()=>t.unobserve(n.value))),{columns:i,state:a,wall:n}}}),At=(e,t)=>{const n=e.__vccOpts||e;for(const[e,l]of t)n[e]=l;return n};const Ut=["data-index"],zt=["src","title","onLoad","onClick"];var Mt=p({name:"CommentBox",components:{CloseIcon:({size:e})=>d("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[d("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"}),d("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:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},d("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:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[d("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"}),d("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"})]),ImageWall:At(Ot,[["render",function(e,t,n,l,o,a){const r=g("LoadingIcon");return f(),h("div",{ref:"wall",class:"wl-gallery",style:w({gap:`${e.gap}px`})},[(f(!0),h(y,null,b(e.columns,((t,n)=>(f(),h("div",{key:n,class:"wl-gallery-column","data-index":n,style:w({gap:`${e.gap}px`})},[(f(!0),h(y,null,b(t,(t=>(f(),h(y,{key:t},[e.state[e.items[t].src]?C("v-if",!0):(f(),k(r,{key:0,size:36,style:{margin:"20px auto"}})),I("img",{class:"wl-gallery-item",src:e.items[t].src,title:e.items[t].title,loading:"lazy",onLoad:n=>e.state[e.items[t].src]=!0,onClick:n=>e.$emit("insert",`![](${e.items[t].src})`)},null,40,zt)],64)))),128))],12,Ut)))),128))],4)}],["__file","ImageWall.vue"]]),MarkdownIcon:()=>d("svg",{width:"16",height:"16",ariaHidden:"true"},d("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:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[d("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"}),d("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:Et,GifIcon:()=>d("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[d("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),d("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})])},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(e,{emit:t}){const n=$("config"),o=Te("WALINE_COMMENT_BOX_EDITOR",""),a=Te("WALINE_USER_META",{nick:"",mail:"",link:""}),i=jt(),c=r({}),u=r(null),d=r(null),p=r(null),v=r(null),g=r(null),f=r(null),h=r(null),w=r({tabs:[],map:{}}),y=r(0),b=r(!1),k=r(!1),C=r(!1),I=r(""),S=r(0),x=L({loading:!0,list:[]}),R=r(0),E=r(!1),O=r(""),A=r(!1),U=m((()=>n.value.locale)),z=m((()=>Boolean(i.value?.token))),M=m((()=>!1!==n.value.imageUploader)),P=e=>{const t=u.value,n=t.selectionStart,l=t.selectionEnd||0,a=t.scrollTop;o.value=t.value.substring(0,n)+e+t.value.substring(l,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=a},T=e=>{const t=`![${n.value.locale.uploading} ${e.name}]()`;return P(t),Promise.resolve().then((()=>n.value.imageUploader(e))).then((n=>{o.value=o.value.replace(t,`\r\n![${e.name}](${n})`)})).catch((e=>{alert(e.message),o.value=o.value.replace(t,"")}))},H=()=>{const{serverURL:l,lang:r,login:s,wordLimit:m,requiredMeta:d}=n.value,p={comment:O.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:n.value.path};if(i.value?.token)p.nick=i.value.display_name,p.mail=i.value.email,p.link=i.value.url;else{if("force"===s)return;if(d.indexOf("nick")>-1&&!p.nick)return c.value.nick?.focus(),alert(U.value.nickError);if(d.indexOf("mail")>-1&&!p.mail||p.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(p.mail))return c.value.mail?.focus(),alert(U.value.mailError);if(!p.comment)return void u.value?.focus();p.nick||(p.nick=U.value.anonymous)}if(!E.value)return alert(U.value.wordHint.replace("$0",m[0].toString()).replace("$1",m[1].toString()).replace("$2",S.value.toString()));p.comment=Ct(p.comment,w.value.map),e.replyId&&e.rootId&&(p.pid=e.replyId,p.rid=e.rootId,p.at=e.replyUser),A.value=!0,(({serverURL:e,lang:t,token:n,comment:l})=>{const o={"Content-Type":"application/json"};return n&&(o.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:o,body:JSON.stringify(l)}).then((e=>e.json()))})({serverURL:l,lang:r,token:i.value?.token,comment:p}).then((n=>{if(A.value=!1,n.errmsg)return alert(n.errmsg);t("submit",n.data),o.value="",I.value="",e.replyId&&t("cancel-reply")})).catch((e=>{A.value=!1,alert(e.message)}))},B=e=>{p.value.contains(e.target)||v.value.contains(e.target)||(b.value=!1),g.value.contains(e.target)||f.value.contains(e.target)||(k.value=!1)},V=async e=>{const{scrollTop:t,clientHeight:l,scrollHeight:o}=e.target,a=(l+t)/o,r=n.value.search,i=h.value?.value||"";a<.9||x.loading||(x.loading=!0,x.list.push(...r.more?await r.more(i,x.list.length):await r.search(i)),x.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},F=me((e=>{x.list=[],V(e)}),300);s([n,S],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(R.value=n[0],E.value=!1):t>n[1]?(R.value=n[1],E.value=!1):(R.value=n[1],E.value=!0):(R.value=0,E.value=!0)}),{immediate:!0}),s(k,(async e=>{if(!e)return;const t=n.value.search;h.value&&(h.value.value=""),x.loading=!0,x.list=t.default?await t.default():await t.search(""),x.loading=!1}));const _=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))))};return l((()=>{document.body.addEventListener("click",B),window.addEventListener("message",_),s((()=>o.value),(e=>{const{highlighter:t,texRenderer:l}=n.value;O.value=e,I.value=It(e,{emojiMap:w.value.map,highlighter:t,texRenderer:l}),S.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?N(u.value):N.destroy(u.value)}),{immediate:!0}),s((()=>n.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?st(et(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:l,icon:o,prefix:a,type:r,items:i}=e;t.tabs.push({name:n,icon:ct(o,l,a,r),items:i.map((e=>{const n=`${a||""}${e}`;return t.map[n]=ct(e,l,a,r),n}))})})),t}))).then((e=>{w.value=e}));var t}),{immediate:!0})})),j((()=>{document.body.removeEventListener("click",B),window.removeEventListener("message",_)})),{config:n,locale:U,insert:P,onChange:()=>{const e=d.value;e.files&&M.value&&T(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{if(e.dataTransfer?.items){const t=wt(e.dataTransfer.items);t&&M.value&&(T(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&H()},onPaste:e=>{if(e.clipboardData){const t=wt(e.clipboardData.items);t&&M.value&&T(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:l}=n.value,o=(window.innerWidth-450)/2,a=(window.innerHeight-450)/2,r=window.open(`${l}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${o},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);r?.postMessage({type:"TOKEN",data:null},"*");const s=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(r?.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:l}=n.value,o=(window.innerWidth-800)/2,a=(window.innerHeight-800)/2;window.open(`${l}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${o},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`)?.postMessage({type:"TOKEN",data:i.value.token},"*")},submitComment:H,onImageWallScroll:V,onGifSearch:F,isLogin:z,userInfo:i,isSubmitting:A,wordNumber:S,wordLimit:R,isWordNumberLegal:E,editor:o,userMeta:a,emoji:w,emojiTabIndex:y,showEmoji:b,gifData:x,showGif:k,canUploadImage:M,previewText:I,showPreview:C,inputRefs:c,editorRef:u,emojiButtonRef:p,emojiPopupRef:v,gifButtonRef:g,gifPopupRef:f,imageUploadRef:d,gifSearchInputRef:h}}});const Pt={class:"wl-comment"},Tt={key:0,class:"wl-login-info"},Nt={class:"wl-avatar"},Ht=["title"],Bt=["title"],Vt=["src"],Ft=["title","textContent"],_t={class:"wl-panel"},Dt=["for","textContent"],Wt=["id","onUpdate:modelValue","name","type"],Gt=["placeholder"],qt={class:"wl-preview"},Jt=I("hr",null,null,-1),Kt=["innerHTML"],Qt={class:"wl-footer"},Yt={class:"wl-actions"},Zt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},Xt=["title"],en=["title"],tn=["title"],nn=["title"],ln={class:"wl-info"},on={class:"wl-text-number"},an={key:0},rn=z("  /  "),sn=["textContent"],cn=["textContent"],un=["disabled"],mn=["placeholder"],dn={key:0,class:"wl-loading"},pn={key:0,class:"wl-tab-wrapper"},vn=["title","onClick"],gn=["src","alt"],fn={key:0,class:"wl-tabs"},hn=["onClick"],wn=["src","alt","title"],yn=["title"];var bn=At(Mt,[["render",function(e,t,n,l,o,a){const r=g("CloseIcon"),i=g("MarkdownIcon"),s=g("EmojiIcon"),c=g("GifIcon"),u=g("ImageIcon"),m=g("PreviewIcon"),d=g("LoadingIcon"),p=g("ImageWall");return f(),h("div",Pt,["disable"!==e.config.login&&e.isLogin?(f(),h("div",Tt,[I("div",Nt,[I("button",{class:"wl-logout-btn",title:e.locale.logout,onClick:t[0]||(t[0]=(...t)=>e.onLogout&&e.onLogout(...t))},[S(r,{size:14})],8,Ht),I("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:t[1]||(t[1]=(...t)=>e.onProfile&&e.onProfile(...t))},[I("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,Vt)],8,Bt)]),I("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:t[2]||(t[2]=(...t)=>e.onProfile&&e.onProfile(...t)),textContent:x(e.userInfo.display_name)},null,8,Ft)])):C("v-if",!0),I("div",_t,["force"!==e.config.login&&e.config.meta.length&&!e.isLogin?(f(),h("div",{key:0,class:R(["wl-header",`item${e.config.meta.length}`])},[(f(!0),h(y,null,b(e.config.meta,(t=>(f(),h("div",{key:t,class:"wl-header-item"},[I("label",{for:t,textContent:x(e.locale[t]+(e.config.requiredMeta.includes(t)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,Dt),E(I("input",{id:`wl-${t}`,ref_for:!0,ref:n=>{n&&(e.inputRefs[t]=n)},"onUpdate:modelValue":n=>e.userMeta[t]=n,class:R(["wl-input",`wl-${t}`]),name:t,type:"mail"===t?"email":"text"},null,10,Wt),[[O,e.userMeta[t]]])])))),128))],2)):C("v-if",!0),E(I("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":t[3]||(t[3]=t=>e.editor=t),class:"wl-editor",placeholder:e.replyUser?`@${e.replyUser}`:e.locale.placeholder,onKeydown:t[4]||(t[4]=(...t)=>e.onKeyDown&&e.onKeyDown(...t)),onDrop:t[5]||(t[5]=(...t)=>e.onDrop&&e.onDrop(...t)),onPaste:t[6]||(t[6]=(...t)=>e.onPaste&&e.onPaste(...t))},null,40,Gt),[[A,e.editor]]),E(I("div",qt,[Jt,I("h4",null,x(e.locale.preview)+":",1),C(" eslint-disable-next-line vue/no-v-html "),I("div",{class:"wl-content",innerHTML:e.previewText},null,8,Kt)],512),[[U,e.showPreview]]),I("div",Qt,[I("div",Yt,[I("a",Zt,[S(i)]),E(I("button",{ref:"emojiButtonRef",class:R(["wl-action",{actived:e.showEmoji}]),title:e.locale.emoji,onClick:t[7]||(t[7]=t=>e.showEmoji=!e.showEmoji)},[S(s)],10,Xt),[[U,e.emoji.tabs.length]]),e.config.search?(f(),h("button",{key:0,ref:"gifButtonRef",class:R(["wl-action",{actived:e.showGif}]),title:e.locale.gif,onClick:t[8]||(t[8]=t=>e.showGif=!e.showGif)},[S(c)],10,en)):C("v-if",!0),I("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:t[9]||(t[9]=(...t)=>e.onChange&&e.onChange(...t))},null,544),e.canUploadImage?(f(),h("label",{key:1,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[S(u)],8,tn)):C("v-if",!0),I("button",{class:R(["wl-action",{actived:e.showPreview}]),title:e.locale.preview,onClick:t[10]||(t[10]=t=>e.showPreview=!e.showPreview)},[S(m)],10,nn)]),I("div",ln,[I("div",on,[z(x(e.wordNumber)+" ",1),e.config.wordLimit?(f(),h("span",an,[rn,I("span",{class:R({illegal:!e.isWordNumberLegal}),textContent:x(e.wordLimit)},null,10,sn)])):C("v-if",!0),z("  "+x(e.locale.word),1)]),"disable"===e.config.login||e.isLogin?C("v-if",!0):(f(),h("button",{key:0,class:"wl-btn",onClick:t[11]||(t[11]=(...t)=>e.onLogin&&e.onLogin(...t)),textContent:x(e.locale.login)},null,8,cn)),"force"!==e.config.login||e.isLogin?(f(),h("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:t[12]||(t[12]=(...t)=>e.submitComment&&e.submitComment(...t))},[e.isSubmitting?(f(),k(d,{key:0,size:16})):(f(),h(y,{key:1},[z(x(e.locale.submit),1)],64))],8,un)):C("v-if",!0)]),I("div",{ref:"gifPopupRef",class:R(["wl-gif-popup",{display:e.showGif}])},[I("input",{ref:"gifSearchInputRef",type:"text",placeholder:e.locale.gifSearchPlaceholder,onInput:t[13]||(t[13]=(...t)=>e.onGifSearch&&e.onGifSearch(...t))},null,40,mn),S(p,{items:e.gifData.list,"column-width":200,gap:6,onInsert:t[14]||(t[14]=t=>e.insert(t)),onScroll:e.onImageWallScroll},null,8,["items","onScroll"]),e.gifData.loading?(f(),h("div",dn,[S(d,{size:30})])):C("v-if",!0)],2),I("div",{ref:"emojiPopupRef",class:R(["wl-emoji-popup",{display:e.showEmoji}])},[(f(!0),h(y,null,b(e.emoji.tabs,((t,n)=>(f(),h(y,{key:t.name},[n===e.emojiTabIndex?(f(),h("div",pn,[(f(!0),h(y,null,b(t.items,(t=>(f(),h("button",{key:t,title:t,onClick:n=>e.insert(`:${t}:`)},[e.showEmoji?(f(),h("img",{key:0,class:"wl-emoji",src:e.emoji.map[t],alt:t,loading:"lazy",referrerPolicy:"no-referrer"},null,8,gn)):C("v-if",!0)],8,vn)))),128))])):C("v-if",!0)],64)))),128)),e.emoji.tabs.length>1?(f(),h("div",fn,[(f(!0),h(y,null,b(e.emoji.tabs,((t,n)=>(f(),h("button",{key:t.name,class:R(["wl-tab",{active:e.emojiTabIndex===n}]),onClick:t=>e.emojiTabIndex=n},[I("img",{class:"wl-emoji",src:t.icon,alt:t.name,title:t.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,wn)],10,hn)))),128))])):C("v-if",!0)],2)])]),e.replyId?(f(),h("button",{key:1,class:"wl-close",title:e.locale.cancelReply,onClick:t[15]||(t[15]=t=>e.$emit("cancel-reply"))},[S(r,{size:24})],8,yn)):C("v-if",!0)])}],["__file","CommentBox.vue"]]);const kn=["approved","waiting","spam"];var Cn=p({components:{CommentBox:bn,DeleteIcon:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},d("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),LikeIcon:({active:e=!1})=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[d("path",{d:"M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z"+(e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"),fill:e?"red":"currentColor"})]),ReplyIcon:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},d("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),VerifiedIcon:()=>d("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},d("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"}))},props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object,default:null}},emits:["submit","reply","like","delete","status","sticky"],setup(e){const t=$("config"),n=xt(),l=jt(),o=m((()=>t.value.locale)),a=m((()=>{const{link:t}=e.comment;return t?tt(t)?t:`https://${t}`:""})),r=m((()=>n.value.includes(e.comment.objectId))),i=((e,t)=>{const n=We();return m((()=>it(e,n.value,t)))})(e.comment.insertedAt,o.value),s=m((()=>"administrator"===l.value.type)),c=m((()=>e.comment.user_id&&l.value.objectId===e.comment.user_id)),u=m((()=>e.comment.objectId===e.reply?.objectId));return{config:t,locale:o,isReplyingCurrent:u,link:a,like:r,time:i,isAdmin:s,isOwner:c,commentStatus:kn}}});const In=["id"],$n={class:"wl-user","aria-hidden":"true"},Ln=["src"],jn={class:"wl-card"},Sn={class:"wl-head"},xn=["href"],Rn={key:1,class:"wl-nick"},En=["textContent"],On=["textContent"],An=["textContent"],Un=["textContent"],zn=["textContent"],Mn={class:"wl-comment-actions"},Pn=["title"],Tn=["textContent"],Nn=["title"],Hn={class:"wl-meta","aria-hidden":"true"},Bn=["textContent"],Vn=["textContent"],Fn=["textContent"],_n=["innerHTML"],Dn={key:0,class:"wl-admin-actions"},Wn={class:"wl-comment-status"},Gn=["disabled","onClick","textContent"],qn={key:1,class:"wl-reply-wrapper"},Jn={key:2,class:"wl-quote"};var Kn=p({name:"WalineRoot",components:{CommentBox:bn,CommentCard:At(Cn,[["render",function(e,t,n,l,o,a){const r=g("VerifiedIcon"),i=g("DeleteIcon"),s=g("LikeIcon"),c=g("ReplyIcon"),u=g("CommentBox"),m=g("CommentCard",!0);return f(),h("div",{id:e.comment.objectId,class:"wl-item"},[I("div",$n,[e.comment.avatar?(f(),h("img",{key:0,src:e.comment.avatar},null,8,Ln)):C("v-if",!0),e.comment.type?(f(),k(r,{key:1})):C("v-if",!0)]),I("div",jn,[I("div",Sn,[e.link?(f(),h("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noreferrer"},x(e.comment.nick),9,xn)):(f(),h("span",Rn,x(e.comment.nick),1)),"administrator"===e.comment.type?(f(),h("span",{key:2,class:"wl-badge",textContent:x(e.locale.admin)},null,8,En)):C("v-if",!0),e.comment.label?(f(),h("span",{key:3,class:"wl-badge",textContent:x(e.comment.label)},null,8,On)):C("v-if",!0),e.comment.sticky?(f(),h("span",{key:4,class:"wl-badge",textContent:x(e.locale.sticky)},null,8,An)):C("v-if",!0),void 0!==e.comment.level&&e.comment.level>=0?(f(),h("span",{key:5,class:R(`wl-badge level${e.comment.level}`),textContent:x(e.locale[`level${e.comment.level}`]||`Level ${e.comment.level}`)},null,10,Un)):C("v-if",!0),I("span",{class:"wl-time",textContent:x(e.time)},null,8,zn),I("div",Mn,[e.isAdmin||e.isOwner?(f(),h("button",{key:0,class:"wl-delete",onClick:t[0]||(t[0]=t=>e.$emit("delete",e.comment))},[S(i)])):C("v-if",!0),I("button",{class:"wl-like",title:e.like?e.locale.cancelLike:e.locale.like,onClick:t[1]||(t[1]=t=>e.$emit("like",e.comment))},[S(s,{active:e.like},null,8,["active"]),"like"in e.comment?(f(),h("span",{key:0,textContent:x(e.comment.like)},null,8,Tn)):C("v-if",!0)],8,Pn),I("button",{class:R(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:t[2]||(t[2]=t=>e.$emit("reply",e.isReplyingCurrent?null:e.comment))},[S(c)],10,Nn)])]),I("div",Hn,[e.comment.addr?(f(),h("span",{key:0,textContent:x(e.comment.addr)},null,8,Bn)):C("v-if",!0),e.comment.browser?(f(),h("span",{key:1,textContent:x(e.comment.browser)},null,8,Vn)):C("v-if",!0),e.comment.os?(f(),h("span",{key:2,textContent:x(e.comment.os)},null,8,Fn)):C("v-if",!0)]),C(" eslint-disable-next-line vue/no-v-html "),I("div",{class:"wl-content",innerHTML:e.comment.comment},null,8,_n),e.isAdmin?(f(),h("div",Dn,[I("span",Wn,[(f(!0),h(y,null,b(e.commentStatus,(t=>(f(),h("button",{key:t,class:R(`wl-btn wl-${t}`),disabled:e.comment.status===t,onClick:n=>e.$emit("status",{status:t,comment:e.comment}),textContent:x(e.locale[t])},null,10,Gn)))),128))]),e.isAdmin&&!e.comment.rid?(f(),h("button",{key:0,class:"wl-btn wl-sticky",onClick:t[3]||(t[3]=t=>e.$emit("sticky",e.comment))},x(e.comment.sticky?e.locale.unsticky:e.locale.sticky),1)):C("v-if",!0)])):C("v-if",!0),e.isReplyingCurrent?(f(),h("div",qn,[S(u,{"reply-id":e.comment.objectId,"reply-user":e.comment.nick,"root-id":e.rootId,onSubmit:t[4]||(t[4]=t=>e.$emit("submit",t)),onCancelReply:t[5]||(t[5]=t=>e.$emit("reply",null))},null,8,["reply-id","reply-user","root-id"])])):C("v-if",!0),e.comment.children?(f(),h("div",Jn,[(f(!0),h(y,null,b(e.comment.children,(n=>(f(),k(m,{key:n.objectId,comment:n,reply:e.reply,"root-id":e.rootId,onReply:t[6]||(t[6]=t=>e.$emit("reply",t)),onSubmit:t[7]||(t[7]=t=>e.$emit("submit",t)),onLike:t[8]||(t[8]=t=>e.$emit("like",t)),onDelete:t[9]||(t[9]=t=>e.$emit("delete",t)),onStatus:t[10]||(t[10]=t=>e.$emit("status",t)),onSticky:t[11]||(t[11]=t=>e.$emit("sticky",t))},null,8,["comment","reply","root-id"])))),128))])):C("v-if",!0)])],8,In)}],["__file","CommentCard.vue"]]),LoadingIcon:Et},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright"],setup(e){const t=m((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:l,emoji:o=["//unpkg.com/@waline/emojis@1.1.0/weibo"],meta:a=["nick","mail","link"],requiredMeta:r=[],dark:i=!1,pageSize:s=10,wordLimit:c,imageUploader:u,highlighter:m,texRenderer:d,copyright:p=!0,login:v="enable",search:g=D(),...f})=>({serverURL:nt(e),path:Xe(t),locale:{...le[n]||le["zh-CN"],..."object"==typeof l?l:{}},wordLimit:lt(c),meta:V(a),requiredMeta:V(r),imageUploader:ot(u,F),highlighter:ot(m,J),texRenderer:ot(d,_),lang:n,dark:i,emoji:o,pageSize:s,login:v,copyright:p,search:g,...f}))(e))),n=jt(),o=xt(),a=r("loading"),i=r(0),c=r(1),u=r(0),d=r([]),p=r(null),v=m((()=>{return"string"==typeof(e=t.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${at}}`:`${e}${at}`:!0===e?`:root${at}`:"";var e}));let g;qe(v);const f=e=>{const{serverURL:l,path:o,pageSize:r}=t.value,s=new AbortController;a.value="loading",g?.(),(({serverURL:e,lang:t,path:n,page:l,pageSize:o,signal:a,token:r})=>{const i={};return r&&(i.Authorization=`Bearer ${r}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${o}&page=${l}&lang=${t}`,{signal:a,headers:i}).then((e=>e.json())).then((e=>dt(e,"comment list")))})({serverURL:l,lang:t.value.lang,path:o,pageSize:r,page:e,signal:s.signal,token:n.value?.token}).then((t=>{a.value="success",i.value=t.count,d.value.push(...t.data),c.value=e,u.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),a.value="error")})),g=s.abort.bind(s)},h=()=>{i.value=0,d.value=[],f(1)};return M("config",t),s((()=>e.path),h),l((()=>h())),{config:t,darkmodeStyle:v,i18n:m((()=>t.value.locale)),status:a,count:i,page:c,totalPages:u,data:d,reply:p,loadMore:()=>f(c.value+1),refresh:h,onReply:e=>{p.value=e},onSubmit:e=>{if(e.rid){const t=d.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else d.value.unshift(e)},onStatusChange:async({comment:e,status:l})=>{if(e.status===l)return;const{serverURL:o,lang:a}=t.value;await pt({serverURL:o,lang:a,token:n.value?.token,objectId:e.objectId,status:l}),e.status=l},onDelete:async({objectId:e})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:l,lang:o}=t.value;await(({serverURL:e,lang:t,token:n,objectId:l})=>fetch(`${e}/comment/${l}?lang=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${n}`}}).then((e=>e.json())))({serverURL:l,lang:o,token:n.value?.token,objectId:e}),d.value.some(((t,n)=>t.objectId===e?(d.value=d.value.filter(((e,t)=>t!==n)),!0):t.children.some(((l,o)=>l.objectId===e&&(d.value[n].children=t.children.filter(((e,t)=>t!==o)),!0)))))},onSticky:async e=>{if(e.rid)return;const{serverURL:l,lang:o}=t.value;await pt({serverURL:l,lang:o,token:n.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},onLike:async e=>{const{serverURL:n,lang:l}=t.value,{objectId:a}=e,r=o.value.includes(a);await(({serverURL:e,lang:t,objectId:n,like:l})=>fetch(`${e}/comment/${n}?lang=${t}`,{method:"PUT",headers:mt,body:JSON.stringify({like:l})}).then((e=>e.json())))({serverURL:n,lang:l,objectId:a,like:!r}),r?o.value=o.value.filter((e=>e!==a)):(o.value=[...o.value,a],o.value.length>50&&(o.value=o.value.slice(-50))),e.like=(e.like||0)+(r?-1:1)},version:"2.6.4"}}});const Qn={"data-waline":""},Yn={class:"wl-count"},Zn=["textContent"],Xn={class:"wl-cards"},el={key:1,class:"wl-operation"},tl=["textContent"],nl={key:0,class:"wl-loading"},ll=["textContent"],ol={class:"wl-operation"},al=["textContent"],rl={key:3,class:"wl-power"},il=z(" Powered by "),sl=I("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);var cl=At(Kn,[["render",function(e,t,n,l,o,a){const r=g("CommentBox"),i=g("CommentCard"),s=g("LoadingIcon");return f(),h("div",Qn,[e.reply?C("v-if",!0):(f(),k(r,{key:0,onSubmit:e.onSubmit},null,8,["onSubmit"])),I("div",Yn,[e.count?(f(),h("span",{key:0,class:"wl-num",textContent:x(e.count)},null,8,Zn)):C("v-if",!0),z(" "+x(e.i18n.comment),1)]),I("div",Xn,[(f(!0),h(y,null,b(e.data,(t=>(f(),k(i,{key:t.objectId,"root-id":t.objectId,comment:t,reply:e.reply,onReply:e.onReply,onSubmit:e.onSubmit,onStatus:e.onStatusChange,onDelete:e.onDelete,onSticky:e.onSticky,onLike:e.onLike},null,8,["root-id","comment","reply","onReply","onSubmit","onStatus","onDelete","onSticky","onLike"])))),128))]),"error"===e.status?(f(),h("div",el,[I("button",{type:"button",class:"wl-btn",onClick:t[0]||(t[0]=(...t)=>e.refresh&&e.refresh(...t)),textContent:x(e.i18n.refresh)},null,8,tl)])):(f(),h(y,{key:2},["loading"===e.status?(f(),h("div",nl,[S(s,{size:30})])):e.data.length?e.page<e.totalPages?(f(),h(y,{key:2},[C(" Load more button "),I("div",ol,[I("button",{type:"button",class:"wl-btn",onClick:t[1]||(t[1]=(...t)=>e.loadMore&&e.loadMore(...t)),textContent:x(e.i18n.more)},null,8,al)])],2112)):C("v-if",!0):(f(),h("div",{key:1,class:"wl-empty",textContent:x(e.i18n.sofa)},null,8,ll))],64)),C(" Copyright Information "),e.config.copyright?(f(),h("div",rl,[il,sl,z(" v"+x(e.version),1)])):C("v-if",!0)])}],["__file","Waline.vue"]]);const ul=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},ml=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:l=!0,lang:o="zh-CN"})=>{const a=new AbortController,r=Array.from(document.querySelectorAll(n)),i=e=>{const n=$t(e);return null!==n&&t!==n},s=n=>vt({serverURL:nt(e),paths:n.map((e=>$t(e)||t)),lang:o,signal:a.signal}).then((e=>ul(e,n))).catch(ut);if(l){const n=r.filter((e=>!i(e))),l=r.filter(i);gt({serverURL:nt(e),path:t,lang:o}).then((e=>ul(new Array(n.length).fill(e),n))),l.length&&s(l)}else s(r);return a.abort.bind(a)},dl=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:l=!1,...o})=>{const a=e?ft(e):null;if(e&&!a)throw new Error("Option 'el' do not match any domElement!");if(!o.serverURL)throw new Error("Option 'serverURL' is missing!");const r=L({...o}),i=L({comment:n,pageview:l,path:t}),s=a?P((()=>d(cl,{path:i.path,...r}))):null;s&&s.mount(a);const c=T((()=>{i.comment&&Rt({serverURL:r.serverURL,path:i.path,selector:"string"==typeof i.comment?i.comment:void 0})})),u=T((()=>{i.pageview&&ml({serverURL:r.serverURL,path:i.path,selector:"string"==typeof i.pageview?i.pageview:void 0})}));return{el:a,update:({comment:e,pageview:t,path:n=window.location.pathname,...l}={})=>{Object.entries(l).forEach((([e,t])=>{r[e]=t})),i.path=n,void 0!==e&&(i.comment=e),void 0!==t&&(i.pageview=t)},destroy:()=>{s?.unmount(),c(),u()}}},pl="2.6.4",vl=({el:e,serverURL:t,count:n,lang:l="zh-CN"})=>{const o=jt(),a=ft(e),r=new AbortController;return(({serverURL:e,lang:t,count:n,signal:l,token:o})=>{const a={};return o&&(a.Authorization=`Bearer ${o}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:l,headers:a}).then((e=>e.json())).then((e=>dt(e,"recent comment")))})({serverURL:t,count:n,lang:l,signal:r.signal,token:o.value?.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:()=>{r.abort(),a.innerHTML=""}}):{comments:e,destroy:()=>r.abort()}))};export{vl as RecentComments,Rt as commentCount,le as defaultLocales,dl as init,ml as pageviewCount,pl as version};
import{getCurrentScope as e,onScopeDispose as t,getCurrentInstance as n,onMounted as l,nextTick as o,unref as a,ref as r,isRef as i,watch as s,readonly as c,shallowRef as u,computed as m,h as d,defineComponent as p,onBeforeUnmount as v,resolveComponent as g,openBlock as f,createElementBlock as h,normalizeStyle as y,Fragment as w,renderList as b,createBlock as k,createCommentVNode as C,createElementVNode as I,inject as $,reactive as L,onUnmounted as S,createVNode as j,toDisplayString as x,normalizeClass as R,withDirectives as E,vModelDynamic as O,vModelText as A,vShow as U,createTextVNode as z,provide as M,createApp as P,watchEffect as T}from"vue";import N from"autosize";import{marked as B}from"marked";const H=["nick","mail","link"],_=e=>e.filter((e=>H.includes(e))),V=e=>new Promise(((t,n)=>{if(e.size>128e3)return n(new Error("File too large! File size limit 128KB"));const l=new FileReader;l.readAsDataURL(e),l.onload=()=>t(l.result?.toString()||""),l.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>',D=()=>{const e={next:""},t=({keyword:e,pos:t})=>{const n=new URLSearchParams("media_filter=minimal");return n.set("key","PAY5JLFIH6V6"),n.set("limit","20"),n.set("pos",t||""),n.set("q",e),fetch(`https://g.tenor.com/v1/search?${n.toString()}`,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())).catch((()=>({next:t||"",results:[]})))};return{search:(n="")=>t({keyword:n}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url})))))),more:n=>t({keyword:n,pos:e.next}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url}))))))}},W=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"),q=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],G={},J=e=>{let t=0;return e.replace(W,((e,n,l)=>{if(l)return`<span style="color: slategray">${l}</span>`;if("<"===n)return"&lt;";let o;G[n]?o=G[n]:(o=q[t],G[n]=o);const a=`<span style="color: #${o}">${n}</span>`;return t=++t%q.length,a}))},K=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest"],Q=e=>Object.fromEntries(e.map(((e,t)=>[K[t],e])));var Y=Q(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words","Please input comments between $0 and $1 words!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest"]),Z=Q(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順"]),X=Q(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度"]),ee=Q(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂","按倒序","按正序","按熱度"]),te=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","Like","Cancel like","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","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente"]),ne=Q(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий"]);const le={zh:X,"zh-cn":X,"zh-CN":X,"zh-tw":ee,"zh-TW":ee,en:Y,"en-US":Y,"en-us":Y,jp:Z,"jp-jp":Z,"jp-JP":Z,"pt-br":te,"pt-BR":te,ru:ne,"ru-ru":ne,"ru-RU":ne};var oe;const ae="undefined"!=typeof window,re=()=>{};function ie(e){return"function"==typeof e?e():a(e)}function se(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}ae&&(null==(oe=null==window?void 0:window.navigator)?void 0:oe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const ce=e=>e();function ue(n){return!!e()&&(t(n),!0)}function me(e,t=200,n={}){return se(function(e,t={}){let n,l;return o=>{const a=ie(e),r=ie(t.maxWait);if(n&&clearTimeout(n),a<=0||void 0!==r&&r<=0)return l&&(clearTimeout(l),l=null),o();r&&!l&&(l=setTimeout((()=>{n&&clearTimeout(n),l=null,o()}),r)),n=setTimeout((()=>{l&&clearTimeout(l),l=null,o()}),a)}}(t,n),e)}var de=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;function ge(e,t,n={}){const l=n,{eventFilter:o=ce}=l,a=((e,t)=>{var n={};for(var l in e)pe.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&de)for(var l of de(e))t.indexOf(l)<0&&ve.call(e,l)&&(n[l]=e[l]);return n})(l,["eventFilter"]);return s(e,se(o,t),a)}var fe=Object.defineProperty,he=Object.defineProperties,ye=Object.getOwnPropertyDescriptors,we=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable,Ce=(e,t,n)=>t in e?fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function Ie(e,t,n={}){const l=n,{eventFilter:o}=l,a=((e,t)=>{var n={};for(var l in e)be.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&we)for(var l of we(e))t.indexOf(l)<0&&ke.call(e,l)&&(n[l]=e[l]);return n})(l,["eventFilter"]),{eventFilter:i,pause:s,resume:c,isActive:u}=function(e=ce){const t=r(!0);return{isActive:t,pause:function(){t.value=!1},resume:function(){t.value=!0},eventFilter:(...n)=>{t.value&&e(...n)}}}(o),m=ge(e,t,(d=((e,t)=>{for(var n in t||(t={}))be.call(t,n)&&Ce(e,n,t[n]);if(we)for(var n of we(t))ke.call(t,n)&&Ce(e,n,t[n]);return e})({},a),he(d,ye({eventFilter:i}))));var d;return{stop:m,pause:s,resume:c,isActive:u}}const $e=ae?window:void 0,Le=ae?window.document:void 0;function Se(...e){let t,n,l,o;if("string"==typeof e[0]?([n,l,o]=e,t=$e):[t,n,l,o]=e,!t)return re;let a=re;const r=s((()=>function(e){var t;const n=ie(e);return null!=(t=null==n?void 0:n.$el)?t:n}(t)),(e=>{a(),e&&(e.addEventListener(n,l,o),a=()=>{e.removeEventListener(n,l,o),a=re})}),{immediate:!0,flush:"post"}),i=()=>{r(),a()};return ue(i),i}ae&&window.navigator,ae&&window.location;const je="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},xe="__vueuse_ssr_handlers__";je[xe]=je[xe]||{};const Re=je[xe];var Ee=Object.defineProperty,Oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,ze=(e,t,n)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Me=(e,t)=>{for(var n in t||(t={}))Ae.call(t,n)&&ze(e,n,t[n]);if(Oe)for(var n of Oe(t))Ue.call(t,n)&&ze(e,n,t[n]);return e};const Pe={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 Te(e,t,n,l={}){var o;const{flush:a="pre",deep:i=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:m=!1,shallow:d,window:p=$e,eventFilter:v,onError:g=(e=>{console.error(e)})}=l,f=(d?u:r)(t);if(!n)try{n=function(e,t){return Re[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=$e)?void 0:e.localStorage}))()}catch(e){g(e)}if(!n)return f;const h=ie(t),y=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),w=null!=(o=l.serializer)?o:Pe[y],{pause:b,resume:k}=Ie(f,(()=>function(t){try{null==t?n.removeItem(e):n.setItem(e,w.write(t))}catch(e){g(e)}}(f.value)),{flush:a,deep:i,eventFilter:v});return p&&s&&Se(p,"storage",C),C(),f;function C(t){t&&t.key!==e||(f.value=function(t){if(!t||t.key===e){b();try{const l=t?t.newValue:n.getItem(e);if(null==l)return c&&null!==h&&n.setItem(e,w.write(h)),h;if(!t&&m){const e=w.read(l);return"function"==typeof m?m(e,h):"object"!==y||Array.isArray(e)?e:Me(Me({},h),e)}return"string"!=typeof l?l:w.read(l)}catch(e){g(e)}finally{k()}}}(t))}}var Ne,Be,He=Object.defineProperty,_e=Object.getOwnPropertySymbols,Ve=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,De=(e,t,n)=>t in e?He(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function We(e={}){const{controls:t=!1,interval:n="requestAnimationFrame"}=e,l=r(new Date),o=()=>l.value=new Date,c="requestAnimationFrame"===n?function(e,t={}){const{immediate:n=!0,window:l=$e}=t,o=r(!1);let a=null;function i(){o.value&&l&&(e(),a=l.requestAnimationFrame(i))}function s(){!o.value&&l&&(o.value=!0,i())}function c(){o.value=!1,null!=a&&l&&(l.cancelAnimationFrame(a),a=null)}return n&&s(),ue(c),{isActive:o,pause:c,resume:s}}(o,{immediate:!0}):function(e,t=1e3,n={}){const{immediate:l=!0,immediateCallback:o=!1}=n;let c=null;const u=r(!1);function m(){c&&(clearInterval(c),c=null)}function d(){u.value=!1,m()}function p(){a(t)<=0||(u.value=!0,o&&e(),m(),c=setInterval(e,ie(t)))}l&&ae&&p(),i(t)&&ue(s(t,(()=>{u.value&&ae&&p()})));return ue(d),{isActive:u,pause:d,resume:p}}(o,n,{immediate:!0});return t?((e,t)=>{for(var n in t||(t={}))Ve.call(t,n)&&De(e,n,t[n]);if(_e)for(var n of _e(t))Fe.call(t,n)&&De(e,n,t[n]);return e})({now:l},c):l}(Be=Ne||(Ne={})).UP="UP",Be.RIGHT="RIGHT",Be.DOWN="DOWN",Be.LEFT="LEFT",Be.NONE="NONE";let qe=0;function Ge(e,t={}){const a=r(!1),{document:i=Le,immediate:u=!0,manual:m=!1,id:d="vueuse_styletag_"+ ++qe}=t,p=r(e);let v=()=>{};const g=()=>{if(!i)return;const e=i.getElementById(d)||i.createElement("style");e.type="text/css",e.id=d,t.media&&(e.media=t.media),i.head.appendChild(e),a.value||(v=s(p,(t=>{e.innerText=t}),{immediate:!0}),a.value=!0)},f=()=>{i&&a.value&&(v(),i.head.removeChild(i.getElementById(d)),a.value=!1)};return u&&!m&&function(e,t=!0){n()?l(e):t?e():o(e)}(g),m||ue(f),{id:d,css:p,unload:f,load:g,isLoaded:c(a)}}var Je=Object.defineProperty,Ke=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Ze=(e,t,n)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))Qe.call(t,n)&&Ze(e,n,t[n]);if(Ke)for(var n of Ke(t))Ye.call(t,n)&&Ze(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Xe=e=>{try{e=decodeURI(e)}catch(e){}return e},et=(e="")=>e.replace(/\/$/u,""),tt=e=>/^(https?:)?\/\//.test(e),nt=e=>{const t=et(e);return tt(t)?t:`https://${t}`},lt=e=>Array.isArray(e)?e:!!e&&[0,e],ot=(e,t)=>"function"==typeof e?e:!1!==e&&t,at="{--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}",rt=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},it=(e,t,n)=>{if(!e)return"";const l="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,o=t.getTime()-l.getTime(),a=Math.floor(o/864e5);if(0===a){const e=o%864e5,t=Math.floor(e/36e5);if(0===t){const t=e%36e5,l=Math.floor(t/6e4);if(0===l){const e=t%6e4;return`${Math.round(e/1e3)} ${n.seconds}`}return`${l} ${n.minutes}`}return`${t} ${n.hours}`}return a<0?n.now:a<8?`${a} ${n.days}`:(e=>{const t=rt(e.getDate(),2),n=rt(e.getMonth()+1,2);return`${rt(e.getFullYear(),2)}-${n}-${t}`})(l)},st=e=>{const t=Te("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((l=>{const o={folder:e,...l};return n&&(t.value[e]=o),o}))},ct=(e,t="",n="",l="")=>`${t?`${t}/`:""}${n}${e}${l?`.${l}`:""}`,ut=e=>{"AbortError"!==e.name&&console.error(e.message)},mt={"Content-Type":"application/json"},dt=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},pt=({serverURL:e,lang:t,token:n,objectId:l,...o})=>fetch(`${e}/comment/${l}?lang=${t}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(o)}).then((e=>e.json())),vt=({serverURL:e,lang:t,paths:n,signal:l})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:l}).then((e=>e.json())).then((e=>dt(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),gt=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:mt,body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>dt(e,"visit count"))),ft=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,ht=e=>e.type.includes("image"),yt=e=>{const t=Array.from(e).find(ht);return t?t.getAsFile():null},wt=/\$.*?\$/,bt=/^\$(.*?)\$/,kt=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Ct=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),It=(e,{emojiMap:t,highlighter:n,texRenderer:l})=>{if(B.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),l){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=kt.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(wt);return-1!==t?t:e.length},tokenizer(t){const n=bt.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(l);B.use({extensions:e})}return B.parse(Ct(e,t))},$t=e=>e.dataset.path||e.getAttribute("id");let Lt=null;const St=()=>Lt||(Lt=Te("WALINE_USER",{}));let jt=null;const xt=()=>jt||(jt=Te("WALINE_LIKE",[])),Rt=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:l="zh-CN"})=>{const o=new AbortController,a=document.querySelectorAll(n),r=St();return a.length&&(({serverURL:e,lang:t,paths:n,signal:l,token:o})=>{const a={};return o&&(a.Authorization=`Bearer ${o}`),fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:l,headers:a}).then((e=>e.json())).then((e=>dt(e,"comment count"))).then((e=>Array.isArray(e)?e:[e]))})({serverURL:nt(e),paths:Array.from(a).map((e=>Xe(e.dataset.path||e.getAttribute("id")||t))),lang:l,signal:o.signal,token:r.value?.token}).then((e=>{a.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(ut),o.abort.bind(o)},Et=({size:e})=>d("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},d("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},d("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Ot=p({name:"ImageWall",components:{LoadingIcon:Et},props:{items:{type:Array,default:()=>[]},columnWidth:{type:Number,default:300},gap:{type:Number,default:0}},emits:["insert"],setup(e){let t=null;const n=r(null),a=r({}),i=r([]),c=()=>{const t=Math.floor((n.value.getBoundingClientRect().width+e.gap)/(e.columnWidth+e.gap));return t>0?t:1},u=async t=>{if(t>=e.items.length)return;await o();const l=Array.from(n.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));i.value[Number(l.dataset.index)].push(t),await u(t+1)},m=async(e=!1)=>{if(i.value.length===c()&&!e)return;var t;i.value=(t=c(),new Array(t).fill(null).map((()=>[])));const n=window.scrollY;await u(0),window.scrollTo({top:n})};return s((()=>[e.items]),(()=>{a.value={},m(!0)})),s((()=>[e.columnWidth,e.gap]),(()=>m())),l((()=>{m(!0),t=new ResizeObserver((()=>m())),t.observe(n.value)})),v((()=>t.unobserve(n.value))),{columns:i,state:a,wall:n}}}),At=(e,t)=>{const n=e.__vccOpts||e;for(const[e,l]of t)n[e]=l;return n};const Ut=["data-index"],zt=["src","title","onLoad","onClick"];var Mt=p({name:"CommentBox",components:{CloseIcon:({size:e})=>d("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[d("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"}),d("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:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},d("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:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[d("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"}),d("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"})]),ImageWall:At(Ot,[["render",function(e,t,n,l,o,a){const r=g("LoadingIcon");return f(),h("div",{ref:"wall",class:"wl-gallery",style:y({gap:`${e.gap}px`})},[(f(!0),h(w,null,b(e.columns,((t,n)=>(f(),h("div",{key:n,class:"wl-gallery-column","data-index":n,style:y({gap:`${e.gap}px`})},[(f(!0),h(w,null,b(t,(t=>(f(),h(w,{key:t},[e.state[e.items[t].src]?C("v-if",!0):(f(),k(r,{key:0,size:36,style:{margin:"20px auto"}})),I("img",{class:"wl-gallery-item",src:e.items[t].src,title:e.items[t].title,loading:"lazy",onLoad:n=>e.state[e.items[t].src]=!0,onClick:n=>e.$emit("insert",`![](${e.items[t].src})`)},null,40,zt)],64)))),128))],12,Ut)))),128))],4)}],["__file","ImageWall.vue"]]),MarkdownIcon:()=>d("svg",{width:"16",height:"16",ariaHidden:"true"},d("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:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[d("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"}),d("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:Et,GifIcon:()=>d("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[d("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),d("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})])},props:{rootId:{type:String,default:""},replyId:{type:String,default:""},replyUser:{type:String,default:""}},emits:["submit","cancel-reply"],setup(e,{emit:t}){const n=$("config"),o=Te("WALINE_COMMENT_BOX_EDITOR",""),a=Te("WALINE_USER_META",{nick:"",mail:"",link:""}),i=St(),c=r({}),u=r(null),d=r(null),p=r(null),v=r(null),g=r(null),f=r(null),h=r(null),y=r({tabs:[],map:{}}),w=r(0),b=r(!1),k=r(!1),C=r(!1),I=r(""),j=r(0),x=L({loading:!0,list:[]}),R=r(0),E=r(!1),O=r(""),A=r(!1),U=m((()=>n.value.locale)),z=m((()=>Boolean(i.value?.token))),M=m((()=>!1!==n.value.imageUploader)),P=e=>{const t=u.value,n=t.selectionStart,l=t.selectionEnd||0,a=t.scrollTop;o.value=t.value.substring(0,n)+e+t.value.substring(l,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=a},T=e=>{const t=`![${n.value.locale.uploading} ${e.name}]()`;return P(t),Promise.resolve().then((()=>n.value.imageUploader(e))).then((n=>{o.value=o.value.replace(t,`\r\n![${e.name}](${n})`)})).catch((e=>{alert(e.message),o.value=o.value.replace(t,"")}))},B=()=>{const{serverURL:l,lang:r,login:s,wordLimit:m,requiredMeta:d}=n.value,p={comment:O.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,ua:navigator.userAgent,url:n.value.path};if(i.value?.token)p.nick=i.value.display_name,p.mail=i.value.email,p.link=i.value.url;else{if("force"===s)return;if(d.indexOf("nick")>-1&&!p.nick)return c.value.nick?.focus(),alert(U.value.nickError);if(d.indexOf("mail")>-1&&!p.mail||p.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(p.mail))return c.value.mail?.focus(),alert(U.value.mailError);if(!p.comment)return void u.value?.focus();p.nick||(p.nick=U.value.anonymous)}if(!E.value)return alert(U.value.wordHint.replace("$0",m[0].toString()).replace("$1",m[1].toString()).replace("$2",j.value.toString()));p.comment=Ct(p.comment,y.value.map),e.replyId&&e.rootId&&(p.pid=e.replyId,p.rid=e.rootId,p.at=e.replyUser),A.value=!0,(({serverURL:e,lang:t,token:n,comment:l})=>{const o={"Content-Type":"application/json"};return n&&(o.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:o,body:JSON.stringify(l)}).then((e=>e.json()))})({serverURL:l,lang:r,token:i.value?.token,comment:p}).then((n=>{if(A.value=!1,n.errmsg)return alert(n.errmsg);t("submit",n.data),o.value="",I.value="",e.replyId&&t("cancel-reply")})).catch((e=>{A.value=!1,alert(e.message)}))},H=e=>{p.value.contains(e.target)||v.value.contains(e.target)||(b.value=!1),g.value.contains(e.target)||f.value.contains(e.target)||(k.value=!1)},_=async e=>{const{scrollTop:t,clientHeight:l,scrollHeight:o}=e.target,a=(l+t)/o,r=n.value.search,i=h.value?.value||"";a<.9||x.loading||(x.loading=!0,x.list.push(...r.more?await r.more(i,x.list.length):await r.search(i)),x.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},V=me((e=>{x.list=[],_(e)}),300);s([n,j],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(R.value=n[0],E.value=!1):t>n[1]?(R.value=n[1],E.value=!1):(R.value=n[1],E.value=!0):(R.value=0,E.value=!0)}),{immediate:!0}),s(k,(async e=>{if(!e)return;const t=n.value.search;h.value&&(h.value.value=""),x.loading=!0,x.list=t.default?await t.default():await t.search(""),x.loading=!1}));const F=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))))};return l((()=>{document.body.addEventListener("click",H),window.addEventListener("message",F),s((()=>o.value),(e=>{const{highlighter:t,texRenderer:l}=n.value;O.value=e,I.value=It(e,{emojiMap:y.value.map,highlighter:t,texRenderer:l}),j.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?N(u.value):N.destroy(u.value)}),{immediate:!0}),s((()=>n.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?st(et(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:l,icon:o,prefix:a,type:r,items:i}=e;t.tabs.push({name:n,icon:ct(o,l,a,r),items:i.map((e=>{const n=`${a||""}${e}`;return t.map[n]=ct(e,l,a,r),n}))})})),t}))).then((e=>{y.value=e}));var t}),{immediate:!0})})),S((()=>{document.body.removeEventListener("click",H),window.removeEventListener("message",F)})),{config:n,locale:U,insert:P,onChange:()=>{const e=d.value;e.files&&M.value&&T(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{if(e.dataTransfer?.items){const t=yt(e.dataTransfer.items);t&&M.value&&(T(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&B()},onPaste:e=>{if(e.clipboardData){const t=yt(e.clipboardData.items);t&&M.value&&T(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:l}=n.value,o=(window.innerWidth-450)/2,a=(window.innerHeight-450)/2,r=window.open(`${l}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${o},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);r?.postMessage({type:"TOKEN",data:null},"*");const s=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(r?.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:l}=n.value,o=(window.innerWidth-800)/2,a=(window.innerHeight-800)/2;window.open(`${l}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${o},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`)?.postMessage({type:"TOKEN",data:i.value.token},"*")},submitComment:B,onImageWallScroll:_,onGifSearch:V,isLogin:z,userInfo:i,isSubmitting:A,wordNumber:j,wordLimit:R,isWordNumberLegal:E,editor:o,userMeta:a,emoji:y,emojiTabIndex:w,showEmoji:b,gifData:x,showGif:k,canUploadImage:M,previewText:I,showPreview:C,inputRefs:c,editorRef:u,emojiButtonRef:p,emojiPopupRef:v,gifButtonRef:g,gifPopupRef:f,imageUploadRef:d,gifSearchInputRef:h}}});const Pt={class:"wl-comment"},Tt={key:0,class:"wl-login-info"},Nt={class:"wl-avatar"},Bt=["title"],Ht=["title"],_t=["src"],Vt=["title","textContent"],Ft={class:"wl-panel"},Dt=["for","textContent"],Wt=["id","onUpdate:modelValue","name","type"],qt=["placeholder"],Gt={class:"wl-preview"},Jt=I("hr",null,null,-1),Kt=["innerHTML"],Qt={class:"wl-footer"},Yt={class:"wl-actions"},Zt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},Xt=["title"],en=["title"],tn=["title"],nn=["title"],ln={class:"wl-info"},on={class:"wl-text-number"},an={key:0},rn=z("  /  "),sn=["textContent"],cn=["textContent"],un=["disabled"],mn=["placeholder"],dn={key:0,class:"wl-loading"},pn={key:0,class:"wl-tab-wrapper"},vn=["title","onClick"],gn=["src","alt"],fn={key:0,class:"wl-tabs"},hn=["onClick"],yn=["src","alt","title"],wn=["title"];var bn=At(Mt,[["render",function(e,t,n,l,o,a){const r=g("CloseIcon"),i=g("MarkdownIcon"),s=g("EmojiIcon"),c=g("GifIcon"),u=g("ImageIcon"),m=g("PreviewIcon"),d=g("LoadingIcon"),p=g("ImageWall");return f(),h("div",Pt,["disable"!==e.config.login&&e.isLogin?(f(),h("div",Tt,[I("div",Nt,[I("button",{class:"wl-logout-btn",title:e.locale.logout,onClick:t[0]||(t[0]=(...t)=>e.onLogout&&e.onLogout(...t))},[j(r,{size:14})],8,Bt),I("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:t[1]||(t[1]=(...t)=>e.onProfile&&e.onProfile(...t))},[I("img",{src:e.userInfo.avatar,alt:"avatar"},null,8,_t)],8,Ht)]),I("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.locale.profile,onClick:t[2]||(t[2]=(...t)=>e.onProfile&&e.onProfile(...t)),textContent:x(e.userInfo.display_name)},null,8,Vt)])):C("v-if",!0),I("div",Ft,["force"!==e.config.login&&e.config.meta.length&&!e.isLogin?(f(),h("div",{key:0,class:R(["wl-header",`item${e.config.meta.length}`])},[(f(!0),h(w,null,b(e.config.meta,(t=>(f(),h("div",{key:t,class:"wl-header-item"},[I("label",{for:t,textContent:x(e.locale[t]+(e.config.requiredMeta.includes(t)||!e.config.requiredMeta.length?"":`(${e.locale.optional})`))},null,8,Dt),E(I("input",{id:`wl-${t}`,ref_for:!0,ref:n=>{n&&(e.inputRefs[t]=n)},"onUpdate:modelValue":n=>e.userMeta[t]=n,class:R(["wl-input",`wl-${t}`]),name:t,type:"mail"===t?"email":"text"},null,10,Wt),[[O,e.userMeta[t]]])])))),128))],2)):C("v-if",!0),E(I("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":t[3]||(t[3]=t=>e.editor=t),class:"wl-editor",placeholder:e.replyUser?`@${e.replyUser}`:e.locale.placeholder,onKeydown:t[4]||(t[4]=(...t)=>e.onKeyDown&&e.onKeyDown(...t)),onDrop:t[5]||(t[5]=(...t)=>e.onDrop&&e.onDrop(...t)),onPaste:t[6]||(t[6]=(...t)=>e.onPaste&&e.onPaste(...t))},null,40,qt),[[A,e.editor]]),E(I("div",Gt,[Jt,I("h4",null,x(e.locale.preview)+":",1),C(" eslint-disable-next-line vue/no-v-html "),I("div",{class:"wl-content",innerHTML:e.previewText},null,8,Kt)],512),[[U,e.showPreview]]),I("div",Qt,[I("div",Yt,[I("a",Zt,[j(i)]),E(I("button",{ref:"emojiButtonRef",class:R(["wl-action",{actived:e.showEmoji}]),title:e.locale.emoji,onClick:t[7]||(t[7]=t=>e.showEmoji=!e.showEmoji)},[j(s)],10,Xt),[[U,e.emoji.tabs.length]]),e.config.search?(f(),h("button",{key:0,ref:"gifButtonRef",class:R(["wl-action",{actived:e.showGif}]),title:e.locale.gif,onClick:t[8]||(t[8]=t=>e.showGif=!e.showGif)},[j(c)],10,en)):C("v-if",!0),I("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:t[9]||(t[9]=(...t)=>e.onChange&&e.onChange(...t))},null,544),e.canUploadImage?(f(),h("label",{key:1,for:"wl-image-upload",class:"wl-action",title:e.locale.uploadImage},[j(u)],8,tn)):C("v-if",!0),I("button",{class:R(["wl-action",{actived:e.showPreview}]),title:e.locale.preview,onClick:t[10]||(t[10]=t=>e.showPreview=!e.showPreview)},[j(m)],10,nn)]),I("div",ln,[I("div",on,[z(x(e.wordNumber)+" ",1),e.config.wordLimit?(f(),h("span",an,[rn,I("span",{class:R({illegal:!e.isWordNumberLegal}),textContent:x(e.wordLimit)},null,10,sn)])):C("v-if",!0),z("  "+x(e.locale.word),1)]),"disable"===e.config.login||e.isLogin?C("v-if",!0):(f(),h("button",{key:0,class:"wl-btn",onClick:t[11]||(t[11]=(...t)=>e.onLogin&&e.onLogin(...t)),textContent:x(e.locale.login)},null,8,cn)),"force"!==e.config.login||e.isLogin?(f(),h("button",{key:1,class:"wl-btn primary",title:"Cmd|Ctrl + Enter",disabled:e.isSubmitting,onClick:t[12]||(t[12]=(...t)=>e.submitComment&&e.submitComment(...t))},[e.isSubmitting?(f(),k(d,{key:0,size:16})):(f(),h(w,{key:1},[z(x(e.locale.submit),1)],64))],8,un)):C("v-if",!0)]),I("div",{ref:"gifPopupRef",class:R(["wl-gif-popup",{display:e.showGif}])},[I("input",{ref:"gifSearchInputRef",type:"text",placeholder:e.locale.gifSearchPlaceholder,onInput:t[13]||(t[13]=(...t)=>e.onGifSearch&&e.onGifSearch(...t))},null,40,mn),j(p,{items:e.gifData.list,"column-width":200,gap:6,onInsert:t[14]||(t[14]=t=>e.insert(t)),onScroll:e.onImageWallScroll},null,8,["items","onScroll"]),e.gifData.loading?(f(),h("div",dn,[j(d,{size:30})])):C("v-if",!0)],2),I("div",{ref:"emojiPopupRef",class:R(["wl-emoji-popup",{display:e.showEmoji}])},[(f(!0),h(w,null,b(e.emoji.tabs,((t,n)=>(f(),h(w,{key:t.name},[n===e.emojiTabIndex?(f(),h("div",pn,[(f(!0),h(w,null,b(t.items,(t=>(f(),h("button",{key:t,title:t,onClick:n=>e.insert(`:${t}:`)},[e.showEmoji?(f(),h("img",{key:0,class:"wl-emoji",src:e.emoji.map[t],alt:t,loading:"lazy",referrerPolicy:"no-referrer"},null,8,gn)):C("v-if",!0)],8,vn)))),128))])):C("v-if",!0)],64)))),128)),e.emoji.tabs.length>1?(f(),h("div",fn,[(f(!0),h(w,null,b(e.emoji.tabs,((t,n)=>(f(),h("button",{key:t.name,class:R(["wl-tab",{active:e.emojiTabIndex===n}]),onClick:t=>e.emojiTabIndex=n},[I("img",{class:"wl-emoji",src:t.icon,alt:t.name,title:t.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,yn)],10,hn)))),128))])):C("v-if",!0)],2)])]),e.replyId?(f(),h("button",{key:1,class:"wl-close",title:e.locale.cancelReply,onClick:t[15]||(t[15]=t=>e.$emit("cancel-reply"))},[j(r,{size:24})],8,wn)):C("v-if",!0)])}],["__file","CommentBox.vue"]]);const kn=["approved","waiting","spam"];var Cn=p({components:{CommentBox:bn,DeleteIcon:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},d("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),LikeIcon:({active:e=!1})=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[d("path",{d:"M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z"+(e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"),fill:e?"red":"currentColor"})]),ReplyIcon:()=>d("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},d("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),VerifiedIcon:()=>d("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},d("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"}))},props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object,default:null}},emits:["submit","reply","like","delete","status","sticky"],setup(e){const t=$("config"),n=xt(),l=St(),o=m((()=>t.value.locale)),a=m((()=>{const{link:t}=e.comment;return t?tt(t)?t:`https://${t}`:""})),r=m((()=>n.value.includes(e.comment.objectId))),i=((e,t)=>{const n=We();return m((()=>it(e,n.value,t)))})(e.comment.insertedAt,o.value),s=m((()=>"administrator"===l.value.type)),c=m((()=>e.comment.user_id&&l.value.objectId===e.comment.user_id)),u=m((()=>e.comment.objectId===e.reply?.objectId));return{config:t,locale:o,isReplyingCurrent:u,link:a,like:r,time:i,isAdmin:s,isOwner:c,commentStatus:kn}}});const In=["id"],$n={class:"wl-user","aria-hidden":"true"},Ln=["src"],Sn={class:"wl-card"},jn={class:"wl-head"},xn=["href"],Rn={key:1,class:"wl-nick"},En=["textContent"],On=["textContent"],An=["textContent"],Un=["textContent"],zn=["textContent"],Mn={class:"wl-comment-actions"},Pn=["title"],Tn=["textContent"],Nn=["title"],Bn={class:"wl-meta","aria-hidden":"true"},Hn=["textContent"],_n=["textContent"],Vn=["textContent"],Fn=["innerHTML"],Dn={key:0,class:"wl-admin-actions"},Wn={class:"wl-comment-status"},qn=["disabled","onClick","textContent"],Gn={key:1,class:"wl-reply-wrapper"},Jn={key:2,class:"wl-quote"};const Kn=[{key:"insertedAt_desc",name:"latest"},{key:"insertedAt_asc",name:"oldest"},{key:"like_desc",name:"hottest"}];var Qn=p({name:"WalineRoot",components:{CommentBox:bn,CommentCard:At(Cn,[["render",function(e,t,n,l,o,a){const r=g("VerifiedIcon"),i=g("DeleteIcon"),s=g("LikeIcon"),c=g("ReplyIcon"),u=g("CommentBox"),m=g("CommentCard",!0);return f(),h("div",{id:e.comment.objectId,class:"wl-item"},[I("div",$n,[e.comment.avatar?(f(),h("img",{key:0,src:e.comment.avatar},null,8,Ln)):C("v-if",!0),e.comment.type?(f(),k(r,{key:1})):C("v-if",!0)]),I("div",Sn,[I("div",jn,[e.link?(f(),h("a",{key:0,class:"wl-nick",href:e.link,target:"_blank",rel:"nofollow noreferrer"},x(e.comment.nick),9,xn)):(f(),h("span",Rn,x(e.comment.nick),1)),"administrator"===e.comment.type?(f(),h("span",{key:2,class:"wl-badge",textContent:x(e.locale.admin)},null,8,En)):C("v-if",!0),e.comment.label?(f(),h("span",{key:3,class:"wl-badge",textContent:x(e.comment.label)},null,8,On)):C("v-if",!0),e.comment.sticky?(f(),h("span",{key:4,class:"wl-badge",textContent:x(e.locale.sticky)},null,8,An)):C("v-if",!0),void 0!==e.comment.level&&e.comment.level>=0?(f(),h("span",{key:5,class:R(`wl-badge level${e.comment.level}`),textContent:x(e.locale[`level${e.comment.level}`]||`Level ${e.comment.level}`)},null,10,Un)):C("v-if",!0),I("span",{class:"wl-time",textContent:x(e.time)},null,8,zn),I("div",Mn,[e.isAdmin||e.isOwner?(f(),h("button",{key:0,class:"wl-delete",onClick:t[0]||(t[0]=t=>e.$emit("delete",e.comment))},[j(i)])):C("v-if",!0),I("button",{class:"wl-like",title:e.like?e.locale.cancelLike:e.locale.like,onClick:t[1]||(t[1]=t=>e.$emit("like",e.comment))},[j(s,{active:e.like},null,8,["active"]),"like"in e.comment?(f(),h("span",{key:0,textContent:x(e.comment.like)},null,8,Tn)):C("v-if",!0)],8,Pn),I("button",{class:R(["wl-reply",{active:e.isReplyingCurrent}]),title:e.isReplyingCurrent?e.locale.cancelReply:e.locale.reply,onClick:t[2]||(t[2]=t=>e.$emit("reply",e.isReplyingCurrent?null:e.comment))},[j(c)],10,Nn)])]),I("div",Bn,[e.comment.addr?(f(),h("span",{key:0,textContent:x(e.comment.addr)},null,8,Hn)):C("v-if",!0),e.comment.browser?(f(),h("span",{key:1,textContent:x(e.comment.browser)},null,8,_n)):C("v-if",!0),e.comment.os?(f(),h("span",{key:2,textContent:x(e.comment.os)},null,8,Vn)):C("v-if",!0)]),C(" eslint-disable-next-line vue/no-v-html "),I("div",{class:"wl-content",innerHTML:e.comment.comment},null,8,Fn),e.isAdmin?(f(),h("div",Dn,[I("span",Wn,[(f(!0),h(w,null,b(e.commentStatus,(t=>(f(),h("button",{key:t,class:R(`wl-btn wl-${t}`),disabled:e.comment.status===t,onClick:n=>e.$emit("status",{status:t,comment:e.comment}),textContent:x(e.locale[t])},null,10,qn)))),128))]),e.isAdmin&&!e.comment.rid?(f(),h("button",{key:0,class:"wl-btn wl-sticky",onClick:t[3]||(t[3]=t=>e.$emit("sticky",e.comment))},x(e.comment.sticky?e.locale.unsticky:e.locale.sticky),1)):C("v-if",!0)])):C("v-if",!0),e.isReplyingCurrent?(f(),h("div",Gn,[j(u,{"reply-id":e.comment.objectId,"reply-user":e.comment.nick,"root-id":e.rootId,onSubmit:t[4]||(t[4]=t=>e.$emit("submit",t)),onCancelReply:t[5]||(t[5]=t=>e.$emit("reply",null))},null,8,["reply-id","reply-user","root-id"])])):C("v-if",!0),e.comment.children?(f(),h("div",Jn,[(f(!0),h(w,null,b(e.comment.children,(n=>(f(),k(m,{key:n.objectId,comment:n,reply:e.reply,"root-id":e.rootId,onReply:t[6]||(t[6]=t=>e.$emit("reply",t)),onSubmit:t[7]||(t[7]=t=>e.$emit("submit",t)),onLike:t[8]||(t[8]=t=>e.$emit("like",t)),onDelete:t[9]||(t[9]=t=>e.$emit("delete",t)),onStatus:t[10]||(t[10]=t=>e.$emit("status",t)),onSticky:t[11]||(t[11]=t=>e.$emit("sticky",t))},null,8,["comment","reply","root-id"])))),128))])):C("v-if",!0)])],8,In)}],["__file","CommentCard.vue"]]),LoadingIcon:Et},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright"],setup(e){const t=m((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:l,emoji:o=["//unpkg.com/@waline/emojis@1.1.0/weibo"],meta:a=["nick","mail","link"],requiredMeta:r=[],dark:i=!1,pageSize:s=10,wordLimit:c,imageUploader:u,highlighter:m,texRenderer:d,copyright:p=!0,login:v="enable",search:g=D(),...f})=>({serverURL:nt(e),path:Xe(t),locale:{...le[n]||le["zh-CN"],..."object"==typeof l?l:{}},wordLimit:lt(c),meta:_(a),requiredMeta:_(r),imageUploader:ot(u,V),highlighter:ot(m,J),texRenderer:ot(d,F),lang:n,dark:i,emoji:o,pageSize:s,login:v,copyright:p,search:g,...f}))(e))),n=St(),o=xt(),a=r("loading"),i=r(0),c=r(1),u=r(0),d=r(Kn[0].key),p=r([]),v=r(null),g=m((()=>{return"string"==typeof(e=t.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${at}}`:`${e}${at}`:!0===e?`:root${at}`:"";var e}));let f;Ge(g);const h=e=>{const{serverURL:l,path:o,pageSize:r}=t.value,s=new AbortController;a.value="loading",f?.(),(({serverURL:e,lang:t,path:n,page:l,pageSize:o,sortBy:a,signal:r,token:i})=>{const s={};return i&&(s.Authorization=`Bearer ${i}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${o}&page=${l}&lang=${t}&sortBy=${a}`,{signal:r,headers:s}).then((e=>e.json())).then((e=>dt(e,"comment list")))})({serverURL:l,lang:t.value.lang,path:o,pageSize:r,sortBy:d.value,page:e,signal:s.signal,token:n.value?.token}).then((t=>{a.value="success",i.value=t.count,p.value.push(...t.data),c.value=e,u.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),a.value="error")})),f=s.abort.bind(s)},y=()=>{i.value=0,p.value=[],h(1)};return M("config",t),s((()=>e.path),y),l((()=>y())),{config:t,darkmodeStyle:g,i18n:m((()=>t.value.locale)),status:a,count:i,page:c,totalPages:u,sortBy:d,sortByItems:Kn,data:p,reply:v,loadMore:()=>h(c.value+1),refresh:y,onSortByChange:e=>{d.value!==e&&(d.value=e,y())},onReply:e=>{v.value=e},onSubmit:e=>{if(e.rid){const t=p.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else p.value.unshift(e)},onStatusChange:async({comment:e,status:l})=>{if(e.status===l)return;const{serverURL:o,lang:a}=t.value;await pt({serverURL:o,lang:a,token:n.value?.token,objectId:e.objectId,status:l}),e.status=l},onDelete:async({objectId:e})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:l,lang:o}=t.value;await(({serverURL:e,lang:t,token:n,objectId:l})=>fetch(`${e}/comment/${l}?lang=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${n}`}}).then((e=>e.json())))({serverURL:l,lang:o,token:n.value?.token,objectId:e}),p.value.some(((t,n)=>t.objectId===e?(p.value=p.value.filter(((e,t)=>t!==n)),!0):t.children.some(((l,o)=>l.objectId===e&&(p.value[n].children=t.children.filter(((e,t)=>t!==o)),!0)))))},onSticky:async e=>{if(e.rid)return;const{serverURL:l,lang:o}=t.value;await pt({serverURL:l,lang:o,token:n.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},onLike:async e=>{const{serverURL:n,lang:l}=t.value,{objectId:a}=e,r=o.value.includes(a);await(({serverURL:e,lang:t,objectId:n,like:l})=>fetch(`${e}/comment/${n}?lang=${t}`,{method:"PUT",headers:mt,body:JSON.stringify({like:l})}).then((e=>e.json())))({serverURL:n,lang:l,objectId:a,like:!r}),r?o.value=o.value.filter((e=>e!==a)):(o.value=[...o.value,a],o.value.length>50&&(o.value=o.value.slice(-50))),e.like=(e.like||0)+(r?-1:1)},version:"2.7.0"}}});const Yn={"data-waline":""},Zn={class:"wl-head"},Xn={class:"wl-count"},el=["textContent"],tl={class:"wl-sort"},nl=["onClick"],ll={class:"wl-cards"},ol={key:1,class:"wl-operation"},al=["textContent"],rl={key:0,class:"wl-loading"},il=["textContent"],sl={class:"wl-operation"},cl=["textContent"],ul={key:3,class:"wl-power"},ml=z(" Powered by "),dl=I("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);var pl=At(Qn,[["render",function(e,t,n,l,o,a){const r=g("CommentBox"),i=g("CommentCard"),s=g("LoadingIcon");return f(),h("div",Yn,[e.reply?C("v-if",!0):(f(),k(r,{key:0,onSubmit:e.onSubmit},null,8,["onSubmit"])),I("div",Zn,[I("div",Xn,[e.count?(f(),h("span",{key:0,class:"wl-num",textContent:x(e.count)},null,8,el)):C("v-if",!0),z(" "+x(e.i18n.comment),1)]),I("ul",tl,[(f(!0),h(w,null,b(e.sortByItems,(t=>(f(),h("li",{key:t.key,class:R([t.key===e.sortBy?"active":""]),onClick:n=>e.onSortByChange(t.key)},x(e.i18n[t.name]),11,nl)))),128))])]),I("div",ll,[(f(!0),h(w,null,b(e.data,(t=>(f(),k(i,{key:t.objectId,"root-id":t.objectId,comment:t,reply:e.reply,onReply:e.onReply,onSubmit:e.onSubmit,onStatus:e.onStatusChange,onDelete:e.onDelete,onSticky:e.onSticky,onLike:e.onLike},null,8,["root-id","comment","reply","onReply","onSubmit","onStatus","onDelete","onSticky","onLike"])))),128))]),"error"===e.status?(f(),h("div",ol,[I("button",{type:"button",class:"wl-btn",onClick:t[0]||(t[0]=(...t)=>e.refresh&&e.refresh(...t)),textContent:x(e.i18n.refresh)},null,8,al)])):(f(),h(w,{key:2},["loading"===e.status?(f(),h("div",rl,[j(s,{size:30})])):e.data.length?e.page<e.totalPages?(f(),h(w,{key:2},[C(" Load more button "),I("div",sl,[I("button",{type:"button",class:"wl-btn",onClick:t[1]||(t[1]=(...t)=>e.loadMore&&e.loadMore(...t)),textContent:x(e.i18n.more)},null,8,cl)])],2112)):C("v-if",!0):(f(),h("div",{key:1,class:"wl-empty",textContent:x(e.i18n.sofa)},null,8,il))],64)),C(" Copyright Information "),e.config.copyright?(f(),h("div",ul,[ml,dl,z(" v"+x(e.version),1)])):C("v-if",!0)])}],["__file","Waline.vue"]]);const vl=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},gl=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:l=!0,lang:o="zh-CN"})=>{const a=new AbortController,r=Array.from(document.querySelectorAll(n)),i=e=>{const n=$t(e);return null!==n&&t!==n},s=n=>vt({serverURL:nt(e),paths:n.map((e=>$t(e)||t)),lang:o,signal:a.signal}).then((e=>vl(e,n))).catch(ut);if(l){const n=r.filter((e=>!i(e))),l=r.filter(i);gt({serverURL:nt(e),path:t,lang:o}).then((e=>vl(new Array(n.length).fill(e),n))),l.length&&s(l)}else s(r);return a.abort.bind(a)},fl=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:l=!1,...o})=>{const a=e?ft(e):null;if(e&&!a)throw new Error("Option 'el' do not match any domElement!");if(!o.serverURL)throw new Error("Option 'serverURL' is missing!");const r=L({...o}),i=L({comment:n,pageview:l,path:t}),s=a?P((()=>d(pl,{path:i.path,...r}))):null;s&&s.mount(a);const c=T((()=>{i.comment&&Rt({serverURL:r.serverURL,path:i.path,selector:"string"==typeof i.comment?i.comment:void 0})})),u=T((()=>{i.pageview&&gl({serverURL:r.serverURL,path:i.path,selector:"string"==typeof i.pageview?i.pageview:void 0})}));return{el:a,update:({comment:e,pageview:t,path:n=window.location.pathname,...l}={})=>{Object.entries(l).forEach((([e,t])=>{r[e]=t})),i.path=n,void 0!==e&&(i.comment=e),void 0!==t&&(i.pageview=t)},destroy:()=>{s?.unmount(),c(),u()}}},hl="2.7.0",yl=({el:e,serverURL:t,count:n,lang:l="zh-CN"})=>{const o=St(),a=ft(e),r=new AbortController;return(({serverURL:e,lang:t,count:n,signal:l,token:o})=>{const a={};return o&&(a.Authorization=`Bearer ${o}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:l,headers:a}).then((e=>e.json())).then((e=>dt(e,"recent comment")))})({serverURL:t,count:n,lang:l,signal:r.signal,token:o.value?.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:()=>{r.abort(),a.innerHTML=""}}):{comments:e,destroy:()=>r.abort()}))};export{yl as RecentComments,Rt as commentCount,le as defaultLocales,fl as init,gl as pageviewCount,hl 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 a=["nick","mail","link"],r=e=>e.filter((e=>a.includes(e))),i=e=>new Promise(((t,n)=>{if(e.size>128e3)return n(new Error("File too large! File size limit 128KB"));const o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result?.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=()=>{const e={next:""},t=({keyword:e,pos:t})=>{const n=new URLSearchParams("media_filter=minimal");return n.set("key","PAY5JLFIH6V6"),n.set("limit","20"),n.set("pos",t||""),n.set("q",e),fetch(`https://g.tenor.com/v1/search?${n.toString()}`,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())).catch((()=>({next:t||"",results:[]})))};return{search:(n="")=>t({keyword:n}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url})))))),more:n=>t({keyword:n,pos:e.next}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url}))))))}},m=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"),u=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],d={},p=e=>{let t=0;return e.replace(m,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;d[n]?l=d[n]:(l=u[t],d[n]=l);const a=`<span style="color: #${l}">${n}</span>`;return t=++t%u.length,a}))},v=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky"],g=e=>Object.fromEntries(e.map(((e,t)=>[v[t],e])));var f=g(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words","Please input comments between $0 and $1 words!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky"]),h=g(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない"]),y=g(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶"]),w=g(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂"]),k=g(["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","Like","Cancel like","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","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky"]),b=g(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий"]);const C={zh:y,"zh-cn":y,"zh-CN":y,"zh-tw":w,"zh-TW":w,en:f,"en-US":f,"en-us":f,jp:h,"jp-jp":h,"jp-JP":h,"pt-br":k,"pt-BR":k,ru:b,"ru-ru":b,"ru-RU":b};var E;const B="undefined"!=typeof window,N=()=>{};function I(t){return"function"==typeof t?t():e.unref(t)}function S(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}B&&(null==(E=null==window?void 0:window.navigator)?void 0:E.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const $=e=>e();function V(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}function L(e,t=200,n={}){return S(function(e,t={}){let n,o;return l=>{const a=I(e),r=I(t.maxWait);if(n&&clearTimeout(n),a<=0||void 0!==r&&r<=0)return o&&(clearTimeout(o),o=null),l();r&&!o&&(o=setTimeout((()=>{n&&clearTimeout(n),o=null,l()}),r)),n=setTimeout((()=>{o&&clearTimeout(o),o=null,l()}),a)}}(t,n),e)}var x=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;function O(t,n,o={}){const l=o,{eventFilter:a=$}=l,r=((e,t)=>{var n={};for(var o in e)j.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&x)for(var o of x(e))t.indexOf(o)<0&&R.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]);return e.watch(t,S(a,n),r)}var z=Object.defineProperty,A=Object.defineProperties,U=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,T=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function F(t,n,o={}){const l=o,{eventFilter:a}=l,r=((e,t)=>{var n={};for(var o in e)D.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&M)for(var o of M(e))t.indexOf(o)<0&&P.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)}}}(a),u=O(t,n,(d=((e,t)=>{for(var n in t||(t={}))D.call(t,n)&&T(e,n,t[n]);if(M)for(var n of M(t))P.call(t,n)&&T(e,n,t[n]);return e})({},r),A(d,U({eventFilter:i}))));var d;return{stop:u,pause:c,resume:s,isActive:m}}const H=B?window:void 0,_=B?window.document:void 0;function W(...t){let n,o,l,a;if("string"==typeof t[0]?([o,l,a]=t,n=H):[n,o,l,a]=t,!n)return N;let r=N;const i=e.watch((()=>function(e){var t;const n=I(e);return null!=(t=null==n?void 0:n.$el)?t:n}(n)),(e=>{r(),e&&(e.addEventListener(o,l,a),r=()=>{e.removeEventListener(o,l,a),r=N})}),{immediate:!0,flush:"post"}),c=()=>{i(),r()};return V(c),c}B&&window.navigator,B&&window.location;const q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},G="__vueuse_ssr_handlers__";q[G]=q[G]||{};const J=q[G];var K=Object.defineProperty,Q=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,X=(e,t,n)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ee=(e,t)=>{for(var n in t||(t={}))Y.call(t,n)&&X(e,n,t[n]);if(Q)for(var n of Q(t))Z.call(t,n)&&X(e,n,t[n]);return e};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(t,n,o,l={}){var a;const{flush:r="pre",deep:i=!0,listenToStorageChanges:c=!0,writeDefaults:s=!0,mergeDefaults:m=!1,shallow:u,window:d=H,eventFilter:p,onError:v=(e=>{console.error(e)})}=l,g=(u?e.shallowRef:e.ref)(n);if(!o)try{o=function(e,t){return J[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=H)?void 0:e.localStorage}))()}catch(e){v(e)}if(!o)return g;const f=I(n),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"}(f),y=null!=(a=l.serializer)?a:te[h],{pause:w,resume:k}=F(g,(()=>function(e){try{null==e?o.removeItem(t):o.setItem(t,y.write(e))}catch(e){v(e)}}(g.value)),{flush:r,deep:i,eventFilter:p});return d&&c&&W(d,"storage",b),b(),g;function b(e){e&&e.key!==t||(g.value=function(e){if(!e||e.key===t){w();try{const n=e?e.newValue:o.getItem(t);if(null==n)return s&&null!==f&&o.setItem(t,y.write(f)),f;if(!e&&m){const e=y.read(n);return"function"==typeof m?m(e,f):"object"!==h||Array.isArray(e)?e:ee(ee({},f),e)}return"string"!=typeof n?n:y.read(n)}catch(e){v(e)}finally{k()}}}(e))}}var oe,le,ae=Object.defineProperty,re=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,se=(e,t,n)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function me(t={}){const{controls:n=!1,interval:o="requestAnimationFrame"}=t,l=e.ref(new Date),a=()=>l.value=new Date,r="requestAnimationFrame"===o?function(t,n={}){const{immediate:o=!0,window:l=H}=n,a=e.ref(!1);let r=null;function i(){a.value&&l&&(t(),r=l.requestAnimationFrame(i))}function c(){!a.value&&l&&(a.value=!0,i())}function s(){a.value=!1,null!=r&&l&&(l.cancelAnimationFrame(r),r=null)}return o&&c(),V(s),{isActive:a,pause:s,resume:c}}(a,{immediate:!0}):function(t,n=1e3,o={}){const{immediate:l=!0,immediateCallback:a=!1}=o;let r=null;const i=e.ref(!1);function c(){r&&(clearInterval(r),r=null)}function s(){i.value=!1,c()}function m(){e.unref(n)<=0||(i.value=!0,a&&t(),c(),r=setInterval(t,I(n)))}l&&B&&m(),e.isRef(n)&&V(e.watch(n,(()=>{i.value&&B&&m()})));return V(s),{isActive:i,pause:s,resume:m}}(a,o,{immediate:!0});return n?((e,t)=>{for(var n in t||(t={}))ie.call(t,n)&&se(e,n,t[n]);if(re)for(var n of re(t))ce.call(t,n)&&se(e,n,t[n]);return e})({now:l},r):l}(le=oe||(oe={})).UP="UP",le.RIGHT="RIGHT",le.DOWN="DOWN",le.LEFT="LEFT",le.NONE="NONE";let ue=0;function de(t,n={}){const o=e.ref(!1),{document:l=_,immediate:a=!0,manual:r=!1,id:i="vueuse_styletag_"+ ++ue}=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)};return a&&!r&&function(t,n=!0){e.getCurrentInstance()?e.onMounted(t):n?t():e.nextTick(t)}(m),r||V(u),{id:i,css:c,unload:u,load:m,isLoaded:e.readonly(o)}}var pe=Object.defineProperty,ve=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,he=(e,t,n)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))ge.call(t,n)&&he(e,n,t[n]);if(ve)for(var n of ve(t))fe.call(t,n)&&he(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const ye=e=>{try{e=decodeURI(e)}catch(e){}return e},we=(e="")=>e.replace(/\/$/u,""),ke=e=>/^(https?:)?\/\//.test(e),be=e=>{const t=we(e);return ke(t)?t:`https://${t}`},Ce=e=>Array.isArray(e)?e:!!e&&[0,e],Ee=(e,t)=>"function"==typeof e?e:!1!==e&&t,Be="{--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},Ie=(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(),a=Math.floor(l/864e5);if(0===a){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 a<0?n.now:a<8?`${a} ${n.days}`:(e=>{const t=Ne(e.getDate(),2),n=Ne(e.getMonth()+1,2);return`${Ne(e.getFullYear(),2)}-${n}-${t}`})(o)},Se=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}))},$e=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,Ve=e=>{"AbortError"!==e.name&&console.error(e.message)},Le={"Content-Type":"application/json"},xe=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},je=({serverURL:e,lang:t,token:n,objectId:o,...l})=>fetch(`${e}/comment/${o}?lang=${t}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(l)}).then((e=>e.json())),Re=({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=>xe(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),Oe=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:Le,body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>xe(e,"visit count"))),ze=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,Ae=e=>e.type.includes("image"),Ue=e=>{const t=Array.from(e).find(Ae);return t?t.getAsFile():null},Me=/\$.*?\$/,De=/^\$(.*?)\$/,Pe=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Te=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),Fe=(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=Pe.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(Me);return-1!==t?t:e.length},tokenizer(t){const n=De.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(Te(e,t))},He=e=>e.dataset.path||e.getAttribute("id");let _e=null;const We=()=>_e||(_e=ne("WALINE_USER",{}));let qe=null;const Ge=()=>qe||(qe=ne("WALINE_LIKE",[])),Je=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:o="zh-CN"})=>{const l=new AbortController,a=document.querySelectorAll(n),r=We();return a.length&&(({serverURL:e,lang:t,paths:n,signal:o,token:l})=>{const a={};return l&&(a.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o,headers:a}).then((e=>e.json())).then((e=>xe(e,"comment count"))).then((e=>Array.isArray(e)?e:[e]))})({serverURL:be(e),paths:Array.from(a).map((e=>ye(e.dataset.path||e.getAttribute("id")||t))),lang:o,signal:l.signal,token:r.value?.token}).then((e=>{a.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(Ve),l.abort.bind(l)},Ke=({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 Qe=e.defineComponent({name:"ImageWall",components:{LoadingIcon:Ke},props:{items:{type:Array,default:()=>[]},columnWidth:{type:Number,default:300},gap:{type:Number,default:0}},emits:["insert"],setup(t){let n=null;const o=e.ref(null),l=e.ref({}),a=e.ref([]),r=()=>{const e=Math.floor((o.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return e>0?e:1},i=async n=>{if(n>=t.items.length)return;await e.nextTick();const l=Array.from(o.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));a.value[Number(l.dataset.index)].push(n),await i(n+1)},c=async(e=!1)=>{if(a.value.length===r()&&!e)return;var t;a.value=(t=r(),new Array(t).fill(null).map((()=>[])));const n=window.scrollY;await i(0),window.scrollTo({top:n})};return e.watch((()=>[t.items]),(()=>{l.value={},c(!0)})),e.watch((()=>[t.columnWidth,t.gap]),(()=>c())),e.onMounted((()=>{c(!0),n=new ResizeObserver((()=>c())),n.observe(o.value)})),e.onBeforeUnmount((()=>n.unobserve(o.value))),{columns:a,state:l,wall:o}}}),Ye=(e,t)=>{const n=e.__vccOpts||e;for(const[e,o]of t)n[e]=o;return n};const Ze=["data-index"],Xe=["src","title","onLoad","onClick"];var et=Ye(Qe,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",{ref:"wall",class:"wl-gallery",style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,((n,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"wl-gallery-column","data-index":o,style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n,(n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[t.state[t.items[n].src]?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,size:36,style:{margin:"20px auto"}})),e.createElementVNode("img",{class:"wl-gallery-item",src:t.items[n].src,title:t.items[n].title,loading:"lazy",onLoad:e=>t.state[t.items[n].src]=!0,onClick:e=>t.$emit("insert",`![](${t.items[n].src})`)},null,40,Xe)],64)))),128))],12,Ze)))),128))],4)}],["__file","ImageWall.vue"]]),tt=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"})]),ImageWall:et,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:Ke,GifIcon:()=>e.h("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[e.h("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),e.h("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})])},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"),a=ne("WALINE_COMMENT_BOX_EDITOR",""),r=ne("WALINE_USER_META",{nick:"",mail:"",link:""}),i=We(),c=e.ref({}),s=e.ref(null),m=e.ref(null),u=e.ref(null),d=e.ref(null),p=e.ref(null),v=e.ref(null),g=e.ref(null),f=e.ref({tabs:[],map:{}}),h=e.ref(0),y=e.ref(!1),w=e.ref(!1),k=e.ref(!1),b=e.ref(""),C=e.ref(0),E=e.reactive({loading:!0,list:[]}),B=e.ref(0),N=e.ref(!1),I=e.ref(""),S=e.ref(!1),$=e.computed((()=>o.value.locale)),V=e.computed((()=>Boolean(i.value?.token))),x=e.computed((()=>!1!==o.value.imageUploader)),j=e=>{const t=s.value,n=t.selectionStart,o=t.selectionEnd||0,l=t.scrollTop;a.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},R=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return j(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{a.value=a.value.replace(t,`\r\n![${e.name}](${n})`)})).catch((e=>{alert(e.message),a.value=a.value.replace(t,"")}))},O=()=>{const{serverURL:e,lang:l,login:m,wordLimit:u,requiredMeta:d}=o.value,p={comment:I.value,nick:r.value.nick,mail:r.value.mail,link:r.value.link,ua:navigator.userAgent,url:o.value.path};if(i.value?.token)p.nick=i.value.display_name,p.mail=i.value.email,p.link=i.value.url;else{if("force"===m)return;if(d.indexOf("nick")>-1&&!p.nick)return c.value.nick?.focus(),alert($.value.nickError);if(d.indexOf("mail")>-1&&!p.mail||p.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(p.mail))return c.value.mail?.focus(),alert($.value.mailError);if(!p.comment)return void s.value?.focus();p.nick||(p.nick=$.value.anonymous)}if(!N.value)return alert($.value.wordHint.replace("$0",u[0].toString()).replace("$1",u[1].toString()).replace("$2",C.value.toString()));p.comment=Te(p.comment,f.value.map),t.replyId&&t.rootId&&(p.pid=t.replyId,p.rid=t.rootId,p.at=t.replyUser),S.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:e,lang:l,token:i.value?.token,comment:p}).then((e=>{if(S.value=!1,e.errmsg)return alert(e.errmsg);n("submit",e.data),a.value="",b.value="",t.replyId&&n("cancel-reply")})).catch((e=>{S.value=!1,alert(e.message)}))},z=e=>{u.value.contains(e.target)||d.value.contains(e.target)||(y.value=!1),p.value.contains(e.target)||v.value.contains(e.target)||(w.value=!1)},A=async e=>{const{scrollTop:t,clientHeight:n,scrollHeight:l}=e.target,a=(n+t)/l,r=o.value.search,i=g.value?.value||"";a<.9||E.loading||(E.loading=!0,E.list.push(...r.more?await r.more(i,E.list.length):await r.search(i)),E.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},U=L((e=>{E.list=[],A(e)}),300);e.watch([o,C],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(B.value=n[0],N.value=!1):t>n[1]?(B.value=n[1],N.value=!1):(B.value=n[1],N.value=!0):(B.value=0,N.value=!0)}),{immediate:!0}),e.watch(w,(async e=>{if(!e)return;const t=o.value.search;g.value&&(g.value.value=""),E.loading=!0,E.list=t.default?await t.default():await t.search(""),E.loading=!1}));const M=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))))};return e.onMounted((()=>{document.body.addEventListener("click",z),window.addEventListener("message",M),e.watch((()=>a.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;I.value=e,b.value=Fe(e,{emojiMap:f.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?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?Se(we(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:a,type:r,items:i}=e;t.tabs.push({name:n,icon:$e(l,o,a,r),items:i.map((e=>{const n=`${a||""}${e}`;return t.map[n]=$e(e,o,a,r),n}))})})),t}))).then((e=>{f.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",z),window.removeEventListener("message",M)})),{config:o,locale:$,insert:j,onChange:()=>{const e=m.value;e.files&&x.value&&R(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{if(e.dataTransfer?.items){const t=Ue(e.dataTransfer.items);t&&x.value&&(R(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&O()},onPaste:e=>{if(e.clipboardData){const t=Ue(e.clipboardData.items);t&&x.value&&R(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,a=(window.innerHeight-450)/2,r=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);r?.postMessage({type:"TOKEN",data:null},"*");const c=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(r?.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,a=(window.innerHeight-800)/2;window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`)?.postMessage({type:"TOKEN",data:i.value.token},"*")},submitComment:O,onImageWallScroll:A,onGifSearch:U,isLogin:V,userInfo:i,isSubmitting:S,wordNumber:C,wordLimit:B,isWordNumberLegal:N,editor:a,userMeta:r,emoji:f,emojiTabIndex:h,showEmoji:y,gifData:E,showGif:w,canUploadImage:x,previewText:b,showPreview:k,inputRefs:c,editorRef:s,emojiButtonRef:u,emojiPopupRef:d,gifButtonRef:p,gifPopupRef:v,imageUploadRef:m,gifSearchInputRef:g}}});const nt={class:"wl-comment"},ot={key:0,class:"wl-login-info"},lt={class:"wl-avatar"},at=["title"],rt=["title"],it=["src"],ct=["title","textContent"],st={class:"wl-panel"},mt=["for","textContent"],ut=["id","onUpdate:modelValue","name","type"],dt=["placeholder"],pt={class:"wl-preview"},vt=e.createElementVNode("hr",null,null,-1),gt=["innerHTML"],ft={class:"wl-footer"},ht={class:"wl-actions"},yt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},wt=["title"],kt=["title"],bt=["title"],Ct=["title"],Et={class:"wl-info"},Bt={class:"wl-text-number"},Nt={key:0},It=e.createTextVNode("  /  "),St=["textContent"],$t=["textContent"],Vt=["disabled"],Lt=["placeholder"],xt={key:0,class:"wl-loading"},jt={key:0,class:"wl-tab-wrapper"},Rt=["title","onClick"],Ot=["src","alt"],zt={key:0,class:"wl-tabs"},At=["onClick"],Ut=["src","alt","title"],Mt=["title"];var Dt=Ye(tt,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("CloseIcon"),c=e.resolveComponent("MarkdownIcon"),s=e.resolveComponent("EmojiIcon"),m=e.resolveComponent("GifIcon"),u=e.resolveComponent("ImageIcon"),d=e.resolveComponent("PreviewIcon"),p=e.resolveComponent("LoadingIcon"),v=e.resolveComponent("ImageWall");return e.openBlock(),e.createElementBlock("div",nt,["disable"!==t.config.login&&t.isLogin?(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",lt,[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,at),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:t.locale.profile,onClick:n[1]||(n[1]=(...e)=>t.onProfile&&t.onProfile(...e))},[e.createElementVNode("img",{src:t.userInfo.avatar,alt:"avatar"},null,8,it)],8,rt)]),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:t.locale.profile,onClick:n[2]||(n[2]=(...e)=>t.onProfile&&t.onProfile(...e)),textContent:e.toDisplayString(t.userInfo.display_name)},null,8,ct)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",st,["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",{key:n,class:"wl-header-item"},[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,mt),e.withDirectives(e.createElementVNode("input",{id:`wl-${n}`,ref_for:!0,ref:e=>{e&&(t.inputRefs[n]=e)},"onUpdate:modelValue":e=>t.userMeta[n]=e,class:e.normalizeClass(["wl-input",`wl-${n}`]),name:n,type:"mail"===n?"email":"text"},null,10,ut),[[e.vModelDynamic,t.userMeta[n]]])])))),128))],2)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":n[3]||(n[3]=e=>t.editor=e),class:"wl-editor",placeholder:t.replyUser?`@${t.replyUser}`:t.locale.placeholder,onKeydown:n[4]||(n[4]=(...e)=>t.onKeyDown&&t.onKeyDown(...e)),onDrop:n[5]||(n[5]=(...e)=>t.onDrop&&t.onDrop(...e)),onPaste:n[6]||(n[6]=(...e)=>t.onPaste&&t.onPaste(...e))},null,40,dt),[[e.vModelText,t.editor]]),e.withDirectives(e.createElementVNode("div",pt,[vt,e.createElementVNode("h4",null,e.toDisplayString(t.locale.preview)+":",1),e.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),e.createElementVNode("div",{class:"wl-content",innerHTML:t.previewText},null,8,gt)],512),[[e.vShow,t.showPreview]]),e.createElementVNode("div",ft,[e.createElementVNode("div",ht,[e.createElementVNode("a",yt,[e.createVNode(c)]),e.withDirectives(e.createElementVNode("button",{ref:"emojiButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showEmoji}]),title:t.locale.emoji,onClick:n[7]||(n[7]=e=>t.showEmoji=!t.showEmoji)},[e.createVNode(s)],10,wt),[[e.vShow,t.emoji.tabs.length]]),t.config.search?(e.openBlock(),e.createElementBlock("button",{key:0,ref:"gifButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showGif}]),title:t.locale.gif,onClick:n[8]||(n[8]=e=>t.showGif=!t.showGif)},[e.createVNode(m)],10,kt)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:n[9]||(n[9]=(...e)=>t.onChange&&t.onChange(...e))},null,544),t.canUploadImage?(e.openBlock(),e.createElementBlock("label",{key:1,for:"wl-image-upload",class:"wl-action",title:t.locale.uploadImage},[e.createVNode(u)],8,bt)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:e.normalizeClass(["wl-action",{actived:t.showPreview}]),title:t.locale.preview,onClick:n[10]||(n[10]=e=>t.showPreview=!t.showPreview)},[e.createVNode(d)],10,Ct)]),e.createElementVNode("div",Et,[e.createElementVNode("div",Bt,[e.createTextVNode(e.toDisplayString(t.wordNumber)+" ",1),t.config.wordLimit?(e.openBlock(),e.createElementBlock("span",Nt,[It,e.createElementVNode("span",{class:e.normalizeClass({illegal:!t.isWordNumberLegal}),textContent:e.toDisplayString(t.wordLimit)},null,10,St)])):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[11]||(n[11]=(...e)=>t.onLogin&&t.onLogin(...e)),textContent:e.toDisplayString(t.locale.login)},null,8,$t)),"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[12]||(n[12]=(...e)=>t.submitComment&&t.submitComment(...e))},[t.isSubmitting?(e.openBlock(),e.createBlock(p,{key:0,size:16})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.locale.submit),1)],64))],8,Vt)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{ref:"gifPopupRef",class:e.normalizeClass(["wl-gif-popup",{display:t.showGif}])},[e.createElementVNode("input",{ref:"gifSearchInputRef",type:"text",placeholder:t.locale.gifSearchPlaceholder,onInput:n[13]||(n[13]=(...e)=>t.onGifSearch&&t.onGifSearch(...e))},null,40,Lt),e.createVNode(v,{items:t.gifData.list,"column-width":200,gap:6,onInsert:n[14]||(n[14]=e=>t.insert(e)),onScroll:t.onImageWallScroll},null,8,["items","onScroll"]),t.gifData.loading?(e.openBlock(),e.createElementBlock("div",xt,[e.createVNode(p,{size:30})])):e.createCommentVNode("v-if",!0)],2),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",jt,[(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,Rt)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),t.emoji.tabs.length>1?(e.openBlock(),e.createElementBlock("div",zt,[(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,Ut)],10,At)))),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[15]||(n[15]=e=>t.$emit("cancel-reply"))},[e.createVNode(i,{size:24})],8,Mt)):e.createCommentVNode("v-if",!0)])}],["__file","CommentBox.vue"]]);const Pt=["approved","waiting","spam"];var Tt=e.defineComponent({components:{CommentBox:Dt,DeleteIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),LikeIcon:({active:t=!1})=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("path",{d:"M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z"+(t?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"),fill:t?"red":"currentColor"})]),ReplyIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),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"}))},props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object,default:null}},emits:["submit","reply","like","delete","status","sticky"],setup(t){const n=e.inject("config"),o=Ge(),l=We(),a=e.computed((()=>n.value.locale)),r=e.computed((()=>{const{link:e}=t.comment;return e?ke(e)?e:`https://${e}`:""})),i=e.computed((()=>o.value.includes(t.comment.objectId))),c=((t,n)=>{const o=me();return e.computed((()=>Ie(t,o.value,n)))})(t.comment.insertedAt,a.value),s=e.computed((()=>"administrator"===l.value.type)),m=e.computed((()=>t.comment.user_id&&l.value.objectId===t.comment.user_id)),u=e.computed((()=>t.comment.objectId===t.reply?.objectId));return{config:n,locale:a,isReplyingCurrent:u,link:r,like:i,time:c,isAdmin:s,isOwner:m,commentStatus:Pt}}});const Ft=["id"],Ht={class:"wl-user","aria-hidden":"true"},_t=["src"],Wt={class:"wl-card"},qt={class:"wl-head"},Gt=["href"],Jt={key:1,class:"wl-nick"},Kt=["textContent"],Qt=["textContent"],Yt=["textContent"],Zt=["textContent"],Xt=["textContent"],en={class:"wl-comment-actions"},tn=["title"],nn=["textContent"],on=["title"],ln={class:"wl-meta","aria-hidden":"true"},an=["textContent"],rn=["textContent"],cn=["textContent"],sn=["innerHTML"],mn={key:0,class:"wl-admin-actions"},un={class:"wl-comment-status"},dn=["disabled","onClick","textContent"],pn={key:1,class:"wl-reply-wrapper"},vn={key:2,class:"wl-quote"};var gn=Ye(Tt,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("VerifiedIcon"),c=e.resolveComponent("DeleteIcon"),s=e.resolveComponent("LikeIcon"),m=e.resolveComponent("ReplyIcon"),u=e.resolveComponent("CommentBox"),d=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{id:t.comment.objectId,class:"wl-item"},[e.createElementVNode("div",Ht,[t.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.comment.avatar},null,8,_t)):e.createCommentVNode("v-if",!0),t.comment.type?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",Wt,[e.createElementVNode("div",qt,[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,Gt)):(e.openBlock(),e.createElementBlock("span",Jt,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,Kt)):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,Qt)):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,Yt)):e.createCommentVNode("v-if",!0),void 0!==t.comment.level&&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,Zt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(t.time)},null,8,Xt),e.createElementVNode("div",en,[t.isAdmin||t.isOwner?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-delete",onClick:n[0]||(n[0]=e=>t.$emit("delete",t.comment))},[e.createVNode(c)])):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:"wl-like",title:t.like?t.locale.cancelLike:t.locale.like,onClick:n[1]||(n[1]=e=>t.$emit("like",t.comment))},[e.createVNode(s,{active:t.like},null,8,["active"]),"like"in t.comment?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.like)},null,8,nn)):e.createCommentVNode("v-if",!0)],8,tn),e.createElementVNode("button",{class:e.normalizeClass(["wl-reply",{active:t.isReplyingCurrent}]),title:t.isReplyingCurrent?t.locale.cancelReply:t.locale.reply,onClick:n[2]||(n[2]=e=>t.$emit("reply",t.isReplyingCurrent?null:t.comment))},[e.createVNode(m)],10,on)])]),e.createElementVNode("div",ln,[t.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.addr)},null,8,an)):e.createCommentVNode("v-if",!0),t.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,textContent:e.toDisplayString(t.comment.browser)},null,8,rn)):e.createCommentVNode("v-if",!0),t.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,textContent:e.toDisplayString(t.comment.os)},null,8,cn)):e.createCommentVNode("v-if",!0)]),e.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),e.createElementVNode("div",{class:"wl-content",innerHTML:t.comment.comment},null,8,sn),t.isAdmin?(e.openBlock(),e.createElementBlock("div",mn,[e.createElementVNode("span",un,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.commentStatus,(n=>(e.openBlock(),e.createElementBlock("button",{key:n,class:e.normalizeClass(`wl-btn wl-${n}`),disabled:t.comment.status===n,onClick:e=>t.$emit("status",{status:n,comment:t.comment}),textContent:e.toDisplayString(t.locale[n])},null,10,dn)))),128))]),t.isAdmin&&!t.comment.rid?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn wl-sticky",onClick:n[3]||(n[3]=e=>t.$emit("sticky",t.comment))},e.toDisplayString(t.comment.sticky?t.locale.unsticky:t.locale.sticky),1)):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0),t.isReplyingCurrent?(e.openBlock(),e.createElementBlock("div",pn,[e.createVNode(u,{"reply-id":t.comment.objectId,"reply-user":t.comment.nick,"root-id":t.rootId,onSubmit:n[4]||(n[4]=e=>t.$emit("submit",e)),onCancelReply:n[5]||(n[5]=e=>t.$emit("reply",null))},null,8,["reply-id","reply-user","root-id"])])):e.createCommentVNode("v-if",!0),t.comment.children?(e.openBlock(),e.createElementBlock("div",vn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment.children,(o=>(e.openBlock(),e.createBlock(d,{key:o.objectId,comment:o,reply:t.reply,"root-id":t.rootId,onReply:n[6]||(n[6]=e=>t.$emit("reply",e)),onSubmit:n[7]||(n[7]=e=>t.$emit("submit",e)),onLike:n[8]||(n[8]=e=>t.$emit("like",e)),onDelete:n[9]||(n[9]=e=>t.$emit("delete",e)),onStatus:n[10]||(n[10]=e=>t.$emit("status",e)),onSticky:n[11]||(n[11]=e=>t.$emit("sticky",e))},null,8,["comment","reply","root-id"])))),128))])):e.createCommentVNode("v-if",!0)])],8,Ft)}],["__file","CommentCard.vue"]]);var fn=e.defineComponent({name:"WalineRoot",components:{CommentBox:Dt,CommentCard:gn,LoadingIcon:Ke},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","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.1.0/weibo"],meta:a=["nick","mail","link"],requiredMeta:m=[],dark:u=!1,pageSize:d=10,wordLimit:v,imageUploader:g,highlighter:f,texRenderer:h,copyright:y=!0,login:w="enable",search:k=s(),...b})=>({serverURL:be(e),path:ye(t),locale:{...C[n]||C["zh-CN"],..."object"==typeof o?o:{}},wordLimit:Ce(v),meta:r(a),requiredMeta:r(m),imageUploader:Ee(g,i),highlighter:Ee(f,p),texRenderer:Ee(h,c),lang:n,dark:u,emoji:l,pageSize:d,login:w,copyright:y,search:k,...b}))(t))),o=We(),l=Ge(),a=e.ref("loading"),m=e.ref(0),u=e.ref(1),d=e.ref(0),v=e.ref([]),g=e.ref(null),f=e.computed((()=>{return"string"==typeof(e=n.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${Be}}`:`${e}${Be}`:!0===e?`:root${Be}`:"";var e}));let h;de(f);const y=e=>{const{serverURL:t,path:l,pageSize:r}=n.value,i=new AbortController;a.value="loading",h?.(),(({serverURL:e,lang:t,path:n,page:o,pageSize:l,signal:a,token:r})=>{const i={};return r&&(i.Authorization=`Bearer ${r}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}`,{signal:a,headers:i}).then((e=>e.json())).then((e=>xe(e,"comment list")))})({serverURL:t,lang:n.value.lang,path:l,pageSize:r,page:e,signal:i.signal,token:o.value?.token}).then((t=>{a.value="success",m.value=t.count,v.value.push(...t.data),u.value=e,d.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),a.value="error")})),h=i.abort.bind(i)},w=()=>{m.value=0,v.value=[],y(1)};return e.provide("config",n),e.watch((()=>t.path),w),e.onMounted((()=>w())),{config:n,darkmodeStyle:f,i18n:e.computed((()=>n.value.locale)),status:a,count:m,page:u,totalPages:d,data:v,reply:g,loadMore:()=>y(u.value+1),refresh:w,onReply:e=>{g.value=e},onSubmit:e=>{if(e.rid){const t=v.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else v.value.unshift(e)},onStatusChange:async({comment:e,status:t})=>{if(e.status===t)return;const{serverURL:l,lang:a}=n.value;await je({serverURL:l,lang:a,token:o.value?.token,objectId:e.objectId,status:t}),e.status=t},onDelete:async({objectId:e})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:t,lang:l}=n.value;await(({serverURL:e,lang:t,token:n,objectId:o})=>fetch(`${e}/comment/${o}?lang=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${n}`}}).then((e=>e.json())))({serverURL:t,lang:l,token:o.value?.token,objectId:e}),v.value.some(((t,n)=>t.objectId===e?(v.value=v.value.filter(((e,t)=>t!==n)),!0):t.children.some(((o,l)=>o.objectId===e&&(v.value[n].children=t.children.filter(((e,t)=>t!==l)),!0)))))},onSticky:async e=>{if(e.rid)return;const{serverURL:t,lang:l}=n.value;await je({serverURL:t,lang:l,token:o.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},onLike:async e=>{const{serverURL:t,lang:o}=n.value,{objectId:a}=e,r=l.value.includes(a);await(({serverURL:e,lang:t,objectId:n,like:o})=>fetch(`${e}/comment/${n}?lang=${t}`,{method:"PUT",headers:Le,body:JSON.stringify({like:o})}).then((e=>e.json())))({serverURL:t,lang:o,objectId:a,like:!r}),r?l.value=l.value.filter((e=>e!==a)):(l.value=[...l.value,a],l.value.length>50&&(l.value=l.value.slice(-50))),e.like=(e.like||0)+(r?-1:1)},version:"2.6.4"}}});const hn={"data-waline":""},yn={class:"wl-count"},wn=["textContent"],kn={class:"wl-cards"},bn={key:1,class:"wl-operation"},Cn=["textContent"],En={key:0,class:"wl-loading"},Bn=["textContent"],Nn={class:"wl-operation"},In=["textContent"],Sn={key:3,class:"wl-power"},$n=e.createTextVNode(" Powered by "),Vn=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);var Ln=Ye(fn,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("CommentBox"),c=e.resolveComponent("CommentCard"),s=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",hn,[t.reply?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,onSubmit:t.onSubmit},null,8,["onSubmit"])),e.createElementVNode("div",yn,[t.count?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(t.count)},null,8,wn)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.i18n.comment),1)]),e.createElementVNode("div",kn,[(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,onStatus:t.onStatusChange,onDelete:t.onDelete,onSticky:t.onSticky,onLike:t.onLike},null,8,["root-id","comment","reply","onReply","onSubmit","onStatus","onDelete","onSticky","onLike"])))),128))]),"error"===t.status?(e.openBlock(),e.createElementBlock("div",bn,[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,Cn)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===t.status?(e.openBlock(),e.createElementBlock("div",En,[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",Nn,[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,In)])],2112)):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(t.i18n.sofa)},null,8,Bn))],64)),e.createCommentVNode(" Copyright Information "),t.config.copyright?(e.openBlock(),e.createElementBlock("div",Sn,[$n,Vn,e.createTextVNode(" v"+e.toDisplayString(t.version),1)])):e.createCommentVNode("v-if",!0)])}],["__file","Waline.vue"]]);const xn=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},jn=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:o=!0,lang:l="zh-CN"})=>{const a=new AbortController,r=Array.from(document.querySelectorAll(n)),i=e=>{const n=He(e);return null!==n&&t!==n},c=n=>Re({serverURL:be(e),paths:n.map((e=>He(e)||t)),lang:l,signal:a.signal}).then((e=>xn(e,n))).catch(Ve);if(o){const n=r.filter((e=>!i(e))),o=r.filter(i);Oe({serverURL:be(e),path:t,lang:l}).then((e=>xn(new Array(n.length).fill(e),n))),o.length&&c(o)}else c(r);return a.abort.bind(a)};exports.RecentComments=({el:e,serverURL:t,count:n,lang:o="zh-CN"})=>{const l=We(),a=ze(e),r=new AbortController;return(({serverURL:e,lang:t,count:n,signal:o,token:l})=>{const a={};return l&&(a.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:o,headers:a}).then((e=>e.json())).then((e=>xe(e,"recent comment")))})({serverURL:t,count:n,lang:o,signal:r.signal,token:l.value?.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:()=>{r.abort(),a.innerHTML=""}}):{comments:e,destroy:()=>r.abort()}))},exports.commentCount=Je,exports.defaultLocales=C,exports.init=({el:t="#waline",path:n=window.location.pathname,comment:o=!1,pageview:l=!1,...a})=>{const r=t?ze(t):null;if(t&&!r)throw new Error("Option 'el' do not match any domElement!");if(!a.serverURL)throw new Error("Option 'serverURL' is missing!");const i=e.reactive({...a}),c=e.reactive({comment:o,pageview:l,path:n}),s=r?e.createApp((()=>e.h(Ln,{path:c.path,...i}))):null;s&&s.mount(r);const m=e.watchEffect((()=>{c.comment&&Je({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.comment?c.comment:void 0})})),u=e.watchEffect((()=>{c.pageview&&jn({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.pageview?c.pageview:void 0})}));return{el:r,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:()=>{s?.unmount(),m(),u()}}},exports.pageviewCount=jn,exports.version="2.6.4";
"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 a=["nick","mail","link"],r=e=>e.filter((e=>a.includes(e))),i=e=>new Promise(((t,n)=>{if(e.size>128e3)return n(new Error("File too large! File size limit 128KB"));const o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result?.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=()=>{const e={next:""},t=({keyword:e,pos:t})=>{const n=new URLSearchParams("media_filter=minimal");return n.set("key","PAY5JLFIH6V6"),n.set("limit","20"),n.set("pos",t||""),n.set("q",e),fetch(`https://g.tenor.com/v1/search?${n.toString()}`,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())).catch((()=>({next:t||"",results:[]})))};return{search:(n="")=>t({keyword:n}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url})))))),more:n=>t({keyword:n,pos:e.next}).then((t=>(e.next=t.next,t.results.map((e=>({title:e.title,src:e.media[0].tinygif.url}))))))}},m=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"),u=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],d={},p=e=>{let t=0;return e.replace(m,((e,n,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if("<"===n)return"&lt;";let l;d[n]?l=d[n]:(l=u[t],d[n]=l);const a=`<span style="color: #${l}">${n}</span>`;return t=++t%u.length,a}))},v=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest"],g=e=>Object.fromEntries(e.map(((e,t)=>[v[t],e])));var f=g(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words","Please input comments between $0 and $1 words!\n Current word number: $2","Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest"]),h=g(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順"]),y=g(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度"]),w=g(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂","按倒序","按正序","按熱度"]),k=g(["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","Like","Cancel like","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","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente"]),b=g(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий"]);const C={zh:y,"zh-cn":y,"zh-CN":y,"zh-tw":w,"zh-TW":w,en:f,"en-US":f,"en-us":f,jp:h,"jp-jp":h,"jp-JP":h,"pt-br":k,"pt-BR":k,ru:b,"ru-ru":b,"ru-RU":b};var E;const B="undefined"!=typeof window,N=()=>{};function I(t){return"function"==typeof t?t():e.unref(t)}function S(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}B&&(null==(E=null==window?void 0:window.navigator)?void 0:E.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const $=e=>e();function V(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}function L(e,t=200,n={}){return S(function(e,t={}){let n,o;return l=>{const a=I(e),r=I(t.maxWait);if(n&&clearTimeout(n),a<=0||void 0!==r&&r<=0)return o&&(clearTimeout(o),o=null),l();r&&!o&&(o=setTimeout((()=>{n&&clearTimeout(n),o=null,l()}),r)),n=setTimeout((()=>{o&&clearTimeout(o),o=null,l()}),a)}}(t,n),e)}var x=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;function O(t,n,o={}){const l=o,{eventFilter:a=$}=l,r=((e,t)=>{var n={};for(var o in e)j.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&x)for(var o of x(e))t.indexOf(o)<0&&R.call(e,o)&&(n[o]=e[o]);return n})(l,["eventFilter"]);return e.watch(t,S(a,n),r)}var z=Object.defineProperty,A=Object.defineProperties,U=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,T=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function F(t,n,o={}){const l=o,{eventFilter:a}=l,r=((e,t)=>{var n={};for(var o in e)D.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&M)for(var o of M(e))t.indexOf(o)<0&&P.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)}}}(a),u=O(t,n,(d=((e,t)=>{for(var n in t||(t={}))D.call(t,n)&&T(e,n,t[n]);if(M)for(var n of M(t))P.call(t,n)&&T(e,n,t[n]);return e})({},r),A(d,U({eventFilter:i}))));var d;return{stop:u,pause:c,resume:s,isActive:m}}const H=B?window:void 0,_=B?window.document:void 0;function W(...t){let n,o,l,a;if("string"==typeof t[0]?([o,l,a]=t,n=H):[n,o,l,a]=t,!n)return N;let r=N;const i=e.watch((()=>function(e){var t;const n=I(e);return null!=(t=null==n?void 0:n.$el)?t:n}(n)),(e=>{r(),e&&(e.addEventListener(o,l,a),r=()=>{e.removeEventListener(o,l,a),r=N})}),{immediate:!0,flush:"post"}),c=()=>{i(),r()};return V(c),c}B&&window.navigator,B&&window.location;const q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},G="__vueuse_ssr_handlers__";q[G]=q[G]||{};const J=q[G];var K=Object.defineProperty,Q=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,X=(e,t,n)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ee=(e,t)=>{for(var n in t||(t={}))Y.call(t,n)&&X(e,n,t[n]);if(Q)for(var n of Q(t))Z.call(t,n)&&X(e,n,t[n]);return e};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(t,n,o,l={}){var a;const{flush:r="pre",deep:i=!0,listenToStorageChanges:c=!0,writeDefaults:s=!0,mergeDefaults:m=!1,shallow:u,window:d=H,eventFilter:p,onError:v=(e=>{console.error(e)})}=l,g=(u?e.shallowRef:e.ref)(n);if(!o)try{o=function(e,t){return J[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=H)?void 0:e.localStorage}))()}catch(e){v(e)}if(!o)return g;const f=I(n),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"}(f),y=null!=(a=l.serializer)?a:te[h],{pause:w,resume:k}=F(g,(()=>function(e){try{null==e?o.removeItem(t):o.setItem(t,y.write(e))}catch(e){v(e)}}(g.value)),{flush:r,deep:i,eventFilter:p});return d&&c&&W(d,"storage",b),b(),g;function b(e){e&&e.key!==t||(g.value=function(e){if(!e||e.key===t){w();try{const n=e?e.newValue:o.getItem(t);if(null==n)return s&&null!==f&&o.setItem(t,y.write(f)),f;if(!e&&m){const e=y.read(n);return"function"==typeof m?m(e,f):"object"!==h||Array.isArray(e)?e:ee(ee({},f),e)}return"string"!=typeof n?n:y.read(n)}catch(e){v(e)}finally{k()}}}(e))}}var oe,le,ae=Object.defineProperty,re=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,se=(e,t,n)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function me(t={}){const{controls:n=!1,interval:o="requestAnimationFrame"}=t,l=e.ref(new Date),a=()=>l.value=new Date,r="requestAnimationFrame"===o?function(t,n={}){const{immediate:o=!0,window:l=H}=n,a=e.ref(!1);let r=null;function i(){a.value&&l&&(t(),r=l.requestAnimationFrame(i))}function c(){!a.value&&l&&(a.value=!0,i())}function s(){a.value=!1,null!=r&&l&&(l.cancelAnimationFrame(r),r=null)}return o&&c(),V(s),{isActive:a,pause:s,resume:c}}(a,{immediate:!0}):function(t,n=1e3,o={}){const{immediate:l=!0,immediateCallback:a=!1}=o;let r=null;const i=e.ref(!1);function c(){r&&(clearInterval(r),r=null)}function s(){i.value=!1,c()}function m(){e.unref(n)<=0||(i.value=!0,a&&t(),c(),r=setInterval(t,I(n)))}l&&B&&m(),e.isRef(n)&&V(e.watch(n,(()=>{i.value&&B&&m()})));return V(s),{isActive:i,pause:s,resume:m}}(a,o,{immediate:!0});return n?((e,t)=>{for(var n in t||(t={}))ie.call(t,n)&&se(e,n,t[n]);if(re)for(var n of re(t))ce.call(t,n)&&se(e,n,t[n]);return e})({now:l},r):l}(le=oe||(oe={})).UP="UP",le.RIGHT="RIGHT",le.DOWN="DOWN",le.LEFT="LEFT",le.NONE="NONE";let ue=0;function de(t,n={}){const o=e.ref(!1),{document:l=_,immediate:a=!0,manual:r=!1,id:i="vueuse_styletag_"+ ++ue}=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)};return a&&!r&&function(t,n=!0){e.getCurrentInstance()?e.onMounted(t):n?t():e.nextTick(t)}(m),r||V(u),{id:i,css:c,unload:u,load:m,isLoaded:e.readonly(o)}}var pe=Object.defineProperty,ve=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,he=(e,t,n)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))ge.call(t,n)&&he(e,n,t[n]);if(ve)for(var n of ve(t))fe.call(t,n)&&he(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const ye=e=>{try{e=decodeURI(e)}catch(e){}return e},we=(e="")=>e.replace(/\/$/u,""),ke=e=>/^(https?:)?\/\//.test(e),be=e=>{const t=we(e);return ke(t)?t:`https://${t}`},Ce=e=>Array.isArray(e)?e:!!e&&[0,e],Ee=(e,t)=>"function"==typeof e?e:!1!==e&&t,Be="{--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},Ie=(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(),a=Math.floor(l/864e5);if(0===a){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 a<0?n.now:a<8?`${a} ${n.days}`:(e=>{const t=Ne(e.getDate(),2),n=Ne(e.getMonth()+1,2);return`${Ne(e.getFullYear(),2)}-${n}-${t}`})(o)},Se=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}))},$e=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,Ve=e=>{"AbortError"!==e.name&&console.error(e.message)},Le={"Content-Type":"application/json"},xe=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`Fetch ${t} failed with ${e.errno}: ${e.errmsg}`);return e},je=({serverURL:e,lang:t,token:n,objectId:o,...l})=>fetch(`${e}/comment/${o}?lang=${t}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(l)}).then((e=>e.json())),Re=({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=>xe(e,"visit count"))).then((e=>Array.isArray(e)?e:[e])),Oe=({serverURL:e,lang:t,path:n})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:Le,body:JSON.stringify({path:n})}).then((e=>e.json())).then((e=>xe(e,"visit count"))),ze=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,Ae=e=>e.type.includes("image"),Ue=e=>{const t=Array.from(e).find(Ae);return t?t.getAsFile():null},Me=/\$.*?\$/,De=/^\$(.*?)\$/,Pe=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Te=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),Fe=(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=Pe.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(Me);return-1!==t?t:e.length},tokenizer(t){const n=De.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(Te(e,t))},He=e=>e.dataset.path||e.getAttribute("id");let _e=null;const We=()=>_e||(_e=ne("WALINE_USER",{}));let qe=null;const Ge=()=>qe||(qe=ne("WALINE_LIKE",[])),Je=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:o="zh-CN"})=>{const l=new AbortController,a=document.querySelectorAll(n),r=We();return a.length&&(({serverURL:e,lang:t,paths:n,signal:o,token:l})=>{const a={};return l&&(a.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o,headers:a}).then((e=>e.json())).then((e=>xe(e,"comment count"))).then((e=>Array.isArray(e)?e:[e]))})({serverURL:be(e),paths:Array.from(a).map((e=>ye(e.dataset.path||e.getAttribute("id")||t))),lang:o,signal:l.signal,token:r.value?.token}).then((e=>{a.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(Ve),l.abort.bind(l)},Ke=({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 Qe=e.defineComponent({name:"ImageWall",components:{LoadingIcon:Ke},props:{items:{type:Array,default:()=>[]},columnWidth:{type:Number,default:300},gap:{type:Number,default:0}},emits:["insert"],setup(t){let n=null;const o=e.ref(null),l=e.ref({}),a=e.ref([]),r=()=>{const e=Math.floor((o.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return e>0?e:1},i=async n=>{if(n>=t.items.length)return;await e.nextTick();const l=Array.from(o.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));a.value[Number(l.dataset.index)].push(n),await i(n+1)},c=async(e=!1)=>{if(a.value.length===r()&&!e)return;var t;a.value=(t=r(),new Array(t).fill(null).map((()=>[])));const n=window.scrollY;await i(0),window.scrollTo({top:n})};return e.watch((()=>[t.items]),(()=>{l.value={},c(!0)})),e.watch((()=>[t.columnWidth,t.gap]),(()=>c())),e.onMounted((()=>{c(!0),n=new ResizeObserver((()=>c())),n.observe(o.value)})),e.onBeforeUnmount((()=>n.unobserve(o.value))),{columns:a,state:l,wall:o}}}),Ye=(e,t)=>{const n=e.__vccOpts||e;for(const[e,o]of t)n[e]=o;return n};const Ze=["data-index"],Xe=["src","title","onLoad","onClick"];var et=Ye(Qe,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",{ref:"wall",class:"wl-gallery",style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,((n,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"wl-gallery-column","data-index":o,style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n,(n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[t.state[t.items[n].src]?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,size:36,style:{margin:"20px auto"}})),e.createElementVNode("img",{class:"wl-gallery-item",src:t.items[n].src,title:t.items[n].title,loading:"lazy",onLoad:e=>t.state[t.items[n].src]=!0,onClick:e=>t.$emit("insert",`![](${t.items[n].src})`)},null,40,Xe)],64)))),128))],12,Ze)))),128))],4)}],["__file","ImageWall.vue"]]),tt=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"})]),ImageWall:et,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:Ke,GifIcon:()=>e.h("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[e.h("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),e.h("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})])},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"),a=ne("WALINE_COMMENT_BOX_EDITOR",""),r=ne("WALINE_USER_META",{nick:"",mail:"",link:""}),i=We(),c=e.ref({}),s=e.ref(null),m=e.ref(null),u=e.ref(null),d=e.ref(null),p=e.ref(null),v=e.ref(null),g=e.ref(null),f=e.ref({tabs:[],map:{}}),h=e.ref(0),y=e.ref(!1),w=e.ref(!1),k=e.ref(!1),b=e.ref(""),C=e.ref(0),E=e.reactive({loading:!0,list:[]}),B=e.ref(0),N=e.ref(!1),I=e.ref(""),S=e.ref(!1),$=e.computed((()=>o.value.locale)),V=e.computed((()=>Boolean(i.value?.token))),x=e.computed((()=>!1!==o.value.imageUploader)),j=e=>{const t=s.value,n=t.selectionStart,o=t.selectionEnd||0,l=t.scrollTop;a.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},R=e=>{const t=`![${o.value.locale.uploading} ${e.name}]()`;return j(t),Promise.resolve().then((()=>o.value.imageUploader(e))).then((n=>{a.value=a.value.replace(t,`\r\n![${e.name}](${n})`)})).catch((e=>{alert(e.message),a.value=a.value.replace(t,"")}))},O=()=>{const{serverURL:e,lang:l,login:m,wordLimit:u,requiredMeta:d}=o.value,p={comment:I.value,nick:r.value.nick,mail:r.value.mail,link:r.value.link,ua:navigator.userAgent,url:o.value.path};if(i.value?.token)p.nick=i.value.display_name,p.mail=i.value.email,p.link=i.value.url;else{if("force"===m)return;if(d.indexOf("nick")>-1&&!p.nick)return c.value.nick?.focus(),alert($.value.nickError);if(d.indexOf("mail")>-1&&!p.mail||p.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(p.mail))return c.value.mail?.focus(),alert($.value.mailError);if(!p.comment)return void s.value?.focus();p.nick||(p.nick=$.value.anonymous)}if(!N.value)return alert($.value.wordHint.replace("$0",u[0].toString()).replace("$1",u[1].toString()).replace("$2",C.value.toString()));p.comment=Te(p.comment,f.value.map),t.replyId&&t.rootId&&(p.pid=t.replyId,p.rid=t.rootId,p.at=t.replyUser),S.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:e,lang:l,token:i.value?.token,comment:p}).then((e=>{if(S.value=!1,e.errmsg)return alert(e.errmsg);n("submit",e.data),a.value="",b.value="",t.replyId&&n("cancel-reply")})).catch((e=>{S.value=!1,alert(e.message)}))},z=e=>{u.value.contains(e.target)||d.value.contains(e.target)||(y.value=!1),p.value.contains(e.target)||v.value.contains(e.target)||(w.value=!1)},A=async e=>{const{scrollTop:t,clientHeight:n,scrollHeight:l}=e.target,a=(n+t)/l,r=o.value.search,i=g.value?.value||"";a<.9||E.loading||(E.loading=!0,E.list.push(...r.more?await r.more(i,E.list.length):await r.search(i)),E.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},U=L((e=>{E.list=[],A(e)}),300);e.watch([o,C],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(B.value=n[0],N.value=!1):t>n[1]?(B.value=n[1],N.value=!1):(B.value=n[1],N.value=!0):(B.value=0,N.value=!0)}),{immediate:!0}),e.watch(w,(async e=>{if(!e)return;const t=o.value.search;g.value&&(g.value.value=""),E.loading=!0,E.list=t.default?await t.default():await t.search(""),E.loading=!1}));const M=({data:e})=>{e&&"profile"===e.type&&(i.value={...i.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(i)))))};return e.onMounted((()=>{document.body.addEventListener("click",z),window.addEventListener("message",M),e.watch((()=>a.value),(e=>{const{highlighter:t,texRenderer:n}=o.value;I.value=e,b.value=Fe(e,{emojiMap:f.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?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?Se(we(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:l,prefix:a,type:r,items:i}=e;t.tabs.push({name:n,icon:$e(l,o,a,r),items:i.map((e=>{const n=`${a||""}${e}`;return t.map[n]=$e(e,o,a,r),n}))})})),t}))).then((e=>{f.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",z),window.removeEventListener("message",M)})),{config:o,locale:$,insert:j,onChange:()=>{const e=m.value;e.files&&x.value&&R(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{if(e.dataTransfer?.items){const t=Ue(e.dataTransfer.items);t&&x.value&&(R(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&O()},onPaste:e=>{if(e.clipboardData){const t=Ue(e.clipboardData.items);t&&x.value&&R(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=o.value,l=(window.innerWidth-450)/2,a=(window.innerHeight-450)/2,r=window.open(`${n}/ui/login?lng=${encodeURIComponent(t)}`,"_blank",`width=450,height=450,left=${l},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);r?.postMessage({type:"TOKEN",data:null},"*");const c=({data:e})=>{e&&"userInfo"===e.type&&e.data.token&&(r?.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,a=(window.innerHeight-800)/2;window.open(`${n}/ui/profile?lng=${encodeURIComponent(t)}`,"_blank",`width=800,height=800,left=${l},top=${a},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`)?.postMessage({type:"TOKEN",data:i.value.token},"*")},submitComment:O,onImageWallScroll:A,onGifSearch:U,isLogin:V,userInfo:i,isSubmitting:S,wordNumber:C,wordLimit:B,isWordNumberLegal:N,editor:a,userMeta:r,emoji:f,emojiTabIndex:h,showEmoji:y,gifData:E,showGif:w,canUploadImage:x,previewText:b,showPreview:k,inputRefs:c,editorRef:s,emojiButtonRef:u,emojiPopupRef:d,gifButtonRef:p,gifPopupRef:v,imageUploadRef:m,gifSearchInputRef:g}}});const nt={class:"wl-comment"},ot={key:0,class:"wl-login-info"},lt={class:"wl-avatar"},at=["title"],rt=["title"],it=["src"],ct=["title","textContent"],st={class:"wl-panel"},mt=["for","textContent"],ut=["id","onUpdate:modelValue","name","type"],dt=["placeholder"],pt={class:"wl-preview"},vt=e.createElementVNode("hr",null,null,-1),gt=["innerHTML"],ft={class:"wl-footer"},ht={class:"wl-actions"},yt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},wt=["title"],kt=["title"],bt=["title"],Ct=["title"],Et={class:"wl-info"},Bt={class:"wl-text-number"},Nt={key:0},It=e.createTextVNode("  /  "),St=["textContent"],$t=["textContent"],Vt=["disabled"],Lt=["placeholder"],xt={key:0,class:"wl-loading"},jt={key:0,class:"wl-tab-wrapper"},Rt=["title","onClick"],Ot=["src","alt"],zt={key:0,class:"wl-tabs"},At=["onClick"],Ut=["src","alt","title"],Mt=["title"];var Dt=Ye(tt,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("CloseIcon"),c=e.resolveComponent("MarkdownIcon"),s=e.resolveComponent("EmojiIcon"),m=e.resolveComponent("GifIcon"),u=e.resolveComponent("ImageIcon"),d=e.resolveComponent("PreviewIcon"),p=e.resolveComponent("LoadingIcon"),v=e.resolveComponent("ImageWall");return e.openBlock(),e.createElementBlock("div",nt,["disable"!==t.config.login&&t.isLogin?(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",lt,[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,at),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:t.locale.profile,onClick:n[1]||(n[1]=(...e)=>t.onProfile&&t.onProfile(...e))},[e.createElementVNode("img",{src:t.userInfo.avatar,alt:"avatar"},null,8,it)],8,rt)]),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:t.locale.profile,onClick:n[2]||(n[2]=(...e)=>t.onProfile&&t.onProfile(...e)),textContent:e.toDisplayString(t.userInfo.display_name)},null,8,ct)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",st,["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",{key:n,class:"wl-header-item"},[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,mt),e.withDirectives(e.createElementVNode("input",{id:`wl-${n}`,ref_for:!0,ref:e=>{e&&(t.inputRefs[n]=e)},"onUpdate:modelValue":e=>t.userMeta[n]=e,class:e.normalizeClass(["wl-input",`wl-${n}`]),name:n,type:"mail"===n?"email":"text"},null,10,ut),[[e.vModelDynamic,t.userMeta[n]]])])))),128))],2)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",{id:"wl-edit",ref:"editorRef","onUpdate:modelValue":n[3]||(n[3]=e=>t.editor=e),class:"wl-editor",placeholder:t.replyUser?`@${t.replyUser}`:t.locale.placeholder,onKeydown:n[4]||(n[4]=(...e)=>t.onKeyDown&&t.onKeyDown(...e)),onDrop:n[5]||(n[5]=(...e)=>t.onDrop&&t.onDrop(...e)),onPaste:n[6]||(n[6]=(...e)=>t.onPaste&&t.onPaste(...e))},null,40,dt),[[e.vModelText,t.editor]]),e.withDirectives(e.createElementVNode("div",pt,[vt,e.createElementVNode("h4",null,e.toDisplayString(t.locale.preview)+":",1),e.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),e.createElementVNode("div",{class:"wl-content",innerHTML:t.previewText},null,8,gt)],512),[[e.vShow,t.showPreview]]),e.createElementVNode("div",ft,[e.createElementVNode("div",ht,[e.createElementVNode("a",yt,[e.createVNode(c)]),e.withDirectives(e.createElementVNode("button",{ref:"emojiButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showEmoji}]),title:t.locale.emoji,onClick:n[7]||(n[7]=e=>t.showEmoji=!t.showEmoji)},[e.createVNode(s)],10,wt),[[e.vShow,t.emoji.tabs.length]]),t.config.search?(e.openBlock(),e.createElementBlock("button",{key:0,ref:"gifButtonRef",class:e.normalizeClass(["wl-action",{actived:t.showGif}]),title:t.locale.gif,onClick:n[8]||(n[8]=e=>t.showGif=!t.showGif)},[e.createVNode(m)],10,kt)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",{id:"wl-image-upload",ref:"imageUploadRef",class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:n[9]||(n[9]=(...e)=>t.onChange&&t.onChange(...e))},null,544),t.canUploadImage?(e.openBlock(),e.createElementBlock("label",{key:1,for:"wl-image-upload",class:"wl-action",title:t.locale.uploadImage},[e.createVNode(u)],8,bt)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:e.normalizeClass(["wl-action",{actived:t.showPreview}]),title:t.locale.preview,onClick:n[10]||(n[10]=e=>t.showPreview=!t.showPreview)},[e.createVNode(d)],10,Ct)]),e.createElementVNode("div",Et,[e.createElementVNode("div",Bt,[e.createTextVNode(e.toDisplayString(t.wordNumber)+" ",1),t.config.wordLimit?(e.openBlock(),e.createElementBlock("span",Nt,[It,e.createElementVNode("span",{class:e.normalizeClass({illegal:!t.isWordNumberLegal}),textContent:e.toDisplayString(t.wordLimit)},null,10,St)])):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[11]||(n[11]=(...e)=>t.onLogin&&t.onLogin(...e)),textContent:e.toDisplayString(t.locale.login)},null,8,$t)),"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[12]||(n[12]=(...e)=>t.submitComment&&t.submitComment(...e))},[t.isSubmitting?(e.openBlock(),e.createBlock(p,{key:0,size:16})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.locale.submit),1)],64))],8,Vt)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{ref:"gifPopupRef",class:e.normalizeClass(["wl-gif-popup",{display:t.showGif}])},[e.createElementVNode("input",{ref:"gifSearchInputRef",type:"text",placeholder:t.locale.gifSearchPlaceholder,onInput:n[13]||(n[13]=(...e)=>t.onGifSearch&&t.onGifSearch(...e))},null,40,Lt),e.createVNode(v,{items:t.gifData.list,"column-width":200,gap:6,onInsert:n[14]||(n[14]=e=>t.insert(e)),onScroll:t.onImageWallScroll},null,8,["items","onScroll"]),t.gifData.loading?(e.openBlock(),e.createElementBlock("div",xt,[e.createVNode(p,{size:30})])):e.createCommentVNode("v-if",!0)],2),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",jt,[(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,Rt)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),t.emoji.tabs.length>1?(e.openBlock(),e.createElementBlock("div",zt,[(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,Ut)],10,At)))),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[15]||(n[15]=e=>t.$emit("cancel-reply"))},[e.createVNode(i,{size:24})],8,Mt)):e.createCommentVNode("v-if",!0)])}],["__file","CommentBox.vue"]]);const Pt=["approved","waiting","spam"];var Tt=e.defineComponent({components:{CommentBox:Dt,DeleteIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),LikeIcon:({active:t=!1})=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[e.h("path",{d:"M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z"+(t?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"),fill:t?"red":"currentColor"})]),ReplyIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),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"}))},props:{comment:{type:Object,required:!0},rootId:{type:String,required:!0},reply:{type:Object,default:null}},emits:["submit","reply","like","delete","status","sticky"],setup(t){const n=e.inject("config"),o=Ge(),l=We(),a=e.computed((()=>n.value.locale)),r=e.computed((()=>{const{link:e}=t.comment;return e?ke(e)?e:`https://${e}`:""})),i=e.computed((()=>o.value.includes(t.comment.objectId))),c=((t,n)=>{const o=me();return e.computed((()=>Ie(t,o.value,n)))})(t.comment.insertedAt,a.value),s=e.computed((()=>"administrator"===l.value.type)),m=e.computed((()=>t.comment.user_id&&l.value.objectId===t.comment.user_id)),u=e.computed((()=>t.comment.objectId===t.reply?.objectId));return{config:n,locale:a,isReplyingCurrent:u,link:r,like:i,time:c,isAdmin:s,isOwner:m,commentStatus:Pt}}});const Ft=["id"],Ht={class:"wl-user","aria-hidden":"true"},_t=["src"],Wt={class:"wl-card"},qt={class:"wl-head"},Gt=["href"],Jt={key:1,class:"wl-nick"},Kt=["textContent"],Qt=["textContent"],Yt=["textContent"],Zt=["textContent"],Xt=["textContent"],en={class:"wl-comment-actions"},tn=["title"],nn=["textContent"],on=["title"],ln={class:"wl-meta","aria-hidden":"true"},an=["textContent"],rn=["textContent"],cn=["textContent"],sn=["innerHTML"],mn={key:0,class:"wl-admin-actions"},un={class:"wl-comment-status"},dn=["disabled","onClick","textContent"],pn={key:1,class:"wl-reply-wrapper"},vn={key:2,class:"wl-quote"};var gn=Ye(Tt,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("VerifiedIcon"),c=e.resolveComponent("DeleteIcon"),s=e.resolveComponent("LikeIcon"),m=e.resolveComponent("ReplyIcon"),u=e.resolveComponent("CommentBox"),d=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{id:t.comment.objectId,class:"wl-item"},[e.createElementVNode("div",Ht,[t.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.comment.avatar},null,8,_t)):e.createCommentVNode("v-if",!0),t.comment.type?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",Wt,[e.createElementVNode("div",qt,[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,Gt)):(e.openBlock(),e.createElementBlock("span",Jt,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,Kt)):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,Qt)):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,Yt)):e.createCommentVNode("v-if",!0),void 0!==t.comment.level&&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,Zt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(t.time)},null,8,Xt),e.createElementVNode("div",en,[t.isAdmin||t.isOwner?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-delete",onClick:n[0]||(n[0]=e=>t.$emit("delete",t.comment))},[e.createVNode(c)])):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:"wl-like",title:t.like?t.locale.cancelLike:t.locale.like,onClick:n[1]||(n[1]=e=>t.$emit("like",t.comment))},[e.createVNode(s,{active:t.like},null,8,["active"]),"like"in t.comment?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.like)},null,8,nn)):e.createCommentVNode("v-if",!0)],8,tn),e.createElementVNode("button",{class:e.normalizeClass(["wl-reply",{active:t.isReplyingCurrent}]),title:t.isReplyingCurrent?t.locale.cancelReply:t.locale.reply,onClick:n[2]||(n[2]=e=>t.$emit("reply",t.isReplyingCurrent?null:t.comment))},[e.createVNode(m)],10,on)])]),e.createElementVNode("div",ln,[t.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.comment.addr)},null,8,an)):e.createCommentVNode("v-if",!0),t.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,textContent:e.toDisplayString(t.comment.browser)},null,8,rn)):e.createCommentVNode("v-if",!0),t.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,textContent:e.toDisplayString(t.comment.os)},null,8,cn)):e.createCommentVNode("v-if",!0)]),e.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),e.createElementVNode("div",{class:"wl-content",innerHTML:t.comment.comment},null,8,sn),t.isAdmin?(e.openBlock(),e.createElementBlock("div",mn,[e.createElementVNode("span",un,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.commentStatus,(n=>(e.openBlock(),e.createElementBlock("button",{key:n,class:e.normalizeClass(`wl-btn wl-${n}`),disabled:t.comment.status===n,onClick:e=>t.$emit("status",{status:n,comment:t.comment}),textContent:e.toDisplayString(t.locale[n])},null,10,dn)))),128))]),t.isAdmin&&!t.comment.rid?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn wl-sticky",onClick:n[3]||(n[3]=e=>t.$emit("sticky",t.comment))},e.toDisplayString(t.comment.sticky?t.locale.unsticky:t.locale.sticky),1)):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0),t.isReplyingCurrent?(e.openBlock(),e.createElementBlock("div",pn,[e.createVNode(u,{"reply-id":t.comment.objectId,"reply-user":t.comment.nick,"root-id":t.rootId,onSubmit:n[4]||(n[4]=e=>t.$emit("submit",e)),onCancelReply:n[5]||(n[5]=e=>t.$emit("reply",null))},null,8,["reply-id","reply-user","root-id"])])):e.createCommentVNode("v-if",!0),t.comment.children?(e.openBlock(),e.createElementBlock("div",vn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment.children,(o=>(e.openBlock(),e.createBlock(d,{key:o.objectId,comment:o,reply:t.reply,"root-id":t.rootId,onReply:n[6]||(n[6]=e=>t.$emit("reply",e)),onSubmit:n[7]||(n[7]=e=>t.$emit("submit",e)),onLike:n[8]||(n[8]=e=>t.$emit("like",e)),onDelete:n[9]||(n[9]=e=>t.$emit("delete",e)),onStatus:n[10]||(n[10]=e=>t.$emit("status",e)),onSticky:n[11]||(n[11]=e=>t.$emit("sticky",e))},null,8,["comment","reply","root-id"])))),128))])):e.createCommentVNode("v-if",!0)])],8,Ft)}],["__file","CommentCard.vue"]]);const fn=[{key:"insertedAt_desc",name:"latest"},{key:"insertedAt_asc",name:"oldest"},{key:"like_desc",name:"hottest"}];var hn=e.defineComponent({name:"WalineRoot",components:{CommentBox:Dt,CommentCard:gn,LoadingIcon:Ke},props:["serverURL","path","meta","requiredMeta","dark","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","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.1.0/weibo"],meta:a=["nick","mail","link"],requiredMeta:m=[],dark:u=!1,pageSize:d=10,wordLimit:v,imageUploader:g,highlighter:f,texRenderer:h,copyright:y=!0,login:w="enable",search:k=s(),...b})=>({serverURL:be(e),path:ye(t),locale:{...C[n]||C["zh-CN"],..."object"==typeof o?o:{}},wordLimit:Ce(v),meta:r(a),requiredMeta:r(m),imageUploader:Ee(g,i),highlighter:Ee(f,p),texRenderer:Ee(h,c),lang:n,dark:u,emoji:l,pageSize:d,login:w,copyright:y,search:k,...b}))(t))),o=We(),l=Ge(),a=e.ref("loading"),m=e.ref(0),u=e.ref(1),d=e.ref(0),v=e.ref(fn[0].key),g=e.ref([]),f=e.ref(null),h=e.computed((()=>{return"string"==typeof(e=n.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${Be}}`:`${e}${Be}`:!0===e?`:root${Be}`:"";var e}));let y;de(h);const w=e=>{const{serverURL:t,path:l,pageSize:r}=n.value,i=new AbortController;a.value="loading",y?.(),(({serverURL:e,lang:t,path:n,page:o,pageSize:l,sortBy:a,signal:r,token:i})=>{const c={};return i&&(c.Authorization=`Bearer ${i}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${l}&page=${o}&lang=${t}&sortBy=${a}`,{signal:r,headers:c}).then((e=>e.json())).then((e=>xe(e,"comment list")))})({serverURL:t,lang:n.value.lang,path:l,pageSize:r,sortBy:v.value,page:e,signal:i.signal,token:o.value?.token}).then((t=>{a.value="success",m.value=t.count,g.value.push(...t.data),u.value=e,d.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),a.value="error")})),y=i.abort.bind(i)},k=()=>{m.value=0,g.value=[],w(1)};return e.provide("config",n),e.watch((()=>t.path),k),e.onMounted((()=>k())),{config:n,darkmodeStyle:h,i18n:e.computed((()=>n.value.locale)),status:a,count:m,page:u,totalPages:d,sortBy:v,sortByItems:fn,data:g,reply:f,loadMore:()=>w(u.value+1),refresh:k,onSortByChange:e=>{v.value!==e&&(v.value=e,k())},onReply:e=>{f.value=e},onSubmit:e=>{if(e.rid){const t=g.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else g.value.unshift(e)},onStatusChange:async({comment:e,status:t})=>{if(e.status===t)return;const{serverURL:l,lang:a}=n.value;await je({serverURL:l,lang:a,token:o.value?.token,objectId:e.objectId,status:t}),e.status=t},onDelete:async({objectId:e})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:t,lang:l}=n.value;await(({serverURL:e,lang:t,token:n,objectId:o})=>fetch(`${e}/comment/${o}?lang=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${n}`}}).then((e=>e.json())))({serverURL:t,lang:l,token:o.value?.token,objectId:e}),g.value.some(((t,n)=>t.objectId===e?(g.value=g.value.filter(((e,t)=>t!==n)),!0):t.children.some(((o,l)=>o.objectId===e&&(g.value[n].children=t.children.filter(((e,t)=>t!==l)),!0)))))},onSticky:async e=>{if(e.rid)return;const{serverURL:t,lang:l}=n.value;await je({serverURL:t,lang:l,token:o.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},onLike:async e=>{const{serverURL:t,lang:o}=n.value,{objectId:a}=e,r=l.value.includes(a);await(({serverURL:e,lang:t,objectId:n,like:o})=>fetch(`${e}/comment/${n}?lang=${t}`,{method:"PUT",headers:Le,body:JSON.stringify({like:o})}).then((e=>e.json())))({serverURL:t,lang:o,objectId:a,like:!r}),r?l.value=l.value.filter((e=>e!==a)):(l.value=[...l.value,a],l.value.length>50&&(l.value=l.value.slice(-50))),e.like=(e.like||0)+(r?-1:1)},version:"2.7.0"}}});const yn={"data-waline":""},wn={class:"wl-head"},kn={class:"wl-count"},bn=["textContent"],Cn={class:"wl-sort"},En=["onClick"],Bn={class:"wl-cards"},Nn={key:1,class:"wl-operation"},In=["textContent"],Sn={key:0,class:"wl-loading"},$n=["textContent"],Vn={class:"wl-operation"},Ln=["textContent"],xn={key:3,class:"wl-power"},jn=e.createTextVNode(" Powered by "),Rn=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);var On=Ye(hn,[["render",function(t,n,o,l,a,r){const i=e.resolveComponent("CommentBox"),c=e.resolveComponent("CommentCard"),s=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",yn,[t.reply?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(i,{key:0,onSubmit:t.onSubmit},null,8,["onSubmit"])),e.createElementVNode("div",wn,[e.createElementVNode("div",kn,[t.count?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(t.count)},null,8,bn)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.i18n.comment),1)]),e.createElementVNode("ul",Cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.sortByItems,(n=>(e.openBlock(),e.createElementBlock("li",{key:n.key,class:e.normalizeClass([n.key===t.sortBy?"active":""]),onClick:e=>t.onSortByChange(n.key)},e.toDisplayString(t.i18n[n.name]),11,En)))),128))])]),e.createElementVNode("div",Bn,[(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,onStatus:t.onStatusChange,onDelete:t.onDelete,onSticky:t.onSticky,onLike:t.onLike},null,8,["root-id","comment","reply","onReply","onSubmit","onStatus","onDelete","onSticky","onLike"])))),128))]),"error"===t.status?(e.openBlock(),e.createElementBlock("div",Nn,[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,In)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===t.status?(e.openBlock(),e.createElementBlock("div",Sn,[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",Vn,[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,Ln)])],2112)):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(t.i18n.sofa)},null,8,$n))],64)),e.createCommentVNode(" Copyright Information "),t.config.copyright?(e.openBlock(),e.createElementBlock("div",xn,[jn,Rn,e.createTextVNode(" v"+e.toDisplayString(t.version),1)])):e.createCommentVNode("v-if",!0)])}],["__file","Waline.vue"]]);const zn=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},An=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:o=!0,lang:l="zh-CN"})=>{const a=new AbortController,r=Array.from(document.querySelectorAll(n)),i=e=>{const n=He(e);return null!==n&&t!==n},c=n=>Re({serverURL:be(e),paths:n.map((e=>He(e)||t)),lang:l,signal:a.signal}).then((e=>zn(e,n))).catch(Ve);if(o){const n=r.filter((e=>!i(e))),o=r.filter(i);Oe({serverURL:be(e),path:t,lang:l}).then((e=>zn(new Array(n.length).fill(e),n))),o.length&&c(o)}else c(r);return a.abort.bind(a)};exports.RecentComments=({el:e,serverURL:t,count:n,lang:o="zh-CN"})=>{const l=We(),a=ze(e),r=new AbortController;return(({serverURL:e,lang:t,count:n,signal:o,token:l})=>{const a={};return l&&(a.Authorization=`Bearer ${l}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:o,headers:a}).then((e=>e.json())).then((e=>xe(e,"recent comment")))})({serverURL:t,count:n,lang:o,signal:r.signal,token:l.value?.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:()=>{r.abort(),a.innerHTML=""}}):{comments:e,destroy:()=>r.abort()}))},exports.commentCount=Je,exports.defaultLocales=C,exports.init=({el:t="#waline",path:n=window.location.pathname,comment:o=!1,pageview:l=!1,...a})=>{const r=t?ze(t):null;if(t&&!r)throw new Error("Option 'el' do not match any domElement!");if(!a.serverURL)throw new Error("Option 'serverURL' is missing!");const i=e.reactive({...a}),c=e.reactive({comment:o,pageview:l,path:n}),s=r?e.createApp((()=>e.h(On,{path:c.path,...i}))):null;s&&s.mount(r);const m=e.watchEffect((()=>{c.comment&&Je({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.comment?c.comment:void 0})})),u=e.watchEffect((()=>{c.pageview&&An({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.pageview?c.pageview:void 0})}));return{el:r,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:()=>{s?.unmount(),m(),u()}}},exports.pageviewCount=An,exports.version="2.7.0";
//# sourceMappingURL=shim.js.map

@@ -189,2 +189,5 @@ interface WalineEmojiInfo {

unsticky: string;
oldest: string;
latest: string;
hottest: string;
}

@@ -191,0 +194,0 @@

@@ -189,2 +189,5 @@ interface WalineEmojiInfo {

unsticky: string;
oldest: string;
latest: string;
hottest: string;
}

@@ -191,0 +194,0 @@

@@ -189,2 +189,5 @@ interface WalineEmojiInfo {

unsticky: string;
oldest: string;
latest: string;
hottest: string;
}

@@ -191,0 +194,0 @@

{
"name": "@waline/client",
"version": "2.6.4",
"version": "2.7.0",
"description": "client for waline comment system",

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

@@ -49,2 +49,5 @@ import { generateLocale } from './generate';

'Unsticky',
'Oldest',
'Latest',
'Hottest',
]);

@@ -49,2 +49,5 @@ import type { WalineLocale } from '../../typings';

'unsticky',
'oldest',
'latest',
'hottest',
];

@@ -51,0 +54,0 @@

@@ -49,2 +49,5 @@ import { generateLocale } from './generate';

'べたつかない',
'逆順',
'正順',
'人気順',
]);

@@ -49,2 +49,5 @@ import { generateLocale } from './generate';

'Unsticky',
'Mais velho',
'Mais recentes',
'Mais quente',
]);

@@ -49,2 +49,5 @@ import { generateLocale } from './generate';

'Нелипкий',
'самый старый',
'последний',
'самый горячий',
]);

@@ -49,2 +49,5 @@ import { generateLocale } from './generate';

'Không dính',
'lâu đời nhất',
'muộn nhất',
'nóng nhất',
]);

@@ -49,2 +49,5 @@ import { generateLocale } from './generate';

'取消置顶',
'按倒序',
'按正序',
'按热度',
]);

@@ -49,2 +49,5 @@ import { generateLocale } from './generate';

'取消置頂',
'按倒序',
'按正序',
'按熱度',
]);

@@ -46,2 +46,5 @@ export interface WalineDateLocale {

unsticky: string;
oldest: string;
latest: string;
hottest: string;
}

@@ -88,2 +88,3 @@ import type { WalineComment, WalineCommentData } from '../typings';

pageSize: number;
sortBy: string;
signal: AbortSignal;

@@ -106,2 +107,3 @@ token?: string;

pageSize,
sortBy,
signal,

@@ -117,3 +119,3 @@ token,

path
)}&pageSize=${pageSize}&page=${page}&lang=${lang}`,
)}&pageSize=${pageSize}&page=${page}&lang=${lang}&sortBy=${sortBy}`,
{ signal, headers }

@@ -120,0 +122,0 @@ )

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 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 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 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