From a62a3e7755579d93ce3a87243dd277575930fffe Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Mon, 5 Nov 2018 21:49:16 -0500 Subject: init --- themes/even/static/lib/gitment/gitment-0.0.3.min.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 themes/even/static/lib/gitment/gitment-0.0.3.min.js (limited to 'themes/even/static/lib/gitment/gitment-0.0.3.min.js') diff --git a/themes/even/static/lib/gitment/gitment-0.0.3.min.js b/themes/even/static/lib/gitment/gitment-0.0.3.min.js new file mode 100644 index 0000000..9b2592d --- /dev/null +++ b/themes/even/static/lib/gitment/gitment-0.0.3.min.js @@ -0,0 +1 @@ +var Gitment=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="",t(t.s=5)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LS_ACCESS_TOKEN_KEY="gitment-comments-token",t.LS_USER_KEY="gitment-user-info",t.NOT_INITIALIZED_ERROR=new Error("Comments Not Initialized")},function(e,t,n){"use strict";(function(n){function r(e){return function(t,n,r){return r&&"function"==typeof r.value?(r.value=V(e,r.value),r.enumerable=!1,r.configurable=!0,r):Kt(e).apply(this,arguments)}}function i(e,t,n){var r="string"==typeof e?e:e.name||"",i="function"==typeof e?e:t,o="function"==typeof e?t:n;return wt("function"==typeof i,vt("m002")),wt(0===i.length,vt("m003")),wt("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),z(r,i,o,void 0)}function o(e){return"function"==typeof e&&!0===e.isMobxAction}function a(e,t,n){var r=function(){return z(t,n,e,arguments)};r.isMobxAction=!0,Ct(e,t,r)}function s(e,t,n){function r(){a(u)}var i,a,s;"string"==typeof e?(i=e,a=t,s=n):(i=e.name||"Autorun@"+bt(),a=e,s=t),wt("function"==typeof a,vt("m004")),wt(!1===o(a),vt("m005")),s&&(a=a.bind(s));var u=new fn(i,function(){this.track(r)});return u.schedule(),u.getDisposer()}function u(e,t,n,r){var i,o,a,u;return"string"==typeof e?(i=e,o=t,a=n,u=r):(i="When@"+bt(),o=e,a=t,u=n),s(i,function(e){if(o.call(u)){e.dispose();var t=te();a.call(u),ne(t)}})}function c(e,t,n,r){function i(){s(h)}var a,s,u,c;"string"==typeof e?(a=e,s=t,u=n,c=r):(a=e.name||"AutorunAsync@"+bt(),s=e,u=t,c=n),wt(!1===o(s),vt("m006")),void 0===u&&(u=1),c&&(s=s.bind(c));var l=!1,h=new fn(a,function(){l||(l=!0,setTimeout(function(){l=!1,h.isDisposed||h.track(i)},u))});return h.schedule(),h.getDisposer()}function l(e,t,n){function r(){if(!u.isDisposed){var n=!1;u.track(function(){var t=e(u);n=Tt(i.compareStructural,o,t),o=t}),a&&i.fireImmediately&&t(o,u),a||!0!==n||t(o,u),a&&(a=!1)}}arguments.length>3&&yt(vt("m007")),Ve(e)&&yt(vt("m008"));var i;i="object"===(void 0===n?"undefined":Ut(n))?n:{},i.name=i.name||e.name||t.name||"Reaction@"+bt(),i.fireImmediately=!0===n||!0===i.fireImmediately,i.delay=i.delay||0,i.compareStructural=i.compareStructural||i.struct||!1,t=Yt(i.name,i.context?t.bind(i.context):t),i.context&&(e=e.bind(i.context));var o,a=!0,s=!1,u=new fn(i.name,function(){a||i.delay<1?r():s||(s=!0,setTimeout(function(){s=!1,r()},i.delay))});return u.schedule(),u.getDisposer()}function h(e){return ct(function(t,n,r,i,o){wt(void 0!==o,vt("m009")),wt("function"==typeof o.get,vt("m010")),Ze(Fe(t,""),n,o.get,o.set,e,!1)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){this.$mobx.values[e].set(t)},!1,!1)}function d(e,t){wt("function"==typeof e&&e.length<2,"createTransformer expects a function that accepts one argument");var n={},r=pn.resetId,i=function(r){function i(t,n){var i=r.call(this,function(){return e(n)},void 0,!1,"Transformer-"+e.name+"-"+t,void 0)||this;return i.sourceIdentifier=t,i.sourceObject=n,i}return Ht(i,r),i.prototype.onBecomeUnobserved=function(){var e=this.value;r.prototype.onBecomeUnobserved.call(this),delete n[this.sourceIdentifier],t&&t(e,this.sourceObject)},i}(sn);return function(e){r!==pn.resetId&&(n={},r=pn.resetId);var t=p(e),o=n[t];return o?o.get():(o=n[t]=new i(t,e),o.get())}}function p(e){if("string"==typeof e||"number"==typeof e)return e;if(null===e||"object"!==(void 0===e?"undefined":Ut(e)))throw new Error("[mobx] transform expected some kind of object or primitive value, got: "+e);var t=e.$transformId;return void 0===t&&(t=bt(),Ct(e,"$transformId",t)),t}function f(e,t){return J()||console.warn(vt("m013")),Jt(e,{context:t}).get()}function m(e){for(var t=[],n=1;n=2,vt("m014")),wt("object"===(void 0===e?"undefined":Ut(e)),vt("m015")),wt(!Tn(e),vt("m016")),n.forEach(function(e){wt("object"===(void 0===e?"undefined":Ut(e)),vt("m017")),wt(!A(e),vt("m018"))});for(var r=Fe(e),i={},o=n.length-1;o>=0;o--){var a=n[o];for(var s in a)if(!0!==i[s]&&Lt(a,s)){if(i[s]=!0,e===a&&!jt(e,s))continue;var u=Object.getOwnPropertyDescriptor(a,s);Xe(r,s,u,t)}}return e}function b(e,t){return y(at(e,t))}function y(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=St(e.observing).map(y)),t}function w(e,t){return _(at(e,t))}function _(e){var t={name:e.name};return se(e)&&(t.observers=ue(e).map(_)),t}function x(e,t,n){return"function"==typeof n?O(e,t,n):S(e,t)}function S(e,t){return st(e).intercept(t)}function O(e,t,n){return st(e,t).intercept(n)}function k(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(!1===ot(e))return!1;var n=at(e,t);return cn(n)}return cn(e)}function A(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(qe(e)||Tn(e))throw new Error(vt("m019"));if(ot(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return ot(e)||!!e.$mobx||an(e)||gn(e)||cn(e)}function E(e){if(void 0===e&&(e=void 0),"string"==typeof arguments[1])return Ft.apply(null,arguments);if(wt(arguments.length<=1,vt("m021")),wt(!Ve(e),vt("m020")),A(e))return e;var t=Be(e,void 0,void 0);return t!==e?t:nn.box(e)}function T(e){yt("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}function L(e){return wt(!!e,":("),ct(function(t,n,r,i,o){Rt(t,n),wt(!o||!o.get,vt("m022")),Qe(Fe(t,void 0),n,r,e)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){rt(this,e,t)},!0,!1)}function C(e,t,n,r){return"function"==typeof n?j(e,t,n,r):I(e,t,n)}function I(e,t,n){return st(e).observe(t,n)}function j(e,t,n,r){return st(e,t).observe(n,r)}function R(e,t,n){function r(r){return t&&n.push([e,r]),r}if(void 0===t&&(t=!0),void 0===n&&(n=[]),A(e)){if(t&&null===n&&(n=[]),t&&null!==e&&"object"===(void 0===e?"undefined":Ut(e)))for(var i=0,o=n.length;i0,"actions should have valid names, got: '"+e+"'");var n=function(){return z(e,t,this,arguments)};return n.originalFn=t,n.isMobxAction=!0,n}function z(e,t,n,r){var i=B(e,t,n,r);try{return t.apply(n,r)}finally{$(i)}}function B(e,t,n,r){var i=Se()&&!!e,o=0;if(i){o=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u0;pn.computationDepth>0&&t&&yt(vt("m031")+e.name),!pn.allowStateChanges&&t&&yt(vt(pn.strictMode?"m030a":"m030b")+e.name)}function X(e,t,n){re(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++pn.runId;var r=pn.trackingDerivation;pn.trackingDerivation=e;var i;try{i=t.call(n)}catch(e){i=new ln(e)}return pn.trackingDerivation=r,Q(e),i}function Q(e){var t=e.observing,n=e.observing=e.newObserving,r=un.UP_TO_DATE;e.newObserving=null;for(var i=0,o=e.unboundDepsCount,a=0;ar&&(r=s.dependenciesState)}for(n.length=i,o=t.length;o--;){var s=t[o];0===s.diffValue&&le(s,e),s.diffValue=0}for(;i--;){var s=n[i];1===s.diffValue&&(s.diffValue=0,ce(s,e))}r!==un.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}function Z(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)le(t[n],e);e.dependenciesState=un.NOT_TRACKING}function ee(e){var t=te(),n=e();return ne(t),n}function te(){var e=pn.trackingDerivation;return pn.trackingDerivation=null,e}function ne(e){pn.trackingDerivation=e}function re(e){if(e.dependenciesState!==un.UP_TO_DATE){e.dependenciesState=un.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=un.UP_TO_DATE}}function ie(){var e=gt(),t=pn;if(e.__mobservableTrackingStack||e.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(e.__mobxGlobal&&e.__mobxGlobal.version!==t.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");e.__mobxGlobal?pn=e.__mobxGlobal:e.__mobxGlobal=t}function oe(){return pn}function ae(){pn.resetId++;var e=new dn;for(var t in e)-1===hn.indexOf(t)&&(pn[t]=e[t]);pn.allowStateChanges=!pn.strictMode}function se(e){return e.observers&&e.observers.length>0}function ue(e){return e.observers}function ce(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function le(e,t){if(1===e.observers.length)e.observers.length=0,he(e);else{var n=e.observers,r=e.observersIndexes,i=n.pop();if(i!==t){var o=r[t.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[t.__mapid]}}function he(e){e.isPendingUnobservation||(e.isPendingUnobservation=!0,pn.pendingUnobservations.push(e))}function de(){pn.inBatch++}function pe(){if(0==--pn.inBatch){we();for(var e=pn.pendingUnobservations,t=0;t=0&&pn.globalReactionErrorHandlers.splice(t,1)}}function we(){pn.inBatch>0||pn.isRunningReactions||vn(_e)}function _e(){pn.isRunningReactions=!0;for(var e=pn.pendingReactions,t=0;e.length>0;){++t===mn&&(console.error("Reaction doesn't converge to a stable state after "+mn+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r0}function Le(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),xt(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Ce(e,t){var n=te();try{var r=e.interceptors;if(r)for(var i=0,o=r.length;i0}function je(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),xt(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Re(e,t){var n=te(),r=e.changeListeners;if(r){r=r.slice();for(var i=0,o=r.length;i=this.length,value:tt?" (... and "+(e.length-t)+"more)":""):""}function kt(e){return null!==e&&"object"===(void 0===e?"undefined":Ut(e))}function At(e){if(null===e||"object"!==(void 0===e?"undefined":Ut(e)))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function Et(){for(var e=arguments[0],t=1,n=arguments.length;t=0;i--)if(!Mt(e[i],t[i]))return!1;return!0}if(r){if(e.size!==t.size)return!1;var o=!0;return e.forEach(function(e,n){o=o&&Mt(t.get(n),e)}),o}if("object"===(void 0===e?"undefined":Ut(e))&&"object"===(void 0===t?"undefined":Ut(t))){if(null===e||null===t)return!1;if(Vt(e)&&Vt(t))return e.size===t.size&&Mt(nn.shallowMap(e).entries(),nn.shallowMap(t).entries());if(Pt(e).length!==Pt(t).length)return!1;for(var a in e){if(!(a in t))return!1;if(!Mt(e[a],t[a]))return!1}return!0}return!1}function Dt(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return kt(e)&&!0===e[n]}}function Nt(e){return Array.isArray(e)||qe(e)}function Vt(e){return zt(e)||Tn(e)}function zt(e){return void 0!==gt().Map&&e instanceof gt().Map}function Bt(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function $t(e){return null===e?null:"object"===(void 0===e?"undefined":Ut(e))?""+e:e}var Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ht=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.extras={allowStateChanges:K,deepEqual:Mt,getAtom:at,getDebugName:ut,getDependencyTree:b,getAdministration:st,getGlobalState:oe,getObserverTree:w,isComputingDerivation:J,isSpyEnabled:Se,onReactionError:ye,reserveArrayBuffer:We,resetGlobalState:ae,shareGlobalState:ie,spyReport:Oe,spyReportEnd:Ae,spyReportStart:ke,setReactionScheduler:xe},"object"===("undefined"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__?"undefined":Ut(__MOBX_DEVTOOLS_GLOBAL_HOOK__))&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(e.exports),e.exports.default=e.exports;var Kt=ct(function(e,t,n,r,i){var o=r&&1===r.length?r[0]:n.name||t||"";Ct(e,t,Yt(o,n))},function(e){return this[e]},function(){wt(!1,vt("m001"))},!1,!0),Gt=ct(function(e,t,n){a(e,t,n)},function(e){return this[e]},function(){wt(!1,vt("m001"))},!1,!1),Yt=function(e,t,n,i){return 1===arguments.length&&"function"==typeof e?V(e.name||"",e):2===arguments.length&&"function"==typeof t?V(e,t):1===arguments.length&&"string"==typeof e?r(e):r(t).apply(null,arguments)};t.action=Yt,Yt.bound=function(e,t,n){if("function"==typeof e){var r=V("",e);return r.autoBind=!0,r}return Gt.apply(null,arguments)},t.runInAction=i,t.isAction=o,t.autorun=s,t.when=u,t.autorunAsync=c,t.reaction=l;var Wt=h(!1),qt=h(!0),Jt=function(e,t,n){if("string"==typeof t)return Wt.apply(null,arguments);wt("function"==typeof e,vt("m011")),wt(arguments.length<3,vt("m012"));var r="object"===(void 0===t?"undefined":Ut(t))?t:{};return r.setter="function"==typeof t?t:r.setter,new sn(e,r.context,r.compareStructural||r.struct||!1,r.name||e.name||"",r.setter)};t.computed=Jt,Jt.struct=qt,t.createTransformer=d,t.expr=f,t.extendObservable=m,t.extendShallowObservable=v,t.intercept=x,t.isComputed=k,t.isObservable=A;var Ft=L(Be),Xt=L($e),Qt=L(Ue),Zt=L(He),en=L(Ke),tn=function(){function e(){}return e.prototype.box=function(e,t){return arguments.length>2&&T("box"),new Pn(e,Be,t)},e.prototype.shallowBox=function(e,t){return arguments.length>2&&T("shallowBox"),new Pn(e,Ue,t)},e.prototype.array=function(e,t){return arguments.length>2&&T("array"),new Sn(e,Be,t)},e.prototype.shallowArray=function(e,t){return arguments.length>2&&T("shallowArray"),new Sn(e,Ue,t)},e.prototype.map=function(e,t){return arguments.length>2&&T("map"),new En(e,Be,t)},e.prototype.shallowMap=function(e,t){return arguments.length>2&&T("shallowMap"),new En(e,Ue,t)},e.prototype.object=function(e,t){arguments.length>2&&T("object");var n={};return Fe(n,t),m(n,e),n},e.prototype.shallowObject=function(e,t){arguments.length>2&&T("shallowObject");var n={};return Fe(n,t),v(n,e),n},e.prototype.ref=function(){return arguments.length<2?ze(Ue,arguments[0]):Qt.apply(null,arguments)},e.prototype.shallow=function(){return arguments.length<2?ze($e,arguments[0]):Xt.apply(null,arguments)},e.prototype.deep=function(){return arguments.length<2?ze(Be,arguments[0]):Ft.apply(null,arguments)},e.prototype.struct=function(){return arguments.length<2?ze(He,arguments[0]):Zt.apply(null,arguments)},e}();t.IObservableFactories=tn;var nn=E;t.observable=nn,Object.keys(tn.prototype).forEach(function(e){return nn[e]=tn.prototype[e]}),nn.deep.struct=nn.struct,nn.ref.struct=function(){return arguments.length<2?ze(Ke,arguments[0]):en.apply(null,arguments)},t.observe=C,t.toJS=R,t.transaction=P,t.whyRun=N,t.useStrict=U,t.isStrictModeEnabled=H;var rn=function(){function e(e){void 0===e&&(e="Atom@"+bt()),this.name=e,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=un.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.reportObserved=function(){fe(this)},e.prototype.reportChanged=function(){de(),me(this),pe()},e.prototype.toString=function(){return this.name},e}();t.BaseAtom=rn;var on=function(e){function t(t,n,r){void 0===t&&(t="Atom@"+bt()),void 0===n&&(n=Bn),void 0===r&&(r=Bn);var i=e.call(this,t)||this;return i.name=t,i.onBecomeObservedHandler=n,i.onBecomeUnobservedHandler=r,i.isPendingUnobservation=!1,i.isBeingTracked=!1,i}return Ht(t,e),t.prototype.reportObserved=function(){return de(),e.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),pe(),!!pn.trackingDerivation},t.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},t}(rn);t.Atom=on;var an=Dt("Atom",rn),sn=function(){function e(e,t,n,r,i){this.derivation=e,this.scope=t,this.compareStructural=n,this.dependenciesState=un.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=un.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+bt(),this.value=void 0,this.isComputing=!1,this.isRunningSetter=!1,this.name=r||"ComputedValue@"+bt(),i&&(this.setter=V(r+"-setter",i))}return e.prototype.onBecomeStale=function(){ge(this)},e.prototype.onBecomeUnobserved=function(){Z(this),this.value=void 0},e.prototype.get=function(){wt(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===pn.inBatch?(de(),q(this)&&(this.value=this.computeValue(!1)),pe()):(fe(this),q(this)&&this.trackAndCompute()&&ve(this));var e=this.value;if(W(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(W(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){wt(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else wt(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},e.prototype.trackAndCompute=function(){Se()&&Oe({object:this.scope,type:"compute",fn:this.derivation});var e=this.value,t=this.value=this.computeValue(!0);return W(t)||Tt(this.compareStructural,t,e)},e.prototype.computeValue=function(e){this.isComputing=!0,pn.computationDepth++;var t;if(e)t=X(this,this.derivation,this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new ln(e)}return pn.computationDepth--,this.isComputing=!1,t},e.prototype.observe=function(e,t){var n=this,r=!0,i=void 0;return s(function(){var o=n.get();if(!r||t){var a=te();e({type:"update",object:n,newValue:o,oldValue:i}),ne(a)}r=!1,i=o})},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return $t(this.get())},e.prototype.whyRun=function(){var e=Boolean(pn.trackingDerivation),t=St(this.isComputing?this.newObserving:this.observing).map(function(e){return e.name}),n=St(ue(this).map(function(e){return e.name}));return"\nWhyRun? computation '"+this.name+"':\n * Running because: "+(e?"[active] the value of this computation is needed by a reaction":this.isComputing?"[get] The value of this computed was requested outside a reaction":"[idle] not running at the moment")+"\n"+(this.dependenciesState===un.NOT_TRACKING?vt("m032"):" * This computation will re-run if any of the following observables changes:\n "+Ot(t)+"\n "+(this.isComputing&&e?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+vt("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+Ot(n)+"\n")},e}();sn.prototype[Bt()]=sn.prototype.valueOf;var un,cn=Dt("ComputedValue",sn);!function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(un||(un={})),t.IDerivationState=un;var ln=function(){function e(e){this.cause=e}return e}();t.untracked=ee;var hn=["mobxGuid","resetId","spyListeners","strictMode","runId"],dn=function(){function e(){this.version=5,this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]}return e}(),pn=new dn,fn=function(){function e(e,t){void 0===e&&(e="Reaction@"+bt()),this.name=e,this.onInvalidate=t,this.observing=[],this.newObserving=[],this.dependenciesState=un.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+bt(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,pn.pendingReactions.push(this),we())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){this.isDisposed||(de(),this._isScheduled=!1,q(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&Se()&&Oe({object:this,type:"scheduled-reaction"})),pe())},e.prototype.track=function(e){de();var t,n=Se();n&&(t=Date.now(),ke({object:this,type:"reaction",fn:e})),this._isRunning=!0;var r=X(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Z(this),W(r)&&this.reportExceptionInDerivation(r.cause),n&&Ae({time:Date.now()-t}),pe()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)return void this.errorHandler(e,this);var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this,r=vt("m037");console.error(n||r,e),Se()&&Oe({type:"error",message:n,error:e,object:this}),pn.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(de(),Z(this),pe()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e.onError=be,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.whyRun=function(){var e=St(this._isRunning?this.newObserving:this.observing).map(function(e){return e.name});return"\nWhyRun? reaction '"+this.name+"':\n * Status: ["+(this.isDisposed?"stopped":this._isRunning?"running":this.isScheduled()?"scheduled":"idle")+"]\n * This reaction will re-run if any of the following observables changes:\n "+Ot(e)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+vt("m038")+"\n"},e}();t.Reaction=fn;var mn=100,vn=function(e){return e()},gn=Dt("Reaction",fn),bn={spyReportEnd:!0};t.spy=Ee,t.asReference=Pe,t.asStructure=Me,t.asFlat=De,t.asMap=Ne,t.isModifierDescriptor=Ve;var yn=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,!1===e}(),wn=0,_n=function(){function e(){}return e}();_n.prototype=[];var xn=function(){function e(e,t,n,r){this.array=n,this.owned=r,this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new rn(e||"ObservableArray@"+bt()),this.enhancer=function(n,r){return t(n,r,e+"[..]")}}return e.prototype.intercept=function(e){return Le(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),je(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r0&&e+t+1>wn&&We(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;F(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:void 0===t||null===t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=[]),Te(this)){var o=Ce(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!o)return Vn;t=o.removedCount,n=o.added}n=n.map(function(e){return r.enhancer(e,void 0)});var a=n.length-t;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,s),s},e.prototype.spliceItemsIntoValues=function(e,t,n){if(n.length<1e4)return(i=this.values).splice.apply(i,[e,t].concat(n));var r=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),r;var i},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&Se(),i=Ie(this),o=i||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&ke(o),this.atom.reportChanged(),i&&Re(this,o),r&&Ae()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&Se(),i=Ie(this),o=i||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&ke(o),this.atom.reportChanged(),i&&Re(this,o),r&&Ae()},e}(),Sn=function(e){function t(t,n,r,i){void 0===r&&(r="ObservableArray@"+bt()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new xn(r,n,o,i);return It(o,"$mobx",a),t&&t.length?(a.updateArrayLength(0,t.length),a.values=t.map(function(e){return n(e,void 0,r+"[..]")}),a.notifyArraySplice(0,a.values.slice(),Vn)):a.values=[],yn&&Object.defineProperty(a.array,"0",On),o}return Ht(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,i=this.$mobx.values;r=e"+n.reactions.heart+" Liked":"")+"\n ",s?(a.classList.add("liked"),a.onclick=function(){return t.unlike()}):(a.classList.remove("liked"),a.onclick=function(){return t.like()}),o.appendChild(a);var u=document.createElement("span");u.innerHTML="\n "+(n.comments?" • "+n.comments+" Comments":"")+"\n ",o.appendChild(u);var l=document.createElement("a");return l.className="gitment-header-issue-link",l.href=n.html_url,l.target="_blank",l.innerText="Issue Page",o.appendChild(l),o}function i(e,t){var n=e.meta,r=e.comments,i=e.commentReactions,o=e.currentPage,a=e.user,s=e.error,u=document.createElement("div");if(u.lang="en-US",u.className="gitment-container gitment-comments-container",s){var h=document.createElement("div");if(h.className="gitment-comments-error",s===l.NOT_INITIALIZED_ERROR&&a.login&&a.login.toLowerCase()===t.owner.toLowerCase()){var d=document.createElement("div"),p=document.createElement("button");p.className="gitment-comments-init-btn",p.onclick=function(){p.setAttribute("disabled",!0),t.init().catch(function(e){p.removeAttribute("disabled"),alert(e)})},p.innerText="Initialize Comments",d.appendChild(p),h.appendChild(d)}else h.innerText=s;return u.appendChild(h),u}if(void 0===r){var f=document.createElement("div");return f.innerText="Loading comments...",f.className="gitment-comments-loading",u.appendChild(f),u}if(!r.length){var m=document.createElement("div");return m.className="gitment-comments-empty",m.innerText="No Comment Yet",u.appendChild(m),u}var v=document.createElement("ul");if(v.className="gitment-comments-list",r.forEach(function(e){var n=new Date(e.created_at),r=new Date(e.updated_at),o=document.createElement("li");o.className="gitment-comment",o.innerHTML='\n \n \n \n
\n
\n \n '+e.user.login+'\n \n commented on\n '+n.toDateString()+"\n "+(n.toString()!==r.toString()?' • edited':"")+'\n
'+c.reply+'
\n
'+c.heart+" "+(e.reactions.heart||"")+'
\n
\n
'+e.body_html+"
\n
\n ";var s=o.querySelector(".gitment-comment-like-btn");i[e.id]&&i[e.id].find(function(e){return"heart"===e.content&&e.user.login===a.login})?(s.classList.add("liked"),s.onclick=function(){return t.unlikeAComment(e.id)}):(s.classList.remove("liked"),s.onclick=function(){return t.likeAComment(e.id)}),o.querySelector(".gitment-comment-reply-btn").onclick=function(){return t.replyAComment(e.user.login)};var u=document.createElement("img"),l=o.querySelector(".gitment-comment-body");u.className="gitment-hidden",u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",u.onload=function(){l.clientHeight>t.maxCommentHeight&&(l.classList.add("gitment-comment-body-folded"),l.style.maxHeight=t.maxCommentHeight+"px",l.title="Click to Expand",l.onclick=function(){l.classList.remove("gitment-comment-body-folded"),l.style.maxHeight="",l.title="",l.onclick=null})},o.appendChild(u),v.appendChild(o)}),u.appendChild(v),n){var g=Math.ceil(n.comments/t.perPage);if(g>1){var b=document.createElement("ul");if(b.className="gitment-comments-pagination",o>1){var y=document.createElement("li");y.className="gitment-comments-page-item",y.innerText="Previous",y.onclick=function(){return t.goto(o-1)},b.appendChild(y)}for(var w=1;w<=g;w++)!function(e){var n=document.createElement("li");n.className="gitment-comments-page-item",n.innerText=e,n.onclick=function(){return t.goto(e)},o===e&&n.classList.add("gitment-selected"),b.appendChild(n)}(w);if(o\n \n ':n.isLoggingIn?'
'+c.spinner+"
":'\n '+c.github+"\n ")+'\n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n ",n.login&&(i.querySelector(".gitment-editor-logout-link").onclick=function(){return t.logout()});var s=i.querySelector(".gitment-editor-write-field"),l=i.querySelector(".gitment-editor-preview-field"),h=s.querySelector("textarea");h.oninput=function(){h.style.height="auto";var e=window.getComputedStyle(h,null),t=parseInt(e.height,10),n=h.clientHeight,r=h.scrollHeight;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"https://api.github.com",i=new XMLHttpRequest,o=localStorage.getItem(a.LS_ACCESS_TOKEN_KEY),s=""+r+t,c=null;"GET"!==e&&"DELETE"!==e||(s+=u.stringify(n));var l=new Promise(function(e,t){i.addEventListener("load",function(){var n=i.getResponseHeader("content-type"),r=i.responseText;if(!/json/.test(n))return void e(r);var o=i.responseText?JSON.parse(r):{};o.message?t(new Error(o.message)):e(o)}),i.addEventListener("error",function(e){return t(e)})});return i.open(e,s,!0),i.setRequestHeader("Accept","application/vnd.github.squirrel-girl-preview, application/vnd.github.html+json"),o&&i.setRequestHeader("Authorization","token "+o),"GET"!==e&&"DELETE"!==e&&(c=JSON.stringify(n),i.setRequestHeader("Content-Type","application/json")),i.send(c),l}}Object.defineProperty(t,"__esModule",{value:!0}),t.http=t.Query=t.isString=void 0;var o=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.getTargetContainer=r;var a=n(0),s=t.isString=function(e){return"[object String]"===toString.call(e)},u=t.Query={parse:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.search;if(!e)return{};var t="?"===e[0]?e.substring(1):e,n={};return t.split("&").forEach(function(e){var t=e.split("="),r=o(t,2),i=r[0],a=r[1];i&&(n[i]=a)}),n},stringify:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"?",n=Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t]||"")}).join("&");return n?t+n:""}};t.http={get:i("GET"),post:i("POST"),delete:i("DELETE"),put:i("PUT")}},function(e,t,n){"use strict";var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){e[t]=function(n){var r=(0,u.getTargetContainer)(n),i=e.theme[t]||e.defaultTheme[t];return(0,a.autorun)(function(){var t=i(e.state,e);r.firstChild?r.replaceChild(t,r.firstChild):r.appendChild(t)}),r}}var o=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),this.defaultTheme=l.default,this.useTheme(l.default),Object.assign(this,{id:window.location.href,title:window.document.title,link:window.location.href,desc:"",labels:[],theme:l.default,oauth:{},perPage:20,maxCommentHeight:250},n),this.useTheme(this.theme);var i={};try{var o=localStorage.getItem(s.LS_USER_KEY);this.accessToken&&o&&Object.assign(i,JSON.parse(o),{fromCache:!0})}catch(e){localStorage.removeItem(s.LS_USER_KEY)}this.state=(0,a.observable)({user:i,error:null,meta:{},comments:void 0,reactions:[],commentReactions:{},currentPage:1});var c=u.Query.parse();if(c.code){var h=this.oauth,d=h.client_id,p=h.client_secret,f=c.code;delete c.code;var m=u.Query.stringify(c),v=""+window.location.origin+window.location.pathname+m+window.location.hash;history.replaceState({},"",v),Object.assign(this,{id:v,link:v},n),this.state.user.isLoggingIn=!0,u.http.post("https://gh-oauth.imsun.net",{code:f,client_id:d,client_secret:p},"").then(function(e){t.accessToken=e.access_token,t.update()}).catch(function(e){t.state.user.isLoggingIn=!1,alert(e)})}else this.update()}return o(e,[{key:"accessToken",get:function(){return localStorage.getItem(s.LS_ACCESS_TOKEN_KEY)},set:function(e){localStorage.setItem(s.LS_ACCESS_TOKEN_KEY,e)}},{key:"loginLink",get:function(){var e=this.oauth.redirect_uri||window.location.href,t=Object.assign({scope:"public_repo",redirect_uri:e},this.oauth);return"https://github.com/login/oauth/authorize"+u.Query.stringify(t)}}]),o(e,[{key:"init",value:function(){var e=this;return this.createIssue().then(function(){return e.loadComments()}).then(function(t){return e.state.error=null,t})}},{key:"useTheme",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.theme=t,Object.keys(this.theme).forEach(function(t){return i(e,t)})}},{key:"update",value:function(){var e=this;return Promise.all([this.loadMeta(),this.loadUserInfo()]).then(function(){return Promise.all([e.loadComments().then(function(){return e.loadCommentReactions()}),e.loadReactions()])}).catch(function(t){return e.state.error=t})}},{key:"markdown",value:function(e){return u.http.post("/markdown",{text:e,mode:"gfm"})}},{key:"createIssue",value:function(){var e=this,t=this.id,n=this.owner,r=this.repo,i=this.title,o=this.link,a=this.desc,s=this.labels;return u.http.post("/repos/"+n+"/"+r+"/issues",{title:i,labels:s.concat(["gitment",t]),body:o+"\n\n"+a}).then(function(t){return e.state.meta=t,t})}},{key:"getIssue",value:function(){return this.state.meta.id?Promise.resolve(this.state.meta):this.loadMeta()}},{key:"post",value:function(e){var t=this;return this.getIssue().then(function(t){return u.http.post(t.comments_url,{body:e},"")}).then(function(e){t.state.meta.comments++;var n=Math.ceil(t.state.meta.comments/t.perPage);return t.state.currentPage===n&&t.state.comments.push(e),e})}},{key:"loadMeta",value:function(){var e=this,t=this.id,n=this.owner,r=this.repo;return u.http.get("/repos/"+n+"/"+r+"/issues",{creator:n,labels:t}).then(function(t){return t.length?(e.state.meta=t[0],t[0]):Promise.reject(s.NOT_INITIALIZED_ERROR)})}},{key:"loadComments",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentPage;return this.getIssue().then(function(n){return u.http.get(n.comments_url,{page:t,per_page:e.perPage},"")}).then(function(t){return e.state.comments=t,t})}},{key:"loadUserInfo",value:function(){var e=this;return this.accessToken?u.http.get("/user").then(function(t){return e.state.user=t,localStorage.setItem(s.LS_USER_KEY,JSON.stringify(t)),t}):(this.logout(),Promise.resolve({}))}},{key:"loadReactions",value:function(){var e=this;return this.accessToken?this.getIssue().then(function(e){return e.reactions.total_count?u.http.get(e.reactions.url,{},""):[]}).then(function(t){return e.state.reactions=t,t}):(this.state.reactions=[],Promise.resolve([]))}},{key:"loadCommentReactions",value:function(){var e=this;if(!this.accessToken)return this.state.commentReactions={},Promise.resolve([]);var t=this.state.comments,n={};return Promise.all(t.map(function(t){if(!t.reactions.total_count)return[];var n=e.owner,r=e.repo;return u.http.get("/repos/"+n+"/"+r+"/issues/comments/"+t.id+"/reactions",{})})).then(function(r){return t.forEach(function(e,t){n[e.id]=r[t]}),e.state.commentReactions=n,n})}},{key:"login",value:function(){window.location.href=this.loginLink}},{key:"logout",value:function(){localStorage.removeItem(s.LS_ACCESS_TOKEN_KEY),localStorage.removeItem(s.LS_USER_KEY),this.state.user={}}},{key:"goto",value:function(e){return this.state.currentPage=e,this.state.comments=void 0,this.loadComments(e)}},{key:"like",value:function(){var e=this;if(!this.accessToken)return alert("Login to Like"),Promise.reject();var t=this.owner,n=this.repo;return u.http.post("/repos/"+t+"/"+n+"/issues/"+this.state.meta.number+"/reactions",{content:"heart"}).then(function(t){e.state.reactions.push(t),e.state.meta.reactions.heart++})}},{key:"unlike",value:function(){var e=this;if(!this.accessToken)return Promise.reject();var t=this.state,n=t.user,r=t.reactions,i=r.findIndex(function(e){return e.user.login===n.login});return u.http.delete("/reactions/"+r[i].id).then(function(){r.splice(i,1),e.state.meta.reactions.heart--})}},{key:"likeAComment",value:function(e){var t=this;if(!this.accessToken)return alert("Login to Like"),Promise.reject();var n=this.owner,r=this.repo,i=this.state.comments.find(function(t){return t.id===e});return u.http.post("/repos/"+n+"/"+r+"/issues/comments/"+e+"/reactions",{content:"heart"}).then(function(n){t.state.commentReactions[e].push(n),i.reactions.heart++})}},{key:"unlikeAComment",value:function(e){if(!this.accessToken)return Promise.reject();var t=this.state.commentReactions[e],n=this.state.comments.find(function(t){return t.id===e}),r=this.state.user,i=t.findIndex(function(e){return e.user.login===r.login});return u.http.delete("/reactions/"+t[i].id).then(function(){t.splice(i,1),n.reactions.heart--})}},{key:"replyAComment",value:function(e){if(!this.accessToken)return Promise.reject();var t=document.getElementById("gitment-editor");t.innerText+="@"+e+" ",t.focus()}}]),e}();e.exports=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.close='',t.github='',t.heart='',t.spinner='',t.reply=''}]); \ No newline at end of file -- cgit v1.2.3