!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,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="",t(t.s=11)}([function(e,t,n){"use strict";function r(e){return"[object Array]"===E.call(e)}function o(e){return"[object ArrayBuffer]"===E.call(e)}function i(e){return"undefined"!=typeof FormData&&e instanceof FormData}function u(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function c(e){return"string"==typeof e}function a(e){return"number"==typeof e}function s(e){return void 0===e}function f(e){return null!==e&&"object"==typeof e}function l(e){return"[object Date]"===E.call(e)}function p(e){return"[object File]"===E.call(e)}function d(e){return"[object Blob]"===E.call(e)}function h(e){return"[object Function]"===E.call(e)}function m(e){return f(e)&&h(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function y(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function b(e,t){if(null!==e&&void 0!==e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n1)for(var n=1;n=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(e){c.headers[e]={}}),o.forEach(["post","put","patch"],function(e){c.headers[e]=o.merge(u)}),e.exports=c}).call(t,n(2))},function(e,t,n){(function(e,n,r,o){!function(e,n){n(t)}(0,function(t){"use strict";function i(e,t){t|=0;for(var n=Math.max(e.length-t,0),r=Array(n),o=0;o-1&&e%1==0&&e<=Ot}function w(e){return null!=e&&b(e.length)&&!g(e)}function x(){}function j(e){return function(){if(null!==e){var t=e;e=null,t.apply(this,arguments)}}}function S(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&eo?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r=r?e:ee(e,t,n)}function ne(e,t){for(var n=e.length;n--&&G(t,e[n],0)>-1;);return n}function re(e,t){for(var n=-1,r=e.length;++n-1;);return n}function oe(e){return e.split("")}function ie(e){return xn.test(e)}function ue(e){return e.match(_n)||[]}function ce(e){return ie(e)?ue(e):oe(e)}function ae(e){return null==e?"":Z(e)}function se(e,t,n){if((e=ae(e))&&(n||void 0===t))return e.replace(Cn,"");if(!e||!(t=Z(t)))return e;var r=ce(e),o=ce(t);return te(r,re(r,o),ne(r,o)+1).join("")}function fe(e){return e=e.toString().replace(In,""),e=e.match(Rn)[2].replace(" ",""),e=e?e.split(Fn):[],e=e.map(function(e){return se(e.replace(Un,""))})}function le(e,t){var n={};X(e,function(e,t){function r(t,n){var r=K(o,function(e){return t[e]});r.push(n),d(e).apply(null,r)}var o,i=p(e),u=!i&&1===e.length||i&&0===e.length;if(Bt(e))o=e.slice(0,-1),e=e[e.length-1],n[t]=o.concat(o.length>0?r:e);else if(u)n[t]=e;else{if(o=fe(e),0===e.length&&!i&&0===o.length)throw new Error("autoInject task functions require explicit parameters.");i||o.pop(),n[t]=o.concat(r)}}),vn(n,t)}function pe(){this.head=this.tail=null,this.length=0}function de(e,t){e.length=1,e.head=e.tail=t}function he(e,t,n){function r(e,t,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");if(f.started=!0,Bt(e)||(e=[e]),0===e.length&&f.idle())return ft(function(){f.drain()});for(var r=0,o=e.length;r0&&c.splice(i,1),o.callback.apply(o,arguments),null!=t&&f.error(t,o.data)}u<=f.concurrency-f.buffer&&f.unsaturated(),f.idle()&&f.drain(),f.process()}}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var i=d(e),u=0,c=[],a=!1,s=!1,f={_tasks:new pe,concurrency:t,payload:n,saturated:x,unsaturated:x,buffer:t/4,empty:x,drain:x,error:x,started:!1,paused:!1,push:function(e,t){r(e,!1,t)},kill:function(){f.drain=x,f._tasks.empty()},unshift:function(e,t){r(e,!0,t)},remove:function(e){f._tasks.remove(e)},process:function(){if(!s){for(s=!0;!f.paused&&u2&&(o=i(arguments,1)),r[t]=o,n(e)})},function(e){n(e,r)})}function Pe(e,t){Ne(sn,e,t)}function De(e,t,n){Ne(B(t),e,n)}function He(e,t){if(t=j(t||x),!Bt(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var n=0,r=e.length;nr?1:0}var o=d(t);fn(e,function(e,t){o(e,function(n,r){if(n)return t(n);t(null,{value:e,criteria:r})})},function(e,t){if(e)return n(e);n(null,K(t.sort(r),Ce("value")))})}function Ke(e,t,n){var r=d(e);return ct(function(o,i){function u(){var t=e.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",n&&(r.info=n),a=!0,i(r)}var c,a=!1;o.push(function(){a||(i.apply(null,arguments),clearTimeout(c))}),c=setTimeout(u,t),r.apply(null,o)})}function Ye(e,t,n,r){for(var o=-1,i=gr(yr((t-e)/(n||1)),0),u=Array(i);i--;)u[r?i:++o]=e,e+=n;return u}function Ze(e,t,n,r){var o=d(n);pn(Ye(0,e,1),t,o,r)}function et(e,t,n,r){arguments.length<=3&&(r=n,n=t,t=Bt(e)?[]:{}),r=j(r||x);var o=d(n);sn(e,function(e,n,r){o(t,e,n,r)},function(e){r(e,t)})}function tt(e,t){var n,r=null;t=t||x,Wn(e,function(e,t){d(e)(function(e,o){n=arguments.length>2?i(arguments,1):o,r=e,t(!e)})},function(){t(r,n)})}function nt(e){return function(){return(e.unmemoized||e).apply(null,arguments)}}function rt(e,t,n){n=M(n||x);var r=d(t);if(!e())return n(null);var o=function(t){if(t)return n(t);if(e())return r(o);var u=i(arguments,1);n.apply(null,[null].concat(u))};r(o)}function ot(e,t,n){rt(function(){return!e.apply(this,arguments)},t,n)}var it,ut=function(e){var t=i(arguments,1);return function(){var n=i(arguments);return e.apply(null,t.concat(n))}},ct=function(e){return function(){var t=i(arguments),n=t.pop();e.call(this,t,n)}},at="function"==typeof e&&e,st="object"==typeof n&&"function"==typeof n.nextTick;it=at?e:st?n.nextTick:c;var ft=a(it),lt="function"==typeof Symbol,pt="object"==typeof r&&r&&r.Object===Object&&r,dt="object"==typeof self&&self&&self.Object===Object&&self,ht=pt||dt||Function("return this")(),mt=ht.Symbol,vt=Object.prototype,yt=vt.hasOwnProperty,gt=vt.toString,bt=mt?mt.toStringTag:void 0,wt=Object.prototype,xt=wt.toString,jt="[object Null]",St="[object Undefined]",Et=mt?mt.toStringTag:void 0,kt="[object AsyncFunction]",Tt="[object Function]",Lt="[object GeneratorFunction]",At="[object Proxy]",Ot=9007199254740991,_t={},Ct="function"==typeof Symbol&&Symbol.iterator,Rt=function(e){return Ct&&e[Ct]&&e[Ct]()},Ft="[object Arguments]",Ut=Object.prototype,It=Ut.hasOwnProperty,qt=Ut.propertyIsEnumerable,Mt=k(function(){return arguments}())?k:function(e){return E(e)&&It.call(e,"callee")&&!qt.call(e,"callee")},Bt=Array.isArray,Nt="object"==typeof t&&t&&!t.nodeType&&t,Pt=Nt&&"object"==typeof o&&o&&!o.nodeType&&o,Dt=Pt&&Pt.exports===Nt,Ht=Dt?ht.Buffer:void 0,Vt=Ht?Ht.isBuffer:void 0,zt=Vt||T,$t=9007199254740991,Xt=/^(?:0|[1-9]\d*)$/,Qt={};Qt["[object Float32Array]"]=Qt["[object Float64Array]"]=Qt["[object Int8Array]"]=Qt["[object Int16Array]"]=Qt["[object Int32Array]"]=Qt["[object Uint8Array]"]=Qt["[object Uint8ClampedArray]"]=Qt["[object Uint16Array]"]=Qt["[object Uint32Array]"]=!0,Qt["[object Arguments]"]=Qt["[object Array]"]=Qt["[object ArrayBuffer]"]=Qt["[object Boolean]"]=Qt["[object DataView]"]=Qt["[object Date]"]=Qt["[object Error]"]=Qt["[object Function]"]=Qt["[object Map]"]=Qt["[object Number]"]=Qt["[object Object]"]=Qt["[object RegExp]"]=Qt["[object Set]"]=Qt["[object String]"]=Qt["[object WeakMap]"]=!1;var Wt="object"==typeof t&&t&&!t.nodeType&&t,Jt=Wt&&"object"==typeof o&&o&&!o.nodeType&&o,Gt=Jt&&Jt.exports===Wt,Kt=Gt&&pt.process,Yt=function(){try{var e=Jt&&Jt.require&&Jt.require("util").types;return e||Kt&&Kt.binding&&Kt.binding("util")}catch(e){}}(),Zt=Yt&&Yt.isTypedArray,en=Zt?function(e){return function(t){return e(t)}}(Zt):A,tn=Object.prototype,nn=tn.hasOwnProperty,rn=Object.prototype,on=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),un=Object.prototype,cn=un.hasOwnProperty,an=P(N,1/0),sn=function(e,t,n){(w(e)?D:an)(e,d(t),n)},fn=H(V),ln=h(fn),pn=z(V),dn=P(pn,1),hn=h(dn),mn=function(e){return function(t,n,r){for(var o=-1,i=Object(t),u=r(t),c=u.length;c--;){var a=u[e?c:++o];if(!1===n(i[a],a,i))break}return t}}(),vn=function(e,t,n){function r(e,t){y.push(function(){a(e,t)})}function o(){if(0===y.length&&0===h)return n(null,p);for(;y.length&&h2&&(r=i(arguments,1)),t){var o={};X(p,function(e,t){o[t]=e}),o[e]=r,m=!0,v=Object.create(null),n(t,o)}else p[e]=r,c(e)});h++;var o=d(t[t.length-1]);t.length>1?o(p,r):o(r)}}function s(t){var n=[];return X(e,function(e,r){Bt(e)&&G(e,t,0)>=0&&n.push(r)}),n}"function"==typeof t&&(n=t,t=null),n=j(n||x);var f=R(e),l=f.length;if(!l)return n(null);t||(t=l);var p={},h=0,m=!1,v=Object.create(null),y=[],g=[],b={};X(e,function(t,n){if(!Bt(t))return r(n,[t]),void g.push(n);var o=t.slice(0,t.length-1),i=o.length;if(0===i)return r(n,t),void g.push(n);b[n]=i,$(o,function(c){if(!e[c])throw new Error("async.auto task `"+n+"` has a non-existent dependency `"+c+"` in "+o.join(", "));u(c,function(){0===--i&&r(n,t)})})}),function(){for(var e,t=0;g.length;)e=g.pop(),t++,$(s(e),function(e){0==--b[e]&&g.push(e)});if(t!==l)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),o()},yn="[object Symbol]",gn=1/0,bn=mt?mt.prototype:void 0,wn=bn?bn.toString:void 0,xn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),jn="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Sn="\\ud83c[\\udffb-\\udfff]",En="(?:\\ud83c[\\udde6-\\uddff]){2}",kn="[\\ud800-\\udbff][\\udc00-\\udfff]",Tn="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Ln="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",En,kn].join("|")+")[\\ufe0e\\ufe0f]?"+Tn+")*",An="[\\ufe0e\\ufe0f]?"+Tn+Ln,On="(?:"+["[^\\ud800-\\udfff]"+jn+"?",jn,En,kn,"[\\ud800-\\udfff]"].join("|")+")",_n=RegExp(Sn+"(?="+Sn+")|"+On+An,"g"),Cn=/^\s+|\s+$/g,Rn=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,Fn=/,/,Un=/(=.+)?(\s*)$/,In=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;pe.prototype.removeLink=function(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e},pe.prototype.empty=function(){for(;this.head;)this.shift();return this},pe.prototype.insertAfter=function(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1},pe.prototype.insertBefore=function(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1},pe.prototype.unshift=function(e){this.head?this.insertBefore(this.head,e):de(this,e)},pe.prototype.push=function(e){this.tail?this.insertAfter(this.tail,e):de(this,e)},pe.prototype.shift=function(){return this.head&&this.removeLink(this.head)},pe.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},pe.prototype.toArray=function(){for(var e=Array(this.length),t=this.head,n=0;n=o.priority;)o=o.next;for(var i=0,u=e.length;it)return!1;var n=t-e,r=Math.floor(n/60),o=Math.floor(r/60),i=Math.floor(o/24);return 1===i?"1 day ago":i>0?i+" days ago":1===o?"1 hour ago":o>0?o+" hours ago":1===r?"1 minute ago":r>0?r+" minutes ago":"a few seconds ago"}function u(e){function t(e,t){if(!e)throw new Error("No URL has been specified");if(s[e])return void t(null,s[e]);f.default.get(e).then(function(n){s[e]=n.data,t(null,n.data)}).catch(t)}function n(t){var n=t.sub,r=t.id;return n&&r?e.base+"/r/"+n+"/comments/"+r+".json":!(n||!r)&&e.base+r}function r(e,r){var o=e.hits.filter(function(e){return!!e.num_comments});a.default.map(o.slice(0,10),function(e,r){var o=e.id,i=e.subreddit;if("undefined"===o)throw new Error("No ID specified");t(n({sub:i,id:o}),r)},r)}function o(t){var n=t.comment,r=t.op,i=t.depth,u=i||0,c=e.commentFmt(n);if(c.depth=u,c.subreddit=r.subreddit,r.permalink&&(c.permalink=e.base+r.permalink,c.thread=e.base+r.permalink+n.id),n.children&&n.children.length>0){var a=u+1;c.hasReplies=!0,c.replies=n.children.reduce(function(e,t){return t.author&&e.push(o({comment:t,op:r,depth:a})),e},[]),c.loadMore=c.replies.length>4}return c}function i(t,n){n(null,t.map(function(t){var n=e.threadFmt(t),r=n.children.reduce(function(e,t){return t.author&&e.push(o({comment:t,op:n})),e},[]);return{op:n,comments:r}}))}function u(t,n){var r=function e(n,r,o){if(o>t.length-1)return{score:n,threads:t.length,comments:r,multiple:function(){return this.threads>1}};var i=t[o];return e(n+=i.op.points,r.concat(i.comments),o+1)}(0,[],0),o=r.comments.sort(function(e,t){return t.score-e.score}),i=e.limit||o.length;r.comments=o.slice(0,i),r.next=o.slice(i),r.hasMore=!!r.next.length,n(null,r)}if(!e)throw new Error("No spec object has been specified");if(!e.submitUrl)throw new Error("submitUrl isnt defined");if(!e.dataFmt)throw new Error("dataFmt method isnt defined");if(!e.commentFmt)throw new Error("commentFmt method isnt defined");if(!e.threadFmt)throw new Error("threadFmt method isnt defined");0===e.limit&&(e.limit=null);var c={},s={};return c.submitUrl=e.submitUrl,c.hasComments=function(n){a.default.waterfall([a.default.apply(t,e.query),e.dataFmt],function(e,t){if(e)throw new Error(e);var r=t.hits.filter(function(e){return!!e.num_comments});n(null,!!r.length)})},c.getComments=function(n){a.default.waterfall([a.default.apply(t,e.query),e.dataFmt,r,i,u],n)},c}Object.defineProperty(t,"__esModule",{value:!0}),t.decode=o,t.parseDate=i,t.embeddConstructor=u;var c=n(4),a=r(c),s=n(17),f=r(s)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r comment}}{{/comments}}",r,{comment:d});if(u.insertAdjacentHTML("beforeend",a),!r.hasMore){var s=document.querySelector(".embedd-container .more-btn");s?s.style.display="none":window.removeEventListener("scroll",n,!1)}t()}function u(e){e.target.parentNode.parentNode.parentNode.classList.toggle("closed")}function a(e){function t(e,n){e&&3!==n?e instanceof Text||"block"===f(e)?t(e.nextSibling,n):(e.style.display="block",t(e.nextSibling,n+1)):r.querySelector(".viewMore").style.display="none"}var n=e.currentTarget,r=n.parentElement;t(r.querySelector(".children").firstChild,0)}function f(e){return e.currentStyle?e.currentStyle.display:window.getComputedStyle(e,null).getPropertyValue("display")}var h={},m=document.currentScript,v=(m.parentNode,document.getElementById("embedd-comments"));if(v)return h.config={element:v,url:location.protocol+"//"+location.host+location.pathname,dark:!1,service:"hn",serviceName:"HackerNews",both:!0,loadMore:!0,infiniteScroll:!1,limit:5,debug:!1},"string"==typeof h.config.element&&(h.config.element=document.querySelector(h.config.element)),h.config.element.className="embedd-container",h.config.loadMore&&h.config.infiniteScroll&&(h.config.loadMore=!1),h.clients={},h.config.both&&(h.clients.reddit=(0,l.default)(h.config),h.clients.hn=(0,s.default)(h.config)),h.config.both||"reddit"!==h.config.service||(h.clients.reddit=(0,l.default)(h.config)),h.config.both||"hn"!==h.config.service||(h.clients.hn=(0,s.default)(h.config)),h.init=function(){var t=h.clients,n=t.reddit,o=t.hn,u=h.clients[h.config.service],c={};o&&(c.hasHn=o.hasComments),n&&(c.hasReddit=n.hasComments),c.data=u.getComments,i.default.series(c,function(t,n){if(t)throw new Error(t);n.submitUrl=u.submitUrl,h=e(h,n),r(h)})},h})().init()},function(e,t,n){(function(e){function r(e,t){this._id=e,this._clearFn=t}var o=Function.prototype.apply;t.setTimeout=function(){return new r(o.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(o.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(13),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(t,n(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";function r(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n"'`=\/]/g,function(e){return g[e]})}function a(t,n){function o(e){if("string"==typeof e&&(e=e.split(w,2)),!m(e)||2!==e.length)throw new Error("Invalid tags: "+e);i=new RegExp(r(e[0])+"\\s*"),c=new RegExp("\\s*"+r(e[1])),a=new RegExp("\\s*"+r("}"+e[1]))}if(!t)return[];var i,c,a,p=[],d=[],h=[],v=!1,y=!1;o(n||e.tags);for(var g,E,k,T,L,A,O=new l(t);!O.eos();){if(g=O.pos,k=O.scanUntil(i))for(var _=0,C=k.length;_0?i[i.length-1][4]:r;break;default:o.push(t)}return r}function l(e){this.string=e,this.tail=e,this.pos=0}function p(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function d(){this.cache={}}var h=Object.prototype.toString,m=Array.isArray||function(e){return"[object Array]"===h.call(e)},v=RegExp.prototype.test,y=/\S/,g={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},b=/\s*/,w=/\s+/,x=/\s*=/,j=/\s*\}/,S=/#|\^|\/|>|\{|&|=|!/;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},l.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},p.prototype.push=function(e){return new p(e,this)},p.prototype.lookup=function(e){var n,r=this.cache;if(r.hasOwnProperty(e))n=r[e];else{for(var i,u,c=this,a=!1;c;){if(e.indexOf(".")>0)for(n=c.view,i=e.split("."),u=0;null!=n&&u"===i?u=this.renderPartial(o,t,n,r):"&"===i?u=this.unescapedValue(o,t):"name"===i?u=this.escapedValue(o,t):"text"===i&&(u=this.rawValue(o)),void 0!==u&&(c+=u);return c},d.prototype.renderSection=function(e,n,r,o){function i(e){return u.render(e,n,r)}var u=this,c="",a=n.lookup(e[1]);if(a){if(m(a))for(var s=0,f=a.length;s * @license MIT */ e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,n){"use strict";function r(e){this.defaults=e,this.interceptors={request:new u,response:new u}}var o=n(3),i=n(0),u=n(28),c=n(29);r.prototype.request=function(e){"string"==typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),e=i.merge(o,{method:"get"},this.defaults,e),e.method=e.method.toLowerCase();var t=[c,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},i.forEach(["delete","get","head","options"],function(e){r.prototype[e]=function(t,n){return this.request(i.merge(n||{},{method:e,url:t}))}}),i.forEach(["post","put","patch"],function(e){r.prototype[e]=function(t,n,r){return this.request(i.merge(r||{},{method:e,url:t,data:n}))}}),e.exports=r},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(8);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(0);e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(o.isURLSearchParams(t))i=t.toString();else{var u=[];o.forEach(t,function(e,t){null!==e&&void 0!==e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),u.push(r(t)+"="+r(e))}))}),i=u.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,n){"use strict";var r=n(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,u={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(u[t]&&o.indexOf(t)>=0)return;u[t]="set-cookie"===t?(u[t]?u[t]:[]).concat([n]):u[t]?u[t]+", "+n:n}}),u):u}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,i,u){var c=[];c.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),r.isString(o)&&c.push("path="+o),r.isString(i)&&c.push("domain="+i),!0===u&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(0);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var o=n(0),i=n(30),u=n(9),c=n(3),a=n(31),s=n(32);e.exports=function(e){return r(e),e.baseURL&&!a(e.url)&&(e.url=s(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||c.adapter)(e).then(function(t){return r(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return u(t)||(r(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(10);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e;return{token:new r(function(t){e=t}),cancel:e}},e.exports=r},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";function r(e){if(!e)throw new Error("The Reddit constructor requires a spec object");var t=e.url,n=e.limit,r={};return r.base="https://www.reddit.com",r.searchQs="/search.json?q=url:",r.query=r.base+r.searchQs+t,r.submitUrl="https://www.reddit.com/submit",r.limit=n,r.dataFmt=function(e,t){e.hits=e.data.children.map(function(e){return e=e.data}),t(null,e)},r.commentFmt=function(e){return{author:e.author,author_link:"https://www.reddit.com/user/"+e.author,body_html:(0,o.decode)(e.body_html),created:(0,o.parseDate)(e.created_utc),id:e.id,score:e.score,replies:null,hasReplies:!1,isEven:function(){return this.depth%2==0},isOdd:function(){return this.depth%2==1},lowScore:function(){return this.score<0}}},r.threadFmt=function(e){var t=function e(t){return t.points=t.score,t.replies&&(t.children=t.replies.data.children.map(function(t){return t=t.data,t.replies&&(t.children=e(t)),t})),t},n=e[0].data.children[0].data;return n.points=n.score,n.children=e[1].data.children.map(function(e){return e=e.data,t(e)}),n},(0,o.embeddConstructor)(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=n(5)},function(e,t){e.exports='
\n {{#data}}\n
\n {{#score}}\n

{{score}} upvotes {{#multiple}}over {{threads}} threads{{/multiple}} on {{config.serviceName}}

\n {{/score}}\n {{^score}}\n \n Start discussion on {{config.serviceName}}\n \n {{/score}}\n
\n\n {{#config.both}}\n {{#hasReddit}}\n {{#hasHn}}\n
\n \n\n \n
\n {{/hasHn}}\n {{/hasReddit}}\n {{/config.both}}\n\n
\n {{#comments}}\n {{> comment}}\n {{/comments}}\n
\n\n {{#config.loadMore}}\n
\n \n
\n {{/config.loadMore}}\n\n {{/data}}\n
\n'},function(e,t){e.exports='
\n\n \n\n {{#body_html}}\n\n {{& body_html}}\n {{/body_html}}\n\n \n\n {{#hasReplies}}\n
\n {{#replies}}\n {{> comment}}\n {{/replies}}\n\n {{#loadMore}}\n \n {{/loadMore}}\n
\n\n {{/hasReplies}}\n\n
\n'}]);