diff --git a/dist/Valine.min.js b/dist/Valine.min.js index 1af13317..df317afd 100644 --- a/dist/Valine.min.js +++ b/dist/Valine.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Valine",[],t):"object"==typeof exports?exports.Valine=t():e.Valine=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=3)}([function(e,t,n){var r;!function(i){"use strict";function a(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,t){return e<>>32-t}function s(e,t,n,r,i,s){return a(o(a(a(t,e),a(r,s)),i),n)}function l(e,t,n,r,i,a,o){return s(t&n|~t&r,e,t,i,a,o)}function c(e,t,n,r,i,a,o){return s(t&r|n&~r,e,t,i,a,o)}function p(e,t,n,r,i,a,o){return s(t^n^r,e,t,i,a,o)}function u(e,t,n,r,i,a,o){return s(n^(t|~r),e,t,i,a,o)}function d(e,t){e[t>>5]|=128<>>9<<4)]=t;var n,r,i,o,s,d=1732584193,h=-271733879,f=-1732584194,v=271733878;for(n=0;n>5]>>>t%32&255);return n}function f(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<16&&(i=d(i,8*e.length)),n=0;n<16;n+=1)a[n]=909522486^i[n],o[n]=1549556828^i[n];return r=d(a.concat(f(t)),512+8*t.length),h(d(o.concat(r),640))}function m(e){var t,n,r="0123456789abcdef",i="";for(n=0;n>>4&15)+r.charAt(15&t);return i}function b(e){return unescape(encodeURIComponent(e))}function x(e){return v(b(e))}function w(e){return m(x(e))}function k(e,t){return g(b(e),b(t))}function y(e,t){return m(k(e,t))}function _(e,t,n){return t?n?k(t,e):y(t,e):n?x(e):w(e)}void 0!==(r=function(){return _}.call(t,n,t,e))&&(e.exports=r)}()},function(e,t,n){(function(t){!function(t){"use strict";function n(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=f.normal,this.options.gfm&&(this.options.tables?this.rules=f.tables:this.rules=f.gfm)}function r(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=v.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=v.breaks:this.rules=v.gfm:this.options.pedantic&&(this.rules=v.pedantic)}function i(e){this.options=e||{}}function a(){}function o(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function c(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=n.source||n,n=n.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function p(e,t){return g[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?g[" "+e]=e+"/":g[" "+e]=e.replace(/[^\/]*$/,"")),e=g[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}function u(){}function d(e){for(var t,n,r=1;rAn error occurred:

