(self.webpackChunk=self.webpackChunk||[]).push([["contributors-graph"],{"./node_modules/hammerjs/hammer.js":function(pe,Qt,C){var f;(function(x,ve,ze,P){"use strict";var Gt=["","webkit","Moz","MS","ms","o"],ge=ve.createElement("div"),Te="function",it=Math.round,G=Math.abs,At=Date.now;function Mt(e,n,s){return setTimeout(Nt(e,s),n)}function ot(e,n,s){return Array.isArray(e)?(X(e,s[n],s),!0):!1}function X(e,n,s){var a;if(e)if(e.forEach)e.forEach(n,s);else if(e.length!==P)for(a=0;a\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",E=x.console&&(x.console.warn||x.console.log);return E&&E.call(x.console,a,d),e.apply(this,arguments)}}var z;typeof Object.assign!="function"?z=function(n){if(n===P||n===null)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(n),a=1;a-1}function xt(e){return e.trim().split(/\s+/g)}function st(e,n,s){if(e.indexOf&&!s)return e.indexOf(n);for(var a=0;aL[n]}):a=a.sort()),a}function bt(e,n){for(var s,a,h=n[0].toUpperCase()+n.slice(1),d=0;d1&&!s.firstMultiple?s.firstMultiple=jt(n):h===1&&(s.firstMultiple=!1);var d=s.firstInput,E=s.firstMultiple,I=E?E.center:d.center,M=n.center=$(a);n.timeStamp=At(),n.deltaTime=n.timeStamp-d.timeStamp,n.angle=ft(I,M),n.distance=It(I,M),Ft(s,n),n.offsetDirection=Ht(n.deltaX,n.deltaY);var L=Xt(n.deltaTime,n.deltaX,n.deltaY);n.overallVelocityX=L.x,n.overallVelocityY=L.y,n.overallVelocity=G(L.x)>G(L.y)?L.x:L.y,n.scale=E?be(E.pointers,a):1,n.rotation=E?ie(E.pointers,a):0,n.maxPointers=s.prevInput?n.pointers.length>s.prevInput.maxPointers?n.pointers.length:s.prevInput.maxPointers:n.pointers.length,_e(s,n);var Q=e.element;Jt(n.srcEvent.target,Q)&&(Q=n.srcEvent.target),n.target=Q}function Ft(e,n){var s=n.center,a=e.offsetDelta||{},h=e.prevDelta||{},d=e.prevInput||{};(n.eventType===y||d.eventType===b)&&(h=e.prevDelta={x:d.deltaX||0,y:d.deltaY||0},a=e.offsetDelta={x:s.x,y:s.y}),n.deltaX=h.x+(s.x-a.x),n.deltaY=h.y+(s.y-a.y)}function _e(e,n){var s=e.lastInterval||n,a=n.timeStamp-s.timeStamp,h,d,E,I;if(n.eventType!=O&&(a>Rt||s.velocity===P)){var M=n.deltaX-s.deltaX,L=n.deltaY-s.deltaY,Q=Xt(a,M,L);d=Q.x,E=Q.y,h=G(Q.x)>G(Q.y)?Q.x:Q.y,I=Ht(M,L),e.lastInterval=n}else h=s.velocity,d=s.velocityX,E=s.velocityY,I=s.direction;n.velocity=h,n.velocityX=d,n.velocityY=E,n.direction=I}function jt(e){for(var n=[],s=0;s=G(n)?e<0?U:ct:n<0?ht:rt}function It(e,n,s){s||(s=ee);var a=n[s[0]]-e[s[0]],h=n[s[1]]-e[s[1]];return Math.sqrt(a*a+h*h)}function ft(e,n,s){s||(s=ee);var a=n[s[0]]-e[s[0]],h=n[s[1]]-e[s[1]];return Math.atan2(h,a)*180/Math.PI}function ie(e,n){return ft(n[1],n[0],Ct)+ft(e[1],e[0],Ct)}function be(e,n){return It(n[0],n[1],Ct)/It(e[0],e[1],Ct)}var Se={mousedown:y,mousemove:K,mouseup:b},Ce="mousedown",Ie="mousemove mouseup";function dt(){this.evEl=Ce,this.evWin=Ie,this.pressed=!1,w.apply(this,arguments)}N(dt,w,{handler:function(n){var s=Se[n.type];s&y&&n.button===0&&(this.pressed=!0),s&K&&n.which!==1&&(s=b),this.pressed&&(s&b&&(this.pressed=!1),this.callback(this.manager,s,{pointers:[n],changedPointers:[n],pointerType:kt,srcEvent:n}))}});var oe={pointerdown:y,pointermove:K,pointerup:b,pointercancel:O,pointerout:O},se={2:q,3:xe,4:kt,5:$t},re="pointerdown",A="pointermove pointerup pointercancel";x.MSPointerEvent&&!x.PointerEvent&&(re="MSPointerDown",A="MSPointerMove MSPointerUp MSPointerCancel");function tt(){this.evEl=re,this.evWin=A,w.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}N(tt,w,{handler:function(n){var s=this.store,a=!1,h=n.type.toLowerCase().replace("ms",""),d=oe[h],E=se[n.pointerType]||n.pointerType,I=E==q,M=st(s,n.pointerId,"pointerId");d&y&&(n.button===0||I)?M<0&&(s.push(n),M=s.length-1):d&(b|O)&&(a=!0),!(M<0)&&(s[M]=n,this.callback(this.manager,d,{pointers:s,changedPointers:[n],pointerType:E,srcEvent:n}),a&&s.splice(M,1))}});var Pe={touchstart:y,touchmove:K,touchend:b,touchcancel:O},Oe="touchstart",ae="touchstart touchmove touchend touchcancel";function le(){this.evTarget=Oe,this.evWin=ae,this.started=!1,w.apply(this,arguments)}N(le,w,{handler:function(n){var s=Pe[n.type];if(s===y&&(this.started=!0),!!this.started){var a=ue.call(this,n,s);s&(b|O)&&a[0].length-a[1].length===0&&(this.started=!1),this.callback(this.manager,s,{pointers:a[0],changedPointers:a[1],pointerType:q,srcEvent:n})}}});function ue(e,n){var s=_t(e.touches),a=_t(e.changedTouches);return n&(b|O)&&(s=k(s.concat(a),"identifier",!0)),[s,a]}var Ae={touchstart:y,touchmove:K,touchend:b,touchcancel:O},Me="touchstart touchmove touchend touchcancel";function Pt(){this.evTarget=Me,this.targetIds={},w.apply(this,arguments)}N(Pt,w,{handler:function(n){var s=Ae[n.type],a=Ne.call(this,n,s);a&&this.callback(this.manager,s,{pointers:a[0],changedPointers:a[1],pointerType:q,srcEvent:n})}});function Ne(e,n){var s=_t(e.touches),a=this.targetIds;if(n&(y|K)&&s.length===1)return a[s[0].identifier]=!0,[s,s];var h,d,E=_t(e.changedTouches),I=[],M=this.target;if(d=s.filter(function(L){return Jt(L.target,M)}),n===y)for(h=0;h-1&&a.splice(d,1)};setTimeout(h,we)}}function De(e){for(var n=e.srcEvent.clientX,s=e.srcEvent.clientY,a=0;a-1&&this.requireFail.splice(n,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var n=this,s=this.state;function a(h){n.manager.emit(h,e)}s=Z&&a(n.options.event+Re(s))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=j},canEmit:function(){for(var e=0;en.threshold&&h&n.direction},attrTest:function(e){return i.prototype.attrTest.call(this,e)&&(this.state&D||!(this.state&D)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var n=me(e.direction);n&&(e.additionalEvent=this.options.event+n),this._super.emit.call(this,e)}});function r(){i.apply(this,arguments)}N(r,i,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[et]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&D)},emit:function(e){if(e.scale!==1){var n=e.scale<1?"in":"out";e.additionalEvent=this.options.event+n}this._super.emit.call(this,e)}});function l(){Y.apply(this,arguments),this._timer=null,this._input=null}N(l,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[de]},process:function(e){var n=this.options,s=e.pointers.length===n.pointers,a=e.distancen.time;if(this._input=e,!a||!s||e.eventType&(b|O)&&!h)this.reset();else if(e.eventType&y)this.reset(),this._timer=Mt(function(){this.state=H,this.tryEmit()},n.time,this);else if(e.eventType&b)return H;return j},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===H&&(e&&e.eventType&b?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=At(),this.manager.emit(this.options.event,this._input)))}});function u(){i.apply(this,arguments)}N(u,i,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[et]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&D)}});function c(){i.apply(this,arguments)}N(c,i,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:F|J,pointers:1},getTouchAction:function(){return o.prototype.getTouchAction.call(this)},attrTest:function(e){var n=this.options.direction,s;return n&(F|J)?s=e.overallVelocity:n&F?s=e.overallVelocityX:n&J&&(s=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&G(s)>this.options.velocity&&e.eventType&b},emit:function(e){var n=me(e.offsetDirection);n&&this.manager.emit(this.options.event+n,e),this.manager.emit(this.options.event,e)}});function m(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}N(m,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[mt]},process:function(e){var n=this.options,s=e.pointers.length===n.pointers,a=e.distance(_pushScopeId("data-v-47958124"),t=t(),_popScopeId(),t),ze={class:"ui header tw-flex tw-items-center tw-justify-between"},P=["datetime"],Gt=["datetime"],ge={class:"ui dropdown jump",id:"repo-contributors"},Te={class:"ui basic compact button"},it={class:"not-mobile"},G={class:"menu"},At={class:"tw-flex ui segment main-graph"},Mt={key:0,class:"gt-tc tw-m-auto"},ot={key:0},X={key:1,class:"text red"},Bt={class:"contributor-grid"},z={class:"ui top attached header tw-flex tw-flex-1"},qt={class:"ui right"},ye=["href"],N=["src"],Nt={class:"tw-ml-2"},wt=["href"],Kt={key:1,class:"contributor-name"},yt={class:"tw-text-12 tw-flex tw-gap-1"},Et={key:0},Jt={key:1,class:"text green"},B={key:2,class:"text red"},xt={class:"ui attached segment"};function st(t,i,o,r,l,u){const c=(0,f.g2)("svg-icon"),m=(0,f.g2)("SvgIcon"),v=(0,f.g2)("ChartLine");return(0,f.uX)(),(0,f.CE)("div",null,[(0,f.Lk)("div",ze,[(0,f.Lk)("div",null,[t.xAxisMin>0?((0,f.uX)(),(0,f.CE)("relative-time",{key:0,format:"datetime",year:"numeric",month:"short",day:"numeric",weekday:"",datetime:new Date(t.xAxisMin)},(0,x.v_)(new Date(t.xAxisMin)),9,P)):(0,f.Q3)("v-if",!0),(0,f.eW)(" "+(0,x.v_)(t.isLoading?o.locale.loadingTitle:t.errorText?o.locale.loadingTitleFailed:"-")+" ",1),t.xAxisMax>0?((0,f.uX)(),(0,f.CE)("relative-time",{key:1,format:"datetime",year:"numeric",month:"short",day:"numeric",weekday:"",datetime:new Date(t.xAxisMax)},(0,x.v_)(new Date(t.xAxisMax)),9,Gt)):(0,f.Q3)("v-if",!0)]),(0,f.Lk)("div",null,[(0,f.Q3)(" Contribution type "),(0,f.Lk)("div",ge,[(0,f.Lk)("div",Te,[(0,f.Lk)("span",it,(0,x.v_)(o.locale.filterLabel),1),(0,f.eW)(),(0,f.Lk)("strong",null,(0,x.v_)(o.locale.contributionType[t.type]),1),(0,f.bF)(c,{name:"octicon-triangle-down",size:14})]),(0,f.Lk)("div",G,[(0,f.Lk)("div",{class:(0,x.C4)(["item",{selected:t.type==="commits"}]),"data-value":"commits"},(0,x.v_)(o.locale.contributionType.commits),3),(0,f.Lk)("div",{class:(0,x.C4)(["item",{selected:t.type==="additions"}]),"data-value":"additions"},(0,x.v_)(o.locale.contributionType.additions),3),(0,f.Lk)("div",{class:(0,x.C4)(["item",{selected:t.type==="deletions"}]),"data-value":"deletions"},(0,x.v_)(o.locale.contributionType.deletions),3)])])])]),(0,f.Lk)("div",At,[t.isLoading||t.errorText!==""?((0,f.uX)(),(0,f.CE)("div",Mt,[t.isLoading?((0,f.uX)(),(0,f.CE)("div",ot,[(0,f.bF)(m,{name:"octicon-sync",class:"tw-mr-2 job-status-rotate"}),(0,f.eW)(" "+(0,x.v_)(o.locale.loadingInfo),1)])):((0,f.uX)(),(0,f.CE)("div",X,[(0,f.bF)(m,{name:"octicon-x-circle-fill"}),(0,f.eW)(" "+(0,x.v_)(t.errorText),1)]))])):(0,f.Q3)("v-if",!0),Object.keys(t.totalStats).length!==0?(0,f.bU)([t.totalStats.weeks,t.type],()=>((0,f.uX)(),(0,f.Wv)(v,{key:1,data:u.toGraphData(t.totalStats.weeks),options:u.getOptions("main")},null,8,["data","options"])),i,0):(0,f.Q3)("v-if",!0)]),(0,f.Lk)("div",Bt,[((0,f.uX)(!0),(0,f.CE)(f.FK,null,(0,f.pI)(t.sortedContributors,(p,g,S,_)=>{const R=[t.sortedContributors,t.type];if(_&&_.key===g&&(0,f.Bs)(_,R))return _;const W=((0,f.uX)(),(0,f.CE)("div",{key:g},[(0,f.Lk)("div",z,[(0,f.Lk)("b",qt,"#"+(0,x.v_)(g+1),1),(0,f.Lk)("a",{href:p.home_link},[(0,f.Lk)("img",{class:"ui avatar tw-align-middle",height:"40",width:"40",src:p.avatar_link},null,8,N)],8,ye),(0,f.Lk)("div",Nt,[p.home_link!==""?((0,f.uX)(),(0,f.CE)("a",{key:0,href:p.home_link},[(0,f.Lk)("h4",null,(0,x.v_)(p.name),1)],8,wt)):((0,f.uX)(),(0,f.CE)("h4",Kt,(0,x.v_)(p.name),1)),(0,f.Lk)("p",yt,[p.total_commits?((0,f.uX)(),(0,f.CE)("strong",Et,(0,x.v_)(p.total_commits.toLocaleString())+" "+(0,x.v_)(o.locale.contributionType.commits),1)):(0,f.Q3)("v-if",!0),p.total_additions?((0,f.uX)(),(0,f.CE)("strong",Jt,(0,x.v_)(p.total_additions.toLocaleString())+"++ ",1)):(0,f.Q3)("v-if",!0),p.total_deletions?((0,f.uX)(),(0,f.CE)("strong",B,(0,x.v_)(p.total_deletions.toLocaleString())+"--",1)):(0,f.Q3)("v-if",!0)])])]),(0,f.Lk)("div",xt,[(0,f.Lk)("div",null,[(0,f.bF)(v,{data:u.toGraphData(p.weeks),options:u.getOptions("contributor")},null,8,["data","options"])])])]));return W.memo=R,W},i,1),128))])])}var _t=C("./web_src/js/svg.js"),k=C("./node_modules/chart.js/dist/chart.js"),bt=C("./web_src/js/modules/fetch.js"),Ee=C("./node_modules/hammerjs/hammer.js"),lt=C.n(Ee),T=C("./node_modules/chart.js/dist/chunks/helpers.segment.js");const ut=t=>t&&t.enabled&&t.modifierKey,Lt=(t,i)=>t&&i[t+"Key"],Dt=(t,i)=>t&&!i[t+"Key"];function V(t,i,o){return t===void 0?!0:typeof t=="string"?t.indexOf(i)!==-1:typeof t=="function"?t({chart:o}).indexOf(i)!==-1:!1}function q(t,i){return typeof t=="function"&&(t=t({chart:i})),typeof t=="string"?{x:t.indexOf("x")!==-1,y:t.indexOf("y")!==-1}:{x:!1,y:!1}}function xe(t,i){let o;return function(){return clearTimeout(o),o=setTimeout(t,i),i}}function kt({x:t,y:i},o){const r=o.scales,l=Object.keys(r);for(let u=0;u=c.top&&i<=c.bottom&&t>=c.left&&t<=c.right)return c}return null}function $t(t,i,o){const{mode:r="xy",scaleMode:l,overScaleMode:u}=t||{},c=kt(i,o),m=q(r,o),v=q(l,o);if(u){const g=q(u,o);for(const S of["x","y"])g[S]&&(v[S]=m[S],m[S]=!1)}if(c&&v[c.axis])return[c];const p=[];return(0,T.F)(o.scales,function(g){m[g.axis]&&p.push(g)}),p}const Rt=new WeakMap;function y(t){let i=Rt.get(t);return i||(i={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{}},Rt.set(t,i)),i}function K(t){Rt.delete(t)}function b(t,i,o){const r=t.max-t.min,l=r*(i-1),u=t.isHorizontal()?o.x:o.y,c=Math.max(0,Math.min(1,(t.getValueForPixel(u)-t.min)/r||0)),m=1-c;return{min:l*c,max:l*m}}function O(t,i,o,r,l){let u=o[r];if(u==="original"){const c=t.originalScaleLimits[i.id][r];u=(0,T.v)(c.options,c.scale)}return(0,T.v)(u,l)}function St(t,i,o){const r=t.getValueForPixel(i),l=t.getValueForPixel(o);return{min:Math.min(r,l),max:Math.max(r,l)}}function U(t,{min:i,max:o},r,l=!1){const u=y(t.chart),{id:c,axis:m,options:v}=t,p=r&&(r[c]||r[m])||{},{minRange:g=0}=p,S=O(u,t,p,"min",-1/0),_=O(u,t,p,"max",1/0),R=l?Math.max(o-i,g):t.max-t.min,W=(R-o+i)/2;return i-=W,o+=W,i_&&(o=_,i=Math.max(_-R,S)),v.min=i,v.max=o,u.updatedScaleLimits[t.id]={min:i,max:o},t.parse(i)!==t.min||t.parse(o)!==t.max}function ct(t,i,o,r){const l=b(t,i,o),u={min:t.min+l.min,max:t.max-l.max};return U(t,u,r,!0)}function ht(t,i,o,r){U(t,St(t,i,o),r,!0)}const rt=t=>t===0||isNaN(t)?0:t<0?Math.min(Math.round(t),-1):Math.max(Math.round(t),1);function F(t){const o=t.getLabels().length-1;t.min>0&&(t.min-=1),t.maxv&&(u=Math.max(0,u-p),c=m===1?u:u+m,g=u===0),U(t,{min:u,max:c},o)||g}const Ct={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function w(t,i,o,r=!1){const{min:l,max:u,options:c}=t,m=c.time&&c.time.round,v=Ct[m]||0,p=t.getValueForPixel(t.getPixelForValue(l+v)-i),g=t.getValueForPixel(t.getPixelForValue(u+v)-i),{min:S=-1/0,max:_=1/0}=r&&o&&o[t.axis]||{};return isNaN(p)||isNaN(g)||p_?!0:U(t,{min:p,max:g},o,r)}function ne(t,i,o){return w(t,i,o,!0)}const zt={category:J,default:ct},Ut={default:ht},Ft={category:ee,default:w,logarithmic:ne,timeseries:ne};function _e(t,i,o){const{id:r,options:{min:l,max:u}}=t;if(!i[r]||!o[r])return!0;const c=o[r];return c.min!==l||c.max!==u}function jt(t,i){(0,T.F)(t,(o,r)=>{i[r]||delete t[r]})}function $(t,i){const{scales:o}=t,{originalScaleLimits:r,updatedScaleLimits:l}=i;return(0,T.F)(o,function(u){_e(u,r,l)&&(r[u.id]={min:{scale:u.min,options:u.options.min},max:{scale:u.max,options:u.options.max}})}),jt(r,o),jt(l,o),r}function Xt(t,i,o,r){const l=zt[t.type]||zt.default;(0,T.Q)(l,[t,i,o,r])}function Ht(t,i,o,r,l){const u=Ut[t.type]||Ut.default;(0,T.Q)(u,[t,i,o,r,l])}function It(t){const i=t.chartArea;return{x:(i.left+i.right)/2,y:(i.top+i.bottom)/2}}function ft(t,i,o="none"){const{x:r=1,y:l=1,focalPoint:u=It(t)}=typeof i=="number"?{x:i,y:i}:i,c=y(t),{options:{limits:m,zoom:v}}=c;$(t,c);const p=r!==1,g=l!==1,S=$t(v,u,t);(0,T.F)(S||t.scales,function(_){_.isHorizontal()&&p?Xt(_,r,u,m):!_.isHorizontal()&&g&&Xt(_,l,u,m)}),t.update(o),(0,T.Q)(v.onZoom,[{chart:t}])}function ie(t,i,o,r="none"){const l=y(t),{options:{limits:u,zoom:c}}=l,{mode:m="xy"}=c;$(t,l);const v=V(m,"x",t),p=V(m,"y",t);(0,T.F)(t.scales,function(g){g.isHorizontal()&&v?Ht(g,i.x,o.x,u):!g.isHorizontal()&&p&&Ht(g,i.y,o.y,u)}),t.update(r),(0,T.Q)(c.onZoom,[{chart:t}])}function be(t,i,o,r="none"){$(t,y(t));const l=t.scales[i];U(l,o,void 0,!0),t.update(r)}function Se(t,i="default"){const o=y(t),r=$(t,o);(0,T.F)(t.scales,function(l){const u=l.options;r[l.id]?(u.min=r[l.id].min.options,u.max=r[l.id].max.options):(delete u.min,delete u.max)}),t.update(i),(0,T.Q)(o.options.zoom.onZoomComplete,[{chart:t}])}function Ce(t,i){const o=t.originalScaleLimits[i];if(!o)return;const{min:r,max:l}=o;return(0,T.v)(l.options,l.scale)-(0,T.v)(r.options,r.scale)}function Ie(t){const i=y(t);let o=1,r=1;return(0,T.F)(t.scales,function(l){const u=Ce(i,l.id);if(u){const c=Math.round(u/(l.max-l.min)*100)/100;o=Math.min(o,c),r=Math.max(r,c)}}),o<1?o:r}function dt(t,i,o,r){const{panDelta:l}=r,u=l[t.id]||0;(0,T.s)(u)===(0,T.s)(i)&&(i+=u);const c=Ft[t.type]||Ft.default;(0,T.Q)(c,[t,i,o])?l[t.id]=0:l[t.id]=i}function oe(t,i,o,r="none"){const{x:l=0,y:u=0}=typeof i=="number"?{x:i,y:i}:i,c=y(t),{options:{pan:m,limits:v}}=c,{onPan:p}=m||{};$(t,c);const g=l!==0,S=u!==0;(0,T.F)(o||t.scales,function(_){_.isHorizontal()&&g?dt(_,l,v,c):!_.isHorizontal()&&S&&dt(_,u,v,c)}),t.update(r),(0,T.Q)(p,[{chart:t}])}function se(t){const i=y(t);$(t,i);const o={};for(const r of Object.keys(t.scales)){const{min:l,max:u}=i.originalScaleLimits[r]||{min:{},max:{}};o[r]={min:l.scale,max:u.scale}}return o}function re(t){const i=se(t);for(const o of Object.keys(t.scales)){const{min:r,max:l}=i[o];if(r!==void 0&&t.scales[o].min!==r||l!==void 0&&t.scales[o].max!==l)return!0}return!1}function A(t,i){const{handlers:o}=y(t),r=o[i];r&&r.target&&(r.target.removeEventListener(i,r),delete o[i])}function tt(t,i,o,r){const{handlers:l,options:u}=y(t),c=l[o];c&&c.target===i||(A(t,o),l[o]=m=>r(t,m,u),l[o].target=i,i.addEventListener(o,l[o]))}function Pe(t,i){const o=y(t);o.dragStart&&(o.dragging=!0,o.dragEnd=i,t.update("none"))}function Oe(t,i){const o=y(t);!o.dragStart||i.key!=="Escape"||(A(t,"keydown"),o.dragging=!1,o.dragStart=o.dragEnd=null,t.update("none"))}function ae(t,i,o){const{onZoomStart:r,onZoomRejected:l}=o;if(r){const u=(0,T.z)(i,t);if((0,T.Q)(r,[{chart:t,event:i,point:u}])===!1)return(0,T.Q)(l,[{chart:t,event:i}]),!1}}function le(t,i){const o=y(t),{pan:r,zoom:l={}}=o.options;if(i.button!==0||Lt(ut(r),i)||Dt(ut(l.drag),i))return(0,T.Q)(l.onZoomRejected,[{chart:t,event:i}]);ae(t,i,l)!==!1&&(o.dragStart=i,tt(t,t.canvas,"mousemove",Pe),tt(t,window.document,"keydown",Oe))}function ue(t,i,o,r){const l=V(i,"x",t),u=V(i,"y",t);let{top:c,left:m,right:v,bottom:p,width:g,height:S}=t.chartArea;const _=(0,T.z)(o,t),R=(0,T.z)(r,t);l&&(m=Math.min(_.x,R.x),v=Math.max(_.x,R.x)),u&&(c=Math.min(_.y,R.y),p=Math.max(_.y,R.y));const W=v-m,e=p-c;return{left:m,top:c,right:v,bottom:p,width:W,height:e,zoomX:l&&W?1+(g-W)/g:1,zoomY:u&&e?1+(S-e)/S:1}}function Ae(t,i){const o=y(t);if(!o.dragStart)return;A(t,"mousemove");const{mode:r,onZoomComplete:l,drag:{threshold:u=0}}=o.options.zoom,c=ue(t,r,o.dragStart,i),m=V(r,"x",t)?c.width:0,v=V(r,"y",t)?c.height:0,p=Math.sqrt(m*m+v*v);if(o.dragStart=o.dragEnd=null,p<=u){o.dragging=!1,t.update("none");return}ie(t,{x:c.left,y:c.top},{x:c.right,y:c.bottom},"zoom"),setTimeout(()=>o.dragging=!1,500),(0,T.Q)(l,[{chart:t}])}function Me(t,i,o){if(Dt(ut(o.wheel),i)){(0,T.Q)(o.onZoomRejected,[{chart:t,event:i}]);return}if(ae(t,i,o)!==!1&&(i.cancelable&&i.preventDefault(),i.deltaY!==void 0))return!0}function Pt(t,i){const{handlers:{onZoomComplete:o},options:{zoom:r}}=y(t);if(!Me(t,i,r))return;const l=i.target.getBoundingClientRect(),u=1+(i.deltaY>=0?-r.wheel.speed:r.wheel.speed),c={x:u,y:u,focalPoint:{x:i.clientX-l.left,y:i.clientY-l.top}};ft(t,c),o&&o()}function Ne(t,i,o,r){o&&(y(t).handlers[i]=xe(()=>(0,T.Q)(o,[{chart:t}]),r))}function we(t,i){const o=t.canvas,{wheel:r,drag:l,onZoomComplete:u}=i.zoom;r.enabled?(tt(t,o,"wheel",Pt),Ne(t,"onZoomComplete",u,250)):A(t,"wheel"),l.enabled?(tt(t,o,"mousedown",le),tt(t,o.ownerDocument,"mouseup",Ae)):(A(t,"mousedown"),A(t,"mousemove"),A(t,"mouseup"),A(t,"keydown"))}function ce(t){A(t,"mousedown"),A(t,"mousemove"),A(t,"mouseup"),A(t,"wheel"),A(t,"click"),A(t,"keydown")}function Yt(t,i){return function(o,r){const{pan:l,zoom:u={}}=i.options;if(!l||!l.enabled)return!1;const c=r&&r.srcEvent;return c&&!i.panning&&r.pointerType==="mouse"&&(Dt(ut(l),c)||Lt(ut(u.drag),c))?((0,T.Q)(l.onPanRejected,[{chart:t,event:r}]),!1):!0}}function Le(t,i){const o=Math.abs(t.clientX-i.clientX),r=Math.abs(t.clientY-i.clientY),l=o/r;let u,c;return l>.3&&l<1.7?u=c=!0:o>r?u=!0:c=!0,{x:u,y:c}}function Wt(t,i,o){if(i.scale){const{center:r,pointers:l}=o,u=1/i.scale*o.scale,c=o.target.getBoundingClientRect(),m=Le(l[0],l[1]),v=i.options.zoom.mode,p={x:m.x&&V(v,"x",t)?u:1,y:m.y&&V(v,"y",t)?u:1,focalPoint:{x:r.x-c.left,y:r.y-c.top}};ft(t,p),i.scale=o.scale}}function De(t,i){i.options.zoom.pinch.enabled&&(i.scale=1)}function he(t,i,o){i.scale&&(Wt(t,i,o),i.scale=null,(0,T.Q)(i.options.zoom.onZoomComplete,[{chart:t}]))}function Vt(t,i,o){const r=i.delta;r&&(i.panning=!0,oe(t,{x:o.deltaX-r.x,y:o.deltaY-r.y},i.panScales),i.delta={x:o.deltaX,y:o.deltaY})}function fe(t,i,o){const{enabled:r,onPanStart:l,onPanRejected:u}=i.options.pan;if(!r)return;const c=o.target.getBoundingClientRect(),m={x:o.center.x-c.left,y:o.center.y-c.top};if((0,T.Q)(l,[{chart:t,event:o,point:m}])===!1)return(0,T.Q)(u,[{chart:t,event:o}]);i.panScales=$t(i.options.pan,m,t),i.delta={x:0,y:0},clearTimeout(i.panEndTimeout),Vt(t,i,o)}function de(t,i){i.delta=null,i.panning&&(i.panEndTimeout=setTimeout(()=>i.panning=!1,500),(0,T.Q)(i.options.pan.onPanComplete,[{chart:t}]))}const mt=new WeakMap;function et(t,i){const o=y(t),r=t.canvas,{pan:l,zoom:u}=i,c=new(lt()).Manager(r);u&&u.pinch.enabled&&(c.add(new(lt()).Pinch),c.on("pinchstart",()=>De(t,o)),c.on("pinch",m=>Wt(t,o,m)),c.on("pinchend",m=>he(t,o,m))),l&&l.enabled&&(c.add(new(lt()).Pan({threshold:l.threshold,enable:Yt(t,o)})),c.on("panstart",m=>fe(t,o,m)),c.on("panmove",m=>Vt(t,o,m)),c.on("panend",()=>de(t,o))),mt.set(t,c)}function pt(t){const i=mt.get(t);i&&(i.remove("pinchstart"),i.remove("pinch"),i.remove("pinchend"),i.remove("panstart"),i.remove("pan"),i.remove("panend"),i.destroy(),mt.delete(t))}var vt="2.0.1";function nt(t,i,o){const r=o.zoom.drag,{dragStart:l,dragEnd:u}=y(t);if(r.drawTime!==i||!u)return;const{left:c,top:m,width:v,height:p}=ue(t,o.zoom.mode,l,u),g=t.ctx;g.save(),g.beginPath(),g.fillStyle=r.backgroundColor||"rgba(225,225,225,0.3)",g.fillRect(c,m,v,p),r.borderWidth>0&&(g.lineWidth=r.borderWidth,g.strokeStyle=r.borderColor||"rgba(225,225,225)",g.strokeRect(c,m,v,p)),g.restore()}var Zt={id:"zoom",version:vt,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(t,i,o){const r=y(t);r.options=o,Object.prototype.hasOwnProperty.call(o.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(o.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(o.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),lt()&&et(t,o),t.pan=(l,u,c)=>oe(t,l,u,c),t.zoom=(l,u)=>ft(t,l,u),t.zoomRect=(l,u,c)=>ie(t,l,u,c),t.zoomScale=(l,u,c)=>be(t,l,u,c),t.resetZoom=l=>Se(t,l),t.getZoomLevel=()=>Ie(t),t.getInitialScaleBounds=()=>se(t),t.isZoomedOrPanned=()=>re(t)},beforeEvent(t){const i=y(t);if(i.panning||i.dragging)return!1},beforeUpdate:function(t,i,o){const r=y(t);r.options=o,we(t,o)},beforeDatasetsDraw(t,i,o){nt(t,"beforeDatasetsDraw",o)},afterDatasetsDraw(t,i,o){nt(t,"afterDatasetsDraw",o)},beforeDraw(t,i,o){nt(t,"beforeDraw",o)},afterDraw(t,i,o){nt(t,"afterDraw",o)},stop:function(t){ce(t),lt()&&pt(t),K(t)},panFunctions:Ft,zoomFunctions:zt,zoomRectFunctions:Ut},ke=C("./node_modules/vue-chartjs/dist/index.js"),Ot=C("./web_src/js/utils/time.js"),at=C("./web_src/js/utils/color.js"),D=C("./web_src/js/utils.js"),gt=C("./node_modules/chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm.js"),Z=C("./node_modules/jquery/dist/jquery.js"),H=C.n(Z);const Tt={id:"customEventListener",afterEvent:(t,i,o)=>{i.event.type==="dblclick"&&o.chartType==="main"&&!i.replay&&(t.resetZoom(),o.instance.updateOtherCharts(i.event,!0))}};k.t1.defaults.color=at.K.text,k.t1.defaults.borderColor=at.K.border,k.t1.register(k.UA,k.kc,k.E8,k.hE,k.FN,k.No,k.dN,Zt,Tt);var j={components:{ChartLine:ke.N1,SvgIcon:_t.Ah},props:{locale:{type:Object,required:!0},repoLink:{type:String,required:!0}},data:()=>({isLoading:!1,errorText:"",totalStats:{},sortedContributors:{},type:"commits",contributorsStats:[],xAxisStart:null,xAxisEnd:null,xAxisMin:null,xAxisMax:null}),mounted(){this.fetchGraphData(),H()("#repo-contributors").dropdown({onChange:t=>{this.xAxisMin=this.xAxisStart,this.xAxisMax=this.xAxisEnd,this.type=t,this.sortContributors()}})},methods:{sortContributors(){const t=this.filterContributorWeeksByDateRange(),i=`total_${this.type}`;this.sortedContributors=Object.values(t).filter(o=>o[i]!==0).sort((o,r)=>o[i]>r[i]?-1:o[i]===r[i]?0:1).slice(0,100)},async fetchGraphData(){this.isLoading=!0;try{let t;do t=await(0,bt.fG)(`${this.repoLink}/activity/contributors/data`),t.status===202&&await(0,D.yy)(1e3);while(t.status===202);if(t.ok){const i=await t.json(),{total:o,...r}=i;o.weeks=Object.fromEntries(Object.entries(o.weeks).sort());const l=Object.values(o.weeks);this.xAxisStart=l[0].week,this.xAxisEnd=(0,Ot.Z1)(new Date);const u=(0,Ot.Ex)(this.xAxisStart,this.xAxisEnd);o.weeks=(0,Ot.a$)(u,o.weeks),this.xAxisMin=this.xAxisStart,this.xAxisMax=this.xAxisEnd,this.contributorsStats={};for(const[c,m]of Object.entries(r))m.weeks=(0,Ot.a$)(u,m.weeks),this.contributorsStats[c]=m;this.sortContributors(),this.totalStats=o,this.errorText=""}else this.errorText=t.statusText}catch(t){this.errorText=t.message}finally{this.isLoading=!1}},filterContributorWeeksByDateRange(){const t={},i=this.contributorsStats;for(const o of Object.keys(i)){const r=i[o];r.total_commits=0,r.total_additions=0,r.total_deletions=0,r.max_contribution_type=0;const l=r.weeks.filter(u=>u.week>=this.xAxisMin-6048e5&&u.week<=this.xAxisMax+6048e5?(r.total_commits+=u.commits,r.total_additions+=u.additions,r.total_deletions+=u.deletions,u[this.type]>r.max_contribution_type&&(r.max_contribution_type=u[this.type]),!0):!1);r.max_contribution_type+=1,t[o]={...r,weeks:l}}return t},maxMainGraph(){const t=Math.max(...this.totalStats.weeks.map(r=>r[this.type])),[i,o]=t.toExponential().split("e").map(Number);return i%1===0?t:(1-i%1)*10**o+t},maxContributorGraph(){const t=Math.max(...this.sortedContributors.map(r=>r.max_contribution_type)),[i,o]=t.toExponential().split("e").map(Number);return i%1===0?t:(1-i%1)*10**o+t},toGraphData(t){return{datasets:[{data:t.map(i=>({x:i.week,y:i[this.type]})),pointRadius:0,pointHitRadius:0,fill:"start",backgroundColor:at.K[this.type],borderWidth:0,tension:.3}]}},updateOtherCharts(t,i){const o=t.chart.options.scales.x.min,r=t.chart.options.scales.x.max;i?(this.xAxisMin=this.xAxisStart,this.xAxisMax=this.xAxisEnd,this.sortContributors()):o&&(this.xAxisMin=o,this.xAxisMax=r,this.sortContributors())},getOptions(t){return{responsive:!0,maintainAspectRatio:!1,animation:!1,events:["mousemove","mouseout","click","touchstart","touchmove","dblclick"],plugins:{title:{display:t==="main",text:"drag: zoom, shift+drag: pan, double click: reset zoom",position:"top",align:"center"},customEventListener:{chartType:t,instance:this},zoom:{pan:{enabled:!0,modifierKey:"shift",mode:"x",threshold:20,onPanComplete:this.updateOtherCharts},limits:{x:{min:"original",max:"original",minRange:2*7*24*60*60*1e3}},zoom:{drag:{enabled:t==="main"},pinch:{enabled:t==="main"},mode:"x",onZoomComplete:this.updateOtherCharts}}},scales:{x:{min:this.xAxisMin,max:this.xAxisMax,type:"time",grid:{display:!1},time:{minUnit:"month"},ticks:{maxRotation:0,maxTicksLimit:t==="main"?12:6}},y:{min:0,max:t==="main"?this.maxMainGraph():this.maxContributorGraph(),ticks:{maxTicksLimit:t==="main"?6:4}}}}}}},Y=C("./node_modules/vue-loader/dist/exportHelper.js"),me=(0,Y.A)(j,[["render",st],["__scopeId","data-v-47958124"]])}}]);