%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/985914/root/data/old/home/stash/stash-home/tmp/webresources/
Upload File :
Create Path :
Current File : //proc/985914/root/data/old/home/stash/stash-home/tmp/webresources/71.cachedfile

;/* module-key = 'com.atlassian.stash.stash-web-plugin:client-storage', location = '/static/util/client-storage.js' */
define("util/client-storage",["jquery","lodash","util/feature-detect","model/page-state","exports"],function(F,Y,P,M,Z){var U={SESSION:"session",LOCAL:"local"};var O="_flash.";var L="_",R="lastCleanup",I="hasCheckedCleanUp",T=1000*60*60*24*30;var W={};Z._resetDummy=function(){W={}};function A(b,a){if(Y.isString(b)){b=[b]}if(!Y.isArray(b)){throw new Error("keyBuilder requires an array of components")}if(a){b.push(a);switch(a){case"pull-request":b.push(M.getPullRequest()&&M.getPullRequest().getId());case"repo":b.push(M.getRepository()&&M.getRepository().getSlug());case"project":b.push(M.getProject()&&M.getProject().getKey());case"user":b.push(M.getCurrentUser()&&M.getCurrentUser().getName());break}}return b.join(L)}function Q(b,c){var e,d;if(P.localStorage()){e=window[(c||U.LOCAL)+"Storage"].getItem(b)}else{e=Y.has(W,b)?W[b]:null}try{d=JSON.parse(e)}catch(a){d=e}return d}function K(a,b){var c=Q(a,b);return F.isPlainObject(c)&&Y.has(c,"data")?c.data:c}function N(a){return K(a,U.SESSION)}function H(a){var b=K(O+a,U.SESSION);G(a);return b}function D(a,c,b){if(P.localStorage()){window[(b||U.LOCAL)+"Storage"].setItem(a,JSON.stringify(c))}else{W[a]=JSON.stringify(c)}}function C(a,e,d,b){var c=Y.extend({},d,{timestamp:new Date().getTime(),data:e});D(a,c,b);if(!b||b===U.LOCAL){Y.defer(J)}}function B(a,c,b){C.call(this,a,c,b,U.SESSION)}function S(a,c,b){C.call(this,O+a,c,b,U.SESSION)}function V(a,b){if(P.localStorage()){window[(b||U.LOCAL)+"Storage"].removeItem(a)}else{delete W[a]}}function E(a){V(a,U.SESSION)}function G(a){V(O+a,U.SESSION)}function J(){if(!!Q(I,U.SESSION)){return }var a=Q(R);if(!a||new Date().getTime()-a>T){X()}D(I,true,U.SESSION)}function X(){var a=new Date().getTime();Y.each(Y.keys(localStorage),function(b){if(b!==R){var c=Q(b);if(c&&c.timestamp&&!c.noCleanup&&(a-c.timestamp>T)){V(b)}}});D(R,new Date().getTime())}Z.LOCAL=U.LOCAL;Z.SESSION=U.SESSION;Z.buildKey=A;Z.getItem=K;Z.getFlashItem=H;Z.getSessionItem=N;Z.setItem=C;Z.setFlashItem=S;Z.setSessionItem=B;Z.removeItem=V;Z.removeFlashItem=G;Z.removeSessionItem=E});;
;/* module-key = 'com.atlassian.auiplugin:aui-experimental-progress-indicator', location = 'js/aui-experimental-progress-indicator.js' */
(function(){function A(B,D,C){AJS._internal.animation.recomputeStyle(B);B.css("width",C*100+"%");D.attr("data-value",C)}AJS.progressBars={update:function(G,M){var C=AJS.$(G).first();var F=C.children(".aui-progress-indicator-value");var L=F.attr("data-value")||0;var K="aui-progress-indicator-after-update";var I="aui-progress-indicator-before-update";var D="transitionend webkitTransitionEnd";var E=!C.attr("data-value");if(E){F.css("width",0)}if(typeof M==="number"&&M<=1&&M>=0){C.trigger(I,[L,M]);var H=document.body||document.documentElement;var B=H.style;var J="transition";if(typeof B.transition==="string"||typeof B.WebkitTransition==="string"){F.one(D,function(){C.trigger(K,[L,M])});A(F,C,M)}else{A(F,C,M);C.trigger(K,[L,M])}}return C},setIndeterminate:function(D){var C=AJS.$(D).first();var B=C.children(".aui-progress-indicator-value");C.removeAttr("data-value");AJS._internal.animation.recomputeStyle(C);B.css("width","100%")}}}());;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/lib/d3.min.js' */
!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function r(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function o(){}function a(n){return ia+n in this}function c(n){return n=ia+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===oa&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===oa)return!1;return!0}function h(){}function g(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function p(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=aa.length;r>e;++e){var u=aa[e]+t;if(u in n)return u}}function v(){}function d(){}function m(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new o;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function y(){Zo.event.preventDefault()}function x(){for(var n,t=Zo.event;n=t.sourceEvent;)t=n;return t}function M(n){for(var t=new d,e=0,r=arguments.length;++e<r;)t[arguments[e]]=m(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=Zo.event;u.target=n,Zo.event=u,t[u.type].apply(e,r)}finally{Zo.event=i}}},t}function _(n){return sa(n,pa),n}function b(n){return"function"==typeof n?n:function(){return la(n,this)}}function w(n){return"function"==typeof n?n:function(){return fa(n,this)}}function S(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=Zo.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function k(n){return n.trim().replace(/\s+/g," ")}function E(n){return new RegExp("(?:^|\\s+)"+Zo.requote(n)+"(?:\\s+|$)","g")}function A(n){return(n+"").trim().split(/^|\s+/)}function C(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=A(n).map(N);var u=n.length;return"function"==typeof t?r:e}function N(n){var t=E(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",k(u+" "+n))):e.setAttribute("class",k(u.replace(t," ")))}}function z(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function L(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function T(n){return"function"==typeof n?n:(n=Zo.ns.qualify(n)).local?function(){return this.ownerDocument.createElementNS(n.space,n.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,n)}}function q(n){return{__data__:n}}function R(n){return function(){return ga(this,n)}}function D(t){return arguments.length||(t=n),function(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}}function P(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function U(n){return sa(n,da),n}function j(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function H(){var n=this.__transition__;n&&++n.active}function F(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,Xo(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+Zo.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),c=O;a>0&&(n=n.substring(0,a));var s=ya.get(n);return s&&(n=s,c=Y),a?t?u:r:t?v:i}function O(n,t){return function(e){var r=Zo.event;Zo.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{Zo.event=r}}}function Y(n,t){var e=O(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function I(){var n=".dragsuppress-"+ ++Ma,t="click"+n,e=Zo.select(Wo).on("touchmove"+n,y).on("dragstart"+n,y).on("selectstart"+n,y);if(xa){var r=Bo.style,u=r[xa];r[xa]="none"}return function(i){function o(){e.on(t,null)}e.on(n,null),xa&&(r[xa]=u),i&&(e.on(t,function(){y(),o()},!0),setTimeout(o,0))}}function Z(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>_a&&(Wo.scrollX||Wo.scrollY)){e=Zo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e[0][0].getScreenCTM();_a=!(u.f||u.e),e.remove()}return _a?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function V(){return Zo.event.changedTouches[0].identifier}function X(){return Zo.event.target}function $(){return Wo}function B(n){return n>0?1:0>n?-1:0}function W(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function J(n){return n>1?0:-1>n?ba:Math.acos(n)}function G(n){return n>1?Sa:-1>n?-Sa:Math.asin(n)}function K(n){return((n=Math.exp(n))-1/n)/2}function Q(n){return((n=Math.exp(n))+1/n)/2}function nt(n){return((n=Math.exp(2*n))-1)/(n+1)}function tt(n){return(n=Math.sin(n/2))*n}function et(){}function rt(n,t,e){return this instanceof rt?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof rt?new rt(n.h,n.s,n.l):mt(""+n,yt,rt):new rt(n,t,e)}function ut(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new gt(u(n+120),u(n),u(n-120))}function it(n,t,e){return this instanceof it?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof it?new it(n.h,n.c,n.l):n instanceof at?st(n.l,n.a,n.b):st((n=xt((n=Zo.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new it(n,t,e)}function ot(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new at(e,Math.cos(n*=Aa)*t,Math.sin(n)*t)}function at(n,t,e){return this instanceof at?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof at?new at(n.l,n.a,n.b):n instanceof it?ot(n.l,n.c,n.h):xt((n=gt(n)).r,n.g,n.b):new at(n,t,e)}function ct(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=lt(u)*ja,r=lt(r)*Ha,i=lt(i)*Fa,new gt(ht(3.2404542*u-1.5371385*r-.4985314*i),ht(-.969266*u+1.8760108*r+.041556*i),ht(.0556434*u-.2040259*r+1.0572252*i))}function st(n,t,e){return n>0?new it(Math.atan2(e,t)*Ca,Math.sqrt(t*t+e*e),n):new it(0/0,0/0,n)}function lt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function ft(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function ht(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function gt(n,t,e){return this instanceof gt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof gt?new gt(n.r,n.g,n.b):mt(""+n,gt,ut):new gt(n,t,e)}function pt(n){return new gt(n>>16,255&n>>8,255&n)}function vt(n){return pt(n)+""}function dt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function mt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(_t(u[0]),_t(u[1]),_t(u[2]))}return(i=Ia.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.substring(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function yt(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new rt(r,u,c)}function xt(n,t,e){n=Mt(n),t=Mt(t),e=Mt(e);var r=ft((.4124564*n+.3575761*t+.1804375*e)/ja),u=ft((.2126729*n+.7151522*t+.072175*e)/Ha),i=ft((.0193339*n+.119192*t+.9503041*e)/Fa);return at(116*u-16,500*(r-u),200*(u-i))}function Mt(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function _t(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function bt(n){return"function"==typeof n?n:function(){return n}}function wt(n){return n}function St(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),kt(t,e,n,r)}}function kt(n,t,e,r){function u(){var n,t=c.status;if(!t&&c.responseText||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return o.error.call(i,r),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=Zo.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,s=null;return!Wo.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=Zo.event;Zo.event=n;try{o.progress.call(i,c)}finally{Zo.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(s=n,i):s},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(Xo(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var l in a)c.setRequestHeader(l,a[l]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=s&&(c.responseType=s),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},Zo.rebind(i,o,"on"),null==r?i:i.get(Et(r))}function Et(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function At(){var n=Ct(),t=Nt()-n;t>24?(isFinite(t)&&(clearTimeout($a),$a=setTimeout(At,t)),Xa=0):(Xa=1,Wa(At))}function Ct(){var n=Date.now();for(Ba=Za;Ba;)n>=Ba.t&&(Ba.f=Ba.c(n-Ba.t)),Ba=Ba.n;return n}function Nt(){for(var n,t=Za,e=1/0;t;)t.f?t=n?n.n=t.n:Za=t.n:(t.t<e&&(e=t.t),t=(n=t).n);return Va=n,e}function zt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Lt(n,t){var e=Math.pow(10,3*ua(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Tt(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r?function(n){for(var t=n.length,u=[],i=0,o=r[0];t>0&&o>0;)u.push(n.substring(t-=o,t+o)),o=r[i=(i+1)%r.length];return u.reverse().join(e)}:wt;return function(n){var e=Ga.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"",c=e[4]||"",s=e[5],l=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1;switch(h&&(h=+h.substring(1)),(s||"0"===r&&"="===o)&&(s=r="0",o="=",f&&(l-=Math.floor((l-1)/4))),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=Ka.get(g)||qt;var y=s&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):a;if(0>p){var c=Zo.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x=n.lastIndexOf("."),M=0>x?n:n.substring(0,x),_=0>x?"":t+n.substring(x+1);!s&&f&&(M=i(M));var b=v.length+M.length+_.length+(y?0:u.length),w=l>b?new Array(b=l-b+1).join(r):"";return y&&(M=i(w+M)),u+=v,n=M+_,("<"===o?u+n+w:">"===o?w+u+n:"^"===o?w.substring(0,b>>=1)+u+n+w.substring(b):u+(y?n:w+n))+e}}}function qt(n){return n+""}function Rt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Dt(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new nc(e-1)),1),e}function i(n,e){return t(n=new nc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{nc=Rt;var r=new Rt;return r._=n,o(r,t,e)}finally{nc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Pt(n);return c.floor=c,c.round=Pt(r),c.ceil=Pt(u),c.offset=Pt(i),c.range=a,n}function Pt(n){return function(t,e){try{nc=Rt;var r=new Rt;return r._=t,n(r,e)._}finally{nc=Date}}}function Ut(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.substring(c,a)),null!=(u=ec[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=C[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.substring(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&nc!==Rt,o=new(i?Rt:nc);return"j"in r?o.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+Math.floor(r.Z/100),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,o,a=0,c=t.length,s=e.length;c>a;){if(r>=s)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=N[o in ec?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){b.lastIndex=0;var r=b.exec(t.substring(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){M.lastIndex=0;var r=M.exec(t.substring(e));return r?(n.w=_.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.substring(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.substring(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,C.c.toString(),t,r)}function c(n,t,r){return e(n,C.x.toString(),t,r)}function s(n,t,r){return e(n,C.X.toString(),t,r)}function l(n,t,e){var r=x.get(t.substring(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{nc=Rt;var t=new nc;return t._=n,r(t)}finally{nc=Date}}var r=t(n);return e.parse=function(n){try{nc=Rt;var t=r.parse(n);return t&&t._}finally{nc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=re;var x=Zo.map(),M=Ht(v),_=Ft(v),b=Ht(d),w=Ft(d),S=Ht(m),k=Ft(m),E=Ht(y),A=Ft(y);p.forEach(function(n,t){x.set(n.toLowerCase(),t)});var C={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return jt(n.getDate(),t,2)},e:function(n,t){return jt(n.getDate(),t,2)},H:function(n,t){return jt(n.getHours(),t,2)},I:function(n,t){return jt(n.getHours()%12||12,t,2)},j:function(n,t){return jt(1+Qa.dayOfYear(n),t,3)},L:function(n,t){return jt(n.getMilliseconds(),t,3)},m:function(n,t){return jt(n.getMonth()+1,t,2)},M:function(n,t){return jt(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return jt(n.getSeconds(),t,2)},U:function(n,t){return jt(Qa.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return jt(Qa.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return jt(n.getFullYear()%100,t,2)},Y:function(n,t){return jt(n.getFullYear()%1e4,t,4)},Z:te,"%":function(){return"%"}},N={a:r,A:u,b:i,B:o,c:a,d:Wt,e:Wt,H:Gt,I:Gt,j:Jt,L:ne,m:Bt,M:Kt,p:l,S:Qt,U:Yt,w:Ot,W:It,x:c,X:s,y:Vt,Y:Zt,Z:Xt,"%":ee};return t}function jt(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Ht(n){return new RegExp("^(?:"+n.map(Zo.requote).join("|")+")","i")}function Ft(n){for(var t=new o,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Ot(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Yt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e));return r?(n.U=+r[0],e+r[0].length):-1}function It(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e));return r?(n.W=+r[0],e+r[0].length):-1}function Zt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Vt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.y=$t(+r[0]),e+r[0].length):-1}function Xt(n,t,e){return/^[+-]\d{4}$/.test(t=t.substring(e,e+5))?(n.Z=-t,e+5):-1}function $t(n){return n+(n>68?1900:2e3)}function Bt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Wt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Jt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function Gt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function Kt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function Qt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ne(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function te(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=~~(ua(t)/60),u=ua(t)%60;return e+jt(r,"0",2)+jt(u,"0",2)}function ee(n,t,e){uc.lastIndex=0;var r=uc.exec(t.substring(e,e+1));return r?e+r[0].length:-1}function re(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ue(){}function ie(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function oe(n,t){n&&cc.hasOwnProperty(n.type)&&cc[n.type](n,t)}function ae(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function ce(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)ae(n[e],t,1);t.polygonEnd()}function se(){function n(n,t){n*=Aa,t=t*Aa/2+ba/4;var e=n-r,o=e>=0?1:-1,a=o*e,c=Math.cos(t),s=Math.sin(t),l=i*s,f=u*c+l*Math.cos(a),h=l*o*Math.sin(a);lc.add(Math.atan2(h,f)),r=n,u=c,i=s}var t,e,r,u,i;fc.point=function(o,a){fc.point=n,r=(t=o)*Aa,u=Math.cos(a=(e=a)*Aa/2+ba/4),i=Math.sin(a)},fc.lineEnd=function(){n(t,e)}}function le(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function fe(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function he(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function ge(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function pe(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function ve(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function de(n){return[Math.atan2(n[1],n[0]),G(n[2])]}function me(n,t){return ua(n[0]-t[0])<ka&&ua(n[1]-t[1])<ka}function ye(n,t){n*=Aa;var e=Math.cos(t*=Aa);xe(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function xe(n,t,e){++hc,pc+=(n-pc)/hc,vc+=(t-vc)/hc,dc+=(e-dc)/hc}function Me(){function n(n,u){n*=Aa;var i=Math.cos(u*=Aa),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),s=Math.atan2(Math.sqrt((s=e*c-r*a)*s+(s=r*o-t*c)*s+(s=t*a-e*o)*s),t*o+e*a+r*c);gc+=s,mc+=s*(t+(t=o)),yc+=s*(e+(e=a)),xc+=s*(r+(r=c)),xe(t,e,r)}var t,e,r;wc.point=function(u,i){u*=Aa;var o=Math.cos(i*=Aa);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),wc.point=n,xe(t,e,r)}}function _e(){wc.point=ye}function be(){function n(n,t){n*=Aa;var e=Math.cos(t*=Aa),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),s=u*c-i*a,l=i*o-r*c,f=r*a-u*o,h=Math.sqrt(s*s+l*l+f*f),g=r*o+u*a+i*c,p=h&&-J(g)/h,v=Math.atan2(h,g);Mc+=p*s,_c+=p*l,bc+=p*f,gc+=v,mc+=v*(r+(r=o)),yc+=v*(u+(u=a)),xc+=v*(i+(i=c)),xe(r,u,i)}var t,e,r,u,i;wc.point=function(o,a){t=o,e=a,wc.point=n,o*=Aa;var c=Math.cos(a*=Aa);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),xe(r,u,i)},wc.lineEnd=function(){n(t,e),wc.lineEnd=_e,wc.point=ye}}function we(){return!0}function Se(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(me(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return u.lineEnd(),void 0}var c=new Ee(e,n,null,!0),s=new Ee(e,null,c,!1);c.o=s,i.push(c),o.push(s),c=new Ee(r,n,null,!1),s=new Ee(r,null,c,!0),c.o=s,i.push(c),o.push(s)}}),o.sort(t),ke(i),ke(o),i.length){for(var a=0,c=e,s=o.length;s>a;++a)o[a].e=c=!c;for(var l,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;l=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,s=l.length;s>a;++a)u.point((f=l[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){l=g.p.z;for(var a=l.length-1;a>=0;--a)u.point((f=l[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,l=g.z,p=!p}while(!g.v);u.lineEnd()}}}function ke(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function Ee(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Ae(n,t,e,r){return function(u,i){function o(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function a(n,t){var e=u(n,t);d.point(e[0],e[1])}function c(){y.point=a,d.lineStart()}function s(){y.point=o,d.lineEnd()}function l(n,t){v.push([n,t]);var e=u(n,t);M.point(e[0],e[1])}function f(){M.lineStart(),v=[]}function h(){l(v[0][0],v[0][1]),M.lineEnd();var n,t=M.clean(),e=x.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,o=-1;if(r>0){for(_||(i.polygonStart(),_=!0),i.lineStart();++o<r;)i.point((u=n[o])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Ce))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:s,polygonStart:function(){y.point=l,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=s,g=Zo.merge(g);var n=Le(m,p);g.length?(_||(i.polygonStart(),_=!0),Se(g,ze,n,e,i)):n&&(_||(i.polygonStart(),_=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),_&&(i.polygonEnd(),_=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},x=Ne(),M=t(x),_=!1;return y}}function Ce(n){return n.length>1}function Ne(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:v,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function ze(n,t){return((n=n.x)[0]<0?n[1]-Sa-ka:Sa-n[1])-((t=t.x)[0]<0?t[1]-Sa-ka:Sa-t[1])}function Le(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;lc.reset();for(var a=0,c=t.length;c>a;++a){var s=t[a],l=s.length;if(l)for(var f=s[0],h=f[0],g=f[1]/2+ba/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===l&&(d=0),n=s[d];var m=n[0],y=n[1]/2+ba/4,x=Math.sin(y),M=Math.cos(y),_=m-h,b=_>=0?1:-1,w=b*_,S=w>ba,k=p*x;if(lc.add(Math.atan2(k*b*Math.sin(w),v*M+k*Math.cos(w))),i+=S?_+b*wa:_,S^h>=e^m>=e){var E=he(le(f),le(n));ve(E);var A=he(u,E);ve(A);var C=(S^_>=0?-1:1)*G(A[2]);(r>C||r===C&&(E[0]||E[1]))&&(o+=S^_>=0?1:-1)}if(!d++)break;h=m,p=x,v=M,f=n}}return(-ka>i||ka>i&&0>lc)^1&o}function Te(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?ba:-ba,c=ua(i-e);ua(c-ba)<ka?(n.point(e,r=(r+o)/2>0?Sa:-Sa),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=ba&&(ua(e-u)<ka&&(e-=u*ka),ua(i-a)<ka&&(i-=a*ka),r=qe(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function qe(n,t,e,r){var u,i,o=Math.sin(n-e);return ua(o)>ka?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function Re(n,t,e,r){var u;if(null==n)u=e*Sa,r.point(-ba,u),r.point(0,u),r.point(ba,u),r.point(ba,0),r.point(ba,-u),r.point(0,-u),r.point(-ba,-u),r.point(-ba,0),r.point(-ba,u);else if(ua(n[0]-t[0])>ka){var i=n[0]<t[0]?ba:-ba;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function De(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,s,l;return{lineStart:function(){s=c=!1,l=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?ba:-ba),h):0;if(!e&&(s=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(me(e,g)||me(p,g))&&(p[0]+=ka,p[1]+=ka,v=t(p[0],p[1]))),v!==c)l=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(l=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&me(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return l|(s&&c)<<1}}}function r(n,t,e){var r=le(n),u=le(t),o=[1,0,0],a=he(r,u),c=fe(a,a),s=a[0],l=c-s*s;if(!l)return!e&&n;var f=i*c/l,h=-i*s/l,g=he(o,a),p=pe(o,f),v=pe(a,h);ge(p,v);var d=g,m=fe(p,d),y=fe(d,d),x=m*m-y*(fe(p,p)-1);if(!(0>x)){var M=Math.sqrt(x),_=pe(d,(-m-M)/y);if(ge(_,p),_=de(_),!e)return _;var b,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(b=w,w=S,S=b);var A=S-w,C=ua(A-ba)<ka,N=C||ka>A;if(!C&&k>E&&(b=k,k=E,E=b),N?C?k+E>0^_[1]<(ua(_[0]-w)<ka?k:E):k<=_[1]&&_[1]<=E:A>ba^(w<=_[0]&&_[0]<=S)){var z=pe(d,(-m+M)/y);return ge(z,p),[_,de(z)]}}}function u(t,e){var r=o?n:ba-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=ua(i)>ka,c=sr(n,6*Aa);return Ae(t,e,c,o?[0,-n]:[-ba,n-ba])}function Pe(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,s=o.y,l=a.x,f=a.y,h=0,g=1,p=l-c,v=f-s;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-s,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-s,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:s+h*v}),1>g&&(u.b={x:c+g*p,y:s+g*v}),u}}}}}}function Ue(n,t,e,r){function u(r,u){return ua(r[0]-n)<ka?u>0?0:3:ua(r[0]-e)<ka?u>0?2:1:ua(r[1]-t)<ka?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,s=a[0];c>o;++o)i=a[o],s[1]<=r?i[1]>r&&W(s,i,n)>0&&++t:i[1]<=r&&W(s,i,n)<0&&--t,s=i;return 0!==t}function s(i,a,c,s){var l=0,f=0;if(null==i||(l=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do s.point(0===l||3===l?n:e,l>1?r:t);while((l=(l+c+4)%4)!==f)}else s.point(a[0],a[1])}function l(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){l(n,t)&&a.point(n,t)}function h(){N.point=p,d&&d.push(m=[]),S=!0,w=!1,_=b=0/0}function g(){v&&(p(y,x),M&&w&&A.rejoin(),v.push(A.buffer())),N.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-kc,Math.min(kc,n)),t=Math.max(-kc,Math.min(kc,t));var e=l(n,t);if(d&&m.push([n,t]),S)y=n,x=t,M=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:_,y:b},b:{x:n,y:t}};C(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}_=n,b=t,w=e}var v,d,m,y,x,M,_,b,w,S,k,E=a,A=Ne(),C=Pe(n,t,e,r),N={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=Zo.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),u&&Se(v,i,t,s,a),a.polygonEnd()),v=d=m=null}};return N}}function je(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function He(n){var t=0,e=ba/3,r=tr(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*ba/180,e=n[1]*ba/180):[180*(t/ba),180*(e/ba)]},u}function Fe(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,G((i-(n*n+e*e)*u*u)/(2*u))]},e}function Oe(){function n(n,t){Ac+=u*n-r*t,r=n,u=t}var t,e,r,u;Tc.point=function(i,o){Tc.point=n,t=r=i,e=u=o},Tc.lineEnd=function(){n(t,e)}}function Ye(n,t){Cc>n&&(Cc=n),n>zc&&(zc=n),Nc>t&&(Nc=t),t>Lc&&(Lc=t)}function Ie(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=Ze(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=Ze(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Ze(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Ve(n,t){pc+=n,vc+=t,++dc}function Xe(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);mc+=o*(t+n)/2,yc+=o*(e+r)/2,xc+=o,Ve(t=n,e=r)}var t,e;Rc.point=function(r,u){Rc.point=n,Ve(t=r,e=u)}}function $e(){Rc.point=Ve}function Be(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);mc+=o*(r+n)/2,yc+=o*(u+t)/2,xc+=o,o=u*n-r*t,Mc+=o*(r+n),_c+=o*(u+t),bc+=3*o,Ve(r=n,u=t)}var t,e,r,u;Rc.point=function(i,o){Rc.point=n,Ve(t=r=i,e=u=o)},Rc.lineEnd=function(){n(t,e)}}function We(n){function t(t,e){n.moveTo(t,e),n.arc(t,e,o,0,wa)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:v};return a}function Je(n){function t(n){return(a?r:e)(n)}function e(t){return Qe(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){x=0/0,S.point=i,t.lineStart()}function i(e,r){var i=le([e,r]),o=n(e,r);u(x,M,y,_,b,w,x=o[0],M=o[1],y=e,_=i[0],b=i[1],w=i[2],a,t),t.point(x,M)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=s,S.lineEnd=l}function s(n,t){i(f=n,h=t),g=x,p=M,v=_,d=b,m=w,S.point=i}function l(){u(x,M,y,_,b,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,x,M,_,b,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,s,l,f,h,g,p,v,d,m){var y=l-t,x=f-e,M=y*y+x*x;if(M>4*i&&d--){var _=a+g,b=c+p,w=s+v,S=Math.sqrt(_*_+b*b+w*w),k=Math.asin(w/=S),E=ua(ua(w)-1)<ka||ua(r-h)<ka?(r+h)/2:Math.atan2(b,_),A=n(E,k),C=A[0],N=A[1],z=C-t,L=N-e,T=x*z-y*L;(T*T/M>i||ua((y*z+x*L)/M-.5)>.3||o>a*g+c*p+s*v)&&(u(t,e,r,a,c,s,C,N,E,_/=S,b/=S,w,d,m),m.point(C,N),u(C,N,E,_,b,w,l,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Aa),a=16;
return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function Ge(n){var t=Je(function(t,e){return n([t*Ca,e*Ca])});return function(n){return er(t(n))}}function Ke(n){this.stream=n}function Qe(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function nr(n){return tr(function(){return n})()}function tr(n){function t(n){return n=a(n[0]*Aa,n[1]*Aa),[n[0]*h+c,s-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(s-n[1])/h),n&&[n[0]*Ca,n[1]*Ca]}function r(){a=je(o=ir(m,y,x),i);var n=i(v,d);return c=g-n[0]*h,s=p+n[1]*h,u()}function u(){return l&&(l.valid=!1,l=null),t}var i,o,a,c,s,l,f=Je(function(n,t){return n=i(n,t),[n[0]*h+c,s-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,y=0,x=0,M=Sc,_=wt,b=null,w=null;return t.stream=function(n){return l&&(l.valid=!1),l=er(M(o,f(_(n)))),l.valid=!0,l},t.clipAngle=function(n){return arguments.length?(M=null==n?(b=n,Sc):De((b=+n)*Aa),u()):b},t.clipExtent=function(n){return arguments.length?(w=n,_=n?Ue(n[0][0],n[0][1],n[1][0],n[1][1]):wt,u()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Aa,d=n[1]%360*Aa,r()):[v*Ca,d*Ca]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Aa,y=n[1]%360*Aa,x=n.length>2?n[2]%360*Aa:0,r()):[m*Ca,y*Ca,x*Ca]},Zo.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function er(n){return Qe(n,function(t,e){n.point(t*Aa,e*Aa)})}function rr(n,t){return[n,t]}function ur(n,t){return[n>ba?n-wa:-ba>n?n+wa:n,t]}function ir(n,t,e){return n?t||e?je(ar(n),cr(t,e)):ar(n):t||e?cr(t,e):ur}function or(n){return function(t,e){return t+=n,[t>ba?t-wa:-ba>t?t+wa:t,e]}}function ar(n){var t=or(n);return t.invert=or(-n),t}function cr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,s=Math.sin(t),l=s*r+a*u;return[Math.atan2(c*i-l*o,a*r-s*u),G(l*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,s=Math.sin(t),l=s*i-c*o;return[Math.atan2(c*i+s*o,a*r+l*u),G(l*r-a*u)]},e}function sr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=lr(e,u),i=lr(e,i),(o>0?i>u:u>i)&&(u+=o*wa)):(u=n+o*wa,i=n-.5*c);for(var s,l=u;o>0?l>i:i>l;l-=c)a.point((s=de([e,-r*Math.cos(l),-r*Math.sin(l)]))[0],s[1])}}function lr(n,t){var e=le(t);e[0]-=n,ve(e);var r=J(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-ka)%(2*Math.PI)}function fr(n,t,e){var r=Zo.range(n,t-ka,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function hr(n,t,e){var r=Zo.range(n,t-ka,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function gr(n){return n.source}function pr(n){return n.target}function vr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),s=u*Math.sin(n),l=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(tt(r-t)+u*o*tt(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*l,u=e*s+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Ca,Math.atan2(o,Math.sqrt(r*r+u*u))*Ca]}:function(){return[n*Ca,t*Ca]};return p.distance=h,p}function dr(){function n(n,u){var i=Math.sin(u*=Aa),o=Math.cos(u),a=ua((n*=Aa)-t),c=Math.cos(a);Dc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Pc.point=function(u,i){t=u*Aa,e=Math.sin(i*=Aa),r=Math.cos(i),Pc.point=n},Pc.lineEnd=function(){Pc.point=Pc.lineEnd=v}}function mr(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function yr(n,t){function e(n,t){o>0?-Sa+ka>t&&(t=-Sa+ka):t>Sa-ka&&(t=Sa-ka);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(ba/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=B(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Sa]},e):Mr}function xr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return ua(u)<ka?rr:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-B(u)*Math.sqrt(n*n+e*e)]},e)}function Mr(n,t){return[n,Math.log(Math.tan(ba/4+t/2))]}function _r(n){var t,e=nr(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=ba*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function br(n,t){return[Math.log(Math.tan(ba/4+t/2)),-n]}function wr(n){return n[0]}function Sr(n){return n[1]}function kr(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&W(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function Er(n,t){return n[0]-t[0]||n[1]-t[1]}function Ar(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Cr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],s=e[1],l=t[1]-c,f=r[1]-s,h=(a*(c-s)-f*(u-i))/(f*o-a*l);return[u+h*o,c+h*l]}function Nr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function zr(){Gr(this),this.edge=this.site=this.circle=null}function Lr(n){var t=Bc.pop()||new zr;return t.site=n,t}function Tr(n){Yr(n),Vc.remove(n),Bc.push(n),Gr(n)}function qr(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Tr(n);for(var c=i;c.circle&&ua(e-c.circle.x)<ka&&ua(r-c.circle.cy)<ka;)i=c.P,a.unshift(c),Tr(c),c=i;a.unshift(c),Yr(c);for(var s=o;s.circle&&ua(e-s.circle.x)<ka&&ua(r-s.circle.cy)<ka;)o=s.N,a.push(s),Tr(s),s=o;a.push(s),Yr(s);var l,f=a.length;for(l=1;f>l;++l)s=a[l],c=a[l-1],Br(s.edge,c.site,s.site,u);c=a[0],s=a[f-1],s.edge=Xr(c.site,s.site,null,u),Or(c),Or(s)}function Rr(n){for(var t,e,r,u,i=n.x,o=n.y,a=Vc._;a;)if(r=Dr(a,o)-i,r>ka)a=a.L;else{if(u=i-Pr(a,o),!(u>ka)){r>-ka?(t=a.P,e=a):u>-ka?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Lr(n);if(Vc.insert(t,c),t||e){if(t===e)return Yr(t),e=Lr(t.site),Vc.insert(c,e),c.edge=e.edge=Xr(t.site,c.site),Or(t),Or(e),void 0;if(!e)return c.edge=Xr(t.site,c.site),void 0;Yr(t),Yr(e);var s=t.site,l=s.x,f=s.y,h=n.x-l,g=n.y-f,p=e.site,v=p.x-l,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,x=v*v+d*d,M={x:(d*y-g*x)/m+l,y:(h*x-v*y)/m+f};Br(e.edge,s,p,M),c.edge=Xr(s,n,null,M),e.edge=Xr(n,p,null,M),Or(t),Or(e)}}function Dr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,s=c-t;if(!s)return a;var l=a-r,f=1/i-1/s,h=l/s;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*s)-c+s/2+u-i/2)))/f+r:(r+a)/2}function Pr(n,t){var e=n.N;if(e)return Dr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ur(n){this.site=n,this.edges=[]}function jr(n){for(var t,e,r,u,i,o,a,c,s,l,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=Zc,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)l=a[o].end(),r=l.x,u=l.y,s=a[++o%c].start(),t=s.x,e=s.y,(ua(r-t)>ka||ua(u-e)>ka)&&(a.splice(o,0,new Wr($r(i.site,l,ua(r-f)<ka&&p-u>ka?{x:f,y:ua(t-f)<ka?e:p}:ua(u-p)<ka&&h-r>ka?{x:ua(e-p)<ka?t:h,y:p}:ua(r-h)<ka&&u-g>ka?{x:h,y:ua(t-h)<ka?e:g}:ua(u-g)<ka&&r-f>ka?{x:ua(e-g)<ka?t:f,y:g}:null),i.site,null)),++c)}function Hr(n,t){return t.angle-n.angle}function Fr(){Gr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Or(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var o=u.x,a=u.y,c=r.x-o,s=r.y-a,l=i.x-o,f=i.y-a,h=2*(c*f-s*l);if(!(h>=-Ea)){var g=c*c+s*s,p=l*l+f*f,v=(f*g-s*p)/h,d=(c*p-l*g)/h,f=d+a,m=Wc.pop()||new Fr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,x=$c._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}$c.insert(y,m),y||(Xc=m)}}}}function Yr(n){var t=n.circle;t&&(t.P||(Xc=t.N),$c.remove(t),Wc.push(t),Gr(t),n.circle=null)}function Ir(n){for(var t,e=Ic,r=Pe(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Zr(t,n)||!r(t)||ua(t.a.x-t.b.x)<ka&&ua(t.a.y-t.b.y)<ka)&&(t.a=t.b=null,e.splice(u,1))}function Zr(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],s=t[1][1],l=n.l,f=n.r,h=l.x,g=l.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(o>d||d>=a)return;if(h>p){if(i){if(i.y>=s)return}else i={x:d,y:c};e={x:d,y:s}}else{if(i){if(i.y<c)return}else i={x:d,y:s};e={x:d,y:c}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=s)return}else i={x:(c-u)/r,y:c};e={x:(s-u)/r,y:s}}else{if(i){if(i.y<c)return}else i={x:(s-u)/r,y:s};e={x:(c-u)/r,y:c}}else if(v>g){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.x<o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}return n.a=i,n.b=e,!0}function Vr(n,t){this.l=n,this.r=t,this.a=this.b=null}function Xr(n,t,e,r){var u=new Vr(n,t);return Ic.push(u),e&&Br(u,n,t,e),r&&Br(u,t,n,r),Zc[n.i].edges.push(new Wr(u,n,t)),Zc[t.i].edges.push(new Wr(u,t,n)),u}function $r(n,t,e){var r=new Vr(n,null);return r.a=t,r.b=e,Ic.push(r),r}function Br(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function Wr(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function Jr(){this._=null}function Gr(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function Kr(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Qr(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function nu(n){for(;n.L;)n=n.L;return n}function tu(n,t){var e,r,u,i=n.sort(eu).pop();for(Ic=[],Zc=new Array(n.length),Vc=new Jr,$c=new Jr;;)if(u=Xc,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(Zc[i.i]=new Ur(i),Rr(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;qr(u.arc)}t&&(Ir(t),jr(t));var o={cells:Zc,edges:Ic};return Vc=$c=Ic=Zc=null,o}function eu(n,t){return t.y-n.y||t.x-n.x}function ru(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function uu(n){return n.x}function iu(n){return n.y}function ou(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function au(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&au(n,c[0],e,r,o,a),c[1]&&au(n,c[1],o,r,u,a),c[2]&&au(n,c[2],e,a,o,i),c[3]&&au(n,c[3],o,a,u,i)}}function cu(n,t){n=Zo.rgb(n),t=Zo.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+dt(Math.round(e+i*n))+dt(Math.round(r+o*n))+dt(Math.round(u+a*n))}}function su(n,t){var e,r={},u={};for(e in n)e in t?r[e]=hu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function lu(n,t){return t-=n=+n,function(e){return n+t*e}}function fu(n,t){var e,r,u,i=Gc.lastIndex=Kc.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=Gc.exec(n))&&(r=Kc.exec(t));)(u=r.index)>i&&(u=t.substring(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:lu(e,r)})),i=Kc.lastIndex;return i<t.length&&(u=t.substring(i),a[o]?a[o]+=u:a[++o]=u),a.length<2?c[0]?(t=c[0].x,function(n){return t(n)+""}):function(){return t}:(t=c.length,function(n){for(var e,r=0;t>r;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function hu(n,t){for(var e,r=Zo.interpolators.length;--r>=0&&!(e=Zo.interpolators[r](n,t)););return e}function gu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(hu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function pu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function vu(n){return function(t){return 1-n(1-t)}}function du(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function mu(n){return n*n}function yu(n){return n*n*n}function xu(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Mu(n){return function(t){return Math.pow(t,n)}}function _u(n){return 1-Math.cos(n*Sa)}function bu(n){return Math.pow(2,10*(n-1))}function wu(n){return 1-Math.sqrt(1-n*n)}function Su(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/wa*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*wa/t)}}function ku(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Eu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Au(n,t){n=Zo.hcl(n),t=Zo.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ot(e+i*n,r+o*n,u+a*n)+""}}function Cu(n,t){n=Zo.hsl(n),t=Zo.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ut(e+i*n,r+o*n,u+a*n)+""}}function Nu(n,t){n=Zo.lab(n),t=Zo.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function zu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Lu(n){var t=[n.a,n.b],e=[n.c,n.d],r=qu(t),u=Tu(t,e),i=qu(Ru(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Ca,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Ca:0}function Tu(n,t){return n[0]*t[0]+n[1]*t[1]}function qu(n){var t=Math.sqrt(Tu(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Ru(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Du(n,t){var e,r=[],u=[],i=Zo.transform(n),o=Zo.transform(t),a=i.translate,c=o.translate,s=i.rotate,l=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:lu(a[0],c[0])},{i:3,x:lu(a[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),s!=l?(s-l>180?l+=360:l-s>180&&(s+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:lu(s,l)})):l&&r.push(r.pop()+"rotate("+l+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:lu(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:lu(g[0],p[0])},{i:e-2,x:lu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Pu(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return(e-n)*t}}function Uu(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return Math.max(0,Math.min(1,(e-n)*t))}}function ju(n){for(var t=n.source,e=n.target,r=Fu(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Hu(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Fu(n,t){if(n===t)return n;for(var e=Hu(n),r=Hu(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function Ou(n){n.fixed|=2}function Yu(n){n.fixed&=-7}function Iu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Zu(n){n.fixed&=-5}function Vu(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(Vu(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var s=t*e[n.point.index];n.charge+=n.pointCharge=s,r+=s*n.point.x,u+=s*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function Xu(n,t){return Zo.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=Ku,n}function $u(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function Bu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++o<u;)e.push(i[o]);for(;null!=(n=r.pop());)t(n)}function Wu(n){return n.children}function Ju(n){return n.value}function Gu(n,t){return t.value-n.value}function Ku(n){return Zo.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function Qu(n){return n.x}function ni(n){return n.y}function ti(n,t,e){n.y0=t,n.y=e}function ei(n){return Zo.range(n.length)}function ri(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function ui(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function ii(n){return n.reduce(oi,0)}function oi(n,t){return n+t[1]}function ai(n,t){return ci(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function ci(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function si(n){return[Zo.min(n),Zo.max(n)]}function li(n,t){return n.value-t.value}function fi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function hi(n,t){n._pack_next=t,t._pack_prev=n}function gi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function pi(n){function t(n){l=Math.min(n.x-n.r,l),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(s=e.length)){var e,r,u,i,o,a,c,s,l=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(vi),r=e[0],r.x=-r.r,r.y=0,t(r),s>1&&(u=e[1],u.x=u.r,u.y=0,t(u),s>2))for(i=e[2],yi(r,u,i),t(i),fi(r,i),r._pack_prev=i,fi(i,u),u=r._pack_next,o=3;s>o;o++){yi(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(gi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!gi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?hi(r,u=a):hi(r=c,u),o--):(fi(r,i),u=i,t(i))}var m=(l+f)/2,y=(h+g)/2,x=0;for(o=0;s>o;o++)i=e[o],i.x-=m,i.y-=y,x=Math.max(x,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=x,e.forEach(di)}}function vi(n){n._pack_next=n._pack_prev=n}function di(n){delete n._pack_next,delete n._pack_prev}function mi(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)mi(u[i],t,e,r)}function yi(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),s=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+s*i,e.y=n.y+c*i-s*u}else e.x=n.x+r,e.y=n.y}function xi(n,t){return n.parent==t.parent?1:2}function Mi(n){var t=n.children;return t.length?t[0]:n.t}function _i(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function bi(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function wi(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Si(n,t,e){return n.a.parent===t.parent?n.a:e}function ki(n){return 1+Zo.max(n,function(n){return n.y})}function Ei(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Ai(n){var t=n.children;return t&&t.length?Ai(t[0]):n}function Ci(n){var t,e=n.children;return e&&(t=e.length)?Ci(e[t-1]):n}function Ni(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function zi(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Li(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Ti(n){return n.rangeExtent?n.rangeExtent():Li(n.range())}function qi(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Ri(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Di(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:ss}function Pi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=Zo.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Ui(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Pi:qi,c=r?Uu:Pu;return o=u(n,t,c,e),a=u(t,n,c,hu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(zu)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Oi(n,t)},i.tickFormat=function(t,e){return Yi(n,t,e)},i.nice=function(t){return Hi(n,t),u()},i.copy=function(){return Ui(n,t,e,r)},u()}function ji(n,t){return Zo.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Hi(n,t){return Ri(n,Di(Fi(n,t)[2]))}function Fi(n,t){null==t&&(t=10);var e=Li(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Oi(n,t){return Zo.range.apply(Zo,Fi(n,t))}function Yi(n,t,e){var r=Fi(n,t);if(e){var u=Ga.exec(e);if(u.shift(),"s"===u[8]){var i=Zo.formatPrefix(Math.max(ua(r[0]),ua(r[1])));return u[7]||(u[7]="."+Ii(i.scale(r[2]))),u[8]="f",e=Zo.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Zi(u[8],r)),e=u.join("")}else e=",."+Ii(r[2])+"f";return Zo.format(e)}function Ii(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Zi(n,t){var e=Ii(t[2]);return n in ls?Math.abs(e-Ii(Math.max(ua(t[0]),ua(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Vi(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Ri(r.map(u),e?Math:hs);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Li(r),o=[],a=n[0],c=n[1],s=Math.floor(u(a)),l=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(l-s)){if(e){for(;l>s;s++)for(var h=1;f>h;h++)o.push(i(s)*h);o.push(i(s))}else for(o.push(i(s));s++<l;)for(var h=f-1;h>0;h--)o.push(i(s)*h);for(s=0;o[s]<a;s++);for(l=o.length;o[l-1]>c;l--);o=o.slice(s,l)}return o},o.tickFormat=function(n,t){if(!arguments.length)return fs;arguments.length<2?t=fs:"function"!=typeof t&&(t=Zo.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Vi(n.copy(),t,e,r)},ji(o,n)}function Xi(n,t,e){function r(t){return n(u(t))}var u=$i(t),i=$i(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Oi(e,n)},r.tickFormat=function(n,t){return Yi(e,n,t)},r.nice=function(n){return r.domain(Hi(e,n))},r.exponent=function(o){return arguments.length?(u=$i(t=o),i=$i(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Xi(n.copy(),t,e)},ji(r,n)}function $i(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Bi(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return Zo.range(n.length).map(function(n){return t+e*n})}var u,i,a;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new o;for(var i,a=-1,c=r.length;++a<c;)u.has(i=r[a])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,a=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,o){arguments.length<2&&(o=0);var c=u[0],s=u[1],l=(s-c)/(Math.max(1,n.length-1)+o);return i=r(n.length<2?(c+s)/2:c+l*o/2,l),a=0,t={t:"rangePoints",a:arguments},e},e.rangeBands=function(u,o,c){arguments.length<2&&(o=0),arguments.length<3&&(c=o);var s=u[1]<u[0],l=u[s-0],f=u[1-s],h=(f-l)/(n.length-o+2*c);return i=r(l+h*c,h),s&&i.reverse(),a=h*(1-o),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,o,c){arguments.length<2&&(o=0),arguments.length<3&&(c=o);var s=u[1]<u[0],l=u[s-0],f=u[1-s],h=Math.floor((f-l)/(n.length-o+2*c)),g=f-l-(n.length-o)*h;return i=r(l+Math.round(g/2),h),s&&i.reverse(),a=Math.round(h*(1-o)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return a},e.rangeExtent=function(){return Li(t.a[0])},e.copy=function(){return Bi(n,t)},e.domain(n)}function Wi(e,r){function u(){var n=0,t=r.length;for(o=[];++n<t;)o[n-1]=Zo.quantile(e,n/t);return i}function i(n){return isNaN(n=+n)?void 0:r[Zo.bisect(o,n)]}var o;return i.domain=function(r){return arguments.length?(e=r.filter(t).sort(n),u()):e},i.range=function(n){return arguments.length?(r=n,u()):r},i.quantiles=function(){return o},i.invertExtent=function(n){return n=r.indexOf(n),0>n?[0/0,0/0]:[n>0?o[n-1]:e[0],n<o.length?o[n]:e[e.length-1]]},i.copy=function(){return Wi(e,r)},u()}function Ji(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return Ji(n,t,e)},u()}function Gi(n,t){function e(e){return e>=e?t[Zo.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return Gi(n,t)},e}function Ki(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Oi(n,t)},t.tickFormat=function(t,e){return Yi(n,t,e)},t.copy=function(){return Ki(n)},t}function Qi(n){return n.innerRadius}function no(n){return n.outerRadius}function to(n){return n.startAngle}function eo(n){return n.endAngle}function ro(n){function t(t){function o(){s.push("M",i(n(l),a))}for(var c,s=[],l=[],f=-1,h=t.length,g=bt(e),p=bt(r);++f<h;)u.call(this,c=t[f],f)?l.push([+g.call(this,c,f),+p.call(this,c,f)]):l.length&&(o(),l=[]);return l.length&&o(),s.length?s.join(""):null}var e=wr,r=Sr,u=we,i=uo,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=xs.get(n)||uo).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function uo(n){return n.join("L")}function io(n){return uo(n)+"Z"}function oo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function ao(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function co(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function so(n,t){return n.length<4?uo(n):n[1]+ho(n.slice(1,n.length-1),go(n,t))}function lo(n,t){return n.length<3?uo(n):n[0]+ho((n.push(n[0]),n),go([n[n.length-2]].concat(n,[n[1]]),t))}function fo(n,t){return n.length<3?uo(n):n[0]+ho(n,go(n,t))}function ho(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return uo(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var s=2;s<t.length;s++,c++)i=n[c],a=t[s],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var l=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+l[0]+","+l[1]}return r}function go(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function po(n){if(n.length<3)return uo(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",xo(bs,o),",",xo(bs,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Mo(c,o,a);return n.pop(),c.push("L",r),c.join("")}function vo(n){if(n.length<4)return uo(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(xo(bs,i)+","+xo(bs,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Mo(e,i,o);return e.join("")}function mo(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[xo(bs,o),",",xo(bs,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Mo(t,o,a);return t.join("")}function yo(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,s=-1;++s<=e;)r=n[s],u=s/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return po(n)}function xo(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Mo(n,t,e){n.push("C",xo(Ms,t),",",xo(Ms,e),",",xo(_s,t),",",xo(_s,e),",",xo(bs,t),",",xo(bs,e))}function _o(n,t){return(t[1]-n[1])/(t[0]-n[0])}function bo(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=_o(u,i);++t<e;)r[t]=(o+(o=_o(u=i,i=n[t+1])))/2;return r[t]=o,r}function wo(n){for(var t,e,r,u,i=[],o=bo(n),a=-1,c=n.length-1;++a<c;)t=_o(n[a],n[a+1]),ua(t)<ka?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function So(n){return n.length<3?uo(n):n[0]+ho(n,wo(n))}function ko(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]+ms,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Eo(n){function t(t){function c(){v.push("M",a(n(m),f),l,s(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,x=t.length,M=bt(e),_=bt(u),b=e===r?function(){return g}:bt(r),w=u===i?function(){return p}:bt(i);++y<x;)o.call(this,h=t[y],y)?(d.push([g=+M.call(this,h,y),p=+_.call(this,h,y)]),m.push([+b.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var e=wr,r=wr,u=0,i=Sr,o=we,a=uo,c=a.key,s=a,l="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=xs.get(n)||uo).key,s=a.reverse||a,l=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Ao(n){return n.radius}function Co(n){return[n.x,n.y]}function No(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]+ms;return[e*Math.cos(r),e*Math.sin(r)]}}function zo(){return 64}function Lo(){return"circle"}function To(n){var t=Math.sqrt(n/ba);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function qo(n,t){return sa(n,Cs),n.id=t,n}function Ro(n,t,e,r){var u=n.id;return P(n,"function"==typeof e?function(n,i,o){n.__transition__[u].tween.set(t,r(e.call(n,n.__data__,i,o)))}:(e=r(e),function(n){n.__transition__[u].tween.set(t,e)}))}function Do(n){return null==n&&(n=""),function(){this.textContent=n}}function Po(n,t,e,r){var u=n.__transition__||(n.__transition__={active:0,count:0}),i=u[e];if(!i){var a=r.time;i=u[e]={tween:new o,time:a,ease:r.ease,delay:r.delay,duration:r.duration},++u.count,Zo.timer(function(r){function o(r){return u.active>e?s():(u.active=e,i.event&&i.event.start.call(n,l,t),i.tween.forEach(function(e,r){(r=r.call(n,l,t))&&v.push(r)}),Zo.timer(function(){return p.c=c(r||1)?we:c,1},0,a),void 0)}function c(r){if(u.active!==e)return s();for(var o=r/g,a=f(o),c=v.length;c>0;)v[--c].call(n,a);
return o>=1?(i.event&&i.event.end.call(n,l,t),s()):void 0}function s(){return--u.count?delete u[e]:delete n.__transition__,1}var l=n.__data__,f=i.ease,h=i.delay,g=i.duration,p=Ba,v=[];return p.t=h+a,r>=h?o(r-h):(p.c=o,void 0)},0,a)}}function Uo(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function jo(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function Ho(n){return n.toISOString()}function Fo(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=Zo.bisect(Us,u);return i==Us.length?[t.year,Fi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Us[i-1]<Us[i]/u?i-1:i]:[Fs,Fi(n,e)[2]]}return r.invert=function(t){return Oo(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Oo)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Oo(+e+1),t).length}var i=r.domain(),o=Li(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Ri(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Oo(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Oo(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Li(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Oo(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Fo(n.copy(),t,e)},ji(r,n)}function Oo(n){return new Date(n)}function Yo(n){return JSON.parse(n.responseText)}function Io(n){var t=$o.createRange();return t.selectNode($o.body),t.createContextualFragment(n.responseText)}var Zo={version:"3.4.11"};Date.now||(Date.now=function(){return+new Date});var Vo=[].slice,Xo=function(n){return Vo.call(n)},$o=document,Bo=$o.documentElement,Wo=window;try{Xo(Bo.childNodes)[0].nodeType}catch(Jo){Xo=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}try{$o.createElement("div").style.setProperty("opacity",0,"")}catch(Go){var Ko=Wo.Element.prototype,Qo=Ko.setAttribute,na=Ko.setAttributeNS,ta=Wo.CSSStyleDeclaration.prototype,ea=ta.setProperty;Ko.setAttribute=function(n,t){Qo.call(this,n,t+"")},Ko.setAttributeNS=function(n,t,e){na.call(this,n,t,e+"")},ta.setProperty=function(n,t,e){ea.call(this,n,t+"",e)}}Zo.ascending=n,Zo.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},Zo.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(e=n[u])&&e>=e);)e=void 0;for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i&&!(null!=(e=t.call(n,n[u],u))&&e>=e);)e=void 0;for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},Zo.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(e=n[u])&&e>=e);)e=void 0;for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i&&!(null!=(e=t.call(n,n[u],u))&&e>=e);)e=void 0;for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},Zo.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o&&!(null!=(e=u=n[i])&&e>=e);)e=u=void 0;for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o&&!(null!=(e=u=t.call(n,n[i],i))&&e>=e);)e=void 0;for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},Zo.sum=function(n,t){var e,r=0,u=n.length,i=-1;if(1===arguments.length)for(;++i<u;)isNaN(e=+n[i])||(r+=e);else for(;++i<u;)isNaN(e=+t.call(n,n[i],i))||(r+=e);return r},Zo.mean=function(n,e){var r,u=0,i=n.length,o=-1,a=i;if(1===arguments.length)for(;++o<i;)t(r=n[o])?u+=r:--a;else for(;++o<i;)t(r=e.call(n,n[o],o))?u+=r:--a;return a?u/a:void 0},Zo.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},Zo.median=function(e,r){return arguments.length>1&&(e=e.map(r)),e=e.filter(t),e.length?Zo.quantile(e.sort(n),.5):void 0};var ra=e(n);Zo.bisectLeft=ra.left,Zo.bisect=Zo.bisectRight=ra.right,Zo.bisector=function(t){return e(1===t.length?function(e,r){return n(t(e),r)}:t)},Zo.shuffle=function(n){for(var t,e,r=n.length;r;)e=0|Math.random()*r--,t=n[r],n[r]=n[e],n[e]=t;return n},Zo.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},Zo.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},Zo.zip=function(){if(!(u=arguments.length))return[];for(var n=-1,t=Zo.min(arguments,r),e=new Array(t);++n<t;)for(var u,i=-1,o=e[n]=new Array(u);++i<u;)o[i]=arguments[i][n];return e},Zo.transpose=function(n){return Zo.zip.apply(Zo,n)},Zo.keys=function(n){var t=[];for(var e in n)t.push(e);return t},Zo.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},Zo.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},Zo.merge=function(n){for(var t,e,r,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(e=new Array(o);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var ua=Math.abs;Zo.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),1/0===(t-n)/e)throw new Error("infinite range");var r,i=[],o=u(ua(e)),a=-1;if(n*=o,t*=o,e*=o,0>e)for(;(r=n+e*++a)>t;)i.push(r/o);else for(;(r=n+e*++a)<t;)i.push(r/o);return i},Zo.map=function(n){var t=new o;if(n instanceof o)n.forEach(function(n,e){t.set(n,e)});else for(var e in n)t.set(e,n[e]);return t},i(o,{has:a,get:function(n){return this[ia+n]},set:function(n,t){return this[ia+n]=t},remove:c,keys:s,values:function(){var n=[];return this.forEach(function(t,e){n.push(e)}),n},entries:function(){var n=[];return this.forEach(function(t,e){n.push({key:t,value:e})}),n},size:l,empty:f,forEach:function(n){for(var t in this)t.charCodeAt(0)===oa&&n.call(this,t.substring(1),this[t])}});var ia="\x00",oa=ia.charCodeAt(0);Zo.nest=function(){function n(t,a,c){if(c>=i.length)return r?r.call(u,a):e?a.sort(e):a;for(var s,l,f,h,g=-1,p=a.length,v=i[c++],d=new o;++g<p;)(h=d.get(s=v(l=a[g])))?h.push(l):d.set(s,[l]);return t?(l=t(),f=function(e,r){l.set(e,n(t,r,c))}):(l={},f=function(e,r){l[e]=n(t,r,c)}),d.forEach(f),l}function t(n,e){if(e>=i.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],a=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(Zo.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return a[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},Zo.set=function(n){var t=new h;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},i(h,{has:a,add:function(n){return this[ia+n]=!0,n},remove:function(n){return n=ia+n,n in this&&delete this[n]},values:s,size:l,empty:f,forEach:function(n){for(var t in this)t.charCodeAt(0)===oa&&n.call(this,t.substring(1))}}),Zo.behavior={},Zo.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=g(n,t,t[e]);return n};var aa=["webkit","ms","moz","Moz","o","O"];Zo.dispatch=function(){for(var n=new d,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=m(n);return n},d.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.substring(e+1),n=n.substring(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},Zo.event=null,Zo.requote=function(n){return n.replace(ca,"\\$&")};var ca=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,sa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},la=function(n,t){return t.querySelector(n)},fa=function(n,t){return t.querySelectorAll(n)},ha=Bo.matches||Bo[p(Bo,"matchesSelector")],ga=function(n,t){return ha.call(n,t)};"function"==typeof Sizzle&&(la=function(n,t){return Sizzle(n,t)[0]||null},fa=Sizzle,ga=Sizzle.matchesSelector),Zo.selection=function(){return ma};var pa=Zo.selection.prototype=[];pa.select=function(n){var t,e,r,u,i=[];n=b(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,s=r.length;++c<s;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return _(i)},pa.selectAll=function(n){var t,e,r=[];n=w(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=Xo(n.call(e,e.__data__,a,u))),t.parentNode=e);return _(r)};var va={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};Zo.ns={prefix:va,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.substring(0,t),n=n.substring(t+1)),va.hasOwnProperty(e)?{space:va[e],local:n}:n}},pa.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=Zo.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(S(t,n[t]));return this}return this.each(S(n,t))},pa.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=A(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!E(n[u]).test(t))return!1;return!0}for(t in n)this.each(C(t,n[t]));return this}return this.each(C(n,t))},pa.style=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t="");for(e in n)this.each(z(e,n[e],t));return this}if(2>r)return Wo.getComputedStyle(this.node(),null).getPropertyValue(n);e=""}return this.each(z(n,t,e))},pa.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(L(t,n[t]));return this}return this.each(L(n,t))},pa.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},pa.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},pa.append=function(n){return n=T(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},pa.insert=function(n,t){return n=T(n),t=b(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},pa.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})},pa.data=function(n,t){function e(n,e){var r,u,i,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),v=new Array(a);if(t){var d,m=new o,y=new o,x=[];for(r=-1;++r<a;)d=t.call(u=n[r],u.__data__,r),m.has(d)?v[r]=u:m.set(d,u),x.push(d);for(r=-1;++r<f;)d=t.call(e,i=e[r],r),(u=m.get(d))?(g[r]=u,u.__data__=i):y.has(d)||(p[r]=q(i)),y.set(d,i),m.remove(d);for(r=-1;++r<a;)m.has(x[r])&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=q(i);for(;f>r;++r)p[r]=q(e[r]);for(;a>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,c.push(p),s.push(g),l.push(v)}var r,u,i=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++i<a;)(u=r[i])&&(n[i]=u.__data__);return n}var c=U([]),s=_([]),l=_([]);if("function"==typeof n)for(;++i<a;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<a;)e(r=this[i],n);return s.enter=function(){return c},s.exit=function(){return l},s},pa.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},pa.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=R(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return _(u)},pa.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},pa.sort=function(n){n=D.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},pa.each=function(n){return P(this,function(t,e,r){n.call(t,t.__data__,e,r)})},pa.call=function(n){var t=Xo(arguments);return n.apply(t[0]=this,t),this},pa.empty=function(){return!this.node()},pa.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},pa.size=function(){var n=0;return this.each(function(){++n}),n};var da=[];Zo.selection.enter=U,Zo.selection.enter.prototype=da,da.append=pa.append,da.empty=pa.empty,da.node=pa.node,da.call=pa.call,da.size=pa.size,da.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var s=-1,l=u.length;++s<l;)(i=u[s])?(t.push(r[s]=e=n.call(u.parentNode,i.__data__,s,a)),e.__data__=i.__data__):t.push(null)}return _(o)},da.insert=function(n,t){return arguments.length<2&&(t=j(this)),pa.insert.call(this,n,t)},pa.transition=function(){for(var n,t,e=Ss||++Ns,r=[],u=ks||{time:Date.now(),ease:xu,delay:0,duration:250},i=-1,o=this.length;++i<o;){r.push(n=[]);for(var a=this[i],c=-1,s=a.length;++c<s;)(t=a[c])&&Po(t,c,e,u),n.push(t)}return qo(r,e)},pa.interrupt=function(){return this.each(H)},Zo.select=function(n){var t=["string"==typeof n?la(n,$o):n];return t.parentNode=Bo,_([t])},Zo.selectAll=function(n){var t=Xo("string"==typeof n?fa(n,$o):n);return t.parentNode=Bo,_([t])};var ma=Zo.select(Bo);pa.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(F(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(F(n,t,e))};var ya=Zo.map({mouseenter:"mouseover",mouseleave:"mouseout"});ya.forEach(function(n){"on"+n in $o&&ya.remove(n)});var xa="onselectstart"in $o?null:p(Bo.style,"userSelect"),Ma=0;Zo.mouse=function(n){return Z(n,x())};var _a=/WebKit/.test(Wo.navigator.userAgent)?-1:0;Zo.touches=function(n,t){return arguments.length<2&&(t=x().touches),t?Xo(t).map(function(t){var e=Z(n,t);return e.identifier=t.identifier,e}):[]},Zo.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",i)}function t(n,t,u,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-x[0],e=r[1]-x[1],p|=n|e,x=r,g({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&Zo.event.target===f),g({type:"dragend"}))}var s,l=this,f=Zo.event.target,h=l.parentNode,g=e.of(l,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=Zo.select(u()).on(i+d,a).on(o+d,c),y=I(),x=t(h,v);r?(s=r.apply(l,arguments),s=[s.x-x[0],s.y-x[1]]):s=[0,0],g({type:"dragstart"})}}var e=M(n,"drag","dragstart","dragend"),r=null,u=t(v,Zo.mouse,$,"mousemove","mouseup"),i=t(V,Zo.touch,X,"touchmove","touchend");return n.origin=function(t){return arguments.length?(r=t,n):r},Zo.rebind(n,e,"on")};var ba=Math.PI,wa=2*ba,Sa=ba/2,ka=1e-6,Ea=ka*ka,Aa=ba/180,Ca=180/ba,Na=Math.SQRT2,za=2,La=4;Zo.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=Q(v),o=i/(za*h)*(e*nt(Na*t+v)-K(v));return[r+o*s,u+o*l,i*e/Q(Na*t+v)]}return[r+n*s,u+n*l,i*Math.exp(Na*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],s=o-r,l=a-u,f=s*s+l*l,h=Math.sqrt(f),g=(c*c-i*i+La*f)/(2*i*za*h),p=(c*c-i*i-La*f)/(2*c*za*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Na;return e.duration=1e3*y,e},Zo.behavior.zoom=function(){function n(n){n.on(A,s).on(Ra+".zoom",f).on("dblclick.zoom",h).on(z,l)}function t(n){return[(n[0]-S.x)/S.k,(n[1]-S.y)/S.k]}function e(n){return[n[0]*S.k+S.x,n[1]*S.k+S.y]}function r(n){S.k=Math.max(E[0],Math.min(E[1],n))}function u(n,t){t=e(t),S.x+=n[0]-t[0],S.y+=n[1]-t[1]}function i(){_&&_.domain(x.range().map(function(n){return(n-S.x)/S.k}).map(x.invert)),w&&w.domain(b.range().map(function(n){return(n-S.y)/S.k}).map(b.invert))}function o(n){n({type:"zoomstart"})}function a(n){i(),n({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function c(n){n({type:"zoomend"})}function s(){function n(){l=1,u(Zo.mouse(r),h),a(s)}function e(){f.on(C,null).on(N,null),g(l&&Zo.event.target===i),c(s)}var r=this,i=Zo.event.target,s=L.of(r,arguments),l=0,f=Zo.select(Wo).on(C,n).on(N,e),h=t(Zo.mouse(r)),g=I();H.call(r),o(s)}function l(){function n(){var n=Zo.touches(g);return h=S.k,n.forEach(function(n){n.identifier in v&&(v[n.identifier]=t(n))}),n}function e(){var t=Zo.event.target;Zo.select(t).on(M,i).on(_,f),b.push(t);for(var e=Zo.event.changedTouches,o=0,c=e.length;c>o;++o)v[e[o].identifier]=null;var s=n(),l=Date.now();if(1===s.length){if(500>l-m){var h=s[0],g=v[h.identifier];r(2*S.k),u(h,g),y(),a(p)}m=l}else if(s.length>1){var h=s[0],x=s[1],w=h[0]-x[0],k=h[1]-x[1];d=w*w+k*k}}function i(){for(var n,t,e,i,o=Zo.touches(g),c=0,s=o.length;s>c;++c,i=null)if(e=o[c],i=v[e.identifier]){if(t)break;n=e,t=i}if(i){var l=(l=e[0]-n[0])*l+(l=e[1]-n[1])*l,f=d&&Math.sqrt(l/d);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],r(f*h)}m=null,u(n,t),a(p)}function f(){if(Zo.event.touches.length){for(var t=Zo.event.changedTouches,e=0,r=t.length;r>e;++e)delete v[t[e].identifier];for(var u in v)return void n()}Zo.selectAll(b).on(x,null),w.on(A,s).on(z,l),k(),c(p)}var h,g=this,p=L.of(g,arguments),v={},d=0,x=".zoom-"+Zo.event.changedTouches[0].identifier,M="touchmove"+x,_="touchend"+x,b=[],w=Zo.select(g).on(A,null).on(z,e),k=I();H.call(g),e(),o(p)}function f(){var n=L.of(this,arguments);d?clearTimeout(d):(g=t(p=v||Zo.mouse(this)),H.call(this),o(n)),d=setTimeout(function(){d=null,c(n)},50),y(),r(Math.pow(2,.002*Ta())*S.k),u(p,g),a(n)}function h(){var n=L.of(this,arguments),e=Zo.mouse(this),i=t(e),s=Math.log(S.k)/Math.LN2;o(n),r(Math.pow(2,Zo.event.shiftKey?Math.ceil(s)-1:Math.floor(s)+1)),u(e,i),a(n),c(n)}var g,p,v,d,m,x,_,b,w,S={x:0,y:0,k:1},k=[960,500],E=qa,A="mousedown.zoom",C="mousemove.zoom",N="mouseup.zoom",z="touchstart.zoom",L=M(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=L.of(this,arguments),t=S;Ss?Zo.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},o(n)}).tween("zoom:zoom",function(){var e=k[0],r=k[1],u=e/2,i=r/2,o=Zo.interpolateZoom([(u-S.x)/S.k,(i-S.y)/S.k,e/S.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),c=e/r[2];this.__chart__=S={x:u-r[0]*c,y:i-r[1]*c,k:c},a(n)}}).each("end.zoom",function(){c(n)}):(this.__chart__=S,o(n),a(n),c(n))})},n.translate=function(t){return arguments.length?(S={x:+t[0],y:+t[1],k:S.k},i(),n):[S.x,S.y]},n.scale=function(t){return arguments.length?(S={x:S.x,y:S.y,k:+t},i(),n):S.k},n.scaleExtent=function(t){return arguments.length?(E=null==t?qa:[+t[0],+t[1]],n):E},n.center=function(t){return arguments.length?(v=t&&[+t[0],+t[1]],n):v},n.size=function(t){return arguments.length?(k=t&&[+t[0],+t[1]],n):k},n.x=function(t){return arguments.length?(_=t,x=t.copy(),S={x:0,y:0,k:1},n):_},n.y=function(t){return arguments.length?(w=t,b=t.copy(),S={x:0,y:0,k:1},n):w},Zo.rebind(n,L,"on")};var Ta,qa=[0,1/0],Ra="onwheel"in $o?(Ta=function(){return-Zo.event.deltaY*(Zo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in $o?(Ta=function(){return Zo.event.wheelDelta},"mousewheel"):(Ta=function(){return-Zo.event.detail},"MozMousePixelScroll");Zo.color=et,et.prototype.toString=function(){return this.rgb()+""},Zo.hsl=rt;var Da=rt.prototype=new et;Da.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new rt(this.h,this.s,this.l/n)},Da.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new rt(this.h,this.s,n*this.l)},Da.rgb=function(){return ut(this.h,this.s,this.l)},Zo.hcl=it;var Pa=it.prototype=new et;Pa.brighter=function(n){return new it(this.h,this.c,Math.min(100,this.l+Ua*(arguments.length?n:1)))},Pa.darker=function(n){return new it(this.h,this.c,Math.max(0,this.l-Ua*(arguments.length?n:1)))},Pa.rgb=function(){return ot(this.h,this.c,this.l).rgb()},Zo.lab=at;var Ua=18,ja=.95047,Ha=1,Fa=1.08883,Oa=at.prototype=new et;Oa.brighter=function(n){return new at(Math.min(100,this.l+Ua*(arguments.length?n:1)),this.a,this.b)},Oa.darker=function(n){return new at(Math.max(0,this.l-Ua*(arguments.length?n:1)),this.a,this.b)},Oa.rgb=function(){return ct(this.l,this.a,this.b)},Zo.rgb=gt;var Ya=gt.prototype=new et;Ya.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new gt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new gt(u,u,u)},Ya.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new gt(n*this.r,n*this.g,n*this.b)},Ya.hsl=function(){return yt(this.r,this.g,this.b)},Ya.toString=function(){return"#"+dt(this.r)+dt(this.g)+dt(this.b)};var Ia=Zo.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ia.forEach(function(n,t){Ia.set(n,pt(t))}),Zo.functor=bt,Zo.xhr=St(wt),Zo.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=kt(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(l>=s)return o;if(u)return u=!1,i;var t=l;if(34===n.charCodeAt(t)){for(var e=t;e++<s;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}l=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++l):10===r&&(u=!0),n.substring(t+1,e).replace(/""/g,'"')}for(;s>l;){var r=n.charCodeAt(l++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(l)&&(++l,++a);else if(r!==c)continue;return n.substring(t,l-a)}return n.substring(t)}for(var r,u,i={},o={},a=[],s=n.length,l=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();(!t||(h=t(h,f++)))&&a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new h,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},Zo.csv=Zo.dsv(",","text/csv"),Zo.tsv=Zo.dsv("	","text/tab-separated-values"),Zo.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=x().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return Z(n,r)};var Za,Va,Xa,$a,Ba,Wa=Wo[p(Wo,"requestAnimationFrame")]||function(n){setTimeout(n,17)};Zo.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};Va?Va.n=i:Za=i,Va=i,Xa||($a=clearTimeout($a),Xa=1,Wa(At))},Zo.timer.flush=function(){Ct(),Nt()},Zo.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var Ja=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Lt);Zo.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=Zo.round(n,zt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),Ja[8+e/3]};var Ga=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ka=Zo.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=Zo.round(n,zt(n,t))).toFixed(Math.max(0,Math.min(20,zt(n*(1+1e-15),t))))}}),Qa=Zo.time={},nc=Date;Rt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){tc.setUTCDate.apply(this._,arguments)},setDay:function(){tc.setUTCDay.apply(this._,arguments)},setFullYear:function(){tc.setUTCFullYear.apply(this._,arguments)},setHours:function(){tc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){tc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){tc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){tc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){tc.setUTCSeconds.apply(this._,arguments)},setTime:function(){tc.setTime.apply(this._,arguments)}};var tc=Date.prototype;Qa.year=Dt(function(n){return n=Qa.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),Qa.years=Qa.year.range,Qa.years.utc=Qa.year.utc.range,Qa.day=Dt(function(n){var t=new nc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),Qa.days=Qa.day.range,Qa.days.utc=Qa.day.utc.range,Qa.dayOfYear=function(n){var t=Qa.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=Qa[n]=Dt(function(n){return(n=Qa.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=Qa.year(n).getDay();return Math.floor((Qa.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});Qa[n+"s"]=e.range,Qa[n+"s"].utc=e.utc.range,Qa[n+"OfYear"]=function(n){var e=Qa.year(n).getDay();return Math.floor((Qa.dayOfYear(n)+(e+t)%7)/7)}}),Qa.week=Qa.sunday,Qa.weeks=Qa.sunday.range,Qa.weeks.utc=Qa.sunday.utc.range,Qa.weekOfYear=Qa.sundayOfYear;var ec={"-":"",_:" ",0:"0"},rc=/^\s*\d+/,uc=/^%/;Zo.locale=function(n){return{numberFormat:Tt(n),timeFormat:Ut(n)}};var ic=Zo.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Zo.format=ic.numberFormat,Zo.geo={},ue.prototype={s:0,t:0,add:function(n){ie(n,this.t,oc),ie(oc.s,this.s,this),this.s?this.t+=oc.t:this.s=oc.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var oc=new ue;Zo.geo.stream=function(n,t){n&&ac.hasOwnProperty(n.type)?ac[n.type](n,t):oe(n,t)};var ac={Feature:function(n,t){oe(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)oe(e[r].geometry,t)}},cc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){ae(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)ae(e[r],t,0)},Polygon:function(n,t){ce(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)ce(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)oe(e[r],t)}};Zo.geo.area=function(n){return sc=0,Zo.geo.stream(n,fc),sc};var sc,lc=new ue,fc={sphere:function(){sc+=4*ba},point:v,lineStart:v,lineEnd:v,polygonStart:function(){lc.reset(),fc.lineStart=se},polygonEnd:function(){var n=2*lc;sc+=0>n?4*ba+n:n,fc.lineStart=fc.lineEnd=fc.point=v}};Zo.geo.bounds=function(){function n(n,t){x.push(M=[l=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=le([t*Aa,e*Aa]);if(m){var u=he(m,r),i=[u[1],-u[0],0],o=he(i,u);ve(o),o=de(o);var c=t-p,s=c>0?1:-1,v=o[0]*Ca*s,d=ua(c)>180;if(d^(v>s*p&&s*t>v)){var y=o[1]*Ca;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>s*p&&s*t>v)){var y=-o[1]*Ca;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t):h>=l?(l>t&&(l=t),t>h&&(h=t)):t>p?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t)}else n(t,e);m=r,p=t}function e(){_.point=t}function r(){M[0]=l,M[1]=h,_.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ua(r)>180?r+(r>0?360:-360):r}else v=n,d=e;fc.point(n,e),t(n,e)}function i(){fc.lineStart()}function o(){u(v,d),fc.lineEnd(),ua(y)>ka&&(l=-(h=180)),M[0]=l,M[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function s(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var l,f,h,g,p,v,d,m,y,x,M,_={point:n,lineStart:e,lineEnd:r,polygonStart:function(){_.point=u,_.lineStart=i,_.lineEnd=o,y=0,fc.polygonStart()},polygonEnd:function(){fc.polygonEnd(),_.point=n,_.lineStart=e,_.lineEnd=r,0>lc?(l=-(h=180),f=-(g=90)):y>ka?g=90:-ka>y&&(f=-90),M[0]=l,M[1]=h}};return function(n){g=h=-(l=f=1/0),x=[],Zo.geo.stream(n,_);var t=x.length;if(t){x.sort(c);for(var e,r=1,u=x[0],i=[u];t>r;++r)e=x[r],s(e[0],u)||s(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);
for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,l=e[0],h=u[1])}return x=M=null,1/0===l||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[l,f],[h,g]]}}(),Zo.geo.centroid=function(n){hc=gc=pc=vc=dc=mc=yc=xc=Mc=_c=bc=0,Zo.geo.stream(n,wc);var t=Mc,e=_c,r=bc,u=t*t+e*e+r*r;return Ea>u&&(t=mc,e=yc,r=xc,ka>gc&&(t=pc,e=vc,r=dc),u=t*t+e*e+r*r,Ea>u)?[0/0,0/0]:[Math.atan2(e,t)*Ca,G(r/Math.sqrt(u))*Ca]};var hc,gc,pc,vc,dc,mc,yc,xc,Mc,_c,bc,wc={sphere:v,point:ye,lineStart:Me,lineEnd:_e,polygonStart:function(){wc.lineStart=be},polygonEnd:function(){wc.lineStart=Me}},Sc=Ae(we,Te,Re,[-ba,-ba/2]),kc=1e9;Zo.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ue(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(Zo.geo.conicEqualArea=function(){return He(Fe)}).raw=Fe,Zo.geo.albers=function(){return Zo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Zo.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=Zo.geo.albers(),o=Zo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=Zo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var s=i.scale(),l=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[l-.455*s,f-.238*s],[l+.455*s,f+.238*s]]).stream(c).point,r=o.translate([l-.307*s,f+.201*s]).clipExtent([[l-.425*s+ka,f+.12*s+ka],[l-.214*s-ka,f+.234*s-ka]]).stream(c).point,u=a.translate([l-.205*s,f+.212*s]).clipExtent([[l-.214*s+ka,f+.166*s+ka],[l-.115*s-ka,f+.234*s-ka]]).stream(c).point,n},n.scale(1070)};var Ec,Ac,Cc,Nc,zc,Lc,Tc={point:v,lineStart:v,lineEnd:v,polygonStart:function(){Ac=0,Tc.lineStart=Oe},polygonEnd:function(){Tc.lineStart=Tc.lineEnd=Tc.point=v,Ec+=ua(Ac/2)}},qc={point:Ye,lineStart:v,lineEnd:v,polygonStart:v,polygonEnd:v},Rc={point:Ve,lineStart:Xe,lineEnd:$e,polygonStart:function(){Rc.lineStart=Be},polygonEnd:function(){Rc.point=Ve,Rc.lineStart=Xe,Rc.lineEnd=$e}};Zo.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),Zo.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Ec=0,Zo.geo.stream(n,u(Tc)),Ec},n.centroid=function(n){return pc=vc=dc=mc=yc=xc=Mc=_c=bc=0,Zo.geo.stream(n,u(Rc)),bc?[Mc/bc,_c/bc]:xc?[mc/xc,yc/xc]:dc?[pc/dc,vc/dc]:[0/0,0/0]},n.bounds=function(n){return zc=Lc=-(Cc=Nc=1/0),Zo.geo.stream(n,u(qc)),[[Cc,Nc],[zc,Lc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||Ge(n):wt,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Ie:new We(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(Zo.geo.albersUsa()).context(null)},Zo.geo.transform=function(n){return{stream:function(t){var e=new Ke(t);for(var r in n)e[r]=n[r];return e}}},Ke.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Zo.geo.projection=nr,Zo.geo.projectionMutator=tr,(Zo.geo.equirectangular=function(){return nr(rr)}).raw=rr.invert=rr,Zo.geo.rotation=function(n){function t(t){return t=n(t[0]*Aa,t[1]*Aa),t[0]*=Ca,t[1]*=Ca,t}return n=ir(n[0]%360*Aa,n[1]*Aa,n.length>2?n[2]*Aa:0),t.invert=function(t){return t=n.invert(t[0]*Aa,t[1]*Aa),t[0]*=Ca,t[1]*=Ca,t},t},ur.invert=rr,Zo.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=ir(-n[0]*Aa,-n[1]*Aa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ca,n[1]*=Ca}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=sr((t=+r)*Aa,u*Aa),n):t},n.precision=function(r){return arguments.length?(e=sr(t*Aa,(u=+r)*Aa),n):u},n.angle(90)},Zo.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Aa,u=n[1]*Aa,i=t[1]*Aa,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),s=Math.cos(u),l=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=s*l-c*f*a)*e),c*l+s*f*a)},Zo.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return Zo.range(Math.ceil(i/d)*d,u,d).map(h).concat(Zo.range(Math.ceil(s/m)*m,c,m).map(g)).concat(Zo.range(Math.ceil(r/p)*p,e,p).filter(function(n){return ua(n%d)>ka}).map(l)).concat(Zo.range(Math.ceil(a/v)*v,o,v).filter(function(n){return ua(n%m)>ka}).map(f))}var e,r,u,i,o,a,c,s,l,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(s).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],s=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),s>c&&(t=s,s=c,c=t),n.precision(y)):[[i,s],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,l=fr(a,o,90),f=hr(r,e,y),h=fr(s,c,90),g=hr(i,u,y),n):y},n.majorExtent([[-180,-90+ka],[180,90-ka]]).minorExtent([[-180,-80-ka],[180,80+ka]])},Zo.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=gr,u=pr;return n.distance=function(){return Zo.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},Zo.geo.interpolate=function(n,t){return vr(n[0]*Aa,n[1]*Aa,t[0]*Aa,t[1]*Aa)},Zo.geo.length=function(n){return Dc=0,Zo.geo.stream(n,Pc),Dc};var Dc,Pc={sphere:v,point:v,lineStart:dr,lineEnd:v,polygonStart:v,polygonEnd:v},Uc=mr(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(Zo.geo.azimuthalEqualArea=function(){return nr(Uc)}).raw=Uc;var jc=mr(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},wt);(Zo.geo.azimuthalEquidistant=function(){return nr(jc)}).raw=jc,(Zo.geo.conicConformal=function(){return He(yr)}).raw=yr,(Zo.geo.conicEquidistant=function(){return He(xr)}).raw=xr;var Hc=mr(function(n){return 1/n},Math.atan);(Zo.geo.gnomonic=function(){return nr(Hc)}).raw=Hc,Mr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Sa]},(Zo.geo.mercator=function(){return _r(Mr)}).raw=Mr;var Fc=mr(function(){return 1},Math.asin);(Zo.geo.orthographic=function(){return nr(Fc)}).raw=Fc;var Oc=mr(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(Zo.geo.stereographic=function(){return nr(Oc)}).raw=Oc,br.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Sa]},(Zo.geo.transverseMercator=function(){var n=_r(br),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=br,Zo.geom={},Zo.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=bt(e),i=bt(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(Er),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var s=kr(a),l=kr(c),f=l[0]===s[0],h=l[l.length-1]===s[s.length-1],g=[];for(t=s.length-1;t>=0;--t)g.push(n[a[s[t]][2]]);for(t=+f;t<l.length-h;++t)g.push(n[a[l[t]][2]]);return g}var e=wr,r=Sr;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},Zo.geom.polygon=function(n){return sa(n,Yc),n};var Yc=Zo.geom.polygon.prototype=[];Yc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},Yc.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},Yc.clip=function(n){for(var t,e,r,u,i,o,a=Nr(n),c=-1,s=this.length-Nr(this),l=this[s-1];++c<s;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],Ar(o,l,u)?(Ar(i,l,u)||n.push(Cr(i,o,l,u)),n.push(o)):Ar(i,l,u)&&n.push(Cr(i,o,l,u)),i=o;a&&n.push(n[0]),l=u}return n};var Ic,Zc,Vc,Xc,$c,Bc=[],Wc=[];Ur.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Hr),t.length},Wr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Jr.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=nu(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(Kr(this,e),n=e,e=n.U),e.C=!1,r.C=!0,Qr(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(Qr(this,e),n=e,e=n.U),e.C=!1,r.C=!0,Kr(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,o=n.R;if(e=i?o?nu(o):i:o,u?u.L===n?u.L=e:u.R=e:this._=e,i&&o?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==o?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=o,o.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return n.C=!1,void 0;do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,Kr(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Qr(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,Kr(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,Qr(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Kr(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,Qr(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},Zo.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return tu(e(n),a).cells.forEach(function(e,a){var c=e.edges,s=e.site,l=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):s.x>=r&&s.x<=i&&s.y>=u&&s.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];l.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/ka)*ka,y:Math.round(o(n,t)/ka)*ka,i:t}})}var r=wr,u=Sr,i=r,o=u,a=Jc;return n?t(n):(t.links=function(n){return tu(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return tu(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Hr),c=-1,s=a.length,l=a[s-1].edge,f=l.l===o?l.r:l.l;++c<s;)u=l,i=f,l=a[c].edge,f=l.l===o?l.r:l.l,r<i.i&&r<f.i&&ru(o,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=bt(r=n),t):r},t.y=function(n){return arguments.length?(o=bt(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?Jc:n,t):a===Jc?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===Jc?null:a&&a[1]},t)};var Jc=[[-1e6,-1e6],[1e6,1e6]];Zo.geom.delaunay=function(n){return Zo.geom.voronoi().triangles(n)},Zo.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,l=n.y;if(null!=c)if(ua(c-e)+ua(l-r)<.01)s(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,s(n,f,c,l,u,i,o,a),s(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else s(n,t,e,r,u,i,o,a)}function s(n,t,e,r,u,o,a,c){var s=.5*(u+a),l=.5*(o+c),f=e>=s,h=r>=l,g=(h<<1)+f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=ou()),f?u=s:a=s,h?o=l:c=l,i(n,t,e,r,u,o,a,c)}var l,f,h,g,p,v,d,m,y,x=bt(a),M=bt(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)l=n[g],l.x<v&&(v=l.x),l.y<d&&(d=l.y),l.x>m&&(m=l.x),l.y>y&&(y=l.y),f.push(l.x),h.push(l.y);else for(g=0;p>g;++g){var _=+x(l=n[g],g),b=+M(l,g);v>_&&(v=_),d>b&&(d=b),_>m&&(m=_),b>y&&(y=b),f.push(_),h.push(b)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=ou();if(k.add=function(n){i(k,n,+x(n,++g),+M(n,g),v,d,m,y)},k.visit=function(n){au(n,k,v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=l=null,k}var o,a=wr,c=Sr;return(o=arguments.length)?(a=uu,c=iu,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},Zo.interpolateRgb=cu,Zo.interpolateObject=su,Zo.interpolateNumber=lu,Zo.interpolateString=fu;var Gc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kc=new RegExp(Gc.source,"g");Zo.interpolate=hu,Zo.interpolators=[function(n,t){var e=typeof t;return("string"===e?Ia.has(t)||/^(#|rgb\(|hsl\()/.test(t)?cu:fu:t instanceof et?cu:Array.isArray(t)?gu:"object"===e&&isNaN(t)?su:lu)(n,t)}],Zo.interpolateArray=gu;var Qc=function(){return wt},ns=Zo.map({linear:Qc,poly:Mu,quad:function(){return mu},cubic:function(){return yu},sin:function(){return _u},exp:function(){return bu},circle:function(){return wu},elastic:Su,back:ku,bounce:function(){return Eu}}),ts=Zo.map({"in":wt,out:vu,"in-out":du,"out-in":function(n){return du(vu(n))}});Zo.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return e=ns.get(e)||Qc,r=ts.get(r)||wt,pu(r(e.apply(null,Vo.call(arguments,1))))},Zo.interpolateHcl=Au,Zo.interpolateHsl=Cu,Zo.interpolateLab=Nu,Zo.interpolateRound=zu,Zo.transform=function(n){var t=$o.createElementNS(Zo.ns.prefix.svg,"g");return(Zo.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Lu(e?e.matrix:es)})(n)},Lu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var es={a:1,b:0,c:0,d:1,e:0,f:0};Zo.interpolateTransform=Du,Zo.layout={},Zo.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(ju(n[e]));return t}},Zo.layout.chord=function(){function n(){var n,s,f,h,g,p={},v=[],d=Zo.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(s=0,g=-1;++g<i;)s+=u[h][g];v.push(s),m.push(Zo.range(i)),n+=s}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(wa-l*i)/n,s=0,h=-1;++h<i;){for(f=s,g=-1;++g<i;){var y=d[h],x=m[y][g],M=u[y][x],_=s,b=s+=M*n;p[y+"-"+x]={index:y,subindex:x,startAngle:_,endAngle:b,value:M}}r[y]={index:y,startAngle:f,endAngle:s,value:(s-f)/n},s+=l}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,s={},l=0;return s.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,s):u},s.padding=function(n){return arguments.length?(l=n,e=r=null,s):l},s.sortGroups=function(n){return arguments.length?(o=n,e=r=null,s):o},s.sortSubgroups=function(n){return arguments.length?(a=n,e=null,s):a},s.sortChords=function(n){return arguments.length?(c=n,e&&t(),s):c},s.chords=function(){return e||n(),e},s.groups=function(){return r||n(),r},s},Zo.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-e,c=i*i+o*o;if(c>a*a/d){if(p>c){var s=t.charge/c;n.px-=i*s,n.py-=o*s}return!0}if(t.point&&c&&p>c){var s=t.pointCharge/c;n.px-=i*s,n.py-=o*s}}return!t.charge}}function t(n){n.px=Zo.event.x,n.py=Zo.event.y,a.resume()}var e,r,u,i,o,a={},c=Zo.dispatch("start","tick","end"),s=[1,1],l=.9,f=rs,h=us,g=-30,p=is,v=.1,d=.64,m=[],y=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,x,M,_=m.length,b=y.length;for(e=0;b>e;++e)a=y[e],f=a.source,h=a.target,x=h.x-f.x,M=h.y-f.y,(p=x*x+M*M)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,x*=p,M*=p,h.x-=x*(d=f.weight/(h.weight+f.weight)),h.y-=M*d,f.x+=x*(d=1-d),f.y+=M*d);if((d=r*v)&&(x=s[0]/2,M=s[1]/2,e=-1,d))for(;++e<_;)a=m[e],a.x+=(x-a.x)*d,a.y+=(M-a.y)*d;if(g)for(Vu(t=Zo.geom.quadtree(m),r,o),e=-1;++e<_;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<_;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*l,a.y-=(a.py-(a.py=a.y))*l);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(y=n,a):y},a.size=function(n){return arguments.length?(s=n,a):s},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(l=+n,a):l},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),Zo.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;s>a;++a){var u=y[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,s=o.length;++a<s;)if(!isNaN(i=o[a][n]))return i;return Math.random()*r}var t,e,r,c=m.length,l=y.length,p=s[0],v=s[1];for(t=0;c>t;++t)(r=m[t]).index=t,r.weight=0;for(t=0;l>t;++t)r=y[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;l>t;++t)u[t]=+f.call(this,y[t],t);else for(t=0;l>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;l>t;++t)i[t]=+h.call(this,y[t],t);else for(t=0;l>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=Zo.behavior.drag().origin(wt).on("dragstart.force",Ou).on("drag.force",t).on("dragend.force",Yu)),arguments.length?(this.on("mouseover.force",Iu).on("mouseout.force",Zu).call(e),void 0):e},Zo.rebind(a,c,"on")};var rs=20,us=1,is=1/0;Zo.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(s=e.call(n,i,i.depth))&&(c=s.length)){for(var c,s,l;--c>=0;)o.push(l=s[c]),l.parent=i,l.depth=i.depth+1;r&&(i.value=0),i.children=s}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Bu(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=Gu,e=Wu,r=Ju;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&($u(t,function(n){n.children&&(n.value=0)}),Bu(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},Zo.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,s=-1;for(r=t.value?r/t.value:0;++s<o;)n(a=i[s],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=Zo.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},Xu(e,r)},Zo.layout.pie=function(){function n(i){var o=i.map(function(e,r){return+t.call(n,e,r)}),a=+("function"==typeof r?r.apply(this,arguments):r),c=(("function"==typeof u?u.apply(this,arguments):u)-a)/Zo.sum(o),s=Zo.range(i.length);null!=e&&s.sort(e===os?function(n,t){return o[t]-o[n]}:function(n,t){return e(i[n],i[t])});var l=[];return s.forEach(function(n){var t;l[n]={data:i[n],value:t=o[n],startAngle:a,endAngle:a+=t*c}}),l}var t=Number,e=os,r=0,u=wa;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n};var os={};Zo.layout.stack=function(){function n(a,c){var s=a.map(function(e,r){return t.call(n,e,r)}),l=s.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,l,c);s=Zo.permute(s,f),l=Zo.permute(l,f);var h,g,p,v=r.call(n,l,c),d=s.length,m=s[0].length;for(g=0;m>g;++g)for(u.call(n,s[0][g],p=v[g],l[0][g][1]),h=1;d>h;++h)u.call(n,s[h][g],p+=l[h-1][g][1],l[h][g][1]);return a}var t=wt,e=ei,r=ri,u=ti,i=Qu,o=ni;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:as.get(t)||ei,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:cs.get(t)||ri,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var as=Zo.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(ui),i=n.map(ii),o=Zo.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,s=[],l=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],s.push(e)):(c+=i[e],l.push(e));return l.reverse().concat(s)},reverse:function(n){return Zo.range(n.length).reverse()},"default":ei}),cs=Zo.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,s,l=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=s=0,e=1;h>e;++e){for(t=0,u=0;l>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];l>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,s>c&&(s=c)}for(e=0;h>e;++e)g[e]-=s;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:ri});Zo.layout.histogram=function(){function n(n,i){for(var o,a,c=[],s=n.map(e,this),l=r.call(this,s,i),f=u.call(this,l,s,i),i=-1,h=s.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=s[i],a>=l[0]&&a<=l[1]&&(o=c[Zo.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=si,u=ai;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=bt(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return ci(n,t)}:bt(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},Zo.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],s=u[1],l=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Bu(a,function(n){n.r=+l(n.value)}),Bu(a,pi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/s))/2;Bu(a,function(n){n.r+=f}),Bu(a,pi),Bu(a,function(n){n.r-=f})}return mi(a,c/2,s/2,t?1:1/Math.max(2*a.r/c,2*a.r/s)),o}var t,e=Zo.layout.hierarchy().sort(li),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Xu(n,e)},Zo.layout.tree=function(){function n(n,u){var l=o.call(this,n,u),f=l[0],h=t(f);if(Bu(h,e),h.parent.m=-h.z,$u(h,r),s)$u(f,i);else{var g=f,p=f,v=f;$u(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);$u(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return l}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){wi(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],s=u.m,l=i.m,f=o.m,h=c.m;o=_i(o),u=Mi(u),o&&u;)c=Mi(c),i=_i(i),i.a=n,r=o.z+f-u.z-s+a(o._,u._),r>0&&(bi(Si(o,n,e),n,r),s+=r,l+=r),f+=o.m,s+=u.m,h+=c.m,l+=i.m;o&&!_i(i)&&(i.t=o,i.m+=f-l),u&&!Mi(c)&&(c.t=u,c.m+=s-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=Zo.layout.hierarchy().sort(null).value(null),a=xi,c=[1,1],s=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(s=null==(c=t)?i:null,n):s?null:c},n.nodeSize=function(t){return arguments.length?(s=null==(c=t)?null:i,n):s?c:null},Xu(n,o)},Zo.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],s=0;Bu(c,function(n){var t=n.children;t&&t.length?(n.x=Ei(t),n.y=ki(t)):(n.x=o?s+=e(n,o):0,n.y=0,o=n)});var l=Ai(c),f=Ci(c),h=l.x-e(l,f)/2,g=f.x+e(f,l)/2;return Bu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=Zo.layout.hierarchy().sort(null).value(null),e=xi,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Xu(n,t)},Zo.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,s=f(e),l=[],h=i.slice(),p=1/0,v="slice"===g?s.dx:"dice"===g?s.dy:"slice-dice"===g?1&e.depth?s.dy:s.dx:Math.min(s.dx,s.dy);for(n(h,s.dx*s.dy/e.value),l.area=0;(c=h.length)>0;)l.push(o=h[c-1]),l.area+=o.area,"squarify"!==g||(a=r(l,v))<=p?(h.pop(),p=a):(l.area-=l.pop().area,u(l,v,s,!1),v=Math.min(s.dx,s.dy),l.length=l.area=0,p=1/0);l.length&&(u(l,v,s,!0),l.length=l.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,s=e.y,l=t?c(n.area/t):0;if(t==e.dx){for((r||l>e.dy)&&(l=e.dy);++i<o;)u=n[i],u.x=a,u.y=s,u.dy=l,a+=u.dx=Math.min(e.x+e.dx-a,l?c(u.area/l):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=l,e.dy-=l}else{for((r||l>e.dx)&&(l=e.dx);++i<o;)u=n[i],u.x=a,u.y=s,u.dx=l,s+=u.dy=Math.min(e.y+e.dy-s,l?c(u.area/l):0);u.z=!1,u.dy+=e.y+e.dy-s,e.x+=l,e.dx-=l}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=s[0],i.dy=s[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=Zo.layout.hierarchy(),c=Math.round,s=[1,1],l=null,f=Ni,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(s=n,i):s},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Ni(t):zi(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return zi(t,n)}if(!arguments.length)return l;var r;return f=null==(l=n)?Ni:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Xu(i,a)},Zo.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=Zo.random.normal.apply(Zo,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=Zo.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},Zo.scale={};var ss={floor:wt,ceil:wt};Zo.scale.linear=function(){return Ui([0,1],[0,1],hu,!1)};var ls={s:1,g:1,p:1,r:1,e:1};Zo.scale.log=function(){return Vi(Zo.scale.linear().domain([0,1]),10,!0,[1,10])};var fs=Zo.format(".0e"),hs={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};Zo.scale.pow=function(){return Xi(Zo.scale.linear(),1,[0,1])},Zo.scale.sqrt=function(){return Zo.scale.pow().exponent(.5)},Zo.scale.ordinal=function(){return Bi([],{t:"range",a:[[]]})},Zo.scale.category10=function(){return Zo.scale.ordinal().range(gs)},Zo.scale.category20=function(){return Zo.scale.ordinal().range(ps)},Zo.scale.category20b=function(){return Zo.scale.ordinal().range(vs)},Zo.scale.category20c=function(){return Zo.scale.ordinal().range(ds)};var gs=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(vt),ps=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(vt),vs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(vt),ds=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(vt);Zo.scale.quantile=function(){return Wi([],[])},Zo.scale.quantize=function(){return Ji(0,1,[0,1])},Zo.scale.threshold=function(){return Gi([.5],[0,1])},Zo.scale.identity=function(){return Ki([0,1])},Zo.svg={},Zo.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=e.apply(this,arguments),o=r.apply(this,arguments)+ms,a=u.apply(this,arguments)+ms,c=(o>a&&(c=o,o=a,a=c),a-o),s=ba>c?"0":"1",l=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);
return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+s+",0 "+n*l+","+n*f+"Z":"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=Qi,e=no,r=to,u=eo;return n.innerRadius=function(e){return arguments.length?(t=bt(e),n):t},n.outerRadius=function(t){return arguments.length?(e=bt(t),n):e},n.startAngle=function(t){return arguments.length?(r=bt(t),n):r},n.endAngle=function(t){return arguments.length?(u=bt(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+e.apply(this,arguments))/2,i=(r.apply(this,arguments)+u.apply(this,arguments))/2+ms;return[Math.cos(i)*n,Math.sin(i)*n]},n};var ms=-Sa,ys=wa-ka;Zo.svg.line=function(){return ro(wt)};var xs=Zo.map({linear:uo,"linear-closed":io,step:oo,"step-before":ao,"step-after":co,basis:po,"basis-open":vo,"basis-closed":mo,bundle:yo,cardinal:fo,"cardinal-open":so,"cardinal-closed":lo,monotone:So});xs.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Ms=[0,2/3,1/3,0],_s=[0,1/3,2/3,0],bs=[0,1/6,2/3,1/6];Zo.svg.line.radial=function(){var n=ro(ko);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},ao.reverse=co,co.reverse=ao,Zo.svg.area=function(){return Eo(wt)},Zo.svg.area.radial=function(){var n=Eo(ko);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},Zo.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),s=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,s)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,s.r,s.p0)+r(s.r,s.p1,s.a1-s.a0)+u(s.r,s.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)+ms,l=s.call(n,u,r)+ms;return{r:i,a0:o,a1:l,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(l),i*Math.sin(l)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>ba)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=gr,o=pr,a=Ao,c=to,s=eo;return n.radius=function(t){return arguments.length?(a=bt(t),n):a},n.source=function(t){return arguments.length?(i=bt(t),n):i},n.target=function(t){return arguments.length?(o=bt(t),n):o},n.startAngle=function(t){return arguments.length?(c=bt(t),n):c},n.endAngle=function(t){return arguments.length?(s=bt(t),n):s},n},Zo.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=gr,e=pr,r=Co;return n.source=function(e){return arguments.length?(t=bt(e),n):t},n.target=function(t){return arguments.length?(e=bt(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},Zo.svg.diagonal.radial=function(){var n=Zo.svg.diagonal(),t=Co,e=n.projection;return n.projection=function(n){return arguments.length?e(No(t=n)):t},n},Zo.svg.symbol=function(){function n(n,r){return(ws.get(t.call(this,n,r))||To)(e.call(this,n,r))}var t=Lo,e=zo;return n.type=function(e){return arguments.length?(t=bt(e),n):t},n.size=function(t){return arguments.length?(e=bt(t),n):e},n};var ws=Zo.map({circle:To,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*As)),e=t*As;return"M0,"+-t+"L"+e+",0"+" 0,"+t+" "+-e+",0"+"Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Es),e=t*Es/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Es),e=t*Es/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});Zo.svg.symbolTypes=ws.keys();var Ss,ks,Es=Math.sqrt(3),As=Math.tan(30*Aa),Cs=[],Ns=0;Cs.call=pa.call,Cs.empty=pa.empty,Cs.node=pa.node,Cs.size=pa.size,Zo.transition=function(n){return arguments.length?Ss?n.transition():n:ma.transition()},Zo.transition.prototype=Cs,Cs.select=function(n){var t,e,r,u=this.id,i=[];n=b(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]);for(var c=this[o],s=-1,l=c.length;++s<l;)(r=c[s])&&(e=n.call(r,r.__data__,s,o))?("__data__"in r&&(e.__data__=r.__data__),Po(e,s,u,r.__transition__[u]),t.push(e)):t.push(null)}return qo(i,u)},Cs.selectAll=function(n){var t,e,r,u,i,o=this.id,a=[];n=w(n);for(var c=-1,s=this.length;++c<s;)for(var l=this[c],f=-1,h=l.length;++f<h;)if(r=l[f]){i=r.__transition__[o],e=n.call(r,r.__data__,f,c),a.push(t=[]);for(var g=-1,p=e.length;++g<p;)(u=e[g])&&Po(u,g,o,i),t.push(u)}return qo(a,o)},Cs.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=R(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return qo(u,this.id)},Cs.tween=function(n,t){var e=this.id;return arguments.length<2?this.node().__transition__[e].tween.get(n):P(this,null==t?function(t){t.__transition__[e].tween.remove(n)}:function(r){r.__transition__[e].tween.set(n,t)})},Cs.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Du:hu,a=Zo.ns.qualify(n);return Ro(this,"attr."+n,t,a.local?i:u)},Cs.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=Zo.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Cs.style=function(n,t,e){function r(){this.style.removeProperty(n)}function u(t){return null==t?r:(t+="",function(){var r,u=Wo.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(r=hu(u,t),function(t){this.style.setProperty(n,r(t),e)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return Ro(this,"style."+n,t,u)},Cs.styleTween=function(n,t,e){function r(r,u){var i=t.call(this,r,u,Wo.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Cs.text=function(n){return Ro(this,"text",n,Do)},Cs.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})},Cs.ease=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof n&&(n=Zo.ease.apply(Zo,arguments)),P(this,function(e){e.__transition__[t].ease=n}))},Cs.delay=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].delay:P(this,"function"==typeof n?function(e,r,u){e.__transition__[t].delay=+n.call(e,e.__data__,r,u)}:(n=+n,function(e){e.__transition__[t].delay=n}))},Cs.duration=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].duration:P(this,"function"==typeof n?function(e,r,u){e.__transition__[t].duration=Math.max(1,n.call(e,e.__data__,r,u))}:(n=Math.max(1,n),function(e){e.__transition__[t].duration=n}))},Cs.each=function(n,t){var e=this.id;if(arguments.length<2){var r=ks,u=Ss;Ss=e,P(this,function(t,r,u){ks=t.__transition__[e],n.call(t,t.__data__,r,u)}),ks=r,Ss=u}else P(this,function(r){var u=r.__transition__[e];(u.event||(u.event=Zo.dispatch("start","end"))).on(n,t)});return this},Cs.transition=function(){for(var n,t,e,r,u=this.id,i=++Ns,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],s=0,l=t.length;l>s;s++)(e=t[s])&&(r=Object.create(e.__transition__[u]),r.delay+=r.duration,Po(e,s,i,r)),n.push(e)}return qo(o,i)},Zo.svg.axis=function(){function n(n){n.each(function(){var n,s=Zo.select(this),l=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):wt:t,p=s.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",ka),d=Zo.transition(p.exit()).style("opacity",ka).remove(),m=Zo.transition(p.order()).style("opacity",1),y=Ti(f),x=s.selectAll(".domain").data([0]),M=(x.enter().append("path").attr("class","domain"),Zo.transition(x));v.append("line"),v.append("text");var _=v.select("line"),b=m.select("line"),w=p.select("text").text(g),S=v.select("text"),k=m.select("text");switch(r){case"bottom":n=Uo,_.attr("y2",u),S.attr("y",Math.max(u,0)+o),b.attr("x2",0).attr("y2",u),k.attr("x",0).attr("y",Math.max(u,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+i+"V0H"+y[1]+"V"+i);break;case"top":n=Uo,_.attr("y2",-u),S.attr("y",-(Math.max(u,0)+o)),b.attr("x2",0).attr("y2",-u),k.attr("x",0).attr("y",-(Math.max(u,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+-i+"V0H"+y[1]+"V"+-i);break;case"left":n=jo,_.attr("x2",-u),S.attr("x",-(Math.max(u,0)+o)),b.attr("x2",-u).attr("y2",0),k.attr("x",-(Math.max(u,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),M.attr("d","M"+-i+","+y[0]+"H0V"+y[1]+"H"+-i);break;case"right":n=jo,_.attr("x2",u),S.attr("x",Math.max(u,0)+o),b.attr("x2",u).attr("y2",0),k.attr("x",Math.max(u,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),M.attr("d","M"+i+","+y[0]+"H0V"+y[1]+"H"+i)}if(f.rangeBand){var E=f,A=E.rangeBand()/2;l=f=function(n){return E(n)+A}}else l.rangeBand?l=f:d.call(n,f);v.call(n,l),m.call(n,f)})}var t,e=Zo.scale.linear(),r=zs,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Ls?t+"":zs,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var zs="bottom",Ls={top:1,right:1,bottom:1,left:1};Zo.svg.brush=function(){function n(i){i.each(function(){var i=Zo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(p,wt);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Ts[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,f=Zo.transition(i),h=Zo.transition(o);c&&(l=Ti(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),e(f)),s&&(l=Ti(s),h.attr("y",l[0]).attr("height",l[1]-l[0]),r(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+l[+/e$/.test(n)]+","+f[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",l[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function r(n){n.select(".extent").attr("y",f[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function u(){function u(){32==Zo.event.keyCode&&(C||(x=null,z[0]-=l[1],z[1]-=f[1],C=2),y())}function p(){32==Zo.event.keyCode&&2==C&&(z[0]+=l[1],z[1]+=f[1],C=0,y())}function v(){var n=Zo.mouse(_),u=!1;M&&(n[0]+=M[0],n[1]+=M[1]),C||(Zo.event.altKey?(x||(x=[(l[0]+l[1])/2,(f[0]+f[1])/2]),z[0]=l[+(n[0]<x[0])],z[1]=f[+(n[1]<x[1])]):x=null),E&&d(n,c,0)&&(e(S),u=!0),A&&d(n,s,1)&&(r(S),u=!0),u&&(t(S),w({type:"brush",mode:C?"move":"resize"}))}function d(n,t,e){var r,u,a=Ti(t),c=a[0],s=a[1],p=z[e],v=e?f:l,d=v[1]-v[0];return C&&(c-=p,s-=d+p),r=(e?g:h)?Math.max(c,Math.min(s,n[e])):n[e],C?u=(r+=p)+d:(x&&(p=Math.max(c,Math.min(s,2*x[e]-r))),r>p?(u=r,r=p):u=p),v[0]!=r||v[1]!=u?(e?o=null:i=null,v[0]=r,v[1]=u,!0):void 0}function m(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),Zo.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),N(),w({type:"brushend"})}var x,M,_=this,b=Zo.select(Zo.event.target),w=a.of(_,arguments),S=Zo.select(_),k=b.datum(),E=!/^(n|s)$/.test(k)&&c,A=!/^(e|w)$/.test(k)&&s,C=b.classed("extent"),N=I(),z=Zo.mouse(_),L=Zo.select(Wo).on("keydown.brush",u).on("keyup.brush",p);if(Zo.event.changedTouches?L.on("touchmove.brush",v).on("touchend.brush",m):L.on("mousemove.brush",v).on("mouseup.brush",m),S.interrupt().selectAll("*").interrupt(),C)z[0]=l[0]-z[0],z[1]=f[0]-z[1];else if(k){var T=+/w$/.test(k),q=+/^n/.test(k);M=[l[1-T]-z[0],f[1-q]-z[1]],z[0]=l[T],z[1]=f[q]}else Zo.event.altKey&&(x=z.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),Zo.select("body").style("cursor",b.style("cursor")),w({type:"brushstart"}),v()}var i,o,a=M(n,"brushstart","brush","brushend"),c=null,s=null,l=[0,0],f=[0,0],h=!0,g=!0,p=qs[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:l,y:f,i:i,j:o},e=this.__chart__||t;this.__chart__=t,Ss?Zo.select(this).transition().each("start.brush",function(){i=e.i,o=e.j,l=e.x,f=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=gu(l,t.x),r=gu(f,t.y);return i=o=null,function(u){l=t.x=e(u),f=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,p=qs[!c<<1|!s],n):c},n.y=function(t){return arguments.length?(s=t,p=qs[!c<<1|!s],n):s},n.clamp=function(t){return arguments.length?(c&&s?(h=!!t[0],g=!!t[1]):c?h=!!t:s&&(g=!!t),n):c&&s?[h,g]:c?h:s?g:null},n.extent=function(t){var e,r,u,a,h;return arguments.length?(c&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),i=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(h=e,e=r,r=h),(e!=l[0]||r!=l[1])&&(l=[e,r])),s&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],s.invert&&(u=s(u),a=s(a)),u>a&&(h=u,u=a,a=h),(u!=f[0]||a!=f[1])&&(f=[u,a])),n):(c&&(i?(e=i[0],r=i[1]):(e=l[0],r=l[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(h=e,e=r,r=h))),s&&(o?(u=o[0],a=o[1]):(u=f[0],a=f[1],s.invert&&(u=s.invert(u),a=s.invert(a)),u>a&&(h=u,u=a,a=h))),c&&s?[[e,u],[r,a]]:c?[e,r]:s&&[u,a])},n.clear=function(){return n.empty()||(l=[0,0],f=[0,0],i=o=null),n},n.empty=function(){return!!c&&l[0]==l[1]||!!s&&f[0]==f[1]},Zo.rebind(n,a,"on")};var Ts={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},qs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Rs=Qa.format=ic.timeFormat,Ds=Rs.utc,Ps=Ds("%Y-%m-%dT%H:%M:%S.%LZ");Rs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ho:Ps,Ho.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Ho.toString=Ps.toString,Qa.second=Dt(function(n){return new nc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Qa.seconds=Qa.second.range,Qa.seconds.utc=Qa.second.utc.range,Qa.minute=Dt(function(n){return new nc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Qa.minutes=Qa.minute.range,Qa.minutes.utc=Qa.minute.utc.range,Qa.hour=Dt(function(n){var t=n.getTimezoneOffset()/60;return new nc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Qa.hours=Qa.hour.range,Qa.hours.utc=Qa.hour.utc.range,Qa.month=Dt(function(n){return n=Qa.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Qa.months=Qa.month.range,Qa.months.utc=Qa.month.utc.range;var Us=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],js=[[Qa.second,1],[Qa.second,5],[Qa.second,15],[Qa.second,30],[Qa.minute,1],[Qa.minute,5],[Qa.minute,15],[Qa.minute,30],[Qa.hour,1],[Qa.hour,3],[Qa.hour,6],[Qa.hour,12],[Qa.day,1],[Qa.day,2],[Qa.week,1],[Qa.month,1],[Qa.month,3],[Qa.year,1]],Hs=Rs.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",we]]),Fs={range:function(n,t,e){return Zo.range(Math.ceil(n/e)*e,+t,e).map(Oo)},floor:wt,ceil:wt};js.year=Qa.year,Qa.scale=function(){return Fo(Zo.scale.linear(),js,Hs)};var Os=js.map(function(n){return[n[0].utc,n[1]]}),Ys=Ds.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",we]]);Os.year=Qa.year.utc,Qa.scale.utc=function(){return Fo(Zo.scale.linear(),Os,Ys)},Zo.text=St(function(n){return n.responseText}),Zo.json=function(n,t){return kt(n,"application/json",Yo,t)},Zo.html=function(n,t){return kt(n,"text/html",Io,t)},Zo.xml=St(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(Zo):"object"==typeof module&&module.exports&&(module.exports=Zo),this.d3=Zo}();;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/lib/d3.tip.js' */
// d3.tip
// Copyright (c) 2013 Justin Palmer
//
// Tooltips for d3.js SVG visualizations

(function (root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module with d3 as a dependency.
    define(['d3'], factory)
  } else {
    // Browser global.
    root.d3.tip = factory(root.d3)
  }
}(this, function (d3) {

  // Public - contructs a new tooltip
  //
  // Returns a tip
  return function() {
    var direction = d3_tip_direction,
        offset    = d3_tip_offset,
        html      = d3_tip_html,
        node      = initNode(),
        svg       = null,
        point     = null,
        target    = null
  
    function tip(vis) {
      svg = getSVGNode(vis)
      point = svg.createSVGPoint()
      document.body.appendChild(node)
    }
  
    // Public - show the tooltip on the screen
    //
    // Returns a tip
    tip.show = function() {
      var args = Array.prototype.slice.call(arguments)
      if(args[args.length - 1] instanceof SVGElement) target = args.pop()
  
      var content = html.apply(this, args),
          poffset = offset.apply(this, args),
          dir     = direction.apply(this, args),
          nodel   = d3.select(node),
          i       = directions.length,
          coords,
          scrollTop  = document.documentElement.scrollTop || document.body.scrollTop,
          scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
  
      nodel.html(content)
        .style({ opacity: 1, 'pointer-events': 'all' })
  
      while(i--) nodel.classed(directions[i], false)
      coords = direction_callbacks.get(dir).apply(this)
      nodel.classed(dir, true).style({
        top: (coords.top +  poffset[0]) + scrollTop + 'px',
        left: (coords.left + poffset[1]) + scrollLeft + 'px'
      })
  
      return tip
    }
  
    // Public - hide the tooltip
    //
    // Returns a tip
    tip.hide = function() {
      nodel = d3.select(node)
      nodel.style({ opacity: 0, 'pointer-events': 'none' })
      return tip
    }
  
    // Public: Proxy attr calls to the d3 tip container.  Sets or gets attribute value.
    //
    // n - name of the attribute
    // v - value of the attribute
    //
    // Returns tip or attribute value
    tip.attr = function(n, v) {
      if (arguments.length < 2 && typeof n === 'string') {
        return d3.select(node).attr(n)
      } else {
        var args =  Array.prototype.slice.call(arguments)
        d3.selection.prototype.attr.apply(d3.select(node), args)
      }
  
      return tip
    }
  
    // Public: Proxy style calls to the d3 tip container.  Sets or gets a style value.
    //
    // n - name of the property
    // v - value of the property
    //
    // Returns tip or style property value
    tip.style = function(n, v) {
      if (arguments.length < 2 && typeof n === 'string') {
        return d3.select(node).style(n)
      } else {
        var args =  Array.prototype.slice.call(arguments)
        d3.selection.prototype.style.apply(d3.select(node), args)
      }
  
      return tip
    }
  
    // Public: Set or get the direction of the tooltip
    //
    // v - One of n(north), s(south), e(east), or w(west), nw(northwest),
    //     sw(southwest), ne(northeast) or se(southeast)
    //
    // Returns tip or direction
    tip.direction = function(v) {
      if (!arguments.length) return direction
      direction = v == null ? v : d3.functor(v)
  
      return tip
    }
  
    // Public: Sets or gets the offset of the tip
    //
    // v - Array of [x, y] offset
    //
    // Returns offset or
    tip.offset = function(v) {
      if (!arguments.length) return offset
      offset = v == null ? v : d3.functor(v)
  
      return tip
    }
  
    // Public: sets or gets the html value of the tooltip
    //
    // v - String value of the tip
    //
    // Returns html value or tip
    tip.html = function(v) {
      if (!arguments.length) return html
      html = v == null ? v : d3.functor(v)
  
      return tip
    }
  
    function d3_tip_direction() { return 'n' }
    function d3_tip_offset() { return [0, 0] }
    function d3_tip_html() { return ' ' }
  
    var direction_callbacks = d3.map({
      n:  direction_n,
      s:  direction_s,
      e:  direction_e,
      w:  direction_w,
      nw: direction_nw,
      ne: direction_ne,
      sw: direction_sw,
      se: direction_se
    }),
  
    directions = direction_callbacks.keys()
  
    function direction_n() {
      var bbox = getScreenBBox()
      return {
        top:  bbox.n.y - node.offsetHeight,
        left: bbox.n.x - node.offsetWidth / 2
      }
    }
  
    function direction_s() {
      var bbox = getScreenBBox()
      return {
        top:  bbox.s.y,
        left: bbox.s.x - node.offsetWidth / 2
      }
    }
  
    function direction_e() {
      var bbox = getScreenBBox()
      return {
        top:  bbox.e.y - node.offsetHeight / 2,
        left: bbox.e.x
      }
    }
  
    function direction_w() {
      var bbox = getScreenBBox()
      return {
        top:  bbox.w.y - node.offsetHeight / 2,
        left: bbox.w.x - node.offsetWidth
      }
    }
  
    function direction_nw() {
      var bbox = getScreenBBox()
      return {
        top:  bbox.nw.y - node.offsetHeight,
        left: bbox.nw.x - node.offsetWidth
      }
    }
  
    function direction_ne() {
      var bbox = getScreenBBox()
      return {
        top:  bbox.ne.y - node.offsetHeight,
        left: bbox.ne.x
      }
    }
  
    function direction_sw() {
      var bbox = getScreenBBox()
      return {
        top:  bbox.sw.y,
        left: bbox.sw.x - node.offsetWidth
      }
    }
  
    function direction_se() {
      var bbox = getScreenBBox()
      return {
        top:  bbox.se.y,
        left: bbox.e.x
      }
    }
  
    function initNode() {
      var node = d3.select(document.createElement('div'))
      node.style({
        position: 'absolute',
        top: 0,
        opacity: 0,
        'pointer-events': 'none',
        'box-sizing': 'border-box'
      })
  
      return node.node()
    }
  
    function getSVGNode(el) {
      el = el.node()
      if(el.tagName.toLowerCase() == 'svg')
        return el
  
      return el.ownerSVGElement
    }
  
    // Private - gets the screen coordinates of a shape
    //
    // Given a shape on the screen, will return an SVGPoint for the directions
    // n(north), s(south), e(east), w(west), ne(northeast), se(southeast), nw(northwest),
    // sw(southwest).
    //
    //    +-+-+
    //    |   |
    //    +   +
    //    |   |
    //    +-+-+
    //
    // Returns an Object {n, s, e, w, nw, sw, ne, se}
    function getScreenBBox() {
      var targetel   = target || d3.event.target,
          bbox       = {},
          matrix     = targetel.getScreenCTM(),
          tbbox      = targetel.getBBox(),
          width      = tbbox.width,
          height     = tbbox.height,
          x          = tbbox.x,
          y          = tbbox.y
  
      point.x = x
      point.y = y
      bbox.nw = point.matrixTransform(matrix)
      point.x += width
      bbox.ne = point.matrixTransform(matrix)
      point.y += height
      bbox.se = point.matrixTransform(matrix)
      point.x -= width
      bbox.sw = point.matrixTransform(matrix)
      point.y -= height / 2
      bbox.w  = point.matrixTransform(matrix)
      point.x += width
      bbox.e = point.matrixTransform(matrix)
      point.x -= width / 2
      point.y -= height / 2
      bbox.n = point.matrixTransform(matrix)
      point.y += height
      bbox.s = point.matrixTransform(matrix)
  
      return bbox
    }
  
    return tip
  };

}));;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-nav.js' */
define('graph/navbuilder', ['underscore', 'stash/api/util/navbuilder', 'model/page-state', 'exports'],
    function (_, nav, pageState, exports) {

        function getContributionsLink(userName, from, to) {
            var params = {
                name: userName
            };
            if (from) {
                params.from = from;
            }
            if (to) {
                params.to = to;
            }
            return nav.pluginServlets().path('user-contributions').withParams(params).buildAbsolute();
        }

        function getChangesetLink(key, slug, id) {
            return nav.project(key).repo(slug).changeset(id).buildAbsolute();
        }

        function getPullRequestLink(key, slug, id) {
            return nav.project(key).repo(slug).pullRequest(id).buildAbsolute();
        }

        function getFileDiffLink(key, slug, id, file) {
            return nav.project(key).repo(slug).changeset(id).withFragment(file).buildAbsolute()
        }

        function getRepoGraphsURL(params) {
            var defaultParams = {
                projectKey: pageState.getProject().getKey(),
                repoSlug: pageState.getRepository().getSlug()
            };
            if (params.allBranches || !pageState.getRevisionRef().isDefault()) {
                defaultParams.refId = params.ref.id;
            }
            var cleanParams = _.omit(params, ['ref', 'allBranches']);
            return nav.pluginServlets().path('graphs').withParams(_.extend(defaultParams, cleanParams)).buildAbsolute();
        }

        function parse(url) {
            return nav.parse(url);
        }

        function getCommitsGraphURL() {
            return nav.rest('stash-graph')
                .project(pageState.getProject())
                .repo(pageState.getRepository())
                .addPathComponents('parents')
                .build()
        }

        exports.getContributionsLink = getContributionsLink;
        exports.getChangesetLink = getChangesetLink;
        exports.getPullRequestLink = getPullRequestLink;
        exports.getFileDiffLink = getFileDiffLink;
        exports.getRepoGraphsURL = getRepoGraphsURL;
        exports.getCommitsGraphURL = getCommitsGraphURL;
        exports.parse = parse;
    });

;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-license.js' */
define('graph/license', ['jquery', 'aui', 'model/page-state', 'util/client-storage', 'graphs/timeHelper', 'exports'],
    function ($, AJS, pageState, storage, timeHelper, exports) {

        var licenseAttributes;

        function getNoShowExpiresDialogKey() {
            return 'graphNoShowExpiresDialog_' + licenseAttributes.expiry;
        }

        function setLicenseAttributes(licenseAttr) {
            licenseAttributes = licenseAttr;
            AJS.log(licenseAttributes);
            if (licenseAttributes.expiry) {
                licenseAttributes.expiryDate = timeHelper.licenseFormat(licenseAttributes.expiry);
            }
        }

        function isFeatured() {
            return licenseAttributes.featured;
        }

        function isEnds() {
            return licenseAttributes.ends;
        }

        function isCluster() {
            return licenseAttributes.cluster;
        }

        function getExpiryDate() {
            return licenseAttributes.expiryDate;
        }

        function createCommitsGraphTooltip($target) {
            AJS.InlineDialog($target, 'buy', function (content, trigger, showPopup) {
                    content.html("\u003cp\u003eIn order to use this functionality in full you need to purchase a \u003ca href=\u0022https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs?from=commits-graph\u0022 target=\u0022_blank\u0022\u003ecommercial\u003c/a\u003e license for Awesome Graphs add-on.\u003c/p\u003e\u003cp\u003e\u003ca href=\u0022https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs?from=commits-graph\u0022 target=\u0022_blank\u0022\u003eBuy it now\u003c/a\u003e\u003c/p\u003e");
                    showPopup();
                    return false;
                },
                {width: 250}
            );
        }

        function createBranchSelectorTooltip() {
            AJS.InlineDialog($('#stilt-branch-button'), 'branch', function (content, trigger, showPopup) {
                    var user = pageState.getCurrentUser();
                    content.html(Graph.Repository.licenseTooltipBranch({
                        emailAddress: user.get('emailAddress')
                    }));
                    showPopup();
                    return false;
                },
                {width: 250}
            );
        }

        function createGroupWidgetTooltip() {
            AJS.InlineDialog($('#group-variants'), 'group-widget', function (content, trigger, showPopup) {
                    var user = pageState.getCurrentUser();
                    content.html(Graph.Repository.licenseTooltipGroupWidget({
                        emailAddress: user.get('emailAddress')
                    }));
                    showPopup();
                    return false;
                },
                {width: 250}
            );
        }

        function showTemplateDialog(params) {
            var dialog = AJS.InlineDialog($('#' + params.targetId), params.dialogId, function (content, trigger, showPopup) {
                    content.html(params.content);
                    showPopup();
                    return false;
                },
                {
                    width: 250,
                    noBind: true,
                    initCallback: function () {
                        $('#' + params.closeId).on('click', function () {
                            dialog.hide();
                            storage.setItem(params.storageKey, true, {noCleanup: true}, 'local');
                        });
                    }
                }
            );

            !storage.getItem(params.storageKey, 'local') && dialog.show()
        }

        function showExpiresDialog(targetId) {
            return showTemplateDialog({
                targetId: targetId,
                dialogId: 'ends',
                content: Graph.Repository.licenseEndsDialog({
                    expiryDate: getExpiryDate()
                }),
                closeId: 'featured-dialog-close',
                storageKey: getNoShowExpiresDialogKey()
            });
        }

        function showFremiumDialog(targetId) {
            return showTemplateDialog({
                targetId: targetId,
                dialogId: 'freemium',
                content: Graph.Repository.freemiumDialog(),
                closeId: 'freemium-dialog-close',
                storageKey: 'graphNoShowFreemiumDialog'
            });
        }

        function showLicenseInCluster(container) {
            container.html(aui.message.info({
                content: "Your Stash is running in cluster mode. Awesome Graphs is available in Stash Data Center when you have a commercial license for the add-on. You can \u003ca href=https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\u003ebuy a license\u003c/a\u003e on the Atlassian Marketplace."
            }));
        }

        function showExpiresMessage(content) {
            $('.license-ends-message').remove();
            content.before(aui.message.info({
                content: Graph.User.licenseEndsDialog({expiryDate: getExpiryDate()})
            }));
        }

        function showFreemiumMessageUserContributions(container) {
            container.addClass('no-license-graph').before(Graph.User.freemiumMessage());
        }

        function showFreemiumMessageCodeFrequency(container) {
            var user = pageState.getCurrentUser();
            container.addClass('no-license-graph').before(Graph.Repository.freemiumMessage(
                user ? {userEmail: user.get('emailAddress')} : {}
            ));
        }

        exports.setLicenseAttributes = setLicenseAttributes;
        exports.isFeatured = isFeatured;
        exports.isCluster = isCluster;
        exports.isEnds = isEnds;
        exports.getExpiryDate = getExpiryDate;
        exports.createCommitsGraphTooltip = createCommitsGraphTooltip;
        exports.createBranchSelectorTooltip = createBranchSelectorTooltip;
        exports.showLicenseInCluster = showLicenseInCluster;
        exports.showExpiresDialog = showExpiresDialog;
        exports.showFremiumDialog = showFremiumDialog;
        exports.showExpiresMessage = showExpiresMessage;
        exports.showFreemiumMessageUserContributions = showFreemiumMessageUserContributions;
        exports.showFreemiumMessageCodeFrequency = showFreemiumMessageCodeFrequency;
        exports.createGroupWidgetTooltip = createGroupWidgetTooltip;

    });
;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-utility.js' */
define('graphs/utility', ['jquery', 'exports'],
    function ($, exports) {

        function getScrollWidth() {
            var div = document.createElement('div');
            div.style.overflowY = 'scroll';
            div.style.width = '50px';
            div.style.height = '50px';
            div.style.visibility = 'hidden';

            $('body').append(div);
            var scrollWidth = div.offsetWidth - div.clientWidth;
            $(div).remove();
            return scrollWidth;
        }

        function isUglyTick(a, b) {
            return b === 0 || (a ^ 0) !== a;
        }

        function shouldDisplayTick(a, b) {
            return isUglyTick(a, b) ? "none" : "block";
        }

        exports.getScrollWidth = getScrollWidth;
        exports.shouldDisplayTick = shouldDisplayTick;
    });;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-date-helper.js' */
define('graphs/timeHelper', ['exports'],
    function (exports) {

        var parseYmd = function (date) {
            return d3.time.format("%Y-%m-%d").parse(date);
        };

        var formatYmdDate = function (date) {
            return d3.time.format("%Y-%m-%d")(date);
        };

        var format = function (template, date) {
            return d3.time.format(template)(parseYmd(date));
        };

        var fullFormat = function (date) {
            return format("%B %d %Y", date);
        };

        var activityFormat = function (date) {
            return format("%B %d, %Y", date);
        };

        var activityFormatDate = function (date) {
            return d3.time.format("%B %d, %Y")(date);
        };

        var formatCodeFrequencyTipDate = function (date) {
            return d3.time.format("%A, %d %B %Y")(date);
        };

        var formatDomainTitleDate = function (date) {
            return d3.time.format('%B %e, %Y')(date);
        };

        var monthFormat = function (date) {
            return format("%b", date);
        };

        var licenseFormat = function (date) {
            return format("%b %e, %Y", date)
        };

        var getIntervals = function (start, end, type) {
            return d3.time[type].range(d3.time[type].floor(start), d3.time[type].ceil(end));
        };

        var getDays = function (start, end) {
            return getIntervals(start, end, 'day');
        };

        var getWeeks = function (start, end) {
            return getIntervals(start, end, 'week');
        };

        var getMonths = function (start, end) {
            return getIntervals(start, end, 'month');
        };

        var getRoundedExtent = function (extent, interval) {
            var rExtent = extent.map(d3.time[interval].round);

            // if empty when rounded, use floor & ceil instead
            if (rExtent[0] >= rExtent[1]) {
                rExtent[0] = d3.time[interval].floor(extent[0]);
                rExtent[1] = d3.time[interval].ceil(extent[1]);
            }
            return rExtent;
        };

        var getLastYearDate = function (date) {
            return d3.time.year.offset(date, -1);
        };

        exports.parseYmd = parseYmd;
        exports.formatYmdDate = formatYmdDate;
        exports.fullFormat = fullFormat;
        exports.monthFormat = monthFormat;
        exports.licenseFormat = licenseFormat;
        exports.activityFormat = activityFormat;
        exports.activityFormatDate = activityFormatDate;
        exports.formatCodeFrequencyTipDate = formatCodeFrequencyTipDate;
        exports.formatDomainTitleDate = formatDomainTitleDate;
        exports.getDays = getDays;
        exports.getWeeks = getWeeks;
        exports.getMonths = getMonths;
        exports.getRoundedExtent = getRoundedExtent;
        exports.getLastYearDate = getLastYearDate;
    });;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-loader.js' */
define('graphs/loader', ['underscore', 'aui', 'util/ajax', 'exports'],
    function (_, AJS, ajax, exports) {

        'use strict';

        var request;

        function load(params) {
            var resource = AJS.contextPath() + '/rest/stash-graph/1.0/' + params.resource,
                method = params.method || 'rest',
                wait = _.isUndefined(params.wait) || params.wait,
                opts = _.defaults(params.opts, {type: 'GET', cache: true});

            if (request && wait && request.state() === 'pending') {
                return request;
            }

            if (request && method === 'poll' && request.state() === 'pending' && !wait) {
                request.pause();
            }

            request = ajax[method](_.extend({url: resource}, opts));

            return request;
        }

        function isFree() {
            return !request || request.state() !== 'pending';
        }

        exports.load = load;
        exports.isFree = isFree;
    });;
;/* module-key = 'com.atlassian.plugins.atlassian-chaperone:internals', location = '/internals/syncing.js' */
var Chaperone={_internal:{}};Chaperone._internal.syncing=(function(){function a(c,d){return(d||AJS.$).ajax({url:AJS.contextPath()+"/rest/chaperone/1/chaperone/"+c})}function b(c,e,d){return(d||AJS.$).ajax({url:AJS.contextPath()+"/rest/chaperone/1/chaperone/"+c,type:"POST",data:{json:e}})}return{syncToServer:b,syncFromServer:a}})();;
;/* module-key = 'com.atlassian.plugins.atlassian-chaperone:feature-discovery', location = '/feature-discovery/feature-discovery.js' */
(function(i,g,k,e,f){var j=e.syncFromServer;var h=e.syncToServer;var c=g.Callbacks();g(document).on("ajaxStop",function(){c.fire()});var b=g.Callbacks();g(window).on("resize",function(){b.fire()});function a(l){var m=g.Deferred();function n(){var o=g(l);if(o.length){m.resolve(o);c.remove(n)}}c.add(n);n();return m}function d(p,r,m,o){var l=g.Callbacks();var n=g.Callbacks();var s=g.Callbacks();function q(u){var w;function t(y){return function(){g(document).off("hideLayer",v);u.off(".chaperone");w.remove();b.remove(w.refresh);c.remove(x);if(y){y.fire()}}}function x(){if(!u.is(":visible")){t()()}}var v=t(l);w=new i.InlineDialog(u,"feature-discovery-"+p,function(A,y,D){A.html(chaperone.featureDiscovery.content({step:r,paging:m}));var C=A.find(".feature-discovery-action");var z=A.find(".feature-discovery-next");var B=A.find(".feature-discovery-close");if(r.action&&r.action.click){C.click(r.action.click)}u.on("click.chaperone",t(s));z.click(t(n));B.click(v);C.click(t(s));D();if(!o.modal){k.delay(function(){g(document).on("showLayer",v)},100)}},{closeOthers:false,hideDelay:null,noBind:true,gravity:r.gravity||(r.dir||"s").replace(/[nswe]/g,function(y){return{n:"s",s:"n",e:"w",w:"e"}[y]}),offsetX:r.offsetX,offsetY:r.offsetY,persistent:true,width:r.width||300,addActiveClass:false});b.add(w.refresh);c.add(x);w.show()}return{showWhenTargetVisible:function(){return a(r.selector).then(q)},on:function(t,u){switch(t){case"close":l.add(u);break;case"next":n.add(u);break;case"action":s.add(u);break}}}}f.registerFeature=function(n,l,m){m=m||{};var p=j(n).pipe(function(q){q=q||{};if(q.isAllDismissed){return g.Deferred().reject()}return q});function o(t,r,q){var s=r.stepInfoById[t.id||t.selector];switch(m.dismissalMode){case"progressive":s.isDismissed=true;h(n,JSON.stringify(r));break;default:if(q&&!r.isAllDismissed){r.isAllDismissed=true;h(n,JSON.stringify(r))}break}}k.reduce(l,function(r,q){return r.then(function(x){var D=x.stepInfoById=x.stepInfoById||{};var w=q.id||q.selector;var s=D[w]=D[w]||{};if(s.isDismissed){return r}var B=l.length;var v=k.indexOf(l,q);var t=v<B-1;var y=new d(n,q,{numSteps:B,stepIndex:v,hasNext:t},m);var C=g.Deferred();y.on("close",C.reject);y.on("next",k.bind(C.resolve,C,x));y.on("action",k.bind(C.resolve,C,x));var z=y.showWhenTargetVisible();var A=k.bind(o,null,q,x,!t);var u=k.bind(o,null,q,x,"all");if(q.once){z.then(A)}else{y.on("close",u);y.on("next",A);y.on("action",A)}return C})},p)};f.checkFeatureVisibility=function(){c.fire()};f.checkFeatureAlignment=function(){b.fire()}})(AJS,AJS.$,_,Chaperone._internal.syncing,Chaperone);;
;/* module-key = 'com.atlassian.plugins.atlassian-chaperone:feature-discovery', location = '/feature-discovery/feature-discovery.soy' */
// This file was automatically generated from feature-discovery.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace chaperone.featureDiscovery.
 */

if (typeof chaperone == 'undefined') { var chaperone = {}; }
if (typeof chaperone.featureDiscovery == 'undefined') { chaperone.featureDiscovery = {}; }


chaperone.featureDiscovery.content = function(opt_data, opt_ignored) {
  return '' + ((opt_data.step.title) ? '<h2>' + soy.$$escapeHtml(opt_data.step.title) + '</h2>' : '') + ((opt_data.step.content) ? soy.$$filterNoAutoescape(opt_data.step.content) : '') + aui.form.form({action: '', content: '' + ((opt_data.step.action && opt_data.step.action.text) ? aui.buttons.button(soy.$$augmentMap(opt_data.step.action, {extraClasses: aui.renderExtraClasses(opt_data.step.action) + ' feature-discovery-action', extraAttributes: aui.renderExtraAttributes(opt_data.step.action) + ' type="button"'})) : '') + ((opt_data.paging && opt_data.paging.hasNext) ? aui.buttons.button({text: "Next", type: opt_data.step.action && opt_data.step.action.text ? 'link' : null, extraClasses: 'feature-discovery-next', extraAttributes: {type: 'button'}}) : '') + aui.buttons.button({text: "Close", type: opt_data.step.action && opt_data.step.action.text || opt_data.paging && opt_data.paging.hasNext ? 'link' : null, extraClasses: 'feature-discovery-close', extraAttributes: {type: 'button'}}) + ((opt_data.step.moreInfo) ? aui.buttons.button(soy.$$augmentMap(opt_data.step.moreInfo, {text: opt_data.step.moreInfo.text ? opt_data.step.moreInfo.text : "Learn more", type: 'link'})) : '') + ((opt_data.paging && opt_data.paging.numSteps > 1) ? '<span class="multi-step-trigger">' + soy.$$escapeHtml(AJS.format("{0}/{1}",opt_data.paging.stepIndex + 1,opt_data.paging.numSteps)) + '</span>' : '')});
};
if (goog.DEBUG) {
  chaperone.featureDiscovery.content.soyTemplateName = 'chaperone.featureDiscovery.content';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:chaperone-feature-discovery', location = '/static/lib/chaperone-AMD.js' */
define("chaperone",function(){return Chaperone});;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'soy/client/graph-repository.soy' */
// This file was automatically generated from graph-repository.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Graph.Repository.
 */

if (typeof Graph == 'undefined') { var Graph = {}; }
if (typeof Graph.Repository == 'undefined') { Graph.Repository = {}; }


Graph.Repository.indexingProgress = function(opt_data, opt_ignored) {
  return '<div class="index-progress-message">' + soy.$$escapeHtml("Repository data indexing is in progress.") + '</div><div id="graph-index-progress" class="aui-progress-indicator"><span class="aui-progress-indicator-value"></span></div><div class="index-progress-message-details"></div>';
};
if (goog.DEBUG) {
  Graph.Repository.indexingProgress.soyTemplateName = 'Graph.Repository.indexingProgress';
}


Graph.Repository.graphDomain = function(opt_data, opt_ignored) {
  return '<div class="graph-domain"><h3 id="' + opt_data.titleId + '" class="graph-domain-title">' + ((opt_data.title) ? ' ' + opt_data.title + ' ' : '') + '</h3><span ' + ((opt_data.messageId) ? ' id=' + opt_data.messageId + ' ' : '') + ' class="graph-domain-message">' + ((opt_data.message) ? ' ' + opt_data.message + ' ' : '') + '</span></div>';
};
if (goog.DEBUG) {
  Graph.Repository.graphDomain.soyTemplateName = 'Graph.Repository.graphDomain';
}


Graph.Repository.codeFrequencyTip = function(opt_data, opt_ignored) {
  return '<div class="day-title"><span class="aui-icon aui-icon-small aui-iconfont-calendar"></span>&nbsp;' + opt_data.day + '</div><div class="legend-line"><div class="aui-icon aui-icon-small legend-square add"></div>&nbsp;' + AJS.format("Added {0} lines",opt_data.added) + '</div><div class="legend-line"><div class="aui-icon aui-icon-small legend-square del"></div>&nbsp;' + AJS.format("Deleted {0} lines",opt_data.deleted) + '</div><div class="legend-line"><div class="aui-icon aui-icon-small legend-square total"></div>&nbsp;' + AJS.format("Total {0} lines",opt_data.total) + '</div>';
};
if (goog.DEBUG) {
  Graph.Repository.codeFrequencyTip.soyTemplateName = 'Graph.Repository.codeFrequencyTip';
}


Graph.Repository.punchcardHeader = function(opt_data, opt_ignored) {
  return '' + Graph.Repository.graphDomain({titleId: 'p-domain-title', title: opt_data.title, message: "Hover your mouse over a circle to see the number of commits."});
};
if (goog.DEBUG) {
  Graph.Repository.punchcardHeader.soyTemplateName = 'Graph.Repository.punchcardHeader';
}


Graph.Repository.commitActivityHeader = function(opt_data, opt_ignored) {
  return '' + Graph.Repository.graphDomain({titleId: 'ca-domain-title', title: opt_data.title, message: "You can use the arrow keys on your keyboard to navigate from one bar to another. Click a bar to see a total number of commits made that week."});
};
if (goog.DEBUG) {
  Graph.Repository.commitActivityHeader.soyTemplateName = 'Graph.Repository.commitActivityHeader';
}


Graph.Repository.codeFrequencyHeader = function(opt_data, opt_ignored) {
  return Graph.Repository.graphDomain({titleId: 'cf-domain-title', message: "Use your mouse wheel to zoom in or out."}) + '<div class="cf-control-buttons"><span class="zoom-buttons">' + "Zoom" + '&nbsp;<p class="aui-buttons"><button id="code-frequency-zoom-in" title="' + "Zoom in (Type \x27+\x27)" + '" class="aui-button">' + "In" + '</button><button id="code-frequency-zoom-out" title="' + "Zoom out (Type \x27-\x27)" + '" class="aui-button">' + "Out" + '</button><button id="code-frequency-zoom-reset" title="' + "Show the complete graph (Type \x27esc\x27)" + '" class="aui-button">' + "Reset" + '</button></p></span><span>' + "Time" + '&nbsp;<p class="aui-buttons"><button id="code-frequency-shift-left" title="' + "Move the timeline backward (Type \x27\u2190\x27)" + '" class="aui-button">' + "Earlier" + '</button><button id="code-frequency-shift-right" title="' + "Move the timeline forward (Type \x27\u2192\x27)" + '" class="aui-button">' + "Later" + '</button></p></span></div>';
};
if (goog.DEBUG) {
  Graph.Repository.codeFrequencyHeader.soyTemplateName = 'Graph.Repository.codeFrequencyHeader';
}


Graph.Repository.contributionsHead = function(opt_data, opt_ignored) {
  return Graph.Repository.graphDomain({titleId: 'contributions-range', messageId: 'range-message'}) + '<div class="graph-header-right-part">' + Graph.Repository.contributionsTypeSelector(opt_data) + Graph.Repository.groupDataWidget({graphName: 'contributors', group: opt_data.group}) + '</div>';
};
if (goog.DEBUG) {
  Graph.Repository.contributionsHead.soyTemplateName = 'Graph.Repository.contributionsHead';
}


Graph.Repository.contributionsTypeSelector = function(opt_data, opt_ignored) {
  var output = '';
  var additions__soy89 = "Additions";
  var deletions__soy90 = "Deletions";
  var commits__soy91 = "Commits";
  output += '<span class="contributions-selector">' + soy.$$escapeHtml("Show") + '&nbsp;<a href="" aria-owns="type-contributions-selector" aria-haspopup="true" class="aui-button aui-dropdown2-trigger aui-style-default type-contributions-title">';
  switch (opt_data.type) {
    case 'a':
      output += soy.$$escapeHtml(additions__soy89);
      break;
    case 'd':
      output += soy.$$escapeHtml(deletions__soy90);
      break;
    default:
      output += soy.$$escapeHtml(commits__soy91);
  }
  output += '</a><div id="type-contributions-selector" class="aui-dropdown2 aui-style-default"><ul class="aui-list-truncate"><li><a data-type-contributions="c" href="">' + soy.$$escapeHtml(commits__soy91) + '</a></li><li><a data-type-contributions="a" href="">' + soy.$$escapeHtml(additions__soy89) + '</a></li><li><a data-type-contributions="d" href="">' + soy.$$escapeHtml(deletions__soy90) + '</a></li></ul></div></span>';
  return output;
};
if (goog.DEBUG) {
  Graph.Repository.contributionsTypeSelector.soyTemplateName = 'Graph.Repository.contributionsTypeSelector';
}


Graph.Repository.groupDataWidget = function(opt_data, opt_ignored) {
  return '<span class="group-data-widget">' + soy.$$escapeHtml("Display in") + '&nbsp;<p id="group-variants" class="aui-buttons"><button data-group-by="days" class="aui-button ' + soy.$$escapeHtml(opt_data.graphName) + '-group-button" aria-pressed="' + soy.$$escapeHtml(opt_data.group == 'days') + '">Days</button><button data-group-by="weeks" class="aui-button ' + soy.$$escapeHtml(opt_data.graphName) + '-group-button" aria-pressed="' + soy.$$escapeHtml(opt_data.group == 'weeks') + '">Weeks</button><button data-group-by="months" class="aui-button ' + soy.$$escapeHtml(opt_data.graphName) + '-group-button" aria-pressed="' + soy.$$escapeHtml(opt_data.group == 'months') + '">Months</button></p></span>';
};
if (goog.DEBUG) {
  Graph.Repository.groupDataWidget.soyTemplateName = 'Graph.Repository.groupDataWidget';
}


Graph.Repository.licenseTooltipBranch = function(opt_data, opt_ignored) {
  return '<p>' + "The Branch Selection feature can be activated by generating an \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3eevaluation\x3c/a\x3e license or purchasing a \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3ecommercial\x3c/a\x3e license." + '</p><p>' + AJS.format("If you have any questions, please, feel free to \x3ca href\x3d\x22https://helpdesk.stiltsoft.com/support/feedback.html?email\x3d{0}\x26subject\x3dFeedback from Awesome Graphs\x22 target\x3d\x22_blank\x22\x3econtact us\x3c/a\x3e.",opt_data.emailAddress) + '</p>';
};
if (goog.DEBUG) {
  Graph.Repository.licenseTooltipBranch.soyTemplateName = 'Graph.Repository.licenseTooltipBranch';
}


Graph.Repository.licenseTooltipGroupWidget = function(opt_data, opt_ignored) {
  return '<p>' + "\x3cstrong\x3e The Display in\x3c/strong\x3e option can be activated by generating an \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3eevaluation\x3c/a\x3e license or purchasing a \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3ecommercial\x3c/a\x3e license." + '</p><p>' + AJS.format("If you have any questions, please, feel free to \x3ca href\x3d\x22https://helpdesk.stiltsoft.com/support/feedback.html?email\x3d{0}\x26subject\x3dFeedback from Awesome Graphs\x22 target\x3d\x22_blank\x22\x3econtact us\x3c/a\x3e.",opt_data.emailAddress) + '</p>';
};
if (goog.DEBUG) {
  Graph.Repository.licenseTooltipGroupWidget.soyTemplateName = 'Graph.Repository.licenseTooltipGroupWidget';
}


Graph.Repository.stiltBranchButton = function(opt_data, opt_ignored) {
  return '<button id="stilt-branch-button" class="aui-button searchable-selector-trigger revision-reference-selector-trigger" type="button"><span class="aui-icon aui-icon-small aui-iconfont-devtools-branch"/><span class="name" title="' + soy.$$escapeHtml(opt_data.branchName) + '">' + soy.$$escapeHtml(opt_data.branchName) + '</span></button>';
};
if (goog.DEBUG) {
  Graph.Repository.stiltBranchButton.soyTemplateName = 'Graph.Repository.stiltBranchButton';
}


Graph.Repository.licenseEndsDialog = function(opt_data, opt_ignored) {
  return '<p>' + AJS.format("Your \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3eAwesome Graphs for Stash\x3c/a\x3e license is available until \x3cstrong\x3e{0}\x3c/strong\x3e.",opt_data.expiryDate) + '</p><p>' + "When the add-on license expires, the functionality will be restricted to \x3ca href\x3d\x22https://docs.stiltsoft.com/display/AwesomeGraphs/Basic+Functionality?from\x3drepo-graphs-buy-add-on\x22 target\x3d\x22_blank\x22\x3ebasic features\x3c/a\x3e." + '</p><p>' + "In order to continue using \x3ca href\x3d\x22https://docs.stiltsoft.com/display/AwesomeGraphs/Advanced+Functionality?from\x3drepo-graphs-buy-add-on\x22 target\x3d\x22_blank\x22\x3eadvanced features\x3c/a\x3e you need to purchase a \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3ecommercial\x3c/a\x3e license or generate an \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3eevaluation\x3c/a\x3e license." + '</p><p><button id="featured-dialog-close" class="aui-button aui-style" type="button">Close</button></p>';
};
if (goog.DEBUG) {
  Graph.Repository.licenseEndsDialog.soyTemplateName = 'Graph.Repository.licenseEndsDialog';
}


Graph.Repository.freemiumDialog = function(opt_data, opt_ignored) {
  return '<p>' + "You don\x27t have a valid license for \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3eAwesome Graphs for Stash\x3c/a\x3e." + '</p><p>' + "The add-on functionality is restricted to \x3ca href\x3d\x22https://docs.stiltsoft.com/display/AwesomeGraphs/Basic+Functionality?from\x3drepo-graphs-buy-add-on\x22 target\x3d\x22_blank\x22\x3ebasic features\x3c/a\x3e." + '</p><p>' + "In order to use \x3ca href\x3d\x22https://docs.stiltsoft.com/display/AwesomeGraphs/Advanced+Functionality?from\x3drepo-graphs-buy-add-on\x22 target\x3d\x22_blank\x22\x3eadvanced features\x3c/a\x3e you need to purchase a \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3ecommercial\x3c/a\x3e license or generate an \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3eevaluation\x3c/a\x3e license." + '</p><p><button id="freemium-dialog-close" class="aui-button aui-style" type="button">Close</button></p>';
};
if (goog.DEBUG) {
  Graph.Repository.freemiumDialog.soyTemplateName = 'Graph.Repository.freemiumDialog';
}


Graph.Repository.freemiumMessage = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '' + aui.message.info({content: "\x3ca href\x3d\x22https://docs.stiltsoft.com/display/AwesomeGraphs/Code+Frequency?from\x3drepo-graphs-no-license\x22 target\x3d\x22_blank\x22\x3eThe Code frequency\x3c/a\x3e graph can be activated by generating an \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3eevaluation\x3c/a\x3e license or purchasing a \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3ecommercial\x3c/a\x3e license." + '&nbsp;' + (opt_data.userEmail ? AJS.format("If you have any questions, please, feel free to \x3ca href\x3d\x22https://helpdesk.stiltsoft.com/support/feedback.html?email\x3d{0}\x26subject\x3dFeedback from Awesome Graphs\x22 target\x3d\x22_blank\x22\x3econtact us\x3c/a\x3e.",opt_data.userEmail) : "If you have any questions, please, feel free to \x3ca href\x3d\x22https://helpdesk.stiltsoft.com/support/feedback.html\x22 target\x3d\x22_blank\x22\x3econtact us\x3c/a\x3e.")});
};
if (goog.DEBUG) {
  Graph.Repository.freemiumMessage.soyTemplateName = 'Graph.Repository.freemiumMessage';
}
;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/graph-attributes-helper.js' */
define('graphs/attributesHelper', ['jquery', 'aui', 'exports', 'graphs/timeHelper'],
    function ($, AJS, exports, timeHelper) {

        function Graph(options) {
            AJS.log(options);
            this.options = options;
        }

        Graph.prototype.setRef = function (ref) {
            this.options.ref = ref;
        };

        Graph.prototype.getRef = function () {
            return this.options.ref;
        };

        Graph.prototype.getName = function () {
            return this.options.graph;
        };

        Graph.prototype.isContributors = function () {
            return this.options.graph == 'contributors';
        };

        Graph.prototype.isCommitActivity = function () {
            return this.options.graph == 'commit-activity';
        };

        Graph.prototype.isCodeFrequency = function () {
            return this.options.graph == 'code-frequency';
        };

        Graph.prototype.isPunchCard = function () {
            return this.options.graph == 'punch-card';
        };

        Graph.prototype.isAllBranches = function () {
            return this.options.ref.id == 'all-branches';
        };

        Graph.prototype.getSavedState = function () {
            var t = this;
            return {
                graph: t.getName(),
                ref: t.getRef(),
                allBranches: t.isAllBranches()
            };
        };

        function getContributorsGraph(options, attributes) {
            options.type = attributes.type || 'c';
            options.group = attributes.group || 'weeks';

            if (attributes.from && attributes.to) {
                options.from = attributes.from;
                options.to = attributes.to;
                options.fromDate = timeHelper.parseYmd(attributes.from);
                options.toDate = timeHelper.parseYmd(attributes.to);
            }

            var graph = new Graph(options);

            graph.getRepoDates = function () {
                return this.options.dates;
            };

            graph.setRepoDates = function (dates) {
                this.options.dates = dates;
            };

            graph.getType = function () {
                return this.options.type;
            };

            graph.setType = function (type) {
                this.options.type = type;
            };

            graph.getGroup = function () {
                return this.options.group;
            };

            graph.setGroup = function (group) {
                this.options.group = group;
            };

            graph.isSelectedRange = function () {
                return this.options.from && this.options.to;
            };

            graph.setSelectedRange = function (range) {
                this.options.from = range.from;
                this.options.to = range.to;
                this.options.fromDate = range.fromDate;
                this.options.toDate = range.toDate;
            };

            graph.getSelectedRange = function () {
                return {
                    from: this.options.from,
                    to: this.options.to,
                    fromDate: this.options.fromDate,
                    toDate: this.options.toDate
                };
            };

            graph.resetSelectedRange = function () {
                this.options.from = undefined;
                this.options.to = undefined;
                this.options.fromDate = undefined;
                this.options.toDate = undefined;
            };

            graph.getSavedState = function () {
                var t = this;

                var state = $.extend(Graph.prototype.getSavedState.call(t), {
                    type: t.getType(),
                    group: t.getGroup()
                });

                if (t.isSelectedRange()) {
                    var range = t.getSelectedRange();
                    state.from = range.from;
                    state.to = range.to;
                }
                return state;
            };

            return graph;
        }

        var getCodeFrequencyGraph = function (options, attributes) {
            options.zoom = !attributes.zoom ? 1 : parseFloat(attributes.zoom);

            if (attributes.from && attributes.to) {
                options.from = attributes.from;
                options.to = attributes.to;
                options.fromDate = timeHelper.parseYmd(attributes.from);
                options.toDate = timeHelper.parseYmd(attributes.to);
            }

            var graph = new Graph(options);

            graph.getZoom = function () {
                return this.options.zoom;
            };

            graph.setZoom = function (zoom) {
                this.options.zoom = zoom;
            };

            graph.isSelectedRange = function () {
                return this.options.from && this.options.to;
            };

            graph.setSelectedRange = function (range) {
                this.options.from = range.from;
                this.options.to = range.to;
                this.options.fromDate = range.fromDate;
                this.options.toDate = range.toDate;
            };

            graph.getSelectedRange = function () {
                return {
                    from: this.options.from,
                    to: this.options.to,
                    fromDate: this.options.fromDate,
                    toDate: this.options.toDate
                };
            };

            graph.resetSelectedRange = function () {
                this.options.zoom = 1;
                this.options.from = undefined;
                this.options.to = undefined;
                this.options.fromDate = undefined;
                this.options.toDate = undefined;
            };

            graph.getSavedState = function () {
                var t = this;
                var state = $.extend(Graph.prototype.getSavedState.call(t), {
                    zoom: t.getZoom()
                });

                if (t.isSelectedRange()) {
                    var range = t.getSelectedRange();
                    state.from = range.from;
                    state.to = range.to;
                }
                return state;
            };

            return graph;

        };

        function getGraph(attributes) {

            var options = {
                graph: attributes.graph,
                ref: attributes.ref
            };

            if (options.graph == 'contributors') {
                return getContributorsGraph(options, attributes);
            } else if (options.graph == 'code-frequency') {
                return getCodeFrequencyGraph(options, attributes);
            }

            return new Graph(options);

        }

        function getHtmlContent(graph) {
            if (graph.isContributors()) {
                return $('<div />')
                    .append('<div id="js-contributors-header" />')
                    .append('<div id="js-contributors-master" />')
                    .append('<ol id="js-contributors" class="contrib-data"/>');
            } else if (graph.isCommitActivity()) {
                return $('<section />')
                    .append('<section id="js-commit-activity-header" />')
                    .append('<section id="js-commit-activity-master" />')
                    .append('<section id="js-commit-activity-detail" />');
            } else if (graph.isCodeFrequency()) {
                return $('<div />')
                    .append('<div id="js-code-frequency-header" />')
                    .append('<div id="js-code-frequency" />');
            } else if (graph.isPunchCard()) {
                return $('<div />')
                    .append('<div id="js-punchcard-header" />')
                    .append('<div id="js-punchcard" />');
            }
        }

        exports.getHtmlContent = getHtmlContent;
        exports.getGraph = getGraph;

    });
;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/graph-data-helper.js' */
define('graphs/dataHelper', ['underscore', 'jquery', 'exports', 'graphs/timeHelper', 'util/ajax'],
    function (_, $, exports, timeHelper, ajax) {

        // todo этот код можно (и нужно!) улучшить, но глаз уже "замылен"
        // с тяжестью на сердце оставляем этот технический долг, с твердым намерением
        // порефакторить в следующей версии

        function addInContributor(contributor, date, interval, type, author) {
            var intervalDate = d3.time[interval].floor(date),
                key = timeHelper.formatYmdDate(intervalDate);

            if (!contributor[type][key]) {
                contributor[type][key] = {date: intervalDate, c: author.c, a: author.a, d: author.d};
            } else {
                contributor[type][key].c += author.c;
                contributor[type][key].a += author.a;
                contributor[type][key].d += author.d;
            }
        }

        function addInGeneral(data, date, interval, type, author) {
            var intervalDate = d3.time[interval].floor(date),
                key = timeHelper.formatYmdDate(intervalDate);

            if (!data[type][key]) {
                data[type][key] = {c: 0, a: 0, d: 0};
            }

            data[type][key].c += author.c;
            data[type][key].a += author.a;
            data[type][key].d += author.d;
        }

        function getNormalizedContributorsData(days) {
            var defer = $.Deferred();
            var start = new Date().getTime();

            var today = new Date(),
                daysInRepo = {},
                generalData = {days: {}, weeks: {}, months: {}},
                repoDates = d3.extent(days, function (day) {
                    return timeHelper.parseYmd(day.d);
                });

            var timeStart = repoDates[0],
            /*
             d3 при постороении диапазона не включает в него последнее значение https://github.com/mbostock/d3/wiki/Arrays#d3_range

             поэтому, мы округляем "последнюю" дату вверх методом ceil https://github.com/mbostock/d3/wiki/Time-Intervals#interval_ceil
             особенность метода в том, что если отдать ему дату в полночь (имеется в виду дата вида Fri Aug 29 2014 00:00:00 GMT+0300),
             то он и вернет ее в качестве результата ни разу никуда не округлив

             с сервера мы получаем даты вида 2014-08-29, которые парсим средствами d3 и имеем на выходе Fri Aug 29 2014 00:00:00 GMT+0300

             в гите же можно коммитить под любой датой, потому мы не можем просто построить диапазон "до сегодня", а должны найти
             максимально позднюю дату коммита и если она позже, чем текущая дата, то строить до нее (даты последнего коммита).

             в этом месте и возникает проблема: в случае, когда есть "коммиты из будущего", мы получаем "дату в полночь",
             которая благополучно исключается из диапазона, что не есть хорошо.

             именно поэтому, полученную дату последнего коммита, двигаем на день вперед, чтоб получить правильный
             диапазон
             */
                timeEnd = repoDates[1] < today ? today : d3.time.day.offset(repoDates[1], 1);

            timeHelper.getDays(timeStart, timeEnd).forEach(function (day) {
                var d = timeHelper.formatYmdDate(day);
                daysInRepo[d] = {d: d, date: day};
            });

            var contributors = {};

            days.forEach(function (day) {
                day.authors.forEach(function (author) {
                    var id = author.id;

                    if (!contributors[id]) {
                        contributors[id] = {
                            id: id,
                            c: 0,
                            a: 0,
                            d: 0,
                            days: {},
                            weeks: {},
                            months: {}
                        };
                    }

                    contributors[id].c += author.c;
                    contributors[id].a += author.a;
                    contributors[id].d += author.d;

                    contributors[id].days[day.d] = {
                        date: daysInRepo[day.d].date,
                        c: author.c,
                        a: author.a,
                        d: author.d
                    };

                    addInContributor(contributors[id], daysInRepo[day.d].date, 'week', 'weeks', author);
                    addInContributor(contributors[id], daysInRepo[day.d].date, 'month', 'months', author);

                    if (!generalData.days[day.d]) {
                        generalData.days[day.d] = {c: 0, a: 0, d: 0};
                    }

                    generalData.days[day.d].c += author.c;
                    generalData.days[day.d].a += author.a;
                    generalData.days[day.d].d += author.d;

                    addInGeneral(generalData, daysInRepo[day.d].date, 'week', 'weeks', author);
                    addInGeneral(generalData, daysInRepo[day.d].date, 'month', 'months', author);

                });
            });

            var end = new Date().getTime();
            AJS.log("Normalization of data: " + (end - start) + " ms");

            contributors = _.values(contributors);

            ajax.rest({
                url: AJS.contextPath() + '/rest/stash-graph/1.0/contributors/resolve',
                type: 'POST',
                data: contributors.map(function (author) {
                    return author.id;
                }),
                cache: false
            }).done(function (contributorsIds) {
                var normals = [], groups = ['days', 'weeks', 'months'];

                contributorsIds.forEach(function (ids) {
                    var source = {c: 0, a: 0, d: 0, weeks: {}, days: {}, months: {}, repoIds: [], ids: ids};

                    ids.forEach(function (id) {
                        var alias = _.find(contributors, function (author) {
                            return author.id == id;
                        });

                        if (alias) {
                            source.c += alias.c;
                            source.a += alias.a;
                            source.d += alias.d;
                            source.repoIds.push(id);

                            groups.forEach(function (group) {
                                _.each(alias[group], function (week, key) {
                                    if (!source[group][key]) {
                                        source[group][key] = week;
                                    } else {
                                        source[group][key].c += week.c;
                                        source[group][key].a += week.a;
                                        source[group][key].d += week.d;
                                    }

                                });
                            });
                        }
                    });

                    normals.push(source);
                });

                defer.resolve({
                    contributors: normals,
                    intervals: {
                        days: _.values(daysInRepo),
                        weeks: timeHelper.getWeeks(timeStart, timeEnd).map(function (date) {
                            return {d: timeHelper.formatYmdDate(date), date: date};
                        }),
                        months: timeHelper.getMonths(timeStart, timeEnd).map(function (date) {
                            return {d: timeHelper.formatYmdDate(date), date: date};
                        })
                    },
                    generalData: generalData
                });
            });

            return defer.promise();
        }

        function sortContributorsByType(array, type) {
            return array.sort(function (a, b) {
                return d3.descending(a[type], b[type]);
            })
        }

        function getFiltered(contributors, graph) {
            var dates = graph.getSelectedRange(),
                group = graph.getGroup(),
                authors = [];

            contributors.forEach(function (contributor) {
                var filtered = {};
                _.map(contributor[group], function (day, key) {
                    if (dates.fromDate <= day.date && day.date <= dates.toDate) {
                        filtered[key] = day;
                    }
                });
                if (!_.isEmpty(filtered)) {
                    var author = {ids: contributor.ids, repoIds: contributor.repoIds};
                    author[group] = filtered;
                    authors.push(author);
                }
            });

            return authors;
        }

        function getDataFromRange(contributors, graph) {
            var results = [],
                group = graph.getGroup();

            var authors = graph.isSelectedRange() ? getFiltered(contributors, graph) : contributors;

            authors.forEach(function (contributor) {
                var c = 0, a = 0, d = 0, days = {};
                _.map(contributor[group], function (day, key) {
                    c += day.c;
                    a += day.a;
                    d += day.d;
                    days[key] = {date: day.date, c: day.c, a: day.a, d: day.d};
                });
                var result = {c: c, a: a, d: d, ids: contributor.ids, repoIds: contributor.repoIds};
                result[group] = days;
                results.push(result);
            });

            return sortContributorsByType(results, graph.getType());
        }

        function getNiceFilledInterval(originInterval, dataStorage) {
            var niceInterval = [];
            originInterval.forEach(function (item) {
                var data = dataStorage[item.d];
                niceInterval.push(data ? {date: item.date, c: data.c, a: data.a, d: data.d} : {
                    date: item.date,
                    c: 0,
                    a: 0,
                    d: 0
                });
            });
            return niceInterval;
        }

        exports.getNormalizedContributorsData = getNormalizedContributorsData;
        exports.getDataFromRange = getDataFromRange;
        exports.sortContributorsByType = sortContributorsByType;
        exports.getNiceFilledInterval = getNiceFilledInterval;

    });;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/lib/jquery.commify.js' */
/**
 * jQuery Commify Plugin @VERSION
 *
 * https://github.com/christopherstyles/jquery-commify
 *
 * Copyright (c) 2011 - 2012 Christopher Styles
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

;(function($){
    $.extend({
        commify: function( options ) {

            var base, decimal, negative, n, parts, pieces, result;

            // Take the first argument as the number to be commified
            n = arguments[0];

            // Clean out anything we don't want
            n = String(n).replace(/[^\d\.]/g, "");

            // Update the options if specified
            options = (arguments.length > 1) ? $.extend({}, $.commify_defaults, arguments[1]) : $.commify_defaults;

            // Round the number if a round value was specified
            if (options.round && typeof options.round === "number")
                n = parseInt(Math.round(n/options.round)*options.round, 10);

            // Coerce the number to a String
            n = String(n);

            // Split into an array
            parts = n.split(".");

            // Get the base number
            base = parts[0];

            // Are we a negative?
            negative = (Boolean(~(n.indexOf("-")))); // see: http://jsperf.com/tilde-instead-of-strict-inequality
            if (negative)
                base = base.replace('-', '');

            // Start an empty result
            result = "";

            // Break the base number into pieces
            pieces = base.split('').reverse();

            // Loop over it, inserting commas for every 3
            for (var i = 0; i < pieces.length; i++) {
                if (i !== 0 && i % 3 === 0)
			        result = ',' + result;
			    result = pieces[i] + result;
            }

            // Get the decimal if there is one
            decimal = (parts.length > 1) ? ("." + parts[1]) : "";
            result += decimal;

            // Add the negative back if it was originally negative
            if (negative)
                result = "-" + result;

            // Add a prefix if one was specified
            if (options.prefix)
                result = options.prefix + result;

            return result;
        },

        commify_defaults: {
            prefix: null,
            round: null // Specify the nth to which you would like to round (10, 100, 1000 etc)
        },

        _commify_log: function(msg, raw) {
            if (window.console) {
                if (raw === true)
                    console.log(msg);
                else
                    console.log("$.commify: " + msg);
                return true;
            }
        },

        decommify: function(value) {
            return Number(value.replace(/,/g, ""));
        }
    });
})(jQuery);;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/graph-contributors.js' */
define('graph/contributors', ['underscore', 'aui', 'jquery', 'memoir', 'graph/navbuilder', 'util/events', 'exports', 'contributors/draw', 'graphs/timeHelper', 'graphs/dataHelper', 'graphs/loader'],
    function (_, AJS, $, memoir, nav, events, exports, drawHelper, timeHelper, dataHelper, dataLoader) {

        var data,
            countContributors = 12;

        var drawBatch = function (contributors, graph, drawCallback) {
            var interval = data.intervals[graph.getGroup()];

            if (graph.isSelectedRange()) {
                var dates = graph.getSelectedRange();
                interval = _.filter(interval, function (day) {
                    return dates.fromDate <= day.date && day.date <= dates.toDate;
                });
            }

            updateRangeTitle([_.first(interval).date, _.last(interval).date]);
            drawCallback(_.first(contributors, countContributors), interval, graph);
            return _.rest(contributors, countContributors);
        };

        var updateRangeTitle = function (dates) {
            var titleFrom = timeHelper.formatDomainTitleDate(dates[0]);
            var titleTo = timeHelper.formatDomainTitleDate(dates[1]);
            $('#contributions-range').text(titleFrom + ' - ' + titleTo);
        };

        var drawContributors = function (contributors, graph, isRedraw) {
            var drawCallback = isRedraw ? drawHelper.redraw : drawHelper.batch;
            return drawBatch(contributors, graph, drawCallback);
        };

        var getHeader = function (graph) {
            return Graph.Repository.contributionsHead({
                type: graph.getType(),
                group: graph.getGroup()
            })
        };

        exports.draw = function (days, graph, license) {

            dataHelper.getNormalizedContributorsData(days).done(function (result) {
                data = result;

                graph.setRepoDates([_.first(data.intervals['days']).date, _.last(data.intervals['days']).date]);

                $('#js-contributors-header').html(getHeader(graph));

                if (license.isFeatured()) {
                    var $groupWidget = $('.contributors-group-button');
                    $groupWidget.on('click', function () {
                        $groupWidget.attr('aria-pressed', false);
                        var $this = $(this);
                        $this.attr('aria-pressed', true);
                        graph.setGroup($this.data('group-by'));
                        drawHelper.general(data, graph, license);

                        contributors = dataHelper.getDataFromRange(data.contributors, graph);
                        contributors = drawContributors(contributors, graph, true);

                        events.trigger('graphContributorsChangeOptions', null);
                    });
                } else {
                    $('.contributors-group-button').on('click', function () {
                        license.createGroupWidgetTooltip();
                    });
                }

                drawHelper.general(data, graph, license);

                var contributors = dataHelper.getDataFromRange(data.contributors, graph);
                contributors = drawContributors(contributors, graph, false);

                $(window).on('scroll.graph', function () {
                    var scrollTop = $(document).scrollTop();
                    var pageHeight = $(document).height();
                    var windHeight = $(window).height();

                    if (pageHeight - scrollTop < windHeight * 2 && contributors.length > 0 && dataLoader.isFree()) {
                        contributors = drawContributors(contributors, graph, false);
                    }
                });

                $('#type-contributions-selector').on({
                    'click selectstart': function (event) {
                        $('.type-contributions-title').text(event.target.text);
                        graph.setType($(event.target).data('type-contributions'));

                        drawHelper.general(data, graph, license);
                        contributors = dataHelper.getDataFromRange(data.contributors, graph);
                        contributors = drawContributors(contributors, graph, true);

                        events.trigger('graphContributorsChangeOptions', null);
                    }
                }).on('click', function () {
                    return false;
                });

                events.off('onSelectedContributionsEmptyRange', null);
                events.on('onSelectedContributionsEmptyRange', function () {
                    graph.resetSelectedRange();
                    drawHelper.general(data, graph, license);
                    contributors = dataHelper.getDataFromRange(data.contributors, graph);
                    contributors = drawContributors(contributors, graph, true);

                    events.trigger('graphContributorsChangeOptions', null);
                });

                events.off('onSelectedContributionsRange', null);
                events.on('onSelectedContributionsRange', function (dates) {

                    graph.setSelectedRange({
                        from: timeHelper.formatYmdDate(dates.from),
                        to: timeHelper.formatYmdDate(dates.to),
                        fromDate: dates.from,
                        toDate: dates.to
                    });

                    contributors = dataHelper.getDataFromRange(data.contributors, graph);
                    contributors = drawContributors(contributors, graph, true);

                    events.trigger('graphContributorsChangeOptions', null);
                });

            });

        }
    });;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/graph-contributors-draw.js' */
define('contributors/draw', ['underscore', 'jquery', 'aui', 'util/ajax', 'util/events', 'exports', 'graphs/utility', 'graphs/timeHelper', 'memoir', 'graph/navbuilder', 'graphs/dataHelper', 'graphs/loader', 'contributors/email-aliases-notifier'],
    function (_, $, AJS, ajax, events, exports, utility, timeHelper, memoir, nav, dataHelper, dataLoader, aliasesNotifier) {

        var pageWidth;
        var interpolate = "monotone";

        var updateDomainTitle = function (dates) {
            var fromTitle = timeHelper.formatDomainTitleDate(dates[0]);
            var toTitle = timeHelper.formatDomainTitleDate(dates[1]);
            $('#contributions-range').text(fromTitle + " - " + toTitle);
        };

        function getRoundType(groupBy) {
            if (groupBy == 'days') return 'day';
            else if (groupBy == 'weeks') return 'week';
            else return 'month';
        }

        function redraw(contributors, interval, graph) {
            d3.selectAll(".person").remove();
            batch(contributors, interval, graph);
        }

        function batch(authors, interval, graph) {
            var upOffset = 10,
                leftOffset = 15,
                rightOffset = 15,
                downOffset = 20;

            var type = graph.getType(),
                groupBy = graph.getGroup();

            var width = 420, personOffsets = 24 + leftOffset + rightOffset;
            var personWidthWithOffsets = width + personOffsets;

            var contributorsContainerWidth = pageWidth - utility.getScrollWidth();

            var freeSpace = contributorsContainerWidth % personWidthWithOffsets;
            var persons = Math.floor(contributorsContainerWidth / personWidthWithOffsets);

            if (freeSpace > personWidthWithOffsets / 2) {
                persons++;
                var offsets = personOffsets * persons;
                width = Math.floor((contributorsContainerWidth - offsets) / persons);
            } else {
                width += Math.floor(freeSpace / persons);
            }

            var widthWithOffset = width + leftOffset + rightOffset;
            var height = Math.floor(width / 4);

            enrichAuthors(authors).done(function (contributors) {

                var maxInWeek = d3.max(contributors, function (contributor) {
                    return d3.max(_.values(contributor[groupBy]), function (day) {
                        return day[type];
                    })
                });

                var xDomain = d3.extent(interval, function (day) {
                        return day.date;
                    }),
                    xRange = [0, width];

                var yDomain = [0, maxInWeek],
                    yRange = [height - downOffset - upOffset, 0];

                var xScale = d3.time.scale()
                    .domain(xDomain)
                    .range(xRange);

                var yScale = d3.scale.linear()
                    .domain(yDomain)
                    .range(yRange);

                var xAxis = d3.svg.axis()
                    .scale(xScale)
                    .ticks(5);

                var yAxis = d3.svg.axis()
                    .scale(yScale)
                    .orient("left")
                    .ticks(2)
                    .tickSize(-width)
                    .tickFormat(d3.format('s'));

                var area = d3.svg.area()
                    .interpolate(interpolate)
                    .x(function (day) {
                        return xScale(day.date);
                    })
                    .y0(function () {
                        return yRange[0];
                    })
                    .y1(function (day) {
                        return yScale(day[type]);
                    });

                var contributorArea = function (contributor) {
                    var days = contributor[groupBy];

                    var graphDays = [];
                    interval.forEach(function (day) {
                        graphDays.push(days[day.d] ? days[day.d] : {date: day.date, c: 0, a: 0, d: 0});
                    });

                    return area(graphDays);
                };

                var contributorsHtml = d3.select("#js-contributors")
                    .selectAll()
                    .data(contributors)
                    .enter();

                var personHtml = contributorsHtml.append("li")
                    .attr("class", "person")
                    .attr("data-is-stash-user", function (contributor) {
                        return contributor.link != null;
                    })
                    .style("display", function (contributor) {
                        return contributor[type] < 1 ? "none" : "block";
                    });

                var personDetail = personHtml.append("h3");
                personDetail.append("img")
                    .attr("src", function (contributor) {
                        return contributor.avatarLink;
                    })
                    .attr("class", "avatar");
                personDetail.append("div")
                    .attr("class", "aname")
                    .attr("title", function (contributor) {
                        var emails = _.compact(_.values(contributor.meta));
                        return !_.isEmpty(emails) ? emails.join(', ') : '(no email)';
                    }).html(function (contributor) {
                        return contributor.link ? "<a href='" + contributor.link + "'>" + contributor.login + "</a>" : contributor.login;
                    });
                personDetail.append("span")
                    .attr("class", "ameta")
                    .html(function (contributor) {
                        return "<div>" +
                            "<span class='cmt'>" + $.commify(contributor.c) + " commit" + (contributor.c > 1 ? "s" : "") + "</span>" +
                            " / <span class='a'>" + $.commify(contributor.a) + " ++</span>" +
                            " / <span class='d'>" + $.commify(contributor.d) + " --</span>" +
                            "</div>";
                    });

                var svg = personHtml.append("svg")
                    .attr("width", widthWithOffset)
                    .attr("height", height + upOffset)
                    .attr("class", "spark")
                    .append("g")
                    .attr("transform", "translate(" + leftOffset + ", " + upOffset + ")");

                svg.append("g")
                    .attr("class", "x axis")
                    .attr("transform", "translate(0, " + (height - upOffset - downOffset) + ")")
                    .call(xAxis);

                svg.append("g")
                    .attr("class", "y axis")
                    .call(yAxis)
                    .selectAll(".y.axis g text")
                    .attr("x", width / 2)
                    .style("display", utility.shouldDisplayTick);

                svg.append("path")
                    .attr("d", contributorArea);

                aliasesNotifier.notify();
            });
        }

        function general(data, graph, license) {

            var groupBy = graph.getGroup(),
                days = data.generalData[groupBy],
                interval = data.intervals[groupBy],
                type = graph.getType();

            if (graph.isSelectedRange()) {
                var selected = graph.getSelectedRange();
                var selectedExtent = timeHelper.getRoundedExtent([selected.fromDate, selected.toDate], getRoundType(groupBy));
                graph.setSelectedRange({
                    fromDate: selectedExtent[0],
                    toDate: selectedExtent[1],
                    from: timeHelper.formatYmdDate(selectedExtent[0]),
                    to: timeHelper.formatYmdDate(selectedExtent[1])
                });
            }

            var domain = d3.extent(interval, function (day) {
                return day.date;
            });

            var graphDays = dataHelper.getNiceFilledInterval(interval, days);

            pageWidth = $('#graphs-content').width();

            var leftOffset = 15,
                rightOffset = 15,
                upOffset = 10,
                downOffset = 10,
                vOffsets = upOffset + downOffset;

            var width = pageWidth - utility.getScrollWidth(),
                height = Math.floor(width / 4.28);

            var maxInDay = d3.max(_.values(days), function (day) {
                return day[type];
            });

            var xScale = d3.time.scale()
                .domain(domain)
                .range([leftOffset, width - rightOffset]);

            var yScale = d3.scale.linear()
                .domain([0, maxInDay])
                .range([height - vOffsets, upOffset]);

            var xAxis = d3.svg.axis()
                .scale(xScale)
                .ticks(10);

            var yAxis = d3.svg.axis()
                .scale(yScale)
                .orient("left")
                .tickSize(-width + rightOffset + leftOffset)
                .ticks(5)
                .tickFormat(d3.format("s"));

            var area = d3.svg.area()
                .interpolate(interpolate)
                .x(function (day) {
                    return xScale(day.date);
                })
                .y0(function () {
                    return height - vOffsets;
                })
                .y1(function (day) {
                    return yScale(day[type]);
                });

            var areaBorder = d3.svg.line()
                .interpolate(interpolate)
                .x(function (day) {
                    return xScale(day.date);
                })
                .y(function (day) {
                    return yScale(day[type]);
                });

            d3.select('#js-contributors-master').selectAll('*').remove();
            var svg = d3.select('#js-contributors-master')
                .append("svg")
                .attr("width", width)
                .attr("height", height)
                .append("g")
                .attr("transform", "translate(" + leftOffset + ", 0)");

            svg.append("g")
                .attr("class", "x axis")
                .attr("transform", "translate(0, " + (height - vOffsets) + ")")
                .call(xAxis);

            svg.append("g")
                .attr("class", "y axis")
                .attr("transform", "translate(" + leftOffset + ", 0)")
                .call(yAxis)
                .selectAll(".y.axis g text")
                .style("display", utility.shouldDisplayTick);

            svg.append("path")
                .attr("d", area(graphDays));

            svg.append("path")
                .attr("class", "area-border")
                .attr("d", areaBorder(graphDays));

            updateDomainTitle(xScale.domain());

            if (license.isFeatured()) {

                $('#range-message').html(AJS.format("To select a time span double click near its start point and drag to its end point.", groupBy));

                var brush = d3.svg.brush()
                    .x(xScale)
                    .on('brushend', function () {

                        if (brush.empty()) {
                            events.trigger("onSelectedContributionsEmptyRange", null);
                            return;
                        }

                        var roundedExtent = timeHelper.getRoundedExtent(brush.extent(), getRoundType(groupBy));

                        d3.select(this).transition().duration(750)
                            .call(brush.extent(roundedExtent));

                        events.trigger("onSelectedContributionsRange", null, {
                            from: roundedExtent[0],
                            to: roundedExtent[1]
                        });
                    });

                if (graph.isSelectedRange()) {
                    var range = graph.getSelectedRange();
                    brush.extent([range.fromDate, range.toDate]);
                    updateDomainTitle(brush.extent());
                }

                svg.append("g")
                    .attr("class", "x brush")
                    .attr("transform", "translate(0," + upOffset / 2 + " )")
                    .call(brush)
                    .selectAll("rect")
                    .attr("height", height - vOffsets - upOffset / 2);

            } else {
                $('#range-message').html("In order to use \u003ca href=\u0022https://docs.stiltsoft.com/display/AwesomeGraphs/Contributors\u0022 target=\u0022_blank\u0022\u003eselection\u003c/a\u003e the Time Span feature you need to purchase a \u003ca href=\u0022https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\u0022 target=\u0022_blank\u0022\u003ecommercial\u003c/a\u003e license.");
            }
        }

        function enrichAuthors(authors) {
            var defer = $.Deferred();
            $('.contributors-spinner').remove();
            var spinner = $("<div class='contributors-spinner'/>").insertAfter($('#js-contributors')).spin('large');
            dataLoader.load({
                resource: 'contributors/details',
                opts: {
                    data: authors.map(function (author) {
                        return author.ids;
                    }),
                    type: 'POST',
                    cache: false
                }
            }).always(function () {
                spinner.spinStop();
            }).done(function (enrichedAuthors) {
                defer.resolve(enrichedAuthors.map(function (enrichedAuthor) {
                    return getContributor(enrichedAuthor, authors);
                }));
            });
            return defer.promise();
        }

        function getContributor(enrichedAuthor, authors) {
            var ids = _.keys(enrichedAuthor.meta).map(function (key) {
                return Number(key);
            });

            var contributor = _.find(authors, function (author) {
                return !_.isEmpty(_.intersection(ids, author.ids));
            });

            enrichedAuthor.meta = _.pick.apply(this, [enrichedAuthor.meta].concat(contributor.repoIds));

            return _.defaults(contributor, enrichedAuthor);
        }

        exports.batch = batch;
        exports.general = general;
        exports.redraw = redraw;
    });;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/graph-commit-activity.js' */
define('graph/commitActivity', ['jquery', 'graphs/timeHelper', 'exports', 'graphs/utility'],
    function ($, timeHelper, exports, utility) {

        function setTitle() {
            var first = new Date(), last = new Date();
            first.setFullYear(first.getFullYear() - 1);

            first = timeHelper.formatDomainTitleDate(first);
            last = timeHelper.formatDomainTitleDate(last);

            $("#js-commit-activity-header").html(Graph.Repository.commitActivityHeader({title: first + ' - ' + last}));
        }

        exports.draw = function (data) {
            setTitle();

            var master = $("#js-commit-activity-master");
            var details = $("#js-commit-activity-detail");
            var detailsWidth = details.width();
            var week = {
                weekdays: [
                    "Sunday",
                    "Monday",
                    "Tuesday",
                    "Wednesday",
                    "Thursday",
                    "Friday",
                    "Saturday"
                ],
                currentWeekIndex: 0,
                weekSelectedEvent: "gg.week.selected"
            };
            var height = 260;
            var upOffsetMaster = 10, leftOffsetMaster = 30, rightOffsetMaster = 20, downOffsetMaster = 30;
            var upOffsetDetail = 20, leftOffsetDetail = 30, rightOffsetDetail = 30, downOffsetDetail = 40;

            data.forEach(function (value, index) {
                if (value.total !== 0)
                    return week.currentWeekIndex = index;
            });

            var commitsInWeek = data[week.currentWeekIndex].days;
            var maxCommitsInDay = d3.max(data, function (value) {
                return d3.max(value.days);
            });

            var xScaleDetail = d3.scale
                .linear()
                .domain([0, commitsInWeek.length - 1])
                .range([0, detailsWidth - leftOffsetDetail - rightOffsetDetail]);

            var yScaleDetail = d3.scale
                .linear()
                .domain([0, maxCommitsInDay])
                .range([height, 0]);

            var svgDetail = d3.select("#js-commit-activity-detail")
                .data([commitsInWeek])
                .append("svg")
                .attr("width", detailsWidth)
                .attr("height", height + upOffsetDetail + downOffsetDetail)
                .attr("class", "viz")
                .append("g")
                .attr("transform", "translate(" + leftOffsetDetail + "," + upOffsetDetail + ")");

            var yAxisDetail = d3.svg
                .axis()
                .scale(yScaleDetail)
                .orient("left")
                .ticks(5)
                .tickSize(-detailsWidth + rightOffsetDetail + leftOffsetDetail)
                .tickFormat(d3.format('s'));

            svgDetail.append("g")
                .attr("class", "y axis")
                .call(yAxisDetail)
                .selectAll(".y.axis g text")
                .style("display", utility.shouldDisplayTick);

            svgDetail.append("g")
                .attr("class", "days")
                .selectAll("g.day")
                .data(week.weekdays)
                .enter()
                .append("g")
                .attr("class", "day")
                .attr("transform", function (a, b) {
                    return"translate(" + xScaleDetail(b) + ", " + height + ")";
                })
                .append("text")
                .attr("text-anchor", "middle")
                .attr("dy", "2em")
                .text(function (a, b) {
                    return a;
                });

            var curve = d3.svg
                .line()
                .interpolate("cardinal")
                .x(function (a, b) {
                    return xScaleDetail(b);
                })
                .y(yScaleDetail);

            svgDetail.append("path")
                .attr("class", "path")
                .attr("d", curve);

            var detailDot = svgDetail.selectAll("g.dot")
                .data(commitsInWeek)
                .enter()
                .append("g")
                .attr("class", "dot")
                .attr("transform", function (a, b) {
                    return "translate(" + xScaleDetail(b) + ", " + yScaleDetail(a) + ")";
                });

            detailDot.append("circle").attr("r", 5);

            detailDot.append("text")
                .attr("text-anchor", "middle")
                .attr("class", "tip")
                .attr("dy", -10)
                .text(function (a) {
                    return a
                });

            var totalCommitsForAllTime = data.map(function (value) {
                return value.total;
            });

            var xScaleMaster = d3.scale
                .ordinal()
                .domain(d3.range(totalCommitsForAllTime.length))
                .rangeRoundBands([0, detailsWidth - leftOffsetMaster - rightOffsetMaster], 0.1);

            var yScaleMaster = d3.scale
                .linear()
                .domain([0, d3.max(totalCommitsForAllTime)])
                .range([height, 0]);

            var svgMaster = d3.select("#js-commit-activity-master")
                .style("width", "" + detailsWidth + "px")
                .append("svg")
                .attr("width", detailsWidth)
                .attr("height", height + upOffsetMaster + downOffsetMaster)
                .attr("class", "viz")
                .append("g")
                .attr("transform", "translate(" + leftOffsetMaster + "," + upOffsetMaster + ")");

            var yAxisMaster = d3.svg
                .axis()
                .scale(yScaleMaster)
                .orient("left")
                .ticks(3)
                .tickSize(-detailsWidth + leftOffsetMaster + rightOffsetMaster)
                .tickFormat(d3.format('s'));

            svgMaster.append("g")
                .attr("class", "y axis")
                .call(yAxisMaster)
                .selectAll(".y.axis g text")
                .style("display", utility.shouldDisplayTick);

            var tipTimeFormat = d3.time.format("%B %e");
            var tip = d3.tip()
                .attr('class', 'commit-activity-tip')
                .offset([-10, 10])
                .html(function (a, b) {
                    var w = tipTimeFormat(timeHelper.parseYmd(data[b].week));
                    return "<div class='no-wrap'>" + a + " commit" + (a > 1 ? "s" : "") + "</div>" +
                        "<div> the week of <span class='no-wrap'>" + w + "</span>" + "</div>";
                });
            svgMaster.call(tip);

            var column = svgMaster.selectAll("g.mini")
                .data(totalCommitsForAllTime)
                .enter()
                .append("g")
                .attr("class", function (a, b) {
                    return b === week.currentWeekIndex ? "bar mini active" : "bar mini";
                })
                .attr("data-week", function (a, b) {
                    return b;
                })
                .attr("transform", function (a, b) {
                    return "translate(" + xScaleMaster(b) + ", 0)"
                })
                .on("click", function (a, b) {
                    return $(document).trigger(week.weekSelectedEvent, {
                        node: this,
                        index: b,
                        data: a
                    });
                })
                .on('mouseover', tip.show)
                .on('mouseout', tip.hide);

            column.append("rect")
                .attr("width", xScaleMaster.rangeBand())
                .attr("height", function (a) {
                    return height - yScaleMaster(a);
                })
                .attr("y", function (a) {
                    return yScaleMaster(a);
                });

            var timeFormat = d3.time.format("%m/%d");
            var xAxisMaster = d3.svg
                .axis()
                .scale(xScaleMaster)
                .orient("bottom")
                .ticks(d3.time.weeks)
                .tickFormat(function (b, c) {
                    return timeFormat(timeHelper.parseYmd(data[c].week));
                });

            svgMaster.append("g")
                .attr("class", "x axis")
                .attr("transform", "translate(0," + height + ")")
                .call(xAxisMaster)
                .selectAll(".tick")
                .style("display", function (a, b) {
                    return b % 3 !== 0 ? "none" : "block"
                });

            var offsetActiveColumn = function () {
                return xScaleMaster($(".bar.mini.active").data('week')) + xScaleMaster.rangeBand() / 2;
            };

            var navCircle = svgMaster.append('circle')
                .attr('r', 2)
                .attr("cx", offsetActiveColumn())
                .attr('cy', height + upOffsetMaster / 2);

            var weekSelectedEventHandler = function (event) {
                if (event.index > 52 || event.index < 0) {
                    return;
                }
                week.currentWeekIndex = event.index;

                var days = d3.selectAll(".bar.mini")
                    .attr("class", "bar mini");

                d3.select(days[0][week.currentWeekIndex])
                    .attr("class", "bar mini active");

                navCircle.transition().attr("cx", offsetActiveColumn());

                var commits = data[event.index].days;

                svgDetail.selectAll(".path")
                    .data([commits])
                    .transition()
                    .duration(500)
                    .attr("d", curve);

                svgDetail.selectAll("g.dot")
                    .data(commits)
                    .transition()
                    .duration(300)
                    .attr("transform", function (a, b) {
                        return "translate(" + xScaleDetail(b) + ", " + yScaleDetail(a) + ")"
                    });

                svgDetail.selectAll("text.tip")
                    .data(commits)
                    .text(function (a) {
                        return a;
                    });
            };

            $(window).off("keyup.graph").on("keyup.graph", function (event) {
                if (event.keyCode == 39 || event.keyCode == 37) {
                    var active = $(".bar.mini.active");
                    var current = event.keyCode == 39 ? active.next() : active.prev();
                    var weekNumber = $(current).data('week');
                    if (weekNumber != undefined) {
                        current.trigger(week.weekSelectedEvent, {index: weekNumber});
                    }
                }
            });

            $(document).bind(week.weekSelectedEvent, function (a, b) {
                return weekSelectedEventHandler(b);
            });
        }
    });;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/graph-code-frequency.js' */
define('graph/codeFrequency', ['underscore', 'jquery', 'memoir', 'graph/navbuilder', 'graphs/timeHelper', 'exports', 'model/page-state', 'util/navigator'],
    function (_, $, memoir, nav, timeHelper, exports, pageState, navigator) {

        var displayDays = 8;

        var normalize = function (days) {
            var data = [];
            var total = 0;

            var daysObject = {};
            days = _.sortBy(days, function (day) {
                day.d = timeHelper.parseYmd(day.d);
                daysObject[day.d] = day;
                return day.d;
            });

            timeHelper.getDays(_.first(days).d, new Date()).forEach(function (day) {
                var added = 0, deleted = 0;

                if (daysObject[day]) {
                    daysObject[day].authors.forEach(function (author) {
                        added += author.a;
                        deleted += author.d;
                    });
                }

                data.push({
                    day: day,
                    added: added,
                    deleted: -deleted,
                    totalLines: total + added - deleted
                });

                total += added - deleted;
            });

            return data;
        };

        var redrawAxis = function (html, axis) {
            html.selectAll('*').remove();
            html.call(axis);
        };

        var appendCircle = function (container, type) {
            return container.append("circle")
                .attr("class", "circle " + type)
                .attr("r", 3);
        };

        var updateCirclePosition = function (circle, height) {
            circle.attr("opacity", 1).attr("transform", "translate(0, " + height + ")");
        };

        var shiftDatesByDays = function (dates, days) {
            return [d3.time.day.offset(dates[0], days), d3.time.day.offset(dates[1], days)];
        };

        var updateDomainTitle = function (dates) {
            var fromTitle = timeHelper.formatDomainTitleDate(dates[0]);
            var toTitle = timeHelper.formatDomainTitleDate(dates[1]);
            $('#cf-domain-title').text(fromTitle + " - " + toTitle);
        };

        var saveUrl = function (graph) {
            var state = {
                graphParams: graph.getSavedState(),
                ref: pageState.getRevisionRef().toJSON()
            };
            var graphsURL = nav.getRepoGraphsURL(state.graphParams);

            var isIE9 = navigator.isIE() && navigator.majorVersion() == 9;
            !isIE9 && memoir.pushState(state, '', graphsURL);
        };

        var updateGraph = function (graph, zoom, range) {
            graph.setZoom(zoom.scale());
            graph.setSelectedRange({
                from: timeHelper.formatYmdDate(range[0]),
                to: timeHelper.formatYmdDate(range[1]),
                fromDate: range[0],
                toDate: range[1]
            });
            saveUrl(graph);
        };

        var clickButton = function (button) {
            !button.attr('disabled') && button.click();
        };

        exports.draw = function (days, graph) {

            var data = normalize(days);

            var dates = d3.extent(data, function (item) {
                return item.day;
            });

            var maxAddLines = d3.max(data, function (day) {
                return day.added;
            });

            var maxDelLines = d3.min(data, function (day) {
                return day.deleted;
            });

            var maxTotLines = d3.max(data, function (day) {
                return day.totalLines;
            });

            var width = $("#js-code-frequency").width();
            var height = Math.floor(width / 2.5), offset = 75;

            var xScale = d3.time.scale()
                .domain(dates)
                .range([offset, width - offset]);

            var yScale = d3.scale.linear()
                .domain([maxDelLines, maxAddLines])
                .range([height - offset / 2, offset / 2])
                .nice();

            var tScale = d3.scale.linear()
                .domain([0, maxTotLines])
                .range([height - offset / 2, offset / 2])
                .nice();

            var xAxis = d3.svg.axis()
                .scale(xScale);

            var yAxis = d3.svg.axis()
                .scale(yScale)
                .orient("left")
                .tickFormat(function (d) {
                    return d3.format("s")(d > 0 ? d : Math.abs(d));
                });

            var tAxis = d3.svg.axis()
                .scale(tScale)
                .orient("right")
                .tickFormat(d3.format("s"));

            var area = d3.svg.area()
                .x(function (d) {
                    return xScale(d.day);
                })
                .y0(yScale(0))
                .y1(function (d) {
                    return yScale(d.value);
                })
                .interpolate("linear");

            var line = d3.svg.line()
                .x(function (d) {
                    return xScale(d.day);
                })
                .y(function (d) {
                    return yScale(d.value);
                })
                .interpolate("linear");

            var tLine = d3.svg.line()
                .x(function (d) {
                    return xScale(d.day);
                })
                .y(function (d) {
                    return tScale(d.totalLines);
                })
                .interpolate("monotone");

            var formatYTicks = function (y) {
                y.selectAll(".tick")
                    .attr("class", function (d) {
                        if (d == 0) return;
                        return d < 0 ? "y-del-tick" : "y-add-tick";
                    })
                    .append("line")
                    .attr("class", "x-ticks")
                    .attr("x1", offset / 2)
                    .attr("x2", width - offset * 1.5);
            };

            var formatTTicks = function (t) {
                t.selectAll(".tick").attr("class", "total-tick");
            };

            var redraw = function () {

                if (xScale.domain()[0] < dates[0]) {
                    zoom.translate([zoom.translate()[0] - xScale(dates[0]) + xScale.range()[0], zoom.translate()[1]]);
                } else if (xScale.domain()[1] > dates[1]) {
                    zoom.translate([zoom.translate()[0] - xScale(dates[1]) + xScale.range()[1], zoom.translate()[1]]);
                }

                xAxisHtml.call(xAxis);

                var interval = xScale.domain();
                var selected = data.filter(function (item) {
                    return interval[0] <= item.day && item.day <= interval[1];
                });

                var min = d3.min(selected, function (day) {
                    return day.deleted;
                });

                var max = d3.max(selected, function (day) {
                    return day.added;
                });

                var total = d3.max(selected, function (day) {
                    return day.totalLines;
                });

                yScale.domain([min, max]).nice();
                redrawAxis(yAxisHtml, yAxis);
                formatYTicks(yAxisHtml);

                tScale.domain([0, total]);
                redrawAxis(tAxisHtml, tAxis);
                formatTTicks(tAxisHtml);

                var area = d3.svg.area()
                    .x(function (d) {
                        return xScale(d.day);
                    })
                    .y0(yScale(0))
                    .y1(function (d) {
                        return yScale(d.value);
                    })
                    .interpolate("linear");

                addAreaHtml.attr("d", area);
                delAreaHtml.attr("d", area);
                addPathHtml.attr("d", line);
                delPathHtml.attr("d", line);
                totalPathHtml.attr("d", tLine);

                updateDomainTitle(xScale.domain());
            };

            var scaleExtent = [1, data.length > displayDays ? data.length / displayDays : 1];

            var zoom = d3.behavior.zoom()
                .x(xScale)
                .scaleExtent(scaleExtent)
                .scale(graph.getZoom())
                .on("zoom", function () {
                    redraw();
                })
                .on("zoomend", function () {
                    graph.setZoom(zoom.scale());
                    var range = xScale.domain();
                    graph.setSelectedRange({
                        from: timeHelper.formatYmdDate(range[0]),
                        to: timeHelper.formatYmdDate(range[1]),
                        fromDate: range[0],
                        toDate: range[1]
                    });
                    saveUrl(graph);
                    checkZoomButtons();
                    checkShiftButtons();
                });

            if (graph.isSelectedRange()) {
                var range = graph.getSelectedRange();
                xScale.domain([range.fromDate, range.toDate]);
            }

            $('#js-code-frequency-header').html(Graph.Repository.codeFrequencyHeader());

            updateDomainTitle(xScale.domain());

            var $zoomIn = $('#code-frequency-zoom-in'),
                $zoomOut = $('#code-frequency-zoom-out'),
                $zoomReset = $('#code-frequency-zoom-reset');

            var checkZoomButtons = function () {
                $zoomIn.attr('disabled', zoom.scale() >= scaleExtent[1]);
                $zoomOut.attr('disabled', zoom.scale() <= scaleExtent[0]);
                $zoomReset.attr('disabled', zoom.scale() == scaleExtent[0]);
            };

            checkZoomButtons();

            $zoomIn.on('click', function () {
                zoomClick(1);
            });

            $zoomOut.on('click', function () {
                zoomClick(-1);
            });

            $zoomReset.on('click', function () {
                return d3.transition().duration(750).tween("zoom", function () {
                    var ix = d3.interpolate(xScale.domain(), dates);
                    return function (t) {
                        zoom.x(xScale.domain(ix(t)));
                        graph.resetSelectedRange();
                        saveUrl(graph);
                        redraw();
                        checkZoomButtons();
                        checkShiftButtons();
                    };
                });
            });

            $(document).keyup(function (e) {
                (e.keyCode == 187 || e.keyCode == 107) && clickButton($zoomIn);
                (e.keyCode == 189 || e.keyCode == 109) && clickButton($zoomOut);
                e.keyCode == 27 && clickButton($zoomReset);

                (e.keyCode == 37 || e.keyCode == 100) && clickButton($shiftLeft);
                (e.keyCode == 39 || e.keyCode == 102) && clickButton($shiftRight);
            });

            var $shiftRight = $('#code-frequency-shift-right');
            var $shiftLeft = $('#code-frequency-shift-left');

            var checkShiftButtons = function () {
                $shiftRight.attr('disabled', xScale.domain()[1] >= dates[1]);
                $shiftLeft.attr('disabled', xScale.domain()[0] <= dates[0]);
            };

            checkShiftButtons();

            $shiftRight.on('click', function () {
                $shiftLeft.attr('disable', false);
                xScale.domain(shiftDatesByDays(xScale.domain(), 1));
                redraw();
                checkShiftButtons();
                updateGraph(graph, zoom, xScale.domain());
            });
            $shiftLeft.on('click', function () {
                $shiftRight.attr('disable', false);
                xScale.domain(shiftDatesByDays(xScale.domain(), -1));
                redraw();
                checkShiftButtons();
                updateGraph(graph, zoom, xScale.domain());
            });

            var interpolateZoom = function (translate, scale) {
                return d3.transition().duration(350).tween("zoom", function () {
                    var it = d3.interpolate(zoom.translate(), translate),
                        is = d3.interpolate(zoom.scale(), scale);
                    return function (t) {
                        // todo в этом месте, при первой попытке уменьшения\увеличения графика кнопкой,
                        // если график был открыт через "расшареный" url происходит сбрасывание шкалы в начало
                        zoom.scale(is(t)).translate(it(t));

                        redraw();

                        checkZoomButtons();
                        checkShiftButtons();

                        updateGraph(graph, zoom, xScale.domain());
                    };
                });
            };

            var zoomClick = function (direction) {
                var factor = 0.2,
                    center = [width / 2, height / 2],
                    extent = zoom.scaleExtent(),
                    translate = zoom.translate(),
                    view = {x: translate[0], y: translate[1], k: zoom.scale()};

                var target_zoom = zoom.scale() * (1 + factor * direction);

                if (target_zoom < extent[0] || extent[1] < target_zoom) {
                    target_zoom = direction < 0 ? extent[0] : extent[1];
                }

                var translate0 = [(center[0] - view.x) / view.k, (center[1] - view.y) / view.k];
                view.k = target_zoom;
                var l = [translate0[0] * view.k + view.x, translate0[1] * view.k + view.y];

                view.x += center[0] - l[0];
                view.y += center[1] - l[1];

                interpolateZoom([view.x, view.y], view.k);
            };

            var graphContainer = d3.select("#js-code-frequency")
                .append("svg")
                .attr("overflow", "hidden")
                .attr("width", width)
                .attr("height", height + offset / 2)
                .attr("pointer-events", "all")
                .append("g")
                .on("mousedown", function () {
                    d3.select(this).style("cursor", "move");
                })
                .on("mouseup", function () {
                    d3.select(this).style("cursor", "default");
                });

            graphContainer.append("text")
                .attr("class", "side-txt")
                .attr("x", offset * 4 / 5)
                .attr("y", height / 2)
                .text("Deletions and Additions")
                .attr("transform", "rotate(-90," + (offset * 4 / 5) + "," + height / 2 + ")");

            graphContainer.append("text")
                .attr("class", "side-txt")
                .attr("x", width - offset * 4 / 5)
                .attr("y", height / 2)
                .text(" Total lines")
                .attr("transform", "rotate(90," + (width - offset * 4 / 5) + "," + height / 2 + ")");

            graphContainer.append("text")
                .attr("class", "head-txt")
                .attr("x", (width + offset) / 2 + offset)
                .attr("y", height + offset / 3)
                .append("tspan")
                .attr("class", "add-txt")
                .text(" Additions")
                .append("tspan")
                .text(" and")
                .append("tspan")
                .attr("class", "del-txt")
                .text(" Deletions")
                .append("tspan")
                .text(" per day and")
                .append("tspan")
                .attr("class", "total-txt")
                .text(" Total")
                .append("tspan")
                .text(" lines");

            var xAxisHtml = graphContainer.append("g")
                .attr("class", "x axis")
                .attr("transform", "translate(0, " + (height - offset / 3) + ")")
                .call(xAxis);

            var yAxisHtml = graphContainer.append("g")
                .attr("class", "y axis")
                .attr("transform", "translate(" + (offset / 2) + ", 0)")
                .call(yAxis);
            formatYTicks(yAxisHtml);

            var tAxisHtml = graphContainer.append("g")
                .attr("class", "total axis")
                .attr("transform", "translate(" + (width - offset / 2) + ", 0)")
                .call(tAxis);
            formatTTicks(tAxisHtml);

            graphContainer.append('defs')
                .append('clipPath')
                .attr('id', 'clip')
                .append('rect')
                .attr("id", "clip-rect")
                .attr("x", "0")
                .attr("y", "0")
                .attr("width", width - offset * 2)
                .attr("height", height - offset)
                .attr("transform", "translate(" + offset + ", " + offset / 2 + ")");

            var codeFrequency = graphContainer.append("g")
                .attr("clip-path", "url(#clip)")
                .call(zoom);

            var addeds = [], deleteds = [];
            data.forEach(function (item) {
                addeds.push({day: item.day, value: item.added});
                deleteds.push({day: item.day, value: item.deleted});
            });

            var addAreaHtml = codeFrequency.append("path")
                .datum(addeds)
                .attr("class", "add-area-path")
                .attr("d", area);
            var addPathHtml = codeFrequency.append("path")
                .datum(addeds)
                .attr("class", "add-path")
                .attr("d", line);

            var delAreaHtml = codeFrequency.append("path")
                .datum(deleteds)
                .attr("class", "del-area-path")
                .attr("d", area);
            var delPathHtml = codeFrequency.append("path")
                .datum(deleteds)
                .attr("class", "del-path")
                .attr("d", line);

            var totalPathHtml = codeFrequency.append("path")
                .datum(data)
                .attr("class", "total-path")
                .attr("d", tLine);

            var details = codeFrequency.append("g")
                .attr("class", "details")
                .style("display", "none");

            details.append("line")
                .attr("y2", height);

            var circleAdd = appendCircle(details, "add");
            var circleDell = appendCircle(details, "del");
            var circleTotal = appendCircle(details, "total");

            var tooltip = d3.select("body")
                .append("div")
                .attr("class", "code-frequency-tip");

            var bisectDate = d3.bisector(function (item) {
                return item.day;
            }).left;

            codeFrequency.append("rect")
                .attr("width", width - offset * 2)
                .attr("height", height)
                .attr("transform", "translate(" + offset + ", 0)")
                .on("mouseover", function () {
                    details.style("display", null);
                    tooltip.style("visibility", "visible");
                })
                .on("mouseout", function () {
                    details.style("display", "none");
                    tooltip.style("visibility", "hidden");
                })
                .on("mousemove", function () {
                    var mouse = d3.mouse(this);
                    var x0 = xScale.invert(mouse[0] + offset),
                        i = bisectDate(data, x0, 1),
                        d0 = data[i - 1],
                        d1 = data[i],
                        d = x0 - d0.day > d1.day - x0 ? d1 : d0;
                    details.attr("transform", "translate(" + xScale(d.day) + ", 0)");

                    updateCirclePosition(circleAdd, yScale(d.added));
                    updateCirclePosition(circleDell, yScale(d.deleted));
                    updateCirclePosition(circleTotal, tScale(d.totalLines));

                    var maxXCoord = codeFrequency.select('rect').node().getBBox().width;
                    var currentXCoord = d3.mouse(codeFrequency.select('rect').node())[0];
                    var tipWidth = parseInt(tooltip.style('width'), 10);

                    var tipLeft = d3.event.pageX + 10;

                    if (maxXCoord - currentXCoord < tipWidth) {
                        tipLeft = currentXCoord - tipWidth + $('.aui-sidebar').width();
                    }

                    tooltip.style("top", (d3.event.pageY - 10) + "px")
                        .style("left", tipLeft + "px")
                        .html(Graph.Repository.codeFrequencyTip({
                            day: timeHelper.formatCodeFrequencyTipDate(d.day),
                            added: $.commify(d.added),
                            deleted: $.commify(Math.abs(d.deleted)),
                            total: $.commify(d.totalLines)
                        }));
                });

            redraw();
        };

    });



;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/graph-punchcard.js' */
define('graph/punchcard', ['jquery', 'graphs/timeHelper', 'exports'],
    function ($, timeHelper, exports) {

        exports.draw = function (from, values) {

            $('#js-punchcard-header').html(Graph.Repository.punchcardHeader({
                title: timeHelper.formatDomainTitleDate(new Date(from)) + ' - ' + timeHelper.formatDomainTitleDate(new Date())
            }));

            var data = d3.entries(values).reverse();

            var upOffset = 0, leftOffset = 0, rightOffset = 0, downOffset = 20, legendWidth = 100, height = 500, width = $("#js-punchcard").width();
            var days = [
                "Sunday",
                "Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday"
            ];

            var yRange = d3.range(7),
                xRange = d3.range(24);

            var max = d3.min(data, function (a) {
                return d3.min(a.value);
            });
            var min = d3.max(data, function (a) {
                return d3.max(a.value);
            });

            var svg = d3.select("#js-punchcard")
                .data(data)
                .append("svg")
                .attr("width", width + leftOffset + rightOffset)
                .attr("height", height + upOffset + downOffset)
                .attr("class", "viz")
                .append("g")
                .attr("transform", "translate(" + leftOffset + "," + upOffset + ")");

            var yScale = d3.scale
                .ordinal()
                .domain(yRange)
                .rangeRoundBands([height - upOffset - downOffset, 0], .1);

            var xScale = d3.scale
                .ordinal()
                .domain(xRange)
                .rangeRoundBands([0, width - legendWidth - leftOffset - rightOffset], .1);

            var rScale = d3.scale
                .quantize()
                .domain([max, min])
                .range(d3.range(0, 50));

            var day = svg.selectAll("g.day")
                .data(data)
                .enter()
                .append("g")
                .attr("class", "day")
                .attr("transform", function (a, b) {
                    return "translate(0, " + yScale(b) + ")"
                });

            day.append("line")
                .attr("x1", 0)
                .attr("y1", yScale.rangeBand())
                .attr("x2", width - leftOffset - rightOffset)
                .attr("y2", yScale.rangeBand())
                .attr("class", "axis");

            day.append("text")
                .attr("class", "label")
                .attr("dy", yScale.rangeBand() / 2)
                .text(function (a, b) {
                    return days[a.key];
                });

            svg.append("g")
                .selectAll("text.hour")
                .data(xRange)
                .enter()
                .append("text")
                .attr("text-anchor", "middle")
                .attr("transform", function (a, c) {
                    return "translate(" + (xScale(c) + legendWidth) + ", " + height + ")";
                }).attr("class", "label")
                .text(function (a) {
                    var b = a % 12 || 12;
                    return "" + b + (a < 12 ? "a" : "p");
                });

            var hour = day.selectAll("g.hour")
                .data(function (a) {
                    return a.value;
                }).enter()
                .append("g")
                .attr("class", "hour")
                .attr("transform", function (a, b) {
                    return "translate(" + (xScale(b) + legendWidth) + ", 0)";
                })
                .attr("width", xScale.rangeBand());

            hour.append("line")
                .attr("x1", 0)
                .attr("y1", function (a, b) {
                    return yScale.rangeBand() + (b % 2 === 0 ? -15 : -10);
                }).attr("x2", 0)
                .attr("y2", yScale.rangeBand())
                .attr("class", function (a, b) {
                    return b % 2 === 0 ? "axis even" : "axis odd";
                });

            var circle = hour.append("circle")
                .attr("r", 0)
                .attr("cy", yScale.rangeBand() / 2 - 2)
                .attr("class", function (a) {
                    return "day h" + rScale(a);
                });

            circle.append("title").text(function (a) {
                return a === 1 ? "1 commit" : ("" + a + " commits");
            });

            circle.transition().attr("r", function (a) {
                return xScale.rangeBand() * (rScale(a) / 100);
            });
        };
    });;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/graph-repository.js' */
define('page/repositoryGraph', ['underscore', 'jquery', 'aui', 'model/page-state', 'graph/navbuilder', 'exports', 'util/events', 'memoir', 'graph/manager', 'graph/license', 'graphs/attributesHelper', 'model/revision-reference'],
    function (_, $, AJS, pageState, nav, exports, events, memoir, graphManager, license, graphHelper, RevisionReference) {

        var graph,
            $graphsLink,
            branchActions = undefined;

        var clickGraphTab = function () {
            $("#" + graph.getName()).click();
        };

        var resizeGraph = function () {
            graphManager.createGraph(graph, license, false);
        };

        var drawGraph = function (tab) {
            var graphName = tab.attr('id');

            if (graphName != graph.getName()) {
                graph = graphHelper.getGraph({
                    graph: graphName,
                    ref: graph.getRef()
                });
            }

            tab.parent('.menu-item').addClass('active-tab');

            $graphsLink.attr('href', nav.getRepoGraphsURL(graph.getSavedState()));

            graphManager.createGraph(graph, license);
        };

        var pushState = function () {
            var state = {
                graphParams: graph.getSavedState(),
                ref: pageState.getRevisionRef().toJSON()
            };
            var graphsURL = nav.getRepoGraphsURL(state.graphParams);
            memoir.pushState(state, '', graphsURL);
            return graphsURL;
        };

        var hideBranchOperations = function () {
            if (!branchActions) {
                branchActions = $('#branch-actions').detach();
                $('#show-all-branches').hide();
            }
        };

        var showBranchOperations = function () {
            if (branchActions) {
                $('#repository-layout-revision-selector').after(branchActions);
                branchActions = undefined;
                $('#show-all-branches').show();
            }
        };

        var updateRefTitle = function (title) {
            $('#repository-layout-revision-selector').find('span.name').text(title);
        };

        exports.onReady = function (graphAttributesJSON, licenseAttributesJSON) {

            license.setLicenseAttributes(licenseAttributesJSON);

            if (!license.isFeatured() && license.isCluster()) {
                license.showLicenseInCluster($('#graphs-content'));
                return;
            }

            Chaperone.registerFeature('black-friday-2014', [{
                id: 'black-friday-2014-discovery',
                selector: '#black-friday',
                title: 'Save up to 50%',
                content: "<p>Black Friday 2014 is almost here, but we don't want you to wait until the day after Thanksgiving for Black Friday deals.</p><p>You can get <a href='https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs?from=black-friday-2014'>Awesome Graphs</a> with 50% discount off the price until Friday, November 28.</p><p><a href='https://promo.atlassian.com/WJW1AU'>Apply the discount and buy it now</a></p>",
                once: false
            }]);

            // AWEGRAPHS-91
            $('.graphs-nav').on('mousedown', function (e) {
                if (e.which == 2) {
                    e.preventDefault();
                    e.target.click();
                }
            });

            $(window).resize(function () {
                return _.debounce(resizeGraph, 100);
            });
            events.on('stash.feature.sidebar.collapseEnd', resizeGraph);
            events.on('stash.feature.sidebar.expandEnd', resizeGraph);

            $(document).ready(function () {
                var featured = 'featured-lozenge';
                (license.isEnds() && license.isFeatured()) && license.showExpiresDialog(featured);
                !license.isFeatured() && license.showFremiumDialog(featured);
            });

            events.on('graphContributorsChangeOptions', function () {
                $graphsLink.attr('href', pushState());
            });

            events.on('memoir.popstate', function (e) {
                if (e.state) {
                    $('.menu-item').removeClass('active-tab');
                    graph = graphHelper.getGraph(e.state.graphParams);

                    updateRefTitle(graph.getRef().displayId);
                    graph.isAllBranches() ? hideBranchOperations() : showBranchOperations();

                    if (e.state.ref.id != pageState.getRevisionRef().id) {
                        events.trigger('stash.page.*.revisionRefChanged', this, new RevisionReference(e.state.ref));
                    } else {
                        drawGraph($("#" + graph.getName()));
                    }
                }
            });

            $graphsLink = $('#repository-nav-graphs');
            graph = graphHelper.getGraph(graphAttributesJSON);

            if (license.isFeatured()) {

                $('#branch-actions').closest('.aui-buttons').after(aui.buttons.button({
                    id: 'show-all-branches',
                    text: "Show all",
                    type: 'link'
                }));

                $('#show-all-branches').on('click', function () {
                    var ref = {
                        id: 'all-branches',
                        displayId: "All branches",
                        isDefault: false,
                        latestChangeset: undefined
                    };
                    hideBranchOperations();
                    graph.setRef(ref);
                    updateRefTitle(ref.displayId);
                    clickGraphTab();
                });

                graph.isAllBranches() && hideBranchOperations();

                events.on('stash.layout.branch.revisionRefChanged', function (newAtRevisionRef) {
                    pageState.setRevisionRef(newAtRevisionRef);
                    graph.setRef(newAtRevisionRef.toJSON());
                    graph.isAllBranches() ? hideBranchOperations() : showBranchOperations();
                    clickGraphTab();
                });

                $('#repository-layout-revision-selector').on('click', function () {
                    $('#repository-layout-revision-selector-dialog').one('click', '.result a', function (e) {
                        var ref = pageState.getRevisionRef();
                        if (ref.id === $(e.target).data('id')) {
                            updateRefTitle(ref.getDisplayId());
                            events.trigger('stash.layout.branch.revisionRefChanged', this, ref);
                        }
                    });
                });


            } else {
                $('#repository-layout-revision-selector').after(Graph.Repository.stiltBranchButton({
                    branchName: pageState.getRevisionRef().getDisplayId()
                })).remove();
                license.createBranchSelectorTooltip();
            }

            $('.graph-tab').click(function () {
                drawGraph($(this));
                pushState();
            });

            clickGraphTab();
        };
    });
;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/graph-manager.js' */
define('graph/manager', ['underscore', 'jquery', 'aui', 'exports', 'model/page-state', 'util/ajax', 'graph/contributors', 'graph/commitActivity', 'graph/codeFrequency', 'graph/punchcard', 'graphs/attributesHelper', 'graphs/loader'],
    function (_, $, AJS, exports, pageState, ajax, contributors, commitActivity, codeFrequency, punchcard, graphHelper, dataLoader) {

        var $content,
            $progressDetails,
            indexProgress = '#graph-index-progress';

        var drawGraph = function (data, graph, license) {
            $content.html(graphHelper.getHtmlContent(graph));

            if (graph.isContributors()) {
                contributors.draw(data.days, graph, license);
            } else if (graph.isCommitActivity()) {
                commitActivity.draw(data.values);
            } else if (graph.isPunchCard()) {
                punchcard.draw(data.from, data.values);
            } else if (graph.isCodeFrequency()) {
                if (license.isFeatured()) {
                    codeFrequency.draw(data.days, graph)
                } else {
                    license.showFreemiumMessageCodeFrequency($('#js-code-frequency'));
                }
            }
        };

        var drawProgress = function (nonIndexedRepos, nonIndexedRefs) {
            if ($(indexProgress, $content).length == 0) {
                $content.html(Graph.Repository.indexingProgress());
                $progressDetails = $('.index-progress-message-details');
                AJS.progressBars && AJS.progressBars.setIndeterminate(indexProgress);
            }
            $progressDetails.text(AJS.format("Please wait until the indexing is completed ({0} repositories and {1} refs remain for indexing).", nonIndexedRepos, nonIndexedRefs));
        };

        var getPreparedParams = function (graph, isBreakMode) {
            var graphName = graph.getName() == 'contributors' || graph.getName() == 'code-frequency' ? 'repository' : graph.getName();
            return {
                resource: 'graphs/' + graphName,
                method: 'poll',
                wait: !isBreakMode,
                opts: {
                    data: {
                        projectKey: pageState.getProject().getKey(),
                        repoSlug: pageState.getRepository().getSlug(),
                        refId: graph.getRef().id,
                        version: 'v2'
                    },
                    statusCode: {
                        '404': function () {
                            $(".spinner").remove();
                            $content.html(aui.message.warning({
                                content: AJS.format("No branch or tag \u0027\u0027{0}\u0027\u0027 exists in the repository \u0027\u0027{1}\u0027\u0027.", pageState.getRevisionRef().id, pageState.getRepository().getSlug())
                            }));
                            return false;
                        }
                    },
                    tick: function (graphView) {
                        $(".spinner").remove();
                        if (graphView.payload) {
                            return true;
                        }
                        drawProgress(graphView.nonIndexedRepos, graphView.nonIndexedRefs);
                        return undefined;
                    },
                    interval: 5000,
                    pollTimeout: Infinity
                }
            };
        };

        exports.createGraph = function (graph, license, isBreakMode) {
            $(window).off('scroll.graph');
            isBreakMode = _.isUndefined(isBreakMode) || isBreakMode;

            $content = $('#graphs-content').empty();
            $(".spinner").remove();
            $("<div class='spinner'/>").insertAfter($content).spin('large');

            dataLoader.load(getPreparedParams(graph, isBreakMode)).done(function (graphView) {
                drawGraph(graphView.payload, graph, license);
            });
        }
    });;
;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-side', location = 'js/repository/email-aliases-notifier.js' */
define('contributors/email-aliases-notifier', ['underscore', 'jquery', 'aui', 'model/page-state', 'stash/api/util/navbuilder', 'chaperone', 'exports'],
    function (_, $, AJS, pageState, nav, Chaperone, exports) {

        function isAlias(person, displayName, emailLogin) {
            var emailLogins = $('.aname', person).attr('title').split(', ').map(function (email) {
                return email.split('@')[0].toLowerCase();
            });

            return $('a', person).text().toLowerCase() === displayName
                || $('.aname', person).text().toLowerCase() === displayName
                || _.contains(emailLogins, emailLogin);
        }

        function notify() {
            var user = pageState.getCurrentUser();

            if (user != null) {
                var displayName = user.get('displayName').toLowerCase(),
                    emailLogin = user.get('emailAddress').split('@')[0].toLowerCase(),
                    id = user.get('id');

                var aliases = $('.person').filter(function (index, person) {
                    return !$(person).data('is-stash-user') && isAlias(person, displayName, emailLogin);
                });

                if (aliases.length > 0) {
                    var person = $(':first:visible', aliases);
                    Chaperone.registerFeature('email-addresses-' + id, [{
                        id: 'email-addresses-discovery',
                        selector: person,
                        width: person.width() - 20,
                        title: "Email addresses",
                        content: AJS.format("\u003cp\u003eAwesome Graphs lets you \u003ca href=\u0022{0}\u0022\u003eassociate multiple email addresses\u003c/a\u003e with an account.\u003c/p\u003e", nav.pluginServlets().path('graphs-email-addresses').buildAbsolute()),
                        moreInfo: {
                            href: 'https://docs.stiltsoft.com/display/AwesomeGraphs/Managing+Emails?src=contributor-alias',
                            text: 'Learn more'
                        },
                        once: false
                    }]);
                }
            }
        }

        exports.notify = notify;
    });;
;/* module-key = 'com.stiltsoft.stash.graphs:graphs-sticky-branches', location = 'js/common/graph-sticky-branches.js' */
define('page/graphs-sticky-branches', ['jquery', 'util/events', 'stash/api/util/navbuilder', 'exports'],
    function($, events, nav, exports) {

    exports.onReady = function() {
        events.on('stash.layout.branch.revisionRefChanged', function(revisionRef) {
            if (revisionRef) {
                var $graphsLink = $('#repository-nav-graphs');
                if (!revisionRef.getIsDefault()) {
                    $graphsLink.attr('href', nav.parse($graphsLink.attr('href')).replaceQueryParam('refId', revisionRef.getId()));
                } else {
                    $graphsLink.attr('href', nav.parse($graphsLink.attr('href')).deleteQueryParam('refId'));
                }
            }
        });
    };
});

AJS.$(document).ready(function() {
    require('page/graphs-sticky-branches').onReady();
});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:user-link', location = '/static/widget/user/user-link.soy' */
// This file was automatically generated from user-link.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }


stash.widget.userLink = function(opt_data, opt_ignored) {
  var output = '';
  var displayName__soy3 = opt_data.user.displayName || opt_data.user.name;
  output += (opt_data.href || opt_data.user.type == 'NORMAL' && opt_data.user.slug && !!(require('model/page-state').getCurrentUser())) ? '<a href="' + soy.$$escapeHtml(opt_data.href ? opt_data.href : require('stash/api/util/navbuilder').user(opt_data.user.slug).build()) + '" ' + ((opt_data.extraClasses) ? 'class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + ((! opt_data.skipTitle) ? 'title="' + soy.$$escapeHtml(displayName__soy3) + '"' : '') + '>' + soy.$$escapeHtml(soy.$$truncate(displayName__soy3, 100, true)) + '</a>' : '<span' + ((opt_data.extraClasses) ? ' class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + ((! opt_data.skipTitle) ? ' title="' + soy.$$escapeHtml(displayName__soy3) + '"' : '') + '>' + soy.$$escapeHtml(soy.$$truncate(displayName__soy3, 100, true)) + '</span>';
  return output;
};
if (goog.DEBUG) {
  stash.widget.userLink.soyTemplateName = 'stash.widget.userLink';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:avatar', location = '/static/widget/avatar/avatar.soy' */
// This file was automatically generated from avatar.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }


stash.widget.avatar = function(opt_data, opt_ignored) {
  return '' + aui.avatar.avatar({size: opt_data.size, avatarImageUrl: require('stash/api/util/navbuilder')._avatarUrl(opt_data.person, ({XSMALL:32,SMALL:48,MEDIUM:64,LARGE:96,XLARGE:128,XXLARGE:192,XXXLARGE:256})[opt_data.size.toUpperCase()]).build(), accessibilityText: opt_data.person.displayName || opt_data.person.name, title: opt_data.tooltip, badgeContent: opt_data.badgeContent, extraClasses: 'user-avatar' + (opt_data.hideBadge ? ' badge-hidden' : '') + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), imageClasses: opt_data.imageClasses, extraAttributes: {'data-username': opt_data.person.name}, id: opt_data.id});
};
if (goog.DEBUG) {
  stash.widget.avatar.soyTemplateName = 'stash.widget.avatar';
}


stash.widget.avatarWithName = function(opt_data, opt_ignored) {
  var output = '';
  var personName__soy14 = opt_data.person.displayName || opt_data.person.name;
  output += '<div class="avatar-with-name' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '" title="' + soy.$$escapeHtml(personName__soy14) + '">' + stash.widget.avatar({size: opt_data.size, person: opt_data.person, imageClasses: opt_data.imageClasses, extraClasses: opt_data.avatarClasses, badgeContent: opt_data.badgeContent, hideBadge: opt_data.hideBadge, id: opt_data.id}) + ((opt_data.link) ? stash.widget.userLink({user: opt_data.person, href: opt_data.href, extraClasses: opt_data.linkExtraClasses, skipTitle: true}) : soy.$$escapeHtml(personName__soy14)) + '</div>';
  return output;
};
if (goog.DEBUG) {
  stash.widget.avatarWithName.soyTemplateName = 'stash.widget.avatarWithName';
}


stash.widget.avatarWithNameAndEmail = function(opt_data, opt_ignored) {
  return stash.widget.avatarWithName(opt_data) + '<span class="email-address" title="' + soy.$$escapeHtml(opt_data.person.emailAddress) + '">' + soy.$$escapeHtml(opt_data.person.emailAddress) + '</span>';
};
if (goog.DEBUG) {
  stash.widget.avatarWithNameAndEmail.soyTemplateName = 'stash.widget.avatarWithNameAndEmail';
}


stash.widget.avatarSizeInPx = function(opt_data, opt_ignored) {
  return '' + soy.$$escapeHtml(({XSMALL:32,SMALL:48,MEDIUM:64,LARGE:96,XLARGE:128,XXLARGE:192,XXXLARGE:256})[opt_data.size.toUpperCase()]) + ((opt_data.showPx) ? 'px' : '');
};
if (goog.DEBUG) {
  stash.widget.avatarSizeInPx.soyTemplateName = 'stash.widget.avatarSizeInPx';
}


stash.widget.avatarWithBadge = function(opt_data, opt_ignored) {
  return '' + stash.widget.avatar({size: opt_data.size, person: opt_data.person, tooltip: opt_data.tooltip, imageClasses: opt_data.imageClasses, extraClasses: opt_data.extraClasses, id: opt_data.id, hideBadge: opt_data.hideBadge, badgeContent: '<span class="badge' + soy.$$escapeHtml(opt_data.badgeClasses ? ' ' + opt_data.badgeClasses : '') + '">' + soy.$$escapeHtml(opt_data.badgeText) + '</span>'});
};
if (goog.DEBUG) {
  stash.widget.avatarWithBadge.soyTemplateName = 'stash.widget.avatarWithBadge';
}


stash.widget.avatarWithNameAndBadge = function(opt_data, opt_ignored) {
  return '' + stash.widget.avatarWithName({size: opt_data.size, person: opt_data.person, extraClasses: opt_data.extraClasses, avatarClasses: opt_data.avatarClasses, imageClasses: opt_data.imageClasses, id: opt_data.id, hideBadge: opt_data.hideBadge, badgeContent: '<span class="badge' + soy.$$escapeHtml(opt_data.badgeClasses ? ' ' + opt_data.badgeClasses : '') + '">' + soy.$$escapeHtml(opt_data.badgeText) + '</span>'});
};
if (goog.DEBUG) {
  stash.widget.avatarWithNameAndBadge.soyTemplateName = 'stash.widget.avatarWithNameAndBadge';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:avatar', location = '/static/widget/avatar/group-avatar.soy' */
// This file was automatically generated from group-avatar.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }


stash.widget.groupAvatar = function(opt_data, opt_ignored) {
  return '<span class="aui-avatar aui-avatar-' + soy.$$escapeHtml(opt_data.size) + ' group-avatar' + soy.$$escapeHtml(opt_data.extraClasses ? ' ' + opt_data.extraClasses : '') + '" data-groupname="' + soy.$$escapeHtml(opt_data.name) + '"></span>';
};
if (goog.DEBUG) {
  stash.widget.groupAvatar.soyTemplateName = 'stash.widget.groupAvatar';
}


stash.widget.groupAvatarWithName = function(opt_data, opt_ignored) {
  return '<span title="' + soy.$$escapeHtml(opt_data.name) + '"' + ((opt_data.extraClasses) ? ' class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + '><span class="aui-avatar aui-avatar-' + soy.$$escapeHtml(opt_data.size) + ' group-avatar' + soy.$$escapeHtml(opt_data.avatarClasses ? ' ' + opt_data.avatarClasses : '') + '" data-groupname="' + soy.$$escapeHtml(opt_data.name) + '"></span>' + soy.$$escapeHtml(opt_data.name) + '</span>';
};
if (goog.DEBUG) {
  stash.widget.groupAvatarWithName.soyTemplateName = 'stash.widget.groupAvatarWithName';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:person-model', location = '/static/model/person.js' */
define("model/person",["backbone-brace"],function(A){return A.Model.extend({namedAttributes:{emailAddress:"string",name:"string"},idAttribute:"name",initialize:function(){if(this.namedAttributes.id==null){this.setId(this.attributes[this.idAttribute])}}})});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:stash-user-model', location = '/static/model/stash-user.js' */
define("model/stash-user",["model/person"],function(B){var A=B.extend({namedAttributes:{active:"boolean",avatarUrl:"string",displayName:"string",id:"number",isAdmin:"boolean",link:Object,links:Object,type:"string",slug:"string"}});return A});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:keyboard-shortcuts', location = '/static/widget/keyboard-shortcuts/keyboard-shortcuts.js' */
define("widget/keyboard-shortcuts",["aui","jquery","lodash","util/events","util/navigator","exports"],function(H,D,J,K,F,B){var L=/^[cC]trl$/i,I="\u2318";var A={};function G(){if(!(this instanceof G)){return new G()}this._dialog=new H.Dialog({width:830,height:580,id:"keyboard-shortcut-dialog",closeOnOutsideClick:true});this._enabledContexts=[]}G.prototype._setRegistry=function(M){this._registry=M};G.prototype._initContent=function(){this._dialog.addHeader("Keyboard shortcuts");this._dialog.addPanel("",stash.widget.keyboardShortcutsContent({contextNames:J.keys(A),contexts:J.values(A)}));this._dialog.addCancel("Close",function(M){M.hide()})};G.prototype._bind=function(M){this._$trigger=M;var N=this;this._$trigger.on("click",function(O){N._show();O.preventDefault()})};G.prototype.enableContext=function(M){if(D.inArray(M,this._enabledContexts)!==-1){return }this._registry.enableContext(M);this._enabledContexts.push(M)};G.prototype.resetContexts=function(){H.trigger("remove-bindings.keyboardshortcuts");this._enabledContexts=[];H.trigger("add-bindings.keyboardshortcuts")};G.prototype._show=function(){if(!this._hasShown){this._initContent();this._hasShown=true}this._dialog.show();this._dialog.updateHeight();this._dialog.getCurrentPanel().body.find(".keyboard-shortcut-help").focus()};G.prototype.addCustomShortcut=function(N,P,O,Q){var M=C({keys:P,context:N,displayContext:Q,description:O},{convertOSModifier:false})};G.convertOSModifier=function(M){return F.isMac()?M.replace(L,I):M};function C(M,N){M=D.extend({},M);M.keys=J.map(M.keys,function(O){return J.map(O,function(P){if(J.all(["key","modifiers"],J.partial(J.has,P))){return P}var Q=(P.length>1)?P.split("+"):P;if(!J.isArray(Q)||Q.length===1){return P}return{key:Q.pop(),modifiers:N&&N.convertOSModifier===false?Q:J.map(Q,G.convertOSModifier)}})});if(!M.displayContext){M.displayContext=G._contextDisplayInfo[M.context]?G._contextDisplayInfo[M.context].displayName:M.context.replace(/\b[a-z]/g,function(O){return O.toUpperCase()})}if(!A[M.displayContext]){A[M.displayContext]=[]}A[M.displayContext].push(M)}G.internalizeShortcuts=function(M){J.each(M,C)};G._contextDisplayInfo={repository:{displayName:"Within A Repository"},"branch-compare":{displayName:"Branch compare"},"branch-list":{displayName:"Branch list"},changeset:{displayName:"Changeset"},commits:{displayName:"Commit List"},"diff-tree":{displayName:"Changeset"},"diff-view":{displayName:"Diff View"},filebrowser:{displayName:"Directory Browsing"},global:{displayName:"Global"},"pull-request":{displayName:"Within A Pull Request"},"pull-request-list":{displayName:"Pull Request List"},"pull-request-overview":{displayName:"Within A Pull Request"},sourceview:{displayName:"Source View"}};var E=new G();B.onReady=function(){E._bind(D(".keyboard-shortcut-link"));var M=D.Deferred();D(document).ready(function(){setTimeout(function(){M.resolve()},0)});H.bind("register-contexts.keyboardshortcuts",function(O,N){E._setRegistry(N.shortcutRegistry);E.enableContext("global");M.done(function(){K.trigger("stash.widget.keyboard-shortcuts.register-contexts",E,E)})});H.bind("shortcuts-loaded.keyboardshortcuts",function(O,N){G.internalizeShortcuts(N.shortcuts)});H.params["keyboardshortcut-hash"]="bundled";H.trigger("initialize.keyboardshortcuts")};B.addTooltip=function(N,P){var M=J(P.split("+")).chain().map(G.convertOSModifier).map(function(Q){if(Q==="shift"){return "Shift"}else{if(Q==="ctrl"){return G.convertOSModifier("Ctrl")}else{return Q}}}).value().join(" + ");var O=N.attr("title");N.attr("title",O+H.format(" (Type \u0027\u0027{0}\u0027\u0027)",M));return{remove:function(){N.attr("title",O)}}};B.showDialog=function(){if(E){E._show()}};B.resetContexts=function(){E.resetContexts()}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:keyboard-shortcuts', location = '/static/widget/keyboard-shortcuts/keyboard-shortcuts.soy' */
// This file was automatically generated from keyboard-shortcuts.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }


stash.widget.keyboardShortcutsContent = function(opt_data, opt_ignored) {
  var param6 = '';
  var contextNameList7 = opt_data.contextNames;
  var contextNameListLen7 = contextNameList7.length;
  for (var contextNameIndex7 = 0; contextNameIndex7 < contextNameListLen7; contextNameIndex7++) {
    var contextNameData7 = contextNameList7[contextNameIndex7];
    param6 += (contextNameIndex7 % 2 == 0) ? stash.widget.keyboardShortContext({contextName: contextNameData7, contextShortcuts: opt_data.contexts[contextNameIndex7]}) : '';
  }
  var param5 = '' + aui.group.item({content: param6});
  var param15 = '';
  var contextNameList16 = opt_data.contextNames;
  var contextNameListLen16 = contextNameList16.length;
  for (var contextNameIndex16 = 0; contextNameIndex16 < contextNameListLen16; contextNameIndex16++) {
    var contextNameData16 = contextNameList16[contextNameIndex16];
    param15 += (contextNameIndex16 % 2 == 1) ? stash.widget.keyboardShortContext({contextName: contextNameData16, contextShortcuts: opt_data.contexts[contextNameIndex16]}) : '';
  }
  param5 += aui.group.item({content: param15});
  var output = '' + aui.group.group({extraClasses: 'keyboard-shortcut-help', extraAttributes: {tabindex: '-1'}, content: param5});
  return output;
};
if (goog.DEBUG) {
  stash.widget.keyboardShortcutsContent.soyTemplateName = 'stash.widget.keyboardShortcutsContent';
}


stash.widget.keyboardShortContext = function(opt_data, opt_ignored) {
  var output = '<div class="keyboard-shortcut-context"><h3>' + soy.$$escapeHtml(opt_data.contextName) + '</h3><dl>';
  var shortcutList29 = opt_data.contextShortcuts;
  var shortcutListLen29 = shortcutList29.length;
  for (var shortcutIndex29 = 0; shortcutIndex29 < shortcutListLen29; shortcutIndex29++) {
    var shortcutData29 = shortcutList29[shortcutIndex29];
    output += (! shortcutData29.hidden) ? stash.widget.keyboardShortcutItem({shortcut: shortcutData29}) : '';
  }
  output += '</dl></div>';
  return output;
};
if (goog.DEBUG) {
  stash.widget.keyboardShortContext.soyTemplateName = 'stash.widget.keyboardShortContext';
}


stash.widget.keyboardShortcutItem = function(opt_data, opt_ignored) {
  var output = '<dt>' + soy.$$escapeHtml(opt_data.shortcut.description) + '</dt>';
  var optionList40 = opt_data.shortcut.keys;
  var optionListLen40 = optionList40.length;
  for (var optionIndex40 = 0; optionIndex40 < optionListLen40; optionIndex40++) {
    var optionData40 = optionList40[optionIndex40];
    output += ((! (optionIndex40 == 0) && ! (optionIndex40 == optionListLen40 - 1)) ? '<dd class=\'separator\'>' + soy.$$escapeHtml(",") + '</dd>' : '') + ((! (optionIndex40 == 0) && optionIndex40 == optionListLen40 - 1) ? '<dd class=\'separator\'>' + soy.$$escapeHtml(" or") + '</dd>' : '') + '<dd>' + stash.widget.keyboardShortcutOption({sequence: optionData40}) + '</dd>';
  }
  return output;
};
if (goog.DEBUG) {
  stash.widget.keyboardShortcutItem.soyTemplateName = 'stash.widget.keyboardShortcutItem';
}


stash.widget.keyboardShortcutOption = function(opt_data, opt_ignored) {
  var output = '';
  var keypressList57 = opt_data.sequence;
  var keypressListLen57 = keypressList57.length;
  for (var keypressIndex57 = 0; keypressIndex57 < keypressListLen57; keypressIndex57++) {
    var keypressData57 = keypressList57[keypressIndex57];
    output += ((! (keypressIndex57 == 0)) ? ' ' + soy.$$escapeHtml("then") + ' ' : '') + ((keypressData57.modifiers) ? stash.widget.keyboardShortcutModifier({keypress: keypressData57}) : stash.widget.keyboardShortcutKey({key: keypressData57}));
  }
  return output;
};
if (goog.DEBUG) {
  stash.widget.keyboardShortcutOption.soyTemplateName = 'stash.widget.keyboardShortcutOption';
}


stash.widget.keyboardShortcutModifier = function(opt_data, opt_ignored) {
  var output = '';
  var modifierList72 = opt_data.keypress.modifiers;
  var modifierListLen72 = modifierList72.length;
  for (var modifierIndex72 = 0; modifierIndex72 < modifierListLen72; modifierIndex72++) {
    var modifierData72 = modifierList72[modifierIndex72];
    output += stash.widget.keyboardShortcutKey({key: modifierData72});
  }
  output += stash.widget.keyboardShortcutKey({key: opt_data.keypress.key});
  return output;
};
if (goog.DEBUG) {
  stash.widget.keyboardShortcutModifier.soyTemplateName = 'stash.widget.keyboardShortcutModifier';
}


stash.widget.keyboardShortcutKey = function(opt_data, opt_ignored) {
  return '<kbd>' + soy.$$escapeHtml(opt_data.key) + '</kbd>';
};
if (goog.DEBUG) {
  stash.widget.keyboardShortcutKey.soyTemplateName = 'stash.widget.keyboardShortcutKey';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:loaded-range', location = '/static/widget/loaded-range.js' */
define("widget/loaded-range",function(){function A(B){this.start=undefined;this.nextPageStart=undefined;this._reachedStart=false;this._reachedEnd=false;this._reachedCapacity=false;this._capacity=B||Infinity}A.prototype.isEmpty=function(){return this.start===undefined};A.prototype.isBeforeStart=function(B){return B<this.start};A.prototype.isAfterNextPageStart=function(B){return B>this.nextPageStart};A.prototype.isLoaded=function(B){return !(this.isEmpty()||this.isBeforeStart(B)||this.isAfterNextPageStart(B))};A.prototype.getAttachmentMethod=function(C,B){return this.isEmpty()?"html":this.isBeforeStart(C)?"prepend":"append"};A.prototype.add=function(G,C,B,E){var F=this.isEmpty();E=E||(G+C);if(F||this.isBeforeStart(G)){this.start=G}if(F||this.isAfterNextPageStart(E)){this.nextPageStart=E}this._reachedStart=this._reachedStart||G<=0;var D=this._reachedEnd=this._reachedEnd||B;if(!D&&this.nextPageStart>=this._capacity){this._reachedCapacity=this._reachedEnd=true}return this};A.prototype.reachedStart=function(){return this._reachedStart};A.prototype.reachedEnd=function(){return this._reachedEnd};A.prototype.reachedCapacity=function(){return this._reachedCapacity};A.prototype.pageBefore=function(B){if(this.reachedStart()){return null}var C=Math.max(0,this.start-B);return{start:C,limit:this.start-C}};A.prototype.pageAfter=function(B){if(this.reachedEnd()){return null}return{start:this.nextPageStart,limit:B}};return A});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:paged-scrollable', location = '/static/widget/paged-scrollable.js' */
define("widget/paged-scrollable",["aui","jquery","lodash","util/events","util/function","util/navigator","widget/loaded-range"],function(H,C,I,J,E,F,B){var A=F.isIE();function G(L,K){this.options=C.extend({},G.defaults,K);this.$scrollElement=C(L||window);if(C.isWindow(this.$scrollElement[0])){var M=window.document.documentElement;this.getPaneHeight=function(){return M.clientHeight};this.getContentHeight=function(){return M.scrollHeight}}this._eventHandlers=[]}G.defaults={pageSize:50,scrollDelay:250,bufferPixels:0,precedingSpaceMaintained:true,suspendOnFailure:true,dataLoadedEvent:"stash.widget.pagedscrollable.dataLoaded",autoLoad:true,preventOverscroll:false,idForEntity:null};G.prototype.init=function(M){G.prototype.reset.call(this);M=M||{};this.loadedRange=M.loadedRange||new B();var L=this;var K=this.options.pageSize;var N=M.targetedItem?Math.floor(M.targetedItem/K)*K:0;if(M.suspended){this.suspend()}if(this.loadedRange.isLoaded(N)){return(this.loadIfRequired()||C.Deferred().resolve()).done(function(){L.onFirstDataLoaded()})}return D(this,N,K).then(undefined,function(){var O=N!==0;if(O){return D(L,0,K)}else{return C.Deferred().rejectWith(this,arguments)}}).fail(function(R,Q,O,P){if(P&&P.errors&&P.errors.length){L.handleErrors(P.errors)}})};G.prototype.reset=function(){if(this.currentXHR){this.cancelRequest()}this.clearListeners();if(this._resizeHandler){C(window).off("resize",this._resizeHandler);this._resizeHandler=null}if(this.options.idForEntity){this._ids={}}this._suspended=false};G.prototype.destroy=function(){this.reset();delete this.$scrollElement};G.prototype.suspend=function(){this._suspended=true};G.prototype.resume=function(){this._suspended=false;return this.loadIfRequired()};G.prototype.isSuspended=function(){return this._suspended};G.prototype.getScrollTop=function(){return this.$scrollElement.scrollTop()};G.prototype.setScrollTop=function(K){this.$scrollElement.scrollTop(K)};G.prototype.getPane=function(){return this.$scrollElement};G.prototype.getPaneHeight=function(){return this.$scrollElement[0].clientHeight};G.prototype.getContentHeight=function(){return this.$scrollElement[0].scrollHeight};G.prototype.getOption=function(K){if(Object.prototype.hasOwnProperty.call(this.options,K)){return this.options[K]}return undefined};G.prototype.setOptions=function(K){if(C.isPlainObject(K)){this.options=C.extend(this.options,K)}};G.prototype.addScrollListener=function(L){var K=this.scrollDelay?I.debounce(L,this.scrollDelay):L;this._eventHandlers.push(K);this.$scrollElement.on("scroll.paged-scrollable",K)};G.prototype._bindOverscrollPrevention=function(){function K(N,O){var L=C(this).outerHeight();var M=this.scrollHeight;if((this.scrollTop===(M-L)&&O<0)||(this.scrollTop===0&&O>0)){N.preventDefault()}}this._eventHandlers.push(K);this.$scrollElement.on("mousewheel.paged-scrollable",K)};G.prototype.clearListeners=function(){var K=this;I.each(this._eventHandlers,function(L){K.$scrollElement.unbind(".paged-scrollable",L)});this._eventHandlers.length=0};G.prototype.loadIfRequired=function(){if(this.isSuspended()||(this.loadedRange.reachedEnd()&&this.loadedRange.reachedStart())){return }var P=this.getScrollTop(),L=this.getPaneHeight(),N=this.getContentHeight(),O=L+P;if(!C.isWindow(this.getPane()[0])&&this.getPane().is(":hidden")){return }if(I.any([true,"previous"],E.eq(this.options.autoLoad))&&P<this.options.bufferPixels+(this.loadedRange.start/this.loadedRange.nextPageStart)*N){var K=this.loadedRange.pageBefore(this.options.pageSize);if(K){return this.load(K.start,K.limit)}}var Q=1;if(I.any([true,"next"],E.eq(this.options.autoLoad))&&O+Q>=N-this.options.bufferPixels){var M=this.loadedRange.pageAfter(this.options.pageSize);if(M){return this.load(M.start,M.limit)}}};function D(L,M,K){if(L.currentXHR){return C.Deferred().reject()}L.currentXHR=L.requestData(M,K);return L.currentXHR.always(function(){L.currentXHR=null}).done(function(N){L.onDataLoaded(M,K,N)}).fail(function(){L.suspend()})}G.prototype.load=function(M,K){var L=this;return D(this,M,K).fail(function(Q,P,N,O){if(O&&O.errors){L.handleErrors(O.errors)}})};G.prototype.loadAfter=function(){var K=this.loadedRange.pageAfter(this.options.pageSize);return K&&this.load(K.start,K.limit)};G.prototype.loadBefore=function(){var K=this.loadedRange.pageBefore(this.options.pageSize);return K&&this.load(K.start,K.limit)};G.prototype.onDataLoaded=function(M,N,P){if(P.start!==undefined){M=P.start}var R=this.loadedRange.isEmpty(),K=this.loadedRange.getAttachmentMethod(M,P.size),Q=K==="prepend";this.loadedRange.add(M,P.size,P.isLastPage,P.nextPageStart);var S,O;if(Q||A){O=this.getScrollTop();S=this.getContentHeight()}P=this._addPage(P,K);if(Q||A){var L=Q?this.getContentHeight()-S:0;this.setScrollTop(O+L)}if(R){this.onFirstDataLoaded(M,N,P)}J.trigger(this.options.dataLoadedEvent,this,M,N,P);this.loadIfRequired()};G.prototype._addPage=function(L,K){L=this._dedupe(L);this.attachNewContent(L,K);return L};G.prototype._dedupe=function(M){if(M&&M.values&&this.options.idForEntity){var L=this._ids;var K=this.options.idForEntity;M=C.extend({},M,{values:I.filter(M.values,function(N){var O=K(N);if(!I.has(L,O)){L[O]=true;return true}return false})})}return M};G.prototype.onFirstDataLoaded=function(){var K=this;this.addScrollListener(function(){K.loadIfRequired()});if(this.options.preventOverscroll){this._bindOverscrollPrevention()}C(window).on("resize",this._resizeHandler=function(){K.loadIfRequired()})};G.prototype.cancelRequest=function(){if(this.currentXHR){if(this.currentXHR.abort){this.currentXHR.abort()}else{if(this.currentXHR.reject){this.currentXHR.reject()}else{H.log("Couldn't cancel the current request.")}}this.currentXHR=null}};G.prototype.add=function(L,K){if(L.length){L=this._addPage({values:L,size:L.length},K||"prepend");return true}return false};G.prototype.remove=function(K){if(this.options.idForEntity){var L=this.options.idForEntity(K);if(I.has(this._ids,L)){delete this._ids[L];if(typeof this.loadedRange.nextPageStart==="number"){this.loadedRange.nextPageStart=Math.max(0,this.loadedRange.nextPageStart-1)}return true}}return false};G.prototype.attachNewContent=function(L,K){throw new Error("attachNewContent is abstract and must be implemented.")};G.prototype.requestData=function(L,K){throw new Error("requestData is abstract and must be implemented.  It must return a promise. It is preferred to return a jqXHR.")};G.prototype.handleErrors=function(K){throw new Error("handleErrors is abstract and must be implemented.")};return G});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:keyboard-controller', location = '/static/widget/keyboard-controller.js' */
define("widget/keyboard-controller",["aui","jquery"],function(B,D){function A(I,G){if(!(this instanceof A)){return new A(I,G)}var F=D(I);var H;F.on("keydown",H=function(J){if(J.keyCode in G){if(!G[J.keyCode](J)){J.preventDefault()}}});this.destroy=function(){F.off("keydown",H)};return this}function C(I,G){G=D.extend({},C.defaults,G);function H(J){J.focus().addClass(G.focusedClass)}var F={};F[B.keyCode.TAB]=function(N){var K,J,L,M=N.target;K=D("a:visible, :input:visible:enabled, :checkbox:visible:enabled, :radio:visible:enabled, [tabindex]",I).not("[tabindex=-1]").filter(function(){return D(this).css("visibility")!=="hidden"});L=K.last();J=K.first();K.removeClass(G.focusedClass);if(N.shiftKey&&M===J[0]){if(!G.wrapAround){return true}H(L)}else{if(!N.shiftKey&&M===L[0]){if(!G.wrapAround){return true}H(J)}else{if(N.shiftKey){H(K.eq(K.index(M)-1))}else{H(K.eq(K.index(M)+1))}}}};return new A(I,F)}C.defaults={focusedClass:"item-focused",wrapAround:true};function E(S,T,U){U=D.extend({},E.defaults,U);var G=D(T);var R=D.Callbacks();var P=D.Callbacks();if(U.onSelect){R.add(U.onSelect)}if(U.onFocus){P.add(U.onFocus)}var J=false,F=false,L=false;function I(W){do{var X=W.find(">:first-child");var V=W.next();if(X.length){W=X}else{if(V.length){W=V}else{W=W.parentsUntil(G[0]).next().first()}}}while(W.length&&!W.is(U.itemSelector));return W}function O(X){do{var W=X.prev();if(W.length){var V;while((V=W.find(">:last-child")).length){W=V}X=W}else{X=X.parent();if(X[0]===G[0]){X=D()}}}while(X.length&&!X.is(U.itemSelector));return X}function Q(V){return function W(d){var c=D(U.itemSelector,G);var f=c.filter(function(){return D(this).hasClass(U.focusedClass)});var X=false;var g=V==="next";var a;if(f.length){if(U.adjacentItems){a=f[V](U.itemSelector)}else{if(V==="next"){a=I(f)}else{a=O(f)}}}else{if(V==="next"){a=c.first()}else{if(U.wrapAround){a=c.last()}else{return }}}L=true;if(!a.length){if(V==="next"&&U.requestMore&&!J){if(!F){L=false;var i=U.requestMore();if(i){F=true;i.done(function(e){J=e;if(!L){W(d)}}).always(function(){F=false;L=false});return }else{J=true;W(d);return }}else{L=false;return }}else{if(U.wrapAround){X=true;g=!g;a=c[V==="next"?"first":"last"]()}else{return }}}f.removeClass(U.focusedClass);a.addClass(U.focusedClass);var Y=a[V](),b=!X&&Y.length?Y:a;var Z=document.activeElement;if(U.focusIntoView&&Z){var h=b.attr("tabindex");b.attr("tabindex","0");b.focus();Z.focus();if(h==null){b.removeAttr("tabindex")}else{b.attr("tabindex",h)}}else{a[0].scrollIntoView(false)}P.fire(a,d)}}var K={};var N=K[B.keyCode.UP]=Q("prev");var H=K[B.keyCode.DOWN]=Q("next");K[B.keyCode.ENTER]=function(V){var X=D(U.itemSelector,G);var W=X.filter(function(){return D(this).hasClass(U.focusedClass)});if(W.length){R.fire(W,V)}};var M=new A(S,K);M.setListElement=function(V){G=D(V)};M.blur=function(){D(U.itemSelector,G).removeClass(U.focusedClass)};M.focus=function(){P.add.apply(P,arguments);return this};M.select=function(){R.add.apply(R,arguments);return this};M.moveToNext=H;M.moveToPrev=N;return M}E.defaults={itemSelector:"li",focusedClass:"item-focused",wrapAround:false,adjacentItems:true,requestMore:undefined,onFocus:undefined,onSelect:undefined};return{KeyboardController:A,TabKeyboardController:C,ListKeyboardController:E}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:jquery-mousewheel', location = '/static/bower/jquery-mousewheel/jquery.mousewheel.js' */
/* Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.1.1
 *
 * Requires: 1.2.2+
 */
(function(A){if(typeof define==="function"&&define.amd){define(["jquery"],A)}else{A(jQuery)}}(function(E){var D=["wheel","mousewheel","DOMMouseScroll"];var G="onwheel" in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"];var F,A;if(E.event.fixHooks){for(var B=D.length;B;){E.event.fixHooks[D[--B]]=E.event.mouseHooks}}E.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var H=G.length;H;){this.addEventListener(G[--H],C,false)}}else{this.onmousewheel=C}},teardown:function(){if(this.removeEventListener){for(var H=G.length;H;){this.removeEventListener(G[--H],C,false)}}else{this.onmousewheel=null}}};E.fn.extend({mousewheel:function(H){return H?this.bind("mousewheel",H):this.trigger("mousewheel")},unmousewheel:function(H){return this.unbind("mousewheel",H)}});function C(H){var I=H||window.event,N=[].slice.call(arguments,1),P=0,K=0,J=0,M=0,L=0,O;H=E.event.fix(I);H.type="mousewheel";if(I.wheelDelta){P=I.wheelDelta}if(I.detail){P=I.detail*-1}if(I.deltaY){J=I.deltaY*-1;P=J}if(I.deltaX){K=I.deltaX;P=K*-1}if(I.wheelDeltaY!==undefined){J=I.wheelDeltaY}if(I.wheelDeltaX!==undefined){K=I.wheelDeltaX*-1}M=Math.abs(P);if(!F||M<F){F=M}L=Math.max(Math.abs(J),Math.abs(K));if(!A||L<A){A=L}O=P>0?"floor":"ceil";P=Math[O](P/F);K=Math[O](K/A);J=Math[O](J/A);N.unshift(H,P,K,J);return(E.event.dispatch||E.event.handle).apply(this,N)}}));;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:promise-util', location = '/static/util/promise.js' */
define("util/promise",["jquery","lodash","exports"],function(H,O,F){var B={PENDING:"pending",REJECTED:"rejected",RESOLVED:"resolved"};function E(R){R&&R.abort&&R.abort()}function K(){var R=Array.prototype.slice.call(arguments);var S=H.when.apply(H,R);S.abort=function(){O.forEach(R,E)};return S}function M(){console.log("Promise does not have an abort function")}function C(){var R=H.when.apply(H,arguments);R.abort=O.invoke.bind(O,arguments,"abort");return P(R)}function P(a,T,S){var R;var Z=a;var V=H.Callbacks();var W={};function X(){if(W.state()==="pending"){if(!R){E(Z)}R=true}V.fire()}function Y(b,c){return function(){if(R){return new H.Deferred()[b+"With"](this,arguments)}Z=c.apply(this,arguments);return Z}}var U=a.then(T?Y("resolve",T):null,S?Y("reject",S):null);W.abort=X;W.thenAbortable=function(b,d){var c=P(W,b,d);V.add(c.abort);return c};return U.promise(W)}function G(S,R){return function(){var X=H.Deferred();var T=this;var U=Array.prototype.slice.call(arguments);var Y;var W=function(){return setTimeout(function(){var Z=S.apply(T,U);Z.done(X.resolve).fail(X.reject);Y=Z.abort?O.bind(Z.abort,Z):M},R)};var V=W();Y=function(){clearTimeout(V);X.reject(X,"abort","abort")};return X.promise({abort:function(){Y()},reset:function(){if(X.state()==="pending"){clearTimeout(V);U=Array.prototype.slice.call(arguments);V=W()}}})}}function I(){return H.when.apply(H,O.map(arguments,A)).then(L,L)}function A(R){return R.then(Q(false),Q(true))}function Q(R){return function(){return H.Deferred().resolve({rejectedSelf:R&&this,self:this,args:Array.prototype.slice.call(arguments)})}}function L(){var U=O.chain(arguments).pluck("rejectedSelf").find(O.identity).value();var T=(U?"reject":"resolve")+"With";var R=U||arguments[0].self;var S=O.pluck(arguments,"args");return H.Deferred()[T](R,S)}function N(R,V,S,U){var T=H(R).spin(S||"small",U||{});return V.always(function(){T.remove()})}function D(R,W,S){S=S||"small";var V;var T=H(R);function U(){var X=Array.prototype.slice.call(arguments);if(!X.length){return }T.spin(S).addClass("spinning");V=I.apply(null,O.compact(X.concat(V)));V.always(function(){if(V.state()!==B.PENDING){T.spinStop().removeClass("spinning")}})}W&&U(W);return{add:U}}function J(V){var T=H.Deferred(),R={timeout:10000,interval:100,name:"",predicate:H.noop};V=H.extend(R,V);var S=new Date().getTime()+(V.timeout);var U=setInterval(function(){var W=V.predicate();if(W){clearInterval(U);T.resolve(W)}else{if(new Date().getTime()>S){clearInterval(U);T.reject("Predicate '"+V.name+"' was false after "+V.timeout+"ms")}}},V.interval);return T.promise()}F.state=B;F.delay=G;F.reduce=K;F.settle=I;F.spinner=N;F.rollingSpinner=D;F.thenAbortable=P;F.whenAbortable=C;F.waitFor=J});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:searchable-selector', location = '/static/widget/searchable-selector/searchable-selector.soy' */
// This file was automatically generated from searchable-selector.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }


stash.widget.searchableSelector = function(opt_data, opt_ignored) {
  var output = '<div class="searchable-selector ' + ((opt_data.extraClasses) ? soy.$$escapeHtml(opt_data.extraClasses) : '') + '" id="' + soy.$$escapeHtml(opt_data.id) + '">' + ((opt_data.searchable) ? '<header><label class="assistive" for="' + soy.$$escapeHtml(opt_data.id) + '-search-input">' + soy.$$escapeHtml(opt_data.searchPlaceholder ? opt_data.searchPlaceholder : "Search") + '</label><input id="' + soy.$$escapeHtml(opt_data.id) + '-search-input" type="text" name="filter" class="filter" placeholder="' + soy.$$escapeHtml(opt_data.searchPlaceholder ? opt_data.searchPlaceholder : "Search") + '"/></header>' : '');
  if (opt_data.tabs && opt_data.tabs.length > 1) {
    output += '<div class="aui-tabs horizontal-tabs"><ul class="tabs-menu">';
    var tabList24 = opt_data.tabs;
    var tabListLen24 = tabList24.length;
    for (var tabIndex24 = 0; tabIndex24 < tabListLen24; tabIndex24++) {
      var tabData24 = tabList24[tabIndex24];
      output += aui.tabMenuItem({url: '#' + soy.$$escapeHtml(opt_data.id) + '-tab-pane-' + soy.$$escapeHtml(tabIndex24), text: tabData24.label, isActive: tabIndex24 == 0, extraAttributes: {'data-tab-id': tabIndex24}});
    }
    output += '</ul>';
    var tabList36 = opt_data.tabs;
    var tabListLen36 = tabList36.length;
    for (var tabIndex36 = 0; tabIndex36 < tabListLen36; tabIndex36++) {
      var tabData36 = tabList36[tabIndex36];
      output += aui.tabPane({content: '<ul class="results-list"></ul><div class="spinner"></div>', id: opt_data.id + '-tab-pane-' + tabIndex36, isActive: tabIndex36 == 0, extraClasses: 'results', extraAttributes: {'data-tab-id': tabIndex36}});
    }
    output += '</div>';
  } else {
    output += '<div class="results"><ul class="results-list"></ul><div class="spinner"></div></div>';
  }
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  stash.widget.searchableSelector.soyTemplateName = 'stash.widget.searchableSelector';
}


stash.widget.searchableSelectorResults = function(opt_data, opt_ignored) {
  var output = '';
  var resultList50 = opt_data.values;
  var resultListLen50 = resultList50.length;
  for (var resultIndex50 = 0; resultIndex50 < resultListLen50; resultIndex50++) {
    var resultData50 = resultList50[resultIndex50];
    output += '<li class="result ' + ((opt_data.isPreload) ? 'preload' : '') + '"><a href="' + soy.$$escapeHtml(resultData50.url ? resultData50.url : '#') + '" tabindex="-1" data-id="' + soy.$$escapeHtml(resultData50.id) + '" data-item="' + soy.$$escapeHtml(JSON.stringify(resultData50).replace(/\//g, '\\/')) + '">' + soy.$$escapeHtml(resultData50.name) + '</a></li>';
  }
  output += (opt_data.isLastPage) ? (opt_data.size > 0) ? '<li class="no-results">' + soy.$$escapeHtml(opt_data.noMoreResultsText ? opt_data.noMoreResultsText : "No more results") + '</li>' : '<li class="no-results">' + soy.$$escapeHtml(opt_data.noResultsText ? opt_data.noResultsText : "No results") + '</li>' : '';
  return output;
};
if (goog.DEBUG) {
  stash.widget.searchableSelectorResults.soyTemplateName = 'stash.widget.searchableSelectorResults';
}


stash.widget.searchableSelectorTrigger = function(opt_data, opt_ignored) {
  return '' + stash.widget.searchableSelectorTriggerGeneric({id: opt_data.id, content: '' + stash.widget.searchableSelectorTriggerContent(opt_data), autofocus: opt_data.autofocus, extraClasses: opt_data.extraClasses, extraAttributes: opt_data.extraAttributes});
};
if (goog.DEBUG) {
  stash.widget.searchableSelectorTrigger.soyTemplateName = 'stash.widget.searchableSelectorTrigger';
}


stash.widget.searchableSelectorTriggerGeneric = function(opt_data, opt_ignored) {
  return '<button ' + ((opt_data.id) ? 'id="' + soy.$$escapeHtml(opt_data.id) + '" ' : '') + 'type="button" class="aui-button searchable-selector-trigger' + aui.renderExtraClasses(opt_data) + '"' + ((opt_data.autofocus) ? ' autofocus' : '') + aui.renderExtraAttributes(opt_data) + '>' + soy.$$filterNoAutoescape(opt_data.content) + '</button>';
};
if (goog.DEBUG) {
  stash.widget.searchableSelectorTriggerGeneric.soyTemplateName = 'stash.widget.searchableSelectorTriggerGeneric';
}


stash.widget.searchableSelectorTriggerWithField = function(opt_data, opt_ignored) {
  return '' + stash.widget.searchableSelectorTrigger(opt_data) + widget.aui.form.input({id: opt_data.fieldId ? opt_data.fieldId : opt_data.id + '-field', name: opt_data.fieldName ? opt_data.fieldName : opt_data.id + '-field', initialValue: opt_data.item ? opt_data.item.id : null, type: 'hidden'});
};
if (goog.DEBUG) {
  stash.widget.searchableSelectorTriggerWithField.soyTemplateName = 'stash.widget.searchableSelectorTriggerWithField';
}


stash.widget.searchableSelectorTriggerContent = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '' + ((opt_data.item) ? '<span class="name" data-id="' + soy.$$escapeHtml(opt_data.item.id) + '" data-item="' + soy.$$escapeHtml(JSON.stringify(opt_data.item).replace(/\//g, '\\/')) + '">' + soy.$$escapeHtml(opt_data.item.name) + '</span>' : '<span class="placeholder">' + soy.$$escapeHtml(opt_data.text ? opt_data.text : "Select item") + '</span>');
};
if (goog.DEBUG) {
  stash.widget.searchableSelectorTriggerContent.soyTemplateName = 'stash.widget.searchableSelectorTriggerContent';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:searchable-selector', location = '/static/widget/searchable-selector/searchable-selector.js' */
define("widget/searchable-selector",["aui","jquery","lodash","util/ajax","util/dom-event","util/events","util/navigator","util/promise","widget/keyboard-controller","widget/paged-scrollable"],function(M,D,N,L,H,O,J,B,G,K){var C=G.TabKeyboardController;var E=G.ListKeyboardController;var I=0;function F(Q,P){return this.init.apply(this,arguments)}F.prototype.defaults={id:null,extraClasses:null,namespace:"searchable-selector",url:null,tabs:null,searchable:true,searchPlaceholder:null,queryParamKey:"filter",queryParamsBuilder:null,pageSize:20,statusCodeHandlers:{},followLinks:false,hideDialogOnSelect:true,itemSelectedEvent:"stash.widget.searchableSelector.itemSelected",context:null,field:null,itemDataKey:"item",template:stash.widget.searchableSelector,resultsTemplate:stash.widget.searchableSelectorResults,noResultsText:null,noMoreResultsText:null,triggerContentTemplate:stash.widget.searchableSelectorTriggerContent,triggerPlaceholder:null,preloadData:null,alwaysShowPreload:false,dataTransform:null,postOptionsInit:null,clearResultsOnSearch:true,popUpOffsetX:0,popUpOffsetY:-1,width:350};F.constructDataPageFromPreloadArray=function(P){if(!N.isArray(P)){return null}return{values:P,isLastPage:false,size:P.length,start:0,limit:P.length}};F.prototype.tabOptionKeys=["label","url","resultsTemplate","noResultsText","noMoreResultsText","dataTransform","queryParamKey","preloadData","searchPlaceholder"];F.prototype.init=function(R,Q){var P=this;this.instanceId=I++;this.$trigger=D(R);this.setOptions(Q);this.scrollables=[];this.scrollableDataStores=[];if(!this._getOptionVal("id")){this.options.id=this._getOptionVal("namespace")+"-"+this.instanceId}if(this.options.tabs&&this.options.tabs.length){this.tabs=N.map(this.options.tabs,function(V){return D.extend(true,{},N.pick(P.options,P.tabOptionKeys),V)})}var U=this._getOption("postOptionsInit");if(N.isFunction(U)){U.call(this)}var T;this.blockShortcutPropagation=T=function(V){var W=(this===document);if(V.keyCode===M.keyCode.ESCAPE){V[W?"stopImmediatePropagation":"stopPropagation"]();P.dialog.hide()}else{if(!W){V.stopPropagation()}}};var S=P._getOptionVal("externalSearchField");this.dialog=M.InlineDialog(this.$trigger,this._getOptionVal("id"),function(W,V,X){if(!W.data("initialised")){P._initialiseDialogContent(W)}X();if(!S){N.defer(N.bind(P.setFocus,P))}},{offsetX:this._getOptionVal("popUpOffsetX"),offsetY:this._getOptionVal("popUpOffsetY"),noBind:!!S,width:this._getOptionVal("width"),hideCallback:function(){if(P.$content.is(document.activeElement)||D.contains(P.$content[0],document.activeElement)){P.$trigger.focus()}D(document).add(P.dialog).off("keydown keypress",T)},initCallback:function(){D(document).add(P.dialog).on("keydown keypress",T)}});if(this._getOptionVal("searchable")&&S){this.$searchField=D(S);this._initialiseSearchOnInput()}if(this.$trigger.find(".name").length){this._selectedItem=this._getItemFromTrigger()}M.bind("hide.dialog",function(W,V){if(P.$trigger.closest(V.dialog.popup.element).length){P.dialog.hide()}});return this};F.prototype.getSelectedItem=function(){return this._selectedItem};F.prototype.setSelectedItem=function(P){if(D.isPlainObject(P)&&P.id!=null){if(!this._selectedItem||this._selectedItem.id!==P.id){this._itemSelected(P)}}};F.prototype.clearSelection=function(){this._selectedItem=null;if(this._getOptionVal("field")){D(this._getOptionVal("field")).val("")}this.resetTrigger()};F.prototype._getItemFromTrigger=function(){var P=this.$trigger.find(".name");return D.extend({},this._buildObjectFromElementDataAttributes(P),{name:P.text()})};F.prototype._buildObjectFromElementDataAttributes=function(P){return D(P).data(this._getOptionVal("itemDataKey"))};F.prototype._initialiseDialogContent=function(Q){var P=this;var R=this._getOptionVal("searchable");var S=this._getOptionVal("externalSearchField");Q.append(this._getOption("template")({id:this._getOptionVal("id"),tabs:this.tabs,searchable:!S&&R,searchPlaceholder:this._getOptionVal("searchPlaceholder"),extraClasses:this._getOptionVal("extraClasses")}));Q.closest(".aui-inline-dialog").addClass("searchable-selector-dialog");if(R&&!S){this.$searchField=Q.find("input.filter");this._initialiseSearchOnInput()}if(this.tabs){var T=Q.find("ul.tabs-menu a");T.on("tabSelect",function(V,U){P.currentTabId=U.tab.parent().data("tab-id");if(P._getOptionVal("searchable")||P._getDataStoreForScrollable().length===0){P._populateScrollable()}P._resultsKeyboardController.setListElement(P._getCurrentScrollable().$scrollElement.find("ul.results-list"));if(R){P.$searchField.focus()}P._updateSearchPlaceholder()});T.on("click",function(U){if(D(this).parent().hasClass("active-tab")){U.stopPropagation();U.preventDefault()}});T.on("keydown",function(V){if(V.keyCode===M.keyCode.ENTER){var U=D(this);if(U.parent("li").hasClass("active-tab")){V.preventDefault()}else{U.click()}}});M.tabs.setup()}Q.find(".results").each(function(){P.scrollables.push(P._createScrollable(D(this)));P.scrollableDataStores.push([])});Q.on("click",".result a",function(U){P.selectItem(U,D(this))});this._initialiseKeyboardNavigation(Q);this._populateScrollable();this.$content=Q;Q.data("initialised",true)};F.prototype._initialiseSearchOnInput=function(){var Q=this;var R=this._getSearchTerm();var S=this._getOptionVal("externalSearchField");var T=B.delay(N.bind(this._handleSearchInput,this),350);var P=N.bind(function(){if(R!==(R=this._getSearchTerm())){if(!this._pendingSearch){this._pendingSearch=T(R);this._pendingSearch.always(function(){Q._pendingSearch=null})}else{this._pendingSearch.reset(R)}}},this);this.$searchField.on("keydown.searchable-selector input.searchable-selector",N.bind(function(U){if(S){if(U.which===M.keyCode.ESCAPE){this._pendingSearch&&this._pendingSearch.abort()}else{if(U.which===M.keyCode.DOWN&&this._shouldSearch(R)){this.dialog.show()}else{if(U.which===M.keyCode.ENTER&&!this.dialog.is(":visible")){this._pendingSearch&&this._pendingSearch.done(function(){var V=Q._getCurrentScrollable().$scrollElement.find("ul.results-list li.result:first");Q._clickItem(V)})}}}}N.defer(P)},this))};F.prototype._handleSearchInput=function(P){var Q=this._getOptionVal("externalSearchField");if(Q){if(this._shouldSearch(P)){if(!this.dialog.is(":visible")){this.dialog.show()}return this._populateScrollable()}else{this.dialog.hide();return D.Deferred().reject().promise()}}else{return this._populateScrollable()}};F.prototype._initialiseKeyboardNavigation=function(R){var S=this;var Q;var T=false;var P=function(V){var W=S.dialog.is(":visible");if(S._getOptionVal("externalSearchField")&&!W){return }if(T&&!W){S.$trigger.click()}else{S._clickItem(V)}};if(this._resultsKeyboardController){this._resultsKeyboardController.destroy()}if(this.$searchField){Q=this.$searchField}else{if(this.tabs){Q=R.find("ul.tabs-menu")}else{Q=this.$trigger;T=true}}var U=S._getCurrentScrollable().$scrollElement.find("ul.results-list");this._resultsKeyboardController=new E(Q,U,{wrapAround:false,focusedClass:"focused",itemSelector:"li.result",requestMore:function(){var V=S._getCurrentScrollable().loadAfter();return V&&V.then(function(W){return W.isLastPage})},onSelect:function(V){if(S._pendingSearch){S._pendingSearch.done(function(){var W=U.find("li.result:first");if(W.length){P(W)}})}else{P(V)}},focusIntoView:true,adjacentItems:S._getOptionVal("adjacentItems")});if(this._tabKeyboardController){this._tabKeyboardController.destroy()}if(J.isMozilla()||J.isWebkit()){R.addClass("override-focus-style")}this._tabKeyboardController=new C(R)};F.prototype._clickItem=function(P){P.children("a").each(function(){this.click()})};F.prototype.setFocus=function(){if(this.$searchField){this.$searchField.focus()}else{if(this.tabs){this.$content.find("ul.tabs-menu a").first().focus()}else{this.$trigger.focus()}}};F.prototype._createScrollable=function(P){var Q=new K(P,{pageSize:this._getOptionVal("pageSize"),bufferPixels:0,preventOverscroll:true});Q.requestData=N.bind(this.getResults,this,Q);Q.attachNewContent=N.bind(this.addResultsToList,this,Q,false);return Q};F.prototype._populateScrollable=function(Q){Q=Q||this._getCurrentScrollable();this._emptyScrollable(Q);var P=this._getPreloadData();var S=0;if(P){S=this.addResultsToList(Q,true,P)}var R=Q.init();if(S>0){return D.Deferred().resolve().promise()}else{return R}};F.prototype._getPreloadData=function(){var Q=this._getOptionVal("preloadData");var R=this._getSearchTerm();if(Q&&(this._getOptionVal("alwaysShowPreload")||R==="")){var P=this._getOption("dataTransform");if(N.isFunction(P)){Q=P.call(this,Q,R)}}else{Q=null}return Q};F.prototype._emptyScrollable=function(P){P=P||this._getCurrentScrollable();P.reset();this._getDataStoreForScrollable(P).length=0;if(this._getOptionVal("clearResultsOnSearch")){P.$scrollElement.children("ul.results-list").empty()}};F.prototype._getCurrentScrollable=function(){return this.scrollables[this.tabs&&this.currentTabId?this.currentTabId:0]};F.prototype._getDataStoreForScrollable=function(Q){if(!Q){return this.scrollableDataStores[this.tabs&&this.currentTabId?this.currentTabId:0]}var P=N.indexOf(this.scrollables,Q);if(P!==-1){return this.scrollableDataStores[P]}else{return null}};F.prototype._getSearchTerm=function(){return(this.$searchField)?this.$searchField.val():""};F.prototype._updateSearchPlaceholder=function(){if(this.$searchField){this.$searchField.attr("placeholder",this._getOptionVal("searchPlaceholder"))}};F.prototype._getOptionVal=function(P){return this._getOption(P,true)};F.prototype._getOption=function(P,R){var Q;if(this.tabs&&N.contains(this.tabOptionKeys,P)){Q=this.tabs[this.currentTabId||0][P]}else{Q=this.options[P]}return(R)?A(Q,this):Q};F.prototype.setOptions=function(P){this.options=D.extend(true,{},this.defaults,P)};F.prototype.getResults=function(U,W,P){var Q=this;if(this.currentXHR&&this.currentXHR.abort){this.currentXHR.abort()}var T=this._getOption("queryParamsBuilder")||this._defaultQueryParamsBuilder;var S=T.call(this,this._getSearchTerm(),W,P);if(S===null){return D.Deferred().reject().promise()}var V=U.$scrollElement.children("ul.results-list");this._showSpinner(U);V.scrollTop(V[0].scrollHeight);var R=this.currentXHR=L.rest({url:this._getOptionVal("url"),data:S,statusCode:this._getOptionVal("statusCodeHandlers")});R.always(function(){Q._hideSpinner(U);Q.currentXHR=null});return R};F.prototype._showSpinner=function(P){P.$scrollElement.children(".spinner").show().spin()};F.prototype._hideSpinner=function(P){P.$scrollElement.children(".spinner").spinStop().hide()};F.prototype._shouldSearch=function(P){var Q=this._getOption("queryParamsBuilder")||this._defaultQueryParamsBuilder;return Q.call(this,P,0,this._getOptionVal("pageSize"))!=null};F.prototype._defaultQueryParamsBuilder=function(Q,S,P){var R={start:S,limit:P};if(this._getOptionVal("searchable")){R[this._getOptionVal("queryParamKey")]=Q}return R};F.prototype.addResultsToList=function(V,Q,T){var X=this._getOption("dataTransform");var W;if(N.isFunction(X)){T=X.call(this,T,this._getSearchTerm())}if(!Q&&(W=this._getPreloadData())){T=this.dedupeData(T,W)}T=D.extend({},T,{isPreload:Q,noResultsText:this._getOptionVal("noResultsText"),noMoreResultsText:this._getOptionVal("noMoreResultsText")});var U=D(this._getOption("resultsTemplate")(T));var S=this._getDataStoreForScrollable(V);S.push.apply(S,T.values);var R=V.$scrollElement.children("ul.results-list");var P=T.start===0&&!(W&&W.size>0)&&(!Q||T.size>0);if(P){R.empty()}R.append(U).attr("data-last-updated",new Date().getTime());if(P&&T.size>0){this._resultsKeyboardController.moveToNext()}return T.size};F.prototype.dedupeData=function(Q,P){if(Q&&Q.values&&P&&P.values){Q=D.extend(true,{},Q);Q.values=N.reject(Q.values,function(R){return N.find(P.values,function(S){return R.id===S.id})})}return Q};F.prototype.selectItem=function(R,Q){var S=Q.data("id");var P=N.find(this._getDataStoreForScrollable(),function(T){return T.id===S});if(Q.attr("href")!=="#"&&(this._getOptionVal("followLinks")||!H.openInSameTab)){}else{R.preventDefault()}if(!this._selectedItem||this._selectedItem.id!==P.id){this._itemSelected(P)}if(this._getOptionVal("hideDialogOnSelect")){this.dialog.hide()}};F.prototype._itemSelected=function(P){this._selectedItem=P;if(this._getOptionVal("field")){D(this._getOptionVal("field")).val(P.id)}this.updateTrigger({item:P});O.trigger(this._getOptionVal("itemSelectedEvent"),this,P,this._getOptionVal("context"))};F.prototype.updateTrigger=function(P){if(!this._getOptionVal("externalSearchField")){this.$trigger.html(this._getOption("triggerContentTemplate")(P||{}))}};F.prototype.resetTrigger=function(){this.updateTrigger({text:this._getOptionVal("triggerPlaceholder")})};F.prototype.destroy=function(){if(this.blockShortcutPropagation){D(document).add(this.dialog).off("keydown keypress",this.blockShortcutPropagation)}if(this._getOptionVal("externalSearchField")){this.$searchField.off(".searchable-selector")}if(this.dialog){this.dialog.hide();this.dialog.remove();this.dialog=null}if(this._resultsKeyboardController){this._resultsKeyboardController.destroy();this._resultsKeyboardController=null}if(this._tabKeyboardController){this._tabKeyboardController.destroy();this._tabKeyboardController=null}this.$trigger=null;this.scrollables=null;this.scrollableDataStores=null;this.tabs=null;this._initialiseDialogContent=D.noop};function A(Q,P){return N.isFunction(Q)?Q.call(P):Q}return F});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:project-avatar', location = '/static/feature/project/project-avatar/project-avatar.soy' */
// This file was automatically generated from project-avatar.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.project.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.project == 'undefined') { stash.feature.project = {}; }


stash.feature.project.avatar = function(opt_data, opt_ignored) {
  return '' + aui.avatar.avatar({tagName: opt_data.tagName, size: opt_data.size, avatarImageUrl: opt_data.imageUrl ? opt_data.imageUrl : opt_data.project ? require('stash/api/util/navbuilder')._avatarUrl(opt_data.project, ({XSMALL:32,SMALL:48,MEDIUM:64,LARGE:96,XLARGE:128,XXLARGE:192,XXXLARGE:256})[opt_data.size.toUpperCase()]).build() : '', accessibilityText: opt_data.project ? opt_data.project.name : '', title: opt_data.tooltip, badgeContent: opt_data.badgeContent, isProject: ! opt_data.project.owner, imageClasses: opt_data.imageClasses, extraClasses: (opt_data.hideBadge ? ' badge-hidden' : '') + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: opt_data.extraAttributes});
};
if (goog.DEBUG) {
  stash.feature.project.avatar.soyTemplateName = 'stash.feature.project.avatar';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-item', location = '/static/feature/repository/repository-item/repository-item.soy' */
// This file was automatically generated from repository-item.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.repository.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; }


stash.feature.repository.repositoryItem = function(opt_data, opt_ignored) {
  return '<span class="repository-item" title="' + soy.$$escapeHtml(opt_data.repository.project.name) + ' / ' + soy.$$escapeHtml(opt_data.repository.name) + '" data-id="' + soy.$$escapeHtml(opt_data.repository.id) + '" data-repository="' + soy.$$escapeHtml(JSON.stringify(opt_data.repository).replace(/\//g, '\\/')) + '">' + stash.feature.repository.repositoryItemContent({avatarTagName: 'span', repository: opt_data.repository}) + '</span>';
};
if (goog.DEBUG) {
  stash.feature.repository.repositoryItem.soyTemplateName = 'stash.feature.repository.repositoryItem';
}


stash.feature.repository.repositoryItemContent = function(opt_data, opt_ignored) {
  return stash.feature.project.avatar({size: 'xsmall', project: opt_data.repository.project, tagName: opt_data.avatarTagName}) + '<span class="project-and-repository"><span class="project-name">' + ((opt_data.projectNameContent) ? soy.$$filterNoAutoescape(opt_data.projectNameContent) : soy.$$escapeHtml(opt_data.repository.project.name)) + '</span><span class="separator">/</span><span class="name">' + ((opt_data.repositoryNameContent) ? soy.$$filterNoAutoescape(opt_data.repositoryNameContent) : soy.$$escapeHtml(opt_data.repository.name)) + '</span></span>';
};
if (goog.DEBUG) {
  stash.feature.repository.repositoryItemContent.soyTemplateName = 'stash.feature.repository.repositoryItemContent';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:internal-regexp-util', location = '/static/bower/atlassian-regexp/lib/internal/util/regexp.js' */
define("internal/util/regexp",["exports"],function(A){function B(C){return C.replace(/[\-\[\]{}()+?.,\\\^$|#\s]/g,"\\$&")}A.escape=B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:internal-highlight-text-util', location = '/static/bower/atlassian-highlight-text/lib/internal/util/highlight-text.js' */
define("internal/util/highlight-text",["internal/util/regexp"],function(D){var C=/[&"'<>`]/g;var E=function(G){var F={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;","`":"&#96;"};if(F.hasOwnProperty(G)){return F[G]}return"&quot;"};var A=function(F){return F.replace(C,E)};var B=function(F){return D.escape(A(F))};return{highlight:function(K,H,G){if(!H||H.length===0){return A(K)}var J=(typeof H==="string")?B(H):H.map(B).join("|");var F=(G==null)?"gi":G;var I=new RegExp(J,F);return A(K).replace(I,"<mark>$&</mark>")}}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:highlight-text-util', location = '/static/util/highlight-text.js' */
define("util/highlight-text",["internal/util/highlight-text"],function(A){return A});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-menu-items', location = '/static/feature/repository/menu-items/repository-menu-items.soy' */
// This file was automatically generated from repository-menu-items.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.repository.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; }


stash.feature.repository.menuItems = function(opt_data, opt_ignored) {
  var output = '';
  var repoList3 = opt_data.repos;
  var repoListLen3 = repoList3.length;
  for (var repoIndex3 = 0; repoIndex3 < repoListLen3; repoIndex3++) {
    var repoData3 = repoList3[repoIndex3];
    output += '<li class="repository-item repository-menu-item' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '"><a data-proj-key="' + soy.$$escapeHtml(repoData3.project.key) + '" data-repo-slug="' + soy.$$escapeHtml(repoData3.slug) + '" data-repo-id="' + soy.$$escapeHtml(repoData3.id) + '" href="' + soy.$$escapeHtml(require('stash/api/util/navbuilder').project(repoData3.project.key).repo(repoData3.slug).browse().build()) + '" title="' + soy.$$escapeHtml(AJS.format("Go to repository \x22{0}\x22 in project \x22{1}\x22",repoData3.name,repoData3.project.name)) + '">' + stash.feature.repository.repositoryItemContent({repository: repoData3, projectNameContent: require('util/highlight-text').highlight(repoData3.project.name, opt_data.projectHighlightText, 'i'), repositoryNameContent: require('util/highlight-text').highlight(repoData3.name, opt_data.repositoryHighlightText, 'i')}) + '</a></li>';
  }
  return output;
};
if (goog.DEBUG) {
  stash.feature.repository.menuItems.soyTemplateName = 'stash.feature.repository.menuItems';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:xregexp', location = '/static/bower/xregexp/src/xregexp.js' */
/*
 * XRegExp 3.0.0-pre
 * <http://xregexp.com/>
 * Steven Levithan � 2007-2012 MIT License
 */
var XRegExp=(function(I){var L="xregexp",U,J={astral:false,natives:false},a={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},F={},S={},B={},R=[],C="default",O="class",g={"default":/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,"class":/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|[\s\S]/},f=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,b=a.exec.call(/()??/,"")[1]===I,N=RegExp.prototype.sticky!==I,e={g:true,i:true,m:true,y:N},Z={}.toString,T;function d(j,h,i){var k;if(i){if(j.__proto__){j.__proto__=U.prototype}else{for(k in U.prototype){j[k]=U.prototype[k]}}}j[L]={captureNames:h};return j}function M(h){return a.replace.call(h,/([\s\S])(?=[\s\S]*\1)/g,"")}function Y(j,i){if(!U.isRegExp(j)){throw new TypeError("Type RegExp expected")}var h=a.exec.call(/\/([a-z]*)$/i,String(j))[1];i=i||{};if(i.add){h=M(h+i.add)}if(i.remove){h=a.replace.call(h,new RegExp("["+i.remove+"]+","g"),"")}j=d(new RegExp(j.source,h),K(j)?j[L].captureNames.slice(0):null,i.addProto);return j}function V(){return{captureNames:null}}function K(h){return !!(h[L]&&h[L].captureNames)}function A(l,k){if(Array.prototype.indexOf){return l.indexOf(k)}var h=l.length,j;for(j=0;j<h;++j){if(l[j]===k){return j}}return -1}function G(i,h){return Z.call(i)==="[object "+h+"]"}function X(i,j,h){return a.test.call(h.indexOf("x")>-1?/^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,i.slice(j))}function E(k,h){var j;if(M(h)!==h){throw new SyntaxError("Invalid duplicate regex flag "+h)}k=a.replace.call(k,/^\(\?([\w$]+)\)/,function(l,i){if(a.test.call(/[gy]/,i)){throw new SyntaxError("Cannot use flag g or y in mode modifier "+l)}h=M(h+i);return""});for(j=0;j<h.length;++j){if(!e[h.charAt(j)]){throw new SyntaxError("Unknown regex flag "+h.charAt(j))}}return{pattern:k,flags:h}}function P(h){h=h||{};if(G(h,"String")){h=U.forEach(h,/[^\s,]+/,function(i){this[i]=true},{})}return h}function H(h){if(!/^[\w$]$/.test(h)){throw new Error("Flag must be a single character A-Za-z0-9_$")}e[h]=true}function D(m,j,n,p,h){var k=R.length,q=null,l,o;while(k--){o=R[k];if((o.scope===p||o.scope==="all")&&(!o.flag||j.indexOf(o.flag)>-1)){l=U.exec(m,o.regex,n,"sticky");if(l){q={matchLength:l[0].length,output:o.handler.call(h,l,p,j),reparse:o.reparse};break}}}return q}function Q(h){U.cache.flush("patterns");J.astral=h}function c(h){RegExp.prototype.exec=(h?F:a).exec;RegExp.prototype.test=(h?F:a).test;String.prototype.match=(h?F:a).match;String.prototype.replace=(h?F:a).replace;String.prototype.split=(h?F:a).split;J.natives=h}function W(h){if(h==null){throw new TypeError("Cannot convert null or undefined to object")}return h}U=function(l,j){var h={hasNamedCapture:false,captureNames:[]},o=C,i="",m=0,p,k,n;if(U.isRegExp(l)){if(j!==I){throw new TypeError("Cannot supply flags when copying a RegExp")}return Y(l,{addProto:true})}l=l===I?"":String(l);j=j===I?"":String(j);n=l+"***"+j;if(!B[n]){p=E(l,j);l=p.pattern;j=p.flags;while(m<l.length){do{p=D(l,j,m,o,h);if(p&&p.reparse){l=l.slice(0,m)+p.output+l.slice(m+p.matchLength)}}while(p&&p.reparse);if(p){i+=p.output;m+=(p.matchLength||1)}else{k=U.exec(l,g[o],m,"sticky")[0];i+=k;m+=k.length;if(k==="["&&o===C){o=O}else{if(k==="]"&&o===O){o=C}}}}B[n]={pattern:a.replace.call(i,/\(\?:\)(?=\(\?:\))|^\(\?:\)|\(\?:\)$/g,""),flags:a.replace.call(j,/[^gimy]+/g,""),captures:h.hasNamedCapture?h.captureNames:null}}n=B[n];return d(new RegExp(n.pattern,n.flags),n.captures,true)};U.prototype=new RegExp;U.version="3.0.0-pre";U.addToken=function(m,l,j){j=j||{};var h=j.optionalFlags,k;if(j.flag){H(j.flag)}if(h){h=a.split.call(h,"");for(k=0;k<h.length;++k){H(h[k])}}R.push({regex:Y(m,{add:"g"+(N?"y":"")}),handler:l,scope:j.scope||C,flag:j.flag,reparse:j.reparse});U.cache.flush("patterns")};U.cache=function(j,h){var i=j+"***"+(h||"");return S[i]||(S[i]=U(j,h))};U.cache.flush=function(h){if(h==="patterns"){B={}}else{S={}}};U.escape=function(h){return a.replace.call(W(h),/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};U.exec=function(m,k,n,l){var j="g",i,h;if(N&&(l||(k.sticky&&l!==false))){j+="y"}k[L]=k[L]||V();h=k[L][j]||(k[L][j]=Y(k,{add:j,remove:l===false?"y":""}));h.lastIndex=n=n||0;i=F.exec.call(h,m);if(l&&i&&i.index!==n){i=null}if(k.global){k.lastIndex=i?h.lastIndex:0}return i};U.forEach=function(m,l,o,k){var n=0,j=-1,h;while((h=U.exec(m,l,n))){o.call(k,h,++j,m,l);n=h.index+(h[0].length||1)}return k};U.globalize=function(h){return Y(h,{add:"g",addProto:true})};U.install=function(h){h=P(h);if(!J.astral&&h.astral){Q(true)}if(!J.natives&&h.natives){c(true)}};U.isInstalled=function(h){return !!(J[h])};U.isRegExp=function(h){return Z.call(h)==="[object RegExp]"};U.match=function(n,m,k){var l=(m.global&&k!=="one")||k==="all",j=(l?"g":"")+(m.sticky?"y":""),h,i;m[L]=m[L]||V();i=m[L][j||"noGY"]||(m[L][j||"noGY"]=Y(m,{add:j,remove:k==="one"?"g":""}));h=a.match.call(W(n),i);if(m.global){m.lastIndex=((k==="one"&&h)?(h.index+h[0].length):0)}return l?(h||[]):(h&&h[0])};U.matchChain=function(i,h){return(function j(k,p){var n=h[p].regex?h[p]:{regex:h[p]},o=[],l=function(q){if(n.backref){if(!(q.hasOwnProperty(n.backref)||+n.backref<q.length)){throw new ReferenceError("Backreference to undefined group: "+n.backref)}o.push(q[n.backref]||"")}else{o.push(q[0])}},m;for(m=0;m<k.length;++m){U.forEach(k[m],n.regex,l)}return((p===h.length-1)||!o.length)?o:j(o,p+1)}([i],0))};U.replace=function(k,p,i,n){var l=U.isRegExp(p),h=(p.global&&n!=="one")||n==="all",j=(h?"g":"")+(p.sticky?"y":""),m=p,o;if(l){p[L]=p[L]||V();m=p[L][j||"noGY"]||(p[L][j||"noGY"]=Y(p,{add:j,remove:n==="one"?"g":""}))}else{if(h){m=new RegExp(U.escape(String(p)),"g")}}o=F.replace.call(W(k),m,i);if(l&&p.global){p.lastIndex=0}return o};U.replaceEach=function(l,j){var h,k;for(h=0;h<j.length;++h){k=j[h];l=U.replace(l,k[0],k[1],k[2])}return l};U.split=function(j,i,h){return F.split.call(W(j),i,h)};U.test=function(j,h,k,i){return !!U.exec(j,h,k,i)};U.uninstall=function(h){h=P(h);if(J.astral&&h.astral){Q(false)}if(J.natives&&h.natives){c(false)}};U.union=function(h,k){var l=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,j=[],n=0,p,q,o,r=function(s,t,u){var i=q[n-p];if(t){++n;if(i){return"(?<"+i+">"}}else{if(u){return"\\"+(+u+p)}}return s},m;if(!(G(h,"Array")&&h.length)){throw new TypeError("Must provide a nonempty array of patterns to merge")}for(m=0;m<h.length;++m){o=h[m];if(U.isRegExp(o)){p=n;q=(o[L]&&o[L].captureNames)||[];j.push(a.replace.call(U(o.source).source,l,r))}else{j.push(U.escape(o))}}return U(j.join("|"),k)};F.exec=function(n){var h=this.lastIndex,l=a.exec.apply(this,arguments),k,j,m;if(l){if(!b&&l.length>1&&A(l,"")>-1){j=Y(this,{remove:"g"});a.replace.call(String(n).slice(l.index),j,function(){var o=arguments.length,p;for(p=1;p<o-2;++p){if(arguments[p]===I){l[p]=I}}})}if(this[L]&&this[L].captureNames){for(m=1;m<l.length;++m){k=this[L].captureNames[m-1];if(k){l[k]=l[m]}}}if(this.global&&!l[0].length&&(this.lastIndex>l.index)){this.lastIndex=l.index}}if(!this.global){this.lastIndex=h}return l};F.test=function(h){return !!F.exec.call(this,h)};F.match=function(i){var h;if(!U.isRegExp(i)){i=new RegExp(i)}else{if(i.global){h=a.match.apply(this,arguments);i.lastIndex=0;return h}}return F.exec.call(i,W(this))};F.replace=function(k,l){var m=U.isRegExp(k),i,j,h;if(m){if(k[L]){j=k[L].captureNames}i=k.lastIndex}else{k+=""}if(G(l,"Function")){h=a.replace.call(String(this),k,function(){var n=arguments,o;if(j){n[0]=new String(n[0]);for(o=0;o<j.length;++o){if(j[o]){n[0][j[o]]=n[o+1]}}}if(m&&k.global){k.lastIndex=n[n.length-2]+n[0].length}return l.apply(I,n)})}else{h=a.replace.call(this==null?this:String(this),k,function(){var n=arguments;return a.replace.call(String(l),f,function(p,o,r){var q;if(o){q=+o;if(q<=n.length-3){return n[q]||""}q=j?A(j,o):-1;if(q<0){throw new SyntaxError("Backreference to undefined group "+p)}return n[q+1]||""}if(r==="$"){return"$"}if(r==="&"||+r===0){return n[0]}if(r==="`"){return n[n.length-1].slice(0,n[n.length-2])}if(r==="'"){return n[n.length-1].slice(n[n.length-2]+n[0].length)}r=+r;if(!isNaN(r)){if(r>n.length-3){throw new SyntaxError("Backreference to undefined group "+p)}return n[r]||""}throw new SyntaxError("Invalid token "+p)})})}if(m){if(k.global){k.lastIndex=0}else{k.lastIndex=i}}return h};F.split=function(l,i){if(!U.isRegExp(l)){return a.split.apply(this,arguments)}var n=String(this),k=[],h=l.lastIndex,m=0,j;i=(i===I?-1:i)>>>0;U.forEach(n,l,function(o){if((o.index+o[0].length)>m){k.push(n.slice(m,o.index));if(o.length>1&&o.index<n.length){Array.prototype.push.apply(k,o.slice(1))}j=o[0].length;m=o.index+j}});if(m===n.length){if(!a.test.call(l,"")||j){k.push("")}}else{k.push(n.slice(m))}l.lastIndex=h;return k.length>i?k.slice(0,i):k};T=U.addToken;T(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(h,i){if(h[1]==="B"&&i===C){return h[0]}throw new SyntaxError("Invalid escape "+h[0])},{scope:"all"});T(/\[(\^?)]/,function(h){return h[1]?"[\\s\\S]":"\\b\\B"});T(/\(\?#[^)]*\)/,function(i,j,h){return X(i.input,i.index+i[0].length,h)?"":"(?:)"});T(/\s+|#.*/,function(i,j,h){return X(i.input,i.index+i[0].length,h)?"":"(?:)"},{flag:"x"});T(/\./,function(){return"[\\s\\S]"},{flag:"s"});T(/\\k<([\w$]+)>/,function(i){var h=isNaN(i[1])?(A(this.captureNames,i[1])+1):+i[1],j=i.index+i[0].length;if(!h||h>this.captureNames.length){throw new SyntaxError("Backreference to undefined group "+i[0])}return"\\"+h+(j===i.input.length||isNaN(i.input.charAt(j))?"":"(?:)")});T(/\\(\d+)/,function(h,i){if(!(i===C&&/^[1-9]/.test(h[1])&&+h[1]<=this.captureNames.length)&&h[1]!=="0"){throw new SyntaxError("Cannot use octal escape or backreference to undefined group "+h[0])}return h[0]},{scope:"all"});T(/\(\?P?<([\w$]+)>/,function(h){if(!isNaN(h[1])){throw new SyntaxError("Cannot use integer as capture name "+h[0])}if(h[1]==="length"||h[1]==="__proto__"){throw new SyntaxError("Cannot use reserved word as capture name "+h[0])}if(A(this.captureNames,h[1])>-1){throw new SyntaxError("Cannot use same name for multiple groups "+h[0])}this.captureNames.push(h[1]);this.hasNamedCapture=true;return"("});T(/\((?!\?)/,function(i,j,h){if(h.indexOf("n")>-1){return"(?:"}this.captureNames.push(null);return"("},{optionalFlags:"n"});return U}());;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:xregexp', location = '/static/lib/xregexp/xregexp-AMD.js' */
define("xregexp",[],function(){return XRegExp});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:xregexp', location = '/static/bower/xregexp/src/addons/unicode/unicode-base.js' */
/*
 * XRegExp Unicode Base 3.0.0-pre
 * <http://xregexp.com/>
 * Steven Levithan � 2008-2012 MIT License
 * Uses Unicode 6.2.0 <http://unicode.org/>
 * Unicode data generated by Mathias Bynens <http://mathiasbynens.be/>
 */
(function(H){var A={};function F(L){return L.replace(/[- _]+/g,"").toLowerCase()}function I(L){while(L.length<4){L="0"+L}return L}function D(L){return parseInt(L,16)}function C(L){return parseInt(L,10).toString(16)}function J(M){var L=/^\\[xu](.+)/.exec(M);return L?D(L[1]):M.charCodeAt(M.charAt(0)==="\\"?1:0)}function B(M){var L="",N=-1,O;H.forEach(M,/(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/,function(P){O=J(P[1]);if(O>(N+1)){L+="\\u"+I(C(N+1));if(O>(N+2)){L+="-\\u"+I(C(O-1))}}N=J(P[2]||P[1])});if(N<65535){L+="\\u"+I(C(N+1));if(N<65534){L+="-\\uFFFF"}}return L}function E(L){var M="b!";return A[L][M]||(A[L][M]=B(A[L].bmp))}function G(L,M){var O=A[L],N="";if(O.bmp&&!O.isBmpLast){N="["+O.bmp+"]"+(O.astral?"|":"")}if(O.astral){N+=O.astral}if(O.isBmpLast&&O.bmp){N+=(O.astral?"|":"")+"["+O.bmp+"]"}return M?"(?:(?!"+N+")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))":"(?:"+N+")"}function K(L,M){var N=M?"a!":"a=";return A[L][N]||(A[L][N]=G(L,M))}H.addToken(/\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/,function(S,W,O){var U="Invalid double negation ",P="Unknown Unicode token ",M="Unicode token missing data ",N="Astral mode required for Unicode token ",L="Astral mode does not support Unicode tokens within character classes",T=S[1]==="P"||!!S[2],R=O.indexOf("A")>-1||H.isInstalled("astral"),Q=F(S[4]||S[3]),V=A[Q];if(S[1]==="P"&&S[2]){throw new SyntaxError(U+S[0])}if(!A.hasOwnProperty(Q)){throw new SyntaxError(P+S[0])}if(V.inverseOf){Q=F(V.inverseOf);if(!A.hasOwnProperty(Q)){throw new ReferenceError(M+S[0]+" -> "+V.inverseOf)}V=A[Q];T=!T}if(!(V.bmp||R)){throw new SyntaxError(N+S[0])}if(R){if(W==="class"){throw new SyntaxError(L)}return K(Q,T)}return W==="class"?(T?E(Q):V.bmp):(T?"[^":"[")+V.bmp+"]"},{scope:"all",optionalFlags:"A"});H.addUnicodeData=function(P){var L="Unicode token requires name",O="Unicode token has no character data ",N,M;for(M=0;M<P.length;++M){N=P[M];if(!N.name){throw new Error(L)}if(!(N.inverseOf||N.bmp||N.astral)){throw new Error(O+N.name)}A[F(N.name)]=N;if(N.alias){A[F(N.alias)]=N}}H.cache.flush("patterns")};H.addUnicodeData([{name:"L",alias:"Letter",bmp:"A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",astral:"\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72]|\uD801[\uDC00-\uDC9D]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1E\uDF30-\uDF40\uDF42-\uDF49\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD81A[\uDC00-\uDE38]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD83-\uDDB2\uDDC1-\uDDC4]|\uD86E[\uDC00-\uDC1D]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD803[\uDC00-\uDC48]|\uD80D[\uDC00-\uDC2E]|\uD805[\uDE80-\uDEAA]|\uD87E[\uDC00-\uDE1D]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD82C[\uDC00\uDC01]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD808[\uDC00-\uDF6E]"}])}(XRegExp));;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:xregexp', location = '/static/bower/xregexp/src/addons/unicode/unicode-categories.js' */
/*
 * XRegExp Unicode Categories 3.0.0-pre
 * <http://xregexp.com/>
 * Steven Levithan � 2010-2012 MIT License
 * Uses Unicode 6.2.0 <http://unicode.org/>
 * Unicode data generated by Mathias Bynens <http://mathiasbynens.be/>
 */
(function(A){if(!A.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Categories")}A.addUnicodeData([{name:"C",alias:"Other",isBmpLast:true,bmp:"\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF",astral:"\uD808[\uDF6F-\uDFFF]|\uD809[\uDC63-\uDC6F\uDC74-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7F\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD7F\uDDC9-\uDDCF\uDDDA-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC60-\uDCFF\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDE80-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF80-\uDFFF]|\uD86D[\uDF35-\uDF3F]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFFF]|\uD86E[\uDC1E-\uDFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8B-\uDD8F\uDD9C-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF1F\uDF24-\uDF2F\uDF4B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]|\uD803[\uDC49-\uDE5F\uDE7F-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|[\uD806\uD807\uD80A\uD80B\uD80E-\uD819\uD81C-\uD82B\uD82D-\uD833\uD836-\uD83A\uD83E\uD83F\uD86F-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD83D[\uDC3F\uDC41\uDCF8\uDCFD-\uDCFF\uDD3E\uDD3F\uDD44-\uDD4F\uDD68-\uDDFA\uDE41-\uDE44\uDE50-\uDE7F\uDEC6-\uDEFF\uDF74-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCBF\uDCC0\uDCD0\uDCE0-\uDCFF\uDD0B-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF\uDF21-\uDF2F\uDF36\uDF7D-\uDF7F\uDF94-\uDF9F\uDFC5\uDFCB-\uDFDF\uDFF1-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD81A[\uDE39-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDDE-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDFFF]|\uD805[\uDC00-\uDE7F\uDEB8-\uDEBF\uDECA-\uDFFF]|\uD82C[\uDC02-\uDFFF]"},{name:"Cc",alias:"Control",bmp:"\0-\x1F\x7F-\x9F"},{name:"Cf",alias:"Format",bmp:"\xAD\u0600-\u0604\u06DD\u070F\u200B-\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\uFEFF\uFFF9-\uFFFB",astral:"\uDB40[\uDC01\uDC20-\uDC7F]|\uD834[\uDD73-\uDD7A]|\uD804\uDCBD"},{name:"Cn",alias:"Unassigned",bmp:"\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u0605\u061C\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065-\u2069\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF",astral:"\uD808[\uDF6F-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDDE-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC60-\uDCFF\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDE80-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF80-\uDFFF]|\uD86D[\uDF35-\uDF3F]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFFF]|\uD809[\uDC63-\uDC6F\uDC74-\uDFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8B-\uDD8F\uDD9C-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF1F\uDF24-\uDF2F\uDF4B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7F\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD7F\uDDC9-\uDDCF\uDDDA-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD803[\uDC49-\uDE5F\uDE7F-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|[\uD806\uD807\uD80A\uD80B\uD80E-\uD819\uD81C-\uD82B\uD82D-\uD833\uD836-\uD83A\uD83E\uD83F\uD86F-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD83D[\uDC3F\uDC41\uDCF8\uDCFD-\uDCFF\uDD3E\uDD3F\uDD44-\uDD4F\uDD68-\uDDFA\uDE41-\uDE44\uDE50-\uDE7F\uDEC6-\uDEFF\uDF74-\uDFFF]|\uD86E[\uDC1E-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCBF\uDCC0\uDCD0\uDCE0-\uDCFF\uDD0B-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF\uDF21-\uDF2F\uDF36\uDF7D-\uDF7F\uDF94-\uDF9F\uDFC5\uDFCB-\uDFDF\uDFF1-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD81A[\uDE39-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDFFF]|\uD805[\uDC00-\uDE7F\uDEB8-\uDEBF\uDECA-\uDFFF]|\uD82C[\uDC02-\uDFFF]"},{name:"Co",alias:"Private_Use",bmp:"\uE000-\uF8FF",astral:"[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]"},{name:"Cs",alias:"Surrogate",bmp:"\uD800-\uDFFF"},{name:"Ll",alias:"Lowercase_Letter",bmp:"a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0561-\u0587\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7FA\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A",astral:"\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD801[\uDC28-\uDC4F]"},{name:"Lm",alias:"Modifier_Letter",bmp:"\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uAA70\uAADD\uAAF3\uAAF4\uFF70\uFF9E\uFF9F",astral:"\uD81B[\uDF93-\uDF9F]"},{name:"Lo",alias:"Other_Letter",bmp:"\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",astral:"\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1E\uDF30-\uDF40\uDF42-\uDF49\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD81A[\uDC00-\uDE38]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD83-\uDDB2\uDDC1-\uDDC4]|\uD86E[\uDC00-\uDC1D]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD803[\uDC00-\uDC48]|\uD80D[\uDC00-\uDC2E]|\uD805[\uDE80-\uDEAA]|\uD87E[\uDC00-\uDE1D]|\uD81B[\uDF00-\uDF44\uDF50]|\uD801[\uDC50-\uDC9D]|\uD82C[\uDC00\uDC01]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD808[\uDC00-\uDF6E]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]"},{name:"Lt",alias:"Titlecase_Letter",bmp:"\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC"},{name:"Lu",alias:"Uppercase_Letter",bmp:"A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA\uFF21-\uFF3A",astral:"\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD801[\uDC00-\uDC27]"},{name:"M",alias:"Mark",bmp:"\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u08FE\u0900-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1DC0-\u1DE6\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26",astral:"\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC80-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD80-\uDD82\uDDB3-\uDDC0]|\uD805[\uDEAB-\uDEB7]|\uD800\uDDFD|\uDB40[\uDD00-\uDDEF]"},{name:"Mc",alias:"Spacing_Mark",bmp:"\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u19B0-\u19C0\u19C8\u19C9\u1A19-\u1A1B\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BAC\u1BAD\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC",astral:"\uD834[\uDD65\uDD66\uDD6D-\uDD72]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0]|\uD805[\uDEAC\uDEAE\uDEAF\uDEB6]|\uD81B[\uDF51-\uDF7E]"},{name:"Me",alias:"Enclosing_Mark",bmp:"\u0488\u0489\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672"},{name:"Mn",alias:"Nonspacing_Mark",bmp:"\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u08FE\u0900-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1DC0-\u1DE6\u1DFC-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26",astral:"\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD81B[\uDF8F-\uDF92]|\uD805[\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7]|\uD804[\uDC01\uDC38-\uDC46\uDC80\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD80\uDD81\uDDB6-\uDDBE]|\uD800\uDDFD|\uDB40[\uDD00-\uDDEF]"},{name:"N",alias:"Number",bmp:"0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19",astral:"\uD802[\uDC58-\uDC5F\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDF58-\uDF5F\uDF78-\uDF7F]|\uD801[\uDCA0-\uDCA9]|\uD809[\uDC00-\uDC62]|\uD835[\uDFCE-\uDFFF]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD834[\uDF60-\uDF71]|\uD803[\uDE60-\uDE7E]|\uD83C[\uDD00-\uDD0A]|\uD805[\uDEC0-\uDEC9]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9]"},{name:"Nd",alias:"Decimal_Number",bmp:"0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19",astral:"\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9]|\uD805[\uDEC0-\uDEC9]|\uD801[\uDCA0-\uDCA9]|\uD835[\uDFCE-\uDFFF]"},{name:"Nl",alias:"Letter_Number",bmp:"\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF",astral:"\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC62]"},{name:"No",alias:"Other_Number",bmp:"\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D70-\u0D75\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835",astral:"\uD802[\uDC58-\uDC5F\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDF58-\uDF5F\uDF78-\uDF7F]|\uD834[\uDF60-\uDF71]|\uD803[\uDE60-\uDE7E]|\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDF20-\uDF23]|\uD83C[\uDD00-\uDD0A]|\uD804[\uDC52-\uDC65]"},{name:"P",alias:"Punctuation",bmp:"\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65",astral:"\uD809[\uDC70-\uDC73]|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDF39-\uDF3F]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDDC5-\uDDC8]"},{name:"Pc",alias:"Connector_Punctuation",bmp:"\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F"},{name:"Pd",alias:"Dash_Punctuation",bmp:"\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D"},{name:"Pe",alias:"Close_Punctuation",bmp:"\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3F\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63"},{name:"Pf",alias:"Final_Punctuation",bmp:"\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21"},{name:"Pi",alias:"Initial_Punctuation",bmp:"\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20"},{name:"Po",alias:"Other_Punctuation",bmp:"\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65",astral:"\uD809[\uDC70-\uDC73]|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDF39-\uDF3F]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDDC5-\uDDC8]"},{name:"Ps",alias:"Open_Punctuation",bmp:"\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3E\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62"},{name:"S",alias:"Symbol",bmp:"\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BA\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u2190-\u2328\u232B-\u23F3\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u26FF\u2701-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B4C\u2B50-\u2B59\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD",astral:"\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCF7\uDCF9-\uDCFC\uDD00-\uDD3D\uDD40-\uDD43\uDD50-\uDD67\uDDFB-\uDE40\uDE45-\uDE4F\uDE80-\uDEC5\uDF00-\uDF73]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBE\uDCC1-\uDCCF\uDCD1-\uDCDF\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDD9A\uDDE6-\uDE02\uDE10-\uDE3A\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDF20\uDF30-\uDF35\uDF37-\uDF7C\uDF80-\uDF93\uDFA0-\uDFC4\uDFC6-\uDFCA\uDFE0-\uDFF0]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDDD\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD90-\uDD9B\uDDD0-\uDDFC]|\uD83B[\uDEF0\uDEF1]"},{name:"Sc",alias:"Currency_Symbol",bmp:"\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BA\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6"},{name:"Sk",alias:"Modifier_Symbol",bmp:"\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3"},{name:"Sm",alias:"Math_Symbol",bmp:"\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2308-\u230B\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC",astral:"\uD83B[\uDEF0\uDEF1]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]"},{name:"So",alias:"Other_Symbol",bmp:"\xA6\xA9\xAE\xB0\u0482\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23F3\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u26FF\u2701-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B50-\u2B59\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD",astral:"\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCF7\uDCF9-\uDCFC\uDD00-\uDD3D\uDD40-\uDD43\uDD50-\uDD67\uDDFB-\uDE40\uDE45-\uDE4F\uDE80-\uDEC5\uDF00-\uDF73]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDDD\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBE\uDCC1-\uDCCF\uDCD1-\uDCDF\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDD9A\uDDE6-\uDE02\uDE10-\uDE3A\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDF20\uDF30-\uDF35\uDF37-\uDF7C\uDF80-\uDF93\uDFA0-\uDFC4\uDFC6-\uDFCA\uDFE0-\uDFF0]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD90-\uDD9B\uDDD0-\uDDFC]"},{name:"Z",alias:"Separator",bmp:"\x20\xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000"},{name:"Zl",alias:"Line_Separator",bmp:"\u2028"},{name:"Zp",alias:"Paragraph_Separator",bmp:"\u2029"},{name:"Zs",alias:"Space_Separator",bmp:"\x20\xA0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000"}])}(XRegExp));;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-search', location = '/static/feature/repository/repository-search/repository-search.soy' */
// This file was automatically generated from repository-search.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.repository.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; }


stash.feature.repository.repositorySearch = function(opt_data, opt_ignored) {
  return '<form class="aui-quicksearch"><div class="repository-search-trigger"><label class="assistive" for="repository-search">' + soy.$$escapeHtml("Find a repository...") + '</label><input id="repository-search" type="text" autocomplete="off" placeholder="' + soy.$$escapeHtml("Find a repository...") + '"/><div class="spinner"></div></div></form>';
};
if (goog.DEBUG) {
  stash.feature.repository.repositorySearch.soyTemplateName = 'stash.feature.repository.repositorySearch';
}


stash.feature.repository.repositorySearchResults = function(opt_data, opt_ignored) {
  return '' + ((! (opt_data.isPreload && opt_data.size == 0)) ? '<div class="results-section' + ((opt_data.isPreload) ? ' recently-viewed' : '') + '">' + stash.feature.repository.menuItems({repos: opt_data.values, extraClasses: 'result', projectHighlightText: opt_data.projectSearchTerm, repositoryHighlightText: opt_data.repositorySearchTerm}) + ((opt_data.isLastPage) ? (opt_data.size > 0) ? '<li class="no-results">' + soy.$$escapeHtml(opt_data.noMoreResultsText) + '</li>' : '<li class="no-results">' + soy.$$escapeHtml(opt_data.noResultsText) + '</li>' : '') + '</div>' : '');
};
if (goog.DEBUG) {
  stash.feature.repository.repositorySearchResults.soyTemplateName = 'stash.feature.repository.repositorySearchResults';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-search', location = '/static/feature/repository/repository-search/repository-search.js' */
define("feature/repository/repository-search",["aui","jquery","lodash","xregexp","stash/api/util/navbuilder","util/events","widget/searchable-selector"],function(F,B,G,E,A,I,D){var C=null;I.on("stash.feature.repositories.recent.loaded",function(J){C=J});var H=function(M,K,J){J=J||{};J.externalSearchField=M;var L=this.init(K,J);L._bindSearchFieldEvents();L.dialog.on("click","a",function(){I.trigger("internal.stash.ui.nav.search.result.clicked",null,{repositoryId:B(this).attr("data-repo-id")})});return L};B.extend(H.prototype,D.prototype);H.prototype._generatePreloadData=function(){if(C==null){return null}var J;var L=this._parseSearchTerm(this._getSearchTerm());if(L){var M=L.projectName&&new RegExp("^"+E.escape(L.projectName),"i");var K=L.repositoryName&&new RegExp("^"+E.escape(L.repositoryName),"i");J=G.filter(C.values,function(N){return(L.projectName==null||N.project.name.match(M)!=null)&&(L.repositoryName==null||N.name.match(K)!=null)})}else{J=C.values}J.sort(function(O,N){return(L&&L.projectName?O.project.name.localeCompare(N.project.name):0)||O.name.localeCompare(N.name)||O.id-N.id});return G.extend({},C,{values:J,size:J.length,isLastPage:false})};H.prototype.defaults=B.extend({},D.prototype.defaults,{extraClasses:"repository-search-dialog",url:A.rest().allRepos().withParams({avatarSize:stash.widget.avatarSizeInPx({size:"xsmall"})}).build(),queryParamsBuilder:function(K,M,J){var L=this._parseSearchTerm(K);if(L==null){return null}return{start:M,limit:J,name:L.repositoryName,projectname:L.projectName}},dataTransform:function(L,J){var K=this._parseSearchTerm(J);if(K==null){return L}return B.extend({repositorySearchTerm:K.repositoryName,projectSearchTerm:K.projectName},L)},preloadData:H.prototype._generatePreloadData,alwaysShowPreload:true,followLinks:true,resultsTemplate:stash.feature.repository.repositorySearchResults,noResultsText:"No repositories matching your search",noMoreResultsText:"No more repositories",adjacentItems:false,clearResultsOnSearch:false,popUpOffsetY:1});H.prototype._bindSearchFieldEvents=function(){var J=this;this.$searchField.on("keydown.repository-search",function(K){if(K.which===F.keyCode.ENTER){K.preventDefault()}});this.$searchField.on("keyup.repository-search",function(K){var L=J.dialog.is(":visible");if(!L&&K.which===F.keyCode.ESCAPE){B(this).blur()}});this.$searchField.on("focus",function(){I.trigger("internal.stash.ui.nav.search.focused")})};H.prototype._parseSearchTerm=function(J){J=B.trim(J);if(J===""||J==="/"){return null}var L={};var K=J.lastIndexOf("/");if(K===-1){L.projectName=null;L.repositoryName=J}else{L.projectName=B.trim(J.substr(0,K));L.repositoryName=B.trim(J.substr(K+1))}return L};H.prototype._showSpinner=function(J){J.$scrollElement.find(".spinner").hide();this.$searchField.closest(".aui-quicksearch").addClass("loading");this.$searchField.next(".spinner").spin()};H.prototype._hideSpinner=function(){this.$searchField.closest(".aui-quicksearch").removeClass("loading");this.$searchField.next(".spinner").spinStop()};return H});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:base-layout', location = '/static/layout/base/base.js' */
define("layout/base",["aui","jquery","lodash","memoir","stash/api/util/navbuilder","util/analytics","util/client-storage","util/events","model/page-state","model/stash-user","widget/aui/dropdown","widget/aui/form","feature/repository/repository-search","exports"],function(J,F,Q,M,I,H,K,C,L,N,P,D,A,R){if(location.search){var G=I.parse(location.href),B=G.getQueryParamValue("eve");B&&C.on(B,function(){console.log([C.name()],this,arguments)})}function O(S){if(S){S.isAdmin=!!F("#header").find("a.admin-link").length;L.setCurrentUser(new N(S))}}function E(S){if(!K.getSessionItem(S)){K.setSessionItem(S,true);H.add("demographics",{d_lang:document.documentElement.lang},true)}}R.onReady=function(V,T){O(V);P.onReady();D.onReady();J.params["build-number"]=encodeURIComponent(F("#product-version").attr("data-system-build-number"));var W=F(window);var U=Q.debounce(function(){C.trigger("window.resize.debounced",W,W.width(),W.height())},200);W.on("resize",U);var X=Q.throttle(function(){C.trigger("window.scroll.throttled",W,W.scrollTop())},25);W.on("scroll",X);var S=F("#repository-search");new A(S,S.closest(".repository-search-trigger"));M.setTitleSuffix(" - "+T);E(K.buildKey("demographic-analytics","user"))};C.on("memoir.changestate",function(T){var S=F("#login-link");if(S.length&&T.state){S.attr("href",I.login().next().build())}F("body").children(".tipsy").remove()})});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:quick-copy-text', location = '/static/widget/quick-copy-text.js' */
define("widget/quick-copy-text",["jquery","exports"],function(B,A){var C=true;A.onReady=function(){if(C){C=false;B(document).on("click",".quick-copy-text",function(D){this.focus();this.select()})}}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:browser-location', location = '/static/util/browser-location.js' */
define("util/browser-location",["exports"],function(A){A.location=window.location});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:sticky-branches', location = '/static/feature/repository/sticky-branches.js' */
define("feature/repository/sticky-branches",["jquery","stash/api/util/navbuilder","util/browser-location","util/client-storage","util/events","util/text","exports"],function(E,A,B,C,L,F,D){var I;var J;var K;D.onReady=function(){var P=A.parse(B.location.href),S=A.currentRepo().browse().build(),T=A.currentRepo().commits().build(),O=P.path().indexOf(S)===0,U=P.path()===T,X=O?P.getQueryParamValue("at"):U?P.getQueryParamValue("until"):undefined,M=O||U,W=C.buildKey("current-branch","repo"),V=C.getSessionItem(W);I=E("#repository-nav-files");J=E("#repository-nav-commits");K=E("#repository-nav-branches");var Q;if(X&&O){var R=E("[data-revision-ref]","#repository-layout-revision-selector").data("revision-ref");Q=R&&((R.id===X&&R.type.id==="commit")||(R.id!==X&&(R.type.id==="branch"||R.type.id==="tag")&&/^[0-9a-f]{7,40}$/.test(X)))}var N=!(O&&Q);if(X&&N){X=decodeURIComponent(X);if(X!==V){C.setSessionItem(W,X)}H(X)}else{if(M&&N){C.removeSessionItem(W)}else{if(V){H(V)}}}L.on("stash.layout.branch.revisionRefChanged",function(Y){if(Y){if(!Y.getIsDefault()){var Z=Y.getId();H(Z);C.setSessionItem(W,Z)}else{G();C.removeSessionItem(W)}}});L.on("stash.*.*.revisionRefRemoved",function(Z){var Y=C.getSessionItem(W);if(Y&&F.endsWith(Z.id,Y)){G();C.removeSessionItem(W)}})};function H(M){if(M){M=encodeURIComponent(M);I.attr("href",A.parse(I.attr("href")).replaceQueryParam("at",M));J.attr("href",A.parse(J.attr("href")).replaceQueryParam("until",M));K.attr("href",A.parse(K.attr("href")).replaceQueryParam("base",M))}else{G()}}function G(){I.attr("href",A.parse(I.attr("href")).deleteQueryParam("at"));J.attr("href",A.parse(J.attr("href")).deleteQueryParam("until"));K.attr("href",A.parse(K.attr("href")).deleteQueryParam("base"))}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:lozenge-internal', location = '/static/widget/lozenge/lozenge.soy' */
// This file was automatically generated from lozenge.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.lozenge.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }
if (typeof stash.widget.lozenge == 'undefined') { stash.widget.lozenge = {}; }


stash.widget.lozenge.lozenge = function(opt_data, opt_ignored) {
  var output = '';
  var tag__soy3 = opt_data.href ? 'a' : opt_data.htmlElement ? opt_data.htmlElement : opt_data.clickable ? 'button' : 'span';
  output += '<' + soy.$$escapeHtml(tag__soy3) + ' class="aui-lozenge' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + ((opt_data.monospace) ? ' monospace-lozenge' : '') + '"' + ((opt_data.href) ? ' href="' + soy.$$escapeHtml(opt_data.href) + '"' : '') + ((opt_data.tooltip) ? ' title="' + soy.$$escapeHtml(opt_data.tooltip) + '"' : '') + '>' + ((opt_data.maxLength) ? soy.$$escapeHtml(soy.$$truncate(opt_data.text, opt_data.maxLength, true)) : soy.$$escapeHtml(opt_data.text)) + '</' + soy.$$escapeHtml(tag__soy3) + '>';
  return output;
};
if (goog.DEBUG) {
  stash.widget.lozenge.lozenge.soyTemplateName = 'stash.widget.lozenge.lozenge';
}


stash.widget.lozenge.htmlLozenge = function(opt_data, opt_ignored) {
  return '<' + ((opt_data.htmlElement) ? soy.$$escapeHtml(opt_data.htmlElement) : 'a') + ' class="aui-lozenge' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + ((opt_data.monospace) ? ' monospace-lozenge' : '') + '"' + ((opt_data.href) ? ' href="' + soy.$$escapeHtml(opt_data.href) + '"' : '') + ((opt_data.tooltip) ? ' title="' + soy.$$escapeHtml(opt_data.tooltip) + '"' : '') + ((opt_data.extraAttributes) ? aui.renderExtraAttributes(opt_data) : '') + '>' + soy.$$filterNoAutoescape(opt_data.content) + '</' + ((opt_data.htmlElement) ? soy.$$escapeHtml(opt_data.htmlElement) : 'a') + '>';
};
if (goog.DEBUG) {
  stash.widget.lozenge.htmlLozenge.soyTemplateName = 'stash.widget.lozenge.htmlLozenge';
}


stash.widget.lozenge.merge = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '' + stash.widget.lozenge.lozenge({extraClasses: 'merge-lozenge' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : '') + (opt_data.abbreviated ? ' abbreviated' : ''), text: '' + soy.$$escapeHtml(opt_data.abbreviated ? "M" : "Merge"), tooltip: '' + soy.$$escapeHtml("This commit is a merge.")});
};
if (goog.DEBUG) {
  stash.widget.lozenge.merge.soyTemplateName = 'stash.widget.lozenge.merge';
}


stash.widget.lozenge.pullRequestState = function(opt_data, opt_ignored) {
  var output = '';
  var commonClasses__soy84 = opt_data.extraClasses ? opt_data.extraClasses + ' pull-request-state-lozenge' : ' pull-request-state-lozenge';
  switch (opt_data.state) {
    case 'OPEN':
      output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-complete open' + commonClasses__soy84, text: "OPEN", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request is in progress.", clickable: opt_data.clickable, href: opt_data.href});
      break;
    case 'OPENED':
      output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-complete opened' + commonClasses__soy84, text: opt_data.isActivityContext ? "opened" : "OPENED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request is in progress.", clickable: opt_data.clickable, href: opt_data.href});
      break;
    case 'MERGED':
      output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-success merged' + commonClasses__soy84, text: opt_data.isActivityContext ? "merged" : "MERGED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been merged.", clickable: opt_data.clickable, href: opt_data.href});
      break;
    case 'DECLINED':
      output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-error declined' + commonClasses__soy84, text: opt_data.isActivityContext ? "declined" : "DECLINED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been declined.", clickable: opt_data.clickable, href: opt_data.href});
      break;
    case 'REOPENED':
      output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-complete reopened' + commonClasses__soy84, text: opt_data.isActivityContext ? "reopened" : "REOPENED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been reopened.", clickable: opt_data.clickable, href: opt_data.href});
      break;
    case 'UPDATED':
    case 'RESCOPED':
      output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-current updated' + commonClasses__soy84, text: opt_data.isActivityContext ? "updated" : "UPDATED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been updated.", clickable: opt_data.clickable, href: opt_data.href});
      break;
    case 'APPROVED':
      output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-success approved' + commonClasses__soy84, text: opt_data.isActivityContext ? "approved" : "Approved", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been approved.", clickable: opt_data.clickable, href: opt_data.href});
      break;
    case 'UNAPPROVED':
      output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-error unapproved' + commonClasses__soy84, text: opt_data.isActivityContext ? "unapproved" : "Unapproved", tooltip: opt_data.tooltip ? opt_data.tooltip : "The approval has been withdrawn from this pull request.", clickable: opt_data.clickable, href: opt_data.href});
      break;
  }
  return output;
};
if (goog.DEBUG) {
  stash.widget.lozenge.pullRequestState.soyTemplateName = 'stash.widget.lozenge.pullRequestState';
}


stash.widget.lozenge.enabled = function(opt_data, opt_ignored) {
  return '' + stash.widget.lozenge.lozenge({extraClasses: opt_data.isEnabled ? 'lozenge-enabled' : 'lozenge-disabled', text: opt_data.isEnabled ? "Enabled" : "Disabled", tooltip: opt_data.tooltip});
};
if (goog.DEBUG) {
  stash.widget.lozenge.enabled.soyTemplateName = 'stash.widget.lozenge.enabled';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:project-model', location = '/static/model/project.js' */
define("model/project",["backbone-brace","model/stash-user"],function(B,A){var C=B.Model.extend({namedAttributes:{id:"number",name:"string",key:"string",description:"string",type:"string",owner:A,avatarUrl:"string",link:Object,links:Object,"public":"boolean"},isEqual:function(D){return !!(D&&D instanceof C&&this.id===D.id)}},{projectType:{NORMAL:"NORMAL",PERSONAL:"PERSONAL"}});return C});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-model', location = '/static/model/repository.js' */
define("model/repository",["backbone-brace","model/project"],function(B,C){var A=B.Model.extend({namedAttributes:{id:"number",name:"string",slug:"string",project:C,"public":"boolean",scmId:"string",state:"string",statusMessage:"string",forkable:"boolean",cloneUrl:"string",link:Object,links:Object,origin:null},isEqual:function(D){return !!(D&&D instanceof A&&this.id===D.id)}});B.Mixins.applyMixin(A,{namedAttributes:{origin:A}});return A});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-public-lozenge', location = '/static/feature/repository/public-lozenge/public-lozenge.soy' */
// This file was automatically generated from public-lozenge.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.repository.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; }


stash.feature.repository.publicLozenge = function(opt_data, opt_ignored) {
  return '' + ((true && (opt_data.repository['public'] || opt_data.repository.project['public'])) ? '<div class="public-lozenge aui-lozenge aui-lozenge-subtle">' + soy.$$escapeHtml("Public") + '</div>' : '');
};
if (goog.DEBUG) {
  stash.feature.repository.publicLozenge.soyTemplateName = 'stash.feature.repository.publicLozenge';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:sidebar', location = '/static/widget/sidebar/sidebar.js' */
define("widget/sidebar",["aui","chaperone","jquery","util/client-storage","util/events","exports"],function(K,D,G,E,L,F){var J="sidebar_expanded";var C=".aui-sidebar";var A;function B(){A=K.sidebar(C);A.on("collapse-end",function(){E.setItem(J,false);L.trigger("stash.feature.sidebar.collapseEnd")});A.on("expand-end",function(){E.setItem(J,true);L.trigger("stash.feature.sidebar.expandEnd")});var M=null;A.$el.find(".aui-sidebar-body").on("mousemove mouseleave",function(O){if(typeof O.srcElement==="undefined"&&O.target!==M){var N=(O.type==="mousemove")&&!G(O.target).parentsUntil(A.$el).filter(".aui-page-header, .aui-navgroup").length;A.$el.toggleClass("aui-is-hover",N);M=O.target}});I()}function I(){var M=E.getItem(J);A.on("expand",function(){M=true});A.on("collapse",function(){M=false});D.registerFeature("sidebar",[{id:"sidebar-discovery",selector:".aui-sidebar[aria-expanded=false] .aui-page-header, .aui-sidebar[aria-expanded=true] .aui-sidebar-group:first-child",title:"Improvements to navigation in Stash",content:stash.widget.sidebar.discoveryContent(),moreInfo:{href:"http://go.atlassian.com/stashsidebar"},gravity:"w",width:350,offsetX:function(){return M?-10:10},once:true}]);A.on("expand",D.checkFeatureAlignment);A.on("collapse",D.checkFeatureAlignment);A.on("expand-end",D.checkFeatureAlignment);A.on("collapse-end",D.checkFeatureAlignment)}function H(){var M=E.getItem(J);G(document.body).toggleClass("aui-sidebar-collapsed",!M);G(C).attr("aria-expanded",M)}F.preload=H;F.onReady=B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:sidebar', location = '/static/widget/sidebar/sidebar.soy' */
// This file was automatically generated from sidebar.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.sidebar.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }
if (typeof stash.widget.sidebar == 'undefined') { stash.widget.sidebar = {}; }


stash.widget.sidebar.discoveryContent = function(opt_data, opt_ignored) {
  return '<ul><li>' + soy.$$escapeHtml("Actions and navigation in one place") + '</li><li>' + soy.$$escapeHtml("Always visible for faster access") + '</li><li>' + soy.$$filterNoAutoescape(AJS.format("Collapse the sidebar with {0}[{1} when you need more space",'<kbd>','</kbd>')) + '</li></ul>';
};
if (goog.DEBUG) {
  stash.widget.sidebar.discoveryContent.soyTemplateName = 'stash.widget.sidebar.discoveryContent';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-layout', location = '/static/layout/repository/repository.js' */
define("layout/repository",["aui","jquery","lodash","stash/api/util/navbuilder","util/events","model/page-state","model/repository","widget/quick-copy-text","widget/sidebar","feature/repository/sticky-branches","exports"],function(J,H,S,I,C,L,G,F,M,R,T){function O(V){var U=new G(V);L.setRepository(U);L.setProject(U.getProject());H(".aui-page-header-image > a").on("click",function(){C.trigger("stash.sidebar.clickAvatar.expanded."+H(".aui-sidebar").attr("aria-expanded"),null)})}function B(){return H(".clone-url")}function E(){return H(".repository-protocol")}function D(){var b=B(),W=b.find("input"),Z=E(),V=H("#"+Z.attr("aria-owns")),Y=V.find("li"),a,U,X="";if(Z.is("button")){N(Z,Z.text());a=Z.attr("data-clone-url");U=Z.attr("data-module-key")}else{N(Z,Y.first().children("a").text());a=Y.first().attr("data-clone-url");U=Y.first().attr("data-module-key")}W.val(a);b.addClass(U);X=U;Y.on("click",function(c){var d=H(this);N(Z,d.text());W.val(d.attr("data-clone-url")).select();U=d.attr("data-module-key");b.removeClass(X).addClass(U);X=U;C.trigger("stash.feature.repository.clone.protocol.changed",null,U,d.attr("data-clone-url"));c.stopPropagation();if(V.is(":visible")){Z.trigger("aui-button-invoke")}c.preventDefault()});C.trigger("stash.feature.repository.clone.protocol.initial",null,U,a)}function N(V,W){var U=V.children("span").remove();V.text(W).append(U)}function K(V,Z){var U=H(Z);var Y=null;var X=null;var W=J.InlineDialog(null,"clone-repo-dialog",function(b,a,c){b.append(U);c();S.defer(function(){U.find(".clone-url input").select()})},{noBind:true,width:360,gravity:"w",hideCallback:function(){var b=E(),a=H("#"+b.attr("aria-owns"));if(a.is(":visible")){b.trigger("aui-button-invoke")}},calculatePositions:function(){if(Y===null&&X===null){return J.InlineDialog.opts.calculatePositions.apply(this,arguments)}else{return{gravity:"w",popupCss:Y,arrowCss:X}}}});H(document).on("click",V,function(c){c.preventDefault();if(H(c.target).closest(".aui-sidebar").length===0){var b=H("#inline-dialog-sidebar-submenu");var a=b.find("#arrow-sidebar-submenu");Y=b.offset();X=a.position()}else{Y=null;X=null}W.show(c,this)});H(document).keyup(function(a){if(a.keyCode===J.keyCode.ESCAPE){W.hide()}});U.find("a.sourcetree-clone-button").on("click",function(){W.hide()})}function Q(){var U=H(".aui-page-header-actions .create-pull-request");C.on("stash.layout.branch.revisionRefChanged",function(W){var V=I.currentRepo().createPullRequest();if(!W.isDefault()&&W.isBranch()){V=V.sourceBranch(W.getId())}U.attr("href",V.build())})}function A(){H(".repository-badge .badge").tooltip({gravity:"n"})}function P(){var U=H(".aui-sidebar[aria-expanded=false] .aui-page-header-image");U.tooltip({gravity:"w",delayIn:0,live:true,html:true,aria:true,className:"aui-sidebar-section-tooltip",title:function(){return H(this).find(".aui-avatar").attr("data-tooltip")}})}T.onReady=function(W,U,V){O(W);D();F.onReady();H(document).ready(M.onReady);R.onReady();K(U,V);Q();A();P();C.on("stash.widget.keyboard-shortcuts.register-contexts",function(X){X.enableContext("repository")})}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:revision-reference', location = '/static/model/revision-reference.js' */
define("model/revision-reference",["aui","backbone-brace","lodash","model/page-state","model/repository"],function(C,F,D,E,A){var B={TAG:{id:"tag",name:"Tag"},BRANCH:{id:"branch",name:"Branch"},COMMIT:{id:"commit",name:"Commit"},isTag:function(H){return H&&(H===B.TAG.id||H.id===B.TAG.id)},isBranch:function(H){return H&&(H===B.BRANCH.id||H.id===B.BRANCH.id)},isCommit:function(H){return H&&(H===B.COMMIT.id||H.id===B.COMMIT.id)},from:function(H){if(B.isTag(H)){return B.TAG}else{if(B.isBranch(H)){return B.BRANCH}else{if(B.isCommit(H)){return B.COMMIT}}}window.console&&console.error("Unknown RevisionReference type "+H);return null}};var G=F.Model.extend({namedAttributes:{id:"string",displayId:"string",type:B.from,isDefault:"boolean",latestChangeset:"string",latestCommit:"string",hash:"string",repository:A},initialize:function(){if(!this.getDisplayId()){this.setDisplayId(this.getId())}if(!this.getIsDefault()){this.setIsDefault(false)}if(!this.getRepository()){this.setRepository(E.getRepository())}},getTypeName:function(){return this.getType().name},isDefault:function(){return this.get("isDefault")||false},isTag:function(){return B.isTag(this.getType())},isBranch:function(){return B.isBranch(this.getType())},isCommit:function(){return B.isCommit(this.getType())},isEqual:function(H){return(H instanceof G)&&this.getId()===H.getId()&&this.getType().id===H.getType().id&&this.getRepository().isEqual(H.getRepository())}},{fromChangeset:function(H){return new G({id:H.id,displayId:H.displayId,type:B.COMMIT,isDefault:false})},hydrateRefFromId:function(N,M,K,L){if(!D.isString(N)){return null}var H=/^refs\/(heads|tags)\/(.+)/;var J=N.replace(H,"$2");if(!K){K=G.type.BRANCH;var I=N.match(H);if(I&&I[1]==="tags"){K=G.type.TAG}}return new G({id:N,displayId:J,type:K,isDefault:M,latestChangeset:L})},hydrateDeprecated:function(H){if(!H.__json){return new G(H.toJSON())}return new G(H.__json)}});G.type=B;return G});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:revision-reference-selector', location = '/static/feature/repository/revision-reference-selector/revision-reference-selector.js' */
define("feature/repository/revision-reference-selector",["aui","jquery","lodash","stash/api/util/navbuilder","util/ajax","util/events","model/page-state","model/repository","model/revision-reference","widget/searchable-selector"],function(I,C,J,B,G,K,H,D,A,E){function F(M,L){return this.init.apply(this,arguments)}C.extend(F.prototype,E.prototype);F.prototype._addRefTypeAndRepositoryToResults=function(M){if(M&&M.values){var N=C.extend(true,{},M);var L=this._getCurrentType();J.each(N.values,J.bind(function(O){if(!O.type){O.type=L}if(!O.repository){O.repository=this.repository&&this.repository.toJSON()}},this));return N}return M};F.prototype.defaults=C.extend(true,{},E.prototype.defaults,{tabs:[{label:"Branches",type:A.type.BRANCH,url:function(){return this.getBranchesUrl()},resultsTemplate:stash.feature.repository.revisionReferenceSelectorBranchResults,searchPlaceholder:"Search for a branch"},{label:"Tags",type:A.type.TAG,url:function(){return this.getTagsUrl()},resultsTemplate:stash.feature.repository.revisionReferenceSelectorTagResults,searchPlaceholder:"Search for a tag"},{label:"Commits",type:A.type.COMMIT,url:function(){return this.getCommitsUrl()},resultsTemplate:stash.feature.repository.revisionReferenceSelectorCommitResults,searchPlaceholder:"Search for a commit"}],queryParamKey:"filterText",namespace:"revision-reference-selector",itemSelectedEvent:"stash.feature.repository.revisionReferenceSelector.revisionRefChanged",itemUnselectedEvent:"stash.feature.repository.revisionReferenceSelector.revisionRefUnselected",itemDataKey:"revision-ref",statusCodeHandlers:G.ignore404WithinRepository(),triggerContentTemplate:stash.feature.repository.revisionReferenceSelectorTriggerContent,extraClasses:"revision-reference-selector",repository:function(){return H.getRepository()},show:{branches:true,tags:true,commits:false},dataTransform:F.prototype._addRefTypeAndRepositoryToResults,postOptionsInit:function(){this.setRepository(this._getOptionVal("repository"))}});F.prototype.init=function(M,L){E.prototype.init.apply(this,arguments);return this};F.prototype.setOptions=function(N){if(N.extraClasses){N.extraClasses=this.defaults.extraClasses+" "+C.trim(N.extraClasses)}N=C.extend(true,{},this.defaults,N);var M={branches:A.type.BRANCH.id,tags:A.type.TAG.id,commits:A.type.COMMIT.id};var L=J.filter(M,function(P,O){return N.show[O]});N.tabs=J.filter(N.tabs,function(O){return J.indexOf(L,O.type.id)!==-1});this.options=N};F.prototype._getItemFromTrigger=function(){var L=this.$trigger.find(".name");return new A(C.extend({},this._buildObjectFromElementDataAttributes(L),{displayId:L.text(),repository:this.repository}))};F.prototype.getBranchesUrl=function(){return B.rest().project(this.repository.getProject()).repo(this.repository).branches().build()};F.prototype.getTagsUrl=function(){return B.rest().project(this.repository.getProject()).repo(this.repository).tags().build()};F.prototype.getCommitsUrl=function(){return B.rest().project(this.repository.getProject()).repo(this.repository).commits().build()};F.prototype.getRepository=function(){return this.repository};F.prototype.setRepository=function(L){var N=this.repository;if(L instanceof D&&!L.isEqual(N)){this.repository=L;if(N){var M=this._getCurrentScrollable();if(M){this._emptyScrollable(M);M.init()}this.clearSelection();this.dialog.hide();K.trigger("stash.feature.repository.revisionReferenceSelector.repoChanged",this,L,this._getOptionVal("context"))}}};F.prototype._getCurrentType=function(){return this.tabs[this.currentTabId||0].type};F.prototype.setSelectedItem=function(L){if(L instanceof A&&!L.isEqual(this._selectedItem)){this._itemSelected(L)}};F.prototype.clearSelection=function(){E.prototype.clearSelection.apply(this,arguments);K.trigger(this._getOptionVal("itemUnselectedEvent"),this,null,this._getOptionVal("context"))};F.prototype._itemSelected=function(N){var L;var M;if(N instanceof A){L=N.toJSON();M=N}else{L=J.pick(N,J.keys(A.prototype.namedAttributes));M=new A(L)}this._selectedItem=M;if(this._getOptionVal("field")){C(this._getOptionVal("field")).val(L.id)}this.updateTrigger({ref:L});K.trigger(this._getOptionVal("itemSelectedEvent"),this,M,this._getOptionVal("context"))};return F});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:revision-reference-selector', location = '/static/feature/repository/revision-reference-selector/revision-reference-selector.soy' */
// This file was automatically generated from revision-reference-selector.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.repository.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; }


stash.feature.repository.revisionReferenceSelectorBranchResults = function(opt_data, opt_ignored) {
  return '' + stash.feature.repository.revisionReferenceSelectorResults({values: opt_data.values, isLastPage: opt_data.isLastPage, size: opt_data.size, isPreload: opt_data.isPreload, noResultsText: "No branches", noMoreResultsText: "No more branches"});
};
if (goog.DEBUG) {
  stash.feature.repository.revisionReferenceSelectorBranchResults.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorBranchResults';
}


stash.feature.repository.revisionReferenceSelectorTagResults = function(opt_data, opt_ignored) {
  return '' + stash.feature.repository.revisionReferenceSelectorResults({values: opt_data.values, isLastPage: opt_data.isLastPage, size: opt_data.size, isPreload: opt_data.isPreload, noResultsText: "No tags", noMoreResultsText: "No more tags"});
};
if (goog.DEBUG) {
  stash.feature.repository.revisionReferenceSelectorTagResults.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorTagResults';
}


stash.feature.repository.revisionReferenceSelectorCommitResults = function(opt_data, opt_ignored) {
  return '' + stash.feature.repository.revisionReferenceSelectorResults({values: opt_data.values, isLastPage: opt_data.isLastPage, size: opt_data.size, isPreload: opt_data.isPreload, noResultsText: "No commits", noMoreResultsText: "No more commits"});
};
if (goog.DEBUG) {
  stash.feature.repository.revisionReferenceSelectorCommitResults.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorCommitResults';
}


stash.feature.repository.revisionReferenceSelectorResults = function(opt_data, opt_ignored) {
  var output = '';
  var refList27 = opt_data.values;
  var refListLen27 = refList27.length;
  for (var refIndex27 = 0; refIndex27 < refListLen27; refIndex27++) {
    var refData27 = refList27[refIndex27];
    output += '<li class="result ' + ((opt_data.isPreload) ? 'preload' : '') + '"><a href="' + soy.$$escapeHtml(refData27.url ? refData27.url : '#') + '" data-id="' + soy.$$escapeHtml(refData27.id) + '" tabindex="-1">' + stash.feature.repository.revisionReferenceSelectorRef({ref: refData27}) + '</a></li>';
  }
  output += (opt_data.isLastPage) ? (opt_data.size > 0) ? '<li class="no-results">' + soy.$$escapeHtml(opt_data.noMoreResultsText ? opt_data.noMoreResultsText : "No more results") + '</li>' : '<li class="no-results">' + soy.$$escapeHtml(opt_data.noResultsText ? opt_data.noResultsText : "No results") + '</li>' : '';
  return output;
};
if (goog.DEBUG) {
  stash.feature.repository.revisionReferenceSelectorResults.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorResults';
}


stash.feature.repository.revisionReferenceSelectorTrigger = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '' + stash.widget.searchableSelectorTriggerGeneric({id: opt_data.id, content: '' + stash.feature.repository.revisionReferenceSelectorTriggerContent(opt_data), autofocus: opt_data.autofocus, extraClasses: 'revision-reference-selector-trigger' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: opt_data.extraAttributes});
};
if (goog.DEBUG) {
  stash.feature.repository.revisionReferenceSelectorTrigger.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorTrigger';
}


stash.feature.repository.revisionReferenceSelectorTriggerWithField = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '' + stash.feature.repository.revisionReferenceSelectorTrigger(opt_data) + widget.aui.form.input({id: opt_data.fieldId ? opt_data.fieldId : opt_data.id ? opt_data.id + '-field' : opt_data.id, name: opt_data.fieldName ? opt_data.fieldName : opt_data.id + '-field', initialValue: opt_data.ref ? opt_data.ref.id : null, type: 'hidden'});
};
if (goog.DEBUG) {
  stash.feature.repository.revisionReferenceSelectorTriggerWithField.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorTriggerWithField';
}


stash.feature.repository.revisionReferenceSelectorTriggerContent = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '' + ((opt_data.ref) ? stash.feature.repository.revisionReferenceSelectorRef(opt_data) : '<span class="placeholder">' + soy.$$escapeHtml(opt_data.text ? opt_data.text : "Select revision") + '</span>');
};
if (goog.DEBUG) {
  stash.feature.repository.revisionReferenceSelectorTriggerContent.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorTriggerContent';
}


stash.feature.repository.revisionReferenceSelectorRef = function(opt_data, opt_ignored) {
  return ((opt_data.ref.type) ? aui.icons.icon({size: 'small', useIconFont: true, iconFontSet: 'devtools', icon: opt_data.ref.type.id, accessibilityText: opt_data.ref.type.name}) : '') + '<span class="name" title="' + soy.$$escapeHtml(opt_data.ref.displayId) + '" data-id="' + soy.$$escapeHtml(opt_data.ref.id) + '" data-revision-ref="' + soy.$$escapeHtml(JSON.stringify(opt_data.ref).replace(/\//g, '\\/')) + '">' + soy.$$escapeHtml(opt_data.ref.displayId ? opt_data.ref.displayId : opt_data.ref.id) + '</span>';
};
if (goog.DEBUG) {
  stash.feature.repository.revisionReferenceSelectorRef.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorRef';
}
;
;/* module-key = 'com.atlassian.stash.stash-page-data-plugin:page-data-loader', location = '/static/util/page-data-loader.js' */
var _PageDataPlugin=(function(){var B=Object.prototype.hasOwnProperty;var F=jQuery;var E={};var A={};function D(J,I){for(var K in I){if(B.call(I,K)){var L=A[K]||(A[K]={});var M=L[J]||(L[J]=F.Deferred());var H=E[K]||(E[K]={});H[J]=I[K];if(M.state()!=="pending"){throw new Error("Attempt to set context "+J+" for plugin key "+K+" multiple times.")}M.resolve(H[J])}}}function C(J,I){var H=Array.prototype.slice.call(arguments,2);var K=A[J]||(A[J]={});var L=K[I]||(K[I]=F.Deferred());H.forEach(function(M){L.done(M)});return L}function G(){F.each(A,function(I,H){F.each(H,function(J,K){K.reject(E[I]?new Error("Provider "+I+" not included with context "+J):new Error("Provider "+I+" not included on page."))})})}F(document).ready(G);return{load:D,data:E,ready:C,_domReady:G}}());;
;/* module-key = 'com.atlassian.stash.stash-client-web-fragments-plugin:web-fragment-manager', location = '/static/util/web-fragment-manager.js' */
var WebFragments=(function(){var M=Object.prototype.hasOwnProperty;var N={item:{},section:{},panel:{}};var O=function(S){var R=[];for(var Q in S){if(M.call(S,Q)){R.push(Q)}}return R};function J(V){var T=Array.prototype.slice.call(arguments,1);for(var R=0,X=T.length;R<X;R++){var U=T[R];if(U){for(var Y=O(U),Q=0,S=Y.length;Q<S;Q++){var W=Y[Q];V[W]=U[W]}}}return V}var K;if(!window._PageDataPlugin||!_PageDataPlugin.ready){K=function(Q){return Q}}else{K=function(Q){_PageDataPlugin.ready(Q.completeModuleKey,Q.location,function(R){if(M.call(R,"serverCondition")){Q.serverCondition=R.serverCondition}if(M.call(R,"serverContext")){Q.serverContext=R.serverContext}})}}var E={item:function(Q,R){return{url:"#example-web-item-url",pluginKey:"org.example.plugins",moduleKey:"example-web-item",completeModuleKey:"org.example.plugins:example-web-item",linkText:"Client Web Item: "+Q,hasTooltip:true,tooltip:"Client Context Items: "+O(R).join(", "),hasIcon:false,iconUrl:null,iconWidth:0,iconHeight:0,styleClass:"plugin-point",linkId:null,description:null,params:{},type:"ITEM",weight:1000}},section:function(Q,R){return{name:"example-web-section",key:"example-web-section",location:Q,labelText:"Client Web Section: "+Q,type:"SECTION",params:{},weight:1000}},panel:function(Q,R){return{view:'<div class="plugin-point web-panel"><strong>Client Web Panel</strong>: '+Q+"<br /><strong>Client Context Items</strong>: "+O(R).join(", ")+"</div>",weight:1000}}};function F(Q){return new RegExp("[\\?&]web\\."+Q+"s(=|&|$)").test(window.location.search)}function H(R,Q){return typeof R==="function"?R(J({},Q)):R}function B(Q,R,V){var Y,W,T,X;var U={type:V.toUpperCase()};if(M.call(Q,"serverCondition")&&!Q.serverCondition){return null}R=J({},R,Q.serverContext,Q.params);if(M.call(Q,"condition")&&!H(Q.condition,R)){return null}if(Q["context-provider"]&&typeof Q["context-provider"]==="function"){R=H(Q["context-provider"],R)}for(Y=O(Q),T=0,X=Y.length;T<X;T++){W=Y[T];if(!/con(dition|text-provider)|params/.test(W)){U[W]=H(Q[W],R)}}if(Q.params){var S=U.params={};for(Y=O(Q.params),T=0,X=Y.length;T<X;T++){W=Y[T];S[W]=H(Q.params[W],R)}}return U}function I(R){var Q=N[R];return function(T,W){var Y=Q[T];var S=[];if(Y&&Y.length){for(var V=0,X=Y.length;V<X;V++){var U=B(Y[V],W,R);if(U){S.push(U)}}}if(F(R)){S.push(E[R](T,W))}return S}}var L=I("panel");function A(Q,T){var R=L(Q,T);for(var S=0,U=R.length;S<U;S++){R[S]=R[S].view}return R}var D=I("item");function G(Q,T){var R=D(Q,T);for(var S=0,U=R.length;S<U;S++){R[S].hasIcon=!!R[S].iconUrl;R[S].hasTooltip=!!R[S].tooltip}return R}function P(R){var Q=N[R];return function(S){if(!S){throw new Error("No descriptor provided")}if(typeof S.location!=="string"){throw new Error("No location provided, or location was not a string.")}if(typeof S.completeModuleKey!=="string"){throw new Error("No completeModuleKey provided, or completeModuleKey was not a string.")}K(S);if(!Q[S.location]){Q[S.location]=[]}Q[S.location].push(S);Q[S.location].sort(C)}}function C(R,Q){return(R.weight>=0?R.weight:1000)-(Q.weight>=0?Q.weight:1000)}return{getWebItems:I("item"),getWebSections:I("section"),getWebPanels:A,getWebFragmentDescriptors:function(Q,S){var R=N[S];var T=R&&R[Q];return T&&T.slice()},addWebItemDescriptor:P("item"),addWebSectionDescriptor:P("section"),addWebPanelDescriptor:P("panel"),getWebFragments:function(U,T,R){if(typeof T!=="string"){R=T;T=U}var Q=this.getWebItems(U,R);var V=this.getWebSections(T,R);var S=Q.concat(V);S.sort(C);return S},_getValue:H,_formatI18n:function(Q,R,T){var S=(Q===R?T:Q)||R||T||"";return function(W){var U=[];var Y=O(W);Y.sort();for(var V=0,X=Y.length;V<X;V++){U.push(W[Y[V]])}return AJS.format(S,U)}}}}());;
;/* module-key = 'com.atlassian.stash.stash-branch-utils:create-branch-action', location = '/web-fragment-placeholder.config' */
WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-branch-utils','key':'create-branch-action','moduleKey':'create-branch-action','completeModuleKey':'com.atlassian.stash.stash-branch-utils:create-branch-action','weight':30.0,'params':{},'styleClass':WebFragments._formatI18n(null, null, 'create-branch'),'location':'stash.branch.layout.actions.dropdown','url':function(ctx) { return WebFragments._getValue((
            function (ctx) {
            var navbuilder = require('stash/api/util/navbuilder');
            var urlBuilder = navbuilder.pluginServlets().path('create-branch');
            if (ctx.repository) {
            urlBuilder = urlBuilder.withParams({repoId: ctx.repository.id});
            }
            if (ctx.atRevisionRef && (ctx.atRevisionRef.type.id === 'branch' || ctx.atRevisionRef.type.id === 'tag')) {
            urlBuilder = urlBuilder.withParams({branchFrom: ctx.atRevisionRef.id});
            }
            return urlBuilder.build();
            }
        ), ctx); },'linkText':WebFragments._formatI18n("Create branch from here", 'stash.branch.actions.create', '')});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:zero-clipboard', location = '/static/lib/zero-clipboard/ZeroClipboard.js' */
/*
 * zeroclipboard
 * The Zero Clipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie, and a JavaScript interface.
 * Copyright 2012 Jon Rohan, James M. Greene, .
 * Released under the MIT license
 * http://jonrohan.github.com/ZeroClipboard/
 * v1.1.7
 */
(function(){var M=function(S,U){var T=S.style[U];if(S.currentStyle){T=S.currentStyle[U]}else{if(window.getComputedStyle){T=document.defaultView.getComputedStyle(S,null).getPropertyValue(U)}}if(T=="auto"&&U=="cursor"){var Q=["a"];for(var R=0;R<Q.length;R++){if(S.tagName.toLowerCase()==Q[R]){return"pointer"}}}return T};var I=function(Q){if(!G.prototype._singleton){return }if(!Q){Q=window.event}var R;if(this!==window){R=this}else{if(Q.target){R=Q.target}else{if(Q.srcElement){R=Q.srcElement}}}G.prototype._singleton.setCurrent(R)};var J=function(Q,S,R){if(Q.addEventListener){Q.addEventListener(S,R,false)}else{if(Q.attachEvent){Q.attachEvent("on"+S,R)}}};var H=function(Q,S,R){if(Q.removeEventListener){Q.removeEventListener(S,R,false)}else{if(Q.detachEvent){Q.detachEvent("on"+S,R)}}};var L=function(R,T){if(R.addClass){R.addClass(T);return R}if(T&&typeof T==="string"){var V=(T||"").split(/\s+/);if(R.nodeType===1){if(!R.className){R.className=T}else{var S=" "+R.className+" ",U=R.className;for(var W=0,Q=V.length;W<Q;W++){if(S.indexOf(" "+V[W]+" ")<0){U+=" "+V[W]}}R.className=U.replace(/^\s+|\s+$/g,"")}}}return R};var A=function(R,T){if(R.removeClass){R.removeClass(T);return R}if(T&&typeof T==="string"||T===undefined){var U=(T||"").split(/\s+/);if(R.nodeType===1&&R.className){if(T){var S=(" "+R.className+" ").replace(/[\n\t]/g," ");for(var V=0,Q=U.length;V<Q;V++){S=S.replace(" "+U[V]+" "," ")}R.className=S.replace(/^\s+|\s+$/g,"")}else{R.className=""}}}return R};var B=function(U){var T={left:0,top:0,width:U.width||U.offsetWidth||0,height:U.height||U.offsetHeight||0,zIndex:9999};var R=M(U,"zIndex");if(R&&R!="auto"){T.zIndex=parseInt(R,10)}while(U){var Q=parseInt(M(U,"borderLeftWidth"),10);var S=parseInt(M(U,"borderTopWidth"),10);T.left+=isNaN(U.offsetLeft)?0:U.offsetLeft;T.left+=isNaN(Q)?0:Q;T.top+=isNaN(U.offsetTop)?0:U.offsetTop;T.top+=isNaN(S)?0:S;U=U.offsetParent}return T};var K=function(Q){return(Q.indexOf("?")>=0?"&":"?")+"nocache="+(new Date).getTime()};var D=function(Q){var R=[];if(Q.trustedDomains){if(typeof Q.trustedDomains==="string"){R.push("trustedDomain="+Q.trustedDomains)}else{R.push("trustedDomain="+Q.trustedDomains.join(","))}}return R.join("&")};var O=function(S,T){if(T.indexOf){return T.indexOf(S)}for(var Q=0,R=T.length;Q<R;Q++){if(T[Q]===S){return Q}}return -1};var P=function(Q){if(typeof Q==="string"){throw new TypeError("ZeroClipboard doesn't accept query strings.")}if(!Q.length){return[Q]}return Q};var G=function(T,S){if(T){(G.prototype._singleton||this).glue(T)}if(G.prototype._singleton){return G.prototype._singleton}G.prototype._singleton=this;this.options={};for(var R in E){this.options[R]=E[R]}for(var Q in S){this.options[Q]=S[Q]}this.handlers={};if(G.detectFlashSupport()){N()}};var F,C=[];G.prototype.setCurrent=function(Q){F=Q;this.reposition();if(Q.getAttribute("title")){this.setTitle(Q.getAttribute("title"))}this.setHandCursor(M(Q,"cursor")=="pointer")};G.prototype.setText=function(Q){if(Q&&Q!==""){this.options.text=Q;if(this.ready()){this.flashBridge.setText(Q)}}};G.prototype.setTitle=function(Q){if(Q&&Q!==""){this.htmlBridge.setAttribute("title",Q)}};G.prototype.setSize=function(R,Q){if(this.ready()){this.flashBridge.setSize(R,Q)}};G.prototype.setHandCursor=function(Q){if(this.ready()){this.flashBridge.setHandCursor(Q)}};G.version="1.1.7";var E={moviePath:"ZeroClipboard.swf",trustedDomains:null,text:null,hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",allowScriptAccess:"sameDomain"};G.setDefaults=function(R){for(var Q in R){E[Q]=R[Q]}};G.destroy=function(){G.prototype._singleton.unglue(C);var Q=G.prototype._singleton.htmlBridge;Q.parentNode.removeChild(Q);delete G.prototype._singleton};G.detectFlashSupport=function(){var Q=false;try{if(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")){Q=true}}catch(R){if(navigator.mimeTypes["application/x-shockwave-flash"]){Q=true}}return Q};var N=function(){var R=G.prototype._singleton;var Q=document.getElementById("global-zeroclipboard-html-bridge");if(!Q){var S='      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%">         <param name="movie" value="'+R.options.moviePath+'"/>         <param name="allowScriptAccess" value="'+R.options.allowScriptAccess+'"/>         <param name="scale" value="exactfit"/>         <param name="loop" value="false"/>         <param name="menu" value="false"/>         <param name="quality" value="best" />         <param name="bgcolor" value="#ffffff"/>         <param name="wmode" value="transparent"/>         <param name="flashvars" value="'+D(R.options)+'"/>         <embed src="'+R.options.moviePath+'"           loop="false" menu="false"           quality="best" bgcolor="#ffffff"           width="100%" height="100%"           name="global-zeroclipboard-flash-bridge"           allowScriptAccess="always"           allowFullScreen="false"           type="application/x-shockwave-flash"           wmode="transparent"           pluginspage="http://www.macromedia.com/go/getflashplayer"           flashvars="'+D(R.options)+'"           scale="exactfit">         </embed>       </object>';Q=document.createElement("div");Q.id="global-zeroclipboard-html-bridge";Q.setAttribute("class","global-zeroclipboard-container");Q.setAttribute("data-clipboard-ready",false);Q.style.position="absolute";Q.style.left="-9999px";Q.style.top="-9999px";Q.style.width="15px";Q.style.height="15px";Q.style.zIndex="9999";Q.innerHTML=S;document.body.appendChild(Q)}R.htmlBridge=Q;R.flashBridge=document["global-zeroclipboard-flash-bridge"]||Q.children[0].lastElementChild};G.prototype.resetBridge=function(){this.htmlBridge.style.left="-9999px";this.htmlBridge.style.top="-9999px";this.htmlBridge.removeAttribute("title");this.htmlBridge.removeAttribute("data-clipboard-text");A(F,this.options.activeClass);F=null;this.options.text=null};G.prototype.ready=function(){var Q=this.htmlBridge.getAttribute("data-clipboard-ready");return Q==="true"||Q===true};G.prototype.reposition=function(){if(!F){return false}var Q=B(F);this.htmlBridge.style.top=Q.top+"px";this.htmlBridge.style.left=Q.left+"px";this.htmlBridge.style.width=Q.width+"px";this.htmlBridge.style.height=Q.height+"px";this.htmlBridge.style.zIndex=Q.zIndex+1;this.setSize(Q.width,Q.height)};G.dispatch=function(Q,R){G.prototype._singleton.receiveEvent(Q,R)};G.prototype.on=function(Q,T){var S=Q.toString().split(/\s/g);for(var R=0;R<S.length;R++){Q=S[R].toLowerCase().replace(/^on/,"");if(!this.handlers[Q]){this.handlers[Q]=T}}if(this.handlers.noflash&&!G.detectFlashSupport()){this.receiveEvent("onNoFlash",null)}};G.prototype.addEventListener=G.prototype.on;G.prototype.off=function(Q,U){var S=Q.toString().split(/\s/g);for(var R=0;R<S.length;R++){Q=S[R].toLowerCase().replace(/^on/,"");for(var T in this.handlers){if(T===Q&&this.handlers[T]===U){delete this.handlers[T]}}}};G.prototype.removeEventListener=G.prototype.off;G.prototype.receiveEvent=function(Q,T){Q=Q.toString().toLowerCase().replace(/^on/,"");var U=F;switch(Q){case"load":if(T&&parseFloat(T.flashVersion.replace(",",".").replace(/[^0-9\.]/gi,""))<10){this.receiveEvent("onWrongFlash",{flashVersion:T.flashVersion});return }this.htmlBridge.setAttribute("data-clipboard-ready",true);break;case"mouseover":L(U,this.options.hoverClass);break;case"mouseout":A(U,this.options.hoverClass);this.resetBridge();break;case"mousedown":L(U,this.options.activeClass);break;case"mouseup":A(U,this.options.activeClass);break;case"datarequested":var S=U.getAttribute("data-clipboard-target"),X=!S?null:document.getElementById(S);if(X){var W=X.value||X.textContent||X.innerText;if(W){this.setText(W)}}else{var R=U.getAttribute("data-clipboard-text");if(R){this.setText(R)}}break;case"complete":this.options.text=null;break}if(this.handlers[Q]){var V=this.handlers[Q];if(typeof V=="function"){V.call(U,this,T)}else{if(typeof V=="string"){window[V].call(U,this,T)}}}};G.prototype.glue=function(R){R=P(R);for(var Q=0;Q<R.length;Q++){if(O(R[Q],C)==-1){C.push(R[Q]);J(R[Q],"mouseover",I)}}};G.prototype.unglue=function(S){S=P(S);for(var R=0;R<S.length;R++){H(S[R],"mouseover",I);var Q=O(S[R],C);if(Q!=-1){C.splice(Q,1)}}};if(typeof module!=="undefined"){module.exports=G}else{if(typeof define==="function"&&define.amd){define(function(){return G})}else{window.ZeroClipboard=G}}})();;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:zero-clipboard', location = '/static/lib/zero-clipboard/ZeroClipboard-AMD.js' */
define("zero-clipboard",["aui"],function(B){var A=window.ZeroClipboard;A.setDefaults({moviePath:B.contextPath()+"/s/"+A.version+"/_/download/resources/com.atlassian.stash.stash-web-plugin:zero-clipboard/ZeroClipboard.swf",useNoCache:false});return A});require("zero-clipboard");;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:notifications-center', location = '/static/widget/notifications-center/notifications-center.soy' */
// This file was automatically generated from notifications-center.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.notifications.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }
if (typeof stash.widget.notifications == 'undefined') { stash.widget.notifications = {}; }


stash.widget.notifications.center = function(opt_data, opt_ignored) {
  return '<div id="notifications-center"></div>';
};
if (goog.DEBUG) {
  stash.widget.notifications.center.soyTemplateName = 'stash.widget.notifications.center';
}


stash.widget.notifications.notification = function(opt_data, opt_ignored) {
  return '<div class="status-notification">' + soy.$$escapeHtml(opt_data.message) + '</div>';
};
if (goog.DEBUG) {
  stash.widget.notifications.notification.soyTemplateName = 'stash.widget.notifications.notification';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:notifications-center', location = '/static/widget/notifications-center/notifications-center.js' */
define("widget/notifications-center",["jquery","util/navigator","exports"],function(E,C,B){var F;function A(){if(F){return F}F=E(stash.widget.notifications.center()).appendTo("body");return F}function D(G){var H=E(stash.widget.notifications.notification({message:G}));A().prepend(H);if(C.isIE()&&C.majorVersion()<=9){H.fadeIn(function(){window.setTimeout(function(){H.fadeOut(function(){H.remove()})},1500)})}H.on("animationend webkitAnimationEnd MSAnimationEnd oanimationend",function(){H.remove()});return H}B.showNotification=D});;
;/* module-key = 'com.atlassian.stash.stash-branch-utils:branch-copy', location = '/static/branch-copy/feature/branch-copy.js' */
define("feature/branch/branch-copy",["aui","jquery","lodash","zero-clipboard","util/navigator","widget/notifications-center","widget/quick-copy-text","exports"],function(i,e,j,f,h,k,c,d){c.onReady();function b(l){var m=i.dialog2(aui.dialog.dialog2({titleText:"Copy branch name",content:stash.feature.branchCopy.dialogContent({branchName:l,flashSupported:f.detectFlashSupport()}),footerHintText:i.format("{0} to copy the branch name to your clipboard",h.isMac()?"⌘ + c":"Ctrl + c"),removeOnHide:true})).show();m.$el.find("form").on("submit",function(n){n.preventDefault()});m.$el.find("#branch-copy-field").on("copy",function(){j.defer(function(){m.hide()});k.showNotification("Branch name has been copied")}).focus().select()}function a(){e("#global-zeroclipboard-html-bridge").css({top:"-9999px",left:"-9999px"})}function g(q,n,p){var o;var l;var m=function(r,s){r.setText(l)};e(document).on("aui-dropdown2-show",n,function(){var r=e(this);var s=e(q);l=p(r);var t=function(u){u.preventDefault();b(l)};s.on("click",t);r.on("aui-dropdown2-hide",function(){s.off("click",t)});if(o){o.off("dataRequested",m)}if(f.detectFlashSupport()){o=new f(s,{forceHandCursor:true});o.on("dataRequested",m);o.on("complete",function(u,v){a();k.showNotification("Branch name has been copied")})}})}d.bindToDropdownLink=g});;
;/* module-key = 'com.atlassian.stash.stash-branch-utils:branch-copy', location = '/static/branch-copy/feature/branch-copy.soy' */
// This file was automatically generated from branch-copy.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.branchCopy.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.branchCopy == 'undefined') { stash.feature.branchCopy = {}; }


stash.feature.branchCopy.dialogContent = function(opt_data, opt_ignored) {
  return '' + ((! opt_data.flashSupported) ? '<p class="install-flash-message">' + soy.$$filterNoAutoescape(AJS.format("Install {0}Adobe Flash{1} to automatically copy the branch name to your clipboard.",'<a href="http://get.adobe.com/flashplayer/" target="_blank">','</a>')) + '</p>' : '') + aui.form.form({content: '' + widget.aui.form.text({id: 'branch-copy-field', labelContent: '' + soy.$$escapeHtml("Branch name"), extraClasses: 'quick-copy-text', initialValue: opt_data.branchName, autofocus: true, readonly: true}), action: ''});
};
if (goog.DEBUG) {
  stash.feature.branchCopy.dialogContent.soyTemplateName = 'stash.feature.branchCopy.dialogContent';
}
;
;/* module-key = 'com.atlassian.stash.stash-branch-utils:branch-copy-branch-layout', location = '/static/branch-copy/branch-layout-copy.js' */
define("feature/branch/branch-selector-copy",["model/page-state","feature/branch/branch-copy","exports"],function(b,c,a){a.onReady=function(){c.bindToDropdownLink(".copy-branch-name","#branch-actions-menu",function(){return b.getRevisionRef().getDisplayId()})}});jQuery(document).ready(function(){require("feature/branch/branch-selector-copy").onReady()});;
;/* module-key = 'com.atlassian.stash.stash-branch-utils:copy-branch-action', location = '/web-fragment-placeholder.config' */
WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-branch-utils','key':'copy-branch-action','moduleKey':'copy-branch-action','completeModuleKey':'com.atlassian.stash.stash-branch-utils:copy-branch-action','weight':15.0,'condition':function(ctx) { return WebFragments._getValue((function(ctx) { return ctx.atRevisionRef.type.id === 'branch'}), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'copy-branch-name'),'location':'stash.branch.layout.actions.dropdown','linkText':WebFragments._formatI18n("Copy branch name", 'stash.branch.actions.copybranch', '')});;
;/* module-key = 'com.atlassian.stash.stash-compare-plugin:compare-branch-action', location = '/web-fragment-placeholder.config' */
WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-compare-plugin','key':'compare-branch-action','moduleKey':'compare-branch-action','completeModuleKey':'com.atlassian.stash.stash-compare-plugin:compare-branch-action','weight':10.0,'condition':function(ctx) { return WebFragments._getValue((function(ctx) { return ctx.atRevisionRef.type.id === 'branch'}), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'compare-branch-action'),'location':'stash.branch.layout.actions.dropdown','url':function(ctx) { return WebFragments._getValue((
            function(ctx) {
            return require('stash/api/util/navbuilder').project(ctx.repository.project).repo(ctx.repository).compare()
            .sourceBranch(ctx.atRevisionRef.id).build();
            }
        ), ctx); },'linkText':WebFragments._formatI18n("Compare", 'stash.web.repository.branch.actions.compare', '')});;
;/* module-key = 'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-checkout', location = '/static/sourcetree-checkout/sourcetree-checkout.js' */
define("plugin/sourcetree/sourcetree-checkout",["jquery","aui","model/page-state","util/events","util/navbuilder","exports"],function(d,a,h,j,e,b){var g=navigator.platform.indexOf("Mac")!==-1;var i;var c=function(k,l){i=l};function f(){return i||e.currentRepo().clone(h.getRepository().getScmId()).buildAbsolute()}b.init=function(){j.on("stash.feature.repository.clone.protocol.changed",c);j.on("stash.feature.repository.clone.protocol.initial",c);d(".sourcetree-checkout").tipsy({gravity:d.fn.tipsy.autoWE,live:true});d(document).on("aui-dropdown2-hide",".aui-dropdown2",function(){d(".sourcetree-checkout").each(function(){d(this).tipsy("hide")})})};b.getSourceTreeCheckoutUrl=function(k){var m="sourcetree://checkoutRef?type=stash&ref="+encodeURIComponent(k.id)+"&baseWebUrl="+encodeURIComponent(window.location.origin+a.contextPath())+"&cloneUrl="+encodeURIComponent(f());var l=h.getCurrentUser();if(l){m=m+"&user="+encodeURIComponent(l.getName())}return m};b.getMinimumSourceTreeVersionTooltip=function(){var k=g?1.7:1.2;return AJS.format("Requires SourceTree v{0}+",k)}});require("plugin/sourcetree/sourcetree-checkout").init();;
;/* module-key = 'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-checkout-action-branch-layout', location = '/web-fragment-placeholder.config' */
WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-sourcetree-plugin','key':'sourcetree-checkout-action-branch-layout','moduleKey':'sourcetree-checkout-action-branch-layout','completeModuleKey':'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-checkout-action-branch-layout','weight':20.0,'params':{},'tooltip':function(ctx) { return WebFragments._getValue((require('plugin/sourcetree/sourcetree-checkout').getMinimumSourceTreeVersionTooltip()), ctx); },'styleClass':WebFragments._formatI18n(null, null, 'sourcetree-checkout'),'location':'stash.branch.layout.actions.dropdown','url':function(ctx) { return WebFragments._getValue((
            function(ctx) {
                return require('plugin/sourcetree/sourcetree-checkout').getSourceTreeCheckoutUrl(ctx.atRevisionRef);
            }
        ), ctx); },'linkText':WebFragments._formatI18n("Check out in SourceTree", 'stash.branch.actions.sourcetree.checkout', '')});;
;/* module-key = 'com.atlassian.stash.stash-branch-utils:copy-commit-action', location = '/web-fragment-placeholder.config' */
WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-branch-utils','key':'copy-commit-action','moduleKey':'copy-commit-action','completeModuleKey':'com.atlassian.stash.stash-branch-utils:copy-commit-action','weight':12.0,'condition':function(ctx) { return WebFragments._getValue((function(ctx) { return ctx.atRevisionRef.type.id === 'commit'}), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'copy-branch-name'),'location':'stash.branch.layout.actions.dropdown','linkText':WebFragments._formatI18n("Copy revision", 'stash.branch.actions.copyrevision', '')});;
;/* module-key = 'com.atlassian.stash.stash-branch-utils:copy-tag-action', location = '/web-fragment-placeholder.config' */
WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-branch-utils','key':'copy-tag-action','moduleKey':'copy-tag-action','completeModuleKey':'com.atlassian.stash.stash-branch-utils:copy-tag-action','weight':11.0,'condition':function(ctx) { return WebFragments._getValue((function(ctx) { return ctx.atRevisionRef.type.id === 'tag'}), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'copy-branch-name'),'location':'stash.branch.layout.actions.dropdown','linkText':WebFragments._formatI18n("Copy tag name", 'stash.branch.actions.copytag', '')});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:web-fragment-templates', location = '/static/widget/web-fragment.soy' */
// This file was automatically generated from web-fragment.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }


stash.widget.webItem = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '<' + soy.$$escapeHtml(opt_data.url || opt_data.forceLink ? 'a' : 'span') + ((opt_data.url) ? ' href="' + soy.$$escapeHtml(opt_data.url) + '"' : '') + ((opt_data.linkId) ? ' id="' + soy.$$escapeHtml(opt_data.linkId) + '"' : '') + ((opt_data.styleClass) ? ' class="' + soy.$$escapeHtml(opt_data.styleClass) + '"' : '') + ((opt_data.tooltip) ? ' title="' + soy.$$escapeHtml(opt_data.tooltip) + '"' : '') + ((opt_data.pluginKey && opt_data.moduleKey) ? ' data-web-item-key="' + soy.$$escapeHtml(opt_data.pluginKey) + ':' + soy.$$escapeHtml(opt_data.moduleKey) + '"' : '') + '>' + ((opt_data.content) ? soy.$$filterNoAutoescape(opt_data.content) : (opt_data.params && opt_data.params['stashIconClass']) ? '<span class="aui-icon ' + soy.$$escapeHtml(opt_data.params['stashIconClass']) + '">' + soy.$$escapeHtml(opt_data.linkText) + '</span>' : soy.$$escapeHtml(opt_data.linkText)) + '</' + soy.$$escapeHtml(opt_data.url || opt_data.forceLink ? 'a' : 'span') + '>';
};
if (goog.DEBUG) {
  stash.widget.webItem.soyTemplateName = 'stash.widget.webItem';
}


stash.widget.webItemButton = function(opt_data, opt_ignored) {
  return '' + stash.buttons.button({buttonText: opt_data.linkText ? opt_data.linkText : '', id: opt_data.linkId, title: opt_data.tooltip, extraClasses: opt_data.styleClass && opt_data.extraClasses ? opt_data.styleClass + ' ' + opt_data.extraClasses : opt_data.styleClass ? opt_data.styleClass : opt_data.extraClasses, href: opt_data.url, iconType: opt_data.params['stashIconClass'] ? 'custom' : '', iconClass: opt_data.params['stashIconClass'], iconText: ! opt_data.linkText ? opt_data.tooltip : ''});
};
if (goog.DEBUG) {
  stash.widget.webItemButton.soyTemplateName = 'stash.widget.webItemButton';
}


stash.widget.webItemtabMenuItem = function(opt_data, opt_ignored) {
  return '' + widget.aui.tabMenuItem({id: opt_data.linkId, tooltip: opt_data.tooltip, text: opt_data.linkText, url: opt_data.url, extraClasses: opt_data.styleClass, isActive: opt_data.isActive});
};
if (goog.DEBUG) {
  stash.widget.webItemtabMenuItem.soyTemplateName = 'stash.widget.webItemtabMenuItem';
}


stash.widget.webItemDropdownItem = function(opt_data, opt_ignored) {
  return '' + stash.widget.webItem(soy.$$augmentMap(opt_data, {forceLink: true}));
};
if (goog.DEBUG) {
  stash.widget.webItemDropdownItem.soyTemplateName = 'stash.widget.webItemDropdownItem';
}


stash.widget.webFragmentButtons = function(opt_data, opt_ignored) {
  var output = '';
  var webFragmentList70 = opt_data.isReverse ? WebFragments.getWebFragments(opt_data.location,opt_data.context).reverse() : WebFragments.getWebFragments(opt_data.location,opt_data.context);
  var webFragmentListLen70 = webFragmentList70.length;
  for (var webFragmentIndex70 = 0; webFragmentIndex70 < webFragmentListLen70; webFragmentIndex70++) {
    var webFragmentData70 = webFragmentList70[webFragmentIndex70];
    switch (webFragmentData70.type) {
      case 'ITEM':
        output += stash.buttons.buttons({content: '' + stash.widget.webItemButton(webFragmentData70)});
        break;
      case 'SECTION':
        var param78 = '';
        var webItemList79 = opt_data.isReverse ? WebFragments.getWebItems(opt_data.location + '/' + webFragmentData70.key,opt_data.context).reverse() : WebFragments.getWebItems(opt_data.location + '/' + webFragmentData70.key,opt_data.context);
        var webItemListLen79 = webItemList79.length;
        for (var webItemIndex79 = 0; webItemIndex79 < webItemListLen79; webItemIndex79++) {
          var webItemData79 = webItemList79[webItemIndex79];
          param78 += stash.widget.webItemButton(webItemData79);
        }
        output += stash.buttons.buttons({extraClasses: webFragmentData70.styleClass, content: param78});
        break;
    }
  }
  return output;
};
if (goog.DEBUG) {
  stash.widget.webFragmentButtons.soyTemplateName = 'stash.widget.webFragmentButtons';
}


stash.widget.webItemTabs = function(opt_data, opt_ignored) {
  var param85 = '' + ((opt_data.tabItemsContent) ? soy.$$filterNoAutoescape(opt_data.tabItemsContent) : '');
  var itemList90 = opt_data.webItems ? opt_data.webItems : WebFragments.getWebItems(opt_data.location,opt_data.context ? opt_data.context : null);
  var itemListLen90 = itemList90.length;
  for (var itemIndex90 = 0; itemIndex90 < itemListLen90; itemIndex90++) {
    var itemData90 = itemList90[itemIndex90];
    var param98 = '';
    var subPanelList99 = WebFragments.getWebPanels(itemData90.moduleKey + '.meta',opt_data.context ? opt_data.context : null).map(function(webPanel) { return soydata.VERY_UNSAFE.ordainSanitizedHtml(webPanel); });
    var subPanelListLen99 = subPanelList99.length;
    for (var subPanelIndex99 = 0; subPanelIndex99 < subPanelListLen99; subPanelIndex99++) {
      var subPanelData99 = subPanelList99[subPanelIndex99];
      param98 += soy.$$escapeHtml(subPanelData99);
    }
    param85 += widget.aui.tabMenuItem({url: itemData90.url, text: itemData90.linkText, id: itemData90.linkId, extraLinkClasses: itemData90.styleClass, tooltip: itemData90.tooltip, isActive: opt_data.showFirstTab ? itemIndex90 == 0 : opt_data.activeTab ? itemData90.moduleKey == opt_data.activeTab : false, extraAttributes: {'data-module-key': itemData90.moduleKey}, extraLinkContent: param98});
  }
  var output = '' + widget.aui.tabChrome(soy.$$augmentMap(opt_data, {tabItemsContent: param85}));
  return output;
};
if (goog.DEBUG) {
  stash.widget.webItemTabs.soyTemplateName = 'stash.widget.webItemTabs';
}


stash.widget.sidebarWebFragmentNavigation = function(opt_data, opt_ignored) {
  var output = '';
  if (opt_data.primaryNavContent || opt_data.secondaryNavContent || opt_data.webFragments.length > 0) {
    var param112 = '<ul class="aui-nav">' + ((opt_data.primaryNavContent) ? soy.$$filterNoAutoescape(opt_data.primaryNavContent) : '');
    var fragmentList118 = opt_data.webFragments;
    var fragmentListLen118 = fragmentList118.length;
    for (var fragmentIndex118 = 0; fragmentIndex118 < fragmentListLen118; fragmentIndex118++) {
      var fragmentData118 = fragmentList118[fragmentIndex118];
      param112 += (fragmentData118.type == 'ITEM') ? stash.widget.sidebarNavItemWebItem({context: opt_data.context, isActive: fragmentData118.moduleKey == opt_data.activeNavItem, isTierOne: opt_data.isTierOne, webItem: fragmentData118}) : (fragmentData118.type == 'SECTION') ? stash.widget.sidebarNavWebSection({activeNavItem: opt_data.activeNavItem, context: opt_data.context, fragment: fragmentData118, isTierOne: opt_data.isTierOne}) : '';
    }
    param112 += '</ul>';
    output += widget.aui.sidebarNavGroup({extraClasses: opt_data.extraClasses, isTierOne: opt_data.isTierOne, isActions: opt_data.isActions, title: opt_data.title, navContent: param112, secondaryNavContent: '' + ((opt_data.secondaryNavContent) ? '<ul class="aui-nav">' + soy.$$filterNoAutoescape(opt_data.secondaryNavContent) + '</ul>' : '')});
  }
  return output;
};
if (goog.DEBUG) {
  stash.widget.sidebarWebFragmentNavigation.soyTemplateName = 'stash.widget.sidebarWebFragmentNavigation';
}


stash.widget.sidebarNavWebSection = function(opt_data, opt_ignored) {
  return '' + stash.widget.sidebarNavSectionWithItems({activeNavItem: opt_data.activeNavItem, context: opt_data.context, heading: opt_data.fragment.labelText, isTierOne: opt_data.isTierOne, webItems: WebFragments.getWebItems(opt_data.fragment.location + '/' + opt_data.fragment.key,opt_data.context ? opt_data.context : null)});
};
if (goog.DEBUG) {
  stash.widget.sidebarNavWebSection.soyTemplateName = 'stash.widget.sidebarNavWebSection';
}


stash.widget.sidebarNavSectionWithItems = function(opt_data, opt_ignored) {
  var output = '';
  if (opt_data.webItems.length) {
    output += widget.aui.navHeading({text: opt_data.heading}) + '<ul class="aui-nav">';
    var webItemList155 = opt_data.webItems;
    var webItemListLen155 = webItemList155.length;
    for (var webItemIndex155 = 0; webItemIndex155 < webItemListLen155; webItemIndex155++) {
      var webItemData155 = webItemList155[webItemIndex155];
      output += stash.widget.sidebarNavItemWebItem({context: opt_data.context, isActive: webItemData155.moduleKey == opt_data.activeNavItem || webItemData155.linkId == opt_data.activeNavItem, isTierOne: opt_data.isTierOne, webItem: webItemData155});
    }
    output += '</ul>';
  }
  return output;
};
if (goog.DEBUG) {
  stash.widget.sidebarNavSectionWithItems.soyTemplateName = 'stash.widget.sidebarNavSectionWithItems';
}


stash.widget.sidebarNavItemWebItem = function(opt_data, opt_ignored) {
  var param172 = '';
  if (opt_data.webItem.moduleKey) {
    var badgeContentList175 = WebFragments.getWebPanels(opt_data.webItem.moduleKey + '.badge',opt_data.context ? opt_data.context : null).map(function(webPanel) { return soydata.VERY_UNSAFE.ordainSanitizedHtml(webPanel); });
    var badgeContentListLen175 = badgeContentList175.length;
    for (var badgeContentIndex175 = 0; badgeContentIndex175 < badgeContentListLen175; badgeContentIndex175++) {
      var badgeContentData175 = badgeContentList175[badgeContentIndex175];
      param172 += ' ' + soy.$$escapeHtml(badgeContentData175);
    }
  }
  var output = '' + widget.aui.sidebarNavItem({extraClasses: opt_data.webItem.styleClass, iconClass: opt_data.webItem.params['stashIconClass'], id: opt_data.webItem.linkId, isActive: opt_data.isActive, isTierOne: opt_data.isTierOne, text: opt_data.webItem.linkText, tooltip: opt_data.webItem.tooltip, url: opt_data.webItem.url, badgeContent: param172});
  return output;
};
if (goog.DEBUG) {
  stash.widget.sidebarNavItemWebItem.soyTemplateName = 'stash.widget.sidebarNavItemWebItem';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:branch-layout', location = '/static/layout/branch/branch.js' */
define("layout/branch",["jquery","lodash","stash/api/util/navbuilder","util/events","model/page-state","model/revision-reference","feature/repository/revision-reference-selector","exports"],function(F,C,H,E,D,G,B,A){A.onReady=function(I,J){J=J||"at";var L=function(M){M=B.prototype._addRefTypeAndRepositoryToResults.call(this,M);var N=H.parse(window.location.href);C.each(M.values,function(P){if(!P.url){var O=N.clone();O.replaceQueryParam(J,P.id);P.url=O.query()+(O.anchor()?O.anchor():"")}});return M};var K=new B(F(I),{id:"repository-layout-revision-selector-dialog",dataTransform:L});D.setRevisionRef(K.getSelectedItem());E.on("stash.feature.repository.revisionReferenceSelector.revisionRefChanged",function(M){if(this===K){E.trigger("stash.layout.branch.revisionRefChanged",this,M);D.setRevisionRef(K.getSelectedItem())}});E.on("stash.page.*.revisionRefChanged",function(M){K.setSelectedItem(G.hydrateDeprecated(M))});E.on("stash.widget.keyboard-shortcuts.register-contexts",function(M){M.enableContext("branch")});F("#branch-actions-menu").on("aui-dropdown2-show",function(){E.trigger("stash.layout.branch.actions.dropdownShown");F("#branch-actions").focus();F(this).html(stash.layout.branch.actionsDropdownMenu({repository:D.getRepository().toJSON(),atRevisionRef:D.getRevisionRef().toJSON()}))}).on("aui-dropdown2-hide",function(){E.trigger("stash.layout.branch.actions.dropdownHidden")})}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:branch-layout', location = '/static/layout/branch/branch-actions-clientside.soy' */
// This file was automatically generated from branch-actions-clientside.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.layout.branch.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.layout == 'undefined') { stash.layout = {}; }
if (typeof stash.layout.branch == 'undefined') { stash.layout.branch = {}; }


stash.layout.branch.actionsDropdownMenu = function(opt_data, opt_ignored) {
  var output = '<ul>';
  var webItemList4 = WebFragments.getWebItems('stash.branch.layout.actions.dropdown',{repository: opt_data.repository, atRevisionRef: opt_data.atRevisionRef});
  var webItemListLen4 = webItemList4.length;
  for (var webItemIndex4 = 0; webItemIndex4 < webItemListLen4; webItemIndex4++) {
    var webItemData4 = webItemList4[webItemIndex4];
    output += '<li class="branch-action-item">' + stash.widget.webItem(soy.$$augmentMap(webItemData4, {url: webItemData4.url ? webItemData4.url : '#'})) + '</li>';
  }
  output += '</ul>';
  return output;
};
if (goog.DEBUG) {
  stash.layout.branch.actionsDropdownMenu.soyTemplateName = 'stash.layout.branch.actionsDropdownMenu';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:paragraph', location = '/static/widget/paragraph.soy' */
// This file was automatically generated from paragraph.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }


stash.widget.paragraph = function(opt_data, opt_ignored) {
  return '<p' + ((opt_data.extraClasses) ? ' class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + '>' + soy.$$escapeHtml(opt_data.text) + '</p>';
};
if (goog.DEBUG) {
  stash.widget.paragraph.soyTemplateName = 'stash.widget.paragraph';
}
;
;/* module-key = 'com.atlassian.stash.stash-branch-utils:branch-creation-oncreated', location = '/static/branch-creation/branch-oncreated-discovery.js' */
jQuery(document).ready(function(){require(["aui","chaperone","util/client-storage","util/events"],function(b,e,a,c){function f(){var g=a.getFlashItem("stash.branch.created");return g+(30*1000)>new Date().getTime()}function d(){e.registerFeature("branch-created-actions-discovery",[{id:"action-discovery",selector:"#branch-actions",title:"Working with your new branch",content:stash.widget.paragraph({text:"Now that you\u0027ve created a new branch you can start development on it. Find branch-related actions in this menu."}),once:true}])}c.on("stash.feature.branch-creation.branchCreated",function(){a.setFlashItem("stash.branch.created",new Date().getTime())});if(f()){d()}})});;
;/* module-key = 'com.atlassian.stash.stash-repository-ref-sync:ref-sync-common', location = '/static/feature/sync/common/ref-sync-common.js' */
define("feature/sync/common/ref-sync-common",["stash/api/util/navbuilder","stash/api/util/server","exports"],function(e,c,a){function b(f){return c.rest({url:e.rest("sync").currentRepo().build(),type:"POST",data:{enabled:f}})}function d(){return e.rest("sync").currentRepo().addPathComponents("synchronize").build()}a.enableRefSyncing=b;a.getSyncUrl=d});;
;/* module-key = 'com.atlassian.stash.stash-repository-ref-sync:ref-sync-banner', location = '/static/feature/sync/banner/ref-sync-banner.js' */
define("feature/sync/banner/ref-sync-banner",["jquery","util/promise","feature/sync/common/ref-sync-common","exports"],function(c,b,d,a){a.onReady=function(){c("#disable-ref-sync").click(function(){b.spinner(c('<div class="spinner"></div>').insertAfter("#disable-ref-sync"),d.enableRefSyncing(false).done(function(){c("#ref-sync-banner").remove()}))})}});jQuery(function(){require("feature/sync/banner/ref-sync-banner").onReady()});;
;/* module-key = 'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-button-panel', location = '/static/button-panel/sourcetree-button-panel.soy' */
// This file was automatically generated from sourcetree-button-panel.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.sourceTree.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.sourceTree == 'undefined') { stash.sourceTree = {}; }


stash.sourceTree.buttonPanel = function(opt_data, opt_ignored) {
  return '<div class="sourcetree-panel">' + stash.buttons.button({buttonText: opt_data.buttonText, id: opt_data.buttonId, extraClasses: 'sourcetree-button', href: opt_data.sourceTreeActionUrl, isPrimary: true}) + ((opt_data.minVersion) ? '<div class="min-version">' + soy.$$escapeHtml(AJS.format("Requires version {0}+",opt_data.minVersion)) + '</div>' : '') + '<p>' + soy.$$filterNoAutoescape(AJS.format("{0} is the free Git and Mercurial client for Windows or Mac.",'<a href="http://www.sourcetreeapp.com" target="_blank">Atlassian SourceTree</a>')) + '</p></div>';
};
if (goog.DEBUG) {
  stash.sourceTree.buttonPanel.soyTemplateName = 'stash.sourceTree.buttonPanel';
}
;
;/* module-key = 'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-clone', location = '/static/sourcetree-clone/sourcetree-clone.js' */
define("plugin/sourcetree/sourcetree-clone",["jquery","aui","util/events","util/navbuilder","model/page-state","exports"],function(c,a,i,d,g,b){var e=navigator.platform.indexOf("Mac")!==-1;var h=function(l,m){var k=g.getCurrentUser();var j="sourcetree://cloneRepo?type=stash&baseWebUrl="+encodeURIComponent(window.location.origin+a.contextPath())+"&cloneUrl="+encodeURIComponent(m);if(k){j=j+"&user="+encodeURIComponent(k.getName())}c("#sourcetree-clone-button").attr("href",j)};var f=function(){var k=e?1.7:1.2;var j="<div class='min-version'>"+AJS.format("Requires SourceTree v{0}+",k)+"</div>";c("#sourcetree-clone-button").after(j)};b.onReady=function(){a.$(document).ready(f);i.on("stash.feature.repository.clone.protocol.changed",h);i.on("stash.feature.repository.clone.protocol.initial",h)}});require("plugin/sourcetree/sourcetree-clone").onReady();;
;/* module-key = 'com.atlassian.stash.plugin.stash-archive:archive-resources', location = '/static/archive.js' */
define("plugin/download-archive",["jquery","aui","model/page-state","util/navbuilder","exports"],function(d,b,c,e,a){a.onReady=function(g){var i=d(g);var h=function(j){i.attr("href",b.contextPath()+"/plugins/servlet/archive/projects/"+encodeURIComponent(c.getProject().getKey())+"/repos/"+encodeURIComponent(c.getRepository().getSlug())+(j?"?at="+encodeURIComponent(j):""))};var f=c.getRevisionRef()?c.getRevisionRef().id:null;h(f);eve.on("stash.feature.repository.revisionReferenceSelector.revisionRefChanged",function(j,k){h(j.id)})}});AJS.$(function(){require("plugin/download-archive").onReady("#download-archive-button")});;
;/* module-key = 'com.atlassian.analytics.analytics-client:js-events', location = 'js/store-1.3.1.js' */
(function(){var l={},h=window,k=h.document,c="localStorage",n="globalStorage",d="__storejs__",g;l.disabled=false;l.set=function(e,o){};l.get=function(e){};l.remove=function(e){};l.clear=function(){};l.transact=function(e,o){var p=l.get(e);if(typeof p=="undefined"){p={}}o(p);l.set(e,p)};l.serialize=function(e){return JSON.stringify(e)};l.deserialize=function(e){if(typeof e!="string"){return undefined}return JSON.parse(e)};function b(){try{return(c in h&&h[c])}catch(e){return false}}function m(){try{return(n in h&&h[n]&&h[n][h.location.hostname])}catch(e){return false}}if(b()){g=h[c];l.set=function(e,o){if(o===undefined){return l.remove(e)}g.setItem(e,l.serialize(o))};l.get=function(e){return l.deserialize(g.getItem(e))};l.remove=function(e){g.removeItem(e)};l.clear=function(){g.clear()}}else{if(m()){g=h[n][h.location.hostname];l.set=function(e,o){if(o===undefined){return l.remove(e)}g[e]=l.serialize(o)};l.get=function(e){return l.deserialize(g[e]&&g[e].value)};l.remove=function(e){delete g[e]};l.clear=function(){for(var e in g){delete g[e]}}}else{if(k.documentElement.addBehavior){var j,f;try{f=new ActiveXObject("htmlfile");f.open();f.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></frame>');f.close();j=f.w.frames[0].document;g=j.createElement("div")}catch(i){g=k.createElement("div");j=k.body}function a(e){return function(){var p=Array.prototype.slice.call(arguments,0);p.unshift(g);j.appendChild(g);g.addBehavior("#default#userData");g.load(c);var o=e.apply(l,p);j.removeChild(g);return o}}l.set=a(function(p,e,o){if(o===undefined){return l.remove(e)}p.setAttribute(e,l.serialize(o));p.save(c)});l.get=a(function(o,e){return l.deserialize(o.getAttribute(e))});l.remove=a(function(o,e){o.removeAttribute(e);o.save(c)});l.clear=a(function(q){var o=q.XMLDocument.documentElement.attributes;q.load(c);for(var p=0,e;e=o[p];p++){q.removeAttribute(e.name)}q.save(c)})}}}try{l.set(d,d);if(l.get(d)!=d){l.disabled=true}l.remove(d)}catch(i){l.disabled=true}if(typeof module!="undefined"){module.exports=l}else{if(typeof define==="function"&&define.amd){define(l)}else{this.store=l}}})();;
;/* module-key = 'com.atlassian.analytics.analytics-client:js-events', location = 'js/atlassian-analytics.js' */
(function(b){var m=AJS.$.ajax;var h="atlassian-analytics";var g=typeof AJS.contextPath=="function"?AJS.contextPath():typeof AJS.Confluence!="undefined"?AJS.Confluence.getContextPath():window.contextPath!=null?window.contextPath:"";var l=null;var i=null;var d=null;var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(u){var t=Math.random()*16|0,s=u=="x"?t:(t&3|8);return s.toString(16)});var p=function(){var s="unknown";if(document.body.id=="jira"){s="jira"}else{if(document.body.id=="com-atlassian-confluence"){s="confluence"}}i=h+"."+s;d=i+".lock"};var c=function(){if(store.get(d)){return false}store.set(d,n);return(store.get(d)===n)};var q=function(){store.set(d,null)};var f=function(){var t=[],v,w,s,u;if(AJS.EventQueue.length==0){return}t=store.get(i)||t;for(s=0,u=AJS.EventQueue.length;s<u;++s){w=AJS.EventQueue[s];if(w.name){v={name:w.name,properties:w.properties,time:w.time||0};t.push(v)}}AJS.EventQueue.length=0;store.set(i,t)};var e=function(){var t;if(!c()){return}f();t=store.get(i);if(t&&t.length){store.remove(i);q();if(k(t)){var u=new Date().getTime();for(var s=0;s<t.length;s++){if(t[s].time>0){t[s].timeDelta=t[s].time-u}else{t[s].timeDelta=s-t.length}delete t[s].time}l=m({type:"POST",url:g+"/rest/analytics/1.0/publish/bulk",data:JSON.stringify(t),contentType:"application/json",dataType:"json"});l.fail(function(){AJS.EventQueue.concat(t);f()})}}else{q()}};var k=function(u){for(var t=u.length-1;t>=0;t--){var w="";var v=u[t];var s=v.properties;if(typeof v.name==="undefined"){w="you must provide a name for the event."}else{if(typeof s!=="undefined"&&s!==null){if(s.constructor!==Object){w="properties must be an object with key value pairs."}else{a(s)}}}if(w!==""){AJS.log("WARN: Invalid analytics event detected and ignored, "+w+"\nEvent: "+JSON.stringify(v));u.splice(t,1)}}return u.length};var a=function(u){for(var t in u){if(u.hasOwnProperty(t)){var s=u[t];if(typeof s!=="undefined"&&s!==null&&s.toString){u[t]=s.toString()}else{u[t]=""}}}};var j=function(){if(l&&!(l.state()==="resolved"||l.state()==="rejected")){l.abort()}};AJS.EventQueue=AJS.EventQueue||[];var o=Array.prototype.push;AJS.EventQueue.push=function(s){s.time=new Date().getTime();o.call(AJS.EventQueue,s)};AJS.toInit(function(){p();setTimeout(e,500);setInterval(e,5000);r()});b(window).unload(function(){j();f()});AJS.Analytics={triggerPrivacyPolicySafeEvent:function(s,t){AJS.log("WARN: 'triggerPrivacyPolicySafeEvent' has been deprecated");AJS.EventQueue.push({name:s,properties:t})}};AJS.bind("analytics",function(s,t){AJS.EventQueue.push({name:t.name,properties:t.data})});AJS.bind("analyticsEvent",function(s,t){AJS.EventQueue.push({name:t.name,properties:t.data})});var r=function(){if(window.location.pathname.indexOf("/secure/admin/ViewApplicationProperties")>-1){AJS.$("[data-property-id='analytics-enabled']").remove()}else{if(window.location.pathname.indexOf("/secure/admin/EditApplicationProperties")>-1){var t=AJS.$(":contains(Enable Atlassian analytics)");if(t.size()>0){var s=t[t.size()-2];if(s){s.remove()}}}}}}(AJS.$));;
;/* module-key = 'com.atlassian.analytics.analytics-client:policy-update', location = 'js/policy-update.js' */
;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:application-header-administration-cog-resource', location = 'header/cog.js' */
var NavLinks=(function(a){a.ApplicationHeader=function(b){b.Cog=(function(){var c=function(){var d=AJS.$("#system-admin-menu-content");if(d.length>0){return d}var e=AJS.$("#admin-menu-link-content");if(e.length>0){return e}return AJS.$("#bamboo\\.global\\.header-admin\\.menu")};return{getDropdown:c}}());return b}(a.ApplicationHeader||{});return a}(NavLinks||{}));;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:administration-shortcuts-resources', location = 'adminshortcuts/adminshortcuts.soy' */
// This file was automatically generated from adminshortcuts.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace navlinks.templates.adminshortcuts.
 */

if (typeof navlinks == 'undefined') { var navlinks = {}; }
if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; }
if (typeof navlinks.templates.adminshortcuts == 'undefined') { navlinks.templates.adminshortcuts = {}; }


navlinks.templates.adminshortcuts.section = function(opt_data, opt_ignored) {
  var param5 = '<ul class="aui-list-truncate">';
  var linkList7 = opt_data.links;
  var linkListLen7 = linkList7.length;
  for (var linkIndex7 = 0; linkIndex7 < linkListLen7; linkIndex7++) {
    var linkData7 = linkList7[linkIndex7];
    param5 += '<li><a href="' + soy.$$escapeHtml(linkData7.link) + '">' + soy.$$escapeHtml(linkData7.label) + '</a></li>';
  }
  param5 += '</ul>';
  var output = '' + aui.dropdown2.section({id: 'nl-remote-admin-section', label: "Other applications", content: param5});
  return output;
};
if (goog.DEBUG) {
  navlinks.templates.adminshortcuts.section.soyTemplateName = 'navlinks.templates.adminshortcuts.section';
}
;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:administration-shortcuts-resources', location = 'adminshortcuts/adminnavlinks.js' */
var NavLinks=(function(a){a.AdminShortcuts=(function(){var c=function(){return AJS.$.ajax({url:AJS.contextPath()+"/rest/menu/latest/admin",cache:false,dataType:"json"})};var b=function(){AJS.$("#nl-remote-admin-section").on("click","a",function(){NL.trackEvent("remoteAdminItemSelected",NL.getCurrentApplication(),$(this).attr("href"))})};return{render:function(){c().done(function(e){e=_.reject(e,function(f){return f.local===true});if(e.length){var d=navlinks.templates.adminshortcuts.section({links:e});a.ApplicationHeader.Cog.getDropdown().append(d);b()}})}}}());return a}(NavLinks||{}));;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-projectshortcuts', location = 'projectshortcuts/projectshortcuts.soy' */
// This file was automatically generated from projectshortcuts.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace navlinks.templates.projectshortcuts.
 */

if (typeof navlinks == 'undefined') { var navlinks = {}; }
if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; }
if (typeof navlinks.templates.projectshortcuts == 'undefined') { navlinks.templates.projectshortcuts = {}; }


navlinks.templates.projectshortcuts.dialogContent = function(opt_data, opt_ignored) {
  return '' + ((opt_data.localShortcuts && opt_data.localShortcuts.length > 0) ? navlinks.templates.projectshortcuts.dialogContentShortcuts({shortcuts: opt_data.localShortcuts, listClass: 'projectshortcut-links'}) : '') + ((opt_data.remoteShortcuts != null) ? (opt_data.remoteShortcuts.length > 0) ? '<h2 class="projectshortcuts-heading">Related Links</h2>' + navlinks.templates.projectshortcuts.dialogContentShortcuts(soy.$$augmentMap(opt_data.remoteShortcuts, {shortcuts: opt_data.remoteShortcuts, listClass: 'projectshortcut-links'})) : '' : navlinks.templates.projectshortcuts.dialogLoading(null));
};
if (goog.DEBUG) {
  navlinks.templates.projectshortcuts.dialogContent.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogContent';
}


navlinks.templates.projectshortcuts.headingWrapper = function(opt_data, opt_ignored) {
  return '<div class="project-dialog-header-wrapper"><div class="project-header"><img class="project-img" src="' + soy.$$escapeHtml(opt_data.logoUrl) + '"><h2 class="dialog-title">' + soy.$$escapeHtml(opt_data.title) + '</h2></div><div class="project-content-wrapper">' + soy.$$filterNoAutoescape(opt_data.contentHtml) + '</div></div>';
};
if (goog.DEBUG) {
  navlinks.templates.projectshortcuts.headingWrapper.soyTemplateName = 'navlinks.templates.projectshortcuts.headingWrapper';
}


navlinks.templates.projectshortcuts.dialogContentShortcuts = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  var output = '<ul' + ((opt_data.listClass) ? ' class="' + soy.$$escapeHtml(opt_data.listClass) + '"' : '') + '>';
  var shortcutList35 = opt_data.shortcuts;
  var shortcutListLen35 = shortcutList35.length;
  for (var shortcutIndex35 = 0; shortcutIndex35 < shortcutListLen35; shortcutIndex35++) {
    var shortcutData35 = shortcutList35[shortcutIndex35];
    output += '<li' + ((shortcutIndex35 == shortcutListLen35 - 1) ? ' class="last"' : '') + '>' + navlinks.templates.projectshortcuts.dialogContentShortcut(shortcutData35) + '</li>';
  }
  output += '</ul>';
  return output;
};
if (goog.DEBUG) {
  navlinks.templates.projectshortcuts.dialogContentShortcuts.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogContentShortcuts';
}


navlinks.templates.projectshortcuts.dialogContentShortcut = function(opt_data, opt_ignored) {
  return '<a href="' + soy.$$escapeHtml(opt_data.link) + '"' + ((opt_data.tooltip) ? ' title="' + soy.$$escapeHtml(opt_data.tooltip) + '"' : '') + '>' + soy.$$escapeHtml(opt_data.label) + '</a>';
};
if (goog.DEBUG) {
  navlinks.templates.projectshortcuts.dialogContentShortcut.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogContentShortcut';
}


navlinks.templates.projectshortcuts.dialogLoading = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '<div class="projectshortcuts-loading">' + ((opt_data.text) ? soy.$$escapeHtml(opt_data.text) : '') + '</div>';
};
if (goog.DEBUG) {
  navlinks.templates.projectshortcuts.dialogLoading.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogLoading';
}
;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-projectshortcuts', location = 'projectshortcuts/projectshortcuts.js' */
(function(e,g){var i,k={},m="key",b="name",j="entity-type";function f(s){var n=e(this),o=n.data(m),q=n.data(b),p=n.data(j);if(typeof o==="undefined"){return}s.preventDefault();i=new AJS.Dialog({width:600,keypressListener:function(u){if(u.which==jQuery.ui.keyCode.ESCAPE){i.remove()}},id:"project-shortcuts-dialog"}).addCancel("Close",function(){i.remove()}).addPanel("",navlinks.templates.projectshortcuts.headingWrapper({title:q,logoUrl:h(),contentHtml:navlinks.templates.projectshortcuts.dialogLoading({text:"Retrieving links…"})})).show();c(i);if(!k[o]){k[o]={entity:{title:q},localShortcuts:null,remoteShortcuts:null};d(AJS.contextPath()+"/rest/project-shortcuts/1.0/local/"+o,{entityType:p}).done(t);d(AJS.contextPath()+"/rest/project-shortcuts/1.0/remote/"+o,{entityType:p}).done(r).fail(function(){var u=i.getCurrentPanel().body.find(".project-content-wrapper");u.find(".projectshortcuts-loading").remove();AJS.messages.error(u,{body:"Could not retrieve remote project shortcuts",closeable:false});c(i)})}else{l(k[o])}function t(u){k[o].localShortcuts=u.shortcuts;l(k[o])}function r(u){k[o].remoteShortcuts=u.shortcuts;l(k[o])}}function h(){return e(".project-shortcut-dialog-trigger img").attr("src")}function l(n){if(n.localShortcuts){i.getCurrentPanel().html(navlinks.templates.projectshortcuts.headingWrapper({title:n.entity.title,logoUrl:h(),contentHtml:navlinks.templates.projectshortcuts.dialogContent(n)}));c(i)}}function a(p){var o=210;if(!p||p.length<=o){return p}var n=o;while(n>0&&p.charAt(n)!=" "){n--}if(n==0){n=o}p=p.substring(0,n);if(p.length>=n){p=p+"..."}return p}function c(n){var q=n.popup.element,p=q.find(".dialog-panel-body"),o=q.find(".dialog-components");p.height("auto");q.height(o.outerHeight()-1);e(".aui-shadow").remove()}function d(n,o){return e.ajax({url:n,cache:false,data:o,dataType:"json"})}e(document).on("click",".project-shortcut-dialog-trigger",f)}(jQuery,window.NL=(window.NL||{})));;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:atlassian-ui-popup-display-controller', location = 'popups/DisplayController.js' */
AJS.Popups=AJS.Popups||{};AJS.Popups.DisplayController=function(){var c=[];var a=false;var b=false;AJS.toInit(function(){setTimeout(function(){AJS.Popups.DisplayController.render()},0)});return{request:function(d){c.push(d);if(a&&b===false){this.render()}},render:function(){c.sort(function(e,d){return e.weight-d.weight});a=true;if(c.length!==0){b=true;c[0].show()}}}}();;
;/* module-key = 'com.atlassian.support.stp:stp-license-status-resources', location = 'js/stp-licenseStatus.js' */
;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher.soy' */
// This file was automatically generated from appswitcher.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace navlinks.templates.appswitcher.
 */

if (typeof navlinks == 'undefined') { var navlinks = {}; }
if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; }
if (typeof navlinks.templates.appswitcher == 'undefined') { navlinks.templates.appswitcher = {}; }


navlinks.templates.appswitcher.linkSection = function(opt_data, opt_ignored) {
  var output = '';
  if (opt_data.list.length > 0) {
    output += '<div class="aui-nav-heading sidebar-section-header">' + soy.$$escapeHtml(opt_data.title) + '</div><ul class="aui-nav nav-links">';
    var linkList8 = opt_data.list;
    var linkListLen8 = linkList8.length;
    for (var linkIndex8 = 0; linkIndex8 < linkListLen8; linkIndex8++) {
      var linkData8 = linkList8[linkIndex8];
      output += navlinks.templates.appswitcher.applicationsItem(linkData8);
    }
    output += '</ul>';
  }
  return output;
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.linkSection.soyTemplateName = 'navlinks.templates.appswitcher.linkSection';
}


navlinks.templates.appswitcher.applicationsItem = function(opt_data, opt_ignored) {
  return '<li class="nav-link"><a href="' + soy.$$escapeHtml(opt_data.link) + '" class="interactive' + ((opt_data.self) ? ' checked' : '') + '" title="' + soy.$$escapeHtml(opt_data.link) + '"><span class="nav-link-label">' + soy.$$escapeHtml(opt_data.label) + '</span></a></li>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.applicationsItem.soyTemplateName = 'navlinks.templates.appswitcher.applicationsItem';
}


navlinks.templates.appswitcher.shortcutsItem = function(opt_data, opt_ignored) {
  return '<li class="nav-link"><a href="' + soy.$$escapeHtml(opt_data.link) + '" class="interactive' + ((opt_data.self) ? ' checked' : '') + '" title="' + soy.$$escapeHtml(opt_data.link) + '"><span class="nav-link-label">' + soy.$$escapeHtml(opt_data.label) + '</span>' + ((opt_data.showDescription && opt_data.description) ? '<span class="nav-link-description">' + soy.$$escapeHtml(opt_data.description) + '</span>' : '') + '</a></li>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.shortcutsItem.soyTemplateName = 'navlinks.templates.appswitcher.shortcutsItem';
}


navlinks.templates.appswitcher.error = function(opt_data, opt_ignored) {
  return '<div class="app-switcher-error">' + soy.$$filterNoAutoescape("Something went wrong, please \x3cspan class\x3d\x22app-switcher-retry\x22\x3etry again\x3c/span\x3e.") + '</div>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.error.soyTemplateName = 'navlinks.templates.appswitcher.error';
}


navlinks.templates.appswitcher.sidebarContents = function(opt_data, opt_ignored) {
  return '<div class="aui-page-panel-nav"><nav class="aui-navgroup aui-navgroup-vertical"><div class="app-switcher-section app-switcher-applications"><div class="aui-nav-heading">' + soy.$$escapeHtml("Application Links") + '</div><div class="app-switcher-loading">' + soy.$$filterNoAutoescape("Loading\x26hellip;") + '</div></div><div class="app-switcher-section app-switcher-shortcuts"><div class="aui-nav-heading">' + soy.$$escapeHtml("Shortcuts") + '</div><div class="app-switcher-loading">' + soy.$$filterNoAutoescape("Loading\x26hellip;") + '</div></div></nav></div>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.sidebarContents.soyTemplateName = 'navlinks.templates.appswitcher.sidebarContents';
}


navlinks.templates.appswitcher.trigger = function(opt_data, opt_ignored) {
  return '<span class="aui-icon aui-icon-small aui-iconfont-appswitcher">' + soy.$$escapeHtml("Linked Applications") + '</span>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.trigger.soyTemplateName = 'navlinks.templates.appswitcher.trigger';
}


navlinks.templates.appswitcher.projectHeaderSection = function(opt_data, opt_ignored) {
  return '<div class="app-switcher-title">' + aui.avatar.avatar({size: 'large', avatarImageUrl: opt_data.avatarUrl, isProject: true, title: opt_data.name}) + '<div class="sidebar-project-name">' + soy.$$escapeHtml(opt_data.name) + '</div></div>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.projectHeaderSection.soyTemplateName = 'navlinks.templates.appswitcher.projectHeaderSection';
}


navlinks.templates.appswitcher.cogDropdown = function(opt_data, opt_ignored) {
  var output = '';
  var dropdownList__soy74 = '' + navlinks.templates.appswitcher.dropdownList({list: opt_data.links});
  output += aui.dropdown2.dropdown2({menu: {id: opt_data.id, content: dropdownList__soy74, extraClasses: 'aui-style-default sidebar-customize-section'}, trigger: {showIcon: false, content: '<span class="aui-icon aui-icon-small aui-iconfont-configure"></span>', container: '#app-switcher'}});
  return output;
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.cogDropdown.soyTemplateName = 'navlinks.templates.appswitcher.cogDropdown';
}


navlinks.templates.appswitcher.dropdownList = function(opt_data, opt_ignored) {
  var output = '<ul class="sidebar-admin-links">';
  var linkList82 = opt_data.list;
  var linkListLen82 = linkList82.length;
  for (var linkIndex82 = 0; linkIndex82 < linkListLen82; linkIndex82++) {
    var linkData82 = linkList82[linkIndex82];
    output += '<li class="nav-link"><a href="' + soy.$$escapeHtml(linkData82.href) + '" title="' + soy.$$escapeHtml(linkData82.title) + '"><span class="nav-link-label">' + soy.$$escapeHtml(linkData82.label) + '</span></a></li>';
  }
  output += '</ul>';
  return output;
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.dropdownList.soyTemplateName = 'navlinks.templates.appswitcher.dropdownList';
}


navlinks.templates.appswitcher.switcher = function(opt_data, opt_ignored) {
  var output = '';
  if (true) {
    if (AJS.DarkFeatures.isEnabled('rotp.sidebar')) {
      var sidebarContents__soy97 = '' + navlinks.templates.appswitcher.sidebarContents(null);
      var triggerContent__soy99 = '' + navlinks.templates.appswitcher.trigger(null);
      output += navlinks.templates.appswitcher.sidebar({sidebar: {id: 'app-switcher', content: sidebarContents__soy97}, trigger: {showIcon: false, content: triggerContent__soy99}}) + '<script>\n                (function (NL) {\n                    var initialise = function () {\n                        new NL.SideBar({\n                            sidebarContents: \'#app-switcher\'\n                        });\n                    };\n                    if (NL.SideBar) {\n                        initialise();\n                    } else {\n                        NL.onInit = initialise;\n                    }\n                }(window.NL = (window.NL || {})));\n                window.NL.isUserAdmin = ' + soy.$$escapeHtml(false) + '<\/script>';
    } else {
      output += navlinks.templates.appswitcher_old.switcher(null);
    }
  }
  return output;
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.switcher.soyTemplateName = 'navlinks.templates.appswitcher.switcher';
}


navlinks.templates.appswitcher.sidebar = function(opt_data, opt_ignored) {
  return '<a href="' + soy.$$escapeHtml(opt_data.sidebar.id) + '" class="sidebar-trigger app-switcher-trigger" aria-owns="' + soy.$$escapeHtml(opt_data.sidebar.id) + '" aria-haspopup="true">' + soy.$$filterNoAutoescape(opt_data.trigger.content) + '</a><div id=' + soy.$$escapeHtml(opt_data.sidebar.id) + ' class="app-switcher-sidebar aui-style-default sidebar-offscreen">' + soy.$$filterNoAutoescape(opt_data.sidebar.content) + '</div>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher.sidebar.soyTemplateName = 'navlinks.templates.appswitcher.sidebar';
}
;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher.js' */
(function(c,a){a.SideBar=function(d){var e=this;this.$sidebar=null;d=c.extend({sidebarContents:null},d);this.getLinks=function(){return c.ajax({url:AJS.contextPath()+"/rest/menu/latest/appswitcher",cache:false,dataType:"json"}).done(this.updateAppLinks).fail(this.showAppSwitcherError)};this.populateProjectHeader=function(g,f){e.getSidebar().find(".app-switcher-shortcuts .aui-nav-heading").after(navlinks.templates.appswitcher.projectHeaderSection({avatarUrl:f,name:g}))};this.getProjectData=function(){var f=c(".project-shortcut-dialog-trigger"),g=f.data("key"),h=f.data("entity-type");if(f.size()==0||!g||!h){c(".app-switcher-shortcuts").remove();return}var j,i;i=c.ajax({url:AJS.contextPath()+"/rest/project-shortcuts/1.0/local/"+g,cache:false,data:{entityType:h},dataType:"json"});j=c.ajax({url:AJS.contextPath()+"/rest/project-shortcuts/1.0/remote/"+g,cache:false,data:{entityType:h},dataType:"json"});c.when(i,j).then(function(l,k){e.updateProjectShortcuts(l,k,{key:g,entityType:h,name:f.data("name"),avatarUrl:f.find("img").prop("src")})},e.showProjectShortcutsError)};this.getSidebar=function(){if(!this.$sidebar){this.$sidebar=c(d.sidebarContents)}return this.$sidebar};this.addApplicationsCog=function(){c(".app-switcher-applications .aui-nav-heading").before(navlinks.templates.appswitcher.cogDropdown({id:"sidebar-applications-admin-dropdown",links:[{href:AJS.contextPath()+"/plugins/servlet/customize-application-navigator",label:"Customize navigator",title:"Add new entries, hide existing or restrict who sees what"},{href:AJS.contextPath()+"/plugins/servlet/applinks/listApplicationLinks",label:"Manage application links",title:"Link to more Atlassian applications"}]}))};this.addProjectShortcutsCog=function(f,h){var g=[{href:AJS.contextPath()+"/plugins/servlet/custom-content-links-admin?entityKey="+f,label:"Customize shortcuts",title:""}];if(e.entityMappings[h]){g.push({href:e.generateEntityLinksUrl(f,e.entityMappings[h]),label:"Manage product links",title:""})}e.getSidebar().find(".app-switcher-shortcuts .aui-nav-heading").before(navlinks.templates.appswitcher.cogDropdown({id:"sidebar-project-shortcuts-admin-dropdown",links:g}))};this.updateAppLinks=function(f){c(function(){e.getSidebar().find(".app-switcher-applications").html(navlinks.templates.appswitcher.linkSection({title:"Application Links",list:f}));if(a.isUserAdmin){e.addApplicationsCog()}e.bindAnalyticsHandlers(e.getSidebar(),f)})};this.updateProjectShortcuts=function(i,g,h){var j=i[0].shortcuts,f=g[0].shortcuts;e.getSidebar().find(".app-switcher-shortcuts").html(navlinks.templates.appswitcher.linkSection({title:"Shortcuts",list:j.concat(f)}));if(a.isUserAdmin){e.addProjectShortcutsCog(h.key,h.entityType)}e.populateProjectHeader(h.name,h.avatarUrl);e.bindAnalyticsHandlers(e.getSidebar(),data)};this.entityMappings={"confluence.space":"com.atlassian.applinks.api.application.confluence.ConfluenceSpaceEntityType","jira.project":"com.atlassian.applinks.api.application.jira.JiraProjectEntityType","bamboo.project":"com.atlassian.applinks.api.application.bamboo.BambooProjectEntityType","stash.project":"com.atlassian.applinks.api.application.stash.StashProjectEntityType"};this.generateEntityLinksUrl=function(f,g){if(g===e.entityMappings["confluence.space"]){return AJS.contextPath()+"/spaces/listentitylinks.action?typeId="+g+"&key="+f}else{return AJS.contextPath()+"/plugins/servlet/applinks/listEntityLinks/"+g+"/"+f}};this.showAppSwitcherError=function(){c(function(){var f=e.getSidebar();f.find(".app-switcher-applications .app-switcher-loading").replaceWith(navlinks.templates.appswitcher.error());f.off(".appswitcher").on("click.appswitcher",".app-switcher-retry",c.proxy(e.retryLoading,e))})};this.showProjectShortcutsError=function(){c(function(){var f=e.getSidebar();f.find(".app-switcher-shortcuts .app-switcher-loading").replaceWith(navlinks.templates.appswitcher.error());f.off(".appswitcher").on("click.appswitcher",".app-switcher-retry",c.proxy(e.retryLoading,e))})};this.retryLoading=function(f){this.getSidebar().html(navlinks.templates.appswitcher.sidebarContents());this.getLinks();this.getProjectData();f&&f.stopPropagation()};this.bindAnalyticsHandlers=function(f,g){};this.getLinks();c(this.getProjectData);this.toggleSidebar=function(h){var i=e.getSidebar(),g=c("body"),f=c(window.document);if(!g.hasClass("app-switcher-open")){var k=c("#header");i.css("left",-i.width());i.parent("body").length||i.appendTo("body");b({data:i});i.animate({left:0},300);function j(l){var n=l.target&&c(l.target),m=l.keyCode;if(l.originalEvent===h.originalEvent){return}if(n&&!m&&!(n.closest(i).length||n.closest(k).length)&&h.which==1&&!(l.shiftKey||l.ctrlKey||l.metaKey)){e.toggleSidebar()}else{if(m===27){e.toggleSidebar()}}}f.on("click.appSwitcher",j);f.on("keydown.appSwitcher",j);f.on("scroll.appSwitcher",i,b)}else{f.off(".appSwitcher")}g.toggleClass("app-switcher-open")};c("#header").on("click",".app-switcher-trigger",this.toggleSidebar)};function b(f){var d=c(document).scrollTop(),g=c("#header"),e=(g.height()+g.offset().top)-d;if(e>=0){f.data.css({top:e,position:"fixed"})}else{f.data.css({top:0,left:0,position:"fixed"})}}if(a.onInit){a.onInit()}}(jQuery,window.NL=(window.NL||{})));;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher_old.js' */
(function(e,c){c.AppSwitcher=function(f){var g=AJS.contextPath()+"/plugins/servlet/customize-application-navigator";var h=this;this.$dropdown=null;f=e.extend({dropdownContents:null},f);this.getLinks=function(){return e.ajax({url:AJS.contextPath()+"/rest/menu/latest/appswitcher",cache:false,dataType:"json"}).done(this.updateDropdown).fail(this.showError)};this.getDropdown=function(){if(!this.$dropdown){this.$dropdown=e(f.dropdownContents)}return this.$dropdown};this.updateDropdown=function(i){e(function(){h.getDropdown().html(navlinks.templates.appswitcher_old.applications({apps:i,showAdminLink:c.isUserAdmin,adminLink:g}));h.bindAnalyticsHandlers(h.getDropdown(),i);h.processSuggestionApps(i)})};this.bindAnalyticsHandlers=function(i,j){};this.processSuggestionApps=function(i){e.ajax({type:"GET",dataType:"json",contentType:"application/json; charset=UTF-8",url:AJS.contextPath()+"/rest/menu/latest/isAppSuggestionAvailable"}).done(function(j){if(j===true){h.handleSuggestionApps(i)}})};this.handleSuggestionApps=function(k){var l=_.map(k,function(m){return m.applicationType.toLowerCase()});$suggestionApps=e("<div id='app-switcher-suggestion-apps' class='aui-dropdown2-section'/>");$suggestionApps.html(navlinks.templates.appswitcher_old.suggestionApps);var j=$suggestionApps.find(".suggestion-apps");var i=false;_.each(a,function(m){if(!_.contains(l,m.appName)){i=true;j.append(navlinks.templates.appswitcher_old.suggestionApp({appName:m.appName,appDesc:m.appDesc}))}});if(!i){return}e("#app-switcher").append($suggestionApps);e(".app-discovery-suggestion-app").click(function(){AJS.trigger("analytics",{name:"appswitcher.discovery.user.select."+e(this).find("a").attr("id").toLowerCase()});window.open(e(this).find("a").attr("title"),"_blank")});e(".app-discovery-suggestion-app").hover(function(){e(this).find("a").removeClass("active").removeClass("aui-dropdown2-active")});e(".app-discovery-cancel-button").click(function(){AJS.trigger("analytics",{name:"appswitcher.discovery.nothanks.button.click"});d(b,"true");$suggestionApps.remove()})};this.showError=function(){e(function(){h.getDropdown().html(navlinks.templates.appswitcher_old.error()).off(".appswitcher").on("click.appswitcher",".app-switcher-retry",e.proxy(h.retryLoading,h))})};this.retryLoading=function(i){this.getDropdown().html(navlinks.templates.appswitcher_old.loading());this.getLinks();i&&i.stopPropagation()};this.getLinks()};var b="key-no-thanks";var a=[{appName:"jira",appDesc:"Issue & Project Tracking Software"},{appName:"confluence",appDesc:"Collaboration and content sharing"},{appName:"bamboo",appDesc:"Continuous integration"}];var d=function(f,g){e.ajax({url:AJS.contextPath()+"/rest/menu/latest/userdata/",type:"PUT",contentType:"application/json",data:JSON.stringify({key:f,value:g})})};if(c.onInit){c.onInit()}}(jQuery,window.NL=(window.NL||{})));;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher_old.soy' */
// This file was automatically generated from appswitcher_old.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace navlinks.templates.appswitcher_old.
 */

if (typeof navlinks == 'undefined') { var navlinks = {}; }
if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; }
if (typeof navlinks.templates.appswitcher_old == 'undefined') { navlinks.templates.appswitcher_old = {}; }


navlinks.templates.appswitcher_old.applications = function(opt_data, opt_ignored) {
  return '' + navlinks.templates.appswitcher_old.applicationsSection({list: opt_data.apps, listClass: 'nav-links', showDescription: opt_data.showDescription}) + ((opt_data.custom) ? navlinks.templates.appswitcher_old.applicationsSection({list: opt_data.custom, showDescription: opt_data.showDescription}) : '') + ((opt_data.showAdminLink) ? navlinks.templates.appswitcher_old.adminSection(opt_data) : '');
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.applications.soyTemplateName = 'navlinks.templates.appswitcher_old.applications';
}


navlinks.templates.appswitcher_old.applicationsSection = function(opt_data, opt_ignored) {
  var output = '';
  if (opt_data.list.length > 0) {
    var param19 = '<ul' + ((opt_data.listClass) ? ' class="' + soy.$$escapeHtml(opt_data.listClass) + '"' : '') + '>';
    var linkList27 = opt_data.list;
    var linkListLen27 = linkList27.length;
    for (var linkIndex27 = 0; linkIndex27 < linkListLen27; linkIndex27++) {
      var linkData27 = linkList27[linkIndex27];
      param19 += navlinks.templates.appswitcher_old.applicationsItem(soy.$$augmentMap(linkData27, {showDescription: opt_data.showDescription}));
    }
    param19 += '</ul>';
    output += aui.dropdown2.section({content: param19});
  }
  return output;
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.applicationsSection.soyTemplateName = 'navlinks.templates.appswitcher_old.applicationsSection';
}


navlinks.templates.appswitcher_old.applicationsItem = function(opt_data, opt_ignored) {
  return '<li class="nav-link' + ((opt_data.self) ? ' nav-link-local' : '') + '"><a href="' + soy.$$escapeHtml(opt_data.link) + '" class="aui-dropdown2-radio interactive' + ((opt_data.self) ? ' checked' : '') + '" title="' + soy.$$escapeHtml(opt_data.link) + '"><span class="nav-link-label">' + soy.$$escapeHtml(opt_data.label) + '</span>' + ((opt_data.showDescription && opt_data.description) ? '<span class="nav-link-description">' + soy.$$escapeHtml(opt_data.description) + '</span>' : '') + '</a></li>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.applicationsItem.soyTemplateName = 'navlinks.templates.appswitcher_old.applicationsItem';
}


navlinks.templates.appswitcher_old.adminSection = function(opt_data, opt_ignored) {
  return '' + aui.dropdown2.section({content: '<ul class="nav-links"><li><a class="nav-link-edit-wrapper" href="' + soy.$$escapeHtml(opt_data.adminLink) + '"><span class="nav-link-edit">' + soy.$$filterNoAutoescape("Configure\x26hellip;") + '</span></a></li></ul>'});
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.adminSection.soyTemplateName = 'navlinks.templates.appswitcher_old.adminSection';
}


navlinks.templates.appswitcher_old.error = function(opt_data, opt_ignored) {
  return '<div class="app-switcher-error">' + soy.$$filterNoAutoescape("Something went wrong, please \x3cspan class\x3d\x22app-switcher-retry\x22\x3etry again\x3c/span\x3e.") + '</div>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.error.soyTemplateName = 'navlinks.templates.appswitcher_old.error';
}


navlinks.templates.appswitcher_old.loading = function(opt_data, opt_ignored) {
  return '<div class="app-switcher-loading">' + soy.$$filterNoAutoescape("Loading\x26hellip;") + '</div>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.loading.soyTemplateName = 'navlinks.templates.appswitcher_old.loading';
}


navlinks.templates.appswitcher_old.trigger = function(opt_data, opt_ignored) {
  return '<span class="aui-icon aui-icon-small aui-iconfont-appswitcher">' + soy.$$escapeHtml("Linked Applications") + '</span>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.trigger.soyTemplateName = 'navlinks.templates.appswitcher_old.trigger';
}


navlinks.templates.appswitcher_old.switcher = function(opt_data, opt_ignored) {
  var output = '';
  if (true) {
    var loadingContent__soy81 = '' + navlinks.templates.appswitcher_old.loading(null);
    var triggerContent__soy83 = '' + navlinks.templates.appswitcher_old.trigger(null);
    output += aui.dropdown2.dropdown2({menu: {id: 'app-switcher', content: loadingContent__soy81, extraClasses: 'aui-style-default'}, trigger: {showIcon: false, content: triggerContent__soy83, extraClasses: 'app-switcher-trigger', extraAttributes: {href: '#app-switcher'}}}) + '<script>\n            (function (NL) {\n                var initialise = function () {\n                    // For some milestones of AUI, the atlassian soy namespace was renamed to aui. Handle that here by ensuring that window.atlassian is defined.\n                    window.atlassian = window.atlassian || window.aui;\n                    new NL.AppSwitcher({\n                        dropdownContents: \'#app-switcher\'\n                    });\n                };\n                if (NL.AppSwitcher) {\n                    initialise();\n                } else {\n                    NL.onInit = initialise;\n                }\n            }(window.NL = (window.NL || {})));\n            window.NL.isUserAdmin = ' + soy.$$escapeHtml(false) + '<\/script>';
  }
  return output;
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.switcher.soyTemplateName = 'navlinks.templates.appswitcher_old.switcher';
}


navlinks.templates.appswitcher_old.suggestionApp = function(opt_data, opt_ignored) {
  return '<li class="app-discovery-suggestion-app"><a id="' + soy.$$escapeHtml(opt_data.appName) + '" href="#" class="app-discovery-link aui-icon-container app-discovery-' + soy.$$escapeHtml(opt_data.appName) + '-product-icon" title="https://www.atlassian.com/software/' + soy.$$escapeHtml(opt_data.appName) + '"/><div class="app-discovery-small">' + soy.$$escapeHtml(opt_data.appDesc) + '</div></li>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.suggestionApp.soyTemplateName = 'navlinks.templates.appswitcher_old.suggestionApp';
}


navlinks.templates.appswitcher_old.suggestionApps = function(opt_data, opt_ignored) {
  return '<ul class=\'nav-links suggestion-apps\'><li><span class=\'app-discovery-suggest-title nav-link-label\'><h6>' + soy.$$escapeHtml("Try other Atlassian apps") + '</h6></span></li></ul><div class=\'buttons-container app-discovery-suggest-apps-buttons\'><div class=\'buttons\'><button class=\'aui-button aui-button-link app-discovery-cancel-button\' name=\'cancel\' accesskey=\'c\' href=\'#\'>' + soy.$$escapeHtml("Don\x27t show this again") + '</button></div></div>';
};
if (goog.DEBUG) {
  navlinks.templates.appswitcher_old.suggestionApps.soyTemplateName = 'navlinks.templates.appswitcher_old.suggestionApps';
}
;
;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/inline-dialog.js' */
(function(d){AJS.CustomInlineDialog=AJS.CustomInlineDialog||function(B,n,r,p){p=p||[];if(p.hasOwnProperty("getArrowAttributes")){getArrowAttributesDeprecationLogger()}if(p.hasOwnProperty("getArrowPath")){getArrowPathDeprecationLogger();if(p.hasOwnProperty("gravity")){getArrowPathWithGravityDeprecationLogger()}}if(p.hasOwnProperty("onTop")){onTopDeprecationLogger();if(p.onTop&&p.gravity===undefined){p.gravity="s"}}if(typeof n==="undefined"){n=String(Math.random()).replace(".","");if(d("#inline-dialog-"+n+", #arrow-"+n+", #inline-dialog-shim-"+n).length){throw"GENERATED_IDENTIFIER_NOT_UNIQUE"}}var z=d.extend(false,AJS.CustomInlineDialog.opts,p);if(z.gravity==="w"){z.offsetX=p.offsetX===undefined?10:p.offsetX;z.offsetY=p.offsetY===undefined?0:p.offsetY}var v=function(){return window.Raphael&&p&&(p.getArrowPath||p.getArrowAttributes)};var j;var q;var K;var u=false;var A=false;var I=false;var J;var x;var g=d('<div id="inline-dialog-'+n+'" class="aui-inline-dialog"><div class="aui-inline-dialog-contents contents"></div><div id="arrow-'+n+'" class="aui-inline-dialog-arrow arrow"></div></div>');var m=d("#arrow-"+n,g);var G=g.find(".contents");if(!v()){g.find(".aui-inline-dialog-arrow").addClass("aui-css-arrow")}if(!z.displayShadow){G.addClass("aui-inline-dialog-no-shadow")}if(z.autoWidth){G.addClass("aui-inline-dialog-auto-width")}else{G.css("width",z.width+"px")}G.mouseover(function(O){clearTimeout(q);g.unbind("mouseover")}).mouseout(function(){E()});var D=function(){if(!j){j={popup:g,hide:function(){E(0)},id:n,show:function(){y()},persistent:z.persistent?true:false,reset:function(){function S(U,T){U.css(T.popupCss);if(v()){if(T.gravity==="s"){T.arrowCss.top-=d.browser.msie?10:9}if(!U.arrowCanvas){U.arrowCanvas=Raphael("arrow-"+n,16,16)}var V=z.getArrowPath,W=d.isFunction(V)?V(T):V;U.arrowCanvas.path(W).attr(z.getArrowAttributes())}else{m.removeClass("aui-bottom-arrow aui-left-arrow aui-right-arrow");if(T.gravity==="s"&&!m.hasClass("aui-bottom-arrow")){m.addClass("aui-bottom-arrow")}else{if(T.gravity==="n"){}else{if(T.gravity==="w"){m.addClass("aui-left-arrow")}else{if(T.gravity==="e"){m.addClass("aui-right-arrow")}}}}}m.css(T.arrowCss)}var P=AJS.$(window).height();var Q=Math.round(P*0.75);g.children(".aui-inline-dialog-contents").css("max-height",Q);var O=z.calculatePositions(g,x,J,z);if(O.hasOwnProperty("displayAbove")){displayAboveDeprecationLogger();O.gravity=O.displayAbove?"s":"n"}S(g,O);g.fadeIn(z.fadeTime,function(){});if(d.browser.msie&&~~(d.browser.version)<10){var R=d("#inline-dialog-shim-"+n);if(!R.length){d(g).prepend(d('<iframe class = "inline-dialog-shim" id="inline-dialog-shim-'+n+'" frameBorder="0" src="javascript:false;"></iframe>'))}R.css({width:G.outerWidth(),height:G.outerHeight()})}}}}return j};var y=function(){if(g.is(":visible")){return}K=setTimeout(function(){if(!I||!A){return}z.addActiveClass&&d(B).addClass("active");u=true;if(!z.persistent){H()}AJS.CustomInlineDialog.current=D();d(document).trigger("showLayer",["inlineDialog",D()]);D().reset()},z.showDelay)};var E=function(O){if(typeof O=="undefined"&&z.persistent){return}A=false;if(u&&z.preHideCallback.call(g[0].popup)){O=(O==null)?z.hideDelay:O;clearTimeout(q);clearTimeout(K);if(O!=null){q=setTimeout(function(){l();z.addActiveClass&&d(B).removeClass("active");g.fadeOut(z.fadeTime,function(){z.hideCallback.call(g[0].popup)});if(g.arrowCanvas){g.arrowCanvas.remove();g.arrowCanvas=null}u=false;A=false;d(document).trigger("hideLayer",["inlineDialog",D()]);AJS.CustomInlineDialog.current=null;if(!z.cacheContent){I=false;w=false}},O)}}};var F=function(R,P){var O=d(P);z.upfrontCallback.call({popup:g,hide:function(){E(0)},id:n,show:function(){y()}});g.each(function(){if(typeof this.popup!="undefined"){this.popup.hide()}});if(z.closeOthers){d(".aui-inline-dialog").each(function(){!this.popup.persistent&&this.popup.hide()})}x={target:O};if(!R){J={x:O.offset().left,y:O.offset().top}}else{J={x:R.pageX,y:R.pageY}}if(!u){clearTimeout(K)}A=true;var Q=function(){w=false;I=true;z.initCallback.call({popup:g,hide:function(){E(0)},id:n,show:function(){y()}});y()};if(!w){w=true;if(d.isFunction(r)){r(G,P,Q)}else{d.get(r,function(T,S,U){G.html(z.responseHandler(T,S,U));I=true;z.initCallback.call({popup:g,hide:function(){E(0)},id:n,show:function(){y()}});y()})}}clearTimeout(q);if(!u){y()}return false};g[0].popup=D();var w=false;var t=false;var s=function(){if(!t){d(z.container).append(g);t=true}};var o=d(B);if(z.onHover){if(z.useLiveEvents){if(o.selector){d(document).on("mousemove",o.selector,function(O){s();F(O,this)}).on("mouseout",o.selector,function(){E()})}else{AJS.log("Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.")}}else{o.mousemove(function(O){s();F(O,this)}).mouseout(function(){E()})}}else{if(!z.noBind){if(z.useLiveEvents){if(o.selector){d(document).on("click",o.selector,function(O){s();if(M()){g.hide()}else{F(O,this)}return false}).on("mouseout",o.selector,function(){E()})}else{AJS.log("Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.")}}else{o.click(function(O){s();if(M()){g.hide()}else{F(O,this)}return false}).mouseout(function(){E()})}}}var M=function(){return u&&z.closeOnTriggerClick};var H=function(){k();f()};var l=function(){C();N()};var i=false;var h=n+".inline-dialog-check";var k=function(){if(!i){d("body").bind("click."+h,function(P){var O=d(P.target);if(O.closest("#inline-dialog-"+n+" .contents").length===0){E(0)}});i=true}};var C=function(){if(i){d("body").unbind("click."+h)}i=false};var L=function(O){if(O.keyCode===27){E(0)}};var f=function(){d(document).on("keydown",L)};var N=function(){d(document).off("keydown",L)};g.show=function(P,O){if(P){P.stopPropagation()}s();if(z.noBind&&!(B&&B.length)){F(P,O===undefined?P.target:O)}else{F(P,B)}};g.hide=function(){E(0)};g.refresh=function(){if(u){D().reset()}};g.getOptions=function(){return z};return g};function c(g){var f=d(g);var h=d.extend({left:0,top:0},f.offset());return{left:h.left,top:h.top,width:f.outerWidth(),height:f.outerHeight()}}function b(h,j,t,f){var m=AJS.$.isFunction(f.offsetX)?f.offsetX(h,j,t,f):f.offsetX;var l=AJS.$.isFunction(f.offsetY)?f.offsetY(h,j,t,f):f.offsetY;var q=AJS.$.isFunction(f.arrowOffsetX)?f.arrowOffsetX(h,j,t,f):f.arrowOffsetX;var p=AJS.$.isFunction(f.arrowOffsetY)?f.arrowOffsetY(h,j,t,f):f.arrowOffsetY;var s=f.container.toLowerCase()!=="body";var g=AJS.$(f.container);var o=s?AJS.$(f.container).parent():AJS.$(window);var r=s?g.offset():{left:0,top:0};var k=s?o.offset():{left:0,top:0};var i=j.target;var u=i.offset();var n=i[0].getBBox&&i[0].getBBox();return{screenPadding:10,arrowMargin:5,window:{top:k.top,left:k.left,scrollTop:o.scrollTop(),scrollLeft:o.scrollLeft(),width:o.width(),height:o.height()},scrollContainer:{width:g.width(),height:g.height()},trigger:{top:u.top-r.top,left:u.left-r.left,width:n?n.width:i.outerWidth(),height:n?n.height:i.outerHeight()},dialog:{width:h.width(),height:h.height(),offset:{top:l,left:m}},arrow:{height:h.find(".arrow").outerHeight(),offset:{top:p,left:q}}}}function e(f,p,G,r){var n=b(f,p,G,r);var j=n.screenPadding;var k=n.window;var t=n.trigger;var D=n.dialog;var i=n.arrow;var z=n.scrollContainer;var E={top:t.top-k.scrollTop,left:t.left-k.scrollLeft};var A=Math.floor(t.height/2);var v=Math.floor(D.height/2);var u=Math.floor(i.height/2);var C=E.left-D.offset.left-j;var H=z.width-E.left-t.width-D.offset.left-j;var B=C>=D.width;var h=H>=D.width;var l=!h&&B?"e":"w";var o=E.top+A-u;var q=k.height-o-i.height;j=Math.min(j,o-n.arrowMargin);j=Math.min(j,q-n.arrowMargin);var g=E.top+A;var x=Math.max(g-j,0);var F=Math.max(k.height-g-j,0);var y=v-D.offset.top>x;var m=v+D.offset.top>F;var w;var s;if(y){w={top:k.scrollTop+j,left:l==="w"?t.left+t.width+D.offset.left:t.left-D.width-D.offset.left};s={top:(t.top+A)-(w.top+u)}}else{if(m){w={top:k.scrollTop+k.height-D.height-j,left:l==="w"?t.left+t.width+D.offset.left:t.left-D.width-D.offset.left};s={top:(t.top+A)-(w.top+u)}}else{w={top:t.top+A-v+D.offset.top,left:l==="w"?t.left+t.width+D.offset.left:t.left-D.width-D.offset.left};s={top:v-u+i.offset.top}}}return{gravity:l,popupCss:w,arrowCss:s}}function a(g,o,z,s){var x=AJS.$.isFunction(s.offsetX)?s.offsetX(g,o,z,s):s.offsetX;var v=AJS.$.isFunction(s.offsetY)?s.offsetY(g,o,z,s):s.offsetY;var m=AJS.$.isFunction(s.arrowOffsetX)?s.arrowOffsetX(g,o,z,s):s.arrowOffsetX;var l=AJS.$.isFunction(s.arrowOffsetY)?s.arrowOffsetY(g,o,z,s):s.arrowOffsetY;var f=c(window);var p=c(o.target);var y=c(g);var j=c(g.find(".aui-inline-dialog-arrow"));var i=p.left+p.width/2;var u=(window.pageYOffset||document.documentElement.scrollTop)+f.height;var k=10;y.top=p.top+p.height+~~v;y.left=p.left+~~x;var r=f.width-(y.left+y.width+k);j.left=i-y.left+~~m;j.top=-(j.height/2);var n=p.top>y.height;var h=(y.top+y.height)<u;var q=(!h&&n)||(n&&s.gravity==="s");if(q){y.top=p.top-y.height-(j.height/2);j.top=y.height}if(s.isRelativeToMouse){if(r<0){y.right=k;y.left="auto";j.left=z.x-(f.width-y.width)}else{y.left=z.x-20;j.left=z.x-y.left}}else{if(r<0){y.right=k;y.left="auto";var w=f.width-y.right;var t=w-y.width;j.right="auto";j.left=i-t-j.width/2}else{if(y.width<=p.width/2){j.left=y.width/2;y.left=i-y.width/2}}}return{gravity:q?"s":"n",displayAbove:q,popupCss:{left:y.left,top:y.top,right:y.right},arrowCss:{left:j.left,top:j.top,right:j.right}}}AJS.CustomInlineDialog.opts={onTop:false,responseHandler:function(g,f,h){return g},closeOthers:true,isRelativeToMouse:false,addActiveClass:true,onHover:false,useLiveEvents:false,noBind:false,fadeTime:100,persistent:false,hideDelay:10000,showDelay:0,width:300,offsetX:0,offsetY:10,arrowOffsetX:0,arrowOffsetY:0,container:"body",cacheContent:true,displayShadow:true,autoWidth:false,gravity:"n",closeOnTriggerClick:false,preHideCallback:function(){return true},hideCallback:function(){},initCallback:function(){},upfrontCallback:function(){},calculatePositions:function(f,i,j,h){h=h||{};var g=h.gravity==="w"?e:a;return g(f,i,j,h)},getArrowPath:function(f){if(f.gravity==="s"){return"M0,8L8,16,16,8"}else{return"M0,8L8,0,16,8"}},getArrowAttributes:function(){return{fill:"#fff",stroke:"#ccc"}}}})(AJS.$);;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:recent-repositories-menu-resources', location = '/static/layout/base/menu/repositories/recent.soy' */
// This file was automatically generated from recent.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.layout.menu.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.layout == 'undefined') { stash.layout = {}; }
if (typeof stash.layout.menu == 'undefined') { stash.layout.menu = {}; }


stash.layout.menu.loadingRecentReposMenuItem = function(opt_data, opt_ignored) {
  return '<li><span class="loading-recent-repos">' + soy.$$escapeHtml("Loading...") + '</span></li>';
};
if (goog.DEBUG) {
  stash.layout.menu.loadingRecentReposMenuItem.soyTemplateName = 'stash.layout.menu.loadingRecentReposMenuItem';
}


stash.layout.menu.noRecentReposMenuItem = function(opt_data, opt_ignored) {
  return '<li><span class="no-recent-repos">' + soy.$$escapeHtml("No recently viewed repositories") + '</span></li>';
};
if (goog.DEBUG) {
  stash.layout.menu.noRecentReposMenuItem.soyTemplateName = 'stash.layout.menu.noRecentReposMenuItem';
}


stash.layout.menu.errorLoadingRecentReposMenuItem = function(opt_data, opt_ignored) {
  return '<li><span>' + soy.$$escapeHtml("An error occurred") + '</span></li>';
};
if (goog.DEBUG) {
  stash.layout.menu.errorLoadingRecentReposMenuItem.soyTemplateName = 'stash.layout.menu.errorLoadingRecentReposMenuItem';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:recent-repositories-menu-resources', location = '/static/layout/base/menu/repositories/recent.js' */
define("layout/base/menu/recent-repos",["jquery","stash/api/util/navbuilder","util/ajax","util/events","util/html","exports"],function(E,F,D,C,B,A){A.initMenu=function(I){var H=E("#"+B.sanitizeId(E("#"+I).attr("aria-owns"))).addClass("recent-repositories-menu"),K=H.find(".recent-repositories-section ul"),J=E(stash.layout.menu.loadingRecentReposMenuItem());H.on("aui-dropdown2-show",function(){C.trigger("internal.stash.ui.nav.repositories.opened")});H.on("click","a",function(){var L=E(this).closest(".aui-dropdown2-section");if(L.is(".recent-repositories-section")){C.trigger("internal.stash.ui.nav.repositories.item.clicked",null,{repositoryId:E(this).attr("data-repo-id")})}if(L.is(".public-repo-list-link-section")){C.trigger("internal.stash.ui.nav.repositories.public.clicked")}});K.append(J);var G=function(){D.rest({url:F.rest().profile().recent().repos().withParams({avatarSize:stash.widget.avatarSizeInPx({size:"xsmall"})}).build(),statusCode:{"*":function(){return false}}}).done(function(M){if(M&&M.size){var L=M.values;L.sort(function(O,N){return O.project.name.localeCompare(N.project.name)||O.name.localeCompare(N.name)});K.append(E(stash.feature.repository.menuItems({repos:L})))}else{K.append(E(stash.layout.menu.noRecentReposMenuItem()))}C.trigger("stash.feature.repositories.recent.loaded",this,M)}).fail(function(){K.append(E(stash.layout.menu.errorLoadingRecentReposMenuItem()))}).always(function(){J.remove()})};E(window).on("load",G)}});;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:curl', location = 'js/wrm/curl-config.js' */
(function(){if(!window.WRM){window.WRM={}}window.curl={apiContext:WRM,defineContext:WRM}}());;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:curl', location = 'js/wrm/lib/curl-0.7.3.js' */
(function(a){var P="0.7.3",u="curl",p="define",G,v,g,d=a.document,l=d&&(d.head||d.getElementsByTagName("head")[0]),V=l&&l.getElementsByTagName("base")[0]||null,i={},N={},c={},A="addEventListener" in a?{}:{loaded:1,complete:1},m={},b=m.toString,y,k={},f={},h=false,O,t=/\?|\.js\b/,e=/^\/|^[^:]+:\/\//,L=/(\.)(\.?)(?:$|\/([^\.\/]+.*)?)/g,E=/\/\*[\s\S]*?\*\/|(?:[^\\])\/\/.*?[\n\r]/g,C=/require\s*\(\s*["']([^"']+)["']\s*\)|(?:[^\\]?)(["'])/g,M,x;function Q(){}function D(X,W){return b.call(X).indexOf("[object "+W)==0}function B(X){var W;X.path=J(X.path||X.location||"");W=X.main||"./main";if(!n(W)){W="./"+W}X.main=s(W,X.name+"/");X.config=X.config;return X}function n(W){return W.charAt(0)=="."}function j(W){return e.test(W)}function o(X,W){return J(X)+"/"+W}function J(W){return W&&W.charAt(W.length-1)=="/"?W.substr(0,W.length-1):W}function s(ab,X){var ac,W,Z,Y,aa;ac=1;W=ab;if(n(W)){Y=true;W=W.replace(L,function(ad,ae,af,ag){if(af){ac++}return ag||""})}if(Y){Z=X.split("/");aa=Z.length-ac;if(aa<0){return ab}Z.splice(aa,ac);return Z.concat(W||[]).join("/")}else{return W}}function S(X){var W=X.indexOf("!");return{resourceId:X.substr(W+1),pluginId:W>=0&&X.substr(0,W)}}function U(){}function z(X,W){U.prototype=X||m;var Z=new U();U.prototype=m;for(var Y in W){Z[Y]=W[Y]}return Z}function F(){var X,aa,W;X=this;aa=[];function ab(ac,ad,ae){aa.push([ac,ad,ae])}function Y(ag,ad){var af,ac,ae=0;while((af=aa[ae++])){ac=af[ag];if(ac){ac(ad)}}}W=function Z(ad,ac){ab=ad?function(ae,af){ae&&ae(ac)}:function(ae,af){af&&af(ac)};W=Q;Y(ad?0:1,ac);Y=Q;aa=y};this.then=function(ac,ad,ae){ab(ac,ad,ae);return X};this.resolve=function(ac){X.resolved=ac;W(true,ac)};this.reject=function(ac){X.rejected=ac;W(false,ac)};this.progress=function(ac){Y(2,ac)}}function r(W){return W instanceof F}function H(W,Z,X,Y){if(r(W)){return W.then(Z,X,Y)}else{return Z(W)}}function q(Y,X,Z){var W;return function(){if(--Y>=0&&X){W=X.apply(y,arguments)}if(Y==0&&Z){Z(W)}return W}}x={toAbsId:function(ab,aa,W){var Y,X,Z;Y=s(ab,aa);if(n(Y)){return Y}Z=S(Y);X=Z.pluginId;Y=X||Z.resourceId;if(Y in W.pathMap){Y=W.pathMap[Y].main||Y}if(X){if(X.indexOf("/")<0&&!(X in W.pathMap)){Y=o(W.pluginPath,X)}Y=Y+"!"+Z.resourceId}return Y},createContext:function(W,X,ab,aa){var Z;Z=new F();Z.id=X||"";Z.isPreload=aa;Z.depNames=ab;Z.config=W;function ad(ae){return x.toAbsId(ae,Z.id,W)}function ac(ae){return x.resolvePathInfo(ad(ae),W).url}function Y(ag,ak,af){var ae,aj,ai,ah;ae=ak&&function(){ak.apply(y,arguments[0])};if(D(ag,"String")){if(ae){throw new Error("require(id, callback) not allowed")}aj=ad(ag);ai=k[aj];if(!(aj in k)){throw new Error("Module not resolved: "+aj)}ah=r(ai)&&ai.exports;return ah||ai}else{H(x.getDeps(x.createContext(W,Z.id,ag,aa)),ae,af)}}Z.require=Y;Y.toUrl=ac;Z.toAbsId=ad;return Z},createResourceDef:function(W,ad,ab){var aa,X,Z;aa=x.createContext(W,ad,y,ab);X=aa.resolve;Z=q(1,function(af){aa.deps=af;try{return x.executeDefFunc(aa)}catch(ae){aa.reject(ae)}});aa.resolve=function Y(ae){H(ab||h,function(){X((k[aa.id]=f[aa.url]=Z(ae)))})};aa.exportsReady=function ac(ae){H(ab||h,function(){if(aa.exports){Z(ae);aa.progress(N)}})};return aa},createPluginDef:function(W,aa,Z,Y){var X;X=x.createContext(W,Z,y,Y);return X},getCjsRequire:function(W){return W.require},getCjsExports:function(W){return W.exports||(W.exports={})},getCjsModule:function(X){var W=X.module;if(!W){W=X.module={id:X.id,uri:x.getDefUrl(X),exports:x.getCjsExports(X),config:function(){return X.config}};W.exports=W.exports}return W},getDefUrl:function(W){return W.url||(W.url=x.checkToAddJsExt(W.require.toUrl(W.id),W.config))},setApi:function(W){var Y,Z,X,aa,ab,ac;Y=u;Z=p;X=aa=a;ab=" already exists";if(W){ac=W.overwriteApi||W.overwriteApi;Y=W.apiName||W.apiName||Y;X=W.apiContext||W.apiContext||X;Z=W.defineName||W.defineName||Z;aa=W.defineContext||W.defineContext||aa;if(v&&D(v,"Function")){a[u]=v}v=null;if(g&&D(g,"Function")){a[p]=g}g=null;if(!ac){if(X[Y]&&X[Y]!=K){throw new Error(Y+ab)}if(aa[Z]&&aa[Z]!=I){throw new Error(Z+ab)}}}X[Y]=K;aa[Z]=I},config:function(aa){var ab,Z,W,X;if("baseUrl" in aa){aa.baseUrl=aa.baseUrl}if("main" in aa){aa.main=aa.main}if("preloads" in aa){aa.preloads=aa.preloads}if("pluginPath" in aa){aa.pluginPath=aa.pluginPath}if("dontAddFileExt" in aa||aa.dontAddFileExt){aa.dontAddFileExt=new RegExp(aa.dontAddFileExt||aa.dontAddFileExt)}ab=G;Z=z(ab,aa);Z.pathMap=z(ab.pathMap);W=aa.plugins||{};Z.plugins=z(ab.plugins);Z.paths=z(ab.paths,aa.paths);Z.packages=z(ab.packages,aa.packages);Z.pathList=[];function ac(af,am){var ah,aj,al,ak,an,ai;for(var ag in af){al=af[ag];if(D(al,"String")){al={path:af[ag]}}al.name=al.name||ag;an=Z;ak=S(J(al.name));ah=ak.resourceId;aj=ak.pluginId;if(aj){an=W[aj];if(!an){an=W[aj]=z(Z);an.pathMap=z(Z.pathMap);an.pathList=[]}delete af[ag]}if(am){ai=B(al);if(ai.config){ai.config=z(Z,ai.config)}}else{ai={path:J(al.path)}}ai.specificity=ah.split("/").length;if(ah){an.pathMap[ah]=ai;an.pathList.push(ah)}else{an.baseUrl=x.resolveUrl(al.path,Z)}}}function ad(af){var ag=af.pathMap;af.pathRx=new RegExp("^("+af.pathList.sort(function(ai,ah){return ag[ah].specificity-ag[ai].specificity}).join("|").replace(/\/|\./g,"\\$&")+")(?=\\/|$)");delete af.pathList}ac(aa.packages,true);ac(aa.paths,false);for(X in W){var Y=x.toAbsId(X+"!","",Z);Z.plugins[Y.substr(0,Y.length-1)]=W[X]}W=Z.plugins;for(X in W){W[X]=z(Z,W[X]);var ae=W[X].pathList;if(ae){W[X].pathList=ae.concat(Z.pathList);ad(W[X])}}for(X in ab.pathMap){if(!Z.pathMap.hasOwnProperty(X)){Z.pathList.push(X)}}ad(Z);return Z},checkPreloads:function(W){var X;X=W&&W.preloads;if(X&&X.length>0){H(h,function(){h=x.getDeps(x.createContext(G,y,X,true))})}},resolvePathInfo:function(Z,X){var Y,ab,aa,W;Y=X.pathMap;if(!j(Z)){aa=Z.replace(X.pathRx,function(ac){ab=Y[ac]||{};W=ab.config;return ab.path||""})}else{aa=Z}return{config:W||G,url:x.resolveUrl(aa,X)}},resolveUrl:function(Y,W){var X=W.baseUrl;return X&&!j(Y)?o(X,Y):Y},checkToAddJsExt:function(X,W){return X+((W||G).dontAddFileExt.test(X)?"":".js")},loadScript:function(Z,ab,X){var Y=d.createElement("script");function aa(ac){ac=ac||a.event;if(ac.type=="load"||A[Y.readyState]){delete c[Z.id];Y.onload=Y.onreadystatechange=Y.onerror="";ab()}}function W(ac){X(new Error("Syntax or http error: "+Z.url))}Y.onload=Y.onreadystatechange=aa;Y.onerror=W;Y.type=Z.mimetype||"text/javascript";Y.charset="utf-8";Y.async=!Z.order;Y.src=Z.url;c[Z.id]=Y;l.insertBefore(Y,V);return Y},extractCjsDeps:function(X){var Y,W=[],Z;Y=typeof X=="string"?X:X.toSource?X.toSource():X.toString();Y.replace(E,"").replace(C,function(aa,ac,ab){if(ab){Z=Z==ab?y:Z}else{if(!Z){W.push(ac)}}return""});return W},fixArgs:function(X){var ac,aa,Y,ab,W,Z;W=X.length;Y=X[W-1];ab=D(Y,"Function")?Y.length:-1;if(W==2){if(D(X[0],"Array")){aa=X[0]}else{ac=X[0]}}else{if(W==3){ac=X[0];aa=X[1]}}if(!aa&&ab>0){Z=true;aa=["require","exports","module"].slice(0,ab).concat(x.extractCjsDeps(Y))}return{id:ac,deps:aa||[],res:ab>=0?Y:function(){return Y},cjs:Z}},executeDefFunc:function(Y){var X,W;W=Y.cjs?Y.exports:y;X=Y.res.apply(W,Y.deps);if(X===y&&Y.exports){X=Y.module?(Y.exports=Y.module.exports):Y.exports}return X},defineResource:function(X,W){X.res=W.res;X.cjs=W.cjs;X.depNames=W.deps;x.getDeps(X)},getDeps:function(X){var ab,af,ai,ad,ag,aa,W,aj,ah;ai=[];af=X.depNames;ad=af.length;if(af.length==0){Y()}function ae(am,ak,al){ai[ak]=am;if(al){aj(am,ak)}}aj=q(ad,ae,ac);ah=q(ad,ae,Y);for(ab=0;ab<ad;ab++){W=af[ab];if(W in M){ah(M[W](X),ab,true);if(X.exports){X.progress(i)}}else{if(!W){ah(y,ab,true)}else{Z(W,ab)}}}return X;function Z(am,al){var an,ak,ap,ao;an=q(1,function(aq){ak(aq);ah(aq,al)});ak=q(1,function(aq){aj(aq,al)});ap=x.fetchDep(am,X);ao=r(ap)&&ap.exports;if(ao){ak(ao)}H(ap,an,X.reject,X.exports&&function(aq){if(ap.exports){if(aq==i){ak(ap.exports)}else{if(aq==N){an(ap.exports)}}}})}function Y(){X.resolve(ai)}function ac(){X.exportsReady&&X.exportsReady(ai)}},fetchResDef:function(W){x.getDefUrl(W);x.loadScript(W,function(){var X=O;O=y;if(W.useNet!==false){if(!X||X.ex){W.reject(new Error(((X&&X.ex)||"define() missing or duplicated: "+W.url)))}else{x.defineResource(W,X)}}},W.reject);return W},fetchDep:function(ai,X){var W,Z,ae,ab,ah,ad,aa,aj,af,Y,ac,ag;W=X.toAbsId;Z=X.isPreload;ae=X.config||G;ab=S(W(ai));aj=ab.resourceId;ah=ab.pluginId||aj;af=x.resolvePathInfo(ah,ae);if(ab.pluginId){ad=ah}else{ad=af.config.moduleLoader||af.config.moduleLoader;if(ad){aj=ah;ah=ad;af=x.resolvePathInfo(ad,ae)}}if(ah in k){Y=k[ah]}else{if(af.url in f){Y=k[ah]=f[af.url]}else{Y=x.createResourceDef(af.config,ah,Z);Y.url=x.checkToAddJsExt(af.url,af.config);k[ah]=f[af.url]=Y;x.fetchResDef(Y)}}if(ah==ad){ac=new F();ag=ae.plugins[ad]||ae;H(Y,function(am){var ao,ak,an;an=am.dynamic;if("normalize" in am){aj=am.normalize(aj,W,Y.config)||""}else{aj=W(aj)}ak=ad+"!"+aj;ao=k[ak];if(!(ak in k)){ao=x.createPluginDef(ag,ak,aj,Z);if(!an){k[ak]=ao}var al=function(ap){ao.resolve(ap);if(!an){k[ak]=ap}};al.resolve=al;al.reject=al.error=ao.reject;am.load(aj,ao.require,al,ag)}if(ac!=ao){H(ao,ac.resolve,ac.reject,ac.progress)}},ac.reject)}return ac||Y},getCurrentDefName:function(){var W;if(!D(a.opera,"Opera")){for(var X in c){if(c[X].readyState=="interactive"){W=X;break}}}return W}};M={require:x.getCjsRequire,exports:x.getCjsExports,module:x.getCjsModule};function K(){var X=[].slice.call(arguments),W;if(D(X[0],"Object")){W=X.shift();R(W)}return new w(X[0],X[1],X[2])}function R(W){if(W){x.setApi(W);G=x.config(W);x.checkPreloads(W);if("main" in W){setTimeout(function(){var X;X=x.createContext(G,y,[].concat(W.main));x.getDeps(X)},0)}}}function w(Y,ab,X,aa){var Z,W;W=x.createContext(G,y,[].concat(Y));this["then"]=Z=function(ac,ad){H(W,function(ae){if(ac){ac.apply(y,ae)}},function(ae){if(ad){ad(ae)}else{throw ae}});return this};this["next"]=function(ae,ac,ad){return new w(ae,ac,ad,W)};this["config"]=R;if(ab||X){Z(ab,X)}H(aa,function(){x.getDeps(W)})}K.version=P;K.config=R;function T(W){var Z,X,Y;Z=W.id;if(Z==y){if(O!==y){O={ex:"Multiple anonymous defines in url"}}else{if(!(Z=x.getCurrentDefName())){O=W}}}if(Z!=y){X=k[Z];if(!(Z in k)){Y=x.resolvePathInfo(Z,G);X=x.createResourceDef(Y.config,Z);k[Z]=X}if(!r(X)){throw new Error("duplicate define: "+Z)}X.useNet=false;x.defineResource(X,W)}}function I(){var W=x.fixArgs(arguments);T(W)}I.amd={plugins:true,jQuery:true,curl:P};G={baseUrl:"",pluginPath:"curl/plugin",dontAddFileExt:t,paths:{},packages:{},plugins:{},pathMap:{},pathRx:/$^/};v=a[u];g=a[p];if(!v||D(v,"Function")){x.setApi()}else{a[u]=y;R(v)}k[u]=K;k["curl/_privileged"]={core:x,cache:k,config:function(){return G},_define:T,_curl:K,Promise:F}}(this.window||(typeof global!="undefined"&&global)||this));;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:curl', location = 'js/wrm/lib/curl-css-0.7.3.js' */
(function(B){var z="createElement",s="parentNode",f=B.setTimeout,H=B.document,k,x=H&&H.createStyleSheet&&!(H.documentMode>=10),v=[],u=[],C=[],i=12,F,g="HTTP or network error.",l={};if(H){k=H.head||H.getElementsByTagName("head")[0];if(x){F=c}else{F=t}}function q(J,I){l[J]=l[J]||I}function y(){var I;I=H[z]("link");I.rel="stylesheet";I.type="text/css";return I}function r(J,I){J.onload=function(){q("load",true);I()}}function n(J,I){J.onerror=function(){q("error",true);I()}}function c(K,I,M){var L;C.push({url:K,cb:I,eb:function J(){M(new Error(g))}});L=h();if(L){m(L)}}function m(K){var J,I;J=C.shift();I=K.styleSheet;if(J){K.onload=function(){J.cb(J.ss);m(K)};K.onerror=function(){J.eb();m(K)};J.ss=I.imports[I.addImport(J.url)]}else{e(K);G(K)}}function G(I){u.push(I)}function h(){var I;I=u.shift();if(!I&&v.length<i){I=H.createElement("style");v.push(I);k.appendChild(I)}return I}function b(L){var K,J,M;if(!L.href||!o()){return false}K=false;try{J=L.sheet;if(J){M=J.cssRules;K=M===null;if(!K&&M){J.insertRule("-curl-css-test {}",0);J.deleteRule(0);K=true}}}catch(I){K=Object.prototype.toString.call(window.opera)!="[object Opera]"&&/security|denied/i.test(I.message)}return K}function e(I){I.onload=I.onerror=j}function w(I){return I.onload==j||!I.onload}function E(J,K,I){if(l.load){return}if(b(J)){I(J.sheet)}else{if(!w(J)){f(function(){E(J,K,I)},K)}}}function A(J,K,I){if(l.error){return}}function p(J,L,I){function K(){if(w(J)){return}e(J);d(function(){I(J.sheet)})}r(J,K);E(J,L,K)}function D(K,L,I){function J(){if(w(K)){return}e(K);I(new Error(g))}n(K,J);A(K,L,J)}function t(J,I,K,M){var L;L=y();p(L,M,I);D(L,M,K);L.href=J;k.appendChild(L)}function d(I){function J(){if(o()){I()}else{f(J,10)}}J()}function o(){return !H.readyState||H.readyState=="complete"}function a(I,J){return I.lastIndexOf(".")<=I.lastIndexOf("/")?I+"."+J:I}function j(){}WRM.define("curl/plugin/css",{normalize:function(N,J){var L,M;if(!N){return N}L=[N];M=[];for(var K=0,I=L.length;K<I;K++){M.push(J(L[K]))}return M.join(",")},load:function(R,L,U,K){var Q,J,V,S,M,O;Q=[];J=[R||""];V=K.cssWatchPeriod||50;S=K.cssNoWait;M=J.length;function N(W){if(J.length>1){Q.push(W)}if(--M==0){U(J.length==1?W:Q)}}function P(X){var W;W=U.reject||function(Y){throw Y};W(X)}for(O=0;O<J.length;O++){R=J[O];var I,T;I=a(L.toUrl(R),"css");if(S){T=y();T.href=I;k.appendChild(T);N(T.sheet||T.styleSheet)}else{F(I,N,P,V)}}},"plugin-builder":"./builder/css",pluginBuilder:"./builder/css"})})(this);;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:curl', location = 'js/wrm/lib/curl-js-0.7.3.js' */
(function(b,c,a){WRM.define("curl/plugin/js",["curl/_privileged"],function(m){var f={},j=[],h=c&&c.createElement("script").async==true,l,k,g;l=m.Promise;function i(n,o){return n.lastIndexOf(".")<=n.lastIndexOf("/")?n+"."+o:n}function e(o,u,q){var v,s,p;v=new Date().valueOf()+(o.timeoutMsec||300000);function n(){s=true;if(o.exports){o.resolved=a(o.exports)}if(!o.exports||o.resolved){u(p)}else{q()}}function r(w){s=true;q(w)}function t(){if(!s){if(v<new Date()){q()}else{setTimeout(t,10)}}}if(q&&o.exports){setTimeout(t,10)}p=m.core.loadScript(o,n,r)}function d(n,o){e(n,function(){var p=j.shift();k=j.length>0;if(p){d.apply(null,p)}o.resolve(n.resolved||true)},function(p){o.reject(p)})}return{dynamic:true,normalize:function(q,p,o){var n=q.indexOf("!");return n>=0?p(q.substr(0,n))+q.substr(n):p(q)},load:function(o,r,w,q){var s,t,u,v,n,p,y;s=o.indexOf("!order")>0;t=o.indexOf("!exports=");u=t>0&&o.substr(t+9);v="prefetch" in q?q.prefetch:true;o=s||t>0?o.substr(0,o.indexOf("!")):o;n=i(r.toUrl(o),"js");function x(z){(w.error||function(A){throw A})(z)}if(n in f){if(f[n] instanceof l){f[n].then(w,x)}else{w(f[n])}}else{p={name:o,url:n,order:s,exports:u,timeoutMsec:q.timeout};f[n]=y=new l();y.then(function(z){f[n]=z;w(z)},x);if(s&&!h&&k){j.push([p,y]);if(v){p.mimetype="text/cache";e(p,function(z){z&&z.parentNode.removeChild(z)},function(){});p.mimetype=""}}else{k=k||s;d(p,y)}}}}})}(this,this.document,function(){try{return eval(arguments[0])}catch(ex){return}}));;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/jquery.js' */
WRM.define("wrm/jquery",function(){return AJS.$});;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/underscore.js' */
WRM.define("wrm/_",function(){var a={filter:function(f,d){var b=[];for(var c=0;c<f.length;++c){var e=f[c];if(d(e)){b.push(e)}}return b},map:function(d,c){var e=[];for(var b=0;b<d.length;++b){e.push(c(d[b]))}return e},each:function(d,c){if(d.length===+d.length){for(var b=0;b<d.length;++b){c(d[b])}}else{for(var e in d){if(d.hasOwnProperty(e)){c(d[e],e)}}}},bind:function(c,b){return function(){c.apply(b,Array.prototype.slice.call(arguments))}},isArray:function(b){return Object.prototype.toString.call(b)=="[object Array]"},isUndefined:function(b){return b===void 0},isNull:function(b){return b===null}};return a});;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/builder.js' */
WRM.define("wrm/builder",function(){var a=function(d){var b="(?:$|\\?.*)";var c="^"+d;this.patterns={js:{superBatch:new RegExp(c+"/superbatch/js/batch.js"+b),contextBatch:new RegExp(c+"/contextbatch/js/(.*?)/batch.js"+b),resourceBatch:new RegExp(c+"/batch/(.*?)/(.*).js"+b),noBatch:new RegExp(c+"/resources/(.*?)/(.*).js"+b)},css:{superBatch:new RegExp(c+"/superbatch/css/batch.css"+b),contextBatch:new RegExp(c+"/contextbatch/css/(.*?)/batch.css"+b),resourceBatch:new RegExp(c+"/batch/(.*?)/(.*).css"+b),noBatch:new RegExp(c+"/resources/(.*?)/(.*).css"+b)}}};a.prototype={initialize:function(c){var g,b=c.getElementsByTagName("script"),e=c.getElementsByTagName("link"),f={superBatch:false,modules:[],contexts:[]};for(g=0;g<b.length;++g){var d=b[g];if(d.getAttribute("src")){this._inspectMatches(d.getAttribute("src"),this.patterns.js,f)}}for(g=0;g<e.length;++g){var h=e[g];if(h.getAttribute("href")){this._inspectMatches(h.getAttribute("href"),this.patterns.css,f)}}return f},getModulesAndContextsFromScriptUrl:function(c){var b={superBatch:false,modules:[],contexts:[]};this._inspectMatches(c,this.patterns.js,b);return b},_inspectMatches:function(d,f,c){var b;b=d.match(f.superBatch);if(b){c.superBatch=true;return}b=d.match(f.contextBatch);if(b){var g=b[1].split(",");for(var e=0;e<g.length;++e){this._addToLoadedList(c.contexts,g[e])}return}b=d.match(f.resourceBatch);if(b){this._addToLoadedList(c.modules,b[1]);return}b=d.match(f.noBatch);if(b){this._addToLoadedList(c.modules,b[1]);return}},_addToLoadedList:function(d,c){for(var b=0;b<d.length;++b){if(d[b]===c){return}}d.push(c)}};return a});;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/ie-only-filter.js' */
WRM.define("wrm/ie-only-filter",["wrm/jquery","wrm/_"],function(c,a){function b(d){var e=c.browser.msie;return a.filter(d,function(f){return f.ieOnly?e:true})}return b});;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/conditional-comment-filter.js' */
WRM.define("wrm/conditional-comment-filter",["wrm/jquery","wrm/_"],function(c,a){function b(e){var f=c.browser.msie;var d=c.browser.version;return a.filter(e,function(h){var g=h.conditionalComment;if(!g){return true}if(!f||d>9){return false}g=g.toLowerCase();switch(g){case"ie":return true;case"lt ie 9":return d<9;case"lte ie 9":return d<=9;case"ie 9":return d==9;case"gt ie 9":return d>9;case"gte ie 9":return d>=9;case"lt ie 8":return d<8;case"lte ie 8":return d<=8;case"ie 8":return d==8;case"gt ie 8":return d>8;case"gte ie 8":return d>=8;default:AJS.log("Cannot parse conditional comment "+g);return false}})}return b});;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/resource-base-url-pattern.js' */
WRM.define("wrm/resource-base-url-pattern",function(){return WRM.data.claim("com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager.resource-base-url-pattern")});;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/require-handler.js' */
WRM.define("wrm/require-handler",["wrm/jquery","wrm/_","wrm/builder","wrm/conditional-comment-filter","wrm/ie-only-filter","wrm/resource-base-url-pattern"],function(e,h,i,g,a,c){var f=/^wr!(.*)$/,d=/^wrc!(.*)$/;var b=function(){this._requireCache={}};b.prototype={require:function(k,j){if(!h.isArray(k)){k=[k]}if(!this._requireCache.hasOwnProperty(k)){this._requireCache[k]=this._resolveAsync(k)}var l=this._requireCache[k];if(j){l.done(function(){j.apply(this,arguments)})}return l},_resolveAsync:function(l){var j=e.Deferred();var k=this;this._getScriptsForResources(l).done(function(p){if(p.unparsedData){window.WRM._unparsedData||(window.WRM._unparsedData={});h.each(p.unparsedData,function(u,t){window.WRM._unparsedData[t]=u})}var q=[];var s=[];var m=k._filter(p.resources);for(var o=0;o<m.length;++o){var r=m[o];var n=r.url;if(r.resourceType==="JAVASCRIPT"){if(!k._isJSInInitLoad(n)){q.push("js!"+n+"!order")}}else{if(r.resourceType==="CSS"){if(!k._isCSSInInitLoad(n)){if(r.media&&"all"!==r.media){s.push(r)}else{q.push("css!"+n)}}}else{AJS.log("Unknown resource type required: "+n)}}}AJS.log("Downloading resources:\n"+q.join("\n"));WRM.curl(q,function(){h.each(s,function(u){k._loadCssImmediate(u)});var t=h.map(l,function(){return window});j.resolveWith(k,t)},function(){j.rejectWith(k,arguments)})});return j.promise()},_loadCssImmediate:function(k){AJS.log("WARN: asynchronously loading a CSS resource containing a media query: "+k.url);var j='<link rel="stylesheet" type="text/css" href="'+k.url+'" media="'+k.media+'" />';e(j).appendTo("head")},_getScriptsForResources:function(k){if(!this._builder){this._builder=new i(c);this._initLoadResources=this._builder.initialize(document)}var j=[];var l=[];h.each(k,function(n){var m;if(m=n.match(f)){j.push(m[1])}else{if(m=n.match(d)){l.push(m[1])}}});return e.ajax({url:AJS.contextPath()+"/rest/webResources/1.0/resources",type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify({r:j,c:l,xc:this._initLoadResources.contexts,xr:this._initLoadResources.modules})})},_isJSInInitLoad:function(j){return e("script[src='"+j+"']").length>0},_isCSSInInitLoad:function(j){return e("link[href='"+j+"']").length>0},_filter:function(k){if(!this._filters){this._filters=[g,a]}var j=k;h.each(this._filters,function(l){j=l(j)});return j}};return b});;
;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/index.js' */
WRM.curl(["wrm/require-handler"],function(b){var a;WRM.require=function(d,c){if(!a){a=new b()}return a.require(d,c)}});;
;/* module-key = 'com.atlassian.stash.plugin.stash-inbox-plugin:inbox-dialog', location = '/static/inbox/inbox.soy' */
// This file was automatically generated from inbox.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.plugin.inbox.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.plugin == 'undefined') { stash.plugin = {}; }
if (typeof stash.plugin.inbox == 'undefined') { stash.plugin.inbox = {}; }


stash.plugin.inbox.dialogContents = function(opt_data, opt_ignored) {
  var output = '<h2>' + soy.$$escapeHtml("My pull requests") + '</h2><div class=\'inbox-table-wrapper aui-tabs horizontal-tabs\'><ul class="tabs-menu">';
  var roleList6 = opt_data.roles;
  var roleListLen6 = roleList6.length;
  for (var roleIndex6 = 0; roleIndex6 < roleListLen6; roleIndex6++) {
    var roleData6 = roleList6[roleIndex6];
    output += '<li class="menu-item"><a href="#inbox-pull-request-' + soy.$$escapeHtml(roleData6.id) + '">' + soy.$$escapeHtml(roleData6.title) + '</a></li>';
  }
  output += '</ul>';
  var roleList14 = opt_data.roles;
  var roleListLen14 = roleList14.length;
  for (var roleIndex14 = 0; roleIndex14 < roleListLen14; roleIndex14++) {
    var roleData14 = roleList14[roleIndex14];
    output += '<div id="inbox-pull-request-' + soy.$$escapeHtml(roleData14.id) + '" class="tabs-pane">' + stash.feature.pullRequest.pullRequestTable({pullRequestsPage: null, scope: 'global', id: 'inbox-pull-request-table-' + roleData14.id}) + '</div>';
  }
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  stash.plugin.inbox.dialogContents.soyTemplateName = 'stash.plugin.inbox.dialogContents';
}


stash.plugin.inbox.triggerIcon = function(opt_data, opt_ignored) {
  return '<span class=\'aui-icon aui-icon-small ' + ((opt_data.isEmpty) ? 'aui-iconfont-workbox-empty' : 'aui-iconfont-workbox') + '\'></span>';
};
if (goog.DEBUG) {
  stash.plugin.inbox.triggerIcon.soyTemplateName = 'stash.plugin.inbox.triggerIcon';
}


stash.plugin.inbox.emptyInboxMessage = function(opt_data, opt_ignored) {
  return '<span class="aui-icon aui-icon-large aui-iconfont-workbox-empty">' + soy.$$escapeHtml("No pull requests to approve") + '</span><h3>' + soy.$$escapeHtml("Inbox Zero") + '</h3>';
};
if (goog.DEBUG) {
  stash.plugin.inbox.emptyInboxMessage.soyTemplateName = 'stash.plugin.inbox.emptyInboxMessage';
}
;
;/* module-key = 'com.atlassian.stash.plugin.stash-inbox-plugin:inbox-dialog', location = '/static/inbox/inbox.js' */
define("plugin/inbox/inbox",["aui","jquery","underscore","stash/api/util/events","stash/api/util/navbuilder","stash/api/util/state","stash/api/util/server","exports"],function(h,f,s,a,q,i,m,t){var u,b;function k(v){return q.newBuilder().addPathComponents("rest","inbox","latest","pull-requests").withParams({role:v})}function c(){return q.newBuilder().addPathComponents("rest","inbox","latest","pull-requests","count").build()}var o=function(v){if(v.keyCode===f.ui.keyCode.ESCAPE){u.hide();v.preventDefault()}};var p=function(){u.hide()};var n=function(y,v){var z={title:"Could not retrieve inbox",message:"An unknown error occurred"};var x={};if(v){x=v.errors?v.errors[0]:v}var w=f.extend({},z,x);y.html(f(stash.widget.focusMessage.error({title:w.title,text:w.message,extraClasses:"communication-error"})));return false};function r(v){l(v,[{id:"reviewer",title:"Reviewing"},{id:"author",title:"Created"}])}function l(A,w){var z=require("widget/avatar-list");var v=require("feature/pull-request/pull-request-table");var x=f(stash.plugin.inbox.dialogContents({roles:w}));A.append(x);var B=function(E,F,C,D){return n.call(this,A,D)};function y(E,C){var D=new v("open",null,s.partial(k,E),{scope:"global",target:"#inbox-pull-request-table-"+E,scrollPaneSelector:".inbox-table-wrapper",bufferPixels:50,pageSize:10,spinnerSize:"medium",noneFoundMessageHtml:stash.plugin.inbox.emptyInboxMessage(),dataLoadedEvent:"stash.plugin.inbox.dataLoaded."+E,statusCode:{0:B,401:B,500:B,502:B}});D.handleErrors=f.noop;D.init();if(C){h.tabs.change(A.find("[href=#inbox-pull-request-"+E+"]"))}}s.each(w,function(D,C){y(D.id,C===0)});A.find(".tabs-menu").delegate("a","click",function(C){h.tabs.change(f(this),C);C&&C.preventDefault()});z.init()}var j=function(w,v,x){x();f(document).on("keyup",o);h.dialog2.on("show",p);e(w,s.partial(r,w))};var e=s.once(function(v,x){var w=f('<div class="loading-resource-spinner"></div>');v.empty().append(w);w.show().spin("medium");WRM.require("wrc!stash.pullRequest.inbox").always(function(){w.spinStop().remove()}).done(function(){x()})});var g=function(){f(document).off("keyup",o);h.dialog2.off("show",p);if(f(document.activeElement).closest("#inbox-pull-requests-content").length){document.activeElement.blur()}};var d=function(){m.rest({url:c(),type:"GET",statusCode:{"*":false}}).done(function(w){if(w.count>0){var x=f(aui.badges.badge({text:w.count}));b.html(stash.plugin.inbox.triggerIcon({isEmpty:false})).append(x);setTimeout(function(){x.addClass("visible")},0)}else{var v=500;b.find(".aui-badge").removeClass("visible");setTimeout(function(){b.html(stash.plugin.inbox.triggerIcon({isEmpty:true}))},v)}b.attr("data-countLoaded",true)})};t.onReady=function(){b=f("#inbox-pull-requests");if(b.length&&i.getCurrentUser()){b.html(stash.plugin.inbox.triggerIcon({isEmpty:true}));u=h.InlineDialog(b,"inbox-pull-requests-content",j,{width:870,hideCallback:g});d();var v=function(w){if(w.user.name===i.getCurrentUser().name){d()}};a.on("stash.widget.approve-button.added",v);a.on("stash.widget.approve-button.removed",v)}}});AJS.$(document).ready(function(){require("plugin/inbox/inbox").onReady()});;

Zerion Mini Shell 1.0