"+s(e.message+"",!0)+"
";throw e}}var f={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};f._label=/(?:\\[\[\]]|[^\[\]])+/,f._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,f.def=c(f.def).replace("label",f._label).replace("title",f._title).getRegex(),f.bullet=/(?:[*+-]|\d+\.)/,f.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,f.item=c(f.item,"gm").replace(/bull/g,f.bullet).getRegex(),f.list=c(f.list).replace(/bull/g,f.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+f.def.source+")").getRegex(),f._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",f.html=c(f.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,f._tag).getRegex(),f.paragraph=c(f.paragraph).replace("hr",f.hr).replace("heading",f.heading).replace("lheading",f.lheading).replace("tag","<"+f._tag).getRegex(),f.blockquote=c(f.blockquote).replace("paragraph",f.paragraph).getRegex(),f.normal=d({},f),f.gfm=d({},f.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),f.gfm.paragraph=c(f.paragraph).replace("(?!","(?!"+f.gfm.fences.source.replace("\\1","\\2")+"|"+f.list.source.replace("\\1","\\3")+"|").getRegex(),f.tables=d({},f.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=f,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,t){e=e.replace(/^ +$/gm,"");for(var n,r,i,a,o,s,l,c,p,u,d;e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),s={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},c=0;c ?/gm,""),this.token(i,t),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),a=i[2],d=a.length>1,this.tokens.push({type:"list_start",ordered:d,start:d?+a:""}),i=i[0].match(this.rules.item),n=!1,u=i.length,c=0;c1&&o.length>1||(e=i.slice(c+1).join("\n")+e,c=u-1)),r=n||/\n\n(?!\s*$)/.test(s),c!==u-1&&(n="\n"===s.charAt(s.length-1),r||(r=n)),this.tokens.push({type:r?"loose_item_start":"list_item_start"}),this.token(s,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),p=i[1].toLowerCase(),this.tokens.links[p]||(this.tokens.links[p]={href:i[2],title:i[3]});else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),s={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:u,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,v.link=c(v.link).replace("inside",v._inside).replace("href",v._href).getRegex(),v.reflink=c(v.reflink).replace("inside",v._inside).getRegex(),v.normal=d({},v),v.pedantic=d({},v.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),v.gfm=d({},v.normal,{escape:c(v.escape).replace("])","~|])").getRegex(),url:c(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",v._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(v.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),v.breaks=d({},v.gfm,{br:c(v.br).replace("{2,}","*").getRegex(),text:c(v.gfm.text).replace("{2,}","*").getRegex()}),r.rules=v,r.output=function(e,t,n){return new r(t,n).output(e)},r.prototype.output=function(e){for(var t,n,r,i,a="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),a+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=s(this.mangle(i[1])),r="mailto:"+n):(n=s(i[1]),r=n),a+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),a+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,a+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){a+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,a+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),a+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),a+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),a+=this.renderer.codespan(s(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),a+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),a+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),a+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else i[0]=this.rules._backpedal.exec(i[0])[0],e=e.substring(i[0].length),"@"===i[2]?(n=s(i[0]),r="mailto:"+n):(n=s(i[0]),r="www."===i[1]?"http://"+n:n),a+=this.renderer.link(r,null,n);return a},r.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:s(e,!0))+"\n
\n":"
"+(n?e:s(e,!0))+"\n
"},i.prototype.blockquote=function(e){return"
\n"+e+"
\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(l(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!m.test(e)&&(e=p(this.options.baseUrl,e));var i='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!m.test(e)&&(e=p(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},a.prototype.strong=a.prototype.em=a.prototype.codespan=a.prototype.del=a.prototype.text=function(e){return e},a.prototype.link=a.prototype.image=function(e,t,n){return""+n},a.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new r(e.links,this.options),this.inlineText=new r(e.links,d({},this.options,{renderer:new a})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,l(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",a="";for(n="",e=0;e\n
    \n
    \n
    \n
    '+i+'
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n \n \n \n
    \n \n
    \n
    \n
    ';t.el.innerHTML=a;var o=t.el.querySelector(".vempty");t.nodata={show:function(e){o.innerHTML=e||"还没有评论哦,快来抢沙发吧!",o.setAttribute("style","display:block;")},hide:function(){o.setAttribute("style","display:none;")}},t.nodata.show();var s=t.el.querySelector(".vsmile-icons"),p=e.emoticon_list||["mrgreen","neutral","twisted","arrow","eek","smile","confused","cool","evil","biggrin","idea","redface","razz","rolleyes","wink","cry","surprised","lol","mad","sad","exclaim","question"];for(var u in p){var h=document.createElement("img");h.setAttribute("src",e.emoticon_url+"/"+p[u]),s.appendChild(h)}n.init({appId:e.app_id||e.appId,appKey:e.app_key||e.appKey}),t.v=n}catch(e){var f="https://github.com/panjunwen/Valine/issues";return void(t.el?t.nodata.show('
    '+e+"
    Valine:"+t.version+"
    反馈:"+f+"
    "):console&&console.log("%c"+e+"\n%cValine%c"+t.version+" "+f,"color:red;","background:#000;padding:5px;line-height:30px;color:#fff;","background:#456;line-height:30px;padding:5px;color:#fff;"))}var v='
    ',g=t.el.querySelector(".vloading");g.innerHTML=v,t.loading={show:function(){g.setAttribute("style","display:block;"),t.nodata.hide()},hide:function(){g.setAttribute("style","display:none;"),0===t.el.querySelectorAll(".vcard").length&&t.nodata.show()}};var m=t.el.querySelector(".vsubmitting");m.innerHTML=v,t.submitting={show:function(){m.setAttribute("style","display:block;")},hide:function(){m.setAttribute("style","display:none;"),t.nodata.hide()}};var b=t.el.querySelector(".vmark");t.alert={show:function(e){b.innerHTML='
    '+e.text+'
    ';var n=b.querySelector(".vbtns"),r='",i='";if(n.innerHTML=""+r+(e.type&&i),b.querySelector(".vcancel").addEventListener("click",function(e){t.alert.hide()}),b.setAttribute("style","display:block;"),e&&e.type){var a=b.querySelector(".vsure");d.on("click",a,function(n){t.alert.hide(),e.cb&&e.cb()})}},hide:function(){b.setAttribute("style","display:none;")}},t.loading.show();var x=new t.v.Query("Comment");x.equalTo("url",l.url),x.count().then(function(n){t.el.querySelector(".count").innerHTML=""+n,t.bind(e)},function(e){console.log(e)})}},{key:"bind",value:function(e){var t=this,n=t.el.querySelector(".vsmile-icons");d.on("click",n,function(e){var n=t.el.querySelector(".veditor"),r=e.target.src;if(void 0!==r){var i="!(:"+decodeURI(r).replace(/^.*\/(.*)$/,"$1")+":)";if(document.selection)n.focus(),sel=document.selection.createRange(),sel.text=i,n.focus();else if(n.selectionStart||"0"==n.selectionStart){var a=n.selectionStart,o=n.selectionEnd,s=o;n.value=n.value.substring(0,a)+i+n.value.substring(o,n.value.length),s+=i.length,n.focus(),n.selectionStart=s,n.selectionEnd=s}else n.value+=i,n.focus();l.comment=n.value;var c=t.el.querySelector(".vsubmit");c.getAttribute("disabled")&&c.removeAttribute("disabled")}});var r=t.el.querySelector(".comment_trigger");d.on("click",r,function(e){r.setAttribute("style","display:none"),t.el.querySelector(".auth-section").removeAttribute("style"),t.el.querySelector(".veditor").focus()});var i=t.el.querySelector(".vsmile-btn"),a=t.el.querySelector(".vsmile-icons");d.on("click",i,function(e){a.getAttribute("triggered")?(a.setAttribute("style","display:none;"),a.removeAttribute("triggered")):(a.removeAttribute("style"),a.setAttribute("triggered",1))});var c=function(e){e.offsetHeight>180&&(e.classList.add("expand"),d.on("click",e,function(t){e.setAttribute("class","vcomment")}))},u=function(){var e=new t.v.Query("Comment");return e.select(["nick","comment","link","rid","emailHash"]),e.notEqualTo("isSpam",!0),e.equalTo("url",l.url),e.addDescending("createdAt"),e},g=1;!function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.loading.show();var r=Number(t.el.querySelector(".count").innerText),i=u();i.limit(10),i.skip(10*(n-1)),i.find().then(function(i){var a=i.length;if(a){for(var o=0;o加载更多评论(剩余'+(r-10*n)+"/"+r+"条)":"";var l=s.querySelector("#vmore");l&&d.on("click",l,function(t){s.innerHTML="",e(++g)})}t.loading.hide()}).catch(function(e){console.log(e),t.loading.hide()})}();var m=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=document.createElement("li");r.setAttribute("class","vcard"),r.setAttribute("id",e.id);var i="d41d8cd98f00b204e9800998ecf8427e"==e.get("emailHash")?"9e63c80900d106cbbec5a9f4ea433a3e":e.get("emailHash"),a="https://gravatar.loli.net/avatar/"+i+"?size=80";r.innerHTML='\n
    \n
    \n '+e.get("nick")+'\n \n '+v(e.get("createdAt"))+'\n
    \n
    '+e.get("comment")+'
    \n \n
    \n
    \n 回复';for(var o=t.el.querySelector(".vlist"),s=o.querySelectorAll("li"),l=r.querySelector(".vat"),p=r.querySelectorAll("a"),u=0,d=p.length;u-1&&""!=l.at){var r='"+l.at+"";l.comment=l.comment.replace(l.at,r)}var i=h.mail(l.mail),a=h.link(l.link);l.mail=i.k?i.v:"",l.link=a.k?a.v:"",i.k||a.k?i.k?a.k?A():t.alert.show({type:1,text:"您的网址格式不正确, 是否继续提交?",cb:function(){A()}}):t.alert.show({type:1,text:"您的邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?",cb:function(){A()}}):t.alert.show({type:1,text:"您的网址和邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?",cb:function(){A()}})},S=function(){var e=new t.v.ACL;return e.setPublicReadAccess(!0),e.setPublicWriteAccess(!1),e},A=function(){y.setAttribute("disabled",!0),t.submitting.show();var e=t.v.Object.extend("Comment"),n=new e;for(var r in l)if(l.hasOwnProperty(r)){if("at"===r)continue;var i=l[r];n.set(r,i)}n.set("emailHash",s(l.mail.toLowerCase().trim())),n.setACL(S()),n.save().then(function(e){p&&p.setItem("ValineCache",JSON.stringify({nick:l.nick,link:l.link,mail:l.mail}));var n=t.el.querySelector(".count");n.innerText=Number(n.innerText)+1,m(e,!0),y.removeAttribute("disabled"),t.submitting.hide(),t.nodata.hide(),t.reset()}).catch(function(e){t.submitting.hide()})},L=function(e){d.on("click",e,function(n){var r=e.getAttribute("at"),i=e.getAttribute("rid");l.rid=i,l.at=r,x.comment.value=r+" ,"+x.comment.value,x.comment.focus(),t.el.querySelector(".comment_trigger").setAttribute("style","display:none"),t.el.querySelector(".auth-section").removeAttribute("style"),t.el.querySelector(".veditor").focus()})};d.off("click",y,_),d.on("click",y,_)}}]),e}(),d={on:function(e,t,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n},off:function(e,t,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}},h={mail:function(e){return{k:/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(e),v:e}},link:function(e){return e.length>0&&(e=/^(http|https)/.test(e)?e:"http://"+e),{k:!(e.length>0)||/(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?/.test(e),v:e}}},f={encode:function(e){return e?e.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\'/g,"'").replace(/\"/g,"""):""},decode:function(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/'/g,"'").replace(/"/g,'"'):""}},v=function(e){try{var t=e.getTime(),n=(new Date).getTime(),r=n-t,i=Math.floor(r/864e5);if(0===i){var a=r%864e5,o=Math.floor(a/36e5);if(0===o){var s=a%36e5,l=Math.floor(s/6e4);if(0===l){var c=s%6e4;return Math.round(c/1e3)+" 秒前"}return l+" 分钟前"}return o+" 小时前"}return i<0?"刚刚":i<30?i+" 天前":i<365?Math.floor(i/30)+" 月前":Math.floor(i/365)+" 年前"}catch(e){console.log(e)}},g=function(){$.getJSON("https://api.ipify.org/?format=jsonp?callback=?",function(e){l.ip=e.ip})};e.exports=u},function(e,t,n){t=e.exports=n(5)(!1),t.push([e.i,'@charset "UTF-8";\n.valine {\n /************ Loading ************/ }\n .valine * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n font-size: 100%;\n font-weight: normal;\n line-height: 1.42857143;\n color: #3c484e;\n -webkit-transition: all .3s ease;\n transition: all .3s ease;\n margin: 0;\n padding: 0; }\n .valine .vwrap {\n overflow: hidden;\n position: relative;\n border: 1px solid #ededed; }\n .valine .vwrap .comment-smiles {\n margin: 0;\n padding: 0 1em;\n margin: .5em 0; }\n .valine .vwrap .comment-smiles .vsmile-btn-wrap {\n width: 100%;\n height: 1.7em; }\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg {\n fill: #aaaaaa;\n cursor: pointer; }\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg:hover {\n fill: #777777; }\n .valine .vwrap .comment-smiles .vsmile-icons {\n padding: .2em 0;\n margin: .3em 0;\n border-top: 1px solid #ededed;\n border-radius: 0;\n max-height: 64px;\n overflow: auto; }\n .valine .vwrap .comment-smiles .vsmile-icons img {\n width: auto !important;\n height: 28px !important;\n margin-right: 4px;\n cursor: pointer; }\n .valine .vwrap .textarea-wrapper {\n color: #4b5b62;\n width: 100%;\n height: 100%;\n background: #fff;\n position: relative;\n border-radius: 0; }\n .valine .vwrap .textarea-wrapper .comment_trigger {\n position: absolute;\n z-index: 10;\n width: 100%;\n height: 100%;\n background-color: #fff;\n padding: 0 1em; }\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar {\n position: absolute;\n width: 3em;\n height: 3em;\n position: absolute;\n top: 50%;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%); }\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar img {\n border-radius: 100%;\n width: 3em;\n height: 3em; }\n .valine .vwrap .textarea-wrapper .comment_trigger .trigger_title {\n position: absolute;\n top: 50%;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%);\n color: #aaa;\n font-size: 1.4em;\n margin-left: 3.5em; }\n .valine .vwrap .textarea-wrapper textarea {\n padding: 1em 1em 0;\n color: #4b5b62;\n width: 100%;\n background: #fff;\n border: none;\n resize: none;\n min-height: 3em; }\n .valine .vwrap .textarea-wrapper textarea:focus {\n border-color: #c4c8cb;\n outline: 0; }\n .valine .vwrap .trigger-section {\n display: none; }\n .valine .vwrap .auth-section {\n display: -webkit-box;\n display: flex;\n display: -ms-flexbox;\n background: #fbfbfb;\n padding: .3em .6em; }\n .valine .vwrap .auth-section .input-wrapper {\n -ms-flex: 1 1 27%;\n -webkit-box-flex: 1;\n flex: 1 1 27%;\n width: 27%; }\n .valine .vwrap .auth-section .input-wrapper input {\n color: #4b5b62;\n background: #fafafa;\n border: none;\n border-radius: 0;\n padding: .6em;\n margin: 0;\n line-height: 2;\n font-size: 1em !important; }\n .valine .vwrap .auth-section .input-wrapper input:focus {\n border-color: #c4c8cb;\n outline: 0; }\n .valine .vwrap .auth-section input {\n width: 100%; }\n .valine .vwrap .auth-section .post-action {\n -ms-flex: 1 1 19%;\n -webkit-box-flex: 1;\n flex: 1 1 19%;\n width: 19%;\n margin: 0;\n padding: 2px 0 0; }\n .valine .vwrap .auth-section .post-action button {\n color: #fff;\n width: 100%;\n line-height: 2;\n font-weight: bolder;\n border-radius: 30px;\n border: 1px solid #e9eff3;\n background-color: #111;\n padding: .4em .5em;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n font-size: 1em !important; }\n .valine .vwrap .auth-section .post-action button:hover {\n background-color: #444; }\n @media screen and (max-width: 720px) {\n .valine .vwrap .auth-section {\n display: block; }\n .valine .vwrap .auth-section .input-wrapper, .valine .vwrap .auth-section .post-action {\n -ms-flex: 1 1 100%;\n -webkit-box-flex: 1;\n flex: 1 1 100%;\n padding-right: 0;\n width: 100%; } }\n .valine .vwrap .vmark {\n position: absolute;\n background: rgba(0, 0, 0, 0.65);\n width: 100%;\n height: 100%;\n left: 0;\n top: 0; }\n .valine .vwrap .vmark .valert {\n padding: 3em 0 0 0; }\n .valine .vwrap .vmark .valert .vtext {\n color: #fff;\n padding: 15px; }\n .valine .vwrap .vmark .valert .vcode {\n width: 75px;\n border-radius: 5px;\n background: #dedede; }\n .valine .vwrap .vmark .valert .vcode:focus {\n border-color: #3090e4;\n background-color: #fff; }\n @media screen and (max-width: 720px) {\n .valine .vwrap .vmark .valert {\n padding: 8em 0; }\n .valine .vwrap .vmark .valert .vtext {\n color: #fff;\n padding: 10px; } }\n .valine .info {\n padding: 5px;\n margin: .5em 0; }\n .valine .info .col {\n display: inline-block;\n vertical-align: middle; }\n .valine .info svg {\n margin-right: 2px;\n overflow: hidden;\n fill: currentColor; }\n .valine .power {\n color: #999;\n font-size: 0.625em !important;\n position: relative; }\n .valine a {\n text-decoration: none;\n color: #3eb0ef; }\n .valine ul,\n .valine li {\n list-style: none; }\n .valine .txt-center {\n text-align: center; }\n .valine .float-right {\n float: right !important; }\n .valine .pd5 {\n padding: 5px; }\n .valine .pd10 {\n padding: 10px; }\n .valine .vbtn {\n display: inline-block;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: 1px solid #e9eff3;\n background-color: #333;\n border-radius: .1em;\n color: #fff;\n padding: .5em 1.5em;\n cursor: pointer;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n outline: none;\n min-width: 60px;\n max-width: 100%;\n margin: 0 1em; }\n .valine .vbtn:active,\n .valine .vbtn:hover {\n border-color: #666; }\n .valine .vpage {\n margin: 1.5em 0; }\n .valine .vpage .more {\n width: 100%;\n height: 2.5em;\n line-height: 2.5em;\n text-align: center;\n cursor: pointer;\n color: #666;\n background: #fafafa;\n border-radius: 1.25em; }\n .valine .vlist {\n width: 100%; }\n .valine .vlist .vcard {\n display: -webkit-box;\n display: flex;\n display: -ms-flexbox;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n padding: 2em 1em;\n border: 1px solid rgba(150, 150, 150, 0.18);\n margin: 2em 0 0;\n list-style: none;\n border-radius: 5px;\n word-break: break-all; }\n .valine .vlist .vcard:hover {\n border: 1px solid rgba(150, 150, 150, 0.25); }\n .valine .vlist .vcard:hover .vat {\n background: #111 !important; }\n .valine .vlist .vcard .vfooter {\n margin: -2em 0 0; }\n .valine .vlist .vcard .vfooter .vat {\n background: transparent;\n color: #ffffff;\n padding: .2em 1em;\n line-height: 1.6;\n cursor: pointer;\n word-break: keep-all;\n text-transform: uppercase; }\n .valine .vlist .vcard .vavatar {\n -webkit-box-flex: 0;\n flex: 0 0 auto;\n -ms-flex: 0 0 auto;\n margin-right: 1em;\n margin-top: 0.1em;\n display: inline-block;\n height: 3em;\n width: 3em;\n position: relative;\n border-radius: 50%; }\n .valine .vlist .vcard .vavatar:hover {\n transform: rotate(1turn);\n -webkit-transform: rotate(1turn); }\n .valine .vlist .vcard .text-wrapper {\n overflow: hidden;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n width: 100%; }\n .valine .vlist .vcard .text-wrapper .vhead {\n line-height: 1;\n margin-bottom: 1em; }\n .valine .vlist .vcard .text-wrapper .vhead a {\n font-weight: bolder;\n font-size: 1em;\n color: rgba(0, 0, 0, 0.7); }\n .valine .vlist .vcard .text-wrapper .vhead .spacer {\n color: #ccc;\n margin-left: 0.3em;\n margin-right: 0.3em; }\n .valine .vlist .vcard .text-wrapper .vhead .vtime {\n color: #a9a4a4;\n display: inline-block;\n font-weight: normal; }\n .valine .vlist .vcard .text-wrapper .vcomment {\n position: relative; }\n .valine .vlist .vcard .text-wrapper .vcomment p {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: break-all;\n text-align: justify;\n line-height: 1.8; }\n .valine .vlist .vcard .text-wrapper .vcomment pre {\n overflow: auto;\n padding: 6px 10px;\n word-wrap: break-word;\n color: #555;\n background: #f5f2f2;\n border-radius: 3px;\n font-size: .875rem;\n margin: 5px 0; }\n .valine .vlist .vcard .text-wrapper .vcomment.expand {\n cursor: pointer;\n max-height: 11.25rem;\n overflow: hidden; }\n .valine .vlist .vcard .text-wrapper .vcomment.expand:before {\n display: block;\n content: "";\n position: absolute;\n width: 100%;\n left: 0;\n top: 0;\n bottom: 3.15rem;\n pointer-events: none;\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.8)));\n background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8)); }\n .valine .vlist .vcard .text-wrapper .vcomment.expand:after {\n display: block;\n content: "\\5C55\\5F00 ";\n text-align: center;\n color: #828586;\n position: absolute;\n width: 100%;\n height: 3.15rem;\n line-height: 3.15rem;\n left: 0;\n bottom: 0;\n pointer-events: none;\n background: rgba(255, 255, 255, 0.9); }\n .valine .vlist .vempty {\n padding: 20px;\n text-align: center;\n color: #999; }\n .valine .spinner {\n margin: 10px auto;\n width: 50px;\n height: 30px;\n text-align: center;\n font-size: 10px; }\n .valine .spinner > div {\n background-color: #9c9c9c;\n height: 100%;\n width: 6px;\n margin-right: 3px;\n display: inline-block;\n -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;\n animation: sk-stretchdelay 1.2s infinite ease-in-out; }\n .valine .spinner .r2 {\n -webkit-animation-delay: -1.1s;\n animation-delay: -1.1s; }\n .valine .spinner .r3 {\n -webkit-animation-delay: -1.0s;\n animation-delay: -1.0s; }\n .valine .spinner .r4 {\n -webkit-animation-delay: -0.9s;\n animation-delay: -0.9s; }\n .valine .spinner .r5 {\n -webkit-animation-delay: -0.8s;\n animation-delay: -0.8s; }\n\n@-webkit-keyframes sk-stretchdelay {\n 0%,\n 40%,\n 100% {\n -webkit-transform: scaleY(0.4); }\n 20% {\n -webkit-transform: scaleY(1); } }\n\n@keyframes sk-stretchdelay {\n 0%,\n 40%,\n 100% {\n transform: scaleY(0.4);\n -webkit-transform: scaleY(0.4); }\n 20% {\n transform: scaleY(1);\n -webkit-transform: scaleY(1); } }\n',""])},function(e,t){function n(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var a=r(i);return[n].concat(i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"})).concat([a]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i=0&&x.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",c(t,e.attrs),a(e,t),t}function l(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",c(t,e.attrs),a(e,t),t}function c(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function p(e,t){var n,r,i,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var c=b++;n=m||(m=s(t)),r=u.bind(null,n,c,!1),i=u.bind(null,n,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=l(t),r=h.bind(null,n,t),i=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=d.bind(null,n),i=function(){o(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}function u(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=k(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function d(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function h(e,t,n){var r=n.css,i=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(r=w(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var f={},v=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),g=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e.call(this,n)),t[n]}}(function(e){return document.querySelector(e)}),m=null,b=0,x=[],w=n(7);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=v()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=i(e,t);return r(n,t),function(e){for(var a=[],o=0;o>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,t){return e<>>32-t}function s(e,t,n,r,i,s){return a(o(a(a(t,e),a(r,s)),i),n)}function l(e,t,n,r,i,a,o){return s(t&n|~t&r,e,t,i,a,o)}function c(e,t,n,r,i,a,o){return s(t&r|n&~r,e,t,i,a,o)}function p(e,t,n,r,i,a,o){return s(t^n^r,e,t,i,a,o)}function u(e,t,n,r,i,a,o){return s(n^(t|~r),e,t,i,a,o)}function d(e,t){e[t>>5]|=128<>>9<<4)]=t;var n,r,i,o,s,d=1732584193,h=-271733879,f=-1732584194,v=271733878;for(n=0;n>5]>>>t%32&255);return n}function f(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<16&&(i=d(i,8*e.length)),n=0;n<16;n+=1)a[n]=909522486^i[n],o[n]=1549556828^i[n];return r=d(a.concat(f(t)),512+8*t.length),h(d(o.concat(r),640))}function m(e){var t,n,r="0123456789abcdef",i="";for(n=0;n>>4&15)+r.charAt(15&t);return i}function b(e){return unescape(encodeURIComponent(e))}function x(e){return v(b(e))}function w(e){return m(x(e))}function k(e,t){return g(b(e),b(t))}function y(e,t){return m(k(e,t))}function _(e,t,n){return t?n?k(t,e):y(t,e):n?x(e):w(e)}void 0!==(r=function(){return _}.call(t,n,t,e))&&(e.exports=r)}()},function(e,t,n){(function(t){!function(t){"use strict";function n(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=f.normal,this.options.gfm&&(this.options.tables?this.rules=f.tables:this.rules=f.gfm)}function r(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=v.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=v.breaks:this.rules=v.gfm:this.options.pedantic&&(this.rules=v.pedantic)}function i(e){this.options=e||{}}function a(){}function o(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function c(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=n.source||n,n=n.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function p(e,t){return g[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?g[" "+e]=e+"/":g[" "+e]=e.replace(/[^\/]*$/,"")),e=g[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}function u(){}function d(e){for(var t,n,r=1;rAn error occurred:

    "+s(e.message+"",!0)+"
    ";throw e}}var f={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};f._label=/(?:\\[\[\]]|[^\[\]])+/,f._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,f.def=c(f.def).replace("label",f._label).replace("title",f._title).getRegex(),f.bullet=/(?:[*+-]|\d+\.)/,f.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,f.item=c(f.item,"gm").replace(/bull/g,f.bullet).getRegex(),f.list=c(f.list).replace(/bull/g,f.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+f.def.source+")").getRegex(),f._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",f.html=c(f.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,f._tag).getRegex(),f.paragraph=c(f.paragraph).replace("hr",f.hr).replace("heading",f.heading).replace("lheading",f.lheading).replace("tag","<"+f._tag).getRegex(),f.blockquote=c(f.blockquote).replace("paragraph",f.paragraph).getRegex(),f.normal=d({},f),f.gfm=d({},f.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),f.gfm.paragraph=c(f.paragraph).replace("(?!","(?!"+f.gfm.fences.source.replace("\\1","\\2")+"|"+f.list.source.replace("\\1","\\3")+"|").getRegex(),f.tables=d({},f.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=f,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,t){e=e.replace(/^ +$/gm,"");for(var n,r,i,a,o,s,l,c,p,u,d;e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),s={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},c=0;c ?/gm,""),this.token(i,t),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),a=i[2],d=a.length>1,this.tokens.push({type:"list_start",ordered:d,start:d?+a:""}),i=i[0].match(this.rules.item),n=!1,u=i.length,c=0;c1&&o.length>1||(e=i.slice(c+1).join("\n")+e,c=u-1)),r=n||/\n\n(?!\s*$)/.test(s),c!==u-1&&(n="\n"===s.charAt(s.length-1),r||(r=n)),this.tokens.push({type:r?"loose_item_start":"list_item_start"}),this.token(s,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),p=i[1].toLowerCase(),this.tokens.links[p]||(this.tokens.links[p]={href:i[2],title:i[3]});else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),s={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:u,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,v.link=c(v.link).replace("inside",v._inside).replace("href",v._href).getRegex(),v.reflink=c(v.reflink).replace("inside",v._inside).getRegex(),v.normal=d({},v),v.pedantic=d({},v.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),v.gfm=d({},v.normal,{escape:c(v.escape).replace("])","~|])").getRegex(),url:c(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",v._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(v.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),v.breaks=d({},v.gfm,{br:c(v.br).replace("{2,}","*").getRegex(),text:c(v.gfm.text).replace("{2,}","*").getRegex()}),r.rules=v,r.output=function(e,t,n){return new r(t,n).output(e)},r.prototype.output=function(e){for(var t,n,r,i,a="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),a+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=s(this.mangle(i[1])),r="mailto:"+n):(n=s(i[1]),r=n),a+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),a+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,a+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){a+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,a+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),a+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),a+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),a+=this.renderer.codespan(s(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),a+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),a+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),a+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else i[0]=this.rules._backpedal.exec(i[0])[0],e=e.substring(i[0].length),"@"===i[2]?(n=s(i[0]),r="mailto:"+n):(n=s(i[0]),r="www."===i[1]?"http://"+n:n),a+=this.renderer.link(r,null,n);return a},r.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:s(e,!0))+"\n
    \n":"
    "+(n?e:s(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(l(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!m.test(e)&&(e=p(this.options.baseUrl,e));var i='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!m.test(e)&&(e=p(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},a.prototype.strong=a.prototype.em=a.prototype.codespan=a.prototype.del=a.prototype.text=function(e){return e},a.prototype.link=a.prototype.image=function(e,t,n){return""+n},a.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new r(e.links,this.options),this.inlineText=new r(e.links,d({},this.options,{renderer:new a})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,l(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",a="";for(n="",e=0;e\n
    \n
    \n
    \n
    '+i+'
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n \n \n
    \n \n \n
    \n
    \n
    ';t.el.innerHTML=a;var o=t.el.querySelector(".vempty");t.nodata={show:function(e){o.innerHTML=e||"还没有评论哦,快来抢沙发吧!",o.setAttribute("style","display:block;")},hide:function(){o.setAttribute("style","display:none;")}},t.nodata.show();var s=t.el.querySelector(".vsmile-icons"),p=e.emoticon_list||["mrgreen","neutral","twisted","arrow","eek","smile","confused","cool","evil","biggrin","idea","redface","razz","rolleyes","wink","cry","surprised","lol","mad","sad","exclaim","question"];for(var u in p){var h=document.createElement("img");h.setAttribute("src",e.emoticon_url+"/"+p[u]),s.appendChild(h)}n.init({appId:e.app_id||e.appId,appKey:e.app_key||e.appKey}),t.v=n}catch(e){var f="https://github.com/panjunwen/Valine/issues";return void(t.el?t.nodata.show('
    '+e+"
    Valine:"+t.version+"
    反馈:"+f+"
    "):console&&console.log("%c"+e+"\n%cValine%c"+t.version+" "+f,"color:red;","background:#000;padding:5px;line-height:30px;color:#fff;","background:#456;line-height:30px;padding:5px;color:#fff;"))}var v='
    ',g=t.el.querySelector(".vloading");g.innerHTML=v,t.loading={show:function(){g.setAttribute("style","display:block;"),t.nodata.hide()},hide:function(){g.setAttribute("style","display:none;"),0===t.el.querySelectorAll(".vcard").length&&t.nodata.show()}};var m=t.el.querySelector(".vsubmitting");m.innerHTML=v,t.submitting={show:function(){m.setAttribute("style","display:block;")},hide:function(){m.setAttribute("style","display:none;"),t.nodata.hide()}};var b=t.el.querySelector(".vmark");t.alert={show:function(e){b.innerHTML='
    '+e.text+'
    ';var n=b.querySelector(".vbtns"),r='",i='";if(n.innerHTML=""+r+(e.type&&i),b.querySelector(".vcancel").addEventListener("click",function(e){t.alert.hide()}),b.setAttribute("style","display:block;"),e&&e.type){var a=b.querySelector(".vsure");d.on("click",a,function(n){t.alert.hide(),e.cb&&e.cb()})}},hide:function(){b.setAttribute("style","display:none;")}},t.loading.show();var x=new t.v.Query("Comment");x.equalTo("url",l.url),x.count().then(function(n){t.el.querySelector(".count").innerHTML=""+n,t.bind(e)},function(e){console.log(e)})}},{key:"bind",value:function(e){var t=this,n=t.el.querySelector(".vsmile-icons");d.on("click",n,function(e){var n=t.el.querySelector(".veditor"),r=e.target.src;if(void 0!==r){var i="!(:"+decodeURI(r).replace(/^.*\/(.*)$/,"$1")+":)";if(document.selection)n.focus(),sel=document.selection.createRange(),sel.text=i,n.focus();else if(n.selectionStart||"0"==n.selectionStart){var a=n.selectionStart,o=n.selectionEnd,s=o;n.value=n.value.substring(0,a)+i+n.value.substring(o,n.value.length),s+=i.length,n.focus(),n.selectionStart=s,n.selectionEnd=s}else n.value+=i,n.focus();l.comment=n.value;var c=t.el.querySelector(".vsubmit");c.getAttribute("disabled")&&c.removeAttribute("disabled")}});var r=t.el.querySelector(".comment_trigger");d.on("click",r,function(e){r.setAttribute("style","display:none"),t.el.querySelector(".auth-section").removeAttribute("style"),t.el.querySelector(".veditor").focus()});var i=t.el.querySelector(".vsmile-btn"),a=t.el.querySelector(".vsmile-icons");d.on("click",i,function(e){a.getAttribute("triggered")?(a.setAttribute("style","display:none;"),a.removeAttribute("triggered")):(a.removeAttribute("style"),a.setAttribute("triggered",1))});var c=function(e){e.offsetHeight>180&&(e.classList.add("expand"),d.on("click",e,function(t){e.setAttribute("class","vcomment")}))},u=function(){var e=new t.v.Query("Comment");return e.select(["nick","comment","link","rid","emailHash"]),e.notEqualTo("isSpam",!0),e.equalTo("url",l.url),e.addDescending("createdAt"),e},g=1;!function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.loading.show();var r=Number(t.el.querySelector(".count").innerText),i=u();i.limit(10),i.skip(10*(n-1)),i.find().then(function(i){var a=i.length;if(a){for(var o=0;o加载更多评论(剩余'+(r-10*n)+"/"+r+"条)":"";var l=s.querySelector("#vmore");l&&d.on("click",l,function(t){s.innerHTML="",e(++g)})}t.loading.hide()}).catch(function(e){console.log(e),t.loading.hide()})}();var m=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=document.createElement("li");r.setAttribute("class","vcard"),r.setAttribute("id",e.id);var i="d41d8cd98f00b204e9800998ecf8427e"==e.get("emailHash")?"9e63c80900d106cbbec5a9f4ea433a3e":e.get("emailHash"),a="https://gravatar.loli.net/avatar/"+i+"?size=80";r.innerHTML='\n
    \n
    \n '+e.get("nick")+'\n \n '+v(e.get("createdAt"))+'\n
    \n
    '+e.get("comment")+'
    \n \n
    \n
    \n 回复';for(var o=t.el.querySelector(".vlist"),s=o.querySelectorAll("li"),l=r.querySelector(".vat"),p=r.querySelectorAll("a"),u=0,d=p.length;u-1&&""!=l.at){var r='"+l.at+"";l.comment=l.comment.replace(l.at,r)}var i=h.mail(l.mail),a=h.link(l.link);l.mail=i.k?i.v:"",l.link=a.k?a.v:"",i.k||a.k?i.k?a.k?A():t.alert.show({type:1,text:"您的网址格式不正确, 是否继续提交?",cb:function(){A()}}):t.alert.show({type:1,text:"您的邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?",cb:function(){A()}}):t.alert.show({type:1,text:"您的网址和邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?",cb:function(){A()}})},S=function(){var e=new t.v.ACL;return e.setPublicReadAccess(!0),e.setPublicWriteAccess(!1),e},A=function(){y.setAttribute("disabled",!0),t.submitting.show();var e=t.v.Object.extend("Comment"),n=new e;for(var r in l)if(l.hasOwnProperty(r)){if("at"===r)continue;var i=l[r];n.set(r,i)}n.set("emailHash",s(l.mail.toLowerCase().trim())),n.setACL(S()),n.save().then(function(e){p&&p.setItem("ValineCache",JSON.stringify({nick:l.nick,link:l.link,mail:l.mail}));var n=t.el.querySelector(".count");n.innerText=Number(n.innerText)+1,m(e,!0),y.removeAttribute("disabled"),t.submitting.hide(),t.nodata.hide(),t.reset()}).catch(function(e){t.submitting.hide()})},L=function(e){d.on("click",e,function(n){var r=e.getAttribute("at"),i=e.getAttribute("rid");l.rid=i,l.at=r,x.comment.value=r+" ,"+x.comment.value,x.comment.focus(),t.el.querySelector(".comment_trigger").setAttribute("style","display:none"),t.el.querySelector(".auth-section").removeAttribute("style"),t.el.querySelector(".veditor").focus()})};d.off("click",y,_),d.on("click",y,_)}}]),e}(),d={on:function(e,t,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n},off:function(e,t,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}},h={mail:function(e){return{k:/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(e),v:e}},link:function(e){return e.length>0&&(e=/^(http|https)/.test(e)?e:"http://"+e),{k:!(e.length>0)||/(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?/.test(e),v:e}}},f={encode:function(e){return e?e.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\'/g,"'").replace(/\"/g,"""):""},decode:function(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/'/g,"'").replace(/"/g,'"'):""}},v=function(e){try{var t=e.getTime(),n=(new Date).getTime(),r=n-t,i=Math.floor(r/864e5);if(0===i){var a=r%864e5,o=Math.floor(a/36e5);if(0===o){var s=a%36e5,l=Math.floor(s/6e4);if(0===l){var c=s%6e4;return Math.round(c/1e3)+" 秒前"}return l+" 分钟前"}return o+" 小时前"}return i<0?"刚刚":i<30?i+" 天前":i<365?Math.floor(i/30)+" 月前":Math.floor(i/365)+" 年前"}catch(e){console.log(e)}},g=function(){$.getJSON("https://api.ipify.org/?format=json",function(e){l.ip=e.ip})};e.exports=u},function(e,t,n){t=e.exports=n(5)(!1),t.push([e.i,'@charset "UTF-8";\n.valine {\n /************ Loading ************/ }\n .valine * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n font-size: 100%;\n font-weight: normal;\n line-height: 1.42857143;\n color: #3c484e;\n -webkit-transition: all .3s ease;\n transition: all .3s ease;\n margin: 0;\n padding: 0; }\n .valine .vwrap {\n overflow: hidden;\n position: relative;\n border: 1px solid #ededed; }\n .valine .vwrap .comment-smiles {\n margin: 0;\n padding: 0 1em;\n margin: .5em 0; }\n .valine .vwrap .comment-smiles .vsmile-btn-wrap {\n width: 100%;\n height: 1.7em; }\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg {\n fill: #aaaaaa;\n cursor: pointer; }\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg:hover {\n fill: #777777; }\n .valine .vwrap .comment-smiles .vsmile-icons {\n padding: .2em 0;\n margin: .3em 0;\n border-top: 1px solid #ededed;\n border-radius: 0;\n max-height: 64px;\n overflow: auto; }\n .valine .vwrap .comment-smiles .vsmile-icons img {\n width: auto !important;\n height: 28px !important;\n margin-right: 4px;\n cursor: pointer; }\n .valine .vwrap .textarea-wrapper {\n color: #4b5b62;\n width: 100%;\n height: 100%;\n background: #fff;\n position: relative;\n border-radius: 0; }\n .valine .vwrap .textarea-wrapper .comment_trigger {\n position: absolute;\n z-index: 10;\n width: 100%;\n height: 100%;\n background-color: #fff;\n padding: 0 1em; }\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar {\n position: absolute;\n width: 3em;\n height: 3em;\n position: absolute;\n top: 50%;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%); }\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar img {\n border-radius: 100%;\n width: 3em;\n height: 3em; }\n .valine .vwrap .textarea-wrapper .comment_trigger .trigger_title {\n position: absolute;\n top: 50%;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%);\n color: #aaa;\n font-size: 1.4em;\n margin-left: 3.5em; }\n .valine .vwrap .textarea-wrapper textarea {\n padding: 1em 1em 0;\n color: #4b5b62;\n width: 100%;\n background: #fff;\n border: none;\n resize: none;\n min-height: 3em; }\n .valine .vwrap .textarea-wrapper textarea:focus {\n border-color: #c4c8cb;\n outline: 0; }\n .valine .vwrap .trigger-section {\n display: none; }\n .valine .vwrap .auth-section {\n display: -webkit-box;\n display: flex;\n display: -ms-flexbox;\n background: #fbfbfb;\n padding: .3em .6em; }\n .valine .vwrap .auth-section .input-wrapper {\n -ms-flex: 1 1 27%;\n -webkit-box-flex: 1;\n flex: 1 1 27%;\n width: 27%; }\n .valine .vwrap .auth-section .input-wrapper input {\n color: #4b5b62;\n background: #fafafa;\n border: none;\n border-radius: 0;\n padding: .6em;\n margin: 0;\n line-height: 2;\n font-size: 1em !important; }\n .valine .vwrap .auth-section .input-wrapper input:focus {\n border-color: #c4c8cb;\n outline: 0; }\n .valine .vwrap .auth-section input {\n width: 100%; }\n .valine .vwrap .auth-section .post-action {\n -ms-flex: 1 1 19%;\n -webkit-box-flex: 1;\n flex: 1 1 19%;\n width: 19%;\n margin: 0;\n padding: 2px 0 0; }\n .valine .vwrap .auth-section .post-action button {\n color: #fff;\n width: 100%;\n line-height: 2;\n font-weight: bolder;\n border-radius: 30px;\n border: 1px solid #e9eff3;\n background-color: #111;\n padding: .4em .5em;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n font-size: 1em !important; }\n .valine .vwrap .auth-section .post-action button:hover {\n background-color: #444; }\n @media screen and (max-width: 720px) {\n .valine .vwrap .auth-section {\n display: block; }\n .valine .vwrap .auth-section .input-wrapper, .valine .vwrap .auth-section .post-action {\n -ms-flex: 1 1 100%;\n -webkit-box-flex: 1;\n flex: 1 1 100%;\n padding-right: 0;\n width: 100%; } }\n .valine .vwrap .vmark {\n position: absolute;\n background: rgba(0, 0, 0, 0.65);\n width: 100%;\n height: 100%;\n left: 0;\n top: 0; }\n .valine .vwrap .vmark .valert {\n padding: 3em 0 0 0; }\n .valine .vwrap .vmark .valert .vtext {\n color: #fff;\n padding: 15px; }\n .valine .vwrap .vmark .valert .vcode {\n width: 75px;\n border-radius: 5px;\n background: #dedede; }\n .valine .vwrap .vmark .valert .vcode:focus {\n border-color: #3090e4;\n background-color: #fff; }\n @media screen and (max-width: 720px) {\n .valine .vwrap .vmark .valert {\n padding: 8em 0; }\n .valine .vwrap .vmark .valert .vtext {\n color: #fff;\n padding: 10px; } }\n .valine .info {\n padding: 5px;\n margin: .5em 0; }\n .valine .info .col {\n display: inline-block;\n vertical-align: middle; }\n .valine .info svg {\n margin-right: 2px;\n overflow: hidden;\n fill: currentColor; }\n .valine .power {\n color: #999;\n font-size: 0.625em !important;\n position: relative; }\n .valine a {\n text-decoration: none;\n color: #3eb0ef; }\n .valine ul,\n .valine li {\n list-style: none; }\n .valine .txt-center {\n text-align: center; }\n .valine .float-right {\n float: right !important; }\n .valine .pd5 {\n padding: 5px; }\n .valine .pd10 {\n padding: 10px; }\n .valine .vbtn {\n display: inline-block;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: 1px solid #e9eff3;\n background-color: #333;\n border-radius: .1em;\n color: #fff;\n padding: .5em 1.5em;\n cursor: pointer;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n outline: none;\n min-width: 60px;\n max-width: 100%;\n margin: 0 1em; }\n .valine .vbtn:active,\n .valine .vbtn:hover {\n border-color: #666; }\n .valine .vpage {\n margin: 1.5em 0; }\n .valine .vpage .more {\n width: 100%;\n height: 2.5em;\n line-height: 2.5em;\n text-align: center;\n cursor: pointer;\n color: #666;\n background: #fafafa;\n border-radius: 1.25em; }\n .valine .vlist {\n width: 100%; }\n .valine .vlist .vcard {\n display: -webkit-box;\n display: flex;\n display: -ms-flexbox;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n padding: 2em 1em;\n border: 1px solid rgba(150, 150, 150, 0.18);\n margin: 2em 0 0;\n list-style: none;\n border-radius: 5px;\n word-break: break-all; }\n .valine .vlist .vcard:hover {\n border: 1px solid rgba(150, 150, 150, 0.25); }\n .valine .vlist .vcard:hover .vat {\n background: #111 !important; }\n .valine .vlist .vcard .vfooter {\n margin: -2em 0 0; }\n .valine .vlist .vcard .vfooter .vat {\n background: transparent;\n color: #ffffff;\n padding: .2em 1em;\n line-height: 1.6;\n cursor: pointer;\n word-break: keep-all;\n text-transform: uppercase; }\n .valine .vlist .vcard .vavatar {\n -webkit-box-flex: 0;\n flex: 0 0 auto;\n -ms-flex: 0 0 auto;\n margin-right: 1em;\n margin-top: 0.1em;\n display: inline-block;\n height: 3em;\n width: 3em;\n position: relative;\n border-radius: 50%; }\n .valine .vlist .vcard .vavatar:hover {\n transform: rotate(1turn);\n -webkit-transform: rotate(1turn); }\n .valine .vlist .vcard .text-wrapper {\n overflow: hidden;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n width: 100%; }\n .valine .vlist .vcard .text-wrapper .vhead {\n line-height: 1;\n margin-bottom: 1em; }\n .valine .vlist .vcard .text-wrapper .vhead a {\n font-weight: bolder;\n font-size: 1em;\n color: rgba(0, 0, 0, 0.7); }\n .valine .vlist .vcard .text-wrapper .vhead .spacer {\n color: #ccc;\n margin-left: 0.3em;\n margin-right: 0.3em; }\n .valine .vlist .vcard .text-wrapper .vhead .vtime {\n color: #a9a4a4;\n display: inline-block;\n font-weight: normal; }\n .valine .vlist .vcard .text-wrapper .vcomment {\n position: relative; }\n .valine .vlist .vcard .text-wrapper .vcomment p {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: break-all;\n text-align: justify;\n line-height: 1.8; }\n .valine .vlist .vcard .text-wrapper .vcomment pre {\n overflow: auto;\n padding: 6px 10px;\n word-wrap: break-word;\n color: #555;\n background: #f5f2f2;\n border-radius: 3px;\n font-size: .875rem;\n margin: 5px 0; }\n .valine .vlist .vcard .text-wrapper .vcomment.expand {\n cursor: pointer;\n max-height: 11.25rem;\n overflow: hidden; }\n .valine .vlist .vcard .text-wrapper .vcomment.expand:before {\n display: block;\n content: "";\n position: absolute;\n width: 100%;\n left: 0;\n top: 0;\n bottom: 3.15rem;\n pointer-events: none;\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.8)));\n background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8)); }\n .valine .vlist .vcard .text-wrapper .vcomment.expand:after {\n display: block;\n content: "\\5C55\\5F00 ";\n text-align: center;\n color: #828586;\n position: absolute;\n width: 100%;\n height: 3.15rem;\n line-height: 3.15rem;\n left: 0;\n bottom: 0;\n pointer-events: none;\n background: rgba(255, 255, 255, 0.9); }\n .valine .vlist .vempty {\n padding: 20px;\n text-align: center;\n color: #999; }\n .valine .spinner {\n margin: 10px auto;\n width: 50px;\n height: 30px;\n text-align: center;\n font-size: 10px; }\n .valine .spinner > div {\n background-color: #9c9c9c;\n height: 100%;\n width: 6px;\n margin-right: 3px;\n display: inline-block;\n -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;\n animation: sk-stretchdelay 1.2s infinite ease-in-out; }\n .valine .spinner .r2 {\n -webkit-animation-delay: -1.1s;\n animation-delay: -1.1s; }\n .valine .spinner .r3 {\n -webkit-animation-delay: -1.0s;\n animation-delay: -1.0s; }\n .valine .spinner .r4 {\n -webkit-animation-delay: -0.9s;\n animation-delay: -0.9s; }\n .valine .spinner .r5 {\n -webkit-animation-delay: -0.8s;\n animation-delay: -0.8s; }\n\n@-webkit-keyframes sk-stretchdelay {\n 0%,\n 40%,\n 100% {\n -webkit-transform: scaleY(0.4); }\n 20% {\n -webkit-transform: scaleY(1); } }\n\n@keyframes sk-stretchdelay {\n 0%,\n 40%,\n 100% {\n transform: scaleY(0.4);\n -webkit-transform: scaleY(0.4); }\n 20% {\n transform: scaleY(1);\n -webkit-transform: scaleY(1); } }\n',""])},function(e,t){function n(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var a=r(i);return[n].concat(i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"})).concat([a]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i=0&&x.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",c(t,e.attrs),a(e,t),t}function l(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",c(t,e.attrs),a(e,t),t}function c(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function p(e,t){var n,r,i,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var c=b++;n=m||(m=s(t)),r=u.bind(null,n,c,!1),i=u.bind(null,n,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=l(t),r=h.bind(null,n,t),i=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=d.bind(null,n),i=function(){o(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}function u(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=k(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function d(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function h(e,t,n){var r=n.css,i=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(r=w(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var f={},v=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),g=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e.call(this,n)),t[n]}}(function(e){return document.querySelector(e)}),m=null,b=0,x=[],w=n(7);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=v()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=i(e,t);return r(n,t),function(e){for(var a=[],o=0;o> 16) + (y >> 16) + (lsw >> 16)\n return (msw << 16) | (lsw & 0xffff)\n }\n\n /*\n * Bitwise rotate a 32-bit number to the left.\n */\n function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }\n\n /*\n * These functions implement the four basic operations the algorithm uses.\n */\n function md5cmn (q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)\n }\n function md5ff (a, b, c, d, x, s, t) {\n return md5cmn((b & c) | (~b & d), a, b, x, s, t)\n }\n function md5gg (a, b, c, d, x, s, t) {\n return md5cmn((b & d) | (c & ~d), a, b, x, s, t)\n }\n function md5hh (a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t)\n }\n function md5ii (a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t)\n }\n\n /*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n function binlMD5 (x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << (len % 32)\n x[((len + 64) >>> 9 << 4) + 14] = len\n\n var i\n var olda\n var oldb\n var oldc\n var oldd\n var a = 1732584193\n var b = -271733879\n var c = -1732584194\n var d = 271733878\n\n for (i = 0; i < x.length; i += 16) {\n olda = a\n oldb = b\n oldc = c\n oldd = d\n\n a = md5ff(a, b, c, d, x[i], 7, -680876936)\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586)\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819)\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330)\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897)\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426)\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341)\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983)\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416)\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417)\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063)\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162)\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682)\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101)\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290)\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329)\n\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510)\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632)\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713)\n b = md5gg(b, c, d, a, x[i], 20, -373897302)\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691)\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083)\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335)\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848)\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438)\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690)\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961)\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501)\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467)\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784)\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473)\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734)\n\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558)\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463)\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562)\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556)\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060)\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353)\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632)\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640)\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174)\n d = md5hh(d, a, b, c, x[i], 11, -358537222)\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979)\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189)\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487)\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835)\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520)\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651)\n\n a = md5ii(a, b, c, d, x[i], 6, -198630844)\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415)\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905)\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055)\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571)\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606)\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523)\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799)\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359)\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744)\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380)\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649)\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070)\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379)\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259)\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551)\n\n a = safeAdd(a, olda)\n b = safeAdd(b, oldb)\n c = safeAdd(c, oldc)\n d = safeAdd(d, oldd)\n }\n return [a, b, c, d]\n }\n\n /*\n * Convert an array of little-endian words to a string\n */\n function binl2rstr (input) {\n var i\n var output = ''\n var length32 = input.length * 32\n for (i = 0; i < length32; i += 8) {\n output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff)\n }\n return output\n }\n\n /*\n * Convert a raw string to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n function rstr2binl (input) {\n var i\n var output = []\n output[(input.length >> 2) - 1] = undefined\n for (i = 0; i < output.length; i += 1) {\n output[i] = 0\n }\n var length8 = input.length * 8\n for (i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32)\n }\n return output\n }\n\n /*\n * Calculate the MD5 of a raw string\n */\n function rstrMD5 (s) {\n return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))\n }\n\n /*\n * Calculate the HMAC-MD5, of a key and some data (raw strings)\n */\n function rstrHMACMD5 (key, data) {\n var i\n var bkey = rstr2binl(key)\n var ipad = []\n var opad = []\n var hash\n ipad[15] = opad[15] = undefined\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636\n opad[i] = bkey[i] ^ 0x5c5c5c5c\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))\n }\n\n /*\n * Convert a raw string to a hex string\n */\n function rstr2hex (input) {\n var hexTab = '0123456789abcdef'\n var output = ''\n var x\n var i\n for (i = 0; i < input.length; i += 1) {\n x = input.charCodeAt(i)\n output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f)\n }\n return output\n }\n\n /*\n * Encode a string as utf-8\n */\n function str2rstrUTF8 (input) {\n return unescape(encodeURIComponent(input))\n }\n\n /*\n * Take string arguments and return either raw or hex encoded strings\n */\n function rawMD5 (s) {\n return rstrMD5(str2rstrUTF8(s))\n }\n function hexMD5 (s) {\n return rstr2hex(rawMD5(s))\n }\n function rawHMACMD5 (k, d) {\n return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d))\n }\n function hexHMACMD5 (k, d) {\n return rstr2hex(rawHMACMD5(k, d))\n }\n\n function md5 (string, key, raw) {\n if (!key) {\n if (!raw) {\n return hexMD5(string)\n }\n return rawMD5(string)\n }\n if (!raw) {\n return hexHMACMD5(key, string)\n }\n return rawHMACMD5(key, string)\n }\n\n if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n return md5\n }.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))\n } else if (typeof module === 'object' && module.exports) {\n module.exports = md5\n } else {\n $.md5 = md5\n }\n})(this)\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {/**\n * marked - a markdown parser\n * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n;(function(root) {\n'use strict';\n\n/**\n * Block-Level Grammar\n */\n\nvar block = {\n newline: /^\\n+/,\n code: /^( {4}[^\\n]+\\n*)+/,\n fences: noop,\n hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)/,\n heading: /^ *(#{1,6}) *([^\\n]+?) *#* *(?:\\n+|$)/,\n nptable: noop,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( *)(bull) [\\s\\S]+?(?:hr|def|\\n{2,}(?! )(?!\\1bull )\\n*|\\s*$)/,\n html: /^ *(?:comment *(?:\\n|\\s*$)|closed *(?:\\n{2,}|\\s*$)|closing *(?:\\n{2,}|\\s*$))/,\n def: /^ {0,3}\\[(label)\\]: *\\n? *]+)>?(?:(?: +\\n? *| *\\n *)(title))? *(?:\\n+|$)/,\n table: noop,\n lheading: /^([^\\n]+)\\n *(=|-){2,} *(?:\\n+|$)/,\n paragraph: /^([^\\n]+(?:\\n?(?!hr|heading|lheading| {0,3}>|tag)[^\\n]+)+)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?:\\\\[\\[\\]]|[^\\[\\]])+/;\nblock._title = /(?:\"(?:\\\\\"|[^\"]|\"[^\"\\n]*\")*\"|'\\n?(?:[^'\\n]+\\n?)*'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d+\\.)/;\nblock.item = /^( *)(bull) [^\\n]*(?:\\n(?!\\1bull )[^\\n]*)*/;\nblock.item = edit(block.item, 'gm')\n .replace(/bull/g, block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'\n + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'\n + '|span|br|wbr|ins|del|img)\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b';\n\nblock.html = edit(block.html)\n .replace('comment', //)\n .replace('closed', /<(tag)[\\s\\S]+?<\\/\\1>/)\n .replace('closing', /\\s]*)*?\\/?>/)\n .replace(/tag/g, block._tag)\n .getRegex();\n\nblock.paragraph = edit(block.paragraph)\n .replace('hr', block.hr)\n .replace('heading', block.heading)\n .replace('lheading', block.lheading)\n .replace('tag', '<' + block._tag)\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = merge({}, block);\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = merge({}, block.normal, {\n fences: /^ *(`{3,}|~{3,})[ \\.]*(\\S+)? *\\n([\\s\\S]*?)\\n? *\\1 *(?:\\n+|$)/,\n paragraph: /^/,\n heading: /^ *(#{1,6}) +([^\\n]+?) *#* *(?:\\n+|$)/\n});\n\nblock.gfm.paragraph = edit(block.paragraph)\n .replace('(?!', '(?!'\n + block.gfm.fences.source.replace('\\\\1', '\\\\2') + '|'\n + block.list.source.replace('\\\\1', '\\\\3') + '|')\n .getRegex();\n\n/**\n * GFM + Tables Block Grammar\n */\n\nblock.tables = merge({}, block.gfm, {\n nptable: /^ *(\\S.*\\|.*)\\n *([-:]+ *\\|[-| :]*)\\n((?:.*\\|.*(?:\\n|$))*)\\n*/,\n table: /^ *\\|(.+)\\n *\\|( *[-:]+[-| :]*)\\n((?: *\\|.*(?:\\n|$))*)\\n*/\n});\n\n/**\n * Block Lexer\n */\n\nfunction Lexer(options) {\n this.tokens = [];\n this.tokens.links = {};\n this.options = options || marked.defaults;\n this.rules = block.normal;\n\n if (this.options.gfm) {\n if (this.options.tables) {\n this.rules = block.tables;\n } else {\n this.rules = block.gfm;\n }\n }\n}\n\n/**\n * Expose Block Rules\n */\n\nLexer.rules = block;\n\n/**\n * Static Lex Method\n */\n\nLexer.lex = function(src, options) {\n var lexer = new Lexer(options);\n return lexer.lex(src);\n};\n\n/**\n * Preprocessing\n */\n\nLexer.prototype.lex = function(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n')\n .replace(/\\t/g, ' ')\n .replace(/\\u00a0/g, ' ')\n .replace(/\\u2424/g, '\\n');\n\n return this.token(src, true);\n};\n\n/**\n * Lexing\n */\n\nLexer.prototype.token = function(src, top) {\n src = src.replace(/^ +$/gm, '');\n var next,\n loose,\n cap,\n bull,\n b,\n item,\n space,\n i,\n tag,\n l,\n isordered;\n\n while (src) {\n // newline\n if (cap = this.rules.newline.exec(src)) {\n src = src.substring(cap[0].length);\n if (cap[0].length > 1) {\n this.tokens.push({\n type: 'space'\n });\n }\n }\n\n // code\n if (cap = this.rules.code.exec(src)) {\n src = src.substring(cap[0].length);\n cap = cap[0].replace(/^ {4}/gm, '');\n this.tokens.push({\n type: 'code',\n text: !this.options.pedantic\n ? cap.replace(/\\n+$/, '')\n : cap\n });\n continue;\n }\n\n // fences (gfm)\n if (cap = this.rules.fences.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'code',\n lang: cap[2],\n text: cap[3] || ''\n });\n continue;\n }\n\n // heading\n if (cap = this.rules.heading.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'heading',\n depth: cap[1].length,\n text: cap[2]\n });\n continue;\n }\n\n // table no leading pipe (gfm)\n if (top && (cap = this.rules.nptable.exec(src))) {\n src = src.substring(cap[0].length);\n\n item = {\n type: 'table',\n header: cap[1].replace(/^ *| *\\| *$/g, '').split(/ *\\| */),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n cells: cap[3].replace(/\\n$/, '').split('\\n')\n };\n\n for (i = 0; i < item.align.length; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n for (i = 0; i < item.cells.length; i++) {\n item.cells[i] = item.cells[i].split(/ *\\| */);\n }\n\n this.tokens.push(item);\n\n continue;\n }\n\n // hr\n if (cap = this.rules.hr.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'hr'\n });\n continue;\n }\n\n // blockquote\n if (cap = this.rules.blockquote.exec(src)) {\n src = src.substring(cap[0].length);\n\n this.tokens.push({\n type: 'blockquote_start'\n });\n\n cap = cap[0].replace(/^ *> ?/gm, '');\n\n // Pass `top` to keep the current\n // \"toplevel\" state. This is exactly\n // how markdown.pl works.\n this.token(cap, top);\n\n this.tokens.push({\n type: 'blockquote_end'\n });\n\n continue;\n }\n\n // list\n if (cap = this.rules.list.exec(src)) {\n src = src.substring(cap[0].length);\n bull = cap[2];\n isordered = bull.length > 1;\n\n this.tokens.push({\n type: 'list_start',\n ordered: isordered,\n start: isordered ? +bull : ''\n });\n\n // Get each top-level item.\n cap = cap[0].match(this.rules.item);\n\n next = false;\n l = cap.length;\n i = 0;\n\n for (; i < l; i++) {\n item = cap[i];\n\n // Remove the list item's bullet\n // so it is seen as the next token.\n space = item.length;\n item = item.replace(/^ *([*+-]|\\d+\\.) +/, '');\n\n // Outdent whatever the\n // list item contains. Hacky.\n if (~item.indexOf('\\n ')) {\n space -= item.length;\n item = !this.options.pedantic\n ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')\n : item.replace(/^ {1,4}/gm, '');\n }\n\n // Determine whether the next list item belongs here.\n // Backpedal if it does not belong in this list.\n if (this.options.smartLists && i !== l - 1) {\n b = block.bullet.exec(cap[i + 1])[0];\n if (bull !== b && !(bull.length > 1 && b.length > 1)) {\n src = cap.slice(i + 1).join('\\n') + src;\n i = l - 1;\n }\n }\n\n // Determine whether item is loose or not.\n // Use: /(^|\\n)(?! )[^\\n]+\\n\\n(?!\\s*$)/\n // for discount behavior.\n loose = next || /\\n\\n(?!\\s*$)/.test(item);\n if (i !== l - 1) {\n next = item.charAt(item.length - 1) === '\\n';\n if (!loose) loose = next;\n }\n\n this.tokens.push({\n type: loose\n ? 'loose_item_start'\n : 'list_item_start'\n });\n\n // Recurse.\n this.token(item, false);\n\n this.tokens.push({\n type: 'list_item_end'\n });\n }\n\n this.tokens.push({\n type: 'list_end'\n });\n\n continue;\n }\n\n // html\n if (cap = this.rules.html.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: this.options.sanitize\n ? 'paragraph'\n : 'html',\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n });\n continue;\n }\n\n // def\n if (top && (cap = this.rules.def.exec(src))) {\n src = src.substring(cap[0].length);\n if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);\n tag = cap[1].toLowerCase();\n if (!this.tokens.links[tag]) {\n this.tokens.links[tag] = {\n href: cap[2],\n title: cap[3]\n };\n }\n continue;\n }\n\n // table (gfm)\n if (top && (cap = this.rules.table.exec(src))) {\n src = src.substring(cap[0].length);\n\n item = {\n type: 'table',\n header: cap[1].replace(/^ *| *\\| *$/g, '').split(/ *\\| */),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n cells: cap[3].replace(/(?: *\\| *)?\\n$/, '').split('\\n')\n };\n\n for (i = 0; i < item.align.length; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n for (i = 0; i < item.cells.length; i++) {\n item.cells[i] = item.cells[i]\n .replace(/^ *\\| *| *\\| *$/g, '')\n .split(/ *\\| */);\n }\n\n this.tokens.push(item);\n\n continue;\n }\n\n // lheading\n if (cap = this.rules.lheading.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'heading',\n depth: cap[2] === '=' ? 1 : 2,\n text: cap[1]\n });\n continue;\n }\n\n // top-level paragraph\n if (top && (cap = this.rules.paragraph.exec(src))) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'paragraph',\n text: cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1]\n });\n continue;\n }\n\n // text\n if (cap = this.rules.text.exec(src)) {\n // Top-level should never reach here.\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'text',\n text: cap[0]\n });\n continue;\n }\n\n if (src) {\n throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));\n }\n }\n\n return this.tokens;\n};\n\n/**\n * Inline-Level Grammar\n */\n\nvar inline = {\n escape: /^\\\\([\\\\`*{}\\[\\]()#+\\-.!_>])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noop,\n tag: /^|^<\\/?[a-zA-Z0-9\\-]+(?:\"[^\"]*\"|'[^']*'|\\s[^<'\">\\/\\s]*)*?\\/?>/,\n link: /^!?\\[(inside)\\]\\(href\\)/,\n reflink: /^!?\\[(inside)\\]\\s*\\[([^\\]]*)\\]/,\n nolink: /^!?\\[((?:\\[[^\\[\\]]*\\]|\\\\[\\[\\]]|[^\\[\\]])*)\\]/,\n strong: /^__([\\s\\S]+?)__(?!_)|^\\*\\*([\\s\\S]+?)\\*\\*(?!\\*)/,\n em: /^_([^\\s_](?:[^_]|__)+?[^\\s_])_\\b|^\\*((?:\\*\\*|[^*])+?)\\*(?!\\*)/,\n code: /^(`+)\\s*([\\s\\S]*?[^`]?)\\s*\\1(?!`)/,\n br: /^ {2,}\\n(?!\\s*$)/,\n del: noop,\n text: /^[\\s\\S]+?(?=[\\\\?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*/;\n\ninline.link = edit(inline.link)\n .replace('inside', inline._inside)\n .replace('href', inline._href)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('inside', inline._inside)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = merge({}, inline);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = merge({}, inline.normal, {\n strong: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n em: /^_(?=\\S)([\\s\\S]*?\\S)_(?!_)|^\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)/\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = merge({}, inline.normal, {\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n url: edit(/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/)\n .replace('email', inline._email)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,\n del: /^~~(?=\\S)([\\s\\S]*?\\S)~~/,\n text: edit(inline.text)\n .replace(']|', '~]|')\n .replace('|', '|https?://|ftp://|www\\\\.|[a-zA-Z0-9.!#$%&\\'*+/=?^_`{\\\\|}~-]+@|')\n .getRegex()\n});\n\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = merge({}, inline.gfm, {\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text).replace('{2,}', '*').getRegex()\n});\n\n/**\n * Inline Lexer & Compiler\n */\n\nfunction InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}\n\n/**\n * Expose Inline Rules\n */\n\nInlineLexer.rules = inline;\n\n/**\n * Static Lexing/Compiling Method\n */\n\nInlineLexer.output = function(src, links, options) {\n var inline = new InlineLexer(links, options);\n return inline.output(src);\n};\n\n/**\n * Lexing/Compiling\n */\n\nInlineLexer.prototype.output = function(src) {\n var out = '',\n link,\n text,\n href,\n cap;\n\n while (src) {\n // escape\n if (cap = this.rules.escape.exec(src)) {\n src = src.substring(cap[0].length);\n out += cap[1];\n continue;\n }\n\n // autolink\n if (cap = this.rules.autolink.exec(src)) {\n src = src.substring(cap[0].length);\n if (cap[2] === '@') {\n text = escape(this.mangle(cap[1]));\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n out += this.renderer.link(href, null, text);\n continue;\n }\n\n // url (gfm)\n if (!this.inLink && (cap = this.rules.url.exec(src))) {\n cap[0] = this.rules._backpedal.exec(cap[0])[0];\n src = src.substring(cap[0].length);\n if (cap[2] === '@') {\n text = escape(cap[0]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + text;\n } else {\n href = text;\n }\n }\n out += this.renderer.link(href, null, text);\n continue;\n }\n\n // tag\n if (cap = this.rules.tag.exec(src)) {\n if (!this.inLink && /^/i.test(cap[0])) {\n this.inLink = false;\n }\n src = src.substring(cap[0].length);\n out += this.options.sanitize\n ? this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0])\n : cap[0]\n continue;\n }\n\n // link\n if (cap = this.rules.link.exec(src)) {\n src = src.substring(cap[0].length);\n this.inLink = true;\n out += this.outputLink(cap, {\n href: cap[2],\n title: cap[3]\n });\n this.inLink = false;\n continue;\n }\n\n // reflink, nolink\n if ((cap = this.rules.reflink.exec(src))\n || (cap = this.rules.nolink.exec(src))) {\n src = src.substring(cap[0].length);\n link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = this.links[link.toLowerCase()];\n if (!link || !link.href) {\n out += cap[0].charAt(0);\n src = cap[0].substring(1) + src;\n continue;\n }\n this.inLink = true;\n out += this.outputLink(cap, link);\n this.inLink = false;\n continue;\n }\n\n // strong\n if (cap = this.rules.strong.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.strong(this.output(cap[2] || cap[1]));\n continue;\n }\n\n // em\n if (cap = this.rules.em.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.em(this.output(cap[2] || cap[1]));\n continue;\n }\n\n // code\n if (cap = this.rules.code.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.codespan(escape(cap[2].trim(), true));\n continue;\n }\n\n // br\n if (cap = this.rules.br.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.br();\n continue;\n }\n\n // del (gfm)\n if (cap = this.rules.del.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.del(this.output(cap[1]));\n continue;\n }\n\n // text\n if (cap = this.rules.text.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.text(escape(this.smartypants(cap[0])));\n continue;\n }\n\n if (src) {\n throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));\n }\n }\n\n return out;\n};\n\n/**\n * Compile Link\n */\n\nInlineLexer.prototype.outputLink = function(cap, link) {\n var href = escape(link.href),\n title = link.title ? escape(link.title) : null;\n\n return cap[0].charAt(0) !== '!'\n ? this.renderer.link(href, title, this.output(cap[1]))\n : this.renderer.image(href, title, escape(cap[1]));\n};\n\n/**\n * Smartypants Transformations\n */\n\nInlineLexer.prototype.smartypants = function(text) {\n if (!this.options.smartypants) return text;\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n};\n\n/**\n * Mangle Links\n */\n\nInlineLexer.prototype.mangle = function(text) {\n if (!this.options.mangle) return text;\n var out = '',\n l = text.length,\n i = 0,\n ch;\n\n for (; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n};\n\n/**\n * Renderer\n */\n\nfunction Renderer(options) {\n this.options = options || {};\n}\n\nRenderer.prototype.code = function(code, lang, escaped) {\n if (this.options.highlight) {\n var out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n if (!lang) {\n return '
    '\n      + (escaped ? code : escape(code, true))\n      + '\\n
    ';\n }\n\n return '
    '\n    + (escaped ? code : escape(code, true))\n    + '\\n
    \\n';\n};\n\nRenderer.prototype.blockquote = function(quote) {\n return '
    \\n' + quote + '
    \\n';\n};\n\nRenderer.prototype.html = function(html) {\n return html;\n};\n\nRenderer.prototype.heading = function(text, level, raw) {\n return ''\n + text\n + '\\n';\n};\n\nRenderer.prototype.hr = function() {\n return this.options.xhtml ? '
    \\n' : '
    \\n';\n};\n\nRenderer.prototype.list = function(body, ordered, start) {\n var type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '\\n';\n};\n\nRenderer.prototype.listitem = function(text) {\n return '
  • ' + text + '
  • \\n';\n};\n\nRenderer.prototype.paragraph = function(text) {\n return '

    ' + text + '

    \\n';\n};\n\nRenderer.prototype.table = function(header, body) {\n return '\\n'\n + '\\n'\n + header\n + '\\n'\n + '\\n'\n + body\n + '\\n'\n + '
    \\n';\n};\n\nRenderer.prototype.tablerow = function(content) {\n return '\\n' + content + '\\n';\n};\n\nRenderer.prototype.tablecell = function(content, flags) {\n var type = flags.header ? 'th' : 'td';\n var tag = flags.align\n ? '<' + type + ' style=\"text-align:' + flags.align + '\">'\n : '<' + type + '>';\n return tag + content + '\\n';\n};\n\n// span level renderer\nRenderer.prototype.strong = function(text) {\n return '' + text + '';\n};\n\nRenderer.prototype.em = function(text) {\n return '' + text + '';\n};\n\nRenderer.prototype.codespan = function(text) {\n return '' + text + '';\n};\n\nRenderer.prototype.br = function() {\n return this.options.xhtml ? '
    ' : '
    ';\n};\n\nRenderer.prototype.del = function(text) {\n return '' + text + '';\n};\n\nRenderer.prototype.link = function(href, title, text) {\n if (this.options.sanitize) {\n try {\n var prot = decodeURIComponent(unescape(href))\n .replace(/[^\\w:]/g, '')\n .toLowerCase();\n } catch (e) {\n return text;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return text;\n }\n }\n if (this.options.baseUrl && !originIndependentUrl.test(href)) {\n href = resolveUrl(this.options.baseUrl, href);\n }\n var out = '
    ';\n return out;\n};\n\nRenderer.prototype.image = function(href, title, text) {\n if (this.options.baseUrl && !originIndependentUrl.test(href)) {\n href = resolveUrl(this.options.baseUrl, href);\n }\n var out = '\"'' : '>';\n return out;\n};\n\nRenderer.prototype.text = function(text) {\n return text;\n};\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\n\nfunction TextRenderer() {}\n\n// no need for block level renderers\n\nTextRenderer.prototype.strong =\nTextRenderer.prototype.em =\nTextRenderer.prototype.codespan =\nTextRenderer.prototype.del =\nTextRenderer.prototype.text = function (text) {\n return text;\n}\n\nTextRenderer.prototype.link =\nTextRenderer.prototype.image = function(href, title, text) {\n return '' + text;\n}\n\nTextRenderer.prototype.br = function() {\n return '';\n}\n\n/**\n * Parsing & Compiling\n */\n\nfunction Parser(options) {\n this.tokens = [];\n this.token = null;\n this.options = options || marked.defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n}\n\n/**\n * Static Parse Method\n */\n\nParser.parse = function(src, options) {\n var parser = new Parser(options);\n return parser.parse(src);\n};\n\n/**\n * Parse Loop\n */\n\nParser.prototype.parse = function(src) {\n this.inline = new InlineLexer(src.links, this.options);\n // use an InlineLexer with a TextRenderer to extract pure text\n this.inlineText = new InlineLexer(\n src.links,\n merge({}, this.options, {renderer: new TextRenderer()})\n );\n this.tokens = src.reverse();\n\n var out = '';\n while (this.next()) {\n out += this.tok();\n }\n\n return out;\n};\n\n/**\n * Next Token\n */\n\nParser.prototype.next = function() {\n return this.token = this.tokens.pop();\n};\n\n/**\n * Preview Next Token\n */\n\nParser.prototype.peek = function() {\n return this.tokens[this.tokens.length - 1] || 0;\n};\n\n/**\n * Parse Text Tokens\n */\n\nParser.prototype.parseText = function() {\n var body = this.token.text;\n\n while (this.peek().type === 'text') {\n body += '\\n' + this.next().text;\n }\n\n return this.inline.output(body);\n};\n\n/**\n * Parse Current Token\n */\n\nParser.prototype.tok = function() {\n switch (this.token.type) {\n case 'space': {\n return '';\n }\n case 'hr': {\n return this.renderer.hr();\n }\n case 'heading': {\n return this.renderer.heading(\n this.inline.output(this.token.text),\n this.token.depth,\n unescape(this.inlineText.output(this.token.text)));\n }\n case 'code': {\n return this.renderer.code(this.token.text,\n this.token.lang,\n this.token.escaped);\n }\n case 'table': {\n var header = '',\n body = '',\n i,\n row,\n cell,\n j;\n\n // header\n cell = '';\n for (i = 0; i < this.token.header.length; i++) {\n cell += this.renderer.tablecell(\n this.inline.output(this.token.header[i]),\n { header: true, align: this.token.align[i] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n for (i = 0; i < this.token.cells.length; i++) {\n row = this.token.cells[i];\n\n cell = '';\n for (j = 0; j < row.length; j++) {\n cell += this.renderer.tablecell(\n this.inline.output(row[j]),\n { header: false, align: this.token.align[j] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n return this.renderer.table(header, body);\n }\n case 'blockquote_start': {\n body = '';\n\n while (this.next().type !== 'blockquote_end') {\n body += this.tok();\n }\n\n return this.renderer.blockquote(body);\n }\n case 'list_start': {\n body = '';\n var ordered = this.token.ordered,\n start = this.token.start;\n\n while (this.next().type !== 'list_end') {\n body += this.tok();\n }\n\n return this.renderer.list(body, ordered, start);\n }\n case 'list_item_start': {\n body = '';\n\n while (this.next().type !== 'list_item_end') {\n body += this.token.type === 'text'\n ? this.parseText()\n : this.tok();\n }\n\n return this.renderer.listitem(body);\n }\n case 'loose_item_start': {\n body = '';\n\n while (this.next().type !== 'list_item_end') {\n body += this.tok();\n }\n\n return this.renderer.listitem(body);\n }\n case 'html': {\n var html = !this.token.pre && !this.options.pedantic\n ? this.inline.output(this.token.text)\n : this.token.text;\n return this.renderer.html(html);\n }\n case 'paragraph': {\n return this.renderer.paragraph(this.inline.output(this.token.text));\n }\n case 'text': {\n return this.renderer.paragraph(this.parseText());\n }\n }\n};\n\n/**\n * Helpers\n */\n\nfunction escape(html, encode) {\n return html\n .replace(!encode ? /&(?!#?\\w+;)/g : /&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(/&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig, function(_, n) {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nfunction edit(regex, opt) {\n regex = regex.source;\n opt = opt || '';\n return {\n replace: function(name, val) {\n val = val.source || val;\n val = val.replace(/(^|[^\\[])\\^/g, '$1');\n regex = regex.replace(name, val);\n return this;\n },\n getRegex: function() {\n return new RegExp(regex, opt);\n }\n };\n}\n\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (/^[^:]+:\\/*[^/]*$/.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = base.replace(/[^/]*$/, '');\n }\n }\n base = baseUrls[' ' + base];\n\n if (href.slice(0, 2) === '//') {\n return base.replace(/:[\\s\\S]*/, ':') + href;\n } else if (href.charAt(0) === '/') {\n return base.replace(/(:\\/*[^/]*)[\\s\\S]*/, '$1') + href;\n } else {\n return base + href;\n }\n}\nvar baseUrls = {};\nvar originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\nfunction noop() {}\nnoop.exec = noop;\n\nfunction merge(obj) {\n var i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\n for (key in target) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n obj[key] = target[key];\n }\n }\n }\n\n return obj;\n}\n\n/**\n * Marked\n */\n\nfunction marked(src, opt, callback) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (callback || typeof opt === 'function') {\n if (!callback) {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n\n var highlight = opt.highlight,\n tokens,\n pending,\n i = 0;\n\n try {\n tokens = Lexer.lex(src, opt)\n } catch (e) {\n return callback(e);\n }\n\n pending = tokens.length;\n\n var done = function(err) {\n if (err) {\n opt.highlight = highlight;\n return callback(err);\n }\n\n var out;\n\n try {\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n\n opt.highlight = highlight;\n\n return err\n ? callback(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!pending) return done();\n\n for (; i < tokens.length; i++) {\n (function(token) {\n if (token.type !== 'code') {\n return --pending || done();\n }\n return highlight(token.text, token.lang, function(err, code) {\n if (err) return done(err);\n if (code == null || code === token.text) {\n return --pending || done();\n }\n token.text = code;\n token.escaped = true;\n --pending || done();\n });\n })(tokens[i]);\n }\n\n return;\n }\n try {\n if (opt) opt = merge({}, marked.defaults, opt);\n return Parser.parse(Lexer.lex(src, opt), opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if ((opt || marked.defaults).silent) {\n return '

    An error occurred:

    '\n        + escape(e.message + '', true)\n        + '
    ';\n }\n throw e;\n }\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n merge(marked.defaults, opt);\n return marked;\n};\n\nmarked.defaults = {\n gfm: true,\n tables: true,\n breaks: false,\n pedantic: false,\n sanitize: false,\n sanitizer: null,\n mangle: true,\n smartLists: false,\n silent: false,\n highlight: null,\n langPrefix: 'lang-',\n smartypants: false,\n headerPrefix: '',\n renderer: new Renderer(),\n xhtml: false,\n baseUrl: null\n};\n\n/**\n * Expose\n */\n\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\n\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\n\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\n\nmarked.InlineLexer = InlineLexer;\nmarked.inlineLexer = InlineLexer.output;\n\nmarked.parse = marked;\n\nif (true) {\n module.exports = marked;\n} else if (typeof define === 'function' && define.amd) {\n define(function() { return marked; });\n} else {\n root.marked = marked;\n}\n})(this || (typeof window !== 'undefined' ? window : global));\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a
    \\n
    \\n \\n \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n
    \\n
    \\n
    ';\n _root.el.innerHTML = eleHTML;\n // Empty Data\n var vempty = _root.el.querySelector('.vempty');\n _root.nodata = {\n show: function show(txt) {\n vempty.innerHTML = txt || '\\u8FD8\\u6CA1\\u6709\\u8BC4\\u8BBA\\u54E6\\uFF0C\\u5FEB\\u6765\\u62A2\\u6C99\\u53D1\\u5427!';\n vempty.setAttribute('style', 'display:block;');\n },\n hide: function hide() {\n vempty.setAttribute('style', 'display:none;');\n }\n };\n _root.nodata.show();\n\n // load smiles image\n var _smile_wrapper = _root.el.querySelector('.vsmile-icons');\n var smile_names = option.emoticon_list || [\"mrgreen\", \"neutral\", \"twisted\", \"arrow\", \"eek\", \"smile\", \"confused\", \"cool\", \"evil\", \"biggrin\", \"idea\", \"redface\", \"razz\", \"rolleyes\", \"wink\", \"cry\", \"surprised\", \"lol\", \"mad\", \"sad\", \"exclaim\", \"question\"];\n for (var i in smile_names) {\n var img = document.createElement('img');\n img.setAttribute('src', option.emoticon_url + '/' + smile_names[i]);\n _smile_wrapper.appendChild(img);\n }\n av.init({\n appId: option.app_id || option.appId,\n appKey: option.app_key || option.appKey\n });\n _root.v = av;\n } catch (ex) {\n var issue = 'https://github.com/panjunwen/Valine/issues';\n if (_root.el) _root.nodata.show('
    ' + ex + '
    Valine:' + _root.version + '
    \\u53CD\\u9988\\uFF1A' + issue + '
    ');else console && console.log('%c' + ex + '\\n%cValine%c' + _root.version + ' ' + issue, 'color:red;', 'background:#000;padding:5px;line-height:30px;color:#fff;', 'background:#456;line-height:30px;padding:5px;color:#fff;');\n return;\n }\n\n // loading\n var _spinner = '
    ';\n var vloading = _root.el.querySelector('.vloading');\n vloading.innerHTML = _spinner;\n // loading control\n _root.loading = {\n show: function show() {\n vloading.setAttribute('style', 'display:block;');\n _root.nodata.hide();\n },\n hide: function hide() {\n vloading.setAttribute('style', 'display:none;');\n _root.el.querySelectorAll('.vcard').length === 0 && _root.nodata.show();\n }\n };\n\n var vsubmitting = _root.el.querySelector('.vsubmitting');\n vsubmitting.innerHTML = _spinner;\n _root.submitting = {\n show: function show() {\n vsubmitting.setAttribute('style', 'display:block;');\n },\n hide: function hide() {\n vsubmitting.setAttribute('style', 'display:none;');\n _root.nodata.hide();\n }\n };\n\n var _mark = _root.el.querySelector('.vmark');\n // alert\n _root.alert = {\n /**\n * {\n * type:0/1,\n * text:'',\n * ctxt:'',\n * otxt:'',\n * cb:fn\n * }\n *\n * @param {Object} o\n */\n show: function show(o) {\n _mark.innerHTML = '
    ' + o.text + '
    ';\n var _vbtns = _mark.querySelector('.vbtns');\n var _cBtn = '';\n var _oBtn = '';\n _vbtns.innerHTML = '' + _cBtn + (o.type && _oBtn);\n _mark.querySelector('.vcancel').addEventListener('click', function (e) {\n _root.alert.hide();\n });\n _mark.setAttribute('style', 'display:block;');\n if (o && o.type) {\n var _ok = _mark.querySelector('.vsure');\n Event.on('click', _ok, function (e) {\n _root.alert.hide();\n o.cb && o.cb();\n });\n }\n },\n hide: function hide() {\n _mark.setAttribute('style', 'display:none;');\n }\n };\n\n _root.loading.show();\n var query = new _root.v.Query('Comment');\n query.equalTo('url', defaultComment['url']);\n query.count().then(function (count) {\n _root.el.querySelector('.count').innerHTML = '' + count;\n _root.bind(option);\n }, function (error) {\n console.log(error);\n });\n }\n\n /**\n * Bind Event\n */\n\n }, {\n key: 'bind',\n value: function bind(option) {\n var _root = this;\n // Smile pictures\n var vsmiles = _root.el.querySelector('.vsmile-icons');\n Event.on('click', vsmiles, function (e) {\n var textField = _root.el.querySelector('.veditor');\n var imgSrc = e.target.src;\n if (typeof imgSrc == 'undefined') return;\n // var tag = \" ![](/\" + imgSrc.replace(/^.*\\/(.*\\.gif)$/, '$1') + \") \";\n var tag = \"!(:\" + decodeURI(imgSrc).replace(/^.*\\/(.*)$/, '$1') + \":)\";\n if (document.selection) {\n textField.focus();\n sel = document.selection.createRange();\n sel.text = tag;\n textField.focus();\n } else if (textField.selectionStart || textField.selectionStart == '0') {\n var startPos = textField.selectionStart;\n var endPos = textField.selectionEnd;\n var cursorPos = endPos;\n textField.value = textField.value.substring(0, startPos) + tag + textField.value.substring(endPos, textField.value.length);\n cursorPos += tag.length;\n textField.focus();\n textField.selectionStart = cursorPos;\n textField.selectionEnd = cursorPos;\n } else {\n textField.value += tag;\n textField.focus();\n }\n defaultComment[\"comment\"] = textField.value;\n var submitBtn = _root.el.querySelector('.vsubmit');\n if (submitBtn.getAttribute('disabled')) submitBtn.removeAttribute('disabled');\n });\n var comment_trigger = _root.el.querySelector('.comment_trigger');\n Event.on('click', comment_trigger, function (e) {\n comment_trigger.setAttribute('style', 'display:none');\n _root.el.querySelector('.auth-section').removeAttribute('style');\n _root.el.querySelector('.veditor').focus();\n });\n var smile_btn = _root.el.querySelector('.vsmile-btn');\n var smile_icons = _root.el.querySelector('.vsmile-icons');\n Event.on('click', smile_btn, function (e) {\n if (smile_icons.getAttribute('triggered')) {\n smile_icons.setAttribute('style', 'display:none;');\n smile_icons.removeAttribute('triggered');\n } else {\n smile_icons.removeAttribute('style');\n smile_icons.setAttribute('triggered', 1);\n }\n });\n\n // Query && show comment list\n\n var expandEvt = function expandEvt(el) {\n if (el.offsetHeight > 180) {\n el.classList.add('expand');\n Event.on('click', el, function (e) {\n el.setAttribute('class', 'vcomment');\n });\n }\n };\n\n var commonQuery = function commonQuery() {\n var query = new _root.v.Query('Comment');\n query.select(['nick', 'comment', 'link', 'rid', 'emailHash']);\n query.notEqualTo('isSpam', true);\n query.equalTo('url', defaultComment['url']);\n query.addDescending('createdAt');\n return query;\n };\n\n var num = 1;\n var query = function query() {\n var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n\n _root.loading.show();\n var size = 10;\n var count = Number(_root.el.querySelector('.count').innerText);\n var cq = commonQuery();\n cq.limit(size);\n cq.skip((n - 1) * size);\n cq.find().then(function (rets) {\n var len = rets.length;\n if (len) {\n // _root.el.querySelector('.vlist').innerHTML = '';\n for (var i = 0; i < len; i++) {\n insertComment(rets[i], false);\n }\n var _vpage = _root.el.querySelector('.vpage');\n _vpage.innerHTML = size * n < count ? '
    \\u52A0\\u8F7D\\u66F4\\u591A\\u8BC4\\u8BBA\\uFF08\\u5269\\u4F59' + (count - size * n) + '/' + count + '\\u6761\\uFF09
    ' : '';\n var _vmore = _vpage.querySelector('#vmore');\n if (_vmore) {\n Event.on('click', _vmore, function (e) {\n _vpage.innerHTML = '';\n query(++num);\n });\n }\n }\n _root.loading.hide();\n }).catch(function (ex) {\n console.log(ex);\n _root.loading.hide();\n });\n };\n query();\n\n var insertComment = function insertComment(ret) {\n var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var _vcard = document.createElement('li');\n _vcard.setAttribute('class', 'vcard');\n _vcard.setAttribute('id', ret.id);\n var emailHash = ret.get('emailHash') == EMPTY_EMAIL_HASH ? DEFAULT_EMAIL_HASH : ret.get('emailHash');\n var gravatar_url = GRAVATAR_BASE_URL + emailHash + '?size=80';\n // language=HTML\n _vcard.innerHTML = '\\n
    \\n
    \\n ' + ret.get(\"nick\") + '\\n \\u2022\\n ' + timeAgo(ret.get(\"createdAt\")) + '\\n
    \\n
    ' + ret.get('comment') + '
    \\n \\n
    \\n
    \\n \\u56DE\\u590D';\n var _vlist = _root.el.querySelector('.vlist');\n var _vlis = _vlist.querySelectorAll('li');\n var _vat = _vcard.querySelector('.vat');\n var _as = _vcard.querySelectorAll('a');\n for (var i = 0, len = _as.length; i < len; i++) {\n var item = _as[i];\n if (item && item.getAttribute('class') != 'at') {\n item.setAttribute('target', '_blank');\n item.setAttribute('rel', 'nofollow');\n }\n }\n if (!top) _vlist.appendChild(_vcard);else _vlist.insertBefore(_vcard, _vlis[0]);\n var _vcontent = _vcard.querySelector('.vcomment');\n expandEvt(_vcontent);\n bindAtEvt(_vat);\n };\n\n var mapping = {\n veditor: \"comment\",\n vnick: \"nick\",\n vlink: \"link\",\n vmail: 'mail'\n };\n var inputs = {};\n for (var i in mapping) {\n if (mapping.hasOwnProperty(i)) {\n (function () {\n var _v = mapping[i];\n var _el = _root.el.querySelector('.' + i);\n inputs[_v] = _el;\n Event.on('input', _el, function (e) {\n defaultComment[_v] = HtmlUtil.encode(_el.value.replace(/(^\\s*)|(\\s*$)/g, \"\"));\n });\n })();\n }\n }\n\n // cache\n var getCache = function getCache() {\n var s = store && store.getItem('ValineCache');\n if (!!s) {\n s = JSON.parse(s);\n var m = ['nick', 'link', 'mail'];\n for (var _i in m) {\n var k = m[_i];\n _root.el.querySelector('.v' + k).value = s[k];\n defaultComment[k] = s[k];\n }\n if (s['mail'] != '') {\n var el = _root.el.querySelector('.visitor_avatar');\n el.setAttribute('src', GRAVATAR_BASE_URL + crypto(s['mail'].toLowerCase().trim()) + '?size=80');\n }\n }\n };\n getCache();\n\n // reset form\n _root.reset = function () {\n for (var _i2 in mapping) {\n if (mapping.hasOwnProperty(_i2)) {\n var _v = mapping[_i2];\n var _el = _root.el.querySelector('.' + _i2);\n _el.value = \"\";\n defaultComment[_v] = \"\";\n }\n }\n defaultComment['rid'] = '';\n defaultComment['nick'] = '小可爱';\n getCache();\n };\n\n // submit\n var submitBtn = _root.el.querySelector('.vsubmit');\n var submitEvt = function submitEvt(e) {\n if (submitBtn.getAttribute('disabled')) {\n _root.alert.show({\n type: 0,\n text: '再等等,评论正在提交中ヾ(๑╹◡╹)ノ\"',\n ctxt: '好的'\n });\n return;\n }\n if (defaultComment.comment == '') {\n inputs['comment'].focus();\n return;\n }\n if (defaultComment.nick == '') {\n defaultComment['nick'] = '小调皮';\n }\n // replace smiles\n defaultComment.comment = defaultComment.comment.replace(/!\\(:(.*?\\.\\w+):\\)/g, '![](' + option.emoticon_url + '/$1)');\n defaultComment.comment = (0, _marked2.default)(defaultComment.comment);\n var idx = defaultComment.comment.indexOf(defaultComment.at);\n if (idx > -1 && defaultComment.at != '') {\n var at = '' + defaultComment.at + '';\n defaultComment.comment = defaultComment.comment.replace(defaultComment.at, at);\n }\n // veirfy\n var mailRet = check.mail(defaultComment.mail);\n var linkRet = check.link(defaultComment.link);\n defaultComment['mail'] = mailRet.k ? mailRet.v : '';\n defaultComment['link'] = linkRet.k ? linkRet.v : '';\n if (!mailRet.k && !linkRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的网址和邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?',\n cb: function cb() {\n commitEvt();\n }\n });\n } else if (!mailRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?',\n cb: function cb() {\n commitEvt();\n }\n });\n } else if (!linkRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的网址格式不正确, 是否继续提交?',\n cb: function cb() {\n commitEvt();\n }\n });\n } else {\n commitEvt();\n }\n };\n\n // setting access\n var getAcl = function getAcl() {\n var acl = new _root.v.ACL();\n acl.setPublicReadAccess(true);\n acl.setPublicWriteAccess(false);\n return acl;\n };\n\n var commitEvt = function commitEvt() {\n submitBtn.setAttribute('disabled', true);\n _root.submitting.show();\n // 声明类型\n var Ct = _root.v.Object.extend('Comment');\n // 新建对象\n var comment = new Ct();\n for (var _i3 in defaultComment) {\n if (defaultComment.hasOwnProperty(_i3)) {\n if (_i3 === 'at') continue;\n var _v = defaultComment[_i3];\n comment.set(_i3, _v);\n }\n }\n comment.set('emailHash', crypto(defaultComment.mail.toLowerCase().trim()));\n comment.setACL(getAcl());\n comment.save().then(function (commentItem) {\n store && store.setItem('ValineCache', JSON.stringify({\n nick: defaultComment['nick'],\n link: defaultComment['link'],\n mail: defaultComment['mail']\n }));\n var _count = _root.el.querySelector('.count');\n _count.innerText = Number(_count.innerText) + 1;\n insertComment(commentItem, true);\n submitBtn.removeAttribute('disabled');\n _root.submitting.hide();\n _root.nodata.hide();\n _root.reset();\n }).catch(function (ex) {\n _root.submitting.hide();\n });\n };\n\n // at event\n var bindAtEvt = function bindAtEvt(el) {\n Event.on('click', el, function (e) {\n var at = el.getAttribute('at');\n var rid = el.getAttribute('rid');\n defaultComment['rid'] = rid;\n defaultComment['at'] = at;\n inputs['comment'].value = at + ' \\uFF0C' + inputs['comment'].value;\n inputs['comment'].focus();\n // remove comment trigger\n _root.el.querySelector('.comment_trigger').setAttribute('style', 'display:none');\n _root.el.querySelector('.auth-section').removeAttribute('style');\n _root.el.querySelector('.veditor').focus();\n });\n };\n\n Event.off('click', submitBtn, submitEvt);\n Event.on('click', submitBtn, submitEvt);\n }\n }]);\n\n return Valine;\n}();\n\nvar Event = {\n on: function on(type, el, handler, capture) {\n if (el.addEventListener) el.addEventListener(type, handler, capture || false);else if (el.attachEvent) el.attachEvent('on' + type, handler);else el['on' + type] = handler;\n },\n off: function off(type, el, handler, capture) {\n if (el.removeEventListener) el.removeEventListener(type, handler, capture || false);else if (el.detachEvent) el.detachEvent('on' + type, handler);else el['on' + type] = null;\n }\n};\n\nvar check = {\n mail: function mail(m) {\n return {\n k: /\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}/.test(m),\n v: m\n };\n },\n link: function link(l) {\n if (l.length > 0) {\n l = /^(http|https)/.test(l) ? l : 'http://' + l;\n }\n return {\n k: l.length > 0 ? /(http|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?/.test(l) : true,\n v: l\n };\n }\n};\n\nvar HtmlUtil = {\n\n // /**\n // *\n // * 将str中的链接转换成a标签形式\n // * @param {String} str\n // * @returns\n // */\n // transUrl(str) {\n // let reg = /(http:\\/\\/|https:\\/\\/)((\\w|=|\\?|\\.|\\/|&|-)+)/g;\n // return str.replace(reg, '$1$2');\n // },\n /**\n * HTML转码\n * @param {String} str\n * @return {String} result\n */\n encode: function encode(str) {\n return !!str ? str.replace(/&/g, \"&\").replace(//g, \">\").replace(/ /g, \" \").replace(/\\'/g, \"'\").replace(/\\\"/g, \""\") : '';\n },\n\n /**\n * HTML解码\n * @param {String} str\n * @return {String} result\n */\n decode: function decode(str) {\n return !!str ? str.replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\").replace(/ /g, \" \").replace(/'/g, \"\\'\").replace(/"/g, \"\\\"\") : '';\n }\n};\n\nvar dateFormat = function dateFormat(date) {\n var vDay = padWithZeros(date.getDate(), 2);\n var vMonth = padWithZeros(date.getMonth() + 1, 2);\n var vYear = padWithZeros(date.getFullYear(), 2);\n // var vHour = padWithZeros(date.getHours(), 2);\n // var vMinute = padWithZeros(date.getMinutes(), 2);\n // var vSecond = padWithZeros(date.getSeconds(), 2);\n return vYear + '-' + vMonth + '-' + vDay;\n // return `${vYear}-${vMonth}-${vDay} ${vHour}:${vMinute}:${vSecond}`;\n};\n\nvar timeAgo = function timeAgo(date) {\n try {\n var oldTime = date.getTime();\n var currTime = new Date().getTime();\n var diffValue = currTime - oldTime;\n\n var days = Math.floor(diffValue / (24 * 3600 * 1000));\n if (days === 0) {\n //计算相差小时数\n var leave1 = diffValue % (24 * 3600 * 1000); //计算天数后剩余的毫秒数\n var hours = Math.floor(leave1 / (3600 * 1000));\n if (hours === 0) {\n //计算相差分钟数\n var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数\n var minutes = Math.floor(leave2 / (60 * 1000));\n if (minutes === 0) {\n //计算相差秒数\n var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数\n var seconds = Math.round(leave3 / 1000);\n return seconds + ' 秒前';\n }\n return minutes + ' 分钟前';\n }\n return hours + ' 小时前';\n }\n if (days < 0) return '刚刚';else if (days < 30) return days + ' 天前';else if (days < 365) return Math.floor(days / 30) + ' 月前';else return Math.floor(days / 365) + ' 年前';\n return dateFormat(date);\n } catch (error) {\n console.log(error);\n }\n};\n\nvar padWithZeros = function padWithZeros(vNumber, width) {\n var numAsString = vNumber.toString();\n while (numAsString.length < width) {\n numAsString = '0' + numAsString;\n }\n return numAsString;\n};\n\nvar loadJS = function loadJS(url, success) {\n var domScript = document.createElement('script');\n domScript.src = url;\n success = success || function () {};\n domScript.onload = domScript.onreadystatechange = function () {\n if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {\n success();\n this.onload = this.onreadystatechange = null;\n // this.parentNode.removeChild(this);\n }\n };\n document.getElementsByTagName('head')[0].appendChild(domScript);\n};\n\nvar getIp = function getIp() {\n $.getJSON(\"https://api.ipify.org/?format=jsonp?callback=?\", function (json) {\n defaultComment['ip'] = json.ip;\n });\n};\n\nmodule.exports = Valine;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(5)(false);\n// imports\n\n\n// module\nexports.push([module.i, \"@charset \\\"UTF-8\\\";\\n.valine {\\n /************ Loading ************/ }\\n .valine * {\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n font-size: 100%;\\n font-weight: normal;\\n line-height: 1.42857143;\\n color: #3c484e;\\n -webkit-transition: all .3s ease;\\n transition: all .3s ease;\\n margin: 0;\\n padding: 0; }\\n .valine .vwrap {\\n overflow: hidden;\\n position: relative;\\n border: 1px solid #ededed; }\\n .valine .vwrap .comment-smiles {\\n margin: 0;\\n padding: 0 1em;\\n margin: .5em 0; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap {\\n width: 100%;\\n height: 1.7em; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg {\\n fill: #aaaaaa;\\n cursor: pointer; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg:hover {\\n fill: #777777; }\\n .valine .vwrap .comment-smiles .vsmile-icons {\\n padding: .2em 0;\\n margin: .3em 0;\\n border-top: 1px solid #ededed;\\n border-radius: 0;\\n max-height: 64px;\\n overflow: auto; }\\n .valine .vwrap .comment-smiles .vsmile-icons img {\\n width: auto !important;\\n height: 28px !important;\\n margin-right: 4px;\\n cursor: pointer; }\\n .valine .vwrap .textarea-wrapper {\\n color: #4b5b62;\\n width: 100%;\\n height: 100%;\\n background: #fff;\\n position: relative;\\n border-radius: 0; }\\n .valine .vwrap .textarea-wrapper .comment_trigger {\\n position: absolute;\\n z-index: 10;\\n width: 100%;\\n height: 100%;\\n background-color: #fff;\\n padding: 0 1em; }\\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar {\\n position: absolute;\\n width: 3em;\\n height: 3em;\\n position: absolute;\\n top: 50%;\\n -webkit-transform: translateY(-50%);\\n transform: translateY(-50%); }\\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar img {\\n border-radius: 100%;\\n width: 3em;\\n height: 3em; }\\n .valine .vwrap .textarea-wrapper .comment_trigger .trigger_title {\\n position: absolute;\\n top: 50%;\\n -webkit-transform: translateY(-50%);\\n transform: translateY(-50%);\\n color: #aaa;\\n font-size: 1.4em;\\n margin-left: 3.5em; }\\n .valine .vwrap .textarea-wrapper textarea {\\n padding: 1em 1em 0;\\n color: #4b5b62;\\n width: 100%;\\n background: #fff;\\n border: none;\\n resize: none;\\n min-height: 3em; }\\n .valine .vwrap .textarea-wrapper textarea:focus {\\n border-color: #c4c8cb;\\n outline: 0; }\\n .valine .vwrap .trigger-section {\\n display: none; }\\n .valine .vwrap .auth-section {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n background: #fbfbfb;\\n padding: .3em .6em; }\\n .valine .vwrap .auth-section .input-wrapper {\\n -ms-flex: 1 1 27%;\\n -webkit-box-flex: 1;\\n flex: 1 1 27%;\\n width: 27%; }\\n .valine .vwrap .auth-section .input-wrapper input {\\n color: #4b5b62;\\n background: #fafafa;\\n border: none;\\n border-radius: 0;\\n padding: .6em;\\n margin: 0;\\n line-height: 2;\\n font-size: 1em !important; }\\n .valine .vwrap .auth-section .input-wrapper input:focus {\\n border-color: #c4c8cb;\\n outline: 0; }\\n .valine .vwrap .auth-section input {\\n width: 100%; }\\n .valine .vwrap .auth-section .post-action {\\n -ms-flex: 1 1 19%;\\n -webkit-box-flex: 1;\\n flex: 1 1 19%;\\n width: 19%;\\n margin: 0;\\n padding: 2px 0 0; }\\n .valine .vwrap .auth-section .post-action button {\\n color: #fff;\\n width: 100%;\\n line-height: 2;\\n font-weight: bolder;\\n border-radius: 30px;\\n border: 1px solid #e9eff3;\\n background-color: #111;\\n padding: .4em .5em;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n font-size: 1em !important; }\\n .valine .vwrap .auth-section .post-action button:hover {\\n background-color: #444; }\\n @media screen and (max-width: 720px) {\\n .valine .vwrap .auth-section {\\n display: block; }\\n .valine .vwrap .auth-section .input-wrapper, .valine .vwrap .auth-section .post-action {\\n -ms-flex: 1 1 100%;\\n -webkit-box-flex: 1;\\n flex: 1 1 100%;\\n padding-right: 0;\\n width: 100%; } }\\n .valine .vwrap .vmark {\\n position: absolute;\\n background: rgba(0, 0, 0, 0.65);\\n width: 100%;\\n height: 100%;\\n left: 0;\\n top: 0; }\\n .valine .vwrap .vmark .valert {\\n padding: 3em 0 0 0; }\\n .valine .vwrap .vmark .valert .vtext {\\n color: #fff;\\n padding: 15px; }\\n .valine .vwrap .vmark .valert .vcode {\\n width: 75px;\\n border-radius: 5px;\\n background: #dedede; }\\n .valine .vwrap .vmark .valert .vcode:focus {\\n border-color: #3090e4;\\n background-color: #fff; }\\n @media screen and (max-width: 720px) {\\n .valine .vwrap .vmark .valert {\\n padding: 8em 0; }\\n .valine .vwrap .vmark .valert .vtext {\\n color: #fff;\\n padding: 10px; } }\\n .valine .info {\\n padding: 5px;\\n margin: .5em 0; }\\n .valine .info .col {\\n display: inline-block;\\n vertical-align: middle; }\\n .valine .info svg {\\n margin-right: 2px;\\n overflow: hidden;\\n fill: currentColor; }\\n .valine .power {\\n color: #999;\\n font-size: 0.625em !important;\\n position: relative; }\\n .valine a {\\n text-decoration: none;\\n color: #3eb0ef; }\\n .valine ul,\\n .valine li {\\n list-style: none; }\\n .valine .txt-center {\\n text-align: center; }\\n .valine .float-right {\\n float: right !important; }\\n .valine .pd5 {\\n padding: 5px; }\\n .valine .pd10 {\\n padding: 10px; }\\n .valine .vbtn {\\n display: inline-block;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none;\\n border: 1px solid #e9eff3;\\n background-color: #333;\\n border-radius: .1em;\\n color: #fff;\\n padding: .5em 1.5em;\\n cursor: pointer;\\n white-space: nowrap;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n outline: none;\\n min-width: 60px;\\n max-width: 100%;\\n margin: 0 1em; }\\n .valine .vbtn:active,\\n .valine .vbtn:hover {\\n border-color: #666; }\\n .valine .vpage {\\n margin: 1.5em 0; }\\n .valine .vpage .more {\\n width: 100%;\\n height: 2.5em;\\n line-height: 2.5em;\\n text-align: center;\\n cursor: pointer;\\n color: #666;\\n background: #fafafa;\\n border-radius: 1.25em; }\\n .valine .vlist {\\n width: 100%; }\\n .valine .vlist .vcard {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n -ms-flex-direction: row;\\n flex-direction: row;\\n padding: 2em 1em;\\n border: 1px solid rgba(150, 150, 150, 0.18);\\n margin: 2em 0 0;\\n list-style: none;\\n border-radius: 5px;\\n word-break: break-all; }\\n .valine .vlist .vcard:hover {\\n border: 1px solid rgba(150, 150, 150, 0.25); }\\n .valine .vlist .vcard:hover .vat {\\n background: #111 !important; }\\n .valine .vlist .vcard .vfooter {\\n margin: -2em 0 0; }\\n .valine .vlist .vcard .vfooter .vat {\\n background: transparent;\\n color: #ffffff;\\n padding: .2em 1em;\\n line-height: 1.6;\\n cursor: pointer;\\n word-break: keep-all;\\n text-transform: uppercase; }\\n .valine .vlist .vcard .vavatar {\\n -webkit-box-flex: 0;\\n flex: 0 0 auto;\\n -ms-flex: 0 0 auto;\\n margin-right: 1em;\\n margin-top: 0.1em;\\n display: inline-block;\\n height: 3em;\\n width: 3em;\\n position: relative;\\n border-radius: 50%; }\\n .valine .vlist .vcard .vavatar:hover {\\n transform: rotate(1turn);\\n -webkit-transform: rotate(1turn); }\\n .valine .vlist .vcard .text-wrapper {\\n overflow: hidden;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n width: 100%; }\\n .valine .vlist .vcard .text-wrapper .vhead {\\n line-height: 1;\\n margin-bottom: 1em; }\\n .valine .vlist .vcard .text-wrapper .vhead a {\\n font-weight: bolder;\\n font-size: 1em;\\n color: rgba(0, 0, 0, 0.7); }\\n .valine .vlist .vcard .text-wrapper .vhead .spacer {\\n color: #ccc;\\n margin-left: 0.3em;\\n margin-right: 0.3em; }\\n .valine .vlist .vcard .text-wrapper .vhead .vtime {\\n color: #a9a4a4;\\n display: inline-block;\\n font-weight: normal; }\\n .valine .vlist .vcard .text-wrapper .vcomment {\\n position: relative; }\\n .valine .vlist .vcard .text-wrapper .vcomment p {\\n word-wrap: break-word;\\n white-space: pre-wrap;\\n word-break: break-all;\\n text-align: justify;\\n line-height: 1.8; }\\n .valine .vlist .vcard .text-wrapper .vcomment pre {\\n overflow: auto;\\n padding: 6px 10px;\\n word-wrap: break-word;\\n color: #555;\\n background: #f5f2f2;\\n border-radius: 3px;\\n font-size: .875rem;\\n margin: 5px 0; }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand {\\n cursor: pointer;\\n max-height: 11.25rem;\\n overflow: hidden; }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand:before {\\n display: block;\\n content: \\\"\\\";\\n position: absolute;\\n width: 100%;\\n left: 0;\\n top: 0;\\n bottom: 3.15rem;\\n pointer-events: none;\\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.8)));\\n background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8)); }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand:after {\\n display: block;\\n content: \\\"\\\\5C55\\\\5F00 \\\";\\n text-align: center;\\n color: #828586;\\n position: absolute;\\n width: 100%;\\n height: 3.15rem;\\n line-height: 3.15rem;\\n left: 0;\\n bottom: 0;\\n pointer-events: none;\\n background: rgba(255, 255, 255, 0.9); }\\n .valine .vlist .vempty {\\n padding: 20px;\\n text-align: center;\\n color: #999; }\\n .valine .spinner {\\n margin: 10px auto;\\n width: 50px;\\n height: 30px;\\n text-align: center;\\n font-size: 10px; }\\n .valine .spinner > div {\\n background-color: #9c9c9c;\\n height: 100%;\\n width: 6px;\\n margin-right: 3px;\\n display: inline-block;\\n -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;\\n animation: sk-stretchdelay 1.2s infinite ease-in-out; }\\n .valine .spinner .r2 {\\n -webkit-animation-delay: -1.1s;\\n animation-delay: -1.1s; }\\n .valine .spinner .r3 {\\n -webkit-animation-delay: -1.0s;\\n animation-delay: -1.0s; }\\n .valine .spinner .r4 {\\n -webkit-animation-delay: -0.9s;\\n animation-delay: -0.9s; }\\n .valine .spinner .r5 {\\n -webkit-animation-delay: -0.8s;\\n animation-delay: -0.8s; }\\n\\n@-webkit-keyframes sk-stretchdelay {\\n 0%,\\n 40%,\\n 100% {\\n -webkit-transform: scaleY(0.4); }\\n 20% {\\n -webkit-transform: scaleY(1); } }\\n\\n@keyframes sk-stretchdelay {\\n 0%,\\n 40%,\\n 100% {\\n transform: scaleY(0.4);\\n -webkit-transform: scaleY(0.4); }\\n 20% {\\n transform: scaleY(1);\\n -webkit-transform: scaleY(1); } }\\n\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = __webpack_require__(7);\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    已有 0 条评论
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    `;\n _root.el.innerHTML = eleHTML;\n // Empty Data\n let vempty = _root.el.querySelector('.vempty');\n _root.nodata = {\n show(txt) {\n vempty.innerHTML = txt || `还没有评论哦,快来抢沙发吧!`;\n vempty.setAttribute('style', 'display:block;');\n },\n hide() {\n vempty.setAttribute('style', 'display:none;');\n }\n }\n _root.nodata.show();\n\n // load smiles image\n let _smile_wrapper = _root.el.querySelector('.vsmile-icons'); \n let smile_names = option.emoticon_list || [\"mrgreen\", \"neutral\", \"twisted\", \"arrow\", \"eek\", \"smile\", \"confused\", \"cool\", \"evil\", \"biggrin\", \"idea\", \"redface\", \"razz\", \"rolleyes\", \"wink\", \"cry\", \"surprised\", \"lol\", \"mad\", \"sad\", \"exclaim\", \"question\"];\n for(let i in smile_names) {\n let img = document.createElement('img');\n img.setAttribute('src', `${option.emoticon_url}/${smile_names[i]}`);\n _smile_wrapper.appendChild(img) ;\n }\n av.init({\n appId: option.app_id || option.appId,\n appKey: option.app_key || option.appKey\n });\n _root.v = av;\n\n } catch (ex) {\n let issue = 'https://github.com/panjunwen/Valine/issues';\n if (_root.el) _root.nodata.show(`
    ${ex}
    Valine:${_root.version}
    反馈:${issue}
    `);\n else console && console.log(`%c${ex}\\n%cValine%c${_root.version} ${issue}`, 'color:red;', 'background:#000;padding:5px;line-height:30px;color:#fff;', 'background:#456;line-height:30px;padding:5px;color:#fff;');\n return;\n }\n\n // loading\n let _spinner = `
    `;\n let vloading = _root.el.querySelector('.vloading');\n vloading.innerHTML = _spinner;\n // loading control\n _root.loading = {\n show() {\n vloading.setAttribute('style', 'display:block;');\n _root.nodata.hide();\n },\n hide() {\n vloading.setAttribute('style', 'display:none;');\n _root.el.querySelectorAll('.vcard').length === 0 && _root.nodata.show();\n }\n };\n\n let vsubmitting = _root.el.querySelector('.vsubmitting');\n vsubmitting.innerHTML = _spinner;\n _root.submitting = {\n show() {\n vsubmitting.setAttribute('style', 'display:block;');\n },\n hide() {\n vsubmitting.setAttribute('style', 'display:none;');\n _root.nodata.hide();\n }\n };\n\n let _mark = _root.el.querySelector('.vmark');\n // alert\n _root.alert = {\n /**\n * {\n * type:0/1,\n * text:'',\n * ctxt:'',\n * otxt:'',\n * cb:fn\n * }\n *\n * @param {Object} o\n */\n show(o) {\n _mark.innerHTML = `
    ${o.text}
    `;\n let _vbtns = _mark.querySelector('.vbtns');\n let _cBtn = ``;\n let _oBtn = ``;\n _vbtns.innerHTML = `${_cBtn}${o.type && _oBtn}`;\n _mark.querySelector('.vcancel').addEventListener('click', function (e) {\n _root.alert.hide();\n });\n _mark.setAttribute('style', 'display:block;');\n if (o && o.type) {\n let _ok = _mark.querySelector('.vsure');\n Event.on('click', _ok, (e) => {\n _root.alert.hide();\n o.cb && o.cb();\n });\n }\n },\n hide() {\n _mark.setAttribute('style', 'display:none;');\n }\n }\n\n _root.loading.show();\n var query = new _root.v.Query('Comment');\n query.equalTo('url', defaultComment['url']);\n query.count().then(function (count) {\n _root.el.querySelector('.count').innerHTML = `${count}`;\n _root.bind(option);\n }, function (error) {\n console.log(error);\n });\n }\n\n /**\n * Bind Event\n */\n bind(option) {\n let _root = this;\n // Smile pictures\n let vsmiles = _root.el.querySelector('.vsmile-icons');\n Event.on('click', vsmiles, (e) => {\n var textField = _root.el.querySelector('.veditor');\n let imgSrc = e.target.src;\n if ( typeof imgSrc == 'undefined' ) return;\n // var tag = \" ![](/\" + imgSrc.replace(/^.*\\/(.*\\.gif)$/, '$1') + \") \";\n var tag = \"!(:\" + decodeURI(imgSrc).replace(/^.*\\/(.*)$/, '$1') + \":)\";\n if (document.selection) {\n textField.focus();\n sel = document.selection.createRange();\n sel.text = tag;\n textField.focus();\n } else if (textField.selectionStart || textField.selectionStart == '0') {\n var startPos = textField.selectionStart;\n var endPos = textField.selectionEnd;\n var cursorPos = endPos;\n textField.value = textField.value.substring(0, startPos) + tag + textField.value.substring(endPos, textField.value.length);\n cursorPos += tag.length;\n textField.focus();\n textField.selectionStart = cursorPos;\n textField.selectionEnd = cursorPos\n } else {\n textField.value += tag;\n textField.focus()\n }\n defaultComment[\"comment\"] = textField.value;\n let submitBtn = _root.el.querySelector('.vsubmit');\n if (submitBtn.getAttribute('disabled')) submitBtn.removeAttribute('disabled');\n })\n let comment_trigger = _root.el.querySelector('.comment_trigger');\n Event.on('click', comment_trigger, (e) => {\n comment_trigger.setAttribute('style', 'display:none');\n _root.el.querySelector('.auth-section').removeAttribute('style');\n _root.el.querySelector('.veditor').focus();\n })\n let smile_btn = _root.el.querySelector('.vsmile-btn');\n let smile_icons = _root.el.querySelector('.vsmile-icons');\n Event.on('click', smile_btn, (e)=>{\n if (smile_icons.getAttribute('triggered')) {\n smile_icons.setAttribute('style', 'display:none;');\n smile_icons.removeAttribute('triggered');\n }\n else {\n smile_icons.removeAttribute('style');\n smile_icons.setAttribute('triggered', 1);\n }\n });\n\n // Query && show comment list\n\n let expandEvt = (el) => {\n if (el.offsetHeight > 180) {\n el.classList.add('expand');\n Event.on('click', el, (e) => {\n el.setAttribute('class', 'vcomment');\n })\n }\n };\n\n let commonQuery = () => {\n let query = new _root.v.Query('Comment');\n query.select(['nick', 'comment', 'link', 'rid', 'emailHash']);\n query.notEqualTo('isSpam', true);\n query.equalTo('url', defaultComment['url']);\n query.addDescending('createdAt');\n return query;\n };\n\n var num = 1;\n let query = (n = 1) => {\n _root.loading.show();\n var size = 10;\n var count = Number(_root.el.querySelector('.count').innerText);\n let cq = commonQuery();\n cq.limit(size);\n cq.skip((n - 1) * size);\n cq.find().then(rets => {\n let len = rets.length;\n if (len) {\n // _root.el.querySelector('.vlist').innerHTML = '';\n for (let i = 0; i < len; i++) {\n insertComment(rets[i], false)\n }\n var _vpage = _root.el.querySelector('.vpage');\n _vpage.innerHTML = size * n < count ? `
    加载更多评论(剩余${count - size * n}/${count}条)
    ` : '';\n var _vmore = _vpage.querySelector('#vmore');\n if (_vmore) {\n Event.on('click', _vmore, (e) => {\n _vpage.innerHTML = '';\n query(++num)\n })\n }\n }\n _root.loading.hide();\n }).catch(ex => {\n console.log(ex);\n _root.loading.hide();\n })\n }\n query();\n\n let insertComment = (ret, top=true) => {\n let _vcard = document.createElement('li');\n _vcard.setAttribute('class', 'vcard');\n _vcard.setAttribute('id', ret.id);\n let emailHash = ret.get('emailHash') == EMPTY_EMAIL_HASH ? DEFAULT_EMAIL_HASH : ret.get('emailHash')\n let gravatar_url = GRAVATAR_BASE_URL + emailHash + '?size=80';\n // language=HTML\n _vcard.innerHTML = `\n
    \n
    \n ${ret.get(\"nick\")}\n \n ${timeAgo(ret.get(\"createdAt\"))}\n
    \n
    ${ret.get('comment')}
    \n \n
    \n
    \n 回复`;\n let _vlist = _root.el.querySelector('.vlist');\n let _vlis = _vlist.querySelectorAll('li');\n let _vat = _vcard.querySelector('.vat');\n let _as = _vcard.querySelectorAll('a');\n for (let i = 0, len = _as.length; i < len; i++) {\n let item = _as[i];\n if (item && item.getAttribute('class') != 'at') {\n item.setAttribute('target', '_blank');\n item.setAttribute('rel', 'nofollow');\n }\n }\n if (!top) _vlist.appendChild(_vcard);\n else _vlist.insertBefore(_vcard, _vlis[0]);\n let _vcontent = _vcard.querySelector('.vcomment');\n expandEvt(_vcontent);\n bindAtEvt(_vat);\n }\n\n let mapping = {\n veditor: \"comment\",\n vnick: \"nick\",\n vlink: \"link\",\n vmail: 'mail'\n };\n let inputs = {};\n for (let i in mapping) {\n if (mapping.hasOwnProperty(i)) {\n let _v = mapping[i];\n let _el = _root.el.querySelector(`.${i}`);\n inputs[_v] = _el;\n Event.on('input', _el, (e) => {\n defaultComment[_v] = HtmlUtil.encode(_el.value.replace(/(^\\s*)|(\\s*$)/g, \"\"));\n });\n }\n }\n\n // cache\n let getCache = () => {\n let s = store && store.getItem('ValineCache');\n if (!!s) {\n s = JSON.parse(s);\n let m = ['nick', 'link', 'mail'];\n for (let i in m) {\n let k = m[i];\n _root.el.querySelector(`.v${k}`).value = s[k];\n defaultComment[k] = s[k];\n }\n if (s['mail'] != '') {\n let el = _root.el.querySelector('.visitor_avatar');\n el.setAttribute('src', GRAVATAR_BASE_URL + crypto(s['mail'].toLowerCase().trim()) + '?size=80');\n }\n }\n }\n getCache();\n\n // reset form\n _root.reset = () => {\n for (let i in mapping) {\n if (mapping.hasOwnProperty(i)) {\n let _v = mapping[i];\n let _el = _root.el.querySelector(`.${i}`);\n _el.value = \"\";\n defaultComment[_v] = \"\";\n }\n }\n defaultComment['rid'] = '';\n defaultComment['nick'] = '小可爱';\n getCache();\n }\n\n // submit\n let submitBtn = _root.el.querySelector('.vsubmit');\n let submitEvt = (e) => {\n if (submitBtn.getAttribute('disabled')) {\n _root.alert.show({\n type: 0,\n text: '再等等,评论正在提交中ヾ(๑╹◡╹)ノ\"',\n ctxt: '好的'\n })\n return;\n }\n if (defaultComment.comment == '') {\n inputs['comment'].focus();\n return;\n }\n if (defaultComment.nick == '') {\n defaultComment['nick'] = '小调皮';\n }\n // replace smiles\n defaultComment.comment = defaultComment.comment.replace(/!\\(:(.*?\\.\\w+):\\)/g, `![](${option.emoticon_url}/$1)`);\n defaultComment.comment = marked(defaultComment.comment);\n let idx = defaultComment.comment.indexOf(defaultComment.at);\n if (idx > -1 && defaultComment.at != '') {\n let at = `${defaultComment.at}`;\n defaultComment.comment = defaultComment.comment.replace(defaultComment.at, at);\n }\n // veirfy\n let mailRet = check.mail(defaultComment.mail);\n let linkRet = check.link(defaultComment.link);\n defaultComment['mail'] = mailRet.k ? mailRet.v : '';\n defaultComment['link'] = linkRet.k ? linkRet.v : '';\n if (!mailRet.k && !linkRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的网址和邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?',\n cb() {\n commitEvt()\n }\n })\n } else if (!mailRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?',\n cb() {\n commitEvt();\n }\n })\n } else if (!linkRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的网址格式不正确, 是否继续提交?',\n cb() {\n commitEvt();\n }\n })\n } else {\n commitEvt();\n }\n }\n\n // setting access\n let getAcl = () => {\n let acl = new _root.v.ACL();\n acl.setPublicReadAccess(true);\n acl.setPublicWriteAccess(false);\n return acl;\n }\n\n let commitEvt = () => {\n submitBtn.setAttribute('disabled', true);\n _root.submitting.show();\n // 声明类型\n let Ct = _root.v.Object.extend('Comment');\n // 新建对象\n let comment = new Ct();\n for (let i in defaultComment) {\n if (defaultComment.hasOwnProperty(i)) {\n if (i === 'at')\n continue;\n let _v = defaultComment[i];\n comment.set(i, _v);\n }\n }\n comment.set('emailHash', crypto(defaultComment.mail.toLowerCase().trim()));\n comment.setACL(getAcl());\n comment.save().then((commentItem) => {\n store && store.setItem('ValineCache', JSON.stringify({\n nick: defaultComment['nick'],\n link: defaultComment['link'],\n mail: defaultComment['mail']\n }));\n let _count = _root.el.querySelector('.count');\n _count.innerText = Number(_count.innerText) + 1;\n insertComment(commentItem, true);\n submitBtn.removeAttribute('disabled');\n _root.submitting.hide();\n _root.nodata.hide();\n _root.reset();\n }).catch(ex => {\n _root.submitting.hide();\n })\n }\n\n // at event\n let bindAtEvt = (el) => {\n Event.on('click', el, (e) => {\n let at = el.getAttribute('at');\n let rid = el.getAttribute('rid');\n defaultComment['rid'] = rid;\n defaultComment['at'] = at;\n inputs['comment'].value = `${at} ,` + inputs['comment'].value;\n inputs['comment'].focus();\n // remove comment trigger\n _root.el.querySelector('.comment_trigger').setAttribute('style', 'display:none');\n _root.el.querySelector('.auth-section').removeAttribute('style');\n _root.el.querySelector('.veditor').focus();\n })\n }\n\n Event.off('click', submitBtn, submitEvt);\n Event.on('click', submitBtn, submitEvt);\n }\n}\n\nconst Event = {\n on(type, el, handler, capture) {\n if (el.addEventListener) el.addEventListener(type, handler, capture || false);\n else if (el.attachEvent) el.attachEvent(`on${type}`, handler);\n else el[`on${type}`] = handler;\n },\n off(type, el, handler, capture) {\n if (el.removeEventListener) el.removeEventListener(type, handler, capture || false);\n else if (el.detachEvent) el.detachEvent(`on${type}`, handler);\n else el[`on${type}`] = null;\n }\n}\n\nconst check = {\n mail(m) {\n return {\n k: /\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}/.test(m),\n v: m\n };\n },\n link(l) {\n if (l.length > 0) {\n l = /^(http|https)/.test(l) ? l : `http://${l}`;\n }\n return {\n k: l.length > 0 ? /(http|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?/.test(l) : true,\n v: l\n };\n }\n}\n\nconst HtmlUtil = {\n\n // /**\n // *\n // * 将str中的链接转换成a标签形式\n // * @param {String} str\n // * @returns\n // */\n // transUrl(str) {\n // let reg = /(http:\\/\\/|https:\\/\\/)((\\w|=|\\?|\\.|\\/|&|-)+)/g;\n // return str.replace(reg, '$1$2');\n // },\n /**\n * HTML转码\n * @param {String} str\n * @return {String} result\n */\n encode(str) {\n return !!str ? str.replace(/&/g, \"&\").replace(//g, \">\").replace(/ /g, \" \").replace(/\\'/g, \"'\").replace(/\\\"/g, \""\") : '';\n },\n /**\n * HTML解码\n * @param {String} str\n * @return {String} result\n */\n decode(str) {\n return !!str ? str.replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\").replace(/ /g, \" \").replace(/'/g, \"\\'\").replace(/"/g, \"\\\"\") : '';\n }\n};\n\nconst dateFormat = (date) => {\n var vDay = padWithZeros(date.getDate(), 2);\n var vMonth = padWithZeros(date.getMonth() + 1, 2);\n var vYear = padWithZeros(date.getFullYear(), 2);\n // var vHour = padWithZeros(date.getHours(), 2);\n // var vMinute = padWithZeros(date.getMinutes(), 2);\n // var vSecond = padWithZeros(date.getSeconds(), 2);\n return `${vYear}-${vMonth}-${vDay}`;\n // return `${vYear}-${vMonth}-${vDay} ${vHour}:${vMinute}:${vSecond}`;\n}\n\nconst timeAgo = (date) => {\n try {\n var oldTime = date.getTime();\n var currTime = new Date().getTime();\n var diffValue = currTime - oldTime;\n\n var days = Math.floor(diffValue / (24 * 3600 * 1000));\n if (days === 0) {\n //计算相差小时数\n var leave1 = diffValue % (24 * 3600 * 1000); //计算天数后剩余的毫秒数\n var hours = Math.floor(leave1 / (3600 * 1000));\n if (hours === 0) {\n //计算相差分钟数\n var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数\n var minutes = Math.floor(leave2 / (60 * 1000));\n if (minutes === 0) {\n //计算相差秒数\n var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数\n var seconds = Math.round(leave3 / 1000);\n return seconds + ' 秒前';\n }\n return minutes + ' 分钟前';\n }\n return hours + ' 小时前';\n }\n if (days < 0) return '刚刚';\n else if (days < 30) return days + ' 天前';\n else if (days < 365) return Math.floor(days / 30) + ' 月前';\n else return Math.floor(days / 365) + ' 年前';\n return dateFormat(date);\n } catch (error) {\n console.log(error)\n }\n}\n\nconst padWithZeros = (vNumber, width) => {\n var numAsString = vNumber.toString();\n while (numAsString.length < width) {\n numAsString = '0' + numAsString;\n }\n return numAsString;\n}\n\nconst loadJS = function (url, success) {\n var domScript = document.createElement('script');\n domScript.src = url;\n success = success || function () {\n };\n domScript.onload = domScript.onreadystatechange = function () {\n if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {\n success();\n this.onload = this.onreadystatechange = null;\n // this.parentNode.removeChild(this);\n }\n };\n document.getElementsByTagName('head')[0].appendChild(domScript);\n};\n\nconst getIp = function(){\n $.getJSON(\"https://api.ipify.org/?format=jsonp?callback=?\",\n function(json) {\n defaultComment['ip'] = json.ip;\n }\n );\n};\n\nmodule.exports = Valine;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Valine.js","exports = module.exports = require(\"../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"@charset \\\"UTF-8\\\";\\n.valine {\\n /************ Loading ************/ }\\n .valine * {\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n font-size: 100%;\\n font-weight: normal;\\n line-height: 1.42857143;\\n color: #3c484e;\\n -webkit-transition: all .3s ease;\\n transition: all .3s ease;\\n margin: 0;\\n padding: 0; }\\n .valine .vwrap {\\n overflow: hidden;\\n position: relative;\\n border: 1px solid #ededed; }\\n .valine .vwrap .comment-smiles {\\n margin: 0;\\n padding: 0 1em;\\n margin: .5em 0; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap {\\n width: 100%;\\n height: 1.7em; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg {\\n fill: #aaaaaa;\\n cursor: pointer; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg:hover {\\n fill: #777777; }\\n .valine .vwrap .comment-smiles .vsmile-icons {\\n padding: .2em 0;\\n margin: .3em 0;\\n border-top: 1px solid #ededed;\\n border-radius: 0;\\n max-height: 64px;\\n overflow: auto; }\\n .valine .vwrap .comment-smiles .vsmile-icons img {\\n width: auto !important;\\n height: 28px !important;\\n margin-right: 4px;\\n cursor: pointer; }\\n .valine .vwrap .textarea-wrapper {\\n color: #4b5b62;\\n width: 100%;\\n height: 100%;\\n background: #fff;\\n position: relative;\\n border-radius: 0; }\\n .valine .vwrap .textarea-wrapper .comment_trigger {\\n position: absolute;\\n z-index: 10;\\n width: 100%;\\n height: 100%;\\n background-color: #fff;\\n padding: 0 1em; }\\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar {\\n position: absolute;\\n width: 3em;\\n height: 3em;\\n position: absolute;\\n top: 50%;\\n -webkit-transform: translateY(-50%);\\n transform: translateY(-50%); }\\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar img {\\n border-radius: 100%;\\n width: 3em;\\n height: 3em; }\\n .valine .vwrap .textarea-wrapper .comment_trigger .trigger_title {\\n position: absolute;\\n top: 50%;\\n -webkit-transform: translateY(-50%);\\n transform: translateY(-50%);\\n color: #aaa;\\n font-size: 1.4em;\\n margin-left: 3.5em; }\\n .valine .vwrap .textarea-wrapper textarea {\\n padding: 1em 1em 0;\\n color: #4b5b62;\\n width: 100%;\\n background: #fff;\\n border: none;\\n resize: none;\\n min-height: 3em; }\\n .valine .vwrap .textarea-wrapper textarea:focus {\\n border-color: #c4c8cb;\\n outline: 0; }\\n .valine .vwrap .trigger-section {\\n display: none; }\\n .valine .vwrap .auth-section {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n background: #fbfbfb;\\n padding: .3em .6em; }\\n .valine .vwrap .auth-section .input-wrapper {\\n -ms-flex: 1 1 27%;\\n -webkit-box-flex: 1;\\n flex: 1 1 27%;\\n width: 27%; }\\n .valine .vwrap .auth-section .input-wrapper input {\\n color: #4b5b62;\\n background: #fafafa;\\n border: none;\\n border-radius: 0;\\n padding: .6em;\\n margin: 0;\\n line-height: 2;\\n font-size: 1em !important; }\\n .valine .vwrap .auth-section .input-wrapper input:focus {\\n border-color: #c4c8cb;\\n outline: 0; }\\n .valine .vwrap .auth-section input {\\n width: 100%; }\\n .valine .vwrap .auth-section .post-action {\\n -ms-flex: 1 1 19%;\\n -webkit-box-flex: 1;\\n flex: 1 1 19%;\\n width: 19%;\\n margin: 0;\\n padding: 2px 0 0; }\\n .valine .vwrap .auth-section .post-action button {\\n color: #fff;\\n width: 100%;\\n line-height: 2;\\n font-weight: bolder;\\n border-radius: 30px;\\n border: 1px solid #e9eff3;\\n background-color: #111;\\n padding: .4em .5em;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n font-size: 1em !important; }\\n .valine .vwrap .auth-section .post-action button:hover {\\n background-color: #444; }\\n @media screen and (max-width: 720px) {\\n .valine .vwrap .auth-section {\\n display: block; }\\n .valine .vwrap .auth-section .input-wrapper, .valine .vwrap .auth-section .post-action {\\n -ms-flex: 1 1 100%;\\n -webkit-box-flex: 1;\\n flex: 1 1 100%;\\n padding-right: 0;\\n width: 100%; } }\\n .valine .vwrap .vmark {\\n position: absolute;\\n background: rgba(0, 0, 0, 0.65);\\n width: 100%;\\n height: 100%;\\n left: 0;\\n top: 0; }\\n .valine .vwrap .vmark .valert {\\n padding: 3em 0 0 0; }\\n .valine .vwrap .vmark .valert .vtext {\\n color: #fff;\\n padding: 15px; }\\n .valine .vwrap .vmark .valert .vcode {\\n width: 75px;\\n border-radius: 5px;\\n background: #dedede; }\\n .valine .vwrap .vmark .valert .vcode:focus {\\n border-color: #3090e4;\\n background-color: #fff; }\\n @media screen and (max-width: 720px) {\\n .valine .vwrap .vmark .valert {\\n padding: 8em 0; }\\n .valine .vwrap .vmark .valert .vtext {\\n color: #fff;\\n padding: 10px; } }\\n .valine .info {\\n padding: 5px;\\n margin: .5em 0; }\\n .valine .info .col {\\n display: inline-block;\\n vertical-align: middle; }\\n .valine .info svg {\\n margin-right: 2px;\\n overflow: hidden;\\n fill: currentColor; }\\n .valine .power {\\n color: #999;\\n font-size: 0.625em !important;\\n position: relative; }\\n .valine a {\\n text-decoration: none;\\n color: #3eb0ef; }\\n .valine ul,\\n .valine li {\\n list-style: none; }\\n .valine .txt-center {\\n text-align: center; }\\n .valine .float-right {\\n float: right !important; }\\n .valine .pd5 {\\n padding: 5px; }\\n .valine .pd10 {\\n padding: 10px; }\\n .valine .vbtn {\\n display: inline-block;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none;\\n border: 1px solid #e9eff3;\\n background-color: #333;\\n border-radius: .1em;\\n color: #fff;\\n padding: .5em 1.5em;\\n cursor: pointer;\\n white-space: nowrap;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n outline: none;\\n min-width: 60px;\\n max-width: 100%;\\n margin: 0 1em; }\\n .valine .vbtn:active,\\n .valine .vbtn:hover {\\n border-color: #666; }\\n .valine .vpage {\\n margin: 1.5em 0; }\\n .valine .vpage .more {\\n width: 100%;\\n height: 2.5em;\\n line-height: 2.5em;\\n text-align: center;\\n cursor: pointer;\\n color: #666;\\n background: #fafafa;\\n border-radius: 1.25em; }\\n .valine .vlist {\\n width: 100%; }\\n .valine .vlist .vcard {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n -ms-flex-direction: row;\\n flex-direction: row;\\n padding: 2em 1em;\\n border: 1px solid rgba(150, 150, 150, 0.18);\\n margin: 2em 0 0;\\n list-style: none;\\n border-radius: 5px;\\n word-break: break-all; }\\n .valine .vlist .vcard:hover {\\n border: 1px solid rgba(150, 150, 150, 0.25); }\\n .valine .vlist .vcard:hover .vat {\\n background: #111 !important; }\\n .valine .vlist .vcard .vfooter {\\n margin: -2em 0 0; }\\n .valine .vlist .vcard .vfooter .vat {\\n background: transparent;\\n color: #ffffff;\\n padding: .2em 1em;\\n line-height: 1.6;\\n cursor: pointer;\\n word-break: keep-all;\\n text-transform: uppercase; }\\n .valine .vlist .vcard .vavatar {\\n -webkit-box-flex: 0;\\n flex: 0 0 auto;\\n -ms-flex: 0 0 auto;\\n margin-right: 1em;\\n margin-top: 0.1em;\\n display: inline-block;\\n height: 3em;\\n width: 3em;\\n position: relative;\\n border-radius: 50%; }\\n .valine .vlist .vcard .vavatar:hover {\\n transform: rotate(1turn);\\n -webkit-transform: rotate(1turn); }\\n .valine .vlist .vcard .text-wrapper {\\n overflow: hidden;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n width: 100%; }\\n .valine .vlist .vcard .text-wrapper .vhead {\\n line-height: 1;\\n margin-bottom: 1em; }\\n .valine .vlist .vcard .text-wrapper .vhead a {\\n font-weight: bolder;\\n font-size: 1em;\\n color: rgba(0, 0, 0, 0.7); }\\n .valine .vlist .vcard .text-wrapper .vhead .spacer {\\n color: #ccc;\\n margin-left: 0.3em;\\n margin-right: 0.3em; }\\n .valine .vlist .vcard .text-wrapper .vhead .vtime {\\n color: #a9a4a4;\\n display: inline-block;\\n font-weight: normal; }\\n .valine .vlist .vcard .text-wrapper .vcomment {\\n position: relative; }\\n .valine .vlist .vcard .text-wrapper .vcomment p {\\n word-wrap: break-word;\\n white-space: pre-wrap;\\n word-break: break-all;\\n text-align: justify;\\n line-height: 1.8; }\\n .valine .vlist .vcard .text-wrapper .vcomment pre {\\n overflow: auto;\\n padding: 6px 10px;\\n word-wrap: break-word;\\n color: #555;\\n background: #f5f2f2;\\n border-radius: 3px;\\n font-size: .875rem;\\n margin: 5px 0; }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand {\\n cursor: pointer;\\n max-height: 11.25rem;\\n overflow: hidden; }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand:before {\\n display: block;\\n content: \\\"\\\";\\n position: absolute;\\n width: 100%;\\n left: 0;\\n top: 0;\\n bottom: 3.15rem;\\n pointer-events: none;\\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.8)));\\n background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8)); }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand:after {\\n display: block;\\n content: \\\"\\\\5C55\\\\5F00 \\\";\\n text-align: center;\\n color: #828586;\\n position: absolute;\\n width: 100%;\\n height: 3.15rem;\\n line-height: 3.15rem;\\n left: 0;\\n bottom: 0;\\n pointer-events: none;\\n background: rgba(255, 255, 255, 0.9); }\\n .valine .vlist .vempty {\\n padding: 20px;\\n text-align: center;\\n color: #999; }\\n .valine .spinner {\\n margin: 10px auto;\\n width: 50px;\\n height: 30px;\\n text-align: center;\\n font-size: 10px; }\\n .valine .spinner > div {\\n background-color: #9c9c9c;\\n height: 100%;\\n width: 6px;\\n margin-right: 3px;\\n display: inline-block;\\n -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;\\n animation: sk-stretchdelay 1.2s infinite ease-in-out; }\\n .valine .spinner .r2 {\\n -webkit-animation-delay: -1.1s;\\n animation-delay: -1.1s; }\\n .valine .spinner .r3 {\\n -webkit-animation-delay: -1.0s;\\n animation-delay: -1.0s; }\\n .valine .spinner .r4 {\\n -webkit-animation-delay: -0.9s;\\n animation-delay: -0.9s; }\\n .valine .spinner .r5 {\\n -webkit-animation-delay: -0.8s;\\n animation-delay: -0.8s; }\\n\\n@-webkit-keyframes sk-stretchdelay {\\n 0%,\\n 40%,\\n 100% {\\n -webkit-transform: scaleY(0.4); }\\n 20% {\\n -webkit-transform: scaleY(1); } }\\n\\n@keyframes sk-stretchdelay {\\n 0%,\\n 40%,\\n 100% {\\n transform: scaleY(0.4);\\n -webkit-transform: scaleY(0.4); }\\n 20% {\\n transform: scaleY(1);\\n -webkit-transform: scaleY(1); } }\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader!./~/postcss-loader/lib!./~/sass-loader/lib/loader.js!./src/Valine.scss\n// module id = 4\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader/lib/css-base.js\n// module id = 5\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of
    \\n
    \\n \\n \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\u5DF2\\u6709 0 \\u6761\\u8BC4\\u8BBA
    \\n
    \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    ';\n _root.el.innerHTML = eleHTML;\n // Empty Data\n var vempty = _root.el.querySelector('.vempty');\n _root.nodata = {\n show: function show(txt) {\n vempty.innerHTML = txt || '\\u8FD8\\u6CA1\\u6709\\u8BC4\\u8BBA\\u54E6\\uFF0C\\u5FEB\\u6765\\u62A2\\u6C99\\u53D1\\u5427!';\n vempty.setAttribute('style', 'display:block;');\n },\n hide: function hide() {\n vempty.setAttribute('style', 'display:none;');\n }\n };\n _root.nodata.show();\n\n // load smiles image\n var _smile_wrapper = _root.el.querySelector('.vsmile-icons');\n var smile_names = option.emoticon_list || [\"mrgreen\", \"neutral\", \"twisted\", \"arrow\", \"eek\", \"smile\", \"confused\", \"cool\", \"evil\", \"biggrin\", \"idea\", \"redface\", \"razz\", \"rolleyes\", \"wink\", \"cry\", \"surprised\", \"lol\", \"mad\", \"sad\", \"exclaim\", \"question\"];\n for (var i in smile_names) {\n var img = document.createElement('img');\n img.setAttribute('src', option.emoticon_url + '/' + smile_names[i]);\n _smile_wrapper.appendChild(img);\n }\n av.init({\n appId: option.app_id || option.appId,\n appKey: option.app_key || option.appKey\n });\n _root.v = av;\n } catch (ex) {\n var issue = 'https://github.com/panjunwen/Valine/issues';\n if (_root.el) _root.nodata.show('
    ' + ex + '
    Valine:' + _root.version + '
    \\u53CD\\u9988\\uFF1A' + issue + '
    ');else console && console.log('%c' + ex + '\\n%cValine%c' + _root.version + ' ' + issue, 'color:red;', 'background:#000;padding:5px;line-height:30px;color:#fff;', 'background:#456;line-height:30px;padding:5px;color:#fff;');\n return;\n }\n\n // loading\n var _spinner = '
    ';\n var vloading = _root.el.querySelector('.vloading');\n vloading.innerHTML = _spinner;\n // loading control\n _root.loading = {\n show: function show() {\n vloading.setAttribute('style', 'display:block;');\n _root.nodata.hide();\n },\n hide: function hide() {\n vloading.setAttribute('style', 'display:none;');\n _root.el.querySelectorAll('.vcard').length === 0 && _root.nodata.show();\n }\n };\n\n var vsubmitting = _root.el.querySelector('.vsubmitting');\n vsubmitting.innerHTML = _spinner;\n _root.submitting = {\n show: function show() {\n vsubmitting.setAttribute('style', 'display:block;');\n },\n hide: function hide() {\n vsubmitting.setAttribute('style', 'display:none;');\n _root.nodata.hide();\n }\n };\n\n var _mark = _root.el.querySelector('.vmark');\n // alert\n _root.alert = {\n /**\n * {\n * type:0/1,\n * text:'',\n * ctxt:'',\n * otxt:'',\n * cb:fn\n * }\n *\n * @param {Object} o\n */\n show: function show(o) {\n _mark.innerHTML = '
    ' + o.text + '
    ';\n var _vbtns = _mark.querySelector('.vbtns');\n var _cBtn = '';\n var _oBtn = '';\n _vbtns.innerHTML = '' + _cBtn + (o.type && _oBtn);\n _mark.querySelector('.vcancel').addEventListener('click', function (e) {\n _root.alert.hide();\n });\n _mark.setAttribute('style', 'display:block;');\n if (o && o.type) {\n var _ok = _mark.querySelector('.vsure');\n Event.on('click', _ok, function (e) {\n _root.alert.hide();\n o.cb && o.cb();\n });\n }\n },\n hide: function hide() {\n _mark.setAttribute('style', 'display:none;');\n }\n };\n\n _root.loading.show();\n var query = new _root.v.Query('Comment');\n query.equalTo('url', defaultComment['url']);\n query.count().then(function (count) {\n _root.el.querySelector('.count').innerHTML = '' + count;\n _root.bind(option);\n }, function (error) {\n console.log(error);\n });\n }\n\n /**\n * Bind Event\n */\n\n }, {\n key: 'bind',\n value: function bind(option) {\n var _root = this;\n // Smile pictures\n var vsmiles = _root.el.querySelector('.vsmile-icons');\n Event.on('click', vsmiles, function (e) {\n var textField = _root.el.querySelector('.veditor');\n var imgSrc = e.target.src;\n if (typeof imgSrc == 'undefined') return;\n // var tag = \" ![](/\" + imgSrc.replace(/^.*\\/(.*\\.gif)$/, '$1') + \") \";\n var tag = \"!(:\" + decodeURI(imgSrc).replace(/^.*\\/(.*)$/, '$1') + \":)\";\n if (document.selection) {\n textField.focus();\n sel = document.selection.createRange();\n sel.text = tag;\n textField.focus();\n } else if (textField.selectionStart || textField.selectionStart == '0') {\n var startPos = textField.selectionStart;\n var endPos = textField.selectionEnd;\n var cursorPos = endPos;\n textField.value = textField.value.substring(0, startPos) + tag + textField.value.substring(endPos, textField.value.length);\n cursorPos += tag.length;\n textField.focus();\n textField.selectionStart = cursorPos;\n textField.selectionEnd = cursorPos;\n } else {\n textField.value += tag;\n textField.focus();\n }\n defaultComment[\"comment\"] = textField.value;\n var submitBtn = _root.el.querySelector('.vsubmit');\n if (submitBtn.getAttribute('disabled')) submitBtn.removeAttribute('disabled');\n });\n var comment_trigger = _root.el.querySelector('.comment_trigger');\n Event.on('click', comment_trigger, function (e) {\n comment_trigger.setAttribute('style', 'display:none');\n _root.el.querySelector('.auth-section').removeAttribute('style');\n _root.el.querySelector('.veditor').focus();\n });\n var smile_btn = _root.el.querySelector('.vsmile-btn');\n var smile_icons = _root.el.querySelector('.vsmile-icons');\n Event.on('click', smile_btn, function (e) {\n if (smile_icons.getAttribute('triggered')) {\n smile_icons.setAttribute('style', 'display:none;');\n smile_icons.removeAttribute('triggered');\n } else {\n smile_icons.removeAttribute('style');\n smile_icons.setAttribute('triggered', 1);\n }\n });\n\n // Query && show comment list\n\n var expandEvt = function expandEvt(el) {\n if (el.offsetHeight > 180) {\n el.classList.add('expand');\n Event.on('click', el, function (e) {\n el.setAttribute('class', 'vcomment');\n });\n }\n };\n\n var commonQuery = function commonQuery() {\n var query = new _root.v.Query('Comment');\n query.select(['nick', 'comment', 'link', 'rid', 'emailHash']);\n query.notEqualTo('isSpam', true);\n query.equalTo('url', defaultComment['url']);\n query.addDescending('createdAt');\n return query;\n };\n\n var num = 1;\n var query = function query() {\n var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n\n _root.loading.show();\n var size = 10;\n var count = Number(_root.el.querySelector('.count').innerText);\n var cq = commonQuery();\n cq.limit(size);\n cq.skip((n - 1) * size);\n cq.find().then(function (rets) {\n var len = rets.length;\n if (len) {\n // _root.el.querySelector('.vlist').innerHTML = '';\n for (var i = 0; i < len; i++) {\n insertComment(rets[i], false);\n }\n var _vpage = _root.el.querySelector('.vpage');\n _vpage.innerHTML = size * n < count ? '
    \\u52A0\\u8F7D\\u66F4\\u591A\\u8BC4\\u8BBA\\uFF08\\u5269\\u4F59' + (count - size * n) + '/' + count + '\\u6761\\uFF09
    ' : '';\n var _vmore = _vpage.querySelector('#vmore');\n if (_vmore) {\n Event.on('click', _vmore, function (e) {\n _vpage.innerHTML = '';\n query(++num);\n });\n }\n }\n _root.loading.hide();\n }).catch(function (ex) {\n console.log(ex);\n _root.loading.hide();\n });\n };\n query();\n\n var insertComment = function insertComment(ret) {\n var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var _vcard = document.createElement('li');\n _vcard.setAttribute('class', 'vcard');\n _vcard.setAttribute('id', ret.id);\n var emailHash = ret.get('emailHash') == EMPTY_EMAIL_HASH ? DEFAULT_EMAIL_HASH : ret.get('emailHash');\n var gravatar_url = GRAVATAR_BASE_URL + emailHash + '?size=80';\n // language=HTML\n _vcard.innerHTML = '\\n
    \\n
    \\n ' + ret.get(\"nick\") + '\\n \\u2022\\n ' + timeAgo(ret.get(\"createdAt\")) + '\\n
    \\n
    ' + ret.get('comment') + '
    \\n \\n
    \\n
    \\n \\u56DE\\u590D';\n var _vlist = _root.el.querySelector('.vlist');\n var _vlis = _vlist.querySelectorAll('li');\n var _vat = _vcard.querySelector('.vat');\n var _as = _vcard.querySelectorAll('a');\n for (var i = 0, len = _as.length; i < len; i++) {\n var item = _as[i];\n if (item && item.getAttribute('class') != 'at') {\n item.setAttribute('target', '_blank');\n item.setAttribute('rel', 'nofollow');\n }\n }\n if (!top) _vlist.appendChild(_vcard);else _vlist.insertBefore(_vcard, _vlis[0]);\n var _vcontent = _vcard.querySelector('.vcomment');\n expandEvt(_vcontent);\n bindAtEvt(_vat);\n };\n\n var mapping = {\n veditor: \"comment\",\n vnick: \"nick\",\n vlink: \"link\",\n vmail: 'mail'\n };\n var inputs = {};\n for (var i in mapping) {\n if (mapping.hasOwnProperty(i)) {\n (function () {\n var _v = mapping[i];\n var _el = _root.el.querySelector('.' + i);\n inputs[_v] = _el;\n Event.on('input', _el, function (e) {\n defaultComment[_v] = HtmlUtil.encode(_el.value.replace(/(^\\s*)|(\\s*$)/g, \"\"));\n });\n })();\n }\n }\n\n // cache\n var getCache = function getCache() {\n var s = store && store.getItem('ValineCache');\n if (!!s) {\n s = JSON.parse(s);\n var m = ['nick', 'link', 'mail'];\n for (var _i in m) {\n var k = m[_i];\n _root.el.querySelector('.v' + k).value = s[k];\n defaultComment[k] = s[k];\n }\n if (s['mail'] != '') {\n var el = _root.el.querySelector('.visitor_avatar');\n el.setAttribute('src', GRAVATAR_BASE_URL + crypto(s['mail'].toLowerCase().trim()) + '?size=80');\n }\n }\n };\n getCache();\n\n // reset form\n _root.reset = function () {\n for (var _i2 in mapping) {\n if (mapping.hasOwnProperty(_i2)) {\n var _v = mapping[_i2];\n var _el = _root.el.querySelector('.' + _i2);\n _el.value = \"\";\n defaultComment[_v] = \"\";\n }\n }\n defaultComment['rid'] = '';\n defaultComment['nick'] = '小可爱';\n getCache();\n };\n\n // submit\n var submitBtn = _root.el.querySelector('.vsubmit');\n var submitEvt = function submitEvt(e) {\n if (submitBtn.getAttribute('disabled')) {\n _root.alert.show({\n type: 0,\n text: '再等等,评论正在提交中ヾ(๑╹◡╹)ノ\"',\n ctxt: '好的'\n });\n return;\n }\n if (defaultComment.comment == '') {\n inputs['comment'].focus();\n return;\n }\n if (defaultComment.nick == '') {\n defaultComment['nick'] = '小调皮';\n }\n // replace smiles\n defaultComment.comment = defaultComment.comment.replace(/!\\(:(.*?\\.\\w+):\\)/g, '![](' + option.emoticon_url + '/$1)');\n defaultComment.comment = (0, _marked2.default)(defaultComment.comment);\n var idx = defaultComment.comment.indexOf(defaultComment.at);\n if (idx > -1 && defaultComment.at != '') {\n var at = '' + defaultComment.at + '';\n defaultComment.comment = defaultComment.comment.replace(defaultComment.at, at);\n }\n // veirfy\n var mailRet = check.mail(defaultComment.mail);\n var linkRet = check.link(defaultComment.link);\n defaultComment['mail'] = mailRet.k ? mailRet.v : '';\n defaultComment['link'] = linkRet.k ? linkRet.v : '';\n if (!mailRet.k && !linkRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的网址和邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?',\n cb: function cb() {\n commitEvt();\n }\n });\n } else if (!mailRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?',\n cb: function cb() {\n commitEvt();\n }\n });\n } else if (!linkRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的网址格式不正确, 是否继续提交?',\n cb: function cb() {\n commitEvt();\n }\n });\n } else {\n commitEvt();\n }\n };\n\n // setting access\n var getAcl = function getAcl() {\n var acl = new _root.v.ACL();\n acl.setPublicReadAccess(true);\n acl.setPublicWriteAccess(false);\n return acl;\n };\n\n var commitEvt = function commitEvt() {\n submitBtn.setAttribute('disabled', true);\n _root.submitting.show();\n // 声明类型\n var Ct = _root.v.Object.extend('Comment');\n // 新建对象\n var comment = new Ct();\n for (var _i3 in defaultComment) {\n if (defaultComment.hasOwnProperty(_i3)) {\n if (_i3 === 'at') continue;\n var _v = defaultComment[_i3];\n comment.set(_i3, _v);\n }\n }\n comment.set('emailHash', crypto(defaultComment.mail.toLowerCase().trim()));\n comment.setACL(getAcl());\n comment.save().then(function (commentItem) {\n store && store.setItem('ValineCache', JSON.stringify({\n nick: defaultComment['nick'],\n link: defaultComment['link'],\n mail: defaultComment['mail']\n }));\n var _count = _root.el.querySelector('.count');\n _count.innerText = Number(_count.innerText) + 1;\n insertComment(commentItem, true);\n submitBtn.removeAttribute('disabled');\n _root.submitting.hide();\n _root.nodata.hide();\n _root.reset();\n }).catch(function (ex) {\n _root.submitting.hide();\n });\n };\n\n // at event\n var bindAtEvt = function bindAtEvt(el) {\n Event.on('click', el, function (e) {\n var at = el.getAttribute('at');\n var rid = el.getAttribute('rid');\n defaultComment['rid'] = rid;\n defaultComment['at'] = at;\n inputs['comment'].value = at + ' \\uFF0C' + inputs['comment'].value;\n inputs['comment'].focus();\n // remove comment trigger\n _root.el.querySelector('.comment_trigger').setAttribute('style', 'display:none');\n _root.el.querySelector('.auth-section').removeAttribute('style');\n _root.el.querySelector('.veditor').focus();\n });\n };\n\n Event.off('click', submitBtn, submitEvt);\n Event.on('click', submitBtn, submitEvt);\n }\n }]);\n\n return Valine;\n}();\n\nvar Event = {\n on: function on(type, el, handler, capture) {\n if (el.addEventListener) el.addEventListener(type, handler, capture || false);else if (el.attachEvent) el.attachEvent('on' + type, handler);else el['on' + type] = handler;\n },\n off: function off(type, el, handler, capture) {\n if (el.removeEventListener) el.removeEventListener(type, handler, capture || false);else if (el.detachEvent) el.detachEvent('on' + type, handler);else el['on' + type] = null;\n }\n};\n\nvar check = {\n mail: function mail(m) {\n return {\n k: /\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}/.test(m),\n v: m\n };\n },\n link: function link(l) {\n if (l.length > 0) {\n l = /^(http|https)/.test(l) ? l : 'http://' + l;\n }\n return {\n k: l.length > 0 ? /(http|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?/.test(l) : true,\n v: l\n };\n }\n};\n\nvar HtmlUtil = {\n\n // /**\n // *\n // * 将str中的链接转换成a标签形式\n // * @param {String} str\n // * @returns\n // */\n // transUrl(str) {\n // let reg = /(http:\\/\\/|https:\\/\\/)((\\w|=|\\?|\\.|\\/|&|-)+)/g;\n // return str.replace(reg, '$1$2');\n // },\n /**\n * HTML转码\n * @param {String} str\n * @return {String} result\n */\n encode: function encode(str) {\n return !!str ? str.replace(/&/g, \"&\").replace(//g, \">\").replace(/ /g, \" \").replace(/\\'/g, \"'\").replace(/\\\"/g, \""\") : '';\n },\n\n /**\n * HTML解码\n * @param {String} str\n * @return {String} result\n */\n decode: function decode(str) {\n return !!str ? str.replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\").replace(/ /g, \" \").replace(/'/g, \"\\'\").replace(/"/g, \"\\\"\") : '';\n }\n};\n\nvar dateFormat = function dateFormat(date) {\n var vDay = padWithZeros(date.getDate(), 2);\n var vMonth = padWithZeros(date.getMonth() + 1, 2);\n var vYear = padWithZeros(date.getFullYear(), 2);\n // var vHour = padWithZeros(date.getHours(), 2);\n // var vMinute = padWithZeros(date.getMinutes(), 2);\n // var vSecond = padWithZeros(date.getSeconds(), 2);\n return vYear + '-' + vMonth + '-' + vDay;\n // return `${vYear}-${vMonth}-${vDay} ${vHour}:${vMinute}:${vSecond}`;\n};\n\nvar timeAgo = function timeAgo(date) {\n try {\n var oldTime = date.getTime();\n var currTime = new Date().getTime();\n var diffValue = currTime - oldTime;\n\n var days = Math.floor(diffValue / (24 * 3600 * 1000));\n if (days === 0) {\n //计算相差小时数\n var leave1 = diffValue % (24 * 3600 * 1000); //计算天数后剩余的毫秒数\n var hours = Math.floor(leave1 / (3600 * 1000));\n if (hours === 0) {\n //计算相差分钟数\n var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数\n var minutes = Math.floor(leave2 / (60 * 1000));\n if (minutes === 0) {\n //计算相差秒数\n var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数\n var seconds = Math.round(leave3 / 1000);\n return seconds + ' 秒前';\n }\n return minutes + ' 分钟前';\n }\n return hours + ' 小时前';\n }\n if (days < 0) return '刚刚';else if (days < 30) return days + ' 天前';else if (days < 365) return Math.floor(days / 30) + ' 月前';else return Math.floor(days / 365) + ' 年前';\n return dateFormat(date);\n } catch (error) {\n console.log(error);\n }\n};\n\nvar padWithZeros = function padWithZeros(vNumber, width) {\n var numAsString = vNumber.toString();\n while (numAsString.length < width) {\n numAsString = '0' + numAsString;\n }\n return numAsString;\n};\n\nvar loadJS = function loadJS(url, success) {\n var domScript = document.createElement('script');\n domScript.src = url;\n success = success || function () {};\n domScript.onload = domScript.onreadystatechange = function () {\n if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {\n success();\n this.onload = this.onreadystatechange = null;\n // this.parentNode.removeChild(this);\n }\n };\n document.getElementsByTagName('head')[0].appendChild(domScript);\n};\n\nvar getIp = function getIp() {\n $.getJSON(\"https://api.ipify.org/?format=json\", function (json) {\n defaultComment['ip'] = json.ip;\n });\n};\n\nmodule.exports = Valine;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(5)(false);\n// imports\n\n\n// module\nexports.push([module.i, \"@charset \\\"UTF-8\\\";\\n.valine {\\n /************ Loading ************/ }\\n .valine * {\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n font-size: 100%;\\n font-weight: normal;\\n line-height: 1.42857143;\\n color: #3c484e;\\n -webkit-transition: all .3s ease;\\n transition: all .3s ease;\\n margin: 0;\\n padding: 0; }\\n .valine .vwrap {\\n overflow: hidden;\\n position: relative;\\n border: 1px solid #ededed; }\\n .valine .vwrap .comment-smiles {\\n margin: 0;\\n padding: 0 1em;\\n margin: .5em 0; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap {\\n width: 100%;\\n height: 1.7em; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg {\\n fill: #aaaaaa;\\n cursor: pointer; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg:hover {\\n fill: #777777; }\\n .valine .vwrap .comment-smiles .vsmile-icons {\\n padding: .2em 0;\\n margin: .3em 0;\\n border-top: 1px solid #ededed;\\n border-radius: 0;\\n max-height: 64px;\\n overflow: auto; }\\n .valine .vwrap .comment-smiles .vsmile-icons img {\\n width: auto !important;\\n height: 28px !important;\\n margin-right: 4px;\\n cursor: pointer; }\\n .valine .vwrap .textarea-wrapper {\\n color: #4b5b62;\\n width: 100%;\\n height: 100%;\\n background: #fff;\\n position: relative;\\n border-radius: 0; }\\n .valine .vwrap .textarea-wrapper .comment_trigger {\\n position: absolute;\\n z-index: 10;\\n width: 100%;\\n height: 100%;\\n background-color: #fff;\\n padding: 0 1em; }\\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar {\\n position: absolute;\\n width: 3em;\\n height: 3em;\\n position: absolute;\\n top: 50%;\\n -webkit-transform: translateY(-50%);\\n transform: translateY(-50%); }\\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar img {\\n border-radius: 100%;\\n width: 3em;\\n height: 3em; }\\n .valine .vwrap .textarea-wrapper .comment_trigger .trigger_title {\\n position: absolute;\\n top: 50%;\\n -webkit-transform: translateY(-50%);\\n transform: translateY(-50%);\\n color: #aaa;\\n font-size: 1.4em;\\n margin-left: 3.5em; }\\n .valine .vwrap .textarea-wrapper textarea {\\n padding: 1em 1em 0;\\n color: #4b5b62;\\n width: 100%;\\n background: #fff;\\n border: none;\\n resize: none;\\n min-height: 3em; }\\n .valine .vwrap .textarea-wrapper textarea:focus {\\n border-color: #c4c8cb;\\n outline: 0; }\\n .valine .vwrap .trigger-section {\\n display: none; }\\n .valine .vwrap .auth-section {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n background: #fbfbfb;\\n padding: .3em .6em; }\\n .valine .vwrap .auth-section .input-wrapper {\\n -ms-flex: 1 1 27%;\\n -webkit-box-flex: 1;\\n flex: 1 1 27%;\\n width: 27%; }\\n .valine .vwrap .auth-section .input-wrapper input {\\n color: #4b5b62;\\n background: #fafafa;\\n border: none;\\n border-radius: 0;\\n padding: .6em;\\n margin: 0;\\n line-height: 2;\\n font-size: 1em !important; }\\n .valine .vwrap .auth-section .input-wrapper input:focus {\\n border-color: #c4c8cb;\\n outline: 0; }\\n .valine .vwrap .auth-section input {\\n width: 100%; }\\n .valine .vwrap .auth-section .post-action {\\n -ms-flex: 1 1 19%;\\n -webkit-box-flex: 1;\\n flex: 1 1 19%;\\n width: 19%;\\n margin: 0;\\n padding: 2px 0 0; }\\n .valine .vwrap .auth-section .post-action button {\\n color: #fff;\\n width: 100%;\\n line-height: 2;\\n font-weight: bolder;\\n border-radius: 30px;\\n border: 1px solid #e9eff3;\\n background-color: #111;\\n padding: .4em .5em;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n font-size: 1em !important; }\\n .valine .vwrap .auth-section .post-action button:hover {\\n background-color: #444; }\\n @media screen and (max-width: 720px) {\\n .valine .vwrap .auth-section {\\n display: block; }\\n .valine .vwrap .auth-section .input-wrapper, .valine .vwrap .auth-section .post-action {\\n -ms-flex: 1 1 100%;\\n -webkit-box-flex: 1;\\n flex: 1 1 100%;\\n padding-right: 0;\\n width: 100%; } }\\n .valine .vwrap .vmark {\\n position: absolute;\\n background: rgba(0, 0, 0, 0.65);\\n width: 100%;\\n height: 100%;\\n left: 0;\\n top: 0; }\\n .valine .vwrap .vmark .valert {\\n padding: 3em 0 0 0; }\\n .valine .vwrap .vmark .valert .vtext {\\n color: #fff;\\n padding: 15px; }\\n .valine .vwrap .vmark .valert .vcode {\\n width: 75px;\\n border-radius: 5px;\\n background: #dedede; }\\n .valine .vwrap .vmark .valert .vcode:focus {\\n border-color: #3090e4;\\n background-color: #fff; }\\n @media screen and (max-width: 720px) {\\n .valine .vwrap .vmark .valert {\\n padding: 8em 0; }\\n .valine .vwrap .vmark .valert .vtext {\\n color: #fff;\\n padding: 10px; } }\\n .valine .info {\\n padding: 5px;\\n margin: .5em 0; }\\n .valine .info .col {\\n display: inline-block;\\n vertical-align: middle; }\\n .valine .info svg {\\n margin-right: 2px;\\n overflow: hidden;\\n fill: currentColor; }\\n .valine .power {\\n color: #999;\\n font-size: 0.625em !important;\\n position: relative; }\\n .valine a {\\n text-decoration: none;\\n color: #3eb0ef; }\\n .valine ul,\\n .valine li {\\n list-style: none; }\\n .valine .txt-center {\\n text-align: center; }\\n .valine .float-right {\\n float: right !important; }\\n .valine .pd5 {\\n padding: 5px; }\\n .valine .pd10 {\\n padding: 10px; }\\n .valine .vbtn {\\n display: inline-block;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none;\\n border: 1px solid #e9eff3;\\n background-color: #333;\\n border-radius: .1em;\\n color: #fff;\\n padding: .5em 1.5em;\\n cursor: pointer;\\n white-space: nowrap;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n outline: none;\\n min-width: 60px;\\n max-width: 100%;\\n margin: 0 1em; }\\n .valine .vbtn:active,\\n .valine .vbtn:hover {\\n border-color: #666; }\\n .valine .vpage {\\n margin: 1.5em 0; }\\n .valine .vpage .more {\\n width: 100%;\\n height: 2.5em;\\n line-height: 2.5em;\\n text-align: center;\\n cursor: pointer;\\n color: #666;\\n background: #fafafa;\\n border-radius: 1.25em; }\\n .valine .vlist {\\n width: 100%; }\\n .valine .vlist .vcard {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n -ms-flex-direction: row;\\n flex-direction: row;\\n padding: 2em 1em;\\n border: 1px solid rgba(150, 150, 150, 0.18);\\n margin: 2em 0 0;\\n list-style: none;\\n border-radius: 5px;\\n word-break: break-all; }\\n .valine .vlist .vcard:hover {\\n border: 1px solid rgba(150, 150, 150, 0.25); }\\n .valine .vlist .vcard:hover .vat {\\n background: #111 !important; }\\n .valine .vlist .vcard .vfooter {\\n margin: -2em 0 0; }\\n .valine .vlist .vcard .vfooter .vat {\\n background: transparent;\\n color: #ffffff;\\n padding: .2em 1em;\\n line-height: 1.6;\\n cursor: pointer;\\n word-break: keep-all;\\n text-transform: uppercase; }\\n .valine .vlist .vcard .vavatar {\\n -webkit-box-flex: 0;\\n flex: 0 0 auto;\\n -ms-flex: 0 0 auto;\\n margin-right: 1em;\\n margin-top: 0.1em;\\n display: inline-block;\\n height: 3em;\\n width: 3em;\\n position: relative;\\n border-radius: 50%; }\\n .valine .vlist .vcard .vavatar:hover {\\n transform: rotate(1turn);\\n -webkit-transform: rotate(1turn); }\\n .valine .vlist .vcard .text-wrapper {\\n overflow: hidden;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n width: 100%; }\\n .valine .vlist .vcard .text-wrapper .vhead {\\n line-height: 1;\\n margin-bottom: 1em; }\\n .valine .vlist .vcard .text-wrapper .vhead a {\\n font-weight: bolder;\\n font-size: 1em;\\n color: rgba(0, 0, 0, 0.7); }\\n .valine .vlist .vcard .text-wrapper .vhead .spacer {\\n color: #ccc;\\n margin-left: 0.3em;\\n margin-right: 0.3em; }\\n .valine .vlist .vcard .text-wrapper .vhead .vtime {\\n color: #a9a4a4;\\n display: inline-block;\\n font-weight: normal; }\\n .valine .vlist .vcard .text-wrapper .vcomment {\\n position: relative; }\\n .valine .vlist .vcard .text-wrapper .vcomment p {\\n word-wrap: break-word;\\n white-space: pre-wrap;\\n word-break: break-all;\\n text-align: justify;\\n line-height: 1.8; }\\n .valine .vlist .vcard .text-wrapper .vcomment pre {\\n overflow: auto;\\n padding: 6px 10px;\\n word-wrap: break-word;\\n color: #555;\\n background: #f5f2f2;\\n border-radius: 3px;\\n font-size: .875rem;\\n margin: 5px 0; }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand {\\n cursor: pointer;\\n max-height: 11.25rem;\\n overflow: hidden; }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand:before {\\n display: block;\\n content: \\\"\\\";\\n position: absolute;\\n width: 100%;\\n left: 0;\\n top: 0;\\n bottom: 3.15rem;\\n pointer-events: none;\\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.8)));\\n background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8)); }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand:after {\\n display: block;\\n content: \\\"\\\\5C55\\\\5F00 \\\";\\n text-align: center;\\n color: #828586;\\n position: absolute;\\n width: 100%;\\n height: 3.15rem;\\n line-height: 3.15rem;\\n left: 0;\\n bottom: 0;\\n pointer-events: none;\\n background: rgba(255, 255, 255, 0.9); }\\n .valine .vlist .vempty {\\n padding: 20px;\\n text-align: center;\\n color: #999; }\\n .valine .spinner {\\n margin: 10px auto;\\n width: 50px;\\n height: 30px;\\n text-align: center;\\n font-size: 10px; }\\n .valine .spinner > div {\\n background-color: #9c9c9c;\\n height: 100%;\\n width: 6px;\\n margin-right: 3px;\\n display: inline-block;\\n -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;\\n animation: sk-stretchdelay 1.2s infinite ease-in-out; }\\n .valine .spinner .r2 {\\n -webkit-animation-delay: -1.1s;\\n animation-delay: -1.1s; }\\n .valine .spinner .r3 {\\n -webkit-animation-delay: -1.0s;\\n animation-delay: -1.0s; }\\n .valine .spinner .r4 {\\n -webkit-animation-delay: -0.9s;\\n animation-delay: -0.9s; }\\n .valine .spinner .r5 {\\n -webkit-animation-delay: -0.8s;\\n animation-delay: -0.8s; }\\n\\n@-webkit-keyframes sk-stretchdelay {\\n 0%,\\n 40%,\\n 100% {\\n -webkit-transform: scaleY(0.4); }\\n 20% {\\n -webkit-transform: scaleY(1); } }\\n\\n@keyframes sk-stretchdelay {\\n 0%,\\n 40%,\\n 100% {\\n transform: scaleY(0.4);\\n -webkit-transform: scaleY(0.4); }\\n 20% {\\n transform: scaleY(1);\\n -webkit-transform: scaleY(1); } }\\n\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = __webpack_require__(7);\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    已有 0 条评论
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    `;\n _root.el.innerHTML = eleHTML;\n // Empty Data\n let vempty = _root.el.querySelector('.vempty');\n _root.nodata = {\n show(txt) {\n vempty.innerHTML = txt || `还没有评论哦,快来抢沙发吧!`;\n vempty.setAttribute('style', 'display:block;');\n },\n hide() {\n vempty.setAttribute('style', 'display:none;');\n }\n }\n _root.nodata.show();\n\n // load smiles image\n let _smile_wrapper = _root.el.querySelector('.vsmile-icons'); \n let smile_names = option.emoticon_list || [\"mrgreen\", \"neutral\", \"twisted\", \"arrow\", \"eek\", \"smile\", \"confused\", \"cool\", \"evil\", \"biggrin\", \"idea\", \"redface\", \"razz\", \"rolleyes\", \"wink\", \"cry\", \"surprised\", \"lol\", \"mad\", \"sad\", \"exclaim\", \"question\"];\n for(let i in smile_names) {\n let img = document.createElement('img');\n img.setAttribute('src', `${option.emoticon_url}/${smile_names[i]}`);\n _smile_wrapper.appendChild(img) ;\n }\n av.init({\n appId: option.app_id || option.appId,\n appKey: option.app_key || option.appKey\n });\n _root.v = av;\n\n } catch (ex) {\n let issue = 'https://github.com/panjunwen/Valine/issues';\n if (_root.el) _root.nodata.show(`
    ${ex}
    Valine:${_root.version}
    反馈:${issue}
    `);\n else console && console.log(`%c${ex}\\n%cValine%c${_root.version} ${issue}`, 'color:red;', 'background:#000;padding:5px;line-height:30px;color:#fff;', 'background:#456;line-height:30px;padding:5px;color:#fff;');\n return;\n }\n\n // loading\n let _spinner = `
    `;\n let vloading = _root.el.querySelector('.vloading');\n vloading.innerHTML = _spinner;\n // loading control\n _root.loading = {\n show() {\n vloading.setAttribute('style', 'display:block;');\n _root.nodata.hide();\n },\n hide() {\n vloading.setAttribute('style', 'display:none;');\n _root.el.querySelectorAll('.vcard').length === 0 && _root.nodata.show();\n }\n };\n\n let vsubmitting = _root.el.querySelector('.vsubmitting');\n vsubmitting.innerHTML = _spinner;\n _root.submitting = {\n show() {\n vsubmitting.setAttribute('style', 'display:block;');\n },\n hide() {\n vsubmitting.setAttribute('style', 'display:none;');\n _root.nodata.hide();\n }\n };\n\n let _mark = _root.el.querySelector('.vmark');\n // alert\n _root.alert = {\n /**\n * {\n * type:0/1,\n * text:'',\n * ctxt:'',\n * otxt:'',\n * cb:fn\n * }\n *\n * @param {Object} o\n */\n show(o) {\n _mark.innerHTML = `
    ${o.text}
    `;\n let _vbtns = _mark.querySelector('.vbtns');\n let _cBtn = ``;\n let _oBtn = ``;\n _vbtns.innerHTML = `${_cBtn}${o.type && _oBtn}`;\n _mark.querySelector('.vcancel').addEventListener('click', function (e) {\n _root.alert.hide();\n });\n _mark.setAttribute('style', 'display:block;');\n if (o && o.type) {\n let _ok = _mark.querySelector('.vsure');\n Event.on('click', _ok, (e) => {\n _root.alert.hide();\n o.cb && o.cb();\n });\n }\n },\n hide() {\n _mark.setAttribute('style', 'display:none;');\n }\n }\n\n _root.loading.show();\n var query = new _root.v.Query('Comment');\n query.equalTo('url', defaultComment['url']);\n query.count().then(function (count) {\n _root.el.querySelector('.count').innerHTML = `${count}`;\n _root.bind(option);\n }, function (error) {\n console.log(error);\n });\n }\n\n /**\n * Bind Event\n */\n bind(option) {\n let _root = this;\n // Smile pictures\n let vsmiles = _root.el.querySelector('.vsmile-icons');\n Event.on('click', vsmiles, (e) => {\n var textField = _root.el.querySelector('.veditor');\n let imgSrc = e.target.src;\n if ( typeof imgSrc == 'undefined' ) return;\n // var tag = \" ![](/\" + imgSrc.replace(/^.*\\/(.*\\.gif)$/, '$1') + \") \";\n var tag = \"!(:\" + decodeURI(imgSrc).replace(/^.*\\/(.*)$/, '$1') + \":)\";\n if (document.selection) {\n textField.focus();\n sel = document.selection.createRange();\n sel.text = tag;\n textField.focus();\n } else if (textField.selectionStart || textField.selectionStart == '0') {\n var startPos = textField.selectionStart;\n var endPos = textField.selectionEnd;\n var cursorPos = endPos;\n textField.value = textField.value.substring(0, startPos) + tag + textField.value.substring(endPos, textField.value.length);\n cursorPos += tag.length;\n textField.focus();\n textField.selectionStart = cursorPos;\n textField.selectionEnd = cursorPos\n } else {\n textField.value += tag;\n textField.focus()\n }\n defaultComment[\"comment\"] = textField.value;\n let submitBtn = _root.el.querySelector('.vsubmit');\n if (submitBtn.getAttribute('disabled')) submitBtn.removeAttribute('disabled');\n })\n let comment_trigger = _root.el.querySelector('.comment_trigger');\n Event.on('click', comment_trigger, (e) => {\n comment_trigger.setAttribute('style', 'display:none');\n _root.el.querySelector('.auth-section').removeAttribute('style');\n _root.el.querySelector('.veditor').focus();\n })\n let smile_btn = _root.el.querySelector('.vsmile-btn');\n let smile_icons = _root.el.querySelector('.vsmile-icons');\n Event.on('click', smile_btn, (e)=>{\n if (smile_icons.getAttribute('triggered')) {\n smile_icons.setAttribute('style', 'display:none;');\n smile_icons.removeAttribute('triggered');\n }\n else {\n smile_icons.removeAttribute('style');\n smile_icons.setAttribute('triggered', 1);\n }\n });\n\n // Query && show comment list\n\n let expandEvt = (el) => {\n if (el.offsetHeight > 180) {\n el.classList.add('expand');\n Event.on('click', el, (e) => {\n el.setAttribute('class', 'vcomment');\n })\n }\n };\n\n let commonQuery = () => {\n let query = new _root.v.Query('Comment');\n query.select(['nick', 'comment', 'link', 'rid', 'emailHash']);\n query.notEqualTo('isSpam', true);\n query.equalTo('url', defaultComment['url']);\n query.addDescending('createdAt');\n return query;\n };\n\n var num = 1;\n let query = (n = 1) => {\n _root.loading.show();\n var size = 10;\n var count = Number(_root.el.querySelector('.count').innerText);\n let cq = commonQuery();\n cq.limit(size);\n cq.skip((n - 1) * size);\n cq.find().then(rets => {\n let len = rets.length;\n if (len) {\n // _root.el.querySelector('.vlist').innerHTML = '';\n for (let i = 0; i < len; i++) {\n insertComment(rets[i], false)\n }\n var _vpage = _root.el.querySelector('.vpage');\n _vpage.innerHTML = size * n < count ? `
    加载更多评论(剩余${count - size * n}/${count}条)
    ` : '';\n var _vmore = _vpage.querySelector('#vmore');\n if (_vmore) {\n Event.on('click', _vmore, (e) => {\n _vpage.innerHTML = '';\n query(++num)\n })\n }\n }\n _root.loading.hide();\n }).catch(ex => {\n console.log(ex);\n _root.loading.hide();\n })\n }\n query();\n\n let insertComment = (ret, top=true) => {\n let _vcard = document.createElement('li');\n _vcard.setAttribute('class', 'vcard');\n _vcard.setAttribute('id', ret.id);\n let emailHash = ret.get('emailHash') == EMPTY_EMAIL_HASH ? DEFAULT_EMAIL_HASH : ret.get('emailHash')\n let gravatar_url = GRAVATAR_BASE_URL + emailHash + '?size=80';\n // language=HTML\n _vcard.innerHTML = `\n
    \n
    \n ${ret.get(\"nick\")}\n \n ${timeAgo(ret.get(\"createdAt\"))}\n
    \n
    ${ret.get('comment')}
    \n \n
    \n
    \n 回复`;\n let _vlist = _root.el.querySelector('.vlist');\n let _vlis = _vlist.querySelectorAll('li');\n let _vat = _vcard.querySelector('.vat');\n let _as = _vcard.querySelectorAll('a');\n for (let i = 0, len = _as.length; i < len; i++) {\n let item = _as[i];\n if (item && item.getAttribute('class') != 'at') {\n item.setAttribute('target', '_blank');\n item.setAttribute('rel', 'nofollow');\n }\n }\n if (!top) _vlist.appendChild(_vcard);\n else _vlist.insertBefore(_vcard, _vlis[0]);\n let _vcontent = _vcard.querySelector('.vcomment');\n expandEvt(_vcontent);\n bindAtEvt(_vat);\n }\n\n let mapping = {\n veditor: \"comment\",\n vnick: \"nick\",\n vlink: \"link\",\n vmail: 'mail'\n };\n let inputs = {};\n for (let i in mapping) {\n if (mapping.hasOwnProperty(i)) {\n let _v = mapping[i];\n let _el = _root.el.querySelector(`.${i}`);\n inputs[_v] = _el;\n Event.on('input', _el, (e) => {\n defaultComment[_v] = HtmlUtil.encode(_el.value.replace(/(^\\s*)|(\\s*$)/g, \"\"));\n });\n }\n }\n\n // cache\n let getCache = () => {\n let s = store && store.getItem('ValineCache');\n if (!!s) {\n s = JSON.parse(s);\n let m = ['nick', 'link', 'mail'];\n for (let i in m) {\n let k = m[i];\n _root.el.querySelector(`.v${k}`).value = s[k];\n defaultComment[k] = s[k];\n }\n if (s['mail'] != '') {\n let el = _root.el.querySelector('.visitor_avatar');\n el.setAttribute('src', GRAVATAR_BASE_URL + crypto(s['mail'].toLowerCase().trim()) + '?size=80');\n }\n }\n }\n getCache();\n\n // reset form\n _root.reset = () => {\n for (let i in mapping) {\n if (mapping.hasOwnProperty(i)) {\n let _v = mapping[i];\n let _el = _root.el.querySelector(`.${i}`);\n _el.value = \"\";\n defaultComment[_v] = \"\";\n }\n }\n defaultComment['rid'] = '';\n defaultComment['nick'] = '小可爱';\n getCache();\n }\n\n // submit\n let submitBtn = _root.el.querySelector('.vsubmit');\n let submitEvt = (e) => {\n if (submitBtn.getAttribute('disabled')) {\n _root.alert.show({\n type: 0,\n text: '再等等,评论正在提交中ヾ(๑╹◡╹)ノ\"',\n ctxt: '好的'\n })\n return;\n }\n if (defaultComment.comment == '') {\n inputs['comment'].focus();\n return;\n }\n if (defaultComment.nick == '') {\n defaultComment['nick'] = '小调皮';\n }\n // replace smiles\n defaultComment.comment = defaultComment.comment.replace(/!\\(:(.*?\\.\\w+):\\)/g, `![](${option.emoticon_url}/$1)`);\n defaultComment.comment = marked(defaultComment.comment);\n let idx = defaultComment.comment.indexOf(defaultComment.at);\n if (idx > -1 && defaultComment.at != '') {\n let at = `${defaultComment.at}`;\n defaultComment.comment = defaultComment.comment.replace(defaultComment.at, at);\n }\n // veirfy\n let mailRet = check.mail(defaultComment.mail);\n let linkRet = check.link(defaultComment.link);\n defaultComment['mail'] = mailRet.k ? mailRet.v : '';\n defaultComment['link'] = linkRet.k ? linkRet.v : '';\n if (!mailRet.k && !linkRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的网址和邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?',\n cb() {\n commitEvt()\n }\n })\n } else if (!mailRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的邮箱格式不正确, 将导致无法正确显示头像和接收回复通知邮件。是否继续提交?',\n cb() {\n commitEvt();\n }\n })\n } else if (!linkRet.k) {\n _root.alert.show({\n type: 1,\n text: '您的网址格式不正确, 是否继续提交?',\n cb() {\n commitEvt();\n }\n })\n } else {\n commitEvt();\n }\n }\n\n // setting access\n let getAcl = () => {\n let acl = new _root.v.ACL();\n acl.setPublicReadAccess(true);\n acl.setPublicWriteAccess(false);\n return acl;\n }\n\n let commitEvt = () => {\n submitBtn.setAttribute('disabled', true);\n _root.submitting.show();\n // 声明类型\n let Ct = _root.v.Object.extend('Comment');\n // 新建对象\n let comment = new Ct();\n for (let i in defaultComment) {\n if (defaultComment.hasOwnProperty(i)) {\n if (i === 'at')\n continue;\n let _v = defaultComment[i];\n comment.set(i, _v);\n }\n }\n comment.set('emailHash', crypto(defaultComment.mail.toLowerCase().trim()));\n comment.setACL(getAcl());\n comment.save().then((commentItem) => {\n store && store.setItem('ValineCache', JSON.stringify({\n nick: defaultComment['nick'],\n link: defaultComment['link'],\n mail: defaultComment['mail']\n }));\n let _count = _root.el.querySelector('.count');\n _count.innerText = Number(_count.innerText) + 1;\n insertComment(commentItem, true);\n submitBtn.removeAttribute('disabled');\n _root.submitting.hide();\n _root.nodata.hide();\n _root.reset();\n }).catch(ex => {\n _root.submitting.hide();\n })\n }\n\n // at event\n let bindAtEvt = (el) => {\n Event.on('click', el, (e) => {\n let at = el.getAttribute('at');\n let rid = el.getAttribute('rid');\n defaultComment['rid'] = rid;\n defaultComment['at'] = at;\n inputs['comment'].value = `${at} ,` + inputs['comment'].value;\n inputs['comment'].focus();\n // remove comment trigger\n _root.el.querySelector('.comment_trigger').setAttribute('style', 'display:none');\n _root.el.querySelector('.auth-section').removeAttribute('style');\n _root.el.querySelector('.veditor').focus();\n })\n }\n\n Event.off('click', submitBtn, submitEvt);\n Event.on('click', submitBtn, submitEvt);\n }\n}\n\nconst Event = {\n on(type, el, handler, capture) {\n if (el.addEventListener) el.addEventListener(type, handler, capture || false);\n else if (el.attachEvent) el.attachEvent(`on${type}`, handler);\n else el[`on${type}`] = handler;\n },\n off(type, el, handler, capture) {\n if (el.removeEventListener) el.removeEventListener(type, handler, capture || false);\n else if (el.detachEvent) el.detachEvent(`on${type}`, handler);\n else el[`on${type}`] = null;\n }\n}\n\nconst check = {\n mail(m) {\n return {\n k: /\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}/.test(m),\n v: m\n };\n },\n link(l) {\n if (l.length > 0) {\n l = /^(http|https)/.test(l) ? l : `http://${l}`;\n }\n return {\n k: l.length > 0 ? /(http|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?/.test(l) : true,\n v: l\n };\n }\n}\n\nconst HtmlUtil = {\n\n // /**\n // *\n // * 将str中的链接转换成a标签形式\n // * @param {String} str\n // * @returns\n // */\n // transUrl(str) {\n // let reg = /(http:\\/\\/|https:\\/\\/)((\\w|=|\\?|\\.|\\/|&|-)+)/g;\n // return str.replace(reg, '$1$2');\n // },\n /**\n * HTML转码\n * @param {String} str\n * @return {String} result\n */\n encode(str) {\n return !!str ? str.replace(/&/g, \"&\").replace(//g, \">\").replace(/ /g, \" \").replace(/\\'/g, \"'\").replace(/\\\"/g, \""\") : '';\n },\n /**\n * HTML解码\n * @param {String} str\n * @return {String} result\n */\n decode(str) {\n return !!str ? str.replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\").replace(/ /g, \" \").replace(/'/g, \"\\'\").replace(/"/g, \"\\\"\") : '';\n }\n};\n\nconst dateFormat = (date) => {\n var vDay = padWithZeros(date.getDate(), 2);\n var vMonth = padWithZeros(date.getMonth() + 1, 2);\n var vYear = padWithZeros(date.getFullYear(), 2);\n // var vHour = padWithZeros(date.getHours(), 2);\n // var vMinute = padWithZeros(date.getMinutes(), 2);\n // var vSecond = padWithZeros(date.getSeconds(), 2);\n return `${vYear}-${vMonth}-${vDay}`;\n // return `${vYear}-${vMonth}-${vDay} ${vHour}:${vMinute}:${vSecond}`;\n}\n\nconst timeAgo = (date) => {\n try {\n var oldTime = date.getTime();\n var currTime = new Date().getTime();\n var diffValue = currTime - oldTime;\n\n var days = Math.floor(diffValue / (24 * 3600 * 1000));\n if (days === 0) {\n //计算相差小时数\n var leave1 = diffValue % (24 * 3600 * 1000); //计算天数后剩余的毫秒数\n var hours = Math.floor(leave1 / (3600 * 1000));\n if (hours === 0) {\n //计算相差分钟数\n var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数\n var minutes = Math.floor(leave2 / (60 * 1000));\n if (minutes === 0) {\n //计算相差秒数\n var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数\n var seconds = Math.round(leave3 / 1000);\n return seconds + ' 秒前';\n }\n return minutes + ' 分钟前';\n }\n return hours + ' 小时前';\n }\n if (days < 0) return '刚刚';\n else if (days < 30) return days + ' 天前';\n else if (days < 365) return Math.floor(days / 30) + ' 月前';\n else return Math.floor(days / 365) + ' 年前';\n return dateFormat(date);\n } catch (error) {\n console.log(error)\n }\n}\n\nconst padWithZeros = (vNumber, width) => {\n var numAsString = vNumber.toString();\n while (numAsString.length < width) {\n numAsString = '0' + numAsString;\n }\n return numAsString;\n}\n\nconst loadJS = function (url, success) {\n var domScript = document.createElement('script');\n domScript.src = url;\n success = success || function () {\n };\n domScript.onload = domScript.onreadystatechange = function () {\n if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {\n success();\n this.onload = this.onreadystatechange = null;\n // this.parentNode.removeChild(this);\n }\n };\n document.getElementsByTagName('head')[0].appendChild(domScript);\n};\n\nconst getIp = function(){\n $.getJSON(\"https://api.ipify.org/?format=json\",\n function(json) {\n defaultComment['ip'] = json.ip;\n }\n );\n};\n\nmodule.exports = Valine;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Valine.js","exports = module.exports = require(\"../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"@charset \\\"UTF-8\\\";\\n.valine {\\n /************ Loading ************/ }\\n .valine * {\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n font-size: 100%;\\n font-weight: normal;\\n line-height: 1.42857143;\\n color: #3c484e;\\n -webkit-transition: all .3s ease;\\n transition: all .3s ease;\\n margin: 0;\\n padding: 0; }\\n .valine .vwrap {\\n overflow: hidden;\\n position: relative;\\n border: 1px solid #ededed; }\\n .valine .vwrap .comment-smiles {\\n margin: 0;\\n padding: 0 1em;\\n margin: .5em 0; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap {\\n width: 100%;\\n height: 1.7em; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg {\\n fill: #aaaaaa;\\n cursor: pointer; }\\n .valine .vwrap .comment-smiles .vsmile-btn-wrap svg:hover {\\n fill: #777777; }\\n .valine .vwrap .comment-smiles .vsmile-icons {\\n padding: .2em 0;\\n margin: .3em 0;\\n border-top: 1px solid #ededed;\\n border-radius: 0;\\n max-height: 64px;\\n overflow: auto; }\\n .valine .vwrap .comment-smiles .vsmile-icons img {\\n width: auto !important;\\n height: 28px !important;\\n margin-right: 4px;\\n cursor: pointer; }\\n .valine .vwrap .textarea-wrapper {\\n color: #4b5b62;\\n width: 100%;\\n height: 100%;\\n background: #fff;\\n position: relative;\\n border-radius: 0; }\\n .valine .vwrap .textarea-wrapper .comment_trigger {\\n position: absolute;\\n z-index: 10;\\n width: 100%;\\n height: 100%;\\n background-color: #fff;\\n padding: 0 1em; }\\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar {\\n position: absolute;\\n width: 3em;\\n height: 3em;\\n position: absolute;\\n top: 50%;\\n -webkit-transform: translateY(-50%);\\n transform: translateY(-50%); }\\n .valine .vwrap .textarea-wrapper .comment_trigger .avatar img {\\n border-radius: 100%;\\n width: 3em;\\n height: 3em; }\\n .valine .vwrap .textarea-wrapper .comment_trigger .trigger_title {\\n position: absolute;\\n top: 50%;\\n -webkit-transform: translateY(-50%);\\n transform: translateY(-50%);\\n color: #aaa;\\n font-size: 1.4em;\\n margin-left: 3.5em; }\\n .valine .vwrap .textarea-wrapper textarea {\\n padding: 1em 1em 0;\\n color: #4b5b62;\\n width: 100%;\\n background: #fff;\\n border: none;\\n resize: none;\\n min-height: 3em; }\\n .valine .vwrap .textarea-wrapper textarea:focus {\\n border-color: #c4c8cb;\\n outline: 0; }\\n .valine .vwrap .trigger-section {\\n display: none; }\\n .valine .vwrap .auth-section {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n background: #fbfbfb;\\n padding: .3em .6em; }\\n .valine .vwrap .auth-section .input-wrapper {\\n -ms-flex: 1 1 27%;\\n -webkit-box-flex: 1;\\n flex: 1 1 27%;\\n width: 27%; }\\n .valine .vwrap .auth-section .input-wrapper input {\\n color: #4b5b62;\\n background: #fafafa;\\n border: none;\\n border-radius: 0;\\n padding: .6em;\\n margin: 0;\\n line-height: 2;\\n font-size: 1em !important; }\\n .valine .vwrap .auth-section .input-wrapper input:focus {\\n border-color: #c4c8cb;\\n outline: 0; }\\n .valine .vwrap .auth-section input {\\n width: 100%; }\\n .valine .vwrap .auth-section .post-action {\\n -ms-flex: 1 1 19%;\\n -webkit-box-flex: 1;\\n flex: 1 1 19%;\\n width: 19%;\\n margin: 0;\\n padding: 2px 0 0; }\\n .valine .vwrap .auth-section .post-action button {\\n color: #fff;\\n width: 100%;\\n line-height: 2;\\n font-weight: bolder;\\n border-radius: 30px;\\n border: 1px solid #e9eff3;\\n background-color: #111;\\n padding: .4em .5em;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n font-size: 1em !important; }\\n .valine .vwrap .auth-section .post-action button:hover {\\n background-color: #444; }\\n @media screen and (max-width: 720px) {\\n .valine .vwrap .auth-section {\\n display: block; }\\n .valine .vwrap .auth-section .input-wrapper, .valine .vwrap .auth-section .post-action {\\n -ms-flex: 1 1 100%;\\n -webkit-box-flex: 1;\\n flex: 1 1 100%;\\n padding-right: 0;\\n width: 100%; } }\\n .valine .vwrap .vmark {\\n position: absolute;\\n background: rgba(0, 0, 0, 0.65);\\n width: 100%;\\n height: 100%;\\n left: 0;\\n top: 0; }\\n .valine .vwrap .vmark .valert {\\n padding: 3em 0 0 0; }\\n .valine .vwrap .vmark .valert .vtext {\\n color: #fff;\\n padding: 15px; }\\n .valine .vwrap .vmark .valert .vcode {\\n width: 75px;\\n border-radius: 5px;\\n background: #dedede; }\\n .valine .vwrap .vmark .valert .vcode:focus {\\n border-color: #3090e4;\\n background-color: #fff; }\\n @media screen and (max-width: 720px) {\\n .valine .vwrap .vmark .valert {\\n padding: 8em 0; }\\n .valine .vwrap .vmark .valert .vtext {\\n color: #fff;\\n padding: 10px; } }\\n .valine .info {\\n padding: 5px;\\n margin: .5em 0; }\\n .valine .info .col {\\n display: inline-block;\\n vertical-align: middle; }\\n .valine .info svg {\\n margin-right: 2px;\\n overflow: hidden;\\n fill: currentColor; }\\n .valine .power {\\n color: #999;\\n font-size: 0.625em !important;\\n position: relative; }\\n .valine a {\\n text-decoration: none;\\n color: #3eb0ef; }\\n .valine ul,\\n .valine li {\\n list-style: none; }\\n .valine .txt-center {\\n text-align: center; }\\n .valine .float-right {\\n float: right !important; }\\n .valine .pd5 {\\n padding: 5px; }\\n .valine .pd10 {\\n padding: 10px; }\\n .valine .vbtn {\\n display: inline-block;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none;\\n border: 1px solid #e9eff3;\\n background-color: #333;\\n border-radius: .1em;\\n color: #fff;\\n padding: .5em 1.5em;\\n cursor: pointer;\\n white-space: nowrap;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n outline: none;\\n min-width: 60px;\\n max-width: 100%;\\n margin: 0 1em; }\\n .valine .vbtn:active,\\n .valine .vbtn:hover {\\n border-color: #666; }\\n .valine .vpage {\\n margin: 1.5em 0; }\\n .valine .vpage .more {\\n width: 100%;\\n height: 2.5em;\\n line-height: 2.5em;\\n text-align: center;\\n cursor: pointer;\\n color: #666;\\n background: #fafafa;\\n border-radius: 1.25em; }\\n .valine .vlist {\\n width: 100%; }\\n .valine .vlist .vcard {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n -ms-flex-direction: row;\\n flex-direction: row;\\n padding: 2em 1em;\\n border: 1px solid rgba(150, 150, 150, 0.18);\\n margin: 2em 0 0;\\n list-style: none;\\n border-radius: 5px;\\n word-break: break-all; }\\n .valine .vlist .vcard:hover {\\n border: 1px solid rgba(150, 150, 150, 0.25); }\\n .valine .vlist .vcard:hover .vat {\\n background: #111 !important; }\\n .valine .vlist .vcard .vfooter {\\n margin: -2em 0 0; }\\n .valine .vlist .vcard .vfooter .vat {\\n background: transparent;\\n color: #ffffff;\\n padding: .2em 1em;\\n line-height: 1.6;\\n cursor: pointer;\\n word-break: keep-all;\\n text-transform: uppercase; }\\n .valine .vlist .vcard .vavatar {\\n -webkit-box-flex: 0;\\n flex: 0 0 auto;\\n -ms-flex: 0 0 auto;\\n margin-right: 1em;\\n margin-top: 0.1em;\\n display: inline-block;\\n height: 3em;\\n width: 3em;\\n position: relative;\\n border-radius: 50%; }\\n .valine .vlist .vcard .vavatar:hover {\\n transform: rotate(1turn);\\n -webkit-transform: rotate(1turn); }\\n .valine .vlist .vcard .text-wrapper {\\n overflow: hidden;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n width: 100%; }\\n .valine .vlist .vcard .text-wrapper .vhead {\\n line-height: 1;\\n margin-bottom: 1em; }\\n .valine .vlist .vcard .text-wrapper .vhead a {\\n font-weight: bolder;\\n font-size: 1em;\\n color: rgba(0, 0, 0, 0.7); }\\n .valine .vlist .vcard .text-wrapper .vhead .spacer {\\n color: #ccc;\\n margin-left: 0.3em;\\n margin-right: 0.3em; }\\n .valine .vlist .vcard .text-wrapper .vhead .vtime {\\n color: #a9a4a4;\\n display: inline-block;\\n font-weight: normal; }\\n .valine .vlist .vcard .text-wrapper .vcomment {\\n position: relative; }\\n .valine .vlist .vcard .text-wrapper .vcomment p {\\n word-wrap: break-word;\\n white-space: pre-wrap;\\n word-break: break-all;\\n text-align: justify;\\n line-height: 1.8; }\\n .valine .vlist .vcard .text-wrapper .vcomment pre {\\n overflow: auto;\\n padding: 6px 10px;\\n word-wrap: break-word;\\n color: #555;\\n background: #f5f2f2;\\n border-radius: 3px;\\n font-size: .875rem;\\n margin: 5px 0; }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand {\\n cursor: pointer;\\n max-height: 11.25rem;\\n overflow: hidden; }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand:before {\\n display: block;\\n content: \\\"\\\";\\n position: absolute;\\n width: 100%;\\n left: 0;\\n top: 0;\\n bottom: 3.15rem;\\n pointer-events: none;\\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.8)));\\n background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8)); }\\n .valine .vlist .vcard .text-wrapper .vcomment.expand:after {\\n display: block;\\n content: \\\"\\\\5C55\\\\5F00 \\\";\\n text-align: center;\\n color: #828586;\\n position: absolute;\\n width: 100%;\\n height: 3.15rem;\\n line-height: 3.15rem;\\n left: 0;\\n bottom: 0;\\n pointer-events: none;\\n background: rgba(255, 255, 255, 0.9); }\\n .valine .vlist .vempty {\\n padding: 20px;\\n text-align: center;\\n color: #999; }\\n .valine .spinner {\\n margin: 10px auto;\\n width: 50px;\\n height: 30px;\\n text-align: center;\\n font-size: 10px; }\\n .valine .spinner > div {\\n background-color: #9c9c9c;\\n height: 100%;\\n width: 6px;\\n margin-right: 3px;\\n display: inline-block;\\n -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;\\n animation: sk-stretchdelay 1.2s infinite ease-in-out; }\\n .valine .spinner .r2 {\\n -webkit-animation-delay: -1.1s;\\n animation-delay: -1.1s; }\\n .valine .spinner .r3 {\\n -webkit-animation-delay: -1.0s;\\n animation-delay: -1.0s; }\\n .valine .spinner .r4 {\\n -webkit-animation-delay: -0.9s;\\n animation-delay: -0.9s; }\\n .valine .spinner .r5 {\\n -webkit-animation-delay: -0.8s;\\n animation-delay: -0.8s; }\\n\\n@-webkit-keyframes sk-stretchdelay {\\n 0%,\\n 40%,\\n 100% {\\n -webkit-transform: scaleY(0.4); }\\n 20% {\\n -webkit-transform: scaleY(1); } }\\n\\n@keyframes sk-stretchdelay {\\n 0%,\\n 40%,\\n 100% {\\n transform: scaleY(0.4);\\n -webkit-transform: scaleY(0.4); }\\n 20% {\\n transform: scaleY(1);\\n -webkit-transform: scaleY(1); } }\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader!./~/postcss-loader/lib!./~/sass-loader/lib/loader.js!./src/Valine.scss\n// module id = 4\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader/lib/css-base.js\n// module id = 5\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of