@waline/client 3.5.0 → 3.5.1
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.js +1 -1
- package/dist/comment.js.map +1 -1
- package/dist/component.js +3 -3
- package/dist/component.js.map +1 -1
- package/dist/pageview.js +1 -1
- package/dist/pageview.js.map +1 -1
- package/dist/slim.d.ts +91 -50
- package/dist/slim.js +3 -3
- package/dist/slim.js.map +1 -1
- package/dist/waline.d.ts +91 -50
- package/dist/waline.js +2 -2
- package/dist/waline.js.map +1 -1
- package/dist/waline.umd.js +2 -2
- package/dist/waline.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/waline.d.ts
CHANGED
|
@@ -302,50 +302,6 @@ interface WalineProps {
|
|
|
302
302
|
* @more Setting `'auto'` will display darkmode due to device settings. Filling in CSS selector will enable darkmode only when the selector match waline ancestor nodes.
|
|
303
303
|
*/
|
|
304
304
|
dark?: string | boolean;
|
|
305
|
-
/**
|
|
306
|
-
* 设置表情包
|
|
307
|
-
*
|
|
308
|
-
* Set Emojis
|
|
309
|
-
*
|
|
310
|
-
* @default ['//unpkg.com/@waline/emojis@1.1.0/weibo']
|
|
311
|
-
*/
|
|
312
|
-
emoji?: (WalineEmojiInfo | WalineEmojiPresets)[] | 'built-in' | 'disabled';
|
|
313
|
-
/**
|
|
314
|
-
* 设置搜索功能
|
|
315
|
-
*
|
|
316
|
-
* Customize Search feature
|
|
317
|
-
*
|
|
318
|
-
* @default 'built-in'
|
|
319
|
-
*/
|
|
320
|
-
search?: WalineSearchOptions | 'built-in' | 'disabled';
|
|
321
|
-
/**
|
|
322
|
-
* 代码高亮
|
|
323
|
-
*
|
|
324
|
-
* Code highlighting
|
|
325
|
-
*
|
|
326
|
-
* @default 'built-in'
|
|
327
|
-
*/
|
|
328
|
-
highlighter?: WalineHighlighter | 'built-in' | 'disabled';
|
|
329
|
-
/**
|
|
330
|
-
* 自定义图片上传方法,方便更好的存储图片
|
|
331
|
-
*
|
|
332
|
-
* 方法执行时会将图片对象传入。
|
|
333
|
-
*
|
|
334
|
-
* Custom image upload callback to manage picture by yourself.
|
|
335
|
-
*
|
|
336
|
-
* We will pass a picture file object when execute it.
|
|
337
|
-
*
|
|
338
|
-
* @default 'built-in'
|
|
339
|
-
*/
|
|
340
|
-
imageUploader?: WalineImageUploader | 'built-in' | 'disabled';
|
|
341
|
-
/**
|
|
342
|
-
* 自定义数学公式处理方法,用于预览。
|
|
343
|
-
*
|
|
344
|
-
* Custom math formula parse callback for preview.
|
|
345
|
-
*
|
|
346
|
-
* @default 'built-in'
|
|
347
|
-
*/
|
|
348
|
-
texRenderer?: WalineTeXRenderer | 'built-in' | 'disabled';
|
|
349
305
|
/**
|
|
350
306
|
*
|
|
351
307
|
* 登录模式状态,可选值:
|
|
@@ -372,24 +328,65 @@ interface WalineProps {
|
|
|
372
328
|
*
|
|
373
329
|
* We strongly recommended you to keep it on to support waline
|
|
374
330
|
*
|
|
375
|
-
* @default false
|
|
376
331
|
*/
|
|
377
332
|
noCopyright?: boolean;
|
|
378
333
|
/**
|
|
334
|
+
* recaptcha v3 客户端 key
|
|
335
|
+
*
|
|
379
336
|
* recaptcha v3 client key
|
|
380
337
|
*/
|
|
381
338
|
recaptchaV3Key?: string;
|
|
382
339
|
/**
|
|
340
|
+
* turnstile 客户端 key
|
|
341
|
+
*
|
|
383
342
|
* turnstile client key
|
|
384
343
|
*/
|
|
385
344
|
turnstileKey?: string;
|
|
386
345
|
/**
|
|
387
|
-
*
|
|
346
|
+
* 文章反应
|
|
347
|
+
*
|
|
348
|
+
* Article reaction
|
|
349
|
+
*/
|
|
350
|
+
reaction?: string[];
|
|
351
|
+
/**
|
|
352
|
+
* 设置表情包
|
|
353
|
+
*
|
|
354
|
+
* Set Emojis
|
|
355
|
+
*
|
|
356
|
+
* @default ['//unpkg.com/@waline/emojis@1.1.0/weibo']
|
|
357
|
+
*/
|
|
358
|
+
emoji?: (WalineEmojiInfo | WalineEmojiPresets)[];
|
|
359
|
+
/**
|
|
360
|
+
* 设置搜索功能
|
|
361
|
+
*
|
|
362
|
+
* Customize Search feature
|
|
363
|
+
*/
|
|
364
|
+
search?: WalineSearchOptions;
|
|
365
|
+
/**
|
|
366
|
+
* 代码块高亮器
|
|
367
|
+
*
|
|
368
|
+
* Code fence highlighter
|
|
369
|
+
*/
|
|
370
|
+
highlighter?: WalineHighlighter;
|
|
371
|
+
/**
|
|
372
|
+
* 自定义图片上传方法,方便更好的存储图片
|
|
373
|
+
*
|
|
374
|
+
* 方法执行时会将图片对象传入。
|
|
375
|
+
*
|
|
376
|
+
* Custom image upload callback to manage picture by yourself.
|
|
377
|
+
*
|
|
378
|
+
* We will pass a picture file object when execute it.
|
|
379
|
+
*/
|
|
380
|
+
imageUploader?: WalineImageUploader;
|
|
381
|
+
/**
|
|
382
|
+
* 自定义数学公式处理方法,用于预览。
|
|
383
|
+
*
|
|
384
|
+
* Custom math formula parse callback for preview.
|
|
388
385
|
*/
|
|
389
|
-
|
|
386
|
+
texRenderer?: WalineTeXRenderer;
|
|
390
387
|
}
|
|
391
388
|
|
|
392
|
-
interface WalineInitOptions extends Omit<WalineProps, 'path'> {
|
|
389
|
+
interface WalineInitOptions extends Omit<WalineProps, 'path' | 'emoji' | 'search' | 'highlighter' | 'imageUploader' | 'texRenderer'> {
|
|
393
390
|
/**
|
|
394
391
|
* Waline 的初始化挂载器。必须是一个**有效的** CSS 选择器 或 HTML 元素
|
|
395
392
|
*
|
|
@@ -401,7 +398,7 @@ interface WalineInitOptions extends Omit<WalineProps, 'path'> {
|
|
|
401
398
|
*
|
|
402
399
|
* Comment number support
|
|
403
400
|
*
|
|
404
|
-
* @default
|
|
401
|
+
* @default true
|
|
405
402
|
*/
|
|
406
403
|
comment?: string | boolean;
|
|
407
404
|
/**
|
|
@@ -409,7 +406,7 @@ interface WalineInitOptions extends Omit<WalineProps, 'path'> {
|
|
|
409
406
|
*
|
|
410
407
|
* Pageview number support
|
|
411
408
|
*
|
|
412
|
-
* @default
|
|
409
|
+
* @default true
|
|
413
410
|
*/
|
|
414
411
|
pageview?: string | boolean;
|
|
415
412
|
/**
|
|
@@ -424,6 +421,50 @@ interface WalineInitOptions extends Omit<WalineProps, 'path'> {
|
|
|
424
421
|
* @default window.location.pathname
|
|
425
422
|
*/
|
|
426
423
|
path?: string;
|
|
424
|
+
/**
|
|
425
|
+
* 设置表情包
|
|
426
|
+
*
|
|
427
|
+
* Set Emojis
|
|
428
|
+
*
|
|
429
|
+
* @default ['//unpkg.com/@waline/emojis@1.1.0/weibo']
|
|
430
|
+
*/
|
|
431
|
+
emoji?: (WalineEmojiInfo | WalineEmojiPresets)[] | boolean;
|
|
432
|
+
/**
|
|
433
|
+
* 设置搜索功能
|
|
434
|
+
*
|
|
435
|
+
* Customize Search feature
|
|
436
|
+
*
|
|
437
|
+
* @default true
|
|
438
|
+
*/
|
|
439
|
+
search?: WalineSearchOptions | boolean;
|
|
440
|
+
/**
|
|
441
|
+
* 代码高亮
|
|
442
|
+
*
|
|
443
|
+
* Code highlighting
|
|
444
|
+
*
|
|
445
|
+
* @default true
|
|
446
|
+
*/
|
|
447
|
+
highlighter?: WalineHighlighter | boolean;
|
|
448
|
+
/**
|
|
449
|
+
* 自定义图片上传方法,方便更好的存储图片
|
|
450
|
+
*
|
|
451
|
+
* 方法执行时会将图片对象传入。
|
|
452
|
+
*
|
|
453
|
+
* Custom image upload callback to manage picture by yourself.
|
|
454
|
+
*
|
|
455
|
+
* We will pass a picture file object when execute it.
|
|
456
|
+
*
|
|
457
|
+
* @default true
|
|
458
|
+
*/
|
|
459
|
+
imageUploader?: WalineImageUploader | boolean;
|
|
460
|
+
/**
|
|
461
|
+
* 自定义数学公式处理方法,用于预览。
|
|
462
|
+
*
|
|
463
|
+
* Custom math formula parse callback for preview.
|
|
464
|
+
*
|
|
465
|
+
* @default true
|
|
466
|
+
*/
|
|
467
|
+
texRenderer?: WalineTeXRenderer | boolean;
|
|
427
468
|
}
|
|
428
469
|
type WalineAbort = (reason?: any) => void;
|
|
429
470
|
|
package/dist/waline.js
CHANGED
|
@@ -7,7 +7,7 @@ var _o=Object.defineProperty;var Co=(e,t,n)=>t in e?_o(e,t,{enumerable:!0,config
|
|
|
7
7
|
Номер текущего слова: $2`,"Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]),qs=Ke(["Tên","Tên không được nhỏ hơn 3 ký tự.","E-Mail","Vui lòng xác nhập địa chỉ email của bạn.","Website","Tùy chọn","Hãy bình luận có văn hoá!","Chưa có bình luận","Gửi","Thích","Bỏ thích","Trả lời","Hủy bỏ","bình luận","Làm mới","Tải thêm...","Xem trước","Emoji","Tải lên hình ảnh","giây trước","phút trước","giờ trước","ngày trước","Vừa xong","Đang tải lên","Đăng nhập","đăng xuất","Quản trị viên","Dính","từ",`Bình luận phải có độ dài giữa $0 và $1 từ!
|
|
8
8
|
Số từ hiện tại: $2`,"Vô danh","Người lùn","Người tí hon","Thần rừng","Pháp sư","Tiên tộc","Maiar","Ảnh GIF","Tìm kiếm ảnh GIF","thông tin cá nhân","Đã được phê duyệt","Đang chờ đợi","Thư rác","Không dính","lâu đời nhất","muộn nhất","nóng nhất","What do you think?"]),Ks=Ke(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字",`评论字数应在 $0 到 $1 字之间!
|
|
9
9
|
当前字数:$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),Do=Ke(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎留言","來發留言吧~","送出","喜歡","取消喜歡","回覆","取消回覆","留言","重整","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登入","登出","管理者","置頂","字",`留言字數應在 $0 到 $1 字之間!
|
|
10
|
-
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const Gs="en-US",jn={zh:Ks,"zh-cn":Ks,"zh-tw":Do,en:Us,"en-us":Us,fr:Bs,"fr-fr":Bs,jp:Vs,"jp-jp":Vs,"pt-br":Fo,ru:Ws,"ru-ru":Ws,vi:qs,"vi-vn":qs,de:zo,es:Ns,"es-mx":Ns},Zs=e=>jn[e.toLowerCase()]||jn[Gs.toLowerCase()],Js=e=>Object.keys(jn).includes(e.toLowerCase())?e:Gs,Ys={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},Ho=Object.keys(Ys),zn=Symbol("waline-config"),Qs=e=>{try{e=decodeURI(e)}catch{}return e},Xs=(e="")=>e.replace(/\/$/u,""),ei=e=>/^(https?:)?\/\//.test(e),Fn=e=>{const t=Xs(e);return ei(t)?t:`https://${t}`},Uo=e=>Array.isArray(e)?e:e?[0,e]:!1,jt=(e,t)=>e
|
|
10
|
+
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const Gs="en-US",jn={zh:Ks,"zh-cn":Ks,"zh-tw":Do,en:Us,"en-us":Us,fr:Bs,"fr-fr":Bs,jp:Vs,"jp-jp":Vs,"pt-br":Fo,ru:Ws,"ru-ru":Ws,vi:qs,"vi-vn":qs,de:zo,es:Ns,"es-mx":Ns},Zs=e=>jn[e.toLowerCase()]||jn[Gs.toLowerCase()],Js=e=>Object.keys(jn).includes(e.toLowerCase())?e:Gs,Ys={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},Ho=Object.keys(Ys),zn=Symbol("waline-config"),Qs=e=>{try{e=decodeURI(e)}catch{}return e},Xs=(e="")=>e.replace(/\/$/u,""),ei=e=>/^(https?:)?\/\//.test(e),Fn=e=>{const t=Xs(e);return ei(t)?t:`https://${t}`},Uo=e=>Array.isArray(e)?e:e?[0,e]:!1,jt=(e,t)=>e==null||e===!0?t:e===!1?null:e,No=({serverURL:e,path:t=location.pathname,lang:n=typeof navigator>"u"?"en-US":navigator.language,locale:r,meta:s=["nick","mail","link"],requiredMeta:i=[],dark:l=!1,pageSize:o=10,wordLimit:a,noCopyright:c=!1,login:u="enable",recaptchaV3Key:f="",turnstileKey:p="",commentSorting:g="latest",emoji:x=Ds,imageUploader:b,highlighter:T,texRenderer:k,search:_,reaction:N,...L})=>({serverURL:Fn(e),path:Qs(t),lang:Js(n),locale:{...Zs(Js(n)),...typeof r=="object"?r:{}},wordLimit:Uo(a),meta:Fs(s),requiredMeta:Fs(i),dark:l,pageSize:o,commentSorting:g,login:u,noCopyright:c,recaptchaV3Key:f,turnstileKey:p,...L,reaction:jt(N,$o),imageUploader:jt(b,Ro),highlighter:jt(T,Oo),texRenderer:jt(k,Ao),emoji:jt(x,Ds),search:jt(_,Eo(n))}),zt=e=>typeof e=="string",$r="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bg-color:#1e1e1e;--waline-bg-color-light:#272727;--waline-bg-color-hover: #444;--waline-border-color:#333;--waline-disable-bg-color:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bg-color:#272727;--waline-info-color:#666}",Bo=e=>zt(e)?e==="auto"?`@media(prefers-color-scheme:dark){body${$r}}`:`${e}${$r}`:e===!0?`:root${$r}`:"",Rr=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},Vo=e=>{const t=Rr(e.getDate(),2),n=Rr(e.getMonth()+1,2);return`${Rr(e.getFullYear(),2)}-${n}-${t}`},Wo=(e,t,n)=>{if(!e)return"";const r=zt(e)?new Date(e.includes(" ")?e.replace(/-/g,"/"):e):e,s=t.getTime()-r.getTime(),i=Math.floor(s/(24*3600*1e3));if(i===0){const l=s%864e5,o=Math.floor(l/(3600*1e3));if(o===0){const a=l%36e5,c=Math.floor(a/(60*1e3));if(c===0){const u=a%6e4;return`${Math.round(u/1e3)} ${n.seconds}`}return`${c} ${n.minutes}`}return`${o} ${n.hours}`}return i<0?n.now:i<8?`${i} ${n.days}`:Vo(r)},qo=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ko=e=>qo.test(e);/**
|
|
11
11
|
* @vue/shared v3.5.13
|
|
12
12
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
13
|
* @license MIT
|
|
@@ -80,5 +80,5 @@ ${t}</tr>
|
|
|
80
80
|
`+this.renderer.text(c);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{const c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(t,n=this.renderer){var s,i;let r="";for(let l=0;l<t.length;l++){const o=t[l];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[o.type]){const c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=c||"";continue}}const a=o;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}}class An{options;block;constructor(t){this.options=t||Lt}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Ue.lex:Ue.lexInline}provideParser(){return this.block?Ne.parse:Ne.parseInline}}Rs(An,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class to{defaults=ps();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ne;Renderer=kr;TextRenderer=xs;Lexer=Ue;Tokenizer=wr;Hooks=An;constructor(...t){this.use(...t)}walkTokens(t,n){var s,i;let r=[];for(const l of t)switch(r=r.concat(n.call(this,l)),l.type){case"table":{const o=l;for(const a of o.header)r=r.concat(this.walkTokens(a.tokens,n));for(const a of o.rows)for(const c of a)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{const o=l;r=r.concat(this.walkTokens(o.items,n));break}default:{const o=l;(i=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&i[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{const c=o[a].flat(1/0);r=r.concat(this.walkTokens(c,n))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,n)))}}return r}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const l=n.renderers[i.name];l?n.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=l.apply(this,o)),a}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=n[i.level];l?l.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),s.extensions=n),r.renderer){const i=this.defaults.renderer||new kr(this.defaults);for(const l in r.renderer){if(!(l in i))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;const o=l,a=r.renderer[o],c=i[o];i[o]=(...u)=>{let f=a.apply(i,u);return f===!1&&(f=c.apply(i,u)),f||""}}s.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new wr(this.defaults);for(const l in r.tokenizer){if(!(l in i))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const o=l,a=r.tokenizer[o],c=i[o];i[o]=(...u)=>{let f=a.apply(i,u);return f===!1&&(f=c.apply(i,u)),f}}s.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new An;for(const l in r.hooks){if(!(l in i))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;const o=l,a=r.hooks[o],c=i[o];An.passThroughHooks.has(l)?i[o]=u=>{if(this.defaults.async)return Promise.resolve(a.call(i,u)).then(p=>c.call(i,p));const f=a.call(i,u);return c.call(i,f)}:i[o]=(...u)=>{let f=a.apply(i,u);return f===!1&&(f=c.apply(i,u)),f}}s.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,l=r.walkTokens;s.walkTokens=function(o){let a=[];return a.push(l.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Ue.lex(t,n??this.defaults)}parser(t,n){return Ne.parse(t,n??this.defaults)}parseMarkdown(t){return(r,s)=>{const i={...s},l={...this.defaults,...i},o=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));l.hooks&&(l.hooks.options=l,l.hooks.block=t);const a=l.hooks?l.hooks.provideLexer():t?Ue.lex:Ue.lexInline,c=l.hooks?l.hooks.provideParser():t?Ne.parse:Ne.parseInline;if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(r):r).then(u=>a(u,l)).then(u=>l.hooks?l.hooks.processAllTokens(u):u).then(u=>l.walkTokens?Promise.all(this.walkTokens(u,l.walkTokens)).then(()=>u):u).then(u=>c(u,l)).then(u=>l.hooks?l.hooks.postprocess(u):u).catch(o);try{l.hooks&&(r=l.hooks.preprocess(r));let u=a(r,l);l.hooks&&(u=l.hooks.processAllTokens(u)),l.walkTokens&&this.walkTokens(u,l.walkTokens);let f=c(u,l);return l.hooks&&(f=l.hooks.postprocess(f)),f}catch(u){return o(u)}}}onError(t,n){return r=>{if(r.message+=`
|
|
81
81
|
Please report this to https://github.com/markedjs/marked.`,t){const s="<p>An error occurred:</p><pre>"+Qe(r.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(r);throw r}}}const It=new to;function fe(e,t){return It.parse(e,t)}fe.options=fe.setOptions=function(e){return It.setOptions(e),fe.defaults=It.defaults,Dl(fe.defaults),fe},fe.getDefaults=ps,fe.defaults=Lt,fe.use=function(...e){return It.use(...e),fe.defaults=It.defaults,Dl(fe.defaults),fe},fe.walkTokens=function(e,t){return It.walkTokens(e,t)},fe.parseInline=It.parseInline,fe.Parser=Ne,fe.parser=Ne.parse,fe.Renderer=kr,fe.TextRenderer=xs,fe.Lexer=Ue,fe.lexer=Ue.lex,fe.Tokenizer=wr,fe.Hooks=An,fe.parse=fe;function gf(e){if(typeof e=="function"&&(e={highlight:e}),!e||typeof e.highlight!="function")throw new Error("Must provide highlight function");return typeof e.langPrefix!="string"&&(e.langPrefix="language-"),typeof e.emptyLangClass!="string"&&(e.emptyLangClass=""),{async:!!e.async,walkTokens(t){if(t.type!=="code")return;const n=no(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(ro(t));const r=e.highlight(t.text,n,t.lang||"");if(r instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");ro(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const s=no(n),i=s?e.langPrefix+oo(s):e.emptyLangClass,l=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${l}>${r?t:oo(t,!0)}
|
|
82
82
|
</code></pre>`}}}}function no(e){return(e||"").match(/\S*/)[0]}function ro(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const so=/[&<>"']/,mf=new RegExp(so.source,"g"),io=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,vf=new RegExp(io.source,"g"),bf={"&":"&","<":"<",">":">",'"':""","'":"'"},lo=e=>bf[e];function oo(e,t){if(t){if(so.test(e))return e.replace(mf,lo)}else if(io.test(e))return e.replace(vf,lo);return e}const yf=/\$.*?\$/,wf=/^\$(.*?)\$/,kf=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,xf=e=>[{name:"blockMath",level:"block",tokenizer(t){const n=kf.exec(t);if(n!==null)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(t){const n=t.search(yf);return n!==-1?n:t.length},tokenizer(t){const n=wf.exec(t);if(n!==null)return{type:"html",raw:n[0],text:e(!1,n[1])}}}],ao=(e="",t={})=>e.replace(/:(.+?):/g,(n,r)=>t[r]?`<img class="wl-emoji" src="${t[r]}" alt="${r}">`:n),_f=(e,{emojiMap:t,highlighter:n,texRenderer:r})=>{const s=new to;if(s.setOptions({breaks:!0}),n&&s.use(gf({highlight:n})),r){const i=xf(r);s.use({extensions:i})}return s.parse(ao(e,t))},_s=e=>{const{path:t}=e.dataset;return t!=null&&t.length?t:null},Cf=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),Sf=e=>e.match(/[\u4E00-\u9FD5]/gu),$f=e=>{var t,n;return(((t=Cf(e))==null?void 0:t.reduce((r,s)=>r+(["",",","."].includes(s.trim())?0:s.trim().split(/\s+/u).length),0))??0)+(((n=Sf(e))==null?void 0:n.length)??0)},Rf=async()=>{const{userAgentData:e}=navigator;let t=navigator.userAgent;if(!e||e.platform!=="Windows")return t;const{platformVersion:n}=await e.getHighEntropyValues(["platformVersion"]);return n&&parseInt(n.split(".")[0])>=13&&(t=t.replace("Windows NT 10.0","Windows NT 11.0")),t},co=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:r=navigator.language})=>{const s=new AbortController,i=document.querySelectorAll(n);return i.length&&Is({serverURL:Fn(e),paths:Array.from(i).map(l=>Qs(_s(l)??t)),lang:r,signal:s.signal}).then(l=>{i.forEach((o,a)=>{o.innerText=l[a].toString()})}).catch(zl),s.abort.bind(s)},uo=({size:e})=>ne("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[ne("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"}),ne("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"})]),Af=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},ne("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"})),Ef=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},ne("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"})),Tf=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[ne("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"}),ne("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"})]),Lf=({active:e=!1})=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[ne("path",{d:`M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z${e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"}`,fill:e?"red":"currentColor"})]),If=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[ne("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"}),ne("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"})]),Mf=()=>ne("svg",{width:"16",height:"16",ariaHidden:"true"},ne("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"})),Pf=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},ne("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"})),Of=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},ne("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"})),jf=()=>ne("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},ne("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"})),En=({size:e=100})=>ne("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},ne("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},ne("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),zf=()=>ne("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[ne("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"}),ne("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"})]),Ff=()=>Zt("WALINE_USER_META",{nick:"",mail:"",link:""}),Df=()=>Zt("WALINE_COMMENT_BOX_EDITOR",""),Hf="WALINE_LIKE",Uf=Zt(Hf,[]),fo=()=>Uf,Nf="WALINE_REACTION",Bf=Zt(Nf,{}),Vf=()=>Bf;var Cs={},mt={},Mt={},ho;function po(){if(ho)return Mt;ho=1;var e=Mt.__awaiter||function(r,s,i,l){function o(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function u(g){try{p(l.next(g))}catch(x){c(x)}}function f(g){try{p(l.throw(g))}catch(x){c(x)}}function p(g){g.done?a(g.value):o(g.value).then(u,f)}p((l=l.apply(r,s||[])).next())})},t=Mt.__generator||function(r,s){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},l,o,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(p){return function(g){return f([p,g])}}function f(p){if(l)throw new TypeError("Generator is already executing.");for(;c&&(c=0,p[0]&&(i=0)),i;)try{if(l=1,o&&(a=p[0]&2?o.return:p[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,p[1])).done)return a;switch(o=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,o=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){i.label=p[1];break}if(p[0]===6&&i.label<a[1]){i.label=a[1],a=p;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(p);break}a[2]&&i.ops.pop(),i.trys.pop();continue}p=s.call(r,i)}catch(g){p=[6,g],o=0}finally{l=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.ReCaptchaInstance=void 0;var n=function(){function r(s,i,l){this.siteKey=s,this.recaptchaID=i,this.recaptcha=l,this.styleContainer=null}return r.prototype.execute=function(s){return e(this,void 0,void 0,function(){var i;return t(this,function(l){switch(l.label){case 0:return this.recaptcha.enterprise?[4,this.recaptcha.enterprise.execute(this.recaptchaID,{action:s})]:[3,2];case 1:return i=l.sent(),[3,4];case 2:return[4,this.recaptcha.execute(this.recaptchaID,{action:s})];case 3:i=l.sent(),l.label=4;case 4:return[2,i]}})})},r.prototype.getSiteKey=function(){return this.siteKey},r.prototype.hideBadge=function(){this.styleContainer===null&&(this.styleContainer=document.createElement("style"),this.styleContainer.innerHTML=".grecaptcha-badge{visibility:hidden !important;}",document.head.appendChild(this.styleContainer))},r.prototype.showBadge=function(){this.styleContainer!==null&&(document.head.removeChild(this.styleContainer),this.styleContainer=null)},r}();return Mt.ReCaptchaInstance=n,Mt}var go;function Wf(){if(go)return mt;go=1;var e=mt.__assign||function(){return e=Object.assign||function(s){for(var i,l=1,o=arguments.length;l<o;l++){i=arguments[l];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(s[a]=i[a])}return s},e.apply(this,arguments)};Object.defineProperty(mt,"__esModule",{value:!0}),mt.getInstance=mt.load=void 0;var t=po(),n;(function(s){s[s.NOT_LOADED=0]="NOT_LOADED",s[s.LOADING=1]="LOADING",s[s.LOADED=2]="LOADED"})(n||(n={}));var r=function(){function s(){}return s.load=function(i,l){if(l===void 0&&(l={}),typeof document>"u")return Promise.reject(new Error("This is a library for the browser!"));if(s.getLoadingState()===n.LOADED)return s.instance.getSiteKey()===i?Promise.resolve(s.instance):Promise.reject(new Error("reCAPTCHA already loaded with different site key!"));if(s.getLoadingState()===n.LOADING)return i!==s.instanceSiteKey?Promise.reject(new Error("reCAPTCHA already loaded with different site key!")):new Promise(function(a,c){s.successfulLoadingConsumers.push(function(u){return a(u)}),s.errorLoadingRunnable.push(function(u){return c(u)})});s.instanceSiteKey=i,s.setLoadingState(n.LOADING);var o=new s;return new Promise(function(a,c){o.loadScript(i,l.useRecaptchaNet||!1,l.useEnterprise||!1,l.renderParameters?l.renderParameters:{},l.customUrl).then(function(){s.setLoadingState(n.LOADED);var u=o.doExplicitRender(grecaptcha,i,l.explicitRenderParameters?l.explicitRenderParameters:{},l.useEnterprise||!1),f=new t.ReCaptchaInstance(i,u,grecaptcha);s.successfulLoadingConsumers.forEach(function(p){return p(f)}),s.successfulLoadingConsumers=[],l.autoHideBadge&&f.hideBadge(),s.instance=f,a(f)}).catch(function(u){s.errorLoadingRunnable.forEach(function(f){return f(u)}),s.errorLoadingRunnable=[],c(u)})})},s.getInstance=function(){return s.instance},s.setLoadingState=function(i){s.loadingState=i},s.getLoadingState=function(){return s.loadingState===null?n.NOT_LOADED:s.loadingState},s.prototype.loadScript=function(i,l,o,a,c){var u=this;l===void 0&&(l=!1),o===void 0&&(o=!1),a===void 0&&(a={}),c===void 0&&(c="");var f=document.createElement("script");f.setAttribute("recaptcha-v3-script",""),f.setAttribute("async",""),f.setAttribute("defer","");var p="https://www.google.com/recaptcha/api.js";l?o?p="https://recaptcha.net/recaptcha/enterprise.js":p="https://recaptcha.net/recaptcha/api.js":o&&(p="https://www.google.com/recaptcha/enterprise.js"),c&&(p=c),a.render&&(a.render=void 0);var g=this.buildQueryString(a);return f.src=p+"?render=explicit"+g,new Promise(function(x,b){f.addEventListener("load",u.waitForScriptToLoad(function(){x(f)},o),!1),f.onerror=function(T){s.setLoadingState(n.NOT_LOADED),b(T)},document.head.appendChild(f)})},s.prototype.buildQueryString=function(i){var l=Object.keys(i);return l.length<1?"":"&"+Object.keys(i).filter(function(o){return!!i[o]}).map(function(o){return o+"="+i[o]}).join("&")},s.prototype.waitForScriptToLoad=function(i,l){var o=this;return function(){window.grecaptcha===void 0?setTimeout(function(){o.waitForScriptToLoad(i,l)},s.SCRIPT_LOAD_DELAY):l?window.grecaptcha.enterprise.ready(function(){i()}):window.grecaptcha.ready(function(){i()})}},s.prototype.doExplicitRender=function(i,l,o,a){var c=e({sitekey:l},o);return o.container?a?i.enterprise.render(o.container,c):i.render(o.container,c):a?i.enterprise.render(c):i.render(c)},s.loadingState=null,s.instance=null,s.instanceSiteKey=null,s.successfulLoadingConsumers=[],s.errorLoadingRunnable=[],s.SCRIPT_LOAD_DELAY=25,s}();return mt.load=r.load,mt.getInstance=r.getInstance,mt}var mo;function qf(){return mo||(mo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReCaptchaInstance=e.getInstance=e.load=void 0;var t=Wf();Object.defineProperty(e,"load",{enumerable:!0,get:function(){return t.load}}),Object.defineProperty(e,"getInstance",{enumerable:!0,get:function(){return t.getInstance}});var n=po();Object.defineProperty(e,"ReCaptchaInstance",{enumerable:!0,get:function(){return n.ReCaptchaInstance}})}(Cs)),Cs}var Kf=qf();const vo={},Gf=e=>{const t=vo[e]??(vo[e]=Kf.load(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:n=>t.then(r=>r.execute(n))}},Zf=e=>({execute:async t=>{const{load:n}=$u("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await n();const r=window.turnstile;return new Promise(s=>{r==null||r.ready(()=>{r.render(".wl-captcha-container",{sitekey:e,action:t,size:"compact",callback:s})})})}}),Jf="WALINE_USER",Yf=Zt(Jf,{}),xr=()=>Yf,Qf={key:0,class:"wl-reaction"},Xf=["textContent"],eh={class:"wl-reaction-list"},th=["onClick"],nh={class:"wl-reaction-img"},rh=["src","alt"],sh=["textContent"],ih=["textContent"];var lh=dn({__name:"ArticleReaction",setup(e){const t=Vf(),n=er(zn),r=Y(-1),s=Y([]),i=ge(()=>n.value.locale),l=ge(()=>n.value.reaction.length>0),o=ge(()=>{const{reaction:f,path:p}=n.value;return f.length?f.map((g,x)=>({icon:g,desc:i.value[`reaction${x}`],active:t.value[p]===x})):null});let a;const c=async()=>{if(!l.value)return;const{serverURL:f,lang:p,path:g,reaction:x}=n.value,b=new AbortController;a=b.abort.bind(b);const[T]=await Cr({serverURL:f,lang:p,paths:[g],type:x.map((k,_)=>`reaction${_}`),signal:b.signal});s.value=x.map((k,_)=>T[`reaction${_}`])},u=async f=>{if(r.value!==-1)return;const{serverURL:p,lang:g,path:x}=n.value,b=t.value[x];r.value=f,b!==void 0&&(await On({serverURL:p,lang:g,path:x,type:`reaction${b}`,action:"desc"}),s.value[b]=Math.max(s.value[b]-1,0)),b!==f&&(await On({serverURL:p,lang:g,path:x,type:`reaction${f}`}),s.value[f]=(s.value[f]||0)+1),b===f?delete t.value[x]:t.value[x]=f,r.value=-1};return gn(()=>{_n(()=>[n.value.serverURL,n.value.path],()=>c())}),Qr(()=>{a==null||a()}),(f,p)=>o.value?(I(),P("div",Qf,[F("div",{class:"wl-reaction-title",textContent:X(i.value.reactionTitle)},null,8,Xf),F("ul",eh,[(I(!0),P(ue,null,je(o.value,({active:g,icon:x,desc:b},T)=>(I(),P("li",{key:T,class:pe(["wl-reaction-item",{active:g}]),onClick:k=>u(T)},[F("div",nh,[F("img",{src:x,alt:b},null,8,rh),r.value===T?(I(),lt(G(En),{key:0,class:"wl-reaction-loading"})):(I(),P("div",{key:1,class:"wl-reaction-votes",textContent:X(s.value[T]||0)},null,8,sh))]),F("div",{class:"wl-reaction-text",textContent:X(b)},null,8,ih)],10,th))),128))])])):Q("v-if",!0)}}),Tn=new Map;function oh(e){var t=Tn.get(e);t&&t.destroy()}function ah(e){var t=Tn.get(e);t&&t.update()}var Ln=null;typeof window>"u"?((Ln=function(e){return e}).destroy=function(e){return e},Ln.update=function(e){return e}):((Ln=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(n){return function(r){if(r&&r.nodeName&&r.nodeName==="TEXTAREA"&&!Tn.has(r)){var s,i=null,l=window.getComputedStyle(r),o=(s=r.value,function(){c({testForHeightReduction:s===""||!r.value.startsWith(s),restoreTextAlign:null}),s=r.value}),a=(function(f){r.removeEventListener("autosize:destroy",a),r.removeEventListener("autosize:update",u),r.removeEventListener("input",o),window.removeEventListener("resize",u),Object.keys(f).forEach(function(p){return r.style[p]=f[p]}),Tn.delete(r)}).bind(r,{height:r.style.height,resize:r.style.resize,textAlign:r.style.textAlign,overflowY:r.style.overflowY,overflowX:r.style.overflowX,wordWrap:r.style.wordWrap});r.addEventListener("autosize:destroy",a),r.addEventListener("autosize:update",u),r.addEventListener("input",o),window.addEventListener("resize",u),r.style.overflowX="hidden",r.style.wordWrap="break-word",Tn.set(r,{destroy:a,update:u}),u()}function c(f){var p,g,x=f.restoreTextAlign,b=x===void 0?null:x,T=f.testForHeightReduction,k=T===void 0||T,_=l.overflowY;if(r.scrollHeight!==0&&(l.resize==="vertical"?r.style.resize="none":l.resize==="both"&&(r.style.resize="horizontal"),k&&(p=function(L){for(var O=[];L&&L.parentNode&&L.parentNode instanceof Element;)L.parentNode.scrollTop&&O.push([L.parentNode,L.parentNode.scrollTop]),L=L.parentNode;return function(){return O.forEach(function(K){var j=K[0],J=K[1];j.style.scrollBehavior="auto",j.scrollTop=J,j.style.scrollBehavior=null})}}(r),r.style.height=""),g=l.boxSizing==="content-box"?r.scrollHeight-(parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)):r.scrollHeight+parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth),l.maxHeight!=="none"&&g>parseFloat(l.maxHeight)?(l.overflowY==="hidden"&&(r.style.overflow="scroll"),g=parseFloat(l.maxHeight)):l.overflowY!=="hidden"&&(r.style.overflow="hidden"),r.style.height=g+"px",b&&(r.style.textAlign=b),p&&p(),i!==g&&(r.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),i=g),_!==l.overflow&&!b)){var N=l.textAlign;l.overflow==="hidden"&&(r.style.textAlign=N==="start"?"end":"start"),c({restoreTextAlign:N,testForHeightReduction:!0})}}function u(){c({testForHeightReduction:!0,restoreTextAlign:null})}}(n)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],oh),e},Ln.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],ah),e});var bo=Ln;const ch=["data-index"],uh=["src","title","onClick"];var fh=dn({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e){const t=e;let n=null;const r=dt("wall"),s=Y({}),i=Y([]),l=()=>{const f=Math.floor((r.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return f>0?f:1},o=f=>new Array(f).fill(null).map(()=>[]),a=async f=>{var p;if(f>=t.items.length)return;await Wt();const g=Array.from(((p=r.value)==null?void 0:p.children)??[]).reduce((x,b)=>b.getBoundingClientRect().height<x.getBoundingClientRect().height?b:x);i.value[Number(g.dataset.index)].push(f),await a(f+1)},c=async(f=!1)=>{if(i.value.length===l()&&!f)return;i.value=o(l());const p=window.scrollY;await a(0),window.scrollTo({top:p})},u=f=>{s.value[f.target.src]=!0};return gn(()=>{c(!0),n=new ResizeObserver(()=>{c()}),n.observe(r.value),it(()=>[t.items],()=>{s.value={},c(!0)}),it(()=>[t.columnWidth,t.gap],()=>{c()})}),Ba(()=>{n.unobserve(r.value)}),(f,p)=>(I(),P("div",{ref_key:"wall",ref:r,class:"wl-gallery",style:nn({gap:`${f.gap}px`})},[(I(!0),P(ue,null,je(i.value,(g,x)=>(I(),P("div",{key:x,class:"wl-gallery-column","data-index":x,style:nn({gap:`${f.gap}px`})},[(I(!0),P(ue,null,je(g,b=>(I(),P(ue,{key:b},[s.value[f.items[b].src]?Q("v-if",!0):(I(),lt(G(En),{key:0,size:36,style:{margin:"20px auto"}})),F("img",{class:"wl-gallery-item",src:f.items[b].src,title:f.items[b].title,loading:"lazy",onLoad:u,onClick:T=>f.$emit("insert",``)},null,40,uh)],64))),128))],12,ch))),128))],4))}});const hh={key:0,class:"wl-login-info"},dh={class:"wl-avatar"},ph=["title"],gh=["title"],mh=["src"],vh=["title","textContent"],bh={class:"wl-panel"},yh=["for","textContent"],wh=["id","onUpdate:modelValue","name","type"],kh=["placeholder"],xh={class:"wl-preview"},_h=["innerHTML"],Ch={class:"wl-footer"},Sh={class:"wl-actions"},$h={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},Rh=["title"],Ah=["title"],Eh=["title","aria-label"],Th=["title"],Lh={class:"wl-info"},Ih={class:"wl-text-number"},Mh={key:0},Ph=["textContent"],Oh=["textContent"],jh=["disabled"],zh=["placeholder"],Fh={key:1,class:"wl-loading"},Dh={key:0,class:"wl-tab-wrapper"},Hh=["title","onClick"],Uh=["src","alt"],Nh={key:0,class:"wl-tabs"},Bh=["onClick"],Vh=["src","alt","title"],Wh=["title"];var yo=dn({__name:"CommentBox",props:{edit:{},rootId:{},replyId:{},replyUser:{}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{emit:t}){const n=e,r=t,s=er(zn),i=Df(),l=Ff(),o=xr(),a=Y({}),c=dt("textarea"),u=dt("image-uploader"),f=dt("emoji-button"),p=dt("emoji-popup"),g=dt("gif-button"),x=dt("gif-popup"),b=dt("gif-search"),T=Y({tabs:[],map:{}}),k=Y(0),_=Y(!1),N=Y(!1),L=Y(!1),O=Y(""),K=Y(0),j=cn({loading:!0,list:[]}),J=Y(0),me=Y(!1),Be=Y(""),E=Y(!1),V=Y(!1),D=ge(()=>s.value.locale),de=ge(()=>!!o.value.token),ye=ge(()=>au(s.value.imageUploader)),ve=z=>{const R=c.value,W=R.selectionStart,h=R.selectionEnd||0,d=R.scrollTop;i.value=R.value.substring(0,W)+z+R.value.substring(h,R.value.length),R.focus(),R.selectionStart=W+z.length,R.selectionEnd=W+z.length,R.scrollTop=d},Xe=({key:z,ctrlKey:R,metaKey:W})=>{E.value||(R||W)&&z==="Enter"&&Fe()},ut=async z=>{const R=`![${s.value.locale.uploading} ${z.name}]()`;ve(R),E.value=!0;try{const W=await s.value.imageUploader(z);i.value=i.value.replace(R,`\r
|
|
83
|
-
`)}catch(W){alert(W.message),i.value=i.value.replace(R,"")}finally{E.value=!1}},Jt=z=>{var R;if((R=z.dataTransfer)!=null&&R.items){const W=Fl(z.dataTransfer.items);W&&ye.value&&(ut(W),z.preventDefault())}},In=z=>{if(z.clipboardData){const R=Fl(z.clipboardData.items);R&&ye.value&&ut(R)}},Pt=()=>{const z=u.value;z.files&&ye.value&&ut(z.files[0]).then(()=>{z.value=""})},Fe=async()=>{var z;const{serverURL:R,lang:W,login:h,wordLimit:d,requiredMeta:m,recaptchaV3Key:y,turnstileKey:w}=s.value,v={comment:Be.value,nick:l.value.nick,mail:l.value.mail,link:l.value.link,url:s.value.path,ua:await Rf()};if(!n.edit)if(o.value.token)v.nick=o.value.display_name,v.mail=o.value.email,v.link=o.value.url;else{if(h==="force")return;if(m.includes("nick")&&!v.nick){a.value.nick.focus(),alert(D.value.nickError);return}if(m.includes("mail")&&!v.mail||v.mail&&!Ko(v.mail)){a.value.mail.focus(),alert(D.value.mailError);return}v.nick||(v.nick=D.value.anonymous)}if(!v.comment){c.value.focus();return}if(!me.value){alert(D.value.wordHint.replace("$0",d[0].toString()).replace("$1",d[1].toString()).replace("$2",K.value.toString()));return}v.comment=ao(v.comment,T.value.map),n.replyId&&n.rootId&&(v.pid=n.replyId,v.rid=n.rootId,v.at=n.replyUser),E.value=!0;try{y&&(v.recaptchaV3=await Gf(y).execute("social")),w&&(v.turnstile=await Zf(w).execute("social"));const A={serverURL:R,lang:W,token:o.value.token,comment:v},S=await(n.edit?Qt({objectId:n.edit.objectId,...A}):Ts(A));if(E.value=!1,S.errmsg){alert(S.errmsg);return}r("submit",S.data),i.value="",O.value="",await Wt(),n.replyId&&r("cancelReply"),(z=n.edit)!=null&&z.objectId&&r("cancelEdit")}catch(A){E.value=!1,alert(A.message)}},Mn=z=>{z.preventDefault();const{lang:R,serverURL:W}=s.value;Ms({serverURL:W,lang:R}).then(h=>{o.value=h,(h.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(h)),r("log")})},_r=()=>{o.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),r("log")},Pn=z=>{z.preventDefault();const{lang:R,serverURL:W}=s.value,h=800,d=800,m=(window.innerWidth-h)/2,y=(window.innerHeight-d)/2,w=new URLSearchParams({lng:R,token:o.value.token}),v=window.open(`${W}/ui/profile?${w.toString()}`,"_blank",`width=${h},height=${d},left=${m},top=${y},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);v==null||v.postMessage({type:"TOKEN",data:o.value.token},"*")},vt=z=>{var R,W,h,d;!((R=f.value)!=null&&R.contains(z.target))&&!((W=p.value)!=null&&W.contains(z.target))&&(_.value=!1),!((h=g.value)!=null&&h.contains(z.target))&&!((d=x.value)!=null&&d.contains(z.target))&&(N.value=!1)},bt=async z=>{var R;const{scrollTop:W,clientHeight:h,scrollHeight:d}=z.target,m=(h+W)/d,y=s.value.search,w=((R=b.value)==null?void 0:R.value)??"";m<.9||j.loading||V.value||(j.loading=!0,(y.more&&j.list.length?await y.more(w,j.list.length):await y.search(w)).length?j.list=[...j.list,...y.more&&j.list.length?await y.more(w,j.list.length):await y.search(w)]:V.value=!0,j.loading=!1,setTimeout(()=>{z.target.scrollTop=W},50))},Ot=du(z=>{j.list=[],V.value=!1,bt(z)},300);return dr("click",vt),dr("message",({data:z})=>{!z||z.type!=="profile"||(o.value={...o.value,...z.data},[localStorage,sessionStorage].filter(R=>R.getItem("WALINE_USER")).forEach(R=>{R.setItem("WALINE_USER",JSON.stringify(o))}))}),_n([s,K],([z,R])=>{const{wordLimit:W}=z;W?R<W[0]&&W[0]!==0?(J.value=W[0],me.value=!1):R>W[1]?(J.value=W[1],me.value=!1):(J.value=W[1],me.value=!0):(J.value=0,me.value=!0)}),it(N,async z=>{var R;if(!z)return;const W=s.value.search;b.value&&(b.value.value=""),j.loading=!0,j.list=await(((R=W.default)==null?void 0:R.call(W))??W.search("")),j.loading=!1}),gn(()=>{var z;(z=n.edit)!=null&&z.objectId&&(i.value=n.edit.orig),_n(()=>i.value,R=>{const{highlighter:W,texRenderer:h}=s.value;Be.value=R,O.value=_f(R,{emojiMap:T.value.map,highlighter:W,texRenderer:h}),K.value=$f(R),R?bo(c.value):bo.destroy(c.value)}),_n(()=>s.value.emoji,async R=>{T.value=await Iu(R)})}),(z,R)=>{var W,h;return I(),P("div",{key:G(o).token,class:"wl-comment"},[G(s).login!=="disable"&&de.value&&!((W=z.edit)!=null&&W.objectId)?(I(),P("div",hh,[F("div",dh,[F("button",{type:"submit",class:"wl-logout-btn",title:D.value.logout,onClick:_r},[oe(G(uo),{size:14})],8,ph),F("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:D.value.profile,onClick:Pn},[F("img",{src:G(o).avatar,alt:"avatar"},null,8,mh)],8,gh)]),F("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:D.value.profile,onClick:Pn,textContent:X(G(o).display_name)},null,8,vh)])):Q("v-if",!0),F("div",bh,[G(s).login!=="force"&&G(s).meta.length&&!de.value?(I(),P("div",{key:0,class:pe(["wl-header",`item${G(s).meta.length}`])},[(I(!0),P(ue,null,je(G(s).meta,d=>(I(),P("div",{key:d,class:"wl-header-item"},[F("label",{for:`wl-${d}`,textContent:X(D.value[d]+(G(s).requiredMeta.includes(d)||!G(s).requiredMeta.length?"":`(${D.value.optional})`))},null,8,yh),Qn(F("input",{id:`wl-${d}`,ref_for:!0,ref:m=>{m&&(a.value[d]=m)},"onUpdate:modelValue":m=>G(l)[d]=m,class:pe(["wl-input",`wl-${d}`]),name:d,type:d==="mail"?"email":"text"},null,10,wh),[[tu,G(l)[d]]])]))),128))],2)):Q("v-if",!0),Qn(F("textarea",{id:"wl-edit",ref:"textarea","onUpdate:modelValue":R[0]||(R[0]=d=>we(i)?i.value=d:null),class:"wl-editor",placeholder:z.replyUser?`@${z.replyUser}`:D.value.placeholder,onKeydown:Xe,onDrop:Jt,onPaste:In},null,40,kh),[[fs,G(i)]]),Qn(F("div",xh,[R[7]||(R[7]=F("hr",null,null,-1)),F("h4",null,X(D.value.preview)+":",1),F("div",{class:"wl-content",innerHTML:O.value},null,8,_h)],512),[[gl,L.value]]),F("div",Ch,[F("div",Sh,[F("a",$h,[oe(G(Mf))]),Qn(F("button",{ref:"emoji-button",type:"button",class:pe(["wl-action",{active:_.value}]),title:D.value.emoji,onClick:R[1]||(R[1]=d=>_.value=!_.value)},[oe(G(Ef))],10,Rh),[[gl,T.value.tabs.length]]),G(s).search?(I(),P("button",{key:0,ref:"gif-button",type:"button",class:pe(["wl-action",{active:N.value}]),title:D.value.gif,onClick:R[2]||(R[2]=d=>N.value=!N.value)},[oe(G(zf))],10,Ah)):Q("v-if",!0),F("input",{id:"wl-image-upload",ref:"image-uploader",class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:Pt},null,544),ye.value?(I(),P("label",{key:1,for:"wl-image-upload",class:"wl-action",title:D.value.uploadImage,"aria-label":D.value.uploadImage},[oe(G(Tf))],8,Eh)):Q("v-if",!0),F("button",{type:"button",class:pe(["wl-action",{active:L.value}]),title:D.value.preview,onClick:R[3]||(R[3]=d=>L.value=!L.value)},[oe(G(If))],10,Th)]),F("div",Lh,[R[9]||(R[9]=F("div",{class:"wl-captcha-container"},null,-1)),F("div",Ih,[ot(X(K.value)+" ",1),G(s).wordLimit?(I(),P("span",Mh,[R[8]||(R[8]=ot(" / ")),F("span",{class:pe({illegal:!me.value}),textContent:X(J.value)},null,10,Ph)])):Q("v-if",!0),ot(" "+X(D.value.word),1)]),G(s).login!=="disable"&&!de.value?(I(),P("button",{key:0,type:"button",class:"wl-btn",onClick:Mn,textContent:X(D.value.login)},null,8,Oh)):Q("v-if",!0),G(s).login!=="force"||de.value?(I(),P("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:E.value,onClick:Fe},[E.value?(I(),lt(G(En),{key:0,size:16})):(I(),P(ue,{key:1},[ot(X(D.value.submit),1)],64))],8,jh)):Q("v-if",!0)]),F("div",{ref:"gif-popup",class:pe(["wl-gif-popup",{display:N.value}])},[F("input",{ref:"gif-search",type:"text",placeholder:D.value.gifSearchPlaceholder,onInput:R[4]||(R[4]=(...d)=>G(Ot)&&G(Ot)(...d))},null,40,zh),j.list.length?(I(),lt(fh,{key:0,items:j.list,"column-width":200,gap:6,onInsert:R[5]||(R[5]=d=>ve(d)),onScroll:bt},null,8,["items"])):Q("v-if",!0),j.loading?(I(),P("div",Fh,[oe(G(En),{size:30})])):Q("v-if",!0)],2),F("div",{ref:"emoji-popup",class:pe(["wl-emoji-popup",{display:_.value}])},[(I(!0),P(ue,null,je(T.value.tabs,(d,m)=>(I(),P(ue,{key:d.name},[m===k.value?(I(),P("div",Dh,[(I(!0),P(ue,null,je(d.items,y=>(I(),P("button",{key:y,type:"button",title:y,onClick:w=>ve(`:${y}:`)},[_.value?(I(),P("img",{key:0,class:"wl-emoji",src:T.value.map[y],alt:y,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Uh)):Q("v-if",!0)],8,Hh))),128))])):Q("v-if",!0)],64))),128)),T.value.tabs.length>1?(I(),P("div",Nh,[(I(!0),P(ue,null,je(T.value.tabs,(d,m)=>(I(),P("button",{key:d.name,type:"button",class:pe(["wl-tab",{active:k.value===m}]),onClick:y=>k.value=m},[F("img",{class:"wl-emoji",src:d.icon,alt:d.name,title:d.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Vh)],10,Bh))),128))])):Q("v-if",!0)],2)])]),z.replyId||(h=z.edit)!=null&&h.objectId?(I(),P("button",{key:1,type:"button",class:"wl-close",title:D.value.cancelReply,onClick:R[6]||(R[6]=d=>z.replyId?r("cancelReply"):r("cancelEdit"))},[oe(G(uo),{size:24})],8,Wh)):Q("v-if",!0)])}}});const qh=["id"],Kh={class:"wl-user","aria-hidden":"true"},Gh=["src"],Zh={class:"wl-card"},Jh={class:"wl-head"},Yh=["href"],Qh={key:1,class:"wl-nick"},Xh=["textContent"],ed=["textContent"],td=["textContent"],nd=["textContent"],rd=["textContent"],sd={class:"wl-comment-actions"},id=["title"],ld=["title"],od={class:"wl-meta","aria-hidden":"true"},ad=["data-value","textContent"],cd={key:0,class:"wl-content"},ud={key:0},fd=["href"],hd=["innerHTML"],dd={key:1,class:"wl-admin-actions"},pd={class:"wl-comment-status"},gd=["disabled","onClick","textContent"],md={key:3,class:"wl-quote"};var vd=dn({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","like","sticky","edit","reply","status"],setup(e,{emit:t}){const n=e,r=t,s=["approved","waiting","spam"],i=er(zn),l=fo(),o=Su(),a=xr(),c=ge(()=>i.value.locale),u=ge(()=>{const{link:k}=n.comment;return k?ei(k)?k:`https://${k}`:""}),f=ge(()=>l.value.includes(n.comment.objectId)),p=ge(()=>Wo(new Date(n.comment.time),o.value,c.value)),g=ge(()=>a.value.type==="administrator"),x=ge(()=>n.comment.user_id&&a.value.objectId===n.comment.user_id),b=ge(()=>{var k;return n.comment.objectId===((k=n.reply)==null?void 0:k.objectId)}),T=ge(()=>{var k;return n.comment.objectId===((k=n.edit)==null?void 0:k.objectId)});return(k,_)=>{var N;const L=Wa("CommentCard",!0);return I(),P("div",{id:k.comment.objectId.toString(),class:"wl-card-item"},[F("div",Kh,[k.comment.avatar?(I(),P("img",{key:0,class:"wl-user-avatar",src:k.comment.avatar,alt:""},null,8,Gh)):Q("v-if",!0),k.comment.type?(I(),lt(G(jf),{key:1})):Q("v-if",!0)]),F("div",Zh,[F("div",Jh,[u.value?(I(),P("a",{key:0,class:"wl-nick",href:u.value,target:"_blank",rel:"nofollow noopener noreferrer"},X(k.comment.nick),9,Yh)):(I(),P("span",Qh,X(k.comment.nick),1)),k.comment.type==="administrator"?(I(),P("span",{key:2,class:"wl-badge",textContent:X(c.value.admin)},null,8,Xh)):Q("v-if",!0),k.comment.label?(I(),P("span",{key:3,class:"wl-badge",textContent:X(k.comment.label)},null,8,ed)):Q("v-if",!0),k.comment.sticky?(I(),P("span",{key:4,class:"wl-badge",textContent:X(c.value.sticky)},null,8,td)):Q("v-if",!0),typeof k.comment.level=="number"?(I(),P("span",{key:5,class:pe(`wl-badge level${k.comment.level}`),textContent:X(c.value[`level${k.comment.level}`]||`Level ${k.comment.level}`)},null,10,nd)):Q("v-if",!0),F("span",{class:"wl-time",textContent:X(p.value)},null,8,rd),F("div",sd,[g.value||x.value?(I(),P(ue,{key:0},[F("button",{type:"button",class:"wl-edit",onClick:_[0]||(_[0]=O=>r("edit",k.comment))},[oe(G(Of))]),F("button",{type:"button",class:"wl-delete",onClick:_[1]||(_[1]=O=>r("delete",k.comment))},[oe(G(Af))])],64)):Q("v-if",!0),F("button",{type:"button",class:"wl-like",title:f.value?c.value.cancelLike:c.value.like,onClick:_[2]||(_[2]=O=>r("like",k.comment))},[oe(G(Lf),{active:f.value},null,8,["active"]),ot(" "+X("like"in k.comment?k.comment.like:""),1)],8,id),F("button",{type:"button",class:pe(["wl-reply",{active:b.value}]),title:b.value?c.value.cancelReply:c.value.reply,onClick:_[3]||(_[3]=O=>r("reply",b.value?null:k.comment))},[oe(G(Pf))],10,ld)])]),F("div",od,[(I(),P(ue,null,je(["addr","browser","os"],O=>(I(),P(ue,null,[k.comment[O]?(I(),P("span",{key:O,class:pe(`wl-${O}`),"data-value":k.comment[O],textContent:X(k.comment[O])},null,10,ad)):Q("v-if",!0)],64))),64))]),T.value?Q("v-if",!0):(I(),P("div",cd,["reply_user"in k.comment&&k.comment.reply_user?(I(),P("p",ud,[F("a",{href:"#"+k.comment.pid},"@"+X(k.comment.reply_user.nick),9,fd),_[17]||(_[17]=F("span",null,": ",-1))])):Q("v-if",!0),F("div",{innerHTML:k.comment.comment},null,8,hd)])),g.value&&!T.value?(I(),P("div",dd,[F("span",pd,[(I(),P(ue,null,je(s,O=>F("button",{key:O,type:"submit",class:pe(`wl-btn wl-${O}`),disabled:k.comment.status===O,onClick:K=>r("status",{status:O,comment:k.comment}),textContent:X(c.value[O])},null,10,gd)),64))]),g.value&&!("rid"in k.comment)?(I(),P("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:_[4]||(_[4]=O=>r("sticky",k.comment))},X(k.comment.sticky?c.value.unsticky:c.value.sticky),1)):Q("v-if",!0)])):Q("v-if",!0),b.value||T.value?(I(),P("div",{key:2,class:pe({"wl-reply-wrapper":b.value,"wl-edit-wrapper":T.value})},[oe(yo,{edit:k.edit,"reply-id":(N=k.reply)==null?void 0:N.objectId,"reply-user":k.comment.nick,"root-id":k.rootId,onLog:_[5]||(_[5]=O=>r("log")),onCancelReply:_[6]||(_[6]=O=>r("reply",null)),onCancelEdit:_[7]||(_[7]=O=>r("edit",null)),onSubmit:_[8]||(_[8]=O=>r("submit",O))},null,8,["edit","reply-id","reply-user","root-id"])],2)):Q("v-if",!0),"children"in k.comment?(I(),P("div",md,[(I(!0),P(ue,null,je(k.comment.children,O=>(I(),lt(L,{key:O.objectId,comment:O,reply:k.reply,edit:k.edit,"root-id":k.rootId,onLog:_[9]||(_[9]=K=>r("log")),onDelete:_[10]||(_[10]=K=>r("delete",K)),onEdit:_[11]||(_[11]=K=>r("edit",K)),onLike:_[12]||(_[12]=K=>r("like",K)),onReply:_[13]||(_[13]=K=>r("reply",K)),onStatus:_[14]||(_[14]=K=>r("status",K)),onSticky:_[15]||(_[15]=K=>r("sticky",K)),onSubmit:_[16]||(_[16]=K=>r("submit",K))},null,8,["comment","reply","edit","root-id"]))),128))])):Q("v-if",!0)])],8,qh)}}});const wo="3.5.0",bd={"data-waline":""},yd={class:"wl-meta-head"},wd={class:"wl-count"},kd=["textContent"],xd={class:"wl-sort"},_d=["onClick"],Cd={class:"wl-cards"},Sd={key:1,class:"wl-operation"},$d=["textContent"],Rd={key:2,class:"wl-loading"},Ad=["textContent"],Ed={key:4,class:"wl-operation"},Td=["textContent"],Ld={key:5,class:"wl-power"};var Id=dn({__name:"WalineComment",props:{serverURL:{},path:{},meta:{},requiredMeta:{},wordLimit:{},pageSize:{},lang:{},locale:{},commentSorting:{},dark:{type:[String,Boolean]},emoji:{},search:{},highlighter:{type:[Function,String]},imageUploader:{type:[Function,String]},texRenderer:{type:[Function,String]},login:{},noCopyright:{type:Boolean},recaptchaV3Key:{},turnstileKey:{},reaction:{}},setup(e){const t=e,n=xr(),r=fo(),s=Y("loading"),i=Y(0),l=Y(1),o=Y(0),a=ge(()=>No(t)),c=Y(a.value.commentSorting),u=Y([]),f=Y(null),p=Y(null),g=ge(()=>Bo(a.value.dark)),x=ge(()=>a.value.locale);Au(g,{id:"waline-darkmode"});let b=null;const T=E=>{const{serverURL:V,path:D,pageSize:de}=a.value,ye=new AbortController;s.value="loading",b==null||b(),Es({serverURL:V,lang:a.value.lang,path:D,pageSize:de,sortBy:Ys[c.value],page:E,signal:ye.signal,token:n.value.token}).then(ve=>{s.value="success",i.value=ve.count,u.value.push(...ve.data),l.value=E,o.value=ve.totalPages}).catch(ve=>{ve.name!=="AbortError"&&(console.error(ve.message),s.value="error")}),b=ye.abort.bind(ye)},k=()=>{T(l.value+1)},_=()=>{i.value=0,u.value=[],T(1)},N=E=>{c.value!==E&&(c.value=E,_())},L=E=>{f.value=E},O=E=>{p.value=E},K=E=>{if(p.value)p.value.comment=E.comment,p.value.orig=E.orig;else if("rid"in E){const V=u.value.find(({objectId:D})=>D===E.rid);if(!V)return;Array.isArray(V.children)||(V.children=[]),V.children.push(E)}else u.value.unshift(E),i.value+=1},j=async({comment:E,status:V})=>{if(E.status===V)return;const{serverURL:D,lang:de}=a.value;await Qt({serverURL:D,lang:de,token:n.value.token,objectId:E.objectId,comment:{status:V}}),E.status=V},J=async E=>{if("rid"in E)return;const{serverURL:V,lang:D}=a.value;await Qt({serverURL:V,lang:D,token:n.value.token,objectId:E.objectId,comment:{sticky:E.sticky?0:1}}),E.sticky=!E.sticky},me=async({objectId:E})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:V,lang:D}=a.value;await Ls({serverURL:V,lang:D,token:n.value.token,objectId:E}),u.value.some((de,ye)=>de.objectId===E?(u.value=u.value.filter((ve,Xe)=>Xe!==ye),!0):de.children.some((ve,Xe)=>ve.objectId===E?(u.value[ye].children=de.children.filter((ut,Jt)=>Jt!==Xe),!0):!1))},Be=async E=>{const{serverURL:V,lang:D}=a.value,{objectId:de}=E,ye=r.value.includes(de);await Qt({serverURL:V,lang:D,objectId:de,token:n.value.token,comment:{like:!ye}}),ye?r.value=r.value.filter(ve=>ve!==de):(r.value=[...r.value,de],r.value.length>50&&(r.value=r.value.slice(-50))),E.like=Math.max(0,(E.like||0)+(ye?-1:1))};return Ya(zn,a),gn(()=>{_n(()=>[t.serverURL,t.path],()=>{_()})}),Qr(()=>{b==null||b()}),(E,V)=>(I(),P("div",bd,[oe(lh),!f.value&&!p.value?(I(),lt(yo,{key:0,onLog:_,onSubmit:K})):Q("v-if",!0),F("div",yd,[F("div",wd,[i.value?(I(),P("span",{key:0,class:"wl-num",textContent:X(i.value)},null,8,kd)):Q("v-if",!0),ot(" "+X(x.value.comment),1)]),F("ul",xd,[(I(!0),P(ue,null,je(G(Ho),D=>(I(),P("li",{key:D,class:pe([D===c.value?"active":""]),onClick:de=>N(D)},X(x.value[D]),11,_d))),128))])]),F("div",Cd,[(I(!0),P(ue,null,je(u.value,D=>(I(),lt(vd,{key:D.objectId,"root-id":D.objectId,comment:D,reply:f.value,edit:p.value,onLog:_,onReply:L,onEdit:O,onSubmit:K,onStatus:j,onDelete:me,onSticky:J,onLike:Be},null,8,["root-id","comment","reply","edit"]))),128))]),s.value==="error"?(I(),P("div",Sd,[F("button",{type:"button",class:"wl-btn",onClick:_,textContent:X(x.value.refresh)},null,8,$d)])):s.value==="loading"?(I(),P("div",Rd,[oe(G(En),{size:30})])):u.value.length?l.value<o.value?(I(),P("div",Ed,[F("button",{type:"button",class:"wl-btn",onClick:k,textContent:X(x.value.more)},null,8,Td)])):Q("v-if",!0):(I(),P("div",{key:3,class:"wl-empty",textContent:X(x.value.sofa)},null,8,Ad)),a.value.noCopyright?Q("v-if",!0):(I(),P("div",Ld,[V[0]||(V[0]=ot(" Powered by ")),V[1]||(V[1]=F("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1)),ot(" v"+X(G(wo)),1)]))]))}});const ko=(e,t)=>{t.forEach((n,r)=>{const s=e[r].time;typeof s=="number"&&(n.innerText=s.toString())})},xo=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:r=!0,lang:s=navigator.language})=>{const i=new AbortController,l=Array.from(document.querySelectorAll(n)),o=c=>{const u=_s(c);return u!==null&&t!==u},a=c=>Ps({serverURL:Fn(e),paths:c.map(u=>_s(u)??t),lang:s,signal:i.signal}).then(u=>ko(u,c)).catch(zl);if(r){const c=l.filter(f=>!o(f)),u=l.filter(o);Os({serverURL:Fn(e),path:t,lang:s}).then(f=>ko(f,c)),u.length&&a(u)}else a(l);return i.abort.bind(i)},Md=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:r=!1,...s})=>{const i=e?ds(e):null;if(e&&!i)throw new Error("Option 'el' do not match any domElement!");if(!s.serverURL)throw new Error("Option 'serverURL' is missing!");const l=cn({...s}),o=cn({comment:n,pageview:r,path:t}),a=()=>{o.comment&&co({serverURL:l.serverURL,path:o.path,...zt(o.comment)?{selector:o.comment}:{}})},c=()=>{o.pageview&&xo({serverURL:l.serverURL,path:o.path,...zt(o.pageview)?{selector:o.pageview}:{}})};let u=null;i&&(u=iu(()=>ne(Id,{path:o.path,...l})),u.mount(i));const f=Yi(a),p=Yi(c);return{el:i,update:({comment:g,pageview:x,path:b=window.location.pathname,...T}={})=>{Object.entries(T).forEach(([k,_])=>{l[k]=_}),o.path=b,g!==void 0&&(o.comment=g),x!==void 0&&(o.pageview=x)},destroy:()=>{u==null||u.unmount(),f(),p()}}},Pd=({el:e,serverURL:t,count:n,lang:r=navigator.language})=>{const s=xr(),i=ds(e),l=new AbortController;return js({serverURL:t,count:n,lang:r,signal:l.signal,token:s.value.token}).then(o=>i&&o.length?(i.innerHTML=`<ul class="wl-recent-list">${o.map(a=>`<li class="wl-recent-item"><a href="${a.url}">${a.nick}</a>:${a.comment}</li>`).join("")}</ul>`,{comments:o,destroy:()=>{l.abort(),i.innerHTML=""}}):{comments:o,destroy:()=>l.abort()})},Od=({el:e,serverURL:t,count:n,locale:r,lang:s=navigator.language,mode:i="list"})=>{const l=ds(e),o=new AbortController;return zs({serverURL:t,pageSize:n,lang:s,signal:o.signal}).then(a=>!l||!a.length?{users:a,destroy:()=>o.abort()}:(r={...Zs(s),...typeof r=="object"?r:{}},l.innerHTML=`<ul class="wl-user-${i}">${a.map((c,u)=>[`<li class="wl-user-item" aria-label="${c.nick}">`,c.link&&`<a href="${c.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${c.avatar}" alt="${c.nick}">`,`<span class="wl-user-badge">${u+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',c.nick,c.level&&`<span class="wl-badge">${r?r[`level${c.level}`]:`Level ${c.level}`}</span>`,c.label&&`<span class="wl-badge">${c.label}</span>`,"</div>",c.link&&c.link,"</div>",c.link&&"</a>","</li>"].filter(f=>f).join("")).join("")}</ul>`,{users:a,destroy:()=>{o.abort(),l.innerHTML=""}}))};export{Pd as RecentComments,Od as UserList,Ts as addComment,co as commentCount,jn as defaultLocales,Ls as deleteComment,Is as fetchCommentCount,Cr as getArticleCounter,Es as getComment,Ps as getPageview,js as getRecentComment,zs as getUserList,Md as init,Ms as login,xo as pageviewCount,On as updateArticleCounter,Qt as updateComment,Os as updatePageview,wo as version};
|
|
83
|
+
`)}catch(W){alert(W.message),i.value=i.value.replace(R,"")}finally{E.value=!1}},Jt=z=>{var R;if((R=z.dataTransfer)!=null&&R.items){const W=Fl(z.dataTransfer.items);W&&ye.value&&(ut(W),z.preventDefault())}},In=z=>{if(z.clipboardData){const R=Fl(z.clipboardData.items);R&&ye.value&&ut(R)}},Pt=()=>{const z=u.value;z.files&&ye.value&&ut(z.files[0]).then(()=>{z.value=""})},Fe=async()=>{var z;const{serverURL:R,lang:W,login:h,wordLimit:d,requiredMeta:m,recaptchaV3Key:y,turnstileKey:w}=s.value,v={comment:Be.value,nick:l.value.nick,mail:l.value.mail,link:l.value.link,url:s.value.path,ua:await Rf()};if(!n.edit)if(o.value.token)v.nick=o.value.display_name,v.mail=o.value.email,v.link=o.value.url;else{if(h==="force")return;if(m.includes("nick")&&!v.nick){a.value.nick.focus(),alert(D.value.nickError);return}if(m.includes("mail")&&!v.mail||v.mail&&!Ko(v.mail)){a.value.mail.focus(),alert(D.value.mailError);return}v.nick||(v.nick=D.value.anonymous)}if(!v.comment){c.value.focus();return}if(!me.value){alert(D.value.wordHint.replace("$0",d[0].toString()).replace("$1",d[1].toString()).replace("$2",K.value.toString()));return}v.comment=ao(v.comment,T.value.map),n.replyId&&n.rootId&&(v.pid=n.replyId,v.rid=n.rootId,v.at=n.replyUser),E.value=!0;try{y&&(v.recaptchaV3=await Gf(y).execute("social")),w&&(v.turnstile=await Zf(w).execute("social"));const A={serverURL:R,lang:W,token:o.value.token,comment:v},S=await(n.edit?Qt({objectId:n.edit.objectId,...A}):Ts(A));if(E.value=!1,S.errmsg){alert(S.errmsg);return}r("submit",S.data),i.value="",O.value="",await Wt(),n.replyId&&r("cancelReply"),(z=n.edit)!=null&&z.objectId&&r("cancelEdit")}catch(A){E.value=!1,alert(A.message)}},Mn=z=>{z.preventDefault();const{lang:R,serverURL:W}=s.value;Ms({serverURL:W,lang:R}).then(h=>{o.value=h,(h.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(h)),r("log")})},_r=()=>{o.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),r("log")},Pn=z=>{z.preventDefault();const{lang:R,serverURL:W}=s.value,h=800,d=800,m=(window.innerWidth-h)/2,y=(window.innerHeight-d)/2,w=new URLSearchParams({lng:R,token:o.value.token}),v=window.open(`${W}/ui/profile?${w.toString()}`,"_blank",`width=${h},height=${d},left=${m},top=${y},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);v==null||v.postMessage({type:"TOKEN",data:o.value.token},"*")},vt=z=>{var R,W,h,d;!((R=f.value)!=null&&R.contains(z.target))&&!((W=p.value)!=null&&W.contains(z.target))&&(_.value=!1),!((h=g.value)!=null&&h.contains(z.target))&&!((d=x.value)!=null&&d.contains(z.target))&&(N.value=!1)},bt=async z=>{var R;const{scrollTop:W,clientHeight:h,scrollHeight:d}=z.target,m=(h+W)/d,y=s.value.search,w=((R=b.value)==null?void 0:R.value)??"";m<.9||j.loading||V.value||(j.loading=!0,(y.more&&j.list.length?await y.more(w,j.list.length):await y.search(w)).length?j.list=[...j.list,...y.more&&j.list.length?await y.more(w,j.list.length):await y.search(w)]:V.value=!0,j.loading=!1,setTimeout(()=>{z.target.scrollTop=W},50))},Ot=du(z=>{j.list=[],V.value=!1,bt(z)},300);return dr("click",vt),dr("message",({data:z})=>{!z||z.type!=="profile"||(o.value={...o.value,...z.data},[localStorage,sessionStorage].filter(R=>R.getItem("WALINE_USER")).forEach(R=>{R.setItem("WALINE_USER",JSON.stringify(o))}))}),_n([s,K],([z,R])=>{const{wordLimit:W}=z;W?R<W[0]&&W[0]!==0?(J.value=W[0],me.value=!1):R>W[1]?(J.value=W[1],me.value=!1):(J.value=W[1],me.value=!0):(J.value=0,me.value=!0)}),it(N,async z=>{var R;if(!z)return;const W=s.value.search;b.value&&(b.value.value=""),j.loading=!0,j.list=await(((R=W.default)==null?void 0:R.call(W))??W.search("")),j.loading=!1}),gn(()=>{var z;(z=n.edit)!=null&&z.objectId&&(i.value=n.edit.orig),_n(()=>i.value,R=>{const{highlighter:W,texRenderer:h}=s.value;Be.value=R,O.value=_f(R,{emojiMap:T.value.map,highlighter:W,texRenderer:h}),K.value=$f(R),R?bo(c.value):bo.destroy(c.value)}),_n(()=>s.value.emoji,async R=>{T.value=await Iu(R)})}),(z,R)=>{var W,h;return I(),P("div",{key:G(o).token,class:"wl-comment"},[G(s).login!=="disable"&&de.value&&!((W=z.edit)!=null&&W.objectId)?(I(),P("div",hh,[F("div",dh,[F("button",{type:"submit",class:"wl-logout-btn",title:D.value.logout,onClick:_r},[oe(G(uo),{size:14})],8,ph),F("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:D.value.profile,onClick:Pn},[F("img",{src:G(o).avatar,alt:"avatar"},null,8,mh)],8,gh)]),F("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:D.value.profile,onClick:Pn,textContent:X(G(o).display_name)},null,8,vh)])):Q("v-if",!0),F("div",bh,[G(s).login!=="force"&&G(s).meta.length&&!de.value?(I(),P("div",{key:0,class:pe(["wl-header",`item${G(s).meta.length}`])},[(I(!0),P(ue,null,je(G(s).meta,d=>(I(),P("div",{key:d,class:"wl-header-item"},[F("label",{for:`wl-${d}`,textContent:X(D.value[d]+(G(s).requiredMeta.includes(d)||!G(s).requiredMeta.length?"":`(${D.value.optional})`))},null,8,yh),Qn(F("input",{id:`wl-${d}`,ref_for:!0,ref:m=>{m&&(a.value[d]=m)},"onUpdate:modelValue":m=>G(l)[d]=m,class:pe(["wl-input",`wl-${d}`]),name:d,type:d==="mail"?"email":"text"},null,10,wh),[[tu,G(l)[d]]])]))),128))],2)):Q("v-if",!0),Qn(F("textarea",{id:"wl-edit",ref:"textarea","onUpdate:modelValue":R[0]||(R[0]=d=>we(i)?i.value=d:null),class:"wl-editor",placeholder:z.replyUser?`@${z.replyUser}`:D.value.placeholder,onKeydown:Xe,onDrop:Jt,onPaste:In},null,40,kh),[[fs,G(i)]]),Qn(F("div",xh,[R[7]||(R[7]=F("hr",null,null,-1)),F("h4",null,X(D.value.preview)+":",1),F("div",{class:"wl-content",innerHTML:O.value},null,8,_h)],512),[[gl,L.value]]),F("div",Ch,[F("div",Sh,[F("a",$h,[oe(G(Mf))]),Qn(F("button",{ref:"emoji-button",type:"button",class:pe(["wl-action",{active:_.value}]),title:D.value.emoji,onClick:R[1]||(R[1]=d=>_.value=!_.value)},[oe(G(Ef))],10,Rh),[[gl,T.value.tabs.length]]),G(s).search?(I(),P("button",{key:0,ref:"gif-button",type:"button",class:pe(["wl-action",{active:N.value}]),title:D.value.gif,onClick:R[2]||(R[2]=d=>N.value=!N.value)},[oe(G(zf))],10,Ah)):Q("v-if",!0),F("input",{id:"wl-image-upload",ref:"image-uploader",class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:Pt},null,544),ye.value?(I(),P("label",{key:1,for:"wl-image-upload",class:"wl-action",title:D.value.uploadImage,"aria-label":D.value.uploadImage},[oe(G(Tf))],8,Eh)):Q("v-if",!0),F("button",{type:"button",class:pe(["wl-action",{active:L.value}]),title:D.value.preview,onClick:R[3]||(R[3]=d=>L.value=!L.value)},[oe(G(If))],10,Th)]),F("div",Lh,[R[9]||(R[9]=F("div",{class:"wl-captcha-container"},null,-1)),F("div",Ih,[ot(X(K.value)+" ",1),G(s).wordLimit?(I(),P("span",Mh,[R[8]||(R[8]=ot(" / ")),F("span",{class:pe({illegal:!me.value}),textContent:X(J.value)},null,10,Ph)])):Q("v-if",!0),ot(" "+X(D.value.word),1)]),G(s).login!=="disable"&&!de.value?(I(),P("button",{key:0,type:"button",class:"wl-btn",onClick:Mn,textContent:X(D.value.login)},null,8,Oh)):Q("v-if",!0),G(s).login!=="force"||de.value?(I(),P("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:E.value,onClick:Fe},[E.value?(I(),lt(G(En),{key:0,size:16})):(I(),P(ue,{key:1},[ot(X(D.value.submit),1)],64))],8,jh)):Q("v-if",!0)]),F("div",{ref:"gif-popup",class:pe(["wl-gif-popup",{display:N.value}])},[F("input",{ref:"gif-search",type:"text",placeholder:D.value.gifSearchPlaceholder,onInput:R[4]||(R[4]=(...d)=>G(Ot)&&G(Ot)(...d))},null,40,zh),j.list.length?(I(),lt(fh,{key:0,items:j.list,"column-width":200,gap:6,onInsert:R[5]||(R[5]=d=>ve(d)),onScroll:bt},null,8,["items"])):Q("v-if",!0),j.loading?(I(),P("div",Fh,[oe(G(En),{size:30})])):Q("v-if",!0)],2),F("div",{ref:"emoji-popup",class:pe(["wl-emoji-popup",{display:_.value}])},[(I(!0),P(ue,null,je(T.value.tabs,(d,m)=>(I(),P(ue,{key:d.name},[m===k.value?(I(),P("div",Dh,[(I(!0),P(ue,null,je(d.items,y=>(I(),P("button",{key:y,type:"button",title:y,onClick:w=>ve(`:${y}:`)},[_.value?(I(),P("img",{key:0,class:"wl-emoji",src:T.value.map[y],alt:y,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Uh)):Q("v-if",!0)],8,Hh))),128))])):Q("v-if",!0)],64))),128)),T.value.tabs.length>1?(I(),P("div",Nh,[(I(!0),P(ue,null,je(T.value.tabs,(d,m)=>(I(),P("button",{key:d.name,type:"button",class:pe(["wl-tab",{active:k.value===m}]),onClick:y=>k.value=m},[F("img",{class:"wl-emoji",src:d.icon,alt:d.name,title:d.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Vh)],10,Bh))),128))])):Q("v-if",!0)],2)])]),z.replyId||(h=z.edit)!=null&&h.objectId?(I(),P("button",{key:1,type:"button",class:"wl-close",title:D.value.cancelReply,onClick:R[6]||(R[6]=d=>z.replyId?r("cancelReply"):r("cancelEdit"))},[oe(G(uo),{size:24})],8,Wh)):Q("v-if",!0)])}}});const qh=["id"],Kh={class:"wl-user","aria-hidden":"true"},Gh=["src"],Zh={class:"wl-card"},Jh={class:"wl-head"},Yh=["href"],Qh={key:1,class:"wl-nick"},Xh=["textContent"],ed=["textContent"],td=["textContent"],nd=["textContent"],rd=["textContent"],sd={class:"wl-comment-actions"},id=["title"],ld=["title"],od={class:"wl-meta","aria-hidden":"true"},ad=["data-value","textContent"],cd={key:0,class:"wl-content"},ud={key:0},fd=["href"],hd=["innerHTML"],dd={key:1,class:"wl-admin-actions"},pd={class:"wl-comment-status"},gd=["disabled","onClick","textContent"],md={key:3,class:"wl-quote"};var vd=dn({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","like","sticky","edit","reply","status"],setup(e,{emit:t}){const n=e,r=t,s=["approved","waiting","spam"],i=er(zn),l=fo(),o=Su(),a=xr(),c=ge(()=>i.value.locale),u=ge(()=>{const{link:k}=n.comment;return k?ei(k)?k:`https://${k}`:""}),f=ge(()=>l.value.includes(n.comment.objectId)),p=ge(()=>Wo(new Date(n.comment.time),o.value,c.value)),g=ge(()=>a.value.type==="administrator"),x=ge(()=>n.comment.user_id&&a.value.objectId===n.comment.user_id),b=ge(()=>{var k;return n.comment.objectId===((k=n.reply)==null?void 0:k.objectId)}),T=ge(()=>{var k;return n.comment.objectId===((k=n.edit)==null?void 0:k.objectId)});return(k,_)=>{var N;const L=Wa("CommentCard",!0);return I(),P("div",{id:k.comment.objectId.toString(),class:"wl-card-item"},[F("div",Kh,[k.comment.avatar?(I(),P("img",{key:0,class:"wl-user-avatar",src:k.comment.avatar,alt:""},null,8,Gh)):Q("v-if",!0),k.comment.type?(I(),lt(G(jf),{key:1})):Q("v-if",!0)]),F("div",Zh,[F("div",Jh,[u.value?(I(),P("a",{key:0,class:"wl-nick",href:u.value,target:"_blank",rel:"nofollow noopener noreferrer"},X(k.comment.nick),9,Yh)):(I(),P("span",Qh,X(k.comment.nick),1)),k.comment.type==="administrator"?(I(),P("span",{key:2,class:"wl-badge",textContent:X(c.value.admin)},null,8,Xh)):Q("v-if",!0),k.comment.label?(I(),P("span",{key:3,class:"wl-badge",textContent:X(k.comment.label)},null,8,ed)):Q("v-if",!0),k.comment.sticky?(I(),P("span",{key:4,class:"wl-badge",textContent:X(c.value.sticky)},null,8,td)):Q("v-if",!0),typeof k.comment.level=="number"?(I(),P("span",{key:5,class:pe(`wl-badge level${k.comment.level}`),textContent:X(c.value[`level${k.comment.level}`]||`Level ${k.comment.level}`)},null,10,nd)):Q("v-if",!0),F("span",{class:"wl-time",textContent:X(p.value)},null,8,rd),F("div",sd,[g.value||x.value?(I(),P(ue,{key:0},[F("button",{type:"button",class:"wl-edit",onClick:_[0]||(_[0]=O=>r("edit",k.comment))},[oe(G(Of))]),F("button",{type:"button",class:"wl-delete",onClick:_[1]||(_[1]=O=>r("delete",k.comment))},[oe(G(Af))])],64)):Q("v-if",!0),F("button",{type:"button",class:"wl-like",title:f.value?c.value.cancelLike:c.value.like,onClick:_[2]||(_[2]=O=>r("like",k.comment))},[oe(G(Lf),{active:f.value},null,8,["active"]),ot(" "+X("like"in k.comment?k.comment.like:""),1)],8,id),F("button",{type:"button",class:pe(["wl-reply",{active:b.value}]),title:b.value?c.value.cancelReply:c.value.reply,onClick:_[3]||(_[3]=O=>r("reply",b.value?null:k.comment))},[oe(G(Pf))],10,ld)])]),F("div",od,[(I(),P(ue,null,je(["addr","browser","os"],O=>(I(),P(ue,null,[k.comment[O]?(I(),P("span",{key:O,class:pe(`wl-${O}`),"data-value":k.comment[O],textContent:X(k.comment[O])},null,10,ad)):Q("v-if",!0)],64))),64))]),T.value?Q("v-if",!0):(I(),P("div",cd,["reply_user"in k.comment&&k.comment.reply_user?(I(),P("p",ud,[F("a",{href:"#"+k.comment.pid},"@"+X(k.comment.reply_user.nick),9,fd),_[17]||(_[17]=F("span",null,": ",-1))])):Q("v-if",!0),F("div",{innerHTML:k.comment.comment},null,8,hd)])),g.value&&!T.value?(I(),P("div",dd,[F("span",pd,[(I(),P(ue,null,je(s,O=>F("button",{key:O,type:"submit",class:pe(`wl-btn wl-${O}`),disabled:k.comment.status===O,onClick:K=>r("status",{status:O,comment:k.comment}),textContent:X(c.value[O])},null,10,gd)),64))]),g.value&&!("rid"in k.comment)?(I(),P("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:_[4]||(_[4]=O=>r("sticky",k.comment))},X(k.comment.sticky?c.value.unsticky:c.value.sticky),1)):Q("v-if",!0)])):Q("v-if",!0),b.value||T.value?(I(),P("div",{key:2,class:pe({"wl-reply-wrapper":b.value,"wl-edit-wrapper":T.value})},[oe(yo,{edit:k.edit,"reply-id":(N=k.reply)==null?void 0:N.objectId,"reply-user":k.comment.nick,"root-id":k.rootId,onLog:_[5]||(_[5]=O=>r("log")),onCancelReply:_[6]||(_[6]=O=>r("reply",null)),onCancelEdit:_[7]||(_[7]=O=>r("edit",null)),onSubmit:_[8]||(_[8]=O=>r("submit",O))},null,8,["edit","reply-id","reply-user","root-id"])],2)):Q("v-if",!0),"children"in k.comment?(I(),P("div",md,[(I(!0),P(ue,null,je(k.comment.children,O=>(I(),lt(L,{key:O.objectId,comment:O,reply:k.reply,edit:k.edit,"root-id":k.rootId,onLog:_[9]||(_[9]=K=>r("log")),onDelete:_[10]||(_[10]=K=>r("delete",K)),onEdit:_[11]||(_[11]=K=>r("edit",K)),onLike:_[12]||(_[12]=K=>r("like",K)),onReply:_[13]||(_[13]=K=>r("reply",K)),onStatus:_[14]||(_[14]=K=>r("status",K)),onSticky:_[15]||(_[15]=K=>r("sticky",K)),onSubmit:_[16]||(_[16]=K=>r("submit",K))},null,8,["comment","reply","edit","root-id"]))),128))])):Q("v-if",!0)])],8,qh)}}});const wo="3.5.1",bd={"data-waline":""},yd={class:"wl-meta-head"},wd={class:"wl-count"},kd=["textContent"],xd={class:"wl-sort"},_d=["onClick"],Cd={class:"wl-cards"},Sd={key:1,class:"wl-operation"},$d=["textContent"],Rd={key:2,class:"wl-loading"},Ad=["textContent"],Ed={key:4,class:"wl-operation"},Td=["textContent"],Ld={key:5,class:"wl-power"};var Id=dn({__name:"WalineComment",props:{serverURL:{},path:{},meta:{},requiredMeta:{},wordLimit:{},pageSize:{},lang:{},locale:{},commentSorting:{},dark:{type:[String,Boolean]},login:{},noCopyright:{type:Boolean},recaptchaV3Key:{},turnstileKey:{},reaction:{},emoji:{},search:{},highlighter:{type:Function},imageUploader:{type:Function},texRenderer:{type:Function}},setup(e){const t=e,n=xr(),r=fo(),s=Y("loading"),i=Y(0),l=Y(1),o=Y(0),a=ge(()=>No(t)),c=Y(a.value.commentSorting),u=Y([]),f=Y(null),p=Y(null),g=ge(()=>Bo(a.value.dark)),x=ge(()=>a.value.locale);Au(g,{id:"waline-darkmode"});let b=null;const T=E=>{const{serverURL:V,path:D,pageSize:de}=a.value,ye=new AbortController;s.value="loading",b==null||b(),Es({serverURL:V,lang:a.value.lang,path:D,pageSize:de,sortBy:Ys[c.value],page:E,signal:ye.signal,token:n.value.token}).then(ve=>{s.value="success",i.value=ve.count,u.value.push(...ve.data),l.value=E,o.value=ve.totalPages}).catch(ve=>{ve.name!=="AbortError"&&(console.error(ve.message),s.value="error")}),b=ye.abort.bind(ye)},k=()=>{T(l.value+1)},_=()=>{i.value=0,u.value=[],T(1)},N=E=>{c.value!==E&&(c.value=E,_())},L=E=>{f.value=E},O=E=>{p.value=E},K=E=>{if(p.value)p.value.comment=E.comment,p.value.orig=E.orig;else if("rid"in E){const V=u.value.find(({objectId:D})=>D===E.rid);if(!V)return;Array.isArray(V.children)||(V.children=[]),V.children.push(E)}else u.value.unshift(E),i.value+=1},j=async({comment:E,status:V})=>{if(E.status===V)return;const{serverURL:D,lang:de}=a.value;await Qt({serverURL:D,lang:de,token:n.value.token,objectId:E.objectId,comment:{status:V}}),E.status=V},J=async E=>{if("rid"in E)return;const{serverURL:V,lang:D}=a.value;await Qt({serverURL:V,lang:D,token:n.value.token,objectId:E.objectId,comment:{sticky:E.sticky?0:1}}),E.sticky=!E.sticky},me=async({objectId:E})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:V,lang:D}=a.value;await Ls({serverURL:V,lang:D,token:n.value.token,objectId:E}),u.value.some((de,ye)=>de.objectId===E?(u.value=u.value.filter((ve,Xe)=>Xe!==ye),!0):de.children.some((ve,Xe)=>ve.objectId===E?(u.value[ye].children=de.children.filter((ut,Jt)=>Jt!==Xe),!0):!1))},Be=async E=>{const{serverURL:V,lang:D}=a.value,{objectId:de}=E,ye=r.value.includes(de);await Qt({serverURL:V,lang:D,objectId:de,token:n.value.token,comment:{like:!ye}}),ye?r.value=r.value.filter(ve=>ve!==de):(r.value=[...r.value,de],r.value.length>50&&(r.value=r.value.slice(-50))),E.like=Math.max(0,(E.like||0)+(ye?-1:1))};return Ya(zn,a),gn(()=>{_n(()=>[t.serverURL,t.path],()=>{_()})}),Qr(()=>{b==null||b()}),(E,V)=>(I(),P("div",bd,[oe(lh),!f.value&&!p.value?(I(),lt(yo,{key:0,onLog:_,onSubmit:K})):Q("v-if",!0),F("div",yd,[F("div",wd,[i.value?(I(),P("span",{key:0,class:"wl-num",textContent:X(i.value)},null,8,kd)):Q("v-if",!0),ot(" "+X(x.value.comment),1)]),F("ul",xd,[(I(!0),P(ue,null,je(G(Ho),D=>(I(),P("li",{key:D,class:pe([D===c.value?"active":""]),onClick:de=>N(D)},X(x.value[D]),11,_d))),128))])]),F("div",Cd,[(I(!0),P(ue,null,je(u.value,D=>(I(),lt(vd,{key:D.objectId,"root-id":D.objectId,comment:D,reply:f.value,edit:p.value,onLog:_,onReply:L,onEdit:O,onSubmit:K,onStatus:j,onDelete:me,onSticky:J,onLike:Be},null,8,["root-id","comment","reply","edit"]))),128))]),s.value==="error"?(I(),P("div",Sd,[F("button",{type:"button",class:"wl-btn",onClick:_,textContent:X(x.value.refresh)},null,8,$d)])):s.value==="loading"?(I(),P("div",Rd,[oe(G(En),{size:30})])):u.value.length?l.value<o.value?(I(),P("div",Ed,[F("button",{type:"button",class:"wl-btn",onClick:k,textContent:X(x.value.more)},null,8,Td)])):Q("v-if",!0):(I(),P("div",{key:3,class:"wl-empty",textContent:X(x.value.sofa)},null,8,Ad)),a.value.noCopyright?Q("v-if",!0):(I(),P("div",Ld,[V[0]||(V[0]=ot(" Powered by ")),V[1]||(V[1]=F("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1)),ot(" v"+X(G(wo)),1)]))]))}});const ko=(e,t)=>{t.forEach((n,r)=>{const s=e[r].time;typeof s=="number"&&(n.innerText=s.toString())})},xo=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:r=!0,lang:s=navigator.language})=>{const i=new AbortController,l=Array.from(document.querySelectorAll(n)),o=c=>{const u=_s(c);return u!==null&&t!==u},a=c=>Ps({serverURL:Fn(e),paths:c.map(u=>_s(u)??t),lang:s,signal:i.signal}).then(u=>ko(u,c)).catch(zl);if(r){const c=l.filter(f=>!o(f)),u=l.filter(o);Os({serverURL:Fn(e),path:t,lang:s}).then(f=>ko(f,c)),u.length&&a(u)}else a(l);return i.abort.bind(i)},Md=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:r=!1,...s})=>{const i=e?ds(e):null;if(e&&!i)throw new Error("Option 'el' do not match any domElement!");if(!s.serverURL)throw new Error("Option 'serverURL' is missing!");const l=cn({...s}),o=cn({comment:n,pageview:r,path:t}),a=()=>{o.comment&&co({serverURL:l.serverURL,path:o.path,...zt(o.comment)?{selector:o.comment}:{}})},c=()=>{o.pageview&&xo({serverURL:l.serverURL,path:o.path,...zt(o.pageview)?{selector:o.pageview}:{}})};let u=null;i&&(u=iu(()=>ne(Id,{path:o.path,...l})),u.mount(i));const f=Yi(a),p=Yi(c);return{el:i,update:({comment:g,pageview:x,path:b=window.location.pathname,...T}={})=>{Object.entries(T).forEach(([k,_])=>{l[k]=_}),o.path=b,g!==void 0&&(o.comment=g),x!==void 0&&(o.pageview=x)},destroy:()=>{u==null||u.unmount(),f(),p()}}},Pd=({el:e,serverURL:t,count:n,lang:r=navigator.language})=>{const s=xr(),i=ds(e),l=new AbortController;return js({serverURL:t,count:n,lang:r,signal:l.signal,token:s.value.token}).then(o=>i&&o.length?(i.innerHTML=`<ul class="wl-recent-list">${o.map(a=>`<li class="wl-recent-item"><a href="${a.url}">${a.nick}</a>:${a.comment}</li>`).join("")}</ul>`,{comments:o,destroy:()=>{l.abort(),i.innerHTML=""}}):{comments:o,destroy:()=>l.abort()})},Od=({el:e,serverURL:t,count:n,locale:r,lang:s=navigator.language,mode:i="list"})=>{const l=ds(e),o=new AbortController;return zs({serverURL:t,pageSize:n,lang:s,signal:o.signal}).then(a=>!l||!a.length?{users:a,destroy:()=>o.abort()}:(r={...Zs(s),...typeof r=="object"?r:{}},l.innerHTML=`<ul class="wl-user-${i}">${a.map((c,u)=>[`<li class="wl-user-item" aria-label="${c.nick}">`,c.link&&`<a href="${c.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${c.avatar}" alt="${c.nick}">`,`<span class="wl-user-badge">${u+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',c.nick,c.level&&`<span class="wl-badge">${r?r[`level${c.level}`]:`Level ${c.level}`}</span>`,c.label&&`<span class="wl-badge">${c.label}</span>`,"</div>",c.link&&c.link,"</div>",c.link&&"</a>","</li>"].filter(f=>f).join("")).join("")}</ul>`,{users:a,destroy:()=>{o.abort(),l.innerHTML=""}}))};export{Pd as RecentComments,Od as UserList,Ts as addComment,co as commentCount,jn as defaultLocales,Ls as deleteComment,Is as fetchCommentCount,Cr as getArticleCounter,Es as getComment,Ps as getPageview,js as getRecentComment,zs as getUserList,Md as init,Ms as login,xo as pageviewCount,On as updateArticleCounter,Qt as updateComment,Os as updatePageview,wo as version};
|
|
84
84
|
//# sourceMappingURL=waline.js.map
|