diff --git a/org.civicrm.reqangular/dist/reqangular.min.js b/org.civicrm.reqangular/dist/reqangular.min.js index db88416ac0e..be0a032ed9c 100644 --- a/org.civicrm.reqangular/dist/reqangular.min.js +++ b/org.civicrm.reqangular/dist/reqangular.min.js @@ -113,7 +113,7 @@ s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),e.precision(y)):[[r, Il.call=wa.call,Il.empty=wa.empty,Il.node=wa.node,Il.size=wa.size,na.transition=function(e,t){return e&&e.transition?Ol?e.transition(t):e:na.selection().transition(e)},na.transition.prototype=Il,Il.select=function(e){var t,n,r,i=this.id,o=this.namespace,a=[];e=M(e);for(var s=-1,l=this.length;++so;o++){i.push(t=[]);for(var n=this[o],s=0,l=n.length;l>s;s++)(r=n[s])&&e.call(r,r.__data__,s,o)&&t.push(r)}return zo(i,this.namespace,this.id)},Il.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):V(this,null==t?function(t){t[r][n].tween.remove(e)}:function(i){i[r][n].tween.set(e,t)})},Il.attr=function(e,t){function n(){this.removeAttribute(s)}function r(){this.removeAttributeNS(s.space,s.local)}function i(e){return null==e?n:(e+="",function(){var t,n=this.getAttribute(s);return n!==e&&(t=a(n,e),function(e){this.setAttribute(s,t(e))})})}function o(e){return null==e?r:(e+="",function(){var t,n=this.getAttributeNS(s.space,s.local);return n!==e&&(t=a(n,e),function(e){this.setAttributeNS(s.space,s.local,t(e))})})}if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var a="transform"==e?qr:yr,s=na.ns.qualify(e);return Bo(this,"attr."+e,t,s.local?o:i)},Il.attrTween=function(e,t){function n(e,n){var r=t.call(this,e,n,this.getAttribute(i));return r&&function(e){this.setAttribute(i,r(e))}}function r(e,n){var r=t.call(this,e,n,this.getAttributeNS(i.space,i.local));return r&&function(e){this.setAttributeNS(i.space,i.local,r(e))}}var i=na.ns.qualify(e);return this.tween("attr."+e,i.local?r:n)},Il.style=function(e,n,r){function i(){this.style.removeProperty(e)}function o(n){return null==n?i:(n+="",function(){var i,o=t(this).getComputedStyle(this,null).getPropertyValue(e);return o!==n&&(i=yr(o,n),function(t){this.style.setProperty(e,i(t),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof e){2>a&&(n="");for(r in e)this.style(r,e[r],n);return this}r=""}return Bo(this,"style."+e,n,o)},Il.styleTween=function(e,n,r){function i(i,o){var a=n.call(this,i,o,t(this).getComputedStyle(this,null).getPropertyValue(e));return a&&function(t){this.style.setProperty(e,a(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+e,i)},Il.text=function(e){return Bo(this,"text",e,Yo)},Il.remove=function(){var e=this.namespace;return this.each("end.transition",function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Il.ease=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].ease:("function"!=typeof e&&(e=na.ease.apply(na,arguments)),V(this,function(r){r[n][t].ease=e}))},Il.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:V(this,"function"==typeof e?function(r,i,o){r[n][t].delay=+e.call(r,r.__data__,i,o)}:(e=+e,function(r){r[n][t].delay=e}))},Il.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:V(this,"function"==typeof e?function(r,i,o){r[n][t].duration=Math.max(1,e.call(r,r.__data__,i,o))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Il.each=function(e,t){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Nl,o=Ol;try{Ol=n,V(this,function(t,i,o){Nl=t[r][n],e.call(t,t.__data__,i,o)})}finally{Nl=i,Ol=o}}else V(this,function(i){var o=i[r][n];(o.event||(o.event=na.dispatch("start","end","interrupt"))).on(e,t)});return this},Il.transition=function(){for(var e,t,n,r,i=this.id,o=++Pl,a=this.namespace,s=[],l=0,u=this.length;u>l;l++){s.push(e=[]);for(var t=this[l],c=0,f=t.length;f>c;c++)(n=t[c])&&(r=n[a][i],Go(n,c,a,o,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),e.push(n)}return zo(s,a,o)},na.svg.axis=function(){function e(e){e.each(function(){var e,u=na.select(this),c=this.__chart__||n,f=this.__chart__=n.copy(),d=null==l?f.ticks?f.ticks.apply(f,s):f.domain():l,p=null==t?f.tickFormat?f.tickFormat.apply(f,s):y:t,h=u.selectAll(".tick").data(d,f),m=h.enter().insert("g",".domain").attr("class","tick").style("opacity",Ma),g=na.transition(h.exit()).style("opacity",Ma).remove(),v=na.transition(h.order()).style("opacity",1),b=Math.max(i,0)+a,$=ji(f),w=u.selectAll(".domain").data([0]),x=(w.enter().append("path").attr("class","domain"),na.transition(w));m.append("line"),m.append("text");var C,k,E,S,_=m.select("line"),M=v.select("line"),T=h.select("text").text(p),D=m.select("text"),A=v.select("text"),O="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(e=Ko,C="x",E="y",k="x2",S="y2",T.attr("dy",0>O?"0em":".71em").style("text-anchor","middle"),x.attr("d","M"+$[0]+","+O*o+"V0H"+$[1]+"V"+O*o)):(e=Jo,C="y",E="x",k="y2",S="x2",T.attr("dy",".32em").style("text-anchor",0>O?"end":"start"),x.attr("d","M"+O*o+","+$[0]+"H0V"+$[1]+"H"+O*o)),_.attr(S,O*i),D.attr(E,O*b),M.attr(k,0).attr(S,O*i),A.attr(C,0).attr(E,O*b),f.rangeBand){var N=f,R=N.rangeBand()/2;c=f=function(e){return N(e)+R}}else c.rangeBand?c=f:g.call(e,f,c);m.call(e,c,f),v.call(e,f,f)})}var t,n=na.scale.linear(),r=Fl,i=6,o=6,a=3,s=[10],l=null;return e.scale=function(t){return arguments.length?(n=t,e):n},e.orient=function(t){return arguments.length?(r=t in jl?t+"":Fl,e):r},e.ticks=function(){return arguments.length?(s=arguments,e):s},e.tickValues=function(t){return arguments.length?(l=t,e):l},e.tickFormat=function(n){return arguments.length?(t=n,e):t},e.tickSize=function(t){var n=arguments.length;return n?(i=+t,o=+arguments[n-1],e):i},e.innerTickSize=function(t){return arguments.length?(i=+t,e):i},e.outerTickSize=function(t){return arguments.length?(o=+t,e):o},e.tickPadding=function(t){return arguments.length?(a=+t,e):a},e.tickSubdivide=function(){return arguments.length&&e},e};var Fl="bottom",jl={top:1,right:1,bottom:1,left:1};na.svg.brush=function(){function e(t){t.each(function(){var t=na.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=t.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=t.selectAll(".resize").data(m,y);s.exit().remove(),s.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return Ll[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",e.empty()?"none":null);var l,f=na.transition(t),d=na.transition(a);u&&(l=ji(u),d.attr("x",l[0]).attr("width",l[1]-l[0]),r(f)),c&&(l=ji(c),d.attr("y",l[0]).attr("height",l[1]-l[0]),i(f)),n(f)})}function n(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+f[+/e$/.test(e)]+","+d[+/^s/.test(e)]+")"})}function r(e){e.select(".extent").attr("x",f[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(e){e.select(".extent").attr("y",d[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",d[1]-d[0])}function o(){function o(){32==na.event.keyCode&&(T||(b=null,A[0]-=f[1],A[1]-=d[1],T=2),k())}function m(){32==na.event.keyCode&&2==T&&(A[0]+=f[1],A[1]+=d[1],T=0,k())}function g(){var e=na.mouse(w),t=!1;$&&(e[0]+=$[0],e[1]+=$[1]),T||(na.event.altKey?(b||(b=[(f[0]+f[1])/2,(d[0]+d[1])/2]),A[0]=f[+(e[0]c?(i=r,r=c):i=c),m[0]!=r||m[1]!=i?(n?s=null:a=null,m[0]=r,m[1]=i,!0):void 0}function y(){g(),E.style("pointer-events","all").selectAll(".resize").style("display",e.empty()?"none":null),na.select("body").style("cursor",null),O.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),C({type:"brushend"})}var b,$,w=this,x=na.select(na.event.target),C=l.of(w,arguments),E=na.select(w),S=x.datum(),_=!/^(n|s)$/.test(S)&&u,M=!/^(e|w)$/.test(S)&&c,T=x.classed("extent"),D=K(w),A=na.mouse(w),O=na.select(t(w)).on("keydown.brush",o).on("keyup.brush",m);if(na.event.changedTouches?O.on("touchmove.brush",g).on("touchend.brush",y):O.on("mousemove.brush",g).on("mouseup.brush",y),E.interrupt().selectAll("*").interrupt(),T)A[0]=f[0]-A[0],A[1]=d[0]-A[1];else if(S){var N=+/w$/.test(S),R=+/^n/.test(S);$=[f[1-N]-A[0],d[1-R]-A[1]],A[0]=f[N],A[1]=d[R]}else na.event.altKey&&(b=A.slice());E.style("pointer-events","none").selectAll(".resize").style("display",null),na.select("body").style("cursor",x.style("cursor")),C({type:"brushstart"}),g()}var a,s,l=S(e,"brushstart","brush","brushend"),u=null,c=null,f=[0,0],d=[0,0],p=!0,h=!0,m=Ul[0];return e.event=function(e){e.each(function(){var e=l.of(this,arguments),t={x:f,y:d,i:a,j:s},n=this.__chart__||t;this.__chart__=t,Ol?na.select(this).transition().each("start.brush",function(){a=n.i,s=n.j,f=n.x,d=n.y,e({type:"brushstart"})}).tween("brush:brush",function(){var n=br(f,t.x),r=br(d,t.y);return a=s=null,function(i){f=t.x=n(i),d=t.y=r(i),e({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=t.i,s=t.j,e({type:"brush",mode:"resize"}),e({type:"brushend"})}):(e({type:"brushstart"}),e({type:"brush",mode:"resize"}),e({type:"brushend"}))})},e.x=function(t){return arguments.length?(u=t,m=Ul[!u<<1|!c],e):u},e.y=function(t){return arguments.length?(c=t,m=Ul[!u<<1|!c],e):c},e.clamp=function(t){return arguments.length?(u&&c?(p=!!t[0],h=!!t[1]):u?p=!!t:c&&(h=!!t),e):u&&c?[p,h]:u?p:c?h:null},e.extent=function(t){var n,r,i,o,l;return arguments.length?(u&&(n=t[0],r=t[1],c&&(n=n[0],r=r[0]),a=[n,r],u.invert&&(n=u(n),r=u(r)),n>r&&(l=n,n=r,r=l),(n!=f[0]||r!=f[1])&&(f=[n,r])),c&&(i=t[0],o=t[1],u&&(i=i[1],o=o[1]),s=[i,o],c.invert&&(i=c(i),o=c(o)),i>o&&(l=i,i=o,o=l),(i!=d[0]||o!=d[1])&&(d=[i,o])),e):(u&&(a?(n=a[0],r=a[1]):(n=f[0],r=f[1],u.invert&&(n=u.invert(n),r=u.invert(r)),n>r&&(l=n,n=r,r=l))),c&&(s?(i=s[0],o=s[1]):(i=d[0],o=d[1],c.invert&&(i=c.invert(i),o=c.invert(o)),i>o&&(l=i,i=o,o=l))),u&&c?[[n,i],[r,o]]:u?[n,r]:c&&[i,o])},e.clear=function(){return e.empty()||(f=[0,0],d=[0,0],a=s=null),e},e.empty=function(){return!!u&&f[0]==f[1]||!!c&&d[0]==d[1]},na.rebind(e,l,"on")};var Ll={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ul=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],ql=as.format=ds.timeFormat,Hl=ql.utc,Vl=Hl("%Y-%m-%dT%H:%M:%S.%LZ");ql.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Zo:Vl,Zo.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Zo.toString=Vl.toString,as.second=Le(function(e){return new ss(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))},function(e){return e.getSeconds()}),as.seconds=as.second.range,as.seconds.utc=as.second.utc.range,as.minute=Le(function(e){return new ss(6e4*Math.floor(e/6e4))},function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))},function(e){return e.getMinutes()}),as.minutes=as.minute.range,as.minutes.utc=as.minute.utc.range,as.hour=Le(function(e){var t=e.getTimezoneOffset()/60;return new ss(36e5*(Math.floor(e/36e5-t)+t))},function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))},function(e){return e.getHours()}),as.hours=as.hour.range,as.hours.utc=as.hour.utc.range,as.month=Le(function(e){return e=as.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),as.months=as.month.range,as.months.utc=as.month.utc.range;var zl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Bl=[[as.second,1],[as.second,5],[as.second,15],[as.second,30],[as.minute,1],[as.minute,5],[as.minute,15],[as.minute,30],[as.hour,1],[as.hour,3],[as.hour,6],[as.hour,12],[as.day,1],[as.day,2],[as.week,1],[as.month,1],[as.month,3],[as.year,1]],Yl=ql.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Mt]]),Wl={range:function(e,t,n){return na.range(Math.ceil(e/n)*n,+t,n).map(Xo)},floor:y,ceil:y};Bl.year=as.year,as.scale=function(){return Qo(na.scale.linear(),Bl,Yl)};var Gl=Bl.map(function(e){return[e[0].utc,e[1]]}),Kl=Hl.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Mt]]);Gl.year=as.year.utc,as.scale.utc=function(){return Qo(na.scale.linear(),Gl,Kl)},na.text=_e(function(e){return e.responseText}),na.json=function(e,t){return Me(e,"application/json",ea,t)},na.html=function(e,t){return Me(e,"text/html",ta,t)},na.xml=_e(function(e){return e.responseXML}),"function"==typeof define&&define.amd?define("common/d3",na):"object"==typeof module&&module.exports&&(module.exports=na),this.d3=na}(),function(){function e(e,t){if(e!==t){var n=null===e,r=e===$,i=e===e,o=null===t,a=t===$,s=t===t;if(e>t&&!o||!i||n&&!a&&s||r&&s)return 1;if(e=e&&9<=e&&13>=e||32==e||160==e||5760==e||6158==e||8192<=e&&(8202>=e||8232==e||8233==e||8239==e||8287==e||12288==e||65279==e)}function m(e,t){for(var n=-1,r=e.length,i=-1,o=[];++n=I&&gi&&ci?new Ue(t):null,u=t.length;l&&(a=qe,s=!1,t=l);e:for(;++oa(t,l,0)&&i.push(l);return i}function st(e,t){var n=!0;return Ri(e,function(e,r,i){return n=!!t(e,r,i)}),n}function lt(e,t,n,r){var i=r,o=i;return Ri(e,function(e,a,s){a=+t(e,a,s),(n(a,i)||a===r&&a===o)&&(i=a,o=e)}),o}function ut(e,t){var n=[];return Ri(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function ct(e,t,n,r){var i;return n(e,function(e,n,o){return t(e,n,o)?(i=r?n:e,!1):void 0}),i}function ft(e,t,n,r){r||(r=[]);for(var i=-1,o=e.length;++it&&(t=-t>i?0:i+t),n=n===$||n>i?i:+n||0,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0,n=Ur(i);++r=u)break e;o=r[o],i*="asc"===o||!0===o?1:-1;break e}i=t.b-n.b}return i})}function Ot(e,t){var n=0;return Ri(e,function(e,r,i){n+=+t(e,r,i)||0}),n}function Nt(e,t){var r=-1,i=xn(),o=e.length,a=i===n,s=a&&o>=I,l=s&&gi&&ci?new Ue(void 0):null,u=[];l?(i=qe,a=!1):(s=!1,l=t?[]:u);e:for(;++ri(l,f,0)&&((t||s)&&l.push(f),u.push(c))}return u}function Rt(e,t){for(var n=-1,r=t.length,i=Ur(r);++n>>1,a=e[o];(n?a<=t:ai?$:o,i=1);++r=I)return t.plant(r).value();for(var i=0,e=n?o[i].apply(this,e):r;++iarguments.length;return"function"==typeof r&&o===$&&Mo(n)?e(n,r,i,a):_t(n,$n(r,o,4),i,a,t)}}function fn(e,t,n,r,i,o,a,s,l,u){function c(){for(var b=arguments.length,w=b,k=Ur(b);w--;)k[w]=arguments[w];if(r&&(k=qt(k,r,i)),o&&(k=Ht(k,o,a)),h||v){var w=c.placeholder,E=m(k,w),b=b-E.length;if(bt?0:t)):[]}function zn(e,t,n){var r=e?e.length:0;return r?((n?An(e,t,n):null==t)&&(t=1),t=r-(+t||0),Mt(e,0,0>t?0:t)):[]}function Bn(e){return e?e[0]:$}function Yn(e,t,r){var i=e?e.length:0;if(!i)return-1;if("number"==typeof r)r=0>r?wi(i+r,0):r;else if(r)return r=Ft(e,t),rn?wi(i+n,0):n||0,"string"==typeof e||!Mo(e)&&wr(e)?n<=i&&-1t?0:+t||0,r);++n=e&&(t=$),n}}function lr(e,t,n){function r(t,n){n&&ai(n),l=d=p=$,t&&(h=ho(),u=e.apply(f,s),d||l||(s=f=$))}function i(){var e=t-(ho()-c);0>=e||e>t?r(p,l):d=fi(i,e)}function o(){r(g,d)}function a(){if(s=arguments,c=ho(),f=this,p=g&&(d||!v),!1===m)var n=v&&!d;else{l||v||(h=c);var r=m-(c-h),a=0>=r||r>m;a?(l&&(l=ai(l)),h=c,u=e.apply(f,s)):l||(l=fi(o,r))}return a&&d?d=ai(d):d||t===m||(d=fi(i,t)),n&&(a=!0,u=e.apply(f,s)),!a||d||l||(s=f=$),u}var s,l,u,c,f,d,p,h=0,m=!1,g=!0;if("function"!=typeof e)throw new Kr(j);if(t=0>t?0:+t||0,!0===n)var v=!0,g=!1;else gr(n)&&(v=!!n.leading,m="maxWait"in n&&wi(+n.maxWait||0,t),g="trailing"in n?!!n.trailing:g);return a.cancel=function(){d&&ai(d),l&&ai(l),h=0,l=d=p=$},a}function ur(e,t){function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;return o.has(i)?o.get(i):(r=e.apply(this,r),n.cache=o.set(i,r),r)}if("function"!=typeof e||t&&"function"!=typeof t)throw new Kr(j);return n.cache=new ur.Cache,n}function cr(e,t){if("function"!=typeof e)throw new Kr(j);return t=wi(t===$?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,i=wi(n.length-t,0),o=Ur(i);++rt}function dr(e){return p(e)&&Tn(e)&&ei.call(e,"callee")&&!ui.call(e,"callee")}function pr(e,t,n,r){return r=(n="function"==typeof n?Lt(n,r,3):$)?n(e,t):$,r===$?vt(e,t,n):!!r}function hr(e){return p(e)&&"string"==typeof e.message&&ni.call(e)==z}function mr(e){return gr(e)&&ni.call(e)==B}function gr(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function vr(e){return null!=e&&(mr(e)?ii.test(Xr.call(e)):p(e)&&Se.test(e))}function yr(e){return"number"==typeof e||p(e)&&ni.call(e)==Y}function br(e){var t;if(!p(e)||ni.call(e)!=W||dr(e)||!(ei.call(e,"constructor")||(t=e.constructor,"function"!=typeof t||t instanceof t)))return!1;var n;return dt(e,function(e,t){n=t}),n===$||ei.call(e,n)}function $r(e){return gr(e)&&ni.call(e)==G}function wr(e){return"string"==typeof e||p(e)&&ni.call(e)==K}function xr(e){return p(e)&&Rn(e.length)&&!!Ne[ni.call(e)]}function Cr(e,t){return et||!e||!bi(t))return n;do t%2&&(n+=e),t=vi(t/2),e+=e;while(t);return n}function Or(e,t,n){var r=e;return(e=i(e))?(n?An(r,t,n):null==t)?e.slice(g(e),v(e)+1):(t+="",e.slice(o(e,t),a(e,t)+1)):e}function Nr(e,t,n){return n&&An(e,t,n)&&(t=$),e=i(e),e.match(t||Ae)||[]}function Rr(e,t,n){return n&&An(e,t,n)&&(t=$),p(e)?Pr(e):rt(e,t)}function Ir(e){return e}function Pr(e){return $t(it(e,!0))}function Fr(e,t,n){if(null==n){var r=gr(t),i=r?Lo(t):$;((i=i&&i.length?mt(t,i):$)?i.length:r)||(i=!1,n=t,t=e,e=this)}i||(i=mt(t,Lo(t)));var o=!0,r=-1,a=mr(e),s=i.length;!1===n?o=!1:gr(n)&&"chain"in n&&(o=n.chain);for(;++r=N)return n}else e=0;return ji(n,r)}}(),Hi=cr(function(e,t){return p(e)&&Tn(e)?at(e,ft(t,!1,!0)):[]}),Vi=en(),zi=en(!0),Bi=cr(function(e){for(var t=e.length,r=t,i=Ur(c),o=xn(),a=o===n,s=[];r--;){var l=e[r]=Tn(l=e[r])?l:[];i[r]=a&&120<=l.length&&gi&&ci?new Ue(r&&l):null}var a=e[0],u=-1,c=a?a.length:0,f=i[0];e:for(;++u(f?qe(f,l):o(s,l,0))){for(r=t;--r;){var d=i[r];if(0>(d?qe(d,l):o(e[r],l,0)))continue e}f&&f.push(l),s.push(l)}return s}),Yi=cr(function(t,n){n=ft(n);var r=tt(t,n);return Et(t,n.sort(e)),r}),Wi=mn(),Gi=mn(!0),Ki=cr(function(e){return Nt(ft(e,!1,!0))}),Ji=cr(function(e,t){return Tn(e)?at(e,t):[]}),Zi=cr(Jn),Qi=cr(function(e){var t=e.length,n=2--e?t.apply(this,arguments):void 0}},Ie.ary=function(e,t,n){return n&&An(e,t,n)&&(t=$),t=e&&null==t?e.length:wi(+t||0,0),gn(e,T,$,$,$,$,t)},Ie.assign=Do,Ie.at=eo,Ie.before=sr,Ie.bind=mo,Ie.bindAll=go,Ie.bindKey=vo,Ie.callback=Rr,Ie.chain=Xn,Ie.chunk=function(e,t,n){t=(n?An(e,t,n):null==t)?1:wi(vi(t)||1,1),n=0;for(var r=e?e.length:0,i=-1,o=Ur(mi(r/t));nn&&(n=-n>i?0:i+n),r=r===$||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;nt?0:t)):[]},Ie.takeRight=function(e,t,n){var r=e?e.length:0;return r?((n?An(e,t,n):null==t)&&(t=1),t=r-(+t||0),Mt(e,0>t?0:t)):[]},Ie.takeRightWhile=function(e,t,n){return e&&e.length?It(e,$n(t,n,3),!1,!0):[]},Ie.takeWhile=function(e,t,n){return e&&e.length?It(e,$n(t,n,3)):[]},Ie.tap=function(e,t,n){return t.call(n,e),e},Ie.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Kr(j);return!1===n?r=!1:gr(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),lr(e,t,{leading:r,maxWait:+t,trailing:i})},Ie.thru=er,Ie.times=function(e,t,n){if(e=vi(e),1>e||!bi(e))return[];var r=-1,i=Ur(xi(e,4294967295));for(t=Lt(t,n,1);++rr?i[r]=t(r):t(r);return i},Ie.toArray=kr,Ie.toPlainObject=Er,Ie.transform=function(e,t,n,r){var i=Mo(e)||xr(e);return t=$n(t,r,4),null==n&&(i||gr(e)?(r=e.constructor,n=i?Mo(e)?new r:[]:Ni(mr(r)?r.prototype:$)):n={}),(i?Ve:pt)(e,function(e,r,i){return t(n,e,r,i)}),n},Ie.union=Ki,Ie.uniq=Kn,Ie.unzip=Jn,Ie.unzipWith=Zn,Ie.values=Tr,Ie.valuesIn=function(e){return Rt(e,_r(e))},Ie.where=function(e,t){return nr(e,$t(t))},Ie.without=Ji,Ie.wrap=function(e,t){return t=null==t?Ir:t,gn(t,_,$,[e],[])},Ie.xor=function(){for(var e=-1,t=arguments.length;++en?0:+n||0,r),n-=t.length,0<=n&&e.indexOf(t,n)==n},Ie.escape=function(e){return(e=i(e))&&de.test(e)?e.replace(ce,u):e},Ie.escapeRegExp=function(e){return(e=i(e))&&$e.test(e)?e.replace(be,c):e||"(?:)"},Ie.every=tr,Ie.find=no,Ie.findIndex=Vi,Ie.findKey=No,Ie.findLast=ro,Ie.findLastIndex=zi,Ie.findLastKey=Ro,Ie.findWhere=function(e,t){return no(e,$t(t))},Ie.first=Bn,Ie.floor=ea,Ie.get=function(e,t,n){return e=null==e?$:gt(e,qn(t),t+""),e===$?n:e},Ie.gt=fr,Ie.gte=function(e,t){return e>=t},Ie.has=function(e,t){if(null==e)return!1;var n=ei.call(e,t);if(!n&&!On(t)){if(t=qn(t),e=1==t.length?e:gt(e,Mt(t,0,-1)),null==e)return!1;t=Wn(t),n=ei.call(e,t)}return n||Rn(e.length)&&Dn(t,e.length)&&(Mo(e)||dr(e))},Ie.identity=Ir,Ie.includes=rr,Ie.indexOf=Yn,Ie.inRange=function(e,t,n){return t=+t||0,n===$?(n=t,t=0):n=+n||0,e>=xi(t,n)&&en?wi(r+n,0):xi(n||0,r-1))+1;else if(n)return i=Ft(e,t,!0)-1,e=e[i],(t===t?t===e:e!==e)?i:-1;if(t!==t)return d(e,i,!0);for(;i--;)if(e[i]===t)return i;return-1},Ie.lt=Cr,Ie.lte=function(e,t){return e<=t},Ie.max=ta,Ie.min=na,Ie.noConflict=function(){return Ye._=ri,this},Ie.noop=jr,Ie.now=ho,Ie.pad=function(e,t,n){e=i(e),t=+t;var r=e.length;return rn?0:+n||0,e.length),e.lastIndexOf(t,n)==n},Ie.sum=function(e,t,n){if(n&&An(e,t,n)&&(t=$),t=$n(t,n,3),1==t.length){e=Mo(e)?e:Ln(e),n=e.length;for(var r=0;n--;)r+=+t(e[n])||0;e=r}else e=Ot(e,t);return e},Ie.template=function(e,t,n){var r=Ie.templateSettings;n&&An(e,t,n)&&(t=n=$),e=i(e),t=Xe(et({},n||t),r,Qe),n=Xe(et({},t.imports),r.imports,Qe);var o,a,s=Lo(n),l=Rt(n,s),u=0;n=t.interpolate||Te;var c="__p+='";n=Wr((t.escape||Te).source+"|"+n.source+"|"+(n===me?Ce:Te).source+"|"+(t.evaluate||Te).source+"|$","g");var d="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(e.replace(n,function(t,n,r,i,s,l){return r||(r=i),c+=e.slice(u,l).replace(De,f),n&&(o=!0,c+="'+__e("+n+")+'"),s&&(a=!0,c+="';"+s+";\n__p+='"),r&&(c+="'+((__t=("+r+"))==null?'':__t)+'"),u=l+t.length,t}),c+="';",(t=t.variable)||(c="with(obj){"+c+"}"),c=(a?c.replace(ae,""):c).replace(se,"$1").replace(le,"$1;"),c="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(a?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}",t=Jo(function(){return Vr(s,d+"return "+c).apply($,l)}),t.source=c,hr(t))throw t;return t},Ie.trim=Or,Ie.trimLeft=function(e,t,n){var r=e;return(e=i(e))?e.slice((n?An(r,t,n):null==t)?g(e):o(e,t+"")):e},Ie.trimRight=function(e,t,n){var r=e;return(e=i(e))?(n?An(r,t,n):null==t)?e.slice(0,v(e)+1):e.slice(0,a(e,t+"")+1):e},Ie.trunc=function(e,t,n){n&&An(e,t,n)&&(t=$);var r=A;if(n=O,null!=t)if(gr(t)){var o="separator"in t?t.separator:o,r="length"in t?+t.length||0:r;n="omission"in t?i(t.omission):n}else r=+t||0;if(e=i(e),r>=e.length)return e;if(r-=n.length,1>r)return n;if(t=e.slice(0,r),null==o)return t+n;if($r(o)){if(e.slice(r).search(o)){var a,s=e.slice(0,r);for(o.global||(o=Wr(o.source,(ke.exec(o)||"")+"g")),o.lastIndex=0;e=o.exec(s);)a=e.index;t=t.slice(0,null==a?r:a)}}else e.indexOf(o,r)!=r&&(o=t.lastIndexOf(o),-1i.__dir__?"Right":"")}),i},je.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Ve(["filter","map","takeWhile"],function(e,t){var n=t+1,r=n!=F;je.prototype[e]=function(e,t){var i=this.clone();return i.__iteratees__.push({iteratee:$n(e,t,1),type:n}),i.__filtered__=i.__filtered__||r,i}}),Ve(["first","last"],function(e,t){var n="take"+(t?"Right":"");je.prototype[e]=function(){return this[n](1).value()[0]}}),Ve(["initial","rest"],function(e,t){var n="drop"+(t?"":"Right");je.prototype[e]=function(){return this.__filtered__?new je(this):this[n](1)}}),Ve(["pluck","where"],function(e,t){var n=t?"filter":"map",r=t?$t:Lr;je.prototype[e]=function(e){return this[n](r(e))}}),je.prototype.compact=function(){return this.filter(Ir)},je.prototype.reject=function(e,t){return e=$n(e,t,1),this.filter(function(t){return!e(t)})},je.prototype.slice=function(e,t){e=null==e?0:+e||0;var n=this;return n.__filtered__&&(0t)?new je(n):(0>e?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==$&&(t=+t||0,n=0>t?n.dropRight(-t):n.take(t-e)),n)},je.prototype.takeRightWhile=function(e,t){return this.reverse().takeWhile(e,t).reverse()},je.prototype.toArray=function(){return this.take(_i)},pt(je.prototype,function(e,t){var n=/^(?:filter|map|reject)|While$/.test(t),r=/^(?:first|last)$/.test(t),i=Ie[r?"take"+("last"==t?"Right":""):t];i&&(Ie.prototype[t]=function(){function t(e){return r&&a?i(e,1)[0]:i.apply($,Ke([e],o))}var o=r?[1]:arguments,a=this.__chain__,s=this.__wrapped__,l=!!this.__actions__.length,u=s instanceof je,c=o[0],f=u||Mo(s);return f&&n&&"function"==typeof c&&1!=c.length&&(u=f=!1),c={func:er,args:[t],thisArg:$},l=u&&!l,r&&!a?l?(s=s.clone(),s.__actions__.push(c),e.call(s)):i.call($,this.value())[0]:!r&&f?(s=l?s:new je(this),s=e.apply(s,o),s.__actions__.push(c),new Fe(s,a)):this.thru(t)})}),Ve("join pop push replace shift sort splice split unshift".split(" "),function(e){var t=(/^(?:replace|split)$/.test(e)?Qr:Jr)[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:join|pop|replace|shift)$/.test(e);Ie.prototype[e]=function(){var e=arguments;return r&&!this.__chain__?t.apply(this.value(),e):this[n](function(n){return t.apply(n,e)})}}),pt(je.prototype,function(e,t){var n=Ie[t];if(n){var r=n.name+"";(Oi[r]||(Oi[r]=[])).push({name:t,func:n})}}),Oi[fn($,C).name]=[{name:"wrapper",func:$}],je.prototype.clone=function(){var e=new je(this.__wrapped__);return e.__actions__=He(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=He(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=He(this.__views__),e},je.prototype.reverse=function(){if(this.__filtered__){var e=new je(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},je.prototype.value=function(){var e,t=this.__wrapped__.value(),n=this.__dir__,r=Mo(t),i=0>n,o=r?t.length:0;e=o;for(var a=this.__views__,s=0,l=-1,u=a.length;++l"'`]/g,fe=RegExp(ue.source),de=RegExp(ce.source),pe=/<%-([\s\S]+?)%>/g,he=/<%([\s\S]+?)%>/g,me=/<%=([\s\S]+?)%>/g,ge=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,ve=/^\w*$/,ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,be=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,$e=RegExp(be.source),we=/[\u0300-\u036f\ufe20-\ufe23]/g,xe=/\\(\\)?/g,Ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ke=/\w*$/,Ee=/^0[xX]/,Se=/^\[object .+?Constructor\]$/,_e=/^\d+$/,Me=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Te=/($^)/,De=/['\n\r\u2028\u2029\\]/g,Ae=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),Oe="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout isFinite parseFloat parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap".split(" "),Ne={};Ne[Z]=Ne[Q]=Ne[X]=Ne[ee]=Ne[te]=Ne[ne]=Ne[re]=Ne[ie]=Ne[oe]=!0,Ne[U]=Ne[q]=Ne[J]=Ne[H]=Ne[V]=Ne[z]=Ne[B]=Ne["[object Map]"]=Ne[Y]=Ne[W]=Ne[G]=Ne["[object Set]"]=Ne[K]=Ne["[object WeakMap]"]=!1;var Re={};Re[U]=Re[q]=Re[J]=Re[H]=Re[V]=Re[Z]=Re[Q]=Re[X]=Re[ee]=Re[te]=Re[Y]=Re[W]=Re[G]=Re[K]=Re[ne]=Re[re]=Re[ie]=Re[oe]=!0,Re[z]=Re[B]=Re["[object Map]"]=Re["[object Set]"]=Re["[object WeakMap]"]=!1;var Ie={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Pe={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Fe={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},je={function:!0,object:!0},Le={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qe=je[typeof exports]&&exports&&!exports.nodeType&&exports,He=je[typeof module]&&module&&!module.nodeType&&module,Ve=je[typeof self]&&self&&self.Object&&self,ze=je[typeof window]&&window&&window.Object&&window,Be=He&&He.exports===qe&&qe,Ye=qe&&He&&"object"==typeof global&&global&&global.Object&&global||ze!==(this&&this.window)&&ze||Ve||this,We=b();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ye._=We,define("common/lodash",[],function(){return We})):qe&&He?Be?(He.exports=We)._=We:qe._=We:Ye._=We}.call(this),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("common/moment",t):e.moment=t()}(this,function(){"use strict";function e(){return Wn.apply(null,arguments); }function t(e){Wn=e}function n(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function i(e,t){var n,r=[];for(n=0;n0)for(n in Kn)r=Kn[n],i=t[r],d(i)||(e[r]=i);return e}function h(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),Jn===!1&&(Jn=!0,e.updateOffset(this),Jn=!1)}function m(e){return e instanceof h||null!=e&&null!=e._isAMomentObject}function g(e){return 0>e?Math.ceil(e):Math.floor(e)}function v(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=g(t)),n}function y(e,t,n){var r,i=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0;for(r=0;i>r;r++)(n&&e[r]!==t[r]||!n&&v(e[r])!==v(t[r]))&&a++;return a+o}function b(){}function $(e){return e?e.toLowerCase().replace("_","-"):e}function w(e){for(var t,n,r,i,o=0;o0;){if(r=x(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&y(i,n,!0)>=t-1)break;t--}o++}return null}function x(e){var t=null;if(!Zn[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=Gn._abbr,require("./locale/"+e),C(t)}catch(e){}return Zn[e]}function C(e,t){var n;return e&&(n=d(t)?E(e):k(e,t),n&&(Gn=n)),Gn._abbr}function k(e,t){return null!==t?(t.abbr=e,Zn[e]=Zn[e]||new b,Zn[e].set(t),C(e),Zn[e]):(delete Zn[e],null)}function E(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Gn;if(!n(e)){if(t=x(e))return t;e=[e]}return w(e)}function S(e,t){var n=e.toLowerCase();Qn[n]=Qn[n+"s"]=Qn[t]=e}function _(e){return"string"==typeof e?Qn[e]||Qn[e.toLowerCase()]:void 0}function M(e){var t,n,r={};for(n in e)o(e,n)&&(t=_(n),t&&(r[t]=e[n]));return r}function T(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(t,n){return function(r){return null!=r?(O(this,t,r),e.updateOffset(this,n),this):A(this,t)}}function A(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function O(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function N(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if(e=_(e),T(this[e]))return this[e](t);return this}function R(e,t,n){var r=""+Math.abs(e),i=t-r.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function I(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(nr[e]=i),t&&(nr[t[0]]=function(){return R(i.apply(this,arguments),t[1],t[2])}),n&&(nr[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function P(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function F(e){var t,n,r=e.match(Xn);for(t=0,n=r.length;n>t;t++)nr[r[t]]?r[t]=nr[r[t]]:r[t]=P(r[t]);return function(i){var o="";for(t=0;n>t;t++)o+=r[t]instanceof Function?r[t].call(i,e):r[t];return o}}function j(e,t){return e.isValid()?(t=L(t,e.localeData()),tr[t]=tr[t]||F(t),tr[t](e)):e.localeData().invalidDate()}function L(e,t){function n(e){return t.longDateFormat(e)||e}var r=5;for(er.lastIndex=0;r>=0&&er.test(e);)e=e.replace(er,n),er.lastIndex=0,r-=1;return e}function U(e,t,n){$r[e]=T(t)?t:function(e,r){return e&&n?n:t}}function q(e,t){return o($r,e)?$r[e](t._strict,t._locale):new RegExp(H(e))}function H(e){return V(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i}))}function V(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function z(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(r=function(e,n){n[t]=v(e)}),n=0;nr;r++){if(i=s([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function Z(e,t){var n;return e.isValid()?"string"==typeof t&&(t=e.localeData().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),W(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e):e}function Q(t){return null!=t?(Z(this,t),e.updateOffset(this,!0),this):A(this,"Month")}function X(){return W(this.year(),this.month())}function ee(e){return this._monthsParseExact?(o(this,"_monthsRegex")||ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function te(e){return this._monthsParseExact?(o(this,"_monthsRegex")||ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function ne(){function e(e,t){return t.length-e.length}var t,n,r=[],i=[],o=[];for(t=0;12>t;t++)n=s([2e3,t]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(r.sort(e),i.sort(e),o.sort(e),t=0;12>t;t++)r[t]=V(r[t]),i[t]=V(i[t]),o[t]=V(o[t]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")$","i")}function re(e){var t,n=e._a;return n&&-2===u(e).overflow&&(t=n[Cr]<0||n[Cr]>11?Cr:n[kr]<1||n[kr]>W(n[xr],n[Cr])?kr:n[Er]<0||n[Er]>24||24===n[Er]&&(0!==n[Sr]||0!==n[_r]||0!==n[Mr])?Er:n[Sr]<0||n[Sr]>59?Sr:n[_r]<0||n[_r]>59?_r:n[Mr]<0||n[Mr]>999?Mr:-1,u(e)._overflowDayOfYear&&(xr>t||t>kr)&&(t=kr),u(e)._overflowWeeks&&-1===t&&(t=Tr),u(e)._overflowWeekday&&-1===t&&(t=Dr),u(e).overflow=t),e}function ie(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function oe(e,t){var n=!0;return a(function(){return n&&(ie(e+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),t.apply(this,arguments)},t)}function ae(e,t){Pr[e]||(ie(t),Pr[e]=!0)}function se(e){var t,n,r,i,o,a,s=e._i,l=Fr.exec(s)||jr.exec(s);if(l){for(u(e).iso=!0,t=0,n=Ur.length;n>t;t++)if(Ur[t][1].exec(l[1])){i=Ur[t][0],r=Ur[t][2]!==!1;break}if(null==i)return void(e._isValid=!1);if(l[3]){for(t=0,n=qr.length;n>t;t++)if(qr[t][1].exec(l[3])){o=(l[2]||" ")+qr[t][0];break}if(null==o)return void(e._isValid=!1)}if(!r&&null!=o)return void(e._isValid=!1);if(l[4]){if(!Lr.exec(l[4]))return void(e._isValid=!1);a="Z"}e._f=i+(o||"")+(a||""),xe(e)}else e._isValid=!1}function le(t){var n=Hr.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(se(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function ue(e,t,n,r,i,o,a){var s=new Date(e,t,n,r,i,o,a);return 100>e&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function ce(e){var t=new Date(Date.UTC.apply(null,arguments));return 100>e&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function fe(e){return de(e)?366:365}function de(e){return e%4===0&&e%100!==0||e%400===0}function pe(){return de(this.year())}function he(e,t,n){var r=7+t-n,i=(7+ce(e,0,r).getUTCDay()-t)%7;return-i+r-1}function me(e,t,n,r,i){var o,a,s=(7+n-r)%7,l=he(e,r,i),u=1+7*(t-1)+s+l;return 0>=u?(o=e-1,a=fe(o)+u):u>fe(e)?(o=e+1,a=u-fe(e)):(o=e,a=u),{year:o,dayOfYear:a}}function ge(e,t,n){var r,i,o=he(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return 1>a?(i=e.year()-1,r=a+ve(i,t,n)):a>ve(e.year(),t,n)?(r=a-ve(e.year(),t,n),i=e.year()+1):(i=e.year(),r=a),{week:r,year:i}}function ve(e,t,n){var r=he(e,t,n),i=he(e+1,t,n);return(fe(e)-r+i)/7}function ye(e,t,n){return null!=e?e:null!=t?t:n}function be(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function $e(e){var t,n,r,i,o=[];if(!e._d){for(r=be(e),e._w&&null==e._a[kr]&&null==e._a[Cr]&&we(e),e._dayOfYear&&(i=ye(e._a[xr],r[xr]),e._dayOfYear>fe(i)&&(u(e)._overflowDayOfYear=!0),n=ce(i,0,e._dayOfYear),e._a[Cr]=n.getUTCMonth(),e._a[kr]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=o[t]=r[t];for(;7>t;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Er]&&0===e._a[Sr]&&0===e._a[_r]&&0===e._a[Mr]&&(e._nextDay=!0,e._a[Er]=0),e._d=(e._useUTC?ce:ue).apply(null,o),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Er]=24)}}function we(e){var t,n,r,i,o,a,s,l;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(o=1,a=4,n=ye(t.GG,e._a[xr],ge(De(),1,4).year),r=ye(t.W,1),i=ye(t.E,1),(1>i||i>7)&&(l=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,n=ye(t.gg,e._a[xr],ge(De(),o,a).year),r=ye(t.w,1),null!=t.d?(i=t.d,(0>i||i>6)&&(l=!0)):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(l=!0)):i=o),1>r||r>ve(n,o,a)?u(e)._overflowWeeks=!0:null!=l?u(e)._overflowWeekday=!0:(s=me(n,r,i,o,a),e._a[xr]=s.year,e._dayOfYear=s.dayOfYear)}function xe(t){if(t._f===e.ISO_8601)return void se(t);t._a=[],u(t).empty=!0;var n,r,i,o,a,s=""+t._i,l=s.length,c=0;for(i=L(t._f,t._locale).match(Xn)||[],n=0;n0&&u(t).unusedInput.push(a),s=s.slice(s.indexOf(r)+r.length),c+=r.length),nr[o]?(r?u(t).empty=!1:u(t).unusedTokens.push(o),Y(o,r,t)):t._strict&&!r&&u(t).unusedTokens.push(o);u(t).charsLeftOver=l-c,s.length>0&&u(t).unusedInput.push(s),u(t).bigHour===!0&&t._a[Er]<=12&&t._a[Er]>0&&(u(t).bigHour=void 0),t._a[Er]=Ce(t._locale,t._a[Er],t._meridiem),$e(t),re(t)}function Ce(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(r=e.isPM(n),r&&12>t&&(t+=12),r||12!==t||(t=0),t):t}function ke(e){var t,n,r,i,o;if(0===e._f.length)return u(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;io)&&(r=o,n=t));a(e,n||t)}function Ee(e){if(!e._d){var t=M(e._i);e._a=i([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),$e(e)}}function Se(e){var t=new h(re(_e(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function _e(e){var t=e._i,i=e._f;return e._locale=e._locale||E(e._l),null===t||void 0===i&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),m(t)?new h(re(t)):(n(i)?ke(e):i?xe(e):r(t)?e._d=t:Me(e),c(e)||(e._d=null),e))}function Me(t){var o=t._i;void 0===o?t._d=new Date(e.now()):r(o)?t._d=new Date(+o):"string"==typeof o?le(t):n(o)?(t._a=i(o.slice(0),function(e){return parseInt(e,10)}),$e(t)):"object"==typeof o?Ee(t):"number"==typeof o?t._d=new Date(o):e.createFromInputFallback(t)}function Te(e,t,n,r,i){var o={};return"boolean"==typeof n&&(r=n,n=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=e,o._f=t,o._strict=r,Se(o)}function De(e,t,n,r){return Te(e,t,n,r,!1)}function Ae(e,t){var r,i;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return De();for(r=t[0],i=1;ie&&(e=-e,n="-"),n+R(~~(e/60),2)+t+R(~~e%60,2)})}function Fe(e,t){var n=(t||"").match(e)||[],r=n[n.length-1]||[],i=(r+"").match(Wr)||["-",0,0],o=+(60*i[1])+v(i[2]);return"+"===i[0]?o:-o}function je(t,n){var i,o;return n._isUTC?(i=n.clone(),o=(m(t)||r(t)?+t:+De(t))-+i,i._d.setTime(+i._d+o),e.updateOffset(i,!1),i):De(t).local()}function Le(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ue(t,n){var r,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Fe(vr,t):Math.abs(t)<16&&(t*=60),!this._isUTC&&n&&(r=Le(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!n||this._changeInProgress?nt(this,Ze(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Le(this):null!=t?this:NaN}function qe(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function He(e){return this.utcOffset(0,e)}function Ve(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Le(this),"m")),this}function ze(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Fe(gr,this._i)),this}function Be(e){return!!this.isValid()&&(e=e?De(e).utcOffset():0,(this.utcOffset()-e)%60===0)}function Ye(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function We(){if(!d(this._isDSTShifted))return this._isDSTShifted;var e={};if(p(e,this),e=_e(e),e._a){var t=e._isUTC?s(e._a):De(e._a);this._isDSTShifted=this.isValid()&&y(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Ge(){return!!this.isValid()&&!this._isUTC}function Ke(){return!!this.isValid()&&this._isUTC}function Je(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ze(e,t){var n,r,i,a=e,s=null;return Ie(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(a={},t?a[t]=e:a.milliseconds=e):(s=Gr.exec(e))?(n="-"===s[1]?-1:1,a={y:0,d:v(s[kr])*n,h:v(s[Er])*n,m:v(s[Sr])*n,s:v(s[_r])*n,ms:v(s[Mr])*n}):(s=Kr.exec(e))?(n="-"===s[1]?-1:1,a={y:Qe(s[2],n),M:Qe(s[3],n),d:Qe(s[4],n),h:Qe(s[5],n),m:Qe(s[6],n),s:Qe(s[7],n),w:Qe(s[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=et(De(a.from),De(a.to)),a={},a.ms=i.milliseconds,a.M=i.months),r=new Re(a),Ie(e)&&o(e,"_locale")&&(r._locale=e._locale),r}function Qe(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Xe(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function et(e,t){var n;return e.isValid()&&t.isValid()?(t=je(t,e),e.isBefore(t)?n=Xe(e,t):(n=Xe(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function tt(e,t){return function(n,r){var i,o;return null===r||isNaN(+r)||(ae(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),o=n,n=r,r=o),n="string"==typeof n?+n:n,i=Ze(n,r),nt(this,i,e),this}}function nt(t,n,r,i){var o=n._milliseconds,a=n._days,s=n._months;t.isValid()&&(i=null==i||i,o&&t._d.setTime(+t._d+o*r),a&&O(t,"Date",A(t,"Date")+a*r),s&&Z(t,A(t,"Month")+s*r),i&&e.updateOffset(t,a||s))}function rt(e,t){var n=e||De(),r=je(n,this).startOf("day"),i=this.diff(r,"days",!0),o=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse",a=t&&(T(t[o])?t[o]():t[o]);return this.format(a||this.localeData().calendar(o,this,De(n)))}function it(){return new h(this)}function ot(e,t){var n=m(e)?e:De(e);return!(!this.isValid()||!n.isValid())&&(t=_(d(t)?"millisecond":t),"millisecond"===t?+this>+n:+n<+this.clone().startOf(t))}function at(e,t){var n=m(e)?e:De(e);return!(!this.isValid()||!n.isValid())&&(t=_(d(t)?"millisecond":t),"millisecond"===t?+n>+this:+this.clone().endOf(t)<+n)}function st(e,t,n){return this.isAfter(e,n)&&this.isBefore(t,n)}function lt(e,t){var n,r=m(e)?e:De(e);return!(!this.isValid()||!r.isValid())&&(t=_(t||"millisecond"),"millisecond"===t?+this===+r:(n=+r,+this.clone().startOf(t)<=n&&n<=+this.clone().endOf(t)))}function ut(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function ct(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function ft(e,t,n){var r,i,o,a;return this.isValid()?(r=je(e,this),r.isValid()?(i=6e4*(r.utcOffset()-this.utcOffset()),t=_(t),"year"===t||"month"===t||"quarter"===t?(a=dt(this,r),"quarter"===t?a/=3:"year"===t&&(a/=12)):(o=this-r,a="second"===t?o/1e3:"minute"===t?o/6e4:"hour"===t?o/36e5:"day"===t?(o-i)/864e5:"week"===t?(o-i)/6048e5:o),n?a:g(a)):NaN):NaN}function dt(e,t){var n,r,i=12*(t.year()-e.year())+(t.month()-e.month()),o=e.clone().add(i,"months");return 0>t-o?(n=e.clone().add(i-1,"months"),r=(t-o)/(o-n)):(n=e.clone().add(i+1,"months"),r=(t-o)/(n-o)),-(i+r)}function pt(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ht(){var e=this.clone().utc();return 0o&&(t=o),Ut.call(this,e,t,n,r,i))}function Ut(e,t,n,r,i){var o=me(e,t,n,r,i),a=ce(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function qt(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Ht(e){return ge(e,this._week.dow,this._week.doy).week}function Vt(){return this._week.dow}function zt(){return this._week.doy}function Bt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Yt(e){var t=ge(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Wt(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function Gt(e,t){return n(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function Kt(e){return this._weekdaysShort[e.day()]}function Jt(e){return this._weekdaysMin[e.day()]}function Zt(e,t,n){var r,i,o;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=De([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function Qt(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Wt(e,this.localeData()),this.add(e-t,"d")):t}function Xt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function en(e){return this.isValid()?null==e?this.day()||7:this.day(this.day()%7?e:e-7):null!=e?this:NaN}function tn(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function nn(){return this.hours()%12||12}function rn(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function on(e,t){return t._meridiemParse}function an(e){return"p"===(e+"").toLowerCase().charAt(0)}function sn(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function ln(e,t){t[Mr]=v(1e3*("0."+e))}function un(){return this._isUTC?"UTC":""}function cn(){return this._isUTC?"Coordinated Universal Time":""}function fn(e){return De(1e3*e)}function dn(){return De.apply(null,arguments).parseZone()}function pn(e,t,n){var r=this._calendar[e];return T(r)?r.call(t,n):r}function hn(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function mn(){return this._invalidDate}function gn(e){return this._ordinal.replace("%d",e)}function vn(e){return e}function yn(e,t,n,r){var i=this._relativeTime[n];return T(i)?i(e,t,n,r):i.replace(/%d/i,e)}function bn(e,t){var n=this._relativeTime[e>0?"future":"past"];return T(n)?n(t):n.replace(/%s/i,t)}function $n(e){var t,n;for(n in e)t=e[n],T(t)?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function wn(e,t,n,r){var i=E(),o=s().set(r,t);return i[n](o,e)}function xn(e,t,n,r,i){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return wn(e,t,n,i);var o,a=[];for(o=0;r>o;o++)a[o]=wn(e,o,n,i);return a}function Cn(e,t){return xn(e,t,"months",12,"month")}function kn(e,t){return xn(e,t,"monthsShort",12,"month")}function En(e,t){return xn(e,t,"weekdays",7,"day")}function Sn(e,t){return xn(e,t,"weekdaysShort",7,"day")}function _n(e,t){return xn(e,t,"weekdaysMin",7,"day")}function Mn(){var e=this._data;return this._milliseconds=bi(this._milliseconds),this._days=bi(this._days),this._months=bi(this._months),e.milliseconds=bi(e.milliseconds),e.seconds=bi(e.seconds),e.minutes=bi(e.minutes),e.hours=bi(e.hours),e.months=bi(e.months),e.years=bi(e.years),this}function Tn(e,t,n,r){var i=Ze(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Dn(e,t){return Tn(this,e,t,1)}function An(e,t){return Tn(this,e,t,-1)}function On(e){return 0>e?Math.floor(e):Math.ceil(e)}function Nn(){var e,t,n,r,i,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||0>=o&&0>=a&&0>=s||(o+=864e5*On(In(s)+a),a=0,s=0),l.milliseconds=o%1e3,e=g(o/1e3),l.seconds=e%60,t=g(e/60),l.minutes=t%60,n=g(t/60),l.hours=n%24,a+=g(n/24),i=g(Rn(a)),s+=i,a-=On(In(i)),r=g(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function Rn(e){return 4800*e/146097}function In(e){return 146097*e/4800}function Pn(e){var t,n,r=this._milliseconds;if(e=_(e),"month"===e||"year"===e)return t=this._days+r/864e5,n=this._months+Rn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(In(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function Fn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function jn(e){return function(){return this.as(e)}}function Ln(e){return e=_(e),this[e+"s"]()}function Un(e){return function(){return this._data[e]}}function qn(){return g(this.days()/7)}function Hn(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function Vn(e,t,n){var r=Ze(e).abs(),i=Ii(r.as("s")),o=Ii(r.as("m")),a=Ii(r.as("h")),s=Ii(r.as("d")),l=Ii(r.as("M")),u=Ii(r.as("y")),c=i=o&&["m"]||o=a&&["h"]||a=s&&["d"]||s=l&&["M"]||l=u&&["y"]||["yy",u];return c[2]=t,c[3]=+e>0,c[4]=n,Hn.apply(null,c)}function zn(e,t){return void 0!==Pi[e]&&(void 0===t?Pi[e]:(Pi[e]=t,!0))}function Bn(e){var t=this.localeData(),n=Vn(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Yn(){var e,t,n,r=Fi(this._milliseconds)/1e3,i=Fi(this._days),o=Fi(this._months);e=g(r/60),t=g(e/60),r%=60,e%=60,n=g(o/12),o%=12;var a=n,s=o,l=i,u=t,c=e,f=r,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(a?a+"Y":"")+(s?s+"M":"")+(l?l+"D":"")+(u||c||f?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(f?f+"S":""):"P0D"}var Wn,Gn,Kn=e.momentProperties=[],Jn=!1,Zn={},Qn={},Xn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,er=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,tr={},nr={},rr=/\d/,ir=/\d\d/,or=/\d{3}/,ar=/\d{4}/,sr=/[+-]?\d{6}/,lr=/\d\d?/,ur=/\d\d\d\d?/,cr=/\d\d\d\d\d\d?/,fr=/\d{1,3}/,dr=/\d{1,4}/,pr=/[+-]?\d{1,6}/,hr=/\d+/,mr=/[+-]?\d+/,gr=/Z|[+-]\d\d:?\d\d/gi,vr=/Z|[+-]\d\d(?::?\d\d)?/gi,yr=/[+-]?\d+(\.\d{1,3})?/,br=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,$r={},wr={},xr=0,Cr=1,kr=2,Er=3,Sr=4,_r=5,Mr=6,Tr=7,Dr=8;I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),S("month","M"),U("M",lr),U("MM",lr,ir),U("MMM",function(e,t){return t.monthsShortRegex(e)}),U("MMMM",function(e,t){return t.monthsRegex(e)}),z(["M","MM"],function(e,t){t[Cr]=v(e)-1}),z(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);null!=i?t[Cr]=i:u(n).invalidMonth=e});var Ar=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Or="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Nr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Rr=br,Ir=br,Pr={};e.suppressDeprecationWarnings=!1;var Fr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,jr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Lr=/Z|[+-]\d\d(?::?\d\d)?/,Ur=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],qr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Hr=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=oe("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),I("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),S("year","y"),U("Y",mr),U("YY",lr,ir),U("YYYY",dr,ar),U("YYYYY",pr,sr),U("YYYYYY",pr,sr),z(["YYYYY","YYYYYY"],xr),z("YYYY",function(t,n){n[xr]=2===t.length?e.parseTwoDigitYear(t):v(t)}),z("YY",function(t,n){n[xr]=e.parseTwoDigitYear(t)}),z("Y",function(e,t){t[xr]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return v(e)+(v(e)>68?1900:2e3)};var Vr=D("FullYear",!1);e.ISO_8601=function(){};var zr=oe("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return this.isValid()&&e.isValid()?this>e?this:e:f()}),Br=oe("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:f()}),Yr=function(){return Date.now?Date.now():+new Date};Pe("Z",":"),Pe("ZZ",""),U("Z",vr),U("ZZ",vr),z(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Fe(vr,e)});var Wr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Gr=/(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Kr=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Ze.fn=Re.prototype;var Jr=tt(1,"add"),Zr=tt(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Qr=oe("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){ -return void 0===e?this.localeData():this.locale(e)});I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Rt("gggg","weekYear"),Rt("ggggg","weekYear"),Rt("GGGG","isoWeekYear"),Rt("GGGGG","isoWeekYear"),S("weekYear","gg"),S("isoWeekYear","GG"),U("G",mr),U("g",mr),U("GG",lr,ir),U("gg",lr,ir),U("GGGG",dr,ar),U("gggg",dr,ar),U("GGGGG",pr,sr),U("ggggg",pr,sr),B(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=v(e)}),B(["gg","GG"],function(t,n,r,i){n[i]=e.parseTwoDigitYear(t)}),I("Q",0,"Qo","quarter"),S("quarter","Q"),U("Q",rr),z("Q",function(e,t){t[Cr]=3*(v(e)-1)}),I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),S("week","w"),S("isoWeek","W"),U("w",lr),U("ww",lr,ir),U("W",lr),U("WW",lr,ir),B(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=v(e)});var Xr={dow:0,doy:6};I("D",["DD",2],"Do","date"),S("date","D"),U("D",lr),U("DD",lr,ir),U("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),z(["D","DD"],kr),z("Do",function(e,t){t[kr]=v(e.match(lr)[0],10)});var ei=D("Date",!0);I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),S("day","d"),S("weekday","e"),S("isoWeekday","E"),U("d",lr),U("e",lr),U("E",lr),U("dd",br),U("ddd",br),U("dddd",br),B(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:u(n).invalidWeekday=e}),B(["d","e","E"],function(e,t,n,r){t[r]=v(e)});var ti="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ni="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ri="Su_Mo_Tu_We_Th_Fr_Sa".split("_");I("DDD",["DDDD",3],"DDDo","dayOfYear"),S("dayOfYear","DDD"),U("DDD",fr),U("DDDD",or),z(["DDD","DDDD"],function(e,t,n){n._dayOfYear=v(e)}),I("H",["HH",2],0,"hour"),I("h",["hh",2],0,nn),I("hmm",0,0,function(){return""+nn.apply(this)+R(this.minutes(),2)}),I("hmmss",0,0,function(){return""+nn.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+R(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)}),rn("a",!0),rn("A",!1),S("hour","h"),U("a",on),U("A",on),U("H",lr),U("h",lr),U("HH",lr,ir),U("hh",lr,ir),U("hmm",ur),U("hmmss",cr),U("Hmm",ur),U("Hmmss",cr),z(["H","HH"],Er),z(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),z(["h","hh"],function(e,t,n){t[Er]=v(e),u(n).bigHour=!0}),z("hmm",function(e,t,n){var r=e.length-2;t[Er]=v(e.substr(0,r)),t[Sr]=v(e.substr(r)),u(n).bigHour=!0}),z("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Er]=v(e.substr(0,r)),t[Sr]=v(e.substr(r,2)),t[_r]=v(e.substr(i)),u(n).bigHour=!0}),z("Hmm",function(e,t,n){var r=e.length-2;t[Er]=v(e.substr(0,r)),t[Sr]=v(e.substr(r))}),z("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Er]=v(e.substr(0,r)),t[Sr]=v(e.substr(r,2)),t[_r]=v(e.substr(i))});var ii=/[ap]\.?m?\.?/i,oi=D("Hours",!0);I("m",["mm",2],0,"minute"),S("minute","m"),U("m",lr),U("mm",lr,ir),z(["m","mm"],Sr);var ai=D("Minutes",!1);I("s",["ss",2],0,"second"),S("second","s"),U("s",lr),U("ss",lr,ir),z(["s","ss"],_r);var si=D("Seconds",!1);I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),S("millisecond","ms"),U("S",fr,rr),U("SS",fr,ir),U("SSS",fr,or);var li;for(li="SSSS";li.length<=9;li+="S")U(li,hr);for(li="S";li.length<=9;li+="S")z(li,ln);var ui=D("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var ci=h.prototype;ci.add=Jr,ci.calendar=rt,ci.clone=it,ci.diff=ft,ci.endOf=Ct,ci.format=mt,ci.from=gt,ci.fromNow=vt,ci.to=yt,ci.toNow=bt,ci.get=N,ci.invalidAt=Ot,ci.isAfter=ot,ci.isBefore=at,ci.isBetween=st,ci.isSame=lt,ci.isSameOrAfter=ut,ci.isSameOrBefore=ct,ci.isValid=Dt,ci.lang=Qr,ci.locale=$t,ci.localeData=wt,ci.max=Br,ci.min=zr,ci.parsingFlags=At,ci.set=N,ci.startOf=xt,ci.subtract=Zr,ci.toArray=_t,ci.toObject=Mt,ci.toDate=St,ci.toISOString=ht,ci.toJSON=Tt,ci.toString=pt,ci.unix=Et,ci.valueOf=kt,ci.creationData=Nt,ci.year=Vr,ci.isLeapYear=pe,ci.weekYear=It,ci.isoWeekYear=Pt,ci.quarter=ci.quarters=qt,ci.month=Q,ci.daysInMonth=X,ci.week=ci.weeks=Bt,ci.isoWeek=ci.isoWeeks=Yt,ci.weeksInYear=jt,ci.isoWeeksInYear=Ft,ci.date=ei,ci.day=ci.days=Qt,ci.weekday=Xt,ci.isoWeekday=en,ci.dayOfYear=tn,ci.hour=ci.hours=oi,ci.minute=ci.minutes=ai,ci.second=ci.seconds=si,ci.millisecond=ci.milliseconds=ui,ci.utcOffset=Ue,ci.utc=He,ci.local=Ve,ci.parseZone=ze,ci.hasAlignedHourOffset=Be,ci.isDST=Ye,ci.isDSTShifted=We,ci.isLocal=Ge,ci.isUtcOffset=Ke,ci.isUtc=Je,ci.isUTC=Je,ci.zoneAbbr=un,ci.zoneName=cn,ci.dates=oe("dates accessor is deprecated. Use date instead.",ei),ci.months=oe("months accessor is deprecated. Use month instead",Q),ci.years=oe("years accessor is deprecated. Use year instead",Vr),ci.zone=oe("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",qe);var fi=ci,di={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},pi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},hi="Invalid date",mi="%d",gi=/\d{1,2}/,vi={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},yi=b.prototype;yi._calendar=di,yi.calendar=pn,yi._longDateFormat=pi,yi.longDateFormat=hn,yi._invalidDate=hi,yi.invalidDate=mn,yi._ordinal=mi,yi.ordinal=gn,yi._ordinalParse=gi,yi.preparse=vn,yi.postformat=vn,yi._relativeTime=vi,yi.relativeTime=yn,yi.pastFuture=bn,yi.set=$n,yi.months=G,yi._months=Or,yi.monthsShort=K,yi._monthsShort=Nr,yi.monthsParse=J,yi._monthsRegex=Ir,yi.monthsRegex=te,yi._monthsShortRegex=Rr,yi.monthsShortRegex=ee,yi.week=Ht,yi._week=Xr,yi.firstDayOfYear=zt,yi.firstDayOfWeek=Vt,yi.weekdays=Gt,yi._weekdays=ti,yi.weekdaysMin=Jt,yi._weekdaysMin=ri,yi.weekdaysShort=Kt,yi._weekdaysShort=ni,yi.weekdaysParse=Zt,yi.isPM=an,yi._meridiemParse=ii,yi.meridiem=sn,C("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===v(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=oe("moment.lang is deprecated. Use moment.locale instead.",C),e.langData=oe("moment.langData is deprecated. Use moment.localeData instead.",E);var bi=Math.abs,$i=jn("ms"),wi=jn("s"),xi=jn("m"),Ci=jn("h"),ki=jn("d"),Ei=jn("w"),Si=jn("M"),_i=jn("y"),Mi=Un("milliseconds"),Ti=Un("seconds"),Di=Un("minutes"),Ai=Un("hours"),Oi=Un("days"),Ni=Un("months"),Ri=Un("years"),Ii=Math.round,Pi={s:45,m:45,h:22,d:26,M:11},Fi=Math.abs,ji=Re.prototype;ji.abs=Mn,ji.add=Dn,ji.subtract=An,ji.as=Pn,ji.asMilliseconds=$i,ji.asSeconds=wi,ji.asMinutes=xi,ji.asHours=Ci,ji.asDays=ki,ji.asWeeks=Ei,ji.asMonths=Si,ji.asYears=_i,ji.valueOf=Fn,ji._bubble=Nn,ji.get=Ln,ji.milliseconds=Mi,ji.seconds=Ti,ji.minutes=Di,ji.hours=Ai,ji.days=Oi,ji.weeks=qn,ji.months=Ni,ji.years=Ri,ji.humanize=Bn,ji.toISOString=Yn,ji.toString=Yn,ji.toJSON=Yn,ji.locale=$t,ji.localeData=wt,ji.toIsoString=oe("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yn),ji.lang=Qr,I("X",0,0,"unix"),I("x",0,0,"valueOf"),U("x",mr),U("X",yr),z("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),z("x",function(e,t,n){n._d=new Date(v(e))}),e.version="2.11.1",t(De),e.fn=fi,e.min=Oe,e.max=Ne,e.now=Yr,e.utc=s,e.unix=fn,e.months=Cn,e.isDate=r,e.locale=C,e.invalid=f,e.duration=Ze,e.isMoment=m,e.weekdays=En,e.parseZone=dn,e.localeData=E,e.isDuration=Ie,e.monthsShort=kn,e.weekdaysMin=_n,e.defineLocale=k,e.weekdaysShort=Sn,e.normalizeUnits=_,e.relativeTimeThreshold=zn,e.prototype=fi;var Li=e;return Li}),define("common/bundles/vendors",["common/require","common/angular","common/angularAnimate","common/angularBootstrap","common/angularFileUpload","common/angularMocks","common/angularResource","common/angularRoute","common/angularXeditable","common/text-angular","common/ui-select","common/d3","common/lodash","common/moment"],function(){}),define("common/modules/apis",["common/angular"],function(e){"use strict";return e.module("common.apis",[])}),define("common/services/api",["common/angular","common/lodash","common/modules/apis"],function(e,t,n){"use strict";n.factory("api",["$log","$http","$httpParamSerializer","$q","$timeout",function(n,r,i,o,a){function s(e){return e.data.is_error?(n.error(e.data),o.reject(e.data.error_message)):e.data}function l(e){var n={options:{limit:0}};return JSON.stringify(t.merge(n,e||{}))}n.debug("api");var u="/civicrm/ajax/rest";return{extend:function(t){return e.extend(Object.create(this),t)},getAll:function(e,r,i,a,s,l,u){return n.debug("api.all"),r=r||{},l=l||"get",o.all([function(){var n=t.assign({},r,s||{},{options:{sort:a||"id DESC"}});return i&&(n.options.offset=(i.page-1)*i.size,n.options.limit=i.size),this.sendGET(e,l,n,u)}.bind(this)(),function(){if(!i)return o.resolve();var n=t.assign({},r,{return:"id"});return n=t.omit(n,function(e,n){return t.startsWith(n,"api.")}),this.sendGET(e,l,n,u)}.bind(this)()]).then(function(e){var t=e[0],n=i?e[1]:t;return{list:t.values,total:n.count,allIds:n.values.map(function(e){return e.id}).join(",")}})},mockGET:function(e,t){var n=o.defer();return a(function(){n.resolve(e)},t||0),n.promise},mockPOST:function(e,t){return this.mockGET.apply(this,arguments)},sendGET:function(e,t,n,i){return r({method:"GET",url:u,cache:"undefined"==typeof i||!!i,responseType:"json",params:{sequential:1,json:l(n),entity:e,action:t}}).then(s)},sendPOST:function(e,t,o){return n.debug("api.sendPOST"),r({method:"POST",url:u,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},responseType:"json",data:{json:l(o),sequential:1,entity:e,action:t},transformRequest:i}).then(s)}}}])}),define("common/services/api/appraisal",["common/modules/apis","common/services/api"],function(e){"use strict";e.factory("api.appraisal",["$log","api",function(e,t){return e.debug("api.appraisal"),t.extend({all:function(t,n,r){return e.debug("api.appraisal.api"),this.getAll("Appraisal",t,n,r)},create:function(t){return e.debug("api.appraisal.create"),this.sendPOST("Appraisal","create",t).then(function(e){return e.values[0]})},find:function(t){return e.debug("api.appraisal.find"),this.sendGET("Appraisal","get",{id:""+t},!1).then(function(e){return e.values[0]})}})}])}),define("common/services/api/option-group",["common/lodash","common/modules/apis","common/services/api"],function(e,t){"use strict";t.factory("api.optionGroup",["$log","api",function(t,n){function r(t){return t.values.map(function(t){var n=e.clone(t);return n.option_group_name=n["option_group_id.name"],delete n["option_group_id.name"],n})}function i(t){return e.transform(t,function(e,t){var n=t.option_group_name;e[n]=e[n]||[],e[n].push(t)})}return t.debug("api.optionGroup"),n.extend({valuesOf:function(t,n){var o=e.isArray(t);return this.sendGET("OptionValue","get",e.assign({"option_group_id.name":{IN:o?t:[t]},is_active:"1",return:["option_group_id.name","option_group_id","id","name","label","value","weight","is_active","is_reserved"]},n)).then(r).then(function(e){return o?i(e):e})}})}])}),define("common/services/api/appraisal-cycle",["common/lodash","common/modules/apis","common/services/api","common/services/api/option-group"],function(e,t){"use strict";t.factory("api.appraisal-cycle",["$q","$log","api","api.optionGroup",function(t,n,r,i){return n.debug("api.appraisal-cycle"),r.extend({all:function(e,t,r){return n.debug("api.appraisal-cycle.all"),this.getAll("AppraisalCycle",e,t,r,{"api.AppraisalCycle.getappraisalsperstep":{}})},create:function(t){return n.debug("api.appraisal-cycle.create"),this.sendPOST("AppraisalCycle","create",e.assign(t,{"api.AppraisalCycle.getappraisalsperstep":{}})).then(function(e){return e.values[0]})},find:function(e){n.debug("api.appraisal-cycle.find");var t={id:""+e,"api.AppraisalCycle.getappraisalsperstep":{}};return this.sendGET("AppraisalCycle","get",t,!1).then(function(e){return e.values[0]})},grades:function(){return n.debug("grades"),this.mockGET([{label:1,value:17},{label:2,value:74},{label:3,value:90},{label:4,value:30}])},statuses:function(){return n.debug("api.appraisal-cycle.statuses"),i.valuesOf("appraisal_status")},statusOverview:function(e){return n.debug("api.appraisal-cycle.statusOverview"),this.sendGET("AppraisalCycle","getstatusoverview",e).then(function(e){return e.values})},update:function(t){return n.debug("api.appraisal-cycle.update"),this.sendPOST("AppraisalCycle","create",e.assign(t,{"api.AppraisalCycle.getappraisalsperstep":{}})).then(function(e){return e.values[0]})},total:function(e){return n.debug("api.appraisal-cycle.total"),this.sendGET("AppraisalCycle","getcount",e||{}).then(function(e){return e.result})},types:function(){return n.debug("api.appraisal-cycle.types"),i.valuesOf("appraisal_cycle_type")}})}])}),define("common/services/api/contact-job-role-api.api",["common/modules/apis","common/services/api"],function(e){"use strict";e.factory("ContactJobRoleAPI",["$log","api",function(e,t){return e.debug("ContactJobRoleAPI"),t.extend({all:function(t,n,r,i){return e.debug("ContactJobRoleAPI.all()"),this.getAll("ContactHrJobRoles",t,n,r,i)}})}])}),define("common/bundles/apis",["common/services/api/appraisal","common/services/api/appraisal-cycle","common/services/api/contact-job-role-api.api","common/services/api/option-group"],function(){}),define("common/modules/services",["common/angular"],function(e){"use strict";return e.module("common.services",[])}),function(e){define("common/services/check-permissions",["common/lodash","common/modules/services"],function(t,n){"use strict";n.factory("checkPermissions",["$q",function(n){return function(r){return r=t.isArray(r)?r:[r],n.resolve(r.every(function(t){return e.checkPerm(t)}))}}])})}(CRM),define("common/services/dom-event-trigger",["common/modules/services"],function(e){"use strict";!function(t){e.factory("DOMEventTrigger",function(){return function(e,n){t(document).trigger(e,n)}})}(CRM.$)}),define("common/services/file-mime-types",["common/lodash","common/modules/services"],function(e,t){"use strict";t.factory("fileMimeTypes",["$q",function(e){var t={txt:"plain",png:"png",jpeg:"jpeg",bmp:"bmp",gif:"gif",pdf:"pdf",doc:"msword",docx:"vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"vnd.ms-excel",xlsx:"vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"vnd.ms-powerpoint",pptx:"vnd.openxmlformats-officedocument.presentationml.presentation"};return{getMimeTypeFor:function(n){return e.resolve(t[n])}}}])}),define("common/services/file.service",["common/modules/services"],function(e){"use strict";e.factory("fileService",["$http","$window","$log",function(e,t,n){return n.debug("Service: fileService"),{openFile:function(n){return e.get(n.url,{responseType:"arraybuffer"}).success(function(e){var r=new Blob([e],{type:n.fileType});t.navigator.msSaveOrOpenBlob?t.navigator.msSaveOrOpenBlob(r,n.name):t.open(URL.createObjectURL(r),"_blank")})}}}])}),define("common/services/hr-settings",["common/modules/services"],function(e){"use strict";e.factory("HR_settings",function(){return{DATE_FORMAT:null}})}),function(e){define("common/services/notification.service",["common/lodash","common/modules/services"],function(t,n){"use strict";n.factory("notificationService",function(){return t(["alert","success","info","error"]).map(function(t){return[t,function(n,r,i){return e.alert(r,n,t,i)}]}).zipObject().value()})})}(CRM),define("common/services/pub-sub",["common/modules/services"],function(e){"use strict";var t=Object.create(null);e.factory("pubSub",["$rootScope",function(e){return{subscribe:function(n,r){var i;return t[n]=t[n]||[],r.$rootScope=e,i=t[n].push(r)-1,{remove:function(){delete t[n][i]}}},publish:function(e,n){t[e]&&(n=void 0!=n?n:{},t[e].forEach(function(e){e.$rootScope.$applyAsync(function(){e(n)})}))}}}])}),define("common/bundles/services",["common/services/check-permissions","common/services/dom-event-trigger","common/services/file-mime-types","common/services/file.service","common/services/hr-settings","common/services/notification.service","common/services/pub-sub"],function(){}),define("common/decorators/angular-date/datepicker-addon",[],function(){"use strict";return["$delegate",function(e){var t=e[0],n=t.compile;return t.compile=function(){var e=n.apply(this,arguments);return function(t,n){function r(){n.trigger("click")}e.apply(this,arguments);var i=n.siblings(".input-group-addon");i.length&&(i.on("click",r),t.$on("$destroy",function(){i.off("click",r)}))}},e}]}),define("common/modules/templates",["common/angular"],function(e){"use strict";return e.module("common.templates",[]).run(["$templateCache",function(e){e.put("dialog.html",'\n\n\n'),e.put("loading.html",'
\n
\n \n
\n
\n
\n'),e.put("angular-date/datepickerPopup.html","
    \n\t
  • \n
\n"),e.put("angular-date/day.html",'\n \n \n \n \n \n \n\n \n \n \n \n\n \n\n \n \n \n \n \n \n \n
\n \n \n \n \n \n
\n {{label.abbr[0]}}\n
{{ weekNumbers[$index] }}\n \n
\n'),e.put("civihr-ui-select/choices.tpl.html",'
    \n
  • \n
    \n
      \n
    • \n
      \n
    • \n
    \n
  • \n
\n'),e.put("civihr-ui-select/match-multiple.tpl.html",'\n
  • \n \n \n
  • \n
    \n'),e.put("civihr-ui-select/match.tpl.html",'\n {{$select.contactList ? \'-select-\' : $select.placeholder}}\n \n \n \n\n'),e.put("civihr-ui-select/select-contacts-multiple.tpl.html",'
    \n
    \n
      \n \n
    • \n \n
    • \n
    \n\n \n\n \n
    \n
    \n'),e.put("civihr-ui-select/select-contacts.tpl.html",'
    \n
    \n \n
    \n'),e.put("civihr-ui-select/select-multiple.tpl.html",'
    \n
    \n
      \n \n
    • \n \n
    • \n
    \n \n
    \n
    \n'),e.put("civihr-ui-select/select.tpl.html",'
    \n
    \n \n
    \n'),e.put("contact-actions/contact-actions.html",'
    \n \n \n
    \n'),e.put("contact-actions/modals/form.html",'
    \n \n \n \n
    \n'); +return void 0===e?this.localeData():this.locale(e)});I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Rt("gggg","weekYear"),Rt("ggggg","weekYear"),Rt("GGGG","isoWeekYear"),Rt("GGGGG","isoWeekYear"),S("weekYear","gg"),S("isoWeekYear","GG"),U("G",mr),U("g",mr),U("GG",lr,ir),U("gg",lr,ir),U("GGGG",dr,ar),U("gggg",dr,ar),U("GGGGG",pr,sr),U("ggggg",pr,sr),B(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=v(e)}),B(["gg","GG"],function(t,n,r,i){n[i]=e.parseTwoDigitYear(t)}),I("Q",0,"Qo","quarter"),S("quarter","Q"),U("Q",rr),z("Q",function(e,t){t[Cr]=3*(v(e)-1)}),I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),S("week","w"),S("isoWeek","W"),U("w",lr),U("ww",lr,ir),U("W",lr),U("WW",lr,ir),B(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=v(e)});var Xr={dow:0,doy:6};I("D",["DD",2],"Do","date"),S("date","D"),U("D",lr),U("DD",lr,ir),U("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),z(["D","DD"],kr),z("Do",function(e,t){t[kr]=v(e.match(lr)[0],10)});var ei=D("Date",!0);I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),S("day","d"),S("weekday","e"),S("isoWeekday","E"),U("d",lr),U("e",lr),U("E",lr),U("dd",br),U("ddd",br),U("dddd",br),B(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:u(n).invalidWeekday=e}),B(["d","e","E"],function(e,t,n,r){t[r]=v(e)});var ti="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ni="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ri="Su_Mo_Tu_We_Th_Fr_Sa".split("_");I("DDD",["DDDD",3],"DDDo","dayOfYear"),S("dayOfYear","DDD"),U("DDD",fr),U("DDDD",or),z(["DDD","DDDD"],function(e,t,n){n._dayOfYear=v(e)}),I("H",["HH",2],0,"hour"),I("h",["hh",2],0,nn),I("hmm",0,0,function(){return""+nn.apply(this)+R(this.minutes(),2)}),I("hmmss",0,0,function(){return""+nn.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+R(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)}),rn("a",!0),rn("A",!1),S("hour","h"),U("a",on),U("A",on),U("H",lr),U("h",lr),U("HH",lr,ir),U("hh",lr,ir),U("hmm",ur),U("hmmss",cr),U("Hmm",ur),U("Hmmss",cr),z(["H","HH"],Er),z(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),z(["h","hh"],function(e,t,n){t[Er]=v(e),u(n).bigHour=!0}),z("hmm",function(e,t,n){var r=e.length-2;t[Er]=v(e.substr(0,r)),t[Sr]=v(e.substr(r)),u(n).bigHour=!0}),z("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Er]=v(e.substr(0,r)),t[Sr]=v(e.substr(r,2)),t[_r]=v(e.substr(i)),u(n).bigHour=!0}),z("Hmm",function(e,t,n){var r=e.length-2;t[Er]=v(e.substr(0,r)),t[Sr]=v(e.substr(r))}),z("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Er]=v(e.substr(0,r)),t[Sr]=v(e.substr(r,2)),t[_r]=v(e.substr(i))});var ii=/[ap]\.?m?\.?/i,oi=D("Hours",!0);I("m",["mm",2],0,"minute"),S("minute","m"),U("m",lr),U("mm",lr,ir),z(["m","mm"],Sr);var ai=D("Minutes",!1);I("s",["ss",2],0,"second"),S("second","s"),U("s",lr),U("ss",lr,ir),z(["s","ss"],_r);var si=D("Seconds",!1);I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),S("millisecond","ms"),U("S",fr,rr),U("SS",fr,ir),U("SSS",fr,or);var li;for(li="SSSS";li.length<=9;li+="S")U(li,hr);for(li="S";li.length<=9;li+="S")z(li,ln);var ui=D("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var ci=h.prototype;ci.add=Jr,ci.calendar=rt,ci.clone=it,ci.diff=ft,ci.endOf=Ct,ci.format=mt,ci.from=gt,ci.fromNow=vt,ci.to=yt,ci.toNow=bt,ci.get=N,ci.invalidAt=Ot,ci.isAfter=ot,ci.isBefore=at,ci.isBetween=st,ci.isSame=lt,ci.isSameOrAfter=ut,ci.isSameOrBefore=ct,ci.isValid=Dt,ci.lang=Qr,ci.locale=$t,ci.localeData=wt,ci.max=Br,ci.min=zr,ci.parsingFlags=At,ci.set=N,ci.startOf=xt,ci.subtract=Zr,ci.toArray=_t,ci.toObject=Mt,ci.toDate=St,ci.toISOString=ht,ci.toJSON=Tt,ci.toString=pt,ci.unix=Et,ci.valueOf=kt,ci.creationData=Nt,ci.year=Vr,ci.isLeapYear=pe,ci.weekYear=It,ci.isoWeekYear=Pt,ci.quarter=ci.quarters=qt,ci.month=Q,ci.daysInMonth=X,ci.week=ci.weeks=Bt,ci.isoWeek=ci.isoWeeks=Yt,ci.weeksInYear=jt,ci.isoWeeksInYear=Ft,ci.date=ei,ci.day=ci.days=Qt,ci.weekday=Xt,ci.isoWeekday=en,ci.dayOfYear=tn,ci.hour=ci.hours=oi,ci.minute=ci.minutes=ai,ci.second=ci.seconds=si,ci.millisecond=ci.milliseconds=ui,ci.utcOffset=Ue,ci.utc=He,ci.local=Ve,ci.parseZone=ze,ci.hasAlignedHourOffset=Be,ci.isDST=Ye,ci.isDSTShifted=We,ci.isLocal=Ge,ci.isUtcOffset=Ke,ci.isUtc=Je,ci.isUTC=Je,ci.zoneAbbr=un,ci.zoneName=cn,ci.dates=oe("dates accessor is deprecated. Use date instead.",ei),ci.months=oe("months accessor is deprecated. Use month instead",Q),ci.years=oe("years accessor is deprecated. Use year instead",Vr),ci.zone=oe("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",qe);var fi=ci,di={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},pi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},hi="Invalid date",mi="%d",gi=/\d{1,2}/,vi={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},yi=b.prototype;yi._calendar=di,yi.calendar=pn,yi._longDateFormat=pi,yi.longDateFormat=hn,yi._invalidDate=hi,yi.invalidDate=mn,yi._ordinal=mi,yi.ordinal=gn,yi._ordinalParse=gi,yi.preparse=vn,yi.postformat=vn,yi._relativeTime=vi,yi.relativeTime=yn,yi.pastFuture=bn,yi.set=$n,yi.months=G,yi._months=Or,yi.monthsShort=K,yi._monthsShort=Nr,yi.monthsParse=J,yi._monthsRegex=Ir,yi.monthsRegex=te,yi._monthsShortRegex=Rr,yi.monthsShortRegex=ee,yi.week=Ht,yi._week=Xr,yi.firstDayOfYear=zt,yi.firstDayOfWeek=Vt,yi.weekdays=Gt,yi._weekdays=ti,yi.weekdaysMin=Jt,yi._weekdaysMin=ri,yi.weekdaysShort=Kt,yi._weekdaysShort=ni,yi.weekdaysParse=Zt,yi.isPM=an,yi._meridiemParse=ii,yi.meridiem=sn,C("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===v(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=oe("moment.lang is deprecated. Use moment.locale instead.",C),e.langData=oe("moment.langData is deprecated. Use moment.localeData instead.",E);var bi=Math.abs,$i=jn("ms"),wi=jn("s"),xi=jn("m"),Ci=jn("h"),ki=jn("d"),Ei=jn("w"),Si=jn("M"),_i=jn("y"),Mi=Un("milliseconds"),Ti=Un("seconds"),Di=Un("minutes"),Ai=Un("hours"),Oi=Un("days"),Ni=Un("months"),Ri=Un("years"),Ii=Math.round,Pi={s:45,m:45,h:22,d:26,M:11},Fi=Math.abs,ji=Re.prototype;ji.abs=Mn,ji.add=Dn,ji.subtract=An,ji.as=Pn,ji.asMilliseconds=$i,ji.asSeconds=wi,ji.asMinutes=xi,ji.asHours=Ci,ji.asDays=ki,ji.asWeeks=Ei,ji.asMonths=Si,ji.asYears=_i,ji.valueOf=Fn,ji._bubble=Nn,ji.get=Ln,ji.milliseconds=Mi,ji.seconds=Ti,ji.minutes=Di,ji.hours=Ai,ji.days=Oi,ji.weeks=qn,ji.months=Ni,ji.years=Ri,ji.humanize=Bn,ji.toISOString=Yn,ji.toString=Yn,ji.toJSON=Yn,ji.locale=$t,ji.localeData=wt,ji.toIsoString=oe("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yn),ji.lang=Qr,I("X",0,0,"unix"),I("x",0,0,"valueOf"),U("x",mr),U("X",yr),z("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),z("x",function(e,t,n){n._d=new Date(v(e))}),e.version="2.11.1",t(De),e.fn=fi,e.min=Oe,e.max=Ne,e.now=Yr,e.utc=s,e.unix=fn,e.months=Cn,e.isDate=r,e.locale=C,e.invalid=f,e.duration=Ze,e.isMoment=m,e.weekdays=En,e.parseZone=dn,e.localeData=E,e.isDuration=Ie,e.monthsShort=kn,e.weekdaysMin=_n,e.defineLocale=k,e.weekdaysShort=Sn,e.normalizeUnits=_,e.relativeTimeThreshold=zn,e.prototype=fi;var Li=e;return Li}),define("common/bundles/vendors",["common/require","common/angular","common/angularAnimate","common/angularBootstrap","common/angularFileUpload","common/angularMocks","common/angularResource","common/angularRoute","common/angularXeditable","common/text-angular","common/ui-select","common/d3","common/lodash","common/moment"],function(){}),define("common/modules/apis",["common/angular"],function(e){"use strict";return e.module("common.apis",[])}),define("common/services/api",["common/angular","common/lodash","common/modules/apis"],function(e,t,n){"use strict";n.factory("api",["$log","$http","$httpParamSerializer","$q","$timeout",function(n,r,i,o,a){function s(e){return e.data.is_error?(n.error(e.data),o.reject(e.data.error_message)):e.data}function l(e){var n={options:{limit:0}};return JSON.stringify(t.merge(n,e||{}))}n.debug("api");var u="/civicrm/ajax/rest";return{extend:function(t){return e.extend(Object.create(this),t)},getAll:function(e,r,i,a,s,l,u){return n.debug("api.all"),r=r||{},l=l||"get",o.all([function(){var n=t.assign({},r,s||{},{options:t.assign({},r.options,{sort:a||"id DESC"})});return i&&(n.options.offset=(i.page-1)*i.size,n.options.limit=i.size),this.sendGET(e,l,n,u)}.bind(this)(),function(){if(!i)return o.resolve();var n=t.assign({},r,{return:"id"});return n=t.omit(n,function(e,n){return t.startsWith(n,"api.")}),this.sendGET(e,l,n,u)}.bind(this)()]).then(function(e){var t=e[0],n=i?e[1]:t;return{list:t.values,total:n.count,allIds:n.values.map(function(e){return e.id}).join(",")}})},mockGET:function(e,t){var n=o.defer();return a(function(){n.resolve(e)},t||0),n.promise},mockPOST:function(e,t){return this.mockGET.apply(this,arguments)},sendGET:function(e,t,n,i){return r({method:"GET",url:u,cache:"undefined"==typeof i||!!i,responseType:"json",params:{sequential:1,json:l(n),entity:e,action:t}}).then(s)},sendPOST:function(e,t,o){return n.debug("api.sendPOST"),r({method:"POST",url:u,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},responseType:"json",data:{json:l(o),sequential:1,entity:e,action:t},transformRequest:i}).then(s)}}}])}),define("common/services/api/appraisal",["common/modules/apis","common/services/api"],function(e){"use strict";e.factory("api.appraisal",["$log","api",function(e,t){return e.debug("api.appraisal"),t.extend({all:function(t,n,r){return e.debug("api.appraisal.api"),this.getAll("Appraisal",t,n,r)},create:function(t){return e.debug("api.appraisal.create"),this.sendPOST("Appraisal","create",t).then(function(e){return e.values[0]})},find:function(t){return e.debug("api.appraisal.find"),this.sendGET("Appraisal","get",{id:""+t},!1).then(function(e){return e.values[0]})}})}])}),define("common/services/api/option-group",["common/lodash","common/modules/apis","common/services/api"],function(e,t){"use strict";t.factory("api.optionGroup",["$log","api",function(t,n){function r(t){return t.values.map(function(t){var n=e.clone(t);return n.option_group_name=n["option_group_id.name"],delete n["option_group_id.name"],n})}function i(t){return e.transform(t,function(e,t){var n=t.option_group_name;e[n]=e[n]||[],e[n].push(t)})}return t.debug("api.optionGroup"),n.extend({valuesOf:function(t,n){var o=e.isArray(t);return this.sendGET("OptionValue","get",e.assign({"option_group_id.name":{IN:o?t:[t]},is_active:"1",return:["option_group_id.name","option_group_id","id","name","label","value","weight","is_active","is_reserved"]},n)).then(r).then(function(e){return o?i(e):e})}})}])}),define("common/services/api/appraisal-cycle",["common/lodash","common/modules/apis","common/services/api","common/services/api/option-group"],function(e,t){"use strict";t.factory("api.appraisal-cycle",["$q","$log","api","api.optionGroup",function(t,n,r,i){return n.debug("api.appraisal-cycle"),r.extend({all:function(e,t,r){return n.debug("api.appraisal-cycle.all"),this.getAll("AppraisalCycle",e,t,r,{"api.AppraisalCycle.getappraisalsperstep":{}})},create:function(t){return n.debug("api.appraisal-cycle.create"),this.sendPOST("AppraisalCycle","create",e.assign(t,{"api.AppraisalCycle.getappraisalsperstep":{}})).then(function(e){return e.values[0]})},find:function(e){n.debug("api.appraisal-cycle.find");var t={id:""+e,"api.AppraisalCycle.getappraisalsperstep":{}};return this.sendGET("AppraisalCycle","get",t,!1).then(function(e){return e.values[0]})},grades:function(){return n.debug("grades"),this.mockGET([{label:1,value:17},{label:2,value:74},{label:3,value:90},{label:4,value:30}])},statuses:function(){return n.debug("api.appraisal-cycle.statuses"),i.valuesOf("appraisal_status")},statusOverview:function(e){return n.debug("api.appraisal-cycle.statusOverview"),this.sendGET("AppraisalCycle","getstatusoverview",e).then(function(e){return e.values})},update:function(t){return n.debug("api.appraisal-cycle.update"),this.sendPOST("AppraisalCycle","create",e.assign(t,{"api.AppraisalCycle.getappraisalsperstep":{}})).then(function(e){return e.values[0]})},total:function(e){return n.debug("api.appraisal-cycle.total"),this.sendGET("AppraisalCycle","getcount",e||{}).then(function(e){return e.result})},types:function(){return n.debug("api.appraisal-cycle.types"),i.valuesOf("appraisal_cycle_type")}})}])}),define("common/services/api/contact-job-role-api.api",["common/modules/apis","common/services/api"],function(e){"use strict";e.factory("ContactJobRoleAPI",["$log","api",function(e,t){return e.debug("ContactJobRoleAPI"),t.extend({all:function(t,n,r,i){return e.debug("ContactJobRoleAPI.all()"),this.getAll("ContactHrJobRoles",t,n,r,i)}})}])}),define("common/bundles/apis",["common/services/api/appraisal","common/services/api/appraisal-cycle","common/services/api/contact-job-role-api.api","common/services/api/option-group"],function(){}),define("common/modules/services",["common/angular"],function(e){"use strict";return e.module("common.services",[])}),function(e){define("common/services/check-permissions",["common/lodash","common/modules/services"],function(t,n){"use strict";n.factory("checkPermissions",["$q",function(n){return function(r){return r=t.isArray(r)?r:[r],n.resolve(r.every(function(t){return e.checkPerm(t)}))}}])})}(CRM),define("common/services/dom-event-trigger",["common/modules/services"],function(e){"use strict";!function(t){e.factory("DOMEventTrigger",function(){return function(e,n){t(document).trigger(e,n)}})}(CRM.$)}),define("common/services/file-mime-types",["common/lodash","common/modules/services"],function(e,t){"use strict";t.factory("fileMimeTypes",["$q",function(e){var t={txt:"plain",png:"png",jpeg:"jpeg",bmp:"bmp",gif:"gif",pdf:"pdf",doc:"msword",docx:"vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"vnd.ms-excel",xlsx:"vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"vnd.ms-powerpoint",pptx:"vnd.openxmlformats-officedocument.presentationml.presentation"};return{getMimeTypeFor:function(n){return e.resolve(t[n])}}}])}),define("common/services/file.service",["common/modules/services"],function(e){"use strict";e.factory("fileService",["$http","$window","$log",function(e,t,n){return n.debug("Service: fileService"),{openFile:function(n){return e.get(n.url,{responseType:"arraybuffer"}).success(function(e){var r=new Blob([e],{type:n.fileType});t.navigator.msSaveOrOpenBlob?t.navigator.msSaveOrOpenBlob(r,n.name):t.open(URL.createObjectURL(r),"_blank")})}}}])}),define("common/services/hr-settings",["common/modules/services"],function(e){"use strict";e.factory("HR_settings",function(){return{DATE_FORMAT:null}})}),function(e){define("common/services/notification.service",["common/lodash","common/modules/services"],function(t,n){"use strict";n.factory("notificationService",function(){return t(["alert","success","info","error"]).map(function(t){return[t,function(n,r,i){return e.alert(r,n,t,i)}]}).zipObject().value()})})}(CRM),define("common/services/pub-sub",["common/modules/services"],function(e){"use strict";var t=Object.create(null);e.factory("pubSub",["$rootScope",function(e){return{subscribe:function(n,r){var i;return t[n]=t[n]||[],r.$rootScope=e,i=t[n].push(r)-1,{remove:function(){delete t[n][i]}}},publish:function(e,n){t[e]&&(n=void 0!=n?n:{},t[e].forEach(function(e){e.$rootScope.$applyAsync(function(){e(n)})}))}}}])}),define("common/bundles/services",["common/services/check-permissions","common/services/dom-event-trigger","common/services/file-mime-types","common/services/file.service","common/services/hr-settings","common/services/notification.service","common/services/pub-sub"],function(){}),define("common/decorators/angular-date/datepicker-addon",[],function(){"use strict";return["$delegate",function(e){var t=e[0],n=t.compile;return t.compile=function(){var e=n.apply(this,arguments);return function(t,n){function r(){n.trigger("click")}e.apply(this,arguments);var i=n.siblings(".input-group-addon");i.length&&(i.on("click",r),t.$on("$destroy",function(){i.off("click",r)}))}},e}]}),define("common/modules/templates",["common/angular"],function(e){"use strict";return e.module("common.templates",[]).run(["$templateCache",function(e){e.put("dialog.html",'\n\n\n'),e.put("loading.html",'
    \n
    \n \n
    \n
    \n
    \n'),e.put("angular-date/datepickerPopup.html","
      \n\t
    • \n
    \n"),e.put("angular-date/day.html",'\n \n \n \n \n \n \n\n \n \n \n \n\n \n\n \n \n \n \n \n \n \n
    \n \n \n \n \n \n
    \n {{label.abbr[0]}}\n
    {{ weekNumbers[$index] }}\n \n
    \n'),e.put("civihr-ui-select/choices.tpl.html",'
      \n
    • \n
      \n
        \n
      • \n
        \n
      • \n
      \n
    • \n
    \n'),e.put("civihr-ui-select/match-multiple.tpl.html",'\n
  • \n \n \n
  • \n
    \n'),e.put("civihr-ui-select/match.tpl.html",'\n {{$select.contactList ? \'-select-\' : $select.placeholder}}\n \n \n \n\n'),e.put("civihr-ui-select/select-contacts-multiple.tpl.html",'
    \n
    \n
      \n \n
    • \n \n
    • \n
    \n\n \n\n \n
    \n
    \n'),e.put("civihr-ui-select/select-contacts.tpl.html",'
    \n
    \n \n
    \n'),e.put("civihr-ui-select/select-multiple.tpl.html",'
    \n
    \n
      \n \n
    • \n \n
    • \n
    \n \n
    \n
    \n'),e.put("civihr-ui-select/select.tpl.html",'
    \n
    \n \n
    \n'),e.put("contact-actions/contact-actions.html",'
    \n \n \n
    \n'),e.put("contact-actions/modals/form.html",'
    \n \n \n \n
    \n'); }])}),define("common/modules/controllers",["common/angular","common/angularBootstrap"],function(e){"use strict";return e.module("common.controllers",["ui.bootstrap"])}),define("common/modules/directives",["common/angular","common/decorators/angular-date/datepicker-addon","common/ui-select","common/modules/templates","common/modules/controllers","common/modules/services","common/modules/apis"],function(e,t){"use strict";return e.module("common.directives",["common.templates","common.controllers","common.apis","ui.select","ngSanitize"]).config(["$provide",function(e){e.decorator("uibDatepickerPopupDirective",t)}])}),define("common/directives/prevent-animations",["common/modules/directives"],function(e){"use strict";e.directive("preventAnimations",["$animate",function(e){return{restrict:"A",link:function(t,n,r){e.enabled(n,!1)}}}])}),define("common/directives/loading",["common/modules/directives","common/directives/prevent-animations"],function(e){"use strict";e.directive("crmLoading",["$templateCache",function(e){return{scope:{show:"="},restrict:"E",replace:!0,transclude:!0,template:e.get("loading.html")}}])}),define("common/services/api/contact-actions",["common/modules/apis","common/services/api"],function(e){"use strict";e.factory("api.contactActions",["$q","api",function(e,t){function n(e,n){return t.sendGET(e,"getoptions",{field:n,context:"search"}).then(function(e){return e.values})}function r(e){return t.sendGET("UFField","get",{uf_group_id:e,is_active:!0}).then(function(e){return e.values})}function i(n,r){return e(function(e,i){return r.contact_type=n,r.email?t.sendGET("CustomField","get",{return:["id"],custom_group_id:"Emergency_Contacts",name:"email"}).then(function(t){r["custom_"+t.id]=r.email,delete r.email,e()}):void e()}).then(function(){return t.sendPOST("Contact","create",r).then(function(e){return e.values[0]})})}return t.extend({getOptions:{forContactType:function(){return n.call(this,"Contact","contact_type")},forGroup:function(){return n.call(this,"GroupContact","group_id")},forTag:function(){return n.call(this,"EntityTag","tag_id")},forStateProvince:function(){return n.call(this,"Address","state_province_id")},forCountry:function(){return n.call(this,"Address","country_id")},forGender:function(){return n.call(this,"Contact","gender_id")},forDeceased:function(){return n.call(this,"Contact","is_deceased")}},save:{newIndividual:function(e){return i.call(this,"Individual",e)},newOrganization:function(e){return i.call(this,"Organization",e)},newHousehold:function(e){return i.call(this,"Household",e)}},getFormFields:{forNewIndividual:function(){return r.call(this,"new_individual")},forNewOrganization:function(){return r.call(this,"new_organization")},forNewHousehold:function(){return r.call(this,"new_household")}}})}])}),define("common/controllers/contact-actions/modal-ctrl",[],function(){"use strict";return function(e,t){this.errorMsg="",this.loading=!0,this.formFields=[],this.init=function(e){e().then(function(e){this.loading=!1,this.formFields=e}.bind(this)).catch(function(){this.loading=!1,this.errorMsg="Error while loading form fields"}.bind(this))},this.cancel=function(){t.dismiss("cancel")},this.save=function(n,r){this.loading=!0;var i=this.formFields.reduce(function(e,t){return e[t.field_name]=t.value,e},{});n(i).then(function(n){this.loading=!1,e.$broadcast(r,n),t.dismiss("cancel")}.bind(this)).catch(function(){this.loading=!1,this.errorMsg="Error while saving data"}.bind(this))}}}),define("common/controllers/contact-actions/new-individual-ctrl",["common/modules/controllers","common/controllers/contact-actions/modal-ctrl","common/services/api/contact-actions"],function(e,t){"use strict";function n(e,n,r){var i=this;t.call(i,e,n),i.title="New Individual",i.init(r.getFormFields.forNewIndividual),i.submit=function(){i.save(r.save.newIndividual,"newIndividualCreated")}}n.prototype=Object.create(t.prototype),n.prototype.constructor=n,e.controller("NewIndividualModalCtrl",["$rootScope","$uibModalInstance","api.contactActions",n])}),define("common/controllers/contact-actions/new-household-ctrl",["common/modules/controllers","common/controllers/contact-actions/modal-ctrl","common/services/api/contact-actions"],function(e,t){"use strict";function n(e,n,r){var i=this;t.call(i,e,n),i.title="New Household",i.init(r.getFormFields.forNewHousehold),i.submit=function(){i.save(r.save.newHousehold,"newHouseholdCreated")}}n.prototype=Object.create(t.prototype),n.prototype.constructor=n,e.controller("NewHouseholdModalCtrl",["$rootScope","$uibModalInstance","api.contactActions",n])}),define("common/controllers/contact-actions/new-organization-ctrl",["common/modules/controllers","common/controllers/contact-actions/modal-ctrl","common/services/api/contact-actions"],function(e,t){"use strict";function n(e,n,r){var i=this;t.call(i,e,n),i.title="New Organization",i.init(r.getFormFields.forNewOrganization),i.submit=function(){i.save(r.save.newOrganization,"newOrganizationCreated")}}n.prototype=Object.create(t.prototype),n.prototype.constructor=n,e.controller("NewOrganizationModalCtrl",["$rootScope","$uibModalInstance","api.contactActions",n])}),define("common/controllers/contact-actions/contact-actions-ctrl",["common/modules/controllers","common/services/api/contact-actions","common/controllers/contact-actions/new-individual-ctrl","common/controllers/contact-actions/new-household-ctrl","common/controllers/contact-actions/new-organization-ctrl"],function(e){"use strict";e.controller("ContactActionsCtrl",["$scope","$rootElement","$uibModal","api.contactActions",function(e,t,n,r){var i=this;e.$watch(function(){return i.refineSearch.selected},function(t,n){t!==n&&e.$emit("contactRefineSearch",{field:t.field?t.field.label:null,option:t.option?t.option.value:null})},!0),i.refineSearch={selected:{field:null,option:null},availableFields:[{label:"Contact Type",getOptions:r.getOptions.forContactType},{label:"Group",getOptions:r.getOptions.forGroup},{label:"Tag",getOptions:r.getOptions.forTag},{label:"State / Province",getOptions:r.getOptions.forStateProvince},{label:"Country",getOptions:r.getOptions.forCountry},{label:"Gender",getOptions:r.getOptions.forGender},{label:"Deceased",getOptions:r.getOptions.forDeceased}],availableOptions:{refresh:function(){i.refineSearch.selected.field?(this.options=null,i.refineSearch.selected.field.getOptions().then(function(e){this.options=e}.bind(this))):this.options=[]},options:[]}},i.showNewIndividualModal=function(){n.open({appendTo:t.children().eq(0),controller:"NewIndividualModalCtrl",controllerAs:"$ctrl",bindToController:!0,templateUrl:"contact-actions/modals/form.html"})},i.showNewHouseholdModal=function(){n.open({appendTo:t.children().eq(0),controller:"NewHouseholdModalCtrl",controllerAs:"$ctrl",bindToController:!0,templateUrl:"contact-actions/modals/form.html"})},i.showNewOrganizationModal=function(){n.open({appendTo:t.children().eq(0),controller:"NewOrganizationModalCtrl",controllerAs:"$ctrl",bindToController:!0,templateUrl:"contact-actions/modals/form.html"})}}])}),define("common/directives/contact-actions/contact-actions",["common/modules/directives","common/controllers/contact-actions/contact-actions-ctrl","common/directives/loading"],function(e){"use strict";e.directive("contactActions",[function(){return{restrict:"E",templateUrl:"contact-actions/contact-actions.html",controller:"ContactActionsCtrl",controllerAs:"$ctrl",link:function(e,t,n){e.$ctrl.refineSearchVisible=t.parent().parent()[0].hasAttribute("refine-search")}}}])}),define("common/bundles/directives",["common/directives/loading","common/directives/prevent-animations","common/directives/contact-actions/contact-actions"],function(){}),define("common/decorators/angular-date/datepicker-popup",["common/lodash"],function(e){return["$delegate","HR_settings",function(t,n){"use strict";var r=t[0].link;return t[0].compile=function(){return function(t,i,o,a){o.uibDatepickerPopup=o.uibDatepickerPopup||n.DATE_FORMAT||"yyyy-MM-dd",o.showButtonBar=o.showButtonBar||!1,t.datepickerOptions=e.assign({formatDayHeader:"E",showWeeks:!1,startingDay:1},t.datepickerOptions),r.apply(this,arguments)}},t}]}),define("common/decorators/angular-date/date-filter",[],function(){"use strict";return["$delegate",function(e){var t=e;return function(){if("E"===arguments[1]){var e=Array.prototype.slice.call(arguments);return e[1]="EEE",t.apply(this,e)[0]}return t.apply(this,arguments)}}]}),define("common/modules/angular-date",["common/angular","common/decorators/angular-date/datepicker-popup","common/decorators/angular-date/date-filter","common/modules/services","common/angularBootstrap","common/modules/templates"],function(e,t,n){"use strict";function r(e){var t="uib/template/datepicker/"+e+".html",n=i.get(t);n=n.replace(/glyphicon glyphicon-chevron-(left|right)/gm,"fa fa-chevron-$1"),"day"===e&&(n=function(e){return jQuery(e).find('th[ng-if="showWeeks"]').parent().css({"border-top":"1px solid #DDD"}),jQuery(e).wrap("
    ").parent().html()}(jQuery.parseHTML(n))),i.put(t,n)}var i;return e.module("common.angularDate",["common.services","ui.bootstrap","common.templates"]).config(["$provide",function(e){e.decorator("uibDatepickerPopupDirective",t),e.decorator("dateFilter",n)}]).run(["$templateCache",function(e){i=e,["day","month","year"].forEach(r)}])}),define("common/services/angular-date/date-format",["common/angular","common/modules/angular-date","common/services/hr-settings"],function(e,t){"use strict";t.factory("DateFormat",["$q","HR_settings",function(e,t){return{dateFormat:null,getDateFormat:function(){return this.dateFormat?e.when(this.dateFormat):e.when("dd/MM/yyyy").catch(function(){return"yyyy-MM-dd"}).then(function(e){return t.DATE_FORMAT=e,this.dateFormat=e,e}.bind(this))}}}])}),define("common/filters/angular-date/format-date",["common/moment","common/modules/angular-date","common/services/hr-settings"],function(e,t){"use strict";t.filter("formatDate",["HR_settings",function(t){var n=["DD-MM-YYYY","DD-MM-YYYY HH:mm:ss","YYYY-MM-DD","YYYY-MM-DD HH:mm:ss","DD/MM/YYYY","x"];return function(r,i){var o,a=i||t.DATE_FORMAT||"YYYY-MM-DD",s=e(0);return r instanceof Date&&(r=e(r).format("YYYY-MM-DD HH:mm:ss")),o=e(r,n,!0),o.isValid()&&!o.isSame(s)?i===Date?o.toDate():o.format(a.toUpperCase()):"Unspecified"}}])}),define("common/directives/angular-date/date-input",["common/modules/angular-date","common/filters/angular-date/format-date"],function(e){"use strict";e.directive("dateInput",["$filter",function(e){return{require:"ngModel",link:function(t,n,r,i){function o(t){var n=e("formatDate")(t);return n="Unspecified"==n?"":n}i.$formatters.push(o),i.$parsers=[]}}}])}),define("common/bundles/angular-date",["common/services/angular-date/date-format","common/filters/angular-date/format-date","common/directives/angular-date/date-input"],function(){}),define("common/modules/routers/compu-ng-route",["common/angular","common/angularRoute"],function(e){"use strict";return e.module("compuNgRoute",["ngRoute"]).config(["$routeProvider",function(t){var n=t.when;t.resolveForAll=function(e){return t.commonResolve=e,t},t.when=function(r,i){return e.extend(i.resolve||{},t.commonResolve||{}),n.call(t,r,i)}}])}),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(e,t,n){"use strict";function r(e,t){return L(new(L(function(){},{prototype:e})),t)}function i(e){return j(arguments,function(t){t!==e&&j(t,function(t,n){e.hasOwnProperty(n)||(e[n]=t)})}),e}function o(e,t){var n=[];for(var r in e.path){if(e.path[r]!==t.path[r])break;n.push(e.path[r])}return n}function a(e){if(Object.keys)return Object.keys(e);var t=[];return j(e,function(e,n){t.push(n)}),t}function s(e,t){if(Array.prototype.indexOf)return e.indexOf(t,Number(arguments[2])||0);var n=e.length>>>0,r=Number(arguments[2])||0;for(r=0>r?Math.ceil(r):Math.floor(r),0>r&&(r+=n);n>r;r++)if(r in e&&e[r]===t)return r;return-1}function l(e,t,n,r){var i,l=o(n,r),u={},c=[];for(var f in l)if(l[f].params&&(i=a(l[f].params),i.length))for(var d in i)s(c,i[d])>=0||(c.push(i[d]),u[i[d]]=e[i[d]]);return L({},u,t)}function u(e,t,n){if(!n){n=[];for(var r in e)n.push(r)}for(var i=0;i "));if(y[n]=r,I(e))g.push(n,[function(){return t.get(e)}],u);else{var i=t.annotate(e);j(i,function(e){e!==n&&l.hasOwnProperty(e)&&p(l[e],e)}),g.push(n,e,i)}v.pop(),y[n]=o}}function h(e){return P(e)&&e.then&&e.$$promises}if(!P(l))throw new Error("'invocables' must be an object");var m=a(l||{}),g=[],v=[],y={};return j(l,p),l=v=y=null,function(r,o,a){function s(){--$||(w||i(b,o.$$values),v.$$values=b,v.$$promises=v.$$promises||!0,delete v.$$inheritedValues,p.resolve(b))}function l(e){v.$$failure=e,p.reject(e)}function u(n,i,o){function u(e){f.reject(e),l(e)}function c(){if(!N(v.$$failure))try{f.resolve(t.invoke(i,a,b)),f.promise.then(function(e){b[n]=e,s()},u)}catch(e){u(e)}}var f=e.defer(),d=0;j(o,function(e){y.hasOwnProperty(e)&&!r.hasOwnProperty(e)&&(d++,y[e].then(function(t){b[e]=t,--d||c()},u))}),d||c(),y[n]=f.promise}if(h(r)&&a===n&&(a=o,o=r,r=null),r){if(!P(r))throw new Error("'locals' must be an object")}else r=c;if(o){if(!h(o))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else o=f;var p=e.defer(),v=p.promise,y=v.$$promises={},b=L({},r),$=1+g.length/3,w=!1;if(N(o.$$failure))return l(o.$$failure),v;o.$$inheritedValues&&i(b,d(o.$$inheritedValues,m)),L(y,o.$$promises),o.$$values?(w=i(b,d(o.$$values,m)),v.$$inheritedValues=d(o.$$values,m),s()):(o.$$inheritedValues&&(v.$$inheritedValues=d(o.$$inheritedValues,m)),o.then(s,l));for(var x=0,C=g.length;C>x;x+=3)r.hasOwnProperty(g[x])?s():u(g[x],g[x+1],g[x+2]);return v}},this.resolve=function(e,t,n,r){return this.study(e)(t,n,r)}}function g(e,t,n){this.fromConfig=function(e,t,n){return N(e.template)?this.fromString(e.template,t):N(e.templateUrl)?this.fromUrl(e.templateUrl,t):N(e.templateProvider)?this.fromProvider(e.templateProvider,t,n):null},this.fromString=function(e,t){return R(e)?e(t):e},this.fromUrl=function(n,r){return R(n)&&(n=n(r)),null==n?null:e.get(n,{cache:t,headers:{Accept:"text/html"}}).then(function(e){return e.data})},this.fromProvider=function(e,t,r){return n.invoke(e,null,r||{params:t})}}function v(e,t,i){function o(t,n,r,i){if(g.push(t),h[t])return h[t];if(!/^\w+(-+\w+)*(?:\[\])?$/.test(t))throw new Error("Invalid parameter name '"+t+"' in pattern '"+e+"'");if(m[t])throw new Error("Duplicate parameter name '"+t+"' in pattern '"+e+"'");return m[t]=new q.Param(t,n,r,i),m[t]}function a(e,t,n,r){var i=["",""],o=e.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!t)return o;switch(n){case!1:i=["(",")"+(r?"?":"")];break;case!0:i=["?(",")?"];break;default:i=["("+n+"|",")?"]}return o+i[0]+t+i[1]}function s(i,o){var a,s,l,u,c;return a=i[2]||i[3],c=t.params[a],l=e.substring(d,i.index),s=o?i[4]:i[4]||("*"==i[1]?".*":null),u=q.type(s||"string")||r(q.type("string"),{pattern:new RegExp(s,t.caseInsensitive?"i":n)}),{id:a,regexp:s,segment:l,type:u,cfg:c}}t=L({params:{}},P(t)?t:{});var l,u=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,c=/([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,f="^",d=0,p=this.segments=[],h=i?i.params:{},m=this.params=i?i.params.$$new():new q.ParamSet,g=[];this.source=e;for(var v,y,b;(l=u.exec(e))&&(v=s(l,!1),!(v.segment.indexOf("?")>=0));)y=o(v.id,v.type,v.cfg,"path"),f+=a(v.segment,y.type.pattern.source,y.squash,y.isOptional),p.push(v.segment),d=u.lastIndex;b=e.substring(d);var $=b.indexOf("?");if($>=0){var w=this.sourceSearch=b.substring($);if(b=b.substring(0,$),this.sourcePath=e.substring(0,d+$),w.length>0)for(d=0;l=c.exec(w);)v=s(l,!0),y=o(v.id,v.type,v.cfg,"search"),d=u.lastIndex}else this.sourcePath=e,this.sourceSearch="";f+=a(b)+(t.strict===!1?"/?":"")+"$",p.push(b),this.regexp=new RegExp(f,t.caseInsensitive?"i":n),this.prefix=p[0],this.$$paramNames=g}function y(e){L(this,e)}function b(){function e(e){return null!=e?e.toString().replace(/\//g,"%2F"):e}function i(e){return null!=e?e.toString().replace(/%2F/g,"/"):e}function o(){return{strict:m,caseInsensitive:d}}function l(e){return R(e)||F(e)&&R(e[e.length-1])}function u(){for(;x.length;){var e=x.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");t.extend($[e.name],f.invoke(e.def))}}function c(e){L(this,e||{})}q=this;var f,d=!1,m=!0,g=!1,$={},w=!0,x=[],C={string:{encode:e,decode:i,is:function(e){return null==e||!N(e)||"string"==typeof e},pattern:/[^\/]*/},int:{encode:e,decode:function(e){return parseInt(e,10)},is:function(e){return N(e)&&this.decode(e.toString())===e},pattern:/\d+/},bool:{encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:function(e){return e===!0||e===!1},pattern:/0|1/},date:{encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):n},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):n},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return this.is(e)&&this.is(t)&&e.toISOString()===t.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:t.toJson,decode:t.fromJson,is:t.isObject,equals:t.equals,pattern:/[^\/]*/},any:{encode:t.identity,decode:t.identity,equals:t.equals,pattern:/.*/}};b.$$getDefaultValue=function(e){if(!l(e.value))return e.value;if(!f)throw new Error("Injectable functions cannot be called at configuration time");return f.invoke(e.value)},this.caseInsensitive=function(e){return N(e)&&(d=e),d},this.strictMode=function(e){return N(e)&&(m=e),m},this.defaultSquashPolicy=function(e){if(!N(e))return g;if(e!==!0&&e!==!1&&!I(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return g=e,e},this.compile=function(e,t){return new v(e,L(o(),t))},this.isMatcher=function(e){if(!P(e))return!1;var t=!0;return j(v.prototype,function(n,r){R(n)&&(t=t&&N(e[r])&&R(e[r]))}),t},this.type=function(e,t,n){if(!N(t))return $[e];if($.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return $[e]=new y(L({name:e},t)),n&&(x.push({name:e,def:n}),w||u()),this},j(C,function(e,t){$[t]=new y(L({name:t},e))}),$=r($,{}),this.$get=["$injector",function(e){return f=e,w=!1,u(),j(C,function(e,t){$[t]||($[t]=new y(e))}),this}],this.Param=function(e,t,r,i){function o(e){var t=P(e)?a(e):[],n=-1===s(t,"value")&&-1===s(t,"type")&&-1===s(t,"squash")&&-1===s(t,"array");return n&&(e={value:e}),e.$$fn=l(e.value)?e.value:function(){return e.value},e}function u(t,n,r){if(t.type&&n)throw new Error("Param '"+e+"' has two type configurations.");return n?n:t.type?t.type instanceof y?t.type:new y(t.type):"config"===r?$.any:$.string}function c(){var t={array:"search"===i&&"auto"},n=e.match(/\[\]$/)?{array:!0}:{};return L(t,n,r).array}function d(e,t){var n=e.squash;if(!t||n===!1)return!1;if(!N(n)||null==n)return g;if(n===!0||I(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}function m(e,t,r,i){var o,a,l=[{from:"",to:r||t?n:""},{from:null,to:r||t?n:""}];return o=F(e.replace)?e.replace:[],I(i)&&o.push({from:i,to:n}),a=h(o,function(e){return e.from}),p(l,function(e){return-1===s(a,e.from)}).concat(o)}function v(){if(!f)throw new Error("Injectable functions cannot be called at configuration time");var e=f.invoke(r.$$fn);if(null!==e&&e!==n&&!x.type.is(e))throw new Error("Default value ("+e+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return e}function b(e){function t(e){return function(t){return t.from===e}}function n(e){var n=h(p(x.replace,t(e)),function(e){return e.to});return n.length?n[0]:e}return e=n(e),N(e)?x.type.$normalize(e):v()}function w(){return"{Param:"+e+" "+t+" squash: '"+E+"' optional: "+k+"}"}var x=this;r=o(r),t=u(r,t,i);var C=c();t=C?t.$asArray(C,"search"===i):t,"string"!==t.name||C||"path"!==i||r.value!==n||(r.value="");var k=r.value!==n,E=d(r,k),S=m(r,C,k,E);L(this,{id:e,type:t,location:i,array:C,squash:E,replace:S,isOptional:k,value:b,dynamic:n,config:r,toString:w})},c.prototype={$$new:function(){return r(this,L(new c,{$$parent:this}))},$$keys:function(){for(var e=[],t=[],n=this,r=a(c.prototype);n;)t.push(n),n=n.$$parent;return t.reverse(),j(t,function(t){j(a(t),function(t){-1===s(e,t)&&-1===s(r,t)&&e.push(t)})}),e},$$values:function(e){var t={},n=this;return j(n.$$keys(),function(r){t[r]=n[r].value(e&&e[r])}),t},$$equals:function(e,t){var n=!0,r=this;return j(r.$$keys(),function(i){var o=e&&e[i],a=t&&t[i];r[i].type.equals(o,a)||(n=!1)}),n},$$validates:function(e){var r,i,o,a,s,l=this.$$keys();for(r=0;ri;i++)if(t(u[i]))return;c&&t(c)}}function p(){return l=l||i.$on("$locationChangeSuccess",d)}var h,m=a.baseHref(),g=r.url();return f||p(),{sync:function(){d()},listen:function(){return p()},update:function(e){return e?void(g=r.url()):void(r.url()!==g&&(r.url(g),r.replace()))},push:function(e,t,i){var o=e.format(t||{});null!==o&&t&&t["#"]&&(o+="#"+t["#"]),r.url(o),h=i&&i.$$avoidResync?r.url():n,i&&i.replace&&r.replace()},href:function(n,i,o){if(!n.validates(i))return null;var a=e.html5Mode();t.isObject(a)&&(a=a.enabled);var l=n.format(i);if(o=o||{},a||null===l||(l="#"+e.hashPrefix()+l),null!==l&&i&&i["#"]&&(l+="#"+i["#"]),l=s(l,a,o.absolute),!o.absolute||!l)return l;var u=!a&&l?"/":"",c=r.port();return c=80===c||443===c?"":":"+c,[r.protocol(),"://",r.host(),c,u,l].join("")}}}var l,u=[],c=null,f=!1;this.rule=function(e){if(!R(e))throw new Error("'rule' must be a function");return u.push(e),this},this.otherwise=function(e){if(I(e)){var t=e;e=function(){return t}}else if(!R(e))throw new Error("'rule' must be a function");return c=e,this},this.when=function(e,t){var n,s=I(t);if(I(e)&&(e=r.compile(e)),!s&&!R(t)&&!F(t))throw new Error("invalid 'handler' in when()");var l={matcher:function(e,t){return s&&(n=r.compile(t),t=["$match",function(e){return n.format(e)}]),L(function(n,r){return a(n,t,e.exec(r.path(),r.search()))},{prefix:I(e.prefix)?e.prefix:""})},regex:function(e,t){if(e.global||e.sticky)throw new Error("when() RegExp must not be global or sticky");return s&&(n=t,t=["$match",function(e){return o(n,e)}]),L(function(n,r){return a(n,t,e.exec(r.path()))},{prefix:i(e)})}},u={matcher:r.isMatcher(e),regex:e instanceof RegExp};for(var c in u)if(u[c])return this.rule(l[c](e,t));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(e){e===n&&(e=!0),f=e},this.$get=s,s.$inject=["$location","$rootScope","$injector","$browser"]}function w(e,i){function o(e){return 0===e.indexOf(".")||0===e.indexOf("^")}function d(e,t){if(!e)return n;var r=I(e),i=r?e:e.name,a=o(i);if(a){if(!t)throw new Error("No reference point given for path '"+i+"'");t=d(t);for(var s=i.split("."),l=0,u=s.length,c=t;u>l;l++)if(""!==s[l]||0!==l){if("^"!==s[l])break;if(!c.parent)throw new Error("Path '"+i+"' not valid for state '"+t.name+"'");c=c.parent}else c=t;s=s.slice(l).join("."),i=c.name+(c.name&&s?".":"")+s}var f=E[i];return!f||!r&&(r||f!==e&&f.self!==e)?n:f}function p(e,t){S[e]||(S[e]=[]),S[e].push(t)}function m(e){for(var t=S[e]||[];t.length;)g(t.shift())}function g(t){t=r(t,{self:t,resolve:t.resolve||{},toString:function(){return this.name}});var n=t.name;if(!I(n)||n.indexOf("@")>=0)throw new Error("State must have a valid name");if(E.hasOwnProperty(n))throw new Error("State '"+n+"'' is already defined");var i=-1!==n.indexOf(".")?n.substring(0,n.lastIndexOf(".")):I(t.parent)?t.parent:P(t.parent)&&I(t.parent.name)?t.parent.name:"";if(i&&!E[i])return p(i,t.self);for(var o in M)R(M[o])&&(t[o]=M[o](t,M.$delegates[o]));return E[n]=t,!t[_]&&t.url&&e.when(t.url,["$match","$stateParams",function(e,n){k.$current.navigable==t&&u(e,n)||k.transitionTo(t,e,{inherit:!0,location:!1})}]),m(n),t}function v(e){return e.indexOf("*")>-1}function y(e){for(var t=e.split("."),n=k.$current.name.split("."),r=0,i=t.length;i>r;r++)"*"===t[r]&&(n[r]="*");return"**"===t[0]&&(n=n.slice(s(n,t[1])),n.unshift("**")),"**"===t[t.length-1]&&(n.splice(s(n,t[t.length-2])+1,Number.MAX_VALUE),n.push("**")),t.length==n.length&&n.join("")===t.join("")}function b(e,t){return I(e)&&!N(t)?M[e]:R(t)&&I(e)?(M[e]&&!M.$delegates[e]&&(M.$delegates[e]=M[e]),M[e]=t,this):this}function $(e,t){return P(e)?t=e:t.name=e,g(t),this}function w(e,i,o,s,f,p,m,g,b){function $(t,n,r,o){var a=e.$broadcast("$stateNotFound",t,n,r);if(a.defaultPrevented)return m.update(),T;if(!a.retry)return null;if(o.$retry)return m.update(),D;var s=k.transition=i.when(a.retry);return s.then(function(){return s!==k.transition?S:(t.options.$retry=!0,k.transitionTo(t.to,t.toParams,t.options))},function(){return T}),m.update(),s}function w(e,n,r,a,l,u){function d(){var n=[];return j(e.views,function(r,i){var a=r.resolve&&r.resolve!==e.resolve?r.resolve:{};a.$template=[function(){return o.load(i,{view:r,locals:l.globals,params:p,notify:u.notify})||""}],n.push(f.resolve(a,l.globals,l.resolve,e).then(function(n){if(R(r.controllerProvider)||F(r.controllerProvider)){var o=t.extend({},a,l.globals);n.$$controller=s.invoke(r.controllerProvider,null,o)}else n.$$controller=r.controller;n.$$state=e,n.$$controllerAs=r.controllerAs,l[i]=n}))}),i.all(n).then(function(){return l.globals})}var p=r?n:c(e.params.$$keys(),n),h={$stateParams:p};l.resolve=f.resolve(e.resolve,h,l.resolve,e);var m=[l.resolve.then(function(e){l.globals=e})];return a&&m.push(a),i.all(m).then(d).then(function(e){return l})}var S=i.reject(new Error("transition superseded")),M=i.reject(new Error("transition prevented")),T=i.reject(new Error("transition aborted")),D=i.reject(new Error("transition failed"));return C.locals={resolve:null,globals:{$stateParams:{}}},k={params:{},current:C.self,$current:C,transition:null},k.reload=function(e){return k.transitionTo(k.current,p,{reload:e||!0,inherit:!1,notify:!0})},k.go=function(e,t,n){return k.transitionTo(e,t,L({inherit:!0,relative:k.$current},n))},k.transitionTo=function(t,n,o){n=n||{},o=L({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},o||{});var a,u=k.$current,f=k.params,h=u.path,g=d(t,o.relative),v=n["#"];if(!N(g)){var y={to:t,toParams:n,options:o},b=$(y,u.self,f,o);if(b)return b;if(t=y.to,n=y.toParams,o=y.options,g=d(t,o.relative),!N(g)){if(!o.relative)throw new Error("No such state '"+t+"'");throw new Error("Could not resolve '"+t+"' from state '"+o.relative+"'")}}if(g[_])throw new Error("Cannot transition to abstract state '"+t+"'");if(o.inherit&&(n=l(p,n||{},k.$current,g)),!g.params.$$validates(n))return D;n=g.params.$$values(n),t=g;var E=t.path,T=0,A=E[T],O=C.locals,R=[];if(o.reload){if(I(o.reload)||P(o.reload)){if(P(o.reload)&&!o.reload.name)throw new Error("Invalid reload state object");var F=o.reload===!0?h[0]:d(o.reload);if(o.reload&&!F)throw new Error("No such reload state '"+(I(o.reload)?o.reload:o.reload.name)+"'");for(;A&&A===h[T]&&A!==F;)O=R[T]=A.locals,T++,A=E[T]}}else for(;A&&A===h[T]&&A.ownParams.$$equals(n,f);)O=R[T]=A.locals,T++,A=E[T];if(x(t,n,u,f,O,o))return v&&(n["#"]=v),k.params=n,U(k.params,p),o.location&&t.navigable&&t.navigable.url&&(m.push(t.navigable.url,n,{$$avoidResync:!0,replace:"replace"===o.location}),m.update(!0)),k.transition=null,i.when(k.current);if(n=c(t.params.$$keys(),n||{}),o.notify&&e.$broadcast("$stateChangeStart",t.self,n,u.self,f).defaultPrevented)return e.$broadcast("$stateChangeCancel",t.self,n,u.self,f),m.update(),M;for(var j=i.when(O),q=T;q=T;r--)a=h[r],a.self.onExit&&s.invoke(a.self.onExit,a.self,a.locals.globals),a.locals=null;for(r=T;r=0?i:i+"@"+(o?o.state.name:"")}function _(e,t){var n,r=e.match(/^\s*({[^}]*})\s*$/);if(r&&(e=t+"("+r[1]+")"),n=e.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!n||4!==n.length)throw new Error("Invalid state ref '"+e+"'");return{state:n[1],paramExpr:n[3]||null}}function M(e){var t=e.parent().inheritedData("$uiView");return t&&t.state&&t.state.name?t.state:void 0}function T(e,n){var r=["location","inherit","reload","absolute"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(i,o,a,s){var l=_(a.uiSref,e.current.name),u=null,c=M(o)||e.$current,f="[object SVGAnimatedString]"===Object.prototype.toString.call(o.prop("href"))?"xlink:href":"href",d=null,p="A"===o.prop("tagName").toUpperCase(),h="FORM"===o[0].nodeName,m=h?"action":f,g=!0,v={relative:c,inherit:!0},y=i.$eval(a.uiSrefOpts)||{};t.forEach(r,function(e){e in y&&(v[e]=y[e])});var b=function(n){if(n&&(u=t.copy(n)),g){d=e.href(l.state,u,v);var r=s[1]||s[0];return r&&r.$$addStateInfo(l.state,u),null===d?(g=!1,!1):void a.$set(m,d)}};l.paramExpr&&(i.$watch(l.paramExpr,function(e,t){e!==u&&b(e)},!0),u=t.copy(i.$eval(l.paramExpr))),b(),h||o.bind("click",function(t){var r=t.which||t.button;if(!(r>1||t.ctrlKey||t.metaKey||t.shiftKey||o.attr("target"))){var i=n(function(){e.go(l.state,u,v)});t.preventDefault();var a=p&&!d?1:0;t.preventDefault=function(){a--<=0&&n.cancel(i)}}})}}}function D(e,t,n){return{restrict:"A",controller:["$scope","$element","$attrs",function(t,r,i){function o(){a()?r.addClass(l):r.removeClass(l)}function a(){for(var e=0;ei;i++){a=s[i];var f=this.params[a],d=r[i+1];for(o=0;oi;i++)a=s[i],c[a]=this.params[a].value(t[a]);return c},v.prototype.parameters=function(e){return N(e)?this.params[e]||null:this.$$paramNames},v.prototype.validates=function(e){return this.params.$$validates(e)},v.prototype.format=function(e){function t(e){return encodeURIComponent(e).replace(/-/g,function(e){return"%5C%"+e.charCodeAt(0).toString(16).toUpperCase()})}e=e||{};var n=this.segments,r=this.parameters(),i=this.params;if(!this.validates(e))return null;var o,a=!1,s=n.length-1,l=r.length,u=n[0];for(o=0;l>o;o++){var c=s>o,f=r[o],d=i[f],p=d.value(e[f]),m=d.isOptional&&d.type.equals(d.value(),p),g=!!m&&d.squash,v=d.type.encode(p);if(c){var y=n[o+1];if(g===!1)null!=v&&(u+=F(v)?h(v,t).join("-"):encodeURIComponent(v)),u+=y;else if(g===!0){var b=u.match(/\/$/)?/\/?(.*)/:/(.*)/;u+=y.match(b)[1]}else I(g)&&(u+=g+y)}else{if(null==v||m&&g!==!1)continue;F(v)||(v=[v]),v=h(v,encodeURIComponent).join("&"+f+"="),u+=(a?"&":"?")+(f+"="+v),a=!0}}return u},y.prototype.is=function(e,t){return!0},y.prototype.encode=function(e,t){return e},y.prototype.decode=function(e,t){return e},y.prototype.equals=function(e,t){return e==t},y.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},y.prototype.pattern=/.*/,y.prototype.toString=function(){return"{Type:"+this.name+"}"},y.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},y.prototype.$asArray=function(e,t){function r(e,t){function r(e,t){return function(){return e[t].apply(e,arguments)}}function i(e){return F(e)?e:N(e)?[e]:[]}function o(e){switch(e.length){case 0:return n;case 1:return"auto"===t?e[0]:e;default:return e}}function a(e){return!e}function s(e,t){return function(n){n=i(n);var r=h(n,e);return t===!0?0===p(r,a).length:o(r)}}function l(e){return function(t,n){var r=i(t),o=i(n);if(r.length!==o.length)return!1;for(var a=0;a=":n(e.from)}:{"<=":n(e.to)}}function i(e){return e.in?{IN:e.in}:{"NOT IN":e.nin}}return{extend:function(t){return e.assign(Object.create(this),t)},compactFilters:function(t){return t?e.pick(t,function(e){return 0===e||e===!1||!!e}):null},processFilters:function(t){return t?(t=this.compactFilters(t),e.transform(t,function(e,t,n){t.from||t.to?e[n]=r(t):t.in||t.nin?e[n]=i(t):e[n]=t},{})):null}}})}),define("common/models/contact-job-role.model",["common/modules/models","common/models/model","common/instances/contact-job-role-instance.instance","common/services/api/contact-job-role-api.api"],function(e){"use strict";e.factory("ContactJobRole",["$log","Model","ContactJobRoleAPI","ContactJobRoleInstance",function(e,t,n,r){return e.debug("ContactJobRole"),t.extend({all:function(e){return n.all(e).then(function(e){return e.list.map(function(e){return r.init(e,!0)})})}})}])}),define("common/models/instances/group-instance",["common/modules/models-instances","common/models/instances/instance"],function(e){"use strict";e.factory("GroupInstance",["ModelInstance",function(e){var t=["id","name","title","description"];return e.extend({fromAPIFilter:function(e,n,r){_.includes(t,r)&&(e[r]=this[r])}})}])}),define("common/mocks/module",["common/angular"],function(e){"use strict";return e.module("common.mocks",[])}),define("common/mocks/services/api/group-mock",["common/lodash","common/mocks/module"],function(e,t){"use strict";t.factory("api.group.mock",["$q",function(t){function n(e){var n=t.defer();return n.resolve(e),n.promise}return{all:function(e,t,r){var i,o,a;return i=r||this.mockedGroups().list,e&&(i=i.filter(function(t){return Object.keys(e).every(function(n){return t[n]===e[n]})})),t&&(o=(t.page-1)*t.size,a=o+t.size,i=i.slice(o,a)),n({list:i,total:i.length,allIds:i.map(function(e){return e.id}).join(",")})},find:function(e,t){var r=t||this.mockedGroups().list.filter(function(t){return t.id===e})[0];return n(r)},spyOnMethods:function(){e.functions(this).forEach(function(e){spyOn(this,e).and.callThrough()}.bind(this))},mockedGroups:function(){return{total:5,list:[{id:"1",name:"Administrators",title:"Administrators",description:"Contacts in this group are assigned Administrator role permissions.",is_active:"1",visibility:"User and User Admin Only",group_type:["1"],is_hidden:"0",is_reserved:"0"},{id:"2",name:"Newsletter Subscribers",title:"Newsletter Subscribers",is_active:'"1',visibility:"Public Pages",where_clause:"...",select_tables:"...",where_tables:"...",group_type:["1","2"],is_hidden:"0",is_reserved:"0"},{id:"3",name:"Summer Program Volunteers",title:"Summer Program Volunteers",is_active:"1",visibility:"Public Pages",where_clause:"...",select_tables:"...",where_tables:"...",group_type:["1","2"],is_hidden:"0",is_reserved:"0"},{id:"4",name:"Advisory Board",title:"Advisory Board",is_active:"1",visibility:"Public Pages",where_clause:"...",select_tables:"...",where_tables:"...",group_type:["1","2"],is_hidden:"0",is_reserved:"0"},{id:"5",name:"Case_Resources",title:"Case Resources",description:"Contacts in this group are listed with their phone number and email when viewing case. You also can send copies of case activities to these contacts.",is_active:"1",visibility:"User and User Admin Only",where_clause:"...",select_tables:"...",where_tables:"...",group_type:"2",is_hidden:"0",is_reserved:"0"}]}}}}])}),define("common/mocks/data/contact.data",[],function(){return{all:{is_error:0,version:3,count:26,values:[{id:"1",contact_id:"1",display_name:"Dr. Kiara Jensen-Parker",email:"kh.jensen-parker@testing.info",contact_type:"Individual"},{id:"2",contact_id:"2",display_name:"jacobc82@lol.co.pl",email:"cruz.v.jacob@spamalot.com",contact_type:"Individual"},{id:"3",contact_id:"3",display_name:"Mei Müller-Nielsen",email:"mz.mller-nielsen75@infomail.co.pl",contact_type:"Individual"},{id:"4",contact_id:"4",display_name:"Ms. Brigette Deforest",email:"deforest.p.brigette9@fakemail.info",contact_type:"Individual"},{id:"5",contact_id:"5",display_name:"robertsc@testing.net",email:"clintr56@mymail.org",contact_type:"Individual"},{id:"6",contact_id:"6",display_name:"Dr. Allen Samuels Sr.",email:"samuelsa@mymail.org",contact_type:"Individual"},{id:"7",contact_id:"7",display_name:"Mei Wilson",email:"wilson.u.mei59@sample.org",contact_type:"Individual"},{id:"8",contact_id:"8",display_name:"Dr. Betty Díaz",email:"dazb@sample.co.nz",contact_type:"Individual"},{id:"9",contact_id:"9",display_name:"Bob Jones-Dimitrov",email:"bobj@testmail.biz",contact_type:"Individual"},{id:"10",contact_id:"10",display_name:"Truman Samuels III",email:"trumans@spamalot.org",contact_type:"Individual"},{id:"11",contact_id:"11",display_name:"Iris Wagner",email:"iwagner75@notmail.info",contact_type:"Individual"},{id:"12",contact_id:"12",display_name:"Mr. Rosario McReynolds",email:"rosariomcreynolds@testmail.org",contact_type:"Individual"},{id:"13",contact_id:"13",display_name:"Shad Jones-Dimitrov III",email:"shadj@lol.net",contact_type:"Individual"},{id:"14",contact_id:"14",display_name:"Toby Cruz Sr.",email:"",contact_type:"Individual"},{id:"15",contact_id:"15",display_name:"lareedaz61@testing.com",email:"lareedaz61@testing.com",contact_type:"Individual"},{id:"16",contact_id:"16",display_name:"Dr. Jay Deforest",email:"jayd@fishmail.org",contact_type:"Individual"},{id:"17",contact_id:"17",display_name:"Mr. Norris Cruz",email:"norriscruz@spamalot.info",contact_type:"Individual"},{id:"18",contact_id:"18",display_name:"herminiac@fishmail.com",email:"herminiac@fishmail.com",contact_type:"Individual"},{id:"19",contact_id:"19",display_name:"Ashley Terrell",email:"terrell.ashley@testmail.info",contact_type:"Individual"},{id:"20",contact_id:"20",display_name:"Kandace Parker-Díaz",email:"parker-daz.kandace67@fishmail.co.uk",contact_type:"Individual"},{id:"21",contact_id:"21",display_name:"Nicole Samuels",email:"ng.samuels@testmail.net",contact_type:"Individual"},{id:"22",contact_id:"22",display_name:"Dr. Kandace Wattson",email:"kandacewattson@testing.info",contact_type:"Individual"},{id:"23",contact_id:"23",display_name:"Brittney Cruz",email:"cruz.brittney@spamalot.co.nz",contact_type:"Individual"},{id:"24",contact_id:"24",display_name:"Shauna Olsen",email:"",contact_type:"Individual"},{id:"202",contact_id:"202",display_name:"civihr_staff@compucorp.co.uk",email:"civihr_staff@compucorp.co.uk",contact_type:"Individual"},{id:"203",contact_id:"203",display_name:"civihr_manager@compucorp.co.uk",email:"civihr_manager@compucorp.co.uk",contact_type:"Individual"}]}}}),define("common/mocks/services/api/contact-mock",["common/lodash","common/mocks/module","common/mocks/data/contact.data"],function(e,t,n){"use strict";t.factory("api.contact.mock",["$q",function(t){function r(e){var n=t.defer();return n.resolve(e),n.promise}return{all:function(t,i,o){var a,s,l;return a=o||n.all.values,t&&(a=a.filter(function(n){return Object.keys(t).every(function(r){return"display_name"===r?new RegExp(t[r],"i").test(n[r]):t[r].IN?e.includes(t[r].IN,n[r]):n[r]===t[r]})})),i&&(s=(i.page-1)*i.size,l=s+i.size,a=a.slice(s,l)),r({list:a,total:a.length,allIds:a.map(function(e){return e.id}).join(",")})},find:function(e,t){var i=t||n.all.values.filter(function(t){return t.id===e})[0];return r(i)},spyOnMethods:function(){e.functions(this).forEach(function(e){spyOn(this,e).and.callThrough()}.bind(this))},mockedContacts:function(){var e=n.all.values;return{total:e.length,list:e.map(function(e){return e})}}}}])}),define("common/mocks/services/api/group-contact-mock",["common/lodash","common/mocks/module","common/mocks/services/api/contact-mock","common/mocks/services/api/group-mock"],function(e,t){"use strict";t.factory("api.group-contact.mock",["$q","api.contact.mock","api.group.mock",function(t,n,r){function i(t){return e.sample(t)}function o(e){var n=t.defer();return n.resolve(e),n.promise}var a=n.mockedContacts().list,s=r.mockedGroups().list;return{all:function(e,t,n){var r,i,a;return r=n||this.mockedGroupsContacts.list,e&&(r=r.filter(function(t){return Object.keys(e).every(function(n){return t[n]===e[n]})})),t&&(i=(t.page-1)*t.size,a=i+t.size,r=r.slice(i,a)),o({list:r,total:r.length,allIds:r.map(function(e){return e.id}).join(",")})},spyOnMethods:function(){e.functions(this).forEach(function(e){spyOn(this,e).and.callThrough()}.bind(this))},mockedGroupsContacts:{total:a.length,list:function(){var e=1;return a.map(function(t){return{id:""+e++,group_id:i(s).id,contact_id:t.id,status:"Added"}})}()}}}])}),define("common/models/group",["common/modules/models","common/models/model","common/models/instances/group-instance","common/mocks/services/api/group-mock","common/mocks/services/api/group-contact-mock"],function(e){"use strict";e.factory("Group",["Model","api.group.mock","api.group-contact.mock","GroupInstance",function(e,t,n,r){return e.extend({all:function(e,n){return t.all(this.processFilters(e),n).then(function(e){return e.list=e.list.map(function(e){return r.init(e,!0)}),e})},find:function(e){return t.find(e).then(function(e){return r.init(e,!0)})},contactIdsOf:function(e){return n.all({group_id:e}).then(function(e){return e.list.map(function(e){return e.contact_id})})}})}])}),define("common/models/instances/job-role-instance",["common/lodash","common/moment","common/modules/models-instances","common/models/instances/instance"],function(e,t,n){"use strict";n.factory("JobRoleInstance",["ModelInstance","HR_settings",function(n,r){return n.extend({fromAPIFilter:function(n,i,o){var a=r.DATE_FORMAT.toUpperCase();e.endsWith(o,"_date")?n[o]=t(this[o],"YYYY-MM-DD HH:mm:ss").format(a):"api.HRJobContract.getsingle"===o?(n.contact_id=this[o].contact_id,n.job_contract_id=this[o].id):n[o]=this[o]},toAPIFilter:function(n,i,o){var a=["contact_id","job_contract_id"],s=r.DATE_FORMAT.toUpperCase();if(e.endsWith(o,"_date"))n[o]=t(this[o],s).format("YYYY-MM-DD HH:mm:ss");else{if(e.includes(a,o))return;n[o]=this[o]}}})}])}),define("common/mocks/services/api/option-group-mock",["common/lodash","common/mocks/module"],function(e,t){"use strict";t.factory("api.optionGroup.mock",["$q",function(t){function n(e){var n=t.defer();return n.resolve(e),n.promise}return{valuesOf:function(t){var r;return r=e.isArray(t)?e.pick(this.mockedOptionValues(),t):this.mockedOptionValues()[t],n(r)},spyOnMethods:function(){e.functions(this).forEach(function(e){spyOn(this,e).and.callThrough()}.bind(this))},mockedOptionValues:function(){return{hrjc_department:[{id:"856",option_group_id:"112",label:"Finance",value:"Finance",weight:"1"},{id:"857",option_group_id:"112",label:"HR",value:"HR",weight:"2"},{id:"858",option_group_id:"112",label:"IT",value:"IT",weight:"3"},{id:"859",option_group_id:"112",label:"Fundraising",value:"Fundraising",weight:"4"},{id:"860",option_group_id:"112",label:"Marketing",value:"Marketing",weight:"5"}],hrjc_level_type:[{id:"845",option_group_id:"111",label:"Senior Manager",value:"Senior Manager",weight:"1"},{id:"846",option_group_id:"111",label:"Junior Manager",value:"Junior Manager",weight:"2"},{id:"847",option_group_id:"111",label:"Senior Staff",value:"Senior Staff",weight:"3"},{id:"848",option_group_id:"111",label:"Junior Staff",value:"Junior Staff",weight:"4"}],hrjc_location:[{id:"854",option_group_id:"115",label:"Headquarters",value:"Headquarters",weight:"1"},{id:"855",option_group_id:"115",label:"Home or Home-Office",value:"Home",weight:"1"}],hrjc_region:[{id:"1",option_group_id:"11",label:"Region #1",value:"Region #1",weight:"1"},{id:"2",option_group_id:"22",label:"Region #2",value:"Region #2",weight:"1"}]}}}}])}),define("common/mocks/services/api/job-role-mock",["common/lodash","common/mocks/module","common/mocks/services/api/contact-mock","common/mocks/services/api/option-group-mock"],function(e,t){"use strict";t.factory("api.job-role.mock",["$q","api.contact.mock","api.optionGroup.mock",function(t,n,r){function i(t,n){return e.sample(t[n])}function o(e){var n=t.defer();return n.resolve(e),n.promise}var a=n.mockedContacts().list,s=r.mockedOptionValues();return{all:function(e,t,n){var r,i,a;return r=n||this.mockedJobRoles.list,e&&(r=r.filter(function(t){return Object.keys(e).every(function(n){return t[n]===e[n]})})),t&&(i=(t.page-1)*t.size,a=i+t.size,r=r.slice(i,a)),o({list:r,total:r.length,allIds:r.map(function(e){return e.id}).join(",")})},find:function(e,t){var n=t||this.mockedJobRoles.list.filter(function(t){return t.id===e})[0];return o(n)},spyOnMethods:function(){e.functions(this).forEach(function(e){spyOn(this,e).and.callThrough()}.bind(this))},mockedJobRoles:{total:10,list:function(){function e(e){return e=e<10?"0"+e:e,"20"+e+"-"+e+"-"+e+" 00:00:00"}var t=0;return a.map(function(n){return t++,{id:""+t,job_contract_id:""+t,title:"Job Role #"+t,description:"Description for Job Role #"+t,department:i(s,"hrjc_department").id,level_type:i(s,"hrjc_level_type").id,location:i(s,"hrjc_location").id,region:i(s,"hrjc_region").id,start_date:e(t),end_date:e(t+1),"api.HRJobContract.getsingle":{id:t,contact_id:n.id,is_primary:"1"}}})}()}}}])}),define("common/models/job-role",["common/modules/models","common/models/model","common/models/instances/job-role-instance","common/mocks/services/api/job-role-mock"],function(e){"use strict";e.factory("JobRole",["Model","api.job-role.mock","JobRoleInstance",function(e,t,n){return e.extend({all:function(e,r){return t.all(this.processFilters(e),r).then(function(e){return e.list=e.list.map(function(e){return n.init(e,!0)}),e})},find:function(e){return t.find(e).then(function(e){return n.init(e,!0)})}})}])}),define("common/models/instances/contact-instance",["common/modules/models-instances","common/models/instances/instance"],function(e){"use strict";e.factory("ContactInstance",["ModelInstance",function(e){return e.extend({})}])}),define("common/models/contact",["common/lodash","common/modules/models","common/models/model","common/models/contact-job-role.model","common/models/group","common/models/job-role","common/models/instances/contact-instance","common/mocks/services/api/contact-mock"],function(e,t){"use strict";t.factory("Contact",["$q","Model","api.contact.mock","Group","JobRole","ContactJobRole","ContactInstance",function(t,n,r,i,o,a,s){function l(t,n){return!e.isEmpty(e.intersection(e.keys(t),n))}function u(e){return a.all(e).then(function(e){return e.map(function(e){return e.contact_id})})}function c(t,n){return e(t).omit(d).omit(p).assign({id:{in:e.intersection.apply(null,n)}}).value()}function f(n){var r=t.defer(),o=[];return n=this.compactFilters(n),l(n,p)&&o.push(u(e.pick(n,p))),l(n,d)&&o.push(i.contactIdsOf(n.group_id)),e.isEmpty(o)?r.resolve(this.processFilters(n)):t.all(o).then(function(e){n=c(n,e),r.resolve(this.processFilters(n))}.bind(this)),r.promise}var d=["group_id"],p=["region","department","level_type","location"];return n.extend({all:function(e,t){return f.call(this,e).then(function(e){return r.all(e,t)}).then(function(e){return e.list=e.list.map(function(e){return s.init(e,!0)}),e})},find:function(e){return r.find(e).then(function(e){return s.init(e,!0)})}})}])}),define("common/models/instances/contract-instance",["common/modules/models-instances","common/models/instances/instance"],function(e){"use strict";e.factory("ContractInstance",["ModelInstance",function(e){return e.extend({})}])}),define("common/services/api/contract",["common/lodash","common/modules/apis","common/services/api"],function(e,t){"use strict";t.factory("api.contract",["$log","api",function(t,n){function r(t){var n=e.clone(t);return n.info=n["api.HRJobContract.getfulldetails"],delete n["api.HRJobContract.getfulldetails"],n}return t.debug("api.contract"),n.extend({all:function(e){return t.debug("ContractAPI.all"),e=e||{},e["api.HRJobContract.getfulldetails"]={jobcontract_id:"$value.id"},e.deleted=0,this.sendGET("HRJobContract","get",e,!1).then(function(e){return e.values}).then(function(e){return e=e.map(r)})}})}])}),define("common/models/contract",["common/modules/models","common/models/model","common/models/instances/contract-instance","common/services/api/contract"],function(e){"use strict";e.factory("Contract",["$log","Model","api.contract","ContractInstance",function(e,t,n,r){return e.debug("Contract"),t.extend({all:function(e){return n.all(e).then(function(e){return e.map(function(e){return r.init(e,!0)})})}})}])}),define("common/models/option-group",["common/modules/models","common/models/model","common/mocks/services/api/option-group-mock"],function(e){"use strict";e.factory("OptionGroup",["Model","api.optionGroup.mock",function(e,t){return e.extend({valuesOf:function(e){return t.valuesOf(e)}})}])}),function(e,t){define("common/models/session.model",["common/modules/models","common/models/model"],function(n){"use strict";n.factory("Session",["$log","$q","Model",function(n,r,i){return n.debug("Session"),i.extend({get:function(){var n={contactId:e.vars.session?e.vars.session.contact_id:t.settings.currentCiviCRMUserId};if(!n.contactId)throw new Error("Session Error: *Logged In Contact Id* is not defined");return r.resolve(n)}})}])})}(CRM,window.Drupal),define("common/bundles/models",["common/instances/contact-job-role-instance.instance","common/models/model","common/models/contact","common/models/contact-job-role.model","common/models/contract","common/models/group","common/models/job-role","common/models/option-group","common/models/session.model","common/models/instances/instance","common/models/instances/contact-instance","common/models/instances/contract-instance","common/models/instances/group-instance","common/models/instances/job-role-instance"],function(){}),define("common/services/dialog/dialog",[],function(){"use strict";return["$uibModal","$rootElement","$templateCache",function(e,t,n){return{open:function(r){var i;if(!r||"object"==typeof r)return i=t.children(),e.open({appendTo:i.length?i.eq(0):t,size:"sm",controller:"DialogCtrl",template:n.get("dialog.html"),resolve:{content:function(){return{copyCancel:r.copyCancel||"",copyConfirm:r.copyConfirm||"",classConfirm:r.classConfirm||"",title:r.title||"",msg:r.msg||""}}}}).result}}}]}),define("common/controllers/dialog/dialog-ctrl",[],function(){"use strict";return["$scope","$uibModalInstance","content",function(e,t,n){e.title=n.title||"CiviHR",e.msg=n.msg||"",e.copyConfirm=n.copyConfirm||"Yes",e.copyCancel=n.copyCancel||"Cancel",e.classConfirm=n.classConfirm||"btn-primary",e.confirm=function(e){t.close(e||!0)},e.cancel=function(){t.close(!1)}}]}),define("common/modules/dialog",["common/angular","common/services/dialog/dialog","common/controllers/dialog/dialog-ctrl","common/angularBootstrap","common/modules/templates"],function(e,t,n){"use strict";return e.module("common.dialog",["ui.bootstrap","common.templates"]).factory("dialog",t).controller("DialogCtrl",n)}),define("common/decorators/xeditable-civi/editable-directive-factory",[],function(){"use strict";return["$delegate",function(e){return function(t){var n=e(t);return n.compile=function(e){var t,r=e[0].attributes.getNamedItem("ng-href");return e.append(''),r&&(t=angular.element(""),t.text("Follow link"),t.attr(r.nodeName,r.value),t.attr("ng-click","$event.stopPropagation();"),t.addClass("editable-link"),e.append(t),e.addClass("editable-with-link")),{post:n.link}},n}}]}),define("common/directives/xeditable-civi/editable-ta",[],function(){"use strict";return["editableDirectiveFactory","$timeout",function(e,t){var n,r;return r=e({directiveName:"editableTa",inputTpl:"",render:function(){this.parent.render.call(this),this.inputEl.parent().parent().removeClass("form-inline"),this.inputEl.addClass("editable-ta"),this.inputEl.attr("ng-model","ta.$data"),this.inputEl.attr("ta-toolbar",this.attrs.eTaToolbar||'[["bold","italics","underline","strikeThrough","ul","ol","undo","redo","clear"]]'),t(function(){this.inputEl.find("textarea").hide()}.bind(this),0)},save:function(){this.scope.$data=this.scope.ta.$data,this.parent.save.call(this)},setLocalValue:function(){this.parent.setLocalValue.call(this), this.scope.ta.$data=this.scope.$data}}),n=r.link,r.link=function(e,t,r,i){return e.ta={},n(e,t,r,i)},r}]}),define("common/modules/xeditable-civi",["common/angular","common/decorators/xeditable-civi/editable-directive-factory","common/directives/xeditable-civi/editable-ta","common/angularXeditable","common/text-angular"],function(e,t,n){"use strict";return e.module("xeditable-civi",["xeditable","textAngular"]).directive("editableTa",n)}); \ No newline at end of file diff --git a/org.civicrm.reqangular/src/common/services/api.js b/org.civicrm.reqangular/src/common/services/api.js index 0a7e945e29e..6ce6f22dbb5 100644 --- a/org.civicrm.reqangular/src/common/services/api.js +++ b/org.civicrm.reqangular/src/common/services/api.js @@ -78,7 +78,7 @@ define([ return $q.all([ (function () { var params = _.assign({}, filters, (additionalParams || {}), { - options: { sort: sort || 'id DESC' } + options: _.assign({}, filters.options, { sort: sort || 'id DESC' }) }); if (pagination) { diff --git a/org.civicrm.reqangular/test/services/api.spec.js b/org.civicrm.reqangular/test/services/api.spec.js index 7f1505e092d..7acb25219cf 100644 --- a/org.civicrm.reqangular/test/services/api.spec.js +++ b/org.civicrm.reqangular/test/services/api.spec.js @@ -8,25 +8,24 @@ define([ 'use strict'; describe('api', function () { - var api, $httpBackend, $httpParamSerializer; + var api, $httpBackend, $httpParamSerializer, $rootScope; var entity = 'entity'; var action = 'action'; beforeEach(module('common.apis')); - beforeEach(inject(function (_api_, _$httpBackend_, _$httpParamSerializer_) { + beforeEach(inject(function (_api_, _$httpBackend_, _$httpParamSerializer_, _$rootScope_) { api = _api_; $httpBackend = _$httpBackend_; $httpParamSerializer = _$httpParamSerializer_; + $rootScope = _$rootScope_; })); - afterEach(function () { - $httpBackend.flush(); - }); - describe('sendGET', function () { var promise; + afterEach(function () { $httpBackend.flush(); }); + describe('when the API does not return an error', function () { var returnValue = { is_error: 0, @@ -100,6 +99,13 @@ define([ }); }); + /** + * Mocks and sends a fake GET request + * + * @param {any} returnValue - value to be returned by the GET request + * @param {Object} params - params to be used in the API call + * @return {Promise} + */ function expectAndSendGET (returnValue, params) { $httpBackend .whenGET(new RegExp('action=' + action + '&entity=' + entity)) @@ -112,6 +118,8 @@ define([ describe('sendPOST', function () { var promise; + afterEach(function () { $httpBackend.flush(); }); + describe('when the API doesnt return an error', function () { var returnValue = { is_error: 0, @@ -185,11 +193,59 @@ define([ }); }); + /** + * Mocks and sends a fake POST request + * + * @param {any} returnValue - value to be returned by the POST request + * @param {Object} params - params to be used in the API call + * @return {Promise} + */ function expectAndSendPOST (returnValue, params) { $httpBackend.whenPOST('/civicrm/ajax/rest').respond(returnValue); return api.sendPOST(entity, action, params); } }); + + describe('getAll()', function () { + var returnValue = { is_error: 0, values: [{}] }; + + describe('custom options', function () { + beforeEach(function () { + spyOn(api, 'sendGET').and.returnValue(returnValue); + $rootScope.$digest(); + }); + + describe('when no custom options are passed', function () { + beforeEach(function () { + api.getAll(entity, {}); + }); + + it('still uses default options in the API call', function () { + expect(api.sendGET).toHaveBeenCalledWith(entity, 'get', + jasmine.objectContaining({ + options: jasmine.any(Object) + }), undefined + ); + }); + }); + + describe('when custom options are passed', function () { + var customOptions = { or: [['field1', 'field2', 'field3']] }; + + beforeEach(function () { + api.getAll(entity, { options: customOptions }); + }); + + it('uses them in the API call', function () { + expect(api.sendGET).toHaveBeenCalledWith(entity, 'get', + jasmine.objectContaining({ + options: jasmine.objectContaining(customOptions) + }), undefined + ); + }); + }); + }); + }); }); });