@waline/client 2.14.0 → 2.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comment.cjs +1 -1
- package/dist/comment.cjs.map +1 -1
- package/dist/comment.js +1 -68
- package/dist/comment.js.map +1 -1
- package/dist/comment.mjs +1 -1
- package/dist/comment.mjs.map +1 -1
- package/dist/component.mjs +1 -1
- package/dist/component.mjs.map +1 -1
- package/dist/legacy.umd.d.ts +14 -5
- package/dist/legacy.umd.js +1 -1
- package/dist/legacy.umd.js.map +1 -1
- package/dist/pageview.cjs +1 -1
- package/dist/pageview.cjs.map +1 -1
- package/dist/pageview.js +1 -121
- package/dist/pageview.js.map +1 -1
- package/dist/pageview.mjs +1 -1
- package/dist/pageview.mjs.map +1 -1
- package/dist/shim.cjs +1 -1
- package/dist/shim.cjs.map +1 -1
- package/dist/shim.d.cts +15 -6
- package/dist/shim.d.mts +15 -6
- package/dist/shim.mjs +1 -1
- package/dist/shim.mjs.map +1 -1
- package/dist/waline.cjs +1 -1
- package/dist/waline.cjs.map +1 -1
- package/dist/waline.css +1 -1
- package/dist/waline.css.map +1 -1
- package/dist/waline.d.cts +15 -6
- package/dist/waline.d.mts +15 -6
- package/dist/waline.d.ts +15 -6
- package/dist/waline.js +1 -6787
- package/dist/waline.js.map +1 -1
- package/dist/waline.mjs +1 -1
- package/dist/waline.mjs.map +1 -1
- package/package.json +18 -18
- package/src/comment.ts +1 -2
- package/src/components/ArticleReaction.vue +120 -117
- package/src/components/CommentBox.vue +451 -488
- package/src/components/CommentCard.vue +109 -98
- package/src/components/ImageWall.vue +132 -131
- package/src/components/WalineComment.vue +683 -0
- package/src/composables/index.ts +1 -2
- package/src/composables/reaction.ts +16 -0
- package/src/composables/recaptchaV3.ts +4 -6
- package/src/config/default.ts +5 -0
- package/src/{entrys → entries}/api.ts +0 -0
- package/src/{entrys → entries}/comment.ts +0 -0
- package/src/entries/components.ts +2 -0
- package/src/{entrys → entries}/full.ts +0 -0
- package/src/{entrys → entries}/init.ts +0 -0
- package/src/{entrys → entries}/legacy.ts +0 -0
- package/src/{entrys → entries}/pageview.ts +0 -0
- package/src/init.ts +1 -1
- package/src/styles/reaction.scss +27 -16
- package/src/typings/base.ts +5 -0
- package/src/typings/waline.ts +14 -5
- package/src/utils/config.ts +27 -5
- package/src/utils/image.ts +1 -1
- package/src/components/Waline.vue +0 -509
- package/src/composables/timeAgo.ts +0 -15
- package/src/composables/vote.ts +0 -20
- package/src/entrys/components.ts +0 -2
package/dist/shim.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),t=require("@vueuse/core"),n=require("autosize"),o=require("marked");const a=["nick","mail","link"],l=e=>e.filter((e=>a.includes(e))),r=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})),i=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>',c=e=>{const t=async(t,n={})=>fetch(`https://api.giphy.com/v1/gifs/${t}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...n}).toString()}`).then((e=>e.json())).then((({data:e})=>e.map((e=>({title:e.title,src:e.images.downsized_medium.url})))));return{search:e=>t("search",{q:e,offset:"0"}),default:()=>t("trending",{}),more:(e,n=0)=>t("search",{q:e,offset:n.toString()})}},s=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],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"<";let a;d[n]?a=d[n]:(a=u[t],d[n]=a);const l=`<span style="color: #${a}">${n}</span>`;return t=++t%u.length,l}))},g=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],v=e=>Object.fromEntries(e.map(((e,t)=>[g[t],e])));var h=v(["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","What do you think?"]),f=v(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順","どう思いますか?"]),y=v(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),k=v(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂","按倒序","按正序","按熱度","你認為這篇文章怎麼樣?"]),w=v(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","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","O que você acha?"]),C=v(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]);const b={zh:y,"zh-cn":y,"zh-CN":y,"zh-tw":k,"zh-TW":k,en:h,"en-US":h,"en-us":h,jp:f,"jp-jp":f,"jp-JP":f,"pt-br":w,"pt-BR":w,ru:C,"ru-ru":C,"ru-RU":C},E={"Content-Type":"application/json"},L=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},B=({serverURL:e,lang:t,paths:n,type:o,signal:a})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&type=${encodeURIComponent(o.join(","))}&lang=${t}`,{signal:a}).then((e=>e.json())),S=({serverURL:e,lang:t,path:n,type:o,action:a})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:E,body:JSON.stringify({path:n,type:o,action:a})}).then((e=>e.json())),$=({serverURL:e,lang:t,token:n,objectId:o,...a})=>fetch(`${e}/comment/${o}?lang=${t}`,{method:"PUT",headers:{...E,Authorization:`Bearer ${n}`},body:JSON.stringify(a)}).then((e=>e.json())).then((e=>L(e,"Update comment"))),V=e=>{try{e=decodeURI(e)}catch(e){}return e},N=(e="")=>e.replace(/\/$/u,""),I=e=>/^(https?:)?\/\//.test(e),R=e=>{const t=N(e);return I(t)?t:`https://${t}`},x=e=>Array.isArray(e)?e:!!e&&[0,e],j=(e,t)=>"function"==typeof e?e:!1!==e&&t,A="{--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}",z=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},U=(e,t,n)=>{if(!e)return"";const o="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,a=t.getTime()-o.getTime(),l=Math.floor(a/864e5);if(0===l){const e=a%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 l<0?n.now:l<8?`${l} ${n.days}`:(e=>{const t=z(e.getDate(),2),n=z(e.getMonth()+1,2);return`${z(e.getFullYear(),2)}-${n}-${t}`})(o)},D=e=>{const n=t.useStorage("WALINE_EMOJI",{}),o=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(o){const t=n.value[e];if(t)return Promise.resolve(t)}return fetch(`${e}/info.json`).then((e=>e.json())).then((t=>{const a={folder:e,...t};return o&&(n.value[e]=a),a}))},M=(e,t="",n="",o="")=>`${t?`${t}/`:""}${n}${e}${o?`.${o}`:""}`,T=e=>{"AbortError"!==e.name&&console.error(e.message)},P=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,_=e=>e.type.includes("image"),O=e=>{const t=Array.from(e).find(_);return t?t.getAsFile():null},H=/\$.*?\$/,F=/^\$(.*?)\$/,W=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,G=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),q=(e,{emojiMap:t,highlighter:n,texRenderer:a})=>{if(o.marked.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),a){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=W.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(H);return-1!==t?t:e.length},tokenizer(t){const n=F.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(a);o.marked.use({extensions:e})}return o.marked.parse(G(e,t))},K=e=>e.dataset.path||e.getAttribute("id"),Z=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:o="zh-CN"})=>{const a=new AbortController,l=document.querySelectorAll(n);return l.length&&(({serverURL:e,lang:t,paths:n,signal:o})=>fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:o}).then((e=>e.json())).then((e=>Array.isArray(e)?e:[e])))({serverURL:R(e),paths:Array.from(l).map((e=>V(e.dataset.path||e.getAttribute("id")||t))),lang:o,signal:a.signal}).then((e=>{l.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(T),a.abort.bind(a)};let J=null;const Y=()=>J||(J=t.useStorage("WALINE_LIKE",[]));var X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Q={},ee={},te={},ne=X&&X.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(a,l){function r(e){try{c(o.next(e))}catch(e){l(e)}}function i(e){try{c(o.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,i)}c((o=o.apply(e,t||[])).next())}))},oe=X&&X.__generator||function(e,t){var n,o,a,l,r={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function i(l){return function(i){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=2&l[0]?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(!(a=r.trys,(a=a.length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){r=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(6===l[0]&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(e){l=[6,e],o=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,i])}}};Object.defineProperty(te,"__esModule",{value:!0}),te.ReCaptchaInstance=void 0;var ae=function(){function e(e,t,n){this.siteKey=e,this.recaptchaID=t,this.recaptcha=n,this.styleContainer=null}return e.prototype.execute=function(e){return ne(this,void 0,void 0,(function(){return oe(this,(function(t){return[2,this.recaptcha.enterprise?this.recaptcha.enterprise.execute(this.recaptchaID,{action:e}):this.recaptcha.execute(this.recaptchaID,{action:e})]}))}))},e.prototype.getSiteKey=function(){return this.siteKey},e.prototype.hideBadge=function(){null===this.styleContainer&&(this.styleContainer=document.createElement("style"),this.styleContainer.innerHTML=".grecaptcha-badge{visibility:hidden !important;}",document.head.appendChild(this.styleContainer))},e.prototype.showBadge=function(){null!==this.styleContainer&&(document.head.removeChild(this.styleContainer),this.styleContainer=null)},e}();te.ReCaptchaInstance=ae,Object.defineProperty(ee,"__esModule",{value:!0}),ee.getInstance=ee.load=void 0;var le,re=te;!function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(le||(le={}));var ie=function(){function e(){}return e.load=function(t,n){if(void 0===n&&(n={}),"undefined"==typeof document)return Promise.reject(new Error("This is a library for the browser!"));if(e.getLoadingState()===le.LOADED)return e.instance.getSiteKey()===t?Promise.resolve(e.instance):Promise.reject(new Error("reCAPTCHA already loaded with different site key!"));if(e.getLoadingState()===le.LOADING)return t!==e.instanceSiteKey?Promise.reject(new Error("reCAPTCHA already loaded with different site key!")):new Promise((function(t,n){e.successfulLoadingConsumers.push((function(e){return t(e)})),e.errorLoadingRunnable.push((function(e){return n(e)}))}));e.instanceSiteKey=t,e.setLoadingState(le.LOADING);var o=new e;return new Promise((function(a,l){o.loadScript(t,n.useRecaptchaNet||!1,n.useEnterprise||!1,n.renderParameters?n.renderParameters:{},n.customUrl).then((function(){e.setLoadingState(le.LOADED);var l=o.doExplicitRender(grecaptcha,t,n.explicitRenderParameters?n.explicitRenderParameters:{},n.useEnterprise||!1),r=new re.ReCaptchaInstance(t,l,grecaptcha);e.successfulLoadingConsumers.forEach((function(e){return e(r)})),e.successfulLoadingConsumers=[],n.autoHideBadge&&r.hideBadge(),e.instance=r,a(r)})).catch((function(t){e.errorLoadingRunnable.forEach((function(e){return e(t)})),e.errorLoadingRunnable=[],l(t)}))}))},e.getInstance=function(){return e.instance},e.setLoadingState=function(t){e.loadingState=t},e.getLoadingState=function(){return null===e.loadingState?le.NOT_LOADED:e.loadingState},e.prototype.loadScript=function(t,n,o,a,l){var r=this;void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===a&&(a={}),void 0===l&&(l="");var i=document.createElement("script");i.setAttribute("recaptcha-v3-script","");var c="https://www.google.com/recaptcha/api.js";n&&(c=o?"https://recaptcha.net/recaptcha/enterprise.js":"https://recaptcha.net/recaptcha/api.js"),o&&(c="https://www.google.com/recaptcha/enterprise.js"),l&&(c=l),a.render&&(a.render=void 0);var s=this.buildQueryString(a);return i.src=c+"?render=explicit"+s,new Promise((function(t,n){i.addEventListener("load",r.waitForScriptToLoad((function(){t(i)}),o),!1),i.onerror=function(t){e.setLoadingState(le.NOT_LOADED),n(t)},document.head.appendChild(i)}))},e.prototype.buildQueryString=function(e){return Object.keys(e).length<1?"":"&"+Object.keys(e).filter((function(t){return!!e[t]})).map((function(t){return t+"="+e[t]})).join("&")},e.prototype.waitForScriptToLoad=function(t,n){var o=this;return function(){void 0===window.grecaptcha?setTimeout((function(){o.waitForScriptToLoad(t,n)}),e.SCRIPT_LOAD_DELAY):n?window.grecaptcha.enterprise.ready((function(){t()})):window.grecaptcha.ready((function(){t()}))}},e.prototype.doExplicitRender=function(e,t,n,o){var a={sitekey:t,badge:n.badge,size:n.size,tabindex:n.tabindex};return n.container?o?e.enterprise.render(n.container,a):e.render(n.container,a):o?e.enterprise.render(a):e.render(a)},e.loadingState=null,e.instance=null,e.instanceSiteKey=null,e.successfulLoadingConsumers=[],e.errorLoadingRunnable=[],e.SCRIPT_LOAD_DELAY=25,e}();ee.load=ie.load,ee.getInstance=ie.getInstance,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReCaptchaInstance=e.getInstance=e.load=void 0;var t=ee;Object.defineProperty(e,"load",{enumerable:!0,get:function(){return t.load}}),Object.defineProperty(e,"getInstance",{enumerable:!0,get:function(){return t.getInstance}});var n=te;Object.defineProperty(e,"ReCaptchaInstance",{enumerable:!0,get:function(){return n.ReCaptchaInstance}})}(Q);const ce={};let se=null;const me=()=>se??(se=t.useStorage("WALINE_VOTE",[]));let ue=null;const de=()=>ue??(ue=t.useStorage("WALINE_USER",{}));var pe=e.defineComponent({setup(){const t=e.ref([]),n=me(),o=e.inject("config"),a=e.computed((()=>o.value.locale)),l=e.computed((()=>{const{reaction:e,path:l}=o.value;return e.map(((e,o)=>({icon:e,vote:t.value[o]||0,desc:a.value[`reaction${o}`],active:Boolean(n.value.find((({id:e,i:t})=>e===l&&t===o)))})))}));let r;return e.onMounted((()=>{e.watch((()=>[o.value.serverURL,o.value.path]),(()=>{(()=>{const{serverURL:e,lang:n,path:a,reaction:l}=o.value;if(l.length){const o=new AbortController;B({serverURL:e,lang:n,paths:[a],type:l.map(((e,t)=>`reaction${t}`)),signal:o.signal}).then((e=>{Array.isArray(e)||"number"==typeof e||(t.value=l.map(((t,n)=>e[`reaction${n}`])))})),r=o.abort.bind(o)}})()}),{immediate:!0})})),e.onUnmounted((()=>r?.())),{reaction:l,locale:a,vote:async e=>{const{serverURL:a,lang:l,path:r}=o.value,i=n.value.find((({id:e})=>e===r));i&&i.i===e||(await S({serverURL:a,lang:l,path:r,type:`reaction${e}`}),t.value[e]=(t.value[e]||0)+1,i?(t.value[i.i]=Math.max(t.value[i.i]-1,0),S({serverURL:a,lang:l,path:r,type:`reaction${i.i}`,action:"desc"}),i.i=e,n.value=Array.from(n.value)):n.value=[...n.value,{id:r,i:e}],n.value.length>50&&(n.value=n.value.slice(-50)))}}}}),ge=(e,t)=>{const n=e.__vccOpts||e;for(const[e,o]of t)n[e]=o;return n};const ve={key:0,class:"wl-reaction"},he=["textContent"],fe=["onClick"],ye={class:"wl-reaction-img"},ke=["src","alt"],we={class:"wl-reaction-votes"},Ce={class:"wl-reaction-text"};var be=ge(pe,[["render",function(t,n,o,a,l,r){return t.reaction.length?(e.openBlock(),e.createElementBlock("div",ve,[e.createElementVNode("h4",{textContent:e.toDisplayString(t.locale.reactionTitle)},null,8,he),e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.reaction,((n,o)=>(e.openBlock(),e.createElementBlock("li",{key:o,class:e.normalizeClass({active:n.active}),onClick:e=>t.vote(o)},[e.createElementVNode("div",ye,[e.createElementVNode("img",{src:n.icon,alt:n.desc},null,8,ke),e.createElementVNode("div",we,e.toDisplayString(n.vote),1)]),e.createElementVNode("div",Ce,e.toDisplayString(n.desc),1)],10,fe)))),128))])])):e.createCommentVNode("v-if",!0)}],["__file","ArticleReaction.vue"]]);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 Le=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),a=e.ref({}),l=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 a=Array.from(o.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));l.value[Number(a.dataset.index)].push(n),await i(n+1)},c=async(e=!1)=>{if(l.value.length===r()&&!e)return;var t;l.value=(t=r(),new Array(t).fill(null).map((()=>[])));const n=window.scrollY;await i(0),window.scrollTo({top:n})};return e.onMounted((()=>{c(!0),n=new ResizeObserver((()=>c())),n.observe(o.value),e.watch((()=>[t.items]),(()=>{a.value={},c(!0)})),e.watch((()=>[t.columnWidth,t.gap]),(()=>c()))})),e.onBeforeUnmount((()=>n.unobserve(o.value))),{columns:l,state:a,wall:o,imageLoad:e=>{a.value[e.target.src]=!0}}}});const Be=["data-index"],Se=["src","title","onClick"];var $e=ge(Le,[["render",function(t,n,o,a,l,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,((o,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"wl-gallery-column","data-index":a,style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(o=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o},[t.state[t.items[o].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[o].src,title:t.items[o].title,loading:"lazy",onLoad:n[0]||(n[0]=(...e)=>t.imageLoad&&t.imageLoad(...e)),onClick:e=>t.$emit("insert",``)},null,40,Se)],64)))),128))],12,Be)))),128))],4)}],["__file","ImageWall.vue"]]),Ve=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:$e,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:""},edit:{type:Object,default:null}},emits:["submit","cancel-reply","cancel-edit"],setup(o,{emit:a}){const l=e.inject("config"),r=t.useStorage("WALINE_COMMENT_BOX_EDITOR",""),i=t.useStorage("WALINE_USER_META",{nick:"",mail:"",link:""}),c=de(),s=e.ref({}),m=e.ref(null),u=e.ref(null),d=e.ref(null),p=e.ref(null),g=e.ref(null),v=e.ref(null),h=e.ref(null),f=e.ref({tabs:[],map:{}}),y=e.ref(0),k=e.ref(!1),w=e.ref(!1),C=e.ref(!1),b=e.ref(""),E=e.ref(0),L=e.reactive({loading:!0,list:[]}),B=e.ref(0),S=e.ref(!1),V=e.ref(""),I=e.ref(!1),R=e.computed((()=>l.value.locale)),x=e.computed((()=>Boolean(c.value?.token))),j=e.computed((()=>!1!==l.value.imageUploader)),A=e=>{const t=m.value,n=t.selectionStart,o=t.selectionEnd||0,a=t.scrollTop;r.value=t.value.substring(0,n)+e+t.value.substring(o,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=a},z=e=>{const t=`![${l.value.locale.uploading} ${e.name}]()`;return A(t),Promise.resolve().then((()=>l.value.imageUploader(e))).then((n=>{r.value=r.value.replace(t,`\r\n`)})).catch((e=>{alert(e.message),r.value=r.value.replace(t,"")}))},U=async()=>{const{serverURL:e,lang:t,login:n,wordLimit:u,requiredMeta:d}=l.value;let p="";l.value.recaptchaV3Key&&(p=await(e=>{const t=ce[e]??(ce[e]=Q.load(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:e=>t.then((t=>t.execute(e)))}})(l.value.recaptchaV3Key).execute("social"));const g={comment:V.value,nick:i.value.nick,mail:i.value.mail,link:i.value.link,ua:navigator.userAgent,url:l.value.path,recaptchaV3:p};if(c.value?.token)g.nick=c.value.display_name,g.mail=c.value.email,g.link=c.value.url;else{if("force"===n)return;if(d.indexOf("nick")>-1&&!g.nick)return s.value.nick?.focus(),alert(R.value.nickError);if(d.indexOf("mail")>-1&&!g.mail||g.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(g.mail))return s.value.mail?.focus(),alert(R.value.mailError);if(!g.comment)return void m.value?.focus();g.nick||(g.nick=R.value.anonymous)}if(!S.value)return alert(R.value.wordHint.replace("$0",u[0].toString()).replace("$1",u[1].toString()).replace("$2",E.value.toString()));g.comment=G(g.comment,f.value.map),o.replyId&&o.rootId&&(g.pid=o.replyId,g.rid=o.rootId,g.at=o.replyUser),I.value=!0;const v={serverURL:e,lang:t,token:c.value?.token,comment:g};(o.edit?$({objectId:o.edit.objectId,...v}):(({serverURL:e,lang:t,token:n,comment:o})=>{const a={"Content-Type":"application/json"};return n&&(a.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:a,body:JSON.stringify(o)}).then((e=>e.json()))})(v)).then((e=>{if(I.value=!1,e.errmsg)return alert(e.errmsg);a("submit",e.data),r.value="",b.value="",o.replyId&&a("cancel-reply"),o.edit?.objectId&&a("cancel-edit")})).catch((e=>{I.value=!1,alert(e.message)}))},T=e=>{d.value.contains(e.target)||p.value.contains(e.target)||(k.value=!1),g.value.contains(e.target)||v.value.contains(e.target)||(w.value=!1)},P=async e=>{const{scrollTop:t,clientHeight:n,scrollHeight:o}=e.target,a=(n+t)/o,r=l.value.search,i=h.value?.value||"";a<.9||L.loading||(L.loading=!0,L.list=[...L.list,...r.more&&L.list.length?await r.more(i,L.list.length):await r.search(i)],L.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},_=t.useDebounceFn((e=>{L.list=[],P(e)}),300);e.watch([l,E],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(B.value=n[0],S.value=!1):t>n[1]?(B.value=n[1],S.value=!1):(B.value=n[1],S.value=!0):(B.value=0,S.value=!0)}),{immediate:!0});const H=({data:e})=>{e&&"profile"===e.type&&(c.value={...c.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(c)))))};return e.onMounted((()=>{document.body.addEventListener("click",T),window.addEventListener("message",H),o.edit?.objectId&&(r.value=o.edit.orig),e.watch(w,(async e=>{if(!e)return;const t=l.value.search;h.value&&(h.value.value=""),L.loading=!0,L.list=t.default?await t.default():await t.search(""),L.loading=!1})),e.watch((()=>r.value),(e=>{const{highlighter:t,texRenderer:o}=l.value;V.value=e,b.value=q(e,{emojiMap:f.value.map,highlighter:t,texRenderer:o}),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?n(m.value):n.destroy(m.value)}),{immediate:!0}),e.watch((()=>l.value.emoji),(e=>{return(t=Array.isArray(e)?e:[],Promise.all(t.map((e=>"string"==typeof e?D(N(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:o,icon:a,prefix:l,type:r,items:i}=e;t.tabs.push({name:n,icon:M(a,o,l,r),items:i.map((e=>{const n=`${l||""}${e}`;return t.map[n]=M(e,o,l,r),n}))})})),t}))).then((e=>{f.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",T),window.removeEventListener("message",H)})),{config:l,locale:R,insert:A,onChange:()=>{const e=u.value;e.files&&j.value&&z(e.files[0]).then((()=>{e.value=""}))},onDrop:e=>{if(e.dataTransfer?.items){const t=O(e.dataTransfer.items);t&&j.value&&(z(t),e.preventDefault())}},onKeyDown:e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&U()},onPaste:e=>{if(e.clipboardData){const t=O(e.clipboardData.items);t&&j.value&&z(t)}},onLogin:e=>{e.preventDefault();const{lang:t,serverURL:n}=l.value;(({lang:e,serverURL:t})=>{const n=(window.innerWidth-450)/2,o=(window.innerHeight-450)/2,a=window.open(`${t}/ui/login?lng=${encodeURIComponent(e)}`,"_blank",`width=450,height=450,left=${n},top=${o},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);return a?.postMessage({type:"TOKEN",data:null},"*"),new Promise((e=>{const t=({data:n})=>{n&&"object"==typeof n&&"userInfo"===n.type&&n.data.token&&(a?.close(),window.removeEventListener("message",t),e(n.data))};window.addEventListener("message",t)}))})({serverURL:n,lang:t}).then((e=>{c.value=e,(e.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e))}))},onLogout:()=>{c.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null")},onProfile:e=>{e.preventDefault();const{lang:t,serverURL:n}=l.value,o=(window.innerWidth-800)/2,a=(window.innerHeight-800)/2,r=new URLSearchParams({lng:t,token:c.value.token});window.open(`${n}/ui/profile?${r.toString()}`,"_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:c.value.token},"*")},submitComment:U,onImageWallScroll:P,onGifSearch:_,isLogin:x,userInfo:c,isSubmitting:I,wordNumber:E,wordLimit:B,isWordNumberLegal:S,editor:r,userMeta:i,emoji:f,emojiTabIndex:y,showEmoji:k,gifData:L,showGif:w,canUploadImage:j,previewText:b,showPreview:C,inputRefs:s,editorRef:m,emojiButtonRef:d,emojiPopupRef:p,gifButtonRef:g,gifPopupRef:v,imageUploadRef:u,gifSearchInputRef:h}}});const Ne={class:"wl-comment"},Ie={key:0,class:"wl-login-info"},Re={class:"wl-avatar"},xe=["title"],je=["title"],Ae=["src"],ze=["title","textContent"],Ue={class:"wl-panel"},De=["for","textContent"],Me=["id","onUpdate:modelValue","name","type"],Te=["placeholder"],Pe={class:"wl-preview"},_e=e.createElementVNode("hr",null,null,-1),Oe=["innerHTML"],He={class:"wl-footer"},Fe={class:"wl-actions"},We={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noreferrer"},Ge=["title"],qe=["title"],Ke=["title"],Ze=["title"],Je={class:"wl-info"},Ye={class:"wl-text-number"},Xe={key:0},Qe=["textContent"],et=["textContent"],tt=["disabled"],nt=["placeholder"],ot={key:0,class:"wl-loading"},at={key:0,class:"wl-tab-wrapper"},lt=["title","onClick"],rt=["src","alt"],it={key:0,class:"wl-tabs"},ct=["onClick"],st=["src","alt","title"],mt=["title"];var ut=ge(Ve,[["render",function(t,n,o,a,l,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"),g=e.resolveComponent("ImageWall");return e.openBlock(),e.createElementBlock("div",Ne,["disable"!==t.config.login&&t.isLogin&&!t.edit?.objectId?(e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("div",Re,[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,Ae)],8,je)]),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,ze)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Ue,["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:`wl-${n}`,textContent:e.toDisplayString(t.locale[n]+(t.config.requiredMeta.includes(n)||!t.config.requiredMeta.length?"":`(${t.locale.optional})`))},null,8,De),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,Me),[[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,Te),[[e.vModelText,t.editor]]),e.withDirectives(e.createElementVNode("div",Pe,[_e,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,Oe)],512),[[e.vShow,t.showPreview]]),e.createElementVNode("div",He,[e.createElementVNode("div",Fe,[e.createElementVNode("a",We,[e.createVNode(c)]),e.withDirectives(e.createElementVNode("button",{ref:"emojiButtonRef",class:e.normalizeClass(["wl-action",{active:t.showEmoji}]),title:t.locale.emoji,onClick:n[7]||(n[7]=e=>t.showEmoji=!t.showEmoji)},[e.createVNode(s)],10,Ge),[[e.vShow,t.emoji.tabs.length]]),t.config.search?(e.openBlock(),e.createElementBlock("button",{key:0,ref:"gifButtonRef",class:e.normalizeClass(["wl-action",{active:t.showGif}]),title:t.locale.gif,onClick:n[8]||(n[8]=e=>t.showGif=!t.showGif)},[e.createVNode(m)],10,qe)):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,Ke)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:e.normalizeClass(["wl-action",{active:t.showPreview}]),title:t.locale.preview,onClick:n[10]||(n[10]=e=>t.showPreview=!t.showPreview)},[e.createVNode(d)],10,Ze)]),e.createElementVNode("div",Je,[e.createElementVNode("div",Ye,[e.createTextVNode(e.toDisplayString(t.wordNumber)+" ",1),t.config.wordLimit?(e.openBlock(),e.createElementBlock("span",Xe,[e.createTextVNode(" / "),e.createElementVNode("span",{class:e.normalizeClass({illegal:!t.isWordNumberLegal}),textContent:e.toDisplayString(t.wordLimit)},null,10,Qe)])):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.locale.word),1)]),"disable"===t.config.login||t.isLogin?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn",onClick:n[11]||(n[11]=(...e)=>t.onLogin&&t.onLogin(...e)),textContent:e.toDisplayString(t.locale.login)},null,8,et)),"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,tt)):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,nt),e.createVNode(g,{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",ot,[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",at,[(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,rt)):e.createCommentVNode("v-if",!0)],8,lt)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),t.emoji.tabs.length>1?(e.openBlock(),e.createElementBlock("div",it,[(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,st)],10,ct)))),128))])):e.createCommentVNode("v-if",!0)],2)])]),t.replyId||t.edit?.objectId?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-close",title:t.locale.cancelReply,onClick:n[15]||(n[15]=e=>t.$emit(t.replyId?"cancel-reply":"cancel-edit"))},[e.createVNode(i,{size:24})],8,mt)):e.createCommentVNode("v-if",!0)])}],["__file","CommentBox.vue"]]);const dt=["approved","waiting","spam"];var pt=e.defineComponent({components:{CommentBox:ut,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"})),EditIcon:()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),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},edit:{type:Object,default:null}},emits:["submit","reply","like","delete","status","sticky","edit"],setup(n){const o=e.inject("config"),a=Y(),l=de(),r=e.computed((()=>o.value.locale)),i=e.computed((()=>{const{link:e}=n.comment;return e?I(e)?e:`https://${e}`:""})),c=e.computed((()=>a.value.includes(n.comment.objectId))),s=((n,o)=>{const a=t.useNow();return e.computed((()=>U(n,a.value,o)))})(n.comment.insertedAt,r.value),m=e.computed((()=>"administrator"===l.value.type)),u=e.computed((()=>n.comment.user_id&&l.value.objectId===n.comment.user_id)),d=e.computed((()=>n.comment.objectId===n.reply?.objectId)),p=e.computed((()=>n.comment.objectId===n.edit?.objectId));return{config:o,locale:r,isReplyingCurrent:d,isEditingCurrent:p,link:i,like:c,time:s,isAdmin:m,isOwner:u,commentStatus:dt}}});const gt=["id"],vt={class:"wl-user","aria-hidden":"true"},ht=["src"],ft={class:"wl-card"},yt={class:"wl-head"},kt=["href"],wt={key:1,class:"wl-nick"},Ct=["textContent"],bt=["textContent"],Et=["textContent"],Lt=["textContent"],Bt=["textContent"],St={class:"wl-comment-actions"},$t=["title"],Vt=["textContent"],Nt=["title"],It={class:"wl-meta","aria-hidden":"true"},Rt=["data-value","textContent"],xt=["data-value","textContent"],jt=["data-value","textContent"],At=["innerHTML"],zt={key:1,class:"wl-admin-actions"},Ut={class:"wl-comment-status"},Dt=["disabled","onClick","textContent"],Mt={key:3,class:"wl-quote"};var Tt=ge(pt,[["render",function(t,n,o,a,l,r){const i=e.resolveComponent("VerifiedIcon"),c=e.resolveComponent("EditIcon"),s=e.resolveComponent("DeleteIcon"),m=e.resolveComponent("LikeIcon"),u=e.resolveComponent("ReplyIcon"),d=e.resolveComponent("CommentBox"),p=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{id:t.comment.objectId,class:"wl-item"},[e.createElementVNode("div",vt,[t.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.comment.avatar},null,8,ht)):e.createCommentVNode("v-if",!0),t.comment.type?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",ft,[e.createElementVNode("div",yt,[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,kt)):(e.openBlock(),e.createElementBlock("span",wt,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,Ct)):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,bt)):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,Et)):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,Lt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(t.time)},null,8,Bt),e.createElementVNode("div",St,[t.isAdmin||t.isOwner?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-edit",onClick:n[0]||(n[0]=e=>t.$emit("edit",t.comment))},[e.createVNode(c)])):e.createCommentVNode("v-if",!0),t.isAdmin||t.isOwner?(e.openBlock(),e.createElementBlock("button",{key:1,class:"wl-delete",onClick:n[1]||(n[1]=e=>t.$emit("delete",t.comment))},[e.createVNode(s)])):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{class:"wl-like",title:t.like?t.locale.cancelLike:t.locale.like,onClick:n[2]||(n[2]=e=>t.$emit("like",t.comment))},[e.createVNode(m,{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,Vt)):e.createCommentVNode("v-if",!0)],8,$t),e.createElementVNode("button",{class:e.normalizeClass(["wl-reply",{active:t.isReplyingCurrent}]),title:t.isReplyingCurrent?t.locale.cancelReply:t.locale.reply,onClick:n[3]||(n[3]=e=>t.$emit("reply",t.isReplyingCurrent?null:t.comment))},[e.createVNode(u)],10,Nt)])]),e.createElementVNode("div",It,[t.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-addr","data-value":t.comment.addr,textContent:e.toDisplayString(t.comment.addr)},null,8,Rt)):e.createCommentVNode("v-if",!0),t.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,class:"wl-browser","data-value":t.comment.browser,textContent:e.toDisplayString(t.comment.browser)},null,8,xt)):e.createCommentVNode("v-if",!0),t.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,class:"wl-os","data-value":t.comment.os,textContent:e.toDisplayString(t.comment.os)},null,8,jt)):e.createCommentVNode("v-if",!0)]),e.createCommentVNode(" eslint-disable vue/no-v-html "),t.isEditingCurrent?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"wl-content",innerHTML:t.comment.comment},null,8,At)),e.createCommentVNode(" eslint-enable vue/no-v-html "),t.isAdmin&&!t.isEditingCurrent?(e.openBlock(),e.createElementBlock("div",zt,[e.createElementVNode("span",Ut,[(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,Dt)))),128))]),t.isAdmin&&!t.comment.rid?(e.openBlock(),e.createElementBlock("button",{key:0,class:"wl-btn wl-sticky",onClick:n[4]||(n[4]=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||t.isEditingCurrent?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass({"wl-reply-wrapper":t.isReplyingCurrent,"wl-edit-wrapper":t.isEditingCurrent})},[e.createVNode(d,{edit:t.edit,"reply-id":t.reply?.objectId,"reply-user":t.comment.nick,"root-id":t.rootId,onSubmit:n[5]||(n[5]=e=>t.$emit("submit",e)),onCancelReply:n[6]||(n[6]=e=>t.$emit("reply",null)),onCancelEdit:n[7]||(n[7]=e=>t.$emit("edit",null))},null,8,["edit","reply-id","reply-user","root-id"])],2)):e.createCommentVNode("v-if",!0),t.comment.children?(e.openBlock(),e.createElementBlock("div",Mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment.children,(o=>(e.openBlock(),e.createBlock(p,{key:o.objectId,comment:o,reply:t.reply,edit:t.edit,"root-id":t.rootId,onReply:n[8]||(n[8]=e=>t.$emit("reply",e)),onSubmit:n[9]||(n[9]=e=>t.$emit("submit",e)),onLike:n[10]||(n[10]=e=>t.$emit("like",e)),onEdit:n[11]||(n[11]=e=>t.$emit("edit",e)),onDelete:n[12]||(n[12]=e=>t.$emit("delete",e)),onStatus:n[13]||(n[13]=e=>t.$emit("status",e)),onSticky:n[14]||(n[14]=e=>t.$emit("sticky",e))},null,8,["comment","reply","edit","root-id"])))),128))])):e.createCommentVNode("v-if",!0)])],8,gt)}],["__file","CommentCard.vue"]]);const Pt={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},_t=Object.keys(Pt);var Ot=e.defineComponent({name:"WalineRoot",components:{Reaction:be,CommentBox:ut,CommentCard:Tt,LoadingIcon:Ee},props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","reaction"],setup(n){const o=n,a=e.computed((()=>(({serverURL:e,path:t=location.pathname,lang:n="zh-CN",locale:o,emoji:a=["//unpkg.com/@waline/emojis@1.1.0/weibo"],meta:m=["nick","mail","link"],requiredMeta:u=[],dark:d=!1,pageSize:g=10,wordLimit:v,imageUploader:h,highlighter:f,texRenderer:y,copyright:k=!0,login:w="enable",search:C,reaction:E,recaptchaV3Key:L="",commentSorting:B="latest",...S})=>({serverURL:R(e),path:V(t),locale:{...b[n]||b["zh-CN"],..."object"==typeof o?o:{}},wordLimit:x(v),meta:l(m),requiredMeta:l(u),imageUploader:j(h,r),highlighter:j(f,p),texRenderer:j(y,i),lang:n,dark:d,emoji:a,pageSize:g,login:w,copyright:k,search:C||c(n),recaptchaV3Key:L,reaction:Array.isArray(E)?E:!0===E?s:[],commentSorting:B,...S}))(o))),m=de(),u=Y(),d=e.ref("loading"),g=e.ref(0),v=e.ref(1),h=e.ref(0),f=e.ref(a.value.commentSorting),y=e.ref([]),k=e.ref(null),w=e.ref(null),C=e.computed((()=>{return"string"==typeof(e=a.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${A}}`:`${e}${A}`:!0===e?`:root${A}`:"";var e}));let E;t.useStyleTag(C);const B=e=>{const{serverURL:t,path:n,pageSize:o}=a.value,l=new AbortController;d.value="loading",E?.(),(({serverURL:e,lang:t,path:n,page:o,pageSize:a,sortBy:l,signal:r,token:i})=>{const c={};return i&&(c.Authorization=`Bearer ${i}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${a}&page=${o}&lang=${t}&sortBy=${l}`,{signal:r,headers:c}).then((e=>e.json())).then((e=>L(e,"Get comment data")))})({serverURL:t,lang:a.value.lang,path:n,pageSize:o,sortBy:Pt[f.value],page:e,signal:l.signal,token:m.value?.token}).then((t=>{d.value="success",g.value=t.count,y.value.push(...t.data),v.value=e,h.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),d.value="error")})),E=l.abort.bind(l)},S=()=>{g.value=0,y.value=[],B(1)};return e.provide("config",a),e.onMounted((()=>{e.watch((()=>[o.serverURL,o.path]),(()=>S()),{immediate:!0})})),e.onUnmounted((()=>E?.())),{config:a,darkmodeStyle:C,i18n:e.computed((()=>a.value.locale)),status:d,count:g,page:v,totalPages:h,commentSorting:f,sortingMethods:_t,data:y,reply:k,edit:w,loadMore:()=>B(v.value+1),refresh:S,onSortByChange:e=>{f.value!==e&&(f.value=e,S())},onReply:e=>{k.value=e},onSubmit:e=>{if(w.value)w.value.comment=e.comment,w.value.orig=e.orig;else if(e.rid){const t=y.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else y.value.unshift(e)},onStatusChange:async({comment:e,status:t})=>{if(e.status===t)return;const{serverURL:n,lang:o}=a.value;await $({serverURL:n,lang:o,token:m.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:n}=a.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())).then((e=>L(e,"Delete comment"))))({serverURL:t,lang:n,token:m.value?.token,objectId:e}),y.value.some(((t,n)=>t.objectId===e?(y.value=y.value.filter(((e,t)=>t!==n)),!0):t.children.some(((o,a)=>o.objectId===e&&(y.value[n].children=t.children.filter(((e,t)=>t!==a)),!0)))))},onSticky:async e=>{if(e.rid)return;const{serverURL:t,lang:n}=a.value;await $({serverURL:t,lang:n,token:m.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},onLike:async e=>{const{serverURL:t,lang:n}=a.value,{objectId:o}=e,l=u.value.includes(o);await $({serverURL:t,lang:n,objectId:o,token:m.value?.token,like:!l}),l?u.value=u.value.filter((e=>e!==o)):(u.value=[...u.value,o],u.value.length>50&&(u.value=u.value.slice(-50))),e.like=(e.like||0)+(l?-1:1)},onEdit:e=>{w.value=e},version:"2.14.0"}}});const Ht={"data-waline":""},Ft={class:"wl-meta-head"},Wt={class:"wl-count"},Gt=["textContent"],qt={class:"wl-sort"},Kt=["onClick"],Zt={class:"wl-cards"},Jt={key:1,class:"wl-operation"},Yt=["textContent"],Xt={key:0,class:"wl-loading"},Qt=["textContent"],en={class:"wl-operation"},tn=["textContent"],nn={key:3,class:"wl-power"},on=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noreferrer"}," Waline ",-1);var an=ge(Ot,[["render",function(t,n,o,a,l,r){const i=e.resolveComponent("Reaction"),c=e.resolveComponent("CommentBox"),s=e.resolveComponent("CommentCard"),m=e.resolveComponent("LoadingIcon");return e.openBlock(),e.createElementBlock("div",Ht,[e.createVNode(i),t.reply?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(c,{key:0,onSubmit:t.onSubmit},null,8,["onSubmit"])),e.createElementVNode("div",Ft,[e.createElementVNode("div",Wt,[t.count?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(t.count)},null,8,Gt)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.i18n.comment),1)]),e.createElementVNode("ul",qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.sortingMethods,(n=>(e.openBlock(),e.createElementBlock("li",{key:n,class:e.normalizeClass([n===t.commentSorting?"active":""]),onClick:e=>t.onSortByChange(n)},e.toDisplayString(t.i18n[n]),11,Kt)))),128))])]),e.createElementVNode("div",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(n=>(e.openBlock(),e.createBlock(s,{key:n.objectId,"root-id":n.objectId,comment:n,reply:t.reply,edit:t.edit,onReply:t.onReply,onEdit:t.onEdit,onSubmit:t.onSubmit,onStatus:t.onStatusChange,onDelete:t.onDelete,onSticky:t.onSticky,onLike:t.onLike},null,8,["root-id","comment","reply","edit","onReply","onEdit","onSubmit","onStatus","onDelete","onSticky","onLike"])))),128))]),"error"===t.status?(e.openBlock(),e.createElementBlock("div",Jt,[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,Yt)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===t.status?(e.openBlock(),e.createElementBlock("div",Xt,[e.createVNode(m,{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,tn)])],2112)):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(t.i18n.sofa)},null,8,Qt))],64)),e.createCommentVNode(" Copyright Information "),t.config.copyright?(e.openBlock(),e.createElementBlock("div",nn,[e.createTextVNode(" Powered by "),on,e.createTextVNode(" v"+e.toDisplayString(t.version),1)])):e.createCommentVNode("v-if",!0)])}],["__file","Waline.vue"]]);const ln=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},rn=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:o=!0,lang:a="zh-CN"})=>{const l=new AbortController,r=Array.from(document.querySelectorAll(n)),i=e=>{const n=K(e);return null!==n&&t!==n},c=n=>(({serverURL:e,lang:t,paths:n,signal:o})=>B({serverURL:e,lang:t,paths:n,type:["time"],signal:o}).then((e=>Array.isArray(e)?e:[e])))({serverURL:R(e),paths:n.map((e=>K(e)||t)),lang:a,signal:l.signal}).then((e=>ln(e,n))).catch(T);if(o){const n=r.filter((e=>!i(e))),o=r.filter(i);(s={serverURL:R(e),path:t,lang:a},S({...s,type:"time",action:"inc"})).then((e=>ln(new Array(n.length).fill(e),n))),o.length&&c(o)}else c(r);var s;return l.abort.bind(l)};exports.RecentComments=({el:e,serverURL:t,count:n,lang:o="zh-CN"})=>{const a=de(),l=P(e),r=new AbortController;return(({serverURL:e,lang:t,count:n,signal:o,token:a})=>{const l={};return a&&(l.Authorization=`Bearer ${a}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:o,headers:l}).then((e=>e.json()))})({serverURL:t,count:n,lang:o,signal:r.signal,token:a.value?.token}).then((e=>l&&e.length?(l.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(),l.innerHTML=""}}):{comments:e,destroy:()=>r.abort()}))},exports.UserList=({el:e,serverURL:t,count:n,locale:o,lang:a="zh-CN",mode:l="list"})=>{const r=P(e),i=new AbortController;return(({serverURL:e,signal:t,pageSize:n,lang:o})=>fetch(`${e}/user?pageSize=${n}&lang=${o}`,{signal:t}).then((e=>e.json())).then((e=>L(e,"user list"))).then((e=>e.data)))({serverURL:t,pageSize:n,lang:a,signal:i.signal}).then((e=>r&&e.length?(o={...b[a]||b["zh-CN"],..."object"==typeof o?o:{}},r.innerHTML=`<ul class="wl-user-${l}">${e.map(((e,t)=>[`<li class="wl-user-item" aria-label="${e.nick}">`,e.link&&`<a href="${e.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${e.avatar}" alt="${e.nick}">`,`<span class="wl-user-badge">${t+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',e.nick,e.level&&`<span class="wl-badge">${o?o[`level${e.level}`]:`Level ${e.level}`}</span>`,e.label&&`<span class="wl-badge">${e.label}</span>`,"</div>",e.link&&e.link,"</div>",e.link&&"</a>","</li>"].filter((e=>e)).join(""))).join("")}</ul>`,{users:e,destroy:()=>{i.abort(),r.innerHTML=""}}):{users:e,destroy:()=>i.abort()}))},exports.commentCount=Z,exports.defaultLocales=b,exports.init=({el:t="#waline",path:n=window.location.pathname,comment:o=!1,pageview:a=!1,...l})=>{const r=t?P(t):null;if(t&&!r)throw new Error("Option 'el' do not match any domElement!");if(!l.serverURL)throw new Error("Option 'serverURL' is missing!");const i=e.reactive({...l}),c=e.reactive({comment:o,pageview:a,path:n}),s=r?e.createApp((()=>e.h(an,{path:c.path,...i}))):null;s&&s.mount(r);const m=e.watchEffect((()=>{c.comment&&Z({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.comment?c.comment:void 0})})),u=e.watchEffect((()=>{c.pageview&&rn({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=rn,exports.version="2.14.0";
|
|
1
|
+
"use strict";var e=require("vue"),t=require("@vueuse/core"),n=require("autosize"),l=require("marked");const a=["nick","mail","link"],o=e=>e.filter((e=>a.includes(e))),r=["//unpkg.com/@waline/emojis@1.1.0/weibo"],i="zh-CN",c=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})),s=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>',u=e=>{const t=async(t,n={})=>fetch(`https://api.giphy.com/v1/gifs/${t}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...n}).toString()}`).then((e=>e.json())).then((({data:e})=>e.map((e=>({title:e.title,src:e.images.downsized_medium.url})))));return{search:e=>t("search",{q:e,offset:"0"}),default:()=>t("trending",{}),more:(e,n=0)=>t("search",{q:e,offset:n.toString()})}},m=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],d=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"),p=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],v={},g=e=>{let t=0;return e.replace(d,((e,n,l)=>{if(l)return`<span style="color: slategray">${l}</span>`;if("<"===n)return"<";let a;v[n]?a=v[n]:(a=p[t],v[n]=a);const o=`<span style="color: #${a}">${n}</span>`;return t=++t%p.length,o}))},h=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],f=e=>Object.fromEntries(e.map(((e,t)=>[h[t],e])));var y=f(["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","What do you think?"]),k=f(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード","コメントは $0 から $1 ワードの間でなければなりません!\n 現在の単語番号: $2","匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順","どう思いますか?"]),w=f(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字","评论字数应在 $0 到 $1 字之间!\n当前字数:$2","匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),b=f(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字","評論字數應在 $0 到 $1 字之間!\n當前字數:$2","匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂","按倒序","按正序","按熱度","你認為這篇文章怎麼樣?"]),C=f(["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","O que você acha?"]),E=f(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова","Пожалуйста, введите комментарии от $0 до $1 слов!\nНомер текущего слова: $2","Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]);const B={zh:w,"zh-cn":w,"zh-CN":w,"zh-tw":b,"zh-TW":b,en:y,"en-US":y,"en-us":y,jp:k,"jp-jp":k,"jp-JP":k,"pt-br":C,"pt-BR":C,ru:E,"ru-ru":E,"ru-RU":E},L={"Content-Type":"application/json"},$=(e,t="")=>{if("object"==typeof e&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},V=({serverURL:e,lang:t,paths:n,type:l,signal:a})=>fetch(`${e}/article?path=${encodeURIComponent(n.join(","))}&type=${encodeURIComponent(l.join(","))}&lang=${t}`,{signal:a}).then((e=>e.json())),N=({serverURL:e,lang:t,path:n,type:l,action:a})=>fetch(`${e}/article?lang=${t}`,{method:"POST",headers:L,body:JSON.stringify({path:n,type:l,action:a})}).then((e=>e.json())),S=({serverURL:e,lang:t,token:n,objectId:l,...a})=>fetch(`${e}/comment/${l}?lang=${t}`,{method:"PUT",headers:{...L,Authorization:`Bearer ${n}`},body:JSON.stringify(a)}).then((e=>e.json())).then((e=>$(e,"Update comment"))),x=e=>{try{e=decodeURI(e)}catch(e){}return e},R=(e="")=>e.replace(/\/$/u,""),j=e=>/^(https?:)?\/\//.test(e),I=e=>{const t=R(e);return j(t)?t:`https://${t}`},A=e=>Array.isArray(e)?e:!!e&&[0,e],z=(e,t)=>"function"==typeof e?e:!1!==e&&t,U="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",_=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},D=(e,t,n)=>{if(!e)return"";const l="string"==typeof e?new Date(-1!==e.indexOf(" ")?e.replace(/-/g,"/"):e):e,a=t.getTime()-l.getTime(),o=Math.floor(a/864e5);if(0===o){const e=a%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 o<0?n.now:o<8?`${o} ${n.days}`:(e=>{const t=_(e.getDate(),2),n=_(e.getMonth()+1,2);return`${_(e.getFullYear(),2)}-${n}-${t}`})(l)},M=e=>{const n=t.useStorage("WALINE_EMOJI",{}),l=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(e));if(l){const t=n.value[e];if(t)return Promise.resolve(t)}return fetch(`${e}/info.json`).then((e=>e.json())).then((t=>{const a={folder:e,...t};return l&&(n.value[e]=a),a}))},T=(e,t="",n="",l="")=>`${t?`${t}/`:""}${n}${e}${l?`.${l}`:""}`,H=e=>{"AbortError"!==e.name&&console.error(e.message)},O=e=>e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,P=e=>e.type.includes("image"),F=e=>{const t=Array.from(e).find(P);return t?t.getAsFile():null},W=/\$.*?\$/,q=/^\$(.*?)\$/,K=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,G=(e="",t={})=>e.replace(/:(.+?):/g,((e,n)=>t[n]?`<img class="wl-emoji" src="${t[n]}" alt="${n}">`:e)),Z=(e,{emojiMap:t,highlighter:n,texRenderer:a})=>{if(l.marked.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),a){const e=(e=>[{name:"blockMath",level:"block",tokenizer(t){const n=K.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(W);return-1!==t?t:e.length},tokenizer(t){const n=q.exec(t);if(null!==n)return{type:"html",raw:n[0],text:e(!1,n[1])}}}])(a);l.marked.use({extensions:e})}return l.marked.parse(G(e,t))},J=e=>e.dataset.path||e.getAttribute("id"),Y=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:l="zh-CN"})=>{const a=new AbortController,o=document.querySelectorAll(n);return o.length&&(({serverURL:e,lang:t,paths:n,signal:l})=>fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:l}).then((e=>e.json())).then((e=>Array.isArray(e)?e:[e])))({serverURL:I(e),paths:Array.from(o).map((e=>x(e.dataset.path||e.getAttribute("id")||t))),lang:l,signal:a.signal}).then((e=>{o.forEach(((t,n)=>{t.innerText=e[n].toString()}))})).catch(H),a.abort.bind(a)},X=({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"})]),Q=()=>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"})),ee=()=>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"})),te=()=>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"})]),ne=({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"})]),le=()=>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"})]),ae=()=>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"})),oe=()=>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"})),re=()=>e.h("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},e.h("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),ie=()=>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"})),ce=({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"}))),se=()=>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"})]);let ue=null;const me=()=>ue||(ue=t.useStorage("WALINE_LIKE",[]));let de=null;const pe=()=>de??(de=t.useStorage("WALINE_REACTION",{}));var ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ge={},he={},fe={},ye=ve&&ve.__awaiter||function(e,t,n,l){return new(n||(n=Promise))((function(a,o){function r(e){try{c(l.next(e))}catch(e){o(e)}}function i(e){try{c(l.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,i)}c((l=l.apply(e,t||[])).next())}))},ke=ve&&ve.__generator||function(e,t){var n,l,a,o,r={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(o){return function(i){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,l&&(a=2&o[0]?l.return:o[0]?l.throw||((a=l.return)&&a.call(l),0):l.next)&&!(a=a.call(l,o[1])).done)return a;switch(l=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,l=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!(a=r.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){r.label=o[1];break}if(6===o[0]&&r.label<a[1]){r.label=a[1],a=o;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(o);break}a[2]&&r.ops.pop(),r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e],l=0}finally{n=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,i])}}};Object.defineProperty(fe,"__esModule",{value:!0}),fe.ReCaptchaInstance=void 0;var we=function(){function e(e,t,n){this.siteKey=e,this.recaptchaID=t,this.recaptcha=n,this.styleContainer=null}return e.prototype.execute=function(e){return ye(this,void 0,void 0,(function(){return ke(this,(function(t){return[2,this.recaptcha.enterprise?this.recaptcha.enterprise.execute(this.recaptchaID,{action:e}):this.recaptcha.execute(this.recaptchaID,{action:e})]}))}))},e.prototype.getSiteKey=function(){return this.siteKey},e.prototype.hideBadge=function(){null===this.styleContainer&&(this.styleContainer=document.createElement("style"),this.styleContainer.innerHTML=".grecaptcha-badge{visibility:hidden !important;}",document.head.appendChild(this.styleContainer))},e.prototype.showBadge=function(){null!==this.styleContainer&&(document.head.removeChild(this.styleContainer),this.styleContainer=null)},e}();fe.ReCaptchaInstance=we,Object.defineProperty(he,"__esModule",{value:!0}),he.getInstance=he.load=void 0;var be,Ce=fe;!function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(be||(be={}));var Ee=function(){function e(){}return e.load=function(t,n){if(void 0===n&&(n={}),"undefined"==typeof document)return Promise.reject(new Error("This is a library for the browser!"));if(e.getLoadingState()===be.LOADED)return e.instance.getSiteKey()===t?Promise.resolve(e.instance):Promise.reject(new Error("reCAPTCHA already loaded with different site key!"));if(e.getLoadingState()===be.LOADING)return t!==e.instanceSiteKey?Promise.reject(new Error("reCAPTCHA already loaded with different site key!")):new Promise((function(t,n){e.successfulLoadingConsumers.push((function(e){return t(e)})),e.errorLoadingRunnable.push((function(e){return n(e)}))}));e.instanceSiteKey=t,e.setLoadingState(be.LOADING);var l=new e;return new Promise((function(a,o){l.loadScript(t,n.useRecaptchaNet||!1,n.useEnterprise||!1,n.renderParameters?n.renderParameters:{},n.customUrl).then((function(){e.setLoadingState(be.LOADED);var o=l.doExplicitRender(grecaptcha,t,n.explicitRenderParameters?n.explicitRenderParameters:{},n.useEnterprise||!1),r=new Ce.ReCaptchaInstance(t,o,grecaptcha);e.successfulLoadingConsumers.forEach((function(e){return e(r)})),e.successfulLoadingConsumers=[],n.autoHideBadge&&r.hideBadge(),e.instance=r,a(r)})).catch((function(t){e.errorLoadingRunnable.forEach((function(e){return e(t)})),e.errorLoadingRunnable=[],o(t)}))}))},e.getInstance=function(){return e.instance},e.setLoadingState=function(t){e.loadingState=t},e.getLoadingState=function(){return null===e.loadingState?be.NOT_LOADED:e.loadingState},e.prototype.loadScript=function(t,n,l,a,o){var r=this;void 0===n&&(n=!1),void 0===l&&(l=!1),void 0===a&&(a={}),void 0===o&&(o="");var i=document.createElement("script");i.setAttribute("recaptcha-v3-script","");var c="https://www.google.com/recaptcha/api.js";n&&(c=l?"https://recaptcha.net/recaptcha/enterprise.js":"https://recaptcha.net/recaptcha/api.js"),l&&(c="https://www.google.com/recaptcha/enterprise.js"),o&&(c=o),a.render&&(a.render=void 0);var s=this.buildQueryString(a);return i.src=c+"?render=explicit"+s,new Promise((function(t,n){i.addEventListener("load",r.waitForScriptToLoad((function(){t(i)}),l),!1),i.onerror=function(t){e.setLoadingState(be.NOT_LOADED),n(t)},document.head.appendChild(i)}))},e.prototype.buildQueryString=function(e){return Object.keys(e).length<1?"":"&"+Object.keys(e).filter((function(t){return!!e[t]})).map((function(t){return t+"="+e[t]})).join("&")},e.prototype.waitForScriptToLoad=function(t,n){var l=this;return function(){void 0===window.grecaptcha?setTimeout((function(){l.waitForScriptToLoad(t,n)}),e.SCRIPT_LOAD_DELAY):n?window.grecaptcha.enterprise.ready((function(){t()})):window.grecaptcha.ready((function(){t()}))}},e.prototype.doExplicitRender=function(e,t,n,l){var a={sitekey:t,badge:n.badge,size:n.size,tabindex:n.tabindex};return n.container?l?e.enterprise.render(n.container,a):e.render(n.container,a):l?e.enterprise.render(a):e.render(a)},e.loadingState=null,e.instance=null,e.instanceSiteKey=null,e.successfulLoadingConsumers=[],e.errorLoadingRunnable=[],e.SCRIPT_LOAD_DELAY=25,e}();he.load=Ee.load,he.getInstance=Ee.getInstance,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReCaptchaInstance=e.getInstance=e.load=void 0;var t=he;Object.defineProperty(e,"load",{enumerable:!0,get:function(){return t.load}}),Object.defineProperty(e,"getInstance",{enumerable:!0,get:function(){return t.getInstance}});var n=fe;Object.defineProperty(e,"ReCaptchaInstance",{enumerable:!0,get:function(){return n.ReCaptchaInstance}})}(ge);const Be={};let Le=null;const $e=()=>Le??(Le=t.useStorage("WALINE_USER",{})),Ve={key:0,class:"wl-reaction"},Ne=["textContent"],Se={class:"wl-reaction-list"},xe=["onClick"],Re={class:"wl-reaction-img"},je=["src","alt"],Ie=["textContent"],Ae=["textContent"];var ze=e.defineComponent({__name:"ArticleReaction",setup(t,{expose:n}){n();const l=pe(),a=e.inject("config"),o=e.ref(-1),r=e.ref([]),i=e.computed((()=>a.value.locale)),c=e.computed((()=>a.value.reaction.length>0)),s=e.computed((()=>{const{reaction:e,path:t}=a.value;return e.map(((e,n)=>({icon:e,desc:i.value[`reaction${n}`],active:l.value[t]===n})))}));let u;return e.onMounted((()=>{e.watch((()=>[a.value.serverURL,a.value.path]),(()=>{(async()=>{if(c.value){const{serverURL:e,lang:t,path:n,reaction:l}=a.value,o=new AbortController;u=o.abort.bind(o);const i=await V({serverURL:e,lang:t,paths:[n],type:l.map(((e,t)=>`reaction${t}`)),signal:o.signal});if(Array.isArray(i)||"number"==typeof i)return;r.value=l.map(((e,t)=>i[`reaction${t}`]))}})()}),{immediate:!0})})),e.onUnmounted((()=>u?.())),(t,n)=>e.unref(s).length?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("h4",{textContent:e.toDisplayString(e.unref(i).reactionTitle)},null,8,Ne),e.createElementVNode("ul",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(({active:t,icon:n,desc:i},c)=>(e.openBlock(),e.createElementBlock("li",{key:c,class:e.normalizeClass(["wl-reaction-item",{active:t}]),onClick:e=>(async e=>{if(-1===o.value){const{serverURL:t,lang:n,path:i}=a.value,c=l.value[i];o.value=e,void 0!==c&&(await N({serverURL:t,lang:n,path:i,type:`reaction${c}`,action:"desc"}),r.value[c]=Math.max(r.value[c]-1,0)),c!==e&&(await N({serverURL:t,lang:n,path:i,type:`reaction${e}`}),r.value[e]=(r.value[e]||0)+1),c===e?delete l.value[i]:l.value[i]=e,o.value=-1}})(c)},[e.createElementVNode("div",Re,[e.createElementVNode("img",{src:n,alt:i},null,8,je),o.value===c?(e.openBlock(),e.createBlock(e.unref(ce),{key:0,class:"wl-reaction-loading"})):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-reaction-votes",textContent:e.toDisplayString(r.value[c]||0)},null,8,Ie))]),e.createElementVNode("div",{class:"wl-reaction-text",textContent:e.toDisplayString(i)},null,8,Ae)],10,xe)))),128))])])):e.createCommentVNode("v-if",!0)}}),Ue=(e,t)=>{const n=e.__vccOpts||e;for(const[e,l]of t)n[e]=l;return n},_e=Ue(ze,[["__file","ArticleReaction.vue"]]);const De=["data-index"],Me=["src","title","onClick"];var Te=Ue(e.defineComponent({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(t,{expose:n}){const l=t;n();let a=null;const o=e.ref(null),r=e.ref({}),i=e.ref([]),c=()=>{const e=Math.floor((o.value.getBoundingClientRect().width+l.gap)/(l.columnWidth+l.gap));return e>0?e:1},s=async t=>{if(t>=l.items.length)return;await e.nextTick();const n=Array.from(o.value?.children||[]).reduce(((e,t)=>t.getBoundingClientRect().height<e.getBoundingClientRect().height?t:e));i.value[Number(n.dataset.index)].push(t),await s(t+1)},u=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 s(0),window.scrollTo({top:n})},m=e=>{r.value[e.target.src]=!0};return e.onMounted((()=>{u(!0),a=new ResizeObserver((()=>{u()})),a.observe(o.value),e.watch((()=>[l.items]),(()=>{r.value={},u(!0)})),e.watch((()=>[l.columnWidth,l.gap]),(()=>{u()}))})),e.onBeforeUnmount((()=>a.unobserve(o.value))),(n,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wall",ref:o,class:"wl-gallery",style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,((l,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"wl-gallery-column","data-index":a,style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,(l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l},[r.value[t.items[l].src]?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(e.unref(ce),{key:0,size:36,style:{margin:"20px auto"}})),e.createElementVNode("img",{class:"wl-gallery-item",src:t.items[l].src,title:t.items[l].title,loading:"lazy",onLoad:m,onClick:e=>n.$emit("insert",``)},null,40,Me)],64)))),128))],12,De)))),128))],4))}}),[["__file","ImageWall.vue"]]);const He={class:"wl-comment"},Oe={key:0,class:"wl-login-info"},Pe={class:"wl-avatar"},Fe=["title"],We=["title"],qe=["src"],Ke=["title","textContent"],Ge={class:"wl-panel"},Ze=["for","textContent"],Je=["id","onUpdate:modelValue","name","type"],Ye=["placeholder"],Xe={class:"wl-preview"},Qe=e.createElementVNode("hr",null,null,-1),et=["innerHTML"],tt={class:"wl-footer"},nt={class:"wl-actions"},lt={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},at=["title"],ot=["title"],rt=["title"],it=["title"],ct={class:"wl-info"},st={class:"wl-text-number"},ut={key:0},mt=["textContent"],dt=["textContent"],pt=["disabled"],vt=["placeholder"],gt={key:0,class:"wl-loading"},ht={key:0,class:"wl-tab-wrapper"},ft=["title","onClick"],yt=["src","alt"],kt={key:0,class:"wl-tabs"},wt=["onClick"],bt=["src","alt","title"],Ct=["title"];var Et=e.defineComponent({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(l,{expose:a,emit:o}){const r=l;a();const i=e.inject("config"),c=t.useStorage("WALINE_COMMENT_BOX_EDITOR",""),s=t.useStorage("WALINE_USER_META",{nick:"",mail:"",link:""}),u=$e(),m=e.ref({}),d=e.ref(null),p=e.ref(null),v=e.ref(null),g=e.ref(null),h=e.ref(null),f=e.ref(null),y=e.ref(null),k=e.ref({tabs:[],map:{}}),w=e.ref(0),b=e.ref(!1),C=e.ref(!1),E=e.ref(!1),B=e.ref(""),L=e.ref(0),$=e.reactive({loading:!0,list:[]}),V=e.ref(0),N=e.ref(!1),x=e.ref(""),j=e.ref(!1),I=e.computed((()=>i.value.locale)),A=e.computed((()=>Boolean(u.value?.token))),z=e.computed((()=>!1!==i.value.imageUploader)),U=e=>{const t=d.value,n=t.selectionStart,l=t.selectionEnd||0,a=t.scrollTop;c.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},_=e=>{const t=e.key;(e.ctrlKey||e.metaKey)&&"Enter"===t&&W()},D=e=>{const t=`![${i.value.locale.uploading} ${e.name}]()`;return U(t),Promise.resolve().then((()=>i.value.imageUploader(e))).then((n=>{c.value=c.value.replace(t,`\r\n`)})).catch((e=>{alert(e.message),c.value=c.value.replace(t,"")}))},H=e=>{if(e.dataTransfer?.items){const t=F(e.dataTransfer.items);t&&z.value&&(D(t),e.preventDefault())}},O=e=>{if(e.clipboardData){const t=F(e.clipboardData.items);t&&z.value&&D(t)}},P=()=>{const e=p.value;e.files&&z.value&&D(e.files[0]).then((()=>{e.value=""}))},W=async()=>{const{serverURL:e,lang:t,login:n,wordLimit:l,requiredMeta:a}=i.value;let p="";i.value.recaptchaV3Key&&(p=await(e=>{const t=Be[e]??(Be[e]=ge.load(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:e=>t.then((t=>t.execute(e)))}})(i.value.recaptchaV3Key).execute("social"));const v={comment:x.value,nick:s.value.nick,mail:s.value.mail,link:s.value.link,ua:navigator.userAgent,url:i.value.path,recaptchaV3:p};if(u.value?.token)v.nick=u.value.display_name,v.mail=u.value.email,v.link=u.value.url;else{if("force"===n)return;if(a.indexOf("nick")>-1&&!v.nick)return m.value.nick?.focus(),alert(I.value.nickError);if(a.indexOf("mail")>-1&&!v.mail||v.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(v.mail))return m.value.mail?.focus(),alert(I.value.mailError);if(!v.comment)return void d.value?.focus();v.nick||(v.nick=I.value.anonymous)}if(!N.value)return alert(I.value.wordHint.replace("$0",l[0].toString()).replace("$1",l[1].toString()).replace("$2",L.value.toString()));v.comment=G(v.comment,k.value.map),r.replyId&&r.rootId&&(v.pid=r.replyId,v.rid=r.rootId,v.at=r.replyUser),j.value=!0;const g={serverURL:e,lang:t,token:u.value?.token,comment:v};(r.edit?S({objectId:r.edit.objectId,...g}):(({serverURL:e,lang:t,token:n,comment:l})=>{const a={"Content-Type":"application/json"};return n&&(a.Authorization=`Bearer ${n}`),fetch(`${e}/comment?lang=${t}`,{method:"POST",headers:a,body:JSON.stringify(l)}).then((e=>e.json()))})(g)).then((e=>{if(j.value=!1,e.errmsg)return alert(e.errmsg);o("submit",e.data),c.value="",B.value="",r.replyId&&o("cancelReply"),r.edit?.objectId&&o("cancelEdit")})).catch((e=>{j.value=!1,alert(e.message)}))},q=e=>{e.preventDefault();const{lang:t,serverURL:n}=i.value;(({lang:e,serverURL:t})=>{const n=(window.innerWidth-450)/2,l=(window.innerHeight-450)/2,a=window.open(`${t}/ui/login?lng=${encodeURIComponent(e)}`,"_blank",`width=450,height=450,left=${n},top=${l},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);return a?.postMessage({type:"TOKEN",data:null},"*"),new Promise((e=>{const t=({data:n})=>{n&&"object"==typeof n&&"userInfo"===n.type&&n.data.token&&(a?.close(),window.removeEventListener("message",t),e(n.data))};window.addEventListener("message",t)}))})({serverURL:n,lang:t}).then((e=>{u.value=e,(e.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(e)),o("log")}))},K=()=>{u.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),o("log")},J=e=>{e.preventDefault();const{lang:t,serverURL:n}=i.value,l=(window.innerWidth-800)/2,a=(window.innerHeight-800)/2,o=new URLSearchParams({lng:t,token:u.value.token});window.open(`${n}/ui/profile?${o.toString()}`,"_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:u.value.token},"*")},Y=e=>{v.value?.contains(e.target)||g.value?.contains(e.target)||(b.value=!1),h.value?.contains(e.target)||f.value?.contains(e.target)||(C.value=!1)},Q=async e=>{const{scrollTop:t,clientHeight:n,scrollHeight:l}=e.target,a=(n+t)/l,o=i.value.search,r=y.value?.value||"";a<.9||$.loading||($.loading=!0,$.list=[...$.list,...o.more&&$.list.length?await o.more(r,$.list.length):await o.search(r)],$.loading=!1,setTimeout((()=>{e.target.scrollTop=t}),50))},ne=t.useDebounceFn((e=>{$.list=[],Q(e)}),300);e.watch([i,L],(([e,t])=>{const{wordLimit:n}=e;n?t<n[0]&&0!==n[0]?(V.value=n[0],N.value=!1):t>n[1]?(V.value=n[1],N.value=!1):(V.value=n[1],N.value=!0):(V.value=0,N.value=!0)}),{immediate:!0});const oe=({data:e})=>{e&&"profile"===e.type&&(u.value={...u.value,...e.data},[localStorage,sessionStorage].filter((e=>e.getItem("WALINE_USER"))).forEach((e=>e.setItem("WALINE_USER",JSON.stringify(u)))))};return e.onMounted((()=>{document.body.addEventListener("click",Y),window.addEventListener("message",oe),r.edit?.objectId&&(c.value=r.edit.orig),e.watch(C,(async e=>{if(!e)return;const t=i.value.search;y.value&&(y.value.value=""),$.loading=!0,$.list=t.default?await t.default():await t.search(""),$.loading=!1})),e.watch((()=>c.value),(e=>{const{highlighter:t,texRenderer:l}=i.value;x.value=e,B.value=Z(e,{emojiMap:k.value.map,highlighter:t,texRenderer:l}),L.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(d.value):n.destroy(d.value)}),{immediate:!0}),e.watch((()=>i.value.emoji),(e=>{return(t=e,Promise.all(t.map((e=>"string"==typeof e?M(R(e)):Promise.resolve(e)))).then((e=>{const t={tabs:[],map:{}};return e.forEach((e=>{const{name:n,folder:l,icon:a,prefix:o,type:r,items:i}=e;t.tabs.push({name:n,icon:T(a,l,o,r),items:i.map((e=>{const n=`${o||""}${e}`;return t.map[n]=T(e,l,o,r),n}))})})),t}))).then((e=>{k.value=e}));var t}),{immediate:!0})})),e.onUnmounted((()=>{document.body.removeEventListener("click",Y),window.removeEventListener("message",oe)})),(t,n)=>(e.openBlock(),e.createElementBlock("div",He,["disable"!==e.unref(i).login&&e.unref(A)&&!l.edit?.objectId?(e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",Pe,[e.createElementVNode("button",{type:"submit",class:"wl-logout-btn",title:e.unref(I).logout,onClick:K},[e.createVNode(e.unref(X),{size:14})],8,Fe),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.unref(I).profile,onClick:J},[e.createElementVNode("img",{src:e.unref(u).avatar,alt:"avatar"},null,8,qe)],8,We)]),e.createElementVNode("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:e.unref(I).profile,onClick:J,textContent:e.toDisplayString(e.unref(u).display_name)},null,8,Ke)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Ge,["force"!==e.unref(i).login&&e.unref(i).meta.length&&!e.unref(A)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wl-header",`item${e.unref(i).meta.length}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i).meta,(t=>(e.openBlock(),e.createElementBlock("div",{key:t,class:"wl-header-item"},[e.createElementVNode("label",{for:`wl-${t}`,textContent:e.toDisplayString(e.unref(I)[t]+(e.unref(i).requiredMeta.includes(t)||!e.unref(i).requiredMeta.length?"":`(${e.unref(I).optional})`))},null,8,Ze),e.withDirectives(e.createElementVNode("input",{id:`wl-${t}`,ref_for:!0,ref:e=>{e&&(m.value[t]=e)},"onUpdate:modelValue":n=>e.unref(s)[t]=n,class:e.normalizeClass(["wl-input",`wl-${t}`]),name:t,type:"mail"===t?"email":"text"},null,10,Je),[[e.vModelDynamic,e.unref(s)[t]]])])))),128))],2)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",{id:"wl-edit",ref_key:"editorRef",ref:d,"onUpdate:modelValue":n[0]||(n[0]=t=>e.isRef(c)?c.value=t:null),class:"wl-editor",placeholder:l.replyUser?`@${l.replyUser}`:e.unref(I).placeholder,onKeydown:_,onDrop:H,onPaste:O},null,40,Ye),[[e.vModelText,e.unref(c)]]),e.withDirectives(e.createElementVNode("div",Xe,[Qe,e.createElementVNode("h4",null,e.toDisplayString(e.unref(I).preview)+":",1),e.createElementVNode("div",{class:"wl-content",innerHTML:B.value},null,8,et)],512),[[e.vShow,E.value]]),e.createElementVNode("div",tt,[e.createElementVNode("div",nt,[e.createElementVNode("a",lt,[e.createVNode(e.unref(ae))]),e.withDirectives(e.createElementVNode("button",{ref_key:"emojiButtonRef",ref:v,type:"button",class:e.normalizeClass(["wl-action",{active:b.value}]),title:e.unref(I).emoji,onClick:n[1]||(n[1]=e=>b.value=!b.value)},[e.createVNode(e.unref(ee))],10,at),[[e.vShow,k.value.tabs.length]]),e.unref(i).search?(e.openBlock(),e.createElementBlock("button",{key:0,ref_key:"gifButtonRef",ref:h,type:"button",class:e.normalizeClass(["wl-action",{active:C.value}]),title:e.unref(I).gif,onClick:n[2]||(n[2]=e=>C.value=!C.value)},[e.createVNode(e.unref(se))],10,ot)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:p,class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:P},null,544),e.unref(z)?(e.openBlock(),e.createElementBlock("label",{key:1,for:"wl-image-upload",class:"wl-action",title:e.unref(I).uploadImage},[e.createVNode(e.unref(te))],8,rt)):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["wl-action",{active:E.value}]),title:e.unref(I).preview,onClick:n[3]||(n[3]=e=>E.value=!E.value)},[e.createVNode(e.unref(le))],10,it)]),e.createElementVNode("div",ct,[e.createElementVNode("div",st,[e.createTextVNode(e.toDisplayString(L.value)+" ",1),e.unref(i).wordLimit?(e.openBlock(),e.createElementBlock("span",ut,[e.createTextVNode(" / "),e.createElementVNode("span",{class:e.normalizeClass({illegal:!N.value}),textContent:e.toDisplayString(V.value)},null,10,mt)])):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(I).word),1)]),"disable"===e.unref(i).login||e.unref(A)?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wl-btn",onClick:q,textContent:e.toDisplayString(e.unref(I).login)},null,8,dt)),"force"!==e.unref(i).login||e.unref(A)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:j.value,onClick:W},[j.value?(e.openBlock(),e.createBlock(e.unref(ce),{key:0,size:16})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(I).submit),1)],64))],8,pt)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",{ref_key:"gifPopupRef",ref:f,class:e.normalizeClass(["wl-gif-popup",{display:C.value}])},[e.createElementVNode("input",{ref_key:"gifSearchInputRef",ref:y,type:"text",placeholder:e.unref(I).gifSearchPlaceholder,onInput:n[4]||(n[4]=(...t)=>e.unref(ne)&&e.unref(ne)(...t))},null,40,vt),e.createVNode(Te,{items:$.list,"column-width":200,gap:6,onInsert:n[5]||(n[5]=e=>U(e)),onScroll:Q},null,8,["items"]),$.loading?(e.openBlock(),e.createElementBlock("div",gt,[e.createVNode(e.unref(ce),{size:30})])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",{ref_key:"emojiPopupRef",ref:g,class:e.normalizeClass(["wl-emoji-popup",{display:b.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value.tabs,((t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.name},[n===w.value?(e.openBlock(),e.createElementBlock("div",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(t=>(e.openBlock(),e.createElementBlock("button",{key:t,type:"button",title:t,onClick:e=>U(`:${t}:`)},[b.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"wl-emoji",src:k.value.map[t],alt:t,loading:"lazy",referrerPolicy:"no-referrer"},null,8,yt)):e.createCommentVNode("v-if",!0)],8,ft)))),128))])):e.createCommentVNode("v-if",!0)],64)))),128)),k.value.tabs.length>1?(e.openBlock(),e.createElementBlock("div",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value.tabs,((t,n)=>(e.openBlock(),e.createElementBlock("button",{key:t.name,type:"button",class:e.normalizeClass(["wl-tab",{active:w.value===n}]),onClick:e=>w.value=n},[e.createElementVNode("img",{class:"wl-emoji",src:t.icon,alt:t.name,title:t.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,bt)],10,wt)))),128))])):e.createCommentVNode("v-if",!0)],2)])]),l.replyId||l.edit?.objectId?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"wl-close",title:e.unref(I).cancelReply,onClick:n[6]||(n[6]=e=>t.$emit(l.replyId?"cancelReply":"cancelEdit"))},[e.createVNode(e.unref(X),{size:24})],8,Ct)):e.createCommentVNode("v-if",!0)]))}}),Bt=Ue(Et,[["__file","CommentBox.vue"]]);const Lt=["id"],$t={class:"wl-user","aria-hidden":"true"},Vt=["src"],Nt={class:"wl-card"},St={class:"wl-head"},xt=["href"],Rt={key:1,class:"wl-nick"},jt=["textContent"],It=["textContent"],At=["textContent"],zt=["textContent"],Ut=["textContent"],_t={class:"wl-comment-actions"},Dt=["title"],Mt=["textContent"],Tt=["title"],Ht={class:"wl-meta","aria-hidden":"true"},Ot=["data-value","textContent"],Pt=["data-value","textContent"],Ft=["data-value","textContent"],Wt=["innerHTML"],qt={key:1,class:"wl-admin-actions"},Kt={class:"wl-comment-status"},Gt=["disabled","onClick","textContent"],Zt={key:3,class:"wl-quote"};var Jt=Ue(e.defineComponent({__name:"CommentCard",props:{comment:null,edit:{default:null},rootId:null,reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(n){const l=n,a=["approved","waiting","spam"],o=e.inject("config"),r=me(),i=t.useNow(),c=$e(),s=e.computed((()=>o.value.locale)),u=e.computed((()=>{const{link:e}=l.comment;return e?j(e)?e:`https://${e}`:""})),m=e.computed((()=>r.value.includes(l.comment.objectId))),d=e.computed((()=>D(l.comment.insertedAt,i.value,s.value))),p=e.computed((()=>"administrator"===c.value.type)),v=e.computed((()=>l.comment.user_id&&c.value.objectId===l.comment.user_id)),g=e.computed((()=>l.comment.objectId===l.reply?.objectId)),h=e.computed((()=>l.comment.objectId===l.edit?.objectId));return(t,l)=>{const o=e.resolveComponent("CommentCard",!0);return e.openBlock(),e.createElementBlock("div",{id:n.comment.objectId,class:"wl-item"},[e.createElementVNode("div",$t,[n.comment.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.comment.avatar},null,8,Vt)):e.createCommentVNode("v-if",!0),n.comment.type?(e.openBlock(),e.createBlock(e.unref(ie),{key:1})):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",Nt,[e.createElementVNode("div",St,[e.unref(u)?(e.openBlock(),e.createElementBlock("a",{key:0,class:"wl-nick",href:e.unref(u),target:"_blank",rel:"noopener noreferrer"},e.toDisplayString(n.comment.nick),9,xt)):(e.openBlock(),e.createElementBlock("span",Rt,e.toDisplayString(n.comment.nick),1)),"administrator"===n.comment.type?(e.openBlock(),e.createElementBlock("span",{key:2,class:"wl-badge",textContent:e.toDisplayString(e.unref(s).admin)},null,8,jt)):e.createCommentVNode("v-if",!0),n.comment.label?(e.openBlock(),e.createElementBlock("span",{key:3,class:"wl-badge",textContent:e.toDisplayString(n.comment.label)},null,8,It)):e.createCommentVNode("v-if",!0),n.comment.sticky?(e.openBlock(),e.createElementBlock("span",{key:4,class:"wl-badge",textContent:e.toDisplayString(e.unref(s).sticky)},null,8,At)):e.createCommentVNode("v-if",!0),void 0!==n.comment.level&&n.comment.level>=0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(`wl-badge level${n.comment.level}`),textContent:e.toDisplayString(e.unref(s)[`level${n.comment.level}`]||`Level ${n.comment.level}`)},null,10,zt)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:"wl-time",textContent:e.toDisplayString(e.unref(d))},null,8,Ut),e.createElementVNode("div",_t,[e.unref(p)||e.unref(v)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wl-edit",onClick:l[0]||(l[0]=()=>t.$emit("edit",n.comment))},[e.createVNode(e.unref(re))])):e.createCommentVNode("v-if",!0),e.unref(p)||e.unref(v)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"wl-delete",onClick:l[1]||(l[1]=e=>t.$emit("delete",n.comment))},[e.createVNode(e.unref(Q))])):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{type:"button",class:"wl-like",title:e.unref(m)?e.unref(s).cancelLike:e.unref(s).like,onClick:l[2]||(l[2]=e=>t.$emit("like",n.comment))},[e.createVNode(e.unref(ne),{active:e.unref(m)},null,8,["active"]),"like"in n.comment?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(n.comment.like)},null,8,Mt)):e.createCommentVNode("v-if",!0)],8,Dt),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["wl-reply",{active:e.unref(g)}]),title:e.unref(g)?e.unref(s).cancelReply:e.unref(s).reply,onClick:l[3]||(l[3]=l=>t.$emit("reply",e.unref(g)?null:n.comment))},[e.createVNode(e.unref(oe))],10,Tt)])]),e.createElementVNode("div",Ht,[n.comment.addr?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-addr","data-value":n.comment.addr,textContent:e.toDisplayString(n.comment.addr)},null,8,Ot)):e.createCommentVNode("v-if",!0),n.comment.browser?(e.openBlock(),e.createElementBlock("span",{key:1,class:"wl-browser","data-value":n.comment.browser,textContent:e.toDisplayString(n.comment.browser)},null,8,Pt)):e.createCommentVNode("v-if",!0),n.comment.os?(e.openBlock(),e.createElementBlock("span",{key:2,class:"wl-os","data-value":n.comment.os,textContent:e.toDisplayString(n.comment.os)},null,8,Ft)):e.createCommentVNode("v-if",!0)]),e.unref(h)?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"wl-content",innerHTML:n.comment.comment},null,8,Wt)),e.unref(p)&&!e.unref(h)?(e.openBlock(),e.createElementBlock("div",qt,[e.createElementVNode("span",Kt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,(l=>e.createElementVNode("button",{key:l,type:"submit",class:e.normalizeClass(`wl-btn wl-${l}`),disabled:n.comment.status===l,onClick:e=>t.$emit("status",{status:l,comment:n.comment}),textContent:e.toDisplayString(e.unref(s)[l])},null,10,Gt))),64))]),e.unref(p)&&!n.comment.rid?(e.openBlock(),e.createElementBlock("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:l[4]||(l[4]=e=>t.$emit("sticky",n.comment))},e.toDisplayString(n.comment.sticky?e.unref(s).unsticky:e.unref(s).sticky),1)):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0),e.unref(g)||e.unref(h)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass({"wl-reply-wrapper":e.unref(g),"wl-edit-wrapper":e.unref(h)})},[e.createVNode(Bt,{edit:n.edit,"reply-id":n.reply?.objectId,"reply-user":n.comment.nick,"root-id":n.rootId,onLog:l[5]||(l[5]=e=>t.$emit("log")),onCancelReply:l[6]||(l[6]=e=>t.$emit("reply",null)),onCancelEdit:l[7]||(l[7]=e=>t.$emit("edit",null)),onSubmit:l[8]||(l[8]=e=>t.$emit("submit",e))},null,8,["edit","reply-id","reply-user","root-id"])],2)):e.createCommentVNode("v-if",!0),n.comment.children?(e.openBlock(),e.createElementBlock("div",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.comment.children,(a=>(e.openBlock(),e.createBlock(o,{key:a.objectId,comment:a,reply:n.reply,edit:n.edit,"root-id":n.rootId,onLog:l[9]||(l[9]=e=>t.$emit("log")),onDelete:l[10]||(l[10]=e=>t.$emit("delete",e)),onEdit:l[11]||(l[11]=e=>t.$emit("edit",e)),onLike:l[12]||(l[12]=e=>t.$emit("like",e)),onReply:l[13]||(l[13]=e=>t.$emit("reply",e)),onStatus:l[14]||(l[14]=e=>t.$emit("status",e)),onSticky:l[15]||(l[15]=e=>t.$emit("sticky",e)),onSubmit:l[16]||(l[16]=e=>t.$emit("submit",e))},null,8,["comment","reply","edit","root-id"])))),128))])):e.createCommentVNode("v-if",!0)])],8,Lt)}}}),[["__file","CommentCard.vue"]]);const Yt="2.14.2",Xt={"data-waline":""},Qt={class:"wl-meta-head"},en={class:"wl-count"},tn=["textContent"],nn={class:"wl-sort"},ln=["onClick"],an={class:"wl-cards"},on={key:1,class:"wl-operation"},rn=["textContent"],cn={key:0,class:"wl-loading"},sn=["textContent"],un={key:2,class:"wl-operation"},mn=["textContent"],dn={key:3,class:"wl-power"},pn=e.createElementVNode("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);var vn=e.defineComponent({__name:"WalineComment",props:{serverURL:null,path:null,meta:null,requiredMeta:null,wordLimit:null,pageSize:null,lang:null,locale:null,commentSorting:null,dark:{type:[String,Boolean]},emoji:{type:[Array,Boolean]},search:{type:[Object,Boolean]},highlighter:{type:[Function,Boolean]},imageUploader:{type:[Function,Boolean]},texRenderer:{type:[Function,Boolean]},login:null,copyright:{type:Boolean},recaptchaV3Key:null,reaction:{type:[Array,Boolean]}},setup(n){const l=n,a={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},d=Object.keys(a),p=$e(),v=me(),h=e.ref("loading"),f=e.ref(0),y=e.ref(1),k=e.ref(0),w=e.computed((()=>(({serverURL:e,path:t=location.pathname,lang:n=i,locale:l,emoji:a=r,meta:d=["nick","mail","link"],requiredMeta:p=[],dark:v=!1,pageSize:h=10,wordLimit:f,imageUploader:y,highlighter:k,texRenderer:w,copyright:b=!0,login:C="enable",search:E,reaction:L,recaptchaV3Key:$="",commentSorting:V="latest",...N})=>({serverURL:I(e),path:x(t),locale:{...B[n]||B[i],..."object"==typeof l?l:{}},wordLimit:A(f),meta:o(d),requiredMeta:o(p),imageUploader:z(y,c),highlighter:z(k,g),texRenderer:z(w,s),lang:n,dark:v,emoji:"boolean"==typeof a?a?r:[]:a,pageSize:h,login:C,copyright:b,search:!1!==E&&("object"==typeof E?E:u(n)),recaptchaV3Key:$,reaction:Array.isArray(L)?L:!0===L?m:[],commentSorting:V,...N}))(l))),b=e.ref(w.value.commentSorting),C=e.ref([]),E=e.ref(null),L=e.ref(null),V=e.computed((()=>{return"string"==typeof(e=w.value.dark)?"auto"===e?`@media(prefers-color-scheme:dark){body${U}}`:`${e}${U}`:!0===e?`:root${U}`:"";var e})),N=e.computed((()=>w.value.locale));let R;t.useStyleTag(V);const j=e=>{const{serverURL:t,path:n,pageSize:l}=w.value,o=new AbortController;h.value="loading",R?.(),(({serverURL:e,lang:t,path:n,page:l,pageSize:a,sortBy:o,signal:r,token:i})=>{const c={};return i&&(c.Authorization=`Bearer ${i}`),fetch(`${e}/comment?path=${encodeURIComponent(n)}&pageSize=${a}&page=${l}&lang=${t}&sortBy=${o}`,{signal:r,headers:c}).then((e=>e.json())).then((e=>$(e,"Get comment data")))})({serverURL:t,lang:w.value.lang,path:n,pageSize:l,sortBy:a[b.value],page:e,signal:o.signal,token:p.value?.token}).then((t=>{h.value="success",f.value=t.count,C.value.push(...t.data),y.value=e,k.value=t.totalPages})).catch((e=>{"AbortError"!==e.name&&(console.error(e.message),h.value="error")})),R=o.abort.bind(o)},_=()=>j(y.value+1),D=()=>{f.value=0,C.value=[],j(1)},M=e=>{E.value=e},T=e=>{L.value=e},H=e=>{if(L.value)L.value.comment=e.comment,L.value.orig=e.orig;else if(e.rid){const t=C.value.find((({objectId:t})=>t===e.rid));if(!t)return;Array.isArray(t.children)||(t.children=[]),t.children.push(e)}else C.value.unshift(e)},O=async({comment:e,status:t})=>{if(e.status===t)return;const{serverURL:n,lang:l}=w.value;await S({serverURL:n,lang:l,token:p.value?.token,objectId:e.objectId,status:t}),e.status=t},P=async e=>{if(e.rid)return;const{serverURL:t,lang:n}=w.value;await S({serverURL:t,lang:n,token:p.value?.token,objectId:e.objectId,sticky:e.sticky?0:1}),e.sticky=!e.sticky},F=async({objectId:e})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:t,lang:n}=w.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())).then((e=>$(e,"Delete comment"))))({serverURL:t,lang:n,token:p.value?.token,objectId:e}),C.value.some(((t,n)=>t.objectId===e?(C.value=C.value.filter(((e,t)=>t!==n)),!0):t.children.some(((l,a)=>l.objectId===e&&(C.value[n].children=t.children.filter(((e,t)=>t!==a)),!0)))))},W=async e=>{const{serverURL:t,lang:n}=w.value,{objectId:l}=e,a=v.value.includes(l);await S({serverURL:t,lang:n,objectId:l,token:p.value?.token,like:!a}),a?v.value=v.value.filter((e=>e!==l)):(v.value=[...v.value,l],v.value.length>50&&(v.value=v.value.slice(-50))),e.like=(e.like||0)+(a?-1:1)};return e.provide("config",w),e.onMounted((()=>{e.watch((()=>[l.serverURL,l.path]),(()=>D()),{immediate:!0})})),e.onUnmounted((()=>R?.())),(t,n)=>(e.openBlock(),e.createElementBlock("div",Xt,[e.createVNode(_e),E.value?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(Bt,{key:0,onLog:D,onSubmit:H})),e.createElementVNode("div",Qt,[e.createElementVNode("div",en,[f.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wl-num",textContent:e.toDisplayString(f.value)},null,8,tn)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(N).comment),1)]),e.createElementVNode("ul",nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(t=>(e.openBlock(),e.createElementBlock("li",{key:t,class:e.normalizeClass([t===b.value?"active":""]),onClick:e=>(e=>{b.value!==e&&(b.value=e,D())})(t)},e.toDisplayString(e.unref(N)[t]),11,ln)))),128))])]),e.createElementVNode("div",an,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(t=>(e.openBlock(),e.createBlock(Jt,{key:t.objectId,"root-id":t.objectId,comment:t,reply:E.value,edit:L.value,onLog:D,onReply:M,onEdit:T,onSubmit:H,onStatus:O,onDelete:F,onSticky:P,onLike:W},null,8,["root-id","comment","reply","edit"])))),128))]),"error"===h.value?(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:D,textContent:e.toDisplayString(e.unref(N).refresh)},null,8,rn)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},["loading"===h.value?(e.openBlock(),e.createElementBlock("div",cn,[e.createVNode(e.unref(ce),{size:30})])):C.value.length?y.value<k.value?(e.openBlock(),e.createElementBlock("div",un,[e.createElementVNode("button",{type:"button",class:"wl-btn",onClick:_,textContent:e.toDisplayString(e.unref(N).more)},null,8,mn)])):e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:"wl-empty",textContent:e.toDisplayString(e.unref(N).sofa)},null,8,sn))],64)),e.unref(w).copyright?(e.openBlock(),e.createElementBlock("div",dn,[e.createTextVNode(" Powered by "),pn,e.createTextVNode(" v"+e.toDisplayString(e.unref(Yt)),1)])):e.createCommentVNode("v-if",!0)]))}}),gn=Ue(vn,[["__file","WalineComment.vue"]]);const hn=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))},fn=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:l=!0,lang:a="zh-CN"})=>{const o=new AbortController,r=Array.from(document.querySelectorAll(n)),i=e=>{const n=J(e);return null!==n&&t!==n},c=n=>(({serverURL:e,lang:t,paths:n,signal:l})=>V({serverURL:e,lang:t,paths:n,type:["time"],signal:l}).then((e=>Array.isArray(e)?e:[e])))({serverURL:I(e),paths:n.map((e=>J(e)||t)),lang:a,signal:o.signal}).then((e=>hn(e,n))).catch(H);if(l){const n=r.filter((e=>!i(e))),l=r.filter(i);(s={serverURL:I(e),path:t,lang:a},N({...s,type:"time",action:"inc"})).then((e=>hn(new Array(n.length).fill(e),n))),l.length&&c(l)}else c(r);var s;return o.abort.bind(o)};exports.RecentComments=({el:e,serverURL:t,count:n,lang:l="zh-CN"})=>{const a=$e(),o=O(e),r=new AbortController;return(({serverURL:e,lang:t,count:n,signal:l,token:a})=>{const o={};return a&&(o.Authorization=`Bearer ${a}`),fetch(`${e}/comment?type=recent&count=${n}&lang=${t}`,{signal:l,headers:o}).then((e=>e.json()))})({serverURL:t,count:n,lang:l,signal:r.signal,token:a.value?.token}).then((e=>o&&e.length?(o.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(),o.innerHTML=""}}):{comments:e,destroy:()=>r.abort()}))},exports.UserList=({el:e,serverURL:t,count:n,locale:l,lang:a=i,mode:o="list"})=>{const r=O(e),c=new AbortController;return(({serverURL:e,signal:t,pageSize:n,lang:l})=>fetch(`${e}/user?pageSize=${n}&lang=${l}`,{signal:t}).then((e=>e.json())).then((e=>$(e,"user list"))).then((e=>e.data)))({serverURL:t,pageSize:n,lang:a,signal:c.signal}).then((e=>r&&e.length?(l={...B[a]||B[i],..."object"==typeof l?l:{}},r.innerHTML=`<ul class="wl-user-${o}">${e.map(((e,t)=>[`<li class="wl-user-item" aria-label="${e.nick}">`,e.link&&`<a href="${e.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${e.avatar}" alt="${e.nick}">`,`<span class="wl-user-badge">${t+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',e.nick,e.level&&`<span class="wl-badge">${l?l[`level${e.level}`]:`Level ${e.level}`}</span>`,e.label&&`<span class="wl-badge">${e.label}</span>`,"</div>",e.link&&e.link,"</div>",e.link&&"</a>","</li>"].filter((e=>e)).join(""))).join("")}</ul>`,{users:e,destroy:()=>{c.abort(),r.innerHTML=""}}):{users:e,destroy:()=>c.abort()}))},exports.commentCount=Y,exports.defaultLocales=B,exports.init=({el:t="#waline",path:n=window.location.pathname,comment:l=!1,pageview:a=!1,...o})=>{const r=t?O(t):null;if(t&&!r)throw new Error("Option 'el' do not match any domElement!");if(!o.serverURL)throw new Error("Option 'serverURL' is missing!");const i=e.reactive({...o}),c=e.reactive({comment:l,pageview:a,path:n}),s=r?e.createApp((()=>e.h(gn,{path:c.path,...i}))):null;s&&s.mount(r);const u=e.watchEffect((()=>{c.comment&&Y({serverURL:i.serverURL,path:c.path,selector:"string"==typeof c.comment?c.comment:void 0})})),m=e.watchEffect((()=>{c.pageview&&fn({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,...l}={})=>{Object.entries(l).forEach((([e,t])=>{i[e]=t})),c.path=n,void 0!==e&&(c.comment=e),void 0!==t&&(c.pageview=t)},destroy:()=>{s?.unmount(),u(),m()}}},exports.pageviewCount=fn,exports.version=Yt;
|
|
2
2
|
//# sourceMappingURL=shim.cjs.map
|