Sentinel/sentinel-dashboard/src/main/webapp/resources/dist/js/app.vendor.js

1 line
365 KiB
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("angular")):"function"==typeof define&&define.amd?define(["exports","angular"],t):t((e=e||self)["@uirouter/angularjs"]={},e.angular)}(this,function(g,e){"use strict";var t=angular,S=e&&e.module?e:t,r=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};function l(n){return function e(){if(arguments.length>=n.length)return n.apply(this,arguments);var t=Array.prototype.slice.call(arguments);return e.bind.apply(e,r([this],t))}}function n(){var n=arguments,r=n.length-1;return function(){for(var e=r,t=n[r].apply(this,arguments);e--;)t=n[e].call(this,t);return t}}function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.apply(null,[].slice.call(arguments).reverse())}var w=function(t){return function(e){return e&&e[t]}},m=l(function(e,t,n){return n&&n[e]===t}),C=function(e){return u.apply(null,e.split(".").map(w))},d=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}};function i(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.apply(null,e)&&r.apply(null,e)}}function s(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.apply(null,e)||r.apply(null,e)}}function o(t){return function(e){return t===e}}var c=function(n){return function(e){return e.reduce(function(e,t){return e&&!!n(t)},!0)}},p=function(n){return function(e){return e.reduce(function(e,t){return e||!!n(t)},!1)}},h=function(t){return function(e){return null!=e&&e.constructor===t||e instanceof t}},f=function(e){return function(){return e}};function a(t,n){return function(e){return e[t].apply(e,n)}}function v(n){return function(e){for(var t=0;t<n.length;t++)if(n[t][0](e))return n[t][1](e)}}function y(t){return function(e){return typeof e===t}}function b(e){return null===e}var $=Object.prototype.toString,_=y("undefined"),k=d(_),D=s(b,_),x=y("function"),O=y("number"),T=y("string"),A=function(e){return null!==e&&"object"==typeof e},E=Array.isArray,P=function(e){return"[object Date]"===$.call(e)},M=function(e){return"[object RegExp]"===$.call(e)};function R(e){if(E(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter(d(T)).length||n.filter(d(x)).length)}return x(e)}function I(r,e){return e.reduce(function(e,t){return e[t]=(n=r+"."+t+"()",function(){throw new Error("No implementation for "+n+". The framework specific code did not implement this method.")}),e;var n},{})}var V=i(A,u(w("then"),x)),N={$q:void 0,$injector:void 0},L=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},F="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0,j=F.angular||{},Y=j.fromJson||JSON.parse.bind(JSON),H=j.toJson||JSON.stringify.bind(JSON),U=j.forEach||function(t,n,e){if(E(t))return t.forEach(n,e);Object.keys(t).forEach(function(e){return n(t[e],e)})},q=Object.assign||Ae,z=j.equals||Ee;function B(e){return e}function W(){}function G(t,r,n,e,i){void 0===i&&(i=!1);function o(e){return t()[e].bind(n())}return(e=e||Object.keys(t())).reduce(function(e,t){var n;return e[t]=i?(n=t,function(){return r[n]=o(n),r[n].apply(null,arguments)}):o(t),e},r)}var K=function(e,t){return q(Object.create(e),t)},Q=l(Z);function Z(e,t){return-1!==e.indexOf(t)}var X=l(J);function J(e,t){var n=e.indexOf(t);return 0<=n&&e.splice(n,1),e}var ee=l(te);function te(e,t){return e.push(t),t}function ne(t){return t.slice().forEach(function(e){"function"==typeof e&&e(),X(t,e)})}function re(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=q.apply(void 0,L([{}],t.reverse()));return q(r,ae(e||{},Object.keys(r)))}function ie(e,t){return q(e,t)}function oe(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 ae(e,t){var n={};for(var r in e)-1!==t.indexOf(r)&&(n[r]=e[r]);return n}function se(n,e){return Object.keys(n).filter(d(Q(e))).reduce(function(e,t){return e[t]=n[t],e},{})}function le(e,t){return pe(e,w(t))}function ue(e,n){var t=E(e),r=t?[]:{},i=t?function(e){return r.push(e)}:function(e,t){return r[t]=e};return U(e,function(e,t){n(e,t)&&i(e,t)}),r}function ce(e,n){var r;return U(e,function(e,t){r||n(e,t)&&(r=e)}),r}var de=pe;function pe(e,n,r){return r=r||(E(e)?[]:{}),U(e,function(e,t){return r[t]=n(e,t)}),r}function he(t){return Object.keys(t).map(function(e){return t[e]})}function fe(e,t){return e&&t}function ge(e,t){return e||t}var me=function(e,t){return e.concat(t)},ve=function(e,t){return E(t)?e.concat(t.reduce(ve,[])):ye(e,t)};function ye(e,t){return e.push(t),e}function we(e,t){return Q(e,t)?e:ye(e,t)}function be(e){return e.reduce(me,[])}function $e(e){return e.reduce(ve,[])}var _e=Ce,Se=Ce;function Ce(n,r){return void 0===r&&(r="assert failure"),function(e){var t=n(e);if(!t)throw new Error(x(r)?r(e):r);return t}}function ke(t){return Object.keys(t).map(function(e){return[e,t[e]]})}function De(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)return[];for(var n=e.reduce(function(e,t){return Math.min(t.length,e)},9007199254740991),r=[],i=function(t){switch(e.length){case 1:r.push([e[0][t]]);break;case 2:r.push([e[0][t],e[1][t]]);break;case 3:r.push([e[0][t],e[1][t],e[2][t]]);break;case 4:r.push([e[0][t],e[1][t],e[2][t],e[3][t]]);break;default:r.push(e.map(function(e){return e[t]}))}},o=0;o<n;o++)i(o);return r}function xe(e,t){var n,r;if(E(t)&&(n=t[0],r=t[1]),!T(n))throw new Error("invalid parameters to applyPairs");return e[n]=r,e}function Oe(e){return e.length&&e[e.length-1]||void 0}function Te(e,t){return t&&Object.keys(t).forEach(function(e){return delete t[e]}),q(t=t||{},e)}function Ae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n)for(var r=Object.keys(n),i=0;i<r.length;i++)e[r[i]]=n[r[i]]}return e}function Ee(e,t){if(e===t)return!0;if(null===e||null===t)return!1;if(e!=e&&t!=t)return!0;var n=typeof e;if(n!=typeof t||"object"!=n)return!1;var r,i,o=[e,t];if(c(E)(o))return i=t,(r=e).length===i.length&&De(r,i).reduce(function(e,t){return e&&Ee(t[0],t[1])},!0);if(c(P)(o))return e.getTime()===t.getTime();if(c(M)(o))return e.toString()===t.toString();if(c(x)(o))return!0;if([x,E,P,M].map(p).reduce(function(e,t){return e||!!t(o)},!1))return!1;var a={};for(var s in e){if(!Ee(e[s],t[s]))return!1;a[s]=!0}for(var s in t)if(!a[s])return!1;return!0}function Pe(e){return e.catch(function(e){return 0})&&e}function Me(e){return Pe(N.$q.reject(e))}var Re=(Ie.is=function(e){return!!/[!,*]+/.exec(e)},Ie.fromString=function(e){return Ie.is(e)?new Ie(e):null},Ie.prototype.matches=function(e){return this.regexp.test("."+e)},Ie);function Ie(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map(function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e}).join("");this.regexp=new RegExp("^"+t+"$")}var Ve,Ne=(Le.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},Le.prototype.evict=function(){var t=this._items.shift();return this._evictListeners.forEach(function(e){return e(t)}),t},Le.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},Le.prototype.clear=function(){var e=this._items;return this._items=[],e},Le.prototype.size=function(){return this._items.length},Le.prototype.remove=function(e){var t=this._items.indexOf(e);return-1<t&&this._items.splice(t,1)[0]},Le.prototype.peekTail=function(){return this._items[this._items.length-1]},Le.prototype.peekHead=function(){if(this.size())return this._items[0]},Le);function Le(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=ee(this._evictListeners)}(Ve=g.RejectType||(g.RejectType={}))[Ve.SUPERSEDED=2]="SUPERSEDED",Ve[Ve.ABORTED=3]="ABORTED",Ve[Ve.INVALID=4]="INVALID",Ve[Ve.IGNORED=5]="IGNORED",Ve[Ve.ERROR=6]="ERROR";var Fe=0,je=(Ye.isRejectionPromise=function(e){return e&&"function"==typeof e.then&&h(Ye)(e._transitionRejection)},Ye.superseded=function(e,t){var n=new Ye(g.RejectType.SUPERSEDED,"The transition has been superseded by a different transition",e);return t&&t.redirected&&(n.redirected=!0),n},Ye.redirected=function(e){return Ye.superseded(e,{redirected:!0})},Ye.invalid=function(e){return new Ye(g.RejectType.INVALID,"This transition is invalid",e)},Ye.ignored=function(e){return new Ye(g.RejectType.IGNORED,"The transition was ignored",e)},Ye.aborted=function(e){return new Ye(g.RejectType.ABORTED,"The transition has been aborted",e)},Ye.errored=function(e){return new Ye(g.RejectType.ERROR,"The transition errored",e)},Ye.normalize=function(e){return h(Ye)(e)?e:Ye.errored(e)},Ye.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():Ke(e);return"Transition Rejection($id: "+this.$id+" type: "+this.type+", message: "+this.message+", detail: "+t+")"},Ye.prototype.toPromise=function(){return q(Me(this),{_transitionRejection:this})},Ye);function Ye(e,t,n){this.$id=Fe++,this.type=e,this.message=t,this.detail=n}function He(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function Ue(e,t){for(;t.length<e;)t+=" ";return t}function qe(e){return e.replace(/^([A-Z])/,function(e){return e.toLowerCase()}).replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}function ze(e){var t=Be(e),n=t.match(/^(function [^ ]+\([^)]*\))/),r=n?n[1]:t,i=e.name||"";return i&&r.match(/function \(/)?"function "+i+r.substr(9):r}function Be(e){var t=E(e)?e.slice(-1)[0]:e;return t&&t.toString()||"undefined"}var We=je.isRejectionPromise,Ge=v([[_,f("undefined")],[b,f("null")],[V,f("[Promise]")],[We,function(e){return e._transitionRejection.toString()}],[function(e){return A(e)&&!E(e)&&e.constructor!==Object&&x(e.toString)},function(e){return e.toString()}],[R,ze],[f(!0),B]]);function Ke(e){var t=[];function n(e){if(A(e)){if(-1!==t.indexOf(e))return"[circular ref]";t.push(e)}return Ge(e)}return _(e)?n(e):JSON.stringify(e,function(e,t){return n(t)}).replace(/\\"/g,'"')}function Qe(n){return function(e){if(!e)return["",""];var t=e.indexOf(n);return-1===t?[e,""]:[e.substr(0,t),e.substr(t+1)]}}function Ze(e){return e.replace(/\/[^/]*$/,"")}function Xe(e){return e?e.replace(/^#/,""):""}var Je=new RegExp("^(?:[a-z]+:)?//[^/]+/"),et=Qe("#"),tt=Qe("?"),nt=Qe("=");function rt(e){var t=new RegExp("("+e+")","g");return function(e){return e.split(t).filter(B)}}function it(e,t){return T(Oe(e))&&T(t)?e.slice(0,-1).concat(Oe(e)+t):ye(e,t)}var ot={log:W,error:W,table:W};function at(t){function e(e){return Function.prototype.bind.call(e,t)}return{log:e(t.log),error:e(t.log),table:e(t.log)}}var st,lt,ut="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?at(window.console):ot:console.table&&console.error?console:(st=console,{log:lt=st.log.bind(st),error:st.error?st.error.bind(st):lt,table:st.table?st.table.bind(st):lt});function ct(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}var dt;function pt(e){return O(e)?g.Category[e]:g.Category[g.Category[e]]}(dt=g.Category||(g.Category={}))[dt.RESOLVE=0]="RESOLVE",dt[dt.TRANSITION=1]="TRANSITION",dt[dt.HOOK=2]="HOOK",dt[dt.UIVIEW=3]="UIVIEW",dt[dt.VIEWCONFIG=4]="VIEWCONFIG";function ht(e){return"Transition #"+ft(e)+"-"+gt(e)}var ft=C("$id"),gt=C("router.$id"),mt=(vt.prototype._set=function(t,e){var n=this;e.length||(e=Object.keys(g.Category).map(function(e){return parseInt(e,10)}).filter(function(e){return!isNaN(e)}).map(function(e){return g.Category[e]})),e.map(pt).forEach(function(e){return n._enabled[e]=t})},vt.prototype.enable=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._set(!0,e)},vt.prototype.disable=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._set(!1,e)},vt.prototype.enabled=function(e){return!!this._enabled[pt(e)]},vt.prototype.traceTransitionStart=function(e){this.enabled(g.Category.TRANSITION)&&ut.log(ht(e)+": Started -> "+Ke(e))},vt.prototype.traceTransitionIgnored=function(e){this.enabled(g.Category.TRANSITION)&&ut.log(ht(e)+": Ignored <> "+Ke(e))},vt.prototype.traceHookInvocation=function(e,t,n){var r,i,o;this.enabled(g.Category.HOOK)&&(r=C("traceData.hookType")(n)||"internal",i=C("traceData.context.state.name")(n)||C("traceData.context")(n)||"unknown",o=ze(e.registeredHook.callback),ut.log(ht(t)+": Hook -> "+r+" context: "+i+", "+He(200,o)))},vt.prototype.traceHookResult=function(e,t,n){this.enabled(g.Category.HOOK)&&ut.log(ht(t)+": <- Hook returned: "+He(200,Ke(e)))},vt.prototype.traceResolvePath=function(e,t,n){this.enabled(g.Category.RESOLVE)&&ut.log(ht(n)+": Resolving "+e+" ("+t+")")},vt.prototype.traceResolvableResolved=function(e,t){this.enabled(g.Category.RESOLVE)&&ut.log(ht(t)+": <- Resolved "+e+" to: "+He(200,Ke(e.data)))},vt.prototype.traceError=function(e,t){this.enabled(g.Category.TRANSITION)&&ut.log(ht(t)+": <- Rejected "+Ke(t)+", reason: "+e)},vt.prototype.traceSuccess=function(e,t){this.enabled(g.Category.TRANSITION)&&ut.log(ht(t)+": <- Success "+Ke(t)+", final state: "+e.name)},vt.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(g.Category.UIVIEW)&&ut.log("ui-view: "+Ue(30,e)+" "+ct(t)+n)},vt.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(g.Category.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},vt.prototype.traceUIViewFill=function(e,t){this.enabled(g.Category.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+He(200,t))},vt.prototype.traceViewSync=function(e){var a,t;this.enabled(g.Category.VIEWCONFIG)&&(a="uiview component fqn",t=e.map(function(e){var t=e.uiView,n=e.viewConfig,r=t&&t.fqn,i=n&&n.viewDecl.$context.name+": ("+n.viewDecl.$name+")",o={};return o[a]=r,o["view config state (view name)"]=i,o}).sort(function(e,t){return(e[a]||"").localeCompare(t[a]||"")}),ut.table(t))},vt.prototype.traceViewServiceEvent=function(e,t){var n,r,i;this.enabled(g.Category.VIEWCONFIG)&&ut.log("VIEWCONFIG: "+e+" "+(r=(n=t).viewDecl,i=r.$context.name||"(root)","[View#"+n.$id+" from '"+i+"' state]: target ui-view: '"+r.$uiViewName+"@"+r.$uiViewContextAnchor+"'"))},vt.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(g.Category.VIEWCONFIG)&&ut.log("VIEWCONFIG: "+e+" "+ct(t))},vt);function vt(){this._enabled={},this.approximateDigests=0}var yt=new mt,wt=(bt.prototype.is=function(e,t){return!0},bt.prototype.encode=function(e,t){return e},bt.prototype.decode=function(e,t){return e},bt.prototype.equals=function(e,t){return e==t},bt.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},bt.prototype.toString=function(){return"{ParamType:"+this.name+"}"},bt.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},bt.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new $t(this,e)},bt);function bt(e){this.pattern=/.*/,this.inherit=!0,q(this,e)}function $t(r,i){var o=this;function a(e){return E(e)?e:k(e)?[e]:[]}function s(n,r){return function(e){if(E(e)&&0===e.length)return e;var t=pe(a(e),n);return!0===r?0===ue(t,function(e){return!e}).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===i?e[0]:e;default:return e}}(t)}}function l(o){return function(e,t){var n=a(e),r=a(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!o(n[i],r[i]))return!1;return!0}}["encode","decode","equals","$normalize"].forEach(function(e){var t=r[e].bind(r),n="equals"===e?l:s;o[e]=n(t)}),q(this,{dynamic:r.dynamic,name:r.name,pattern:r.pattern,inherit:r.inherit,raw:r.raw,is:s(r.is.bind(r),!0),$arrayMode:i})}var _t,St=Object.prototype.hasOwnProperty,Ct=function(e){return 0===["value","type","squash","array","dynamic"].filter(St.bind(e||{})).length};function kt(e,t,n){var r=!1===n.reloadOnSearch&&t===g.DefType.SEARCH||void 0,i=ce([n.dynamic,r],k),o=k(i)?{dynamic:i}:{},a=function(e){function t(){return e.value}e=Ct(e)?{value:e}:e,t.__cacheable=!0;var n=R(e.value)?e.value:t;return q(e,{$$fn:n})}(n&&n.params&&n.params[e]);return q(o,a)}(_t=g.DefType||(g.DefType={}))[_t.PATH=0]="PATH",_t[_t.SEARCH=1]="SEARCH",_t[_t.CONFIG=2]="CONFIG";var Dt=(xt.values=function(e,t){void 0===t&&(t={});for(var n={},r=0,i=e;r<i.length;r++){var o=i[r];n[o.id]=o.value(t[o.id])}return n},xt.changed=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e.filter(function(e){return!e.type.equals(t[e.id],n[e.id])})},xt.equals=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),0===xt.changed(e,t,n).length},xt.validates=function(e,t){return void 0===t&&(t={}),e.map(function(e){return e.validates(t[e.id])}).reduce(fe,!0)},xt.prototype.isDefaultValue=function(e){return this.isOptional&&this.type.equals(this.value(),e)},xt.prototype.value=function(e){var i=this;return e=function(e){for(var t=0,n=i.replace;t<n.length;t++){var r=n[t];if(r.from===e)return r.to}return e}(e),_(e)?function(){if(i._defaultValueCache)return i._defaultValueCache.defaultValue;if(!N.$injector)throw new Error("Injectable functions cannot be called at configuration time");var e=N.$injector.invoke(i.config.$$fn);if(null!=e&&!i.type.is(e))throw new Error("Default value ("+e+") for parameter '"+i.id+"' is not an instance of ParamType ("+i.type.name+")");return i.config.$$fn.__cacheable&&(i._defaultValueCache={defaultValue:e}),e}():this.type.$normalize(e)},xt.prototype.isSearch=function(){return this.location===g.DefType.SEARCH},xt.prototype.validates=function(e){if((_(e)||null===e)&&this.isOptional)return!0;var t=this.type.$normalize(e);if(!this.type.is(t))return!1;var n=this.type.encode(t);return!(T(n)&&!this.type.pattern.exec(n))},xt.prototype.toString=function(){return"{Param:"+this.id+" "+this.type+" squash: '"+this.squash+"' optional: "+this.isOptional+"}"},xt);function xt(e,t,n,r,i){var o=kt(e,n,i);t=function(e,t,n,r,i){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&i.type(e.type))return i.type(e.type);if(t)return t;if(e.type)return e.type instanceof wt?e.type:i.type(e.type);var o=n===g.DefType.CONFIG?"any":n===g.DefType.PATH?"path":n===g.DefType.SEARCH?"query":"string";return i.type(o)}(o,t,n,e,r.paramTypes);var a,s,l=(a={array:n===g.DefType.SEARCH&&"auto"},s=e.match(/\[\]$/)?{array:!0}:{},q(a,s,o).array);t=l?t.$asArray(l,n===g.DefType.SEARCH):t;var u=void 0!==o.value||n===g.DefType.SEARCH,c=k(o.dynamic)?!!o.dynamic:!!t.dynamic,d=k(o.raw)?!!o.raw:!!t.raw,p=function(e,t,n){var r=e.squash;if(!t||!1===r)return!1;if(!k(r)||null==r)return n;if(!0===r||T(r))return r;throw new Error("Invalid squash policy: '"+r+"'. Valid policies: false, true, or arbitrary string")}(o,u,r.defaultSquashPolicy()),h=function(e,t,n,r){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],o=E(e.replace)?e.replace:[];T(r)&&o.push({from:r,to:void 0});var a=pe(o,w("from"));return ue(i,function(e){return-1===a.indexOf(e.from)}).concat(o)}(o,l,u,p),f=k(o.inherit)?!!o.inherit:!!t.inherit;q(this,{id:e,type:t,location:n,isOptional:u,dynamic:c,raw:d,squash:p,replace:h,inherit:f,array:l,config:o})}var Ot=(Tt.prototype.dispose=function(){this.types={}},Tt.prototype.type=function(e,t,n){if(!k(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new wt(q({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},Tt.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");q(this.types[e.name],N.$injector.invoke(e.def))}},Tt);function Tt(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=ae(Tt.prototype,["hash","string","query","path","int","bool","date","json","any"]);this.types=K(pe(this.defaultTypes,function(e,t){return new wt(q({name:t},e))}),{})}function At(e){function t(e){return null!=e?e.toString():e}var n={encode:t,decode:t,is:h(String),pattern:/.*/,equals:function(e,t){return e==t}};return q({},n,e)}q(Ot.prototype,{string:At({}),path:At({pattern:/[^/]*/}),query:At({}),hash:At({inherit:!1}),int:At({decode:function(e){return parseInt(e,10)},is:function(e){return!D(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:At({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:h(Boolean),pattern:/0|1/}),date:At({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},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]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(n,r){return["getFullYear","getMonth","getDate"].reduce(function(e,t){return e&&n[t]()===r[t]()},!0)},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:At({encode:H,decode:Y,is:h(Object),equals:z,pattern:/[^/]*/}),any:At({encode:B,decode:B,is:function(){return!0},equals:z})});var Et=(Pt.prototype.$inherit=function(e,t,n){var r,i=oe(t,n),o={},a=[];for(var s in i)if(i[s]&&i[s].params&&(r=Object.keys(i[s].params)).length)for(var l in r)0<=a.indexOf(r[l])||(a.push(r[l]),o[r[l]]=this[r[l]]);return q({},o,e)},Pt);function Pt(e){void 0===e&&(e={}),q(this,e)}var Mt=(Rt.prototype.clone=function(){return new Rt(this)},Rt.prototype.applyRawParams=function(r){return this.paramValues=this.paramSchema.reduce(function(e,t){return xe(e,[(n=t).id,n.value(r[n.id])]);var n},{}),this},Rt.prototype.parameter=function(e){return ce(this.paramSchema,m("id",e))},Rt.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},Rt.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return Dt.changed(n,this.paramValues,e.paramValues)},Rt.clone=function(e){return e.clone()},Rt);function Rt(e){var t,n;e instanceof Rt?(t=e,this.state=t.state,this.paramSchema=t.paramSchema.slice(),this.paramValues=q({},t.paramValues),this.resolvables=t.resolvables.slice(),this.views=t.views&&t.views.slice()):(n=e,this.state=n,this.paramSchema=n.parameters({inherit:!1}),this.paramValues={},this.resolvables=n.resolvables.map(function(e){return e.clone()}))}var It=(Vt.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},Vt.prototype.identifier=function(){return this._identifier},Vt.prototype.params=function(){return this._params},Vt.prototype.$state=function(){return this._definition},Vt.prototype.state=function(){return this._definition&&this._definition.self},Vt.prototype.options=function(){return this._options},Vt.prototype.exists=function(){return!(!this._definition||!this._definition.self)},Vt.prototype.valid=function(){return!this.error()},Vt.prototype.error=function(){var e=this.options().relative;if(this._definition||!e)return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'";var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"},Vt.prototype.toString=function(){return"'"+this.name()+"'"+Ke(this.params())},Vt.prototype.withState=function(e){return new Vt(this._stateRegistry,e,this._params,this._options)},Vt.prototype.withParams=function(e,t){void 0===t&&(t=!1);var n=t?e:q({},this._params,e);return new Vt(this._stateRegistry,this._identifier,n,this._options)},Vt.prototype.withOptions=function(e,t){void 0===t&&(t=!1);var n=t?e:q({},this._options,e);return new Vt(this._stateRegistry,this._identifier,this._params,n)},Vt.isDef=function(e){return e&&e.state&&(T(e.state)||A(e.state)&&T(e.state.name))},Vt);function Vt(e,t,n,r){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=q({},n||{}),this._options=q({},r||{}),this._definition=e.matcher.find(t,this._options.relative)}var Nt=(Lt.makeTargetState=function(e,t){var n=Oe(t).state;return new It(e,n,t.map(w("paramValues")).reduce(ie,{}),{})},Lt.buildPath=function(e){var t=e.params();return e.$state().path.map(function(e){return new Mt(e).applyRawParams(t)})},Lt.buildToPath=function(e,t){var n=Lt.buildPath(t);return t.options().inherit?Lt.inheritParams(e,n,Object.keys(t.params())):n},Lt.applyViewConfigs=function(i,o,t){o.filter(function(e){return Q(t,e.state)}).forEach(function(t){var e=he(t.state.views||{}),n=Lt.subPath(o,function(e){return e===t}),r=e.map(function(e){return i.createViewConfig(n,e)});t.views=r.reduce(me,[])})},Lt.inheritParams=function(l,e,u){void 0===u&&(u=[]);var c=l.map(function(e){return e.paramSchema}).reduce(me,[]).filter(function(e){return!e.inherit}).map(w("id"));return e.map(function(e){var t,n,r,i=ae(o=q({},e&&e.paramValues),u),o=se(o,u),a=se((t=l,n=e.state,r=ce(t,m("state",n)),q({},r&&r.paramValues)||{}),c),s=q(o,a,i);return new Mt(e.state).applyRawParams(s)})},Lt.treeChanges=function(e,r,t){for(var n,i,o,a,s,l=Math.min(e.length,r.length),u=0;u<l&&e[u].state!==t&&(n=e[u],i=r[u],n.equals(i,Lt.nonDynamicParams));)u++;a=(o=e).slice(0,u),s=o.slice(u);var c=a.map(function(e,t){var n=e.clone();return n.paramValues=r[t].paramValues,n}),d=r.slice(u);return{from:o,to:c.concat(d),retained:a,retainedWithToParams:c,exiting:s,entering:d}},Lt.matching=function(e,t,i){var o=!1;return De(e,t).reduce(function(e,t){var n=t[0],r=t[1];return(o=o||!n.equals(r,i))?e:e.concat(n)},[])},Lt.equals=function(e,t,n){return e.length===t.length&&Lt.matching(e,t,n).length===e.length},Lt.subPath=function(e,t){var n=ce(e,t),r=e.indexOf(n);return-1===r?void 0:e.slice(0,r+1)},Lt.nonDynamicParams=function(e){return e.state.parameters({inherit:!1}).filter(function(e){return!e.dynamic})},Lt.paramValues=function(e){return e.reduce(function(e,t){return q(e,t.paramValues)},{})},Lt);function Lt(){}var Ft={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}},jt={when:"LAZY",async:"WAIT"},Yt=(Ht.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||jt.when,async:t.async||n.async||jt.async}},Ht.prototype.resolve=function(t,n){var r=this,e=N.$q,i=t.findNode(this),o=i&&i.state,a=this.getPolicy(o).async,s=x(a)?a:B;return this.promise=e.when().then(function(){return e.all(t.getDependencies(r).map(function(e){return e.get(t,n)}))}).then(function(e){return r.resolveFn.apply(null,e)}).then(s).then(function(e){return r.data=e,r.resolved=!0,r.resolveFn=null,yt.traceResolvableResolved(r,n),r.data})},Ht.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},Ht.prototype.toString=function(){return"Resolvable(token: "+Ke(this.token)+", requires: ["+this.deps.map(Ke)+"])"},Ht.prototype.clone=function(){return new Ht(this)},Ht.fromData=function(e,t){return new Ht(e,function(){return t},null,null,t)},Ht);function Ht(e,t,n,r,i){if(this.resolved=!1,this.promise=void 0,e instanceof Ht)q(this,e);else if(x(t)){if(D(e))throw new Error("new Resolvable(): token argument is required");if(!x(t))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=e,this.policy=r,this.resolveFn=t,this.deps=n||[],this.data=i,this.resolved=void 0!==i,this.promise=this.resolved?N.$q.when(this.data):void 0}else if(A(e)&&e.token&&(e.hasOwnProperty("resolveFn")||e.hasOwnProperty("data"))){return new Ht(e.token,e.resolveFn,e.deps,e.policy,e.data)}}var Ut=Ft.when,qt=[Ut.EAGER,Ut.LAZY],zt=[Ut.EAGER],Bt="Native Injector",Wt=(Gt.prototype.getTokens=function(){return this._path.reduce(function(e,t){return e.concat(t.resolvables.map(function(e){return e.token}))},[]).reduce(we,[])},Gt.prototype.getResolvable=function(t){return Oe(this._path.map(function(e){return e.resolvables}).reduce(me,[]).filter(function(e){return e.token===t}))},Gt.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},Gt.prototype.subContext=function(t){return new Gt(Nt.subPath(this._path,function(e){return e.state===t}))},Gt.prototype.addResolvables=function(e,t){var n=ce(this._path,m("state",t)),r=e.map(function(e){return e.token});n.resolvables=n.resolvables.filter(function(e){return-1===r.indexOf(e.token)}).concat(e)},Gt.prototype.resolvePath=function(e,s){var l=this;void 0===e&&(e="LAZY");var u=(Q(qt,e)?e:"LAZY")===Ft.when.EAGER?zt:qt;function c(t,n){return function(e){return Q(t,l.getPolicy(e)[n])}}yt.traceResolvePath(this._path,e,s);var t=this._path.reduce(function(e,t){function n(t){return t.get(a,s).then(function(e){return{token:t.token,value:e}})}var r=t.resolvables.filter(c(u,"when")),i=r.filter(c(["NOWAIT"],"async")),o=r.filter(d(c(["NOWAIT"],"async"))),a=l.subContext(t.state);return i.forEach(n),e.concat(o.map(n))},[]);return N.$q.all(t)},Gt.prototype.injector=function(){return this._injector||(this._injector=new Kt(this))},Gt.prototype.findNode=function(t){return ce(this._path,function(e){return Q(e.resolvables,t)})},Gt.prototype.getDependencies=function(t){var r=this,n=this.findNode(t),i=(Nt.subPath(this._path,function(e){return e===n})||this._path).reduce(function(e,t){return e.concat(t.resolvables)},[]).filter(function(e){return e!==t});return t.deps.map(function(t){var e=i.filter(function(e){return e.token===t});if(e.length)return Oe(e);var n=r.injector().getNative(t);if(_(n))throw new Error("Could not find Dependency Injection token: "+Ke(t));return new Yt(t,function(){return n},[],n)})},Gt);function Gt(e){this._path=e}var Kt=(Qt.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+Ke(t.token));return t.data}return this.getNative(e)},Qt.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):N.$q.when(this.native.get(e))},Qt.prototype.getNative=function(e){return this.native&&this.native.get(e)},Qt);function Qt(e){this.context=e,this.native=this.get(Bt)||N.$injector}function Zt(e){return e.name}function Xt(e){return e.self.$$state=function(){return e},e.self}function Jt(e){return e.parent&&e.parent.data&&(e.data=e.self.data=K(e.parent.data,e.data)),e.data}function en(a,s){return function(e){var t,n=e.self;n&&n.url&&n.name&&n.name.match(/\.\*\*$/)&&(Te(n,t={}),t.url+="{remainder:any}",n=t);var r=e.parent,i=function(e){if(!T(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(n.url),o=i?a.compile(i.val,{state:n}):n.url;if(!o)return null;if(!a.isMatcher(o))throw new Error("Invalid url '"+o+"' in state '"+e+"'");return i&&i.root?o:(r&&r.navigable||s()).url.append(o)}}function tn(e){return e.parent?e.parent.path.concat(e):[e]}function nn(e){var t=e.parent?q({},e.parent.includes):{};return t[e.name]=!0,t}function rn(e){function t(e){return e.provide||e.token}var n,r,i=v([[w("resolveFn"),function(e){return new Yt(t(e),e.resolveFn,e.deps,e.policy)}],[w("useFactory"),function(e){return new Yt(t(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[w("useClass"),function(e){return new Yt(t(e),function(){return new e.useClass},[],e.policy)}],[w("useValue"),function(e){return new Yt(t(e),function(){return e.useValue},[],e.policy,e.useValue)}],[w("useExisting"),function(e){return new Yt(t(e),B,[e.useExisting],e.policy)}]]),o=v([[u(w("val"),T),function(e){return new Yt(e.token,B,[e.val],e.policy)}],[u(w("val"),E),function(e){return new Yt(e.token,Oe(e.val),e.val.slice(0,-1),e.policy)}],[u(w("val"),x),function(e){return new Yt(e.token,e.val,(t=e.val,n=N.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),a=v([[h(Yt),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},i],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},i],[function(e){return!!(e&&e.val&&(T(e.val)||E(e.val)||x(e.val)))},o],[f(!0),function(e){throw new Error("Invalid resolve value: "+Ke(e))}]]),s=e.resolve;return(E(s)?s:(n=s,r=e.resolvePolicy||{},Object.keys(n||{}).map(function(e){return{token:e,val:n[e],deps:void 0,policy:r[e]}}))).map(a)}var on=(an.prototype.builder=function(e,t){var n=this.builders,r=n[e]||[];return T(e)&&!k(t)?1<r.length?r:r[0]:T(e)&&x(t)?(n[e]=r,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},an.prototype.build=function(e){var t,n=this.matcher,r=this.builders,i=this.parentName(e);if(i&&!n.find(i,void 0,!1))return null;for(var o in r)r.hasOwnProperty(o)&&(t=r[o].reduce(function(t,n){return function(e){return n(e,t)}},W),e[o]=t(e));return e},an.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?T(e.parent)?e.parent:e.parent.name:""},an.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=T(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},an);function an(t,e){this.matcher=t;function n(){return t.find("")}function r(e){return""===e.name}var i,o,a=this;this.builders={name:[Zt],self:[Xt],parent:[function(e){return r(e)?null:t.find(a.parentName(e))||n()}],data:[Jt],url:[en(e,n)],navigable:[(o=r,function(e){return!o(e)&&e.url?e:e.parent?e.parent.navigable:null})],params:[(i=e.paramFactory,function(n){var e=n.url&&n.url.parameters({inherit:!1})||[],t=he(de(se(n.params||{},e.map(w("id"))),function(e,t){return i.fromConfig(t,null,n.self)}));return e.concat(t).map(function(e){return[e.id,e]}).reduce(xe,{})})],views:[],path:[tn],includes:[nn],resolvables:[rn]}}var sn=(ln.create=function(e){e=ln.isStateClass(e)?new e:e;var t=K(K(e,ln.prototype));return e.$$state=function(){return t},t.self=e,t.__stateObjectCache={nameGlob:Re.fromString(t.name)},t},ln.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},ln.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},ln.prototype.root=function(){return this.parent&&this.parent.root()||this},ln.prototype.parameters=function(t){return((t=re(t,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat(he(this.params)).filter(function(e){return!t.matchingKeys||t.matchingKeys.hasOwnProperty(e.id)})},ln.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||ce(he(this.params),m("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},ln.prototype.toString=function(){return this.fqn()},ln.isStateClass=function(e){return x(e)&&!0===e.__uiRouterState},ln.isStateDeclaration=function(e){return x(e.$$state)},ln.isState=function(e){return A(e.__stateObjectCache)},ln);function ln(e){return ln.create(e||{})}var un=(cn.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},cn.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var r=T(e),i=r?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var o=this._states[i];if(o&&(r||!(r||o!==e&&o.self!==e)))return o;if(r&&n){var a=he(this._states).filter(function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)});return 1<a.length&&ut.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",a.map(function(e){return e.name})),a[0]}}},cn.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),r=e.split("."),i=r.length,o=0,a=n;o<i;o++)if(""!==r[o]||0!==o){if("^"!==r[o])break;if(!a.parent)throw new Error("Path '"+e+"' not valid for state '"+n.name+"'");a=a.parent}else a=n;var s=r.slice(o).join(".");return a.name+(a.name&&s?".":"")+s},cn);function cn(e){this._states=e}var dn=(pn.prototype.dispose=function(){this.queue=[]},pn.prototype.register=function(e){var t=this.queue,n=sn.create(e),r=n.name;if(!T(r))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(r)||Q(t.map(w("name")),r))throw new Error("State '"+r+"' is already defined");return t.push(n),this.flush(),n},pn.prototype.flush=function(){for(var t=this,e=this.queue,n=this.states,r=this.builder,i=[],o=[],a={},s=function(e){return t.states.hasOwnProperty(e)&&t.states[e]},l=function(){i.length&&t.listeners.forEach(function(e){return e("registered",i.map(function(e){return e.self}))})};0<e.length;){var u=e.shift(),c=u.name,d=r.build(u),p=o.indexOf(u);if(d){var h=s(c);if(h&&h.name===c)throw new Error("State '"+c+"' is already defined");var f=s(c+".**");f&&this.router.stateRegistry.deregister(f),n[c]=u,this.attachRoute(u),0<=p&&o.splice(p,1),i.push(u)}else{var g=a[c];if(a[c]=e.length,0<=p&&g===e.length)return e.push(u),l(),n;p<0&&o.push(u),e.push(u)}}return l(),n},pn.prototype.attachRoute=function(e){var t;!e.abstract&&e.url&&(t=this.router.urlService.rules).rule(t.urlRuleFactory.create(e))},pn);function pn(e,t,n,r){this.router=e,this.states=t,this.builder=n,this.listeners=r,this.queue=[]}var hn,fn,gn=(mn.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},mn.prototype.dispose=function(){var t=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach(function(e){return t.get(e)&&t.deregister(e)})},mn.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){X(this.listeners)(e)}.bind(this)},mn.prototype.root=function(){return this._root},mn.prototype.register=function(e){return this.stateQueue.register(e)},mn.prototype._deregisterTree=function(e){var n=this,r=this.get().map(function(e){return e.$$state()}),i=function(t){var e=r.filter(function(e){return-1!==t.indexOf(e.parent)});return 0===e.length?e:e.concat(i(e))},t=i([e]),o=[e].concat(t).reverse();return o.forEach(function(e){var t=n.router.urlService.rules;t.rules().filter(m("state",e)).forEach(function(e){return t.removeRule(e)}),delete n.states[e.name]}),o},mn.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach(function(e){return e("deregistered",n.map(function(e){return e.self}))}),n},mn.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map(function(e){return n.states[e].self});var r=this.matcher.find(e,t);return r&&r.self||null},mn.prototype.decorator=function(e,t){return this.builder.builder(e,t)},mn);function mn(e){this.router=e,this.states={},this.listeners=[],this.matcher=new un(this.states),this.builder=new on(this.matcher,e.urlMatcherFactory),this.stateQueue=new dn(e,this.states,this.builder,this.listeners),this._registerRoot()}(hn=g.TransitionHookPhase||(g.TransitionHookPhase={}))[hn.CREATE=0]="CREATE",hn[hn.BEFORE=1]="BEFORE",hn[hn.RUN=2]="RUN",hn[hn.SUCCESS=3]="SUCCESS",hn[hn.ERROR=4]="ERROR",(fn=g.TransitionHookScope||(g.TransitionHookScope={}))[fn.TRANSITION=0]="TRANSITION",fn[fn.STATE=1]="STATE";var vn={current:W,transition:null,traceData:{},bind:null},yn=(wn.chain=function(e,t){return e.reduce(function(e,t){return e.then(function(){return t.invokeHook()})},t||N.$q.when())},wn.invokeHooks=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].invokeHook();if(V(r)){var i=e.slice(n+1);return wn.chain(i,r).then(t)}}return t()},wn.runAllHooks=function(e){e.forEach(function(e){return e.invokeHook()})},wn.prototype.logError=function(e){this.transition.router.stateService.defaultErrorHandler()(e)},wn.prototype.invokeHook=function(){var t=this,n=this.registeredHook;if(!n._deregistered){var e=this.getNotCurrentRejection();if(e)return e;var r=this.options;yt.traceHookInvocation(this,this.transition,r);var i=function(e){return n.eventType.getErrorHandler(t)(e)},o=function(e){return n.eventType.getResultHandler(t)(e)};try{var a=n.callback.call(r.bind,t.transition,t.stateContext);return!this.type.synchronous&&V(a)?a.catch(function(e){return je.normalize(e).toPromise()}).then(o,i):o(a)}catch(e){return i(je.normalize(e))}finally{n.invokeLimit&&++n.invokeCount>=n.invokeLimit&&n.deregister()}}},wn.prototype.handleHookResult=function(e){var t=this,n=this.getNotCurrentRejection();return n||(V(e)?e.then(function(e){return t.handleHookResult(e)}):(yt.traceHookResult(e,this.transition,this.options),!1===e?je.aborted("Hook aborted transition").toPromise():h(It)(e)?je.redirected(e).toPromise():void 0))},wn.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?je.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?je.aborted().toPromise():this.isSuperseded()?je.superseded(this.options.current()).toPromise():void 0},wn.prototype.toString=function(){var e=this.options,t=this.registeredHook;return(C("traceData.hookType")(e)||"internal")+" context: "+(C("traceData.context.state.name")(e)||C("traceData.context")(e)||"unknown")+", "+He(200,Be(t.callback))},wn.HANDLE_RESULT=function(t){return function(e){return t.handleHookResult(e)}},wn.LOG_REJECTED_RESULT=function(t){return function(e){V(e)&&e.catch(function(e){return t.logError(je.normalize(e))})}},wn.LOG_ERROR=function(t){return function(e){return t.logError(e)}},wn.REJECT_ERROR=function(e){return Me},wn.THROW_ERROR=function(e){return function(e){throw e}},wn);function wn(e,t,n,r){var i=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=r,this.isSuperseded=function(){return i.type.hookPhase===g.TransitionHookPhase.RUN&&!i.options.transition.isActive()},this.options=re(r,vn),this.type=n.eventType}function bn(e,t,n){var i=T(t)?[t]:t;return!!(x(i)?i:function(e){for(var t=i,n=0;n<t.length;n++){var r=new Re(t[n]);if(r&&r.matches(e.name)||!r&&t[n]===e.name)return!0}return!1})(e,n)}var $n=(_n.prototype._matchingNodes=function(e,t,n){if(!0===t)return e;var r=e.filter(function(e){return bn(e.state,t,n)});return r.length?r:null},_n.prototype._getDefaultMatchCriteria=function(){return de(this.tranSvc._pluginapi._getPathTypes(),function(){return!0})},_n.prototype._getMatchingNodes=function(o,a){var s=this,l=q(this._getDefaultMatchCriteria(),this.matchCriteria);return he(this.tranSvc._pluginapi._getPathTypes()).reduce(function(e,t){var n=t.scope===g.TransitionHookScope.STATE,r=o[t.name]||[],i=n?r:[Oe(r)];return e[t.name]=s._matchingNodes(i,l[t.name],a),e},{})},_n.prototype.matches=function(e,t){var n=this._getMatchingNodes(e,t);return he(n).every(B)?n:null},_n.prototype.deregister=function(){this.removeHookFromRegistry(this),this._deregistered=!0},_n);function _n(e,t,n,r,i,o){void 0===o&&(o={}),this.tranSvc=e,this.eventType=t,this.callback=n,this.matchCriteria=r,this.removeHookFromRegistry=i,this.invokeCount=0,this._deregistered=!1,this.priority=o.priority||0,this.bind=o.bind||null,this.invokeLimit=o.invokeLimit}function Sn(e,i,o){var a=(e._registeredHooks=e._registeredHooks||{})[o.name]=[],s=X(a);function t(e,t,n){void 0===n&&(n={});var r=new $n(i,o,t,e,s,n);return a.push(r),r.deregister.bind(r)}return e[o.name]=t}var Cn=(kn.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map(function(e){return t.buildHooks(e)}).reduce(me,[]).filter(B)},kn.prototype.buildHooks=function(o){var a=this.transition,e=a.treeChanges(),t=this.getMatchingHooks(o,e,a);if(!t)return[];var s={transition:a,current:a.options().current};return t.map(function(i){return i.matches(e,a)[o.criteriaMatchPath.name].map(function(e){var t=q({bind:i.bind,traceData:{hookType:o.name,context:e}},s),n=o.criteriaMatchPath.scope===g.TransitionHookScope.STATE?e.state.self:null,r=new yn(a,n,i,t);return{hook:i,node:e,transitionHook:r}})}).reduce(me,[]).sort(function(i){return void 0===i&&(i=!1),function(e,t){var n=i?-1:1,r=(e.node.state.path.length-t.node.state.path.length)*n;return 0!=r?r:t.hook.priority-e.hook.priority}}(o.reverseSort)).map(function(e){return e.transitionHook})},kn.prototype.getMatchingHooks=function(t,n,r){var e=t.hookPhase===g.TransitionHookPhase.CREATE,i=this.transition.router.transitionService;return(e?[i]:[this.transition,i]).map(function(e){return e.getHooks(t.name)}).filter(_e(E,"broken event named: "+t.name)).reduce(me,[]).filter(function(e){return e.matches(n,r)})},kn);function kn(e){this.transition=e}var Dn=w("self"),xn=(On.prototype.onBefore=function(e,t,n){},On.prototype.onStart=function(e,t,n){},On.prototype.onExit=function(e,t,n){},On.prototype.onRetain=function(e,t,n){},On.prototype.onEnter=function(e,t,n){},On.prototype.onFinish=function(e,t,n){},On.prototype.onSuccess=function(e,t,n){},On.prototype.onError=function(e,t,n){},On.prototype.createTransitionHookRegFns=function(){var t=this;this.router.transitionService._pluginapi._getEvents().filter(function(e){return e.hookPhase!==g.TransitionHookPhase.CREATE}).forEach(function(e){return Sn(t,t.router.transitionService,e)})},On.prototype.getHooks=function(e){return this._registeredHooks[e]},On.prototype.applyViewConfigs=function(e){var t=this._treeChanges.entering.map(function(e){return e.state});Nt.applyViewConfigs(e.transitionService.$view,this._treeChanges.to,t)},On.prototype.$from=function(){return Oe(this._treeChanges.from).state},On.prototype.$to=function(){return Oe(this._treeChanges.to).state},On.prototype.from=function(){return this.$from().self},On.prototype.to=function(){return this.$to().self},On.prototype.targetState=function(){return this._targetState},On.prototype.is=function(e){return e instanceof On?this.is({to:e.$to().name,from:e.$from().name}):!(e.to&&!bn(this.$to(),e.to,this)||e.from&&!bn(this.$from(),e.from,this))},On.prototype.params=function(e){return void 0===e&&(e="to"),Object.freeze(this._treeChanges[e].map(w("paramValues")).reduce(ie,{}))},On.prototype.paramsChanged=function(){var e=this.params("from"),n=this.params("to"),t=[].concat(this._treeChanges.to).concat(this._treeChanges.from).map(function(e){return e.paramSchema}).reduce(ve,[]).reduce(we,[]);return Dt.changed(t,e,n).reduce(function(e,t){return e[t.id]=n[t.id],e},{})},On.prototype.injector=function(t,e){void 0===e&&(e="to");var n=this._treeChanges[e];return t&&(n=Nt.subPath(n,function(e){return e.state===t||e.state.name===t})),new Wt(n).injector()},On.prototype.getResolveTokens=function(e){return void 0===e&&(e="to"),new Wt(this._treeChanges[e]).getTokens()},On.prototype.addResolvable=function(e,t){void 0===t&&(t=""),e=h(Yt)(e)?e:new Yt(e);var n="string"==typeof t?t:t.name,r=this._treeChanges.to,i=ce(r,function(e){return e.state.name===n});new Wt(r).addResolvables([e],i.state)},On.prototype.redirectedFrom=function(){return this._options.redirectedFrom||null},On.prototype.originalTransition=function(){var e=this.redirectedFrom();return e&&e.originalTransition()||this},On.prototype.options=function(){return this._options},On.prototype.entering=function(){return pe(this._treeChanges.entering,w("state")).map(Dn)},On.prototype.exiting=function(){return pe(this._treeChanges.exiting,w("state")).map(Dn).reverse()},On.prototype.retained=function(){return pe(this._treeChanges.retained,w("state")).map(Dn)},On.prototype.views=function(e,t){void 0===e&&(e="entering");var n=this._treeChanges[e];return(n=t?n.filter(m("state",t)):n).map(w("views")).filter(B).reduce(me,[])},On.prototype.treeChanges=function(e){return e?this._treeChanges[e]:this._treeChanges},On.prototype.redirect=function(e){for(var t=1,n=this;null!=(n=n.redirectedFrom());)if(20<++t)throw new Error("Too many consecutive Transition redirects (20+)");var r={redirectedFrom:this,source:"redirect"};"url"===this.options().source&&!1!==e.options().location&&(r.location="replace");var i=q({},this.options(),e.options(),r);e=e.withOptions(i,!0);var o,a=this.router.transitionService.create(this._treeChanges.from,e),s=this._treeChanges.entering,l=a._treeChanges.entering;return Nt.matching(l,s,Nt.nonDynamicParams).filter(d((o=e.options().reloadState,function(e){return o&&e.state.includes[o.name]}))).forEach(function(e,t){e.resolvables=s[t].resolvables}),a},On.prototype._changedParams=function(){var e=this._treeChanges;if(!(this._options.reload||e.exiting.length||e.entering.length||e.to.length!==e.from.length||De(e.to,e.from).map(function(e){return e[0].state!==e[1].state}).reduce(ge,!1))){var t=e.to.map(function(e){return e.paramSchema}),n=[e.to,e.from].map(function(e){return e.map(function(e){return e.paramValues})});return De(t,n[0],n[1]).map(function(e){var t=e[0],n=e[1],r=e[2];return Dt.changed(t,n,r)}).reduce(me,[])}},On.prototype.dynamic=function(){var e=this._changedParams();return!!e&&e.map(function(e){return e.dynamic}).reduce(ge,!1)},On.prototype.ignored=function(){return!!this._ignoredReason()},On.prototype._ignoredReason=function(){function e(e,t){if(e.length===t.length){var n=Nt.matching(e,t);return e.length===n.filter(function(e){return!r||!e.state.includes[r.name]}).length}}var t=this.router.globals.transition,r=this._options.reloadState,n=this.treeChanges(),i=t&&t.treeChanges();return i&&e(i.to,n.to)&&e(i.exiting,n.exiting)?"SameAsPending":0===n.exiting.length&&0===n.entering.length&&e(n.from,n.to)?"SameAsCurrent":void 0},On.prototype.run=function(){function t(e){return n._hookBuilder.buildHooksForPhase(e)}var n=this,r=yn.runAllHooks,e=t(g.TransitionHookPhase.BEFORE);return yn.invokeHooks(e,function(){var e=n.router.globals;return e.lastStartedTransitionId=n.$id,e.transition=n,e.transitionHistory.enqueue(n),yt.traceTransitionStart(n),N.$q.when(void 0)}).then(function(){var e=t(g.TransitionHookPhase.RUN);return yn.invokeHooks(e,function(){return N.$q.when(void 0)})}).then(function(){yt.traceSuccess(n.$to(),n),n.success=!0,n._deferred.resolve(n.to()),r(t(g.TransitionHookPhase.SUCCESS))},function(e){yt.traceError(e,n),n.success=!1,n._deferred.reject(e),n._error=e,r(t(g.TransitionHookPhase.ERROR))}),this.promise},On.prototype.valid=function(){return!this.error()||void 0!==this.success},On.prototype.abort=function(){_(this.success)&&(this._aborted=!0)},On.prototype.error=function(){var e=this.$to();if(e.self.abstract)return je.invalid("Cannot transition to abstract state '"+e.name+"'");var t=e.parameters(),n=this.params(),r=t.filter(function(e){return!e.validates(n[e.id])});if(r.length){var i=r.map(function(e){return"["+e.id+":"+Ke(n[e.id])+"]"}).join(", "),o="The following parameter values are not valid for state '"+e.name+"': "+i;return je.invalid(o)}return!1===this.success?this._error:void 0},On.prototype.toString=function(){function e(e){return null!==e["#"]&&void 0!==e["#"]?e:se(e,["#"])}var t=this.from(),n=this.to();return"Transition#"+this.$id+"( '"+(A(t)?t.name:t)+"'"+Ke(e(this._treeChanges.from.map(w("paramValues")).reduce(ie,{})))+" -> "+(this.valid()?"":"(X) ")+"'"+(A(n)?n.name:n)+"'"+Ke(e(this.params()))+" )"},On.diToken=On);function On(e,t,n){var r=this;if(this._deferred=N.$q.defer(),this.promise=this._deferred.promise,this._registeredHooks={},this._hookBuilder=new Cn(this),this.isActive=function(){return r.router.globals.transition===r},this.router=n,!(this._targetState=t).valid())throw new Error(t.error());this._options=q({current:f(this)},t.options()),this.$id=n.transitionService._transitionCount++;var i=Nt.buildToPath(e,t);this._treeChanges=Nt.treeChanges(e,i,this._options.reloadState),this.createTransitionHookRegFns();var o=this._hookBuilder.buildHooksForPhase(g.TransitionHookPhase.CREATE);yn.invokeHooks(o,function(){return null}),this.applyViewConfigs(n)}function Tn(e,t){var n=["",""],r=e.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!t)return r;switch(t.squash){case!1:n=["(",")"+(t.isOptional?"?":"")];break;case!0:r=r.replace(/\/$/,""),n=["(?:/(",")|/)?"];break;default:n=["("+t.squash+"|",")?"]}return r+n[0]+t.type.pattern.source+n[1]}var An=rt("/"),En={state:{params:{}},strict:!0,caseInsensitive:!0},Pn=(Mn.encodeDashes=function(e){return encodeURIComponent(e).replace(/-/g,function(e){return"%5C%"+e.charCodeAt(0).toString(16).toUpperCase()})},Mn.pathSegmentsAndParams=function(e){return De(e._segments,e._params.filter(function(e){return e.location===g.DefType.PATH}).concat(void 0)).reduce(me,[]).filter(function(e){return""!==e&&k(e)})},Mn.queryParams=function(e){return e._params.filter(function(e){return e.location===g.DefType.SEARCH})},Mn.compare=function(e,t){function n(e){return e._cache.weights=e._cache.weights||((t=e)._cache.segments=t._cache.segments||t._cache.path.map(Mn.pathSegmentsAndParams).reduce(me,[]).reduce(it,[]).map(function(e){return T(e)?An(e):e}).reduce(me,[])).map(function(e){return"/"===e?1:T(e)?2:e instanceof Dt?3:void 0});var t}var r=n(e),i=n(t);!function(e,t,n){for(var r=Math.max(e.length,t.length);e.length<r;)e.push(n);for(;t.length<r;)t.push(n)}(r,i,0);for(var o,a=De(r,i),s=0;s<a.length;s++)if(0!=(o=a[s][0]-a[s][1]))return o;return 0},Mn.prototype.append=function(e){return this._children.push(e),e._cache={path:this._cache.path.concat(e),parent:this,pattern:null},e},Mn.prototype.isRoot=function(){return this._cache.path[0]===this},Mn.prototype.toString=function(){return this.pattern},Mn.prototype.exec=function(e,r,t,n){var i=this;void 0===r&&(r={});var o,a,s,l=(o=this._cache,s=function(){return new RegExp(["^",be(i._cache.path.map(w("_compiled"))).join(""),!1===i.config.strict?"/?":"","$"].join(""),i.config.caseInsensitive?"i":void 0)},(o[a="pattern"]=o[a]||s()).exec(e));if(!l)return null;var u=this.parameters(),c=u.filter(function(e){return!e.isSearch()}),d=u.filter(function(e){return e.isSearch()}),p=this._cache.path.map(function(e){return e._segments.length-1}).reduce(function(e,t){return e+t}),h={};if(p!==l.length-1)throw new Error("Unbalanced capture group in route '"+this.pattern+"'");function f(e){function t(e){return e.split("").reverse().join("")}var n=pe(t(e).split(/-(?!\\)/),t);return pe(n,function(e){return e.replace(/\\-/g,"-")}).reverse()}for(var g=0;g<p;g++){for(var m=c[g],v=l[g+1],y=0;y<m.replace.length;y++)m.replace[y].from===v&&(v=m.replace[y].to);v&&!0===m.array&&(v=f(v)),k(v)&&(v=m.type.decode(v)),h[m.id]=m.value(v)}return d.forEach(function(e){for(var t=r[e.id],n=0;n<e.replace.length;n++)e.replace[n].from===t&&(t=e.replace[n].to);k(t)&&(t=e.type.decode(t)),h[e.id]=e.value(t)}),t&&(h["#"]=t),h},Mn.prototype.parameters=function(e){return void 0===e&&(e={}),!1===e.inherit?this._params:be(this._cache.path.map(function(e){return e._params}))},Mn.prototype.parameter=function(r,e){var i=this;void 0===e&&(e={});var t=this._cache.parent;return function(){for(var e=0,t=i._params;e<t.length;e++){var n=t[e];if(n.id===r)return n}}()||!1!==e.inherit&&t&&t.parameter(r,e)||null},Mn.prototype.validates=function(r){return r=r||{},this.parameters().filter(function(e){return r.hasOwnProperty(e.id)}).map(function(e){return n=r[(t=e).id],!t||t.validates(n);var t,n}).reduce(fe,!0)},Mn.prototype.format=function(a){void 0===a&&(a={});var e=this._cache.path,t=e.map(Mn.pathSegmentsAndParams).reduce(me,[]).map(function(e){return T(e)?e:r(e)}),n=e.map(Mn.queryParams).reduce(me,[]).map(r);if(t.concat(n).filter(function(e){return!1===e.isValid}).length)return null;function r(e){var t=e.value(a[e.id]),n=e.validates(t),r=e.isDefaultValue(t),i=!!r&&e.squash,o=e.type.encode(t);return{param:e,value:t,isValid:n,isDefaultValue:r,squash:i,encoded:o}}var i=t.reduce(function(e,t){if(T(t))return e+t;var n=t.squash,r=t.encoded,i=t.param;return!0===n?e.match(/\/$/)?e.slice(0,-1):e:T(n)?e+n:!1!==n||null==r?e:E(r)?e+pe(r,Mn.encodeDashes).join("-"):i.raw?e+r:e+encodeURIComponent(r)},""),o=n.map(function(e){var t=e.param,n=e.squash,r=e.encoded,i=e.isDefaultValue;if(!(null==r||i&&!1!==n)&&(E(r)||(r=[r]),0!==r.length))return t.raw||(r=pe(r,encodeURIComponent)),r.map(function(e){return t.id+"="+e})}).filter(B).reduce(me,[]).join("&");return i+(o?"?"+o:"")+(a["#"]?"#"+a["#"]:"")},Mn.nameValidator=/^\w+([-.]+\w+)*(?:\[\])?$/,Mn);function Mn(o,a,e,t){var s=this;this._cache={path:[this]},this._children=[],this._params=[],this._segments=[],this._compiled=[],this.config=t=re(t,En),this.pattern=o;for(var n,r,i=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,u=[],c=0,d=function(e){if(!Mn.nameValidator.test(e))throw new Error("Invalid parameter name '"+e+"' in pattern '"+o+"'");if(ce(s._params,m("id",e)))throw new Error("Duplicate parameter name '"+e+"' in pattern '"+o+"'")},p=function(e,t){var n,r=e[2]||e[3],i=t?e[4]:e[4]||("*"===e[1]?"[\\s\\S]*":null);return{id:r,regexp:i,segment:o.substring(c,e.index),type:i?a.type(i)||(n=i,K(a.type(t?"query":"path"),{pattern:new RegExp(n,s.config.caseInsensitive?"i":void 0)})):null}};(n=i.exec(o))&&!(0<=(r=p(n,!1)).segment.indexOf("?"));)d(r.id),this._params.push(e.fromPath(r.id,r.type,t.state)),this._segments.push(r.segment),u.push([r.segment,Oe(this._params)]),c=i.lastIndex;var h=(g=o.substring(c)).indexOf("?");if(0<=h){var f=g.substring(h),g=g.substring(0,h);if(0<f.length)for(c=0;n=l.exec(f);)d((r=p(n,!0)).id),this._params.push(e.fromSearch(r.id,r.type,t.state)),c=i.lastIndex}this._segments.push(g),this._compiled=u.map(function(e){return Tn.apply(null,e)}).concat(Tn(g))}var Rn=function(){return(Rn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},In=(Vn.prototype.fromConfig=function(e,t,n){return new Dt(e,t,g.DefType.CONFIG,this.router.urlService.config,n)},Vn.prototype.fromPath=function(e,t,n){return new Dt(e,t,g.DefType.PATH,this.router.urlService.config,n)},Vn.prototype.fromSearch=function(e,t,n){return new Dt(e,t,g.DefType.SEARCH,this.router.urlService.config,n)},Vn);function Vn(e){this.router=e}var Nn=(Ln.prototype.compile=function(e,t){var n=this.router.urlService.config,r=t&&!t.state&&t.params;t=r?Rn({state:{params:r}},t):t;var i={strict:n._isStrictMode,caseInsensitive:n._isCaseInsensitive};return new Pn(e,n.paramTypes,this.paramFactory,q(i,t))},Ln.prototype.isMatcher=function(n){if(!A(n))return!1;var r=!0;return U(Pn.prototype,function(e,t){x(e)&&(r=r&&k(n[t])&&x(n[t]))}),r},Ln.prototype.$get=function(){var e=this.router.urlService.config;return e.paramTypes.enqueue=!1,e.paramTypes._flushTypeQueue(),this},Ln);function Ln(e){var r=this;this.router=e,this.paramFactory=new In(this.router),this.caseInsensitive=function(e){return r.router.urlService.config.caseInsensitive(e)},this.defaultSquashPolicy=function(e){return r.router.urlService.config.defaultSquashPolicy(e)},this.strictMode=function(e){return r.router.urlService.config.strictMode(e)},this.type=function(e,t,n){return r.router.urlService.config.type(e,t,n)||r},q(this,{UrlMatcher:Pn,Param:Dt})}var Fn=(jn.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},jn.prototype.create=function(e,t){var n=this,r=sn.isState,i=sn.isStateDeclaration,o=v([[T,function(e){return o(n.compile(e))}],[h(Pn),function(e){return n.fromUrlMatcher(e,t)}],[s(r,i),function(e){return n.fromState(e,n.router)}],[h(RegExp),function(e){return n.fromRegExp(e,t)}],[x,function(e){return new Yn(e,t)}]]),a=o(e);if(!a)throw new Error("invalid 'what' in when()");return a},jn.prototype.fromUrlMatcher=function(n,t){var e=t;T(t)&&(t=this.router.urlMatcherFactory.compile(t)),h(Pn)(t)&&(e=function(e){return t.format(e)});var r={urlMatcher:n,matchPriority:function(t){var e=n.parameters().filter(function(e){return e.isOptional});return e.length?e.filter(function(e){return t[e.id]}).length/e.length:1e-6},type:"URLMATCHER"};return q(new Yn(function(e){var t=n.exec(e.path,e.search,e.hash);return n.validates(t)&&t},e),r)},jn.prototype.fromState=function(e,r){var i=sn.isStateDeclaration(e)?e.$$state():e,t={state:i,type:"STATE"};return q(this.fromUrlMatcher(i.url,function(e){var t=r.stateService,n=r.globals;t.href(i,e)!==t.href(n.current,n.params)&&t.transitionTo(i,e,{inherit:!0,source:"url"})}),t)},jn.prototype.fromRegExp=function(t,e){if(t.global||t.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=T(e)?function(n){return e.replace(/\$(\$|\d{1,2})/,function(e,t){return n["$"===t?0:Number(t)]})}:e,r={regexp:t,type:"REGEXP"};return q(new Yn(function(e){return t.exec(e.path)},n),r)},jn.isUrlRule=function(t){return t&&["type","match","handler"].every(function(e){return k(t[e])})},jn);function jn(e){this.router=e}var Yn=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||B};var Hn=(Un.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},Un.prototype.push=function(e,t,n){var r=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),r)},Un.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var i,o,a,s,l=this.router.urlService.config,u=l.html5Mode();if(u||null===r||(r="#"+l.hashPrefix()+r),i=r,o=u,a=n.absolute,r="/"===(s=l.baseHref())?i:o?Ze(s)+i:a?s.slice(1)+i:i,!n.absolute||!r)return r;var c=!u&&r?"/":"",d=l.port(),p=80===d||443===d?"":":"+d;return[l.protocol(),"://",l.host(),p,c,r].join("")},Object.defineProperty(Un.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!0,configurable:!0}),Un);function Un(e){var r=this;this.router=e,this.sync=function(e){return r.router.urlService.sync(e)},this.listen=function(e){return r.router.urlService.listen(e)},this.deferIntercept=function(e){return r.router.urlService.deferIntercept(e)},this.match=function(e){return r.router.urlService.match(e)},this.initial=function(e){return r.router.urlService.rules.initial(e)},this.otherwise=function(e){return r.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return r.router.urlService.rules.removeRule(e)},this.rule=function(e){return r.router.urlService.rules.rule(e)},this.rules=function(){return r.router.urlService.rules.rules()},this.sort=function(e){return r.router.urlService.rules.sort(e)},this.when=function(e,t,n){return r.router.urlService.rules.when(e,t,n)},this.urlRuleFactory=new Fn(e)}var qn=(zn.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),r=n[0]||"$default",i=T(n[1])?n[1]:"^",o=/^(\^(?:\.\^)*)\.(.*$)/.exec(r);return o&&(i=o[1],r=o[2]),"!"===r.charAt(0)&&(r=r.substr(1),i=""),/^(\^(?:\.\^)*)$/.exec(i)?i=i.split(".").reduce(function(e,t){return e.parent},e).name:"."===i&&(i=e.name),{uiViewName:r,uiViewContextAnchor:i}},zn.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},zn.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},zn.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var r=n(e,t);return E(r)?r:[r]},zn.prototype.deactivateViewConfig=function(e){yt.traceViewServiceEvent("<- Removing",e),X(this._viewConfigs,e)},zn.prototype.activateViewConfig=function(e){yt.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},zn.prototype.sync=function(){var n=this,r=this._uiViews.map(function(e){return[e.fqn,e]}).reduce(xe,{});function i(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var o=l(function(e,t,n,r){return t*(e(n)-e(r))}),e=this._uiViews.sort(o(function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)},1)).map(function(e){var t=n._viewConfigs.filter(zn.matches(r,e));return 1<t.length&&t.sort(o(i,-1)),{uiView:e,viewConfig:t[0]}}),t=e.map(function(e){return e.viewConfig}),a=this._viewConfigs.filter(function(e){return!Q(t,e)}).map(function(e){return{uiView:void 0,viewConfig:e}});e.forEach(function(e){-1!==n._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)});var s=e.concat(a);this._listeners.forEach(function(e){return e(s)}),yt.traceViewSync(s)},zn.prototype.registerUIView=function(t){yt.traceViewServiceUIViewEvent("-> Registering",t);var e=this._uiViews;return e.filter(function(e){return e.fqn===t.fqn&&e.$type===t.$type}).length&&yt.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",t),e.push(t),this.sync(),function(){-1!==e.indexOf(t)?(yt.traceViewServiceUIViewEvent("<- Deregistering",t),X(e)(t)):yt.traceViewServiceUIViewEvent("Tried removing non-registered uiView",t)}},zn.prototype.available=function(){return this._uiViews.map(w("fqn"))},zn.prototype.active=function(){return this._uiViews.filter(w("$config")).map(w("name"))},zn.matches=function(s,l){return function(e){if(l.$type!==e.viewDecl.$type)return!1;var t=e.viewDecl,n=t.$uiViewName.split("."),r=l.fqn.split(".");if(!z(n,r.slice(0-n.length)))return!1;var i=1-n.length||void 0,o=r.slice(0,i).join("."),a=s[o].creationContext;return t.$uiViewContextAnchor===(a&&a.name)}},zn);function zn(e){var n=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(t){return ce(n._uiViews,function(e){return n.router.$id+"."+e.id===t})},_registeredUIViews:function(){return n._uiViews},_activeViewConfigs:function(){return n._viewConfigs},_onSync:function(e){return n._listeners.push(e),function(){return X(n._listeners,e)}}}}var Bn=(Wn.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},Wn);function Wn(){this.params=new Et,this.lastStartedTransitionId=-1,this.transitionHistory=new Ne([],1),this.successfulTransitions=new Ne([],1)}var Gn;function Kn(e){if(!(x(e)||T(e)||h(It)(e)||It.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return x(e)?e:f(e)}Gn=function(e,t){var n,r,i,o,a,s,l,u,c=(n=e,(t.priority||0)-(n.priority||0));return 0!==c?c:(r=t,0!==(c=((i={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1})[e.type]||0)-(i[r.type]||0))?c:(a=t,0!==(c=(o=e).urlMatcher&&a.urlMatcher?Pn.compare(o.urlMatcher,a.urlMatcher):0)?c:(l=t,(u={STATE:!0,URLMATCHER:!0})[(s=e).type]&&u[l.type]?0:(s.$id||0)-(l.$id||0))))};var Qn=(Zn.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},Zn.prototype.initial=function(e){var t=Kn(e);this.rule(this.urlRuleFactory.create(function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)},t))},Zn.prototype.otherwise=function(e){var t=Kn(e);this._otherwiseFn=this.urlRuleFactory.create(f(!0),t),this._sorted=!1},Zn.prototype.removeRule=function(e){X(this._rules,e)},Zn.prototype.rule=function(e){var t=this;if(!Fn.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},Zn.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},Zn.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,r=0;r<t.length;r++)t[r]._group=n,r<t.length-1&&0!==this._sortFn(t[r],t[r+1])&&n++;this._rules=t,this._sorted=!0},Zn.prototype.ensureSorted=function(){this._sorted||this.sort()},Zn.prototype.stableSort=function(e,r){var t=e.map(function(e,t){return{elem:e,idx:t}});return t.sort(function(e,t){var n=r(e.elem,t.elem);return 0===n?e.idx-t.idx:n}),t.map(function(e){return e.elem})},Zn.prototype.when=function(e,t,n){var r=this.urlRuleFactory.create(e,t);return k(n&&n.priority)&&(r.priority=n.priority),this.rule(r),r},Zn);function Zn(e){this.router=e,this._sortFn=Gn,this._rules=[],this._id=0,this.urlRuleFactory=new Fn(e)}var Xn=(Jn.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=k(e)?e:this._isCaseInsensitive},Jn.prototype.defaultSquashPolicy=function(e){if(k(e)&&!0!==e&&!1!==e&&!T(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=k(e)?e:this._defaultSquashPolicy},Jn.prototype.strictMode=function(e){return this._isStrictMode=k(e)?e:this._isStrictMode},Jn.prototype.type=function(e,t,n){var r=this.paramTypes.type(e,t,n);return k(t)?this:r},Jn);function Jn(e){var t=this;this.router=e,this.paramTypes=new Ot,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}var er=(tr.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},tr.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},tr.prototype.sync=function(e){var t,n,r,i,o;e&&e.defaultPrevented||(t=this.router,n=t.urlService,r=t.stateService,i={path:n.path(),search:n.search(),hash:n.hash()},o=this.match(i),v([[T,function(e){return n.url(e,!0)}],[It.isDef,function(e){return r.go(e.state,e.params,e.options)}],[h(It),function(e){return r.go(e.state(),e.params(),e.options())}]])(o&&o.rule.handler(o.match,i,this.router)))},tr.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange(function(e){return t.sync(e)});this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},tr.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},tr.prototype.match=function(e){var t=this;e=q({path:"",search:{},hash:""},e);for(var n,r,i=this.rules.rules(),o=0;o<i.length&&(!s||s.rule._group===i[o]._group);o++)var a=(n=i[o],(r=n.match(e,t.router))&&{match:r,rule:n,weight:n.matchPriority(r)}),s=!s||a&&a.weight>s.weight?a:s;return s},tr);function tr(e){var r=this;this.router=e,this.interceptDeferred=!1,this.rules=new Qn(this.router),this.config=new Xn(this.router),this.url=function(e,t,n){return r.router.locationService.url(e,t,n)},this.path=function(){return r.router.locationService.path()},this.search=function(){return r.router.locationService.search()},this.hash=function(){return r.router.locationService.hash()},this.onChange=function(e){return r.router.locationService.onChange(e)}}var nr=0,rr=I("LocationServices",["url","path","search","hash","onChange"]),ir=I("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),or=(ar.prototype.disposable=function(e){this._disposables.push(e)},ar.prototype.dispose=function(e){var t=this;e&&x(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach(function(e){try{"function"==typeof e.dispose&&e.dispose(t),X(t._disposables,e)}catch(e){}}))},ar.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},ar.prototype.getPlugin=function(e){return e?this._plugins[e]:he(this._plugins)},ar);function ar(e,t){void 0===e&&(e=rr),void 0===t&&(t=ir),this.locationService=e,this.locationConfig=t,this.$id=nr++,this._disposed=!1,this._disposables=[],this.trace=yt,this.viewService=new qn(this),this.globals=new Bn,this.transitionService=new Or(this),this.urlMatcherFactory=new Nn(this),this.urlRouter=new Hn(this),this.urlService=new er(this),this.stateRegistry=new gn(this),this.stateService=new Ar(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}function sr(t){t.addResolvable(Yt.fromData(or,t.router),""),t.addResolvable(Yt.fromData(xn,t),""),t.addResolvable(Yt.fromData("$transition$",t),""),t.addResolvable(Yt.fromData("$stateParams",t.params()),""),t.entering().forEach(function(e){t.addResolvable(Yt.fromData("$state$",e),e)})}function lr(e){function t(e){return cr(e.token)?Yt.fromData(e.token,null):e}he(e.treeChanges()).reduce(me,[]).reduce(we,[]).forEach(function(e){e.resolvables=e.resolvables.map(t)})}function ur(t){var e=t.to().redirectTo;if(e){var n=t.router.stateService;return x(e)?N.$q.when(e(t)).then(r):r(e)}function r(e){if(e)return e instanceof It?e:T(e)?n.target(e,t.params(),t.options()):e.state||e.params?n.target(e.state||t.to(),e.params||t.params(),t.options()):void 0}}var cr=Q(["$transition$",xn]);function dr(n){return function(e,t){return(0,t.$$state()[n])(e,t)}}function pr(e){return new Wt(e.treeChanges().to).resolvePath("EAGER",e).then(W)}function hr(e,t){return new Wt(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(W)}function fr(e){return new Wt(e.treeChanges().to).resolvePath("LAZY",e).then(W)}function gr(e){var t=N.$q,n=e.views("entering");if(n.length)return t.all(n.map(function(e){return t.when(e.load())})).then(W)}function mr(e){var t,n=e.views("entering"),r=e.views("exiting");(n.length||r.length)&&(t=e.router.viewService,r.forEach(function(e){return t.deactivateViewConfig(e)}),n.forEach(function(e){return t.activateViewConfig(e)}),t.sync())}function vr(e){function t(){n.transition===e&&(n.transition=null)}var n=e.router.globals;e.onSuccess({},function(){n.successfulTransitions.enqueue(e),n.$current=e.$to(),n.current=n.$current.self,Te(e.params(),n.params)},{priority:1e4}),e.promise.then(t,t)}function yr(e){var t,n=e.options(),r=e.router.stateService,i=e.router.urlRouter;"url"!==n.source&&n.location&&r.$current.navigable&&(t={replace:"replace"===n.location},i.push(r.$current.navigable.url,r.params,t)),i.update(!0)}function wr(a){var s=a.router,e=a.entering().filter(function(e){return!!e.$$state().lazyLoad}).map(function(e){return Sr(a,e)});return N.$q.all(e).then(function(){if("url"!==a.originalTransition().options().source){var e=a.targetState();return s.stateService.target(e.identifier(),e.params(),e.options())}var t=s.urlService,n=t.match(t.parts()),r=n&&n.rule;if(r&&"STATE"===r.type){var i=r.state,o=n.match;return s.stateService.target(i,o,a.options())}s.urlService.sync()})}var br=dr("onExit"),$r=dr("onRetain"),_r=dr("onEnter");function Sr(t,n){var r=n.$$state().lazyLoad,e=r._promise;return e||(e=r._promise=N.$q.when(r(t,n)).then(function(e){e&&Array.isArray(e.states)&&e.states.forEach(function(e){return t.router.stateRegistry.register(e)});return e}).then(function(e){return delete n.lazyLoad,delete n.$$state().lazyLoad,delete r._promise,e},function(e){return delete r._promise,N.$q.reject(e)})),e}var Cr=function(e,t,n,r,i,o,a,s){void 0===i&&(i=!1),void 0===o&&(o=yn.HANDLE_RESULT),void 0===a&&(a=yn.REJECT_ERROR),void 0===s&&(s=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=i,this.getResultHandler=o,this.getErrorHandler=a,this.synchronous=s};function kr(e){var t=e._ignoredReason();if(t){yt.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),je.ignored().toPromise()}}function Dr(e){if(!e.valid())throw new Error(e.error().toString())}var xr={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},Or=(Tr.prototype.onCreate=function(e,t,n){},Tr.prototype.onBefore=function(e,t,n){},Tr.prototype.onStart=function(e,t,n){},Tr.prototype.onExit=function(e,t,n){},Tr.prototype.onRetain=function(e,t,n){},Tr.prototype.onEnter=function(e,t,n){},Tr.prototype.onFinish=function(e,t,n){},Tr.prototype.onSuccess=function(e,t,n){},Tr.prototype.onError=function(e,t,n){},Tr.prototype.dispose=function(e){he(this._registeredHooks).forEach(function(t){return t.forEach(function(e){e._deregistered=!0,X(t,e)})})},Tr.prototype.create=function(e,t){return new xn(e,t,this._router)},Tr.prototype._defineCoreEvents=function(){var e=g.TransitionHookPhase,t=yn,n=this._criteriaPaths;this._defineEvent("onCreate",e.CREATE,0,n.to,!1,t.LOG_REJECTED_RESULT,t.THROW_ERROR,!0),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,!1,t.LOG_REJECTED_RESULT,t.LOG_ERROR,!0),this._defineEvent("onError",e.ERROR,0,n.to,!1,t.LOG_REJECTED_RESULT,t.LOG_ERROR,!0)},Tr.prototype._defineCorePaths=function(){var e=g.TransitionHookScope.STATE,t=g.TransitionHookScope.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},Tr.prototype._defineEvent=function(e,t,n,r,i,o,a,s){void 0===i&&(i=!1),void 0===o&&(o=yn.HANDLE_RESULT),void 0===a&&(a=yn.REJECT_ERROR),void 0===s&&(s=!1);var l=new Cr(e,t,n,r,i,o,a,s);this._eventTypes.push(l),Sn(this,this,l)},Tr.prototype._getEvents=function(t){return(k(t)?this._eventTypes.filter(function(e){return e.hookPhase===t}):this._eventTypes.slice()).sort(function(e,t){var n=e.hookPhase-t.hookPhase;return 0==n?e.hookOrder-t.hookOrder:n})},Tr.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},Tr.prototype._getPathTypes=function(){return this._criteriaPaths},Tr.prototype.getHooks=function(e){return this._registeredHooks[e]},Tr.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},sr),e.ignored=this.onBefore({},kr,{priority:-9999}),e.invalid=this.onBefore({},Dr,{priority:-1e4}),e.redirectTo=this.onStart({to:function(e){return!!e.redirectTo}},ur),e.onExit=this.onExit({exiting:function(e){return!!e.onExit}},br),e.onRetain=this.onRetain({retained:function(e){return!!e.onRetain}},$r),e.onEnter=this.onEnter({entering:function(e){return!!e.onEnter}},_r),e.eagerResolve=this.onStart({},pr,{priority:1e3}),e.lazyResolve=this.onEnter({entering:f(!0)},hr,{priority:1e3}),e.resolveAll=this.onFinish({},fr,{priority:1e3}),e.loadViews=this.onFinish({},gr),e.activateViews=this.onSuccess({},mr),e.updateGlobals=this.onCreate({},vr),e.updateUrl=this.onSuccess({},yr,{priority:9999}),e.lazyLoad=this.onBefore({entering:function(e){return!!e.lazyLoad}},wr)},Tr);function Tr(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=G(f(this),{},f(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(lr)}var Ar=(Object.defineProperty(Er.prototype,"transition",{get:function(){return this.router.globals.transition},enumerable:!0,configurable:!0}),Object.defineProperty(Er.prototype,"params",{get:function(){return this.router.globals.params},enumerable:!0,configurable:!0}),Object.defineProperty(Er.prototype,"current",{get:function(){return this.router.globals.current},enumerable:!0,configurable:!0}),Object.defineProperty(Er.prototype,"$current",{get:function(){return this.router.globals.$current},enumerable:!0,configurable:!0}),Er.prototype.dispose=function(){this.defaultErrorHandler(W),this.invalidCallbacks=[]},Er.prototype._handleInvalidTargetState=function(e,n){function r(){return t.transitionHistory.peekTail()}var i=this,o=Nt.makeTargetState(this.router.stateRegistry,e),t=this.router.globals,a=r(),s=new Ne(this.invalidCallbacks.slice()),l=new Wt(e).injector(),u=function(e){if(e instanceof It){var t=e;return(t=i.target(t.identifier(),t.params(),t.options())).valid()?r()!==a?je.superseded().toPromise():i.transitionTo(t.identifier(),t.params(),t.options()):je.invalid(t.error()).toPromise()}};return function t(){var e=s.dequeue();return void 0===e?je.invalid(n.error()).toPromise():N.$q.when(e(n,o,l)).then(u).then(function(e){return e||t()})}()},Er.prototype.onInvalid=function(e){return this.invalidCallbacks.push(e),function(){X(this.invalidCallbacks)(e)}.bind(this)},Er.prototype.reload=function(e){return this.transitionTo(this.current,this.params,{reload:!k(e)||e,inherit:!1,notify:!1})},Er.prototype.go=function(e,t,n){var r=re(n,{relative:this.$current,inherit:!0},xr);return this.transitionTo(e,t,r)},Er.prototype.target=function(e,t,n){if(void 0===n&&(n={}),A(n.reload)&&!n.reload.name)throw new Error("Invalid reload state object");var r=this.router.stateRegistry;if(n.reloadState=!0===n.reload?r.root():r.matcher.find(n.reload,n.relative),n.reload&&!n.reloadState)throw new Error("No such reload state '"+(T(n.reload)?n.reload:n.reload.name)+"'");return new It(this.router.stateRegistry,e,t,n)},Er.prototype.getCurrentPath=function(){var e=this,t=this.router.globals.successfulTransitions.peekTail();return t?t.treeChanges().to:[new Mt(e.router.stateRegistry.root())]},Er.prototype.transitionTo=function(e,t,n){var o=this;void 0===t&&(t={}),void 0===n&&(n={});var a=this.router,s=a.globals;function r(){return s.transition}n=re(n,xr),n=q(n,{current:r});var i=this.target(e,t,n),l=this.getCurrentPath();if(!i.exists())return this._handleInvalidTargetState(l,i);if(!i.valid())return Me(i.error());if(!1===n.supercede&&r())return je.ignored("Another transition is in progress and supercede has been set to false in TransitionOptions for the transition. So the transition was ignored in favour of the existing one in progress.").toPromise();var u=function(i){return function(e){if(e instanceof je){var t=a.globals.lastStartedTransitionId<=i.$id;if(e.type===g.RejectType.IGNORED)return t&&a.urlRouter.update(),N.$q.when(s.current);var n=e.detail;if(e.type===g.RejectType.SUPERSEDED&&e.redirected&&n instanceof It){var r=i.redirect(n);return r.run().catch(u(r))}if(e.type===g.RejectType.ABORTED)return t&&a.urlRouter.update(),N.$q.reject(e)}return o.defaultErrorHandler()(e),N.$q.reject(e)}},c=this.router.transitionService.create(l,i),d=c.run().catch(u(c));return Pe(d),q(d,{transition:c})},Er.prototype.is=function(e,t,n){n=re(n,{relative:this.$current});var r=this.router.stateRegistry.matcher.find(e,n.relative);if(k(r)){if(this.$current!==r)return!1;if(!t)return!0;var i=r.parameters({inherit:!0,matchingKeys:t});return Dt.equals(i,Dt.values(i,t),this.params)}},Er.prototype.includes=function(e,t,n){n=re(n,{relative:this.$current});var r=T(e)&&Re.fromString(e);if(r){if(!r.matches(this.$current.name))return!1;e=this.$current.name}var i=this.router.stateRegistry.matcher.find(e,n.relative),o=this.$current.includes;if(k(i)){if(!k(o[i.name]))return!1;if(!t)return!0;var a=i.parameters({inherit:!0,matchingKeys:t});return Dt.equals(a,Dt.values(a,t),this.params)}},Er.prototype.href=function(e,t,n){n=re(n,{lossy:!0,inherit:!0,absolute:!1,relative:this.$current}),t=t||{};var r=this.router.stateRegistry.matcher.find(e,n.relative);if(!k(r))return null;n.inherit&&(t=this.params.$inherit(t,this.$current,r));var i=r&&n.lossy?r.navigable:r;return i&&void 0!==i.url&&null!==i.url?this.router.urlRouter.href(i.url,t,{absolute:n.absolute}):null},Er.prototype.defaultErrorHandler=function(e){return this._defaultErrorHandler=e||this._defaultErrorHandler},Er.prototype.get=function(e,t){var n=this.router.stateRegistry;return 0===arguments.length?n.get():n.get(e,t||this.$current)},Er.prototype.lazyLoad=function(e,t){var n=this.get(e);if(!n||!n.lazyLoad)throw new Error("Can not lazy load "+e);var r=this.getCurrentPath(),i=Nt.makeTargetState(this.router.stateRegistry,r);return Sr(t=t||this.router.transitionService.create(r,i),n)},Er);function Er(e){this.router=e,this.invalidCallbacks=[],this._defaultErrorHandler=function(e){e instanceof Error&&e.stack?(console.error(e),console.error(e.stack)):e instanceof je?(console.error(e.toString()),e.detail&&e.detail.stack&&console.error(e.detail.stack)):console.error(e)};var t=Object.keys(Er.prototype).filter(d(Q(["current","$current","params","transition"])));G(f(Er.prototype),this,f(this),t)}function Pr(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?E(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e}function Mr(e){return e.split("&").filter(B).map(nt).reduce(Pr,{})}var Rr={when:function(n){return new Promise(function(e,t){return e(n)})},reject:function(n){return new Promise(function(e,t){t(n)})},defer:function(){var n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),n},all:function(e){if(E(e))return Promise.all(e);if(A(e)){var t=Object.keys(e).map(function(t){return e[t].then(function(e){return{key:t,val:e}})});return Rr.all(t).then(function(e){return e.reduce(function(e,t){return e[t.key]=t.val,e},{})})}}},Ir={},Vr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Nr=/([^\s,]+)/g,Lr={get:function(e){return Ir[e]},has:function(e){return null!=Lr.get(e)},invoke:function(e,t,n){var r=q({},Ir,n||{}),i=Lr.annotate(e),o=_e(function(e){return r.hasOwnProperty(e)},function(e){return"DI can't find injectable: '"+e+"'"}),a=i.filter(o).map(function(e){return r[e]});return x(e)?e.apply(t,a):e.slice(-1)[0].apply(t,a)},annotate:function(e){if(!R(e))throw new Error("Not an injectable function: "+e);if(e&&e.$inject)return e.$inject;if(E(e))return e.slice(0,-1);var t=e.toString().replace(Vr,"");return t.slice(t.indexOf("(")+1,t.indexOf(")")).match(Nr)||[]}};function Fr(e){function t(e){return e||""}var n=et(e).map(t),r=n[0],i=n[1],o=tt(r).map(t);return{path:o[0],search:o[1],hash:i,url:e}}function jr(e){var t=e.path(),n=e.search(),r=e.hash(),i=Object.keys(n).map(function(t){var e=n[t];return(E(e)?e:[e]).map(function(e){return t+"="+e})}).reduce(me,[]).join("&");return t+(i?"?"+i:"")+(r?"#"+r:"")}function Yr(r,i,o,a){return function(e){var t=e.locationService=new o(e),n=e.locationConfig=new a(e,i);return{name:r,service:t,configuration:n,dispose:function(e){e.dispose(t),e.dispose(n)}}}}var Hr=(Ur.prototype.url=function(t,e){return void 0===e&&(e=!0),k(t)&&t!==this._get()&&(this._set(null,null,t,e),this.fireAfterUpdate&&this._listeners.forEach(function(e){return e({url:t})})),jr(this)},Ur.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return X(t._listeners,e)}},Ur.prototype.dispose=function(e){ne(this._listeners)},Ur);function Ur(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(t){return n._listeners.forEach(function(e){return e(t)})},this.hash=function(){return Fr(n._get()).hash},this.path=function(){return Fr(n._get()).path},this.search=function(){return Mr(Fr(n._get()).search)},this._location=F.location,this._history=F.history}var qr,zr,Br=((qr=function(e,t){return(qr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}qr(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(Wr,zr=Hr),Wr.prototype._get=function(){return Xe(this._location.hash)},Wr.prototype._set=function(e,t,n,r){this._location.hash=n},Wr.prototype.dispose=function(e){zr.prototype.dispose.call(this,e),F.removeEventListener("hashchange",this._listener)},Wr);function Wr(e){var t=zr.call(this,e,!1)||this;return F.addEventListener("hashchange",t._listener,!1),t}var Gr,Kr,Qr=((Gr=function(e,t){return(Gr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}Gr(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(Zr,Kr=Hr),Zr.prototype._get=function(){return this._url},Zr.prototype._set=function(e,t,n,r){this._url=n},Zr);function Zr(e){return Kr.call(this,e,!0)||this}var Xr,Jr,ei=((Xr=function(e,t){return(Xr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}Xr(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(ti,Jr=Hr),ti.prototype._getBasePrefix=function(){return Ze(this._config.baseHref())},ti.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,r=e.search,r=tt(r)[1],n=et(n)[1],i=this._getBasePrefix(),o=t===this._config.baseHref(),a=t.substr(0,i.length)===i;return(t=o?"/":a?t.substring(i.length):t)+(r?"?"+r:"")+(n?"#"+n:"")},ti.prototype._set=function(e,t,n,r){var i=this._getBasePrefix(),o=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():i+o+n;r?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},ti.prototype.dispose=function(e){Jr.prototype.dispose.call(this,e),F.removeEventListener("popstate",this._listener)},ti);function ti(e){var t=Jr.call(this,e,!0)||this;return t._config=e.urlService.config,F.addEventListener("popstate",t._listener,!1),t}function ni(){var t=this;this.dispose=W,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return t._port},this.protocol=function(){return t._protocol},this.host=function(){return t._host},this.baseHref=function(){return t._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(e){return k(e)?t._hashPrefix=e:t._hashPrefix}}var ri=(ii.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},ii.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},ii.prototype.host=function(){return location.hostname},ii.prototype.html5Mode=function(){return this._isHtml5},ii.prototype.hashPrefix=function(e){return k(e)?this._hashPrefix=e:this._hashPrefix},ii.prototype.baseHref=function(e){return k(e)&&(this._baseHref=e),_(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},ii.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):!this._isHtml5&&location.pathname||"/"},ii.prototype.dispose=function(){},ii);function ii(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}function oi(e){return N.$injector=Lr,{name:"vanilla.services",$q:N.$q=Rr,$injector:Lr,dispose:function(){return null}}}var ai=Yr("vanilla.hashBangLocation",!1,Br,ri),si=Yr("vanilla.pushStateLocation",!0,ei,ri),li=Yr("vanilla.memoryLocation",!1,Qr,ni),ui=(ci.prototype.dispose=function(e){},ci);function ci(){}var di=Object.freeze({__proto__:null,root:F,fromJson:Y,toJson:H,forEach:U,extend:q,equals:z,identity:B,noop:W,createProxyFunctions:G,inherit:K,inArray:Q,_inArray:Z,removeFrom:X,_removeFrom:J,pushTo:ee,_pushTo:te,deregAll:ne,defaults:re,mergeR:ie,ancestors:oe,pick:ae,omit:se,pluck:le,filter:ue,find:ce,mapObj:de,map:pe,values:he,allTrueR:fe,anyTrueR:ge,unnestR:me,flattenR:ve,pushR:ye,uniqR:we,unnest:be,flatten:$e,assertPredicate:_e,assertMap:Se,assertFn:Ce,pairs:ke,arrayTuples:De,applyPairs:xe,tail:Oe,copy:Te,_extend:Ae,silenceUncaughtInPromise:Pe,silentRejection:Me,makeStub:I,services:N,Glob:Re,curry:l,compose:n,pipe:u,prop:w,propEq:m,parse:C,not:d,and:i,or:s,all:c,any:p,is:h,eq:o,val:f,invoke:a,pattern:v,isUndefined:_,isDefined:k,isNull:b,isNullOrUndefined:D,isFunction:x,isNumber:O,isString:T,isObject:A,isArray:E,isDate:P,isRegExp:M,isInjectable:R,isPromise:V,Queue:Ne,maxLength:He,padString:Ue,kebobString:qe,functionToString:ze,fnToString:Be,stringify:Ke,beforeAfterSubstr:Qe,hostRegex:Je,stripLastPathElement:Ze,splitHash:et,splitQuery:tt,splitEqual:nt,trimHashVal:Xe,splitOnDelim:rt,joinNeighborsR:it,get Category(){return g.Category},Trace:mt,trace:yt,get DefType(){return g.DefType},Param:Dt,ParamTypes:Ot,StateParams:Et,ParamType:wt,PathNode:Mt,PathUtils:Nt,resolvePolicies:Ft,defaultResolvePolicy:jt,Resolvable:Yt,NATIVE_INJECTOR_TOKEN:Bt,ResolveContext:Wt,resolvablesBuilder:rn,StateBuilder:on,StateObject:sn,StateMatcher:un,StateQueueManager:dn,StateRegistry:gn,StateService:Ar,TargetState:It,get TransitionHookPhase(){return g.TransitionHookPhase},get TransitionHookScope(){return g.TransitionHookScope},HookBuilder:Cn,matchState:bn,RegisteredHook:$n,makeEvent:Sn,get RejectType(){return g.RejectType},Rejection:je,Transition:xn,TransitionHook:yn,TransitionEventType:Cr,defaultTransOpts:xr,TransitionService:Or,UrlRules:Qn,UrlConfig:Xn,UrlMatcher:Pn,ParamFactory:In,UrlMatcherFactory:Nn,UrlRouter:Hn,UrlRuleFactory:Fn,BaseUrlRule:Yn,UrlService:er,ViewService:qn,UIRouterGlobals:Bn,UIRouter:or,$q:Rr,$injector:Lr,BaseLocationServices:Hr,HashLocationService:Br,MemoryLocationService:Qr,PushStateLocationService:ei,MemoryLocationConfig:ni,BrowserLocationConfig:ri,keyValsToObjectR:Pr,getParams:Mr,parseUrl:Fr,buildUrl:jr,locationPluginFactory:Yr,servicesPlugin:oi,hashLocationPlugin:ai,pushStateLocationPlugin:si,memoryLocationPlugin:li,UIRouterPluginBase:ui});function pi(){var n=null;return function(e,t){return n=n||N.$injector.get("$templateFactory"),[new mi(e,t,n)]}}var hi=function(e,n){return e.reduce(function(e,t){return e||k(n[t])},!1)};function fi(r){if(!r.parent)return{};var i=["component","bindings","componentProvider"],o=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),e=i.concat(o);if(k(r.views)&&hi(e,r))throw new Error("State '"+r.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+e.filter(function(e){return k(r[e])}).join(", "));var a={},t=r.views||{$default:ae(r,e)};return U(t,function(e,t){if(t=t||"$default",T(e)&&(e={component:e}),e=q({},e),hi(i,e)&&hi(o,e))throw new Error("Cannot combine: "+i.join("|")+" with: "+o.join("|")+" in stateview: '"+t+"@"+r.name+"'");e.resolveAs=e.resolveAs||"$resolve",e.$type="ng1",e.$context=r,e.$name=t;var n=qn.normalizeUIViewTarget(e.$context,e.$name);e.$uiViewName=n.uiViewName,e.$uiViewContextAnchor=n.uiViewContextAnchor,a[t]=e}),a}var gi=0,mi=(vi.prototype.load=function(){var t=this,e=N.$q,n=new Wt(this.path),r=this.path.reduce(function(e,t){return q(e,t.paramValues)},{}),i={template:e.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:e.when(this.getController(n))};return e.all(i).then(function(e){return yt.traceViewServiceEvent("Loaded",t),t.controller=e.controller,q(t,e.template),t})},vi.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!R(t))return this.viewDecl.controller;var n=N.$injector.annotate(t),r=E(t)?Oe(t):t;return new Yt("",r,n).get(e)},vi);function vi(e,t,n){var r=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=gi++,this.loaded=!1,this.getTemplate=function(e,t){return r.component?r.factory.makeComponentTemplate(e,t,r.component,r.viewDecl.bindings):r.template}}var yi=(wi.prototype.useHttpService=function(e){this._useHttp=e},wi.prototype.fromConfig=function(e,t,n){function r(e){return N.$q.when(e).then(function(e){return{template:e}})}function i(e){return N.$q.when(e).then(function(e){return{component:e}})}return k(e.template)?r(this.fromString(e.template,t)):k(e.templateUrl)?r(this.fromUrl(e.templateUrl,t)):k(e.templateProvider)?r(this.fromProvider(e.templateProvider,t,n)):k(e.component)?i(e.component):k(e.componentProvider)?i(this.fromComponentProvider(e.componentProvider,t,n)):r("<ui-view></ui-view>")},wi.prototype.fromString=function(e,t){return x(e)?e(t):e},wi.prototype.fromUrl=function(e,t){return x(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then(function(e){return e.data}):this.$templateRequest(e)},wi.prototype.fromProvider=function(e,t,n){var r=N.$injector.annotate(e),i=E(e)?Oe(e):e;return new Yt("",i,r).get(n)},wi.prototype.fromComponentProvider=function(e,t,n){var r=N.$injector.annotate(e),i=E(e)?Oe(e):e;return new Yt("",i,r).get(n)},wi.prototype.makeComponentTemplate=function(l,u,e,c){function d(e){var t=qe(e);return/^(x|data)-/.exec(t)?"x-"+t:t}c=c||{};var p=3<=S.version.minor?"::":"",t=function(e){var t=N.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(bi).reduce(me,[])}(e).map(function(e){var t=e.name,n=e.type,r=d(t);if(l.attr(r)&&!c[t])return r+"='"+l.attr(r)+"'";var i=c[t]||t;if("@"===n)return r+"='{{"+p+"$resolve."+i+"}}'";if("&"!==n)return r+"='"+p+"$resolve."+i+"'";var o=u.getResolvable(i),a=o&&o.data,s=a&&N.$injector.annotate(a)||[];return r+"='$resolve."+i+(E(a)?"["+(a.length-1)+"]":"")+"("+s.join(",")+")'"}).join(" "),n=d(e);return"<"+n+" "+t+"></"+n+">"},wi);function wi(){var r=this;this._useHttp=S.version.minor<3,this.$get=["$http","$templateCache","$injector",function(e,t,n){return r.$templateRequest=n.has&&n.has("$templateRequest")&&n.get("$templateRequest"),r.$http=e,r.$templateCache=t,r}]}var bi=function(e){return A(e.bindToController)?$i(e.bindToController):$i(e.scope)},$i=function(t){return Object.keys(t||{}).map(function(e){return[e,/^([=<@&])[?]?(.*)/.exec(t[e])]}).filter(function(e){return k(e)&&E(e[1])}).map(function(e){return{name:e[1][2]||e[0],type:e[1][1]}})},_i=(Si.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},Si.prototype.state=function(e,t){return A(e)?t=e:t.name=e,this.stateRegistry.register(t),this},Si.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},Si);function Si(e,t){this.stateRegistry=e,this.stateService=t,G(f(Si.prototype),this,f(this))}function Ci(t){return function(e){var i=e[t],o="onExit"===t?"from":"to";return i?function(e,t){var n=new Wt(e.treeChanges(o)).subContext(t.$$state()),r=q(Ui(n),{$state$:t,$transition$:e});return N.$injector.invoke(i,this,r)}:void 0}}var ki=(Di.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,function(e){return{"~":"~~","/":"~2F"}[e]}):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,function(e){return{"~~":"~","~2F":"/"}[e]}):e}},Di.prototype.dispose=function(){},Di.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return X(t._urlListeners)(e)}},Di.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=A(e)?e.enabled:e)&&this.$sniffer.history},Di.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},Di.prototype.url=function(e,t,n){return void 0===t&&(t=!1),k(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},Di.prototype._runtimeServices=function(e,t,n,r,i){var o=this;this.$location=t,this.$sniffer=n,this.$browser=r,this.$window=i,e.$on("$locationChangeSuccess",function(t){return o._urlListeners.forEach(function(e){return e(t)})});var a=f(t);G(a,this,a,["replace","path","search","hash"]),G(a,this,a,["port","protocol","host"])},Di);function Di(e){this._urlListeners=[],this.$locationProvider=e;var t=f(e);G(t,this,t,["hashPrefix"])}var xi=(Oi.injectableHandler=function(t,n){return function(e){return N.$injector.invoke(n,null,{$match:e,$stateParams:t.globals.params})}},Oi.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},Oi.prototype.rule=function(e){var t=this;if(!x(e))throw new Error("'rule' must be a function");var n=new Yn(function(){return e(N.$injector,t.router.locationService)},B);return this.router.urlService.rules.rule(n),this},Oi.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if(T(e))n.otherwise(e);else{if(!x(e))throw new Error("'rule' must be a string or function");n.otherwise(function(){return e(N.$injector,t.router.locationService)})}return this},Oi.prototype.when=function(e,t){return(E(t)||x(t))&&(t=Oi.injectableHandler(this.router,t)),this.router.urlService.rules.when(e,t),this},Oi.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},Oi);function Oi(e){this.router=e}S.module("ui.router.angular1",[]);var Ti=S.module("ui.router.init",["ng"]),Ai=S.module("ui.router.util",["ui.router.init"]),Ei=S.module("ui.router.router",["ui.router.util"]),Pi=S.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),Mi=S.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),Ri=(S.module("ui.router.compat",["ui.router"]),null);function Ii(e){(Ri=this.router=new or).stateProvider=new _i(Ri.stateRegistry,Ri.stateService),Ri.stateRegistry.decorator("views",fi),Ri.stateRegistry.decorator("onExit",Ci("onExit")),Ri.stateRegistry.decorator("onRetain",Ci("onRetain")),Ri.stateRegistry.decorator("onEnter",Ci("onEnter")),Ri.viewService._pluginapi._viewConfigFactory("ng1",pi());var s=Ri.locationService=Ri.locationConfig=new ki(e);function t(e,t,n,r,i,o,a){return s._runtimeServices(i,e,r,t,n),delete Ri.router,delete Ri.$get,Ri}return ki.monkeyPatchPathParameterType(Ri),((Ri.router=Ri).$get=t).$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],Ri}Ii.$inject=["$locationProvider"];function Vi(n){return["$uiRouterProvider",function(e){var t=e.router[n];return t.$get=function(){return t},t}]}function Ni(t,e,n){if(N.$injector=t,N.$q=e,!t.hasOwnProperty("strictDi"))try{t.invoke(function(e){})}catch(e){t.strictDi=!!/strict mode/.exec(e&&e.toString())}n.stateRegistry.get().map(function(e){return e.$$state().resolvables}).reduce(me,[]).filter(function(e){return"deferred"===e.deps}).forEach(function(e){return e.deps=t.annotate(e.resolveFn,t.strictDi)})}Ni.$inject=["$injector","$q","$uiRouter"];function Li(e){e.$watch(function(){yt.approximateDigests++})}Li.$inject=["$rootScope"],Ti.provider("$uiRouter",Ii),Ei.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new xi(e)}]),Ai.provider("$urlService",Vi("urlService")),Ai.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return Ri.urlMatcherFactory}]),Ai.provider("$templateFactory",function(){return new yi}),Pi.provider("$stateRegistry",Vi("stateRegistry")),Pi.provider("$uiRouterGlobals",Vi("globals")),Pi.provider("$transitions",Vi("transitionService")),Pi.provider("$state",["$uiRouterProvider",function(){return q(Ri.stateProvider,{$get:function(){return Ri.stateService}})}]),Pi.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),Mi.factory("$view",function(){return Ri.viewService}),Mi.service("$trace",function(){return yt}),Mi.run(Li),Ai.run(["$urlMatcherFactory",function(e){}]),Pi.run(["$state",function(e){}]),Ei.run(["$urlRouter",function(e){}]),Ti.run(Ni);var Fi,ji,Yi,Hi,Ui=function(n){return n.getTokens().filter(T).map(function(e){var t=n.getResolvable(e);return[e,"NOWAIT"===n.getPolicy(t).async?t.promise:t.data]}).reduce(xe,{})};function qi(e){var t,n=e.match(/^\s*({[^}]*})\s*$/);if(n&&(e="("+n[1]+")"),!(t=e.replace(/\n/g," ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/))||4!==t.length)throw new Error("Invalid state ref '"+e+"'");return{state:t[1]||null,paramExpr:t[3]||null}}function zi(e){var t=e.parent().inheritedData("$uiView"),n=C("$cfg.path")(t);return n?Oe(n).state.name:void 0}function Bi(e,t,n){var r,i=n.uiState||e.current.name,o=q((r=e,{relative:zi(t)||r.$current,inherit:!0,source:"sref"}),n.uiStateOpts||{}),a=e.href(i,n.uiStateParams,o);return{uiState:i,uiStateParams:n.uiStateParams,uiStateOpts:o,href:a}}function Wi(e){var t="[object SVGAnimatedString]"===Object.prototype.toString.call(e.prop("href")),n="FORM"===e[0].nodeName;return{attr:n?"action":t?"xlink:href":"href",isAnchor:"A"===e.prop("tagName").toUpperCase(),clickable:!n}}function Gi(o,a,s,l,u){return function(e){var t,n,r=e.which||e.button,i=u();1<r||e.ctrlKey||e.metaKey||e.shiftKey||o.attr("target")||(t=s(function(){o.attr("disabled")||a.go(i.uiState,i.uiStateParams,i.uiStateOpts)}),e.preventDefault(),n=l.isAnchor&&!i.href?1:0,e.preventDefault=function(){n--<=0&&s.cancel(t)})}}function Ki(i,e,o,t){var a;t&&(a=t.events),E(a)||(a=["click"]);for(var n=i.on?"on":"bind",r=0,s=a;r<s.length;r++){var l=s[r];i[n](l,o)}e.$on("$destroy",function(){for(var e=i.off?"off":"unbind",t=0,n=a;t<n.length;t++){var r=n[t];i[e](r,o)}})}function Qi(r){function e(e,t,n){return r.is(e,t,n)}return e.$stateful=!0,e}function Zi(r){function e(e,t,n){return r.includes(e,t,n)}return e.$stateful=!0,e}function Xi(g,m,v,e,y,t){var w=C("viewDecl.controllerAs"),b=C("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(e){var f=e.html();return e.empty(),function(t,n){var e=n.data("$uiView");if(!e)return n.html(f),void g(n.contents())(t);var r=e.$cfg||{viewDecl:{},getTemplate:W},i=r.path&&new Wt(r.path);n.html(r.getTemplate(n,i)||f),yt.traceUIViewFill(e.$uiView,n.html());var o,a,s,l,u=g(n.contents()),c=r.controller,d=w(r),p=b(r),h=i&&Ui(i);t[p]=h,c&&(o=m(c,q({},h,{$scope:t,$element:n})),d&&(t[d]=o,t[d][p]=h),n.data("$ngControllerController",o),n.children().data("$ngControllerController",o),to(y,v,o,t,r)),T(r.component)&&(a=qe(r.component),s=new RegExp("^(x-|data-)?"+a+"$","i"),l=t.$watch(function(){var e=[].slice.call(n[0].children).filter(function(e){return e&&e.tagName&&s.exec(e.tagName)});return e&&S.element(e).data("$"+r.component+"Controller")},function(e){e&&(to(y,v,e,t,r),l())})),u(t)}}}}Fi=["$uiRouter","$timeout",function(p,h){var f=p.stateService;return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,t,n,r){function i(){return Bi(f,t,u)}var o,a=Wi(t),s=r[1]||r[0],l=null,u={},c=qi(n.uiSref);function d(){var e=i();l&&l(),s&&(l=s.$$addStateInfo(e.uiState,e.uiStateParams)),null!=e.href&&n.$set(a.attr,e.href)}u.uiState=c.state,u.uiStateOpts=n.uiSrefOpts?e.$eval(n.uiSrefOpts):{},c.paramExpr&&(e.$watch(c.paramExpr,function(e){u.uiStateParams=q({},e),d()},!0),u.uiStateParams=q({},e.$eval(c.paramExpr))),d(),e.$on("$destroy",p.stateRegistry.onStatesChanged(d)),e.$on("$destroy",p.transitionService.onSuccess({},d)),a.clickable&&(o=Gi(t,f,h,a,i),Ki(t,e,o,u.uiStateOpts))}}}],ji=["$uiRouter","$timeout",function(h,f){var g=h.stateService;return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,e,r,t){function i(){return Bi(g,e,u)}var o,a=Wi(e),s=t[1]||t[0],l=null,u={},c=["uiState","uiStateParams","uiStateOpts"],d=c.reduce(function(e,t){return e[t]=W,e},{});function p(){var e=i();l&&l(),s&&(l=s.$$addStateInfo(e.uiState,e.uiStateParams)),null!=e.href&&r.$set(a.attr,e.href)}c.forEach(function(t){u[t]=r[t]?n.$eval(r[t]):null,r.$observe(t,function(e){d[t](),d[t]=n.$watch(e,function(e){u[t]=e,p()},!0)})}),p(),n.$on("$destroy",h.stateRegistry.onStatesChanged(p)),n.$on("$destroy",h.transitionService.onSuccess({},p)),a.clickable&&(o=Gi(e,g,f,a,i),Ki(e,n,o,u.uiStateOpts))}}}],Yi=["$state","$stateParams","$interpolate","$uiRouter",function(f,e,g,m){return{restrict:"A",controller:["$scope","$element","$attrs",function(s,l,e){var r,t,n,i,u=[],c=g(e.uiSrefActiveEq||"",!1)(s);try{r=s.$eval(e.uiSrefActive)}catch(e){}function o(e){e.promise.then(h,W)}function a(){d(r)}function d(e){A(e)&&(u=[],U(e,function(e,t){function n(e,t){var n=qi(e);p(n.state,s.$eval(n.paramExpr),t)}T(e)?n(e,t):E(e)&&U(e,function(e){n(e,t)})}))}function p(e,t,n){var r={state:f.get(e,zi(l))||{name:e},params:t,activeClass:n};return u.push(r),function(){X(u)(r)}}function h(){function t(e){return e.split(/\s/).filter(B)}function e(e){return e.map(function(e){return e.activeClass}).map(t).reduce(me,[])}var n=e(u).concat(t(c)).reduce(we,[]),r=e(u.filter(function(e){return f.includes(e.state.name,e.params)})),i=!!u.filter(function(e){return f.is(e.state.name,e.params)}).length?t(c):[],o=r.concat(i).reduce(we,[]),a=n.filter(function(e){return!Q(o,e)});s.$evalAsync(function(){o.forEach(function(e){return l.addClass(e)}),a.forEach(function(e){return l.removeClass(e)})})}d(r=r||g(e.uiSrefActive||"",!1)(s)),this.$$addStateInfo=function(e,t){if(!(A(r)&&0<u.length)){var n=p(e,t,r);return h(),n}},s.$on("$destroy",(t=m.stateRegistry.onStatesChanged(a),n=m.transitionService.onStart({},o),i=s.$on("$stateChangeSuccess",h),function(){t(),n(),i()})),m.globals.transition&&o(m.globals.transition),h()}]}}],S.module("ui.router.state").directive("uiSref",Fi).directive("uiSrefActive",Yi).directive("uiSrefActiveEq",Yi).directive("uiState",ji),Qi.$inject=["$state"],Zi.$inject=["$state"],S.module("ui.router.state").filter("isState",Qi).filter("includedByState",Zi),Hi=["$view","$animate","$uiViewScroll","$interpolate","$q",function(i,o,y,w,b){var $={$cfg:{viewDecl:{$context:i._pluginapi._rootViewContext()}},$uiView:{}},_={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(e,t,v){return function(a,s,e){var l,u,c,d,t,p=e.onload||"",h=e.autoscroll,f={enter:function(e,t,n){2<S.version.minor?o.enter(e,null,t).then(n):o.enter(e,null,t,n)},leave:function(e,t){2<S.version.minor?o.leave(e).then(t):o.leave(e,t)}},n=s.inheritedData("$uiView")||$,g=w(e.uiView||e.name||"")(a)||"$default",m={$type:"ng1",id:_.count++,name:g,fqn:n.$uiView.fqn?n.$uiView.fqn+"."+g:g,config:null,configUpdated:function(e){if(e&&!(e instanceof mi))return;if(d===e)return;yt.traceUIViewConfigUpdated(m,e&&e.viewDecl&&e.viewDecl.$context),r(d=e)},get creationContext(){var e=C("$cfg.viewDecl.$context")(n),t=C("$uiView.creationContext")(n);return e||t}};function r(e){var t=a.$new(),n=b.defer(),r=b.defer(),i={$cfg:e,$uiView:m},o={$animEnter:n.promise,$animLeave:r.promise,$$animLeave:r};t.$emit("$viewContentLoading",g),u=v(t,function(e){var t;e.data("$uiViewAnim",o),e.data("$uiView",i),f.enter(e,s,function(){n.resolve(),c&&c.$emit("$viewContentAnimationEnded"),(k(h)&&!h||a.$eval(h))&&y(e)}),l&&(yt.traceUIViewEvent("Removing (previous) el",l.data("$uiView")),l.remove(),l=null),c&&(yt.traceUIViewEvent("Destroying scope",m),c.$destroy(),c=null),u&&(t=u.data("$uiViewAnim"),yt.traceUIViewEvent("Animate out",t),f.leave(u,function(){t.$$animLeave.resolve(),l=null}),l=u,u=null)}),(c=t).$emit("$viewContentLoaded",e||d),c.$eval(p)}yt.traceUIViewEvent("Linking",m),s.data("$uiView",{$uiView:m}),r(),t=i.registerUIView(m),a.$on("$destroy",function(){yt.traceUIViewEvent("Destroying/Unregistering",m),t()})}}};return _}],Xi.$inject=["$compile","$controller","$transitions","$view","$q","$timeout"];var Ji="function"==typeof S.module("ui.router").component,eo=0;function to(r,e,u,t,n){!x(u.$onInit)||(n.viewDecl.component||n.viewDecl.componentProvider)&&Ji||u.$onInit();var c,i,o,a,s,d=Oe(n.path).state.self,l={bind:u};x(u.uiOnParamsChanged)&&(c=new Wt(n.path).getResolvable("$transition$").data,t.$on("$destroy",e.onSuccess({},function(e){var n,r,t,i,o,a,s,l;e!==c&&-1===e.exiting().indexOf(d)&&(n=e.params("to"),r=e.params("from"),t=function(e){return e.paramSchema},i=e.treeChanges("to").map(t).reduce(me,[]),o=e.treeChanges("from").map(t).reduce(me,[]),(a=i.filter(function(e){var t=o.indexOf(e);return-1===t||!o[t].type.equals(n[e.id],r[e.id])})).length&&(s=a.map(function(e){return e.id}),l=ue(n,function(e,t){return-1!==s.indexOf(t)}),u.uiOnParamsChanged(l,e)))},l))),x(u.uiCanExit)&&(i=eo++,o="_uiCanExitIds",a=function(e){return!!e&&(e[o]&&!0===e[o][i]||a(e.redirectedFrom()))},s={exiting:d.name},t.$on("$destroy",e.onBefore(s,function(e){var t,n=e[o]=e[o]||{};return a(e)||(t=r.when(u.uiCanExit(e))).then(function(e){return n[i]=!1!==e}),t},l)))}S.module("ui.router.state").directive("uiView",Hi),S.module("ui.router.state").directive("uiView",Xi),S.module("ui.router.state").provider("$uiViewScroll",function(){var n=!1;this.useAnchorScroll=function(){n=!0},this.$get=["$anchorScroll","$timeout",function(e,t){return n?e:function(e){return t(function(){e[0].scrollIntoView()},0,!1)}}]});g.$injector=Lr,g.$q=Rr,g.BaseLocationServices=Hr,g.BaseUrlRule=Yn,g.BrowserLocationConfig=ri,g.Glob=Re,g.HashLocationService=Br,g.HookBuilder=Cn,g.MemoryLocationConfig=ni,g.MemoryLocationService=Qr,g.NATIVE_INJECTOR_TOKEN=Bt,g.Ng1ViewConfig=mi,g.Param=Dt,g.ParamFactory=In,g.ParamType=wt,g.ParamTypes=Ot,g.PathNode=Mt,g.PathUtils=Nt,g.PushStateLocationService=ei,g.Queue=Ne,g.RegisteredHook=$n,g.Rejection=je,g.Resolvable=Yt,g.ResolveContext=Wt,g.StateBuilder=on,g.StateMatcher=un,g.StateObject=sn,g.StateParams=Et,g.StateProvider=_i,g.StateQueueManager=dn,g.StateRegistry=gn,g.StateService=Ar,g.TargetState=It,g.Trace=mt,g.Transition=xn,g.TransitionEventType=Cr,g.TransitionHook=yn,g.TransitionService=Or,g.UIRouter=or,g.UIRouterGlobals=Bn,g.UIRouterPluginBase=ui,g.UrlConfig=Xn,g.UrlMatcher=Pn,g.UrlMatcherFactory=Nn,g.UrlRouter=Hn,g.UrlRouterProvider=xi,g.UrlRuleFactory=Fn,g.UrlRules=Qn,g.UrlService=er,g.ViewService=qn,g._extend=Ae,g._inArray=Z,g._pushTo=te,g._removeFrom=J,g.all=c,g.allTrueR=fe,g.ancestors=oe,g.and=i,g.any=p,g.anyTrueR=ge,g.applyPairs=xe,g.arrayTuples=De,g.assertFn=Ce,g.assertMap=Se,g.assertPredicate=_e,g.beforeAfterSubstr=Qe,g.buildUrl=jr,g.compose=n,g.copy=Te,g.core=di,g.createProxyFunctions=G,g.curry=l,g.default="ui.router",g.defaultResolvePolicy=jt,g.defaultTransOpts=xr,g.defaults=re,g.deregAll=ne,g.eq=o,g.equals=z,g.extend=q,g.filter=ue,g.find=ce,g.flatten=$e,g.flattenR=ve,g.fnToString=Be,g.forEach=U,g.fromJson=Y,g.functionToString=ze,g.getLocals=Ui,g.getNg1ViewConfigFactory=pi,g.getParams=Mr,g.hashLocationPlugin=ai,g.hostRegex=Je,g.identity=B,g.inArray=Q,g.inherit=K,g.invoke=a,g.is=h,g.isArray=E,g.isDate=P,g.isDefined=k,g.isFunction=x,g.isInjectable=R,g.isNull=b,g.isNullOrUndefined=D,g.isNumber=O,g.isObject=A,g.isPromise=V,g.isRegExp=M,g.isString=T,g.isUndefined=_,g.joinNeighborsR=it,g.kebobString=qe,g.keyValsToObjectR=Pr,g.locationPluginFactory=Yr,g.makeEvent=Sn,g.makeStub=I,g.map=pe,g.mapObj=de,g.matchState=bn,g.maxLength=He,g.memoryLocationPlugin=li,g.mergeR=ie,g.ng1ViewsBuilder=fi,g.noop=W,g.not=d,g.omit=se,g.or=s,g.padString=Ue,g.pairs=ke,g.parse=C,g.parseUrl=Fr,g.pattern=v,g.pick=ae,g.pipe=u,g.pluck=le,g.prop=w,g.propEq=m,g.pushR=ye,g.pushStateLocationPlugin=si,g.pushTo=ee,g.removeFrom=X,g.resolvablesBuilder=rn,g.resolvePolicies=Ft,g.root=F,g.services=N,g.servicesPlugin=oi,g.silenceUncaughtInPromise=Pe,g.silentRejection=Me,g.splitEqual=nt,g.splitHash=et,g.splitOnDelim=rt,g.splitQuery=tt,g.stringify=Ke,g.stripLastPathElement=Ze,g.tail=Oe,g.toJson=H,g.trace=yt,g.trimHashVal=Xe,g.uniqR=we,g.unnest=be,g.unnestR=me,g.val=f,g.values=he,g.watchDigests=Li,Object.defineProperty(g,"__esModule",{value:!0})}),function($,l){"use strict";var _=["ng","oc.lazyLoad"],S={},C=[],k=[],u=[],D=[],x=$.noop,O={},T=[];$.module("oc.lazyLoad",["ng"]).provider("$ocLazyLoad",["$controllerProvider","$provide","$compileProvider","$filterProvider","$injector","$animateProvider",function(e,t,n,r,i,o){function c(e,t,n){if(t){for(var r,i=[],o=t.length-1;0<=o;o--)if(r=t[o],$.isString(r)||(r=h(r)),r&&-1===T.indexOf(r)&&(!f[r]||-1!==u.indexOf(r))){var a=-1===_.indexOf(r),s=E(r);if(a&&(_.push(r),c(e,s.requires,n)),0<s._runBlocks.length)for(O[r]=[];0<s._runBlocks.length;)O[r].push(s._runBlocks.shift());$.isDefined(O[r])&&(a||n.rerun)&&(i=i.concat(O[r])),d(e,s._invokeQueue,r,n.reconfig),d(e,s._configBlocks,r,n.reconfig),x(a?"ocLazyLoad.moduleLoaded":"ocLazyLoad.moduleReloaded",r),t.pop(),T.push(r)}var l=e.getInstanceInjector();$.forEach(i,function(e){l.invoke(e)})}}function p(e,a){function s(e){return $.isArray(e)?b(e.toString()):$.isObject(e)?b(w(e)):$.isDefined(e)&&null!==e?b(e.toString()):e}var n=e[2][0],l=e[1],u=!1;$.isUndefined(S[a])&&(S[a]={}),$.isUndefined(S[a][l])&&(S[a][l]={});function r(e,t){var n,r,i,o;S[a][l].hasOwnProperty(e)||(S[a][l][e]=[]),n=t,r=S[a][l][e],o=!0,r.length&&(i=s(n),$.forEach(r,function(e){o=o&&s(e)!==i})),o&&(u=!0,S[a][l][e].push(t),x("ocLazyLoad.componentLoaded",[a,l,e]))}if($.isString(n))r(n,e[2][1]);else{if(!$.isObject(n))return!1;$.forEach(n,function(e,t){$.isString(e)?r(e,n[1]):r(t,e)})}return u}function d(e,t,n,r){if(t)for(var i,o,a=0,s=t.length;a<s;a++)if(i=t[a],$.isArray(i)){if(null!==e){if(!e.hasOwnProperty(i[0]))throw new Error("unsupported provider "+i[0]);o=e[i[0]]}var l=p(i,n);if("invoke"!==i[1])l&&$.isDefined(o)&&o[i[1]].apply(o,i[2]);else{var u=function(e){var t=C.indexOf(n+"-"+e);-1!==t&&!r||(-1===t&&C.push(n+"-"+e),$.isDefined(o)&&o[i[1]].apply(o,i[2]))};if($.isFunction(i[2][0]))u(i[2][0]);else if($.isArray(i[2][0]))for(var c=0,d=i[2][0].length;c<d;c++)$.isFunction(i[2][0][c])&&u(i[2][0][c])}}}function h(e){var t=null;return $.isString(e)?t=e:$.isObject(e)&&e.hasOwnProperty("name")&&$.isString(e.name)&&(t=e.name),t}function a(e){if(!$.isString(e))return!1;try{return E(e)}catch(e){if(/No module/.test(e)||-1<e.message.indexOf("$injector:nomod"))return!1}}var f={},s={$controllerProvider:e,$compileProvider:n,$filterProvider:r,$provide:t,$injector:i,$animateProvider:o},g=!1,m=!1,v=[],y={};v.push=function(e){-1===this.indexOf(e)&&Array.prototype.push.apply(this,arguments)},this.config=function(e){$.isDefined(e.modules)&&($.isArray(e.modules)?$.forEach(e.modules,function(e){f[e.name]=e}):f[e.modules.name]=e.modules),$.isDefined(e.debug)&&(g=e.debug),$.isDefined(e.events)&&(m=e.events)},this._init=function(r){var t,i,o,n;0===k.length&&(t=[r],i=["ng:app","ng-app","x-ng-app","data-ng-app"],o=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/,n=function(e){return e&&t.push(e)},$.forEach(i,function(e){i[e]=!0,n(document.getElementById(e)),e=e.replace(":","\\:"),void 0!==r[0]&&r[0].querySelectorAll&&($.forEach(r[0].querySelectorAll("."+e),n),$.forEach(r[0].querySelectorAll("."+e+"\\:"),n),$.forEach(r[0].querySelectorAll("["+e+"]"),n))}),$.forEach(t,function(e){var t,n;0===k.length&&(t=" "+r.className+" ",(n=o.exec(t))?k.push((n[2]||"").replace(/\s+/g,",")):$.forEach(e.attributes,function(e){0===k.length&&i[e.name]&&k.push(e.value)}))})),0!==k.length||(l.jasmine||l.mocha)&&$.isDefined($.mock)||console.error("No module found during bootstrap, unable to init ocLazyLoad. You should always use the ng-app directive or angular.boostrap when you use ocLazyLoad.");$.forEach(k,function(e){!function e(t){var n;-1===_.indexOf(t)&&(_.push(t),d(null,(n=$.module(t))._invokeQueue,t),d(null,n._configBlocks,t),$.forEach(n.requires,e))}(e)}),k=[],D.pop()};var w=function(t){try{return JSON.stringify(t)}catch(e){var n=[];return JSON.stringify(t,function(e,t){if($.isObject(t)&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t})}},b=function(e){var t,n,r=0;if(0==e.length)return r;for(t=0,n=e.length;t<n;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return r};this.$get=["$log","$rootElement","$rootScope","$cacheFactory","$q",function(n,e,r,t,l){function u(e){var t=l.defer();return n.error(e.message),t.reject(e),t.promise}var i,o=t("ocLazyLoad");return g||((n={}).error=$.noop,n.warn=$.noop,n.info=$.noop),s.getInstanceInjector=function(){return i||(i=e.data("$injector")||$.injector())},{_broadcast:x=function(e,t){m&&r.$broadcast(e,t),g&&n.info(e,t)},_$log:n,_getFilesCache:function(){return o},toggleWatch:function(e){e?D.push(!0):D.pop()},getModuleConfig:function(e){if(!$.isString(e))throw new Error("You need to give the name of the module to get");return f[e]?$.copy(f[e]):null},setModuleConfig:function(e){if(!$.isObject(e))throw new Error("You need to give the module config object to set");return f[e.name]=e},getModules:function(){return _},isLoaded:function(e){var t;if($.isString(e)&&(e=[e]),$.isArray(e)){for(var n=0,r=e.length;n<r;n++)if(t=e[n],!(-1<_.indexOf(t)||a(t)))return!1;return!0}throw new Error("You need to define the module(s) name(s)")},_getModuleName:h,_getModule:function(t){try{return E(t)}catch(e){throw(/No module/.test(e)||-1<e.message.indexOf("$injector:nomod"))&&(e.message='The module "'+w(t)+'" that you are trying to load does not exist. '+e.message),e}},moduleExists:a,_loadDependencies:function(r,i){var e,t,o,a=[],s=this;if(null===(r=s._getModuleName(r)))return l.when();try{e=s._getModule(r)}catch(e){return u(e)}return t=s.getRequires(e),$.forEach(t,function(t){if($.isString(t)){var e=s.getModuleConfig(t);if(null===e)return void v.push(t);(t=e).name=void 0}if(s.moduleExists(t.name))return 0!==(o=t.files.filter(function(e){return s.getModuleConfig(t.name).files.indexOf(e)<0})).length&&s._$log.warn('Module "',r,'" attempted to redefine configuration for dependency. "',t.name,'"\n Additional Files Loaded:',o),$.isDefined(s.filesLoader)?void a.push(s.filesLoader(t,i).then(function(){return s._loadDependencies(t)})):u(new Error("Error: New dependencies need to be loaded from external files ("+t.files+"), but no loader has been defined."));var n;if($.isArray(t)?(n=[],$.forEach(t,function(e){var t=s.getModuleConfig(e);null===t?n.push(e):t.files&&(n=n.concat(t.files))}),0<n.length&&(t={files:n})):$.isObject(t)&&t.hasOwnProperty("name")&&t.name&&(s.setModuleConfig(t),v.push(t.name)),$.isDefined(t.files)&&0!==t.files.length){if(!$.isDefined(s.filesLoader))return u(new Error('Error: the module "'+t.name+'" is defined in external files ('+t.files+"), but no loader has been defined."));a.push(s.filesLoader(t,i).then(function(){return s._loadDependencies(t)}))}}),l.all(a)},inject:function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],t=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],r=this,i=l.defer();if($.isDefined(e)&&null!==e){if($.isArray(e)){var o=[];return $.forEach(e,function(e){o.push(r.inject(e,n,t))}),l.all(o)}r._addToLoadList(r._getModuleName(e),!0,t)}if(0<k.length){var a=k.slice();!function e(t){v.push(t),y[t]=i.promise,r._loadDependencies(t,n).then(function(){try{T=[],c(s,v,n)}catch(e){return r._$log.error(e.message),void i.reject(e)}0<k.length?e(k.shift()):i.resolve(a)},function(e){i.reject(e)})}(k.shift())}else{if(n&&n.name&&y[n.name])return y[n.name];i.resolve()}return i.promise},getRequires:function(e){var t=[];return $.forEach(e.requires,function(e){-1===_.indexOf(e)&&t.push(e)}),t},_invokeQueue:d,_registerInvokeList:p,_register:c,_addToLoadList:A,_unregister:function(e){$.isDefined(e)&&$.isArray(e)&&$.forEach(e,function(e){S[e]=void 0})}}}],this._init($.element(l.document))}]);var r=$.bootstrap;$.bootstrap=function(e,t,n){return _=["ng","oc.lazyLoad"],S={},C=[],k=[],u=[],D=[],x=$.noop,O={},T=[],$.forEach(t.slice(),function(e){A(e,!0,!0)}),r(e,t,n)};var A=function(e,t,n){(0<D.length||t)&&$.isString(e)&&-1===k.indexOf(e)&&(k.push(e),n&&u.push(e))},E=$.module;$.module=function(e,t,n){return A(e,!1,!0),E(e,t,n)},"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="oc.lazyLoad")}(angular,window),function(u){"use strict";u.module("oc.lazyLoad").directive("ocLazyLoad",["$ocLazyLoad","$compile","$animate","$parse","$timeout",function(o,a,s,l,e){return{restrict:"A",terminal:!0,priority:1e3,compile:function(e,t){var i=e[0].innerHTML;return e.html(""),function(t,n,e){var r=l(e.ocLazyLoad);t.$watch(function(){return r(t)||e.ocLazyLoad},function(e){u.isDefined(e)&&o.load(e).then(function(){s.enter(i,n),a(n.contents())(t)})},!0)}}}}])}(angular),function(S){"use strict";S.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q","$window","$interval",function(v,y,w,b){var $=!1,_=w.document.getElementsByTagName("head")[0]||w.document.getElementsByTagName("body")[0];return v.buildElement=function(e,t,n){function r(e){var t=(new Date).getTime();return 0<=e.indexOf("?")?"&"===e.substring(0,e.length-1)?e+"_dc="+t:e+"&_dc="+t:e+"?_dc="+t}var i,o,a=y.defer(),s=v._getFilesCache();switch(S.isUndefined(s.get(t))&&s.put(t,a.promise),e){case"css":(i=w.document.createElement("link")).type="text/css",i.rel="stylesheet",i.href=!1===n.cache?r(t):t;break;case"js":(i=w.document.createElement("script")).src=!1===n.cache?r(t):t;break;default:s.remove(t),a.reject(new Error('Requested type "'+e+'" is not known. Could not inject "'+t+'"'))}i.onload=i.onreadystatechange=function(e){i.readyState&&!/^c|loade/.test(i.readyState)||o||(i.onload=i.onreadystatechange=null,o=1,v._broadcast("ocLazyLoad.fileLoaded",t),a.resolve(i))},i.onerror=function(){s.remove(t),a.reject(new Error("Unable to load "+t))},i.async=n.serie?0:1;var l,u,c,d,p,h,f,g,m=_.lastChild;return!n.insertBefore||(l=S.element(S.isDefined(window.jQuery)?n.insertBefore:document.querySelector(n.insertBefore)))&&0<l.length&&(m=l[0]),m.parentNode.insertBefore(i,m),"css"==e&&(-1<(u=w.navigator.userAgent.toLowerCase()).indexOf("phantomjs/1.9")?$=!0:/iP(hone|od|ad)/.test(w.navigator.platform)?(c=w.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),d=parseFloat([parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3]||0,10)].join(".")),$=d<6):-1<u.indexOf("android")?(p=parseFloat(u.slice(u.indexOf("android")+8)),$=p<4.4):-1<u.indexOf("safari")&&(h=u.match(/version\/([\.\d]+)/i),$=h&&h[1]&&parseFloat(h[1])<6),$&&(f=1e3,g=b(function(){try{i.sheet.cssRules,b.cancel(g),i.onload()}catch(e){--f<=0&&i.onerror()}},20))),a.promise},v}])}])}(angular),function(m){"use strict";m.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(f,g){return f.filesLoader=function(e){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=[],o=[],a=[],s=[],l=null,u=f._getFilesCache();f.toggleWatch(!0),m.extend(r,e);function t(e){var t,n=null;if(m.isObject(e)&&(n=e.type,e=e.path),l=u.get(e),m.isUndefined(l)||!1===r.cache){if(null!==(t=/^(css|less|html|htm|js)?(?=!)/.exec(e))&&(n=t[1],e=e.substr(t[1].length+1,e.length)),!n)if(null!==(t=/[.](css|less|html|htm|js)?((\?|#).*)?$/.exec(e)))n=t[1];else{if(f.jsLoader.hasOwnProperty("ocLazyLoadLoader")||!f.jsLoader.hasOwnProperty("requirejs"))return void f._$log.error("File type could not be determined. "+e);n="js"}"css"!==n&&"less"!==n||-1!==i.indexOf(e)?"html"!==n&&"htm"!==n||-1!==o.indexOf(e)?"js"===n||-1===a.indexOf(e)?a.push(e):f._$log.error("File type is not valid. "+e):o.push(e):i.push(e)}else l&&s.push(l)}var n,c,d;if(r.serie?t(r.files.shift()):m.forEach(r.files,function(e){t(e)}),0<i.length&&(n=g.defer(),f.cssLoader(i,function(e){m.isDefined(e)&&f.cssLoader.hasOwnProperty("ocLazyLoadLoader")?(f._$log.error(e),n.reject(e)):n.resolve()},r),s.push(n.promise)),0<o.length&&(c=g.defer(),f.templatesLoader(o,function(e){m.isDefined(e)&&f.templatesLoader.hasOwnProperty("ocLazyLoadLoader")?(f._$log.error(e),c.reject(e)):c.resolve()},r),s.push(c.promise)),0<a.length&&(d=g.defer(),f.jsLoader(a,function(e){m.isDefined(e)&&(f.jsLoader.hasOwnProperty("ocLazyLoadLoader")||f.jsLoader.hasOwnProperty("requirejs"))?(f._$log.error(e),d.reject(e)):d.resolve()},r),s.push(d.promise)),0!==s.length)return r.serie&&0<r.files.length?g.all(s).then(function(){return f.filesLoader(e,r)}):g.all(s).finally(function(e){return f.toggleWatch(!1),e});var p=g.defer(),h="Error: no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load'.";return f._$log.error(h),p.reject(h),p.promise},f.load=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=this,r=null,i=[],o=g.defer(),a=m.copy(e),s=m.copy(t);if(m.isArray(a))return m.forEach(a,function(e){i.push(n.load(e,s))}),g.all(i).then(function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise;if(m.isString(a)?r=(r=n.getModuleConfig(a))||{files:[a]}:m.isObject(a)&&(r=m.isDefined(a.path)&&m.isDefined(a.type)?{files:[a]}:n.setModuleConfig(a)),null===r){var l='Module "'+(n._getModuleName(a)||"unknown")+'" is not configured, cannot load.';return f._$log.error(l),o.reject(new Error(l)),o.promise}m.isDefined(r.template)&&(m.isUndefined(r.files)&&(r.files=[]),m.isString(r.template)?r.files.push(r.template):m.isArray(r.template)&&r.files.concat(r.template));var u=m.extend({},s,r);return m.isUndefined(r.files)&&m.isDefined(r.name)&&f.moduleExists(r.name)?f.inject(r.name,u,!0):(f.filesLoader(r,u).then(function(){f.inject(null,u).then(function(e){o.resolve(e)},function(e){o.reject(e)})},function(e){o.reject(e)}),o.promise)},f}])}])}(angular),function(a){"use strict";a.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(i,o){return i.cssLoader=function(e,t,n){var r=[];a.forEach(e,function(e){r.push(i.buildElement("css",e,n))}),o.all(r).then(function(){t()},function(e){t(e)})},i.cssLoader.ocLazyLoadLoader=!0,i}])}])}(angular),function(a){"use strict";a.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(i,o){return i.jsLoader=function(e,t,n){var r=[];a.forEach(e,function(e){r.push(i.buildElement("js",e,n))}),o.all(r).then(function(){t()},function(e){t(e)})},i.jsLoader.ocLazyLoadLoader=!0,i}])}])}(angular),function(c){"use strict";c.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$templateCache","$q","$http",function(n,s,l,u){return n.templatesLoader=function(e,t,i){var o=[],a=n._getFilesCache();return c.forEach(e,function(n){var r=l.defer();o.push(r.promise),u.get(n,i).then(function(e){var t=e.data;c.isString(t)&&0<t.length&&c.forEach(c.element(t),function(e){"SCRIPT"===e.nodeName&&"text/ng-template"===e.type&&s.put(e.id,e.innerHTML)}),c.isUndefined(a.get(n))&&a.put(n,!0),r.resolve()}).catch(function(e){r.reject(new Error('Unable to load template file "'+n+'": '+e.data))})}),l.all(o).then(function(){t()},function(e){t(e)})},n.templatesLoader.ocLazyLoadLoader=!0,n}])}])}(angular),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n;if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),i=r.length>>>0;if(0==i)return-1;var o=+t||0;if(Math.abs(o)===1/0&&(o=0),i<=o)return-1;for(n=Math.max(0<=o?o:i-Math.abs(o),0);n<i;){if(n in r&&r[n]===e)return n;n++}return-1}),function(){"use strict";angular.module("angular-loading-bar",["cfp.loadingBarInterceptor"]),angular.module("chieffancypants.loadingBar",["cfp.loadingBarInterceptor"]),angular.module("cfp.loadingBarInterceptor",["cfp.loadingBar"]).config(["$httpProvider",function(h){var e=["$q","$cacheFactory","$timeout","$rootScope","$log","cfpLoadingBar",function(t,o,n,r,i,a){function s(){n.cancel(u),a.complete(),c=d=0}function l(e){var t,n=o.get("$http"),r=h.defaults;!e.cache&&!r.cache||!1===e.cache||"GET"!==e.method&&"JSONP"!==e.method||(t=angular.isObject(e.cache)?e.cache:angular.isObject(r.cache)?r.cache:n);var i=void 0!==t&&void 0!==t.get(e.url);return void 0!==e.cached&&i!==e.cached?e.cached:e.cached=i}var u,c=0,d=0,p=a.latencyThreshold;return{request:function(e){return e.ignoreLoadingBar||l(e)||(r.$broadcast("cfpLoadingBar:loading",{url:e.url}),0===c&&(u=n(function(){a.start()},p)),c++,a.set(d/c)),e},response:function(e){return e&&e.config?e.config.ignoreLoadingBar||l(e.config)||(d++,r.$broadcast("cfpLoadingBar:loaded",{url:e.config.url,result:e}),c<=d?s():a.set(d/c)):i.error("Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),e},responseError:function(e){return e&&e.config?e.config.ignoreLoadingBar||l(e.config)||(d++,r.$broadcast("cfpLoadingBar:loaded",{url:e.config.url,result:e}),c<=d?s():a.set(d/c)):i.error("Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),t.reject(e)}}}];h.interceptors.push(e)}]),angular.module("cfp.loadingBar",[]).provider("cfpLoadingBar",function(){this.autoIncrement=!0,this.includeSpinner=!0,this.includeBar=!0,this.latencyThreshold=100,this.startSize=.02,this.parentSelector="body",this.spinnerTemplate='<div id="loading-bar-spinner"><div class="spinner-icon"></div></div>',this.loadingBarTemplate='<div id="loading-bar"><div class="bar"><div class="peg"></div></div></div>',this.$get=["$injector","$document","$timeout","$rootScope",function(i,o,a,s){function l(e){var t;g&&(t=100*e+"%",h.css("width",t),m=e,v&&(a.cancel(r),r=a(function(){n()},250)))}function n(){var e,t;1<=m||(t=0<=(e=m)&&e<.25?(3*Math.random()+3)/100:.25<=e&&e<.65?3*Math.random()/100:.65<=e&&e<.9?2*Math.random()/100:.9<=e&&e<.99?.005:0,l(m+t))}function e(){return m}function t(){m=0,g=!1}var u,r,c,d=this.parentSelector,p=angular.element(this.loadingBarTemplate),h=p.find("div").eq(0),f=angular.element(this.spinnerTemplate),g=!1,m=0,v=this.autoIncrement,y=this.includeSpinner,w=this.includeBar,b=this.startSize;return{start:function(){var e,t,n,r;u=u||i.get("$animate"),a.cancel(c),g||(t=(t=(e=o[0]).querySelector?e.querySelector(d):o.find(d)[0])||e.getElementsByTagName("body")[0],n=angular.element(t),r=t.lastChild&&angular.element(t.lastChild),s.$broadcast("cfpLoadingBar:started"),g=!0,w&&u.enter(p,n,r),y&&u.enter(f,n,p),l(b))},set:l,status:e,inc:n,complete:function(){u=u||i.get("$animate"),s.$broadcast("cfpLoadingBar:completed"),l(1),a.cancel(c),c=a(function(){var e=u.leave(p,t);e&&e.then&&e.then(t),u.leave(f)},500)},autoIncrement:this.autoIncrement,includeSpinner:this.includeSpinner,latencyThreshold:this.latencyThreshold,parentSelector:this.parentSelector,startSize:this.startSize}}]})}(),angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.transition","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(a,s,l){function e(e){for(var t in e)if(void 0!==n.style[t])return e[t]}var u=function(e,t,n){n=n||{};var r=a.defer(),i=u[n.animation?"animationEndEventName":"transitionEndEventName"],o=function(){l.$apply(function(){e.unbind(i,o),r.resolve(e)})};return i&&e.bind(i,o),s(function(){angular.isString(t)?e.addClass(t):angular.isFunction(t)?t(e):angular.isObject(t)&&e.css(t),i||r.resolve(e)}),r.promise.cancel=function(){i&&e.unbind(i,o),r.reject("Transition cancelled")},r.promise},n=document.createElement("trans");return u.transitionEndEventName=e({WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}),u.animationEndEventName=e({WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"}),u}]),angular.module("ui.bootstrap.collapse",["ui.bootstrap.transition"]).directive("collapse",["$transition",function(l){return{link:function(e,r,t){function n(e){function t(){a===n&&(a=void 0)}var n=l(r,e);return a&&a.cancel(),(a=n).then(t,t),n}function i(){r.removeClass("collapsing"),r.addClass("collapse in"),r.css({height:"auto"})}function o(){r.removeClass("collapsing"),r.addClass("collapse")}var a,s=!0;e.$watch(t.collapse,function(e){e?s?(s=!1,o(),r.css({height:0})):(r.css({height:r[0].scrollHeight+"px"}),r[0].offsetWidth,r.removeClass("collapse in").addClass("collapsing"),n({height:0}).then(o)):s?(s=!1,i()):(r.removeClass("collapse").addClass("collapsing"),n({height:r[0].scrollHeight+"px"}).then(i))})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(e,n,r){this.groups=[],this.closeOthers=function(t){(angular.isDefined(n.closeOthers)?e.$eval(n.closeOthers):r.closeOthers)&&angular.forEach(this.groups,function(e){e!==t&&(e.isOpen=!1)})},this.addGroup=function(e){var t=this;this.groups.push(e),e.$on("$destroy",function(){t.removeGroup(e)})},this.removeGroup=function(e){var t=this.groups.indexOf(e);-1!==t&&this.groups.splice(t,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(e){this.heading=e}},link:function(t,e,n,r){r.addGroup(t),t.$watch("isOpen",function(e){e&&r.closeOthers(t)}),t.toggleOpen=function(){t.isDisabled||(t.isOpen=!t.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(e,t,n,r,i){r.setHeading(i(e,function(){}))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(e,t,n,r){e.$watch(function(){return r[n.accordionTransclude]},function(e){e&&(t.html(""),t.append(e))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(e,t){e.closeable="close"in t,this.close=e.close}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}).directive("dismissOnTimeout",["$timeout",function(i){return{require:"alert",link:function(e,t,n,r){i(function(){r.close()},parseInt(n.dismissOnTimeout,10))}}}]),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(e,t,n){t.addClass("ng-binding").data("$binding",n.bindHtmlUnsafe),e.$watch(n.bindHtmlUnsafe,function(e){t.html(e||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(e){this.activeClass=e.activeClass||"active",this.toggleEvent=e.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(t,n,r,e){var i=e[0],o=e[1];o.$render=function(){n.toggleClass(i.activeClass,angular.equals(o.$modelValue,t.$eval(r.btnRadio)))},n.bind(i.toggleEvent,function(){var e=n.hasClass(i.activeClass);e&&!angular.isDefined(r.uncheckable)||t.$apply(function(){o.$setViewValue(e?null:t.$eval(r.btnRadio)),o.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(r,e,t,n){function i(){return o(t.btnCheckboxTrue,!0)}function o(e,t){var n=r.$eval(e);return angular.isDefined(n)?n:t}var a=n[0],s=n[1];s.$render=function(){e.toggleClass(a.activeClass,angular.equals(s.$modelValue,i()))},e.bind(a.toggleEvent,function(){r.$apply(function(){s.$setViewValue(e.hasClass(a.activeClass)?o(t.btnCheckboxFalse,!1):i()),s.$render()})})}}}),angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$interval","$transition",function(a,t,n,s){function l(){r();var e=+a.interval;!isNaN(e)&&0<e&&(o=n(i,e))}function r(){o&&(n.cancel(o),o=null)}function i(){var e=+a.interval;u&&!isNaN(e)&&0<e?a.next():a.pause()}var o,u,c=this,d=c.slides=a.slides=[],p=-1;c.currentSlide=null;var h=!1;c.select=a.select=function(n,r){function e(){var e,t;h||(c.currentSlide&&angular.isString(r)&&!a.noTransition&&n.$element?(n.$element.addClass(r),n.$element[0].offsetWidth,angular.forEach(d,function(e){angular.extend(e,{direction:"",entering:!1,leaving:!1,active:!1})}),angular.extend(n,{direction:r,active:!0,entering:!0}),angular.extend(c.currentSlide||{},{direction:r,leaving:!0}),a.$currentTransition=s(n.$element,{}),e=n,t=c.currentSlide,a.$currentTransition.then(function(){i(e,t)},function(){i(e,t)})):i(n,c.currentSlide),c.currentSlide=n,p=o,l())}function i(e,t){angular.extend(e,{direction:"",active:!0,leaving:!1,entering:!1}),angular.extend(t||{},{direction:"",active:!1,leaving:!1,entering:!1}),a.$currentTransition=null}var o=d.indexOf(n);void 0===r&&(r=p<o?"next":"prev"),n&&n!==c.currentSlide&&(a.$currentTransition?(a.$currentTransition.cancel(),t(e)):e())},a.$on("$destroy",function(){h=!0}),c.indexOfSlide=function(e){return d.indexOf(e)},a.next=function(){var e=(p+1)%d.length;return a.$currentTransition?void 0:c.select(d[e],"next")},a.prev=function(){var e=p-1<0?d.length-1:p-1;return a.$currentTransition?void 0:c.select(d[e],"prev")},a.isActive=function(e){return c.currentSlide===e},a.$watch("interval",l),a.$on("$destroy",r),a.play=function(){u||(u=!0,l())},a.pause=function(){a.noPause||(u=!1,r())},c.addSlide=function(e,t){e.$element=t,d.push(e),1===d.length||e.active?(c.select(d[d.length-1]),1==d.length&&a.play()):e.active=!1},c.removeSlide=function(e){var t=d.indexOf(e);d.splice(t,1),0<d.length&&e.active?c.select(t>=d.length?d[t-1]:d[t]):t<p&&p--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?"},link:function(t,e,n,r){r.addSlide(t,e),t.$on("$destroy",function(){r.removeSlide(t)}),t.$watch("active",function(e){e&&r.select(t)})}}}),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(v,y){this.parsers={};var w={yyyy:{regex:"\\d{4}",apply:function(e){this.year=+e}},yy:{regex:"\\d{2}",apply:function(e){this.year=+e+2e3}},y:{regex:"\\d{1,4}",apply:function(e){this.year=+e}},MMMM:{regex:v.DATETIME_FORMATS.MONTH.join("|"),apply:function(e){this.month=v.DATETIME_FORMATS.MONTH.indexOf(e)}},MMM:{regex:v.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(e){this.month=v.DATETIME_FORMATS.SHORTMONTH.indexOf(e)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(e){this.month=e-1}},M:{regex:"[1-9]|1[0-2]",apply:function(e){this.month=e-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(e){this.date=+e}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(e){this.date=+e}},EEEE:{regex:v.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:v.DATETIME_FORMATS.SHORTDAY.join("|")}};this.parse=function(e,t){if(!angular.isString(e)||!t)return e;var o,a,s;t=v.DATETIME_FORMATS[t]||t,this.parsers[t]||(this.parsers[t]=(a=[],s=(o=t).split(""),angular.forEach(w,function(e,t){var n=o.indexOf(t);if(-1<n){o=o.split(""),s[n]="("+e.regex+")",o[n]="$";for(var r=n+1,i=n+t.length;r<i;r++)s[r]="",o[r]="$";o=o.join(""),a.push({index:n,apply:e.apply})}}),{regex:new RegExp("^"+s.join("")+"$"),map:y(a,"index")}));var n,r,i,l=this.parsers[t],u=l.regex,c=l.map,d=e.match(u);if(d&&d.length){for(var p,h={year:1900,month:0,date:1,hours:0},f=1,g=d.length;f<g;f++){var m=c[f-1];m.apply&&m.apply.call(h,d[f])}return n=h.year,i=h.date,(1===(r=h.month)&&28<i?29===i&&(n%4==0&&n%100!=0||n%400==0):3!==r&&5!==r&&8!==r&&10!==r||i<31)&&(p=new Date(h.year,h.month,h.date,h.hours)),p}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(o,r){function a(e){return"static"===(n="position",((t=e).currentStyle?t.currentStyle[n]:r.getComputedStyle?r.getComputedStyle(t)[n]:t.style[n])||"static");var t,n}return{position:function(e){var t=this.offset(e),n={top:0,left:0},r=function(e){for(var t=o[0],n=e.offsetParent||t;n&&n!==t&&a(n);)n=n.offsetParent;return n||t}(e[0]);r!=o[0]&&((n=this.offset(angular.element(r))).top+=r.clientTop-r.scrollTop,n.left+=r.clientLeft-r.scrollLeft);var i=e[0].getBoundingClientRect();return{width:i.width||e.prop("offsetWidth"),height:i.height||e.prop("offsetHeight"),top:t.top-n.top,left:t.left-n.left}},offset:function(e){var t=e[0].getBoundingClientRect();return{width:t.width||e.prop("offsetWidth"),height:t.height||e.prop("offsetHeight"),top:t.top+(r.pageYOffset||o[0].documentElement.scrollTop),left:t.left+(r.pageXOffset||o[0].documentElement.scrollLeft)}},positionElements:function(e,t,n,r){var i,o=n.split("-"),a=o[0],s=o[1]||"center",l=r?this.offset(e):this.position(e),u=t.prop("offsetWidth"),c=t.prop("offsetHeight"),d={center:function(){return l.left+l.width/2-u/2},left:function(){return l.left},right:function(){return l.left+l.width}},p={center:function(){return l.top+l.height/2-c/2},top:function(){return l.top},bottom:function(){return l.top+l.height}};switch(a){case"right":i={top:p[s](),left:d[a]()};break;case"left":i={top:p[s](),left:l.left-u};break;case"bottom":i={top:p[a](),left:d[s]()};break;default:i={top:l.top-c,left:d[s]()}}return i}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(n,r,e,i,t,o,a,s){var l=this,u={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange"],function(e,t){l[e]=angular.isDefined(r[e])?t<8?i(r[e])(n.$parent):n.$parent.$eval(r[e]):s[e]}),angular.forEach(["minDate","maxDate"],function(t){r[t]?n.$parent.$watch(e(r[t]),function(e){l[t]=e?new Date(e):null,l.refreshView()}):l[t]=s[t]?new Date(s[t]):null}),n.datepickerMode=n.datepickerMode||s.datepickerMode,n.uniqueId="datepicker-"+n.$id+"-"+Math.floor(1e4*Math.random()),this.activeDate=angular.isDefined(r.initDate)?n.$parent.$eval(r.initDate):new Date,n.isActive=function(e){return 0===l.compare(e.date,l.activeDate)&&(n.activeDateId=e.uid,!0)},this.init=function(e){(u=e).$render=function(){l.render()}},this.render=function(){var e,t;u.$modelValue&&(e=new Date(u.$modelValue),(t=!isNaN(e))?this.activeDate=e:o.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),u.$setValidity("date",t)),this.refreshView()},this.refreshView=function(){var e;this.element&&(this._refreshView(),e=u.$modelValue?new Date(u.$modelValue):null,u.$setValidity("date-disabled",!e||this.element&&!this.isDisabled(e)))},this.createDateObject=function(e,t){var n=u.$modelValue?new Date(u.$modelValue):null;return{date:e,label:a(e,t),selected:n&&0===this.compare(e,n),disabled:this.isDisabled(e),current:0===this.compare(e,new Date)}},this.isDisabled=function(e){return this.minDate&&this.compare(e,this.minDate)<0||this.maxDate&&0<this.compare(e,this.maxDate)||r.dateDisabled&&n.dateDisabled({date:e,mode:n.datepickerMode})},this.split=function(e,t){for(var n=[];0<e.length;)n.push(e.splice(0,t));return n},n.select=function(e){var t;n.datepickerMode===l.minMode?((t=u.$modelValue?new Date(u.$modelValue):new Date(0,0,0,0,0,0,0)).setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),u.$setViewValue(t),u.$render()):(l.activeDate=e,n.datepickerMode=l.modes[l.modes.indexOf(n.datepickerMode)-1])},n.move=function(e){var t=l.activeDate.getFullYear()+e*(l.step.years||0),n=l.activeDate.getMonth()+e*(l.step.months||0);l.activeDate.setFullYear(t,n,1),l.refreshView()},n.toggleMode=function(e){e=e||1,n.datepickerMode===l.maxMode&&1===e||n.datepickerMode===l.minMode&&-1===e||(n.datepickerMode=l.modes[l.modes.indexOf(n.datepickerMode)+e])},n.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};function c(){t(function(){l.element[0].focus()},0,!1)}n.$on("datepicker.focus",c),n.keydown=function(e){var t=n.keys[e.which];if(t&&!e.shiftKey&&!e.altKey)if(e.preventDefault(),e.stopPropagation(),"enter"===t||"space"===t){if(l.isDisabled(l.activeDate))return;n.select(l.activeDate),c()}else!e.ctrlKey||"up"!==t&&"down"!==t?(l.handleKeyDown(t,e),l.refreshView()):(n.toggleMode("up"===t?1:-1),c())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(e,t,n,r){var i=r[0],o=r[1];o&&i.init(o)}}}).directive("daypicker",["dateFilter",function(h){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(d,e,t,p){function r(e,t){return 1!==t||e%4!=0||e%100==0&&e%400!=0?n[t]:29}d.showWeeks=p.showWeeks,p.step={months:1},p.element=e;var n=[31,28,31,30,31,30,31,31,30,31,30,31];p._refreshView=function(){var e=p.activeDate.getFullYear(),t=p.activeDate.getMonth(),n=new Date(e,t,1),r=p.startingDay-n.getDay(),i=0<r?7-r:-r,o=new Date(n);0<i&&o.setDate(1-i);for(var a=function(e,t){var n=new Array(t),r=new Date(e),i=0;for(r.setHours(12);i<t;)n[i++]=new Date(r),r.setDate(r.getDate()+1);return n}(o,42),s=0;s<42;s++)a[s]=angular.extend(p.createDateObject(a[s],p.formatDay),{secondary:a[s].getMonth()!==t,uid:d.uniqueId+"-"+s});d.labels=new Array(7);for(var l=0;l<7;l++)d.labels[l]={abbr:h(a[l].date,p.formatDayHeader),full:h(a[l].date,"EEEE")};if(d.title=h(p.activeDate,p.formatDayTitle),d.rows=p.split(a,7),d.showWeeks){d.weekNumbers=[];for(var u=function(e){var t=new Date(e);t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t)/864e5)/7)+1}(d.rows[0][0].date),c=d.rows.length;d.weekNumbers.push(u++)<c;);}},p.compare=function(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate())-new Date(t.getFullYear(),t.getMonth(),t.getDate())},p.handleKeyDown=function(e){var t,n=p.activeDate.getDate();"left"===e?--n:"up"===e?n-=7:"right"===e?n+=1:"down"===e?n+=7:"pageup"===e||"pagedown"===e?(t=p.activeDate.getMonth()+("pageup"===e?-1:1),p.activeDate.setMonth(t,1),n=Math.min(r(p.activeDate.getFullYear(),p.activeDate.getMonth()),n)):"home"===e?n=1:"end"===e&&(n=r(p.activeDate.getFullYear(),p.activeDate.getMonth())),p.activeDate.setDate(n)},p.refreshView()}}}]).directive("monthpicker",["dateFilter",function(o){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(r,e,t,i){i.step={years:1},i.element=e,i._refreshView=function(){for(var e=new Array(12),t=i.activeDate.getFullYear(),n=0;n<12;n++)e[n]=angular.extend(i.createDateObject(new Date(t,n,1),i.formatMonth),{uid:r.uniqueId+"-"+n});r.title=o(i.activeDate,i.formatMonthTitle),r.rows=i.split(e,3)},i.compare=function(e,t){return new Date(e.getFullYear(),e.getMonth())-new Date(t.getFullYear(),t.getMonth())},i.handleKeyDown=function(e){var t,n=i.activeDate.getMonth();"left"===e?--n:"up"===e?n-=3:"right"===e?n+=1:"down"===e?n+=3:"pageup"===e||"pagedown"===e?(t=i.activeDate.getFullYear()+("pageup"===e?-1:1),i.activeDate.setFullYear(t)):"home"===e?n=0:"end"===e&&(n=11),i.activeDate.setMonth(n)},i.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(r,e,t,i){function o(e){return parseInt((e-1)/a,10)*a+1}var a=i.yearRange;i.step={years:a},i.element=e,i._refreshView=function(){for(var e=new Array(a),t=0,n=o(i.activeDate.getFullYear());t<a;t++)e[t]=angular.extend(i.createDateObject(new Date(n+t,0,1),i.formatYear),{uid:r.uniqueId+"-"+t});r.title=[e[0].label,e[a-1].label].join(" - "),r.rows=i.split(e,5)},i.compare=function(e,t){return e.getFullYear()-t.getFullYear()},i.handleKeyDown=function(e){var t=i.activeDate.getFullYear();"left"===e?--t:"up"===e?t-=5:"right"===e?t+=1:"down"===e?t+=5:"pageup"===e||"pagedown"===e?t+=("pageup"===e?-1:1)*i.step.years:"home"===e?t=o(i.activeDate.getFullYear()):"end"===e&&(t=o(i.activeDate.getFullYear())+a-1),i.activeDate.setFullYear(t)},i.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(f,g,m,v,y,w,b){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&"},link:function(r,t,i,n){function o(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}function a(e){if(!e)return n.$setValidity("date",!0),null;if(angular.isDate(e)&&!isNaN(e))return n.$setValidity("date",!0),e;if(angular.isString(e)){var t=w.parse(e,s)||new Date(e);return isNaN(t)?void n.$setValidity("date",!1):(n.$setValidity("date",!0),t)}n.$setValidity("date",!1)}var s,l=angular.isDefined(i.closeOnDateSelection)?r.$parent.$eval(i.closeOnDateSelection):b.closeOnDateSelection,u=angular.isDefined(i.datepickerAppendToBody)?r.$parent.$eval(i.datepickerAppendToBody):b.appendToBody;r.showButtonBar=angular.isDefined(i.showButtonBar)?r.$parent.$eval(i.showButtonBar):b.showButtonBar,r.getText=function(e){return r[e+"Text"]||b[e+"Text"]},i.$observe("datepickerPopup",function(e){s=e||b.datepickerPopup,n.$render()});var e=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");e.attr({"ng-model":"date","ng-change":"dateSelection()"});var c=angular.element(e.children()[0]);i.datepickerOptions&&angular.forEach(r.$parent.$eval(i.datepickerOptions),function(e,t){c.attr(o(t),e)}),r.watchData={},angular.forEach(["minDate","maxDate","datepickerMode"],function(t){var e,n;i[t]&&(e=g(i[t]),r.$parent.$watch(e,function(e){r.watchData[t]=e}),c.attr(o(t),"watchData."+t),"datepickerMode"===t&&(n=e.assign,r.$watch("watchData."+t,function(e,t){e!==t&&n(r.$parent,e)})))}),i.dateDisabled&&c.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),n.$parsers.unshift(a),r.dateSelection=function(e){angular.isDefined(e)&&(r.date=e),n.$setViewValue(r.date),n.$render(),l&&(r.isOpen=!1,t[0].focus())},t.bind("input change keyup",function(){r.$apply(function(){r.date=n.$modelValue})}),n.$render=function(){var e=n.$viewValue?y(n.$viewValue,s):"";t.val(e),r.date=a(n.$modelValue)};function d(e){r.isOpen&&e.target!==t[0]&&r.$apply(function(){r.isOpen=!1})}function p(e){r.keydown(e)}t.bind("keydown",p),r.keydown=function(e){27===e.which?(e.preventDefault(),e.stopPropagation(),r.close()):40!==e.which||r.isOpen||(r.isOpen=!0)},r.$watch("isOpen",function(e){e?(r.$broadcast("datepicker.focus"),r.position=u?v.offset(t):v.position(t),r.position.top=r.position.top+t.prop("offsetHeight"),m.bind("click",d)):m.unbind("click",d)}),r.select=function(e){var t;"today"===e&&(t=new Date,angular.isDate(n.$modelValue)?(e=new Date(n.$modelValue)).setFullYear(t.getFullYear(),t.getMonth(),t.getDate()):e=new Date(t.setHours(0,0,0,0))),r.dateSelection(e)},r.close=function(){r.isOpen=!1,t[0].focus()};var h=f(e)(r);e.remove(),u?m.find("body").append(h):t.after(h),r.$on("$destroy",function(){h.remove(),t.unbind("keydown",p),m.unbind("click",d)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(e,t){t.bind("click",function(e){e.preventDefault(),e.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdown",[]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document",function(t){var n=null;this.open=function(e){n||(t.bind("click",r),t.bind("keydown",i)),n&&n!==e&&(n.isOpen=!1),n=e},this.close=function(e){n===e&&(n=null,t.unbind("click",r),t.unbind("keydown",i))};var r=function(e){var t;n&&(t=n.getToggleElement(),e&&t&&t[0].contains(e.target)||n.$apply(function(){n.isOpen=!1}))},i=function(e){27===e.which&&(n.focusToggleElement(),r())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate",function(n,t,r,e,i,o){var a,s=this,l=n.$new(),u=e.openClass,c=angular.noop,d=t.onToggle?r(t.onToggle):angular.noop;this.init=function(e){s.$element=e,t.isOpen&&(a=r(t.isOpen),c=a.assign,n.$watch(a,function(e){l.isOpen=!!e}))},this.toggle=function(e){return l.isOpen=arguments.length?!!e:!l.isOpen},this.isOpen=function(){return l.isOpen},l.getToggleElement=function(){return s.toggleElement},l.focusToggleElement=function(){s.toggleElement&&s.toggleElement[0].focus()},l.$watch("isOpen",function(e,t){o[e?"addClass":"removeClass"](s.$element,u),e?(l.focusToggleElement(),i.open(l)):i.close(l),c(n,e),angular.isDefined(e)&&e!==t&&d(n,{open:!!e})}),n.$on("$locationChangeSuccess",function(){l.isOpen=!1}),n.$on("$destroy",function(){l.$destroy()})}]).directive("dropdown",function(){return{controller:"DropdownController",link:function(e,t,n,r){r.init(t)}}}).directive("dropdownToggle",function(){return{require:"?^dropdown",link:function(t,n,r,i){var e;i&&(i.toggleElement=n,e=function(e){e.preventDefault(),n.hasClass("disabled")||r.disabled||t.$apply(function(){i.toggle()})},n.bind("click",e),n.attr({"aria-haspopup":!0,"aria-expanded":!1}),t.$watch(i.isOpen,function(e){n.attr("aria-expanded",!!e)}),t.$on("$destroy",function(){n.unbind("click",e)}))}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var r=[];return{add:function(e,t){r.push({key:e,value:t})},get:function(e){for(var t=0;t<r.length;t++)if(e==r[t].key)return r[t]},keys:function(){for(var e=[],t=0;t<r.length;t++)e.push(r[t].key);return e},top:function(){return r[r.length-1]},remove:function(e){for(var t=-1,n=0;n<r.length;n++)if(e==r[n].key){t=n;break}return r.splice(t,1)[0]},removeTop:function(){return r.splice(r.length-1,1)[0]},length:function(){return r.length}}}}}).directive("modalBackdrop",["$timeout",function(r){return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",link:function(e,t,n){e.backdropClass=n.backdropClass||"",e.animate=!1,r(function(){e.animate=!0})}}}]).directive("modalWindow",["$modalStack","$timeout",function(r,i){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(e,t){return t.templateUrl||"template/modal/window.html"},link:function(e,t,n){t.addClass(n.windowClass||""),e.size=n.size,i(function(){e.animate=!0,t[0].querySelectorAll("[autofocus]").length||t[0].focus()}),e.close=function(e){var t=r.getTop();t&&t.value.backdrop&&"static"!=t.value.backdrop&&e.target===e.currentTarget&&(e.preventDefault(),e.stopPropagation(),r.dismiss(t.key,"backdrop click"))}}}}]).directive("modalTransclude",function(){return{link:function(e,t,n,r,i){i(e.$parent,function(e){t.empty(),t.append(e)})}}}).factory("$modalStack",["$transition","$timeout","$document","$compile","$rootScope","$$stackedMap",function(s,l,u,c,d,e){function p(){for(var e=-1,t=m.keys(),n=0;n<t.length;n++)m.get(t[n]).value.backdrop&&(e=n);return e}function r(e){var t=u.find("body").eq(0),n=m.get(e).value;m.remove(e),i(n.modalDomEl,n.modalScope,300,function(){n.modalScope.$destroy(),t.toggleClass(g,0<m.length()),function(){{var e;h&&-1==p()&&(i(h,e=f,150,function(){e.$destroy(),e=null}),f=h=void 0)}}()})}function i(e,t,n,r){function i(){i.done||(i.done=!0,e.remove(),r&&r())}t.animate=!1;var o,a=s.transitionEndEventName;a?(o=l(i,n),e.bind(a,function(){l.cancel(o),i(),t.$apply()})):l(i)}var h,f,g="modal-open",m=e.createNew(),n={};return d.$watch(p,function(e){f&&(f.index=e)}),u.bind("keydown",function(e){var t;27!==e.which||(t=m.top())&&t.value.keyboard&&(e.preventDefault(),d.$apply(function(){n.dismiss(t.key,"escape key press")}))}),n.open=function(e,t){m.add(e,{deferred:t.deferred,modalScope:t.scope,backdrop:t.backdrop,keyboard:t.keyboard});var n,r=u.find("body").eq(0),i=p();0<=i&&!h&&((f=d.$new(!0)).index=i,(n=angular.element("<div modal-backdrop></div>")).attr("backdrop-class",t.backdropClass),h=c(n)(f),r.append(h));var o=angular.element("<div modal-window></div>");o.attr({"template-url":t.windowTemplateUrl,"window-class":t.windowClass,size:t.size,index:m.length()-1,animate:"animate"}).html(t.content);var a=c(o)(t.scope);m.top().value.modalDomEl=a,r.append(a),r.addClass(g)},n.close=function(e,t){var n=m.get(e);n&&(n.value.deferred.resolve(t),r(e))},n.dismiss=function(e,t){var n=m.get(e);n&&(n.value.deferred.reject(t),r(e))},n.dismissAll=function(e){for(var t=this.getTop();t;)this.dismiss(t.key,e),t=this.getTop()},n.getTop=function(){return m.top()},n}]).provider("$modal",function(){var g={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function(l,u,c,d,p,h,f){var e={};return e.open=function(o){var a=c.defer(),e=c.defer(),s={result:a.promise,opened:e.promise,close:function(e){f.close(s,e)},dismiss:function(e){f.dismiss(s,e)}};if((o=angular.extend({},g.options,o)).resolve=o.resolve||{},!o.template&&!o.templateUrl)throw new Error("One of template or templateUrl options is required.");var t,n,r,i=c.all([(r=o).template?c.when(r.template):d.get(angular.isFunction(r.templateUrl)?r.templateUrl():r.templateUrl,{cache:p}).then(function(e){return e.data})].concat((t=o.resolve,n=[],angular.forEach(t,function(e){(angular.isFunction(e)||angular.isArray(e))&&n.push(c.when(l.invoke(e)))}),n)));return i.then(function(n){var e=(o.scope||u).$new();e.$close=s.close,e.$dismiss=s.dismiss;var t,r={},i=1;o.controller&&(r.$scope=e,r.$modalInstance=s,angular.forEach(o.resolve,function(e,t){r[t]=n[i++]}),t=h(o.controller,r),o.controllerAs&&(e[o.controllerAs]=t)),f.open(s,{scope:e,deferred:a,content:n[0],backdrop:o.backdrop,keyboard:o.keyboard,backdropClass:o.backdropClass,windowClass:o.windowClass,windowTemplateUrl:o.windowTemplateUrl,size:o.size})},function(e){a.reject(e)}),i.then(function(){e.resolve(!0)},function(){e.reject(!1)}),s},e}]};return g}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(n,r,i){var o=this,a={$setViewValue:angular.noop},t=r.numPages?i(r.numPages).assign:angular.noop;this.init=function(e,t){a=e,this.config=t,a.$render=function(){o.render()},r.itemsPerPage?n.$parent.$watch(i(r.itemsPerPage),function(e){o.itemsPerPage=parseInt(e,10),n.totalPages=o.calculateTotalPages()}):this.itemsPerPage=t.itemsPerPage},this.calculateTotalPages=function(){var e=this.itemsPerPage<1?1:Math.ceil(n.totalItems/this.itemsPerPage);return Math.max(e||0,1)},this.render=function(){n.page=parseInt(a.$viewValue,10)||1},n.selectPage=function(e){n.page!==e&&0<e&&e<=n.totalPages&&(a.$setViewValue(e),a.$render())},n.getText=function(e){return n[e+"Text"]||o.config[e+"Text"]},n.noPrevious=function(){return 1===n.page},n.noNext=function(){return n.page===n.totalPages},n.$watch("totalItems",function(){n.totalPages=o.calculateTotalPages()}),n.$watch("totalPages",function(e){t(n.$parent,e),n.page>e?n.selectPage(e):a.$render()})}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(s,l){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(e,t,n,r){function c(e,t,n){return{number:e,text:t,active:n}}var d,p,i,o=r[0],a=r[1];a&&(d=angular.isDefined(n.maxSize)?e.$parent.$eval(n.maxSize):l.maxSize,p=angular.isDefined(n.rotate)?e.$parent.$eval(n.rotate):l.rotate,e.boundaryLinks=angular.isDefined(n.boundaryLinks)?e.$parent.$eval(n.boundaryLinks):l.boundaryLinks,e.directionLinks=angular.isDefined(n.directionLinks)?e.$parent.$eval(n.directionLinks):l.directionLinks,o.init(a,l),n.maxSize&&e.$parent.$watch(s(n.maxSize),function(e){d=parseInt(e,10),o.render()}),i=o.render,o.render=function(){i(),0<e.page&&e.page<=e.totalPages&&(e.pages=function(e,t){var n=[],r=1,i=t,o=angular.isDefined(d)&&d<t;o&&(p?t<(i=(r=Math.max(e-Math.floor(d/2),1))+d-1)&&(r=(i=t)-d+1):(r=(Math.ceil(e/d)-1)*d+1,i=Math.min(r+d-1,t)));for(var a,s,l=r;l<=i;l++){var u=c(l,l,l===e);n.push(u)}return o&&!p&&(1<r&&(a=c(r-1,"...",!1),n.unshift(a)),i<t&&(s=c(i+1,"...",!1),n.push(s))),n}(e.page,e.totalPages))})}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(e,t,n,r){var i=r[0],o=r[1];o&&(e.align=angular.isDefined(n.align)?e.$parent.$eval(n.align):a.align,i.init(o,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){var s={placement:"top",animation:!0,popupDelay:0},l={mouseenter:"mouseleave",click:"click",focus:"blur"},u={};this.options=function(e){angular.extend(u,e)},this.setTriggers=function(e){angular.extend(l,e)},this.$get=["$window","$compile","$timeout","$document","$position","$interpolate",function(e,o,x,O,T,a){return function(S,C,n){function k(e){var t=e||D.trigger||n;return{show:t,hide:l[t]||t}}var D=angular.extend({},s,u),e=S.replace(/[A-Z]/g,function(e,t){return(t?"-":"")+e.toLowerCase()}),t=a.startSymbol(),r=a.endSymbol(),i="<div "+e+'-popup title="'+t+"title"+r+'" content="'+t+"content"+r+'" placement="'+t+"placement"+r+'" animation="animation" is-open="isOpen"></div>';return{restrict:"EA",compile:function(){var _=o(i);return function(e,t,n){function r(){(m.isOpen?o:i)()}function i(){g&&!e.$eval(n[C+"Enable"])||(function(){var e=n[C+"Placement"];m.placement=angular.isDefined(e)?e:D.placement}(),function(){var e=n[C+"PopupDelay"],t=parseInt(e,10);m.popupDelay=isNaN(t)?D.popupDelay:t}(),m.popupDelay?p||(p=x(a,m.popupDelay,!1)).then(function(e){e()}):a()())}function o(){e.$apply(function(){s()})}function a(){return p=null,d&&(x.cancel(d),d=null),m.content?(u&&l(),c=m.$new(),(u=_(c,function(e){h?O.find("body").append(e):t.after(e)})).css({top:0,left:0,display:"block"}),m.$digest(),v(),m.isOpen=!0,m.$digest(),v):angular.noop}function s(){m.isOpen=!1,x.cancel(p),p=null,m.animation?d=d||x(l,500):l()}function l(){d=null,u&&(u.remove(),u=null),c&&(c.$destroy(),c=null)}var u,c,d,p,h=!!angular.isDefined(D.appendToBody)&&D.appendToBody,f=k(void 0),g=angular.isDefined(n[C+"Enable"]),m=e.$new(!0),v=function(){var e=T.positionElements(t,u,m.placement,h);e.top+="px",e.left+="px",u.css(e)};m.isOpen=!1,n.$observe(S,function(e){!(m.content=e)&&m.isOpen&&s()}),n.$observe(C+"Title",function(e){m.title=e});function y(){t.unbind(f.show,i),t.unbind(f.hide,o)}var w;w=n[C+"Trigger"],y(),(f=k(w)).show===f.hide?t.bind(f.show,r):(t.bind(f.show,i),t.bind(f.hide,o));var b=e.$eval(n[C+"Animation"]);m.animation=angular.isDefined(b)?!!b:D.animation;var $=e.$eval(n[C+"AppendToBody"]);(h=angular.isDefined($)?$:h)&&e.$on("$locationChangeSuccess",function(){m.isOpen&&s()}),e.$on("$destroy",function(){x.cancel(d),x.cancel(p),y(),l(),m=null})}}}}}]}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(e){return e("tooltip","tooltip","mouseenter")}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).directive("tooltipHtmlUnsafe",["$tooltip",function(e){return e("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(e){return e("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(n,e,t){var r=this,i=angular.isDefined(e.animate)?n.$parent.$eval(e.animate):t.animate;this.bars=[],n.max=angular.isDefined(e.max)?n.$parent.$eval(e.max):t.max,this.addBar=function(t,e){i||e.css({transition:"none"}),this.bars.push(t),t.$watch("value",function(e){t.percent=+(100*e/n.max).toFixed(2)}),t.$on("$destroy",function(){e=null,r.removeBar(t)})},this.removeBar=function(e){this.bars.splice(this.bars.indexOf(e),1)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(e,t,n,r){r.addBar(e,t)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(e,t,n,r){r.addBar(e,angular.element(t.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(n,r,i){var o={$setViewValue:angular.noop};this.init=function(e){(o=e).$render=this.render,this.stateOn=angular.isDefined(r.stateOn)?n.$parent.$eval(r.stateOn):i.stateOn,this.stateOff=angular.isDefined(r.stateOff)?n.$parent.$eval(r.stateOff):i.stateOff;var t=angular.isDefined(r.ratingStates)?n.$parent.$eval(r.ratingStates):new Array(angular.isDefined(r.max)?n.$parent.$eval(r.max):i.max);n.range=this.buildTemplateObjects(t)},this.buildTemplateObjects=function(e){for(var t=0,n=e.length;t<n;t++)e[t]=angular.extend({index:t},{stateOn:this.stateOn,stateOff:this.stateOff},e[t]);return e},n.rate=function(e){!n.readonly&&0<=e&&e<=n.range.length&&(o.$setViewValue(e),o.$render())},n.enter=function(e){n.readonly||(n.value=e),n.onHover({value:e})},n.reset=function(){n.value=o.$viewValue,n.onLeave()},n.onKeydown=function(e){/(37|38|39|40)/.test(e.which)&&(e.preventDefault(),e.stopPropagation(),n.rate(n.value+(38===e.which||39===e.which?1:-1)))},this.render=function(){n.value=o.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(e,t,n,r){var i=r[0],o=r[1];o&&i.init(o)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(e){var r,i=this,o=i.tabs=e.tabs=[];i.select=function(t){angular.forEach(o,function(e){e.active&&e!==t&&(e.active=!1,e.onDeselect())}),t.active=!0,t.onSelect()},i.addTab=function(e){o.push(e),1===o.length?e.active=!0:e.active&&i.select(e)},i.removeTab=function(e){var t,n=o.indexOf(e);e.active&&1<o.length&&!r&&(t=n==o.length-1?n-1:n+1,i.select(o[t])),o.splice(n,1)},e.$on("$destroy",function(){r=!0})}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(e,t,n){e.vertical=!!angular.isDefined(n.vertical)&&e.$parent.$eval(n.vertical),e.justified=!!angular.isDefined(n.justified)&&e.$parent.$eval(n.justified)}}}).directive("tab",["$parse",function(o){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(e,t,i){return function(t,e,n,r){t.$watch("active",function(e){e&&r.select(t)}),t.disabled=!1,n.disabled&&t.$parent.$watch(o(n.disabled),function(e){t.disabled=!!e}),t.select=function(){t.disabled||(t.active=!0)},r.addTab(t),t.$on("$destroy",function(){r.removeTab(t)}),t.$transcludeFn=i}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(e,t){e.$watch("headingElement",function(e){e&&(t.html(""),t.append(e))})}}}]).directive("tabContentTransclude",function(){return{restrict:"A",require:"^tabset",link:function(e,n,t){var r=e.$eval(t.tabContentTransclude);r.$transcludeFn(r.$parent,function(e){angular.forEach(e,function(e){var t;(t=e).tagName&&(t.hasAttribute("tab-heading")||t.hasAttribute("data-tab-heading")||"tab-heading"===t.tagName.toLowerCase()||"data-tab-heading"===t.tagName.toLowerCase())?r.headingElement=e:n.append(e)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(i,o,e,t,n,a){function r(){var e=parseInt(i.hours,10);return(i.showMeridian?0<e&&e<13:0<=e&&e<24)?(i.showMeridian&&(12===e&&(e=0),i.meridian===g[1]&&(e+=12)),e):void 0}function s(){var e=parseInt(i.minutes,10);return 0<=e&&e<60?e:void 0}function l(e){return angular.isDefined(e)&&e.toString().length<2?"0"+e:e}function u(e){c(),f.$setViewValue(new Date(h)),d(e)}function c(){f.$setValidity("time",!0),i.invalidHours=!1,i.invalidMinutes=!1}function d(e){var t=h.getHours(),n=h.getMinutes();i.showMeridian&&(t=0===t||12===t?12:t%12),i.hours="h"===e?t:l(t),i.minutes="m"===e?n:l(n),i.meridian=h.getHours()<12?g[0]:g[1]}function p(e){var t=new Date(h.getTime()+6e4*e);h.setHours(t.getHours(),t.getMinutes()),u()}var h=new Date,f={$setViewValue:angular.noop},g=angular.isDefined(o.meridians)?i.$parent.$eval(o.meridians):a.meridians||n.DATETIME_FORMATS.AMPMS;this.init=function(e,t){(f=e).$render=this.render;var n=t.eq(0),r=t.eq(1);(angular.isDefined(o.mousewheel)?i.$parent.$eval(o.mousewheel):a.mousewheel)&&this.setupMousewheelEvents(n,r),i.readonlyInput=angular.isDefined(o.readonlyInput)?i.$parent.$eval(o.readonlyInput):a.readonlyInput,this.setupInputEvents(n,r)};var m=a.hourStep;o.hourStep&&i.$parent.$watch(e(o.hourStep),function(e){m=parseInt(e,10)});var v=a.minuteStep;o.minuteStep&&i.$parent.$watch(e(o.minuteStep),function(e){v=parseInt(e,10)}),i.showMeridian=a.showMeridian,o.showMeridian&&i.$parent.$watch(e(o.showMeridian),function(e){var t,n;i.showMeridian=!!e,f.$error.time?(t=r(),n=s(),angular.isDefined(t)&&angular.isDefined(n)&&(h.setHours(t),u())):d()}),this.setupMousewheelEvents=function(e,t){function n(e){e.originalEvent&&(e=e.originalEvent);var t=e.wheelDelta?e.wheelDelta:-e.deltaY;return e.detail||0<t}e.bind("mousewheel wheel",function(e){i.$apply(n(e)?i.incrementHours():i.decrementHours()),e.preventDefault()}),t.bind("mousewheel wheel",function(e){i.$apply(n(e)?i.incrementMinutes():i.decrementMinutes()),e.preventDefault()})},this.setupInputEvents=function(e,t){if(i.readonlyInput)return i.updateHours=angular.noop,void(i.updateMinutes=angular.noop);function n(e,t){f.$setViewValue(null),f.$setValidity("time",!1),angular.isDefined(e)&&(i.invalidHours=e),angular.isDefined(t)&&(i.invalidMinutes=t)}i.updateHours=function(){var e=r();angular.isDefined(e)?(h.setHours(e),u("h")):n(!0)},e.bind("blur",function(){!i.invalidHours&&i.hours<10&&i.$apply(function(){i.hours=l(i.hours)})}),i.updateMinutes=function(){var e=s();angular.isDefined(e)?(h.setMinutes(e),u("m")):n(void 0,!0)},t.bind("blur",function(){!i.invalidMinutes&&i.minutes<10&&i.$apply(function(){i.minutes=l(i.minutes)})})},this.render=function(){var e=f.$modelValue?new Date(f.$modelValue):null;isNaN(e)?(f.$setValidity("time",!1),t.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(e&&(h=e),c(),d())},i.incrementHours=function(){p(60*m)},i.decrementHours=function(){p(60*-m)},i.incrementMinutes=function(){p(v)},i.decrementMinutes=function(){p(-v)},i.toggleMeridian=function(){p(720*(h.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(e,t,n,r){var i=r[0],o=r[1];o&&i.init(o,t.find("input"))}}}),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(n){var r=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(e){var t=e.match(r);if(!t)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+e+'".');return{itemName:t[3],source:n(t[4]),viewMapper:n(t[2]||t[1]),modelMapper:n(t[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(k,D,x,O,T,A,E){var P=[9,13,27,38,40];return{require:"ngModel",link:function(o,a,e,s){var l,n=o.$eval(e.typeaheadMinLength)||1,r=o.$eval(e.typeaheadWaitMs)||0,i=!1!==o.$eval(e.typeaheadEditable),u=D(e.typeaheadLoading).assign||angular.noop,c=D(e.typeaheadOnSelect),d=e.typeaheadInputFormatter?D(e.typeaheadInputFormatter):void 0,p=!!e.typeaheadAppendToBody&&o.$eval(e.typeaheadAppendToBody),h=!1!==o.$eval(e.typeaheadFocusFirst),f=D(e.ngModel).assign,g=E.parse(e.typeahead),m=o.$new();o.$on("$destroy",function(){m.$destroy()});var t="typeahead-"+m.$id+"-"+Math.floor(1e4*Math.random());a.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":t});var v=angular.element("<div typeahead-popup></div>");v.attr({id:t,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(e.typeaheadTemplateUrl)&&v.attr("template-url",e.typeaheadTemplateUrl);function y(){m.matches=[],m.activeIdx=-1,a.attr("aria-expanded",!1)}function w(e){return t+"-option-"+e}m.$watch("activeIdx",function(e){e<0?a.removeAttr("aria-activedescendant"):a.attr("aria-activedescendant",w(e))});function b(r){var i={$viewValue:r};u(o,!0),x.when(g.source(o,i)).then(function(e){var t=r===s.$viewValue;if(t&&l)if(0<e.length){m.activeIdx=h?0:-1;for(var n=m.matches.length=0;n<e.length;n++)i[g.itemName]=e[n],m.matches.push({id:w(n),label:g.viewMapper(m,i),model:e[n]});m.query=r,m.position=p?A.offset(a):A.position(a),m.position.top=m.position.top+a.prop("offsetHeight"),a.attr("aria-expanded",!0)}else y();t&&u(o,!1)},function(){y(),u(o,!1)})}y(),m.query=void 0;function $(){_&&O.cancel(_)}var _;s.$parsers.unshift(function(e){return l=!0,e&&e.length>=n?0<r?($(),t=e,_=O(function(){b(t)},r)):b(e):(u(o,!1),$(),y()),i?e:e?void s.$setValidity("editable",!1):(s.$setValidity("editable",!0),e);var t}),s.$formatters.push(function(e){var t,n={};return d?(n.$model=e,d(o,n)):(n[g.itemName]=e,t=g.viewMapper(o,n),n[g.itemName]=void 0,t!==g.viewMapper(o,n)?t:e)}),m.select=function(e){var t,n,r={};r[g.itemName]=n=m.matches[e].model,t=g.modelMapper(o,r),f(o,t),s.$setValidity("editable",!0),c(o,{$item:n,$model:t,$label:g.viewMapper(o,r)}),y(),O(function(){a[0].focus()},0,!1)},a.bind("keydown",function(e){0!==m.matches.length&&-1!==P.indexOf(e.which)&&(-1!=m.activeIdx||13!==e.which&&9!==e.which)&&(e.preventDefault(),40===e.which?(m.activeIdx=(m.activeIdx+1)%m.matches.length,m.$digest()):38===e.which?(m.activeIdx=(0<m.activeIdx?m.activeIdx:m.matches.length)-1,m.$digest()):13===e.which||9===e.which?m.$apply(function(){m.select(m.activeIdx)}):27===e.which&&(e.stopPropagation(),y(),m.$digest()))}),a.bind("blur",function(){l=!1});function S(e){a[0]!==e.target&&(y(),m.$digest())}T.bind("click",S),o.$on("$destroy",function(){T.unbind("click",S),p&&C.remove()});var C=k(v)(m);p?T.find("body").append(C):a.after(C)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(t,e,n){t.templateUrl=n.templateUrl,t.isOpen=function(){return 0<t.matches.length},t.isActive=function(e){return t.active==e},t.selectActive=function(e){t.active=e},t.selectMatch=function(e){t.select({activeIdx:e})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function(i,o,a,s){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(t,n,e){var r=s(e.templateUrl)(t.$parent)||"template/typeahead/typeahead-match.html";i.get(r,{cache:o}).success(function(e){n.replaceWith(a(e.trim())(t))})}}}]).filter("typeaheadHighlight",function(){return function(e,t){return t?(""+e).replace(new RegExp(t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"gi"),"<strong>$&</strong>"):e}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(e){e.put("template/accordion/accordion-group.html",'<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a href class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse" collapse="!isOpen">\n\t <div class="panel-body" ng-transclude></div>\n </div>\n</div>\n')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(e){e.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(e){e.put("template/alert/alert.html",'<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissable\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(e){e.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(e){e.put("template/carousel/slide.html","<div ng-class=\"{\n 'active': leaving || (active && !entering),\n 'prev': (next || active) && direction=='prev',\n 'next': (next || active) && direction=='next',\n 'right': direction=='prev',\n 'left': direction=='next'\n }\" class=\"item text-center\" ng-transclude></div>\n")}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(e){e.put("template/datepicker/datepicker.html",'<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(e){e.put("template/datepicker/day.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(e){e.put("template/datepicker/month.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(e){e.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n\t<li ng-transclude></li>\n\t<li ng-if="showButtonBar" style="padding:10px 9px 2px">\n\t\t<span class="btn-group pull-left">\n\t\t\t<button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n\t\t\t<button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n\t\t</span>\n\t\t<button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n\t</li>\n</ul>\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(e){e.put("template/datepicker/year.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(e){e.put("template/modal/backdrop.html",'<div class="modal-backdrop fade {{ backdropClass }}"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(e){e.put("template/modal/window.html",'<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="{\'modal-sm\': size == \'sm\', \'modal-lg\': size == \'lg\'}"><div class="modal-content" modal-transclude></div></div>\n</div>')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(e){e.put("template/pagination/pager.html",'<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n</ul>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(e){e.put("template/pagination/pagination.html",'<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages)">{{getText(\'last\')}}</a></li>\n</ul>')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(e){e.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(e){e.put("template/tooltip/tooltip-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(e){e.put("template/popover/popover.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(e){e.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(e){e.put("template/progressbar/progress.html",'<div class="progress" ng-transclude></div>')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(e){e.put("template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(e){e.put("template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(e){e.put("template/tabs/tab.html",'<li ng-class="{active: active, disabled: disabled}">\n <a href ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(e){e.put("template/tabs/tabset.html",'<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(e){e.put("template/timepicker/timepicker.html",'<table>\n\t<tbody>\n\t\t<tr class="text-center">\n\t\t\t<td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n\t\t\t<td ng-show="showMeridian"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidHours}">\n\t\t\t\t<input type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-mousewheel="incrementHours()" ng-readonly="readonlyInput" maxlength="2">\n\t\t\t</td>\n\t\t\t<td>:</td>\n\t\t\t<td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n\t\t\t\t<input type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n\t\t\t</td>\n\t\t\t<td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n\t\t</tr>\n\t\t<tr class="text-center">\n\t\t\t<td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n\t\t\t<td ng-show="showMeridian"></td>\n\t\t</tr>\n\t</tbody>\n</table>\n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(e){e.put("template/typeahead/typeahead-match.html",'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')}]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(e){e.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')}]),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function h(){return e.apply(null,arguments)}function s(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function l(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(f(e,t))return;return 1}function o(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function a(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){for(var n=[],r=0;r<e.length;++r)n.push(t(e[r],r));return n}function p(e,t){for(var n in t)f(t,n)&&(e[n]=t[n]);return f(t,"toString")&&(e.toString=t.toString),f(t,"valueOf")&&(e.valueOf=t.valueOf),e}function g(e,t,n,r){return Ot(e,t,n,r,!0).utc()}function m(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function v(e){if(null==e._isValid){var t=m(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),r=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(r=r&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return r;e._isValid=r}return e._isValid}function y(e){var t=g(NaN);return null!=e?p(m(t),e):m(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};var w=h.momentProperties=[],t=!1;function b(e,t){var n,r,i;if(o(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),o(t._i)||(e._i=t._i),o(t._f)||(e._f=t._f),o(t._l)||(e._l=t._l),o(t._strict)||(e._strict=t._strict),o(t._tzm)||(e._tzm=t._tzm),o(t._isUTC)||(e._isUTC=t._isUTC),o(t._offset)||(e._offset=t._offset),o(t._pf)||(e._pf=m(t)),o(t._locale)||(e._locale=t._locale),0<w.length)for(n=0;n<w.length;n++)o(i=t[r=w[n]])||(e[r]=i);return e}function $(e){b(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,h.updateOffset(this),t=!1)}function _(e){return e instanceof $||null!=e&&null!=e._isAMomentObject}function S(e){!1===h.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,o){var a=!0;return p(function(){if(null!=h.deprecationHandler&&h.deprecationHandler(null,i),a){for(var e,t,n=[],r=0;r<arguments.length;r++){if(e="","object"==typeof arguments[r]){for(t in e+="\n["+r+"] ",arguments[0])f(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[r];n.push(e)}S(i+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),a=!1}return o.apply(this,arguments)},o)}var r,C={};function k(e,t){null!=h.deprecationHandler&&h.deprecationHandler(e,t),C[e]||(S(t),C[e]=!0)}function D(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,r=p({},e);for(n in t)f(t,n)&&(l(e[n])&&l(t[n])?(r[n]={},p(r[n],e[n]),p(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)f(e,n)&&!f(t,n)&&l(e[n])&&(r[n]=p({},r[n]));return r}function O(e){null!=e&&this.set(e)}h.suppressDeprecationWarnings=!1,h.deprecationHandler=null,r=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)f(e,t)&&n.push(t);return n};function T(e,t,n){var r=""+Math.abs(e),i=t-r.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var A=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,P={},M={};function R(e,t,n,r){var i="string"==typeof r?function(){return this[r]()}:r;e&&(M[e]=i),t&&(M[t[0]]=function(){return T(i.apply(this,arguments),t[1],t[2])}),n&&(M[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function I(e,t){return e.isValid()?(t=V(t,e.localeData()),P[t]=P[t]||function(r){for(var e,i=r.match(A),t=0,o=i.length;t<o;t++)M[i[t]]?i[t]=M[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<o;n++)t+=D(i[n])?i[n].call(e,r):i[n];return t}}(t),P[t](e)):e.localeData().invalidDate()}function V(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(E.lastIndex=0;0<=n&&E.test(e);)e=e.replace(E,r),E.lastIndex=0,--n;return e}var N={};function L(e,t){var n=e.toLowerCase();N[n]=N[n+"s"]=N[t]=e}function F(e){return"string"==typeof e?N[e]||N[e.toLowerCase()]:void 0}function j(e){var t,n,r={};for(n in e)f(e,n)&&(t=F(n))&&(r[t]=e[n]);return r}var Y={};function H(e,t){Y[e]=t}function U(e){return e%4==0&&e%100!=0||e%400==0}function q(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function z(e){var t=+e,n=0;return 0!=t&&isFinite(t)&&(n=q(t)),n}function B(t,n){return function(e){return null!=e?(G(this,t,e),h.updateOffset(this,n),this):W(this,t)}}function W(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function G(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&U(e.year())&&1===e.month()&&29===e.date()?(n=z(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Oe(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var K,Q=/\d/,Z=/\d\d/,X=/\d{3}/,J=/\d{4}/,ee=/[+-]?\d{6}/,te=/\d\d?/,ne=/\d\d\d\d?/,re=/\d\d\d\d\d\d?/,ie=/\d{1,3}/,oe=/\d{1,4}/,ae=/[+-]?\d{1,6}/,se=/\d+/,le=/[+-]?\d+/,ue=/Z|[+-]\d\d:?\d\d/gi,ce=/Z|[+-]\d\d(?::?\d\d)?/gi,de=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function pe(e,n,r){K[e]=D(n)?n:function(e,t){return e&&r?r:n}}function he(e,t){return f(K,e)?K[e](t._strict,t._locale):new RegExp(fe(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i})))}function fe(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}K={};var ge={};function me(e,n){var t,r=n;for("string"==typeof e&&(e=[e]),c(n)&&(r=function(e,t){t[n]=z(e)}),t=0;t<e.length;t++)ge[e[t]]=r}function ve(e,i){me(e,function(e,t,n,r){n._w=n._w||{},i(e,n._w,n,r)})}var ye,we=0,be=1,$e=2,_e=3,Se=4,Ce=5,ke=6,De=7,xe=8;function Oe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,r=(t%(n=12)+n)%n;return e+=(t-r)/12,1==r?U(e)?29:28:31-r%7%2}ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),R("MMMM",0,0,function(e){return this.localeData().months(this,e)}),L("month","M"),H("month",8),pe("M",te),pe("MM",te,Z),pe("MMM",function(e,t){return t.monthsShortRegex(e)}),pe("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[be]=z(e)-1}),me(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);null!=i?t[be]=i:m(n).invalidMonth=e});var Te="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ae="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ee=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pe=de,Me=de;function Re(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=z(t);else if(!c(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Oe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Ie(e){return null!=e?(Re(this,e),h.updateOffset(this,!0),this):W(this,"Month")}function Ve(){function e(e,t){return t.length-e.length}for(var t,n=[],r=[],i=[],o=0;o<12;o++)t=g([2e3,o]),n.push(this.monthsShort(t,"")),r.push(this.months(t,"")),i.push(this.months(t,"")),i.push(this.monthsShort(t,""));for(n.sort(e),r.sort(e),i.sort(e),o=0;o<12;o++)n[o]=fe(n[o]),r[o]=fe(r[o]);for(o=0;o<24;o++)i[o]=fe(i[o]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Ne(e){return U(e)?366:365}R("Y",0,0,function(){var e=this.year();return e<=9999?T(e,4):"+"+e}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),L("year","y"),H("year",1),pe("Y",le),pe("YY",te,Z),pe("YYYY",oe,J),pe("YYYYY",ae,ee),pe("YYYYYY",ae,ee),me(["YYYYY","YYYYYY"],we),me("YYYY",function(e,t){t[we]=2===e.length?h.parseTwoDigitYear(e):z(e)}),me("YY",function(e,t){t[we]=h.parseTwoDigitYear(e)}),me("Y",function(e,t){t[we]=parseInt(e,10)}),h.parseTwoDigitYear=function(e){return z(e)+(68<z(e)?1900:2e3)};var Le=B("FullYear",!0);function Fe(e){var t,n;return e<100&&0<=e?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function je(e,t,n){var r=7+t-n;return r-(7+Fe(e,0,r).getUTCDay()-t)%7-1}function Ye(e,t,n,r,i){var o,a=1+7*(t-1)+(7+n-r)%7+je(e,r,i),s=a<=0?Ne(o=e-1)+a:a>Ne(e)?(o=e+1,a-Ne(e)):(o=e,a);return{year:o,dayOfYear:s}}function He(e,t,n){var r,i,o=je(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?r=a+Ue(i=e.year()-1,t,n):a>Ue(e.year(),t,n)?(r=a-Ue(e.year(),t,n),i=e.year()+1):(i=e.year(),r=a),{week:r,year:i}}function Ue(e,t,n){var r=je(e,t,n),i=je(e+1,t,n);return(Ne(e)-r+i)/7}R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),H("week",5),H("isoWeek",5),pe("w",te),pe("ww",te,Z),pe("W",te),pe("WW",te,Z),ve(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=z(e)});function qe(e,t){return e.slice(t,7).concat(e.slice(0,t))}R("d",0,"do","day"),R("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),R("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),R("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),H("day",11),H("weekday",11),H("isoWeekday",11),pe("d",te),pe("e",te),pe("E",te),pe("dd",function(e,t){return t.weekdaysMinRegex(e)}),pe("ddd",function(e,t){return t.weekdaysShortRegex(e)}),pe("dddd",function(e,t){return t.weekdaysRegex(e)}),ve(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:m(n).invalidWeekday=e}),ve(["d","e","E"],function(e,t,n,r){t[r]=z(e)});var ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Be="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),We="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ge=de,Ke=de,Qe=de;function Ze(){function e(e,t){return t.length-e.length}for(var t,n,r,i,o=[],a=[],s=[],l=[],u=0;u<7;u++)t=g([2e3,1]).day(u),n=fe(this.weekdaysMin(t,"")),r=fe(this.weekdaysShort(t,"")),i=fe(this.weekdays(t,"")),o.push(n),a.push(r),s.push(i),l.push(n),l.push(r),l.push(i);o.sort(e),a.sort(e),s.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Je(e,t){R(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}R("H",["HH",2],0,"hour"),R("h",["hh",2],0,Xe),R("k",["kk",2],0,function(){return this.hours()||24}),R("hmm",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)}),R("hmmss",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Je("a",!0),Je("A",!1),L("hour","h"),H("hour",13),pe("a",et),pe("A",et),pe("H",te),pe("h",te),pe("k",te),pe("HH",te,Z),pe("hh",te,Z),pe("kk",te,Z),pe("hmm",ne),pe("hmmss",re),pe("Hmm",ne),pe("Hmmss",re),me(["H","HH"],_e),me(["k","kk"],function(e,t,n){var r=z(e);t[_e]=24===r?0:r}),me(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),me(["h","hh"],function(e,t,n){t[_e]=z(e),m(n).bigHour=!0}),me("hmm",function(e,t,n){var r=e.length-2;t[_e]=z(e.substr(0,r)),t[Se]=z(e.substr(r)),m(n).bigHour=!0}),me("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[_e]=z(e.substr(0,r)),t[Se]=z(e.substr(r,2)),t[Ce]=z(e.substr(i)),m(n).bigHour=!0}),me("Hmm",function(e,t,n){var r=e.length-2;t[_e]=z(e.substr(0,r)),t[Se]=z(e.substr(r))}),me("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[_e]=z(e.substr(0,r)),t[Se]=z(e.substr(r,2)),t[Ce]=z(e.substr(i))});var tt=B("Hours",!0);var nt,rt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Te,monthsShort:Ae,week:{dow:0,doy:6},weekdays:ze,weekdaysMin:We,weekdaysShort:Be,meridiemParse:/[ap]\.?m?\.?/i},it={},ot={};function at(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n}function st(e){return e?e.toLowerCase().replace("_","-"):e}function lt(t){var e=null;if(void 0===it[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=nt._abbr,require("./locale/"+t),ut(e)}catch(e){it[t]=null}return it[t]}function ut(e,t){var n;return e&&((n=o(t)?dt(e):ct(e,t))?nt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),nt._abbr}function ct(e,t){if(null===t)return delete it[e],null;var n,r=rt;if(t.abbr=e,null!=it[e])k("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])r=it[t.parentLocale]._config;else{if(null==(n=lt(t.parentLocale)))return ot[t.parentLocale]||(ot[t.parentLocale]=[]),ot[t.parentLocale].push({name:e,config:t}),null;r=n._config}return it[e]=new O(x(r,t)),ot[e]&&ot[e].forEach(function(e){ct(e.name,e.config)}),ut(e),it[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return nt;if(!s(e)){if(t=lt(e))return t;e=[e]}return function(e){for(var t,n,r,i,o=0;o<e.length;){for(t=(i=st(e[o]).split("-")).length,n=(n=st(e[o+1]))?n.split("-"):null;0<t;){if(r=lt(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&at(i,n)>=t-1)break;t--}o++}return nt}(e)}function pt(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[be]<0||11<n[be]?be:n[$e]<1||n[$e]>Oe(n[we],n[be])?$e:n[_e]<0||24<n[_e]||24===n[_e]&&(0!==n[Se]||0!==n[Ce]||0!==n[ke])?_e:n[Se]<0||59<n[Se]?Se:n[Ce]<0||59<n[Ce]?Ce:n[ke]<0||999<n[ke]?ke:-1,m(e)._overflowDayOfYear&&(t<we||$e<t)&&(t=$e),m(e)._overflowWeeks&&-1===t&&(t=De),m(e)._overflowWeekday&&-1===t&&(t=xe),m(e).overflow=t),e}var ht=/^\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)?)?$/,ft=/^\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)?)?$/,gt=/Z|[+-]\d\d(?::?\d\d)?/,mt=[["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}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],vt=[["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/]],yt=/^\/?Date\((-?\d+)/i,wt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,bt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function $t(e){var t,n,r,i,o,a,s=e._i,l=ht.exec(s)||ft.exec(s);if(l){for(m(e).iso=!0,t=0,n=mt.length;t<n;t++)if(mt[t][1].exec(l[1])){i=mt[t][0],r=!1!==mt[t][2];break}if(null==i)return void(e._isValid=!1);if(l[3]){for(t=0,n=vt.length;t<n;t++)if(vt[t][1].exec(l[3])){o=(l[2]||" ")+vt[t][0];break}if(null==o)return void(e._isValid=!1)}if(!r&&null!=o)return void(e._isValid=!1);if(l[4]){if(!gt.exec(l[4]))return void(e._isValid=!1);a="Z"}e._f=i+(o||"")+(a||""),Dt(e)}else e._isValid=!1}function _t(e,t,n,r,i,o){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Ae.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&a.push(parseInt(o,10)),a}function St(e){var t,n,r,i,o=wt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(o){if(t=_t(o[4],o[3],o[2],o[5],o[6],o[7]),n=o[1],r=t,i=e,n&&Be.indexOf(n)!==new Date(r[0],r[1],r[2]).getDay()&&(m(i).weekdayMismatch=!0,!void(i._isValid=!1)))return;e._a=t,e._tzm=function(e,t,n){if(e)return bt[e];if(t)return 0;var r=parseInt(n,10),i=r%100;return 60*((r-i)/100)+i}(o[8],o[9],o[10]),e._d=Fe.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0}else e._isValid=!1}function Ct(e,t,n){return null!=e?e:null!=t?t:n}function kt(e){var t,n,r,i,o,a,s,l=[];if(!e._d){for(a=e,s=new Date(h.now()),r=a._useUTC?[s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()]:[s.getFullYear(),s.getMonth(),s.getDate()],e._w&&null==e._a[$e]&&null==e._a[be]&&function(e){var t,n,r,i,o,a,s,l,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(o=1,a=4,n=Ct(t.GG,e._a[we],He(Tt(),1,4).year),r=Ct(t.W,1),((i=Ct(t.E,1))<1||7<i)&&(l=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,u=He(Tt(),o,a),n=Ct(t.gg,e._a[we],u.year),r=Ct(t.w,u.week),null!=t.d?((i=t.d)<0||6<i)&&(l=!0):null!=t.e?(i=t.e+o,(t.e<0||6<t.e)&&(l=!0)):i=o);r<1||r>Ue(n,o,a)?m(e)._overflowWeeks=!0:null!=l?m(e)._overflowWeekday=!0:(s=Ye(n,r,i,o,a),e._a[we]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(o=Ct(e._a[we],r[we]),(e._dayOfYear>Ne(o)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=Fe(o,0,e._dayOfYear),e._a[be]=n.getUTCMonth(),e._a[$e]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=l[t]=r[t];for(;t<7;t++)e._a[t]=l[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[_e]&&0===e._a[Se]&&0===e._a[Ce]&&0===e._a[ke]&&(e._nextDay=!0,e._a[_e]=0),e._d=(e._useUTC?Fe:function(e,t,n,r,i,o,a){var s;return e<100&&0<=e?(s=new Date(e+400,t,n,r,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,o,a),s}).apply(null,l),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[_e]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(m(e).weekdayMismatch=!0)}}function Dt(e){if(e._f!==h.ISO_8601)if(e._f!==h.RFC_2822){e._a=[],m(e).empty=!0;for(var t,n,r,i,o,a,s,l=""+e._i,u=l.length,c=0,d=V(e._f,e._locale).match(A)||[],p=0;p<d.length;p++)n=d[p],(t=(l.match(he(n,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(t))).length&&m(e).unusedInput.push(r),l=l.slice(l.indexOf(t)+t.length),c+=t.length),M[n]?(t?m(e).empty=!1:m(e).unusedTokens.push(n),o=n,s=e,null!=(a=t)&&f(ge,o)&&ge[o](a,s._a,s,o)):e._strict&&!t&&m(e).unusedTokens.push(n);m(e).charsLeftOver=u-c,0<l.length&&m(e).unusedInput.push(l),e._a[_e]<=12&&!0===m(e).bigHour&&0<e._a[_e]&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[_e]=function(e,t,n){var r;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0)),t)}(e._locale,e._a[_e],e._meridiem),null!==(i=m(e).era)&&(e._a[we]=e._locale.erasConvertYear(i,e._a[we])),kt(e),pt(e)}else St(e);else $t(e)}function xt(e){var t,n,r=e._i,i=e._f;return e._locale=e._locale||dt(e._l),null===r||void 0===i&&""===r?y({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),_(r)?new $(pt(r)):(a(r)?e._d=r:s(i)?function(e){var t,n,r,i,o,a,s=!1;if(0===e._f.length)return m(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)o=0,a=!1,t=b({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Dt(t),v(t)&&(a=!0),o+=m(t).charsLeftOver,o+=10*m(t).unusedTokens.length,m(t).score=o,s?o<r&&(r=o,n=t):(null==r||o<r||a)&&(r=o,n=t,a&&(s=!0));p(e,n||t)}(e):i?Dt(e):o(n=(t=e)._i)?t._d=new Date(h.now()):a(n)?t._d=new Date(n.valueOf()):"string"==typeof n?function(e){var t=yt.exec(e._i);null===t?($t(e),!1===e._isValid&&(delete e._isValid,St(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:h.createFromInputFallback(e)))):e._d=new Date(+t[1])}(t):s(n)?(t._a=d(n.slice(0),function(e){return parseInt(e,10)}),kt(t)):l(n)?function(e){var t,n;e._d||(n=void 0===(t=j(e._i)).day?t.date:t.day,e._a=d([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),kt(e))}(t):c(n)?t._d=new Date(n):h.createFromInputFallback(t),v(e)||(e._d=null),e))}function Ot(e,t,n,r,i){var o,a={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(l(e)&&u(e)||s(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=r,(o=new $(pt(xt(a))))._nextDay&&(o.add(1,"d"),o._nextDay=void 0),o}function Tt(e,t,n,r){return Ot(e,t,n,r,!1)}h.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),h.ISO_8601=function(){},h.RFC_2822=function(){};var At=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:y()}),Et=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:y()});function Pt(e,t){var n,r;if(1===t.length&&s(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var Mt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Rt(e){var t=j(e),n=t.year||0,r=t.quarter||0,i=t.month||0,o=t.week||t.isoWeek||0,a=t.day||0,s=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=function(e){var t,n,r=!1;for(t in e)if(f(e,t)&&(-1===ye.call(Mt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<Mt.length;++n)if(e[Mt[n]]){if(r)return!1;parseFloat(e[Mt[n]])!==z(e[Mt[n]])&&(r=!0)}return!0}(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*s*60*60,this._days=+a+7*o,this._months=+i+3*r+12*n,this._data={},this._locale=dt(),this._bubble()}function It(e){return e instanceof Rt}function Vt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Nt(e,n){R(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+T(~~(e/60),2)+n+T(~~e%60,2)})}Nt("Z",":"),Nt("ZZ",""),pe("Z",ce),pe("ZZ",ce),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ft(ce,e)});var Lt=/([\+\-]|\d\d)/gi;function Ft(e,t){var n,r,i=(t||"").match(e);return null===i?null:0===(r=60*(n=((i[i.length-1]||[])+"").match(Lt)||["-",0,0])[1]+z(n[2]))?0:"+"===n[0]?r:-r}function jt(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(_(e)||a(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),h.updateOffset(n,!1),n):Tt(e).local()}function Yt(e){return-Math.round(e._d.getTimezoneOffset())}function Ht(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}h.updateOffset=function(){};var Ut=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,qt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function zt(e,t){var n,r,i,o=e,a=null;return It(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(o={},t?o[t]=+e:o.milliseconds=+e):(a=Ut.exec(e))?(n="-"===a[1]?-1:1,o={y:0,d:z(a[$e])*n,h:z(a[_e])*n,m:z(a[Se])*n,s:z(a[Ce])*n,ms:z(Vt(1e3*a[ke]))*n}):(a=qt.exec(e))?(n="-"===a[1]?-1:1,o={y:Bt(a[2],n),M:Bt(a[3],n),w:Bt(a[4],n),d:Bt(a[5],n),h:Bt(a[6],n),m:Bt(a[7],n),s:Bt(a[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=jt(t,e),e.isBefore(t)?n=Wt(e,t):((n=Wt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Tt(o.from),Tt(o.to)),(o={}).ms=i.milliseconds,o.M=i.months),r=new Rt(o),It(e)&&f(e,"_locale")&&(r._locale=e._locale),It(e)&&f(e,"_isValid")&&(r._isValid=e._isValid),r}function Bt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Wt(e,t){var n={};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 Gt(r,i){return function(e,t){var n;return null===t||isNaN(+t)||(k(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),Kt(this,zt(e,t),r),this}}function Kt(e,t,n,r){var i=t._milliseconds,o=Vt(t._days),a=Vt(t._months);e.isValid()&&(r=null==r||r,a&&Re(e,W(e,"Month")+a*n),o&&G(e,"Date",W(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&h.updateOffset(e,o||a))}zt.fn=Rt.prototype,zt.invalid=function(){return zt(NaN)};var Qt=Gt(1,"add"),Zt=Gt(-1,"subtract");function Xt(e){return"string"==typeof e||e instanceof String}function Jt(e){return _(e)||a(e)||Xt(e)||c(e)||function(t){var e=s(t),n=!1;e&&(n=0===t.filter(function(e){return!c(e)&&Xt(t)}).length);return e&&n}(e)||function(e){var t,n,r=l(e)&&!u(e),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;t<o.length;t+=1)n=o[t],i=i||f(e,n);return r&&i}(e)||null==e}function en(e,t){if(e.date()<t.date())return-en(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months"),i=t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(1+n,"months")-r);return-(n+i)||0}function tn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=dt(e))&&(this._locale=t),this)}h.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",h.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var nn=n("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)});function rn(){return this._locale}var on=126227808e5;function an(e,t){return(e%t+t)%t}function sn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-on:new Date(e,t,n).valueOf()}function ln(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-on:Date.UTC(e,t,n)}function un(e,t){return t.erasAbbrRegex(e)}function cn(){for(var e=[],t=[],n=[],r=[],i=this.eras(),o=0,a=i.length;o<a;++o)t.push(fe(i[o].name)),e.push(fe(i[o].abbr)),n.push(fe(i[o].narrow)),r.push(fe(i[o].name)),r.push(fe(i[o].abbr)),r.push(fe(i[o].narrow));this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}function dn(e,t){R(0,[e,e.length],0,t)}function pn(e,t,n,r,i){var o;return null==e?He(this,r,i).year:((o=Ue(e,r,i))<t&&(t=o),function(e,t,n,r,i){var o=Ye(e,t,n,r,i),a=Fe(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,r,i))}R("N",0,0,"eraAbbr"),R("NN",0,0,"eraAbbr"),R("NNN",0,0,"eraAbbr"),R("NNNN",0,0,"eraName"),R("NNNNN",0,0,"eraNarrow"),R("y",["y",1],"yo","eraYear"),R("y",["yy",2],0,"eraYear"),R("y",["yyy",3],0,"eraYear"),R("y",["yyyy",4],0,"eraYear"),pe("N",un),pe("NN",un),pe("NNN",un),pe("NNNN",function(e,t){return t.erasNameRegex(e)}),pe("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),me(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?m(n).era=i:m(n).invalidEra=e}),pe("y",se),pe("yy",se),pe("yyy",se),pe("yyyy",se),pe("yo",function(e,t){return t._eraYearOrdinalRegex||se}),me(["y","yy","yyy","yyyy"],we),me(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[we]=n._locale.eraYearOrdinalParse(e,i):t[we]=parseInt(e,10)}),R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),dn("gggg","weekYear"),dn("ggggg","weekYear"),dn("GGGG","isoWeekYear"),dn("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),H("weekYear",1),H("isoWeekYear",1),pe("G",le),pe("g",le),pe("GG",te,Z),pe("gg",te,Z),pe("GGGG",oe,J),pe("gggg",oe,J),pe("GGGGG",ae,ee),pe("ggggg",ae,ee),ve(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=z(e)}),ve(["gg","GG"],function(e,t,n,r){t[r]=h.parseTwoDigitYear(e)}),R("Q",0,"Qo","quarter"),L("quarter","Q"),H("quarter",7),pe("Q",Q),me("Q",function(e,t){t[be]=3*(z(e)-1)}),R("D",["DD",2],"Do","date"),L("date","D"),H("date",9),pe("D",te),pe("DD",te,Z),pe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),me(["D","DD"],$e),me("Do",function(e,t){t[$e]=z(e.match(te)[0])});var hn=B("Date",!0);R("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),H("dayOfYear",4),pe("DDD",ie),pe("DDDD",X),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=z(e)}),R("m",["mm",2],0,"minute"),L("minute","m"),H("minute",14),pe("m",te),pe("mm",te,Z),me(["m","mm"],Se);var fn=B("Minutes",!1);R("s",["ss",2],0,"second"),L("second","s"),H("second",15),pe("s",te),pe("ss",te,Z),me(["s","ss"],Ce);var gn,mn,vn=B("Seconds",!1);for(R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),H("millisecond",16),pe("S",ie,Q),pe("SS",ie,Z),pe("SSS",ie,X),gn="SSSS";gn.length<=9;gn+="S")pe(gn,se);function yn(e,t){t[ke]=z(1e3*("0."+e))}for(gn="S";gn.length<=9;gn+="S")me(gn,yn);mn=B("Milliseconds",!1),R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var wn=$.prototype;function bn(e){return e}wn.add=Qt,wn.calendar=function(e,t){1===arguments.length&&(Jt(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=l(e)&&!u(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i=0;i<r.length;i+=1)n=n||f(e,r[i]);return t&&n}(arguments[0])&&(t=arguments[0],e=void 0));var n=e||Tt(),r=jt(n,this).startOf("day"),i=h.calendarFormat(this,r)||"sameElse",o=t&&(D(t[i])?t[i].call(this,n):t[i]);return this.format(o||this.localeData().calendar(i,this,Tt(n)))},wn.clone=function(){return new $(this)},wn.diff=function(e,t,n){var r,i,o;if(!this.isValid())return NaN;if(!(r=jt(e,this)).isValid())return NaN;switch(i=6e4*(r.utcOffset()-this.utcOffset()),t=F(t)){case"year":o=en(this,r)/12;break;case"month":o=en(this,r);break;case"quarter":o=en(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:q(o)},wn.endOf=function(e){var t,n;if(void 0===(e=F(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?ln:sn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-an(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-an(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-an(t,1e3)-1}return this._d.setTime(t),h.updateOffset(this,!0),this},wn.format=function(e){e=e||(this.isUtc()?h.defaultFormatUtc:h.defaultFormat);var t=I(this,e);return this.localeData().postformat(t)},wn.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Tt(e).isValid())?zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},wn.fromNow=function(e){return this.from(Tt(),e)},wn.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Tt(e).isValid())?zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},wn.toNow=function(e){return this.to(Tt(),e)},wn.get=function(e){return D(this[e=F(e)])?this[e]():this},wn.invalidAt=function(){return m(this).overflow},wn.isAfter=function(e,t){var n=_(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},wn.isBefore=function(e,t){var n=_(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},wn.isBetween=function(e,t,n,r){var i=_(e)?e:Tt(e),o=_(t)?t:Tt(t);return!!(this.isValid()&&i.isValid()&&o.isValid())&&(("("===(r=r||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===r[1]?this.isBefore(o,n):!this.isAfter(o,n)))},wn.isSame=function(e,t){var n,r=_(e)?e:Tt(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},wn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},wn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},wn.isValid=function(){return v(this)},wn.lang=nn,wn.locale=tn,wn.localeData=rn,wn.max=Et,wn.min=At,wn.parsingFlags=function(){return p({},m(this))},wn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)f(e,t)&&n.push({unit:t,priority:Y[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=j(e)),r=0;r<n.length;r++)this[n[r].unit](e[n[r].unit]);else if(D(this[e=F(e)]))return this[e](t);return this},wn.startOf=function(e){var t,n;if(void 0===(e=F(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?ln:sn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=an(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=an(t,6e4);break;case"second":t=this._d.valueOf(),t-=an(t,1e3)}return this._d.setTime(t),h.updateOffset(this,!0),this},wn.subtract=Zt,wn.toArray=function(){return[this.year(),this.month(),this.date(),this.hour(),this.minute(),this.second(),this.millisecond()]},wn.toObject=function(){return{years:this.year(),months:this.month(),date:this.date(),hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()}},wn.toDate=function(){return new Date(this.valueOf())},wn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?I(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",I(n,"Z")):I(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},wn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r="moment",i="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=i+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(wn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),wn.toJSON=function(){return this.isValid()?this.toISOString():null},wn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},wn.unix=function(){return Math.floor(this.valueOf()/1e3)},wn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},wn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},wn.eraName=function(){for(var e,t=this.localeData().eras(),n=0,r=t.length;n<r;++n){if(e=this.startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].name;if(t[n].until<=e&&e<=t[n].since)return t[n].name}return""},wn.eraNarrow=function(){for(var e,t=this.localeData().eras(),n=0,r=t.length;n<r;++n){if(e=this.startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].narrow;if(t[n].until<=e&&e<=t[n].since)return t[n].narrow}return""},wn.eraAbbr=function(){for(var e,t=this.localeData().eras(),n=0,r=t.length;n<r;++n){if(e=this.startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].abbr;if(t[n].until<=e&&e<=t[n].since)return t[n].abbr}return""},wn.eraYear=function(){for(var e,t,n=this.localeData().eras(),r=0,i=n.length;r<i;++r)if(e=n[r].since<=n[r].until?1:-1,t=this.startOf("day").valueOf(),n[r].since<=t&&t<=n[r].until||n[r].until<=t&&t<=n[r].since)return(this.year()-h(n[r].since).year())*e+n[r].offset;return this.year()},wn.year=Le,wn.isLeapYear=function(){return U(this.year())},wn.weekYear=function(e){return pn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},wn.isoWeekYear=function(e){return pn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},wn.quarter=wn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},wn.month=Ie,wn.daysInMonth=function(){return Oe(this.year(),this.month())},wn.week=wn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},wn.isoWeek=wn.isoWeeks=function(e){var t=He(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},wn.weeksInYear=function(){var e=this.localeData()._week;return Ue(this.year(),e.dow,e.doy)},wn.weeksInWeekYear=function(){var e=this.localeData()._week;return Ue(this.weekYear(),e.dow,e.doy)},wn.isoWeeksInYear=function(){return Ue(this.year(),1,4)},wn.isoWeeksInISOWeekYear=function(){return Ue(this.isoWeekYear(),1,4)},wn.date=hn,wn.day=wn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,r=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-r,"d")):r},wn.weekday=function(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")},wn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,n,r=(t=e,n=this.localeData(),"string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?r:r-7)},wn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},wn.hour=wn.hours=tt,wn.minute=wn.minutes=fn,wn.second=wn.seconds=vn,wn.millisecond=wn.milliseconds=mn,wn.utcOffset=function(e,t,n){var r,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Yt(this);if("string"==typeof e){if(null===(e=Ft(ce,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=Yt(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==e&&(!t||this._changeInProgress?Kt(this,zt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,h.updateOffset(this,!0),this._changeInProgress=null)),this},wn.utc=function(e){return this.utcOffset(0,e)},wn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Yt(this),"m")),this},wn.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Ft(ue,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},wn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},wn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},wn.isLocal=function(){return!!this.isValid()&&!this._isUTC},wn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},wn.isUtc=Ht,wn.isUTC=Ht,wn.zoneAbbr=function(){return this._isUTC?"UTC":""},wn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},wn.dates=n("dates accessor is deprecated. Use date instead.",hn),wn.months=n("months accessor is deprecated. Use month instead",Ie),wn.years=n("years accessor is deprecated. Use year instead",Le),wn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),wn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e,t={};return b(t,this),(t=xt(t))._a?(e=(t._isUTC?g:Tt)(t._a),this._isDSTShifted=this.isValid()&&0<function(e,t,n){for(var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),o=0,a=0;a<r;a++)(n&&e[a]!==t[a]||!n&&z(e[a])!==z(t[a]))&&o++;return o+i}(t._a,e.toArray())):this._isDSTShifted=!1,this._isDSTShifted});var $n=O.prototype;function _n(e,t,n,r){var i=dt(),o=g().set(r,t);return i[n](o,e)}function Sn(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return _n(e,t,n,"month");for(var r=[],i=0;i<12;i++)r[i]=_n(e,i,n,"month");return r}function Cn(e,t,n,r){t=("boolean"==typeof e?c(t)&&(n=t,t=void 0):(t=e,e=!1,c(n=t)&&(n=t,t=void 0)),t||"");var i,o=dt(),a=e?o._week.dow:0,s=[];if(null!=n)return _n(t,(n+a)%7,r,"day");for(i=0;i<7;i++)s[i]=_n(t,(i+a)%7,r,"day");return s}$n.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return D(r)?r.call(t,n):r},$n.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(A).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},$n.invalidDate=function(){return this._invalidDate},$n.ordinal=function(e){return this._ordinal.replace("%d",e)},$n.preparse=bn,$n.postformat=bn,$n.relativeTime=function(e,t,n,r){var i=this._relativeTime[n];return D(i)?i(e,t,n,r):i.replace(/%d/i,e)},$n.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return D(n)?n(t):n.replace(/%s/i,t)},$n.set=function(e){var t,n;for(n in e)f(e,n)&&(D(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},$n.eras=function(e,t){for(var n,r=this._eras||dt("en")._eras,i=0,o=r.length;i<o;++i){switch(typeof r[i].since){case"string":n=h(r[i].since).startOf("day"),r[i].since=n.valueOf()}switch(typeof r[i].until){case"undefined":r[i].until=1/0;break;case"string":n=h(r[i].until).startOf("day").valueOf(),r[i].until=n.valueOf()}}return r},$n.erasParse=function(e,t,n){var r,i,o,a,s,l=this.eras();for(e=e.toUpperCase(),r=0,i=l.length;r<i;++r)if(o=l[r].name.toUpperCase(),a=l[r].abbr.toUpperCase(),s=l[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return l[r];break;case"NNNN":if(o===e)return l[r];break;case"NNNNN":if(s===e)return l[r]}else if(0<=[o,a,s].indexOf(e))return l[r]},$n.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?h(e.since).year():h(e.since).year()+(t-e.offset)*n},$n.erasAbbrRegex=function(e){return f(this,"_erasAbbrRegex")||cn.call(this),e?this._erasAbbrRegex:this._erasRegex},$n.erasNameRegex=function(e){return f(this,"_erasNameRegex")||cn.call(this),e?this._erasNameRegex:this._erasRegex},$n.erasNarrowRegex=function(e){return f(this,"_erasNarrowRegex")||cn.call(this),e?this._erasNarrowRegex:this._erasRegex},$n.months=function(e,t){return e?s(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Ee).test(t)?"format":"standalone"][e.month()]:s(this._months)?this._months:this._months.standalone},$n.monthsShort=function(e,t){return e?s(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ee.test(t)?"format":"standalone"][e.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},$n.monthsParse=function(e,t,n){var r,i,o;if(this._monthsParseExact)return function(e,t,n){var r,i,o,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=g([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=ye.call(this._shortMonthsParse,a))||-1!==(i=ye.call(this._longMonthsParse,a))?i:null:-1!==(i=ye.call(this._longMonthsParse,a))||-1!==(i=ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=g([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}},$n.monthsRegex=function(e){return this._monthsParseExact?(f(this,"_monthsRegex")||Ve.call(this),e?this._monthsStrictRegex:this._monthsRegex):(f(this,"_monthsRegex")||(this._monthsRegex=Me),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},$n.monthsShortRegex=function(e){return this._monthsParseExact?(f(this,"_monthsRegex")||Ve.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(f(this,"_monthsShortRegex")||(this._monthsShortRegex=Pe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},$n.week=function(e){return He(e,this._week.dow,this._week.doy).week},$n.firstDayOfYear=function(){return this._week.doy},$n.firstDayOfWeek=function(){return this._week.dow},$n.weekdays=function(e,t){var n=s(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?qe(n,this._week.dow):e?n[e.day()]:n},$n.weekdaysMin=function(e){return!0===e?qe(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},$n.weekdaysShort=function(e){return!0===e?qe(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},$n.weekdaysParse=function(e,t,n){var r,i,o;if(this._weekdaysParseExact)return function(e,t,n){var r,i,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=g([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=ye.call(this._weekdaysParse,a))||-1!==(i=ye.call(this._shortWeekdaysParse,a))||-1!==(i=ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=ye.call(this._shortWeekdaysParse,a))||-1!==(i=ye.call(this._weekdaysParse,a))||-1!==(i=ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=ye.call(this._minWeekdaysParse,a))||-1!==(i=ye.call(this._weekdaysParse,a))||-1!==(i=ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=g([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}},$n.weekdaysRegex=function(e){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||Ze.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(f(this,"_weekdaysRegex")||(this._weekdaysRegex=Ge),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},$n.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||Ze.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(f(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ke),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},$n.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||Ze.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(f(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Qe),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},$n.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},$n.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ut("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===z(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),h.lang=n("moment.lang is deprecated. Use moment.locale instead.",ut),h.langData=n("moment.langData is deprecated. Use moment.localeData instead.",dt);var kn=Math.abs;function Dn(e,t,n,r){var i=zt(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function xn(e){return e<0?Math.floor(e):Math.ceil(e)}function On(e){return 4800*e/146097}function Tn(e){return 146097*e/4800}function An(e){return function(){return this.as(e)}}var En=An("ms"),Pn=An("s"),Mn=An("m"),Rn=An("h"),In=An("d"),Vn=An("w"),Nn=An("M"),Ln=An("Q"),Fn=An("y");function jn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Yn=jn("milliseconds"),Hn=jn("seconds"),Un=jn("minutes"),qn=jn("hours"),zn=jn("days"),Bn=jn("months"),Wn=jn("years");var Gn=Math.round,Kn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Qn(e,t,n,r){var i=zt(e).abs(),o=Gn(i.as("s")),a=Gn(i.as("m")),s=Gn(i.as("h")),l=Gn(i.as("d")),u=Gn(i.as("M")),c=Gn(i.as("w")),d=Gn(i.as("y")),p=(o<=n.ss?["s",o]:o<n.s&&["ss",o])||a<=1&&["m"]||a<n.m&&["mm",a]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(p=p||c<=1&&["w"]||c<n.w&&["ww",c]),(p=p||u<=1&&["M"]||u<n.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=t,p[3]=0<+e,p[4]=r,function(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}.apply(null,p)}var Zn=Math.abs;function Xn(e){return(0<e)-(e<0)||+e}function Jn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,o,a,s,l=Zn(this._milliseconds)/1e3,u=Zn(this._days),c=Zn(this._months),d=this.asSeconds();return d?(e=q(l/60),t=q(e/60),l%=60,e%=60,n=q(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",o=Xn(this._months)!==Xn(d)?"-":"",a=Xn(this._days)!==Xn(d)?"-":"",s=Xn(this._milliseconds)!==Xn(d)?"-":"",i+"P"+(n?o+n+"Y":"")+(c?o+c+"M":"")+(u?a+u+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var er=Rt.prototype;return er.isValid=function(){return this._isValid},er.abs=function(){var e=this._data;return this._milliseconds=kn(this._milliseconds),this._days=kn(this._days),this._months=kn(this._months),e.milliseconds=kn(e.milliseconds),e.seconds=kn(e.seconds),e.minutes=kn(e.minutes),e.hours=kn(e.hours),e.months=kn(e.months),e.years=kn(e.years),this},er.add=function(e,t){return Dn(this,e,t,1)},er.subtract=function(e,t){return Dn(this,e,t,-1)},er.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=F(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+On(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Tn(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)}},er.asMilliseconds=En,er.asSeconds=Pn,er.asMinutes=Mn,er.asHours=Rn,er.asDays=In,er.asWeeks=Vn,er.asMonths=Nn,er.asQuarters=Ln,er.asYears=Fn,er.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*z(this._months/12):NaN},er._bubble=function(){var e,t,n,r,i,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return 0<=o&&0<=a&&0<=s||o<=0&&a<=0&&s<=0||(o+=864e5*xn(Tn(s)+a),s=a=0),l.milliseconds=o%1e3,e=q(o/1e3),l.seconds=e%60,t=q(e/60),l.minutes=t%60,n=q(t/60),l.hours=n%24,a+=q(n/24),s+=i=q(On(a)),a-=xn(Tn(i)),r=q(s/12),s%=12,l.days=a,l.months=s,l.years=r,this},er.clone=function(){return zt(this)},er.get=function(e){return e=F(e),this.isValid()?this[e+"s"]():NaN},er.milliseconds=Yn,er.seconds=Hn,er.minutes=Un,er.hours=qn,er.days=zn,er.weeks=function(){return q(this.days()/7)},er.months=Bn,er.years=Wn,er.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,o=Kn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(o=Object.assign({},Kn,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),n=this.localeData(),r=Qn(this,!i,o,n),i&&(r=n.pastFuture(+this,r)),n.postformat(r)},er.toISOString=Jn,er.toString=Jn,er.toJSON=Jn,er.locale=tn,er.localeData=rn,er.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Jn),er.lang=nn,R("X",0,0,"unix"),R("x",0,0,"valueOf"),pe("x",le),pe("X",/[+-]?\d+(\.\d{1,3})?/),me("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),me("x",function(e,t,n){n._d=new Date(z(e))}),h.version="2.25.2",e=Tt,h.fn=wn,h.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},h.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},h.now=function(){return Date.now?Date.now():+new Date},h.utc=g,h.unix=function(e){return Tt(1e3*e)},h.months=function(e,t){return Sn(e,t,"months")},h.isDate=a,h.locale=ut,h.invalid=y,h.duration=zt,h.isMoment=_,h.weekdays=function(e,t,n){return Cn(e,t,n,"weekdays")},h.parseZone=function(){return Tt.apply(null,arguments).parseZone()},h.localeData=dt,h.isDuration=It,h.monthsShort=function(e,t){return Sn(e,t,"monthsShort")},h.weekdaysMin=function(e,t,n){return Cn(e,t,n,"weekdaysMin")},h.defineLocale=ct,h.updateLocale=function(e,t){var n,r,i;return null!=t?(i=rt,null!=it[e]&&null!=it[e].parentLocale?it[e].set(x(it[e]._config,t)):(null!=(r=lt(e))&&(i=r._config),t=x(i,t),null==r&&(t.abbr=e),(n=new O(t)).parentLocale=it[e],it[e]=n),ut(e)):null!=it[e]&&(null!=it[e].parentLocale?(it[e]=it[e].parentLocale,e===ut()&&ut(e)):null!=it[e]&&delete it[e]),it[e]},h.locales=function(){return r(it)},h.weekdaysShort=function(e,t,n){return Cn(e,t,n,"weekdaysShort")},h.normalizeUnits=F,h.relativeTimeRounding=function(e){return void 0===e?Gn:"function"==typeof e&&(Gn=e,!0)},h.relativeTimeThreshold=function(e,t){return void 0!==Kn[e]&&(void 0===t?Kn[e]:(Kn[e]=t,"s"===e&&(Kn.ss=t-1),!0))},h.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},h.prototype=wn,h.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},h}),function(e,t){"use strict";"undefined"!=typeof module&&module.exports?(t("undefined"==typeof angular?require("angular"):angular,"undefined"==typeof moment?require("moment"):moment),module.exports="ui.bootstrap.datetimepicker"):"function"==typeof define&&define.amd?define(["angular","moment"],t):t(e.angular,e.moment)}(this,function(d,p){"use strict";function e(){return function(e,t,n){var r,i;switch(e){case"Date":r=o(function(e){return a(e).toDate()});break;case"moment":r=o(a);break;case"milliseconds":r=o(function(e){return p.utc(e,t,p.locale(),n).valueOf()});break;default:r=o((i=e,function(e){return a(e).format(i)}))}return r;function o(t){return function(e){return d.isUndefined(e)||""===e||null===e?null:t(e)}}function a(e){return p(e,t,p.locale(),n)}}}function t(c){return{require:"ngModel",restrict:"A",scope:{dateFormats:"="},link:function(e,t,n,r){if(d.isDefined(e.dateFormats)&&!d.isString(e.dateFormats)&&!d.isArray(e.dateFormats))throw new Error("date-formats must be a single string or an array of strings i.e. date-formats=\"['YYYY-MM-DD']\" ");if(d.isDefined(n.modelType)&&(!d.isString(n.modelType)||0===n.modelType.length))throw new Error('model-type must be "Date", "moment", "milliseconds", or a moment format string');var i=n.dateTimeInput||p.defaultFormat,o=void 0===n.dateParseStrict||"true"===n.dateParseStrict,a=n.modelType||"Date",s=[n.dateTimeInput,a].concat(e.dateFormats).concat([p.ISO_8601]).filter(u),l=[a].concat(s).filter(u);function u(e,t,n){return-1===["Date","moment","milliseconds",void 0].indexOf(e)&&n.indexOf(e)===t}r.$parsers.unshift(c(a,s,o)),r.$formatters.push(function(e){return d.isUndefined(e)||""===e||null===e?null:d.isDate(e)?p(e).format(i):d.isNumber(e)?p.utc(e).format(i):p(e,l,p.locale(),o).format(i)}),r.$validators.dateTimeInput=function(e,t){return!(!d.isUndefined(t)&&""!==t&&null!==t)||p(t,s,p.locale(),o).isValid()},t.bind("blur",function(){r.$viewValue=r.$formatters.filter(function(){return!0}).reverse().reduce(function(e,t){return t(e)},r.$modelValue),r.$render()})}}}d.module("ui.dateTimeInput",[]).service("dateTimeParserFactory",e).directive("dateTimeInput",t),e.$inject=[],t.$inject=["dateTimeParserFactory"]}),function(e,t){"use strict";"undefined"!=typeof module&&module.exports?(t("undefined"==typeof angular?require("angular"):angular,"undefined"==typeof moment?require("moment"):moment),module.exports="ui.bootstrap.datetimepicker"):"function"==typeof define&&define.amd?define(["angular","moment"],t):t(e.angular,e.moment)}(this,function(a,b){"use strict";function e(i,o){var e={bindToController:!1,controller:t,controllerAs:"dateTimePickerController",replace:!0,require:"ngModel",restrict:"E",scope:{beforeRender:"&",onSetTime:"&"},templateUrl:"templates/datetimepicker.html"};function t(u,e,n){var m=e.controller("ngModel"),v=t();u.screenReader=v.screenReader,u.changeView=function(e,t,n){n&&(n.stopPropagation(),n.preventDefault());if(e&&t.utcDateValue>-1/0&&t.selectable&&c[e]){var r=c[e](t.utcDateValue),i=[];if(r.weeks)for(var o=0;o<r.weeks.length;o+=1)for(var a=r.weeks[o],s=0;s<a.dates.length;s+=1){var l=a.dates[s];i.push(l)}u.beforeRender({$view:r.currentView,$dates:r.dates||i,$leftDate:r.leftDate,$upDate:r.previousViewDate,$rightDate:r.rightDate}),u.data=r}},m.$render=function(){u.changeView(v.startView,new w({utcDateValue:function(e){var t=new Date;if(e){var n=r(e);if(!n.isValid())throw new Error("Invalid date: "+e);t=n.toDate()}return t.getTime()-6e4*t.getTimezoneOffset()}(m.$viewValue)}))},v.configureOn&&u.$on(v.configureOn,function(){v=t(),u.screenReader=v.screenReader,m.$render()}),v.renderOn&&u.$on(v.renderOn,m.$render);var c={year:function(e){for(var t=b.utc(e).startOf("year"),n=10*parseInt(t.year()/10,10),r=b.utc(d(e)).subtract(1,"year").startOf("year"),i="YYYY",o=y(m.$modelValue,i),a=b().format(i),s={currentView:"year",nextView:"year"===v.minView?"setTime":"month",previousViewDate:new w({utcDateValue:null,display:n+"-"+(9+n)}),leftDate:new w({utcDateValue:b.utc(r).subtract(9,"year").valueOf()}),rightDate:new w({utcDateValue:b.utc(r).add(11,"year").valueOf()}),dates:[]},l=0;l<12;l+=1){var u=b.utc(r).add(l,"years"),c={active:u.format(i)===o,current:u.format(i)===a,display:u.format(i),future:u.year()>9+n,past:u.year()<n,utcDateValue:u.valueOf()};s.dates.push(new w(c))}return s},month:function(e){for(var t=b.utc(e).startOf("year"),n=d(e),r="YYYY-MMM",i=y(m.$modelValue,r),o=b().format(r),a={previousView:"year",currentView:"month",nextView:"month"===v.minView?"setTime":"day",previousViewDate:new w({utcDateValue:n.valueOf(),display:t.format("YYYY")}),leftDate:new w({utcDateValue:b.utc(t).subtract(1,"year").valueOf()}),rightDate:new w({utcDateValue:b.utc(t).add(1,"year").valueOf()}),dates:[]},s=0;s<12;s+=1){var l=b.utc(t).add(s,"months"),u={active:l.format(r)===i,current:l.format(r)===o,display:l.format("MMM"),utcDateValue:l.valueOf()};a.dates.push(new w(u))}return a},day:function(e){for(var t=b.utc(e),n=b.utc(t).startOf("month"),r=b.utc(t).startOf("year"),i=b.utc(t).endOf("month"),o=b.utc(n).subtract(Math.abs(n.weekday()),"days"),a="YYYY-MMM-DD",s=y(m.$modelValue,a),l=b().format(a),u={previousView:"month",currentView:"day",nextView:"day"===v.minView?"setTime":"hour",previousViewDate:new w({utcDateValue:r.valueOf(),display:n.format("YYYY-MMM")}),leftDate:new w({utcDateValue:b.utc(n).subtract(1,"months").valueOf()}),rightDate:new w({utcDateValue:b.utc(n).add(1,"months").valueOf()}),dayNames:[],weeks:[]},c=0;c<7;c+=1)u.dayNames.push(b.utc().weekday(c).format("dd"));for(var d=0;d<6;d+=1){for(var p={dates:[]},h=0;h<7;h+=1){var f=b.utc(o).add(7*d+h,"days"),g={active:f.format(a)===s,current:f.format(a)===l,display:f.format("D"),future:f.isAfter(i),past:f.isBefore(n),utcDateValue:f.valueOf()};p.dates.push(new w(g))}u.weeks.push(p)}return u},hour:function(e){for(var t=b.utc(e).startOf("day"),n=b.utc(t).startOf("month"),r="YYYY-MM-DD H",i=y(m.$modelValue,r),o=b().format(r),a={previousView:"day",currentView:"hour",nextView:"hour"===v.minView?"setTime":"minute",previousViewDate:new w({utcDateValue:n.valueOf(),display:t.format("ll")}),leftDate:new w({utcDateValue:b.utc(t).subtract(1,"days").valueOf()}),rightDate:new w({utcDateValue:b.utc(t).add(1,"days").valueOf()}),dates:[]},s=0;s<24;s+=1){var l=b.utc(t).add(s,"hours"),u={active:l.format(r)===i,current:l.format(r)===o,display:l.format("LT"),utcDateValue:l.valueOf()};a.dates.push(new w(u))}return a},minute:function(e){for(var t=b.utc(e).startOf("hour"),n=b.utc(t).startOf("day"),r="YYYY-MM-DD H:mm",i=y(m.$modelValue,r),o=b().format(r),a={previousView:"hour",currentView:"minute",nextView:"setTime",previousViewDate:new w({utcDateValue:n.valueOf(),display:t.format("lll")}),leftDate:new w({utcDateValue:b.utc(t).subtract(1,"hours").valueOf()}),rightDate:new w({utcDateValue:b.utc(t).add(1,"hours").valueOf()}),dates:[]},s=60/v.minuteStep,l=0;l<s;l+=1){var u=b.utc(t).add(l*v.minuteStep,"minute"),c={active:u.format(r)===i,current:u.format(r)===o,display:u.format("LT"),utcDateValue:u.valueOf()};a.dates.push(new w(c))}return a},setTime:function(e){var t=new Date(e),n=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());switch(v.modelType){case"Date":break;case"moment":n=b([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()]);break;case"milliseconds":n=e;break;default:n=b([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()]).format(v.modelType)}var r=m.$modelValue;m.$setViewValue(n),v.dropdownSelector&&jQuery(v.dropdownSelector).dropdown("toggle");return u.onSetTime({newDate:n,oldDate:r}),c[v.startView](e)}};function d(e){var t=10*parseInt(b.utc(e).year()/10,10);return b.utc(e).year(t).startOf("year")}function y(e,t){return e?r(e).format(t):""}function r(e){return b(e,a.isString(e)?v.parseFormat:void 0)}function t(){var e={};n.datetimepickerConfig&&(e=u.$parent.$eval(n.datetimepickerConfig));var t=a.extend({},i,e);return o.validate(t),t}}function w(){var e=new Date(arguments[0].utcDateValue),t=6e4*e.getTimezoneOffset();this.utcDateValue=e.getTime(),this.selectable=!0,this.localDateValue=function(){return this.utcDateValue+t};var n=["active","current","display","future","past","selectable","utcDateValue"],r=arguments[0];Object.keys(r).filter(function(e){return 0<=n.indexOf(e)}).forEach(function(e){this[e]=r[e]},this)}return t.$inject=["$scope","$element","$attrs"],e}function t(i){return{validate:function(e){var t=["configureOn","dropdownSelector","minuteStep","minView","modelType","parseFormat","renderOn","startView","screenReader"],n=Object.keys(e).filter(function(e){return t.indexOf(e)<0});if(n.length)throw new Error("Invalid options: "+n.join(", "));var r=["minute","hour","day","month","year"];if(r.indexOf(e.startView)<0)throw new Error("invalid startView value: "+e.startView);if(r.indexOf(e.minView)<0)throw new Error("invalid minView value: "+e.minView);if(r.indexOf(e.minView)>r.indexOf(e.startView))throw new Error("startView must be greater than minView");if(!a.isNumber(e.minuteStep))throw new Error("minuteStep must be numeric");if(e.minuteStep<=0||60<=e.minuteStep)throw new Error("minuteStep must be greater than zero and less than 60");if(null!==e.configureOn&&!a.isString(e.configureOn))throw new Error("configureOn must be a string");if(null!==e.configureOn&&e.configureOn.length<1)throw new Error("configureOn must not be an empty string");if(null!==e.renderOn&&!a.isString(e.renderOn))throw new Error("renderOn must be a string");if(null!==e.renderOn&&e.renderOn.length<1)throw new Error("renderOn must not be an empty string");if(null!==e.modelType&&!a.isString(e.modelType))throw new Error("modelType must be a string");if(null!==e.modelType&&e.modelType.length<1)throw new Error("modelType must not be an empty string");"Date"!==e.modelType&&"moment"!==e.modelType&&"milliseconds"!==e.modelType&&(e.parseFormat=e.modelType);if(null!==e.dropdownSelector&&!a.isString(e.dropdownSelector))throw new Error("dropdownSelector must be a string");null===e.dropdownSelector||"undefined"!=typeof jQuery&&"function"==typeof jQuery().dropdown||(i.error("Please DO NOT specify the dropdownSelector option unless you are using jQuery AND Bootstrap.js. Please include jQuery AND Bootstrap.js, or write code to close the dropdown in the on-set-time callback. \n\nThe dropdownSelector configuration option is being removed because it will not function properly."),delete e.dropdownSelector)}}}a.module("ui.bootstrap.datetimepicker",[]).service("dateTimePickerConfig",function(){var e={bg:{previous:"предишна",next:"следваща"},ca:{previous:"anterior",next:"següent"},da:{previous:"forrige",next:"næste"},de:{previous:"vorige",next:"weiter"},"en-au":{previous:"previous",next:"next"},"en-gb":{previous:"previous",next:"next"},en:{previous:"previous",next:"next"},"es-us":{previous:"atrás",next:"siguiente"},es:{previous:"atrás",next:"siguiente"},fi:{previous:"edellinen",next:"seuraava"},fr:{previous:"précédent",next:"suivant"},hu:{previous:"előző",next:"következő"},it:{previous:"precedente",next:"successivo"},ja:{previous:"前へ",next:"次へ"},ml:{previous:"മുൻപുള്ളത്",next:"അടുത്തത്"},nl:{previous:"vorige",next:"volgende"},pl:{previous:"poprzednia",next:"następna"},"pt-br":{previous:"anteriores",next:"próximos"},pt:{previous:"anterior",next:"próximo"},ro:{previous:"anterior",next:"următor"},ru:{previous:"предыдущая",next:"следующая"},sk:{previous:"predošlá",next:"ďalšia"},sv:{previous:"föregående",next:"nästa"},tr:{previous:"önceki",next:"sonraki"},uk:{previous:"назад",next:"далі"},"zh-cn":{previous:"上一页",next:"下一页"},"zh-tw":{previous:"上一頁",next:"下一頁"}}[b.locale().toLowerCase()];return a.extend({},{configureOn:null,dropdownSelector:null,minuteStep:5,minView:"minute",modelType:"Date",parseFormat:"YYYY-MM-DDTHH:mm:ss.SSSZZ",renderOn:null,startView:"day"},{screenReader:e})}).service("dateTimePickerValidator",t).directive("datetimepicker",e),e.$inject=["dateTimePickerConfig","dateTimePickerValidator"],t.$inject=["$log"]}),angular.module("rzTable",[]),angular.module("rzTable").directive("rzTable",["resizeStorage","$injector","$parse",function(g,o,u){function e(e){}function c(n,r,i){return function(e,t){!0!==i.busy&&void 0!==t&&t!==e&&(d(),p(n,r,i))}}function d(){k=!0,l.map(function(e){e.remove()}),l=[]}function p(e,t,n){var r,i;n.busy||(b=$(e).find("th"),v=n.mode,y=!angular.isDefined(n.saveTableSizes)||n.saveTableSizes,w=n.profile,(r=function(t,e){try{var n=e.rzMode?t.mode:"BasicResizer";return o.get(n)}catch(e){return console.error("The resizer "+t.mode+" was not found"),null}}(n,t))&&(C=new r(e,b,h),y&&(D=g.loadTableSizes(e,n.mode,n.profile)),s=C.handles(b),a=C.ctrlColumns,C.setup(),(i=D)&&($(S).width("auto"),a.each(function(e,t){var n=angular.element(t).scope().rzCol||$(t).attr("id"),r=i[n];$(t).css({width:r})}),C.onTableReady()),s.each(function(e,t){!function(e,t){var n=$("<div>",{class:e.options.handleClass||"rz-handle"});$(t).prepend(n),l.push(n);var r=C.handleMiddleware(n,t);!function(p,h,f){$(h).mousedown(function(e){k&&(C.onFirstDrag(f,h),C.onTableReady(),k=!1),p.options.onResizeStarted&&p.options.onResizeStarted(f);var t={};C.intervene&&(((t=C.intervene.selector(f)).column=t).orgWidth=$(t).width()),e.preventDefault(),$(h).addClass(p.options.handleClassActive||"rz-handle-active");var n,r,i,o,a,s,l,u,c=e.clientX,d=$(f).width();o=p,a=f,s=c,l=d,u=t,_=function(e){var t=e.clientX-s,n=C.calculate(l,t);if(!(n<m(a)||C.restrict(n,t))){if(C.intervene){var r=C.intervene.calculator(u.orgWidth,t);if(r<m(u.column))return;if(C.intervene.restrict(r,t))return;$(u.column).width(r)}o.options.onResizeInProgress&&o.options.onResizeInProgress(a,n,t),$(a).width(n)}},$(window).mousemove(_),$(window).one("mouseup",(n=p,r=f,i=h,function(){$(i).removeClass(n.options.handleClassActive||"rz-handle-active"),_&&$(window).unbind("mousemove",_),n.options.onResizeEnded&&n.options.onResizeEnded(r),C.onEndDrag(),y&&(D=D||{},$(b).each(function(e,t){var n=angular.element(t).scope().rzCol||$(t).attr("id");n&&(D[n]=C.saveAttr(t))}),g.saveTableSizes(S,v,w,D))}))})}(e,n,r)}(n,t)})))}function m(e){return parseInt($(e).css("min-width"))||0}var v,y,w,b=null,a=null,s=null,_=null,l=[],S=null,h=null,C=null,k=!0,D=null;return e.$inject=["$scope","$attrs","$element"],{restrict:"A",link:function(e,t,n){var r,i,o,a,s,l;S=t,h=e.container?$(e.container):$(S).parent(),e.options=n.rzOptions&&e.options||{},$(S).addClass(e.options.tableClass||"rz-table"),p(S,n,e),function(t,e,n){{e.rzModel&&u(e.rzModel).assign(n.$parent,{update:function(){d(),p(t,e,n)},reset:function(){var e;e=t,$(e).outerWidth("100%"),$(e).find("th").width("auto"),this.clearStorageActive(),this.update()},clearStorage:function(){g.clearAll()},clearStorageActive:function(){g.clearCurrent(t,v,w)}})}}(S,n,e),a=S,s=n,(l=e).$watch(function(){return $(a).find("th").length},c(a,s,l)),r=S,i=n,(o=e).$watch("profile",c(r,i,o)),o.$watch("mode",c(r,i,o)),o.$watch("busy",c(r,i,o))},controller:e,scope:{mode:"=rzMode",profile:"=?rzProfile",busy:"=?rzBusy",saveTableSizes:"=?rzSave",options:"=?rzOptions",model:"=rzModel",container:"@rzContainer"}}}]),angular.module("rzTable").directive("rzCol",[function(){return{restrict:"A",priority:650,link:function(e,t,n){e.rzCol=e.$eval(n.rzCol)},require:"^^rzTable",scope:!0}}]),angular.module("rzTable").service("resizeStorage",["$window",function(a){function s(e,t,n){return e.attr("id")?r+"."+e.attr("id")+"."+t+(n?"."+n:""):void console.error("Table has no id",e)}var r="ngColumnResize";this.loadTableSizes=function(e,t,n){var r=s(e,t,n),i=a.localStorage.getItem(r);return JSON.parse(i)},this.saveTableSizes=function(e,t,n,r){var i,o=s(e,t,n);o&&(i=JSON.stringify(r),a.localStorage.setItem(o,i))},this.clearAll=function(){for(var e=[],t=0;t<a.localStorage.length;++t){var n=localStorage.key(t);n&&n.startsWith(r)&&e.push(n)}e.map(function(e){a.localStorage.removeItem(e)})},this.clearCurrent=function(e,t,n){var r=s(e,t,n);r&&a.localStorage.removeItem(r)}}]),angular.module("rzTable").factory("ResizerModel",[function(){function e(e,t,n){this.table=e,this.columns=t,this.container=n,this.handleColumns=this.handles(),this.ctrlColumns=this.ctrlColumns()}return e.prototype.setup=function(){$(this.container).css({overflowX:"hidden"})},e.prototype.onTableReady=function(){$(this.table).outerWidth("100%")},e.prototype.getMinWidth=function(e){return parseInt($(e).css("min-width"))||0},e.prototype.handles=function(){return this.columns},e.prototype.ctrlColumns=function(){return this.handleColumns},e.prototype.onFirstDrag=function(){$(this.ctrlColumns).each(function(e,t){$(t).width($(t).width())})},e.prototype.handleMiddleware=function(e,t){return t},e.prototype.restrict=function(e){return!1},e.prototype.calculate=function(e,t){return e+t},e.prototype.onEndDrag=function(){},e.prototype.saveAttr=function(e){return $(e).outerWidth()},e}]),angular.module("rzTable").factory("BasicResizer",["ResizerModel",function(r){function e(e,t,n){r.call(this,e,t,n),this.ctrlColumns=this.columns,this.intervene={selector:i,calculator:o,restrict:a}}function i(e){return $(e).next()}function o(e,t){return e-t}function a(e){return e<25}return(e.prototype=Object.create(r.prototype)).setup=function(){$(this.container).css({overflowX:"hidden"}),$(this.table).css({width:"100%"})},e.prototype.handles=function(){return $(this.columns).not(":last")},e.prototype.onFirstDrag=function(){this.onEndDrag()},e.prototype.onEndDrag=function(){var r=$(this.table).outerWidth(),i=[];$(this.columns).each(function(e,t){var n=$(t).outerWidth()/r*100+"%";i.push(function(){$(t).css({width:n})})}),i.map(function(e){e()})},e.prototype.saveAttr=function(e){return $(e)[0].style.width},e}]),angular.module("rzTable").factory("FixedResizer",["ResizerModel",function(r){function e(e,t,n){r.call(this,e,t,n),this.fixedColumn=$(e).find("th").first(),this.bound=!1}return(e.prototype=Object.create(r.prototype)).setup=function(){$(this.container).css({overflowX:"hidden"}),$(this.table).css({width:"100%"}),$(this.columns).first().css({width:"auto"})},e.prototype.handles=function(){return $(this.columns).not(":last")},e.prototype.ctrlColumns=function(){return $(this.columns).not(":first")},e.prototype.onFirstDrag=function(){$(this.ctrlColumns).each(function(e,t){$(t).width($(t).width())})},e.prototype.handleMiddleware=function(e,t){return $(t).next()},e.prototype.restrict=function(e,t){return this.bound&&this.bound<t?this.bound=!1:!!(this.bound&&this.bound>t)||(this.fixedColumn.width()<=this.getMinWidth(this.fixedColumn)?(this.bound=t,$(this.fixedColumn).width(this.minWidth),!0):void 0)},e.prototype.onEndDrag=function(){this.bound=!1},e.prototype.calculate=function(e,t){return e-t},e}]),angular.module("rzTable").factory("OverflowResizer",["ResizerModel",function(r){function e(e,t,n){r.call(this,e,t,n)}return(e.prototype=Object.create(r.prototype)).setup=function(){$(this.container).css({overflow:"auto"})},e.prototype.onTableReady=function(){$(this.table).width(1)},e}]),function(e,t){"function"==typeof define&&define.amd?define(["angular"],t):"object"==typeof module&&module.exports?module.exports=t(require("angular")):e.angularClipboard=t(e.angular)}(this,function(i){return i.module("angular-clipboard",[]).factory("clipboard",["$document","$window",function(l,u){return{copyText:function(e,t){var n,r,i=u.pageXOffset||l[0].documentElement.scrollLeft,o=u.pageYOffset||l[0].documentElement.scrollTop,a=t&&t.container||l[0].body,s=(n=e,(r=l[0].createElement("textarea")).style.position="absolute",r.style.fontSize="12pt",r.style.border="0",r.style.padding="0",r.style.margin="0",r.style.left="-10000px",r.style.top=(u.pageYOffset||l[0].documentElement.scrollTop)+"px",r.textContent=n,r);a.appendChild(s),function(e){try{l[0].body.style.webkitUserSelect="initial";var t=l[0].getSelection();t.removeAllRanges();var n=document.createRange();n.selectNodeContents(e),t.addRange(n),e.select(),e.setSelectionRange(0,999999);try{if(!l[0].execCommand("copy"))throw"failure copy"}finally{t.removeAllRanges()}}finally{l[0].body.style.webkitUserSelect=""}}(s),u.scrollTo(i,o),a.removeChild(s)},supported:"queryCommandSupported"in l[0]&&l[0].queryCommandSupported("copy")}}]).directive("clipboard",["clipboard",function(r){return{restrict:"A",scope:{onCopied:"&",onError:"&",text:"=",supported:"=?"},link:function(t,n){t.supported=r.supported,n.on("click",function(e){try{r.copyText(t.text,n[0]),i.isFunction(t.onCopied)&&t.$evalAsync(t.onCopied())}catch(e){i.isFunction(t.onError)&&t.$evalAsync(t.onError({err:e}))}})}}}])}),function(e,t){"function"==typeof define&&define.amd?define("sifter",t):"object"==typeof exports?module.exports=t():e.Sifter=t()}(this,function(){function e(e,t){this.items=e,this.settings=t||{diacritics:!0}}e.prototype.tokenize=function(e){if(!(e=s(String(e||"").toLowerCase()))||!e.length)return[];for(var t,n,r=[],i=e.split(/ +/),o=0,a=i.length;o<a;o++){if(t=l(i[o]),this.settings.diacritics)for(n in u)u.hasOwnProperty(n)&&(t=t.replace(new RegExp(n,"g"),u[n]));r.push({string:i[o],regex:new RegExp(t,"i")})}return r},e.prototype.iterator=function(e,t){var n=a(e)?Array.prototype.forEach||function(e){for(var t=0,n=this.length;t<n;t++)e(this[t],t,this)}:function(e){for(var t in this)this.hasOwnProperty(t)&&e(this[t],t,this)};n.apply(e,[t])},e.prototype.getScoreFunction=function(e,t){var i,o,a,s;e=this.prepareSearch(e,t),o=e.tokens,i=e.options.fields,a=o.length,s=e.options.nesting;function l(e,t){var n,r;return!e||-1===(r=(e=String(e||"")).search(t.regex))?0:(n=t.string.length/e.length,0===r&&(n+=.5),n)}var u,c=(u=i.length)?1===u?function(e,t){return l(f(t,i[0],s),e)}:function(e,t){for(var n=0,r=0;n<u;n++)r+=l(f(t,i[n],s),e);return r/u}:function(){return 0};return a?1===a?function(e){return c(o[0],e)}:"and"===e.options.conjunction?function(e){for(var t,n=0,r=0;n<a;n++){if((t=c(o[n],e))<=0)return 0;r+=t}return r/a}:function(e){for(var t=0,n=0;t<a;t++)n+=c(o[t],e);return n/a}:function(){return 0}},e.prototype.getSortFunction=function(e,n){function o(e,t){return"$score"===e?t.score:f(c.items[t.id],e,n.nesting)}var t,r,i,a,s,l,u,c=this,d=!(e=c.prepareSearch(e,n)).query&&n.sort_empty||n.sort,p=[];if(d)for(t=0,r=d.length;t<r;t++)!e.query&&"$score"===d[t].field||p.push(d[t]);if(e.query){for(u=!0,t=0,r=p.length;t<r;t++)if("$score"===p[t].field){u=!1;break}u&&p.unshift({field:"$score",direction:"desc"})}else for(t=0,r=p.length;t<r;t++)if("$score"===p[t].field){p.splice(t,1);break}for(l=[],t=0,r=p.length;t<r;t++)l.push("desc"===p[t].direction?-1:1);return(a=p.length)?1===a?(i=p[0].field,s=l[0],function(e,t){return s*h(o(i,e),o(i,t))}):function(e,t){for(var n,r,i=0;i<a;i++)if(r=p[i].field,n=l[i]*h(o(r,e),o(r,t)))return n;return 0}:null},e.prototype.prepareSearch=function(e,t){if("object"==typeof e)return e;var n=(t=o({},t)).fields,r=t.sort,i=t.sort_empty;return n&&!a(n)&&(t.fields=[n]),r&&!a(r)&&(t.sort=[r]),i&&!a(i)&&(t.sort_empty=[i]),{options:t,query:String(e||"").toLowerCase(),tokens:this.tokenize(e),total:0,items:[]}},e.prototype.search=function(e,n){var r,t,i,o=this.prepareSearch(e,n);return n=o.options,e=o.query,i=n.score||this.getScoreFunction(o),e.length?this.iterator(this.items,function(e,t){r=i(e),(!1===n.filter||0<r)&&o.items.push({score:r,id:t})}):this.iterator(this.items,function(e,t){o.items.push({score:1,id:t})}),(t=this.getSortFunction(o,n))&&o.items.sort(t),o.total=o.items.length,"number"==typeof n.limit&&(o.items=o.items.slice(0,n.limit)),o};var h=function(e,t){return"number"==typeof e&&"number"==typeof t?t<e?1:e<t?-1:0:(e=n(String(e||"")),(t=n(String(t||"")))<e?1:e<t?-1:0)},o=function(e,t){for(var n,r,i=1,o=arguments.length;i<o;i++)if(r=arguments[i])for(n in r)r.hasOwnProperty(n)&&(e[n]=r[n]);return e},f=function(e,t,n){if(e&&t){if(!n)return e[t];for(var r=t.split(".");r.length&&(e=e[r.shift()]););return e}},s=function(e){return(e+"").replace(/^\s+|\s+$|/g,"")},l=function(e){return(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},a=Array.isArray||"undefined"!=typeof $&&$.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},u={a:"[aḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]",b:"[b␢βΒB฿𐌁ᛒ]",c:"[cĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕ]",d:"[dĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅð]",e:"[eÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇɘǝƏƐε]",f:"[fƑƒḞḟ]",g:"[gɢ₲ǤǥĜĝĞğĢģƓɠĠġ]",h:"[hĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]",i:"[iÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪ]",j:"[jȷĴĵɈɉʝɟʲ]",k:"[kƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]",l:"[lŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟ]",n:"[nŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴŊŋ]",o:"[oØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌōÕõǪǫȌȍՕօ]",p:"[pṔṕṖṗⱣᵽƤƥᵱ]",q:"[qꝖꝗʠɊɋꝘꝙq̃]",r:"[rŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]",s:"[sŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]",t:"[tŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]",u:"[uŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ]",v:"[vṼṽṾṿƲʋꝞꝟⱱʋ]",w:"[wẂẃẀẁŴŵẄẅẆẇẈẉ]",x:"[xẌẍẊẋχ]",y:"[yÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]",z:"[zŹźẐẑŽžŻżẒẓẔẕƵƶ]"},n=function(){var e,t,n,r,i="",o={};for(n in u)if(u.hasOwnProperty(n))for(i+=r=u[n].substring(2,u[n].length-1),e=0,t=r.length;e<t;e++)o[r.charAt(e)]=n;var a=new RegExp("["+i+"]","g");return function(e){return e.replace(a,function(e){return o[e]}).toLowerCase()}}();return e}),function(e,t){"function"==typeof define&&define.amd?define("microplugin",t):"object"==typeof exports?module.exports=t():e.MicroPlugin=t()}(this,function(){var e={mixin:function(r){r.plugins={},r.prototype.initializePlugins=function(e){var t,n,r,i=[];if(this.plugins={names:[],settings:{},requested:{},loaded:{}},o.isArray(e))for(t=0,n=e.length;t<n;t++)"string"==typeof e[t]?i.push(e[t]):(this.plugins.settings[e[t].name]=e[t].options,i.push(e[t].name));else if(e)for(r in e)e.hasOwnProperty(r)&&(this.plugins.settings[r]=e[r],i.push(r));for(;i.length;)this.require(i.shift())},r.prototype.loadPlugin=function(e){var t=this.plugins,n=r.plugins[e];if(!r.plugins.hasOwnProperty(e))throw new Error('Unable to find "'+e+'" plugin');t.requested[e]=!0,t.loaded[e]=n.fn.apply(this,[this.plugins.settings[e]||{}]),t.names.push(e)},r.prototype.require=function(e){var t=this.plugins;if(!this.plugins.loaded.hasOwnProperty(e)){if(t.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")');this.loadPlugin(e)}return t.loaded[e]},r.define=function(e,t){r.plugins[e]={name:e,fn:t}}}},o={isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}};return e}),function(e,t){"function"==typeof define&&define.amd?define("selectize",["jquery","sifter","microplugin"],t):"object"==typeof exports?module.exports=t(require("jquery"),require("sifter"),require("microplugin")):e.Selectize=t(e.jQuery,e.Sifter,e.MicroPlugin)}(this,function(C,d,e){"use strict";function k(e,t){if("string"!=typeof t||t.length){var l="string"==typeof t?new RegExp(t,"i"):t,u=function(e){var t=0;if(3===e.nodeType){var n,r,i,o,a=e.data.search(l);0<=a&&0<e.data.length&&(n=e.data.match(l),(r=document.createElement("span")).className="highlight",(i=e.splitText(a)).splitText(n[0].length),o=i.cloneNode(!0),r.appendChild(o),i.parentNode.replaceChild(r,i),t=1)}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&("highlight"!==e.className||"SPAN"!==e.tagName))for(var s=0;s<e.childNodes.length;++s)s+=u(e.childNodes[s]);return t};return e.each(function(){u(this)})}}C.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()}).end()};function r(){}r.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){var n=arguments.length;return 0===n?delete this._events:1===n?delete this._events[e]:(this._events=this._events||{},void(e in this._events!=!1&&this._events[e].splice(this._events[e].indexOf(t),1)))},trigger:function(e){if(this._events=this._events||{},e in this._events!=!1)for(var t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1))}},r.mixin=function(e){for(var t=["on","off","trigger"],n=0;n<t.length;n++)e.prototype[t[n]]=r.prototype[t[n]]};function u(e){return void 0!==e}function D(e){return null==e?null:"boolean"==typeof e?e?"1":"0":e+""}function s(e){return(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function n(t,n,e){var r,i=t.trigger,o={};for(r in t.trigger=function(){var e=arguments[0];if(-1===n.indexOf(e))return i.apply(t,arguments);o[e]=arguments},e.apply(t,[]),t.trigger=i,o)o.hasOwnProperty(r)&&i.apply(t,o[r])}function f(e){var t,n,r={};return"selectionStart"in e?(r.start=e.selectionStart,r.length=e.selectionEnd-r.start):document.selection&&(e.focus(),t=document.selection.createRange(),n=document.selection.createRange().text.length,t.moveStart("character",-e.value.length),r.start=t.text.length-n,r.length=n),r}function $(p){function e(e,t){var n,r,i,o,a,s,l,u,c,d;t=t||{},(e=e||window.event||{}).metaKey||e.altKey||!t.force&&!1===p.data("grow")||(d=p.val(),e.type&&"keydown"===e.type.toLowerCase()&&(r=48<=(n=e.keyCode)&&n<=57||65<=n&&n<=90||96<=n&&n<=111||186<=n&&n<=222||32===n,46===n||8===n?(l=f(p[0])).length?d=d.substring(0,l.start)+d.substring(l.start+l.length):8===n&&l.start?d=d.substring(0,l.start-1)+d.substring(l.start+1):46===n&&void 0!==l.start&&(d=d.substring(0,l.start)+d.substring(l.start+1)):r&&(a=e.shiftKey,s=String.fromCharCode(e.keyCode),d+=s=a?s.toUpperCase():s.toLowerCase())),i=p.attr("placeholder"),!d&&i&&(d=i),c=p,(o=((u=d)?(w.$testInput||(w.$testInput=C("<span />").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).appendTo("body")),w.$testInput.text(u),function(e,t,n){var r,i,o={};if(n)for(r=0,i=n.length;r<i;r++)o[n[r]]=e.css(n[r]);else o=e.css();t.css(o)}(c,w.$testInput,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]),w.$testInput.width()):0)+4)!==h&&(h=o,p.width(o),p.triggerHandler("resize")))}var h=null;p.on("keydown keyup update blur",e),e()}var _=/Mac/.test(navigator.userAgent),S=_?91:17,x=_?18:17,O=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("input").validity,t={before:function(e,t,n){var r=e[t];e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)}},after:function(t,e,n){var r=t[e];t[e]=function(){var e=r.apply(t,arguments);return n.apply(t,arguments),e}}},w=function(e,t){var n,r,i=this,o=e[0];o.selectize=i;var a,s,l,u,c=window.getComputedStyle&&window.getComputedStyle(o,null);if(u=(u=c?c.getPropertyValue("direction"):o.currentStyle&&o.currentStyle.direction)||e.parents("[dir]:first").attr("dir")||"",C.extend(i,{order:0,settings:t,$input:e,tabIndex:e.attr("tabindex")||"",tagType:"select"===o.tagName.toLowerCase()?1:2,rtl:/rtl/i.test(u),eventNS:".selectize"+ ++w.count,highlightedValue:null,isBlurring:!1,isOpen:!1,isDisabled:!1,isRequired:e.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===t.loadThrottle?i.onSearchChange:(a=i.onSearchChange,s=t.loadThrottle,function(){var e=this,t=arguments;window.clearTimeout(l),l=window.setTimeout(function(){a.apply(e,t)},s)})}),i.sifter=new d(this.options,{diacritics:t.diacritics}),i.settings.options){for(n=0,r=i.settings.options.length;n<r;n++)i.registerOption(i.settings.options[n]);delete i.settings.options}if(i.settings.optgroups){for(n=0,r=i.settings.optgroups.length;n<r;n++)i.registerOptionGroup(i.settings.optgroups[n]);delete i.settings.optgroups}i.settings.mode=i.settings.mode||(1===i.settings.maxItems?"single":"multi"),"boolean"!=typeof i.settings.hideSelected&&(i.settings.hideSelected="multi"===i.settings.mode),i.initializePlugins(i.settings.plugins),i.setupCallbacks(),i.setupTemplates(),i.setup()};return r.mixin(w),void 0!==e?e.mixin(w):function(e,t){t=t||{};console.error("Selectize: "+e),t.explanation&&(console.group&&console.group(),console.error(t.explanation),console.group&&console.groupEnd())}("Dependency MicroPlugin is missing",{explanation:'Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.'}),C.extend(w.prototype,{setup:function(){var e,t,n,r,i,o,a,s=this,l=s.settings,u=s.eventNS,c=C(window),d=C(document),p=s.$input,h=s.settings.mode,f=p.attr("class")||"",g=C("<div>").addClass(l.wrapperClass).addClass(f).addClass(h),m=C("<div>").addClass(l.inputClass).addClass("items").appendTo(g),v=C('<input type="text" autocomplete="off" />').appendTo(m).attr("tabindex",p.is(":disabled")?"-1":s.tabIndex),y=C(l.dropdownParent||g),w=C("<div>").addClass(l.dropdownClass).addClass(h).hide().appendTo(y),b=C("<div>").addClass(l.dropdownContentClass).appendTo(w);(t=p.attr("id"))&&(v.attr("id",t+"-selectized"),C("label[for='"+t+"']").attr("for",t+"-selectized")),s.settings.copyClassesToDropdown&&w.addClass(f),g.css({width:p[0].style.width}),s.plugins.names.length&&(e="plugin-"+s.plugins.names.join(" plugin-"),g.addClass(e),w.addClass(e)),(null===l.maxItems||1<l.maxItems)&&1===s.tagType&&p.attr("multiple","multiple"),s.settings.placeholder&&v.attr("placeholder",l.placeholder),!s.settings.splitOn&&s.settings.delimiter&&(n=s.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),s.settings.splitOn=new RegExp("\\s*"+n+"+\\s*")),p.attr("autocorrect")&&v.attr("autocorrect",p.attr("autocorrect")),p.attr("autocapitalize")&&v.attr("autocapitalize",p.attr("autocapitalize")),v[0].type=p[0].type,s.$wrapper=g,s.$control=m,s.$control_input=v,s.$dropdown=w,s.$dropdown_content=b,w.on("mouseenter mousedown click","[data-disabled]>[data-selectable]",function(e){e.stopImmediatePropagation()}),w.on("mouseenter","[data-selectable]",function(){return s.onOptionHover.apply(s,arguments)}),w.on("mousedown click","[data-selectable]",function(){return s.onOptionSelect.apply(s,arguments)}),i="mousedown",o="*:not(input)",a=function(){return s.onItemSelect.apply(s,arguments)},(r=m).on(i,o,function(e){for(var t=e.target;t&&t.parentNode!==r[0];)t=t.parentNode;return e.currentTarget=t,a.apply(this,[e])}),$(v),m.on({mousedown:function(){return s.onMouseDown.apply(s,arguments)},click:function(){return s.onClick.apply(s,arguments)}}),v.on({mousedown:function(e){e.stopPropagation()},keydown:function(){return s.onKeyDown.apply(s,arguments)},keyup:function(){return s.onKeyUp.apply(s,arguments)},keypress:function(){return s.onKeyPress.apply(s,arguments)},resize:function(){s.positionDropdown.apply(s,[])},blur:function(){return s.onBlur.apply(s,arguments)},focus:function(){return s.ignoreBlur=!1,s.onFocus.apply(s,arguments)},paste:function(){return s.onPaste.apply(s,arguments)}}),d.on("keydown"+u,function(e){s.isCmdDown=e[_?"metaKey":"ctrlKey"],s.isCtrlDown=e[_?"altKey":"ctrlKey"],s.isShiftDown=e.shiftKey}),d.on("keyup"+u,function(e){e.keyCode===x&&(s.isCtrlDown=!1),16===e.keyCode&&(s.isShiftDown=!1),e.keyCode===S&&(s.isCmdDown=!1)}),d.on("mousedown"+u,function(e){if(s.isFocused){if(e.target===s.$dropdown[0]||e.target.parentNode===s.$dropdown[0])return!1;s.$control.has(e.target).length||e.target===s.$control[0]||s.blur(e.target)}}),c.on(["scroll"+u,"resize"+u].join(" "),function(){s.isOpen&&s.positionDropdown.apply(s,arguments)}),c.on("mousemove"+u,function(){s.ignoreHover=!1}),this.revertSettings={$children:p.children().detach(),tabindex:p.attr("tabindex")},p.attr("tabindex",-1).hide().after(s.$wrapper),C.isArray(l.items)&&(s.setValue(l.items),delete l.items),O&&p.on("invalid"+u,function(e){e.preventDefault(),s.isInvalid=!0,s.refreshState()}),s.updateOriginalInput(),s.refreshItems(),s.refreshState(),s.updatePlaceholder(),s.isSetup=!0,p.is(":disabled")&&s.disable(),s.on("change",this.onChange),p.data("selectize",s),p.addClass("selectized"),s.trigger("initialize"),!0===l.preload&&s.onSearchChange("")},setupTemplates:function(){var n=this.settings.labelField,r=this.settings.optgroupLabelField,e={optgroup:function(e){return'<div class="optgroup">'+e.html+"</div>"},optgroup_header:function(e,t){return'<div class="optgroup-header">'+t(e[r])+"</div>"},option:function(e,t){return'<div class="option">'+t(e[n])+"</div>"},item:function(e,t){return'<div class="item">'+t(e[n])+"</div>"},option_create:function(e,t){return'<div class="create">Add <strong>'+t(e.input)+"</strong>&hellip;</div>"}};this.settings.render=C.extend({},e,this.settings.render)},setupCallbacks:function(){var e,t,n={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in n)n.hasOwnProperty(e)&&(t=this.settings[n[e]])&&this.on(e,t)},onClick:function(e){this.isFocused&&this.isOpen||(this.focus(),e.preventDefault())},onMouseDown:function(e){var t=this,n=e.isDefaultPrevented();C(e.target);if(t.isFocused){if(e.target!==t.$control_input[0])return"single"===t.settings.mode?t.isOpen?t.close():t.open():n||t.setActiveItem(null),!1}else n||window.setTimeout(function(){t.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(e){var i=this;i.isFull()||i.isInputHidden||i.isLocked?e.preventDefault():i.settings.splitOn&&setTimeout(function(){var e=i.$control_input.val();if(e.match(i.settings.splitOn))for(var t=C.trim(e).split(i.settings.splitOn),n=0,r=t.length;n<r;n++)i.createItem(t[n])},0)},onKeyPress:function(e){if(this.isLocked)return e&&e.preventDefault();var t=String.fromCharCode(e.keyCode||e.which);return this.settings.create&&"multi"===this.settings.mode&&t===this.settings.delimiter?(this.createItem(),e.preventDefault(),!1):void 0},onKeyDown:function(e){e.target,this.$control_input[0];var t,n,r=this;if(r.isLocked)9!==e.keyCode&&e.preventDefault();else{switch(e.keyCode){case 65:if(r.isCmdDown)return void r.selectAll();break;case 27:return void(r.isOpen&&(e.preventDefault(),e.stopPropagation(),r.close()));case 78:if(!e.ctrlKey||e.altKey)break;case 40:return!r.isOpen&&r.hasOptions?r.open():r.$activeOption&&(r.ignoreHover=!0,(t=r.getAdjacentOption(r.$activeOption,1)).length&&r.setActiveOption(t,!0,!0)),void e.preventDefault();case 80:if(!e.ctrlKey||e.altKey)break;case 38:return r.$activeOption&&(r.ignoreHover=!0,(n=r.getAdjacentOption(r.$activeOption,-1)).length&&r.setActiveOption(n,!0,!0)),void e.preventDefault();case 13:return void(r.isOpen&&r.$activeOption&&(r.onOptionSelect({currentTarget:r.$activeOption}),e.preventDefault()));case 37:return void r.advanceSelection(-1,e);case 39:return void r.advanceSelection(1,e);case 9:return r.settings.selectOnTab&&r.isOpen&&r.$activeOption&&(r.onOptionSelect({currentTarget:r.$activeOption}),r.isFull()||e.preventDefault()),void(r.settings.create&&r.createItem()&&e.preventDefault());case 8:case 46:return void r.deleteSelection(e)}!r.isFull()&&!r.isInputHidden||(_?e.metaKey:e.ctrlKey)||e.preventDefault()}},onKeyUp:function(e){if(this.isLocked)return e&&e.preventDefault();var t=this.$control_input.val()||"";this.lastValue!==t&&(this.lastValue=t,this.onSearchChange(t),this.refreshOptions(),this.trigger("type",t))},onSearchChange:function(t){var n=this,r=n.settings.load;r&&(n.loadedSearches.hasOwnProperty(t)||(n.loadedSearches[t]=!0,n.load(function(e){r.apply(n,[t,e])})))},onFocus:function(e){var t=this,n=t.isFocused;if(t.isDisabled)return t.blur(),e&&e.preventDefault(),!1;t.ignoreFocus||(t.isFocused=!0,"focus"===t.settings.preload&&t.onSearchChange(""),n||t.trigger("focus"),t.$activeItems.length||(t.showInput(),t.setActiveItem(null),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState())},onBlur:function(e,t){var n=this;if(n.isFocused&&(n.isFocused=!1,!n.ignoreFocus)){if(!n.ignoreBlur&&document.activeElement===n.$dropdown_content[0])return n.ignoreBlur=!0,void n.onFocus(e);var r=function(){n.close(),n.setTextboxValue(""),n.setActiveItem(null),n.setActiveOption(null),n.setCaret(n.items.length),n.refreshState(),t&&t.focus&&t.focus(),n.isBlurring=!1,n.ignoreFocus=!1,n.trigger("blur")};n.isBlurring=!0,n.ignoreFocus=!0,n.settings.create&&n.settings.createOnBlur?n.createItem(null,!1,r):r()}},onOptionHover:function(e){this.ignoreHover||this.setActiveOption(e.currentTarget,!1)},onOptionSelect:function(e){var t,n,r=this;e.preventDefault&&(e.preventDefault(),e.stopPropagation()),(n=C(e.currentTarget)).hasClass("create")?r.createItem(null,function(){r.settings.closeAfterSelect&&r.close()}):void 0!==(t=n.attr("data-value"))&&(r.lastQuery=null,r.setTextboxValue(""),r.addItem(t),r.settings.closeAfterSelect?r.close():!r.settings.hideSelected&&e.type&&/mouse/.test(e.type)&&r.setActiveOption(r.getOption(t)))},onItemSelect:function(e){this.isLocked||"multi"===this.settings.mode&&(e.preventDefault(),this.setActiveItem(e.currentTarget,e))},load:function(e){var t=this,n=t.$wrapper.addClass(t.settings.loadingClass);t.loading++,e.apply(t,[function(e){t.loading=Math.max(t.loading-1,0),e&&e.length&&(t.addOption(e),t.refreshOptions(t.isFocused&&!t.isInputHidden)),t.loading||n.removeClass(t.settings.loadingClass),t.trigger("load",e)}])},setTextboxValue:function(e){var t=this.$control_input;t.val()!==e&&(t.val(e).triggerHandler("update"),this.lastValue=e)},getValue:function(){return 1===this.tagType&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(e,t){n(this,t?[]:["change"],function(){this.clear(t),this.addItems(e,t)})},setActiveItem:function(e,t){var n,r,i,o,a,s,l,u,c=this;if("single"!==c.settings.mode){if(!(e=C(e)).length)return C(c.$activeItems).removeClass("active"),c.$activeItems=[],void(c.isFocused&&c.showInput());if("mousedown"===(n=t&&t.type.toLowerCase())&&c.isShiftDown&&c.$activeItems.length){for(u=c.$control.children(".active:last"),o=Array.prototype.indexOf.apply(c.$control[0].childNodes,[u[0]]),(a=Array.prototype.indexOf.apply(c.$control[0].childNodes,[e[0]]))<o&&(l=o,o=a,a=l),r=o;r<=a;r++)s=c.$control[0].childNodes[r],-1===c.$activeItems.indexOf(s)&&(C(s).addClass("active"),c.$activeItems.push(s));t.preventDefault()}else"mousedown"===n&&c.isCtrlDown||"keydown"===n&&this.isShiftDown?e.hasClass("active")?(i=c.$activeItems.indexOf(e[0]),c.$activeItems.splice(i,1),e.removeClass("active")):c.$activeItems.push(e.addClass("active")[0]):(C(c.$activeItems).removeClass("active"),c.$activeItems=[e.addClass("active")[0]]);c.hideInput(),this.isFocused||c.focus()}},setActiveOption:function(e,t,n){var r,i,o,a,s,l=this;l.$activeOption&&l.$activeOption.removeClass("active"),l.$activeOption=null,(e=C(e)).length&&(l.$activeOption=e.addClass("active"),!t&&u(t)||(r=l.$dropdown_content.height(),i=l.$activeOption.outerHeight(!0),t=l.$dropdown_content.scrollTop()||0,s=(a=o=l.$activeOption.offset().top-l.$dropdown_content.offset().top+t)-r+i,r+t<o+i?l.$dropdown_content.stop().animate({scrollTop:s},n?l.settings.scrollDuration:0):o<t&&l.$dropdown_content.stop().animate({scrollTop:a},n?l.settings.scrollDuration:0)))},selectAll:function(){"single"!==this.settings.mode&&(this.$activeItems=Array.prototype.slice.apply(this.$control.children(":not(input)").addClass("active")),this.$activeItems.length&&(this.hideInput(),this.close()),this.focus())},hideInput:function(){this.setTextboxValue(""),this.$control_input.css({opacity:0,position:"absolute",left:this.rtl?1e4:-1e4}),this.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var e=this;e.isDisabled||(e.ignoreFocus=!0,e.$control_input[0].focus(),window.setTimeout(function(){e.ignoreFocus=!1,e.onFocus()},0))},blur:function(e){this.$control_input[0].blur(),this.onBlur(null,e)},getScoreFunction:function(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())},getSearchOptions:function(){var e=this.settings,t=e.sortField;return"string"==typeof t&&(t=[{field:t}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t,nesting:e.nesting}},search:function(e){var t,n,r,i=this.settings,o=this.getSearchOptions();if(i.score&&"function"!=typeof(r=this.settings.score.apply(this,[e])))throw new Error('Selectize "score" setting must be a function that returns a function');if(e!==this.lastQuery?(this.lastQuery=e,n=this.sifter.search(e,C.extend(o,{score:r})),this.currentResults=n):n=C.extend(!0,{},this.currentResults),i.hideSelected)for(t=n.items.length-1;0<=t;t--)-1!==this.items.indexOf(D(n.items[t].id))&&n.items.splice(t,1);return n},refreshOptions:function(e){var t,n,r,i,o,a,s,l,u,c,d,p,h,f,g;void 0===e&&(e=!0);var m,v,y=this,w=C.trim(y.$control_input.val()),b=y.search(w),$=y.$dropdown_content,_=y.$activeOption&&D(y.$activeOption.attr("data-value")),S=b.items.length;for("number"==typeof y.settings.maxOptions&&(S=Math.min(S,y.settings.maxOptions)),i={},o=[],t=0;t<S;t++)for(a=y.options[b.items[t].id],s=y.render("option",a),l=a[y.settings.optgroupField]||"",n=0,r=(u=C.isArray(l)?l:[l])&&u.length;n<r;n++)l=u[n],y.optgroups.hasOwnProperty(l)||(l=""),i.hasOwnProperty(l)||(i[l]=document.createDocumentFragment(),o.push(l)),i[l].appendChild(s);for(this.settings.lockOptgroupOrder&&o.sort(function(e,t){return(y.optgroups[e].$order||0)-(y.optgroups[t].$order||0)}),c=document.createDocumentFragment(),t=0,S=o.length;t<S;t++)l=o[t],y.optgroups.hasOwnProperty(l)&&i[l].childNodes.length?((d=document.createDocumentFragment()).appendChild(y.render("optgroup_header",y.optgroups[l])),d.appendChild(i[l]),c.appendChild(y.render("optgroup",C.extend({},y.optgroups[l],{html:(m=d,v=void 0,(v=document.createElement("div")).appendChild(m.cloneNode(!0)),v.innerHTML),dom:d})))):c.appendChild(i[l]);if($.html(c),y.settings.highlight&&($.removeHighlight(),b.query.length&&b.tokens.length))for(t=0,S=b.tokens.length;t<S;t++)k($,b.tokens[t].regex);if(!y.settings.hideSelected)for(t=0,S=y.items.length;t<S;t++)y.getOption(y.items[t]).addClass("selected");(p=y.canCreate(w))&&($.prepend(y.render("option_create",{input:w})),g=C($[0].childNodes[0])),y.hasOptions=0<b.items.length||p,y.hasOptions?(0<b.items.length?((f=_&&y.getOption(_))&&f.length?h=f:"single"===y.settings.mode&&y.items.length&&(h=y.getOption(y.items[0])),h&&h.length||(h=g&&!y.settings.addPrecedence?y.getAdjacentOption(g,1):$.find("[data-selectable]:first"))):h=g,y.setActiveOption(h),e&&!y.isOpen&&y.open()):(y.setActiveOption(null),e&&y.isOpen&&y.close())},addOption:function(e){var t,n,r;if(C.isArray(e))for(t=0,n=e.length;t<n;t++)this.addOption(e[t]);else(r=this.registerOption(e))&&(this.userOptions[r]=!0,this.lastQuery=null,this.trigger("option_add",r,e))},registerOption:function(e){var t=D(e[this.settings.valueField]);return null!=t&&!this.options.hasOwnProperty(t)&&(e.$order=e.$order||++this.order,this.options[t]=e,t)},registerOptionGroup:function(e){var t=D(e[this.settings.optgroupValueField]);return!!t&&(e.$order=e.$order||++this.order,this.optgroups[t]=e,t)},addOptionGroup:function(e,t){t[this.settings.optgroupValueField]=e,(e=this.registerOptionGroup(t))&&this.trigger("optgroup_add",e,t)},removeOptionGroup:function(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.renderCache={},this.trigger("optgroup_remove",e))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(e,t){var n,r,i,o,a,s,l,u=this;if(e=D(e),i=D(t[u.settings.valueField]),null!==e&&u.options.hasOwnProperty(e)){if("string"!=typeof i)throw new Error("Value must be set in option data");l=u.options[e].$order,i!==e&&(delete u.options[e],-1!==(o=u.items.indexOf(e))&&u.items.splice(o,1,i)),t.$order=t.$order||l,u.options[i]=t,a=u.renderCache.item,s=u.renderCache.option,a&&(delete a[e],delete a[i]),s&&(delete s[e],delete s[i]),-1!==u.items.indexOf(i)&&(n=u.getItem(e),r=C(u.render("item",t)),n.hasClass("active")&&r.addClass("active"),n.replaceWith(r)),u.lastQuery=null,u.isOpen&&u.refreshOptions(!1)}},removeOption:function(e,t){e=D(e);var n=this.renderCache.item,r=this.renderCache.option;n&&delete n[e],r&&delete r[e],delete this.userOptions[e],delete this.options[e],this.lastQuery=null,this.trigger("option_remove",e),this.removeItem(e,t)},clearOptions:function(){var n=this;n.loadedSearches={},n.userOptions={},n.renderCache={};var r=n.options;C.each(n.options,function(e,t){-1==n.items.indexOf(e)&&delete r[e]}),n.options=n.sifter.items=r,n.lastQuery=null,n.trigger("option_clear")},getOption:function(e){return this.getElementWithValue(e,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(e,t){var n=this.$dropdown.find("[data-selectable]"),r=n.index(e)+t;return 0<=r&&r<n.length?n.eq(r):C()},getElementWithValue:function(e,t){if(null!=(e=D(e)))for(var n=0,r=t.length;n<r;n++)if(t[n].getAttribute("data-value")===e)return C(t[n]);return C()},getItem:function(e){return this.getElementWithValue(e,this.$control.children())},addItems:function(e,t){this.buffer=document.createDocumentFragment();for(var n=this.$control[0].childNodes,r=0;r<n.length;r++)this.buffer.appendChild(n[r]);for(var i=C.isArray(e)?e:[e],r=0,o=i.length;r<o;r++)this.isPending=r<o-1,this.addItem(i[r],t);var a=this.$control[0];a.insertBefore(this.buffer,a.firstChild),this.buffer=null},addItem:function(s,l){n(this,l?[]:["change"],function(){var e,t,n,r,i,o=this,a=o.settings.mode;s=D(s),-1===o.items.indexOf(s)?o.options.hasOwnProperty(s)&&("single"===a&&o.clear(l),"multi"===a&&o.isFull()||(e=C(o.render("item",o.options[s])),i=o.isFull(),o.items.splice(o.caretPos,0,s),o.insertAtCaret(e),o.isPending&&(i||!o.isFull())||o.refreshState(),o.isSetup&&(n=o.$dropdown_content.find("[data-selectable]"),o.isPending||(t=o.getOption(s),r=o.getAdjacentOption(t,1).attr("data-value"),o.refreshOptions(o.isFocused&&"single"!==a),r&&o.setActiveOption(o.getOption(r))),!n.length||o.isFull()?o.close():o.isPending||o.positionDropdown(),o.updatePlaceholder(),o.trigger("item_add",s,e),o.isPending||o.updateOriginalInput({silent:l})))):"single"===a&&o.close()})},removeItem:function(e,t){var n,r,i=this,o=e instanceof C?e:i.getItem(e);e=D(o.attr("data-value")),-1!==(n=i.items.indexOf(e))&&(o.remove(),o.hasClass("active")&&(r=i.$activeItems.indexOf(o[0]),i.$activeItems.splice(r,1)),i.items.splice(n,1),i.lastQuery=null,!i.settings.persist&&i.userOptions.hasOwnProperty(e)&&i.removeOption(e,t),n<i.caretPos&&i.setCaret(i.caretPos-1),i.refreshState(),i.updatePlaceholder(),i.updateOriginalInput({silent:t}),i.positionDropdown(),i.trigger("item_remove",e,o))},createItem:function(e,n){var r=this,i=r.caretPos;e=e||C.trim(r.$control_input.val()||"");var o=arguments[arguments.length-1];if("function"!=typeof o&&(o=function(){}),"boolean"!=typeof n&&(n=!0),!r.canCreate(e))return o(),!1;r.lock();var t,a,s="function"==typeof r.settings.create?this.settings.create:function(e){var t={};return t[r.settings.labelField]=e,t[r.settings.valueField]=e,t},l=(a=!(t=function(e){if(r.unlock(),!e||"object"!=typeof e)return o();var t=D(e[r.settings.valueField]);if("string"!=typeof t)return o();r.setTextboxValue(""),r.addOption(e),r.setCaret(i),r.addItem(t),r.refreshOptions(n&&"single"!==r.settings.mode),o(e)}),function(){a||(a=!0,t.apply(this,arguments))}),u=s.apply(this,[e,l]);return void 0!==u&&l(u),!0},refreshItems:function(){this.lastQuery=null,this.isSetup&&this.addItem(this.items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){this.refreshValidityState(),this.refreshClasses()},refreshValidityState:function(){if(!this.isRequired)return!1;var e=!this.items.length;this.isInvalid=e,this.$control_input.prop("required",e),this.$input.prop("required",!e)},refreshClasses:function(){var e=this,t=e.isFull(),n=e.isLocked;e.$wrapper.toggleClass("rtl",e.rtl),e.$control.toggleClass("focus",e.isFocused).toggleClass("disabled",e.isDisabled).toggleClass("required",e.isRequired).toggleClass("invalid",e.isInvalid).toggleClass("locked",n).toggleClass("full",t).toggleClass("not-full",!t).toggleClass("input-active",e.isFocused&&!e.isInputHidden).toggleClass("dropdown-active",e.isOpen).toggleClass("has-options",!C.isEmptyObject(e.options)).toggleClass("has-items",0<e.items.length),e.$control_input.data("grow",!t&&!n)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(e){var t,n,r,i,o=this;if(e=e||{},1===o.tagType){for(r=[],t=0,n=o.items.length;t<n;t++)i=o.options[o.items[t]][o.settings.labelField]||"",r.push('<option value="'+s(o.items[t])+'" selected="selected">'+s(i)+"</option>");r.length||this.$input.attr("multiple")||r.push('<option value="" selected="selected"></option>'),o.$input.html(r.join(""))}else o.$input.val(o.getValue()),o.$input.attr("value",o.$input.val());o.isSetup&&(e.silent||o.trigger("change",o.$input.val()))},updatePlaceholder:function(){var e;this.settings.placeholder&&(e=this.$control_input,this.items.length?e.removeAttr("placeholder"):e.attr("placeholder",this.settings.placeholder),e.triggerHandler("update",{force:!0}))},open:function(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.focus(),e.isOpen=!0,e.refreshState(),e.$dropdown.css({visibility:"hidden",display:"block"}),e.positionDropdown(),e.$dropdown.css({visibility:"visible"}),e.trigger("dropdown_open",e.$dropdown))},close:function(){var e=this,t=e.isOpen;"single"===e.settings.mode&&e.items.length&&(e.hideInput(),e.isBlurring||e.$control_input.blur()),e.isOpen=!1,e.$dropdown.hide(),e.setActiveOption(null),e.refreshState(),t&&e.trigger("dropdown_close",e.$dropdown)},positionDropdown:function(){var e=this.$control,t="body"===this.settings.dropdownParent?e.offset():e.position();t.top+=e.outerHeight(!0),this.$dropdown.css({width:e[0].getBoundingClientRect().width,top:t.top,left:t.left})},clear:function(e){var t=this;t.items.length&&(t.$control.children(":not(input)").remove(),t.items=[],t.lastQuery=null,t.setCaret(0),t.setActiveItem(null),t.updatePlaceholder(),t.updateOriginalInput({silent:e}),t.refreshState(),t.showInput(),t.trigger("clear"))},insertAtCaret:function(e){var t=Math.min(this.caretPos,this.items.length),n=e[0],r=this.buffer||this.$control[0];0===t?r.insertBefore(n,r.firstChild):r.insertBefore(n,r.childNodes[t]),this.setCaret(t+1)},deleteSelection:function(e){var t,n,r,i,o,a,s,l=this,u=e&&8===e.keyCode?-1:1,c=f(l.$control_input[0]);if(l.$activeOption&&!l.settings.hideSelected&&(o=l.getAdjacentOption(l.$activeOption,-1).attr("data-value")),r=[],l.$activeItems.length){for(s=l.$control.children(".active:"+(0<u?"last":"first")),i=l.$control.children(":not(input)").index(s),0<u&&i++,t=0,n=l.$activeItems.length;t<n;t++)r.push(C(l.$activeItems[t]).attr("data-value"));e&&(e.preventDefault(),e.stopPropagation())}else(l.isFocused||"single"===l.settings.mode)&&l.items.length&&(u<0&&0===c.start&&0===c.length?r.push(l.items[l.caretPos-1]):0<u&&c.start===l.$control_input.val().length&&r.push(l.items[l.caretPos]));if(!r.length||"function"==typeof l.settings.onDelete&&!1===l.settings.onDelete.apply(l,[r]))return!1;for(void 0!==i&&l.setCaret(i);r.length;)l.removeItem(r.pop());return l.showInput(),l.positionDropdown(),l.refreshOptions(!0),o&&(a=l.getOption(o)).length&&l.setActiveOption(a),!0},advanceSelection:function(e,t){var n,r,i,o,a,s=this;0!==e&&(s.rtl&&(e*=-1),n=0<e?"last":"first",r=f(s.$control_input[0]),s.isFocused&&!s.isInputHidden?(o=s.$control_input.val().length,(e<0?0!==r.start||0!==r.length:r.start!==o)||o||s.advanceCaret(e,t)):(a=s.$control.children(".active:"+n)).length&&(i=s.$control.children(":not(input)").index(a),s.setActiveItem(null),s.setCaret(0<e?i+1:i)))},advanceCaret:function(e,t){var n,r;0!==e&&(n=0<e?"next":"prev",this.isShiftDown?(r=this.$control_input[n]()).length&&(this.hideInput(),this.setActiveItem(r),t&&t.preventDefault()):this.setCaret(this.caretPos+e))},setCaret:function(e){if(e="single"===this.settings.mode?this.items.length:Math.max(0,Math.min(this.items.length,e)),!this.isPending)for(var t,n=this.$control.children(":not(input)"),r=0,i=n.length;r<i;r++)t=C(n[r]).detach(),r<e?this.$control_input.before(t):this.$control.append(t);this.caretPos=e},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){this.$input.prop("disabled",!0),this.$control_input.prop("disabled",!0).prop("tabindex",-1),this.isDisabled=!0,this.lock()},enable:function(){this.$input.prop("disabled",!1),this.$control_input.prop("disabled",!1).prop("tabindex",this.tabIndex),this.isDisabled=!1,this.unlock()},destroy:function(){var e=this,t=e.eventNS,n=e.revertSettings;e.trigger("destroy"),e.off(),e.$wrapper.remove(),e.$dropdown.remove(),e.$input.html("").append(n.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:n.tabindex}).show(),e.$control_input.removeData("grow"),e.$input.removeData("selectize"),0==--w.count&&w.$testInput&&(w.$testInput.remove(),w.$testInput=void 0),C(window).off(t),C(document).off(t),C(document.body).off(t),delete e.$input[0].selectize},render:function(e,t){var n,r,i="",o=!1,a=this;return"option"!==e&&"item"!==e||(o=!!(n=D(t[a.settings.valueField]))),o&&(u(a.renderCache[e])||(a.renderCache[e]={}),a.renderCache[e].hasOwnProperty(n))?a.renderCache[e][n]:(i=C(a.settings.render[e].apply(this,[t,s])),"option"===e||"option_create"===e?t[a.settings.disabledField]||i.attr("data-selectable",""):"optgroup"===e&&(r=t[a.settings.optgroupValueField]||"",i.attr("data-group",r),t[a.settings.disabledField]&&i.attr("data-disabled","")),"option"!==e&&"item"!==e||i.attr("data-value",n||""),o&&(a.renderCache[e][n]=i[0]),i[0])},clearCache:function(e){void 0===e?this.renderCache={}:delete this.renderCache[e]},canCreate:function(e){if(!this.settings.create)return!1;var t=this.settings.createFilter;return e.length&&("function"!=typeof t||t.apply(this,[e]))&&("string"!=typeof t||new RegExp(t).test(e))&&(!(t instanceof RegExp)||t.test(e))}}),w.count=0,w.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},C.fn.selectize=function(i){function o(e,a){function s(e){var t=p&&e.attr(p);return"string"==typeof t&&t.length?JSON.parse(t):null}function l(e,t){e=C(e);var n,r,i=D(e.val());(i||d.allowEmptyOption)&&(c.hasOwnProperty(i)?t&&((n=c[i][m])?C.isArray(n)?n.push(t):c[i][m]=[n,t]:c[i][m]=t):((r=s(e)||{})[h]=r[h]||e.text(),r[f]=r[f]||i,r[g]=r[g]||e.prop("disabled"),r[m]=r[m]||t,c[i]=r,u.push(r),e.is(":selected")&&a.items.push(i)))}function t(e){var t,n,r,i,o;for((r=(e=C(e)).attr("label"))&&((i=s(e)||{})[v]=r,i[y]=r,i[g]=e.prop("disabled"),a.optgroups.push(i)),t=0,n=(o=C("option",e)).length;t<n;t++)l(o[t],r)}var n,r,i,o,u=a.options,c={};for(a.maxItems=e.attr("multiple")?null:1,n=0,r=(o=e.children()).length;n<r;n++)"optgroup"===(i=o[n].tagName.toLowerCase())?t(o[n]):"option"===i&&l(o[n])}var a=C.fn.selectize.defaults,d=C.extend({},a,i),p=d.dataAttr,h=d.labelField,f=d.valueField,g=d.disabledField,m=d.optgroupField,v=d.optgroupLabelField,y=d.optgroupValueField;return this.each(function(){var e,t,n,r;this.selectize||(e=C(this),t=this.tagName.toLowerCase(),(n=e.attr("placeholder")||e.attr("data-placeholder"))||d.allowEmptyOption||(n=e.children('option[value=""]').text()),("select"===t?o:function(e,t){var n,r,i,o,a=e.attr(p);if(a)for(t.options=JSON.parse(a),n=0,r=t.options.length;n<r;n++)t.items.push(t.options[n][f]);else{var s=C.trim(e.val()||"");if(!d.allowEmptyOption&&!s.length)return;for(n=0,r=(i=s.split(d.delimiter)).length;n<r;n++)(o={})[h]=i[n],o[f]=i[n],t.options.push(o);t.items=i}})(e,r={placeholder:n,options:[],optgroups:[],items:[]}),new w(e,C.extend(!0,{},a,r,i)))})},C.fn.selectize.defaults=w.defaults,C.fn.selectize.support={validity:O},w.define("drag_drop",function(e){if(!C.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');var r,t,n,i;"multi"===this.settings.mode&&((r=this).lock=(t=r.lock,function(){var e=r.$control.data("sortable");return e&&e.disable(),t.apply(r,arguments)}),r.unlock=(n=r.unlock,function(){var e=r.$control.data("sortable");return e&&e.enable(),n.apply(r,arguments)}),r.setup=(i=r.setup,function(){i.apply(this,arguments);var n=r.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:r.isLocked,start:function(e,t){t.placeholder.css("width",t.helper.css("width")),n.css({overflow:"visible"})},stop:function(){n.css({overflow:"hidden"});var e=r.$activeItems?r.$activeItems.slice():null,t=[];n.children("[data-value]").each(function(){t.push(C(this).attr("data-value"))}),r.setValue(t),r.setActiveItem(e)}})}))}),w.define("dropdown_header",function(e){var t,n=this;e=C.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(e){return'<div class="'+e.headerClass+'"><div class="'+e.titleRowClass+'"><span class="'+e.labelClass+'">'+e.title+'</span><a href="javascript:void(0)" class="'+e.closeClass+'">&times;</a></div></div>'}},e),n.setup=(t=n.setup,function(){t.apply(n,arguments),n.$dropdown_header=C(e.html(e)),n.$dropdown.prepend(n.$dropdown_header)})}),w.define("optgroup_columns",function(s){var o,l=this;s=C.extend({equalizeWidth:!0,equalizeHeight:!0},s),this.getAdjacentOption=function(e,t){var n=e.closest("[data-group]").find("[data-selectable]"),r=n.index(e)+t;return 0<=r&&r<n.length?n.eq(r):C()},this.onKeyDown=(o=l.onKeyDown,function(e){var t,n,r,i;return!this.isOpen||37!==e.keyCode&&39!==e.keyCode?o.apply(this,arguments):(l.ignoreHover=!0,t=(i=this.$activeOption.closest("[data-group]")).find("[data-selectable]").index(this.$activeOption),void((n=(r=(i=37===e.keyCode?i.prev("[data-group]"):i.next("[data-group]")).find("[data-selectable]")).eq(Math.min(r.length-1,t))).length&&this.setActiveOption(n)))});function e(){var e,t,n,r,i,o=C("[data-group]",l.$dropdown_content),a=o.length;if(a&&l.$dropdown_content.width()){if(s.equalizeHeight){for(e=t=0;e<a;e++)t=Math.max(t,o.eq(e).height());o.css({height:t})}s.equalizeWidth&&(i=l.$dropdown_content.innerWidth()-u(),n=Math.round(i/a),o.css({width:n}),1<a&&(r=i-n*(a-1),o.eq(a-1).css({width:r})))}}var u=function(){var e,t=u.width,n=document;return void 0===t&&((e=n.createElement("div")).innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',e=e.firstChild,n.body.appendChild(e),t=u.width=e.offsetWidth-e.clientWidth,n.body.removeChild(e)),t};(s.equalizeHeight||s.equalizeWidth)&&(t.after(this,"positionDropdown",e),t.after(this,"refreshOptions",e))}),w.define("remove_button",function(e){e=C.extend({label:"&times;",title:"Remove",className:"remove",append:!0},e);var o,t,n,r,a;"single"!==this.settings.mode?(r=o=this,a='<a href="javascript:void(0)" class="'+(t=e).className+'" tabindex="-1" title="'+s(t.title)+'">'+t.label+"</a>",o.setup=(n=r.setup,function(){var i;t.append&&(i=r.settings.render.item,r.settings.render.item=function(e){return t=i.apply(o,arguments),n=a,r=t.search(/(<\/[^>]+>\s*)$/),t.substring(0,r)+n+t.substring(r);var t,n,r}),n.apply(o,arguments),o.$control.on("click","."+t.className,function(e){var t;e.preventDefault(),r.isLocked||(t=C(e.currentTarget).parent(),r.setActiveItem(t),r.deleteSelection()&&r.setCaret(r.items.length))})})):function(i,t){t.className="remove-single";var n,o=i,a='<a href="javascript:void(0)" class="'+t.className+'" tabindex="-1" title="'+s(t.title)+'">'+t.label+"</a>";i.setup=(n=o.setup,function(){var e,r;t.append&&(e=C(o.$input.context).attr("id"),C("#"+e),r=o.settings.render.item,o.settings.render.item=function(e){return t=r.apply(i,arguments),n=a,C("<span>").append(t).append(n);var t,n}),n.apply(i,arguments),i.$control.on("click","."+t.className,function(e){e.preventDefault(),o.isLocked||o.clear()})})}(this,e)}),w.define("restore_on_backspace",function(r){var i,e=this;r.text=r.text||function(e){return e[this.settings.labelField]},this.onKeyDown=(i=e.onKeyDown,function(e){var t,n;return 8===e.keyCode&&""===this.$control_input.val()&&!this.$activeItems.length&&0<=(t=this.caretPos-1)&&t<this.items.length?(n=this.options[this.items[t]],this.deleteSelection(e)&&(this.setTextboxValue(r.text.apply(this,[n])),this.refreshOptions(!0)),void e.preventDefault()):i.apply(this,arguments)})}),w}),angular.module("selectize",[]).value("selectizeConfig",{}).directive("selectize",["selectizeConfig",function(p){return{restrict:"EA",require:"^ngModel",scope:{ngModel:"=",config:"=?",options:"=?",ngDisabled:"=",ngRequired:"&"},link:function(n,e,t,r){Selectize.defaults.maxItems=null;var i,o=angular.extend({},Selectize.defaults,p,n.config);function a(e){e?i.disable():i.enable()}r.$isEmpty=function(e){return null==e||!e.length};function s(e){return e?(e=angular.isArray(e)||angular.isObject(e)?e:[e],$.map(e,function(e){return"string"==typeof e?(t=e,(n={})[o.labelField]=t,n[o.valueField]=t,n):e;var t,n})):[]}function l(){var e;e=(n.ngRequired()||t.required||o.required)&&r.$isEmpty(n.ngModel),r.$setValidity("required",!e),i.$control.toggleClass("ng-valid",r.$valid),i.$control.toggleClass("ng-invalid",r.$invalid),i.$control.toggleClass("ng-dirty",r.$dirty),i.$control.toggleClass("ng-pristine",r.$pristine),angular.equals(i.items,n.ngModel)||(i.addOption(s(n.ngModel)),i.setValue(n.ngModel))}var u=o.onChange,c=o.onOptionAdd;o.onChange=function(){n.disableOnChange||(angular.equals(i.items,n.ngModel)||n.$evalAsync(function(){var e=angular.copy(i.items);1==o.maxItems&&(e=e[0]),r.$setViewValue(e)}),u&&u.apply(this,arguments))},o.onOptionAdd=function(e,t){-1===n.options.indexOf(t)&&(n.options.push(t),c&&c.apply(this,arguments))},n.options?n.options.splice(0,n.options.length,s(n.options)):n.options=s(angular.copy(n.ngModel));var d=o.onInitialize;o.onInitialize=function(){(i=e[0].selectize).addOption(n.options),i.setValue(n.ngModel),d&&d(i),n.$watch("options",function(){n.disableOnChange=!0,i.clearOptions(),i.addOption(n.options),i.setValue(n.ngModel),n.disableOnChange=!1},!0),n.$watchCollection("ngModel",l),n.$watch("ngDisabled",a)},e.selectize(o),e.on("$destroy",function(){i&&(i.destroy(),e=null)})}}}]),function(e,t){"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof exports?t(require("jquery")):(t(e.jquery),e.bootstrapSwitch={})}(this,function(e){"use strict";function o(){var n=this,e=this.$on.add(this.$off).add(this.$label).css("width",""),r="auto"===this.options.handleWidth?Math.round(Math.max(this.$on.width(),this.$off.width())):this.options.handleWidth;return e.width(r),this.$label.width(function(e,t){return"auto"===n.options.labelWidth?t<r?r:t:n.options.labelWidth}),this.privateHandleWidth=this.$on.outerWidth(),this.privateLabelWidth=this.$label.outerWidth(),this.$container.width(2*this.privateHandleWidth+this.privateLabelWidth),this.$wrapper.width(this.privateHandleWidth+this.privateLabelWidth)}function a(){var t=this,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.ope;this.$container.css("margin-left",function(){var e=[0,"-"+t.privateHandleWidth+"px"];return t.options.indeterminate?"-"+t.privateHandleWidth/2+"px":n?t.options.inverse?e[1]:e[0]:t.options.inverse?e[0]:e[1]})}function s(e){return this.options.baseClass+"-"+e}function n(e){var t=this;return l.isArray(e)?e.map(function(e){return s.call(t,e)}):[s.call(this,e)]}var t=e&&e.__esModule?e:{default:e},r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=function(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e},l=t.default||window.jQuery||window.$,u=(i(c,[{key:"setPrevOptions",value:function(){this.prevOptions=r({},this.options)}},{key:"state",value:function(e,t){return void 0===e?this.options.state:(this.options.disabled||this.options.readonly||this.options.state&&!this.options.radioAllOff&&this.$element.is(":radio")||(this.$element.is(":radio")?l('[name="'+this.$element.attr("name")+'"]').trigger("setPreviousOptions.bootstrapSwitch"):this.$element.trigger("setPreviousOptions.bootstrapSwitch"),this.options.indeterminate&&this.indeterminate(!1),this.$element.prop("checked",!!e).trigger("change.bootstrapSwitch",t)),this.$element)}},{key:"toggleState",value:function(e){return this.options.disabled||this.options.readonly?this.$element:this.options.indeterminate?(this.indeterminate(!1),this.state(!0)):this.$element.prop("checked",!this.options.state).trigger("change.bootstrapSwitch",e)}},{key:"size",value:function(e){return void 0===e?this.options.size:(null!=this.options.size&&this.$wrapper.removeClass(s.call(this,this.options.size)),e&&this.$wrapper.addClass(s.call(this,e)),o.call(this),a.call(this),this.options.size=e,this.$element)}},{key:"animate",value:function(e){return void 0===e?this.options.animate:this.options.animate===!!e?this.$element:this.toggleAnimate()}},{key:"toggleAnimate",value:function(){return this.options.animate=!this.options.animate,this.$wrapper.toggleClass(s.call(this,"animate")),this.$element}},{key:"disabled",value:function(e){return void 0===e?this.options.disabled:this.options.disabled===!!e?this.$element:this.toggleDisabled()}},{key:"toggleDisabled",value:function(){return this.options.disabled=!this.options.disabled,this.$element.prop("disabled",this.options.disabled),this.$wrapper.toggleClass(s.call(this,"disabled")),this.$element}},{key:"readonly",value:function(e){return void 0===e?this.options.readonly:this.options.readonly===!!e?this.$element:this.toggleReadonly()}},{key:"toggleReadonly",value:function(){return this.options.readonly=!this.options.readonly,this.$element.prop("readonly",this.options.readonly),this.$wrapper.toggleClass(s.call(this,"readonly")),this.$element}},{key:"indeterminate",value:function(e){return void 0===e?this.options.indeterminate:this.options.indeterminate===!!e?this.$element:this.toggleIndeterminate()}},{key:"toggleIndeterminate",value:function(){return this.options.indeterminate=!this.options.indeterminate,this.$element.prop("indeterminate",this.options.indeterminate),this.$wrapper.toggleClass(s.call(this,"indeterminate")),a.call(this),this.$element}},{key:"inverse",value:function(e){return void 0===e?this.options.inverse:this.options.inverse===!!e?this.$element:this.toggleInverse()}},{key:"toggleInverse",value:function(){this.$wrapper.toggleClass(s.call(this,"inverse"));var e=this.$on.clone(!0),t=this.$off.clone(!0);return this.$on.replaceWith(t),this.$off.replaceWith(e),this.$on=t,this.$off=e,this.options.inverse=!this.options.inverse,this.$element}},{key:"onColor",value:function(e){return void 0===e?this.options.onColor:(this.options.onColor&&this.$on.removeClass(s.call(this,this.options.onColor)),this.$on.addClass(s.call(this,e)),this.options.onColor=e,this.$element)}},{key:"offColor",value:function(e){return void 0===e?this.options.offColor:(this.options.offColor&&this.$off.removeClass(s.call(this,this.options.offColor)),this.$off.addClass(s.call(this,e)),this.options.offColor=e,this.$element)}},{key:"onText",value:function(e){return void 0===e?this.options.onText:(this.$on.html(e),o.call(this),a.call(this),this.options.onText=e,this.$element)}},{key:"offText",value:function(e){return void 0===e?this.options.offText:(this.$off.html(e),o.call(this),a.call(this),this.options.offText=e,this.$element)}},{key:"labelText",value:function(e){return void 0===e?this.options.labelText:(this.$label.html(e),o.call(this),this.options.labelText=e,this.$element)}},{key:"handleWidth",value:function(e){return void 0===e?this.options.handleWidth:(this.options.handleWidth=e,o.call(this),a.call(this),this.$element)}},{key:"labelWidth",value:function(e){return void 0===e?this.options.labelWidth:(this.options.labelWidth=e,o.call(this),a.call(this),this.$element)}},{key:"baseClass",value:function(){return this.options.baseClass}},{key:"wrapperClass",value:function(e){if(void 0===e)return this.options.wrapperClass;var t=e||l.fn.bootstrapSwitch.defaults.wrapperClass;return this.$wrapper.removeClass(n.call(this,this.options.wrapperClass).join(" ")),this.$wrapper.addClass(n.call(this,t).join(" ")),this.options.wrapperClass=t,this.$element}},{key:"radioAllOff",value:function(e){if(void 0===e)return this.options.radioAllOff;var t=!!e;return this.options.radioAllOff===t||(this.options.radioAllOff=t),this.$element}},{key:"onInit",value:function(e){return void 0===e?this.options.onInit:(this.options.onInit=e||l.fn.bootstrapSwitch.defaults.onInit,this.$element)}},{key:"onSwitchChange",value:function(e){return void 0===e?this.options.onSwitchChange:(this.options.onSwitchChange=e||l.fn.bootstrapSwitch.defaults.onSwitchChange,this.$element)}},{key:"destroy",value:function(){var e=this.$element.closest("form");return e.length&&e.off("reset.bootstrapSwitch").removeData("bootstrap-switch"),this.$container.children().not(this.$element).remove(),this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch"),this.$element}}]),c);function c(r){var i=this,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,c),this.$element=l(r),this.options=l.extend({},l.fn.bootstrapSwitch.defaults,function(){return{state:this.$element.is(":checked"),size:this.$element.data("size"),animate:this.$element.data("animate"),disabled:this.$element.is(":disabled"),readonly:this.$element.is("[readonly]"),indeterminate:this.$element.data("indeterminate"),inverse:this.$element.data("inverse"),radioAllOff:this.$element.data("radio-all-off"),onColor:this.$element.data("on-color"),offColor:this.$element.data("off-color"),onText:this.$element.data("on-text"),offText:this.$element.data("off-text"),labelText:this.$element.data("label-text"),handleWidth:this.$element.data("handle-width"),labelWidth:this.$element.data("label-width"),baseClass:this.$element.data("base-class"),wrapperClass:this.$element.data("wrapper-class")}}.call(this),e),this.prevOptions={},this.$wrapper=l("<div>",{class:function(){return e=i.options,t=i.$element.attr("id"),[e.state?"on":"off",e.size,e.disabled?"disabled":void 0,e.readonly?"readonly":void 0,e.indeterminate?"indeterminate":void 0,e.inverse?"inverse":void 0,t?"id-"+t:void 0].filter(function(e){return null==e}).map(function(e){return s.call(i,e)}).concat([i.options.baseClass],n.call(i,i.options.wrapperClass)).join(" ");var e,t}}),this.$container=l("<div>",{class:s.call(this,"container")}),this.$on=l("<span>",{html:this.options.onText,class:s.call(this,"handle-on")+" "+s.call(this,this.options.onColor)}),this.$off=l("<span>",{html:this.options.offText,class:s.call(this,"handle-off")+" "+s.call(this,this.options.offColor)}),this.$label=l("<span>",{html:this.options.labelText,class:s.call(this,"label")}),this.$element.on("init.bootstrapSwitch",function(){return i.options.onInit(r)}),this.$element.on("switchChange.bootstrapSwitch",function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];!1===i.options.onSwitchChange.apply(r,t)&&(i.$element.is(":radio")?l('[name="'+i.$element.attr("name")+'"]').trigger("previousState.bootstrapSwitch",!0):i.$element.trigger("previousState.bootstrapSwitch",!0))}),this.$container=this.$element.wrap(this.$container).parent(),this.$wrapper=this.$container.wrap(this.$wrapper).parent(),this.$element.before(this.options.inverse?this.$off:this.$on).before(this.$label).before(this.options.inverse?this.$on:this.$off),this.options.indeterminate&&this.$element.prop("indeterminate",!0),function(){function e(){n.setPrevOptions(),o.call(n),a.call(n),setTimeout(function(){return n.options.animate&&n.$wrapper.addClass(s.call(n,"animate"))},50)}var t,n=this;this.$wrapper.is(":visible")?e():t=window.setInterval(function(){return n.$wrapper.is(":visible")&&(e()||!0)&&window.clearInterval(t)},50)}.call(this),function(){var r=this;return this.$element.on({"setPreviousOptions.bootstrapSwitch":function(){return r.setPrevOptions()},"previousState.bootstrapSwitch":function(){r.options=r.prevOptions,r.options.indeterminate&&r.$wrapper.addClass(s.call(r,"indeterminate")),r.$element.prop("checked",r.options.state).trigger("change.bootstrapSwitch",!0)},"change.bootstrapSwitch":function(e,t){e.preventDefault(),e.stopImmediatePropagation();var n=r.$element.is(":checked");a.call(r,n),n===r.options.state||(r.options.state=n,r.$wrapper.toggleClass(s.call(r,"off")).toggleClass(s.call(r,"on")),t||(r.$element.is(":radio")&&l('[name="'+r.$element.attr("name")+'"]').not(r.$element).prop("checked",!1).trigger("change.bootstrapSwitch",!0),r.$element.trigger("switchChange.bootstrapSwitch",[n])))},"focus.bootstrapSwitch":function(e){e.preventDefault(),r.$wrapper.addClass(s.call(r,"focused"))},"blur.bootstrapSwitch":function(e){e.preventDefault(),r.$wrapper.removeClass(s.call(r,"focused"))},"keydown.bootstrapSwitch":function(e){!e.which||r.options.disabled||r.options.readonly||37!==e.which&&39!==e.which||(e.preventDefault(),e.stopImmediatePropagation(),r.state(39===e.which))}})}.call(this),function(){var t=this;return this.$on.on("click.bootstrapSwitch",function(e){return e.preventDefault(),e.stopPropagation(),t.state(!1),t.$element.trigger("focus.bootstrapSwitch")}),this.$off.on("click.bootstrapSwitch",function(e){return e.preventDefault(),e.stopPropagation(),t.state(!0),t.$element.trigger("focus.bootstrapSwitch")})}.call(this),function(){var n=this,r=void 0,i=void 0;this.$label.on({click:function(e){e.stopPropagation()},"mousedown.bootstrapSwitch touchstart.bootstrapSwitch":function(e){r||n.options.disabled||n.options.readonly||(e.preventDefault(),e.stopPropagation(),r=(e.pageX||e.originalEvent.touches[0].pageX)-parseInt(n.$container.css("margin-left"),10),n.options.animate&&n.$wrapper.removeClass(s.call(n,"animate")),n.$element.trigger("focus.bootstrapSwitch"))},"mousemove.bootstrapSwitch touchmove.bootstrapSwitch":function(e){var t;null!=r&&(t=(e.pageX||e.originalEvent.touches[0].pageX)-r,e.preventDefault(),t<-n.privateHandleWidth||0<t||(i=t,n.$container.css("margin-left",i+"px")))},"mouseup.bootstrapSwitch touchend.bootstrapSwitch":function(e){var t;r&&(e.preventDefault(),n.options.animate&&n.$wrapper.addClass(s.call(n,"animate")),i?(t=i>-n.privateHandleWidth/2,i=!1,n.state(n.options.inverse?!t:t)):n.state(!n.options.state),r=!1)},"mouseleave.bootstrapSwitch":function(){n.$label.trigger("mouseup.bootstrapSwitch")}})}.call(this),function(){function e(){return l(this).data("bootstrap-switch")}function t(){return l(this).bootstrapSwitch("state",this.checked)}var n=this.$element.closest("form");n.data("bootstrap-switch")||n.on("reset.bootstrapSwitch",function(){window.setTimeout(function(){n.find("input").filter(e).each(t)},1)}).data("bootstrap-switch",!0)}.call(this),function(){var t=this,n=this.$element.closest("label");n.on("click",function(e){e.preventDefault(),e.stopImmediatePropagation(),e.target===n[0]&&t.toggleState()})}.call(this),this.$element.trigger("init.bootstrapSwitch",this.options.state)}function d(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}l.fn.bootstrapSwitch=function(o){for(var e=arguments.length,a=Array(1<e?e-1:0),t=1;t<e;t++)a[t-1]=arguments[t];return Array.prototype.reduce.call(this,function(e,t){var n=l(t),r=n.data("bootstrap-switch"),i=r||new u(t,o);return r||n.data("bootstrap-switch",i),"string"==typeof o?i[o].apply(i,a):e},this)},l.fn.bootstrapSwitch.Constructor=u,l.fn.bootstrapSwitch.defaults={state:!0,size:null,animate:!0,disabled:!1,readonly:!1,indeterminate:!1,inverse:!1,radioAllOff:!1,onColor:"primary",offColor:"default",onText:"ON",offText:"OFF",labelText:"&nbsp",handleWidth:"auto",labelWidth:"auto",baseClass:"bootstrap-switch",wrapperClass:"wrapper",onInit:function(){},onSwitchChange:function(){}}}),function(e,t){"undefined"!=typeof module&&module.exports?("undefined"==typeof angular?t(require("angular")):t(angular),module.exports="ngDialog"):"function"==typeof define&&define.amd?define(["angular"],t):t(e.angular)}(this,function(O){"use strict";var e=O.module("ngDialog",[]),T=O.element,t=O.isDefined,n=(document.body||document.documentElement).style,u=t(n.animation)||t(n.WebkitAnimation)||t(n.MozAnimation)||t(n.MsAnimation)||t(n.OAnimation),c="animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",r={html:!1,body:!1},A={},E=[],P=!1,M=!1;return e.provider("ngDialog",function(){var S=this.defaults={className:"ngdialog-theme-default",appendClassName:"",disableAnimation:!1,plain:!1,showClose:!0,closeByDocument:!0,closeByEscape:!0,closeByNavigation:!1,appendTo:!1,preCloseCallback:!1,overlay:!0,cache:!0,trapFocus:!0,preserveFocus:!0,ariaAuto:!0,ariaRole:null,ariaLabelledById:null,ariaLabelledBySelector:null,ariaDescribedById:null,ariaDescribedBySelector:null,bodyClassName:"ngdialog-open",width:null,height:null};this.setForceHtmlReload=function(e){r.html=e||!1},this.setForceBodyReload=function(e){r.body=e||!1},this.setDefaults=function(e){O.extend(S,e)},this.setOpenOnePerName=function(e){M=e||!1};var C,k=0,D=0,x={};this.$get=["$document","$templateCache","$compile","$q","$http","$rootScope","$timeout","$window","$controller","$injector",function(n,o,g,a,s,m,v,y,w,l){var b=[],$={onDocumentKeydown:function(e){27===e.keyCode&&_.close("$escape")},activate:function(e){e.data("$ngDialogOptions").trapFocus&&(e.on("keydown",$.onTrapFocusKeydown),b.body.on("keydown",$.onTrapFocusKeydown))},deactivate:function(e){e.off("keydown",$.onTrapFocusKeydown),b.body.off("keydown",$.onTrapFocusKeydown)},deactivateAll:function(e){O.forEach(e,function(e){var t=O.element(e);$.deactivate(t)})},setBodyPadding:function(e){var t=parseInt(b.body.css("padding-right")||0,10);b.body.css("padding-right",t+e+"px"),b.body.data("ng-dialog-original-padding",t),m.$broadcast("ngDialog.setPadding",e)},resetBodyPadding:function(){var e=b.body.data("ng-dialog-original-padding");e?b.body.css("padding-right",e+"px"):b.body.css("padding-right",""),m.$broadcast("ngDialog.setPadding",0)},performCloseDialog:function(e,t){var n,r,i=e.data("$ngDialogOptions"),o=e.attr("id"),a=A[o];a&&(void 0!==y.Hammer?((n=a.hammerTime).off("tap",C),n.destroy&&n.destroy(),delete a.hammerTime):e.unbind("click"),1===D&&b.body.unbind("keydown",$.onDocumentKeydown),e.hasClass("ngdialog-closing")||--D,(r=e.data("$ngDialogPreviousFocus"))&&r.focus&&r.focus(),m.$broadcast("ngDialog.closing",e,t),D=D<0?0:D,u&&!i.disableAnimation?(a.$destroy(),e.unbind(c).bind(c,function(){$.closeDialogElement(e,t)}).addClass("ngdialog-closing")):(a.$destroy(),$.closeDialogElement(e,t)),x[o]&&(x[o].resolve({id:o,value:t,$dialog:e,remainingDialogs:D}),delete x[o]),A[o]&&delete A[o],E.splice(E.indexOf(o),1),E.length||(b.body.unbind("keydown",$.onDocumentKeydown),P=!1))},closeDialogElement:function(e,t){var n=e.data("$ngDialogOptions");e.remove(),0===D&&(b.html.removeClass(n.bodyClassName),b.body.removeClass(n.bodyClassName),$.resetBodyPadding()),m.$broadcast("ngDialog.closed",e,t)},closeDialog:function(e,t){var n=e.data("$ngDialogPreCloseCallback");if(n&&O.isFunction(n)){var r=n.call(e,t);if(O.isObject(r))r.closePromise?r.closePromise.then(function(){$.performCloseDialog(e,t)},function(){return!1}):r.then(function(){$.performCloseDialog(e,t)},function(){return!1});else{if(!1===r)return!1;$.performCloseDialog(e,t)}}else $.performCloseDialog(e,t)},onTrapFocusKeydown:function(e){var t,n=O.element(e.currentTarget);if(n.hasClass("ngdialog"))t=n;else if(null===(t=$.getActiveDialog()))return;var r=9===e.keyCode,i=!0===e.shiftKey;r&&$.handleTab(t,e,i)},handleTab:function(e,t,n){var r,i,o,a,s,l,u=$.getFocusableElements(e);0!==u.length?(r=document.activeElement,o=-1===(i=Array.prototype.indexOf.call(u,r)),a=0===i,s=i===u.length-1,l=!1,n?(o||a)&&(u[u.length-1].focus(),l=!0):(o||s)&&(u[0].focus(),l=!0),l&&(t.preventDefault(),t.stopPropagation())):document.activeElement&&document.activeElement.blur&&document.activeElement.blur()},autoFocus:function(e){var t,n,r,i=e[0],o=i.querySelector("*[autofocus]");null!==o&&(o.focus(),document.activeElement===o)||(0<(t=$.getFocusableElements(e)).length?t[0].focus():0<(n=$.filterVisibleElements(i.querySelectorAll("h1,h2,h3,h4,h5,h6,p,span"))).length&&(r=n[0],T(r).attr("tabindex","-1").css("outline","0"),r.focus()))},getFocusableElements:function(e){var t=e[0].querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]"),n=$.filterTabbableElements(t);return $.filterVisibleElements(n)},filterTabbableElements:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"-1"!==T(r).attr("tabindex")&&t.push(r)}return t},filterVisibleElements:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];(0<r.offsetWidth||0<r.offsetHeight)&&t.push(r)}return t},getActiveDialog:function(){var e=document.querySelectorAll(".ngdialog");return 0===e.length?null:T(e[e.length-1])},applyAriaAttributes:function(e,t){var n;t.ariaAuto&&(t.ariaRole||(n=0<$.getFocusableElements(e).length?"dialog":"alertdialog",t.ariaRole=n),t.ariaLabelledBySelector||(t.ariaLabelledBySelector="h1,h2,h3,h4,h5,h6"),t.ariaDescribedBySelector||(t.ariaDescribedBySelector="article,section,p")),t.ariaRole&&e.attr("role",t.ariaRole),$.applyAriaAttribute(e,"aria-labelledby",t.ariaLabelledById,t.ariaLabelledBySelector),$.applyAriaAttribute(e,"aria-describedby",t.ariaDescribedById,t.ariaDescribedBySelector)},applyAriaAttribute:function(e,t,n,r){if(n&&e.attr(t,n),r){var i=e.attr("id"),o=e[0].querySelector(r);if(!o)return;var a=i+"-"+t;return T(o).attr("id",a),e.attr(t,a),a}},detectUIRouter:function(){try{return O.module("ui.router"),!0}catch(e){return!1}},getRouterLocationEventName:function(){return $.detectUIRouter()?"$stateChangeStart":"$locationChangeStart"}},_={__PRIVATE__:$,open:function(e){var u=null;if(e=e||{},!(M&&e.name&&(u=e.name.toLowerCase().replace(/\s/g,"-")+"-dialog",this.isOpen(u)))){var t,c,d,p,h,f=O.copy(S),n=++k,u=u||"ngdialog"+n;E.push(u),void 0!==f.data&&(void 0===e.data&&(e.data={}),e.data=O.merge(O.copy(f.data),e.data)),O.extend(f,e),x[u]=t=a.defer(),A[u]=c=O.isObject(f.scope)?f.scope.$new():m.$new();var r=O.extend({},f.resolve);return O.forEach(r,function(e,t){r[t]=O.isString(e)?l.get(e):l.invoke(e,null,null,t)}),a.all({template:function(e){if(!e)return"Empty template";if(O.isString(e)&&f.plain)return e;return"boolean"!=typeof f.cache||f.cache?i(e,{cache:o}):i(e,{cache:!1})}(f.template||f.templateUrl),locals:a.all(r)}).then(function(e){var t=e.template,n=e.locals;f.showClose&&(t+='<div class="ngdialog-close"></div>');var r,i,o,a,s,l=f.overlay?"":" ngdialog-no-overlay";return(d=T('<div id="'+u+'" class="ngdialog'+l+'"></div>')).html(f.overlay?'<div class="ngdialog-overlay"></div><div class="ngdialog-content" role="document">'+t+"</div>":'<div class="ngdialog-content" role="document">'+t+"</div>"),d.data("$ngDialogOptions",f),c.ngDialogId=u,f.data&&O.isString(f.data)?(r=f.data.replace(/^\s*/,"")[0],c.ngDialogData="{"===r||"["===r?O.fromJson(f.data):new String(f.data),c.ngDialogData.ngDialogId=u):f.data&&O.isObject(f.data)&&(c.ngDialogData=f.data,c.ngDialogData.ngDialogId=u),f.className&&d.addClass(f.className),f.appendClassName&&d.addClass(f.appendClassName),f.width&&(h=d[0].querySelector(".ngdialog-content"),O.isString(f.width)?h.style.width=f.width:h.style.width=f.width+"px"),f.height&&(h=d[0].querySelector(".ngdialog-content"),O.isString(f.height)?h.style.height=f.height:h.style.height=f.height+"px"),f.disableAnimation&&d.addClass("ngdialog-disabled-animation"),p=f.appendTo&&O.isString(f.appendTo)?O.element(document.querySelector(f.appendTo)):b.body,$.applyAriaAttributes(d,f),f.preCloseCallback&&(O.isFunction(f.preCloseCallback)?i=f.preCloseCallback:O.isString(f.preCloseCallback)&&c&&(O.isFunction(c[f.preCloseCallback])?i=c[f.preCloseCallback]:c.$parent&&O.isFunction(c.$parent[f.preCloseCallback])?i=c.$parent[f.preCloseCallback]:m&&O.isFunction(m[f.preCloseCallback])&&(i=m[f.preCloseCallback])),i&&d.data("$ngDialogPreCloseCallback",i)),c.closeThisDialog=function(e){$.closeDialog(d,e)},f.controller&&(O.isString(f.controller)||O.isArray(f.controller)||O.isFunction(f.controller))&&(f.controllerAs&&O.isString(f.controllerAs)&&(o=f.controllerAs),a=w(f.controller,O.extend(n,{$scope:c,$element:d}),!0,o),f.bindToController&&O.extend(a.instance,{ngDialogId:c.ngDialogId,ngDialogData:c.ngDialogData,closeThisDialog:c.closeThisDialog,confirm:c.confirm}),"function"==typeof a?d.data("$ngDialogControllerController",a()):d.data("$ngDialogControllerController",a)),v(function(){var e=document.querySelectorAll(".ngdialog");$.deactivateAll(e),g(d)(c);var t=y.innerWidth-b.body.prop("clientWidth");b.html.addClass(f.bodyClassName),b.body.addClass(f.bodyClassName);var n=t-(y.innerWidth-b.body.prop("clientWidth"));0<n&&$.setBodyPadding(n),p.append(d),$.activate(d),f.trapFocus&&$.autoFocus(d),f.name?m.$broadcast("ngDialog.opened",{dialog:d,name:f.name}):m.$broadcast("ngDialog.opened",d)}),P||(b.body.bind("keydown",$.onDocumentKeydown),P=!0),f.closeByNavigation&&(s=$.getRouterLocationEventName(),m.$on(s,function(e){!1===$.closeDialog(d)&&e.preventDefault()})),f.preserveFocus&&d.data("$ngDialogPreviousFocus",document.activeElement),C=function(e){var t=!!f.closeByDocument&&T(e.target).hasClass("ngdialog-overlay"),n=T(e.target).hasClass("ngdialog-close");(t||n)&&_.close(d.attr("id"),n?"$closeButton":"$document")},void 0!==y.Hammer?(c.hammerTime=y.Hammer(d[0])).on("tap",C):d.bind("click",C),D+=1,_}),{id:u,closePromise:t.promise,close:function(e){$.closeDialog(d,e)}}}function i(t,e){return(e=e||{}).headers=e.headers||{},O.extend(e.headers,{Accept:"text/html"}),m.$broadcast("ngDialog.templateLoading",t),s.get(t,e).then(function(e){return m.$broadcast("ngDialog.templateLoaded",t),e.data||""})}},openConfirm:function(e){var n=a.defer(),t=O.copy(S);e=e||{},void 0!==t.data&&(void 0===e.data&&(e.data={}),e.data=O.merge(O.copy(t.data),e.data)),O.extend(t,e),t.scope=O.isObject(t.scope)?t.scope.$new():m.$new(),t.scope.confirm=function(e){n.resolve(e);var t=T(document.getElementById(r.id));$.performCloseDialog(t,e)};var r=_.open(t);if(r)return r.closePromise.then(function(e){return e?n.reject(e.value):n.reject()}),n.promise},isOpen:function(e){return 0<T(document.getElementById(e)).length},close:function(e,t){var n,r=T(document.getElementById(e));return r.length?$.closeDialog(r,t):"$escape"===e?(n=E[E.length-1],(r=T(document.getElementById(n))).data("$ngDialogOptions").closeByEscape&&$.closeDialog(r,"$escape")):_.closeAll(t),_},closeAll:function(e){for(var t=document.querySelectorAll(".ngdialog"),n=t.length-1;0<=n;n--){var r=t[n];$.closeDialog(T(r),e)}},getOpenDialogs:function(){return E},getDefaults:function(){return S}};return O.forEach(["html","body"],function(e){var t;b[e]=n.find(e),r[e]&&(t=$.getRouterLocationEventName(),m.$on(t,function(){b[e]=n.find(e)}))}),_}]}),e.directive("ngDialog",["ngDialog",function(o){return{restrict:"A",scope:{ngDialogScope:"="},link:function(r,e,i){e.on("click",function(e){e.preventDefault();var t=O.isDefined(r.ngDialogScope)?r.ngDialogScope:"noScope";O.isDefined(i.ngDialogClosePrevious)&&o.close(i.ngDialogClosePrevious);var n=o.getDefaults();o.open({template:i.ngDialog,className:i.ngDialogClass||n.className,appendClassName:i.ngDialogAppendClass,controller:i.ngDialogController,controllerAs:i.ngDialogControllerAs,bindToController:i.ngDialogBindToController,disableAnimation:i.ngDialogDisableAnimation,scope:t,data:i.ngDialogData,showClose:"false"!==i.ngDialogShowClose&&("true"===i.ngDialogShowClose||n.showClose),closeByDocument:"false"!==i.ngDialogCloseByDocument&&("true"===i.ngDialogCloseByDocument||n.closeByDocument),closeByEscape:"false"!==i.ngDialogCloseByEscape&&("true"===i.ngDialogCloseByEscape||n.closeByEscape),overlay:"false"!==i.ngDialogOverlay&&("true"===i.ngDialogOverlay||n.overlay),preCloseCallback:i.ngDialogPreCloseCallback||n.preCloseCallback,bodyClassName:i.ngDialogBodyClass||n.bodyClassName})})}}}]),e}),angular.module("ui-notification",[]),angular.module("ui-notification").provider("Notification",function(){this.options={delay:5e3,startTop:10,startRight:10,verticalSpacing:10,horizontalSpacing:10,positionX:"right",positionY:"top",replaceMessage:!1,templateUrl:"angular-ui-notification.html",onClose:void 0,closeOnClick:!0,maxCount:0,container:"body",priority:10},this.setOptions=function(e){if(!angular.isObject(e))throw new Error("Options should be an object!");this.options=angular.extend({},this.options,e)},this.$get=["$timeout","$http","$compile","$templateCache","$rootScope","$injector","$sce","$q","$window",function(u,r,c,i,o,e,f,a,g){function t(h,e){function t(e){function t(t){["-webkit-transition","-o-transition","transition"].forEach(function(e){i.css(e,t)})}var n=h.scope.$new();n.message=f.trustAsHtml(h.message),n.title=f.trustAsHtml(h.title),n.t=h.type.substr(0,1),n.delay=h.delay,n.onClose=h.onClose;function d(e,t){return e._priority-t._priority}function p(e,t){return t._priority-e._priority}function r(){var e=0,t=0,n=y,r=[];"top"===h.positionY?$.sort(d):"bottom"===h.positionY&&$.sort(p);for(var i=$.length-1;0<=i;i--){var o,a,s,l,u,c=$[i];h.replaceMessage&&i<$.length-1?c.addClass("killed"):(o=parseInt(c[0].offsetHeight),a=parseInt(c[0].offsetWidth),s=r[c._positionY+c._positionX],l+o>window.innerHeight&&(s=v,t++,e=0),l=s?0===e?s:s+w:v,u=n+t*(b+a),c.css(c._positionY,l+"px"),"center"==c._positionX?c.css("left",parseInt(window.innerWidth/2-a/2)+"px"):c.css(c._positionX,u+"px"),r[c._positionY+c._positionX]=l+o,0<m.maxCount&&$.length>m.maxCount&&0===i&&c.scope().kill(!0),e++)}}var i=c(e)(n);i._positionY=h.positionY,i._positionX=h.positionX,i._priority=h.priority,i.addClass(h.type);function o(e){("click"===(e=e.originalEvent||e).type||"opacity"===e.propertyName&&1<=e.elapsedTime)&&(n.onClose&&n.$apply(n.onClose(i)),i.remove(),$.splice($.indexOf(i),1),n.$destroy(),r())}h.closeOnClick&&(i.addClass("clickable"),i.bind("click",o)),i.bind("webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd",o),angular.isNumber(h.delay)&&u(function(){i.addClass("killed")},h.delay),t("none"),angular.element(document.querySelector(h.container)).append(i);var a,s=-(parseInt(i[0].offsetHeight)+50);i.css(i._positionY,s+"px"),$.push(i),"center"==h.positionX&&(a=parseInt(i[0].offsetWidth),i.css("left",parseInt(window.innerWidth/2-a/2)+"px")),u(function(){t("")}),n._templateElement=i,n.kill=function(e){e?(n.onClose&&n.$apply(n.onClose(n._templateElement)),$.splice($.indexOf(n._templateElement),1),n._templateElement.remove(),n.$destroy(),u(r)):n._templateElement.addClass("killed")},u(r),_||(angular.element(g).bind("resize",function(e){u(r)}),_=!0),l.resolve(n)}var l=a.defer();"object"==typeof h&&null!==h||(h={message:h}),h.scope=h.scope?h.scope:o,h.template=h.templateUrl?h.templateUrl:m.templateUrl,h.delay=angular.isUndefined(h.delay)?s:h.delay,h.type=e||h.type||m.type||"",h.positionY=h.positionY?h.positionY:m.positionY,h.positionX=h.positionX?h.positionX:m.positionX,h.replaceMessage=h.replaceMessage?h.replaceMessage:m.replaceMessage,h.onClose=h.onClose?h.onClose:m.onClose,h.closeOnClick=null!==h.closeOnClick&&void 0!==h.closeOnClick?h.closeOnClick:m.closeOnClick,h.container=h.container?h.container:m.container,h.priority=h.priority?h.priority:m.priority;var n=i.get(h.template);return n?t(n):r.get(h.template,{cache:!0}).then(function(e){t(e.data)}).catch(function(e){throw new Error("Template ("+h.template+") could not be loaded. "+e)}),l.promise}var m=this.options,v=m.startTop,y=m.startRight,w=m.verticalSpacing,b=m.horizontalSpacing,s=m.delay,$=[],_=!1;return t.primary=function(e){return this(e,"primary")},t.error=function(e){return this(e,"error")},t.success=function(e){return this(e,"success")},t.info=function(e){return this(e,"info")},t.warning=function(e){return this(e,"warning")},t.clearAll=function(){angular.forEach($,function(e){e.addClass("killed")})},t}]}),angular.module("ui-notification").run(["$templateCache",function(e){e.put("angular-ui-notification.html",'<div class="ui-notification"><h3 ng-show="title" ng-bind-html="title"></h3><div class="message" ng-bind-html="message"></div></div>')}]),function(){var m="__default";angular.module("angularUtils.directives.dirPagination",[]).directive("dirPaginate",["$compile","$parse","paginationService",function(h,f,g){return{terminal:!0,multiElement:!0,priority:100,compile:function(e,t){var d=t.dirPaginate,n=d.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),r=/\|\s*itemsPerPage\s*:\s*(.*\(\s*\w*\)|([^\)]*?(?=\s+as\s+))|[^\)]*)/;if(null===n[2].match(r))throw"pagination directive: the 'itemsPerPage' filter must be set.";var i=n[2].replace(r,""),p=f(i);!function(e){angular.forEach(e,function(e){1===e.nodeType&&angular.element(e).attr("dir-paginate-no-compile",!0)})}(e);var o=t.paginationId||m;return g.registerInstance(o),function(e,t,n){var r=f(n.paginationId)(e)||n.paginationId||m;g.registerInstance(r);var i,o,a,s,l=function(e,t){var n,r=!!e.match(/(\|\s*itemsPerPage\s*:[^|]*:[^|]*)/);n=t===m||r?e:e.replace(/(\|\s*itemsPerPage\s*:\s*[^|\s]*)/,"$1 : '"+t+"'");return n}(d,r);o=n,a=l,(i=t)[0].hasAttribute("dir-paginate-start")||i[0].hasAttribute("data-dir-paginate-start")?(o.$set("ngRepeatStart",a),i.eq(i.length-1).attr("ng-repeat-end",!0)):o.$set("ngRepeat",a),s=t,angular.forEach(s,function(e){1===e.nodeType&&angular.element(e).removeAttr("dir-paginate-no-compile")}),s.eq(0).removeAttr("dir-paginate-start").removeAttr("dir-paginate").removeAttr("data-dir-paginate-start").removeAttr("data-dir-paginate"),s.eq(s.length-1).removeAttr("dir-paginate-end").removeAttr("data-dir-paginate-end");var u=h(t),c=function(e,t,n){var r;{var i;r=t.currentPage?f(t.currentPage):(i=(n+"__currentPage").replace(/\W/g,"_"),e[i]=1,f(i))}return r}(e,n,r);g.setCurrentPageParser(r,c,e),void 0!==n.totalItems?(g.setAsyncModeTrue(r),e.$watch(function(){return f(n.totalItems)(e)},function(e){0<=e&&g.setCollectionLength(r,e)})):(g.setAsyncModeFalse(r),e.$watchCollection(function(){return p(e)},function(e){var t;e&&(t=e instanceof Array?e.length:Object.keys(e).length,g.setCollectionLength(r,t))})),u(e)}}}}]).directive("dirPaginateNoCompile",function(){return{priority:5e3,terminal:!0}}).directive("dirPaginationControls",["paginationService","paginationTemplate",function(d,n){var p=/^\d+$/,e={restrict:"AE",scope:{maxSize:"=?",onPageChange:"&?",paginationId:"=?",autoHide:"=?"},link:function(r,e,t){var n=t.paginationId||m,i=r.paginationId||t.paginationId||m;{var o;d.isRegistered(i)||d.isRegistered(n)||(o=i!==m?" (id: "+i+") ":" ",window.console&&console.warn("Pagination directive: the pagination controls"+o+"cannot be used without the corresponding pagination directive, which was not found at link time."))}r.maxSize||(r.maxSize=9);r.autoHide=void 0===r.autoHide||r.autoHide,r.directionLinks=!angular.isDefined(t.directionLinks)||r.$parent.$eval(t.directionLinks),r.boundaryLinks=!!angular.isDefined(t.boundaryLinks)&&r.$parent.$eval(t.boundaryLinks);var a=Math.max(r.maxSize,5);function s(e){var t;d.isRegistered(i)&&c(e)&&(t=r.pagination.current,r.pages=h(e,d.getCollectionLength(i),d.getItemsPerPage(i),a),r.pagination.current=e,u(),r.onPageChange&&r.onPageChange({newPageNumber:e,oldPageNumber:t}))}function l(){var e;d.isRegistered(i)&&(e=parseInt(d.getCurrentPage(i))||1,r.pages=h(e,d.getCollectionLength(i),d.getItemsPerPage(i),a),r.pagination.current=e,r.pagination.last=r.pages[r.pages.length-1],r.pagination.last<r.pagination.current?r.setCurrent(r.pagination.last):u())}function u(){var e,t,n;d.isRegistered(i)&&(e=d.getCurrentPage(i),t=d.getItemsPerPage(i),n=d.getCollectionLength(i),r.range.lower=(e-1)*t+1,r.range.upper=Math.min(e*t,n),r.range.total=n)}function c(e){return p.test(e)&&0<e&&e<=r.pagination.last}r.pages=[],r.pagination={last:1,current:1},r.range={lower:1,upper:1,total:1},r.$watch("maxSize",function(e){e&&(a=Math.max(r.maxSize,5),l())}),r.$watch(function(){if(d.isRegistered(i))return(d.getCollectionLength(i)+1)*d.getItemsPerPage(i)},function(e){0<e&&l()}),r.$watch(function(){if(d.isRegistered(i))return d.getItemsPerPage(i)},function(e,t){e!=t&&void 0!==t&&s(r.pagination.current)}),r.$watch(function(){if(d.isRegistered(i))return d.getCurrentPage(i)},function(e,t){e!=t&&s(e)}),r.setCurrent=function(e){d.isRegistered(i)&&c(e)&&(e=parseInt(e,10),d.setCurrentPage(i,e))},r.tracker=function(e,t){return e+"_"+t}}},t=n.getString();void 0!==t?e.template=t:e.templateUrl=function(e,t){return t.templateUrl||n.getPath()};return e;function h(e,t,n,r){for(var i=[],o=Math.ceil(t/n),a=Math.ceil(r/2),s=e<=a?"start":o-a<e?"end":"middle",l=r<o,u=1;u<=o&&u<=r;){var c=f(u,e,r,o);l&&(2===u&&("middle"===s||"end"===s)||u===r-1&&("middle"===s||"start"===s))?i.push("..."):i.push(c),u++}return i}function f(e,t,n,r){var i=Math.ceil(n/2);return e===n?r:1!==e&&n<r?r-i<t?r-n+e:i<t?t-i+e:e:e}}]).filter("itemsPerPage",["paginationService",function(a){return function(t,e,n){if(void 0===n&&(n=m),!a.isRegistered(n))throw"pagination directive: the itemsPerPage id argument (id: "+n+") does not match a registered pagination-id.";var r,i;if(angular.isObject(t)){if(e=parseInt(e)||9999999999,r=(i=a.isAsyncMode(n)?0:(a.getCurrentPage(n)-1)*e)+e,a.setItemsPerPage(n,e),t instanceof Array)return t.slice(i,r);var o={};return angular.forEach(function(e){{if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}}(t).slice(i,r),function(e){o[e]=t[e]}),o}return t}}]).service("paginationService",function(){var t,r={};this.registerInstance=function(e){void 0===r[e]&&(r[e]={asyncMode:!1},t=e)},this.deregisterInstance=function(e){delete r[e]},this.isRegistered=function(e){return void 0!==r[e]},this.getLastInstanceId=function(){return t},this.setCurrentPageParser=function(e,t,n){r[e].currentPageParser=t,r[e].context=n},this.setCurrentPage=function(e,t){r[e].currentPageParser.assign(r[e].context,t)},this.getCurrentPage=function(e){var t=r[e].currentPageParser;return t?t(r[e].context):1},this.setItemsPerPage=function(e,t){r[e].itemsPerPage=t},this.getItemsPerPage=function(e){return r[e].itemsPerPage},this.setCollectionLength=function(e,t){r[e].collectionLength=t},this.getCollectionLength=function(e){return r[e].collectionLength},this.setAsyncModeTrue=function(e){r[e].asyncMode=!0},this.setAsyncModeFalse=function(e){r[e].asyncMode=!1},this.isAsyncMode=function(e){return r[e].asyncMode}}).provider("paginationTemplate",function(){var t,n="angularUtils.directives.dirPagination.template";this.setPath=function(e){n=e},this.setString=function(e){t=e},this.$get=function(){return{getPath:function(){return n},getString:function(){return t}}}}).run(["$templateCache",function(e){e.put("angularUtils.directives.dirPagination.template",'<ul class="pagination" ng-if="1 < pages.length || !autoHide"><li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == 1 }"><a href="" ng-click="setCurrent(1)">&laquo;</a></li><li ng-if="directionLinks" ng-class="{ disabled : pagination.current == 1 }"><a href="" ng-click="setCurrent(pagination.current - 1)">&lsaquo;</a></li><li ng-repeat="pageNumber in pages track by tracker(pageNumber, $index)" ng-class="{ active : pagination.current == pageNumber, disabled : pageNumber == \'...\' || ( ! autoHide && pages.length === 1 ) }"><a href="" ng-click="setCurrent(pageNumber)">{{ pageNumber }}</a></li><li ng-if="directionLinks" ng-class="{ disabled : pagination.current == pagination.last }"><a href="" ng-click="setCurrent(pagination.current + 1)">&rsaquo;</a></li><li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == pagination.last }"><a href="" ng-click="setCurrent(pagination.last)">&raquo;</a></li></ul>')}])}();var com_github_culmat_jsTreeTable=function(){function l(e,r,i){return i=i||"children",$.each(e,function(e,t){!function n(e){e[i]&&$.each(e[i],function(e,t){n(t)}),r(e)}(t)}),e}function t(e,n,o,a){var t=e;n=n||"id",o=o||"parent",a=a||"children";var s=[];$.each(t,function(e,t){s[t[n]]=t});var l=[];return $.each(t,function(e,r){var i,t=r[o];$.isArray(t)||(t=[t]),0==t.length?l.push(r):(i=!1,$.each(t,function(e,t){var n=s[t];n&&(n[a]||(n[a]=[]),$.inArray(r,n[a])<0&&n[a].push(r),i=!0)}),i||l.push(r))}),l}function u(e,u,c,d,p,t){u=u||"children",c=c||"id",t=t||{};var n=0,r=$("<table>");$.each(t,function(e,t){"class"==e&&"jsTT"!=t?r.addClass(t):r.attr(e,t)});var i=$("<thead>"),o=$("<tr>"),h=$("<tbody>");return r.append(i),i.append(o),r.append(h),d?$.each(d,function(e,t){$(o).append($("<th>"+t+"</th>"))}):($(o).append($("<th>"+c+"</th>")),$.each(e[0],function(e,t){e!=u&&e!=c&&$(o).append($("<th>"+e+"</th>"))})),function o(e,a,s,l){n=Math.max(n,s),$.each(e,function(e,n){var r,t,i;n["data-tt-level"]=s,r=n,t=l,i=$("<tr>"),$(i).attr("data-tt-id",r[c]),$(i).attr("data-tt-level",r["data-tt-level"]),r[u]&&0!=r[u].length?$(i).attr("data-tt-isnode",!0):$(i).attr("data-tt-isleaf",!0),t&&$(i).attr("data-tt-parent-id",t[c]),p?p($(i),r):d?$.each(d,function(e,t){$(i).append($("<td>"+r[e]+"</td>"))}):($(i).append($("<td>"+r[c]+"</td>")),$.each(r,function(e,t){e!=u&&e!=c&&"data-tt-level"!=e&&$(i).append($("<td>"+t+"</td>"))})),h.append(i),n[a]&&$.each(n[a],function(e,t){o([t],a,s+1,n)})})}(e,u,1),e[0]&&(e[0].maxLevel=n),r}function n(e,t){return $.each(e,function(e,n){$.each(t,function(e,t){n[t]=$(n).attr(t)})}),e}function c(i){i.addClass("jsTT"),i.expandLevel=function(n){$("tr[data-tt-level]",i).each(function(e){var t=parseInt($(this).attr("data-tt-level"));n-1<t?this.trCollapse(!0):t==n-1&&this.trExpand(!0)})},$("tr[data-tt-id]",i).each(function(e,t){(t=$(t)).attr("data-tt-level",function e(t){var n=t.attr("data-tt-level");if(null!=n)return parseInt(n);var r=t.attr("data-tt-parent-id");return null==r?0:e($('tr[data-tt-id="'+r+'"]',i).first())+1}(t))});var e=$("tr[data-tt-level]",i).get();$.each(e,function(e,t){t.trChildrenVisible=!0,t.trChildren=[]}),e=t(e=n(e,["data-tt-id","data-tt-parent-id"]),"data-tt-id","data-tt-parent-id","trChildren");var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHFJREFUeNpi/P//PwMlgImBQsA44C6gvhfa29v3MzAwOODRc6CystIRbxi0t7fjDJjKykpGYrwwi1hxnLHQ3t7+jIGBQRJJ6HllZaUUKYEYRYBPOB0gBShKwKGA////48VtbW3/8clTnBIH3gCKkzJgAGvBX0dDm0sCAAAAAElFTkSuQmCC";return $("tr[data-tt-level]",i).each(function(e,t){var n=$(t).attr("data-tt-level"),r=$("td",t).first();0<t.trChildren.length?r.prepend($('<img id="state" style="cursor:pointer" src="'+o+'"/>')):r.prepend($('<span style="padding-left:16px;" /></span>')),r.prepend($('<span style="padding-left:'+15*parseInt(n-1)+'px;" /></span>')),t.trExpand=function(e){var n;this.trChildren.length<1||(e&&(this.trChildrenVisible=!0,$("#state",this).get(0).src=o),n=e||this.trChildrenVisible,$.each(this.trChildren,function(e,t){n&&$(t).css("display","table-row"),t.trExpand()}))},t.trCollapse=function(e){this.trChildren.length<1||(e&&(this.trChildrenVisible=!1,$("#state",this).get(0).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHlJREFUeNrcU1sNgDAQ6wgmcAM2MICGGlg1gJnNzWQcvwQGy1j4oUl/7tH0mpwzM7SgQyO+EZAUWh2MkkzSWhJwuRAlHYsJwEwyvs1gABDuzqoJcTw5qxaIJN0bgQRgIjnlmn1heSO5PE6Y2YXe+5Cr5+h++gs12AcAS6FS+7YOsj4AAAAASUVORK5CYII="),$.each(this.trChildren,function(e,t){$(t).css("display","none"),t.trCollapse()}))},$(t).click(function(){this.trChildrenVisible?this.trCollapse(!0):this.trExpand(!0)})}),i}return{depthFirst:l,makeTree:t,renderTree:u,attr2attr:n,treeTable:c,appendTreetable:function(e,t){(t=t||{}).idAttr=t.idAttr||"id",t.childrenAttr=t.childrenAttr||"children";var n=t.controls||[];t.mountPoint||(t.mountPoint=$("body")),t.depthFirst&&l(e,t.depthFirst,t.childrenAttr);var r=u(e,t.childrenAttr,t.idAttr,t.renderedAttr,t.renderer,t.tableAttributes);c(r),t.replaceContent&&t.mountPoint.html("");var i,o,a,s=t.initialExpandLevel?parseInt(t.initialExpandLevel):-1,s=Math.min(s,e[0].maxLevel);return r.expandLevel(s),t.slider&&((i=$('<div style="margin-right: 15px;">')).width("200px"),i.slider({min:1,max:e[0].maxLevel,range:"min",value:s,slide:function(e,t){r.expandLevel(t.value)}}),n=[i].concat(t.controls)),0<n.length&&t.mountPoint.append((o=n,a=$("<tr>"),$.each(o,function(e,t){a.append($('<td style="padding-right: 20px;">').append(t))}),$('<table border="0"/>').append(a))),t.mountPoint.append(r),r},jsTreeTable:"1.0",register:function(n){$.each(this,function(e,t){"register"!=e&&(n[e]=t)})}}}();