gantt.js 679 KB
!function(t,e,n){"use strict";function i(t,e){return e=e||Error,function(){var n,i,r=2,o=arguments,a=o[0],s="["+(t?t+":":"")+a+"] ",l=o[1];for(s+=l.replace(/\{\d+\}/g,function(t){var e=+t.slice(1,-1),n=e+r;return n<o.length?$t(o[n]):t}),s+="\nhttp://errors.angularjs.org/1.5.0/"+(t?t+"/":"")+a,i=r,n="?";i<o.length;i++,n="&")s+=n+"p"+(i-r)+"="+encodeURIComponent($t(o[i]));return new e(s)}}function r(t){if(null==t||_(t))return!1;if(zi(t)||C(t)||Fi&&t instanceof Fi)return!0;var e="length"in Object(t)&&t.length;return S(e)&&(e>=0&&(e-1 in t||t instanceof Array)||"function"==typeof t.item)}function o(t,e,n){var i,a;if(t)if(D(t))for(i in t)"prototype"==i||"length"==i||"name"==i||t.hasOwnProperty&&!t.hasOwnProperty(i)||e.call(n,t[i],i,t);else if(zi(t)||r(t)){var s="object"!=typeof t;for(i=0,a=t.length;a>i;i++)(s||i in t)&&e.call(n,t[i],i,t)}else if(t.forEach&&t.forEach!==o)t.forEach(e,n,t);else if(x(t))for(i in t)e.call(n,t[i],i,t);else if("function"==typeof t.hasOwnProperty)for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t);else for(i in t)Mi.call(t,i)&&e.call(n,t[i],i,t);return t}function a(t,e,n){for(var i=Object.keys(t).sort(),r=0;r<i.length;r++)e.call(n,t[i[r]],i[r]);return i}function s(t){return function(e,n){t(n,e)}}function l(){return++Wi}function u(t,e){e?t.$$hashKey=e:delete t.$$hashKey}function c(t,e,n){for(var i=t.$$hashKey,r=0,o=e.length;o>r;++r){var a=e[r];if(w(a)||D(a))for(var s=Object.keys(a),l=0,d=s.length;d>l;l++){var h=s[l],f=a[h];n&&w(f)?k(f)?t[h]=new Date(f.valueOf()):E(f)?t[h]=new RegExp(f):f.nodeName?t[h]=f.cloneNode(!0):N(f)?t[h]=f.clone():(w(t[h])||(t[h]=zi(f)?[]:{}),c(t[h],[f],!0)):t[h]=f}}return u(t,i),t}function d(t){return c(t,Ri.call(arguments,1),!1)}function h(t){return c(t,Ri.call(arguments,1),!0)}function f(t){return parseInt(t,10)}function p(t,e){return d(Object.create(t),e)}function m(){}function g(t){return t}function v(t){return function(){return t}}function y(t){return D(t.toString)&&t.toString!==Hi}function b(t){return"undefined"==typeof t}function $(t){return"undefined"!=typeof t}function w(t){return null!==t&&"object"==typeof t}function x(t){return null!==t&&"object"==typeof t&&!Bi(t)}function C(t){return"string"==typeof t}function S(t){return"number"==typeof t}function k(t){return"[object Date]"===Hi.call(t)}function D(t){return"function"==typeof t}function E(t){return"[object RegExp]"===Hi.call(t)}function _(t){return t&&t.window===t}function M(t){return t&&t.$evalAsync&&t.$watch}function T(t){return"[object File]"===Hi.call(t)}function P(t){return"[object FormData]"===Hi.call(t)}function A(t){return"[object Blob]"===Hi.call(t)}function j(t){return"boolean"==typeof t}function O(t){return t&&D(t.then)}function F(t){return t&&S(t.length)&&Gi.test(Hi.call(t))}function I(t){return"[object ArrayBuffer]"===Hi.call(t)}function N(t){return!(!t||!(t.nodeName||t.prop&&t.attr&&t.find))}function R(t){var e,n={},i=t.split(",");for(e=0;e<i.length;e++)n[i[e]]=!0;return n}function L(t){return Ti(t.nodeName||t[0]&&t[0].nodeName)}function V(t,e){var n=t.indexOf(e);return n>=0&&t.splice(n,1),n}function H(t,e){function i(t,e){var n,i=e.$$hashKey;if(zi(t))for(var o=0,a=t.length;a>o;o++)e.push(r(t[o]));else if(x(t))for(n in t)e[n]=r(t[n]);else if(t&&"function"==typeof t.hasOwnProperty)for(n in t)t.hasOwnProperty(n)&&(e[n]=r(t[n]));else for(n in t)Mi.call(t,n)&&(e[n]=r(t[n]));return u(e,i),e}function r(t){if(!w(t))return t;var e=s.indexOf(t);if(-1!==e)return l[e];if(_(t)||M(t))throw Ui("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");var r=!1,o=a(t);return o===n&&(o=zi(t)?[]:Object.create(Bi(t)),r=!0),s.push(t),l.push(o),r?i(t,o):o}function a(t){switch(Hi.call(t)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new t.constructor(r(t.buffer));case"[object ArrayBuffer]":if(!t.slice){var e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}return t.slice(0);case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new t.constructor(t.valueOf());case"[object RegExp]":var n=new RegExp(t.source,t.toString().match(/[^\/]*$/)[0]);return n.lastIndex=t.lastIndex,n}return D(t.cloneNode)?t.cloneNode(!0):void 0}var s=[],l=[];if(e){if(F(e)||I(e))throw Ui("cpta","Can't copy! TypedArray destination cannot be mutated.");if(t===e)throw Ui("cpi","Can't copy! Source and destination are identical.");return zi(e)?e.length=0:o(e,function(t,n){"$$hashKey"!==n&&delete e[n]}),s.push(t),l.push(e),i(t,e)}return r(t)}function B(t,e){if(zi(t)){e=e||[];for(var n=0,i=t.length;i>n;n++)e[n]=t[n]}else if(w(t)){e=e||{};for(var r in t)"$"===r.charAt(0)&&"$"===r.charAt(1)||(e[r]=t[r])}return e||t}function U(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!==t&&e!==e)return!0;var n,i,r,o=typeof t,a=typeof e;if(o==a&&"object"==o){if(!zi(t)){if(k(t))return k(e)?U(t.getTime(),e.getTime()):!1;if(E(t))return E(e)?t.toString()==e.toString():!1;if(M(t)||M(e)||_(t)||_(e)||zi(e)||k(e)||E(e))return!1;r=vt();for(i in t)if("$"!==i.charAt(0)&&!D(t[i])){if(!U(t[i],e[i]))return!1;r[i]=!0}for(i in e)if(!(i in r)&&"$"!==i.charAt(0)&&$(e[i])&&!D(e[i]))return!1;return!0}if(!zi(e))return!1;if((n=t.length)==e.length){for(i=0;n>i;i++)if(!U(t[i],e[i]))return!1;return!0}}return!1}function Y(t,e,n){return t.concat(Ri.call(e,n))}function W(t,e){return Ri.call(t,e||0)}function z(t,e){var n=arguments.length>2?W(arguments,2):[];return!D(e)||e instanceof RegExp?e:n.length?function(){return arguments.length?e.apply(t,Y(n,arguments,0)):e.apply(t,n)}:function(){return arguments.length?e.apply(t,arguments):e.call(t)}}function G(t,i){var r=i;return"string"==typeof t&&"$"===t.charAt(0)&&"$"===t.charAt(1)?r=n:_(i)?r="$WINDOW":i&&e===i?r="$DOCUMENT":M(i)&&(r="$SCOPE"),r}function q(t,e){return b(t)?n:(S(e)||(e=e?2:null),JSON.stringify(t,G,e))}function X(t){return C(t)?JSON.parse(t):t}function K(t,e){t=t.replace(Qi,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(n)?e:n}function Z(t,e){return t=new Date(t.getTime()),t.setMinutes(t.getMinutes()+e),t}function Q(t,e,n){n=n?-1:1;var i=t.getTimezoneOffset(),r=K(e,i);return Z(t,n*(r-i))}function J(t){t=Fi(t).clone();try{t.empty()}catch(e){}var n=Fi("<div>").append(t).html();try{return t[0].nodeType===rr?Ti(n):n.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(t,e){return"<"+Ti(e)})}catch(e){return Ti(n)}}function tt(t){try{return decodeURIComponent(t)}catch(e){}}function et(t){var e={};return o((t||"").split("&"),function(t){var n,i,r;t&&(i=t=t.replace(/\+/g,"%20"),n=t.indexOf("="),-1!==n&&(i=t.substring(0,n),r=t.substring(n+1)),i=tt(i),$(i)&&(r=$(r)?tt(r):!0,Mi.call(e,i)?zi(e[i])?e[i].push(r):e[i]=[e[i],r]:e[i]=r))}),e}function nt(t){var e=[];return o(t,function(t,n){zi(t)?o(t,function(t){e.push(rt(n,!0)+(t===!0?"":"="+rt(t,!0)))}):e.push(rt(n,!0)+(t===!0?"":"="+rt(t,!0)))}),e.length?e.join("&"):""}function it(t){return rt(t,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function rt(t,e){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,e?"%20":"+")}function ot(t,e){var n,i,r=Ji.length;for(i=0;r>i;++i)if(n=Ji[i]+e,C(n=t.getAttribute(n)))return n;return null}function at(t,e){var n,i,r={};o(Ji,function(e){var r=e+"app";!n&&t.hasAttribute&&t.hasAttribute(r)&&(n=t,i=t.getAttribute(r))}),o(Ji,function(e){var r,o=e+"app";!n&&(r=t.querySelector("["+o.replace(":","\\:")+"]"))&&(n=r,i=r.getAttribute(o))}),n&&(r.strictDi=null!==ot(n,"strict-di"),e(n,i?[i]:[],r))}function st(n,i,r){w(r)||(r={});var a={strictDi:!1};r=d(a,r);var s=function(){if(n=Fi(n),n.injector()){var t=n[0]===e?"document":J(n);throw Ui("btstrpd","App Already Bootstrapped with this Element '{0}'",t.replace(/</,"&lt;").replace(/>/,"&gt;"))}i=i||[],i.unshift(["$provide",function(t){t.value("$rootElement",n)}]),r.debugInfoEnabled&&i.push(["$compileProvider",function(t){t.debugInfoEnabled(!0)}]),i.unshift("ng");var o=re(i,r.strictDi);return o.invoke(["$rootScope","$rootElement","$compile","$injector",function(t,e,n,i){t.$apply(function(){e.data("$injector",i),n(e)(t)})}]),o},l=/^NG_ENABLE_DEBUG_INFO!/,u=/^NG_DEFER_BOOTSTRAP!/;return t&&l.test(t.name)&&(r.debugInfoEnabled=!0,t.name=t.name.replace(l,"")),t&&!u.test(t.name)?s():(t.name=t.name.replace(u,""),Yi.resumeBootstrap=function(t){return o(t,function(t){i.push(t)}),s()},void(D(Yi.resumeDeferredBootstrap)&&Yi.resumeDeferredBootstrap()))}function lt(){t.name="NG_ENABLE_DEBUG_INFO!"+t.name,t.location.reload()}function ut(t){var e=Yi.element(t).injector();if(!e)throw Ui("test","no injector found for element argument to getTestability");return e.get("$$testability")}function ct(t,e){return e=e||"_",t.replace(tr,function(t,n){return(n?e:"")+t.toLowerCase()})}function dt(){var e;if(!er){var i=Zi();Ii=b(i)?t.jQuery:i?t[i]:n,Ii&&Ii.fn.on?(Fi=Ii,d(Ii.fn,{scope:Cr.scope,isolateScope:Cr.isolateScope,controller:Cr.controller,injector:Cr.injector,inheritedData:Cr.inheritedData}),e=Ii.cleanData,Ii.cleanData=function(t){for(var n,i,r=0;null!=(i=t[r]);r++)n=Ii._data(i,"events"),n&&n.$destroy&&Ii(i).triggerHandler("$destroy");e(t)}):Fi=Pt,Yi.element=Fi,er=!0}}function ht(t,e,n){if(!t)throw Ui("areq","Argument '{0}' is {1}",e||"?",n||"required");return t}function ft(t,e,n){return n&&zi(t)&&(t=t[t.length-1]),ht(D(t),e,"not a function, got "+(t&&"object"==typeof t?t.constructor.name||"Object":typeof t)),t}function pt(t,e){if("hasOwnProperty"===t)throw Ui("badname","hasOwnProperty is not a valid {0} name",e)}function mt(t,e,n){if(!e)return t;for(var i,r=e.split("."),o=t,a=r.length,s=0;a>s;s++)i=r[s],t&&(t=(o=t)[i]);return!n&&D(t)?z(o,t):t}function gt(t){for(var e,n=t[0],i=t[t.length-1],r=1;n!==i&&(n=n.nextSibling);r++)(e||t[r]!==n)&&(e||(e=Fi(Ri.call(t,0,r))),e.push(n));return e||t}function vt(){return Object.create(null)}function yt(t){function e(t,e,n){return t[e]||(t[e]=n())}var n=i("$injector"),r=i("ng"),o=e(t,"angular",Object);return o.$$minErr=o.$$minErr||i,e(o,"module",function(){var t={};return function(i,o,a){var s=function(t,e){if("hasOwnProperty"===t)throw r("badname","hasOwnProperty is not a valid {0} name",e)};return s(i,"module"),o&&t.hasOwnProperty(i)&&(t[i]=null),e(t,i,function(){function t(t,e,n,i){return i||(i=r),function(){return i[n||"push"]([t,e,arguments]),c}}function e(t,e){return function(n,o){return o&&D(o)&&(o.$$moduleName=i),r.push([t,e,arguments]),c}}if(!o)throw n("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",i);var r=[],s=[],l=[],u=t("$injector","invoke","push",s),c={_invokeQueue:r,_configBlocks:s,_runBlocks:l,requires:o,name:i,provider:e("$provide","provider"),factory:e("$provide","factory"),service:e("$provide","service"),value:t("$provide","value"),constant:t("$provide","constant","unshift"),decorator:e("$provide","decorator"),animation:e("$animateProvider","register"),filter:e("$filterProvider","register"),controller:e("$controllerProvider","register"),directive:e("$compileProvider","directive"),component:e("$compileProvider","component"),config:u,run:function(t){return l.push(t),this}};return a&&u(a),c})}})}function bt(t){var e=[];return JSON.stringify(t,function(t,n){if(n=G(t,n),w(n)){if(e.indexOf(n)>=0)return"...";e.push(n)}return n})}function $t(t){return"function"==typeof t?t.toString().replace(/ \{[\s\S]*$/,""):b(t)?"undefined":"string"!=typeof t?bt(t):t}function wt(e){d(e,{bootstrap:st,copy:H,extend:d,merge:h,equals:U,element:Fi,forEach:o,injector:re,noop:m,bind:z,toJson:q,fromJson:X,identity:g,isUndefined:b,isDefined:$,isString:C,isFunction:D,isObject:w,isNumber:S,isElement:N,isArray:zi,version:lr,isDate:k,lowercase:Ti,uppercase:Pi,callbacks:{counter:0},getTestability:ut,$$minErr:i,$$csp:Ki,reloadWithDebugInfo:lt}),(Ni=yt(t))("ng",["ngLocale"],["$provide",function(t){t.provider({$$sanitizeUri:Cn}),t.provider("$compile",pe).directive({a:Mo,input:zo,textarea:zo,form:Oo,script:Ha,select:Ya,style:za,option:Wa,ngBind:Xo,ngBindHtml:Zo,ngBindTemplate:Ko,ngClass:Jo,ngClassEven:ea,ngClassOdd:ta,ngCloak:na,ngController:ia,ngForm:Fo,ngHide:Oa,ngIf:aa,ngInclude:sa,ngInit:ua,ngNonBindable:ka,ngPluralize:Ma,ngRepeat:Ta,ngShow:ja,ngStyle:Fa,ngSwitch:Ia,ngSwitchWhen:Na,ngSwitchDefault:Ra,ngOptions:_a,ngTransclude:Va,ngModel:xa,ngList:ca,ngChange:Qo,pattern:qa,ngPattern:qa,required:Ga,ngRequired:Ga,minlength:Ka,ngMinlength:Ka,maxlength:Xa,ngMaxlength:Xa,ngValue:qo,ngModelOptions:Sa}).directive({ngInclude:la}).directive(To).directive(ra),t.provider({$anchorScroll:oe,$animate:Lr,$animateCss:Br,$$animateJs:Nr,$$animateQueue:Rr,$$AnimateRunner:Hr,$$animateAsyncRun:Vr,$browser:de,$cacheFactory:he,$controller:be,$document:$e,$exceptionHandler:we,$filter:Nn,$$forceReflow:Gr,$interpolate:Fe,$interval:Ie,$http:Pe,$httpParamSerializer:Ce,$httpParamSerializerJQLike:Se,$httpBackend:je,$xhrFactory:Ae,$location:Ke,$log:Ze,$parse:vn,$rootScope:xn,$q:yn,$$q:bn,$sce:En,$sceDelegate:Dn,$sniffer:_n,$templateCache:fe,$templateRequest:Mn,$$testability:Tn,$timeout:Pn,$window:On,$$rAF:wn,$$jqLite:Qt,$$HashMap:Er,$$cookieReader:In})}])}function xt(){return++cr}function Ct(t){return t.replace(fr,function(t,e,n,i){return i?n.toUpperCase():n}).replace(pr,"Moz$1")}function St(t){return!yr.test(t)}function kt(t){var e=t.nodeType;return e===nr||!e||e===ar}function Dt(t){for(var e in ur[t.ng339])return!0;return!1}function Et(t){for(var e=0,n=t.length;n>e;e++)Ft(t[e])}function _t(t,e){var n,i,r,a,s=e.createDocumentFragment(),l=[];if(St(t))l.push(e.createTextNode(t));else{for(n=n||s.appendChild(e.createElement("div")),i=(br.exec(t)||["",""])[1].toLowerCase(),r=wr[i]||wr._default,n.innerHTML=r[1]+t.replace($r,"<$1></$2>")+r[2],a=r[0];a--;)n=n.lastChild;l=Y(l,n.childNodes),n=s.firstChild,n.textContent=""}return s.textContent="",s.innerHTML="",o(l,function(t){s.appendChild(t)}),s}function Mt(t,n){n=n||e;var i;return(i=vr.exec(t))?[n.createElement(i[1])]:(i=_t(t,n))?i.childNodes:[]}function Tt(t,e){var n=t.parentNode;n&&n.replaceChild(e,t),e.appendChild(t)}function Pt(t){if(t instanceof Pt)return t;var e;if(C(t)&&(t=qi(t),e=!0),!(this instanceof Pt)){if(e&&"<"!=t.charAt(0))throw gr("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new Pt(t)}e?Ht(this,Mt(t)):Ht(this,t)}function At(t){return t.cloneNode(!0)}function jt(t,e){if(e||Ft(t),t.querySelectorAll)for(var n=t.querySelectorAll("*"),i=0,r=n.length;r>i;i++)Ft(n[i])}function Ot(t,e,n,i){if($(i))throw gr("offargs","jqLite#off() does not support the `selector` argument");var r=It(t),a=r&&r.events,s=r&&r.handle;if(s)if(e){var l=function(e){var i=a[e];$(n)&&V(i||[],n),$(n)&&i&&i.length>0||(hr(t,e,s),delete a[e])};o(e.split(" "),function(t){l(t),mr[t]&&l(mr[t])})}else for(e in a)"$destroy"!==e&&hr(t,e,s),delete a[e]}function Ft(t,e){var i=t.ng339,r=i&&ur[i];if(r){if(e)return void delete r.data[e];r.handle&&(r.events.$destroy&&r.handle({},"$destroy"),Ot(t)),delete ur[i],t.ng339=n}}function It(t,e){var i=t.ng339,r=i&&ur[i];return e&&!r&&(t.ng339=i=xt(),r=ur[i]={events:{},data:{},handle:n}),r}function Nt(t,e,n){if(kt(t)){var i=$(n),r=!i&&e&&!w(e),o=!e,a=It(t,!r),s=a&&a.data;if(i)s[e]=n;else{if(o)return s;if(r)return s&&s[e];d(s,e)}}}function Rt(t,e){return t.getAttribute?(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+e+" ")>-1:!1}function Lt(t,e){e&&t.setAttribute&&o(e.split(" "),function(e){t.setAttribute("class",qi((" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+qi(e)+" "," ")))})}function Vt(t,e){if(e&&t.setAttribute){var n=(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");o(e.split(" "),function(t){t=qi(t),-1===n.indexOf(" "+t+" ")&&(n+=t+" ")}),t.setAttribute("class",qi(n))}}function Ht(t,e){if(e)if(e.nodeType)t[t.length++]=e;else{var n=e.length;if("number"==typeof n&&e.window!==e){if(n)for(var i=0;n>i;i++)t[t.length++]=e[i]}else t[t.length++]=e}}function Bt(t,e){return Ut(t,"$"+(e||"ngController")+"Controller")}function Ut(t,e,n){t.nodeType==ar&&(t=t.documentElement);for(var i=zi(e)?e:[e];t;){for(var r=0,o=i.length;o>r;r++)if($(n=Fi.data(t,i[r])))return n;t=t.parentNode||t.nodeType===sr&&t.host}}function Yt(t){for(jt(t,!0);t.firstChild;)t.removeChild(t.firstChild)}function Wt(t,e){e||jt(t);var n=t.parentNode;n&&n.removeChild(t)}function zt(e,n){n=n||t,"complete"===n.document.readyState?n.setTimeout(e):Fi(n).on("load",e)}function Gt(t,e){var n=Sr[e.toLowerCase()];return n&&kr[L(t)]&&n}function qt(t){return Dr[t]}function Xt(t,e){var n=function(n,i){n.isDefaultPrevented=function(){return n.defaultPrevented};var r=e[i||n.type],o=r?r.length:0;if(o){if(b(n.immediatePropagationStopped)){var a=n.stopImmediatePropagation;n.stopImmediatePropagation=function(){n.immediatePropagationStopped=!0,n.stopPropagation&&n.stopPropagation(),a&&a.call(n)}}n.isImmediatePropagationStopped=function(){return n.immediatePropagationStopped===!0};var s=r.specialHandlerWrapper||Kt;o>1&&(r=B(r));for(var l=0;o>l;l++)n.isImmediatePropagationStopped()||s(t,n,r[l])}};return n.elem=t,n}function Kt(t,e,n){n.call(t,e)}function Zt(t,e,n){var i=e.relatedTarget;i&&(i===t||xr.call(t,i))||n.call(t,e)}function Qt(){this.$get=function(){return d(Pt,{hasClass:function(t,e){return t.attr&&(t=t[0]),Rt(t,e)},addClass:function(t,e){return t.attr&&(t=t[0]),Vt(t,e)},removeClass:function(t,e){return t.attr&&(t=t[0]),Lt(t,e)}})}}function Jt(t,e){var n=t&&t.$$hashKey;if(n)return"function"==typeof n&&(n=t.$$hashKey()),n;var i=typeof t;return n="function"==i||"object"==i&&null!==t?t.$$hashKey=i+":"+(e||l)():i+":"+t}function te(t,e){if(e){var n=0;this.nextUid=function(){return++n}}o(t,this.put,this)}function ee(t){var e=t.toString().replace(Ar,""),n=e.match(_r)||e.match(Mr);return n}function ne(t){var e=ee(t);return e?"function("+(e[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function ie(t,e,n){var i,r,a;if("function"==typeof t){if(!(i=t.$inject)){if(i=[],t.length){if(e)throw C(n)&&n||(n=t.name||ne(t)),jr("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",n);r=ee(t),o(r[1].split(Tr),function(t){t.replace(Pr,function(t,e,n){i.push(n)})})}t.$inject=i}}else zi(t)?(a=t.length-1,ft(t[a],"fn"),i=t.slice(0,a)):ft(t,"fn",!0);return i}function re(t,e){function i(t){return function(e,n){return w(e)?void o(e,s(t)):t(e,n)}}function r(t,e){if(pt(t,"service"),(D(e)||zi(e))&&(e=S.instantiate(e)),!e.$get)throw jr("pget","Provider '{0}' must define $get factory method.",t);return x[t+g]=e}function a(t,e){return function(){var n=_.invoke(e,this);if(b(n))throw jr("undef","Provider '{0}' must return a value from $get factory method.",t);return n}}function l(t,e,n){return r(t,{$get:n!==!1?a(t,e):e})}function u(t,e){return l(t,["$injector",function(t){return t.instantiate(e)}])}function c(t,e){return l(t,v(e),!1)}function d(t,e){pt(t,"constant"),x[t]=e,k[t]=e}function h(t,e){var n=S.get(t+g),i=n.$get;n.$get=function(){var t=_.invoke(i,n);return _.invoke(e,null,{$delegate:t})}}function f(t){ht(b(t)||zi(t),"modulesToLoad","not an array");var e,n=[];return o(t,function(t){function i(t){var e,n;for(e=0,n=t.length;n>e;e++){var i=t[e],r=S.get(i[0]);r[i[1]].apply(r,i[2])}}if(!$.get(t)){$.put(t,!0);try{C(t)?(e=Ni(t),n=n.concat(f(e.requires)).concat(e._runBlocks),i(e._invokeQueue),i(e._configBlocks)):D(t)?n.push(S.invoke(t)):zi(t)?n.push(S.invoke(t)):ft(t,"module")}catch(r){throw zi(t)&&(t=t[t.length-1]),r.message&&r.stack&&-1==r.stack.indexOf(r.message)&&(r=r.message+"\n"+r.stack),jr("modulerr","Failed to instantiate module {0} due to:\n{1}",t,r.stack||r.message||r)}}}),n}function p(t,n){function i(e,i){if(t.hasOwnProperty(e)){if(t[e]===m)throw jr("cdep","Circular dependency found: {0}",e+" <- "+y.join(" <- "));return t[e]}try{return y.unshift(e),t[e]=m,t[e]=n(e,i)}catch(r){throw t[e]===m&&delete t[e],r}finally{y.shift()}}function r(t,n,r){for(var o=[],a=re.$$annotate(t,e,r),s=0,l=a.length;l>s;s++){var u=a[s];if("string"!=typeof u)throw jr("itkn","Incorrect injection token! Expected service name as string, got {0}",u);o.push(n&&n.hasOwnProperty(u)?n[u]:i(u,r))}return o}function o(t){return 11>=Oi?!1:"function"==typeof t&&/^(?:class\s|constructor\()/.test(Function.prototype.toString.call(t))}function a(t,e,n,i){"string"==typeof n&&(i=n,n=null);var a=r(t,n,i);return zi(t)&&(t=t[t.length-1]),o(t)?(a.unshift(null),new(Function.prototype.bind.apply(t,a))):t.apply(e,a)}function s(t,e,n){var i=zi(t)?t[t.length-1]:t,o=r(t,e,n);return o.unshift(null),new(Function.prototype.bind.apply(i,o))}return{invoke:a,instantiate:s,get:i,annotate:re.$$annotate,has:function(e){return x.hasOwnProperty(e+g)||t.hasOwnProperty(e)}}}e=e===!0;var m={},g="Provider",y=[],$=new te([],!0),x={$provide:{provider:i(r),factory:i(l),service:i(u),value:i(c),constant:i(d),decorator:h}},S=x.$injector=p(x,function(t,e){throw Yi.isString(e)&&y.push(e),jr("unpr","Unknown provider: {0}",y.join(" <- "))}),k={},E=p(k,function(t,e){var i=S.get(t+g,e);return _.invoke(i.$get,i,n,t)}),_=E;x["$injector"+g]={$get:v(E)};var M=f(t);return _=E.get("$injector"),_.strictDi=e,o(M,function(t){t&&_.invoke(t)}),_}function oe(){var t=!0;this.disableAutoScrolling=function(){t=!1},this.$get=["$window","$location","$rootScope",function(e,n,i){function r(t){var e=null;return Array.prototype.some.call(t,function(t){return"a"===L(t)?(e=t,!0):void 0}),e}function o(){var t=s.yOffset;if(D(t))t=t();else if(N(t)){var n=t[0],i=e.getComputedStyle(n);t="fixed"!==i.position?0:n.getBoundingClientRect().bottom}else S(t)||(t=0);return t}function a(t){if(t){t.scrollIntoView();var n=o();if(n){var i=t.getBoundingClientRect().top;e.scrollBy(0,i-n)}}else e.scrollTo(0,0)}function s(t){t=C(t)?t:n.hash();var e;t?(e=l.getElementById(t))?a(e):(e=r(l.getElementsByName(t)))?a(e):"top"===t&&a(null):a(null)}var l=e.document;return t&&i.$watch(function(){return n.hash()},function(t,e){t===e&&""===t||zt(function(){i.$evalAsync(s)})}),s}]}function ae(t,e){return t||e?t?e?(zi(t)&&(t=t.join(" ")),zi(e)&&(e=e.join(" ")),t+" "+e):t:e:""}function se(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.nodeType===Fr)return n}}function le(t){C(t)&&(t=t.split(" "));var e=vt();return o(t,function(t){t.length&&(e[t]=!0)}),e}function ue(t){return w(t)?t:{}}function ce(t,e,n,i){function r(t){try{t.apply(null,W(arguments,1))}finally{if(y--,0===y)for(;$.length;)try{$.pop()()}catch(e){n.error(e)}}}function a(t){var e=t.indexOf("#");return-1===e?"":t.substr(e)}function s(){k=null,u(),c()}function l(){try{return f.state}catch(t){}}function u(){w=l(),w=b(w)?null:w,U(w,_)&&(w=_),_=w}function c(){C===d.url()&&x===w||(C=d.url(),x=w,o(D,function(t){t(d.url(),w)}))}var d=this,h=(e[0],t.location),f=t.history,p=t.setTimeout,g=t.clearTimeout,v={};d.isMock=!1;var y=0,$=[];d.$$completeOutstandingRequest=r,d.$$incOutstandingRequestCount=function(){y++},d.notifyWhenNoOutstandingRequests=function(t){0===y?t():$.push(t)};var w,x,C=h.href,S=e.find("base"),k=null;u(),x=w,d.url=function(e,n,r){if(b(r)&&(r=null),h!==t.location&&(h=t.location),f!==t.history&&(f=t.history),e){var o=x===r;if(C===e&&(!i.history||o))return d;var s=C&&He(C)===He(e);return C=e,x=r,!i.history||s&&o?(s&&!k||(k=e),n?h.replace(e):s?h.hash=a(e):h.href=e,h.href!==e&&(k=e)):(f[n?"replaceState":"pushState"](r,"",e),u(),x=w),d}return k||h.href.replace(/%27/g,"'")},d.state=function(){return w};var D=[],E=!1,_=null;d.onUrlChange=function(e){return E||(i.history&&Fi(t).on("popstate",s),Fi(t).on("hashchange",s),E=!0),D.push(e),e},d.$$applicationDestroyed=function(){Fi(t).off("hashchange popstate",s)},d.$$checkUrlChange=c,d.baseHref=function(){var t=S.attr("href");return t?t.replace(/^(https?\:)?\/\/[^\/]*/,""):""},d.defer=function(t,e){var n;return y++,n=p(function(){delete v[n],r(t)},e||0),v[n]=!0,n},d.defer.cancel=function(t){return v[t]?(delete v[t],g(t),r(m),!0):!1}}function de(){this.$get=["$window","$log","$sniffer","$document",function(t,e,n,i){return new ce(t,i,e,n)}]}function he(){this.$get=function(){function t(t,n){function r(t){t!=h&&(f?f==t&&(f=t.n):f=t,o(t.n,t.p),o(t,h),h=t,h.n=null)}function o(t,e){t!=e&&(t&&(t.p=e),e&&(e.n=t))}if(t in e)throw i("$cacheFactory")("iid","CacheId '{0}' is already taken!",t);var a=0,s=d({},n,{id:t}),l=vt(),u=n&&n.capacity||Number.MAX_VALUE,c=vt(),h=null,f=null;return e[t]={put:function(t,e){if(!b(e)){if(u<Number.MAX_VALUE){var n=c[t]||(c[t]={key:t});r(n)}return t in l||a++,l[t]=e,a>u&&this.remove(f.key),e}},get:function(t){if(u<Number.MAX_VALUE){var e=c[t];if(!e)return;r(e)}return l[t]},remove:function(t){if(u<Number.MAX_VALUE){var e=c[t];if(!e)return;e==h&&(h=e.p),e==f&&(f=e.n),o(e.n,e.p),delete c[t]}t in l&&(delete l[t],a--)},removeAll:function(){l=vt(),a=0,c=vt(),h=f=null},destroy:function(){l=null,s=null,c=null,delete e[t]},info:function(){return d({},s,{size:a})}}}var e={};return t.info=function(){var t={};return o(e,function(e,n){t[n]=e.info()}),t},t.get=function(t){return e[t]},t}}function fe(){this.$get=["$cacheFactory",function(t){return t("templates")}]}function pe(t,i){function r(t,e,n){var i=/^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/,r={};return o(t,function(t,o){var a=t.match(i);if(!a)throw Ur("iscp","Invalid {3} for directive '{0}'. Definition: {... {1}: '{2}' ...}",e,o,t,n?"controller bindings definition":"isolate scope definition");r[o]={mode:a[1][0],collection:"*"===a[2],optional:"?"===a[3],attrName:a[4]||o}}),r}function a(t,e){var n={isolateScope:null,bindToController:null};if(w(t.scope)&&(t.bindToController===!0?(n.bindToController=r(t.scope,e,!0),n.isolateScope={}):n.isolateScope=r(t.scope,e,!1)),w(t.bindToController)&&(n.bindToController=r(t.bindToController,e,!0)),w(n.bindToController)){var i=t.controller,o=t.controllerAs;if(!i)throw Ur("noctrl","Cannot bind to controller without directive '{0}'s controller.",e);if(!ye(i,o))throw Ur("noident","Cannot bind to controller without identifier for directive '{0}'.",e)}return n}function l(t){var e=t.charAt(0);if(!e||e!==Ti(e))throw Ur("baddir","Directive name '{0}' is invalid. The first character must be a lowercase letter",t);if(t!==t.trim())throw Ur("baddir","Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces",t)}var u={},c="Directive",h=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,f=/(([\w\-]+)(?:\:([^;]+))?;?)/,y=R("ngSrc,ngSrcset,src,srcset"),x=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,S=/^(on[a-z]+|formaction)$/;this.directive=function E(e,n){return pt(e,"directive"),C(e)?(l(e),ht(n,"directiveFactory"),u.hasOwnProperty(e)||(u[e]=[],t.factory(e+c,["$injector","$exceptionHandler",function(t,n){var i=[];return o(u[e],function(r,o){try{var s=t.invoke(r);D(s)?s={compile:v(s)}:!s.compile&&s.link&&(s.compile=v(s.link)),s.priority=s.priority||0,s.index=o,s.name=s.name||e,s.require=s.require||s.controller&&s.name,s.restrict=s.restrict||"EA";var l=s.$$bindings=a(s,s.name);w(l.isolateScope)&&(s.$$isolateBindings=l.isolateScope),s.$$moduleName=r.$$moduleName,i.push(s)}catch(u){n(u)}}),i}])),u[e].push(n)):o(e,s(E)),this},this.component=function(t,e){function n(t){function n(e){return D(e)||zi(e)?function(n,i){return t.invoke(e,this,{$element:n,$attrs:i})}:e}var r=e.template||e.templateUrl?e.template:"";return{controller:i,controllerAs:ye(e.controller)||e.controllerAs||"$ctrl",template:n(r),templateUrl:n(e.templateUrl),transclude:e.transclude,scope:{},bindToController:e.bindings||{},restrict:"E",require:e.require}}var i=e.controller||function(){};return o(e,function(t,e){"$"===e.charAt(0)&&(n[e]=t)}),n.$inject=["$injector"],this.directive(t,n)},this.aHrefSanitizationWhitelist=function(t){return $(t)?(i.aHrefSanitizationWhitelist(t),this):i.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(t){return $(t)?(i.imgSrcSanitizationWhitelist(t),this):i.imgSrcSanitizationWhitelist()};var k=!0;this.debugInfoEnabled=function(t){return $(t)?(k=t,this):k},this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(t,i,r,a,s,l,v,$,E,_){function T(t,e,n){ut.innerHTML="<span "+e+">";var i=ut.firstChild.attributes,r=i[0];i.removeNamedItem(r.name),r.value=n,t.attributes.setNamedItem(r)}function P(t,e){try{t.addClass(e)}catch(n){}}function A(t,n,i,r,o){t instanceof Fi||(t=Fi(t));for(var a=/\S+/,s=0,l=t.length;l>s;s++){var u=t[s];u.nodeType===rr&&u.nodeValue.match(a)&&Tt(u,t[s]=e.createElement("span"))}var c=F(t,n,t,i,r,o);A.$$addScopeClass(t);var d=null;return function(e,n,i){ht(e,"scope"),o&&o.needsNewScope&&(e=e.$parent.$new()),i=i||{};var r=i.parentBoundTranscludeFn,a=i.transcludeControllers,s=i.futureParentElement;r&&r.$$boundTransclude&&(r=r.$$boundTransclude),d||(d=O(s));var l;if(l="html"!==d?Fi(et(d,Fi("<div>").append(t).html())):n?Cr.clone.call(t):t,a)for(var u in a)l.data("$"+u+"Controller",a[u].instance);return A.$$addScopeInfo(l,e),n&&n(l,e),c&&c(e,l,l,r),l}}function O(t){var e=t&&t[0];return e&&"foreignobject"!==L(e)&&Hi.call(e).match(/SVG/)?"svg":"html"}function F(t,e,i,r,o,a){function s(t,i,r,o){var a,s,l,u,c,d,h,f,g;if(p){var v=i.length;for(g=new Array(v),c=0;c<m.length;c+=3)h=m[c],g[h]=i[h]}else g=i;for(c=0,d=m.length;d>c;)l=g[m[c++]],a=m[c++],s=m[c++],a?(a.scope?(u=t.$new(),A.$$addScopeInfo(Fi(l),u)):u=t,f=a.transcludeOnThisElement?I(t,a.transclude,o):!a.templateOnThisElement&&o?o:!o&&e?I(t,e):null,a(s,u,l,r,f)):s&&s(t,l.childNodes,n,o)}for(var l,u,c,d,h,f,p,m=[],g=0;g<t.length;g++)l=new dt,u=N(t[g],[],l,0===g?r:n,o),c=u.length?Y(u,t[g],l,e,i,null,[],[],a):null,c&&c.scope&&A.$$addScopeClass(l.$$element),h=c&&c.terminal||!(d=t[g].childNodes)||!d.length?null:F(d,c?(c.transcludeOnThisElement||!c.templateOnThisElement)&&c.transclude:e),(c||h)&&(m.push(g,c,h),f=!0,p=p||c),a=null;return f?s:null}function I(t,e,n){var i=function(i,r,o,a,s){return i||(i=t.$new(!1,s),i.$$transcluded=!0),e(i,r,{parentBoundTranscludeFn:n,transcludeControllers:o,futureParentElement:a})},r=i.$$slots=vt();for(var o in e.$$slots)e.$$slots[o]?r[o]=I(t,e.$$slots[o],n):r[o]=null;return i}function N(t,e,n,i,r){var o,a,s=t.nodeType,l=n.$attr;switch(s){case nr:G(e,me(L(t)),"E",i,r);for(var u,c,d,p,m,g,v=t.attributes,y=0,b=v&&v.length;b>y;y++){var $=!1,x=!1;u=v[y],c=u.name,m=qi(u.value),p=me(c),(g=gt.test(p))&&(c=c.replace(Yr,"").substr(8).replace(/_(.)/g,function(t,e){return e.toUpperCase()}));var S=p.match(yt);S&&q(S[1])&&($=c,x=c.substr(0,c.length-5)+"end",c=c.substr(0,c.length-6)),d=me(c.toLowerCase()),l[d]=c,!g&&n.hasOwnProperty(d)||(n[d]=m,Gt(t,d)&&(n[d]=!0)),it(t,e,m,d,g),G(e,d,"A",i,r,$,x)}if(a=t.className,w(a)&&(a=a.animVal),C(a)&&""!==a)for(;o=f.exec(a);)d=me(o[2]),G(e,d,"C",i,r)&&(n[d]=qi(o[3])),a=a.substr(o.index+o[0].length);break;case rr:if(11===Oi)for(;t.parentNode&&t.nextSibling&&t.nextSibling.nodeType===rr;)t.nodeValue=t.nodeValue+t.nextSibling.nodeValue,t.parentNode.removeChild(t.nextSibling);tt(e,t.nodeValue);break;case or:try{o=h.exec(t.nodeValue),o&&(d=me(o[1]),G(e,d,"M",i,r)&&(n[d]=qi(o[2])))}catch(k){}}return e.sort(Z),e}function R(t,e,n){var i=[],r=0;if(e&&t.hasAttribute&&t.hasAttribute(e)){do{if(!t)throw Ur("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",e,n);t.nodeType==nr&&(t.hasAttribute(e)&&r++,t.hasAttribute(n)&&r--),i.push(t),t=t.nextSibling}while(r>0)}else i.push(t);return Fi(i)}function H(t,e,n){return function(i,r,o,a,s){return r=R(r[0],e,n),t(i,r,o,a,s)}}function B(t,e,n,i,r,o){if(t)return A(e,n,i,r,o);var a;return function(){return a||(a=A(e,n,i,r,o),e=n=o=null),a.apply(this,arguments)}}function Y(t,i,a,s,u,c,h,f,p){function m(t,e,n,i){t&&(n&&(t=H(t,n,i)),t.require=$.require,t.directiveName=S,(O===$||$.$$isolateScope)&&(t=ot(t,{isolateScope:!0})),h.push(t)),e&&(n&&(e=H(e,n,i)),e.require=$.require,e.directiveName=S,(O===$||$.$$isolateScope)&&(e=ot(e,{isolateScope:!0})),f.push(e))}function g(t,e,n,i){var r;if(C(e)){var a=e.match(x),s=e.substring(a[0].length),l=a[1]||a[3],u="?"===a[2];
if("^^"===l?n=n.parent():(r=i&&i[s],r=r&&r.instance),!r){var c="$"+s+"Controller";r=l?n.inheritedData(c):n.data(c)}if(!r&&!u)throw Ur("ctreq","Controller '{0}', required by directive '{1}', can't be found!",s,t)}else if(zi(e)){r=[];for(var d=0,h=e.length;h>d;d++)r[d]=g(t,e[d],n,i)}else w(e)&&(r={},o(e,function(e,o){r[o]=g(t,e,n,i)}));return r||null}function v(t,e,n,i,r,o){var a=vt();for(var s in i){var u=i[s],c={$scope:u===O||u.$$isolateScope?r:o,$element:t,$attrs:e,$transclude:n},d=u.controller;"@"==d&&(d=e[u.name]);var h=l(d,c,!0,u.controllerAs);a[u.name]=h,Y||t.data("$"+u.name+"Controller",h.instance)}return a}function y(t,e,r,s,l){function u(t,e,i,r){var o;if(M(t)||(r=i,i=e,e=t,t=n),Y&&(o=x),i||(i=Y?S.parent():S),!r)return l(t,e,o,i,V);var a=l.$$slots[r];if(a)return a(t,e,o,i,V);if(b(a))throw Ur("noslot",'No parent directive that requires a transclusion with slot name "{0}". Element: {1}',r,J(S))}var c,p,m,y,$,x,C,S,k,E,_;i===r?(k=a,S=a.$$element):(S=Fi(r),k=new dt(S,a)),$=e,O?y=e.$new(!0):P&&($=e.$parent),l&&(C=u,C.$$boundTransclude=l,C.isSlotFilled=function(t){return!!l.$$slots[t]}),j&&(x=v(S,k,C,j,y,e)),O&&(A.$$addScopeInfo(S,y,!0,!(F&&(F===O||F===O.$$originalDirective))),A.$$addScopeClass(S,!0),y.$$isolateBindings=O.$$isolateBindings,E=st(e,k,y,y.$$isolateBindings,O),E&&y.$on("$destroy",E));for(var T in x){var I=j[T],N=x[T],R=I.$$bindings.bindToController;N.identifier&&R&&(_=st($,k,N.instance,R,I));var L=N();L!==N.instance&&(N.instance=L,S.data("$"+I.name+"Controller",L),_&&_(),_=st($,k,N.instance,R,I))}for(o(j,function(t,e){var n=t.require;t.bindToController&&!zi(n)&&w(n)&&d(x[e].instance,g(e,n,S,x))}),o(x,function(t){D(t.instance.$onInit)&&t.instance.$onInit()}),c=0,p=h.length;p>c;c++)m=h[c],at(m,m.isolateScope?y:e,S,k,m.require&&g(m.directiveName,m.require,S,x),C);var V=e;for(O&&(O.template||null===O.templateUrl)&&(V=y),t&&t(V,r.childNodes,n,l),c=f.length-1;c>=0;c--)m=f[c],at(m,m.isolateScope?y:e,S,k,m.require&&g(m.directiveName,m.require,S,x),C)}p=p||{};for(var $,S,k,E,_,T=-Number.MAX_VALUE,P=p.newScopeDirective,j=p.controllerDirectives,O=p.newIsolateScopeDirective,F=p.templateDirective,I=p.nonTlbTranscludeDirective,V=!1,U=!1,Y=p.hasElementTranscludeDirective,G=a.$$element=Fi(i),q=c,Z=s,tt=!1,nt=!1,it=0,lt=t.length;lt>it;it++){$=t[it];var ut=$.$$start,ct=$.$$end;if(ut&&(G=R(i,ut,ct)),k=n,T>$.priority)break;if((_=$.scope)&&($.templateUrl||(w(_)?(Q("new/isolated scope",O||P,$,G),O=$):Q("new/isolated scope",O,$,G)),P=P||$),S=$.name,!tt&&($.replace&&($.templateUrl||$.template)||$.transclude&&!$.$$tlb)){for(var ht,ft=it+1;ht=t[ft++];)if(ht.transclude&&!ht.$$tlb||ht.replace&&(ht.templateUrl||ht.template)){nt=!0;break}tt=!0}if(!$.templateUrl&&$.controller&&(_=$.controller,j=j||vt(),Q("'"+S+"' controller",j[S],$,G),j[S]=$),_=$.transclude)if(V=!0,$.$$tlb||(Q("transclusion",I,$,G),I=$),"element"==_)Y=!0,T=$.priority,k=G,G=a.$$element=Fi(e.createComment(" "+S+": "+a[S]+" ")),i=G[0],rt(u,W(k),i),Z=B(nt,k,s,T,q&&q.name,{nonTlbTranscludeDirective:I});else{var pt=vt();if(k=Fi(At(i)).contents(),w(_)){k=[];var gt=vt(),yt=vt();o(_,function(t,e){var n="?"===t.charAt(0);t=n?t.substring(1):t,gt[t]=e,pt[e]=null,yt[e]=n}),o(G.contents(),function(t){var e=gt[me(L(t))];e?(yt[e]=!0,pt[e]=pt[e]||[],pt[e].push(t)):k.push(t)}),o(yt,function(t,e){if(!t)throw Ur("reqslot","Required transclusion slot `{0}` was not filled.",e)});for(var bt in pt)pt[bt]&&(pt[bt]=B(nt,pt[bt],s))}G.empty(),Z=B(nt,k,s,n,n,{needsNewScope:$.$$isolateScope||$.$$newScope}),Z.$$slots=pt}if($.template)if(U=!0,Q("template",F,$,G),F=$,_=D($.template)?$.template(G,a):$.template,_=mt(_),$.replace){if(q=$,k=St(_)?[]:ve(et($.templateNamespace,qi(_))),i=k[0],1!=k.length||i.nodeType!==nr)throw Ur("tplrt","Template for directive '{0}' must have exactly one root element. {1}",S,"");rt(u,G,i);var $t={$attr:{}},wt=N(i,[],$t),xt=t.splice(it+1,t.length-(it+1));(O||P)&&z(wt,O,P),t=t.concat(wt).concat(xt),X(a,$t),lt=t.length}else G.html(_);if($.templateUrl)U=!0,Q("template",F,$,G),F=$,$.replace&&(q=$),y=K(t.splice(it,t.length-it),G,a,u,V&&Z,h,f,{controllerDirectives:j,newScopeDirective:P!==$&&P,newIsolateScopeDirective:O,templateDirective:F,nonTlbTranscludeDirective:I}),lt=t.length;else if($.compile)try{E=$.compile(G,a,Z),D(E)?m(null,E,ut,ct):E&&m(E.pre,E.post,ut,ct)}catch(Ct){r(Ct,J(G))}$.terminal&&(y.terminal=!0,T=Math.max(T,$.priority))}return y.scope=P&&P.scope===!0,y.transcludeOnThisElement=V,y.templateOnThisElement=U,y.transclude=Z,p.hasElementTranscludeDirective=Y,y}function z(t,e,n){for(var i=0,r=t.length;r>i;i++)t[i]=p(t[i],{$$isolateScope:e,$$newScope:n})}function G(e,n,i,o,a,s,l){if(n===a)return null;var d=null;if(u.hasOwnProperty(n))for(var h,f=t.get(n+c),m=0,g=f.length;g>m;m++)try{h=f[m],(b(o)||o>h.priority)&&-1!=h.restrict.indexOf(i)&&(s&&(h=p(h,{$$start:s,$$end:l})),e.push(h),d=h)}catch(v){r(v)}return d}function q(e){if(u.hasOwnProperty(e))for(var n,i=t.get(e+c),r=0,o=i.length;o>r;r++)if(n=i[r],n.multiElement)return!0;return!1}function X(t,e){var n=e.$attr,i=t.$attr,r=t.$$element;o(t,function(i,r){"$"!=r.charAt(0)&&(e[r]&&e[r]!==i&&(i+=("style"===r?";":" ")+e[r]),t.$set(r,i,!0,n[r]))}),o(e,function(e,o){"class"==o?(P(r,e),t["class"]=(t["class"]?t["class"]+" ":"")+e):"style"==o?(r.attr("style",r.attr("style")+";"+e),t.style=(t.style?t.style+";":"")+e):"$"==o.charAt(0)||t.hasOwnProperty(o)||(t[o]=e,i[o]=n[o])})}function K(t,e,n,i,r,s,l,u){var c,d,h=[],f=e[0],m=t.shift(),g=p(m,{templateUrl:null,transclude:null,replace:null,$$originalDirective:m}),v=D(m.templateUrl)?m.templateUrl(e,n):m.templateUrl,y=m.templateNamespace;return e.empty(),a(v).then(function(a){var p,b,$,x;if(a=mt(a),m.replace){if($=St(a)?[]:ve(et(y,qi(a))),p=$[0],1!=$.length||p.nodeType!==nr)throw Ur("tplrt","Template for directive '{0}' must have exactly one root element. {1}",m.name,v);b={$attr:{}},rt(i,e,p);var C=N(p,[],b);w(m.scope)&&z(C,!0),t=C.concat(t),X(n,b)}else p=f,e.html(a);for(t.unshift(g),c=Y(t,p,n,r,e,m,s,l,u),o(i,function(t,n){t==p&&(i[n]=e[0])}),d=F(e[0].childNodes,r);h.length;){var S=h.shift(),k=h.shift(),D=h.shift(),E=h.shift(),_=e[0];if(!S.$$destroyed){if(k!==f){var M=k.className;u.hasElementTranscludeDirective&&m.replace||(_=At(p)),rt(D,Fi(k),_),P(Fi(_),M)}x=c.transcludeOnThisElement?I(S,c.transclude,E):E,c(d,S,_,i,x)}}h=null}),function(t,e,n,i,r){var o=r;e.$$destroyed||(h?h.push(e,n,i,o):(c.transcludeOnThisElement&&(o=I(e,c.transclude,r)),c(d,e,n,i,o)))}}function Z(t,e){var n=e.priority-t.priority;return 0!==n?n:t.name!==e.name?t.name<e.name?-1:1:t.index-e.index}function Q(t,e,n,i){function r(t){return t?" (module: "+t+")":""}if(e)throw Ur("multidir","Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}",e.name,r(e.$$moduleName),n.name,r(n.$$moduleName),t,J(i))}function tt(t,e){var n=i(e,!0);n&&t.push({priority:0,compile:function(t){var e=t.parent(),i=!!e.length;return i&&A.$$addBindingClass(e),function(t,e){var r=e.parent();i||A.$$addBindingClass(r),A.$$addBindingInfo(r,n.expressions),t.$watch(n,function(t){e[0].nodeValue=t})}}})}function et(t,n){switch(t=Ti(t||"html")){case"svg":case"math":var i=e.createElement("div");return i.innerHTML="<"+t+">"+n+"</"+t+">",i.childNodes[0].childNodes;default:return n}}function nt(t,e){if("srcdoc"==e)return $.HTML;var n=L(t);return"xlinkHref"==e||"form"==n&&"action"==e||"img"!=n&&("src"==e||"ngSrc"==e)?$.RESOURCE_URL:void 0}function it(t,e,n,r,o){var a=nt(t,r);o=y[r]||o;var s=i(n,!0,a,o);if(s){if("multiple"===r&&"select"===L(t))throw Ur("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",J(t));e.push({priority:100,compile:function(){return{pre:function(t,e,l){var u=l.$$observers||(l.$$observers=vt());if(S.test(r))throw Ur("nodomevents","Interpolations for HTML DOM event attributes are disallowed.  Please use the ng- versions (such as ng-click instead of onclick) instead.");var c=l[r];c!==n&&(s=c&&i(c,!0,a,o),n=c),s&&(l[r]=s(t),(u[r]||(u[r]=[])).$$inter=!0,(l.$$observers&&l.$$observers[r].$$scope||t).$watch(s,function(t,e){"class"===r&&t!=e?l.$updateClass(t,e):l.$set(r,t)}))}}}})}}function rt(t,n,i){var r,o,a=n[0],s=n.length,l=a.parentNode;if(t)for(r=0,o=t.length;o>r;r++)if(t[r]==a){t[r++]=i;for(var u=r,c=u+s-1,d=t.length;d>u;u++,c++)d>c?t[u]=t[c]:delete t[u];t.length-=s-1,t.context===a&&(t.context=i);break}l&&l.replaceChild(i,a);var h=e.createDocumentFragment();for(r=0;s>r;r++)h.appendChild(n[r]);for(Fi.hasData(a)&&(Fi.data(i,Fi.data(a)),Fi(a).off("$destroy")),Fi.cleanData(h.querySelectorAll("*")),r=1;s>r;r++)delete n[r];n[0]=i,n.length=1}function ot(t,e){return d(function(){return t.apply(null,arguments)},t,e)}function at(t,e,n,i,o,a){try{t(e,n,i,o,a)}catch(s){r(s,J(n))}}function st(t,e,n,r,a){var l=[];return o(r,function(r,o){var u,c,d,h,f,p=r.attrName,g=r.optional,v=r.mode;switch(v){case"@":g||Mi.call(e,p)||(n[o]=e[p]=void 0),e.$observe(p,function(t){C(t)&&(n[o]=t)}),e.$$observers[p].$$scope=t,u=e[p],C(u)?n[o]=i(u)(t):j(u)&&(n[o]=u);break;case"=":if(!Mi.call(e,p)){if(g)break;e[p]=void 0}if(g&&!e[p])break;c=s(e[p]),h=c.literal?U:function(t,e){return t===e||t!==t&&e!==e},d=c.assign||function(){throw u=n[o]=c(t),Ur("nonassign","Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!",e[p],p,a.name)},u=n[o]=c(t);var y=function(e){return h(e,n[o])||(h(e,u)?d(t,e=n[o]):n[o]=e),u=e};y.$stateful=!0,f=r.collection?t.$watchCollection(e[p],y):t.$watch(s(e[p],y),null,c.literal),l.push(f);break;case"<":if(!Mi.call(e,p)){if(g)break;e[p]=void 0}if(g&&!e[p])break;c=s(e[p]),n[o]=c(t),f=t.$watch(c,function(t){n[o]=t},c.literal),l.push(f);break;case"&":if(c=e.hasOwnProperty(p)?s(e[p]):m,c===m&&g)break;n[o]=function(e){return c(t,e)}}}),l.length&&function(){for(var t=0,e=l.length;e>t;++t)l[t]()}}var lt=/^\w/,ut=e.createElement("div"),dt=function(t,e){if(e){var n,i,r,o=Object.keys(e);for(n=0,i=o.length;i>n;n++)r=o[n],this[r]=e[r]}else this.$attr={};this.$$element=t};dt.prototype={$normalize:me,$addClass:function(t){t&&t.length>0&&E.addClass(this.$$element,t)},$removeClass:function(t){t&&t.length>0&&E.removeClass(this.$$element,t)},$updateClass:function(t,e){var n=ge(t,e);n&&n.length&&E.addClass(this.$$element,n);var i=ge(e,t);i&&i.length&&E.removeClass(this.$$element,i)},$set:function(t,e,n,i){var a,s=this.$$element[0],l=Gt(s,t),u=qt(t),c=t;if(l?(this.$$element.prop(t,e),i=l):u&&(this[u]=e,c=u),this[t]=e,i?this.$attr[t]=i:(i=this.$attr[t],i||(this.$attr[t]=i=ct(t,"-"))),a=L(this.$$element),"a"===a&&("href"===t||"xlinkHref"===t)||"img"===a&&"src"===t)this[t]=e=_(e,"src"===t);else if("img"===a&&"srcset"===t){for(var d="",h=qi(e),f=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,p=/\s/.test(h)?f:/(,)/,m=h.split(p),g=Math.floor(m.length/2),v=0;g>v;v++){var y=2*v;d+=_(qi(m[y]),!0),d+=" "+qi(m[y+1])}var $=qi(m[2*v]).split(/\s/);d+=_(qi($[0]),!0),2===$.length&&(d+=" "+qi($[1])),this[t]=e=d}n!==!1&&(null===e||b(e)?this.$$element.removeAttr(i):lt.test(i)?this.$$element.attr(i,e):T(this.$$element[0],i,e));var w=this.$$observers;w&&o(w[c],function(t){try{t(e)}catch(n){r(n)}})},$observe:function(t,e){var n=this,i=n.$$observers||(n.$$observers=vt()),r=i[t]||(i[t]=[]);return r.push(e),v.$evalAsync(function(){r.$$inter||!n.hasOwnProperty(t)||b(n[t])||e(n[t])}),function(){V(r,e)}}};var ft=i.startSymbol(),pt=i.endSymbol(),mt="{{"==ft&&"}}"==pt?g:function(t){return t.replace(/\{\{/g,ft).replace(/}}/g,pt)},gt=/^ngAttr[A-Z]/,yt=/^(.+)Start$/;return A.$$addBindingInfo=k?function(t,e){var n=t.data("$binding")||[];zi(e)?n=n.concat(e):n.push(e),t.data("$binding",n)}:m,A.$$addBindingClass=k?function(t){P(t,"ng-binding")}:m,A.$$addScopeInfo=k?function(t,e,n,i){var r=n?i?"$isolateScopeNoTemplate":"$isolateScope":"$scope";t.data(r,e)}:m,A.$$addScopeClass=k?function(t,e){P(t,e?"ng-isolate-scope":"ng-scope")}:m,A}]}function me(t){return Ct(t.replace(Yr,""))}function ge(t,e){var n="",i=t.split(/\s+/),r=e.split(/\s+/);t:for(var o=0;o<i.length;o++){for(var a=i[o],s=0;s<r.length;s++)if(a==r[s])continue t;n+=(n.length>0?" ":"")+a}return n}function ve(t){t=Fi(t);var e=t.length;if(1>=e)return t;for(;e--;){var n=t[e];n.nodeType===or&&Li.call(t,e,1)}return t}function ye(t,e){if(e&&C(e))return e;if(C(t)){var n=zr.exec(t);if(n)return n[3]}}function be(){var t={},e=!1;this.register=function(e,n){pt(e,"controller"),w(e)?d(t,e):t[e]=n},this.allowGlobals=function(){e=!0},this.$get=["$injector","$window",function(r,o){function a(t,e,n,r){if(!t||!w(t.$scope))throw i("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",r,e);t.$scope[e]=n}return function(i,s,l,u){var c,h,f,p;if(l=l===!0,u&&C(u)&&(p=u),C(i)){if(h=i.match(zr),!h)throw Wr("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",i);f=h[1],p=p||h[3],i=t.hasOwnProperty(f)?t[f]:mt(s.$scope,f,!0)||(e?mt(o,f,!0):n),ft(i,f,!0)}if(l){var m=(zi(i)?i[i.length-1]:i).prototype;c=Object.create(m||null),p&&a(s,p,c,f||i.name);var g;return g=d(function(){var t=r.invoke(i,c,s,f);return t!==c&&(w(t)||D(t))&&(c=t,p&&a(s,p,c,f||i.name)),c},{instance:c,identifier:p})}return c=r.instantiate(i,s,f),p&&a(s,p,c,f||i.name),c}}]}function $e(){this.$get=["$window",function(t){return Fi(t.document)}]}function we(){this.$get=["$log",function(t){return function(e,n){t.error.apply(t,arguments)}}]}function xe(t){return w(t)?k(t)?t.toISOString():q(t):t}function Ce(){this.$get=function(){return function(t){if(!t)return"";var e=[];return a(t,function(t,n){null===t||b(t)||(zi(t)?o(t,function(t,i){e.push(rt(n)+"="+rt(xe(t)))}):e.push(rt(n)+"="+rt(xe(t))))}),e.join("&")}}}function Se(){this.$get=function(){return function(t){function e(t,i,r){null===t||b(t)||(zi(t)?o(t,function(t,n){e(t,i+"["+(w(t)?n:"")+"]")}):w(t)&&!k(t)?a(t,function(t,n){e(t,i+(r?"":"[")+n+(r?"":"]"))}):n.push(rt(i)+"="+rt(xe(t))))}if(!t)return"";var n=[];return e(t,"",!0),n.join("&")}}}function ke(t,e){if(C(t)){var n=t.replace(Qr,"").trim();if(n){var i=e("Content-Type");(i&&0===i.indexOf(qr)||De(n))&&(t=X(n))}}return t}function De(t){var e=t.match(Kr);return e&&Zr[e[0]].test(t)}function Ee(t){function e(t,e){t&&(i[t]=i[t]?i[t]+", "+e:e)}var n,i=vt();return C(t)?o(t.split("\n"),function(t){n=t.indexOf(":"),e(Ti(qi(t.substr(0,n))),qi(t.substr(n+1)))}):w(t)&&o(t,function(t,n){e(Ti(n),qi(t))}),i}function _e(t){var e;return function(n){if(e||(e=Ee(t)),n){var i=e[Ti(n)];return void 0===i&&(i=null),i}return e}}function Me(t,e,n,i){return D(i)?i(t,e,n):(o(i,function(i){t=i(t,e,n)}),t)}function Te(t){return t>=200&&300>t}function Pe(){var t=this.defaults={transformResponse:[ke],transformRequest:[function(t){return!w(t)||T(t)||A(t)||P(t)?t:q(t)}],headers:{common:{Accept:"application/json, text/plain, */*"},post:B(Xr),put:B(Xr),patch:B(Xr)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},e=!1;this.useApplyAsync=function(t){return $(t)?(e=!!t,this):e};var r=!0;this.useLegacyPromiseExtensions=function(t){return $(t)?(r=!!t,this):r};var a=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(s,l,u,c,h,f){function p(e){function a(t){var e=d({},t);return e.data=Me(t.data,t.headers,t.status,u.transformResponse),Te(t.status)?e:h.reject(e)}function s(t,e){var n,i={};return o(t,function(t,r){D(t)?(n=t(e),null!=n&&(i[r]=n)):i[r]=t}),i}function l(e){var n,i,r,o=t.headers,a=d({},e.headers);o=d({},o.common,o[Ti(e.method)]);t:for(n in o){i=Ti(n);for(r in a)if(Ti(r)===i)continue t;a[n]=o[n]}return s(a,B(e))}if(!w(e))throw i("$http")("badreq","Http request configuration must be an object.  Received: {0}",e);if(!C(e.url))throw i("$http")("badreq","Http request configuration url must be a string.  Received: {0}",e.url);var u=d({method:"get",transformRequest:t.transformRequest,transformResponse:t.transformResponse,paramSerializer:t.paramSerializer},e);u.headers=l(e),u.method=Pi(u.method),u.paramSerializer=C(u.paramSerializer)?f.get(u.paramSerializer):u.paramSerializer;var c=function(e){var i=e.headers,r=Me(e.data,_e(i),n,e.transformRequest);return b(r)&&o(i,function(t,e){"content-type"===Ti(e)&&delete i[e]}),b(e.withCredentials)&&!b(t.withCredentials)&&(e.withCredentials=t.withCredentials),v(e,r).then(a,a)},p=[c,n],m=h.when(u);for(o(S,function(t){(t.request||t.requestError)&&p.unshift(t.request,t.requestError),(t.response||t.responseError)&&p.push(t.response,t.responseError)});p.length;){var g=p.shift(),y=p.shift();m=m.then(g,y)}return r?(m.success=function(t){return ft(t,"fn"),m.then(function(e){t(e.data,e.status,e.headers,u)}),m},m.error=function(t){return ft(t,"fn"),m.then(null,function(e){t(e.data,e.status,e.headers,u)}),m}):(m.success=to("success"),m.error=to("error")),m}function m(t){o(arguments,function(t){p[t]=function(e,n){return p(d({},n||{},{method:t,url:e}))}})}function g(t){o(arguments,function(t){p[t]=function(e,n,i){return p(d({},i||{},{method:t,url:e,data:n}))}})}function v(i,r){function o(t,n,i,r){function o(){a(n,t,i,r)}f&&(Te(t)?f.put(S,[t,n,Ee(i),r]):f.remove(S)),e?c.$applyAsync(o):(o(),c.$$phase||c.$apply())}function a(t,e,n,r){e=e>=-1?e:0,(Te(e)?g.resolve:g.reject)({data:t,status:e,headers:_e(n),config:i,statusText:r})}function u(t){a(t.data,t.status,B(t.headers()),t.statusText)}function d(){var t=p.pendingRequests.indexOf(i);-1!==t&&p.pendingRequests.splice(t,1)}var f,m,g=h.defer(),v=g.promise,C=i.headers,S=y(i.url,i.paramSerializer(i.params));if(p.pendingRequests.push(i),v.then(d,d),!i.cache&&!t.cache||i.cache===!1||"GET"!==i.method&&"JSONP"!==i.method||(f=w(i.cache)?i.cache:w(t.cache)?t.cache:x),f&&(m=f.get(S),$(m)?O(m)?m.then(u,u):zi(m)?a(m[1],m[0],B(m[2]),m[3]):a(m,200,{},"OK"):f.put(S,v)),b(m)){var k=jn(i.url)?l()[i.xsrfCookieName||t.xsrfCookieName]:n;k&&(C[i.xsrfHeaderName||t.xsrfHeaderName]=k),s(i.method,S,r,o,C,i.timeout,i.withCredentials,i.responseType)}return v}function y(t,e){return e.length>0&&(t+=(-1==t.indexOf("?")?"?":"&")+e),t}var x=u("$http");t.paramSerializer=C(t.paramSerializer)?f.get(t.paramSerializer):t.paramSerializer;var S=[];return o(a,function(t){S.unshift(C(t)?f.get(t):f.invoke(t))}),p.pendingRequests=[],m("get","delete","head","jsonp"),g("post","put","patch"),p.defaults=t,p}]}function Ae(){this.$get=function(){return function(){return new t.XMLHttpRequest}}}function je(){this.$get=["$browser","$window","$document","$xhrFactory",function(t,e,n,i){return Oe(t,i,t.defer,e.angular.callbacks,n[0])}]}function Oe(t,e,n,i,r){function a(t,e,n){var o=r.createElement("script"),a=null;return o.type="text/javascript",o.src=t,o.async=!0,a=function(t){hr(o,"load",a),hr(o,"error",a),r.body.removeChild(o),o=null;var s=-1,l="unknown";t&&("load"!==t.type||i[e].called||(t={type:"error"}),l=t.type,s="error"===t.type?404:200),n&&n(s,l)},dr(o,"load",a),dr(o,"error",a),r.body.appendChild(o),a}return function(r,s,l,u,c,d,h,f){function p(){y&&y(),w&&w.abort()}function g(e,i,r,o,a){$(S)&&n.cancel(S),y=w=null,e(i,r,o,a),t.$$completeOutstandingRequest(m)}if(t.$$incOutstandingRequestCount(),s=s||t.url(),"jsonp"==Ti(r)){var v="_"+(i.counter++).toString(36);i[v]=function(t){i[v].data=t,i[v].called=!0};var y=a(s.replace("JSON_CALLBACK","angular.callbacks."+v),v,function(t,e){g(u,t,i[v].data,"",e),i[v]=m})}else{var w=e(r,s);w.open(r,s,!0),o(c,function(t,e){$(t)&&w.setRequestHeader(e,t)}),w.onload=function(){var t=w.statusText||"",e="response"in w?w.response:w.responseText,n=1223===w.status?204:w.status;0===n&&(n=e?200:"file"==An(s).protocol?404:0),g(u,n,e,w.getAllResponseHeaders(),t)};var x=function(){g(u,-1,null,null,"")};if(w.onerror=x,w.onabort=x,h&&(w.withCredentials=!0),f)try{w.responseType=f}catch(C){if("json"!==f)throw C}w.send(b(l)?null:l)}if(d>0)var S=n(p,d);else O(d)&&d.then(p)}}function Fe(){var t="{{",e="}}";this.startSymbol=function(e){return e?(t=e,this):t},this.endSymbol=function(t){return t?(e=t,this):e},this.$get=["$parse","$exceptionHandler","$sce",function(n,i,r){function o(t){return"\\\\\\"+t}function a(n){return n.replace(f,t).replace(p,e)}function s(t){if(null==t)return"";switch(typeof t){case"string":break;case"number":t=""+t;break;default:t=q(t)}return t}function l(t,e,n,i){var r;return r=t.$watch(function(t){return r(),i(t)},e,n)}function u(o,u,f,p){function m(t){try{return t=A(t),p&&!$(t)?t:s(t)}catch(e){i(eo.interr(o,e))}}if(!o.length||-1===o.indexOf(t)){var g;if(!u){var y=a(o);g=v(y),g.exp=o,g.expressions=[],g.$$watchDelegate=l}return g}p=!!p;for(var w,x,C,S=0,k=[],E=[],_=o.length,M=[],T=[];_>S;){if(-1==(w=o.indexOf(t,S))||-1==(x=o.indexOf(e,w+c))){S!==_&&M.push(a(o.substring(S)));break}S!==w&&M.push(a(o.substring(S,w))),C=o.substring(w+c,x),k.push(C),E.push(n(C,m)),S=x+h,T.push(M.length),M.push("")}if(f&&M.length>1&&eo.throwNoconcat(o),!u||k.length){var P=function(t){for(var e=0,n=k.length;n>e;e++){if(p&&b(t[e]))return;M[T[e]]=t[e]}return M.join("")},A=function(t){return f?r.getTrusted(f,t):r.valueOf(t)};return d(function(t){var e=0,n=k.length,r=new Array(n);try{for(;n>e;e++)r[e]=E[e](t);return P(r)}catch(a){i(eo.interr(o,a))}},{exp:o,expressions:k,$$watchDelegate:function(t,e){var n;return t.$watchGroup(E,function(i,r){var o=P(i);D(e)&&e.call(this,o,i!==r?n:o,t),n=o})}})}}var c=t.length,h=e.length,f=new RegExp(t.replace(/./g,o),"g"),p=new RegExp(e.replace(/./g,o),"g");return u.startSymbol=function(){return t},u.endSymbol=function(){return e},u}]}function Ie(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(t,e,n,i,r){function o(o,s,l,u){function c(){d?o.apply(null,h):o(m)}var d=arguments.length>4,h=d?W(arguments,4):[],f=e.setInterval,p=e.clearInterval,m=0,g=$(u)&&!u,v=(g?i:n).defer(),y=v.promise;return l=$(l)?l:0,y.$$intervalId=f(function(){g?r.defer(c):t.$evalAsync(c),v.notify(m++),l>0&&m>=l&&(v.resolve(m),p(y.$$intervalId),delete a[y.$$intervalId]),g||t.$apply()},s),a[y.$$intervalId]=v,y}var a={};return o.cancel=function(t){return t&&t.$$intervalId in a?(a[t.$$intervalId].reject("canceled"),e.clearInterval(t.$$intervalId),delete a[t.$$intervalId],!0):!1},o}]}function Ne(t){for(var e=t.split("/"),n=e.length;n--;)e[n]=it(e[n]);return e.join("/")}function Re(t,e){var n=An(t);e.$$protocol=n.protocol,e.$$host=n.hostname,e.$$port=f(n.port)||io[n.protocol]||null}function Le(t,e){var n="/"!==t.charAt(0);n&&(t="/"+t);var i=An(t);e.$$path=decodeURIComponent(n&&"/"===i.pathname.charAt(0)?i.pathname.substring(1):i.pathname),e.$$search=et(i.search),e.$$hash=decodeURIComponent(i.hash),e.$$path&&"/"!=e.$$path.charAt(0)&&(e.$$path="/"+e.$$path)}function Ve(t,e){return 0===e.indexOf(t)?e.substr(t.length):void 0}function He(t){var e=t.indexOf("#");return-1==e?t:t.substr(0,e)}function Be(t){return t.replace(/(#.+)|#$/,"$1")}function Ue(t){return t.substr(0,He(t).lastIndexOf("/")+1)}function Ye(t){return t.substring(0,t.indexOf("/",t.indexOf("//")+2))}function We(t,e,n){this.$$html5=!0,n=n||"",Re(t,this),this.$$parse=function(t){var n=Ve(e,t);if(!C(n))throw ro("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',t,e);Le(n,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var t=nt(this.$$search),n=this.$$hash?"#"+it(this.$$hash):"";this.$$url=Ne(this.$$path)+(t?"?"+t:"")+n,this.$$absUrl=e+this.$$url.substr(1)},this.$$parseLinkUrl=function(i,r){if(r&&"#"===r[0])return this.hash(r.slice(1)),!0;var o,a,s;return $(o=Ve(t,i))?(a=o,s=$(o=Ve(n,o))?e+(Ve("/",o)||o):t+a):$(o=Ve(e,i))?s=e+o:e==i+"/"&&(s=e),s&&this.$$parse(s),!!s}}function ze(t,e,n){Re(t,this),this.$$parse=function(i){function r(t,e,n){var i,r=/^\/[A-Z]:(\/.*)/;return 0===e.indexOf(n)&&(e=e.replace(n,"")),r.exec(e)?t:(i=r.exec(t),i?i[1]:t)}var o,a=Ve(t,i)||Ve(e,i);b(a)||"#"!==a.charAt(0)?this.$$html5?o=a:(o="",b(a)&&(t=i,this.replace())):(o=Ve(n,a),b(o)&&(o=a)),Le(o,this),this.$$path=r(this.$$path,o,t),this.$$compose()},this.$$compose=function(){var e=nt(this.$$search),i=this.$$hash?"#"+it(this.$$hash):"";this.$$url=Ne(this.$$path)+(e?"?"+e:"")+i,this.$$absUrl=t+(this.$$url?n+this.$$url:"")},this.$$parseLinkUrl=function(e,n){return He(t)==He(e)?(this.$$parse(e),!0):!1}}function Ge(t,e,n){this.$$html5=!0,ze.apply(this,arguments),this.$$parseLinkUrl=function(i,r){if(r&&"#"===r[0])return this.hash(r.slice(1)),!0;var o,a;return t==He(i)?o=i:(a=Ve(e,i))?o=t+n+a:e===i+"/"&&(o=e),o&&this.$$parse(o),!!o},this.$$compose=function(){var e=nt(this.$$search),i=this.$$hash?"#"+it(this.$$hash):"";this.$$url=Ne(this.$$path)+(e?"?"+e:"")+i,this.$$absUrl=t+n+this.$$url}}function qe(t){return function(){return this[t]}}function Xe(t,e){return function(n){return b(n)?this[t]:(this[t]=e(n),this.$$compose(),this)}}function Ke(){var t="",e={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(e){return $(e)?(t=e,this):t},this.html5Mode=function(t){return j(t)?(e.enabled=t,this):w(t)?(j(t.enabled)&&(e.enabled=t.enabled),j(t.requireBase)&&(e.requireBase=t.requireBase),j(t.rewriteLinks)&&(e.rewriteLinks=t.rewriteLinks),this):e},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(n,i,r,o,a){function s(t,e,n){var r=u.url(),o=u.$$state;try{i.url(t,e,n),u.$$state=i.state()}catch(a){throw u.url(r),u.$$state=o,a}}function l(t,e){n.$broadcast("$locationChangeSuccess",u.absUrl(),t,u.$$state,e)}var u,c,d,h=i.baseHref(),f=i.url();if(e.enabled){if(!h&&e.requireBase)throw ro("nobase","$location in HTML5 mode requires a <base> tag to be present!");d=Ye(f)+(h||"/"),c=r.history?We:Ge}else d=He(f),c=ze;var p=Ue(d);u=new c(d,p,"#"+t),u.$$parseLinkUrl(f,f),u.$$state=i.state();var m=/^\s*(javascript|mailto):/i;o.on("click",function(t){if(e.rewriteLinks&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&2!=t.which&&2!=t.button){for(var r=Fi(t.target);"a"!==L(r[0]);)if(r[0]===o[0]||!(r=r.parent())[0])return;var s=r.prop("href"),l=r.attr("href")||r.attr("xlink:href");w(s)&&"[object SVGAnimatedString]"===s.toString()&&(s=An(s.animVal).href),m.test(s)||!s||r.attr("target")||t.isDefaultPrevented()||u.$$parseLinkUrl(s,l)&&(t.preventDefault(),u.absUrl()!=i.url()&&(n.$apply(),a.angular["ff-684208-preventDefault"]=!0))}}),Be(u.absUrl())!=Be(f)&&i.url(u.absUrl(),!0);var g=!0;return i.onUrlChange(function(t,e){return b(Ve(p,t))?void(a.location.href=t):(n.$evalAsync(function(){var i,r=u.absUrl(),o=u.$$state;t=Be(t),u.$$parse(t),u.$$state=e,i=n.$broadcast("$locationChangeStart",t,r,e,o).defaultPrevented,u.absUrl()===t&&(i?(u.$$parse(r),u.$$state=o,s(r,!1,o)):(g=!1,l(r,o)))}),void(n.$$phase||n.$digest()))}),n.$watch(function(){var t=Be(i.url()),e=Be(u.absUrl()),o=i.state(),a=u.$$replace,c=t!==e||u.$$html5&&r.history&&o!==u.$$state;(g||c)&&(g=!1,n.$evalAsync(function(){var e=u.absUrl(),i=n.$broadcast("$locationChangeStart",e,t,u.$$state,o).defaultPrevented;u.absUrl()===e&&(i?(u.$$parse(t),u.$$state=o):(c&&s(e,a,o===u.$$state?null:u.$$state),l(t,o)))})),u.$$replace=!1}),u}]}function Ze(){var t=!0,e=this;this.debugEnabled=function(e){return $(e)?(t=e,this):t},this.$get=["$window",function(n){function i(t){return t instanceof Error&&(t.stack?t=t.message&&-1===t.stack.indexOf(t.message)?"Error: "+t.message+"\n"+t.stack:t.stack:t.sourceURL&&(t=t.message+"\n"+t.sourceURL+":"+t.line)),t}function r(t){var e=n.console||{},r=e[t]||e.log||m,a=!1;try{a=!!r.apply}catch(s){}return a?function(){var t=[];return o(arguments,function(e){t.push(i(e))}),r.apply(e,t)}:function(t,e){r(t,null==e?"":e)}}return{log:r("log"),info:r("info"),warn:r("warn"),error:r("error"),debug:function(){var n=r("debug");return function(){t&&n.apply(e,arguments)}}()}}]}function Qe(t,e){if("__defineGetter__"===t||"__defineSetter__"===t||"__lookupGetter__"===t||"__lookupSetter__"===t||"__proto__"===t)throw ao("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",e);return t}function Je(t){return t+""}function tn(t,e){if(t){if(t.constructor===t)throw ao("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",e);if(t.window===t)throw ao("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",e);if(t.children&&(t.nodeName||t.prop&&t.attr&&t.find))throw ao("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",e);if(t===Object)throw ao("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",e)}return t}function en(t,e){if(t){if(t.constructor===t)throw ao("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",e);if(t===so||t===lo||t===uo)throw ao("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",e)}}function nn(t,e){if(t&&(t===0..constructor||t===(!1).constructor||t==="".constructor||t==={}.constructor||t===[].constructor||t===Function.constructor))throw ao("isecaf","Assigning to a constructor is disallowed! Expression: {0}",e)}function rn(t,e){return"undefined"!=typeof t?t:e}function on(t,e){return"undefined"==typeof t?e:"undefined"==typeof e?t:t+e}function an(t,e){var n=t(e);return!n.$stateful}function sn(t,e){var n,i;switch(t.type){case po.Program:n=!0,o(t.body,function(t){sn(t.expression,e),n=n&&t.expression.constant}),t.constant=n;break;case po.Literal:t.constant=!0,t.toWatch=[];break;case po.UnaryExpression:sn(t.argument,e),t.constant=t.argument.constant,t.toWatch=t.argument.toWatch;break;case po.BinaryExpression:sn(t.left,e),sn(t.right,e),t.constant=t.left.constant&&t.right.constant,t.toWatch=t.left.toWatch.concat(t.right.toWatch);break;case po.LogicalExpression:sn(t.left,e),sn(t.right,e),t.constant=t.left.constant&&t.right.constant,t.toWatch=t.constant?[]:[t];break;case po.ConditionalExpression:sn(t.test,e),sn(t.alternate,e),sn(t.consequent,e),t.constant=t.test.constant&&t.alternate.constant&&t.consequent.constant,t.toWatch=t.constant?[]:[t];break;case po.Identifier:t.constant=!1,t.toWatch=[t];break;case po.MemberExpression:sn(t.object,e),t.computed&&sn(t.property,e),t.constant=t.object.constant&&(!t.computed||t.property.constant),t.toWatch=[t];break;case po.CallExpression:n=t.filter?an(e,t.callee.name):!1,i=[],o(t.arguments,function(t){sn(t,e),n=n&&t.constant,t.constant||i.push.apply(i,t.toWatch)}),t.constant=n,t.toWatch=t.filter&&an(e,t.callee.name)?i:[t];break;case po.AssignmentExpression:sn(t.left,e),sn(t.right,e),t.constant=t.left.constant&&t.right.constant,t.toWatch=[t];break;case po.ArrayExpression:n=!0,i=[],o(t.elements,function(t){sn(t,e),n=n&&t.constant,t.constant||i.push.apply(i,t.toWatch)}),t.constant=n,t.toWatch=i;break;case po.ObjectExpression:n=!0,i=[],o(t.properties,function(t){sn(t.value,e),n=n&&t.value.constant,t.value.constant||i.push.apply(i,t.value.toWatch)}),t.constant=n,t.toWatch=i;break;case po.ThisExpression:t.constant=!1,t.toWatch=[];break;case po.LocalsExpression:t.constant=!1,t.toWatch=[]}}function ln(t){if(1==t.length){var e=t[0].expression,i=e.toWatch;return 1!==i.length?i:i[0]!==e?i:n}}function un(t){return t.type===po.Identifier||t.type===po.MemberExpression}function cn(t){return 1===t.body.length&&un(t.body[0].expression)?{type:po.AssignmentExpression,left:t.body[0].expression,right:{type:po.NGValueParameter},operator:"="}:void 0}function dn(t){return 0===t.body.length||1===t.body.length&&(t.body[0].expression.type===po.Literal||t.body[0].expression.type===po.ArrayExpression||t.body[0].expression.type===po.ObjectExpression)}function hn(t){return t.constant}function fn(t,e){this.astBuilder=t,this.$filter=e}function pn(t,e){this.astBuilder=t,this.$filter=e}function mn(t){return"constructor"==t}function gn(t){return D(t.valueOf)?t.valueOf():go.call(t)}function vn(){var t=vt(),e=vt();this.$get=["$filter",function(i){function r(n,r,o){var s,f,y;switch(o=o||v,typeof n){case"string":n=n.trim(),y=n;var b=o?e:t;if(s=b[y],!s){":"===n.charAt(0)&&":"===n.charAt(1)&&(f=!0,n=n.substring(2));var $=o?g:p,w=new fo($),x=new mo(w,i,$);s=x.parse(n),s.constant?s.$$watchDelegate=d:f?s.$$watchDelegate=s.literal?c:u:s.inputs&&(s.$$watchDelegate=l),o&&(s=a(s)),b[y]=s}return h(s,r);case"function":return h(n,r);default:return h(m,r)}}function a(t){function e(e,n,i,r){var o=v;v=!0;try{return t(e,n,i,r)}finally{v=o}}if(!t)return t;e.$$watchDelegate=t.$$watchDelegate,e.assign=a(t.assign),e.constant=t.constant,e.literal=t.literal;for(var n=0;t.inputs&&n<t.inputs.length;++n)t.inputs[n]=a(t.inputs[n]);
return e.inputs=t.inputs,e}function s(t,e){return null==t||null==e?t===e:"object"==typeof t&&(t=gn(t),"object"==typeof t)?!1:t===e||t!==t&&e!==e}function l(t,e,i,r,o){var a,l=r.inputs;if(1===l.length){var u=s;return l=l[0],t.$watch(function(t){var e=l(t);return s(e,u)||(a=r(t,n,n,[e]),u=e&&gn(e)),a},e,i,o)}for(var c=[],d=[],h=0,f=l.length;f>h;h++)c[h]=s,d[h]=null;return t.$watch(function(t){for(var e=!1,i=0,o=l.length;o>i;i++){var u=l[i](t);(e||(e=!s(u,c[i])))&&(d[i]=u,c[i]=u&&gn(u))}return e&&(a=r(t,n,n,d)),a},e,i,o)}function u(t,e,n,i){var r,o;return r=t.$watch(function(t){return i(t)},function(t,n,i){o=t,D(e)&&e.apply(this,arguments),$(t)&&i.$$postDigest(function(){$(o)&&r()})},n)}function c(t,e,n,i){function r(t){var e=!0;return o(t,function(t){$(t)||(e=!1)}),e}var a,s;return a=t.$watch(function(t){return i(t)},function(t,n,i){s=t,D(e)&&e.call(this,t,n,i),r(t)&&i.$$postDigest(function(){r(s)&&a()})},n)}function d(t,e,n,i){var r;return r=t.$watch(function(t){return r(),i(t)},e,n)}function h(t,e){if(!e)return t;var n=t.$$watchDelegate,i=!1,r=n!==c&&n!==u,o=r?function(n,r,o,a){var s=i&&a?a[0]:t(n,r,o,a);return e(s,n,r)}:function(n,i,r,o){var a=t(n,i,r,o),s=e(a,n,i);return $(a)?s:a};return t.$$watchDelegate&&t.$$watchDelegate!==l?o.$$watchDelegate=t.$$watchDelegate:e.$stateful||(o.$$watchDelegate=l,i=!t.inputs,o.inputs=t.inputs?t.inputs:[t]),o}var f=Ki().noUnsafeEval,p={csp:f,expensiveChecks:!1},g={csp:f,expensiveChecks:!0},v=!1;return r.$$runningExpensiveChecks=function(){return v},r}]}function yn(){this.$get=["$rootScope","$exceptionHandler",function(t,e){return $n(function(e){t.$evalAsync(e)},e)}]}function bn(){this.$get=["$browser","$exceptionHandler",function(t,e){return $n(function(e){t.defer(e)},e)}]}function $n(t,e){function r(){this.$$state={status:0}}function a(t,e){return function(n){e.call(t,n)}}function s(t){var i,r,o;o=t.pending,t.processScheduled=!1,t.pending=n;for(var a=0,s=o.length;s>a;++a){r=o[a][0],i=o[a][t.status];try{D(i)?r.resolve(i(t.value)):1===t.status?r.resolve(t.value):r.reject(t.value)}catch(l){r.reject(l),e(l)}}}function l(e){!e.processScheduled&&e.pending&&(e.processScheduled=!0,t(function(){s(e)}))}function u(){this.promise=new r}function c(t){var e=new u,n=0,i=zi(t)?[]:{};return o(t,function(t,r){n++,v(t).then(function(t){i.hasOwnProperty(r)||(i[r]=t,--n||e.resolve(i))},function(t){i.hasOwnProperty(r)||e.reject(t)})}),0===n&&e.resolve(i),e.promise}var h=i("$q",TypeError),f=function(){var t=new u;return t.resolve=a(t,t.resolve),t.reject=a(t,t.reject),t.notify=a(t,t.notify),t};d(r.prototype,{then:function(t,e,n){if(b(t)&&b(e)&&b(n))return this;var i=new u;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([i,t,e,n]),this.$$state.status>0&&l(this.$$state),i.promise},"catch":function(t){return this.then(null,t)},"finally":function(t,e){return this.then(function(e){return g(e,!0,t)},function(e){return g(e,!1,t)},e)}}),d(u.prototype,{resolve:function(t){this.promise.$$state.status||(t===this.promise?this.$$reject(h("qcycle","Expected promise to be resolved with value other than itself '{0}'",t)):this.$$resolve(t))},$$resolve:function(t){function n(t){s||(s=!0,o.$$resolve(t))}function i(t){s||(s=!0,o.$$reject(t))}var r,o=this,s=!1;try{(w(t)||D(t))&&(r=t&&t.then),D(r)?(this.promise.$$state.status=-1,r.call(t,n,i,a(this,this.notify))):(this.promise.$$state.value=t,this.promise.$$state.status=1,l(this.promise.$$state))}catch(u){i(u),e(u)}},reject:function(t){this.promise.$$state.status||this.$$reject(t)},$$reject:function(t){this.promise.$$state.value=t,this.promise.$$state.status=2,l(this.promise.$$state)},notify:function(n){var i=this.promise.$$state.pending;this.promise.$$state.status<=0&&i&&i.length&&t(function(){for(var t,r,o=0,a=i.length;a>o;o++){r=i[o][0],t=i[o][3];try{r.notify(D(t)?t(n):n)}catch(s){e(s)}}})}});var p=function(t){var e=new u;return e.reject(t),e.promise},m=function(t,e){var n=new u;return e?n.resolve(t):n.reject(t),n.promise},g=function(t,e,n){var i=null;try{D(n)&&(i=n())}catch(r){return m(r,!1)}return O(i)?i.then(function(){return m(t,e)},function(t){return m(t,!1)}):m(t,e)},v=function(t,e,n,i){var r=new u;return r.resolve(t),r.promise.then(e,n,i)},y=v,$=function(t){function e(t){i.resolve(t)}function n(t){i.reject(t)}if(!D(t))throw h("norslvr","Expected resolverFn, got '{0}'",t);var i=new u;return t(e,n),i.promise};return $.prototype=r.prototype,$.defer=f,$.reject=p,$.when=v,$.resolve=y,$.all=c,$}function wn(){this.$get=["$window","$timeout",function(t,e){var n=t.requestAnimationFrame||t.webkitRequestAnimationFrame,i=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.webkitCancelRequestAnimationFrame,r=!!n,o=r?function(t){var e=n(t);return function(){i(e)}}:function(t){var n=e(t,16.66,!1);return function(){e.cancel(n)}};return o.supported=r,o}]}function xn(){function t(t){function e(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=l(),this.$$ChildScope=null}return e.prototype=t,e}var e=10,n=i("$rootScope"),a=null,s=null;this.digestTtl=function(t){return arguments.length&&(e=t),e},this.$get=["$exceptionHandler","$parse","$browser",function(i,u,c){function d(t){t.currentScope.$$destroyed=!0}function h(t){9===Oi&&(t.$$childHead&&h(t.$$childHead),t.$$nextSibling&&h(t.$$nextSibling)),t.$parent=t.$$nextSibling=t.$$prevSibling=t.$$childHead=t.$$childTail=t.$root=t.$$watchers=null}function f(){this.$id=l(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$$isolateBindings=null}function p(t){if(S.$$phase)throw n("inprog","{0} already in progress",S.$$phase);S.$$phase=t}function g(){S.$$phase=null}function v(t,e){do t.$$watchersCount+=e;while(t=t.$parent)}function y(t,e,n){do t.$$listenerCount[n]-=e,0===t.$$listenerCount[n]&&delete t.$$listenerCount[n];while(t=t.$parent)}function $(){}function x(){for(;_.length;)try{_.shift()()}catch(t){i(t)}s=null}function C(){null===s&&(s=c.defer(function(){S.$apply(x)}))}f.prototype={constructor:f,$new:function(e,n){var i;return n=n||this,e?(i=new f,i.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=t(this)),i=new this.$$ChildScope),i.$parent=n,i.$$prevSibling=n.$$childTail,n.$$childHead?(n.$$childTail.$$nextSibling=i,n.$$childTail=i):n.$$childHead=n.$$childTail=i,(e||n!=this)&&i.$on("$destroy",d),i},$watch:function(t,e,n,i){var r=u(t);if(r.$$watchDelegate)return r.$$watchDelegate(this,e,n,r,t);var o=this,s=o.$$watchers,l={fn:e,last:$,get:r,exp:i||t,eq:!!n};return a=null,D(e)||(l.fn=m),s||(s=o.$$watchers=[]),s.unshift(l),v(this,1),function(){V(s,l)>=0&&v(o,-1),a=null}},$watchGroup:function(t,e){function n(){l=!1,u?(u=!1,e(r,r,s)):e(r,i,s)}var i=new Array(t.length),r=new Array(t.length),a=[],s=this,l=!1,u=!0;if(!t.length){var c=!0;return s.$evalAsync(function(){c&&e(r,r,s)}),function(){c=!1}}return 1===t.length?this.$watch(t[0],function(t,n,o){r[0]=t,i[0]=n,e(r,t===n?r:i,o)}):(o(t,function(t,e){var o=s.$watch(t,function(t,o){r[e]=t,i[e]=o,l||(l=!0,s.$evalAsync(n))});a.push(o)}),function(){for(;a.length;)a.shift()()})},$watchCollection:function(t,e){function n(t){o=t;var e,n,i,s,l;if(!b(o)){if(w(o))if(r(o)){a!==f&&(a=f,g=a.length=0,d++),e=o.length,g!==e&&(d++,a.length=g=e);for(var u=0;e>u;u++)l=a[u],s=o[u],i=l!==l&&s!==s,i||l===s||(d++,a[u]=s)}else{a!==p&&(a=p={},g=0,d++),e=0;for(n in o)Mi.call(o,n)&&(e++,s=o[n],l=a[n],n in a?(i=l!==l&&s!==s,i||l===s||(d++,a[n]=s)):(g++,a[n]=s,d++));if(g>e){d++;for(n in a)Mi.call(o,n)||(g--,delete a[n])}}else a!==o&&(a=o,d++);return d}}function i(){if(m?(m=!1,e(o,o,l)):e(o,s,l),c)if(w(o))if(r(o)){s=new Array(o.length);for(var t=0;t<o.length;t++)s[t]=o[t]}else{s={};for(var n in o)Mi.call(o,n)&&(s[n]=o[n])}else s=o}n.$stateful=!0;var o,a,s,l=this,c=e.length>1,d=0,h=u(t,n),f=[],p={},m=!0,g=0;return this.$watch(h,i)},$digest:function(){var t,r,o,l,u,d,h,f,m,v,y,b,w=e,C=this,_=[];p("$digest"),c.$$checkUrlChange(),this===S&&null!==s&&(c.defer.cancel(s),x()),a=null;do{for(f=!1,v=C;k.length;){try{b=k.shift(),b.scope.$eval(b.expression,b.locals)}catch(M){i(M)}a=null}t:do{if(d=v.$$watchers)for(h=d.length;h--;)try{if(t=d[h])if(u=t.get,(r=u(v))===(o=t.last)||(t.eq?U(r,o):"number"==typeof r&&"number"==typeof o&&isNaN(r)&&isNaN(o))){if(t===a){f=!1;break t}}else f=!0,a=t,t.last=t.eq?H(r,null):r,l=t.fn,l(r,o===$?r:o,v),5>w&&(y=4-w,_[y]||(_[y]=[]),_[y].push({msg:D(t.exp)?"fn: "+(t.exp.name||t.exp.toString()):t.exp,newVal:r,oldVal:o}))}catch(M){i(M)}if(!(m=v.$$watchersCount&&v.$$childHead||v!==C&&v.$$nextSibling))for(;v!==C&&!(m=v.$$nextSibling);)v=v.$parent}while(v=m);if((f||k.length)&&!w--)throw g(),n("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",e,_)}while(f||k.length);for(g();E.length;)try{E.shift()()}catch(M){i(M)}},$destroy:function(){if(!this.$$destroyed){var t=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this===S&&c.$$applicationDestroyed(),v(this,-this.$$watchersCount);for(var e in this.$$listenerCount)y(this,this.$$listenerCount[e],e);t&&t.$$childHead==this&&(t.$$childHead=this.$$nextSibling),t&&t.$$childTail==this&&(t.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=m,this.$on=this.$watch=this.$watchGroup=function(){return m},this.$$listeners={},this.$$nextSibling=null,h(this)}},$eval:function(t,e){return u(t)(this,e)},$evalAsync:function(t,e){S.$$phase||k.length||c.defer(function(){k.length&&S.$digest()}),k.push({scope:this,expression:u(t),locals:e})},$$postDigest:function(t){E.push(t)},$apply:function(t){try{p("$apply");try{return this.$eval(t)}finally{g()}}catch(e){i(e)}finally{try{S.$digest()}catch(e){throw i(e),e}}},$applyAsync:function(t){function e(){n.$eval(t)}var n=this;t&&_.push(e),t=u(t),C()},$on:function(t,e){var n=this.$$listeners[t];n||(this.$$listeners[t]=n=[]),n.push(e);var i=this;do i.$$listenerCount[t]||(i.$$listenerCount[t]=0),i.$$listenerCount[t]++;while(i=i.$parent);var r=this;return function(){var i=n.indexOf(e);-1!==i&&(n[i]=null,y(r,1,t))}},$emit:function(t,e){var n,r,o,a=[],s=this,l=!1,u={name:t,targetScope:s,stopPropagation:function(){l=!0},preventDefault:function(){u.defaultPrevented=!0},defaultPrevented:!1},c=Y([u],arguments,1);do{for(n=s.$$listeners[t]||a,u.currentScope=s,r=0,o=n.length;o>r;r++)if(n[r])try{n[r].apply(null,c)}catch(d){i(d)}else n.splice(r,1),r--,o--;if(l)return u.currentScope=null,u;s=s.$parent}while(s);return u.currentScope=null,u},$broadcast:function(t,e){var n=this,r=n,o=n,a={name:t,targetScope:n,preventDefault:function(){a.defaultPrevented=!0},defaultPrevented:!1};if(!n.$$listenerCount[t])return a;for(var s,l,u,c=Y([a],arguments,1);r=o;){for(a.currentScope=r,s=r.$$listeners[t]||[],l=0,u=s.length;u>l;l++)if(s[l])try{s[l].apply(null,c)}catch(d){i(d)}else s.splice(l,1),l--,u--;if(!(o=r.$$listenerCount[t]&&r.$$childHead||r!==n&&r.$$nextSibling))for(;r!==n&&!(o=r.$$nextSibling);)r=r.$parent}return a.currentScope=null,a}};var S=new f,k=S.$$asyncQueue=[],E=S.$$postDigestQueue=[],_=S.$$applyAsyncQueue=[];return S}]}function Cn(){var t=/^\s*(https?|ftp|mailto|tel|file):/,e=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(e){return $(e)?(t=e,this):t},this.imgSrcSanitizationWhitelist=function(t){return $(t)?(e=t,this):e},this.$get=function(){return function(n,i){var r,o=i?e:t;return r=An(n).href,""===r||r.match(o)?n:"unsafe:"+r}}}function Sn(t){if("self"===t)return t;if(C(t)){if(t.indexOf("***")>-1)throw vo("iwcard","Illegal sequence *** in string matcher.  String: {0}",t);return t=Xi(t).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+t+"$")}if(E(t))return new RegExp("^"+t.source+"$");throw vo("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function kn(t){var e=[];return $(t)&&o(t,function(t){e.push(Sn(t))}),e}function Dn(){this.SCE_CONTEXTS=yo;var t=["self"],e=[];this.resourceUrlWhitelist=function(e){return arguments.length&&(t=kn(e)),t},this.resourceUrlBlacklist=function(t){return arguments.length&&(e=kn(t)),e},this.$get=["$injector",function(n){function i(t,e){return"self"===t?jn(e):!!t.exec(e.href)}function r(n){var r,o,a=An(n.toString()),s=!1;for(r=0,o=t.length;o>r;r++)if(i(t[r],a)){s=!0;break}if(s)for(r=0,o=e.length;o>r;r++)if(i(e[r],a)){s=!1;break}return s}function o(t){var e=function(t){this.$$unwrapTrustedValue=function(){return t}};return t&&(e.prototype=new t),e.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},e.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},e}function a(t,e){var n=d.hasOwnProperty(t)?d[t]:null;if(!n)throw vo("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",t,e);if(null===e||b(e)||""===e)return e;if("string"!=typeof e)throw vo("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",t);return new n(e)}function s(t){return t instanceof c?t.$$unwrapTrustedValue():t}function l(t,e){if(null===e||b(e)||""===e)return e;var n=d.hasOwnProperty(t)?d[t]:null;if(n&&e instanceof n)return e.$$unwrapTrustedValue();if(t===yo.RESOURCE_URL){if(r(e))return e;throw vo("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}",e.toString())}if(t===yo.HTML)return u(e);throw vo("unsafe","Attempting to use an unsafe value in a safe context.")}var u=function(t){throw vo("unsafe","Attempting to use an unsafe value in a safe context.")};n.has("$sanitize")&&(u=n.get("$sanitize"));var c=o(),d={};return d[yo.HTML]=o(c),d[yo.CSS]=o(c),d[yo.URL]=o(c),d[yo.JS]=o(c),d[yo.RESOURCE_URL]=o(d[yo.URL]),{trustAs:a,getTrusted:l,valueOf:s}}]}function En(){var t=!0;this.enabled=function(e){return arguments.length&&(t=!!e),t},this.$get=["$parse","$sceDelegate",function(e,n){if(t&&8>Oi)throw vo("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode.  You can fix this by adding the text <!doctype html> to the top of your HTML document.  See http://docs.angularjs.org/api/ng.$sce for more information.");var i=B(yo);i.isEnabled=function(){return t},i.trustAs=n.trustAs,i.getTrusted=n.getTrusted,i.valueOf=n.valueOf,t||(i.trustAs=i.getTrusted=function(t,e){return e},i.valueOf=g),i.parseAs=function(t,n){var r=e(n);return r.literal&&r.constant?r:e(n,function(e){return i.getTrusted(t,e)})};var r=i.parseAs,a=i.getTrusted,s=i.trustAs;return o(yo,function(t,e){var n=Ti(e);i[Ct("parse_as_"+n)]=function(e){return r(t,e)},i[Ct("get_trusted_"+n)]=function(e){return a(t,e)},i[Ct("trust_as_"+n)]=function(e){return s(t,e)}}),i}]}function _n(){this.$get=["$window","$document",function(t,e){var n,i,r={},o=f((/android (\d+)/.exec(Ti((t.navigator||{}).userAgent))||[])[1]),a=/Boxee/i.test((t.navigator||{}).userAgent),s=e[0]||{},l=/^(Moz|webkit|ms)(?=[A-Z])/,u=s.body&&s.body.style,c=!1,d=!1;if(u){for(var h in u)if(i=l.exec(h)){n=i[0],n=n.substr(0,1).toUpperCase()+n.substr(1);break}n||(n="WebkitOpacity"in u&&"webkit"),c=!!("transition"in u||n+"Transition"in u),d=!!("animation"in u||n+"Animation"in u),!o||c&&d||(c=C(u.webkitTransition),d=C(u.webkitAnimation))}return{history:!(!t.history||!t.history.pushState||4>o||a),hasEvent:function(t){if("input"===t&&11>=Oi)return!1;if(b(r[t])){var e=s.createElement("div");r[t]="on"+t in e}return r[t]},csp:Ki(),vendorPrefix:n,transitions:c,animations:d,android:o}}]}function Mn(){var t;this.httpOptions=function(e){return e?(t=e,this):t},this.$get=["$templateCache","$http","$q","$sce",function(e,n,i,r){function o(a,s){function l(t){if(!s)throw Ur("tpload","Failed to load template: {0} (HTTP status: {1} {2})",a,t.status,t.statusText);return i.reject(t)}o.totalPendingRequests++,C(a)&&e.get(a)||(a=r.getTrustedResourceUrl(a));var u=n.defaults&&n.defaults.transformResponse;return zi(u)?u=u.filter(function(t){return t!==ke}):u===ke&&(u=null),n.get(a,d({cache:e,transformResponse:u},t))["finally"](function(){o.totalPendingRequests--}).then(function(t){return e.put(a,t.data),t.data},l)}return o.totalPendingRequests=0,o}]}function Tn(){this.$get=["$rootScope","$browser","$location",function(t,e,n){var i={};return i.findBindings=function(t,e,n){var i=t.getElementsByClassName("ng-binding"),r=[];return o(i,function(t){var i=Yi.element(t).data("$binding");i&&o(i,function(i){if(n){var o=new RegExp("(^|\\s)"+Xi(e)+"(\\s|\\||$)");o.test(i)&&r.push(t)}else-1!=i.indexOf(e)&&r.push(t)})}),r},i.findModels=function(t,e,n){for(var i=["ng-","data-ng-","ng\\:"],r=0;r<i.length;++r){var o=n?"=":"*=",a="["+i[r]+"model"+o+'"'+e+'"]',s=t.querySelectorAll(a);if(s.length)return s}},i.getLocation=function(){return n.url()},i.setLocation=function(e){e!==n.url()&&(n.url(e),t.$digest())},i.whenStable=function(t){e.notifyWhenNoOutstandingRequests(t)},i}]}function Pn(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(t,e,n,i,r){function o(o,s,l){D(o)||(l=s,s=o,o=m);var u,c=W(arguments,3),d=$(l)&&!l,h=(d?i:n).defer(),f=h.promise;return u=e.defer(function(){try{h.resolve(o.apply(null,c))}catch(e){h.reject(e),r(e)}finally{delete a[f.$$timeoutId]}d||t.$apply()},s),f.$$timeoutId=u,a[u]=h,f}var a={};return o.cancel=function(t){return t&&t.$$timeoutId in a?(a[t.$$timeoutId].reject("canceled"),delete a[t.$$timeoutId],e.defer.cancel(t.$$timeoutId)):!1},o}]}function An(t){var e=t;return Oi&&(bo.setAttribute("href",e),e=bo.href),bo.setAttribute("href",e),{href:bo.href,protocol:bo.protocol?bo.protocol.replace(/:$/,""):"",host:bo.host,search:bo.search?bo.search.replace(/^\?/,""):"",hash:bo.hash?bo.hash.replace(/^#/,""):"",hostname:bo.hostname,port:bo.port,pathname:"/"===bo.pathname.charAt(0)?bo.pathname:"/"+bo.pathname}}function jn(t){var e=C(t)?An(t):t;return e.protocol===$o.protocol&&e.host===$o.host}function On(){this.$get=v(t)}function Fn(t){function e(t){try{return decodeURIComponent(t)}catch(e){return t}}var n=t[0]||{},i={},r="";return function(){var t,o,a,s,l,u=n.cookie||"";if(u!==r)for(r=u,t=r.split("; "),i={},a=0;a<t.length;a++)o=t[a],s=o.indexOf("="),s>0&&(l=e(o.substring(0,s)),b(i[l])&&(i[l]=e(o.substring(s+1))));return i}}function In(){this.$get=Fn}function Nn(t){function e(i,r){if(w(i)){var a={};return o(i,function(t,n){a[n]=e(n,t)}),a}return t.factory(i+n,r)}var n="Filter";this.register=e,this.$get=["$injector",function(t){return function(e){return t.get(e+n)}}],e("currency",Bn),e("date",ii),e("filter",Rn),e("json",ri),e("limitTo",oi),e("lowercase",Eo),e("number",Un),e("orderBy",ai),e("uppercase",_o)}function Rn(){return function(t,e,n){if(!r(t)){if(null==t)return t;throw i("filter")("notarray","Expected array but received: {0}",t)}var o,a,s=Hn(e);switch(s){case"function":o=e;break;case"boolean":case"null":case"number":case"string":a=!0;case"object":o=Ln(e,n,a);break;default:return t}return Array.prototype.filter.call(t,o)}}function Ln(t,e,n){var i,r=w(t)&&"$"in t;return e===!0?e=U:D(e)||(e=function(t,e){return b(t)?!1:null===t||null===e?t===e:w(e)||w(t)&&!y(t)?!1:(t=Ti(""+t),e=Ti(""+e),-1!==t.indexOf(e))}),i=function(i){return r&&!w(i)?Vn(i,t.$,e,!1):Vn(i,t,e,n)}}function Vn(t,e,n,i,r){var o=Hn(t),a=Hn(e);if("string"===a&&"!"===e.charAt(0))return!Vn(t,e.substring(1),n,i);if(zi(t))return t.some(function(t){return Vn(t,e,n,i)});switch(o){case"object":var s;if(i){for(s in t)if("$"!==s.charAt(0)&&Vn(t[s],e,n,!0))return!0;return r?!1:Vn(t,e,n,!1)}if("object"===a){for(s in e){var l=e[s];if(!D(l)&&!b(l)){var u="$"===s,c=u?t:t[s];if(!Vn(c,l,n,u,u))return!1}}return!0}return n(t,e);case"function":return!1;default:return n(t,e)}}function Hn(t){return null===t?"null":typeof t}function Bn(t){var e=t.NUMBER_FORMATS;return function(t,n,i){return b(n)&&(n=e.CURRENCY_SYM),b(i)&&(i=e.PATTERNS[1].maxFrac),null==t?t:zn(t,e.PATTERNS[1],e.GROUP_SEP,e.DECIMAL_SEP,i).replace(/\u00A4/g,n)}}function Un(t){var e=t.NUMBER_FORMATS;return function(t,n){return null==t?t:zn(t,e.PATTERNS[0],e.GROUP_SEP,e.DECIMAL_SEP,n)}}function Yn(t){var e,n,i,r,o,a=0;for((n=t.indexOf(xo))>-1&&(t=t.replace(xo,"")),(i=t.search(/e/i))>0?(0>n&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):0>n&&(n=t.length),i=0;t.charAt(i)==Co;i++);if(i==(o=t.length))e=[0],n=1;else{for(o--;t.charAt(o)==Co;)o--;for(n-=i,e=[],r=0;o>=i;i++,r++)e[r]=+t.charAt(i)}return n>wo&&(e=e.splice(0,wo-1),a=n-1,n=1),{d:e,e:a,i:n}}function Wn(t,e,n,i){var r=t.d,o=r.length-t.i;e=b(e)?Math.min(Math.max(n,o),i):+e;var a=e+t.i,s=r[a];if(a>0)r.splice(a);else{t.i=1,r.length=a=e+1;for(var l=0;a>l;l++)r[l]=0}for(s>=5&&r[a-1]++;e>o;o++)r.push(0);var u=r.reduceRight(function(t,e,n,i){return e+=t,i[n]=e%10,Math.floor(e/10)},0);u&&(r.unshift(u),t.i++)}function zn(t,e,n,i,r){if(!C(t)&&!S(t)||isNaN(t))return"";var o,a=!isFinite(t),s=!1,l=Math.abs(t)+"",u="";if(a)u="∞";else{o=Yn(l),Wn(o,r,e.minFrac,e.maxFrac);var c=o.d,d=o.i,h=o.e,f=[];for(s=c.reduce(function(t,e){return t&&!e},!0);0>d;)c.unshift(0),d++;d>0?f=c.splice(d):(f=c,c=[0]);var p=[];for(c.length>e.lgSize&&p.unshift(c.splice(-e.lgSize).join(""));c.length>e.gSize;)p.unshift(c.splice(-e.gSize).join(""));c.length&&p.unshift(c.join("")),u=p.join(n),f.length&&(u+=i+f.join("")),h&&(u+="e+"+h)}return 0>t&&!s?e.negPre+u+e.negSuf:e.posPre+u+e.posSuf}function Gn(t,e,n){var i="";for(0>t&&(i="-",t=-t),t=""+t;t.length<e;)t=Co+t;return n&&(t=t.substr(t.length-e)),i+t}function qn(t,e,n,i){return n=n||0,function(r){var o=r["get"+t]();return(n>0||o>-n)&&(o+=n),0===o&&-12==n&&(o=12),Gn(o,e,i)}}function Xn(t,e){return function(n,i){var r=n["get"+t](),o=Pi(e?"SHORT"+t:t);return i[o][r]}}function Kn(t,e,n){var i=-1*n,r=i>=0?"+":"";return r+=Gn(Math[i>0?"floor":"ceil"](i/60),2)+Gn(Math.abs(i%60),2)}function Zn(t){var e=new Date(t,0,1).getDay();return new Date(t,0,(4>=e?5:12)-e)}function Qn(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+(4-t.getDay()))}function Jn(t){return function(e){var n=Zn(e.getFullYear()),i=Qn(e),r=+i-+n,o=1+Math.round(r/6048e5);return Gn(o,t)}}function ti(t,e){return t.getHours()<12?e.AMPMS[0]:e.AMPMS[1]}function ei(t,e){return t.getFullYear()<=0?e.ERAS[0]:e.ERAS[1]}function ni(t,e){return t.getFullYear()<=0?e.ERANAMES[0]:e.ERANAMES[1]}function ii(t){function e(t){var e;if(e=t.match(n)){var i=new Date(0),r=0,o=0,a=e[8]?i.setUTCFullYear:i.setFullYear,s=e[8]?i.setUTCHours:i.setHours;e[9]&&(r=f(e[9]+e[10]),o=f(e[9]+e[11])),a.call(i,f(e[1]),f(e[2])-1,f(e[3]));var l=f(e[4]||0)-r,u=f(e[5]||0)-o,c=f(e[6]||0),d=Math.round(1e3*parseFloat("0."+(e[7]||0)));return s.call(i,l,u,c,d),i}return t}var n=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,i,r){var a,s,l="",u=[];if(i=i||"mediumDate",i=t.DATETIME_FORMATS[i]||i,C(n)&&(n=Do.test(n)?f(n):e(n)),S(n)&&(n=new Date(n)),!k(n)||!isFinite(n.getTime()))return n;for(;i;)s=ko.exec(i),s?(u=Y(u,s,1),i=u.pop()):(u.push(i),i=null);var c=n.getTimezoneOffset();return r&&(c=K(r,c),n=Q(n,r,!0)),o(u,function(e){a=So[e],l+=a?a(n,t.DATETIME_FORMATS,c):"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),l}}function ri(){return function(t,e){return b(e)&&(e=2),q(t,e)}}function oi(){return function(t,e,n){return e=Math.abs(Number(e))===1/0?Number(e):f(e),isNaN(e)?t:(S(t)&&(t=t.toString()),zi(t)||C(t)?(n=!n||isNaN(n)?0:f(n),n=0>n?Math.max(0,t.length+n):n,e>=0?t.slice(n,n+e):0===n?t.slice(e,t.length):t.slice(Math.max(0,n+e),n)):t)}}function ai(t){function e(e,n){return n=n?-1:1,e.map(function(e){var i=1,r=g;if(D(e))r=e;else if(C(e)&&("+"!=e.charAt(0)&&"-"!=e.charAt(0)||(i="-"==e.charAt(0)?-1:1,e=e.substring(1)),""!==e&&(r=t(e),r.constant))){var o=r();r=function(t){return t[o]}}return{get:r,descending:i*n}})}function n(t){switch(typeof t){case"number":case"boolean":case"string":return!0;default:return!1}}function o(t,e){return"function"==typeof t.valueOf&&(t=t.valueOf(),n(t))?t:y(t)&&(t=t.toString(),n(t))?t:e}function a(t,e){var n=typeof t;return null===t?(n="string",t="null"):"string"===n?t=t.toLowerCase():"object"===n&&(t=o(t,e)),{value:t,type:n}}function s(t,e){var n=0;return t.type===e.type?t.value!==e.value&&(n=t.value<e.value?-1:1):n=t.type<e.type?-1:1,n}return function(t,n,o){function l(t,e){return{value:t,predicateValues:c.map(function(n){return a(n.get(t),e)})}}function u(t,e){for(var n=0,i=0,r=c.length;r>i&&!(n=s(t.predicateValues[i],e.predicateValues[i])*c[i].descending);++i);return n}if(null==t)return t;if(!r(t))throw i("orderBy")("notarray","Expected array but received: {0}",t);zi(n)||(n=[n]),0===n.length&&(n=["+"]);var c=e(n,o);c.push({get:function(){return{}},descending:o?-1:1});var d=Array.prototype.map.call(t,l);return d.sort(u),t=d.map(function(t){return t.value})}}function si(t){return D(t)&&(t={link:t}),t.restrict=t.restrict||"AC",v(t)}function li(t,e){t.$name=e}function ui(t,e,i,r,a){var s=this,l=[];s.$error={},s.$$success={},s.$pending=n,s.$name=a(e.name||e.ngForm||"")(i),s.$dirty=!1,s.$pristine=!0,s.$valid=!0,s.$invalid=!1,s.$submitted=!1,s.$$parentForm=Po,s.$rollbackViewValue=function(){o(l,function(t){t.$rollbackViewValue()})},s.$commitViewValue=function(){o(l,function(t){t.$commitViewValue()})},s.$addControl=function(t){pt(t.$name,"input"),l.push(t),t.$name&&(s[t.$name]=t),t.$$parentForm=s},s.$$renameControl=function(t,e){var n=t.$name;s[n]===t&&delete s[n],s[e]=t,t.$name=e},s.$removeControl=function(t){t.$name&&s[t.$name]===t&&delete s[t.$name],o(s.$pending,function(e,n){s.$setValidity(n,null,t)}),o(s.$error,function(e,n){s.$setValidity(n,null,t)}),o(s.$$success,function(e,n){s.$setValidity(n,null,t)}),V(l,t),t.$$parentForm=Po},Si({ctrl:this,$element:t,set:function(t,e,n){var i=t[e];if(i){var r=i.indexOf(n);-1===r&&i.push(n)}else t[e]=[n]},unset:function(t,e,n){var i=t[e];i&&(V(i,n),0===i.length&&delete t[e])},$animate:r}),s.$setDirty=function(){r.removeClass(t,fa),r.addClass(t,pa),s.$dirty=!0,s.$pristine=!1,s.$$parentForm.$setDirty()},s.$setPristine=function(){r.setClass(t,fa,pa+" "+Ao),s.$dirty=!1,s.$pristine=!0,s.$submitted=!1,o(l,function(t){t.$setPristine()})},s.$setUntouched=function(){o(l,function(t){t.$setUntouched()})},s.$setSubmitted=function(){r.addClass(t,Ao),s.$submitted=!0,s.$$parentForm.$setSubmitted()}}function ci(t){t.$formatters.push(function(e){return t.$isEmpty(e)?e:e.toString()})}function di(t,e,n,i,r,o){hi(t,e,n,i,r,o),ci(i)}function hi(t,e,n,i,r,o){var a=Ti(e[0].type);if(!r.android){var s=!1;e.on("compositionstart",function(t){s=!0}),e.on("compositionend",function(){s=!1,l()})}var l=function(t){if(u&&(o.defer.cancel(u),u=null),!s){var r=e.val(),l=t&&t.type;"password"===a||n.ngTrim&&"false"===n.ngTrim||(r=qi(r)),(i.$viewValue!==r||""===r&&i.$$hasNativeValidators)&&i.$setViewValue(r,l)}};if(r.hasEvent("input"))e.on("input",l);else{var u,c=function(t,e,n){u||(u=o.defer(function(){u=null,e&&e.value===n||l(t)}))};e.on("keydown",function(t){var e=t.keyCode;91===e||e>15&&19>e||e>=37&&40>=e||c(t,this,this.value)}),r.hasEvent("paste")&&e.on("paste cut",c)}e.on("change",l),i.$render=function(){var t=i.$isEmpty(i.$viewValue)?"":i.$viewValue;e.val()!==t&&e.val(t)}}function fi(t,e){if(k(t))return t;if(C(t)){Bo.lastIndex=0;var n=Bo.exec(t);if(n){var i=+n[1],r=+n[2],o=0,a=0,s=0,l=0,u=Zn(i),c=7*(r-1);return e&&(o=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),l=e.getMilliseconds()),new Date(i,0,u.getDate()+c,o,a,s,l)}}return NaN}function pi(t,e){return function(n,i){var r,a;if(k(n))return n;if(C(n)){if('"'==n.charAt(0)&&'"'==n.charAt(n.length-1)&&(n=n.substring(1,n.length-1)),Io.test(n))return new Date(n);if(t.lastIndex=0,r=t.exec(n))return r.shift(),a=i?{yyyy:i.getFullYear(),MM:i.getMonth()+1,dd:i.getDate(),HH:i.getHours(),mm:i.getMinutes(),ss:i.getSeconds(),sss:i.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},o(r,function(t,n){n<e.length&&(a[e[n]]=+t)}),new Date(a.yyyy,a.MM-1,a.dd,a.HH,a.mm,a.ss||0,1e3*a.sss||0)}return NaN}}function mi(t,e,i,r){return function(o,a,s,l,u,c,d){function h(t){return t&&!(t.getTime&&t.getTime()!==t.getTime())}function f(t){return $(t)&&!k(t)?i(t)||n:t}gi(o,a,s,l),hi(o,a,s,l,u,c);var p,m=l&&l.$options&&l.$options.timezone;if(l.$$parserName=t,l.$parsers.push(function(t){if(l.$isEmpty(t))return null;if(e.test(t)){var r=i(t,p);return m&&(r=Q(r,m)),r}return n}),l.$formatters.push(function(t){if(t&&!k(t))throw $a("datefmt","Expected `{0}` to be a date",t);return h(t)?(p=t,p&&m&&(p=Q(p,m,!0)),d("date")(t,r,m)):(p=null,"")}),$(s.min)||s.ngMin){var g;l.$validators.min=function(t){return!h(t)||b(g)||i(t)>=g},s.$observe("min",function(t){g=f(t),l.$validate()})}if($(s.max)||s.ngMax){var v;l.$validators.max=function(t){return!h(t)||b(v)||i(t)<=v},s.$observe("max",function(t){v=f(t),l.$validate()})}}}function gi(t,e,i,r){var o=e[0],a=r.$$hasNativeValidators=w(o.validity);a&&r.$parsers.push(function(t){var i=e.prop(_i)||{};return i.badInput||i.typeMismatch?n:t})}function vi(t,e,i,r,o,a){if(gi(t,e,i,r),hi(t,e,i,r,o,a),r.$$parserName="number",r.$parsers.push(function(t){return r.$isEmpty(t)?null:Lo.test(t)?parseFloat(t):n}),r.$formatters.push(function(t){if(!r.$isEmpty(t)){if(!S(t))throw $a("numfmt","Expected `{0}` to be a number",t);t=t.toString()}return t}),$(i.min)||i.ngMin){var s;r.$validators.min=function(t){return r.$isEmpty(t)||b(s)||t>=s},i.$observe("min",function(t){$(t)&&!S(t)&&(t=parseFloat(t,10)),s=S(t)&&!isNaN(t)?t:n,r.$validate()})}if($(i.max)||i.ngMax){var l;r.$validators.max=function(t){return r.$isEmpty(t)||b(l)||l>=t},i.$observe("max",function(t){$(t)&&!S(t)&&(t=parseFloat(t,10)),l=S(t)&&!isNaN(t)?t:n,r.$validate()})}}function yi(t,e,n,i,r,o){hi(t,e,n,i,r,o),ci(i),i.$$parserName="url",i.$validators.url=function(t,e){var n=t||e;return i.$isEmpty(n)||No.test(n)}}function bi(t,e,n,i,r,o){hi(t,e,n,i,r,o),ci(i),i.$$parserName="email",i.$validators.email=function(t,e){var n=t||e;return i.$isEmpty(n)||Ro.test(n)}}function $i(t,e,n,i){b(n.name)&&e.attr("name",l());var r=function(t){e[0].checked&&i.$setViewValue(n.value,t&&t.type)};e.on("click",r),i.$render=function(){var t=n.value;e[0].checked=t==i.$viewValue},n.$observe("value",i.$render)}function wi(t,e,n,i,r){var o;if($(i)){if(o=t(i),!o.constant)throw $a("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,i);return o(e)}return r}function xi(t,e,n,i,r,o,a,s){var l=wi(s,t,"ngTrueValue",n.ngTrueValue,!0),u=wi(s,t,"ngFalseValue",n.ngFalseValue,!1),c=function(t){i.$setViewValue(e[0].checked,t&&t.type)};e.on("click",c),i.$render=function(){e[0].checked=i.$viewValue},i.$isEmpty=function(t){return t===!1},i.$formatters.push(function(t){return U(t,l)}),i.$parsers.push(function(t){return t?l:u})}function Ci(t,e){return t="ngClass"+t,["$animate",function(n){function i(t,e){var n=[];t:for(var i=0;i<t.length;i++){for(var r=t[i],o=0;o<e.length;o++)if(r==e[o])continue t;n.push(r)}return n}function r(t){var e=[];return zi(t)?(o(t,function(t){e=e.concat(r(t))}),e):C(t)?t.split(" "):w(t)?(o(t,function(t,n){t&&(e=e.concat(n.split(" ")))}),e):t}return{restrict:"AC",link:function(a,s,l){function u(t){var e=d(t,1);l.$addClass(e)}function c(t){var e=d(t,-1);l.$removeClass(e)}function d(t,e){var n=s.data("$classCounts")||vt(),i=[];return o(t,function(t){(e>0||n[t])&&(n[t]=(n[t]||0)+e,n[t]===+(e>0)&&i.push(t))}),s.data("$classCounts",n),i.join(" ")}function h(t,e){var r=i(e,t),o=i(t,e);r=d(r,1),o=d(o,-1),r&&r.length&&n.addClass(s,r),o&&o.length&&n.removeClass(s,o)}function f(t){if(e===!0||a.$index%2===e){var n=r(t||[]);if(p){if(!U(t,p)){var i=r(p);h(i,n)}}else u(n)}p=B(t)}var p;a.$watch(l[t],f,!0),l.$observe("class",function(e){f(a.$eval(l[t]))}),"ngClass"!==t&&a.$watch("$index",function(n,i){var o=1&n;if(o!==(1&i)){var s=r(a.$eval(l[t]));o===e?u(s):c(s)}})}}}]}function Si(t){function e(t,e,l){b(e)?i("$pending",t,l):r("$pending",t,l),j(e)?e?(d(s.$error,t,l),c(s.$$success,t,l)):(c(s.$error,t,l),d(s.$$success,t,l)):(d(s.$error,t,l),d(s.$$success,t,l)),s.$pending?(o(va,!0),s.$valid=s.$invalid=n,a("",null)):(o(va,!1),s.$valid=ki(s.$error),
s.$invalid=!s.$valid,a("",s.$valid));var u;u=s.$pending&&s.$pending[t]?n:s.$error[t]?!1:s.$$success[t]?!0:null,a(t,u),s.$$parentForm.$setValidity(t,u,s)}function i(t,e,n){s[t]||(s[t]={}),c(s[t],e,n)}function r(t,e,i){s[t]&&d(s[t],e,i),ki(s[t])&&(s[t]=n)}function o(t,e){e&&!u[t]?(h.addClass(l,t),u[t]=!0):!e&&u[t]&&(h.removeClass(l,t),u[t]=!1)}function a(t,e){t=t?"-"+ct(t,"-"):"",o(da+t,e===!0),o(ha+t,e===!1)}var s=t.ctrl,l=t.$element,u={},c=t.set,d=t.unset,h=t.$animate;u[ha]=!(u[da]=l.hasClass(da)),s.$setValidity=e}function ki(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function Di(t){t[0].hasAttribute("selected")&&(t[0].selected=!0)}var Ei=/^\/(.+)\/([a-z]*)$/,_i="validity",Mi=Object.prototype.hasOwnProperty,Ti=function(t){return C(t)?t.toLowerCase():t},Pi=function(t){return C(t)?t.toUpperCase():t},Ai=function(t){return C(t)?t.replace(/[A-Z]/g,function(t){return String.fromCharCode(32|t.charCodeAt(0))}):t},ji=function(t){return C(t)?t.replace(/[a-z]/g,function(t){return String.fromCharCode(-33&t.charCodeAt(0))}):t};"i"!=="I".toLowerCase()&&(Ti=Ai,Pi=ji);var Oi,Fi,Ii,Ni,Ri=[].slice,Li=[].splice,Vi=[].push,Hi=Object.prototype.toString,Bi=Object.getPrototypeOf,Ui=i("ng"),Yi=t.angular||(t.angular={}),Wi=0;Oi=e.documentMode,m.$inject=[],g.$inject=[];var zi=Array.isArray,Gi=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/,qi=function(t){return C(t)?t.trim():t},Xi=function(t){return t.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Ki=function(){function t(){try{return new Function(""),!1}catch(t){return!0}}if(!$(Ki.rules)){var n=e.querySelector("[ng-csp]")||e.querySelector("[data-ng-csp]");if(n){var i=n.getAttribute("ng-csp")||n.getAttribute("data-ng-csp");Ki.rules={noUnsafeEval:!i||-1!==i.indexOf("no-unsafe-eval"),noInlineStyle:!i||-1!==i.indexOf("no-inline-style")}}else Ki.rules={noUnsafeEval:t(),noInlineStyle:!1}}return Ki.rules},Zi=function(){if($(Zi.name_))return Zi.name_;var t,n,i,r,o=Ji.length;for(n=0;o>n;++n)if(i=Ji[n],t=e.querySelector("["+i.replace(":","\\:")+"jq]")){r=t.getAttribute(i+"jq");break}return Zi.name_=r},Qi=/:/g,Ji=["ng-","data-ng-","ng:","x-ng-"],tr=/[A-Z]/g,er=!1,nr=1,ir=2,rr=3,or=8,ar=9,sr=11,lr={full:"1.5.0",major:1,minor:5,dot:0,codeName:"ennoblement-facilitation"};Pt.expando="ng339";var ur=Pt.cache={},cr=1,dr=function(t,e,n){t.addEventListener(e,n,!1)},hr=function(t,e,n){t.removeEventListener(e,n,!1)};Pt._data=function(t){return this.cache[t[this.expando]]||{}};var fr=/([\:\-\_]+(.))/g,pr=/^moz([A-Z])/,mr={mouseleave:"mouseout",mouseenter:"mouseover"},gr=i("jqLite"),vr=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,yr=/<|&#?\w+;/,br=/<([\w:-]+)/,$r=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wr={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wr.optgroup=wr.option,wr.tbody=wr.tfoot=wr.colgroup=wr.caption=wr.thead,wr.th=wr.td;var xr=Node.prototype.contains||function(t){return!!(16&this.compareDocumentPosition(t))},Cr=Pt.prototype={ready:function(n){function i(){r||(r=!0,n())}var r=!1;"complete"===e.readyState?setTimeout(i):(this.on("DOMContentLoaded",i),Pt(t).on("load",i))},toString:function(){var t=[];return o(this,function(e){t.push(""+e)}),"["+t.join(", ")+"]"},eq:function(t){return Fi(t>=0?this[t]:this[this.length+t])},length:0,push:Vi,sort:[].sort,splice:[].splice},Sr={};o("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(t){Sr[Ti(t)]=t});var kr={};o("input,select,option,textarea,button,form,details".split(","),function(t){kr[t]=!0});var Dr={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};o({data:Nt,removeData:Ft,hasData:Dt,cleanData:Et},function(t,e){Pt[e]=t}),o({data:Nt,inheritedData:Ut,scope:function(t){return Fi.data(t,"$scope")||Ut(t.parentNode||t,["$isolateScope","$scope"])},isolateScope:function(t){return Fi.data(t,"$isolateScope")||Fi.data(t,"$isolateScopeNoTemplate")},controller:Bt,injector:function(t){return Ut(t,"$injector")},removeAttr:function(t,e){t.removeAttribute(e)},hasClass:Rt,css:function(t,e,n){return e=Ct(e),$(n)?void(t.style[e]=n):t.style[e]},attr:function(t,e,i){var r=t.nodeType;if(r!==rr&&r!==ir&&r!==or){var o=Ti(e);if(Sr[o]){if(!$(i))return t[e]||(t.attributes.getNamedItem(e)||m).specified?o:n;i?(t[e]=!0,t.setAttribute(e,o)):(t[e]=!1,t.removeAttribute(o))}else if($(i))t.setAttribute(e,i);else if(t.getAttribute){var a=t.getAttribute(e,2);return null===a?n:a}}},prop:function(t,e,n){return $(n)?void(t[e]=n):t[e]},text:function(){function t(t,e){if(b(e)){var n=t.nodeType;return n===nr||n===rr?t.textContent:""}t.textContent=e}return t.$dv="",t}(),val:function(t,e){if(b(e)){if(t.multiple&&"select"===L(t)){var n=[];return o(t.options,function(t){t.selected&&n.push(t.value||t.text)}),0===n.length?null:n}return t.value}t.value=e},html:function(t,e){return b(e)?t.innerHTML:(jt(t,!0),void(t.innerHTML=e))},empty:Yt},function(t,e){Pt.prototype[e]=function(e,n){var i,r,o=this.length;if(t!==Yt&&b(2==t.length&&t!==Rt&&t!==Bt?e:n)){if(w(e)){for(i=0;o>i;i++)if(t===Nt)t(this[i],e);else for(r in e)t(this[i],r,e[r]);return this}for(var a=t.$dv,s=b(a)?Math.min(o,1):o,l=0;s>l;l++){var u=t(this[l],e,n);a=a?a+u:u}return a}for(i=0;o>i;i++)t(this[i],e,n);return this}}),o({removeData:Ft,on:function(t,e,i,r){if($(r))throw gr("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(kt(t)){var o=It(t,!0),a=o.events,s=o.handle;s||(s=o.handle=Xt(t,a));for(var l=e.indexOf(" ")>=0?e.split(" "):[e],u=l.length,c=function(e,n,r){var o=a[e];o||(o=a[e]=[],o.specialHandlerWrapper=n,"$destroy"===e||r||dr(t,e,s)),o.push(i)};u--;)e=l[u],mr[e]?(c(mr[e],Zt),c(e,n,!0)):c(e)}},off:Ot,one:function(t,e,n){t=Fi(t),t.on(e,function i(){t.off(e,n),t.off(e,i)}),t.on(e,n)},replaceWith:function(t,e){var n,i=t.parentNode;jt(t),o(new Pt(e),function(e){n?i.insertBefore(e,n.nextSibling):i.replaceChild(e,t),n=e})},children:function(t){var e=[];return o(t.childNodes,function(t){t.nodeType===nr&&e.push(t)}),e},contents:function(t){return t.contentDocument||t.childNodes||[]},append:function(t,e){var n=t.nodeType;if(n===nr||n===sr){e=new Pt(e);for(var i=0,r=e.length;r>i;i++){var o=e[i];t.appendChild(o)}}},prepend:function(t,e){if(t.nodeType===nr){var n=t.firstChild;o(new Pt(e),function(e){t.insertBefore(e,n)})}},wrap:function(t,e){Tt(t,Fi(e).eq(0).clone()[0])},remove:Wt,detach:function(t){Wt(t,!0)},after:function(t,e){var n=t,i=t.parentNode;e=new Pt(e);for(var r=0,o=e.length;o>r;r++){var a=e[r];i.insertBefore(a,n.nextSibling),n=a}},addClass:Vt,removeClass:Lt,toggleClass:function(t,e,n){e&&o(e.split(" "),function(e){var i=n;b(i)&&(i=!Rt(t,e)),(i?Vt:Lt)(t,e)})},parent:function(t){var e=t.parentNode;return e&&e.nodeType!==sr?e:null},next:function(t){return t.nextElementSibling},find:function(t,e){return t.getElementsByTagName?t.getElementsByTagName(e):[]},clone:At,triggerHandler:function(t,e,n){var i,r,a,s=e.type||e,l=It(t),u=l&&l.events,c=u&&u[s];c&&(i={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented===!0},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return this.immediatePropagationStopped===!0},stopPropagation:m,type:s,target:t},e.type&&(i=d(i,e)),r=B(c),a=n?[i].concat(n):[i],o(r,function(e){i.isImmediatePropagationStopped()||e.apply(t,a)}))}},function(t,e){Pt.prototype[e]=function(e,n,i){for(var r,o=0,a=this.length;a>o;o++)b(r)?(r=t(this[o],e,n,i),$(r)&&(r=Fi(r))):Ht(r,t(this[o],e,n,i));return $(r)?r:this},Pt.prototype.bind=Pt.prototype.on,Pt.prototype.unbind=Pt.prototype.off}),te.prototype={put:function(t,e){this[Jt(t,this.nextUid)]=e},get:function(t){return this[Jt(t,this.nextUid)]},remove:function(t){var e=this[t=Jt(t,this.nextUid)];return delete this[t],e}};var Er=[function(){this.$get=[function(){return te}]}],_r=/^([^\(]+?)=>/,Mr=/^[^\(]*\(\s*([^\)]*)\)/m,Tr=/,/,Pr=/^\s*(_?)(\S+?)\1\s*$/,Ar=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,jr=i("$injector");re.$$annotate=ie;var Or=i("$animate"),Fr=1,Ir="ng-animate",Nr=function(){this.$get=function(){}},Rr=function(){var t=new te,e=[];this.$get=["$$AnimateRunner","$rootScope",function(n,i){function r(t,e,n){var i=!1;return e&&(e=C(e)?e.split(" "):zi(e)?e:[],o(e,function(e){e&&(i=!0,t[e]=n)})),i}function a(){o(e,function(e){var n=t.get(e);if(n){var i=le(e.attr("class")),r="",a="";o(n,function(t,e){var n=!!i[e];t!==n&&(t?r+=(r.length?" ":"")+e:a+=(a.length?" ":"")+e)}),o(e,function(t){r&&Vt(t,r),a&&Lt(t,a)}),t.remove(e)}}),e.length=0}function s(n,o,s){var l=t.get(n)||{},u=r(l,o,!0),c=r(l,s,!1);(u||c)&&(t.put(n,l),e.push(n),1===e.length&&i.$$postDigest(a))}return{enabled:m,on:m,off:m,pin:m,push:function(t,e,i,r){r&&r(),i=i||{},i.from&&t.css(i.from),i.to&&t.css(i.to),(i.addClass||i.removeClass)&&s(t,i.addClass,i.removeClass);var o=new n;return o.complete(),o}}}]},Lr=["$provide",function(t){var e=this;this.$$registeredAnimations=Object.create(null),this.register=function(n,i){if(n&&"."!==n.charAt(0))throw Or("notcsel","Expecting class selector starting with '.' got '{0}'.",n);var r=n+"-animation";e.$$registeredAnimations[n.substr(1)]=r,t.factory(r,i)},this.classNameFilter=function(t){if(1===arguments.length&&(this.$$classNameFilter=t instanceof RegExp?t:null,this.$$classNameFilter)){var e=new RegExp("(\\s+|\\/)"+Ir+"(\\s+|\\/)");if(e.test(this.$$classNameFilter.toString()))throw Or("nongcls",'$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.',Ir)}return this.$$classNameFilter},this.$get=["$$animateQueue",function(t){function e(t,e,n){if(n){var i=se(n);!i||i.parentNode||i.previousElementSibling||(n=null)}n?n.after(t):e.prepend(t)}return{on:t.on,off:t.off,pin:t.pin,enabled:t.enabled,cancel:function(t){t.end&&t.end()},enter:function(n,i,r,o){return i=i&&Fi(i),r=r&&Fi(r),i=i||r.parent(),e(n,i,r),t.push(n,"enter",ue(o))},move:function(n,i,r,o){return i=i&&Fi(i),r=r&&Fi(r),i=i||r.parent(),e(n,i,r),t.push(n,"move",ue(o))},leave:function(e,n){return t.push(e,"leave",ue(n),function(){e.remove()})},addClass:function(e,n,i){return i=ue(i),i.addClass=ae(i.addclass,n),t.push(e,"addClass",i)},removeClass:function(e,n,i){return i=ue(i),i.removeClass=ae(i.removeClass,n),t.push(e,"removeClass",i)},setClass:function(e,n,i,r){return r=ue(r),r.addClass=ae(r.addClass,n),r.removeClass=ae(r.removeClass,i),t.push(e,"setClass",r)},animate:function(e,n,i,r,o){return o=ue(o),o.from=o.from?d(o.from,n):n,o.to=o.to?d(o.to,i):i,r=r||"ng-inline-animate",o.tempClasses=ae(o.tempClasses,r),t.push(e,"animate",o)}}}]}],Vr=function(){this.$get=["$$rAF",function(t){function e(e){n.push(e),n.length>1||t(function(){for(var t=0;t<n.length;t++)n[t]();n=[]})}var n=[];return function(){var t=!1;return e(function(){t=!0}),function(n){t?n():e(n)}}}]},Hr=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$document","$timeout",function(t,e,n,i,r){function a(t){this.setHost(t);var e=n(),o=function(t){r(t,0,!1)};this._doneCallbacks=[],this._tick=function(t){var n=i[0];n&&n.hidden?o(t):e(t)},this._state=0}var s=0,l=1,u=2;return a.chain=function(t,e){function n(){return i===t.length?void e(!0):void t[i](function(t){return t===!1?void e(!1):(i++,void n())})}var i=0;n()},a.all=function(t,e){function n(n){r=r&&n,++i===t.length&&e(r)}var i=0,r=!0;o(t,function(t){t.done(n)})},a.prototype={setHost:function(t){this.host=t||{}},done:function(t){this._state===u?t():this._doneCallbacks.push(t)},progress:m,getPromise:function(){if(!this.promise){var e=this;this.promise=t(function(t,n){e.done(function(e){e===!1?n():t()})})}return this.promise},then:function(t,e){return this.getPromise().then(t,e)},"catch":function(t){return this.getPromise()["catch"](t)},"finally":function(t){return this.getPromise()["finally"](t)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end(),this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel(),this._resolve(!1)},complete:function(t){var e=this;e._state===s&&(e._state=l,e._tick(function(){e._resolve(t)}))},_resolve:function(t){this._state!==u&&(o(this._doneCallbacks,function(e){e(t)}),this._doneCallbacks.length=0,this._state=u)}},a}]},Br=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(t,e,n){return function(e,i){function r(){return t(function(){o(),s||l.complete(),s=!0}),l}function o(){a.addClass&&(e.addClass(a.addClass),a.addClass=null),a.removeClass&&(e.removeClass(a.removeClass),a.removeClass=null),a.to&&(e.css(a.to),a.to=null)}var a=i||{};a.$$prepared||(a=H(a)),a.cleanupStyles&&(a.from=a.to=null),a.from&&(e.css(a.from),a.from=null);var s,l=new n;return{start:r,end:r}}}]},Ur=i("$compile");pe.$inject=["$provide","$$sanitizeUriProvider"];var Yr=/^((?:x|data)[\:\-_])/i,Wr=i("$controller"),zr=/^(\S+)(\s+as\s+([\w$]+))?$/,Gr=function(){this.$get=["$document",function(t){return function(e){return e?!e.nodeType&&e instanceof Fi&&(e=e[0]):e=t[0].body,e.offsetWidth+1}}]},qr="application/json",Xr={"Content-Type":qr+";charset=utf-8"},Kr=/^\[|^\{(?!\{)/,Zr={"[":/]$/,"{":/}$/},Qr=/^\)\]\}',?\n/,Jr=i("$http"),to=function(t){return function(){throw Jr("legacy","The method `{0}` on the promise returned from `$http` has been disabled.",t)}},eo=Yi.$interpolateMinErr=i("$interpolate");eo.throwNoconcat=function(t){throw eo("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required.  See http://docs.angularjs.org/api/ng.$sce",t)},eo.interr=function(t,e){return eo("interr","Can't interpolate: {0}\n{1}",t,e.toString())};var no=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,io={http:80,https:443,ftp:21},ro=i("$location"),oo={$$html5:!1,$$replace:!1,absUrl:qe("$$absUrl"),url:function(t){if(b(t))return this.$$url;var e=no.exec(t);return(e[1]||""===t)&&this.path(decodeURIComponent(e[1])),(e[2]||e[1]||""===t)&&this.search(e[3]||""),this.hash(e[5]||""),this},protocol:qe("$$protocol"),host:qe("$$host"),port:qe("$$port"),path:Xe("$$path",function(t){return t=null!==t?t.toString():"","/"==t.charAt(0)?t:"/"+t}),search:function(t,e){switch(arguments.length){case 0:return this.$$search;case 1:if(C(t)||S(t))t=t.toString(),this.$$search=et(t);else{if(!w(t))throw ro("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");t=H(t,{}),o(t,function(e,n){null==e&&delete t[n]}),this.$$search=t}break;default:b(e)||null===e?delete this.$$search[t]:this.$$search[t]=e}return this.$$compose(),this},hash:Xe("$$hash",function(t){return null!==t?t.toString():""}),replace:function(){return this.$$replace=!0,this}};o([Ge,ze,We],function(t){t.prototype=Object.create(oo),t.prototype.state=function(e){if(!arguments.length)return this.$$state;if(t!==We||!this.$$html5)throw ro("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=b(e)?null:e,this}});var ao=i("$parse"),so=Function.prototype.call,lo=Function.prototype.apply,uo=Function.prototype.bind,co=vt();o("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(t){co[t]=!0});var ho={n:"\n",f:"\f",r:"\r",t:"	",v:"\x0B","'":"'",'"':'"'},fo=function(t){this.options=t};fo.prototype={constructor:fo,lex:function(t){for(this.text=t,this.index=0,this.tokens=[];this.index<this.text.length;){var e=this.text.charAt(this.index);if('"'===e||"'"===e)this.readString(e);else if(this.isNumber(e)||"."===e&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(e))this.readIdent();else if(this.is(e,"(){}[].,;:?"))this.tokens.push({index:this.index,text:e}),this.index++;else if(this.isWhitespace(e))this.index++;else{var n=e+this.peek(),i=n+this.peek(2),r=co[e],o=co[n],a=co[i];if(r||o||a){var s=a?i:o?n:e;this.tokens.push({index:this.index,text:s,operator:!0}),this.index+=s.length}else this.throwError("Unexpected next character ",this.index,this.index+1)}}return this.tokens},is:function(t,e){return-1!==e.indexOf(t)},peek:function(t){var e=t||1;return this.index+e<this.text.length?this.text.charAt(this.index+e):!1},isNumber:function(t){return t>="0"&&"9">=t&&"string"==typeof t},isWhitespace:function(t){return" "===t||"\r"===t||"	"===t||"\n"===t||"\x0B"===t||" "===t},isIdent:function(t){return t>="a"&&"z">=t||t>="A"&&"Z">=t||"_"===t||"$"===t},isExpOperator:function(t){return"-"===t||"+"===t||this.isNumber(t)},throwError:function(t,e,n){n=n||this.index;var i=$(e)?"s "+e+"-"+this.index+" ["+this.text.substring(e,n)+"]":" "+n;throw ao("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",t,i,this.text)},readNumber:function(){for(var t="",e=this.index;this.index<this.text.length;){var n=Ti(this.text.charAt(this.index));if("."==n||this.isNumber(n))t+=n;else{var i=this.peek();if("e"==n&&this.isExpOperator(i))t+=n;else if(this.isExpOperator(n)&&i&&this.isNumber(i)&&"e"==t.charAt(t.length-1))t+=n;else{if(!this.isExpOperator(n)||i&&this.isNumber(i)||"e"!=t.charAt(t.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:e,text:t,constant:!0,value:Number(t)})},readIdent:function(){for(var t=this.index;this.index<this.text.length;){var e=this.text.charAt(this.index);if(!this.isIdent(e)&&!this.isNumber(e))break;this.index++}this.tokens.push({index:t,text:this.text.slice(t,this.index),identifier:!0})},readString:function(t){var e=this.index;this.index++;for(var n="",i=t,r=!1;this.index<this.text.length;){var o=this.text.charAt(this.index);if(i+=o,r){if("u"===o){var a=this.text.substring(this.index+1,this.index+5);a.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+a+"]"),this.index+=4,n+=String.fromCharCode(parseInt(a,16))}else{var s=ho[o];n+=s||o}r=!1}else if("\\"===o)r=!0;else{if(o===t)return this.index++,void this.tokens.push({index:e,text:i,constant:!0,value:n});n+=o}this.index++}this.throwError("Unterminated quote",e)}};var po=function(t,e){this.lexer=t,this.options=e};po.Program="Program",po.ExpressionStatement="ExpressionStatement",po.AssignmentExpression="AssignmentExpression",po.ConditionalExpression="ConditionalExpression",po.LogicalExpression="LogicalExpression",po.BinaryExpression="BinaryExpression",po.UnaryExpression="UnaryExpression",po.CallExpression="CallExpression",po.MemberExpression="MemberExpression",po.Identifier="Identifier",po.Literal="Literal",po.ArrayExpression="ArrayExpression",po.Property="Property",po.ObjectExpression="ObjectExpression",po.ThisExpression="ThisExpression",po.LocalsExpression="LocalsExpression",po.NGValueParameter="NGValueParameter",po.prototype={ast:function(t){this.text=t,this.tokens=this.lexer.lex(t);var e=this.program();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),e},program:function(){for(var t=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&t.push(this.expressionStatement()),!this.expect(";"))return{type:po.Program,body:t}},expressionStatement:function(){return{type:po.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var t,e=this.expression();t=this.expect("|");)e=this.filter(e);return e},expression:function(){return this.assignment()},assignment:function(){var t=this.ternary();return this.expect("=")&&(t={type:po.AssignmentExpression,left:t,right:this.assignment(),operator:"="}),t},ternary:function(){var t,e,n=this.logicalOR();return this.expect("?")&&(t=this.expression(),this.consume(":"))?(e=this.expression(),{type:po.ConditionalExpression,test:n,alternate:t,consequent:e}):n},logicalOR:function(){for(var t=this.logicalAND();this.expect("||");)t={type:po.LogicalExpression,operator:"||",left:t,right:this.logicalAND()};return t},logicalAND:function(){for(var t=this.equality();this.expect("&&");)t={type:po.LogicalExpression,operator:"&&",left:t,right:this.equality()};return t},equality:function(){for(var t,e=this.relational();t=this.expect("==","!=","===","!==");)e={type:po.BinaryExpression,operator:t.text,left:e,right:this.relational()};return e},relational:function(){for(var t,e=this.additive();t=this.expect("<",">","<=",">=");)e={type:po.BinaryExpression,operator:t.text,left:e,right:this.additive()};return e},additive:function(){for(var t,e=this.multiplicative();t=this.expect("+","-");)e={type:po.BinaryExpression,operator:t.text,left:e,right:this.multiplicative()};return e},multiplicative:function(){for(var t,e=this.unary();t=this.expect("*","/","%");)e={type:po.BinaryExpression,operator:t.text,left:e,right:this.unary()};return e},unary:function(){var t;return(t=this.expect("+","-","!"))?{type:po.UnaryExpression,operator:t.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var t;this.expect("(")?(t=this.filterChain(),this.consume(")")):this.expect("[")?t=this.arrayDeclaration():this.expect("{")?t=this.object():this.constants.hasOwnProperty(this.peek().text)?t=H(this.constants[this.consume().text]):this.peek().identifier?t=this.identifier():this.peek().constant?t=this.constant():this.throwError("not a primary expression",this.peek());for(var e;e=this.expect("(","[",".");)"("===e.text?(t={type:po.CallExpression,callee:t,arguments:this.parseArguments()},this.consume(")")):"["===e.text?(t={type:po.MemberExpression,object:t,property:this.expression(),computed:!0},this.consume("]")):"."===e.text?t={type:po.MemberExpression,object:t,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return t},filter:function(t){for(var e=[t],n={type:po.CallExpression,callee:this.identifier(),arguments:e,filter:!0};this.expect(":");)e.push(this.expression());return n},parseArguments:function(){var t=[];if(")"!==this.peekToken().text)do t.push(this.expression());while(this.expect(","));return t},identifier:function(){var t=this.consume();return t.identifier||this.throwError("is not a valid identifier",t),{type:po.Identifier,name:t.text}},constant:function(){return{type:po.Literal,value:this.consume().value}},arrayDeclaration:function(){var t=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;t.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:po.ArrayExpression,elements:t}},object:function(){var t,e=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;t={type:po.Property,kind:"init"},this.peek().constant?t.key=this.constant():this.peek().identifier?t.key=this.identifier():this.throwError("invalid key",this.peek()),this.consume(":"),t.value=this.expression(),e.push(t)}while(this.expect(","));return this.consume("}"),{type:po.ObjectExpression,properties:e}},throwError:function(t,e){throw ao("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",e.text,t,e.index+1,this.text,this.text.substring(e.index))},consume:function(t){if(0===this.tokens.length)throw ao("ueoe","Unexpected end of expression: {0}",this.text);var e=this.expect(t);return e||this.throwError("is unexpected, expecting ["+t+"]",this.peek()),e},peekToken:function(){if(0===this.tokens.length)throw ao("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(t,e,n,i){return this.peekAhead(0,t,e,n,i)},peekAhead:function(t,e,n,i,r){if(this.tokens.length>t){var o=this.tokens[t],a=o.text;if(a===e||a===n||a===i||a===r||!e&&!n&&!i&&!r)return o}return!1},expect:function(t,e,n,i){var r=this.peek(t,e,n,i);return r?(this.tokens.shift(),r):!1},constants:{"true":{type:po.Literal,value:!0},"false":{type:po.Literal,value:!1},"null":{type:po.Literal,value:null},undefined:{type:po.Literal,value:n},"this":{type:po.ThisExpression},$locals:{type:po.LocalsExpression}}},fn.prototype={compile:function(t,e){var i=this,r=this.astBuilder.ast(t);this.state={nextId:0,filters:{},expensiveChecks:e,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},sn(r,i.$filter);var a,s="";if(this.stage="assign",a=cn(r)){this.state.computing="assign";var l=this.nextId();this.recurse(a,l),this.return_(l),s="fn.assign="+this.generateFunction("assign","s,v,l")}var u=ln(r.body);i.stage="inputs",o(u,function(t,e){var n="fn"+e;i.state[n]={vars:[],body:[],own:{}},i.state.computing=n;var r=i.nextId();i.recurse(t,r),i.return_(r),i.state.inputs.push(n),t.watchId=e}),this.state.computing="fn",this.stage="main",this.recurse(r);var c='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+s+this.watchFns()+"return fn;",d=new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext","ifDefined","plus","text",c)(this.$filter,Qe,tn,en,Je,nn,rn,on,t);return this.state=this.stage=n,d.literal=dn(r),d.constant=hn(r),d},USE:"use",STRICT:"strict",watchFns:function(){var t=[],e=this.state.inputs,n=this;return o(e,function(e){t.push("var "+e+"="+n.generateFunction(e,"s"))}),e.length&&t.push("fn.inputs=["+e.join(",")+"];"),t.join("")},generateFunction:function(t,e){return"function("+e+"){"+this.varsPrefix(t)+this.body(t)+"};"},filterPrefix:function(){var t=[],e=this;return o(this.state.filters,function(n,i){t.push(n+"=$filter("+e.escape(i)+")")}),t.length?"var "+t.join(",")+";":""},varsPrefix:function(t){return this.state[t].vars.length?"var "+this.state[t].vars.join(",")+";":""},body:function(t){return this.state[t].body.join("")},recurse:function(t,e,i,r,a,s){var l,u,c,d,h=this;if(r=r||m,!s&&$(t.watchId))return e=e||this.nextId(),void this.if_("i",this.lazyAssign(e,this.computedMember("i",t.watchId)),this.lazyRecurse(t,e,i,r,a,!0));switch(t.type){case po.Program:o(t.body,function(e,i){h.recurse(e.expression,n,n,function(t){u=t}),i!==t.body.length-1?h.current().body.push(u,";"):h.return_(u)});break;case po.Literal:d=this.escape(t.value),this.assign(e,d),r(d);break;case po.UnaryExpression:this.recurse(t.argument,n,n,function(t){u=t}),d=t.operator+"("+this.ifDefined(u,0)+")",this.assign(e,d),r(d);break;case po.BinaryExpression:this.recurse(t.left,n,n,function(t){l=t}),this.recurse(t.right,n,n,function(t){u=t}),d="+"===t.operator?this.plus(l,u):"-"===t.operator?this.ifDefined(l,0)+t.operator+this.ifDefined(u,0):"("+l+")"+t.operator+"("+u+")",this.assign(e,d),r(d);break;case po.LogicalExpression:e=e||this.nextId(),h.recurse(t.left,e),h.if_("&&"===t.operator?e:h.not(e),h.lazyRecurse(t.right,e)),r(e);break;case po.ConditionalExpression:e=e||this.nextId(),h.recurse(t.test,e),h.if_(e,h.lazyRecurse(t.alternate,e),h.lazyRecurse(t.consequent,e)),r(e);break;case po.Identifier:e=e||this.nextId(),i&&(i.context="inputs"===h.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",t.name)+"?l:s"),i.computed=!1,i.name=t.name),Qe(t.name),h.if_("inputs"===h.stage||h.not(h.getHasOwnProperty("l",t.name)),function(){h.if_("inputs"===h.stage||"s",function(){a&&1!==a&&h.if_(h.not(h.nonComputedMember("s",t.name)),h.lazyAssign(h.nonComputedMember("s",t.name),"{}")),h.assign(e,h.nonComputedMember("s",t.name))})},e&&h.lazyAssign(e,h.nonComputedMember("l",t.name))),(h.state.expensiveChecks||mn(t.name))&&h.addEnsureSafeObject(e),r(e);break;case po.MemberExpression:l=i&&(i.context=this.nextId())||this.nextId(),e=e||this.nextId(),h.recurse(t.object,l,n,function(){h.if_(h.notNull(l),function(){a&&1!==a&&h.addEnsureSafeAssignContext(l),t.computed?(u=h.nextId(),h.recurse(t.property,u),h.getStringValue(u),h.addEnsureSafeMemberName(u),a&&1!==a&&h.if_(h.not(h.computedMember(l,u)),h.lazyAssign(h.computedMember(l,u),"{}")),d=h.ensureSafeObject(h.computedMember(l,u)),h.assign(e,d),i&&(i.computed=!0,i.name=u)):(Qe(t.property.name),a&&1!==a&&h.if_(h.not(h.nonComputedMember(l,t.property.name)),h.lazyAssign(h.nonComputedMember(l,t.property.name),"{}")),d=h.nonComputedMember(l,t.property.name),(h.state.expensiveChecks||mn(t.property.name))&&(d=h.ensureSafeObject(d)),h.assign(e,d),i&&(i.computed=!1,i.name=t.property.name))},function(){h.assign(e,"undefined")}),r(e)},!!a);break;case po.CallExpression:e=e||this.nextId(),t.filter?(u=h.filter(t.callee.name),c=[],o(t.arguments,function(t){var e=h.nextId();h.recurse(t,e),c.push(e)}),d=u+"("+c.join(",")+")",h.assign(e,d),r(e)):(u=h.nextId(),l={},c=[],h.recurse(t.callee,u,l,function(){h.if_(h.notNull(u),function(){h.addEnsureSafeFunction(u),o(t.arguments,function(t){h.recurse(t,h.nextId(),n,function(t){c.push(h.ensureSafeObject(t))})}),l.name?(h.state.expensiveChecks||h.addEnsureSafeObject(l.context),d=h.member(l.context,l.name,l.computed)+"("+c.join(",")+")"):d=u+"("+c.join(",")+")",d=h.ensureSafeObject(d),h.assign(e,d)},function(){h.assign(e,"undefined")}),r(e)}));break;case po.AssignmentExpression:if(u=this.nextId(),l={},!un(t.left))throw ao("lval","Trying to assign a value to a non l-value");this.recurse(t.left,n,l,function(){h.if_(h.notNull(l.context),function(){h.recurse(t.right,u),h.addEnsureSafeObject(h.member(l.context,l.name,l.computed)),h.addEnsureSafeAssignContext(l.context),d=h.member(l.context,l.name,l.computed)+t.operator+u,h.assign(e,d),r(e||d)})},1);break;case po.ArrayExpression:c=[],o(t.elements,function(t){h.recurse(t,h.nextId(),n,function(t){c.push(t)})}),d="["+c.join(",")+"]",this.assign(e,d),r(d);break;case po.ObjectExpression:c=[],o(t.properties,function(t){h.recurse(t.value,h.nextId(),n,function(e){c.push(h.escape(t.key.type===po.Identifier?t.key.name:""+t.key.value)+":"+e)})}),d="{"+c.join(",")+"}",this.assign(e,d),r(d);break;case po.ThisExpression:this.assign(e,"s"),r("s");break;case po.LocalsExpression:this.assign(e,"l"),r("l");break;case po.NGValueParameter:this.assign(e,"v"),r("v")}},getHasOwnProperty:function(t,e){var n=t+"."+e,i=this.current().own;return i.hasOwnProperty(n)||(i[n]=this.nextId(!1,t+"&&("+this.escape(e)+" in "+t+")")),i[n]},assign:function(t,e){return t?(this.current().body.push(t,"=",e,";"),t):void 0},filter:function(t){return this.state.filters.hasOwnProperty(t)||(this.state.filters[t]=this.nextId(!0)),this.state.filters[t]},ifDefined:function(t,e){return"ifDefined("+t+","+this.escape(e)+")"},plus:function(t,e){return"plus("+t+","+e+")"},return_:function(t){this.current().body.push("return ",t,";")},if_:function(t,e,n){if(t===!0)e();else{var i=this.current().body;i.push("if(",t,"){"),e(),i.push("}"),n&&(i.push("else{"),n(),i.push("}"))}},not:function(t){return"!("+t+")"},notNull:function(t){return t+"!=null"},nonComputedMember:function(t,e){return t+"."+e},computedMember:function(t,e){return t+"["+e+"]"},member:function(t,e,n){return n?this.computedMember(t,e):this.nonComputedMember(t,e)},addEnsureSafeObject:function(t){this.current().body.push(this.ensureSafeObject(t),";")},addEnsureSafeMemberName:function(t){this.current().body.push(this.ensureSafeMemberName(t),";")},addEnsureSafeFunction:function(t){this.current().body.push(this.ensureSafeFunction(t),";")},addEnsureSafeAssignContext:function(t){this.current().body.push(this.ensureSafeAssignContext(t),";")},ensureSafeObject:function(t){return"ensureSafeObject("+t+",text)"},ensureSafeMemberName:function(t){return"ensureSafeMemberName("+t+",text)"},ensureSafeFunction:function(t){return"ensureSafeFunction("+t+",text)"},getStringValue:function(t){this.assign(t,"getStringValue("+t+")")},ensureSafeAssignContext:function(t){return"ensureSafeAssignContext("+t+",text)"},lazyRecurse:function(t,e,n,i,r,o){var a=this;return function(){a.recurse(t,e,n,i,r,o)}},lazyAssign:function(t,e){var n=this;return function(){n.assign(t,e)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)},escape:function(t){if(C(t))return"'"+t.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(S(t))return t.toString();if(t===!0)return"true";if(t===!1)return"false";if(null===t)return"null";if("undefined"==typeof t)return"undefined";throw ao("esc","IMPOSSIBLE")},nextId:function(t,e){var n="v"+this.state.nextId++;return t||this.current().vars.push(n+(e?"="+e:"")),n},current:function(){
return this.state[this.state.computing]}},pn.prototype={compile:function(t,e){var n=this,i=this.astBuilder.ast(t);this.expression=t,this.expensiveChecks=e,sn(i,n.$filter);var r,a;(r=cn(i))&&(a=this.recurse(r));var s,l=ln(i.body);l&&(s=[],o(l,function(t,e){var i=n.recurse(t);t.input=i,s.push(i),t.watchId=e}));var u=[];o(i.body,function(t){u.push(n.recurse(t.expression))});var c=0===i.body.length?function(){}:1===i.body.length?u[0]:function(t,e){var n;return o(u,function(i){n=i(t,e)}),n};return a&&(c.assign=function(t,e,n){return a(t,n,e)}),s&&(c.inputs=s),c.literal=dn(i),c.constant=hn(i),c},recurse:function(t,e,i){var r,a,s,l=this;if(t.input)return this.inputs(t.input,t.watchId);switch(t.type){case po.Literal:return this.value(t.value,e);case po.UnaryExpression:return a=this.recurse(t.argument),this["unary"+t.operator](a,e);case po.BinaryExpression:return r=this.recurse(t.left),a=this.recurse(t.right),this["binary"+t.operator](r,a,e);case po.LogicalExpression:return r=this.recurse(t.left),a=this.recurse(t.right),this["binary"+t.operator](r,a,e);case po.ConditionalExpression:return this["ternary?:"](this.recurse(t.test),this.recurse(t.alternate),this.recurse(t.consequent),e);case po.Identifier:return Qe(t.name,l.expression),l.identifier(t.name,l.expensiveChecks||mn(t.name),e,i,l.expression);case po.MemberExpression:return r=this.recurse(t.object,!1,!!i),t.computed||(Qe(t.property.name,l.expression),a=t.property.name),t.computed&&(a=this.recurse(t.property)),t.computed?this.computedMember(r,a,e,i,l.expression):this.nonComputedMember(r,a,l.expensiveChecks,e,i,l.expression);case po.CallExpression:return s=[],o(t.arguments,function(t){s.push(l.recurse(t))}),t.filter&&(a=this.$filter(t.callee.name)),t.filter||(a=this.recurse(t.callee,!0)),t.filter?function(t,i,r,o){for(var l=[],u=0;u<s.length;++u)l.push(s[u](t,i,r,o));var c=a.apply(n,l,o);return e?{context:n,name:n,value:c}:c}:function(t,n,i,r){var o,u=a(t,n,i,r);if(null!=u.value){tn(u.context,l.expression),en(u.value,l.expression);for(var c=[],d=0;d<s.length;++d)c.push(tn(s[d](t,n,i,r),l.expression));o=tn(u.value.apply(u.context,c),l.expression)}return e?{value:o}:o};case po.AssignmentExpression:return r=this.recurse(t.left,!0,1),a=this.recurse(t.right),function(t,n,i,o){var s=r(t,n,i,o),u=a(t,n,i,o);return tn(s.value,l.expression),nn(s.context),s.context[s.name]=u,e?{value:u}:u};case po.ArrayExpression:return s=[],o(t.elements,function(t){s.push(l.recurse(t))}),function(t,n,i,r){for(var o=[],a=0;a<s.length;++a)o.push(s[a](t,n,i,r));return e?{value:o}:o};case po.ObjectExpression:return s=[],o(t.properties,function(t){s.push({key:t.key.type===po.Identifier?t.key.name:""+t.key.value,value:l.recurse(t.value)})}),function(t,n,i,r){for(var o={},a=0;a<s.length;++a)o[s[a].key]=s[a].value(t,n,i,r);return e?{value:o}:o};case po.ThisExpression:return function(t){return e?{value:t}:t};case po.LocalsExpression:return function(t,n){return e?{value:n}:n};case po.NGValueParameter:return function(t,n,i,r){return e?{value:i}:i}}},"unary+":function(t,e){return function(n,i,r,o){var a=t(n,i,r,o);return a=$(a)?+a:0,e?{value:a}:a}},"unary-":function(t,e){return function(n,i,r,o){var a=t(n,i,r,o);return a=$(a)?-a:0,e?{value:a}:a}},"unary!":function(t,e){return function(n,i,r,o){var a=!t(n,i,r,o);return e?{value:a}:a}},"binary+":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a),l=e(i,r,o,a),u=on(s,l);return n?{value:u}:u}},"binary-":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a),l=e(i,r,o,a),u=($(s)?s:0)-($(l)?l:0);return n?{value:u}:u}},"binary*":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)*e(i,r,o,a);return n?{value:s}:s}},"binary/":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)/e(i,r,o,a);return n?{value:s}:s}},"binary%":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)%e(i,r,o,a);return n?{value:s}:s}},"binary===":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)===e(i,r,o,a);return n?{value:s}:s}},"binary!==":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)!==e(i,r,o,a);return n?{value:s}:s}},"binary==":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)==e(i,r,o,a);return n?{value:s}:s}},"binary!=":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)!=e(i,r,o,a);return n?{value:s}:s}},"binary<":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)<e(i,r,o,a);return n?{value:s}:s}},"binary>":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)>e(i,r,o,a);return n?{value:s}:s}},"binary<=":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)<=e(i,r,o,a);return n?{value:s}:s}},"binary>=":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)>=e(i,r,o,a);return n?{value:s}:s}},"binary&&":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)&&e(i,r,o,a);return n?{value:s}:s}},"binary||":function(t,e,n){return function(i,r,o,a){var s=t(i,r,o,a)||e(i,r,o,a);return n?{value:s}:s}},"ternary?:":function(t,e,n,i){return function(r,o,a,s){var l=t(r,o,a,s)?e(r,o,a,s):n(r,o,a,s);return i?{value:l}:l}},value:function(t,e){return function(){return e?{context:n,name:n,value:t}:t}},identifier:function(t,e,i,r,o){return function(a,s,l,u){var c=s&&t in s?s:a;r&&1!==r&&c&&!c[t]&&(c[t]={});var d=c?c[t]:n;return e&&tn(d,o),i?{context:c,name:t,value:d}:d}},computedMember:function(t,e,n,i,r){return function(o,a,s,l){var u,c,d=t(o,a,s,l);return null!=d&&(u=e(o,a,s,l),u=Je(u),Qe(u,r),i&&1!==i&&(nn(d),d&&!d[u]&&(d[u]={})),c=d[u],tn(c,r)),n?{context:d,name:u,value:c}:c}},nonComputedMember:function(t,e,i,r,o,a){return function(s,l,u,c){var d=t(s,l,u,c);o&&1!==o&&(nn(d),d&&!d[e]&&(d[e]={}));var h=null!=d?d[e]:n;return(i||mn(e))&&tn(h,a),r?{context:d,name:e,value:h}:h}},inputs:function(t,e){return function(n,i,r,o){return o?o[e]:t(n,i,r)}}};var mo=function(t,e,n){this.lexer=t,this.$filter=e,this.options=n,this.ast=new po(this.lexer),this.astCompiler=n.csp?new pn(this.ast,e):new fn(this.ast,e)};mo.prototype={constructor:mo,parse:function(t){return this.astCompiler.compile(t,this.options.expensiveChecks)}};var go=Object.prototype.valueOf,vo=i("$sce"),yo={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Ur=i("$compile"),bo=e.createElement("a"),$o=An(t.location.href);Fn.$inject=["$document"],Nn.$inject=["$provide"];var wo=22,xo=".",Co="0";Bn.$inject=["$locale"],Un.$inject=["$locale"];var So={yyyy:qn("FullYear",4),yy:qn("FullYear",2,0,!0),y:qn("FullYear",1),MMMM:Xn("Month"),MMM:Xn("Month",!0),MM:qn("Month",2,1),M:qn("Month",1,1),dd:qn("Date",2),d:qn("Date",1),HH:qn("Hours",2),H:qn("Hours",1),hh:qn("Hours",2,-12),h:qn("Hours",1,-12),mm:qn("Minutes",2),m:qn("Minutes",1),ss:qn("Seconds",2),s:qn("Seconds",1),sss:qn("Milliseconds",3),EEEE:Xn("Day"),EEE:Xn("Day",!0),a:ti,Z:Kn,ww:Jn(2),w:Jn(1),G:ei,GG:ei,GGG:ei,GGGG:ni},ko=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,Do=/^\-?\d+$/;ii.$inject=["$locale"];var Eo=v(Ti),_o=v(Pi);ai.$inject=["$parse"];var Mo=v({restrict:"E",compile:function(t,e){return e.href||e.xlinkHref?void 0:function(t,e){if("a"===e[0].nodeName.toLowerCase()){var n="[object SVGAnimatedString]"===Hi.call(e.prop("href"))?"xlink:href":"href";e.on("click",function(t){e.attr(n)||t.preventDefault()})}}}}),To={};o(Sr,function(t,e){function n(t,n,r){t.$watch(r[i],function(t){r.$set(e,!!t)})}if("multiple"!=t){var i=me("ng-"+e),r=n;"checked"===t&&(r=function(t,e,r){r.ngModel!==r[i]&&n(t,e,r)}),To[i]=function(){return{restrict:"A",priority:100,link:r}}}}),o(Dr,function(t,e){To[e]=function(){return{priority:100,link:function(t,n,i){if("ngPattern"===e&&"/"==i.ngPattern.charAt(0)){var r=i.ngPattern.match(Ei);if(r)return void i.$set("ngPattern",new RegExp(r[1],r[2]))}t.$watch(i[e],function(t){i.$set(e,t)})}}}}),o(["src","srcset","href"],function(t){var e=me("ng-"+t);To[e]=function(){return{priority:99,link:function(n,i,r){var o=t,a=t;"href"===t&&"[object SVGAnimatedString]"===Hi.call(i.prop("href"))&&(a="xlinkHref",r.$attr[a]="xlink:href",o=null),r.$observe(e,function(e){return e?(r.$set(a,e),void(Oi&&o&&i.prop(o,r[a]))):void("href"===t&&r.$set(a,null))})}}}});var Po={$addControl:m,$$renameControl:li,$removeControl:m,$setValidity:m,$setDirty:m,$setPristine:m,$setSubmitted:m},Ao="ng-submitted";ui.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var jo=function(t){return["$timeout","$parse",function(e,i){function r(t){return""===t?i('this[""]').assign:i(t).assign||m}var o={name:"form",restrict:t?"EAC":"E",require:["form","^^?form"],controller:ui,compile:function(i,o){i.addClass(fa).addClass(da);var a=o.name?"name":t&&o.ngForm?"ngForm":!1;return{pre:function(t,i,o,s){var l=s[0];if(!("action"in o)){var u=function(e){t.$apply(function(){l.$commitViewValue(),l.$setSubmitted()}),e.preventDefault()};dr(i[0],"submit",u),i.on("$destroy",function(){e(function(){hr(i[0],"submit",u)},0,!1)})}var c=s[1]||l.$$parentForm;c.$addControl(l);var h=a?r(l.$name):m;a&&(h(t,l),o.$observe(a,function(e){l.$name!==e&&(h(t,n),l.$$parentForm.$$renameControl(l,e),(h=r(l.$name))(t,l))})),i.on("$destroy",function(){l.$$parentForm.$removeControl(l),h(t,n),d(l,Po)})}}}};return o}]},Oo=jo(),Fo=jo(!0),Io=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,No=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:\/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Ro=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Lo=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Vo=/^(\d{4})-(\d{2})-(\d{2})$/,Ho=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Bo=/^(\d{4})-W(\d\d)$/,Uo=/^(\d{4})-(\d\d)$/,Yo=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Wo={text:di,date:mi("date",Vo,pi(Vo,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":mi("datetimelocal",Ho,pi(Ho,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:mi("time",Yo,pi(Yo,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:mi("week",Bo,fi,"yyyy-Www"),month:mi("month",Uo,pi(Uo,["yyyy","MM"]),"yyyy-MM"),number:vi,url:yi,email:bi,radio:$i,checkbox:xi,hidden:m,button:m,submit:m,reset:m,file:m},zo=["$browser","$sniffer","$filter","$parse",function(t,e,n,i){return{restrict:"E",require:["?ngModel"],link:{pre:function(r,o,a,s){s[0]&&(Wo[Ti(a.type)]||Wo.text)(r,o,a,s[0],e,t,n,i)}}}}],Go=/^(true|false|\d+)$/,qo=function(){return{restrict:"A",priority:100,compile:function(t,e){return Go.test(e.ngValue)?function(t,e,n){n.$set("value",t.$eval(n.ngValue))}:function(t,e,n){t.$watch(n.ngValue,function(t){n.$set("value",t)})}}}},Xo=["$compile",function(t){return{restrict:"AC",compile:function(e){return t.$$addBindingClass(e),function(e,n,i){t.$$addBindingInfo(n,i.ngBind),n=n[0],e.$watch(i.ngBind,function(t){n.textContent=b(t)?"":t})}}}}],Ko=["$interpolate","$compile",function(t,e){return{compile:function(n){return e.$$addBindingClass(n),function(n,i,r){var o=t(i.attr(r.$attr.ngBindTemplate));e.$$addBindingInfo(i,o.expressions),i=i[0],r.$observe("ngBindTemplate",function(t){i.textContent=b(t)?"":t})}}}}],Zo=["$sce","$parse","$compile",function(t,e,n){return{restrict:"A",compile:function(i,r){var o=e(r.ngBindHtml),a=e(r.ngBindHtml,function(t){return(t||"").toString()});return n.$$addBindingClass(i),function(e,i,r){n.$$addBindingInfo(i,r.ngBindHtml),e.$watch(a,function(){i.html(t.getTrustedHtml(o(e))||"")})}}}}],Qo=v({restrict:"A",require:"ngModel",link:function(t,e,n,i){i.$viewChangeListeners.push(function(){t.$eval(n.ngChange)})}}),Jo=Ci("",!0),ta=Ci("Odd",0),ea=Ci("Even",1),na=si({compile:function(t,e){e.$set("ngCloak",n),t.removeClass("ng-cloak")}}),ia=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],ra={},oa={blur:!0,focus:!0};o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(t){var e=me("ng-"+t);ra[e]=["$parse","$rootScope",function(n,i){return{restrict:"A",compile:function(r,o){var a=n(o[e],null,!0);return function(e,n){n.on(t,function(n){var r=function(){a(e,{$event:n})};oa[t]&&i.$$phase?e.$evalAsync(r):e.$apply(r)})}}}}]});var aa=["$animate",function(t){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(n,i,r,o,a){var s,l,u;n.$watch(r.ngIf,function(n){n?l||a(function(n,o){l=o,n[n.length++]=e.createComment(" end ngIf: "+r.ngIf+" "),s={clone:n},t.enter(n,i.parent(),i)}):(u&&(u.remove(),u=null),l&&(l.$destroy(),l=null),s&&(u=gt(s.clone),t.leave(u).then(function(){u=null}),s=null))})}}}],sa=["$templateRequest","$anchorScroll","$animate",function(t,e,n){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Yi.noop,compile:function(i,r){var o=r.ngInclude||r.src,a=r.onload||"",s=r.autoscroll;return function(i,r,l,u,c){var d,h,f,p=0,m=function(){h&&(h.remove(),h=null),d&&(d.$destroy(),d=null),f&&(n.leave(f).then(function(){h=null}),h=f,f=null)};i.$watch(o,function(o){var l=function(){!$(s)||s&&!i.$eval(s)||e()},h=++p;o?(t(o,!0).then(function(t){if(!i.$$destroyed&&h===p){var e=i.$new();u.template=t;var s=c(e,function(t){m(),n.enter(t,null,r).then(l)});d=e,f=s,d.$emit("$includeContentLoaded",o),i.$eval(a)}},function(){i.$$destroyed||h===p&&(m(),i.$emit("$includeContentError",o))}),i.$emit("$includeContentRequested",o)):(m(),u.template=null)})}}}}],la=["$compile",function(t){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(n,i,r,o){return Hi.call(i[0]).match(/SVG/)?(i.empty(),void t(_t(o.template,e).childNodes)(n,function(t){i.append(t)},{futureParentElement:i})):(i.html(o.template),void t(i.contents())(n))}}}],ua=si({priority:450,compile:function(){return{pre:function(t,e,n){t.$eval(n.ngInit)}}}}),ca=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(t,e,i,r){var a=e.attr(i.$attr.ngList)||", ",s="false"!==i.ngTrim,l=s?qi(a):a,u=function(t){if(!b(t)){var e=[];return t&&o(t.split(l),function(t){t&&e.push(s?qi(t):t)}),e}};r.$parsers.push(u),r.$formatters.push(function(t){return zi(t)?t.join(a):n}),r.$isEmpty=function(t){return!t||!t.length}}}},da="ng-valid",ha="ng-invalid",fa="ng-pristine",pa="ng-dirty",ma="ng-untouched",ga="ng-touched",va="ng-pending",ya="ng-empty",ba="ng-not-empty",$a=i("ngModel"),wa=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(t,e,i,r,a,s,l,u,c,d){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=n,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=n,this.$name=d(i.name||"",!1)(t),this.$$parentForm=Po;var h,f=a(i.ngModel),p=f.assign,g=f,v=p,y=null,w=this;this.$$setOptions=function(t){if(w.$options=t,t&&t.getterSetter){var e=a(i.ngModel+"()"),n=a(i.ngModel+"($$$p)");g=function(t){var n=f(t);return D(n)&&(n=e(t)),n},v=function(t,e){D(f(t))?n(t,{$$$p:w.$modelValue}):p(t,w.$modelValue)}}else if(!f.assign)throw $a("nonassign","Expression '{0}' is non-assignable. Element: {1}",i.ngModel,J(r))},this.$render=m,this.$isEmpty=function(t){return b(t)||""===t||null===t||t!==t},this.$$updateEmptyClasses=function(t){w.$isEmpty(t)?(s.removeClass(r,ba),s.addClass(r,ya)):(s.removeClass(r,ya),s.addClass(r,ba))};var x=0;Si({ctrl:this,$element:r,set:function(t,e){t[e]=!0},unset:function(t,e){delete t[e]},$animate:s}),this.$setPristine=function(){w.$dirty=!1,w.$pristine=!0,s.removeClass(r,pa),s.addClass(r,fa)},this.$setDirty=function(){w.$dirty=!0,w.$pristine=!1,s.removeClass(r,fa),s.addClass(r,pa),w.$$parentForm.$setDirty()},this.$setUntouched=function(){w.$touched=!1,w.$untouched=!0,s.setClass(r,ma,ga)},this.$setTouched=function(){w.$touched=!0,w.$untouched=!1,s.setClass(r,ga,ma)},this.$rollbackViewValue=function(){l.cancel(y),w.$viewValue=w.$$lastCommittedViewValue,w.$render()},this.$validate=function(){if(!S(w.$modelValue)||!isNaN(w.$modelValue)){var t=w.$$lastCommittedViewValue,e=w.$$rawModelValue,i=w.$valid,r=w.$modelValue,o=w.$options&&w.$options.allowInvalid;w.$$runValidators(e,t,function(t){o||i===t||(w.$modelValue=t?e:n,w.$modelValue!==r&&w.$$writeModelToScope())})}},this.$$runValidators=function(t,e,i){function r(){var t=w.$$parserName||"parse";return b(h)?(l(t,null),!0):(h||(o(w.$validators,function(t,e){l(e,null)}),o(w.$asyncValidators,function(t,e){l(e,null)})),l(t,h),h)}function a(){var n=!0;return o(w.$validators,function(i,r){var o=i(t,e);n=n&&o,l(r,o)}),n?!0:(o(w.$asyncValidators,function(t,e){l(e,null)}),!1)}function s(){var i=[],r=!0;o(w.$asyncValidators,function(o,a){var s=o(t,e);if(!O(s))throw $a("nopromise","Expected asynchronous validator to return a promise but got '{0}' instead.",s);l(a,n),i.push(s.then(function(){l(a,!0)},function(t){r=!1,l(a,!1)}))}),i.length?c.all(i).then(function(){u(r)},m):u(!0)}function l(t,e){d===x&&w.$setValidity(t,e)}function u(t){d===x&&i(t)}x++;var d=x;return r()&&a()?void s():void u(!1)},this.$commitViewValue=function(){var t=w.$viewValue;l.cancel(y),(w.$$lastCommittedViewValue!==t||""===t&&w.$$hasNativeValidators)&&(w.$$updateEmptyClasses(t),w.$$lastCommittedViewValue=t,w.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){function e(){w.$modelValue!==a&&w.$$writeModelToScope()}var i=w.$$lastCommittedViewValue,r=i;if(h=b(r)?n:!0)for(var o=0;o<w.$parsers.length;o++)if(r=w.$parsers[o](r),b(r)){h=!1;break}S(w.$modelValue)&&isNaN(w.$modelValue)&&(w.$modelValue=g(t));var a=w.$modelValue,s=w.$options&&w.$options.allowInvalid;w.$$rawModelValue=r,s&&(w.$modelValue=r,e()),w.$$runValidators(r,w.$$lastCommittedViewValue,function(t){s||(w.$modelValue=t?r:n,e())})},this.$$writeModelToScope=function(){v(t,w.$modelValue),o(w.$viewChangeListeners,function(t){try{t()}catch(n){e(n)}})},this.$setViewValue=function(t,e){w.$viewValue=t,w.$options&&!w.$options.updateOnDefault||w.$$debounceViewValueCommit(e)},this.$$debounceViewValueCommit=function(e){var n,i=0,r=w.$options;r&&$(r.debounce)&&(n=r.debounce,S(n)?i=n:S(n[e])?i=n[e]:S(n["default"])&&(i=n["default"])),l.cancel(y),i?y=l(function(){w.$commitViewValue()},i):u.$$phase?w.$commitViewValue():t.$apply(function(){w.$commitViewValue()})},t.$watch(function(){var e=g(t);if(e!==w.$modelValue&&(w.$modelValue===w.$modelValue||e===e)){w.$modelValue=w.$$rawModelValue=e,h=n;for(var i=w.$formatters,r=i.length,o=e;r--;)o=i[r](o);w.$viewValue!==o&&(w.$$updateEmptyClasses(o),w.$viewValue=w.$$lastCommittedViewValue=o,w.$render(),w.$$runValidators(e,o,m))}return e})}],xa=["$rootScope",function(t){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:wa,priority:1,compile:function(e){return e.addClass(fa).addClass(ma).addClass(da),{pre:function(t,e,n,i){var r=i[0],o=i[1]||r.$$parentForm;r.$$setOptions(i[2]&&i[2].$options),o.$addControl(r),n.$observe("name",function(t){r.$name!==t&&r.$$parentForm.$$renameControl(r,t)}),t.$on("$destroy",function(){r.$$parentForm.$removeControl(r)})},post:function(e,n,i,r){var o=r[0];o.$options&&o.$options.updateOn&&n.on(o.$options.updateOn,function(t){o.$$debounceViewValueCommit(t&&t.type)}),n.on("blur",function(n){o.$touched||(t.$$phase?e.$evalAsync(o.$setTouched):e.$apply(o.$setTouched))})}}}}}],Ca=/(\s+|^)default(\s+|$)/,Sa=function(){return{restrict:"A",controller:["$scope","$attrs",function(t,e){var n=this;this.$options=H(t.$eval(e.ngModelOptions)),$(this.$options.updateOn)?(this.$options.updateOnDefault=!1,this.$options.updateOn=qi(this.$options.updateOn.replace(Ca,function(){return n.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}},ka=si({terminal:!0,priority:1e3}),Da=i("ngOptions"),Ea=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,_a=["$compile","$parse",function(t,n){function i(t,e,i){function o(t,e,n,i,r){this.selectValue=t,this.viewValue=e,this.label=n,this.group=i,this.disabled=r}function a(t){var e;if(!u&&r(t))e=t;else{e=[];for(var n in t)t.hasOwnProperty(n)&&"$"!==n.charAt(0)&&e.push(n)}return e}var s=t.match(Ea);if(!s)throw Da("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",t,J(e));var l=s[5]||s[7],u=s[6],c=/ as /.test(s[0])&&s[1],d=s[9],h=n(s[2]?s[1]:l),f=c&&n(c),p=f||h,m=d&&n(d),g=d?function(t,e){return m(i,e)}:function(t){return Jt(t)},v=function(t,e){return g(t,C(t,e))},y=n(s[2]||s[1]),b=n(s[3]||""),$=n(s[4]||""),w=n(s[8]),x={},C=u?function(t,e){return x[u]=e,x[l]=t,x}:function(t){return x[l]=t,x};return{trackBy:d,getTrackByValue:v,getWatchables:n(w,function(t){var e=[];t=t||[];for(var n=a(t),r=n.length,o=0;r>o;o++){var l=t===n?o:n[o],u=(t[l],C(t[l],l)),c=g(t[l],u);if(e.push(c),s[2]||s[1]){var d=y(i,u);e.push(d)}if(s[4]){var h=$(i,u);e.push(h)}}return e}),getOptions:function(){for(var t=[],e={},n=w(i)||[],r=a(n),s=r.length,l=0;s>l;l++){var u=n===r?l:r[l],c=n[u],h=C(c,u),f=p(i,h),m=g(f,h),x=y(i,h),S=b(i,h),k=$(i,h),D=new o(m,f,x,S,k);t.push(D),e[m]=D}return{items:t,selectValueMap:e,getOptionFromViewValue:function(t){return e[v(t)]},getViewValueFromOption:function(t){return d?Yi.copy(t.viewValue):t.viewValue}}}}}function a(e,n,r,a){function u(t,e){t.element=e,e.disabled=t.disabled,t.label!==e.label&&(e.label=t.label,e.textContent=t.label),t.value!==e.value&&(e.value=t.selectValue)}function c(t,e,n,i){var r;return e&&Ti(e.nodeName)===n?r=e:(r=i.cloneNode(!1),e?t.insertBefore(r,e):t.appendChild(r)),r}function d(t){for(var e;t;)e=t.nextSibling,Wt(t),t=e}function h(t){var e=p&&p[0],n=C&&C[0];if(e||n)for(;t&&(t===e||t===n||t.nodeType===or||"option"===L(t)&&""===t.value);)t=t.nextSibling;return t}function f(){var t=S&&m.readValue();S=k.getOptions();var e={},i=n[0].firstChild;if(x&&n.prepend(p),i=h(i),S.items.forEach(function(t){var r,o,a;$(t.group)?(r=e[t.group],r||(o=c(n[0],i,"optgroup",l),i=o.nextSibling,o.label=t.group,r=e[t.group]={groupElement:o,currentOptionElement:o.firstChild}),a=c(r.groupElement,r.currentOptionElement,"option",s),u(t,a),r.currentOptionElement=a.nextSibling):(a=c(n[0],i,"option",s),u(t,a),i=a.nextSibling)}),Object.keys(e).forEach(function(t){d(e[t].currentOptionElement)}),d(i),g.$render(),!g.$isEmpty(t)){var r=m.readValue(),o=k.trackBy||v;(o?U(t,r):t===r)||(g.$setViewValue(r),g.$render())}}for(var p,m=a[0],g=a[1],v=r.multiple,y=0,b=n.children(),w=b.length;w>y;y++)if(""===b[y].value){p=b.eq(y);break}var x=!!p,C=Fi(s.cloneNode(!1));C.val("?");var S,k=i(r.ngOptions,n,e),D=function(){x||n.prepend(p),n.val(""),p.prop("selected",!0),p.attr("selected",!0)},E=function(){x||p.remove()},_=function(){n.prepend(C),n.val("?"),C.prop("selected",!0),C.attr("selected",!0)},M=function(){C.remove()};v?(g.$isEmpty=function(t){return!t||0===t.length},m.writeValue=function(t){S.items.forEach(function(t){t.element.selected=!1}),t&&t.forEach(function(t){var e=S.getOptionFromViewValue(t);e&&!e.disabled&&(e.element.selected=!0)})},m.readValue=function(){var t=n.val()||[],e=[];return o(t,function(t){var n=S.selectValueMap[t];n&&!n.disabled&&e.push(S.getViewValueFromOption(n))}),e},k.trackBy&&e.$watchCollection(function(){return zi(g.$viewValue)?g.$viewValue.map(function(t){return k.getTrackByValue(t)}):void 0},function(){g.$render()})):(m.writeValue=function(t){var e=S.getOptionFromViewValue(t);e&&!e.disabled?n[0].value!==e.selectValue&&(M(),E(),n[0].value=e.selectValue,e.element.selected=!0,e.element.setAttribute("selected","selected")):null===t||x?(M(),D()):(E(),_())},m.readValue=function(){var t=S.selectValueMap[n.val()];return t&&!t.disabled?(E(),M(),S.getViewValueFromOption(t)):null},k.trackBy&&e.$watch(function(){return k.getTrackByValue(g.$viewValue)},function(){g.$render()})),x?(p.remove(),t(p)(e),p.removeClass("ng-scope")):p=Fi(s.cloneNode(!1)),f(),e.$watchCollection(k.getWatchables,f)}var s=e.createElement("option"),l=e.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(t,e,n,i){i[0].registerOption=m},post:a}}}],Ma=["$locale","$interpolate","$log",function(t,e,n){var i=/{}/g,r=/^when(Minus)?(.+)$/;return{link:function(a,s,l){function u(t){s.text(t||"")}var c,d=l.count,h=l.$attr.when&&s.attr(l.$attr.when),f=l.offset||0,p=a.$eval(h)||{},g={},v=e.startSymbol(),y=e.endSymbol(),$=v+d+"-"+f+y,w=Yi.noop;o(l,function(t,e){var n=r.exec(e);if(n){var i=(n[1]?"-":"")+Ti(n[2]);p[i]=s.attr(l.$attr[e])}}),o(p,function(t,n){g[n]=e(t.replace(i,$))}),a.$watch(d,function(e){var i=parseFloat(e),r=isNaN(i);if(r||i in p||(i=t.pluralCat(i-f)),i!==c&&!(r&&S(c)&&isNaN(c))){w();var o=g[i];b(o)?(null!=e&&n.debug("ngPluralize: no rule defined for '"+i+"' in "+h),w=m,u()):w=a.$watch(o,u),c=i}})}}}],Ta=["$parse","$animate",function(t,a){var s="$$NG_REMOVED",l=i("ngRepeat"),u=function(t,e,n,i,r,o,a){t[n]=i,r&&(t[r]=o),t.$index=e,t.$first=0===e,t.$last=e===a-1,t.$middle=!(t.$first||t.$last),t.$odd=!(t.$even=0===(1&e))},c=function(t){return t.clone[0]},d=function(t){return t.clone[t.clone.length-1]};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(i,h){var f=h.ngRepeat,p=e.createComment(" end ngRepeat: "+f+" "),m=f.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!m)throw l("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",f);var g=m[1],v=m[2],y=m[3],b=m[4];if(m=g.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/),!m)throw l("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",g);var $=m[3]||m[1],w=m[2];if(y&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(y)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(y)))throw l("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",y);var x,C,S,k,D={$id:Jt};return b?x=t(b):(S=function(t,e){return Jt(e)},k=function(t){return t}),function(t,e,i,h,m){x&&(C=function(e,n,i){return w&&(D[w]=e),D[$]=n,D.$index=i,x(t,D)});var g=vt();t.$watchCollection(v,function(i){var h,v,b,x,D,E,_,M,T,P,A,j,O=e[0],F=vt();if(y&&(t[y]=i),r(i))T=i,M=C||S;else{M=C||k,T=[];for(var I in i)Mi.call(i,I)&&"$"!==I.charAt(0)&&T.push(I)}for(x=T.length,A=new Array(x),h=0;x>h;h++)if(D=i===T?h:T[h],E=i[D],_=M(D,E,h),g[_])P=g[_],delete g[_],F[_]=P,A[h]=P;else{if(F[_])throw o(A,function(t){t&&t.scope&&(g[t.id]=t)}),l("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",f,_,E);A[h]={id:_,scope:n,clone:n},F[_]=!0}for(var N in g){if(P=g[N],j=gt(P.clone),a.leave(j),j[0].parentNode)for(h=0,v=j.length;v>h;h++)j[h][s]=!0;P.scope.$destroy()}for(h=0;x>h;h++)if(D=i===T?h:T[h],E=i[D],P=A[h],P.scope){b=O;do b=b.nextSibling;while(b&&b[s]);c(P)!=b&&a.move(gt(P.clone),null,Fi(O)),O=d(P),u(P.scope,h,$,E,w,D,x)}else m(function(t,e){P.scope=e;var n=p.cloneNode(!1);t[t.length++]=n,a.enter(t,null,Fi(O)),O=n,P.clone=t,F[P.id]=P,u(P.scope,h,$,E,w,D,x)});g=F})}}}}],Pa="ng-hide",Aa="ng-hide-animate",ja=["$animate",function(t){return{restrict:"A",multiElement:!0,link:function(e,n,i){e.$watch(i.ngShow,function(e){t[e?"removeClass":"addClass"](n,Pa,{tempClasses:Aa})})}}}],Oa=["$animate",function(t){return{restrict:"A",multiElement:!0,link:function(e,n,i){e.$watch(i.ngHide,function(e){t[e?"addClass":"removeClass"](n,Pa,{tempClasses:Aa})})}}}],Fa=si(function(t,e,n){t.$watch(n.ngStyle,function(t,n){n&&t!==n&&o(n,function(t,n){e.css(n,"")}),t&&e.css(t)},!0)}),Ia=["$animate",function(t){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(n,i,r,a){var s=r.ngSwitch||r.on,l=[],u=[],c=[],d=[],h=function(t,e){return function(){t.splice(e,1)}};n.$watch(s,function(n){var i,r;for(i=0,r=c.length;r>i;++i)t.cancel(c[i]);for(c.length=0,i=0,r=d.length;r>i;++i){var s=gt(u[i].clone);d[i].$destroy();var f=c[i]=t.leave(s);f.then(h(c,i))}u.length=0,d.length=0,(l=a.cases["!"+n]||a.cases["?"])&&o(l,function(n){n.transclude(function(i,r){d.push(r);var o=n.element;i[i.length++]=e.createComment(" end ngSwitchWhen: ");var a={clone:i};u.push(a),t.enter(i,o.parent(),o)})})})}}}],Na=si({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(t,e,n,i,r){i.cases["!"+n.ngSwitchWhen]=i.cases["!"+n.ngSwitchWhen]||[],i.cases["!"+n.ngSwitchWhen].push({transclude:r,element:e})}}),Ra=si({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(t,e,n,i,r){i.cases["?"]=i.cases["?"]||[],i.cases["?"].push({transclude:r,element:e})}}),La=i("ngTransclude"),Va=si({restrict:"EAC",link:function(t,e,n,i,r){function o(t){t.length&&(e.empty(),e.append(t))}if(n.ngTransclude===n.$attr.ngTransclude&&(n.ngTransclude=""),!r)throw La("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",J(e));var a=n.ngTransclude||n.ngTranscludeSlot;r(o,null,a)}}),Ha=["$templateCache",function(t){return{restrict:"E",terminal:!0,compile:function(e,n){if("text/ng-template"==n.type){var i=n.id,r=e[0].text;t.put(i,r)}}}}],Ba={$setViewValue:m,$render:m},Ua=["$element","$scope","$attrs",function(t,i,r){var o=this,a=new te;o.ngModelCtrl=Ba,o.unknownOption=Fi(e.createElement("option")),o.renderUnknownOption=function(e){var n="? "+Jt(e)+" ?";o.unknownOption.val(n),t.prepend(o.unknownOption),t.val(n)},i.$on("$destroy",function(){o.renderUnknownOption=m}),o.removeUnknownOption=function(){o.unknownOption.parent()&&o.unknownOption.remove()},o.readValue=function(){return o.removeUnknownOption(),t.val()},o.writeValue=function(e){o.hasOption(e)?(o.removeUnknownOption(),t.val(e),""===e&&o.emptyOption.prop("selected",!0)):null==e&&o.emptyOption?(o.removeUnknownOption(),t.val("")):o.renderUnknownOption(e)},o.addOption=function(t,e){if(e[0].nodeType!==or){pt(t,'"option value"'),""===t&&(o.emptyOption=e);var n=a.get(t)||0;a.put(t,n+1),o.ngModelCtrl.$render(),Di(e)}},o.removeOption=function(t){var e=a.get(t);e&&(1===e?(a.remove(t),""===t&&(o.emptyOption=n)):a.put(t,e-1))},o.hasOption=function(t){return!!a.get(t)},o.registerOption=function(t,e,n,i,r){if(i){var a;n.$observe("value",function(t){$(a)&&o.removeOption(a),a=t,o.addOption(t,e)})}else r?t.$watch(r,function(t,i){n.$set("value",t),i!==t&&o.removeOption(i),o.addOption(t,e)}):o.addOption(n.value,e);e.on("$destroy",function(){o.removeOption(n.value),o.ngModelCtrl.$render()})}}],Ya=function(){function t(t,e,n,i){var r=i[1];if(r){var a=i[0];if(a.ngModelCtrl=r,e.on("change",function(){t.$apply(function(){r.$setViewValue(a.readValue())})}),n.multiple){a.readValue=function(){var t=[];return o(e.find("option"),function(e){e.selected&&t.push(e.value)}),t},a.writeValue=function(t){var n=new te(t);o(e.find("option"),function(t){t.selected=$(n.get(t.value))})};var s,l=NaN;t.$watch(function(){l!==r.$viewValue||U(s,r.$viewValue)||(s=B(r.$viewValue),r.$render()),l=r.$viewValue}),r.$isEmpty=function(t){return!t||0===t.length}}}}function e(t,e,n,i){var r=i[1];if(r){var o=i[0];r.$render=function(){o.writeValue(r.$viewValue)}}}return{restrict:"E",require:["select","?ngModel"],controller:Ua,priority:1,link:{pre:t,post:e}}},Wa=["$interpolate",function(t){return{restrict:"E",priority:100,compile:function(e,n){if($(n.value))var i=t(n.value,!0);else{var r=t(e.text(),!0);r||n.$set("value",e.text())}return function(t,e,n){var o="$selectController",a=e.parent(),s=a.data(o)||a.parent().data(o);s&&s.registerOption(t,e,n,i,r)}}}}],za=v({restrict:"E",terminal:!1}),Ga=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,n,i){i&&(n.required=!0,i.$validators.required=function(t,e){return!n.required||!i.$isEmpty(e)},n.$observe("required",function(){i.$validate()}))}}},qa=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,r,o){if(o){var a,s=r.ngPattern||r.pattern;
r.$observe("pattern",function(t){if(C(t)&&t.length>0&&(t=new RegExp("^"+t+"$")),t&&!t.test)throw i("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",s,t,J(e));a=t||n,o.$validate()}),o.$validators.pattern=function(t,e){return o.$isEmpty(e)||b(a)||a.test(e)}}}}},Xa=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,n,i){if(i){var r=-1;n.$observe("maxlength",function(t){var e=f(t);r=isNaN(e)?-1:e,i.$validate()}),i.$validators.maxlength=function(t,e){return 0>r||i.$isEmpty(e)||e.length<=r}}}}},Ka=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,n,i){if(i){var r=0;n.$observe("minlength",function(t){r=f(t)||0,i.$validate()}),i.$validators.minlength=function(t,e){return i.$isEmpty(e)||e.length>=r}}}}};return t.angular.bootstrap?void console.log("WARNING: Tried to load angular more than once."):(dt(),wt(Yi),Yi.module("ngLocale",[],["$provide",function(t){function e(t){t+="";var e=t.indexOf(".");return-1==e?0:t.length-e-1}function i(t,i){var r=i;n===r&&(r=Math.min(e(t),3));var o=Math.pow(10,r),a=(t*o|0)%o;return{v:r,f:a}}var r={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};t.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["日","一","二","三","四","五","六"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],STANDALONEMONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(t,e){var n=0|t,o=i(t,e);return 1==n&&0==o.v?r.ONE:r.OTHER}})}]),void Fi(e).ready(function(){at(e,st)}))}(window,document),!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>'),function(t,e,n){"use strict";function i(){var t=!1;this.$get=["$$sanitizeUri",function(n){return t&&e.extend(C,w),function(t){var e=[];return a(t,u(e,function(t,e){return!/^unsafe:/.test(n(t,e))})),e.join("")}}],this.enableSvg=function(n){return e.isDefined(n)?(t=n,this):t}}function r(t){var n=[],i=u(n,e.noop);return i.chars(t),n.join("")}function o(t,n){var i,r={},o=t.split(",");for(i=0;i<o.length;i++)r[n?e.lowercase(o[i]):o[i]]=!0;return r}function a(t,e){null===t||t===n?t="":"string"!=typeof t&&(t=""+t),d.innerHTML=t;var i=5;do{if(0===i)throw h("uinput","Failed to sanitize html because the input is unstable");i--,document.documentMode<=11&&c(d),t=d.innerHTML,d.innerHTML=t}while(t!==d.innerHTML);for(var r=d.firstChild;r;){switch(r.nodeType){case 1:e.start(r.nodeName.toLowerCase(),s(r.attributes));break;case 3:e.chars(r.textContent)}var o;if(!(o=r.firstChild)&&(1==r.nodeType&&e.end(r.nodeName.toLowerCase()),o=r.nextSibling,!o))for(;null==o&&(r=r.parentNode,r!==d);)o=r.nextSibling,1==r.nodeType&&e.end(r.nodeName.toLowerCase());r=o}for(;r=d.firstChild;)d.removeChild(r)}function s(t){for(var e={},n=0,i=t.length;i>n;n++){var r=t[n];e[r.name]=r.value}return e}function l(t){return t.replace(/&/g,"&amp;").replace(f,function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1);return"&#"+(1024*(e-55296)+(n-56320)+65536)+";"}).replace(p,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function u(t,n){var i=!1,r=e.bind(t,t.push);return{start:function(t,o){t=e.lowercase(t),!i&&x[t]&&(i=t),i||C[t]!==!0||(r("<"),r(t),e.forEach(o,function(i,o){var a=e.lowercase(o),s="img"===t&&"src"===a||"background"===a;E[a]!==!0||S[a]===!0&&!n(i,s)||(r(" "),r(o),r('="'),r(l(i)),r('"'))}),r(">"))},end:function(t){t=e.lowercase(t),i||C[t]!==!0||m[t]===!0||(r("</"),r(t),r(">")),t==i&&(i=!1)},chars:function(t){i||r(l(t))}}}function c(t){if(t.nodeType===Node.ELEMENT_NODE)for(var e=t.attributes,n=0,i=e.length;i>n;n++){var r=e[n],o=r.name.toLowerCase();"xmlns:ns1"!==o&&0!==o.indexOf("ns1:")||(t.removeAttributeNode(r),n--,i--)}var a=t.firstChild;a&&c(a),a=t.nextSibling,a&&c(a)}var d,h=e.$$minErr("$sanitize"),f=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,p=/([^\#-~ |!])/g,m=o("area,br,col,hr,img,wbr"),g=o("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),v=o("rp,rt"),y=e.extend({},v,g),b=e.extend({},g,o("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),$=e.extend({},v,o("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),w=o("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),x=o("script,style"),C=e.extend({},m,b,$,y),S=o("background,cite,href,longdesc,src,xlink:href"),k=o("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),D=o("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),E=e.extend({},S,D,k);!function(t){var e;if(!t.document||!t.document.implementation)throw h("noinert","Can't create an inert html document");e=t.document.implementation.createHTMLDocument("inert");var n=e.documentElement||e.getDocumentElement(),i=n.getElementsByTagName("body");if(1===i.length)d=i[0];else{var r=e.createElement("html");d=e.createElement("body"),r.appendChild(d),e.appendChild(r)}}(t),e.module("ngSanitize",[]).provider("$sanitize",i),e.module("ngSanitize").filter("linky",["$sanitize",function(t){var n=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,i=/^mailto:/i,o=e.$$minErr("linky"),a=e.isString;return function(s,l,u){function c(t){t&&g.push(r(t))}function d(t,n){var i;if(g.push("<a "),e.isFunction(u)&&(u=u(t)),e.isObject(u))for(i in u)g.push(i+'="'+u[i]+'" ');else u={};!e.isDefined(l)||"target"in u||g.push('target="',l,'" '),g.push('href="',t.replace(/"/g,"&quot;"),'">'),c(n),g.push("</a>")}if(null==s||""===s)return s;if(!a(s))throw o("notstring","Expected string but received: {0}",s);for(var h,f,p,m=s,g=[];h=m.match(n);)f=h[0],h[2]||h[4]||(f=(h[3]?"http://":"mailto:")+f),p=h.index,c(m.substr(0,p)),d(f,h[0].replace(i,"")),m=m.substring(p+h[0].length);return c(m),t(g.join(""))}}])}(window,window.angular),function(t,e,n){"use strict";function i(t,e,n){if(!t)throw gt("areq","Argument '{0}' is {1}",e||"?",n||"required");return t}function r(t,e){return t||e?t?e?(U(t)&&(t=t.join(" ")),U(e)&&(e=e.join(" ")),t+" "+e):t:e:""}function o(t){var e={};return t&&(t.to||t.from)&&(e.to=t.to,e.from=t.from),e}function a(t,e,n){var i="";return t=U(t)?t:t&&Y(t)&&t.length?t.split(/\s+/):[],B(t,function(t,r){t&&t.length>0&&(i+=r>0?" ":"",i+=n?e+t:t+e)}),i}function s(t,e){var n=t.indexOf(e);e>=0&&t.splice(n,1)}function l(t){if(t instanceof H)switch(t.length){case 0:return[];case 1:if(t[0].nodeType===K)return t;break;default:return H(u(t))}return t.nodeType===K?H(t):void 0}function u(t){if(!t[0])return t;for(var e=0;e<t.length;e++){var n=t[e];if(n.nodeType==K)return n}}function c(t,e,n){B(e,function(e){t.addClass(e,n)})}function d(t,e,n){B(e,function(e){t.removeClass(e,n)})}function h(t){return function(e,n){n.addClass&&(c(t,e,n.addClass),n.addClass=null),n.removeClass&&(d(t,e,n.removeClass),n.removeClass=null)}}function f(t){if(t=t||{},!t.$$prepared){var e=t.domOperation||R;t.domOperation=function(){t.$$domOperationFired=!0,e(),e=R},t.$$prepared=!0}return t}function p(t,e){m(t,e),g(t,e)}function m(t,e){e.from&&(t.css(e.from),e.from=null)}function g(t,e){e.to&&(t.css(e.to),e.to=null)}function v(t,e,n){var i=e.options||{},r=n.options||{},o=(i.addClass||"")+" "+(r.addClass||""),a=(i.removeClass||"")+" "+(r.removeClass||""),s=y(t.attr("class"),o,a);r.preparationClasses&&(i.preparationClasses=k(r.preparationClasses,i.preparationClasses),delete r.preparationClasses);var l=i.domOperation!==R?i.domOperation:null;return V(i,r),l&&(i.domOperation=l),s.addClass?i.addClass=s.addClass:i.addClass=null,s.removeClass?i.removeClass=s.removeClass:i.removeClass=null,e.addClass=i.addClass,e.removeClass=i.removeClass,i}function y(t,e,n){function i(t){Y(t)&&(t=t.split(" "));var e={};return B(t,function(t){t.length&&(e[t]=!0)}),e}var r=1,o=-1,a={};t=i(t),e=i(e),B(e,function(t,e){a[e]=r}),n=i(n),B(n,function(t,e){a[e]=a[e]===r?null:o});var s={addClass:"",removeClass:""};return B(a,function(e,n){var i,a;e===r?(i="addClass",a=!t[n]):e===o&&(i="removeClass",a=t[n]),a&&(s[i].length&&(s[i]+=" "),s[i]+=n)}),s}function b(t){return t instanceof e.element?t[0]:t}function $(t,e,n){var i="";e&&(i=a(e,J,!0)),n.addClass&&(i=k(i,a(n.addClass,Z))),n.removeClass&&(i=k(i,a(n.removeClass,Q))),i.length&&(n.preparationClasses=i,t.addClass(i))}function w(t,e){e.preparationClasses&&(t.removeClass(e.preparationClasses),e.preparationClasses=null),e.activeClasses&&(t.removeClass(e.activeClasses),e.activeClasses=null)}function x(t,e){var n=e?"-"+e+"s":"";return S(t,[pt,n]),[pt,n]}function C(t,e){var n=e?"paused":"",i=I+ct;return S(t,[i,n]),[i,n]}function S(t,e){var n=e[0],i=e[1];t.style[n]=i}function k(t,e){return t?e?t+" "+e:t:e}function D(t){return[ft,t+"s"]}function E(t,e){var n=e?ht:pt;return[n,t+"s"]}function _(t,e,n){var i=Object.create(null),r=t.getComputedStyle(e)||{};return B(n,function(t,e){var n=r[t];if(n){var o=n.charAt(0);("-"===o||"+"===o||o>=0)&&(n=M(n)),0===n&&(n=null),i[e]=n}}),i}function M(t){var e=0,n=t.split(/\s*,\s*/);return B(n,function(t){"s"==t.charAt(t.length-1)&&(t=t.substring(0,t.length-1)),t=parseFloat(t)||0,e=e?Math.max(t,e):t}),e}function T(t){return 0===t||null!=t}function P(t,e){var n=O,i=t+"s";return e?n+=ot:i+=" linear all",[n,i]}function A(){var t=Object.create(null);return{flush:function(){t=Object.create(null)},count:function(e){var n=t[e];return n?n.total:0},get:function(e){var n=t[e];return n&&n.value},put:function(e,n){t[e]?t[e].total++:t[e]={total:1,value:n}}}}function j(t,e,n){B(n,function(n){t[n]=G(t[n])?t[n]:e.style.getPropertyValue(n)})}var O,F,I,N,R=e.noop,L=e.copy,V=e.extend,H=e.element,B=e.forEach,U=e.isArray,Y=e.isString,W=e.isObject,z=e.isUndefined,G=e.isDefined,q=e.isFunction,X=e.isElement,K=1,Z="-add",Q="-remove",J="ng-",tt="-active",et="-prepare",nt="ng-animate",it="$$ngAnimateChildren",rt="";z(t.ontransitionend)&&G(t.onwebkittransitionend)?(rt="-webkit-",O="WebkitTransition",F="webkitTransitionEnd transitionend"):(O="transition",F="transitionend"),z(t.onanimationend)&&G(t.onwebkitanimationend)?(rt="-webkit-",I="WebkitAnimation",N="webkitAnimationEnd animationend"):(I="animation",N="animationend");var ot="Duration",at="Property",st="Delay",lt="TimingFunction",ut="IterationCount",ct="PlayState",dt=9999,ht=I+st,ft=I+ot,pt=O+st,mt=O+ot,gt=e.$$minErr("ng"),vt=["$$rAF",function(t){function e(t){i=i.concat(t),n()}function n(){if(i.length){for(var e=i.shift(),o=0;o<e.length;o++)e[o]();r||t(function(){r||n()})}}var i,r;return i=e.queue=[],e.waitUntilQuiet=function(e){r&&r(),r=t(function(){r=null,e(),n()})},e}],yt=["$interpolate",function(t){return{link:function(n,i,r){function o(t){t="on"===t||"true"===t,i.data(it,t)}var a=r.ngAnimateChildren;e.isString(a)&&0===a.length?i.data(it,!0):(o(t(a)(n)),r.$observe("ngAnimateChildren",o))}}}],bt="$$animateCss",$t=1e3,wt=3,xt=1.5,Ct={transitionDuration:mt,transitionDelay:pt,transitionProperty:O+at,animationDuration:ft,animationDelay:ht,animationIterationCount:I+ut},St={transitionDuration:mt,transitionDelay:pt,animationDuration:ft,animationDelay:ht},kt=["$animateProvider",function(t){var e=A(),n=A();this.$get=["$window","$$jqLite","$$AnimateRunner","$timeout","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue",function(t,i,r,l,u,c,d,v){function y(t,e){var n="$$ngAnimateParentKey",i=t.parentNode,r=i[n]||(i[n]=++V);return r+"-"+t.getAttribute("class")+"-"+e}function $(n,i,r,o){var a=e.get(r);return a||(a=_(t,n,o),"infinite"===a.animationIterationCount&&(a.animationIterationCount=1)),e.put(r,a),a}function w(r,o,s,l){var u;if(e.count(s)>0&&(u=n.get(s),!u)){var c=a(o,"-stagger");i.addClass(r,c),u=_(t,r,l),u.animationDuration=Math.max(u.animationDuration,0),u.transitionDuration=Math.max(u.transitionDuration,0),i.removeClass(r,c),n.put(s,u)}return u||{}}function k(t){H.push(t),d.waitUntilQuiet(function(){e.flush(),n.flush();for(var t=u(),i=0;i<H.length;i++)H[i](t);H.length=0})}function M(t,e,n){var i=$(t,e,n,Ct),r=i.animationDelay,o=i.transitionDelay;return i.maxDelay=r&&o?Math.max(r,o):r||o,i.maxDuration=Math.max(i.animationDuration*i.animationIterationCount,i.transitionDuration),i}var A=h(i),V=0,H=[];return function(t,n){function u(){h()}function d(){h(!0)}function h(e){if(!(G||X&&q)){G=!0,q=!1,Y.$$skipPreparationClasses||i.removeClass(t,yt),i.removeClass(t,kt),C(z,!1),x(z,!1),B(ut,function(t){z.style[t[0]]=""}),A(t,Y),p(t,Y),Object.keys(W).length&&B(W,function(t,e){t?z.style.setProperty(e,t):z.style.removeProperty(e)}),Y.onDone&&Y.onDone(),ft&&ft.length&&t.off(ft.join(" "),V);var n=t.data(bt);n&&(l.cancel(n[0].timer),t.removeData(bt)),K&&K.complete(!e)}}function $(t){Lt.blockTransition&&x(z,t),Lt.blockKeyframeAnimation&&C(z,!!t)}function _(){return K=new r({end:u,cancel:d}),k(R),h(),{$$willAnimate:!1,start:function(){return K},end:u}}function V(t){t.stopPropagation();var e=t.originalEvent||t,n=e.$manualTimeStamp||Date.now(),i=parseFloat(e.elapsedTime.toFixed(wt));Math.max(n-st,0)>=it&&i>=rt&&(X=!0,h())}function H(){function e(){if(!G){if($(!1),B(ut,function(t){var e=t[0],n=t[1];z.style[e]=n}),A(t,Y),i.addClass(t,kt),Lt.recalculateTimingStyles){if(Ct=z.className+" "+yt,_t=y(z,Ct),Nt=M(z,Ct,_t),Rt=Nt.maxDelay,nt=Math.max(Rt,0),rt=Nt.maxDuration,0===rt)return void h();Lt.hasTransitions=Nt.transitionDuration>0,Lt.hasAnimations=Nt.animationDuration>0}if(Lt.applyAnimationDelay&&(Rt="boolean"!=typeof Y.delay&&T(Y.delay)?parseFloat(Y.delay):Rt,nt=Math.max(Rt,0),Nt.animationDelay=Rt,Vt=E(Rt,!0),ut.push(Vt),z.style[Vt[0]]=Vt[1]),it=nt*$t,ot=rt*$t,Y.easing){var e,r=Y.easing;Lt.hasTransitions&&(e=O+lt,ut.push([e,r]),z.style[e]=r),Lt.hasAnimations&&(e=I+lt,ut.push([e,r]),z.style[e]=r)}Nt.transitionDuration&&ft.push(F),Nt.animationDuration&&ft.push(N),st=Date.now();var o=it+xt*ot,a=st+o,s=t.data(bt)||[],u=!0;if(s.length){var c=s[0];u=a>c.expectedEndTime,u?l.cancel(c.timer):s.push(h)}if(u){var d=l(n,o,!1);s[0]={timer:d,expectedEndTime:a},s.push(h),t.data(bt,s)}ft.length&&t.on(ft.join(" "),V),Y.to&&(Y.cleanupStyles&&j(W,z,Object.keys(Y.to)),g(t,Y))}}function n(){var e=t.data(bt);if(e){for(var n=1;n<e.length;n++)e[n]();t.removeData(bt)}}if(!G){if(!z.parentNode)return void h();var r=function(t){if(X)q&&t&&(q=!1,h());else if(q=!t,Nt.animationDuration){var e=C(z,q);q?ut.push(e):s(ut,e)}},o=Ft>0&&(Nt.transitionDuration&&0===Mt.transitionDuration||Nt.animationDuration&&0===Mt.animationDuration)&&Math.max(Mt.animationDelay,Mt.transitionDelay);o?l(e,Math.floor(o*Ft*$t),!1):e(),et.resume=function(){r(!0)},et.pause=function(){r(!1)}}}var Y=n||{};Y.$$prepared||(Y=f(L(Y)));var W={},z=b(t);if(!z||!z.parentNode||!v.enabled())return _();var G,q,X,K,et,nt,it,rt,ot,st,ut=[],ct=t.attr("class"),ht=o(Y),ft=[];if(0===Y.duration||!c.animations&&!c.transitions)return _();var pt=Y.event&&U(Y.event)?Y.event.join(" "):Y.event,mt=pt&&Y.structural,gt="",vt="";mt?gt=a(pt,J,!0):pt&&(gt=pt),Y.addClass&&(vt+=a(Y.addClass,Z)),Y.removeClass&&(vt.length&&(vt+=" "),vt+=a(Y.removeClass,Q)),Y.applyClassesEarly&&vt.length&&A(t,Y);var yt=[gt,vt].join(" ").trim(),Ct=ct+" "+yt,kt=a(yt,tt),Dt=ht.to&&Object.keys(ht.to).length>0,Et=(Y.keyframeStyle||"").length>0;if(!Et&&!Dt&&!yt)return _();var _t,Mt;if(Y.stagger>0){var Tt=parseFloat(Y.stagger);Mt={transitionDelay:Tt,animationDelay:Tt,transitionDuration:0,animationDuration:0}}else _t=y(z,Ct),Mt=w(z,yt,_t,St);Y.$$skipPreparationClasses||i.addClass(t,yt);var Pt;if(Y.transitionStyle){var At=[O,Y.transitionStyle];S(z,At),ut.push(At)}if(Y.duration>=0){Pt=z.style[O].length>0;var jt=P(Y.duration,Pt);S(z,jt),ut.push(jt)}if(Y.keyframeStyle){var Ot=[I,Y.keyframeStyle];S(z,Ot),ut.push(Ot)}var Ft=Mt?Y.staggerIndex>=0?Y.staggerIndex:e.count(_t):0,It=0===Ft;It&&!Y.skipBlocking&&x(z,dt);var Nt=M(z,Ct,_t),Rt=Nt.maxDelay;nt=Math.max(Rt,0),rt=Nt.maxDuration;var Lt={};if(Lt.hasTransitions=Nt.transitionDuration>0,Lt.hasAnimations=Nt.animationDuration>0,Lt.hasTransitionAll=Lt.hasTransitions&&"all"==Nt.transitionProperty,Lt.applyTransitionDuration=Dt&&(Lt.hasTransitions&&!Lt.hasTransitionAll||Lt.hasAnimations&&!Lt.hasTransitions),Lt.applyAnimationDuration=Y.duration&&Lt.hasAnimations,Lt.applyTransitionDelay=T(Y.delay)&&(Lt.applyTransitionDuration||Lt.hasTransitions),Lt.applyAnimationDelay=T(Y.delay)&&Lt.hasAnimations,Lt.recalculateTimingStyles=vt.length>0,(Lt.applyTransitionDuration||Lt.applyAnimationDuration)&&(rt=Y.duration?parseFloat(Y.duration):rt,Lt.applyTransitionDuration&&(Lt.hasTransitions=!0,Nt.transitionDuration=rt,Pt=z.style[O+at].length>0,ut.push(P(rt,Pt))),Lt.applyAnimationDuration&&(Lt.hasAnimations=!0,Nt.animationDuration=rt,ut.push(D(rt)))),0===rt&&!Lt.recalculateTimingStyles)return _();if(null!=Y.delay){var Vt;"boolean"!=typeof Y.delay&&(Vt=parseFloat(Y.delay),nt=Math.max(Vt,0)),Lt.applyTransitionDelay&&ut.push(E(Vt)),Lt.applyAnimationDelay&&ut.push(E(Vt,!0))}return null==Y.duration&&Nt.transitionDuration>0&&(Lt.recalculateTimingStyles=Lt.recalculateTimingStyles||It),it=nt*$t,ot=rt*$t,Y.skipBlocking||(Lt.blockTransition=Nt.transitionDuration>0,Lt.blockKeyframeAnimation=Nt.animationDuration>0&&Mt.animationDelay>0&&0===Mt.animationDuration),Y.from&&(Y.cleanupStyles&&j(W,z,Object.keys(Y.from)),m(t,Y)),Lt.blockTransition||Lt.blockKeyframeAnimation?$(rt):Y.skipBlocking||x(z,!1),{$$willAnimate:!0,end:u,start:function(){return G?void 0:(et={end:u,cancel:d,resume:null,pause:null},K=new r(et),k(H),K)}}}}]}],Dt=["$$animationProvider",function(t){function e(t){return t.parentNode&&11===t.parentNode.nodeType}t.drivers.push("$$animateCssDriver");var n="ng-animate-shim",i="ng-anchor",r="ng-anchor-out",o="ng-anchor-in";this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(t,a,s,l,u,c,d){function f(t){return t.replace(/\bng-\S+\b/g,"")}function p(t,e){return Y(t)&&(t=t.split(" ")),Y(e)&&(e=e.split(" ")),t.filter(function(t){return-1===e.indexOf(t)}).join(" ")}function m(e,a,l){function u(t){var e={},n=b(t).getBoundingClientRect();return B(["width","height","top","left"],function(t){var i=n[t];switch(t){case"top":i+=y.scrollTop;break;case"left":i+=y.scrollLeft}e[t]=Math.floor(i)+"px"}),e}function c(){var e=t(g,{addClass:r,delay:!0,from:u(a)});return e.$$willAnimate?e:null}function d(t){return t.attr("class")||""}function h(){var e=f(d(l)),n=p(e,v),i=p(v,e),a=t(g,{to:u(l),addClass:o+" "+n,removeClass:r+" "+i,delay:!0});return a.$$willAnimate?a:null}function m(){g.remove(),a.removeClass(n),l.removeClass(n)}var g=H(b(a).cloneNode(!0)),v=f(d(g));a.addClass(n),l.addClass(n),g.addClass(i),w.append(g);var $,x=c();if(!x&&($=h(),!$))return m();var C=x||$;return{start:function(){function t(){n&&n.end()}var e,n=C.start();return n.done(function(){return n=null,!$&&($=h())?(n=$.start(),n.done(function(){n=null,m(),e.complete()}),n):(m(),void e.complete())}),e=new s({end:t,cancel:t})}}}function g(t,e,n,i){var r=v(t,R),o=v(e,R),a=[];return B(i,function(t){var e=t.out,i=t["in"],r=m(n,e,i);r&&a.push(r)}),r||o||0!==a.length?{start:function(){function t(){B(e,function(t){t.end()})}var e=[];r&&e.push(r.start()),o&&e.push(o.start()),B(a,function(t){e.push(t.start())});var n=new s({end:t,cancel:t});return s.all(e,function(t){n.complete(t)}),n}}:void 0}function v(e){var n=e.element,i=e.options||{};e.structural&&(i.event=e.event,i.structural=!0,i.applyClassesEarly=!0,"leave"===e.event&&(i.onDone=i.domOperation)),i.preparationClasses&&(i.event=k(i.event,i.preparationClasses));var r=t(n,i);return r.$$willAnimate?r:null}if(!u.animations&&!u.transitions)return R;var y=d[0].body,$=b(l),w=H(e($)||y.contains($)?$:y);h(c);return function(t){return t.from&&t.to?g(t.from,t.to,t.classes,t.anchors):v(t)}}]}],Et=["$animateProvider",function(t){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(e,n,i){function r(n){n=U(n)?n:n.split(" ");for(var i=[],r={},o=0;o<n.length;o++){var a=n[o],s=t.$$registeredAnimations[a];s&&!r[a]&&(i.push(e.get(s)),r[a]=!0)}return i}var o=h(i);return function(t,e,i,a){function s(){a.domOperation(),o(t,a)}function l(){h=!0,s(),p(t,a)}function u(t,e,i,r,o){var a;switch(i){case"animate":a=[e,r.from,r.to,o];break;case"setClass":a=[e,v,y,o];break;case"addClass":a=[e,v,o];break;case"removeClass":a=[e,y,o];break;default:a=[e,o]}a.push(r);var s=t.apply(t,a);if(s)if(q(s.start)&&(s=s.start()),s instanceof n)s.done(o);else if(q(s))return s;return R}function c(t,e,i,r,o){var a=[];return B(r,function(r){var s=r[o];s&&a.push(function(){var r,o,a=!1,l=function(t){a||(a=!0,(o||R)(t),r.complete(!t))};return r=new n({end:function(){l()},cancel:function(){l(!0)}}),o=u(s,t,e,i,function(t){var e=t===!1;l(e)}),r})}),a}function d(t,e,i,r,o){var a=c(t,e,i,r,o);if(0===a.length){var s,l;"beforeSetClass"===o?(s=c(t,"removeClass",i,r,"beforeRemoveClass"),l=c(t,"addClass",i,r,"beforeAddClass")):"setClass"===o&&(s=c(t,"removeClass",i,r,"removeClass"),l=c(t,"addClass",i,r,"addClass")),s&&(a=a.concat(s)),l&&(a=a.concat(l))}if(0!==a.length)return function(t){var e=[];return a.length&&B(a,function(t){e.push(t())}),e.length?n.all(e,t):t(),function(t){B(e,function(e){t?e.cancel():e.end()})}}}var h=!1;3===arguments.length&&W(i)&&(a=i,i=null),a=f(a),i||(i=t.attr("class")||"",a.addClass&&(i+=" "+a.addClass),a.removeClass&&(i+=" "+a.removeClass));var m,g,v=a.addClass,y=a.removeClass,b=r(i);if(b.length){var $,w;"leave"==e?(w="leave",$="afterLeave"):(w="before"+e.charAt(0).toUpperCase()+e.substr(1),$=e),"enter"!==e&&"move"!==e&&(m=d(t,e,a,b,w)),g=d(t,e,a,b,$)}if(m||g){var x;return{$$willAnimate:!0,end:function(){return x?x.end():(l(),x=new n,x.complete(!0)),x},start:function(){function t(t){l(t),x.complete(t)}function e(e){h||((i||R)(e),t(e))}if(x)return x;x=new n;var i,r=[];return m&&r.push(function(t){i=m(t)}),r.length?r.push(function(t){s(),t(!0)}):s(),g&&r.push(function(t){i=g(t)}),x.setHost({end:function(){e()},cancel:function(){e(!0)}}),n.chain(r,t),x}}}}}]}],_t=["$$animationProvider",function(t){t.drivers.push("$$animateJsDriver"),this.$get=["$$animateJs","$$AnimateRunner",function(t,e){function n(e){var n=e.element,i=e.event,r=e.options,o=e.classes;return t(n,i,o,r)}return function(t){if(t.from&&t.to){var i=n(t.from),r=n(t.to);if(!i&&!r)return;return{start:function(){function t(){return function(){B(o,function(t){t.end()})}}function n(t){a.complete(t)}var o=[];i&&o.push(i.start()),r&&o.push(r.start()),e.all(o,n);var a=new e({end:t(),cancel:t()});return a}}}return n(t)}}]}],Mt="data-ng-animate",Tt="$ngAnimatePin",Pt=["$animateProvider",function(t){function e(t){if(!t)return null;var e=t.split(c),n=Object.create(null);return B(e,function(t){n[t]=!0}),n}function n(t,n){if(t&&n){var i=e(n);return t.split(c).some(function(t){return i[t]})}}function r(t,e,n,i){return d[t].some(function(t){return t(e,n,i)})}function o(t,e){var n=(t.addClass||"").length>0,i=(t.removeClass||"").length>0;return e?n&&i:n||i}var a=1,s=2,c=" ",d=this.rules={skip:[],cancel:[],join:[]};d.join.push(function(t,e,n){return!e.structural&&o(e)}),d.skip.push(function(t,e,n){return!e.structural&&!o(e)}),d.skip.push(function(t,e,n){return"leave"==n.event&&e.structural}),d.skip.push(function(t,e,n){return n.structural&&n.state===s&&!e.structural}),d.cancel.push(function(t,e,n){return n.structural&&e.structural}),d.cancel.push(function(t,e,n){return n.state===s&&e.structural}),d.cancel.push(function(t,e,i){var r=e.addClass,o=e.removeClass,a=i.addClass,s=i.removeClass;return z(r)&&z(o)||z(a)&&z(s)?!1:n(r,s)||n(o,a)}),this.$get=["$$rAF","$rootScope","$rootElement","$document","$$HashMap","$$animation","$$AnimateRunner","$templateRequest","$$jqLite","$$forceReflow",function(e,n,c,d,m,g,y,x,C,S){function k(){var t=!1;return function(e){t?e():n.$$postDigest(function(){t=!0,e()})}}function D(t,e){return v(t,e,{})}function E(t,e,n){var i=b(e),r=b(t),o=[],a=R[n];return a&&B(a,function(t){J.call(t.node,i)?o.push(t.callback):"leave"===n&&J.call(t.node,r)&&o.push(t.callback)}),o}function _(t,i,u){function c(n,i,r,o){_(function(){var n=E(x,t,i);n.length&&e(function(){B(n,function(e){e(t,r,o)})})}),n.progress(i,r,o)}function h(e){w(t,C),Q(t,C),p(t,C),C.domOperation(),S.complete(!e)}var m,x,C=L(u);t=l(t),t&&(m=b(t),x=t.parent()),C=f(C);var S=new y,_=k();if(U(C.addClass)&&(C.addClass=C.addClass.join(" ")),C.addClass&&!Y(C.addClass)&&(C.addClass=null),U(C.removeClass)&&(C.removeClass=C.removeClass.join(" ")),C.removeClass&&!Y(C.removeClass)&&(C.removeClass=null),C.from&&!W(C.from)&&(C.from=null),C.to&&!W(C.to)&&(C.to=null),!m)return h(),S;var P=[m.className,C.addClass,C.removeClass].join(" ");if(!Z(P))return h(),S;var N=["enter","move","leave"].indexOf(i)>=0,R=!I||d[0].hidden||F.get(m),V=!R&&O.get(m)||{},H=!!V.state;if(R||H&&V.state==a||(R=!A(t,x,i)),R)return h(),S;N&&M(t);var z={structural:N,element:t,event:i,addClass:C.addClass,removeClass:C.removeClass,close:h,options:C,runner:S};if(H){var G=r("skip",t,z,V);if(G)return V.state===s?(h(),S):(v(t,V,z),V.runner);var q=r("cancel",t,z,V);if(q)if(V.state===s)V.runner.end();else{if(!V.structural)return v(t,V,z),V.runner;V.close()}else{var X=r("join",t,z,V);if(X){if(V.state!==s)return $(t,N?i:null,C),i=z.event=V.event,C=v(t,V,z),V.runner;D(t,z)}}}else D(t,z);var K=z.structural;if(K||(K="animate"===z.event&&Object.keys(z.options.to||{}).length>0||o(z)),!K)return h(),T(t),S;var J=(V.counter||0)+1;return z.counter=J,j(t,a,z),n.$$postDigest(function(){var e=O.get(m),n=!e;e=e||{};var r=t.parent()||[],a=r.length>0&&("animate"===e.event||e.structural||o(e));if(n||e.counter!==J||!a)return n&&(Q(t,C),p(t,C)),(n||N&&e.event!==i)&&(C.domOperation(),S.end()),void(a||T(t));i=!e.structural&&o(e,!0)?"setClass":e.event,j(t,s);var l=g(t,i,e.options);l.done(function(e){h(!e);var n=O.get(m);n&&n.counter===J&&T(b(t)),c(S,i,"close",{})}),S.setHost(l),c(S,i,"start",{})}),S}function M(t){var e=b(t),n=e.querySelectorAll("["+Mt+"]");B(n,function(t){var e=parseInt(t.getAttribute(Mt)),n=O.get(t);if(n)switch(e){case s:n.runner.end();case a:O.remove(t)}})}function T(t){var e=b(t);e.removeAttribute(Mt),O.remove(e)}function P(t,e){return b(t)===b(e)}function A(t,e,n){var i,r=H(d[0].body),o=P(t,r)||"HTML"===t[0].nodeName,a=P(t,c),s=!1,l=F.get(b(t)),u=t.data(Tt);for(u&&(e=u);e&&e.length;){a||(a=P(e,c));var h=e[0];if(h.nodeType!==K)break;var f=O.get(h)||{};if(!s){var p=F.get(h);if(p===!0&&l!==!1){l=!0;break}p===!1&&(l=!1),s=f.structural}if(z(i)||i===!0){var m=e.data(it);G(m)&&(i=m)}if(s&&i===!1)break;if(o||(o=P(e,r)),o&&a)break;e=a||!(u=e.data(Tt))?e.parent():u}var g=(!s||i)&&l!==!0;return g&&a&&o}function j(t,e,n){n=n||{},n.state=e;var i=b(t);i.setAttribute(Mt,e);var r=O.get(i),o=r?V(r,n):n;O.put(i,o)}var O=new m,F=new m,I=null,N=n.$watch(function(){return 0===x.totalPendingRequests},function(t){t&&(N(),n.$$postDigest(function(){n.$$postDigest(function(){null===I&&(I=!0)})}))}),R={},q=t.classNameFilter(),Z=q?function(t){return q.test(t)}:function(){return!0},Q=h(C),J=Node.prototype.contains||function(t){return this===t||!!(16&this.compareDocumentPosition(t))};return{on:function(t,e,n){var i=u(e);R[t]=R[t]||[],R[t].push({node:i,callback:n})},off:function(t,e,n){function i(t,e,n){var i=u(e);return t.filter(function(t){var e=t.node===i&&(!n||t.callback===n);return!e})}var r=R[t];r&&(R[t]=1===arguments.length?null:i(r,e,n))},pin:function(t,e){i(X(t),"element","not an element"),i(X(e),"parentElement","not an element"),t.data(Tt,e)},push:function(t,e,n,i){return n=n||{},n.domOperation=i,_(t,e,n)},enabled:function(t,e){var n=arguments.length;if(0===n)e=!!I;else{var i=X(t);if(i){var r=b(t),o=F.get(r);1===n?e=!o:F.put(r,!e)}else e=I=!!t}return e}}}]}],At=["$animateProvider",function(t){function e(t,e){t.data(s,e)}function n(t){t.removeData(s)}function i(t){return t.data(s)}var o="ng-animate-ref",a=this.drivers=[],s="$$animationRunner";this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$HashMap","$$rAFScheduler",function(t,s,l,u,c,d){function m(t){function e(t){if(t.processed)return t;t.processed=!0;var n=t.domNode,i=n.parentNode;o.put(n,t);for(var a;i;){if(a=o.get(i)){a.processed||(a=e(a));break}i=i.parentNode}return(a||r).children.push(t),t}function n(t){var e,n=[],i=[];for(e=0;e<t.children.length;e++)i.push(t.children[e]);var r=i.length,o=0,a=[];for(e=0;e<i.length;e++){var s=i[e];0>=r&&(r=o,o=0,n.push(a),a=[]),a.push(s.fn),s.children.forEach(function(t){o++,i.push(t)}),r--}return a.length&&n.push(a),n}var i,r={children:[]},o=new c;for(i=0;i<t.length;i++){var a=t[i];o.put(a.domNode,t[i]={domNode:a.domNode,fn:a.fn,children:[]})}for(i=0;i<t.length;i++)e(t[i]);return n(r)}var g=[],v=h(t);return function(c,h,y){function $(t){var e="["+o+"]",n=t.hasAttribute(o)?[t]:t.querySelectorAll(e),i=[];return B(n,function(t){var e=t.getAttribute(o);e&&e.length&&i.push(t)}),i}function w(t){var e=[],n={};B(t,function(t,i){var r=t.element,a=b(r),s=t.event,l=["enter","move"].indexOf(s)>=0,u=t.structural?$(a):[];if(u.length){var c=l?"to":"from";B(u,function(t){var e=t.getAttribute(o);n[e]=n[e]||{},n[e][c]={animationID:i,element:H(t)}})}else e.push(t)});var i={},r={};return B(n,function(n,o){var a=n.from,s=n.to;if(!a||!s){var l=a?a.animationID:s.animationID,u=l.toString();return void(i[u]||(i[u]=!0,e.push(t[l])))}var c=t[a.animationID],d=t[s.animationID],h=a.animationID.toString();if(!r[h]){var f=r[h]={structural:!0,beforeStart:function(){c.beforeStart(),d.beforeStart()},close:function(){c.close(),d.close()},classes:x(c.classes,d.classes),from:c,to:d,anchors:[]};f.classes.length?e.push(f):(e.push(c),e.push(d))}r[h].anchors.push({
out:a.element,"in":s.element})}),e}function x(t,e){t=t.split(" "),e=e.split(" ");for(var n=[],i=0;i<t.length;i++){var r=t[i];if("ng-"!==r.substring(0,3))for(var o=0;o<e.length;o++)if(r===e[o]){n.push(r);break}}return n.join(" ")}function C(t){for(var e=a.length-1;e>=0;e--){var n=a[e];if(l.has(n)){var i=l.get(n),r=i(t);if(r)return r}}}function S(){c.addClass(nt),P&&t.addClass(c,P),A&&(t.removeClass(c,A),A=null)}function k(t,e){function n(t){i(t).setHost(e)}t.from&&t.to?(n(t.from.element),n(t.to.element)):n(t.element)}function D(){var t=i(c);!t||"leave"===h&&y.$$domOperationFired||t.end()}function E(e){c.off("$destroy",D),n(c),v(c,y),p(c,y),y.domOperation(),P&&t.removeClass(c,P),c.removeClass(nt),M.complete(!e)}y=f(y);var _=["enter","move","leave"].indexOf(h)>=0,M=new u({end:function(){E()},cancel:function(){E(!0)}});if(!a.length)return E(),M;e(c,M);var T=r(c.attr("class"),r(y.addClass,y.removeClass)),P=y.tempClasses;P&&(T+=" "+P,y.tempClasses=null);var A;return _&&(A="ng-"+h+et,t.addClass(c,A)),g.push({element:c,classes:T,event:h,structural:_,options:y,beforeStart:S,close:E}),c.on("$destroy",D),g.length>1?M:(s.$$postDigest(function(){var t=[];B(g,function(e){i(e.element)?t.push(e):e.close()}),g.length=0;var e=w(t),n=[];B(e,function(t){n.push({domNode:b(t.from?t.from.element:t.element),fn:function(){t.beforeStart();var e,n=t.close,r=t.anchors?t.from.element||t.to.element:t.element;if(i(r)){var o=C(t);o&&(e=o.start)}if(e){var a=e();a.done(function(t){n(!t)}),k(t,a)}else n()}})}),d(m(n))}),M)}}]}],jt=["$animate","$rootScope",function(t,e){return{restrict:"A",transclude:"element",terminal:!0,priority:600,link:function(e,n,i,r,o){var a,s;e.$watchCollection(i.ngAnimateSwap||i["for"],function(i){a&&t.leave(a),s&&(s.$destroy(),s=null),(i||0===i)&&(s=e.$new(),o(s,function(e){a=e,t.enter(e,null,n)}))})}}}];e.module("ngAnimate",[]).directive("ngAnimateSwap",jt).directive("ngAnimateChildren",yt).factory("$$rAFScheduler",vt).provider("$$animateQueue",Pt).provider("$$animation",At).provider("$animateCss",kt).provider("$$animateCssDriver",Dt).provider("$$animateJs",Et).provider("$$animateJsDriver",_t)}(window,window.angular),function(t,e,n){"use strict";function i(t,n,i,r,o,a){function s(t,n){return angular.element((n||e).querySelectorAll(t))}function l(t){return u[t]?u[t]:u[t]=n.get(t,{cache:a}).then(function(t){return t.data})}this.compile=function(e){e.template&&/\.html$/.test(e.template)&&(console.warn("Deprecated use of `template` option to pass a file. Please use the `templateUrl` option instead."),e.templateUrl=e.template,e.template="");var n=e.templateUrl,a=e.template||"",u=e.controller,c=e.controllerAs,d=angular.copy(e.resolve||{}),h=angular.copy(e.locals||{}),f=e.transformTemplate||angular.identity,p=e.bindToController;if(angular.forEach(d,function(t,e){angular.isString(t)?d[e]=i.get(t):d[e]=i.invoke(t)}),angular.extend(d,h),a)d.$template=t.when(a);else{if(!n)throw new Error("Missing `template` / `templateUrl` option.");d.$template=l(n)}return e.contentTemplate&&(d.$template=t.all([d.$template,l(e.contentTemplate)]).then(function(t){var n=angular.element(t[0]),i=s('[ng-bind="content"], [ng-bind="title"]',n[0]).removeAttr("ng-bind").html(t[1]);return e.templateUrl||i.next().remove(),n[0].outerHTML})),t.all(d).then(function(t){var n=f(t.$template);e.html&&(n=n.replace(/ng-bind="/gi,'ng-bind-html="'));var i=angular.element("<div>").html(n.trim()).contents(),a=r(i);return{locals:t,element:i,link:function(e){if(t.$scope=e,u){var n=o(u,t,!0);p&&angular.extend(n.instance,t);var r=angular.isObject(n)?n:n();i.data("$ngControllerController",r),i.children().data("$ngControllerController",r),c&&(e[c]=r)}return a.apply(null,arguments)}}})};var u={}}i.$inject=["$q","$http","$injector","$compile","$controller","$templateCache"],angular.module("mgcrea.ngStrap.typeahead",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$typeahead",function(){var t=this.defaults={animation:"am-fade",prefixClass:"typeahead",prefixEvent:"$typeahead",placement:"bottom-left",templateUrl:"typeahead/typeahead.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,minLength:1,filter:"bsAsyncFilter",limit:6,autoSelect:!1,comparator:"",trimValue:!0};this.$get=["$window","$rootScope","$tooltip","$$rAF","$timeout",function(e,n,i,r,o){function a(e,n,a){var l={},u=angular.extend({},t,a);l=i(e,u);var c=a.scope,d=l.$scope;d.$resetMatches=function(){d.$matches=[],d.$activeIndex=u.autoSelect?0:-1},d.$resetMatches(),d.$activate=function(t){d.$$postDigest(function(){l.activate(t)})},d.$select=function(t,e){d.$$postDigest(function(){l.select(t)})},d.$isVisible=function(){return l.$isVisible()},l.update=function(t){d.$matches=t,d.$activeIndex>=t.length&&(d.$activeIndex=u.autoSelect?0:-1),s(d),r(l.$applyPlacement)},l.activate=function(t){d.$activeIndex=t},l.select=function(t){if(-1!==t){var e=d.$matches[t].value;n.$setViewValue(e),n.$render(),d.$resetMatches(),c&&c.$digest(),d.$emit(u.prefixEvent+".select",e,t,l)}},l.$isVisible=function(){return u.minLength&&n?d.$matches.length&&angular.isString(n.$viewValue)&&n.$viewValue.length>=u.minLength:!!d.$matches.length},l.$getIndex=function(t){var e;for(e=d.$matches.length;e--&&!angular.equals(d.$matches[e].value,t););return e},l.$onMouseDown=function(t){t.preventDefault(),t.stopPropagation()},l.$onKeyDown=function(t){/(38|40|13)/.test(t.keyCode)&&(!l.$isVisible()||13===t.keyCode&&-1===d.$activeIndex||(t.preventDefault(),t.stopPropagation()),13===t.keyCode&&d.$matches.length?l.select(d.$activeIndex):38===t.keyCode&&d.$activeIndex>0?d.$activeIndex--:40===t.keyCode&&d.$activeIndex<d.$matches.length-1?d.$activeIndex++:angular.isUndefined(d.$activeIndex)&&(d.$activeIndex=0),d.$digest())};var h=l.show;l.show=function(){h(),o(function(){l.$element&&(l.$element.on("mousedown",l.$onMouseDown),u.keyboard&&e&&e.on("keydown",l.$onKeyDown))},0,!1)};var f=l.hide;return l.hide=function(){l.$element&&l.$element.off("mousedown",l.$onMouseDown),u.keyboard&&e&&e.off("keydown",l.$onKeyDown),u.autoSelect||l.activate(-1),f()},l}function s(t){t.$$phase||t.$root&&t.$root.$$phase||t.$digest()}return a.defaults=t,a}]}).filter("bsAsyncFilter",["$filter",function(t){return function(e,n,i){return e&&angular.isFunction(e.then)?e.then(function(e){return t("filter")(e,n,i)}):t("filter")(e,n,i)}}]).directive("bsTypeahead",["$window","$parse","$q","$typeahead","$parseOptions",function(t,e,n,i,r){var o=i.defaults;return{restrict:"EAC",require:"ngModel",link:function(t,e,n,a){var s={scope:t};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","filter","limit","minLength","watchOptions","selectMode","autoSelect","comparator","id","prefixEvent","prefixClass"],function(t){angular.isDefined(n[t])&&(s[t]=n[t])});var l=/^(false|0|)$/i;angular.forEach(["html","container","trimValue"],function(t){angular.isDefined(n[t])&&l.test(n[t])&&(s[t]=!1)}),e.attr("autocomplete")||e.attr("autocomplete","off");var u=s.filter||o.filter,c=s.limit||o.limit,d=s.comparator||o.comparator,h=n.bsOptions;u&&(h+=" | "+u+":$viewValue"),d&&(h+=":"+d),c&&(h+=" | limitTo:"+c);var f=r(h),p=i(e,a,s);if(s.watchOptions){var m=f.$match[7].replace(/\|.+/,"").replace(/\(.*\)/g,"").trim();t.$watchCollection(m,function(e,n){f.valuesFn(t,a).then(function(t){p.update(t),a.$render()})})}t.$watch(n.ngModel,function(e,n){t.$modelValue=e,f.valuesFn(t,a).then(function(t){return s.selectMode&&!t.length&&e.length>0?void a.$setViewValue(a.$viewValue.substring(0,a.$viewValue.length-1)):(t.length>c&&(t=t.slice(0,c)),p.update(t),void a.$render())})}),a.$formatters.push(function(t){var e=f.displayValue(t);return e?e:t&&"object"!=typeof t?t:""}),a.$render=function(){if(a.$isEmpty(a.$viewValue))return e.val("");var t=p.$getIndex(a.$modelValue),n=-1!==t?p.$scope.$matches[t].label:a.$viewValue;n=angular.isObject(n)?f.displayValue(n):n;var i=n?n.toString().replace(/<(?:.|\n)*?>/gm,""):"";e.val(s.trimValue===!1?i:i.trim())},t.$on("$destroy",function(){p&&p.destroy(),s=null,p=null})}}}]),angular.module("mgcrea.ngStrap.tooltip",["mgcrea.ngStrap.core","mgcrea.ngStrap.helpers.dimensions"]).provider("$tooltip",function(){var t=this.defaults={animation:"am-fade",customClass:"",prefixClass:"tooltip",prefixEvent:"tooltip",container:!1,target:!1,placement:"top",templateUrl:"tooltip/tooltip.tpl.html",template:"",contentTemplate:!1,trigger:"hover focus",keyboard:!1,html:!1,show:!1,title:"",type:"",delay:0,autoClose:!1,bsEnabled:!0,viewport:{selector:"body",padding:0}};this.$get=["$window","$rootScope","$bsCompiler","$q","$templateCache","$http","$animate","$sce","dimensions","$$rAF","$timeout",function(n,i,r,o,a,s,l,u,c,d,h){function f(o,a){function s(){O.$emit(A.prefixEvent+".show",P)}function f(){if(O.$emit(A.prefixEvent+".hide",P),V===Y){if(U&&"focus"===A.trigger)return o[0].blur();T()}}function y(){var t=A.trigger.split(" ");angular.forEach(t,function(t){"click"===t?o.on("click",P.toggle):"manual"!==t&&(o.on("hover"===t?"mouseenter":"focus",P.enter),o.on("hover"===t?"mouseleave":"blur",P.leave),"button"===F&&"hover"!==t&&o.on(g?"touchstart":"mousedown",P.$onFocusElementMouseDown))})}function b(){for(var t=A.trigger.split(" "),e=t.length;e--;){var n=t[e];"click"===n?o.off("click",P.toggle):"manual"!==n&&(o.off("hover"===n?"mouseenter":"focus",P.enter),o.off("hover"===n?"mouseleave":"blur",P.leave),"button"===F&&"hover"!==n&&o.off(g?"touchstart":"mousedown",P.$onFocusElementMouseDown))}}function $(){"focus"!==A.trigger?V.on("keyup",P.$onKeyUp):o.on("keyup",P.$onFocusKeyUp)}function w(){"focus"!==A.trigger?V.off("keyup",P.$onKeyUp):o.off("keyup",P.$onFocusKeyUp)}function x(){h(function(){V.on("click",S),v.on("click",P.hide),W=!0},0,!1)}function C(){W&&(V.off("click",S),v.off("click",P.hide),W=!1)}function S(t){t.stopPropagation()}function k(t){t=t||A.target||o;var i=t[0],r="BODY"===i.tagName,a=i.getBoundingClientRect(),s={};for(var l in a)s[l]=a[l];null===s.width&&(s=angular.extend({},s,{width:a.right-a.left,height:a.bottom-a.top}));var u=r?{top:0,left:0}:c.offset(i),d={scroll:r?e.documentElement.scrollTop||e.body.scrollTop:t.prop("scrollTop")||0},h=r?{width:e.documentElement.clientWidth,height:n.innerHeight}:null;return angular.extend({},s,d,h,u)}function D(t,e,n,i){var r,o=t.split("-");switch(o[0]){case"right":r={top:e.top+e.height/2-i/2,left:e.left+e.width};break;case"bottom":r={top:e.top+e.height,left:e.left+e.width/2-n/2};break;case"left":r={top:e.top+e.height/2-i/2,left:e.left-n};break;default:r={top:e.top-i,left:e.left+e.width/2-n/2}}if(!o[1])return r;if("top"===o[0]||"bottom"===o[0])switch(o[1]){case"left":r.left=e.left;break;case"right":r.left=e.left+e.width-n}else if("left"===o[0]||"right"===o[0])switch(o[1]){case"top":r.top=e.top-i+e.height;break;case"bottom":r.top=e.top}return r}function E(t,e){var n=V[0],i=n.offsetWidth,r=n.offsetHeight,o=parseInt(c.css(n,"margin-top"),10),a=parseInt(c.css(n,"margin-left"),10);isNaN(o)&&(o=0),isNaN(a)&&(a=0),t.top=t.top+o,t.left=t.left+a,c.setOffset(n,angular.extend({using:function(t){V.css({top:Math.round(t.top)+"px",left:Math.round(t.left)+"px",right:""})}},t),0);var s=n.offsetWidth,l=n.offsetHeight;if("top"===e&&l!==r&&(t.top=t.top+r-l),!/top-left|top-right|bottom-left|bottom-right/.test(e)){var u=_(e,t,s,l);if(u.left?t.left+=u.left:t.top+=u.top,c.setOffset(n,t),/top|right|bottom|left/.test(e)){var d=/top|bottom/.test(e),h=d?2*u.left-i+s:2*u.top-r+l,f=d?"offsetWidth":"offsetHeight";M(h,n[f],d)}}}function _(t,e,n,i){var r={top:0,left:0};if(!P.$viewport)return r;var o=A.viewport&&A.viewport.padding||0,a=k(P.$viewport);if(/right|left/.test(t)){var s=e.top-o-a.scroll,l=e.top+o-a.scroll+i;s<a.top?r.top=a.top-s:l>a.top+a.height&&(r.top=a.top+a.height-l)}else{var u=e.left-o,c=e.left+o+n;u<a.left?r.left=a.left-u:c>a.right&&(r.left=a.left+a.width-c)}return r}function M(t,e,n){var i=m(".tooltip-arrow, .arrow",V[0]);i.css(n?"left":"top",50*(1-t/e)+"%").css(n?"top":"left","")}function T(){clearTimeout(N),P.$isShown&&null!==V&&(A.autoClose&&C(),A.keyboard&&w()),B&&(B.$destroy(),B=null),V&&(V.remove(),V=P.$element=null)}var P={},A=P.$options=angular.extend({},t,a),j=P.$promise=r.compile(A),O=P.$scope=A.scope&&A.scope.$new()||i.$new(),F=o[0].nodeName.toLowerCase();if(A.delay&&angular.isString(A.delay)){var I=A.delay.split(",").map(parseFloat);A.delay=I.length>1?{show:I[0],hide:I[1]}:I[0]}P.$id=A.id||o.attr("id")||"",A.title&&(O.title=u.trustAsHtml(A.title)),O.$setEnabled=function(t){O.$$postDigest(function(){P.setEnabled(t)})},O.$hide=function(){O.$$postDigest(function(){P.hide()})},O.$show=function(){O.$$postDigest(function(){P.show()})},O.$toggle=function(){O.$$postDigest(function(){P.toggle()})},P.$isShown=O.$isShown=!1;var N,R,L,V,H,B;j.then(function(t){L=t,P.init()}),P.init=function(){A.delay&&angular.isNumber(A.delay)&&(A.delay={show:A.delay,hide:A.delay}),"self"===A.container?H=o:angular.isElement(A.container)?H=A.container:A.container&&(H=m(A.container)),y(),A.target&&(A.target=angular.isElement(A.target)?A.target:m(A.target)),A.show&&O.$$postDigest(function(){"focus"===A.trigger?o[0].focus():P.show()})},P.destroy=function(){b(),T(),O.$destroy()},P.enter=function(){return clearTimeout(N),R="in",A.delay&&A.delay.show?void(N=setTimeout(function(){"in"===R&&P.show()},A.delay.show)):P.show()},P.show=function(){if(A.bsEnabled&&!P.$isShown){O.$emit(A.prefixEvent+".show.before",P);var t,e;A.container?(t=H,e=H[0].lastChild?angular.element(H[0].lastChild):null):(t=null,e=o),V&&T(),B=P.$scope.$new(),V=P.$element=L.link(B,function(t,e){}),V.css({top:"-9999px",left:"-9999px",right:"auto",display:"block",visibility:"hidden"}),A.animation&&V.addClass(A.animation),A.type&&V.addClass(A.prefixClass+"-"+A.type),A.customClass&&V.addClass(A.customClass),e?e.after(V):t.prepend(V),P.$isShown=O.$isShown=!0,p(O),P.$applyPlacement(),angular.version.minor<=2?l.enter(V,t,e,s):l.enter(V,t,e).then(s),p(O),d(function(){V&&V.css({visibility:"visible"}),A.keyboard&&("focus"!==A.trigger&&P.focus(),$())}),A.autoClose&&x()}},P.leave=function(){return clearTimeout(N),R="out",A.delay&&A.delay.hide?void(N=setTimeout(function(){"out"===R&&P.hide()},A.delay.hide)):P.hide()};var U,Y;P.hide=function(t){P.$isShown&&(O.$emit(A.prefixEvent+".hide.before",P),U=t,Y=V,angular.version.minor<=2?l.leave(V,f):l.leave(V).then(f),P.$isShown=O.$isShown=!1,p(O),A.keyboard&&null!==V&&w(),A.autoClose&&null!==V&&C())},P.toggle=function(){P.$isShown?P.leave():P.enter()},P.focus=function(){V[0].focus()},P.setEnabled=function(t){A.bsEnabled=t},P.setViewport=function(t){A.viewport=t},P.$applyPlacement=function(){if(V){var e=A.placement,n=/\s?auto?\s?/i,i=n.test(e);i&&(e=e.replace(n,"")||t.placement),V.addClass(A.placement);var r=k(),o=V.prop("offsetWidth"),a=V.prop("offsetHeight");if(P.$viewport=A.viewport&&m(A.viewport.selector||A.viewport),i){var s=e,l=k(P.$viewport);/bottom/.test(s)&&r.bottom+a>l.bottom?e=s.replace("bottom","top"):/top/.test(s)&&r.top-a<l.top&&(e=s.replace("top","bottom")),/left/.test(s)&&r.left-o<l.left?e=e.replace("left","right"):/right/.test(s)&&r.right+o>l.width&&(e=e.replace("right","left")),V.removeClass(s).addClass(e)}var u=D(e,r,o,a);E(u,e)}},P.$onKeyUp=function(t){27===t.which&&P.$isShown&&(P.hide(),t.stopPropagation())},P.$onFocusKeyUp=function(t){27===t.which&&(o[0].blur(),t.stopPropagation())},P.$onFocusElementMouseDown=function(t){t.preventDefault(),t.stopPropagation(),P.$isShown?o[0].blur():o[0].focus()};var W=!1;return P}function p(t){t.$$phase||t.$root&&t.$root.$$phase||t.$digest()}function m(t,n){return angular.element((n||e).querySelectorAll(t))}var g="createTouch"in n.document,v=angular.element(n.document);return f}]}).directive("bsTooltip",["$window","$location","$sce","$tooltip","$$rAF",function(t,e,n,i,r){return{restrict:"EAC",scope:!0,link:function(t,e,o,a){var s,l={scope:t};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","container","delay","trigger","html","animation","backdropAnimation","type","customClass","id"],function(t){angular.isDefined(o[t])&&(l[t]=o[t])});var u=/^(false|0|)$/i;angular.forEach(["html","container"],function(t){angular.isDefined(o[t])&&u.test(o[t])&&(l[t]=!1)});var c=e.attr("data-target");angular.isDefined(c)&&(u.test(c)?l.target=!1:l.target=c),t.hasOwnProperty("title")||(t.title=""),o.$observe("title",function(e){if(angular.isDefined(e)||!t.hasOwnProperty("title")){var i=t.title;t.title=n.trustAsHtml(e),angular.isDefined(i)&&r(function(){s&&s.$applyPlacement()})}}),o.bsTooltip&&t.$watch(o.bsTooltip,function(e,n){angular.isObject(e)?angular.extend(t,e):t.title=e,angular.isDefined(n)&&r(function(){s&&s.$applyPlacement()})},!0),o.bsShow&&t.$watch(o.bsShow,function(t,e){s&&angular.isDefined(t)&&(angular.isString(t)&&(t=!!t.match(/true|,?(tooltip),?/i)),t===!0?s.show():s.hide())}),o.bsEnabled&&t.$watch(o.bsEnabled,function(t,e){s&&angular.isDefined(t)&&(angular.isString(t)&&(t=!!t.match(/true|1|,?(tooltip),?/i)),t===!1?s.setEnabled(!1):s.setEnabled(!0))}),o.viewport&&t.$watch(o.viewport,function(t){s&&angular.isDefined(t)&&s.setViewport(t)}),s=i(e,l),t.$on("$destroy",function(){s&&s.destroy(),l=null,s=null})}}}]),angular.module("mgcrea.ngStrap.timepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$timepicker",function(){var t=this.defaults={animation:"am-fade",prefixClass:"timepicker",placement:"bottom-left",templateUrl:"timepicker/timepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!0,timeType:"date",timeFormat:"shortTime",timezone:null,modelTimeFormat:null,autoclose:!1,minTime:-(1/0),maxTime:+(1/0),length:5,hourStep:1,minuteStep:5,secondStep:5,roundDisplay:!1,iconUp:"glyphicon glyphicon-chevron-up",iconDown:"glyphicon glyphicon-chevron-down",arrowBehavior:"pager"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","$tooltip","$timeout",function(e,n,i,r,o,a,s){function l(e,n,i){function r(t){var e=6e4*p.minuteStep;return new Date(Math.floor(t.getTime()/e)*e)}function l(t,n){var i=t+n;if(e[0].createTextRange){var r=e[0].createTextRange();r.collapse(!0),r.moveStart("character",t),r.moveEnd("character",i),r.select()}else e[0].setSelectionRange?e[0].setSelectionRange(t,i):angular.isUndefined(e[0].selectionStart)&&(e[0].selectionStart=t,e[0].selectionEnd=i)}function d(){e[0].focus()}var h=a(e,angular.extend({},t,i)),f=i.scope,p=h.$options,m=h.$scope,g=p.lang,v=function(t,e,n){return o.formatDate(t,e,g,n)},y=0,b=p.roundDisplay?r(new Date):new Date,$=n.$dateValue||b,w={hour:$.getHours(),meridian:$.getHours()<12,minute:$.getMinutes(),second:$.getSeconds(),millisecond:$.getMilliseconds()},x=o.getDatetimeFormat(p.timeFormat,g),C=o.hoursFormat(x),S=o.timeSeparator(x),k=o.minutesFormat(x),D=o.secondsFormat(x),E=o.showSeconds(x),_=o.showAM(x);m.$iconUp=p.iconUp,m.$iconDown=p.iconDown,m.$select=function(t,e){h.select(t,e)},m.$moveIndex=function(t,e){h.$moveIndex(t,e)},m.$switchMeridian=function(t){h.switchMeridian(t)},h.update=function(t){angular.isDate(t)&&!isNaN(t.getTime())?(h.$date=t,angular.extend(w,{hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds()}),h.$build()):h.$isBuilt||h.$build()},h.select=function(t,e,i){n.$dateValue&&!isNaN(n.$dateValue.getTime())||(n.$dateValue=new Date(1970,0,1)),angular.isDate(t)||(t=new Date(t)),0===e?n.$dateValue.setHours(t.getHours()):1===e?n.$dateValue.setMinutes(t.getMinutes()):2===e&&n.$dateValue.setSeconds(t.getSeconds()),n.$setViewValue(angular.copy(n.$dateValue)),n.$render(),p.autoclose&&!i&&s(function(){h.hide(!0)})},h.switchMeridian=function(t){if(n.$dateValue&&!isNaN(n.$dateValue.getTime())){var e=(t||n.$dateValue).getHours();n.$dateValue.setHours(12>e?e+12:e-12),n.$setViewValue(angular.copy(n.$dateValue)),n.$render()}},h.$build=function(){var t,e,n=m.midIndex=parseInt(p.length/2,10),i=[];for(t=0;t<p.length;t++)e=new Date(1970,0,1,w.hour-(n-t)*p.hourStep),i.push({date:e,label:v(e,C),selected:h.$date&&h.$isSelected(e,0),disabled:h.$isDisabled(e,0)});var r,o=[];for(t=0;t<p.length;t++)r=new Date(1970,0,1,0,w.minute-(n-t)*p.minuteStep),o.push({date:r,label:v(r,k),selected:h.$date&&h.$isSelected(r,1),disabled:h.$isDisabled(r,1)});var a,s=[];for(t=0;t<p.length;t++)a=new Date(1970,0,1,0,0,w.second-(n-t)*p.secondStep),s.push({date:a,label:v(a,D),selected:h.$date&&h.$isSelected(a,2),disabled:h.$isDisabled(a,2)});var l=[];for(t=0;t<p.length;t++)E?l.push([i[t],o[t],s[t]]):l.push([i[t],o[t]]);m.rows=l,m.showSeconds=E,m.showAM=_,m.isAM=(h.$date||i[n].date).getHours()<12,m.timeSeparator=S,h.$isBuilt=!0},h.$isSelected=function(t,e){return h.$date?0===e?t.getHours()===h.$date.getHours():1===e?t.getMinutes()===h.$date.getMinutes():2===e?t.getSeconds()===h.$date.getSeconds():void 0:!1},h.$isDisabled=function(t,e){var n;return 0===e?n=t.getTime()+6e4*w.minute+1e3*w.second:1===e?n=t.getTime()+36e5*w.hour+1e3*w.second:2===e&&(n=t.getTime()+36e5*w.hour+6e4*w.minute),n<1*p.minTime||n>1*p.maxTime},m.$arrowAction=function(t,e){"picker"===p.arrowBehavior?h.$setTimeByStep(t,e):h.$moveIndex(t,e)},h.$setTimeByStep=function(t,e){var n=new Date(h.$date||$),i=n.getHours(),r=n.getMinutes(),o=n.getSeconds();0===e?n.setHours(i-parseInt(p.hourStep,10)*t):1===e?n.setMinutes(r-parseInt(p.minuteStep,10)*t):2===e&&n.setSeconds(o-parseInt(p.secondStep,10)*t),h.select(n,e,!0)},h.$moveIndex=function(t,e){var n;0===e?(n=new Date(1970,0,1,w.hour+t*p.length,w.minute,w.second),angular.extend(w,{hour:n.getHours()})):1===e?(n=new Date(1970,0,1,w.hour,w.minute+t*p.length*p.minuteStep,w.second),angular.extend(w,{minute:n.getMinutes()})):2===e&&(n=new Date(1970,0,1,w.hour,w.minute,w.second+t*p.length*p.secondStep),angular.extend(w,{second:n.getSeconds()})),h.$build()},h.$onMouseDown=function(t){if("input"!==t.target.nodeName.toLowerCase()&&t.preventDefault(),t.stopPropagation(),c){var e=angular.element(t.target);"button"!==e[0].nodeName.toLowerCase()&&(e=e.parent()),e.triggerHandler("click")}},h.$onKeyDown=function(t){if(/(38|37|39|40|13)/.test(t.keyCode)&&!t.shiftKey&&!t.altKey){if(t.preventDefault(),t.stopPropagation(),13===t.keyCode)return void h.hide(!0);var e=new Date(h.$date),n=e.getHours(),i=v(e,C).length,r=e.getMinutes(),o=v(e,k).length,a=e.getSeconds(),s=v(e,D).length,u=1,c=/(37|39)/.test(t.keyCode),d=2+1*E+1*_;c&&(37===t.keyCode?y=1>y?d-1:y-1:39===t.keyCode&&(y=d-1>y?y+1:0));var m=[0,i],g=0;38===t.keyCode&&(g=-1),40===t.keyCode&&(g=1);var b=2===y&&E,$=2===y&&!E||3===y&&E;0===y?(e.setHours(n+g*parseInt(p.hourStep,10)),i=v(e,C).length,m=[0,i]):1===y?(e.setMinutes(r+g*parseInt(p.minuteStep,10)),o=v(e,k).length,m=[i+u,o]):b?(e.setSeconds(a+g*parseInt(p.secondStep,10)),s=v(e,D).length,m=[i+u+o+u,s]):$&&(c||h.switchMeridian(),m=[i+u+o+u+(s+u)*E,2]),h.select(e,y,!0),l(m[0],m[1]),f.$digest()}};var M=h.init;h.init=function(){return u&&p.useNative?(e.prop("type","time"),void e.css("-webkit-appearance","textfield")):(c&&(e.prop("type","text"),e.attr("readonly","true"),e.on("click",d)),void M())};var T=h.destroy;h.destroy=function(){u&&p.useNative&&e.off("click",d),T()};var P=h.show;h.show=function(){!c&&e.attr("readonly")||e.attr("disabled")||(P(),s(function(){h.$element&&h.$element.on(c?"touchstart":"mousedown",h.$onMouseDown),p.keyboard&&e&&e.on("keydown",h.$onKeyDown)},0,!1))};var A=h.hide;return h.hide=function(t){h.$isShown&&(h.$element&&h.$element.off(c?"touchstart":"mousedown",h.$onMouseDown),p.keyboard&&e&&e.off("keydown",h.$onKeyDown),A(t))},h}var u=/(ip[ao]d|iphone|android)/gi.test(e.navigator.userAgent),c="createTouch"in e.document&&u;return t.lang||(t.lang=o.getDefaultLocale()),l.defaults=t,l}]}).directive("bsTimepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$timepicker",function(t,e,i,r,o,a){var s=a.defaults,l=/(ip[ao]d|iphone|android)/gi.test(t.navigator.userAgent);return{restrict:"EAC",require:"ngModel",link:function(t,e,i,u){function c(t){if(angular.isDate(t)){var e=isNaN(h.minTime)||new Date(t.getTime()).setFullYear(1970,0,1)>=h.minTime,n=isNaN(h.maxTime)||new Date(t.getTime()).setFullYear(1970,0,1)<=h.maxTime,i=e&&n;u.$setValidity("date",i),u.$setValidity("min",e),u.$setValidity("max",n),i&&(u.$dateValue=t)}}function d(){return!u.$dateValue||isNaN(u.$dateValue.getTime())?"":g(u.$dateValue,h.timeFormat)}var h={scope:t};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","autoclose","timeType","timeFormat","timezone","modelTimeFormat","useNative","hourStep","minuteStep","secondStep","length","arrowBehavior","iconUp","iconDown","roundDisplay","id","prefixClass","prefixEvent"],function(t){angular.isDefined(i[t])&&(h[t]=i[t])});var f=/^(false|0|)$/i;angular.forEach(["html","container","autoclose","useNative","roundDisplay"],function(t){angular.isDefined(i[t])&&f.test(i[t])&&(h[t]=!1)}),l&&(h.useNative||s.useNative)&&(h.timeFormat="HH:mm");var p=a(e,u,h);h=p.$options;var m=h.lang,g=function(t,e,n){return r.formatDate(t,e,m,n)};i.bsShow&&t.$watch(i.bsShow,function(t,e){p&&angular.isDefined(t)&&(angular.isString(t)&&(t=!!t.match(/true|,?(timepicker),?/i)),t===!0?p.show():p.hide())});var v=o({format:h.timeFormat,lang:m});angular.forEach(["minTime","maxTime"],function(t){angular.isDefined(i[t])&&i.$observe(t,function(e){p.$options[t]=v.getTimeForAttribute(t,e),isNaN(p.$options[t])||p.$build(),c(u.$dateValue)})}),t.$watch(i.ngModel,function(t,e){p.update(u.$dateValue)},!0),u.$parsers.unshift(function(t){var e;if(!t)return u.$setValidity("date",!0),null;var i=angular.isDate(t)?t:v.parse(t,u.$dateValue);return!i||isNaN(i.getTime())?(u.$setValidity("date",!1),n):(c(i),"string"===h.timeType?(e=v.timezoneOffsetAdjust(i,h.timezone,!0),g(e,h.modelTimeFormat||h.timeFormat)):(e=v.timezoneOffsetAdjust(u.$dateValue,h.timezone,!0),"number"===h.timeType?e.getTime():"unix"===h.timeType?e.getTime()/1e3:"iso"===h.timeType?e.toISOString():new Date(e)))}),u.$formatters.push(function(t){var e;return e=angular.isUndefined(t)||null===t?NaN:angular.isDate(t)?t:"string"===h.timeType?v.parse(t,null,h.modelTimeFormat):"unix"===h.timeType?new Date(1e3*t):new Date(t),u.$dateValue=v.timezoneOffsetAdjust(e,h.timezone),d()}),u.$render=function(){e.val(d())},t.$on("$destroy",function(){p&&p.destroy(),h=null,p=null})}}}]),angular.module("mgcrea.ngStrap.tab",[]).provider("$tab",function(){var t=this.defaults={animation:"am-fade",template:"tab/tab.tpl.html",navClass:"nav-tabs",activeClass:"active"},e=this.controller=function(e,n,i){var r=this;r.$options=angular.copy(t),angular.forEach(["animation","navClass","activeClass"],function(t){angular.isDefined(i[t])&&(r.$options[t]=i[t])}),e.$navClass=r.$options.navClass,e.$activeClass=r.$options.activeClass,r.$panes=e.$panes=[],r.$activePaneChangeListeners=r.$viewChangeListeners=[],r.$push=function(t){angular.isUndefined(r.$panes.$active)&&e.$setActive(t.name||0),r.$panes.push(t)},r.$remove=function(t){var e,n=r.$panes.indexOf(t),i=r.$panes.$active;e=angular.isString(i)?r.$panes.map(function(t){return t.name}).indexOf(i):r.$panes.$active,r.$panes.splice(n,1),e>n?e--:n===e&&e===r.$panes.length&&e--,e>=0&&e<r.$panes.length?r.$setActive(r.$panes[e].name||e):r.$setActive()},r.$setActive=e.$setActive=function(t){r.$panes.$active=t,r.$activePaneChangeListeners.forEach(function(t){t()})},r.$isActive=e.$isActive=function(t,e){return r.$panes.$active===t.name||r.$panes.$active===e}};this.$get=function(){var n={};return n.defaults=t,n.controller=e,n}}).directive("bsTabs",["$window","$animate","$tab","$parse",function(t,e,n,i){var r=n.defaults;return{require:["?ngModel","bsTabs"],transclude:!0,scope:!0,controller:["$scope","$element","$attrs",n.controller],templateUrl:function(t,e){return e.template||r.template},link:function(t,e,n,r){var o=r[0],a=r[1];if(o&&(a.$activePaneChangeListeners.push(function(){o.$setViewValue(a.$panes.$active)}),o.$formatters.push(function(t){return a.$setActive(t),t})),n.bsActivePane){var s=i(n.bsActivePane);a.$activePaneChangeListeners.push(function(){s.assign(t,a.$panes.$active)}),t.$watch(n.bsActivePane,function(t,e){a.$setActive(t)},!0)}}}}]).directive("bsPane",["$window","$animate","$sce",function(t,e,n){return{require:["^?ngModel","^bsTabs"],scope:!0,link:function(t,i,r,o){function a(){var n=s.$panes.indexOf(t);e[s.$isActive(t,n)?"addClass":"removeClass"](i,s.$options.activeClass)}var s=o[1];i.addClass("tab-pane"),r.$observe("title",function(e,i){t.title=n.trustAsHtml(e)}),t.name=r.name,s.$options.animation&&i.addClass(s.$options.animation),r.$observe("disabled",function(e,n){t.disabled=t.$eval(e)}),s.$push(t),t.$on("$destroy",function(){s.$remove(t)}),s.$activePaneChangeListeners.push(function(){a()}),a()}}}]),angular.module("mgcrea.ngStrap.select",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$select",function(){var t=this.defaults={animation:"am-fade",prefixClass:"select",prefixEvent:"$select",placement:"bottom-left",templateUrl:"select/select.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,multiple:!1,allNoneButtons:!1,sort:!0,caretHtml:'&nbsp;<span class="caret"></span>',placeholder:"Choose among the following...",allText:"All",noneText:"None",maxLength:3,maxLengthHtml:"selected",iconCheckmark:"glyphicon glyphicon-ok"};this.$get=["$window","$document","$rootScope","$tooltip","$timeout",function(e,n,i,r,o){function a(i,a,s){var u={},c=angular.extend({},t,s);u=r(i,c);var d=u.$scope;d.$matches=[],c.multiple?d.$activeIndex=[]:d.$activeIndex=-1,d.$isMultiple=c.multiple,d.$showAllNoneButtons=c.allNoneButtons&&c.multiple,d.$iconCheckmark=c.iconCheckmark,d.$allText=c.allText,d.$noneText=c.noneText,d.$activate=function(t){d.$$postDigest(function(){u.activate(t)})},d.$select=function(t,e){d.$$postDigest(function(){u.select(t)})},d.$isVisible=function(){return u.$isVisible()},d.$isActive=function(t){return u.$isActive(t)},d.$selectAll=function(){for(var t=0;t<d.$matches.length;t++)d.$isActive(t)||d.$select(t)},d.$selectNone=function(){for(var t=0;t<d.$matches.length;t++)d.$isActive(t)&&d.$select(t)},u.update=function(t){d.$matches=t,u.$updateActiveIndex()},u.activate=function(t){return c.multiple?(u.$isActive(t)?d.$activeIndex.splice(d.$activeIndex.indexOf(t),1):d.$activeIndex.push(t),c.sort&&d.$activeIndex.sort(function(t,e){return t-e})):d.$activeIndex=t,d.$activeIndex},u.select=function(t){var e=d.$matches[t].value;d.$apply(function(){u.activate(t),c.multiple?a.$setViewValue(d.$activeIndex.map(function(t){return angular.isUndefined(d.$matches[t])?null:d.$matches[t].value})):(a.$setViewValue(e),u.hide())}),d.$emit(c.prefixEvent+".select",e,t,u)},u.$updateActiveIndex=function(){c.multiple?angular.isArray(a.$modelValue)?d.$activeIndex=a.$modelValue.map(function(t){return u.$getIndex(t)}):d.$activeIndex=[]:angular.isDefined(a.$modelValue)&&d.$matches.length?d.$activeIndex=u.$getIndex(a.$modelValue):d.$activeIndex=-1},u.$isVisible=function(){return c.minLength&&a?d.$matches.length&&a.$viewValue.length>=c.minLength:d.$matches.length},u.$isActive=function(t){return c.multiple?-1!==d.$activeIndex.indexOf(t):d.$activeIndex===t},u.$getIndex=function(t){var e;for(e=d.$matches.length;e--&&!angular.equals(d.$matches[e].value,t););return e},u.$onMouseDown=function(t){if(t.preventDefault(),t.stopPropagation(),l){var e=angular.element(t.target);e.triggerHandler("click")}},u.$onKeyDown=function(t){return/(9|13|38|40)/.test(t.keyCode)?(9!==t.keyCode&&(t.preventDefault(),t.stopPropagation()),c.multiple&&9===t.keyCode?u.hide():c.multiple||13!==t.keyCode&&9!==t.keyCode?void(c.multiple||(38===t.keyCode&&d.$activeIndex>0?d.$activeIndex--:38===t.keyCode&&d.$activeIndex<0?d.$activeIndex=d.$matches.length-1:40===t.keyCode&&d.$activeIndex<d.$matches.length-1?d.$activeIndex++:angular.isUndefined(d.$activeIndex)&&(d.$activeIndex=0),d.$digest())):u.select(d.$activeIndex)):void 0},u.$isIE=function(){var t=e.navigator.userAgent;return t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0},u.$selectScrollFix=function(t){"UL"===n[0].activeElement.tagName&&(t.preventDefault(),
t.stopImmediatePropagation(),t.target.focus())};var h=u.show;u.show=function(){h(),c.multiple&&u.$element.addClass("select-multiple"),o(function(){u.$element.on(l?"touchstart":"mousedown",u.$onMouseDown),c.keyboard&&i.on("keydown",u.$onKeyDown)},0,!1)};var f=u.hide;return u.hide=function(){!c.multiple&&angular.isUndefined(a.$modelValue)&&(d.$activeIndex=-1),u.$element.off(l?"touchstart":"mousedown",u.$onMouseDown),c.keyboard&&i.off("keydown",u.$onKeyDown),f(!0)},u}var s=/(ip[ao]d|iphone|android)/gi.test(e.navigator.userAgent),l="createTouch"in e.document&&s;return a.defaults=t,a}]}).directive("bsSelect",["$window","$parse","$q","$select","$parseOptions",function(t,e,n,i,r){var o=i.defaults;return{restrict:"EAC",require:"ngModel",link:function(t,e,n,a){var s={scope:t,placeholder:o.placeholder};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","placeholder","allNoneButtons","maxLength","maxLengthHtml","allText","noneText","iconCheckmark","autoClose","id","sort","caretHtml","prefixClass","prefixEvent"],function(t){angular.isDefined(n[t])&&(s[t]=n[t])});var l=/^(false|0|)$/i;angular.forEach(["html","container","allNoneButtons","sort"],function(t){angular.isDefined(n[t])&&l.test(n[t])&&(s[t]=!1)});var u=e.attr("data-multiple");if(angular.isDefined(u)&&(l.test(u)?s.multiple=!1:s.multiple=u),"select"===e[0].nodeName.toLowerCase()){var c=e;c.css("display","none"),e=angular.element('<button type="button" class="btn btn-default"></button>'),c.after(e)}var d=r(n.bsOptions),h=i(e,a,s);h.$isIE()&&e[0].addEventListener("blur",h.$selectScrollFix);var f=d.$match[7].replace(/\|.+/,"").trim();t.$watch(f,function(e,n){d.valuesFn(t,a).then(function(t){h.update(t),a.$render()})},!0),t.$watch(n.ngModel,function(t,e){h.$updateActiveIndex(),a.$render()},!0),a.$render=function(){var t,n;s.multiple&&angular.isArray(a.$modelValue)?(t=a.$modelValue.map(function(t){return n=h.$getIndex(t),-1!==n?h.$scope.$matches[n].label:!1}).filter(angular.isDefined),t=t.length>(s.maxLength||o.maxLength)?t.length+" "+(s.maxLengthHtml||o.maxLengthHtml):t.join(", ")):(n=h.$getIndex(a.$modelValue),t=-1!==n?h.$scope.$matches[n].label:!1),e.html((t?t:s.placeholder)+(s.caretHtml?s.caretHtml:o.caretHtml))},s.multiple&&(a.$isEmpty=function(t){return!t||0===t.length}),t.$on("$destroy",function(){h&&h.destroy(),s=null,h=null})}}}]),angular.module("mgcrea.ngStrap.popover",["mgcrea.ngStrap.tooltip"]).provider("$popover",function(){var t=this.defaults={animation:"am-fade",customClass:"",container:!1,target:!1,placement:"right",templateUrl:"popover/popover.tpl.html",contentTemplate:!1,trigger:"click",keyboard:!0,html:!1,title:"",content:"",delay:0,autoClose:!1};this.$get=["$tooltip",function(e){function n(n,i){var r=angular.extend({},t,i),o=e(n,r);return r.content&&(o.$scope.content=r.content),o}return n}]}).directive("bsPopover",["$window","$sce","$popover",function(t,e,n){var i=t.requestAnimationFrame||t.setTimeout;return{restrict:"EAC",scope:!0,link:function(t,r,o){var a,s={scope:t};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","container","delay","trigger","html","animation","customClass","autoClose","id","prefixClass","prefixEvent"],function(t){angular.isDefined(o[t])&&(s[t]=o[t])});var l=/^(false|0|)$/i;angular.forEach(["html","container","autoClose"],function(t){angular.isDefined(o[t])&&l.test(o[t])&&(s[t]=!1)});var u=r.attr("data-target");angular.isDefined(u)&&(l.test(u)?s.target=!1:s.target=u),angular.forEach(["title","content"],function(n){o[n]&&o.$observe(n,function(r,o){t[n]=e.trustAsHtml(r),angular.isDefined(o)&&i(function(){a&&a.$applyPlacement()})})}),o.bsPopover&&t.$watch(o.bsPopover,function(e,n){angular.isObject(e)?angular.extend(t,e):t.content=e,angular.isDefined(n)&&i(function(){a&&a.$applyPlacement()})},!0),o.bsShow&&t.$watch(o.bsShow,function(t,e){a&&angular.isDefined(t)&&(angular.isString(t)&&(t=!!t.match(/true|,?(popover),?/i)),t===!0?a.show():a.hide())}),o.viewport&&t.$watch(o.viewport,function(t){a&&angular.isDefined(t)&&a.setViewport(t)}),a=n(r,s),t.$on("$destroy",function(){a&&a.destroy(),s=null,a=null})}}}]),angular.module("mgcrea.ngStrap.scrollspy",["mgcrea.ngStrap.helpers.debounce","mgcrea.ngStrap.helpers.dimensions"]).provider("$scrollspy",function(){var t=this.$$spies={},n=this.defaults={debounce:150,throttle:100,offset:100};this.$get=["$window","$document","$rootScope","dimensions","debounce","throttle",function(i,r,o,a,s,l){function u(t,e){return t[0].nodeName&&t[0].nodeName.toLowerCase()===e.toLowerCase()}function c(r){var c=angular.extend({},n,r);c.element||(c.element=f);var p=u(c.element,"body"),m=p?d:c.element,g=p?"window":c.id;if(t[g])return t[g].$$count++,t[g];var v,y,b,$,w,x,C,S,k={},D=k.$trackedElements=[],E=[];return k.init=function(){this.$$count=1,$=s(this.checkPosition,c.debounce),w=l(this.checkPosition,c.throttle),m.on("click",this.checkPositionWithEventLoop),d.on("resize",$),m.on("scroll",w),x=s(this.checkOffsets,c.debounce),v=o.$on("$viewContentLoaded",x),y=o.$on("$includeContentLoaded",x),x(),g&&(t[g]=k)},k.destroy=function(){this.$$count--,this.$$count>0||(m.off("click",this.checkPositionWithEventLoop),d.off("resize",$),m.off("scroll",w),v(),y(),g&&delete t[g])},k.checkPosition=function(){if(E.length){if(S=(p?i.pageYOffset:m.prop("scrollTop"))||0,C=Math.max(i.innerHeight,h.prop("clientHeight")),S<E[0].offsetTop&&b!==E[0].target)return k.$activateElement(E[0]);for(var t=E.length;t--;)if(!angular.isUndefined(E[t].offsetTop)&&null!==E[t].offsetTop&&b!==E[t].target&&!(S<E[t].offsetTop||E[t+1]&&S>E[t+1].offsetTop))return k.$activateElement(E[t])}},k.checkPositionWithEventLoop=function(){setTimeout(k.checkPosition,1)},k.$activateElement=function(t){if(b){var e=k.$getTrackedElement(b);e&&(e.source.removeClass("active"),u(e.source,"li")&&u(e.source.parent().parent(),"li")&&e.source.parent().parent().removeClass("active"))}b=t.target,t.source.addClass("active"),u(t.source,"li")&&u(t.source.parent().parent(),"li")&&t.source.parent().parent().addClass("active")},k.$getTrackedElement=function(t){return D.filter(function(e){return e.target===t})[0]},k.checkOffsets=function(){angular.forEach(D,function(t){var n=e.querySelector(t.target);t.offsetTop=n?a.offset(n).top:null,c.offset&&null!==t.offsetTop&&(t.offsetTop-=1*c.offset)}),E=D.filter(function(t){return null!==t.offsetTop}).sort(function(t,e){return t.offsetTop-e.offsetTop}),$()},k.trackElement=function(t,e){D.push({target:t,source:e})},k.untrackElement=function(t,e){for(var n,i=D.length;i--;)if(D[i].target===t&&D[i].source===e){n=i;break}D=D.splice(n,1)},k.activate=function(t){D[t].addClass("active")},k.init(),k}var d=angular.element(i),h=angular.element(r.prop("documentElement")),f=angular.element(i.document.body);return c}]}).directive("bsScrollspy",["$rootScope","debounce","dimensions","$scrollspy",function(t,e,n,i){return{restrict:"EAC",link:function(t,e,n){var r={scope:t};angular.forEach(["offset","target"],function(t){angular.isDefined(n[t])&&(r[t]=n[t])});var o=i(r);o.trackElement(r.target,e),t.$on("$destroy",function(){o&&(o.untrackElement(r.target,e),o.destroy()),r=null,o=null})}}}]).directive("bsScrollspyList",["$rootScope","debounce","dimensions","$scrollspy",function(t,e,n,i){return{restrict:"A",compile:function(t,e){var n=t[0].querySelectorAll("li > a[href]");angular.forEach(n,function(t){var e=angular.element(t);e.parent().attr("bs-scrollspy","").attr("data-target",e.attr("href"))})}}}]),angular.module("mgcrea.ngStrap.navbar",[]).provider("$navbar",function(){var t=this.defaults={activeClass:"active",routeAttr:"data-match-route",strict:!1};this.$get=function(){return{defaults:t}}}).directive("bsNavbar",["$window","$location","$navbar",function(t,e,n){var i=n.defaults;return{restrict:"A",link:function(t,n,r,o){var a=angular.copy(i);angular.forEach(Object.keys(i),function(t){angular.isDefined(r[t])&&(a[t]=r[t])}),t.$watch(function(){return e.path()},function(t,e){var i=n[0].querySelectorAll("li["+a.routeAttr+"]");angular.forEach(i,function(e){var n=angular.element(e),i=n.attr(a.routeAttr).replace("/","\\/");a.strict&&(i="^"+i+"$");var r=new RegExp(i,"i");r.test(t)?n.addClass(a.activeClass):n.removeClass(a.activeClass)})})}}}]),angular.module("mgcrea.ngStrap.modal",["mgcrea.ngStrap.core","mgcrea.ngStrap.helpers.dimensions"]).provider("$modal",function(){var t=this.defaults={animation:"am-fade",backdropAnimation:"am-fade",customClass:"",prefixClass:"modal",prefixEvent:"modal",placement:"top",templateUrl:"modal/modal.tpl.html",template:"",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$window","$rootScope","$bsCompiler","$animate","$timeout","$sce","dimensions",function(n,i,r,o,a,s,l){function u(e){function n(){D.$emit(S.prefixEvent+".show",C)}function a(){D.$emit(S.prefixEvent+".hide",C),p.removeClass(S.prefixClass+"-open"),S.animation&&p.removeClass(S.prefixClass+"-with-"+S.animation)}function l(){S.backdrop&&(_.on("click",$),T.on("click",$),T.on("wheel",w))}function u(){S.backdrop&&(_.off("click",$),T.off("click",$),T.off("wheel",w))}function y(){S.keyboard&&_.on("keyup",C.$onKeyUp)}function b(){S.keyboard&&_.off("keyup",C.$onKeyUp)}function $(t){t.target===t.currentTarget&&("static"===S.backdrop?C.focus():C.hide())}function w(t){t.preventDefault()}function x(){C.$isShown&&null!==_&&(u(),b()),M&&(M.$destroy(),M=null),_&&(_.remove(),_=C.$element=null)}var C={},S=C.$options=angular.extend({},t,e),k=C.$promise=r.compile(S),D=C.$scope=S.scope&&S.scope.$new()||i.$new();S.element||S.container||(S.container="body"),C.$id=S.id||S.element&&S.element.attr("id")||"",h(["title","content"],function(t){S[t]&&(D[t]=s.trustAsHtml(S[t]))}),D.$hide=function(){D.$$postDigest(function(){C.hide()})},D.$show=function(){D.$$postDigest(function(){C.show()})},D.$toggle=function(){D.$$postDigest(function(){C.toggle()})},C.$isShown=D.$isShown=!1;var E,_,M,T=angular.element('<div class="'+S.prefixClass+'-backdrop"/>');return T.css({position:"fixed",top:"0px",left:"0px",bottom:"0px",right:"0px"}),k.then(function(t){E=t,C.init()}),C.init=function(){S.show&&D.$$postDigest(function(){C.show()})},C.destroy=function(){x(),T&&(T.remove(),T=null),D.$destroy()},C.show=function(){if(!C.$isShown){var t,e;if(angular.isElement(S.container)?(t=S.container,e=S.container[0].lastChild?angular.element(S.container[0].lastChild):null):S.container?(t=d(S.container),e=t[0]&&t[0].lastChild?angular.element(t[0].lastChild):null):(t=null,e=S.element),_&&x(),M=C.$scope.$new(),_=C.$element=E.link(M,function(t,e){}),S.backdrop&&(_.css({"z-index":g+20*m}),T.css({"z-index":v+20*m}),m++),!D.$emit(S.prefixEvent+".show.before",C).defaultPrevented){_.css({display:"block"}).addClass(S.placement),S.customClass&&_.addClass(S.customClass),S.animation&&(S.backdrop&&T.addClass(S.backdropAnimation),_.addClass(S.animation)),S.backdrop&&o.enter(T,p,null),angular.version.minor<=2?o.enter(_,t,e,n):o.enter(_,t,e).then(n),C.$isShown=D.$isShown=!0,c(D);var i=_[0];f(function(){i.focus()}),p.addClass(S.prefixClass+"-open"),S.animation&&p.addClass(S.prefixClass+"-with-"+S.animation),l(),y()}}},C.hide=function(){C.$isShown&&(S.backdrop&&m--,D.$emit(S.prefixEvent+".hide.before",C).defaultPrevented||(angular.version.minor<=2?o.leave(_,a):o.leave(_).then(a),S.backdrop&&o.leave(T),C.$isShown=D.$isShown=!1,c(D),u(),b()))},C.toggle=function(){C.$isShown?C.hide():C.show()},C.focus=function(){_[0].focus()},C.$onKeyUp=function(t){27===t.which&&C.$isShown&&(C.hide(),t.stopPropagation())},C}function c(t){t.$$phase||t.$root&&t.$root.$$phase||t.$digest()}function d(t,n){return angular.element((n||e).querySelectorAll(t))}var h=angular.forEach,f=n.requestAnimationFrame||n.setTimeout,p=angular.element(n.document.body),m=0,g=1050,v=1040;return u}]}).directive("bsModal",["$window","$sce","$modal",function(t,e,n){return{restrict:"EAC",scope:!0,link:function(t,i,r,o){var a={scope:t,element:i,show:!1};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","backdrop","keyboard","html","container","animation","backdropAnimation","id","prefixEvent","prefixClass","customClass","modalClass"],function(t){angular.isDefined(r[t])&&(a[t]=r[t])}),a.modalClass&&(a.customClass=a.modalClass);var s=/^(false|0|)$/i;angular.forEach(["backdrop","keyboard","html","container"],function(t){angular.isDefined(r[t])&&s.test(r[t])&&(a[t]=!1)}),angular.forEach(["title","content"],function(n){r[n]&&r.$observe(n,function(i,r){t[n]=e.trustAsHtml(i)})}),r.bsModal&&t.$watch(r.bsModal,function(e,n){angular.isObject(e)?angular.extend(t,e):t.content=e},!0);var l=n(a);i.on(r.trigger||"click",l.toggle),t.$on("$destroy",function(){l&&l.destroy(),a=null,l=null})}}}]),angular.version.minor<3&&angular.version.dot<14&&angular.module("ng").factory("$$rAF",["$window","$timeout",function(t,e){var n=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame,i=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.webkitCancelRequestAnimationFrame,r=!!n,o=r?function(t){var e=n(t);return function(){i(e)}}:function(t){var n=e(t,16.66,!1);return function(){e.cancel(n)}};return o.supported=r,o}]),angular.module("mgcrea.ngStrap.helpers.parseOptions",[]).provider("$parseOptions",function(){var t=this.defaults={regexp:/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/};this.$get=["$parse","$q",function(e,n){function i(i,r){function o(t,e){return t.map(function(t,n){var i,r,o={};return o[c]=t,i=u(e,o),r=f(e,o),{label:i,value:r,index:n}})}var a={},s=angular.extend({},t,r);a.$values=[];var l,u,c,d,h,f,p;return a.init=function(){a.$match=l=i.match(s.regexp),u=e(l[2]||l[1]),c=l[4]||l[6],d=l[5],h=e(l[3]||""),f=e(l[2]?l[1]:c),p=e(l[7])},a.valuesFn=function(t,e){return n.when(p(t,e)).then(function(e){return angular.isArray(e)||(e=[]),a.$values=e.length?o(e,t):[],a.$values})},a.displayValue=function(t){var e={};return e[c]=t,u(e)},a.init(),a}return i}]}),angular.module("mgcrea.ngStrap.helpers.dimensions",[]).factory("dimensions",function(){function e(t){var e=t.ownerDocument,r=t.offsetParent||e;if(i(r,"#document"))return e.documentElement;for(;r&&!i(r,"html")&&"static"===n.css(r,"position");)r=r.offsetParent;return r||e.documentElement}var n={},i=n.nodeName=function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()};return n.css=function(e,n,i){var r;return r=e.currentStyle?e.currentStyle[n]:t.getComputedStyle?t.getComputedStyle(e)[n]:e.style[n],i===!0?parseFloat(r)||0:r},n.offset=function(e){var n=e.getBoundingClientRect(),i=e.ownerDocument;return{width:n.width||e.offsetWidth,height:n.height||e.offsetHeight,top:n.top+(t.pageYOffset||i.documentElement.scrollTop)-(i.documentElement.clientTop||0),left:n.left+(t.pageXOffset||i.documentElement.scrollLeft)-(i.documentElement.clientLeft||0)}},n.setOffset=function(t,e,i){var r,o,a,s,l,u,c,d=n.css(t,"position"),h=angular.element(t),f={};"static"===d&&(t.style.position="relative"),l=n.offset(t),a=n.css(t,"top"),u=n.css(t,"left"),c=("absolute"===d||"fixed"===d)&&(a+u).indexOf("auto")>-1,c?(r=n.position(t),s=r.top,o=r.left):(s=parseFloat(a)||0,o=parseFloat(u)||0),angular.isFunction(e)&&(e=e.call(t,i,l)),null!==e.top&&(f.top=e.top-l.top+s),null!==e.left&&(f.left=e.left-l.left+o),"using"in e?e.using.call(h,f):h.css({top:f.top+"px",left:f.left+"px"})},n.position=function(t){var r,o,a={top:0,left:0};return"fixed"===n.css(t,"position")?o=t.getBoundingClientRect():(r=e(t),o=n.offset(t),i(r,"html")||(a=n.offset(r)),a.top+=n.css(r,"borderTopWidth",!0),a.left+=n.css(r,"borderLeftWidth",!0)),{width:t.offsetWidth,height:t.offsetHeight,top:o.top-a.top-n.css(t,"marginTop",!0),left:o.left-a.left-n.css(t,"marginLeft",!0)}},n.height=function(t,e){var i=t.offsetHeight;return e?i+=n.css(t,"marginTop",!0)+n.css(t,"marginBottom",!0):i-=n.css(t,"paddingTop",!0)+n.css(t,"paddingBottom",!0)+n.css(t,"borderTopWidth",!0)+n.css(t,"borderBottomWidth",!0),i},n.width=function(t,e){var i=t.offsetWidth;return e?i+=n.css(t,"marginLeft",!0)+n.css(t,"marginRight",!0):i-=n.css(t,"paddingLeft",!0)+n.css(t,"paddingRight",!0)+n.css(t,"borderLeftWidth",!0)+n.css(t,"borderRightWidth",!0),i},n}),angular.module("mgcrea.ngStrap.helpers.debounce",[]).factory("debounce",["$timeout",function(t){return function(e,n,i){var r=null;return function(){var o=this,a=arguments,s=i&&!r;return r&&t.cancel(r),r=t(function(){r=null,i||e.apply(o,a)},n,!1),s&&e.apply(o,a),r}}}]).factory("throttle",["$timeout",function(t){return function(e,n,i){var r=null;return i||(i={}),function(){var o=this,a=arguments;r||(i.leading!==!1&&e.apply(o,a),r=t(function(){r=null,i.trailing!==!1&&e.apply(o,a)},n,!1))}}}]),angular.module("mgcrea.ngStrap.helpers.dateParser",[]).provider("$dateParser",["$localeProvider",function(t){function e(){this.year=1970,this.month=0,this.day=1,this.hours=0,this.minutes=0,this.seconds=0,this.milliseconds=0}function n(){}function i(t){return!isNaN(parseFloat(t))&&isFinite(t)}function r(t,e){for(var n=t.length,i=e.toString().toLowerCase(),r=0;n>r;r++)if(t[r].toLowerCase()===i)return r;return-1}e.prototype.setMilliseconds=function(t){this.milliseconds=t},e.prototype.setSeconds=function(t){this.seconds=t},e.prototype.setMinutes=function(t){this.minutes=t},e.prototype.setHours=function(t){this.hours=t},e.prototype.getHours=function(){return this.hours},e.prototype.setDate=function(t){this.day=t},e.prototype.setMonth=function(t){this.month=t},e.prototype.setFullYear=function(t){this.year=t},e.prototype.fromDate=function(t){return this.year=t.getFullYear(),this.month=t.getMonth(),this.day=t.getDate(),this.hours=t.getHours(),this.minutes=t.getMinutes(),this.seconds=t.getSeconds(),this.milliseconds=t.getMilliseconds(),this},e.prototype.toDate=function(){return new Date(this.year,this.month,this.day,this.hours,this.minutes,this.seconds,this.milliseconds)};var o=e.prototype,a=this.defaults={format:"shortDate",strict:!1};this.$get=["$locale","dateFilter",function(t,s){var l=function(l){function u(t){var e=c(t);return p(e)}function c(t){var e=d(t),n=e.replace(/''/g,"\\'"),i=/('(?:\\'|.)*?')/,r=n.split(i),o=Object.keys(w),a=[];return angular.forEach(r,function(t){if(h(t))t=f(t);else for(var e=0;e<o.length;e++)t=t.split(o[e]).join("${"+e+"}");a.push(t)}),a.join("")}function d(t){return t.replace(/\\/g,"[\\\\]").replace(/-/g,"[-]").replace(/\./g,"[.]").replace(/\*/g,"[*]").replace(/\+/g,"[+]").replace(/\?/g,"[?]").replace(/\$/g,"[$]").replace(/\^/g,"[^]").replace(/\//g,"[/]").replace(/\\s/g,"[\\s]")}function h(t){return/^'.*'$/.test(t)}function f(t){return t.replace(/^'(.*)'$/,"$1")}function p(t){for(var e=Object.keys(w),n=t,i=0;i<e.length;i++)n=n.split("${"+i+"}").join("("+w[e[i]]+")");return new RegExp("^"+n+"$",["i"])}function m(t){var e=c(t);return g(e)}function g(t){for(var e,n,i,r,o=Object.keys(w),a=new RegExp("\\${(\\d+)}","g"),s=[];null!==(e=a.exec(t));)n=e[1],i=o[n],r=x[i],s.push(r);return s}var v,y,b=angular.extend({},a,l),$={},w={sss:"[0-9]{3}",ss:"[0-5][0-9]",s:b.strict?"[1-5]?[0-9]":"[0-9]|[0-5][0-9]",mm:"[0-5][0-9]",m:b.strict?"[1-5]?[0-9]":"[0-9]|[0-5][0-9]",HH:"[01][0-9]|2[0-3]",H:b.strict?"1?[0-9]|2[0-3]":"[01]?[0-9]|2[0-3]",hh:"[0][1-9]|[1][012]",h:b.strict?"[1-9]|1[012]":"0?[1-9]|1[012]",a:"AM|PM",EEEE:t.DATETIME_FORMATS.DAY.join("|"),EEE:t.DATETIME_FORMATS.SHORTDAY.join("|"),dd:"0[1-9]|[12][0-9]|3[01]",d:b.strict?"[1-9]|[1-2][0-9]|3[01]":"0?[1-9]|[1-2][0-9]|3[01]",MMMM:t.DATETIME_FORMATS.MONTH.join("|"),MMM:t.DATETIME_FORMATS.SHORTMONTH.join("|"),MM:"0[1-9]|1[012]",M:b.strict?"[1-9]|1[012]":"0?[1-9]|1[012]",yyyy:"[1]{1}[0-9]{3}|[2]{1}[0-9]{3}",yy:"[0-9]{2}",y:b.strict?"-?(0|[1-9][0-9]{0,3})":"-?0*[0-9]{1,4}"},x={sss:o.setMilliseconds,ss:o.setSeconds,s:o.setSeconds,mm:o.setMinutes,m:o.setMinutes,HH:o.setHours,H:o.setHours,hh:o.setHours,h:o.setHours,EEEE:n,EEE:n,dd:o.setDate,d:o.setDate,a:function(t){var e=this.getHours()%12;return this.setHours(t.match(/pm/i)?e+12:e)},MMMM:function(e){return this.setMonth(r(t.DATETIME_FORMATS.MONTH,e))},MMM:function(e){return this.setMonth(r(t.DATETIME_FORMATS.SHORTMONTH,e))},MM:function(t){return this.setMonth(1*t-1)},M:function(t){return this.setMonth(1*t-1)},yyyy:o.setFullYear,yy:function(t){return this.setFullYear(2e3+1*t)},y:function(t){return 50>=1*t&&2===t.length?this.setFullYear(2e3+1*t):this.setFullYear(1*t)}};return $.init=function(){$.$format=t.DATETIME_FORMATS[b.format]||b.format,v=u($.$format),y=m($.$format)},$.isValid=function(t){return angular.isDate(t)?!isNaN(t.getTime()):v.test(t)},$.parse=function(n,i,r,o){r&&(r=t.DATETIME_FORMATS[r]||r),angular.isDate(n)&&(n=s(n,r||$.$format,o));var a=r?u(r):v,l=r?m(r):y,c=a.exec(n);if(!c)return!1;for(var d=i&&!isNaN(i.getTime())?(new e).fromDate(i):(new e).fromDate(new Date(1970,0,1,0)),h=0;h<c.length-1;h++)l[h]&&l[h].call(d,c[h+1]);var f=d.toDate();return parseInt(d.day,10)!==f.getDate()?!1:f},$.getDateForAttribute=function(t,e){var n;if("today"===e){var r=new Date;n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+("maxDate"===t?1:0),0,0,0,"minDate"===t?0:-1)}else n=angular.isString(e)&&e.match(/^".+"$/)?new Date(e.substr(1,e.length-2)):i(e)?new Date(parseInt(e,10)):angular.isString(e)&&0===e.length?"minDate"===t?-(1/0):+(1/0):new Date(e);return n},$.getTimeForAttribute=function(t,e){var n;return n="now"===e?(new Date).setFullYear(1970,0,1):angular.isString(e)&&e.match(/^".+"$/)?new Date(e.substr(1,e.length-2)).setFullYear(1970,0,1):i(e)?new Date(parseInt(e,10)).setFullYear(1970,0,1):angular.isString(e)&&0===e.length?"minTime"===t?-(1/0):+(1/0):$.parse(e,new Date(1970,0,1,0))},$.daylightSavingAdjust=function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},$.timezoneOffsetAdjust=function(t,e,n){return t?(e&&"UTC"===e&&(t=new Date(t.getTime()),t.setMinutes(t.getMinutes()+(n?-1:1)*t.getTimezoneOffset())),t):null},$.init(),$};return l}]}]),angular.module("mgcrea.ngStrap.helpers.dateFormatter",[]).service("$dateFormatter",["$locale","dateFilter",function(t,e){function n(t){return/(h+)([:\.])?(m+)([:\.])?(s*)[ ]?(a?)/i.exec(t).slice(1)}this.getDefaultLocale=function(){return t.id},this.getDatetimeFormat=function(e,n){return t.DATETIME_FORMATS[e]||e},this.weekdaysShort=function(e){return t.DATETIME_FORMATS.SHORTDAY},this.hoursFormat=function(t){return n(t)[0]},this.minutesFormat=function(t){return n(t)[2]},this.secondsFormat=function(t){return n(t)[4]},this.timeSeparator=function(t){return n(t)[1]},this.showSeconds=function(t){return!!n(t)[4]},this.showAM=function(t){return!!n(t)[5]},this.formatDate=function(t,n,i,r){return e(t,n,r)}}]),angular.module("mgcrea.ngStrap.core",[]).service("$bsCompiler",i),angular.module("mgcrea.ngStrap.dropdown",["mgcrea.ngStrap.tooltip"]).provider("$dropdown",function(){var t=this.defaults={animation:"am-fade",prefixClass:"dropdown",prefixEvent:"dropdown",placement:"bottom-left",templateUrl:"dropdown/dropdown.tpl.html",trigger:"click",container:!1,keyboard:!0,html:!1,delay:0};this.$get=["$window","$rootScope","$tooltip","$timeout",function(e,n,i,r){function o(e,o){function l(t){return t.target!==e[0]?t.target!==e[0]&&u.hide():void 0}var u={},c=angular.extend({},t,o);u.$scope=c.scope&&c.scope.$new()||n.$new(),u=i(e,c);var d=e.parent();u.$onKeyDown=function(t){if(/(38|40)/.test(t.keyCode)){t.preventDefault(),t.stopPropagation();var e=angular.element(u.$element[0].querySelectorAll("li:not(.divider) a"));if(e.length){var n;angular.forEach(e,function(t,e){s&&s.call(t,":focus")&&(n=e)}),38===t.keyCode&&n>0?n--:40===t.keyCode&&n<e.length-1?n++:angular.isUndefined(n)&&(n=0),e.eq(n)[0].focus()}}};var h=u.show;u.show=function(){h(),r(function(){c.keyboard&&u.$element&&u.$element.on("keydown",u.$onKeyDown),a.on("click",l)},0,!1),d.hasClass("dropdown")&&d.addClass("open")};var f=u.hide;u.hide=function(){u.$isShown&&(c.keyboard&&u.$element&&u.$element.off("keydown",u.$onKeyDown),a.off("click",l),d.hasClass("dropdown")&&d.removeClass("open"),f())};var p=u.destroy;return u.destroy=function(){a.off("click",l),p()},u}var a=angular.element(e.document.body),s=Element.prototype.matchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector;return o}]}).directive("bsDropdown",["$window","$sce","$dropdown",function(t,e,i){return{restrict:"EAC",scope:!0,compile:function(t,e){if(!e.bsDropdown){for(var r=t[0].nextSibling;r&&1!==r.nodeType;)r=r.nextSibling;r&&r.classList.contains("dropdown-menu")&&(e.template=r.outerHTML,e.templateUrl=n,r.parentNode.removeChild(r))}return function(t,n,r){var o={scope:t};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","id","autoClose"],function(t){angular.isDefined(e[t])&&(o[t]=e[t])});var a=/^(false|0|)$/i;angular.forEach(["html","container"],function(t){angular.isDefined(r[t])&&a.test(r[t])&&(o[t]=!1)}),r.bsDropdown&&t.$watch(r.bsDropdown,function(e,n){t.content=e},!0);var s=i(n,o);r.bsShow&&t.$watch(r.bsShow,function(t,e){s&&angular.isDefined(t)&&(angular.isString(t)&&(t=!!t.match(/true|,?(dropdown),?/i)),t===!0?s.show():s.hide())}),t.$on("$destroy",function(){s&&s.destroy(),o=null,s=null})}}}}]),angular.module("mgcrea.ngStrap.datepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$datepicker",function(){var t=this.defaults={animation:"am-fade",prefixClass:"datepicker",placement:"bottom-left",templateUrl:"datepicker/datepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!1,dateType:"date",dateFormat:"shortDate",timezone:null,modelDateFormat:null,dayFormat:"dd",monthFormat:"MMM",yearFormat:"yyyy",monthTitleFormat:"MMMM yyyy",yearTitleFormat:"yyyy",strictFormat:!1,autoclose:!1,minDate:-(1/0),maxDate:+(1/0),startView:0,minView:0,startWeek:0,daysOfWeekDisabled:"",iconLeft:"glyphicon glyphicon-chevron-left",iconRight:"glyphicon glyphicon-chevron-right"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","datepickerViews","$tooltip","$timeout",function(e,n,i,r,o,a,s,l){function u(e,n,i){function r(t){t.selected=u.$isSelected(t.date)}function o(){e[0].focus()}var u=s(e,angular.extend({},t,i)),h=i.scope,f=u.$options,p=u.$scope;f.startView&&(f.startView-=f.minView);var m=a(u);u.$views=m.views;var g=m.viewDate;p.$mode=f.startView,p.$iconLeft=f.iconLeft,p.$iconRight=f.iconRight;var v=u.$views[p.$mode];p.$select=function(t){u.select(t)},p.$selectPane=function(t){u.$selectPane(t)},p.$toggleMode=function(){u.setMode((p.$mode+1)%u.$views.length)},u.update=function(t){angular.isDate(t)&&!isNaN(t.getTime())&&(u.$date=t,v.update.call(v,t)),u.$build(!0)},u.updateDisabledDates=function(t){f.disabledDateRanges=t;for(var e=0,n=p.rows.length;n>e;e++)angular.forEach(p.rows[e],u.$setDisabledEl)},u.select=function(t,e){angular.isDate(n.$dateValue)||(n.$dateValue=new Date(t)),!p.$mode||e?(n.$setViewValue(angular.copy(t)),n.$render(),f.autoclose&&!e&&l(function(){u.hide(!0)})):(angular.extend(g,{year:t.getFullYear(),month:t.getMonth(),date:t.getDate()}),u.setMode(p.$mode-1),u.$build())},u.setMode=function(t){p.$mode=t,v=u.$views[p.$mode],u.$build()},u.$build=function(t){t===!0&&v.built||(t!==!1||v.built)&&v.build.call(v)},u.$updateSelected=function(){for(var t=0,e=p.rows.length;e>t;t++)angular.forEach(p.rows[t],r)},u.$isSelected=function(t){return v.isSelected(t)},u.$setDisabledEl=function(t){t.disabled=v.isDisabled(t.date)},u.$selectPane=function(t){var e=v.steps,n=new Date(Date.UTC(g.year+(e.year||0)*t,g.month+(e.month||0)*t,1));angular.extend(g,{year:n.getUTCFullYear(),month:n.getUTCMonth(),date:n.getUTCDate()}),u.$build()},u.$onMouseDown=function(t){if(t.preventDefault(),t.stopPropagation(),d){var e=angular.element(t.target);"button"!==e[0].nodeName.toLowerCase()&&(e=e.parent()),e.triggerHandler("click")}},u.$onKeyDown=function(t){if(/(38|37|39|40|13)/.test(t.keyCode)&&!t.shiftKey&&!t.altKey){if(t.preventDefault(),t.stopPropagation(),13===t.keyCode)return void(p.$mode?p.$apply(function(){u.setMode(p.$mode-1)}):u.hide(!0));v.onKeyDown(t),h.$digest()}};var y=u.init;u.init=function(){return c&&f.useNative?(e.prop("type","date"),void e.css("-webkit-appearance","textfield")):(d&&(e.prop("type","text"),e.attr("readonly","true"),e.on("click",o)),void y())};var b=u.destroy;u.destroy=function(){c&&f.useNative&&e.off("click",o),b()};var $=u.show;u.show=function(){!d&&e.attr("readonly")||e.attr("disabled")||($(),l(function(){u.$isShown&&(u.$element.on(d?"touchstart":"mousedown",u.$onMouseDown),f.keyboard&&e.on("keydown",u.$onKeyDown))},0,!1))};var w=u.hide;return u.hide=function(t){u.$isShown&&(u.$element.off(d?"touchstart":"mousedown",u.$onMouseDown),f.keyboard&&e.off("keydown",u.$onKeyDown),w(t))},u}var c=/(ip[ao]d|iphone|android)/gi.test(e.navigator.userAgent),d="createTouch"in e.document&&c;return t.lang||(t.lang=o.getDefaultLocale()),u.defaults=t,u}]}).directive("bsDatepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$datepicker",function(t,e,n,i,r,o){var a=/(ip[ao]d|iphone|android)/gi.test(t.navigator.userAgent);return{restrict:"EAC",require:"ngModel",link:function(t,e,n,s){function l(t){return t&&t.length?t:null}function u(t){if(angular.isDate(t)){var e=isNaN(f.$options.minDate)||t.getTime()>=f.$options.minDate,n=isNaN(f.$options.maxDate)||t.getTime()<=f.$options.maxDate,i=e&&n;s.$setValidity("date",i),s.$setValidity("min",e),s.$setValidity("max",n),i&&(s.$dateValue=t)}}function c(){return!s.$dateValue||isNaN(s.$dateValue.getTime())?"":m(s.$dateValue,d.dateFormat)}var d={scope:t};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","html","animation","autoclose","dateType","dateFormat","timezone","modelDateFormat","dayFormat","strictFormat","startWeek","startDate","useNative","lang","startView","minView","iconLeft","iconRight","daysOfWeekDisabled","id","prefixClass","prefixEvent"],function(t){angular.isDefined(n[t])&&(d[t]=n[t])});var h=/^(false|0|)$/i;angular.forEach(["html","container","autoclose","useNative"],function(t){angular.isDefined(n[t])&&h.test(n[t])&&(d[t]=!1)});var f=o(e,s,d);d=f.$options,a&&d.useNative&&(d.dateFormat="yyyy-MM-dd");var p=d.lang,m=function(t,e){return i.formatDate(t,e,p)},g=r({format:d.dateFormat,lang:p,strict:d.strictFormat});n.bsShow&&t.$watch(n.bsShow,function(t,e){f&&angular.isDefined(t)&&(angular.isString(t)&&(t=!!t.match(/true|,?(datepicker),?/i)),t===!0?f.show():f.hide())}),angular.forEach(["minDate","maxDate"],function(t){angular.isDefined(n[t])&&n.$observe(t,function(e){f.$options[t]=g.getDateForAttribute(t,e),isNaN(f.$options[t])||f.$build(!1),u(s.$dateValue)})}),angular.isDefined(n.dateFormat)&&n.$observe("dateFormat",function(t){f.$options.dateFormat=t}),t.$watch(n.ngModel,function(t,e){f.update(s.$dateValue)},!0),angular.isDefined(n.disabledDates)&&t.$watch(n.disabledDates,function(t,e){t=l(t),e=l(e),t&&f.updateDisabledDates(t)}),s.$parsers.unshift(function(t){var e;if(!t)return s.$setValidity("date",!0),null;var n=g.parse(t,s.$dateValue);return!n||isNaN(n.getTime())?void s.$setValidity("date",!1):(u(n),"string"===d.dateType?(e=g.timezoneOffsetAdjust(n,d.timezone,!0),m(e,d.modelDateFormat||d.dateFormat)):(e=g.timezoneOffsetAdjust(s.$dateValue,d.timezone,!0),"number"===d.dateType?e.getTime():"unix"===d.dateType?e.getTime()/1e3:"iso"===d.dateType?e.toISOString():new Date(e)))}),s.$formatters.push(function(t){var e;return e=angular.isUndefined(t)||null===t?NaN:angular.isDate(t)?t:"string"===d.dateType?g.parse(t,null,d.modelDateFormat):"unix"===d.dateType?new Date(1e3*t):new Date(t),s.$dateValue=g.timezoneOffsetAdjust(e,d.timezone),c()}),s.$render=function(){e.val(c())},t.$on("$destroy",function(){f&&f.destroy(),d=null,f=null})}}}]).provider("datepickerViews",function(){function t(t,e){for(var n=[];t.length>0;)n.push(t.splice(0,e));
return n}function e(t,e){return(t%e+e)%e}this.$get=["$dateFormatter","$dateParser","$sce",function(n,i,r){return function(o){var a=o.$scope,s=o.$options,l=s.lang,u=function(t,e){return n.formatDate(t,e,l)},c=i({format:s.dateFormat,lang:l,strict:s.strictFormat}),d=n.weekdaysShort(l),h=d.slice(s.startWeek).concat(d.slice(0,s.startWeek)),f=r.trustAsHtml('<th class="dow text-center">'+h.join('</th><th class="dow text-center">')+"</th>"),p=o.$date||(s.startDate?c.getDateForAttribute("startDate",s.startDate):new Date),m={year:p.getFullYear(),month:p.getMonth(),date:p.getDate()},g=[{format:s.dayFormat,split:7,steps:{month:1},update:function(t,e){!this.built||e||t.getFullYear()!==m.year||t.getMonth()!==m.month?(angular.extend(m,{year:o.$date.getFullYear(),month:o.$date.getMonth(),date:o.$date.getDate()}),o.$build()):t.getDate()===m.date&&1!==t.getDate()||(m.date=o.$date.getDate(),o.$updateSelected())},build:function(){var n=new Date(m.year,m.month,1),i=n.getTimezoneOffset(),r=new Date(+n-864e5*e(n.getDay()-s.startWeek,7)),l=r.getTimezoneOffset(),d=c.timezoneOffsetAdjust(new Date,s.timezone).toDateString();l!==i&&(r=new Date(+r+6e4*(l-i)));for(var h,p=[],g=0;42>g;g++)h=c.daylightSavingAdjust(new Date(r.getFullYear(),r.getMonth(),r.getDate()+g)),p.push({date:h,isToday:h.toDateString()===d,label:u(h,this.format),selected:o.$date&&this.isSelected(h),muted:h.getMonth()!==m.month,disabled:this.isDisabled(h)});a.title=u(n,s.monthTitleFormat),a.showLabels=!0,a.labels=f,a.rows=t(p,this.split),this.built=!0},isSelected:function(t){return o.$date&&t.getFullYear()===o.$date.getFullYear()&&t.getMonth()===o.$date.getMonth()&&t.getDate()===o.$date.getDate()},isDisabled:function(t){var e=t.getTime();if(e<s.minDate||e>s.maxDate)return!0;if(-1!==s.daysOfWeekDisabled.indexOf(t.getDay()))return!0;if(s.disabledDateRanges)for(var n=0;n<s.disabledDateRanges.length;n++)if(e>=s.disabledDateRanges[n].start&&e<=s.disabledDateRanges[n].end)return!0;return!1},onKeyDown:function(t){if(o.$date){var e,n=o.$date.getTime();37===t.keyCode?e=new Date(n-864e5):38===t.keyCode?e=new Date(n-6048e5):39===t.keyCode?e=new Date(n+864e5):40===t.keyCode&&(e=new Date(n+6048e5)),this.isDisabled(e)||o.select(e,!0)}}},{name:"month",format:s.monthFormat,split:4,steps:{year:1},update:function(t,e){this.built&&t.getFullYear()===m.year?t.getMonth()!==m.month&&(angular.extend(m,{month:o.$date.getMonth(),date:o.$date.getDate()}),o.$updateSelected()):(angular.extend(m,{year:o.$date.getFullYear(),month:o.$date.getMonth(),date:o.$date.getDate()}),o.$build())},build:function(){for(var e,n=[],i=0;12>i;i++)e=new Date(m.year,i,1),n.push({date:e,label:u(e,this.format),selected:o.$isSelected(e),disabled:this.isDisabled(e)});a.title=u(e,s.yearTitleFormat),a.showLabels=!1,a.rows=t(n,this.split),this.built=!0},isSelected:function(t){return o.$date&&t.getFullYear()===o.$date.getFullYear()&&t.getMonth()===o.$date.getMonth()},isDisabled:function(t){var e=+new Date(t.getFullYear(),t.getMonth()+1,0);return e<s.minDate||t.getTime()>s.maxDate},onKeyDown:function(t){if(o.$date){var e=o.$date.getMonth(),n=new Date(o.$date);37===t.keyCode?n.setMonth(e-1):38===t.keyCode?n.setMonth(e-4):39===t.keyCode?n.setMonth(e+1):40===t.keyCode&&n.setMonth(e+4),this.isDisabled(n)||o.select(n,!0)}}},{name:"year",format:s.yearFormat,split:4,steps:{year:12},update:function(t,e){!this.built||e||parseInt(t.getFullYear()/20,10)!==parseInt(m.year/20,10)?(angular.extend(m,{year:o.$date.getFullYear(),month:o.$date.getMonth(),date:o.$date.getDate()}),o.$build()):t.getFullYear()!==m.year&&(angular.extend(m,{year:o.$date.getFullYear(),month:o.$date.getMonth(),date:o.$date.getDate()}),o.$updateSelected())},build:function(){for(var e,n=m.year-m.year%(3*this.split),i=[],r=0;12>r;r++)e=new Date(n+r,0,1),i.push({date:e,label:u(e,this.format),selected:o.$isSelected(e),disabled:this.isDisabled(e)});a.title=i[0].label+"-"+i[i.length-1].label,a.showLabels=!1,a.rows=t(i,this.split),this.built=!0},isSelected:function(t){return o.$date&&t.getFullYear()===o.$date.getFullYear()},isDisabled:function(t){var e=+new Date(t.getFullYear()+1,0,0);return e<s.minDate||t.getTime()>s.maxDate},onKeyDown:function(t){if(o.$date){var e=o.$date.getFullYear(),n=new Date(o.$date);37===t.keyCode?n.setYear(e-1):38===t.keyCode?n.setYear(e-4):39===t.keyCode?n.setYear(e+1):40===t.keyCode&&n.setYear(e+4),this.isDisabled(n)||o.select(n,!0)}}}];return{views:s.minView?Array.prototype.slice.call(g,s.minView):g,viewDate:m}}}]}),angular.module("mgcrea.ngStrap.collapse",[]).provider("$collapse",function(){var t=this.defaults={animation:"am-collapse",disallowToggle:!1,activeClass:"in",startCollapsed:!1,allowMultiple:!1},e=this.controller=function(e,n,i){function r(t){for(var e=l.$targets.$active,n=0;n<e.length;n++)t<e[n]&&(e[n]=e[n]-1),e[n]===l.$targets.length&&(e[n]=l.$targets.length-1)}function o(t){var e=l.$targets.$active;return-1!==e.indexOf(t)}function a(t){var e=l.$targets.$active.indexOf(t);-1!==e&&l.$targets.$active.splice(e,1)}function s(t){l.$options.allowMultiple||l.$targets.$active.splice(0,1),-1===l.$targets.$active.indexOf(t)&&l.$targets.$active.push(t)}var l=this;l.$options=angular.copy(t),angular.forEach(["animation","disallowToggle","activeClass","startCollapsed","allowMultiple"],function(t){angular.isDefined(i[t])&&(l.$options[t]=i[t])});var u=/^(false|0|)$/i;angular.forEach(["disallowToggle","startCollapsed","allowMultiple"],function(t){angular.isDefined(i[t])&&u.test(i[t])&&(l.$options[t]=!1)}),l.$toggles=[],l.$targets=[],l.$viewChangeListeners=[],l.$registerToggle=function(t){l.$toggles.push(t)},l.$registerTarget=function(t){l.$targets.push(t)},l.$unregisterToggle=function(t){var e=l.$toggles.indexOf(t);l.$toggles.splice(e,1)},l.$unregisterTarget=function(t){var e=l.$targets.indexOf(t);l.$targets.splice(e,1),l.$options.allowMultiple&&a(t),r(e),l.$viewChangeListeners.forEach(function(t){t()})},l.$targets.$active=l.$options.startCollapsed?[]:[0],l.$setActive=e.$setActive=function(t){angular.isArray(t)?l.$targets.$active=t:!l.$options.disallowToggle&&o(t)?a(t):s(t),l.$viewChangeListeners.forEach(function(t){t()})},l.$activeIndexes=function(){return l.$options.allowMultiple?l.$targets.$active:1===l.$targets.$active.length?l.$targets.$active[0]:-1}};this.$get=function(){var n={};return n.defaults=t,n.controller=e,n}}).directive("bsCollapse",["$window","$animate","$collapse",function(t,e,n){return{require:["?ngModel","bsCollapse"],controller:["$scope","$element","$attrs",n.controller],link:function(t,e,n,i){var r=i[0],o=i[1];r&&(o.$viewChangeListeners.push(function(){r.$setViewValue(o.$activeIndexes())}),r.$formatters.push(function(t){if(angular.isArray(t))o.$setActive(t);else{var e=o.$activeIndexes();angular.isArray(e)?-1===e.indexOf(1*t)&&o.$setActive(1*t):e!==1*t&&o.$setActive(1*t)}return t}))}}}]).directive("bsCollapseToggle",function(){return{require:["^?ngModel","^bsCollapse"],link:function(t,e,n,i){var r=i[1];e.attr("data-toggle","collapse"),r.$registerToggle(e),t.$on("$destroy",function(){r.$unregisterToggle(e)}),e.on("click",function(){if(!n.disabled){var i=n.bsCollapseToggle&&"bs-collapse-toggle"!==n.bsCollapseToggle?n.bsCollapseToggle:r.$toggles.indexOf(e);r.$setActive(1*i),t.$apply()}})}}}).directive("bsCollapseTarget",["$animate",function(t){return{require:["^?ngModel","^bsCollapse"],link:function(e,n,i,r){function o(){var e=a.$targets.indexOf(n),i=a.$activeIndexes(),r="removeClass";angular.isArray(i)?-1!==i.indexOf(e)&&(r="addClass"):e===i&&(r="addClass"),t[r](n,a.$options.activeClass)}var a=r[1];n.addClass("collapse"),a.$options.animation&&n.addClass(a.$options.animation),a.$registerTarget(n),e.$on("$destroy",function(){a.$unregisterTarget(n)}),a.$viewChangeListeners.push(function(){o()}),o()}}}]),angular.module("mgcrea.ngStrap.button",[]).provider("$button",function(){var t=this.defaults={activeClass:"active",toggleEvent:"click"};this.$get=function(){return{defaults:t}}}).directive("bsCheckboxGroup",function(){return{restrict:"A",require:"ngModel",compile:function(t,e){t.attr("data-toggle","buttons"),t.removeAttr("ng-model");var n=t[0].querySelectorAll('input[type="checkbox"]');angular.forEach(n,function(t){var n=angular.element(t);n.attr("bs-checkbox",""),n.attr("ng-model",e.ngModel+"."+n.attr("value"))})}}}).directive("bsCheckbox",["$button","$$rAF",function(t,e){var n=t.defaults,i=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(t,r,o,a){var s=n,l="INPUT"===r[0].nodeName,u=l?r.parent():r,c=angular.isDefined(o.trueValue)?o.trueValue:!0;i.test(o.trueValue)&&(c=t.$eval(o.trueValue));var d=angular.isDefined(o.falseValue)?o.falseValue:!1;i.test(o.falseValue)&&(d=t.$eval(o.falseValue));var h="boolean"!=typeof c||"boolean"!=typeof d;h&&(a.$parsers.push(function(t){return t?c:d}),a.$formatters.push(function(t){return angular.equals(t,c)}),t.$watch(o.ngModel,function(t,e){a.$render()})),a.$render=function(){var t=angular.equals(a.$modelValue,c);e(function(){l&&(r[0].checked=t),u.toggleClass(s.activeClass,t)})},r.bind(s.toggleEvent,function(){t.$apply(function(){l||a.$setViewValue(!u.hasClass("active")),h||a.$render()})})}}}]).directive("bsRadioGroup",function(){return{restrict:"A",require:"ngModel",compile:function(t,e){t.attr("data-toggle","buttons"),t.removeAttr("ng-model");var n=t[0].querySelectorAll('input[type="radio"]');angular.forEach(n,function(t){angular.element(t).attr("bs-radio",""),angular.element(t).attr("ng-model",e.ngModel)})}}}).directive("bsRadio",["$button","$$rAF",function(t,e){var n=t.defaults,i=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(t,r,o,a){var s,l=n,u="INPUT"===r[0].nodeName,c=u?r.parent():r;o.$observe("value",function(e){s=i.test(e)?t.$eval(e):e,a.$render()}),a.$render=function(){var t=angular.equals(a.$modelValue,s);e(function(){u&&(r[0].checked=t),c.toggleClass(l.activeClass,t)})},r.bind(l.toggleEvent,function(){t.$apply(function(){a.$setViewValue(s),a.$render()})})}}}]),angular.module("mgcrea.ngStrap.aside",["mgcrea.ngStrap.modal"]).provider("$aside",function(){var t=this.defaults={animation:"am-fade-and-slide-right",prefixClass:"aside",prefixEvent:"aside",placement:"right",templateUrl:"aside/aside.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$modal",function(e){function n(n){var i={},r=angular.extend({},t,n);return i=e(r)}return n}]}).directive("bsAside",["$window","$sce","$aside",function(t,e,n){return{restrict:"EAC",scope:!0,link:function(t,i,r,o){var a={scope:t,element:i,show:!1};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","backdrop","keyboard","html","container","animation"],function(t){angular.isDefined(r[t])&&(a[t]=r[t])});var s=/^(false|0|)$/i;angular.forEach(["backdrop","keyboard","html","container"],function(t){angular.isDefined(r[t])&&s.test(r[t])&&(a[t]=!1)}),angular.forEach(["title","content"],function(n){r[n]&&r.$observe(n,function(i,r){t[n]=e.trustAsHtml(i)})}),r.bsAside&&t.$watch(r.bsAside,function(e,n){angular.isObject(e)?angular.extend(t,e):t.content=e},!0);var l=n(a);i.on(r.trigger||"click",l.toggle),t.$on("$destroy",function(){l&&l.destroy(),a=null,l=null})}}}]),angular.module("mgcrea.ngStrap.alert",["mgcrea.ngStrap.modal"]).provider("$alert",function(){var t=this.defaults={animation:"am-fade",prefixClass:"alert",prefixEvent:"alert",placement:null,templateUrl:"alert/alert.tpl.html",container:!1,element:null,backdrop:!1,keyboard:!0,show:!0,duration:!1,type:!1,dismissable:!0};this.$get=["$modal","$timeout",function(e,n){function i(i){var r={},o=angular.extend({},t,i);r=e(o),r.$scope.dismissable=!!o.dismissable,o.type&&(r.$scope.type=o.type);var a=r.show;return o.duration&&(r.show=function(){a(),n(function(){r.hide()},1e3*o.duration)}),r}return i}]}).directive("bsAlert",["$window","$sce","$alert",function(t,e,n){return{restrict:"EAC",scope:!0,link:function(t,i,r,o){var a={scope:t,element:i,show:!1};angular.forEach(["template","templateUrl","controller","controllerAs","placement","keyboard","html","container","animation","duration","dismissable"],function(t){angular.isDefined(r[t])&&(a[t]=r[t])});var s=/^(false|0|)$/i;angular.forEach(["keyboard","html","container","dismissable"],function(t){angular.isDefined(r[t])&&s.test(r[t])&&(a[t]=!1)}),t.hasOwnProperty("title")||(t.title=""),angular.forEach(["title","content","type"],function(n){r[n]&&r.$observe(n,function(i,r){t[n]=e.trustAsHtml(i)})}),r.bsAlert&&t.$watch(r.bsAlert,function(e,n){angular.isObject(e)?angular.extend(t,e):t.content=e},!0);var l=n(a);i.on(r.trigger||"click",l.toggle),t.$on("$destroy",function(){l&&l.destroy(),a=null,l=null})}}}]),angular.module("mgcrea.ngStrap.affix",["mgcrea.ngStrap.helpers.dimensions","mgcrea.ngStrap.helpers.debounce"]).provider("$affix",function(){var t=this.defaults={offsetTop:"auto",inlineStyles:!0};this.$get=["$window","debounce","dimensions",function(e,n,i){function r(r,s){function l(t,e,n){var i=u(),r=c();return y>=i?"top":null!==t&&i+t<=e.top?"middle":null!==b&&e.top+n+g>=r-b?"bottom":"middle"}function u(){return f[0]===e?e.pageYOffset:f[0].scrollTop}function c(){return f[0]===e?e.document.body.scrollHeight:f[0].scrollHeight}var d={},h=angular.extend({},t,s),f=h.target,p="affix affix-top affix-bottom",m=!1,g=0,v=0,y=0,b=0,$=null,w=null,x=r.parent();if(h.offsetParent)if(h.offsetParent.match(/^\d+$/))for(var C=0;C<1*h.offsetParent-1;C++)x=x.parent();else x=angular.element(h.offsetParent);return d.init=function(){this.$parseOffsets(),v=i.offset(r[0]).top+g,m=!r[0].style.width,f.on("scroll",this.checkPosition),f.on("click",this.checkPositionWithEventLoop),a.on("resize",this.$debouncedOnResize),this.checkPosition(),this.checkPositionWithEventLoop()},d.destroy=function(){f.off("scroll",this.checkPosition),f.off("click",this.checkPositionWithEventLoop),a.off("resize",this.$debouncedOnResize)},d.checkPositionWithEventLoop=function(){setTimeout(d.checkPosition,1)},d.checkPosition=function(){var t=u(),e=i.offset(r[0]),n=i.height(r[0]),a=l(w,e,n);$!==a&&($=a,"top"===a?(w=null,m&&r.css("width",""),h.inlineStyles&&(r.css("position",h.offsetParent?"":"relative"),r.css("top",""))):"bottom"===a?(w=h.offsetUnpin?-(1*h.offsetUnpin):e.top-t,m&&r.css("width",""),h.inlineStyles&&(r.css("position",h.offsetParent?"":"relative"),r.css("top",h.offsetParent?"":o[0].offsetHeight-b-n-v+"px"))):(w=null,m&&r.css("width",r[0].offsetWidth+"px"),h.inlineStyles&&(r.css("position","fixed"),r.css("top",g+"px"))),r.removeClass(p).addClass("affix"+("middle"!==a?"-"+a:"")))},d.$onResize=function(){d.$parseOffsets(),d.checkPosition()},d.$debouncedOnResize=n(d.$onResize,50),d.$parseOffsets=function(){var t=r.css("position");h.inlineStyles&&r.css("position",h.offsetParent?"":"relative"),h.offsetTop&&("auto"===h.offsetTop&&(h.offsetTop="+0"),h.offsetTop.match(/^[-+]\d+$/)?(g=1*-h.offsetTop,y=h.offsetParent?i.offset(x[0]).top+1*h.offsetTop:i.offset(r[0]).top-i.css(r[0],"marginTop",!0)+1*h.offsetTop):y=1*h.offsetTop),h.offsetBottom&&(b=h.offsetParent&&h.offsetBottom.match(/^[-+]\d+$/)?c()-(i.offset(x[0]).top+i.height(x[0]))+1*h.offsetBottom+1:1*h.offsetBottom),h.inlineStyles&&r.css("position",t)},d.init(),d}var o=angular.element(e.document.body),a=angular.element(e);return r}]}).directive("bsAffix",["$affix","$window",function(t,e){return{restrict:"EAC",require:"^?bsAffixTarget",link:function(n,i,r,o){var a={scope:n,target:o?o.$element:angular.element(e)};angular.forEach(["offsetTop","offsetBottom","offsetParent","offsetUnpin","inlineStyles"],function(t){if(angular.isDefined(r[t])){var e=r[t];/true/i.test(e)&&(e=!0),/false/i.test(e)&&(e=!1),a[t]=e}});var s=t(i,a);n.$on("$destroy",function(){s&&s.destroy(),a=null,s=null})}}}]).directive("bsAffixTarget",function(){return{controller:["$element",function(t){this.$element=t}]}}),angular.module("mgcrea.ngStrap",["mgcrea.ngStrap.modal","mgcrea.ngStrap.aside","mgcrea.ngStrap.alert","mgcrea.ngStrap.button","mgcrea.ngStrap.select","mgcrea.ngStrap.datepicker","mgcrea.ngStrap.timepicker","mgcrea.ngStrap.navbar","mgcrea.ngStrap.tooltip","mgcrea.ngStrap.popover","mgcrea.ngStrap.dropdown","mgcrea.ngStrap.typeahead","mgcrea.ngStrap.scrollspy","mgcrea.ngStrap.affix","mgcrea.ngStrap.tab","mgcrea.ngStrap.collapse"])}(window,document),function(t,e,n){"use strict";angular.module("mgcrea.ngStrap.alert").run(["$templateCache",function(t){t.put("alert/alert.tpl.html",'<div class="alert" ng-class="[type ? \'alert-\' + type : null]"><button type="button" class="close" ng-if="dismissable" ng-click="$hide()">&times;</button> <strong ng-bind="title"></strong>&nbsp;<span ng-bind-html="content"></span></div>')}]),angular.module("mgcrea.ngStrap.aside").run(["$templateCache",function(t){t.put("aside/aside.tpl.html",'<div class="aside" tabindex="-1" role="dialog"><div class="aside-dialog"><div class="aside-content"><div class="aside-header" ng-show="title"><button type="button" class="close" ng-click="$hide()">&times;</button><h4 class="aside-title" ng-bind="title"></h4></div><div class="aside-body" ng-bind="content"></div><div class="aside-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>')}]),angular.module("mgcrea.ngStrap.datepicker").run(["$templateCache",function(t){t.put("datepicker/datepicker.tpl.html",'<div class="dropdown-menu datepicker" ng-class="\'datepicker-mode-\' + $mode" style="max-width: 320px"><table style="table-layout: fixed; height: 100%; width: 100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$selectPane(-1)"><i class="{{$iconLeft}}"></i></button></th><th colspan="{{ rows[0].length - 2 }}"><button tabindex="-1" type="button" class="btn btn-default btn-block text-strong" ng-click="$toggleMode()"><strong style="text-transform: capitalize" ng-bind="title"></strong></button></th><th><button tabindex="-1" type="button" class="btn btn-default pull-right" ng-click="$selectPane(+1)"><i class="{{$iconRight}}"></i></button></th></tr><tr ng-if="showLabels" ng-bind-html="labels"></tr></thead><tbody><tr ng-repeat="(i, row) in rows" height="{{ 100 / rows.length }}%"><td class="text-center" ng-repeat="(j, el) in row"><button tabindex="-1" type="button" class="btn btn-default" style="width: 100%" ng-class="{\'btn-primary\': el.selected, \'btn-info btn-today\': el.isToday && !el.selected}" ng-click="$select(el.date)" ng-disabled="el.disabled"><span ng-class="{\'text-muted\': el.muted}" ng-bind="el.label"></span></button></td></tr></tbody></table></div>')}]),angular.module("mgcrea.ngStrap.dropdown").run(["$templateCache",function(t){t.put("dropdown/dropdown.tpl.html",'<ul tabindex="-1" class="dropdown-menu" role="menu" ng-show="content && content.length"><li role="presentation" ng-class="{divider: item.divider, active: item.active}" ng-repeat="item in content"><a role="menuitem" tabindex="-1" ng-href="{{item.href}}" ng-if="!item.divider && item.href" target="{{item.target || \'\'}}" ng-bind="item.text"></a> <a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-if="!item.divider && item.click" ng-click="$eval(item.click);$hide()" ng-bind="item.text"></a></li></ul>')}]),angular.module("mgcrea.ngStrap.modal").run(["$templateCache",function(t){t.put("modal/modal.tpl.html",'<div class="modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header" ng-show="title"><button type="button" class="close" aria-label="Close" ng-click="$hide()"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" ng-bind="title"></h4></div><div class="modal-body" ng-bind="content"></div><div class="modal-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>')}]),angular.module("mgcrea.ngStrap.popover").run(["$templateCache",function(t){t.put("popover/popover.tpl.html",'<div class="popover" tabindex="-1"><div class="arrow"></div><h3 class="popover-title" ng-bind="title" ng-show="title"></h3><div class="popover-content" ng-bind="content"></div></div>')}]),angular.module("mgcrea.ngStrap.select").run(["$templateCache",function(t){t.put("select/select.tpl.html",'<ul tabindex="-1" class="select dropdown-menu" ng-show="$isVisible()" role="select"><li ng-if="$showAllNoneButtons"><div class="btn-group" style="margin-bottom: 5px; margin-left: 5px"><button type="button" class="btn btn-default btn-xs" ng-click="$selectAll()">{{$allText}}</button> <button type="button" class="btn btn-default btn-xs" ng-click="$selectNone()">{{$noneText}}</button></div></li><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $isActive($index)}"><a style="cursor: default" role="menuitem" tabindex="-1" ng-click="$select($index, $event)"><i class="{{$iconCheckmark}} pull-right" ng-if="$isMultiple && $isActive($index)"></i> <span ng-bind="match.label"></span></a></li></ul>')}]),angular.module("mgcrea.ngStrap.tab").run(["$templateCache",function(t){t.put("tab/tab.tpl.html",'<ul class="nav" ng-class="$navClass" role="tablist"><li role="presentation" ng-repeat="$pane in $panes track by $index" ng-class="[ $isActive($pane, $index) ? $activeClass : \'\', $pane.disabled ? \'disabled\' : \'\' ]"><a role="tab" data-toggle="tab" ng-click="!$pane.disabled && $setActive($pane.name || $index)" data-index="{{ $index }}" ng-bind-html="$pane.title" aria-controls="$pane.title"></a></li></ul><div ng-transclude class="tab-content"></div>')}]),angular.module("mgcrea.ngStrap.timepicker").run(["$templateCache",function(t){t.put("timepicker/timepicker.tpl.html",'<div class="dropdown-menu timepicker" style="min-width: 0px;width: auto"><table height="100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 0)"><i class="{{ $iconUp }}"></i></button></th><th>&nbsp;</th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 1)"><i class="{{ $iconUp }}"></i></button></th><th>&nbsp;</th><th><button ng-if="showSeconds" tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 2)"><i class="{{ $iconUp }}"></i></button></th></tr></thead><tbody><tr ng-repeat="(i, row) in rows"><td class="text-center"><button tabindex="-1" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[0].selected}" ng-click="$select(row[0].date, 0)" ng-disabled="row[0].disabled"><span ng-class="{\'text-muted\': row[0].muted}" ng-bind="row[0].label"></span></button></td><td><span ng-bind="i == midIndex ? timeSeparator : \' \'"></span></td><td class="text-center"><button tabindex="-1" ng-if="row[1].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[1].selected}" ng-click="$select(row[1].date, 1)" ng-disabled="row[1].disabled"><span ng-class="{\'text-muted\': row[1].muted}" ng-bind="row[1].label"></span></button></td><td><span ng-bind="i == midIndex ? timeSeparator : \' \'"></span></td><td class="text-center"><button tabindex="-1" ng-if="showSeconds && row[2].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[2].selected}" ng-click="$select(row[2].date, 2)" ng-disabled="row[2].disabled"><span ng-class="{\'text-muted\': row[2].muted}" ng-bind="row[2].label"></span></button></td><td ng-if="showAM">&nbsp;</td><td ng-if="showAM"><button tabindex="-1" ng-show="i == midIndex - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !!isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">AM</button> <button tabindex="-1" ng-show="i == midIndex + 1 - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">PM</button></td></tr></tbody><tfoot><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 0)"><i class="{{ $iconDown }}"></i></button></th><th>&nbsp;</th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 1)"><i class="{{ $iconDown }}"></i></button></th><th>&nbsp;</th><th><button ng-if="showSeconds" tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 2)"><i class="{{ $iconDown }}"></i></button></th></tr></tfoot></table></div>')}]),angular.module("mgcrea.ngStrap.tooltip").run(["$templateCache",function(t){t.put("tooltip/tooltip.tpl.html",'<div class="tooltip in" ng-show="title"><div class="tooltip-arrow"></div><div class="tooltip-inner" ng-bind="title"></div></div>')}]),angular.module("mgcrea.ngStrap.typeahead").run(["$templateCache",function(t){t.put("typeahead/typeahead.tpl.html",'<ul tabindex="-1" class="typeahead dropdown-menu" ng-show="$isVisible()" role="select"><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $index == $activeIndex}"><a role="menuitem" tabindex="-1" ng-click="$select($index, $event)" ng-bind="match.label"></a></li></ul>')}])}(window,document),function(t){"use strict";function e(){return"ondrag"in document.createElement("a")}function n(t){"undefined"!=typeof t.dataTransfer&&"none"===t.dataTransfer.dropEffect&&("copy"===t.dataTransfer.effectAllowed||"move"===t.dataTransfer.effectAllowed?t.dataTransfer.dropEffect=t.dataTransfer.effectAllowed:"copyMove"!==t.dataTransfer.effectAllowed&&"copymove"!==t.dataTransfer.effectAllowed||(t.dataTransfer.dropEffect=t.ctrlKey?"copy":"move"))}if(!e())return void t.module("ang-drag-drop",[]);window.jQuery&&-1===window.jQuery.event.props.indexOf("dataTransfer")&&window.jQuery.event.props.push("dataTransfer");var i=t.module("ang-drag-drop",[]);i.directive("uiDraggable",["$parse","$rootScope","$dragImage",function(e,i,r){return function(o,a,s){function l(t){setTimeout(function(){a.unbind("$destroy",l)},0);var r=s.dragChannel||"defaultchannel";if(i.$broadcast("ANGULAR_DRAG_END",t,r),n(t),t.dataTransfer&&"none"!==t.dataTransfer.dropEffect)if(s.onDropSuccess){var u=e(s.onDropSuccess);o.$evalAsync(function(){u(o,{$event:t})})}else if(s.onDropFailure){var c=e(s.onDropFailure);o.$evalAsync(function(){c(o,{$event:t})})}a.removeClass(p)}function u(n,i){var r;n&&n.dataTransfer&&n.dataTransfer.setDragImage&&(r=e(i),o.$apply(function(){var e,i=r(o,{$event:n});i&&t.isString(i)&&(e=document.getElementById(i),e&&n.dataTransfer.setDragImage(e,0,0))}))}function c(n){var c=!f||h.classList.contains(d);if(c){var m=s.dragChannel||"defaultchannel",g="";s.drag&&(g=o.$eval(s.drag));var v=s.dragImage||null;a.addClass(p),a.bind("$destroy",l);var y=!(document.uniqueID||window.opera);if(v&&y){var b=e(s.dragImage);o.$apply(function(){var e=b(o,{$event:n});if(e&&(t.isString(e)&&(e=r.generate(e)),e.image)){var i=e.xOffset||0,a=e.yOffset||0;n.dataTransfer.setDragImage(e.image,i,a)}})}else s.dragImageElementId&&u(n,s.dragImageElementId);var $={data:g,channel:m},w=t.toJson($);n.dataTransfer.setData("text",w),n.dataTransfer.effectAllowed="copyMove",i.$broadcast("ANGULAR_DRAG_START",n,m,$)}else n.preventDefault()}var d,h,f=!1,p=s.draggingClass||"on-dragging";a.attr("draggable",!1),o.$watch(s.uiDraggable,function(t){t?(a.attr("draggable",t),a.bind("dragend",l),a.bind("dragstart",c)):(a.removeAttr("draggable"),a.unbind("dragend",l),a.unbind("dragstart",c))}),t.isString(s.dragHandleClass)&&(f=!0,d=s.dragHandleClass.trim()||"drag-handle",a.bind("mousedown",function(t){h=t.target}))}}]),i.directive("uiOnDrop",["$parse","$rootScope",function(e,i){return function(r,o,a){function s(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation();var n=e(a.uiOnDragOver);return r.$evalAsync(function(){n(r,{$event:t,$channel:p})}),!1}function l(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),f--,0===f&&(r.$evalAsync(function(){b(r,{$event:t,$channel:p})}),o.addClass(g),o.removeClass(v));var n=e(a.uiOnDragLeave);r.$evalAsync(function(){n(r,{$event:t,$channel:p})})}function u(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),0===f&&(r.$evalAsync(function(){y(r,{$event:t,$channel:p})}),o.removeClass(g),o.addClass(v)),f++;var n=e(a.uiOnDragEnter);r.$evalAsync(function(){n(r,{$event:t,$channel:p})}),i.$broadcast("ANGULAR_HOVER",m)}function c(i){i.preventDefault&&i.preventDefault(),i.stopPropagation&&i.stopPropagation();var s=i.dataTransfer.getData("text");s=t.fromJson(s),n(i);var l=e(a.uiOnDrop);r.$evalAsync(function(){l(r,{$data:s.data,$event:i,$channel:s.channel})}),o.removeClass(g),f=0}function d(t,e){if("*"===e)return!0;var n=new RegExp("(\\s|[,])+("+t+")(\\s|[,])+","i");return n.test(","+e+",")}function h(t){return t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.dataTransfer.dropEffect="none",!1}var f=0,p=a.dropChannel||"defaultchannel",m="",g=a.dragEnterClass||"on-drag-enter",v=a.dragHoverClass||"on-drag-hover",y=e(a.onDragEnter),b=e(a.onDragLeave),$=i.$on("ANGULAR_DRAG_START",function(t,n,i,f){m=i;var v=!0;if(d(i,p)||(v=!1),v&&a.dropValidate){var y=e(a.dropValidate);v=y(r,{$drop:{scope:r,element:o},$event:n,$data:f.data,$channel:f.channel})}v?(o.bind("dragover",s),o.bind("dragenter",u),o.bind("dragleave",l),o.bind("drop",c),o.addClass(g)):(o.bind("dragover",h),o.bind("dragenter",h),o.bind("dragleave",h),o.bind("drop",h),o.removeClass(g))}),w=i.$on("ANGULAR_DRAG_END",function(){o.unbind("dragover",s),o.unbind("dragenter",u),o.unbind("dragleave",l),o.unbind("drop",c),o.removeClass(v),o.removeClass(g),o.unbind("dragover",h),o.unbind("dragenter",h),o.unbind("dragleave",h),o.unbind("drop",h)});r.$on("$destroy",function(){$(),w()}),a.$observe("dropChannel",function(t){t&&(p=t)})}}]),i.constant("$dragImageConfig",{height:20,width:200,padding:10,font:"bold 11px Arial",fontColor:"#eee8d5",backgroundColor:"#93a1a1",xOffset:0,yOffset:0}),i.service("$dragImage",["$dragImageConfig",function(e){function n(t,e,n){var r=t.measureText(e).width;if(r<n.width)return e;for(;r+n.padding>n.width;)e=e.substring(0,e.length-1),r=t.measureText(e+i).width;return e+i}var i="…";this.generate=function(i,r){var o=t.extend({},e,r||{}),a=document.createElement("canvas");a.height=o.height,a.width=o.width;var s=a.getContext("2d");s.fillStyle=o.backgroundColor,s.fillRect(0,0,o.width,o.height),s.font=o.font,s.fillStyle=o.fontColor;var l=n(s,i,o);s.fillText(l,4,o.padding+4);var u=new Image;return u.src=a.toDataURL(),{image:u,xOffset:o.xOffset,yOffset:o.yOffset}}}])}(angular),function(){"use strict";angular.module("ui.tree",[]).constant("treeConfig",{treeClass:"angular-ui-tree",emptyTreeClass:"angular-ui-tree-empty",hiddenClass:"angular-ui-tree-hidden",nodesClass:"angular-ui-tree-nodes",nodeClass:"angular-ui-tree-node",handleClass:"angular-ui-tree-handle",placeholderClass:"angular-ui-tree-placeholder",dragClass:"angular-ui-tree-drag",dragThreshold:3,levelThreshold:30,defaultCollapsed:!1})}(),function(){"use strict";angular.module("ui.tree").controller("TreeHandleController",["$scope","$element",function(t,e){this.scope=t,t.$element=e,t.$nodeScope=null,t.$type="uiTreeHandle"}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeNodeController",["$scope","$element",function(t,e){function n(t){var e,i,r,o=0,a=t.childNodes();if(!a||0===a.length)return 0;for(r=a.length-1;r>=0;r--)e=a[r],i=1+n(e),o=Math.max(o,i);return o}this.scope=t,t.$element=e,t.$modelValue=null,t.$parentNodeScope=null,t.$childNodesScope=null,t.$parentNodesScope=null,t.$treeScope=null,t.$handleScope=null,t.$type="uiTreeNode",t.$$allowNodeDrop=!1,t.collapsed=!1,t.init=function(n){var i=n[0];t.$treeScope=n[1]?n[1].scope:null,t.$parentNodeScope=i.scope.$nodeScope,t.$modelValue=i.scope.$modelValue[t.$index],t.$parentNodesScope=i.scope,i.scope.initSubNode(t),e.on("$destroy",function(){i.scope.destroySubNode(t)})},t.index=function(){return t.$parentNodesScope.$modelValue.indexOf(t.$modelValue)},t.dragEnabled=function(){return!(t.$treeScope&&!t.$treeScope.dragEnabled)},t.isSibling=function(e){return t.$parentNodesScope==e.$parentNodesScope;
},t.isChild=function(e){var n=t.childNodes();return n&&n.indexOf(e)>-1},t.prev=function(){var e=t.index();return e>0?t.siblings()[e-1]:null},t.siblings=function(){return t.$parentNodesScope.childNodes()},t.childNodesCount=function(){return t.childNodes()?t.childNodes().length:0},t.hasChild=function(){return t.childNodesCount()>0},t.childNodes=function(){return t.$childNodesScope&&t.$childNodesScope.$modelValue?t.$childNodesScope.childNodes():null},t.accept=function(e,n){return t.$childNodesScope&&t.$childNodesScope.$modelValue&&t.$childNodesScope.accept(e,n)},t.remove=function(){return t.$parentNodesScope.removeNode(t)},t.toggle=function(){t.collapsed=!t.collapsed},t.collapse=function(){t.collapsed=!0},t.expand=function(){t.collapsed=!1},t.depth=function(){var e=t.$parentNodeScope;return e?e.depth()+1:1},t.maxSubDepth=function(){return t.$childNodesScope?n(t.$childNodesScope):0}}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeNodesController",["$scope","$element",function(t,e){this.scope=t,t.$element=e,t.$modelValue=null,t.$nodeScope=null,t.$treeScope=null,t.$type="uiTreeNodes",t.$nodesMap={},t.nodropEnabled=!1,t.maxDepth=0,t.cloneEnabled=!1,t.initSubNode=function(e){return e.$modelValue?void(t.$nodesMap[e.$modelValue.$$hashKey]=e):null},t.destroySubNode=function(e){return e.$modelValue?void(t.$nodesMap[e.$modelValue.$$hashKey]=null):null},t.accept=function(e,n){return t.$treeScope.$callbacks.accept(e,t,n)},t.beforeDrag=function(e){return t.$treeScope.$callbacks.beforeDrag(e)},t.isParent=function(e){return e.$parentNodesScope==t},t.hasChild=function(){return t.$modelValue.length>0},t.safeApply=function(t){var e=this.$root.$$phase;"$apply"==e||"$digest"==e?t&&"function"==typeof t&&t():this.$apply(t)},t.removeNode=function(e){var n=t.$modelValue.indexOf(e.$modelValue);return n>-1?(t.safeApply(function(){t.$modelValue.splice(n,1)[0]}),t.$treeScope.$callbacks.removed(e)):null},t.insertNode=function(e,n){t.safeApply(function(){t.$modelValue.splice(e,0,n)})},t.childNodes=function(){var e,n=[];if(t.$modelValue)for(e=0;e<t.$modelValue.length;e++)n.push(t.$nodesMap[t.$modelValue[e].$$hashKey]);return n},t.depth=function(){return t.$nodeScope?t.$nodeScope.depth():0},t.outOfDepth=function(e){var n=t.maxDepth||t.$treeScope.maxDepth;return n>0?t.depth()+e.maxSubDepth()+1>n:!1}}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeController",["$scope","$element",function(t,e){this.scope=t,t.$element=e,t.$nodesScope=null,t.$type="uiTree",t.$emptyElm=null,t.$callbacks=null,t.dragEnabled=!0,t.emptyPlaceholderEnabled=!0,t.maxDepth=0,t.dragDelay=0,t.cloneEnabled=!1,t.nodropEnabled=!1,t.isEmpty=function(){return t.$nodesScope&&t.$nodesScope.$modelValue&&0===t.$nodesScope.$modelValue.length},t.place=function(e){t.$nodesScope.$element.append(e),t.$emptyElm.remove()},this.resetEmptyElement=function(){t.$nodesScope.$modelValue&&0!==t.$nodesScope.$modelValue.length||!t.emptyPlaceholderEnabled?t.$emptyElm.remove():e.append(t.$emptyElm)},t.resetEmptyElement=this.resetEmptyElement}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTree",["treeConfig","$window",function(t,e){return{restrict:"A",scope:!0,controller:"TreeController",link:function(n,i,r,o){var a,s,l,u={accept:null,beforeDrag:null},c={};angular.extend(c,t),c.treeClass&&i.addClass(c.treeClass),"table"===i.prop("tagName").toLowerCase()?(n.$emptyElm=angular.element(e.document.createElement("tr")),s=i.find("tr"),l=s.length>0?angular.element(s).children().length:1e6,a=angular.element(e.document.createElement("td")).attr("colspan",l),n.$emptyElm.append(a)):n.$emptyElm=angular.element(e.document.createElement("div")),c.emptyTreeClass&&n.$emptyElm.addClass(c.emptyTreeClass),n.$watch("$nodesScope.$modelValue.length",function(t){angular.isNumber(t)&&o.resetEmptyElement()},!0),n.$watch(r.dragEnabled,function(t){"boolean"==typeof t&&(n.dragEnabled=t)}),n.$watch(r.emptyPlaceholderEnabled,function(t){"boolean"==typeof t&&(n.emptyPlaceholderEnabled=t,o.resetEmptyElement())}),n.$watch(r.nodropEnabled,function(t){"boolean"==typeof t&&(n.nodropEnabled=t)}),n.$watch(r.cloneEnabled,function(t){"boolean"==typeof t&&(n.cloneEnabled=t)}),n.$watch(r.maxDepth,function(t){"number"==typeof t&&(n.maxDepth=t)}),n.$watch(r.dragDelay,function(t){"number"==typeof t&&(n.dragDelay=t)}),u.accept=function(t,e,n){return!(e.nodropEnabled||e.$treeScope.nodropEnabled||e.outOfDepth(t))},u.beforeDrag=function(t){return!0},u.removed=function(t){},u.dropped=function(t){},u.dragStart=function(t){},u.dragMove=function(t){},u.dragStop=function(t){},u.beforeDrop=function(t){},n.$watch(r.uiTree,function(t,e){angular.forEach(t,function(t,e){u[e]&&"function"==typeof t&&(u[e]=t)}),n.$callbacks=u},!0)}}}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTreeHandle",["treeConfig",function(t){return{require:"^uiTreeNode",restrict:"A",scope:!0,controller:"TreeHandleController",link:function(e,n,i,r){var o={};angular.extend(o,t),o.handleClass&&n.addClass(o.handleClass),e!=r.scope&&(e.$nodeScope=r.scope,r.scope.$handleScope=e)}}}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTreeNode",["treeConfig","UiTreeHelper","$window","$document","$timeout","$q","$rootElement",function(t,e,n,i,r,o,a){return{require:["^uiTreeNodes","^uiTree"],restrict:"A",controller:"TreeNodeController",link:function(s,l,u,c){var d,h,f,p,m,g,v,y,b,$,w,x,C,S,k,D,E,_,M,T,P,A,j,O,F={},I="ontouchstart"in window,N=null,R=document.body,L=document.documentElement;angular.extend(F,t),F.nodeClass&&l.addClass(F.nodeClass),s.init(c),s.collapsed=!!e.getNodeAttribute(s,"collapsed")||t.defaultCollapsed,s.sourceOnly=s.nodropEnabled||s.$treeScope.nodropEnabled,s.$watch(u.collapsed,function(t){"boolean"==typeof t&&(s.collapsed=t)}),s.$watch("collapsed",function(t){e.setNodeAttribute(s,"collapsed",t),u.$set("collapsed",t)}),s.$on("angular-ui-tree:collapse-all",function(){s.collapsed=!0}),s.$on("angular-ui-tree:expand-all",function(){s.collapsed=!1}),$=function(t){if((I||2!==t.button&&3!==t.which)&&!(t.uiTreeDragging||t.originalEvent&&t.originalEvent.uiTreeDragging)){var r,o,u,c,$,w,x,C,S,k=angular.element(t.target);if(r=e.treeNodeHandlerContainerOfElement(k),r&&(k=angular.element(r)),o=l.clone(),C=e.elementIsTreeNode(k),S=e.elementIsTreeNodeHandle(k),(C||S)&&!(C&&e.elementContainsTreeNodeHandler(k)||(u=k.prop("tagName").toLowerCase(),"input"==u||"textarea"==u||"button"==u||"select"==u))){for(O=angular.element(t.target);O&&O[0]&&O[0]!==l;){if(e.nodrag(O))return;O=O.parent()}s.beforeDrag(s)&&(t.uiTreeDragging=!0,t.originalEvent&&(t.originalEvent.uiTreeDragging=!0),t.preventDefault(),$=e.eventObj(t),d=!0,h=e.dragInfo(s),c=l.prop("tagName"),"tr"===c.toLowerCase()?(p=angular.element(n.document.createElement(c)),w=angular.element(n.document.createElement("td")).addClass(F.placeholderClass).attr("colspan",l[0].children.length),p.append(w)):p=angular.element(n.document.createElement(c)).addClass(F.placeholderClass),m=angular.element(n.document.createElement(c)),F.hiddenClass&&m.addClass(F.hiddenClass),f=e.positionStarted($,l),p.css("height",e.height(l)+"px"),g=angular.element(n.document.createElement(s.$parentNodesScope.$element.prop("tagName"))).addClass(s.$parentNodesScope.$element.attr("class")).addClass(F.dragClass),g.css("width",e.width(l)+"px"),g.css("z-index",9999),x=(l[0].querySelector(".angular-ui-tree-handle")||l[0]).currentStyle,x&&(document.body.setAttribute("ui-tree-cursor",i.find("body").css("cursor")||""),i.find("body").css({cursor:x.cursor+"!important"})),s.sourceOnly&&p.css("display","none"),l.after(p),l.after(m),h.isClone()&&s.sourceOnly?g.append(o):g.append(l),a.append(g),g.css({left:$.pageX-f.offsetX+"px",top:$.pageY-f.offsetY+"px"}),v={placeholder:p,dragging:g},M(),s.$apply(function(){s.$treeScope.$callbacks.dragStart(h.eventArgs(v,f))}),y=Math.max(R.scrollHeight,R.offsetHeight,L.clientHeight,L.scrollHeight,L.offsetHeight),b=Math.max(R.scrollWidth,R.offsetWidth,L.clientWidth,L.scrollWidth,L.offsetWidth))}}},w=function(t){var i,r,o,a,l,u,c,m,$,w,x,C,S,k,D,E,_=e.eventObj(t);if(g){if(t.preventDefault(),n.getSelection?n.getSelection().removeAllRanges():n.document.selection&&n.document.selection.empty(),o=_.pageX-f.offsetX,a=_.pageY-f.offsetY,0>o&&(o=0),0>a&&(a=0),a+10>y&&(a=y-10),o+10>b&&(o=b-10),g.css({left:o+"px",top:a+"px"}),l=window.pageYOffset||n.document.documentElement.scrollTop,u=l+(window.innerHeight||n.document.clientHeight||n.document.clientHeight),u<_.pageY&&y>=u&&window.scrollBy(0,10),l>_.pageY&&window.scrollBy(0,-10),e.positionMoved(t,f,d),d)return void(d=!1);if(m=e.offset(g).left-e.offset(p).left>=F.threshold,$=_.pageX-(n.pageXOffset||n.document.body.scrollLeft||n.document.documentElement.scrollLeft)-(n.document.documentElement.clientLeft||0),w=_.pageY-(n.pageYOffset||n.document.body.scrollTop||n.document.documentElement.scrollTop)-(n.document.documentElement.clientTop||0),angular.isFunction(g.hide)?g.hide():(x=g[0].style.display,g[0].style.display="none"),n.document.elementFromPoint($,w),S=angular.element(n.document.elementFromPoint($,w)),j=e.treeNodeHandlerContainerOfElement(S),j&&(S=angular.element(j)),angular.isFunction(g.show)?g.show():g[0].style.display=x,A=!(e.elementIsTreeNodeHandle(S)||e.elementIsTreeNode(S)||e.elementIsTreeNodes(S)||e.elementIsTree(S)||e.elementIsPlaceholder(S)),A&&(p.remove(),N&&(N.resetEmptyElement(),N=null)),f.dirAx&&f.distAxX>=F.levelThreshold&&(f.distAxX=0,f.distX>0&&(i=h.prev(),i&&!i.collapsed&&i.accept(s,i.childNodesCount())&&(i.$childNodesScope.$element.append(p),h.moveTo(i.$childNodesScope,i.childNodes(),i.childNodesCount()))),f.distX<0&&(r=h.next(),r||(c=h.parentNode(),c&&c.$parentNodesScope.accept(s,c.index()+1)&&(c.$element.after(p),h.moveTo(c.$parentNodesScope,c.siblings(),c.index()+1))))),!f.dirAx){if(e.elementIsTree(S)?C=S.controller("uiTree").scope:e.elementIsTreeNodeHandle(S)?C=S.controller("uiTreeHandle").scope:e.elementIsTreeNode(S)?C=S.controller("uiTreeNode").scope:e.elementIsTreeNodes(S)?C=S.controller("uiTreeNodes").scope:e.elementIsPlaceholder(S)?C=S.controller("uiTreeNodes").scope:S.controller("uiTreeNode")&&(C=S.controller("uiTreeNode").scope),k=!1,!C)return;if(!C.$treeScope||C.$parent.nodropEnabled||C.$treeScope.nodropEnabled||p.css("display",""),"uiTree"==C.$type&&C.dragEnabled&&(k=C.isEmpty()),"uiTreeHandle"==C.$type&&(C=C.$nodeScope),"uiTreeNode"!=C.$type&&!k)return;N&&p.parent()[0]!=N.$element[0]&&(N.resetEmptyElement(),N=null),k?(N=C,C.$nodesScope.accept(s,0)&&(C.place(p),h.moveTo(C.$nodesScope,C.$nodesScope.childNodes(),0))):C.dragEnabled()&&(S=C.$element,D=e.offset(S),E=C.horizontal?_.pageX<D.left+e.width(S)/2:_.pageY<D.top+e.height(S)/2,C.$parentNodesScope.accept(s,C.index())?E?(S[0].parentNode.insertBefore(p[0],S[0]),h.moveTo(C.$parentNodesScope,C.siblings(),C.index())):(S.after(p),h.moveTo(C.$parentNodesScope,C.siblings(),C.index()+1)):!E&&C.accept(s,C.childNodesCount())?(C.$childNodesScope.$element.append(p),h.moveTo(C.$childNodesScope,C.childNodes(),C.childNodesCount())):A=!0)}s.$apply(function(){s.$treeScope.$callbacks.dragMove(h.eventArgs(v,f))})}},x=function(t){var e=h.eventArgs(v,f);t.preventDefault(),T(),s.$treeScope.$apply(function(){o.when(s.$treeScope.$callbacks.beforeDrop(e)).then(function(t){t!==!1&&s.$$allowNodeDrop&&!A?(h.apply(),s.$treeScope.$callbacks.dropped(e)):_()})["catch"](function(){_()})["finally"](function(){m.replaceWith(s.$element),p.remove(),g&&(g.remove(),g=null),s.$treeScope.$callbacks.dragStop(e),s.$$allowNodeDrop=!1,h=null;var t=document.body.getAttribute("ui-tree-cursor");null!==t&&(i.find("body").css({cursor:t}),document.body.removeAttribute("ui-tree-cursor"))})})},C=function(t){s.dragEnabled()&&$(t)},S=function(t){w(t)},k=function(t){s.$$allowNodeDrop=!0,x(t)},D=function(t){x(t)},E=function(){var t;return{exec:function(e,n){n||(n=0),this.cancel(),t=r(e,n)},cancel:function(){r.cancel(t)}}}(),_=function(){l.bind("touchstart mousedown",function(t){E.exec(function(){C(t)},s.dragDelay||0)}),l.bind("touchend touchcancel mouseup",function(){E.cancel()})},_(),M=function(){angular.element(i).bind("touchend",k),angular.element(i).bind("touchcancel",k),angular.element(i).bind("touchmove",S),angular.element(i).bind("mouseup",k),angular.element(i).bind("mousemove",S),angular.element(i).bind("mouseleave",D)},T=function(){angular.element(i).unbind("touchend",k),angular.element(i).unbind("touchcancel",k),angular.element(i).unbind("touchmove",S),angular.element(i).unbind("mouseup",k),angular.element(i).unbind("mousemove",S),angular.element(i).unbind("mouseleave",D)},P=function(t){27==t.keyCode&&(s.$$allowNodeDrop=!1,x(t))},angular.element(n.document).bind("keydown",P),s.$on("$destroy",function(){angular.element(n.document).unbind("keydown",P)})}}}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTreeNodes",["treeConfig","$window",function(t){return{require:["ngModel","?^uiTreeNode","^uiTree"],restrict:"A",scope:!0,controller:"TreeNodesController",link:function(e,n,i,r){var o={},a=r[0],s=r[1],l=r[2];angular.extend(o,t),o.nodesClass&&n.addClass(o.nodesClass),s?(s.scope.$childNodesScope=e,e.$nodeScope=s.scope):l.scope.$nodesScope=e,e.$treeScope=l.scope,a&&(a.$render=function(){e.$modelValue=a.$modelValue}),e.$watch(function(){return i.maxDepth},function(t){"number"==typeof t&&(e.maxDepth=t)}),e.$watch(function(){return i.nodropEnabled},function(t){"undefined"!=typeof t&&(e.nodropEnabled=!0)},!0),i.$observe("horizontal",function(t){e.horizontal="undefined"!=typeof t})}}}])}(),function(){"use strict";function t(t,e){if(void 0===e)return null;for(var n=e.parentNode,i=1,r="function"==typeof n.setAttribute&&n.hasAttribute(t)?n:null;n&&"function"==typeof n.setAttribute&&!n.hasAttribute(t);){if(n=n.parentNode,r=n,n===document.documentElement){r=null;break}i++}return r}angular.module("ui.tree").factory("UiTreeHelper",["$document","$window","treeConfig",function(e,n,i){return{nodesData:{},setNodeAttribute:function(t,e,n){if(!t.$modelValue)return null;var i=this.nodesData[t.$modelValue.$$hashKey];i||(i={},this.nodesData[t.$modelValue.$$hashKey]=i),i[e]=n},getNodeAttribute:function(t,e){if(!t.$modelValue)return null;var n=this.nodesData[t.$modelValue.$$hashKey];return n?n[e]:null},nodrag:function(t){return"undefined"!=typeof t.attr("data-nodrag")?"false"!==t.attr("data-nodrag"):!1},eventObj:function(t){var e=t;return void 0!==t.targetTouches?e=t.targetTouches.item(0):void 0!==t.originalEvent&&void 0!==t.originalEvent.targetTouches&&(e=t.originalEvent.targetTouches.item(0)),e},dragInfo:function(t){return{source:t,sourceInfo:{cloneModel:t.$treeScope.cloneEnabled===!0?angular.copy(t.$modelValue):void 0,nodeScope:t,index:t.index(),nodesScope:t.$parentNodesScope},index:t.index(),siblings:t.siblings().slice(0),parent:t.$parentNodesScope,moveTo:function(t,e,n){this.parent=t,this.siblings=e.slice(0);var i=this.siblings.indexOf(this.source);i>-1&&(this.siblings.splice(i,1),this.source.index()<n&&n--),this.siblings.splice(n,0,this.source),this.index=n},parentNode:function(){return this.parent.$nodeScope},prev:function(){return this.index>0?this.siblings[this.index-1]:null},next:function(){return this.index<this.siblings.length-1?this.siblings[this.index+1]:null},isClone:function(){return this.source.$treeScope.cloneEnabled===!0},clonedNode:function(t){return angular.copy(t)},isDirty:function(){return this.source.$parentNodesScope!=this.parent||this.source.index()!=this.index},isForeign:function(){return this.source.$treeScope!==this.parent.$treeScope},eventArgs:function(t,e){return{source:this.sourceInfo,dest:{index:this.index,nodesScope:this.parent},elements:t,pos:e}},apply:function(){var t=this.source.$modelValue;this.parent.nodropEnabled||this.parent.$treeScope.nodropEnabled||this.isDirty()&&(this.isClone()&&this.isForeign()?this.parent.insertNode(this.index,this.sourceInfo.cloneModel):(this.source.remove(),this.parent.insertNode(this.index,t)))}}},height:function(t){return t.prop("scrollHeight")},width:function(t){return t.prop("scrollWidth")},offset:function(t){var i=t[0].getBoundingClientRect();return{width:t.prop("offsetWidth"),height:t.prop("offsetHeight"),top:i.top+(n.pageYOffset||e[0].body.scrollTop||e[0].documentElement.scrollTop),left:i.left+(n.pageXOffset||e[0].body.scrollLeft||e[0].documentElement.scrollLeft)}},positionStarted:function(t,e){var n={},i=t.pageX,r=t.pageY;return t.originalEvent&&t.originalEvent.touches&&t.originalEvent.touches.length>0&&(i=t.originalEvent.touches[0].pageX,r=t.originalEvent.touches[0].pageY),n.offsetX=i-this.offset(e).left,n.offsetY=r-this.offset(e).top,n.startX=n.lastX=i,n.startY=n.lastY=r,n.nowX=n.nowY=n.distX=n.distY=n.dirAx=0,n.dirX=n.dirY=n.lastDirX=n.lastDirY=n.distAxX=n.distAxY=0,n},positionMoved:function(t,e,n){var i,r=t.pageX,o=t.pageY;return t.originalEvent&&t.originalEvent.touches&&t.originalEvent.touches.length>0&&(r=t.originalEvent.touches[0].pageX,o=t.originalEvent.touches[0].pageY),e.lastX=e.nowX,e.lastY=e.nowY,e.nowX=r,e.nowY=o,e.distX=e.nowX-e.lastX,e.distY=e.nowY-e.lastY,e.lastDirX=e.dirX,e.lastDirY=e.dirY,e.dirX=0===e.distX?0:e.distX>0?1:-1,e.dirY=0===e.distY?0:e.distY>0?1:-1,i=Math.abs(e.distX)>Math.abs(e.distY)?1:0,n?(e.dirAx=i,void(e.moving=!0)):(e.dirAx!==i?(e.distAxX=0,e.distAxY=0):(e.distAxX+=Math.abs(e.distX),0!==e.dirX&&e.dirX!==e.lastDirX&&(e.distAxX=0),e.distAxY+=Math.abs(e.distY),0!==e.dirY&&e.dirY!==e.lastDirY&&(e.distAxY=0)),void(e.dirAx=i))},elementIsTreeNode:function(t){return"undefined"!=typeof t.attr("ui-tree-node")},elementIsTreeNodeHandle:function(t){return"undefined"!=typeof t.attr("ui-tree-handle")},elementIsTree:function(t){return"undefined"!=typeof t.attr("ui-tree")},elementIsTreeNodes:function(t){return"undefined"!=typeof t.attr("ui-tree-nodes")},elementIsPlaceholder:function(t){return t.hasClass(i.placeholderClass)},elementContainsTreeNodeHandler:function(t){return t[0].querySelectorAll("[ui-tree-handle]").length>=1},treeNodeHandlerContainerOfElement:function(e){return t("ui-tree-handle",e[0])}}}])}(),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.moment=e()}(this,function(){"use strict";function t(){return Gn.apply(null,arguments)}function e(t){Gn=t}function n(t){return"[object Array]"===Object.prototype.toString.call(t)}function i(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function r(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function a(t,e){for(var n in e)o(e,n)&&(t[n]=e[n]);return o(e,"toString")&&(t.toString=e.toString),o(e,"valueOf")&&(t.valueOf=e.valueOf),t}function s(t,e,n,i){return Mt(t,e,n,i,!0).utc()}function l(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function u(t){return null==t._pf&&(t._pf=l()),t._pf}function c(t){if(null==t._isValid){var e=u(t);t._isValid=!(isNaN(t._d.getTime())||!(e.overflow<0)||e.empty||e.invalidMonth||e.invalidWeekday||e.nullInput||e.invalidFormat||e.userInvalidated),t._strict&&(t._isValid=t._isValid&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour)}return t._isValid}function d(t){var e=s(NaN);return null!=t?a(u(e),t):u(e).userInvalidated=!0,e}function h(t){return void 0===t}function f(t,e){var n,i,r;if(h(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),h(e._i)||(t._i=e._i),h(e._f)||(t._f=e._f),h(e._l)||(t._l=e._l),h(e._strict)||(t._strict=e._strict),h(e._tzm)||(t._tzm=e._tzm),h(e._isUTC)||(t._isUTC=e._isUTC),h(e._offset)||(t._offset=e._offset),h(e._pf)||(t._pf=u(e)),h(e._locale)||(t._locale=e._locale),Xn.length>0)for(n in Xn)i=Xn[n],r=e[i],h(r)||(t[i]=r);return t}function p(e){f(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),Kn===!1&&(Kn=!0,t.updateOffset(this),Kn=!1)}function m(t){return t instanceof p||null!=t&&null!=t._isAMomentObject}function g(t){return 0>t?Math.ceil(t):Math.floor(t)}function v(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=g(e)),n}function y(t,e,n){var i,r=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),a=0;for(i=0;r>i;i++)(n&&t[i]!==e[i]||!n&&v(t[i])!==v(e[i]))&&a++;return a+o}function b(){}function $(t){return t?t.toLowerCase().replace("_","-"):t}function w(t){for(var e,n,i,r,o=0;o<t.length;){for(r=$(t[o]).split("-"),e=r.length,n=$(t[o+1]),n=n?n.split("-"):null;e>0;){if(i=x(r.slice(0,e).join("-")))return i;if(n&&n.length>=e&&y(r,n,!0)>=e-1)break;e--}o++}return null}function x(t){var e=null;if(!Zn[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=qn._abbr,require("./locale/"+t),C(e)}catch(n){}return Zn[t]}function C(t,e){var n;return t&&(n=h(e)?k(t):S(t,e),n&&(qn=n)),qn._abbr}function S(t,e){return null!==e?(e.abbr=t,Zn[t]=Zn[t]||new b,Zn[t].set(e),C(t),Zn[t]):(delete Zn[t],null)}function k(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return qn;if(!n(t)){if(e=x(t))return e;t=[t]}return w(t)}function D(t,e){var n=t.toLowerCase();Qn[n]=Qn[n+"s"]=Qn[e]=t}function E(t){return"string"==typeof t?Qn[t]||Qn[t.toLowerCase()]:void 0}function _(t){var e,n,i={};for(n in t)o(t,n)&&(e=E(n),e&&(i[e]=t[n]));return i}function M(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function T(e,n){return function(i){return null!=i?(A(this,e,i),t.updateOffset(this,n),this):P(this,e)}}function P(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function A(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function j(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=E(t),M(this[t]))return this[t](e);return this}function O(t,e,n){var i=""+Math.abs(t),r=e-i.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}function F(t,e,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),t&&(ni[t]=r),e&&(ni[e[0]]=function(){return O(r.apply(this,arguments),e[1],e[2])}),n&&(ni[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function I(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function N(t){var e,n,i=t.match(Jn);for(e=0,n=i.length;n>e;e++)ni[i[e]]?i[e]=ni[i[e]]:i[e]=I(i[e]);return function(r){var o="";for(e=0;n>e;e++)o+=i[e]instanceof Function?i[e].call(r,t):i[e];return o}}function R(t,e){return t.isValid()?(e=L(e,t.localeData()),ei[e]=ei[e]||N(e),ei[e](t)):t.localeData().invalidDate()}function L(t,e){function n(t){return e.longDateFormat(t)||t}var i=5;for(ti.lastIndex=0;i>=0&&ti.test(t);)t=t.replace(ti,n),ti.lastIndex=0,i-=1;return t}function V(t,e,n){$i[t]=M(e)?e:function(t,i){return t&&n?n:e}}function H(t,e){return o($i,t)?$i[t](e._strict,e._locale):new RegExp(B(t))}function B(t){return U(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,r){return e||n||i||r}))}function U(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Y(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(i=function(t,n){n[e]=v(t)}),n=0;n<t.length;n++)wi[t[n]]=i}function W(t,e){Y(t,function(t,n,i,r){i._w=i._w||{},e(t,i._w,i,r)})}function z(t,e,n){null!=e&&o(wi,t)&&wi[t](e,n._a,n,t)}function G(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function q(t,e){return n(this._months)?this._months[t.month()]:this._months[Pi.test(e)?"format":"standalone"][t.month()]}function X(t,e){return n(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Pi.test(e)?"format":"standalone"][t.month()]}function K(t,e,n){var i,r,o;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;12>i;i++){if(r=s([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}}function Z(t,e){var n;return t.isValid()?"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(n=Math.min(t.date(),G(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t):t}function Q(e){return null!=e?(Z(this,e),t.updateOffset(this,!0),this):P(this,"Month")}function J(){return G(this.year(),this.month())}function tt(t){return this._monthsParseExact?(o(this,"_monthsRegex")||nt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function et(t){return this._monthsParseExact?(o(this,"_monthsRegex")||nt.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function nt(){function t(t,e){return e.length-t.length}var e,n,i=[],r=[],o=[];for(e=0;12>e;e++)n=s([2e3,e]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(i.sort(t),r.sort(t),o.sort(t),e=0;12>e;e++)i[e]=U(i[e]),r[e]=U(r[e]),o[e]=U(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")$","i")}function it(t){var e,n=t._a;return n&&-2===u(t).overflow&&(e=n[Ci]<0||n[Ci]>11?Ci:n[Si]<1||n[Si]>G(n[xi],n[Ci])?Si:n[ki]<0||n[ki]>24||24===n[ki]&&(0!==n[Di]||0!==n[Ei]||0!==n[_i])?ki:n[Di]<0||n[Di]>59?Di:n[Ei]<0||n[Ei]>59?Ei:n[_i]<0||n[_i]>999?_i:-1,u(t)._overflowDayOfYear&&(xi>e||e>Si)&&(e=Si),u(t)._overflowWeeks&&-1===e&&(e=Mi),u(t)._overflowWeekday&&-1===e&&(e=Ti),u(t).overflow=e),t}function rt(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function ot(t,e){var n=!0;return a(function(){return n&&(rt(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function at(t,e){Ii[t]||(rt(e),Ii[t]=!0)}function st(t){var e,n,i,r,o,a,s=t._i,l=Ni.exec(s)||Ri.exec(s);if(l){for(u(t).iso=!0,e=0,n=Vi.length;n>e;e++)if(Vi[e][1].exec(l[1])){r=Vi[e][0],i=Vi[e][2]!==!1;break}if(null==r)return void(t._isValid=!1);if(l[3]){for(e=0,n=Hi.length;n>e;e++)if(Hi[e][1].exec(l[3])){o=(l[2]||" ")+Hi[e][0];break}if(null==o)return void(t._isValid=!1)}if(!i&&null!=o)return void(t._isValid=!1);if(l[4]){if(!Li.exec(l[4]))return void(t._isValid=!1);a="Z"}t._f=r+(o||"")+(a||""),xt(t)}else t._isValid=!1}function lt(e){var n=Bi.exec(e._i);return null!==n?void(e._d=new Date(+n[1])):(st(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function ut(t,e,n,i,r,o,a){var s=new Date(t,e,n,i,r,o,a);return 100>t&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function ct(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function dt(t){return ht(t)?366:365}function ht(t){return t%4===0&&t%100!==0||t%400===0}function ft(){return ht(this.year())}function pt(t,e,n){var i=7+e-n,r=(7+ct(t,0,i).getUTCDay()-e)%7;return-r+i-1}function mt(t,e,n,i,r){var o,a,s=(7+n-i)%7,l=pt(t,i,r),u=1+7*(e-1)+s+l;return 0>=u?(o=t-1,a=dt(o)+u):u>dt(t)?(o=t+1,a=u-dt(t)):(o=t,a=u),{year:o,dayOfYear:a}}function gt(t,e,n){var i,r,o=pt(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return 1>a?(r=t.year()-1,i=a+vt(r,e,n)):a>vt(t.year(),e,n)?(i=a-vt(t.year(),e,n),r=t.year()+1):(r=t.year(),i=a),{week:i,year:r}}function vt(t,e,n){var i=pt(t,e,n),r=pt(t+1,e,n);return(dt(t)-i+r)/7}function yt(t,e,n){return null!=t?t:null!=e?e:n}function bt(e){var n=new Date(t.now());return e._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function $t(t){var e,n,i,r,o=[];if(!t._d){for(i=bt(t),t._w&&null==t._a[Si]&&null==t._a[Ci]&&wt(t),t._dayOfYear&&(r=yt(t._a[xi],i[xi]),t._dayOfYear>dt(r)&&(u(t)._overflowDayOfYear=!0),n=ct(r,0,t._dayOfYear),t._a[Ci]=n.getUTCMonth(),t._a[Si]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=i[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ki]&&0===t._a[Di]&&0===t._a[Ei]&&0===t._a[_i]&&(t._nextDay=!0,t._a[ki]=0),t._d=(t._useUTC?ct:ut).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ki]=24)}}function wt(t){var e,n,i,r,o,a,s,l;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,a=4,n=yt(e.GG,t._a[xi],gt(Tt(),1,4).year),i=yt(e.W,1),r=yt(e.E,1),(1>r||r>7)&&(l=!0)):(o=t._locale._week.dow,a=t._locale._week.doy,n=yt(e.gg,t._a[xi],gt(Tt(),o,a).year),i=yt(e.w,1),null!=e.d?(r=e.d,(0>r||r>6)&&(l=!0)):null!=e.e?(r=e.e+o,(e.e<0||e.e>6)&&(l=!0)):r=o),1>i||i>vt(n,o,a)?u(t)._overflowWeeks=!0:null!=l?u(t)._overflowWeekday=!0:(s=mt(n,i,r,o,a),t._a[xi]=s.year,t._dayOfYear=s.dayOfYear)}function xt(e){if(e._f===t.ISO_8601)return void st(e);e._a=[],u(e).empty=!0;var n,i,r,o,a,s=""+e._i,l=s.length,c=0;for(r=L(e._f,e._locale).match(Jn)||[],n=0;n<r.length;n++)o=r[n],i=(s.match(H(o,e))||[])[0],i&&(a=s.substr(0,s.indexOf(i)),a.length>0&&u(e).unusedInput.push(a),s=s.slice(s.indexOf(i)+i.length),c+=i.length),ni[o]?(i?u(e).empty=!1:u(e).unusedTokens.push(o),z(o,i,e)):e._strict&&!i&&u(e).unusedTokens.push(o);u(e).charsLeftOver=l-c,s.length>0&&u(e).unusedInput.push(s),u(e).bigHour===!0&&e._a[ki]<=12&&e._a[ki]>0&&(u(e).bigHour=void 0),e._a[ki]=Ct(e._locale,e._a[ki],e._meridiem),$t(e),it(e)}function Ct(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(i=t.isPM(n),i&&12>e&&(e+=12),i||12!==e||(e=0),e):e}function St(t){var e,n,i,r,o;if(0===t._f.length)return u(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;r<t._f.length;r++)o=0,e=f({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[r],xt(e),c(e)&&(o+=u(e).charsLeftOver,o+=10*u(e).unusedTokens.length,u(e).score=o,(null==i||i>o)&&(i=o,n=e));a(t,n||e)}function kt(t){if(!t._d){var e=_(t._i);t._a=r([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),$t(t)}}function Dt(t){var e=new p(it(Et(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Et(t){var e=t._i,r=t._f;return t._locale=t._locale||k(t._l),null===e||void 0===r&&""===e?d({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),m(e)?new p(it(e)):(n(r)?St(t):r?xt(t):i(e)?t._d=e:_t(t),c(t)||(t._d=null),t))}function _t(e){var o=e._i;void 0===o?e._d=new Date(t.now()):i(o)?e._d=new Date(+o):"string"==typeof o?lt(e):n(o)?(e._a=r(o.slice(0),function(t){return parseInt(t,10)}),$t(e)):"object"==typeof o?kt(e):"number"==typeof o?e._d=new Date(o):t.createFromInputFallback(e)}function Mt(t,e,n,i,r){var o={};return"boolean"==typeof n&&(i=n,n=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=r,o._l=n,o._i=t,o._f=e,o._strict=i,Dt(o)}function Tt(t,e,n,i){return Mt(t,e,n,i,!1)}function Pt(t,e){var i,r;if(1===e.length&&n(e[0])&&(e=e[0]),!e.length)return Tt();for(i=e[0],r=1;r<e.length;++r)e[r].isValid()&&!e[r][t](i)||(i=e[r]);return i}function At(){var t=[].slice.call(arguments,0);return Pt("isBefore",t)}function jt(){var t=[].slice.call(arguments,0);return Pt("isAfter",t)}function Ot(t){var e=_(t),n=e.year||0,i=e.quarter||0,r=e.month||0,o=e.week||0,a=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._milliseconds=+c+1e3*u+6e4*l+36e5*s,this._days=+a+7*o,this._months=+r+3*i+12*n,this._data={},this._locale=k(),this._bubble()}function Ft(t){return t instanceof Ot}function It(t,e){F(t,0,0,function(){var t=this.utcOffset(),n="+";return 0>t&&(t=-t,n="-"),n+O(~~(t/60),2)+e+O(~~t%60,2)})}function Nt(t,e){var n=(e||"").match(t)||[],i=n[n.length-1]||[],r=(i+"").match(Gi)||["-",0,0],o=+(60*r[1])+v(r[2]);return"+"===r[0]?o:-o}function Rt(e,n){var r,o;return n._isUTC?(r=n.clone(),o=(m(e)||i(e)?+e:+Tt(e))-+r,r._d.setTime(+r._d+o),t.updateOffset(r,!1),
r):Tt(e).local()}function Lt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Vt(e,n){var i,r=this._offset||0;return this.isValid()?null!=e?("string"==typeof e?e=Nt(vi,e):Math.abs(e)<16&&(e=60*e),!this._isUTC&&n&&(i=Lt(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==e&&(!n||this._changeInProgress?ne(this,Zt(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:Lt(this):null!=e?this:NaN}function Ht(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Bt(t){return this.utcOffset(0,t)}function Ut(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Lt(this),"m")),this}function Yt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Nt(gi,this._i)),this}function Wt(t){return this.isValid()?(t=t?Tt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function zt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Gt(){if(!h(this._isDSTShifted))return this._isDSTShifted;var t={};if(f(t,this),t=Et(t),t._a){var e=t._isUTC?s(t._a):Tt(t._a);this._isDSTShifted=this.isValid()&&y(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function qt(){return this.isValid()?!this._isUTC:!1}function Xt(){return this.isValid()?this._isUTC:!1}function Kt(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Zt(t,e){var n,i,r,a=t,s=null;return Ft(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(s=qi.exec(t))?(n="-"===s[1]?-1:1,a={y:0,d:v(s[Si])*n,h:v(s[ki])*n,m:v(s[Di])*n,s:v(s[Ei])*n,ms:v(s[_i])*n}):(s=Xi.exec(t))?(n="-"===s[1]?-1:1,a={y:Qt(s[2],n),M:Qt(s[3],n),d:Qt(s[4],n),h:Qt(s[5],n),m:Qt(s[6],n),s:Qt(s[7],n),w:Qt(s[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(r=te(Tt(a.from),Tt(a.to)),a={},a.ms=r.milliseconds,a.M=r.months),i=new Ot(a),Ft(t)&&o(t,"_locale")&&(i._locale=t._locale),i}function Qt(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Jt(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function te(t,e){var n;return t.isValid()&&e.isValid()?(e=Rt(e,t),t.isBefore(e)?n=Jt(t,e):(n=Jt(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ee(t,e){return function(n,i){var r,o;return null===i||isNaN(+i)||(at(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),o=n,n=i,i=o),n="string"==typeof n?+n:n,r=Zt(n,i),ne(this,r,t),this}}function ne(e,n,i,r){var o=n._milliseconds,a=n._days,s=n._months;e.isValid()&&(r=null==r?!0:r,o&&e._d.setTime(+e._d+o*i),a&&A(e,"Date",P(e,"Date")+a*i),s&&Z(e,P(e,"Month")+s*i),r&&t.updateOffset(e,a||s))}function ie(t,e){var n=t||Tt(),i=Rt(n,this).startOf("day"),r=this.diff(i,"days",!0),o=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse",a=e&&(M(e[o])?e[o]():e[o]);return this.format(a||this.localeData().calendar(o,this,Tt(n)))}function re(){return new p(this)}function oe(t,e){var n=m(t)?t:Tt(t);return this.isValid()&&n.isValid()?(e=E(h(e)?"millisecond":e),"millisecond"===e?+this>+n:+n<+this.clone().startOf(e)):!1}function ae(t,e){var n=m(t)?t:Tt(t);return this.isValid()&&n.isValid()?(e=E(h(e)?"millisecond":e),"millisecond"===e?+n>+this:+this.clone().endOf(e)<+n):!1}function se(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)}function le(t,e){var n,i=m(t)?t:Tt(t);return this.isValid()&&i.isValid()?(e=E(e||"millisecond"),"millisecond"===e?+this===+i:(n=+i,+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e))):!1}function ue(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ce(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function de(t,e,n){var i,r,o,a;return this.isValid()?(i=Rt(t,this),i.isValid()?(r=6e4*(i.utcOffset()-this.utcOffset()),e=E(e),"year"===e||"month"===e||"quarter"===e?(a=he(this,i),"quarter"===e?a/=3:"year"===e&&(a/=12)):(o=this-i,a="second"===e?o/1e3:"minute"===e?o/6e4:"hour"===e?o/36e5:"day"===e?(o-r)/864e5:"week"===e?(o-r)/6048e5:o),n?a:g(a)):NaN):NaN}function he(t,e){var n,i,r=12*(e.year()-t.year())+(e.month()-t.month()),o=t.clone().add(r,"months");return 0>e-o?(n=t.clone().add(r-1,"months"),i=(e-o)/(o-n)):(n=t.clone().add(r+1,"months"),i=(e-o)/(n-o)),-(r+i)}function fe(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function pe(){var t=this.clone().utc();return 0<t.year()&&t.year()<=9999?M(Date.prototype.toISOString)?this.toDate().toISOString():R(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):R(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function me(e){var n=R(this,e||t.defaultFormat);return this.localeData().postformat(n)}function ge(t,e){return this.isValid()&&(m(t)&&t.isValid()||Tt(t).isValid())?Zt({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ve(t){return this.from(Tt(),t)}function ye(t,e){return this.isValid()&&(m(t)&&t.isValid()||Tt(t).isValid())?Zt({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function be(t){return this.to(Tt(),t)}function $e(t){var e;return void 0===t?this._locale._abbr:(e=k(t),null!=e&&(this._locale=e),this)}function we(){return this._locale}function xe(t){switch(t=E(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this}function Ce(t){return t=E(t),void 0===t||"millisecond"===t?this:this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms")}function Se(){return+this._d-6e4*(this._offset||0)}function ke(){return Math.floor(+this/1e3)}function De(){return this._offset?new Date(+this):this._d}function Ee(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function _e(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function Me(){return this.isValid()?this.toISOString():"null"}function Te(){return c(this)}function Pe(){return a({},u(this))}function Ae(){return u(this).overflow}function je(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Oe(t,e){F(0,[t,t.length],0,e)}function Fe(t){return Le.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Ie(t){return Le.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Ne(){return vt(this.year(),1,4)}function Re(){var t=this.localeData()._week;return vt(this.year(),t.dow,t.doy)}function Le(t,e,n,i,r){var o;return null==t?gt(this,i,r).year:(o=vt(t,i,r),e>o&&(e=o),Ve.call(this,t,e,n,i,r))}function Ve(t,e,n,i,r){var o=mt(t,e,n,i,r),a=ct(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function He(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Be(t){return gt(t,this._week.dow,this._week.doy).week}function Ue(){return this._week.dow}function Ye(){return this._week.doy}function We(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function ze(t){var e=gt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Ge(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function qe(t,e){return n(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function Xe(t){return this._weekdaysShort[t.day()]}function Ke(t){return this._weekdaysMin[t.day()]}function Ze(t,e,n){var i,r,o;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;7>i;i++){if(r=Tt([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function Qe(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ge(t,this.localeData()),this.add(t-e,"d")):e}function Je(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function tn(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function en(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function nn(){return this.hours()%12||12}function rn(t,e){F(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function on(t,e){return e._meridiemParse}function an(t){return"p"===(t+"").toLowerCase().charAt(0)}function sn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function ln(t,e){e[_i]=v(1e3*("0."+t))}function un(){return this._isUTC?"UTC":""}function cn(){return this._isUTC?"Coordinated Universal Time":""}function dn(t){return Tt(1e3*t)}function hn(){return Tt.apply(null,arguments).parseZone()}function fn(t,e,n){var i=this._calendar[t];return M(i)?i.call(e,n):i}function pn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function mn(){return this._invalidDate}function gn(t){return this._ordinal.replace("%d",t)}function vn(t){return t}function yn(t,e,n,i){var r=this._relativeTime[n];return M(r)?r(t,e,n,i):r.replace(/%d/i,t)}function bn(t,e){var n=this._relativeTime[t>0?"future":"past"];return M(n)?n(e):n.replace(/%s/i,e)}function $n(t){var e,n;for(n in t)e=t[n],M(e)?this[n]=e:this["_"+n]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function wn(t,e,n,i){var r=k(),o=s().set(i,e);return r[n](o,t)}function xn(t,e,n,i,r){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return wn(t,e,n,r);var o,a=[];for(o=0;i>o;o++)a[o]=wn(t,o,n,r);return a}function Cn(t,e){return xn(t,e,"months",12,"month")}function Sn(t,e){return xn(t,e,"monthsShort",12,"month")}function kn(t,e){return xn(t,e,"weekdays",7,"day")}function Dn(t,e){return xn(t,e,"weekdaysShort",7,"day")}function En(t,e){return xn(t,e,"weekdaysMin",7,"day")}function _n(){var t=this._data;return this._milliseconds=br(this._milliseconds),this._days=br(this._days),this._months=br(this._months),t.milliseconds=br(t.milliseconds),t.seconds=br(t.seconds),t.minutes=br(t.minutes),t.hours=br(t.hours),t.months=br(t.months),t.years=br(t.years),this}function Mn(t,e,n,i){var r=Zt(e,n);return t._milliseconds+=i*r._milliseconds,t._days+=i*r._days,t._months+=i*r._months,t._bubble()}function Tn(t,e){return Mn(this,t,e,1)}function Pn(t,e){return Mn(this,t,e,-1)}function An(t){return 0>t?Math.floor(t):Math.ceil(t)}function jn(){var t,e,n,i,r,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||0>=o&&0>=a&&0>=s||(o+=864e5*An(Fn(s)+a),a=0,s=0),l.milliseconds=o%1e3,t=g(o/1e3),l.seconds=t%60,e=g(t/60),l.minutes=e%60,n=g(e/60),l.hours=n%24,a+=g(n/24),r=g(On(a)),s+=r,a-=An(Fn(r)),i=g(s/12),s%=12,l.days=a,l.months=s,l.years=i,this}function On(t){return 4800*t/146097}function Fn(t){return 146097*t/4800}function In(t){var e,n,i=this._milliseconds;if(t=E(t),"month"===t||"year"===t)return e=this._days+i/864e5,n=this._months+On(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Fn(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}function Nn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function Rn(t){return function(){return this.as(t)}}function Ln(t){return t=E(t),this[t+"s"]()}function Vn(t){return function(){return this._data[t]}}function Hn(){return g(this.days()/7)}function Bn(t,e,n,i,r){return r.relativeTime(e||1,!!n,t,i)}function Un(t,e,n){var i=Zt(t).abs(),r=Fr(i.as("s")),o=Fr(i.as("m")),a=Fr(i.as("h")),s=Fr(i.as("d")),l=Fr(i.as("M")),u=Fr(i.as("y")),c=r<Ir.s&&["s",r]||1>=o&&["m"]||o<Ir.m&&["mm",o]||1>=a&&["h"]||a<Ir.h&&["hh",a]||1>=s&&["d"]||s<Ir.d&&["dd",s]||1>=l&&["M"]||l<Ir.M&&["MM",l]||1>=u&&["y"]||["yy",u];return c[2]=e,c[3]=+t>0,c[4]=n,Bn.apply(null,c)}function Yn(t,e){return void 0===Ir[t]?!1:void 0===e?Ir[t]:(Ir[t]=e,!0)}function Wn(t){var e=this.localeData(),n=Un(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function zn(){var t,e,n,i=Nr(this._milliseconds)/1e3,r=Nr(this._days),o=Nr(this._months);t=g(i/60),e=g(t/60),i%=60,t%=60,n=g(o/12),o%=12;var a=n,s=o,l=r,u=e,c=t,d=i,h=this.asSeconds();return h?(0>h?"-":"")+"P"+(a?a+"Y":"")+(s?s+"M":"")+(l?l+"D":"")+(u||c||d?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(d?d+"S":""):"P0D"}var Gn,qn,Xn=t.momentProperties=[],Kn=!1,Zn={},Qn={},Jn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ti=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ei={},ni={},ii=/\d/,ri=/\d\d/,oi=/\d{3}/,ai=/\d{4}/,si=/[+-]?\d{6}/,li=/\d\d?/,ui=/\d\d\d\d?/,ci=/\d\d\d\d\d\d?/,di=/\d{1,3}/,hi=/\d{1,4}/,fi=/[+-]?\d{1,6}/,pi=/\d+/,mi=/[+-]?\d+/,gi=/Z|[+-]\d\d:?\d\d/gi,vi=/Z|[+-]\d\d(?::?\d\d)?/gi,yi=/[+-]?\d+(\.\d{1,3})?/,bi=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,$i={},wi={},xi=0,Ci=1,Si=2,ki=3,Di=4,Ei=5,_i=6,Mi=7,Ti=8;F("M",["MM",2],"Mo",function(){return this.month()+1}),F("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),F("MMMM",0,0,function(t){return this.localeData().months(this,t)}),D("month","M"),V("M",li),V("MM",li,ri),V("MMM",function(t,e){return e.monthsShortRegex(t)}),V("MMMM",function(t,e){return e.monthsRegex(t)}),Y(["M","MM"],function(t,e){e[Ci]=v(t)-1}),Y(["MMM","MMMM"],function(t,e,n,i){var r=n._locale.monthsParse(t,i,n._strict);null!=r?e[Ci]=r:u(n).invalidMonth=t});var Pi=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Ai="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ji="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Oi=bi,Fi=bi,Ii={};t.suppressDeprecationWarnings=!1;var Ni=/^\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)?)?/,Ri=/^\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)?)?/,Li=/Z|[+-]\d\d(?::?\d\d)?/,Vi=[["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}/]],Hi=[["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/]],Bi=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=ot("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),F("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),F(0,["YY",2],0,function(){return this.year()%100}),F(0,["YYYY",4],0,"year"),F(0,["YYYYY",5],0,"year"),F(0,["YYYYYY",6,!0],0,"year"),D("year","y"),V("Y",mi),V("YY",li,ri),V("YYYY",hi,ai),V("YYYYY",fi,si),V("YYYYYY",fi,si),Y(["YYYYY","YYYYYY"],xi),Y("YYYY",function(e,n){n[xi]=2===e.length?t.parseTwoDigitYear(e):v(e)}),Y("YY",function(e,n){n[xi]=t.parseTwoDigitYear(e)}),Y("Y",function(t,e){e[xi]=parseInt(t,10)}),t.parseTwoDigitYear=function(t){return v(t)+(v(t)>68?1900:2e3)};var Ui=T("FullYear",!1);t.ISO_8601=function(){};var Yi=ot("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Tt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:d()}),Wi=ot("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Tt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:d()}),zi=function(){return Date.now?Date.now():+new Date};It("Z",":"),It("ZZ",""),V("Z",vi),V("ZZ",vi),Y(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Nt(vi,t)});var Gi=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var qi=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Xi=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Zt.fn=Ot.prototype;var Ki=ee(1,"add"),Zi=ee(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Qi=ot("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});F(0,["gg",2],0,function(){return this.weekYear()%100}),F(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Oe("gggg","weekYear"),Oe("ggggg","weekYear"),Oe("GGGG","isoWeekYear"),Oe("GGGGG","isoWeekYear"),D("weekYear","gg"),D("isoWeekYear","GG"),V("G",mi),V("g",mi),V("GG",li,ri),V("gg",li,ri),V("GGGG",hi,ai),V("gggg",hi,ai),V("GGGGG",fi,si),V("ggggg",fi,si),W(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=v(t)}),W(["gg","GG"],function(e,n,i,r){n[r]=t.parseTwoDigitYear(e)}),F("Q",0,"Qo","quarter"),D("quarter","Q"),V("Q",ii),Y("Q",function(t,e){e[Ci]=3*(v(t)-1)}),F("w",["ww",2],"wo","week"),F("W",["WW",2],"Wo","isoWeek"),D("week","w"),D("isoWeek","W"),V("w",li),V("ww",li,ri),V("W",li),V("WW",li,ri),W(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=v(t)});var Ji={dow:0,doy:6};F("D",["DD",2],"Do","date"),D("date","D"),V("D",li),V("DD",li,ri),V("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),Y(["D","DD"],Si),Y("Do",function(t,e){e[Si]=v(t.match(li)[0],10)});var tr=T("Date",!0);F("d",0,"do","day"),F("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),F("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),F("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),F("e",0,0,"weekday"),F("E",0,0,"isoWeekday"),D("day","d"),D("weekday","e"),D("isoWeekday","E"),V("d",li),V("e",li),V("E",li),V("dd",bi),V("ddd",bi),V("dddd",bi),W(["dd","ddd","dddd"],function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);null!=r?e.d=r:u(n).invalidWeekday=t}),W(["d","e","E"],function(t,e,n,i){e[i]=v(t)});var er="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),nr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ir="Su_Mo_Tu_We_Th_Fr_Sa".split("_");F("DDD",["DDDD",3],"DDDo","dayOfYear"),D("dayOfYear","DDD"),V("DDD",di),V("DDDD",oi),Y(["DDD","DDDD"],function(t,e,n){n._dayOfYear=v(t)}),F("H",["HH",2],0,"hour"),F("h",["hh",2],0,nn),F("hmm",0,0,function(){return""+nn.apply(this)+O(this.minutes(),2)}),F("hmmss",0,0,function(){return""+nn.apply(this)+O(this.minutes(),2)+O(this.seconds(),2)}),F("Hmm",0,0,function(){return""+this.hours()+O(this.minutes(),2)}),F("Hmmss",0,0,function(){return""+this.hours()+O(this.minutes(),2)+O(this.seconds(),2)}),rn("a",!0),rn("A",!1),D("hour","h"),V("a",on),V("A",on),V("H",li),V("h",li),V("HH",li,ri),V("hh",li,ri),V("hmm",ui),V("hmmss",ci),V("Hmm",ui),V("Hmmss",ci),Y(["H","HH"],ki),Y(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Y(["h","hh"],function(t,e,n){e[ki]=v(t),u(n).bigHour=!0}),Y("hmm",function(t,e,n){var i=t.length-2;e[ki]=v(t.substr(0,i)),e[Di]=v(t.substr(i)),u(n).bigHour=!0}),Y("hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[ki]=v(t.substr(0,i)),e[Di]=v(t.substr(i,2)),e[Ei]=v(t.substr(r)),u(n).bigHour=!0}),Y("Hmm",function(t,e,n){var i=t.length-2;e[ki]=v(t.substr(0,i)),e[Di]=v(t.substr(i))}),Y("Hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[ki]=v(t.substr(0,i)),e[Di]=v(t.substr(i,2)),e[Ei]=v(t.substr(r))});var rr=/[ap]\.?m?\.?/i,or=T("Hours",!0);F("m",["mm",2],0,"minute"),D("minute","m"),V("m",li),V("mm",li,ri),Y(["m","mm"],Di);var ar=T("Minutes",!1);F("s",["ss",2],0,"second"),D("second","s"),V("s",li),V("ss",li,ri),Y(["s","ss"],Ei);var sr=T("Seconds",!1);F("S",0,0,function(){return~~(this.millisecond()/100)}),F(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),F(0,["SSS",3],0,"millisecond"),F(0,["SSSS",4],0,function(){return 10*this.millisecond()}),F(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),F(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),F(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),F(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),F(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),D("millisecond","ms"),V("S",di,ii),V("SS",di,ri),V("SSS",di,oi);var lr;for(lr="SSSS";lr.length<=9;lr+="S")V(lr,pi);for(lr="S";lr.length<=9;lr+="S")Y(lr,ln);var ur=T("Milliseconds",!1);F("z",0,0,"zoneAbbr"),F("zz",0,0,"zoneName");var cr=p.prototype;cr.add=Ki,cr.calendar=ie,cr.clone=re,cr.diff=de,cr.endOf=Ce,cr.format=me,cr.from=ge,cr.fromNow=ve,cr.to=ye,cr.toNow=be,cr.get=j,cr.invalidAt=Ae,cr.isAfter=oe,cr.isBefore=ae,cr.isBetween=se,cr.isSame=le,cr.isSameOrAfter=ue,cr.isSameOrBefore=ce,cr.isValid=Te,cr.lang=Qi,cr.locale=$e,cr.localeData=we,cr.max=Wi,cr.min=Yi,cr.parsingFlags=Pe,cr.set=j,cr.startOf=xe,cr.subtract=Zi,cr.toArray=Ee,cr.toObject=_e,cr.toDate=De,cr.toISOString=pe,cr.toJSON=Me,cr.toString=fe,cr.unix=ke,cr.valueOf=Se,cr.creationData=je,cr.year=Ui,cr.isLeapYear=ft,cr.weekYear=Fe,cr.isoWeekYear=Ie,cr.quarter=cr.quarters=He,cr.month=Q,cr.daysInMonth=J,cr.week=cr.weeks=We,cr.isoWeek=cr.isoWeeks=ze,cr.weeksInYear=Re,cr.isoWeeksInYear=Ne,cr.date=tr,cr.day=cr.days=Qe,cr.weekday=Je,cr.isoWeekday=tn,cr.dayOfYear=en,cr.hour=cr.hours=or,cr.minute=cr.minutes=ar,cr.second=cr.seconds=sr,cr.millisecond=cr.milliseconds=ur,cr.utcOffset=Vt,cr.utc=Bt,cr.local=Ut,cr.parseZone=Yt,cr.hasAlignedHourOffset=Wt,cr.isDST=zt,cr.isDSTShifted=Gt,cr.isLocal=qt,cr.isUtcOffset=Xt,cr.isUtc=Kt,cr.isUTC=Kt,cr.zoneAbbr=un,cr.zoneName=cn,cr.dates=ot("dates accessor is deprecated. Use date instead.",tr),cr.months=ot("months accessor is deprecated. Use month instead",Q),cr.years=ot("years accessor is deprecated. Use year instead",Ui),cr.zone=ot("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ht);var dr=cr,hr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},fr={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"},pr="Invalid date",mr="%d",gr=/\d{1,2}/,vr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},yr=b.prototype;yr._calendar=hr,yr.calendar=fn,yr._longDateFormat=fr,yr.longDateFormat=pn,yr._invalidDate=pr,yr.invalidDate=mn,yr._ordinal=mr,yr.ordinal=gn,yr._ordinalParse=gr,yr.preparse=vn,yr.postformat=vn,yr._relativeTime=vr,yr.relativeTime=yn,yr.pastFuture=bn,yr.set=$n,yr.months=q,yr._months=Ai,yr.monthsShort=X,yr._monthsShort=ji,yr.monthsParse=K,yr._monthsRegex=Fi,yr.monthsRegex=et,yr._monthsShortRegex=Oi,yr.monthsShortRegex=tt,yr.week=Be,yr._week=Ji,yr.firstDayOfYear=Ye,yr.firstDayOfWeek=Ue,yr.weekdays=qe,yr._weekdays=er,yr.weekdaysMin=Ke,yr._weekdaysMin=ir,yr.weekdaysShort=Xe,yr._weekdaysShort=nr,yr.weekdaysParse=Ze,yr.isPM=an,yr._meridiemParse=rr,yr.meridiem=sn,C("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===v(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),t.lang=ot("moment.lang is deprecated. Use moment.locale instead.",C),t.langData=ot("moment.langData is deprecated. Use moment.localeData instead.",k);var br=Math.abs,$r=Rn("ms"),wr=Rn("s"),xr=Rn("m"),Cr=Rn("h"),Sr=Rn("d"),kr=Rn("w"),Dr=Rn("M"),Er=Rn("y"),_r=Vn("milliseconds"),Mr=Vn("seconds"),Tr=Vn("minutes"),Pr=Vn("hours"),Ar=Vn("days"),jr=Vn("months"),Or=Vn("years"),Fr=Math.round,Ir={s:45,m:45,h:22,d:26,M:11},Nr=Math.abs,Rr=Ot.prototype;Rr.abs=_n,Rr.add=Tn,Rr.subtract=Pn,Rr.as=In,Rr.asMilliseconds=$r,Rr.asSeconds=wr,Rr.asMinutes=xr,Rr.asHours=Cr,Rr.asDays=Sr,Rr.asWeeks=kr,Rr.asMonths=Dr,Rr.asYears=Er,Rr.valueOf=Nn,Rr._bubble=jn,Rr.get=Ln,Rr.milliseconds=_r,Rr.seconds=Mr,Rr.minutes=Tr,Rr.hours=Pr,Rr.days=Ar,Rr.weeks=Hn,Rr.months=jr,Rr.years=Or,Rr.humanize=Wn,Rr.toISOString=zn,Rr.toString=zn,Rr.toJSON=zn,Rr.locale=$e,Rr.localeData=we,Rr.toIsoString=ot("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",zn),Rr.lang=Qi,F("X",0,0,"unix"),F("x",0,0,"valueOf"),V("x",mi),V("X",yi),Y("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),Y("x",function(t,e,n){n._d=new Date(v(t))}),t.version="2.11.2",e(Tt),t.fn=dr,t.min=At,t.max=jt,t.now=zi,t.utc=s,t.unix=dn,t.months=Cn,t.isDate=i,t.locale=C,t.invalid=d,t.duration=Zt,t.isMoment=m,t.weekdays=kn,t.parseZone=hn,t.localeData=k,t.isDuration=Ft,t.monthsShort=Sn,t.weekdaysMin=En,t.defineLocale=S,t.weekdaysShort=Dn,t.normalizeUnits=E,t.relativeTimeThreshold=Yn,t.prototype=dr;var Lr=t;return Lr.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,e){return 12===t&&(t=0),"凌晨"===e||"早上"===e||"上午"===e?t:"下午"===e||"晚上"===e?t+12:t>=11?t:t+12},meridiem:function(t,e,n){var i=100*t+e;return 600>i?"凌晨":900>i?"早上":1130>i?"上午":1230>i?"中午":1800>i?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var t,e;return t=moment().startOf("week"),e=this.unix()-t.unix()>=604800?"[下]":"[本]",0===this.minutes()?e+"dddAh点整":e+"dddAh点mm"},lastWeek:function(){var t,e;return t=moment().startOf("week"),e=this.unix()<t.unix()?"[上]":"[本]",0===this.minutes()?e+"dddAh点整":e+"dddAh点mm"},sameElse:"LL"},ordinalParse:/\d{1,2}(||)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"周";default:return t}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}}),Lr}),function(){"use strict";function t(t){return angular.isUndefined(t)||null===t}function e(){try{return require("moment")}catch(t){throw new Error("Please install moment via npm. Please reference to: https://github.com/urish/angular-moment")}}function n(n,i){if("undefined"==typeof i){if("function"!=typeof require)throw new Error("Moment cannot be found by angular-moment! Please reference to: https://github.com/urish/angular-moment");i=e()}return n.module("angularMoment",[]).constant("angularMomentConfig",{preprocess:null,timezone:null,format:null,statefulFilters:!0}).constant("moment",i).constant("amTimeAgoConfig",{withoutSuffix:!1,serverTime:null,titleFormat:null,fullDateThreshold:null,fullDateFormat:null}).directive("amTimeAgo",["$window","moment","amMoment","amTimeAgoConfig",function(e,i,r,o){return function(a,s,l){function u(){var t;if(m)t=m;else if(o.serverTime){var e=(new Date).getTime(),n=e-w+o.serverTime;t=i(n)}else t=i();return t}function c(){g&&(e.clearTimeout(g),g=null)}function d(t){var n=u().diff(t,"day"),i=b&&n>=b;if(i?s.text(t.format($)):s.text(t.from(u(),v)),y&&S&&s.attr("title",t.local().format(y)),!i){var r=Math.abs(u().diff(t,"minute")),o=3600;1>r?o=1:60>r?o=30:180>r&&(o=300),g=e.setTimeout(function(){d(t)},1e3*o)}}function h(t){C&&s.attr("datetime",t)}function f(){if(c(),p){var t=r.preprocessDate(p);d(t),h(t.toISOString())}}var p,m,g=null,v=o.withoutSuffix,y=o.titleFormat,b=o.fullDateThreshold,$=o.fullDateFormat,w=(new Date).getTime(),x=l.amTimeAgo,C="TIME"===s[0].nodeName.toUpperCase(),S=!s.attr("title");a.$watch(x,function(e){return t(e)||""===e?(c(),void(p&&(s.text(""),h(""),p=null))):(p=e,void f())}),n.isDefined(l.amFrom)&&a.$watch(l.amFrom,function(e){m=t(e)||""===e?null:i(e),f()}),n.isDefined(l.amWithoutSuffix)&&a.$watch(l.amWithoutSuffix,function(t){"boolean"==typeof t?(v=t,f()):v=o.withoutSuffix}),l.$observe("amFullDateThreshold",function(t){b=t,f()}),l.$observe("amFullDateFormat",function(t){$=t,f()}),a.$on("$destroy",function(){c()}),a.$on("amMoment:localeChanged",function(){f()})}}]).service("amMoment",["moment","$rootScope","$log","angularMomentConfig",function(t,e,i,r){var o=null;this.changeLocale=function(i,r){var o=t.locale(i,r);return n.isDefined(i)&&e.$broadcast("amMoment:localeChanged"),o},this.changeTimezone=function(n){t.tz&&t.tz.setDefault?(t.tz.setDefault(n),e.$broadcast("amMoment:timezoneChanged")):i.warn("angular-moment: changeTimezone() works only with moment-timezone.js v0.3.0 or greater."),r.timezone=n,o=n},this.preprocessDate=function(e){return o!==r.timezone&&this.changeTimezone(r.timezone),r.preprocess?r.preprocess(e):t(!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e,10):e)}}]).filter("amParse",["moment",function(t){return function(e,n){return t(e,n)}}]).filter("amFromUnix",["moment",function(t){return function(e){return t.unix(e)}}]).filter("amUtc",["moment",function(t){return function(e){return t.utc(e)}}]).filter("amUtcOffset",["amMoment",function(t){function e(e,n){return t.preprocessDate(e).utcOffset(n)}return e}]).filter("amLocal",["moment",function(t){return function(e){return t.isMoment(e)?e.local():null}}]).filter("amTimezone",["amMoment","angularMomentConfig","$log",function(t,e,n){function i(e,i){var r=t.preprocessDate(e);return i?r.tz?r.tz(i):(n.warn("angular-moment: named timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js ?"),r):r}return i}]).filter("amCalendar",["moment","amMoment","angularMomentConfig",function(e,n,i){function r(e){if(t(e))return"";var i=n.preprocessDate(e);return i.isValid()?i.calendar():""}return r.$stateful=i.statefulFilters,r}]).filter("amDifference",["moment","amMoment","angularMomentConfig",function(e,n,i){function r(i,r,o,a){if(t(i))return"";var s=n.preprocessDate(i),l=t(r)?e():n.preprocessDate(r);return s.isValid()&&l.isValid()?s.diff(l,o,a):"";
}return r.$stateful=i.statefulFilters,r}]).filter("amDateFormat",["moment","amMoment","angularMomentConfig",function(e,n,i){function r(e,i){if(t(e))return"";var r=n.preprocessDate(e);return r.isValid()?r.format(i):""}return r.$stateful=i.statefulFilters,r}]).filter("amDurationFormat",["moment","angularMomentConfig",function(e,n){function i(n,i,r){return t(n)?"":e.duration(n,i).humanize(r)}return i.$stateful=n.statefulFilters,i}]).filter("amTimeAgo",["moment","amMoment","angularMomentConfig",function(e,n,i){function r(i,r,o){var a,s;return t(i)?"":(i=n.preprocessDate(i),a=e(i),a.isValid()?(s=e(o),!t(o)&&s.isValid()?a.from(s,r):a.fromNow(r)):"")}return r.$stateful=i.statefulFilters,r}]).filter("amSubtract",["moment","angularMomentConfig",function(e,n){function i(n,i,r){return t(n)?"":e(n).subtract(parseInt(i,10),r)}return i.$stateful=n.statefulFilters,i}]).filter("amAdd",["moment","angularMomentConfig",function(e,n){function i(n,i,r){return t(n)?"":e(n).add(parseInt(i,10),r)}return i.$stateful=n.statefulFilters,i}]).filter("amStartOf",["moment","angularMomentConfig",function(e,n){function i(n,i){return t(n)?"":e(n).startOf(i)}return i.$stateful=n.statefulFilters,i}]).filter("amEndOf",["moment","angularMomentConfig",function(e,n){function i(n,i){return t(n)?"":e(n).endOf(i)}return i.$stateful=n.statefulFilters,i}])}"function"==typeof define&&define.amd?define(["angular","moment"],n):"undefined"!=typeof module&&module&&module.exports?(n(require("angular"),require("moment")),module.exports="angularMoment"):n(angular,("undefined"!=typeof global?global:window).moment)}(),function(){"use strict";angular.module("gantt",["gantt.templates","angularMoment"]).directive("gantt",["Gantt","ganttEnableNgAnimate","$timeout","$templateCache",function(t,e,n,i){return{restrict:"A",transclude:!0,templateUrl:function(t,e){var n;return n=void 0===e.templateUrl?"template/gantt.tmpl.html":e.templateUrl,void 0!==e.template&&i.put(n,e.template),n},scope:{sortMode:"=?",filterTask:"=?",filterTaskComparator:"=?",filterRow:"=?",filterRowComparator:"=?",viewScale:"=?",columnWidth:"=?",expandToFit:"=?",shrinkToFit:"=?",showSide:"=?",allowSideResizing:"=?",fromDate:"=?",toDate:"=?",currentDateValue:"=?",currentDate:"=?",daily:"=?",autoExpand:"=?",taskOutOfRange:"=?",taskContent:"=?",rowContent:"=?",maxHeight:"=?",sideWidth:"=?",headers:"=?",headersFormats:"=?",timeFrames:"=?",dateFrames:"=?",timeFramesWorkingMode:"=?",timeFramesNonWorkingMode:"=?",timespans:"=?",columnMagnet:"=?",shiftColumnMagnet:"=?",timeFramesMagnet:"=?",data:"=?",api:"=?",options:"=?"},controller:["$scope","$element",function(n,i){for(var r in n.options)n[r]=n.options[r];e(i,!1),n.gantt=new t(n,i),this.gantt=n.gantt}],link:function(t,e){t.gantt.api.directives.raise["new"]("gantt",t,e),t.$on("$destroy",function(){t.gantt.api.directives.raise.destroy("gantt",t,e)}),n(function(){t.gantt.initialized()})}}}])}(),function(){"use strict";angular.module("gantt").factory("GanttApi",["$q","$rootScope","ganttUtils",function(t,e,n){function i(t,n,i,r){return e.$on(t,function(){var t=Array.prototype.slice.call(arguments);t.splice(0,1),n.apply(r?r:i.api,t)})}var r=function(t){this.gantt=t,this.listeners=[],this.apiId=n.newId()};return r.prototype.suppressEvents=function(t,e){var n=this,r=angular.isArray(t)?t:[t],o=[];r.forEach(function(t){o=n.listeners.filter(function(e){return t===e.handler})}),o.forEach(function(t){t.dereg()}),e(),o.forEach(function(t){t.dereg=i(t.eventId,t.handler,n.gantt,t._this)})},r.prototype.registerEvent=function(t,n){var r=this;r[t]||(r[t]={});var o=r[t];o.on||(o.on={},o.raise={});var a="event:gantt:"+this.apiId+":"+t+":"+n;o.raise[n]=function(){e.$emit.apply(e,[a].concat(Array.prototype.slice.call(arguments)))},o.on[n]=function(t,e,n){var o=i(a,e,r.gantt,n),s={handler:e,dereg:o,eventId:a,scope:t,_this:n};r.listeners.push(s);var l=function(){s.dereg();var t=r.listeners.indexOf(s);r.listeners.splice(t,1)};return t.$on("$destroy",function(){l()}),l}},r.prototype.registerEventsFromObject=function(t){var e=this,n=[];angular.forEach(t,function(t,e){var i={name:e,events:[]};angular.forEach(t,function(t,e){i.events.push(e)}),n.push(i)}),n.forEach(function(t){t.events.forEach(function(n){e.registerEvent(t.name,n)})})},r.prototype.registerMethod=function(t,e,i,r){this[t]||(this[t]={});var o=this[t];o[e]=n.createBoundedWrapper(r||this.gantt,i)},r.prototype.registerMethodsFromObject=function(t,e){var n=this,i=[];angular.forEach(t,function(t,e){var n={name:e,methods:[]};angular.forEach(t,function(t,e){n.methods.push({name:e,fn:t})}),i.push(n)}),i.forEach(function(t){t.methods.forEach(function(i){n.registerMethod(t.name,i.name,i.fn,e)})})},r}])}(),function(){"use strict";angular.module("gantt").factory("GanttOptions",[function(){var t=function(t,e){this.defaultValues=e,this.values=t,this.defaultValue=function(t){var e=this.defaultValues[t];return angular.isFunction(e)&&(e=e()),e},this.sanitize=function(t,e){if(!e){var n=this.defaultValue(t);if(void 0!==n)return void 0!==e&&"boolean"==typeof n?e:n}return e},this.value=function(t){return this.sanitize(t,this.values[t])},this.set=function(t,e){this.values[t]=e},this.initialize=function(){for(var t in this.values){var e=this.values[t];this.values.hasOwnProperty(t)&&(this.values[t]=this.value(t,e))}return this.values}};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttCalendar",["$filter","moment",function(t,e){var n=function(t){void 0===t&&(t={}),this.start=t.start,this.end=t.end,this.working=t.working,this.magnet=void 0!==t.magnet?t.magnet:!0,this["default"]=t["default"],this.color=t.color,this.classes=t.classes,this.internal=t.internal};n.prototype.updateView=function(){if(this.$element){var t={};void 0!==this.left?t.left=this.left+"px":t.left="",void 0!==this.width?t.width=this.width+"px":t.width="",void 0!==this.color?t["background-color"]=this.color:t["background-color"]="",this.$element.css(t);var e=["gantt-timeframe"+(this.working?"":"-non")+"-working"];this.classes&&(e=e.concat(this.classes));for(var n=0,i=e.length;i>n;n++)this.$element.toggleClass(e[n],!0)}},n.prototype.getDuration=function(){return void 0!==this.end&&void 0!==this.start?this.end.diff(this.start,"milliseconds"):void 0},n.prototype.clone=function(){return new n(this)};var i=function(t){this.func=t};i.prototype.getTimeFrames=function(t){var e=this.func(t);return e instanceof Array||(e=[e]),e},i.prototype.clone=function(){return new i(this.func)};var r=function(t){this.evaluator=t.evaluator,t.date?(this.start=e(t.date).startOf("day"),this.end=e(t.date).endOf("day")):(this.start=t.start,this.end=t.end),t.targets instanceof Array?this.targets=t.targets:this.targets=[t.targets],this["default"]=t["default"]};r.prototype.dateMatch=function(t){return this.evaluator?this.evaluator(t):this.start&&this.end?t>=this.start&&t<=this.end:!1},r.prototype.clone=function(){return new r(this)};var o=function(){this.timeFrames={},this.timeFrameMappings={},this.dateFrames={}};o.prototype.clear=function(){this.timeFrames={},this.timeFrameMappings={},this.dateFrames={}},o.prototype.registerTimeFrames=function(t){angular.forEach(t,function(t,e){this.timeFrames[e]=new n(t)},this)},o.prototype.removeTimeFrames=function(t){angular.forEach(t,function(t){delete this.timeFrames[t]},this)},o.prototype.clearTimeFrames=function(){this.timeFrames={}},o.prototype.registerTimeFrameMappings=function(t){angular.forEach(t,function(t,e){this.timeFrameMappings[e]=new i(t)},this)},o.prototype.removeTimeFrameMappings=function(t){angular.forEach(t,function(t){delete this.timeFrameMappings[t]},this)},o.prototype.clearTimeFrameMappings=function(){this.timeFrameMappings={}},o.prototype.registerDateFrames=function(t){angular.forEach(t,function(t,e){this.dateFrames[e]=new r(t)},this)},o.prototype.removeDateFrames=function(t){angular.forEach(t,function(t){delete this.dateFrames[t]},this)},o.prototype.clearDateFrames=function(){this.dateFrames={}};var a=function(t,e){var n=[];return angular.forEach(t,function(t){t.dateMatch(e)&&n.push(t)}),0===n.length&&angular.forEach(t,function(t){t["default"]&&n.push(t)}),n};return o.prototype.getTimeFrames=function(t){for(var n=[],i=a(this.dateFrames,t),r=0;r<i.length;r++)if(void 0!==i[r])for(var o=i[r].targets,s=0;s<o.length;s++){var l=this.timeFrameMappings[o[s]];if(void 0!==l)n.push(l.getTimeFrames());else{var u=this.timeFrames[o[s]];void 0!==u&&n.push(u)}}var c=t.year(),d=t.month(),h=t.date(),f=[];for(0===n.length&&angular.forEach(this.timeFrames,function(t){t["default"]&&n.push(t)}),r=0;r<n.length;r++){var p=n[r].clone();void 0!==p.start&&(p.start.year(c),p.start.month(d),p.start.date(h)),void 0!==p.end&&(p.end.year(c),p.end.month(d),p.end.date(h),e(p.end).startOf("day")===p.end&&p.end.add(1,"day")),f.push(p)}return f},o.prototype.solve=function(i,r,o){for(var a,s,l,u,c=0;c<i.length;c++){var d=i[c];(void 0===l||l>d.start)&&(l=d.start),(void 0===u||u<d.end)&&(u=d.end),void 0===a&&d.color&&(a=d.color),void 0!==d.classes&&(void 0===s&&(s=[]),s=s.concat(d.classes))}void 0===r&&(r=l),void 0===o&&(o=u);var h=[new n({start:r,end:o,internal:!0})];for(i=t("filter")(i,function(t){return(void 0===t.start||t.start<o)&&(void 0===t.end||t.end>r)}),c=0;c<i.length;c++){var f=i[c];f.start||(f.start=r),f.end||(f.end=o)}var p,m=t("orderBy")(i,function(t){return-t.getDuration()});for(c=0;c<m.length;c++){var g=m[c],v=h.slice();p=0;for(var y=!1,b=!1,$=0;$<h.length;$++){var w=h[$];if(!b){if(g.end||g.start)if(g.end>w.start&&g.start<w.end){var x=w.clone();w.end=e(g.start),x.start=e(g.end),v.splice(p+1,0,g.clone(),x),b=!0,y=!1}else!y&&g.start<w.end?(w.end=e(g.start),v.splice(p+1,0,g.clone()),y=!0):y&&g.end>w.start&&(w.start=e(g.end),y=!1,b=!0);else v.splice(p,0,g),b=!0,y=!1;p++}}h=v}return h=t("filter")(h,function(t){return!t.internal&&(void 0===t.start||t.start<o)&&(void 0===t.end||t.end>r)})},o}])}(),function(){"use strict";angular.module("gantt").factory("GanttCurrentDateManager",["moment",function(t){var e=function(e){var n=this;this.gantt=e,this.date=void 0,this.position=void 0,this.currentDateColumn=void 0,this.gantt.$scope.simplifyMoment=function(e){return t.isMoment(e)?e.unix():e},this.gantt.$scope.$watchGroup(["currentDate","simplifyMoment(currentDateValue)"],function(t,e){t!==e&&n.setCurrentDate(n.gantt.options.value("currentDateValue"))})};return e.prototype.setCurrentDate=function(t){this.date=t;var e,n=this.currentDateColumn;void 0!==this.date&&"column"===this.gantt.options.value("currentDate")&&(e=this.gantt.columnsManager.getColumnByDate(this.date,!0)),this.currentDateColumn=e,n!==e&&(void 0!==n&&(n.currentDate=!1,n.updateView()),void 0!==e&&(e.currentDate=!0,e.updateView())),this.position=this.gantt.getPositionByDate(this.date,!0)},e}])}(),function(){"use strict";angular.module("gantt").factory("GanttColumn",["moment",function(t){var e=function(t,e,n,i,r,o,a){this.date=t,this.endDate=e,this.left=n,this.width=i,this.calendar=r,this.duration=this.endDate.diff(this.date,"milliseconds"),this.timeFramesWorkingMode=o,this.timeFramesNonWorkingMode=a,this.timeFrames=[],this.currentDate=!1,this.visibleTimeFrames=[],this.daysTimeFrames={},this.cropped=!1,this.originalSize={left:this.left,width:this.width},this.updateTimeFrames()},n=function(t){return t.year()+"-"+t.month()+"-"+t.date()};return e.prototype.updateView=function(){if(this.$element){this.currentDate?this.$element.addClass("gantt-foreground-col-current-date"):this.$element.removeClass("gantt-foreground-col-current-date"),this.$element.css({left:this.left+"px",width:this.width+"px"});for(var t=0,e=this.timeFrames.length;e>t;t++)this.timeFrames[t].updateView()}},e.prototype.updateTimeFrames=function(){var e=this;if(void 0!==e.calendar&&("hidden"!==e.timeFramesNonWorkingMode||"hidden"!==e.timeFramesWorkingMode)){for(var i,r=e.date,o=t(r).startOf("day"),a=o.add(1,"day");r<e.endDate;){var s=e.calendar.getTimeFrames(r),l=t.min(a,e.endDate);s=e.calendar.solve(s,r,l);var u=[];for(i=0;i<s.length;i++){var c=s[i],d=c.start;void 0===d&&(d=r);var h=c.end;void 0===h&&(h=l),d<e.date&&(d=e.date),h>e.endDate&&(h=e.endDate),c=c.clone(),c.start=t(d),c.end=t(h),u.push(c)}e.timeFrames=e.timeFrames.concat(u);var f=n(r);e.daysTimeFrames[f]=u,r=l,o=t(r).startOf("day"),a=o.add(1,"day")}for(i=0;i<e.timeFrames.length;i++){var p=e.timeFrames[i],m=p.start.diff(e.date,"milliseconds"),g=m/e.duration*e.width,v=p.end.diff(p.start,"milliseconds"),y=v/e.duration*e.width,b=!1;p.working&&"visible"!==e.timeFramesWorkingMode?b=!0:p.working||"visible"===e.timeFramesNonWorkingMode||(b=!0),b||e.visibleTimeFrames.push(p),p.hidden=b,p.left=g,p.width=y,p.originalSize={left:p.left,width:p.width}}if("cropped"===e.timeFramesNonWorkingMode||"cropped"===e.timeFramesWorkingMode){for(var $=0,w=0;w<e.timeFrames.length;w++){var x=e.timeFrames[w];(!x.working&&"cropped"!==e.timeFramesNonWorkingMode||x.working&&"cropped"!==e.timeFramesWorkingMode)&&($+=x.width)}if($!==e.width){var C=e.width/$,S=0,k=0,D=!0;for(w=0;w<e.timeFrames.length;w++){var E=e.timeFrames[w];!E.working&&"cropped"!==e.timeFramesNonWorkingMode||E.working&&"cropped"!==e.timeFramesWorkingMode?(E.left=(E.left-S)*C,E.width=E.width*C,E.originalSize.left=(E.originalSize.left-k)*C,E.originalSize.width=E.originalSize.width*C,E.cropped=!1,D=!1):(S+=E.width,k+=E.originalSize.width,E.left=void 0,E.width=0,E.originalSize={left:void 0,width:0},E.cropped=!0)}e.cropped=D}else e.cropped=!1}}},e.prototype.clone=function(){return new e(t(this.date),t(this.endDate),this.left,this.width,this.calendar)},e.prototype.containsDate=function(t){return t>this.date&&t<=this.endDate},e.prototype.equals=function(t){return this.date===t.date},e.prototype.roundTo=function(t,e,n,i){"day"===e&&(e="date"),n=n||1;var r=t.get(e);switch(i){case"up":r=Math.ceil(r/n);break;case"down":r=Math.floor(r/n);break;default:r=Math.round(r/n)}var o=["millisecond","second","minute","hour","date","month","year"];t.set(e,r*n);for(var a=o.indexOf(e),s=0;a>s;s++)t.set(o[s],0);return t},e.prototype.getMagnetDate=function(e,n,i,r){if(n>0&&void 0!==i){var o=e;if(e=t(e),"column"===i){var a=this.getPositionByDate(e);e=t(a<this.width/2?this.date:this.endDate)}else e=this.roundTo(e,i,n),e<this.date?e=t(this.date):e>this.endDate&&(e=t(this.endDate));if(r)for(var s,l=Math.abs(o.diff(e,"milliseconds")),u=0;u<this.timeFrames.length;u++){var c=this.timeFrames[u];if(c.magnet){var d,h=this.timeFrames[u-1],f=this.timeFrames[u+1];void 0!==h&&h.working===c.working||(d=Math.abs(o.diff(c.start,"milliseconds")),l>d&&(void 0===s||s>d)&&(s=d,e=c.start)),void 0!==f&&f.working===c.working||(d=Math.abs(o.diff(c.end,"milliseconds")),l>d&&(void 0===s||s>d)&&(s=d,e=c.end))}}}return e},e.prototype.getDateByPositionUsingTimeFrames=function(e){for(var n=0,i=this.timeFrames.length;i>n;n++){var r=this.timeFrames[n];if(!r.cropped&&e>=r.left&&e<=r.left+r.width){var o=r.getDuration()/r.width*(e-r.left),a=t(r.start).add(o,"milliseconds");return a}}},e.prototype.getDateByPosition=function(e,n,i,r){var o,a;return 0>e&&(e=0),e>this.width&&(e=this.width),"cropped"!==this.timeFramesNonWorkingMode&&"cropped"!==this.timeFramesWorkingMode||(a=this.getDateByPositionUsingTimeFrames(e)),void 0===a&&(o=this.duration/this.width*e,a=t(this.date).add(o,"milliseconds")),a=this.getMagnetDate(a,n,i,r)},e.prototype.getDayTimeFrame=function(t){var e=this.daysTimeFrames[n(t)];return void 0===e?[]:e},e.prototype.getPositionByDate=function(t){var e,n;if("cropped"===this.timeFramesNonWorkingMode||"cropped"===this.timeFramesWorkingMode)for(var i=t,r=this.getDayTimeFrame(i),o=0;o<r.length;o++){var a=r[o];if(i>=a.start&&i<=a.end){if(!a.cropped)return e=i.diff(a.start,"milliseconds"),n=e/a.getDuration()*a.width,this.left+a.left+n;i=r.length>o+1?r[o+1].start:a.end}}return e=t.diff(this.date,"milliseconds"),n=e/this.duration*this.width,0>n&&(n=0),n>this.width&&(n=this.width),this.left+n},e}])}(),function(){"use strict";angular.module("gantt").factory("GanttColumnBuilder",["GanttColumn",function(t){var e=function(t){this.columnsManager=t};return e.prototype.newColumn=function(e,n,i,r){var o=this.columnsManager.gantt.calendar,a=this.columnsManager.gantt.options.value("timeFramesWorkingMode"),s=this.columnsManager.gantt.options.value("timeFramesNonWorkingMode");return new t(e,n,i,r,o,a,s)},e}])}(),function(){"use strict";angular.module("gantt").service("GanttColumnGenerator",["moment",function(t){var e=function(e,n,i){return t(e).add(n,i).startOf(i)===e},n=function(t){return["hour","minute","second","millisecond"].indexOf(t)>=0?0:void 0},i=function(t,e,i){var r=e.get(t),o=i.get(t),a=n(t);void 0!==a&&o!==a&&r>o&&i.set(t,a)};this.generate=function(n,r,o,a,s,l,u,c){if(!o&&!l)throw"to or maximumWidth must be defined";a=a.trim(),"s"===a.charAt(a.length-1)&&(a=a.substring(0,a.length-1));var d,h,f;a&&(f=a.split(" ")),f&&f.length>1?(d=parseFloat(f[0]),h=f[f.length-1]):(d=1,h=a);var p=!1;r=t(r).startOf(h),o&&(p=e(o),o=t(o).startOf(h));var m=0,g=t(r).startOf(h);c&&(g.add(-d,h),m-=s);for(var v=[];;){if(l&&Math.abs(m)>l+s)break;var y=t(g),b=t(y).add(d,h);i(h,y,b);var $=n.newColumn(y,b,u?m+u:m,s);if($.cropped||(v.push($),c?m-=s:m+=s),o)if(c){if(p&&o>g||!p&&o>=g)break}else if(p&&g>o||!p&&g>=o)break;c?(g.add(-d,h),i(h,g,y)):(g.add(d,h),i(h,y,g))}return c&&(e(r,d,h)&&v.shift(),v.reverse()),v}}])}(),function(){"use strict";angular.module("gantt").factory("GanttColumnHeader",["moment","GanttColumn",function(t,e){var n=function(n,i,r,o,a,s){n=t(n),i=t(i);var l=new e(n,i,o,a);return l.unit=r,l.label=angular.isFunction(s)?s(l):n.format(s),l};return n}])}(),function(){"use strict";angular.module("gantt").factory("GanttColumnsManager",["GanttColumnGenerator","GanttColumnBuilder","GanttHeadersGenerator","$filter","$timeout","ganttLayout","ganttBinarySearch","moment",function(t,e,n,i,r,o,a,s){var l=function(t){var n=this;this.gantt=t,this.from=void 0,this.to=void 0,this.columns=[],this.visibleColumns=[],this.previousColumns=[],this.nextColumns=[],this.headers=[],this.visibleHeaders=[],this.scrollAnchor=void 0,this.columnBuilder=new e(this),this.gantt.$scope.$watchGroup(["viewScale","columnWidth","timeFramesWorkingMode","timeFramesNonWorkingMode","fromDate","toDate","autoExpand","taskOutOfRange"],function(t,e){t!==e&&n.gantt.rendered&&n.generateColumns()}),this.gantt.$scope.$watchCollection("headers",function(t,e){t!==e&&n.gantt.rendered&&n.generateColumns()}),this.gantt.$scope.$watchCollection("headersFormats",function(t,e){t!==e&&n.gantt.rendered&&n.generateColumns()}),this.gantt.$scope.$watchGroup(["ganttElementWidth","showSide","sideWidth","maxHeight","daily"],function(t,e){t!==e&&n.gantt.rendered&&n.updateColumnsMeta()}),this.gantt.api.data.on.load(this.gantt.$scope,function(){(void 0===n.from||void 0===n.to||n.from>n.gantt.rowsManager.getDefaultFrom()||n.to<n.gantt.rowsManager.getDefaultTo())&&n.gantt.rendered&&n.generateColumns(),n.gantt.rowsManager.sortRows()}),this.gantt.api.data.on.remove(this.gantt.$scope,function(){n.gantt.rowsManager.sortRows()}),this.gantt.api.registerMethod("columns","clear",this.clearColumns,this),this.gantt.api.registerMethod("columns","generate",this.generateColumns,this),this.gantt.api.registerMethod("columns","refresh",this.updateColumnsMeta,this),this.gantt.api.registerMethod("columns","getColumnsWidth",this.getColumnsWidth,this),this.gantt.api.registerMethod("columns","getColumnsWidthToFit",this.getColumnsWidthToFit,this),this.gantt.api.registerMethod("columns","getDateRange",this.getDateRange,this),this.gantt.api.registerEvent("columns","clear"),this.gantt.api.registerEvent("columns","generate"),this.gantt.api.registerEvent("columns","refresh")};l.prototype.setScrollAnchor=function(){if(this.gantt.scroll.$element&&this.columns.length>0){var t=this.gantt.scroll.$element[0],e=t.scrollLeft+t.offsetWidth/2;this.scrollAnchor=this.gantt.getDateByPosition(e)}},l.prototype.scrollToScrollAnchor=function(){var t=this;this.columns.length>0&&void 0!==this.scrollAnchor&&this.gantt.$scope.$$postDigest(function(){t.gantt.api.scroll.toDate(t.scrollAnchor)})},l.prototype.clearColumns=function(){this.setScrollAnchor(),this.from=void 0,this.to=void 0,this.columns=[],this.visibleColumns=[],this.previousColumns=[],this.nextColumns=[],this.headers=[],this.visibleHeaders=[],this.gantt.api.columns.raise.clear()},l.prototype.generateColumns=function(e,i){return e||(e=this.gantt.options.value("fromDate")),i||(i=this.gantt.options.value("toDate")),(e&&(!s.isMoment(e)||e.isValid())||(e=this.gantt.rowsManager.getDefaultFrom()))&&(i&&(!s.isMoment(i)||i.isValid())||(i=this.gantt.rowsManager.getDefaultTo()))?(void 0===e||s.isMoment(e)||(e=s(e)),void 0===i||s.isMoment(i)||(i=s(i)),"expand"===this.gantt.options.value("taskOutOfRange")&&(e=this.gantt.rowsManager.getExpandedFrom(e),i=this.gantt.rowsManager.getExpandedTo(i)),this.setScrollAnchor(),this.from=e,this.to=i,this.columns=t.generate(this.columnBuilder,e,i,this.gantt.options.value("viewScale"),this.getColumnsWidth()),this.headers=n.generate(this),this.previousColumns=[],this.nextColumns=[],this.updateColumnsMeta(),this.scrollToScrollAnchor(),void this.gantt.api.columns.raise.generate(this.columns,this.headers)):!1},l.prototype.updateColumnsMeta=function(){this.gantt.isRefreshingColumns=!0;var t=this.getLastColumn();this.gantt.originalWidth=void 0!==t?t.originalSize.left+t.originalSize.width:0;var e=this.updateColumnsWidths(this.columns,this.headers,this.previousColumns,this.nextColumns);this.gantt.width=void 0!==t?t.left+t.width:0;var n=this.gantt.options.value("showSide"),i=this.gantt.side.isShown(),r=n!==i;r&&!n&&this.gantt.side.show(!1),this.gantt.rowsManager.updateTasksPosAndSize(),this.gantt.timespansManager.updateTimespansPosAndSize(),this.updateVisibleColumns(e),this.gantt.rowsManager.updateVisibleObjects();var o=this.gantt.options.value("currentDateValue");this.gantt.currentDateManager.setCurrentDate(o),r&&n&&this.gantt.side.show(!0),this.gantt.isRefreshingColumns=!1,this.gantt.api.columns.raise.refresh(this.columns,this.headers)},l.prototype.getLastColumn=function(t){var e=this.columns;return t&&(e=this.nextColumns),e&&e.length>0?e[e.length-1]:void 0},l.prototype.getFirstColumn=function(t){var e=this.columns;return t&&(e=this.previousColumns),e&&e.length>0?e[0]:void 0},l.prototype.getColumnByDate=function(t,e){e||this.expandExtendedColumnsForDate(t);var n=this.previousColumns.concat(this.columns,this.nextColumns),i=a.get(n,t,function(t){return t.date},!0);return void 0===i[0]?i[1]:i[0]},l.prototype.getColumnByPosition=function(t,e){e||this.expandExtendedColumnsForPosition(t);var n=this.previousColumns.concat(this.columns,this.nextColumns),i=a.get(n,t,function(t){return t.left},!0);return void 0===i[0]?i[1]:i[0]},l.prototype.updateColumnsWidths=function(t,e,n,i){var r=this.gantt.options.value("columnWidth"),a=this.gantt.options.value("expandToFit"),s=this.gantt.options.value("shrinkToFit");if(void 0===r||a||s){var l=this.gantt.getBodyAvailableWidth(),u=this.gantt.columnsManager.getLastColumn(!1);if(void 0!==u){var c=u.originalSize.left+u.originalSize.width;if(a&&l>c||s&&c>l||void 0===r){var d=l/c;o.setColumnsWidthFactor(t,d);for(var h=0;h<e.length;h++)o.setColumnsWidthFactor(e[h],d);return n.splice(0,this.previousColumns.length),i.splice(0,this.nextColumns.length),!0}}}return!1},l.prototype.getColumnsWidth=function(){var t=this.gantt.options.value("columnWidth");return void 0===t&&(t=!this.gantt.width||this.gantt.width<=0?20:this.gantt.width/this.columns.length),t},l.prototype.getColumnsWidthToFit=function(){return this.gantt.getBodyAvailableWidth()/this.columns.length},l.prototype.expandExtendedColumnsForPosition=function(e){var n;if(0>e){var i=this.getFirstColumn(),r=i.date,o=this.getFirstColumn(!0);return(!o||o.left>e)&&(n=this.gantt.options.value("viewScale"),this.previousColumns=t.generate(this.columnBuilder,r,void 0,n,this.getColumnsWidth(),-e,0,!0)),!0}if(e>this.gantt.width){var a=this.getLastColumn(),s=a.getDateByPosition(a.width),l=this.getLastColumn(!0);return(!l||l.left+l.width<e)&&(n=this.gantt.options.value("viewScale"),this.nextColumns=t.generate(this.columnBuilder,s,void 0,n,this.getColumnsWidth(),e-this.gantt.width,this.gantt.width,!1)),!0}return!1},l.prototype.expandExtendedColumnsForDate=function(e){var n,i=this.getFirstColumn();i&&(n=i.date);var r,o=this.getLastColumn();o&&(r=o.getDateByPosition(o.width));var a;if(n&&n>e){var s=this.getFirstColumn(!0);return(!s||s.date>e)&&(a=this.gantt.options.value("viewScale"),this.previousColumns=t.generate(this.columnBuilder,n,e,a,this.getColumnsWidth(),void 0,0,!0)),!0}if(r&&e>=r){var l=this.getLastColumn(!0);return(!l||l.date<r)&&(a=this.gantt.options.value("viewScale"),this.nextColumns=t.generate(this.columnBuilder,r,e,a,this.getColumnsWidth(),void 0,this.gantt.width,!1)),!0}return!1},l.prototype.getActiveHeadersCount=function(){return this.headers.length},l.prototype.updateVisibleColumns=function(t){this.visibleColumns=i("ganttColumnLimit")(this.columns,this.gantt),this.visibleHeaders=[];for(var e=0;e<this.headers.length;e++)this.visibleHeaders.push(i("ganttColumnLimit")(this.headers[e],this.gantt));if(t){for(e=0;e<this.visibleColumns.length;e++)this.visibleColumns[e].updateView();for(e=0;e<this.visibleHeaders.length;e++)for(var n=this.visibleHeaders[e],r=0;r<n.length;r++)n[r].updateView()}var o=this.gantt.options.value("currentDateValue");this.gantt.currentDateManager.setCurrentDate(o)};var u={year:"YYYY",quarter:"[Q]Q YYYY",month:"MMMM YYYY",week:"w",day:"D",hour:"H",minute:"HH:mm"},c={day:"LL",hour:"H",minute:"HH:mm"},d={year:"YYYY",quarter:"[Q]Q",month:"MMMM"};return l.prototype.getHeaderFormat=function(t){var e,n=this.gantt.options.value("headersFormats");if(void 0!==n&&(e=n[t]),void 0===e){var i=this.gantt.options.value("viewScale");i=i.trim(),"s"===i.charAt(i.length-1)&&(i=i.substring(0,i.length-1));var r,o;i&&(o=i.split(" ")),r=o&&o.length>1?o[o.length-1]:i,["millisecond","second","minute","hour"].indexOf(r)>-1?e=c[t]:["month","quarter","year"].indexOf(r)>-1&&(e=d[t]),void 0===e&&(e=u[t])}return e},l.prototype.getDateRange=function(t){var e,n;return t?this.visibleColumns&&this.visibleColumns.length>0&&(e=this.visibleColumns[0],n=this.visibleColumns[this.visibleColumns.length-1]):(e=this.getFirstColumn(),n=this.getLastColumn()),e&&n?[e.date,n.endDate]:void 0},l}])}(),function(){"use strict";angular.module("gantt").service("GanttHeadersGenerator",["GanttColumnHeader","moment",function(t,e){var n=function(n,i){var r,o,a,s,l=[];i&&(s=i.split(" ")),s&&s.length>1?(o=parseFloat(s[0]),a=s[s.length-1]):(o=1,a=i);for(var u=n.columns[0],c=e(u.date).startOf(a),d=e(n.columns[n.columns.length-1].endDate);;){var h=u.getPositionByDate(c),f=e.min(e(c).add(o,a),d),p=n.getColumnByDate(f,!0),m=p.getPositionByDate(f),g=m-h;if(g>0){var v=n.getHeaderFormat(a);r=new t(c,f,a,h,g,v),l.push(r)}if(f.isSame(d)||f.isAfter(d))break;u=p,c=f}return l};this.generate=function(t){var e=[];if(void 0===t.gantt.options.value("headers")){var i=t.gantt.options.value("viewScale");i=i.trim(),"s"===i.charAt(i.length-1)&&(i=i.substring(0,i.length-1));var r,o;i&&(o=i.split(" ")),r=o&&o.length>1?o[o.length-1]:i,["quarter","month"].indexOf(r)>-1&&e.push("year"),["day","week"].indexOf(r)>-1&&e.push("month"),["day"].indexOf(r)>-1&&e.push("week"),["hour"].indexOf(r)>-1&&e.push("day"),["minute","second"].indexOf(r)>-1&&e.push("hour"),["second"].indexOf(r)>-1&&e.push("minute"),e.push(i)}else e=t.gantt.options.value("headers");for(var a=[],s=0;s<e.length;s++)a.push(n(t,e[s]));return a}}])}(),function(){"use strict";angular.module("gantt").factory("Gantt",["GanttApi","GanttOptions","GanttCalendar","GanttScroll","GanttBody","GanttRowHeader","GanttHeader","GanttSide","GanttObjectModel","GanttRowsManager","GanttColumnsManager","GanttTimespansManager","GanttCurrentDateManager","ganttArrays","moment","$document","$timeout",function(t,e,n,i,r,o,a,s,l,u,c,d,h,f,p,m,g){var v=function(o,g){var v=this;this.$scope=o,this.$element=g,this.options=new e(o,{api:angular.noop,data:[],timespans:[],viewScale:"day",columnMagnet:"15 minutes",timeFramesMagnet:!0,showSide:!0,allowSideResizing:!0,currentDate:"line",currentDateValue:p,autoExpand:"none",taskOutOfRange:"truncate",taskContent:"{{task.model.name}}",rowContent:"{{row.model.name}}",maxHeight:0,timeFrames:[],dateFrames:[],timeFramesWorkingMode:"hidden",timeFramesNonWorkingMode:"visible"}),this.api=new t(this),this.api.registerEvent("core","ready"),this.api.registerEvent("core","rendered"),this.api.registerEvent("directives","controller"),this.api.registerEvent("directives","preLink"),this.api.registerEvent("directives","postLink"),this.api.registerEvent("directives","new"),this.api.registerEvent("directives","destroy"),this.api.registerEvent("data","change"),this.api.registerEvent("data","load"),this.api.registerEvent("data","remove"),this.api.registerEvent("data","clear"),this.api.registerMethod("core","getDateByPosition",this.getDateByPosition,this),this.api.registerMethod("core","getPositionByDate",this.getPositionByDate,this),this.api.registerMethod("data","load",this.loadData,this),this.api.registerMethod("data","remove",this.removeData,this),this.api.registerMethod("data","clear",this.clearData,this),this.api.registerMethod("data","get",this.getData,this),this.calendar=new n(this),this.calendar.registerTimeFrames(this.options.value("timeFrames")),this.calendar.registerDateFrames(this.options.value("dateFrames")),this.api.registerMethod("timeframes","registerTimeFrames",this.calendar.registerTimeFrames,this.calendar),this.api.registerMethod("timeframes","clearTimeframes",this.calendar.clearTimeFrames,this.calendar),this.api.registerMethod("timeframes","registerDateFrames",this.calendar.registerDateFrames,this.calendar),this.api.registerMethod("timeframes","clearDateFrames",this.calendar.clearDateFrames,this.calendar),this.api.registerMethod("timeframes","registerTimeFrameMappings",this.calendar.registerTimeFrameMappings,this.calendar),this.api.registerMethod("timeframes","clearTimeFrameMappings",this.calendar.clearTimeFrameMappings,this.calendar),o.$watchGroup(["timeFrames","dateFrames"],function(t,e){if(t!==e){var n=t[0],i=t[1],r=e[0],o=e[1],a=!1;angular.equals(n,r)||(v.calendar.clearTimeFrames(),v.calendar.registerTimeFrames(n),a=!0),angular.equals(i,o)||(v.calendar.clearDateFrames(),v.calendar.registerDateFrames(i),a=!0),a&&v.columnsManager.generateColumns()}}),o.$watch("columnMagnet",function(){var t,e=v.options.value("columnMagnet");e&&(t=e.trim().split(" ")),t&&t.length>1?(v.columnMagnetValue=parseFloat(t[0]),v.columnMagnetUnit=p.normalizeUnits(t[t.length-1])):(v.columnMagnetValue=1,v.columnMagnetUnit=p.normalizeUnits(e))}),o.$watchGroup(["shiftColumnMagnet","viewScale"],function(){var t,e=v.options.value("shiftColumnMagnet");e&&(t=e.trim().split(" ")),void 0!==t&&t.length>1?(v.shiftColumnMagnetValue=parseFloat(t[0]),v.shiftColumnMagnetUnit=p.normalizeUnits(t[t.length-1])):(v.shiftColumnMagnetValue=1,v.shiftColumnMagnetUnit=p.normalizeUnits(e))});var y=function(t){return v.shiftKey=t.shiftKey,!0};m.on("keyup keydown",y),o.$on("$destroy",function(){m.off("keyup keydown",y)}),this.scroll=new i(this),this.body=new r(this),this.header=new a(this),this.side=new s(this),this.objectModel=new l(this.api),this.rowsManager=new u(this),this.columnsManager=new c(this),this.timespansManager=new d(this),this.currentDateManager=new h(this),this.originalWidth=0,this.width=0,angular.isFunction(this.$scope.api)&&this.$scope.api(this.api);var b=function(t,e){if(void 0===e||t.length!==e.length)return!0;for(var n=0,i=t.length;i>n;n++)if(t[n].id!==e[n].id)return!0;return!1};o.$watchCollection("data",function(t,e){if(void 0!==e){var n=f.getRemovedIds(t,e);if(n.length===e.length)v.rowsManager.removeAll(),v.api.data.raise.clear();else{for(var i=0,r=n.length;r>i;i++){var o=n[i];v.rowsManager.removeRow(o)}var a=[];for(i=0,r=e.length;r>i;i++)n.indexOf(e[i].id)>-1&&a.push(e[i]);v.api.data.raise.remove(a)}}if(void 0!==t){var s=b(t,e);s&&v.rowsManager.resetNonModelLists();for(var l=0,u=t.length;u>l;l++){var c=t[l];v.rowsManager.addRow(c,s)}v.api.data.raise.change(t,e),v.api.data.raise.load(t)}})};return v.prototype.getDateByPosition=function(t,e,n){
var i=this.columnsManager.getColumnByPosition(t,n);if(void 0!==i){var r,o;if(e)if(this.shiftKey)if(void 0!==this.shiftColumnMagnetValue&&void 0!==this.shiftColumnMagnetUnit)r=this.shiftColumnMagnetValue,o=this.shiftColumnMagnetUnit;else{var a=this.options.value("viewScale");a=a.trim();var s,l,u;a&&(u=a.split(" ")),u&&u.length>1?(s=parseFloat(u[0]),l=p.normalizeUnits(u[u.length-1])):(s=1,l=p.normalizeUnits(a)),r=.25*s,o=l}else r=this.columnMagnetValue,o=this.columnMagnetUnit;return i.getDateByPosition(t-i.left,r,o,this.options.value("timeFramesMagnet"))}},v.prototype.getBodyAvailableWidth=function(){var t=this.getWidth()-this.side.getWidth(),e=this.scroll.getBordersWidth(),n=t-(void 0!==e?this.scroll.getBordersWidth():0);return n-=1},v.prototype.getPositionByDate=function(t,e){if(void 0!==t){p.isMoment(p)||(t=p(t));var n=this.columnsManager.getColumnByDate(t,e);return void 0!==n?n.getPositionByDate(t):void 0}},v.prototype.loadData=function(t){if(angular.isArray(t)||(t=void 0!==t?[t]:[]),void 0===this.$scope.data)this.$scope.data=t;else for(var e=0,n=t.length;n>e;e++){var i=t[e],r=f.indexOfId(this.$scope.data,i.id);r>-1?this.$scope.data[r]=i:this.$scope.data.push(i)}var o=this.side.getWidth();o>0&&this.options.set("sideWidth",o)},v.prototype.getData=function(){return this.$scope.data},v.prototype.removeData=function(t){if(angular.isArray(t)||(t=void 0!==t?[t]:[]),void 0!==this.$scope.data)for(var e=0,n=t.length;n>e;e++){var i=t[e],r=f.indexOfId(this.$scope.data,i.id);if(r>-1)if(void 0===i.tasks||0===i.tasks.length)this.$scope.data.splice(r,1);else for(var o=this.$scope.data[r],a=0,s=i.tasks.length;s>a;a++){var l=i.tasks[a],u=f.indexOfId(o.tasks,l.id);u>-1&&o.tasks.splice(u,1)}}},v.prototype.clearData=function(){this.$scope.data=void 0},v.prototype.getWidth=function(){return this.$scope.ganttElementWidth},v.prototype.initialized=function(){this.api.core.raise.ready(this.api),this.rendered=!0,this.columnsManager.generateColumns();var t=this,e=function(){var e=t.side.getWidth();e>0&&t.options.set("sideWidth",e),t.api.core.raise.rendered(t.api)};g(e)},v}])}(),function(){"use strict";angular.module("gantt").factory("GanttObjectModel",["ganttUtils","moment",function(t,e){var n=function(t){this.api=t,this.api.registerEvent("tasks","clean"),this.api.registerEvent("rows","clean"),this.api.registerEvent("timespans","clean")};return n.prototype.cleanTask=function(n){void 0===n.id&&(n.id=t.randomUuid()),void 0===n.from||e.isMoment(n.from)||(n.from=e(n.from)),void 0===n.to||e.isMoment(n.to)||(n.to=e(n.to)),this.api.tasks.raise.clean(n)},n.prototype.cleanRow=function(n){void 0===n.id&&(n.id=t.randomUuid()),void 0===n.from||e.isMoment(n.from)||(n.from=e(n.from)),void 0===n.to||e.isMoment(n.to)||(n.to=e(n.to)),this.api.rows.raise.clean(n)},n.prototype.cleanTimespan=function(n){void 0===n.id&&(n.id=t.randomUuid()),void 0===n.from||e.isMoment(n.from)||(n.from=e(n.from)),void 0===n.to||e.isMoment(n.to)||(n.to=e(n.to)),this.api.timespans.raise.clean(n)},n}])}(),function(){"use strict";angular.module("gantt").factory("GanttRow",["GanttTask","moment","$filter",function(t,e,n){var i=function(t,e){this.rowsManager=t,this.model=e,this.from=void 0,this.to=void 0,this.tasksMap={},this.tasks=[],this.filteredTasks=[],this.visibleTasks=[]};return i.prototype.addTaskImpl=function(t,e){this.tasksMap[t.model.id]=t,this.tasks.push(t),e||(void 0===this.model.tasks&&(this.model.tasks=[]),-1===this.model.tasks.indexOf(t.model)&&this.model.tasks.push(t.model))},i.prototype.addTask=function(e,n){var i,r=!1;if(this.rowsManager.gantt.objectModel.cleanTask(e),e.id in this.tasksMap){if(i=this.tasksMap[e.id],i.model===e)return i;i.model=e,r=!0}else i=new t(this,e),this.addTaskImpl(i,n);return this.sortTasks(),this.setFromToByTask(i),n||(r?this.rowsManager.gantt.api.tasks.raise.change(i):this.rowsManager.gantt.api.tasks.raise.add(i)),i},i.prototype.moveTaskToRow=function(t,e){var n=t.row;n.removeTask(t.model.id,e,!0),t.row=this,this.addTaskImpl(t,e),this.sortTasks(),this.setFromToByTask(t),t.updatePosAndSize(),this.updateVisibleTasks(),n.$scope.$digest(),t.row.$scope.$digest(),this.rowsManager.gantt.api.tasks.raise.viewRowChange(t,n),e||this.rowsManager.gantt.api.tasks.raise.rowChange(t,n)},i.prototype.updateVisibleTasks=function(){var t=this.rowsManager.gantt.options.value("filterTask");if(t){"object"==typeof t&&(t={model:t});var e=this.rowsManager.gantt.options.value("filterTaskComparator");"function"==typeof e&&(e=function(t,n){return e(t.model,n.model)}),this.filteredTasks=n("filter")(this.tasks,t,e)}else this.filteredTasks=this.tasks.slice(0);this.visibleTasks=n("ganttTaskLimit")(this.filteredTasks,this.rowsManager.gantt)},i.prototype.updateTasksPosAndSize=function(){for(var t=0,e=this.tasks.length;e>t;t++)this.tasks[t].updatePosAndSize()},i.prototype.removeTask=function(t,e,n){if(t in this.tasksMap){var i,r,o=this.tasksMap[t];for(r=this.tasks.length-1;r>=0;r--)if(i=this.tasks[r],i.model.id===t){this.tasks.splice(r,1),this.from-i.model.from!==0&&this.to-i.model.to!==0||this.setFromTo();break}for(r=this.filteredTasks.length-1;r>=0;r--)if(i=this.filteredTasks[r],i.model.id===t){this.filteredTasks.splice(r,1);break}for(r=this.visibleTasks.length-1;r>=0;r--)if(i=this.visibleTasks[r],i.model.id===t){this.visibleTasks.splice(r,1);break}if(!e){if(delete this.tasksMap[t],void 0!==this.model.tasks){var a=this.model.tasks.indexOf(o.model);a>-1&&this.model.tasks.splice(a,1)}n||this.rowsManager.gantt.api.tasks.raise.remove(o)}return o}},i.prototype.removeAllTasks=function(){this.from=void 0,this.to=void 0,this.tasksMap={},this.tasks=[],this.filteredTasks=[],this.visibleTasks=[]},i.prototype.setFromTo=function(){this.from=void 0,this.to=void 0;for(var t=0,e=this.tasks.length;e>t;t++)this.setFromToByTask(this.tasks[t])},i.prototype.setFromToByTask=function(t){this.setFromToByValues(t.model.from,t.model.to)},i.prototype.setFromToByValues=function(t,n){void 0!==t&&(void 0===this.from?this.from=e(t):t<this.from&&(this.from=e(t))),void 0!==n&&(void 0===this.to?this.to=e(n):n>this.to&&(this.to=e(n)))},i.prototype.sortTasks=function(){this.tasks.sort(function(t,e){return t.left-e.left})},i.prototype.clone=function(){for(var t=new i(this.rowsManager,angular.copy(this)),e=0,n=this.tasks.length;n>e;e++)t.addTask(this.tasks[e].model);return t},i}])}(),function(){"use strict";angular.module("gantt").factory("GanttRowHeader",[function(){var t=function(t){this.gantt=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttRowsManager",["GanttRow","ganttArrays","$filter","$timeout","moment",function(t,e,n,i,r){var o=function(t){var e=this;this.gantt=t,this.rowsMap={},this.rows=[],this.sortedRows=[],this.filteredRows=[],this.customFilteredRows=[],this.visibleRows=[],this.rowsTaskWatchers=[],this._defaultFilterImpl=function(t,e,i){return n("filter")(t,e,i)},this.filterImpl=this._defaultFilterImpl,this.customRowSorters=[],this.customRowFilters=[],this.gantt.$scope.$watchGroup(["filterTask","filterTaskComparator"],function(t,n){t!==n&&e.updateVisibleTasks()}),this.gantt.$scope.$watchGroup(["filterRow","filterRowComparator"],function(t,n){t!==n&&e.updateVisibleRows()}),this.gantt.$scope.$watch("sortMode",function(t,n){t!==n&&e.sortRows()});var r=this.gantt.scroll.isVScrollbarVisible();this.gantt.$scope.$watchGroup(["maxHeight","gantt.rowsManager.visibleRows.length"],function(t,n){t!==n&&i(function(){var t=e.gantt.scroll.isVScrollbarVisible();t!==r&&(r=t,e.gantt.columnsManager.updateColumnsMeta())})}),this.gantt.api.registerMethod("rows","sort",o.prototype.sortRows,this),this.gantt.api.registerMethod("rows","applySort",o.prototype.applySort,this),this.gantt.api.registerMethod("rows","refresh",o.prototype.updateVisibleObjects,this),this.gantt.api.registerMethod("rows","removeRowSorter",o.prototype.removeCustomRowSorter,this),this.gantt.api.registerMethod("rows","addRowSorter",o.prototype.addCustomRowSorter,this),this.gantt.api.registerMethod("rows","removeRowFilter",o.prototype.removeCustomRowFilter,this),this.gantt.api.registerMethod("rows","addRowFilter",o.prototype.addCustomRowFilter,this),this.gantt.api.registerMethod("rows","setFilterImpl",o.prototype.setFilterImpl,this),this.gantt.api.registerEvent("tasks","add"),this.gantt.api.registerEvent("tasks","change"),this.gantt.api.registerEvent("tasks","viewChange"),this.gantt.api.registerEvent("tasks","rowChange"),this.gantt.api.registerEvent("tasks","viewRowChange"),this.gantt.api.registerEvent("tasks","remove"),this.gantt.api.registerEvent("tasks","filter"),this.gantt.api.registerEvent("tasks","displayed"),this.gantt.api.registerEvent("rows","add"),this.gantt.api.registerEvent("rows","change"),this.gantt.api.registerEvent("rows","remove"),this.gantt.api.registerEvent("rows","move"),this.gantt.api.registerEvent("rows","displayed"),this.gantt.api.registerEvent("rows","filter"),this.updateVisibleObjects()};return o.prototype.resetNonModelLists=function(){this.rows=[],this.sortedRows=[],this.filteredRows=[],this.customFilteredRows=[],this.visibleRows=[]},o.prototype.addRow=function(n,i){var r,o,a,s=!1;if(this.gantt.objectModel.cleanRow(n),n.id in this.rowsMap){if(r=this.rowsMap[n.id],i&&(this.rows.push(r),this.sortedRows.push(r),this.filteredRows.push(r),this.customFilteredRows.push(r),this.visibleRows.push(r)),r.model===n)return;var l=e.getRemovedIds(n.tasks,r.model.tasks);for(o=0,a=l.length;a>o;o++){var u=l[o];r.removeTask(u)}r.model=n,s=!0}else r=new t(this,n),this.rowsMap[n.id]=r,this.rows.push(r),this.sortedRows.push(r),this.filteredRows.push(r),this.customFilteredRows.push(r),this.visibleRows.push(r);if(void 0!==n.tasks&&n.tasks.length>0){for(o=0,a=n.tasks.length;a>o;o++){var c=n.tasks[o];r.addTask(c)}r.updateVisibleTasks()}if(s?this.gantt.api.rows.raise.change(r):this.gantt.api.rows.raise.add(r),!s){var d=this.gantt.$scope.$watchCollection(function(){return n.tasks},function(t,n){if(t!==n){var i,o,a=e.getRemovedIds(t,n);for(i=0,o=a.length;o>i;i++){var s=a[i];r.removeTask(s)}if(void 0!==t){for(i=0,o=t.length;o>i;i++){var l=t[i];r.addTask(l)}r.updateVisibleTasks()}}});this.rowsTaskWatchers.push(d)}return s},o.prototype.removeRow=function(t){if(t in this.rowsMap){delete this.rowsMap[t];var n,i,r=e.indexOfId(this.rows,t,["model","id"]);if(r>-1){n=this.rows.splice(r,1)[0];var o=this.rowsTaskWatchers.splice(r,1)[0];o()}return e.removeId(this.sortedRows,t,["model","id"]),e.removeId(this.filteredRows,t,["model","id"]),e.removeId(this.customFilteredRows,t,["model","id"]),e.removeId(this.visibleRows,t,["model","id"]),this.gantt.api.rows.raise.remove(n),i}},o.prototype.removeAll=function(){this.rowsMap={},this.rows=[],this.sortedRows=[],this.filteredRows=[],this.customFilteredRows=[],this.visibleRows=[];for(var t=0,e=this.rowsTaskWatchers.length;e>t;t++){var n=this.rowsTaskWatchers[t];n()}this.rowsTaskWatchers=[]},o.prototype.sortRows=function(){var t=this.gantt.options.value("sortMode");if(void 0!==t){var e=!1;angular.isString(t)&&"-"===t.charAt(0)&&(e=!0,t=t.substr(1));var i=n("orderBy");this.sortedRows=i(this.rows,t,e)}else this.sortedRows=this.rows.slice();this.sortedRows=this.applyCustomRowSorters(this.sortedRows),this.updateVisibleRows()},o.prototype.removeCustomRowSorter=function(t){var e=this.customRowSorters.indexOf(t);e>-1&&this.customRowSorters.splice(e,1)},o.prototype.addCustomRowSorter=function(t){this.customRowSorters.push(t)},o.prototype.applyCustomRowSorters=function(t){for(var e=0;e<this.customRowSorters.length;e++)t=this.customRowSorters[e](t);return t},o.prototype.applySort=function(){var t=this.gantt.$scope.data;t.splice(0,t.length);for(var e=[],n=0,i=this.sortedRows.length;i>n;n++)t.push(this.sortedRows[n].model),e.push(this.sortedRows[n]);this.rows=e},o.prototype.moveRow=function(t,n){var i=this.gantt.options.value("sortMode");void 0!==i&&(this.applySort(),this.gantt.options.set("sortMode",void 0));var r=this.rows.indexOf(n),o=this.rows.indexOf(t);r>-1&&o>-1&&r!==o&&(e.moveToIndex(this.rows,o,r),e.moveToIndex(this.rowsTaskWatchers,o,r),e.moveToIndex(this.gantt.$scope.data,o,r),this.gantt.api.rows.raise.change(t),this.gantt.api.rows.raise.move(t,o,r),this.updateVisibleObjects(),this.sortRows())},o.prototype.updateVisibleObjects=function(){this.updateVisibleRows(),this.updateVisibleTasks()},o.prototype.updateVisibleRows=function(){var t=this.filteredRows,e=this.gantt.options.value("filterRow");if(e){"object"==typeof e&&(e={model:e});var n=this.gantt.options.value("filterRowComparator");if("function"==typeof n){var i=this.gantt;n=function(t,e){return i.options.value("filterRowComparator")(t,e)}}this.filteredRows=this.filterImpl(this.sortedRows,e,n)}else this.filteredRows=this.sortedRows.slice(0);var r=!angular.equals(t,this.filteredRows);this.customFilteredRows=this.applyCustomRowFilters(this.filteredRows),this.visibleRows=this.customFilteredRows,this.gantt.api.rows.raise.displayed(this.sortedRows,this.filteredRows,this.visibleRows),r&&this.gantt.api.rows.raise.filter(this.sortedRows,this.filteredRows)},o.prototype.removeCustomRowFilter=function(t){var e=this.customRowFilters.indexOf(t);e>-1&&this.customRowFilters.splice(e,1)},o.prototype.addCustomRowFilter=function(t){this.customRowFilters.push(t)},o.prototype.applyCustomRowFilters=function(t){for(var e=0;e<this.customRowFilters.length;e++)t=this.customRowFilters[e](t);return t},o.prototype.setFilterImpl=function(t){t?this.filterImpl=t:this.filterImpl=this._defaultFilterImpl},o.prototype.updateVisibleTasks=function(){for(var t=[],e=[],n=[],i=[],r=0;r<this.rows.length;r++){var o=this.rows[r];t=t.concat(o.filteredTasks),o.updateVisibleTasks(),e=e.concat(o.filteredTasks),i=i.concat(o.visibleTasks),n=n.concat(o.tasks)}this.gantt.api.tasks.raise.displayed(n,e,i);var a=!angular.equals(t,e);a&&this.gantt.api.tasks.raise.filter(n,e,i)},o.prototype.updateTasksPosAndSize=function(){for(var t=0,e=this.rows.length;e>t;t++)this.rows[t].updateTasksPosAndSize()},o.prototype.getExpandedFrom=function(t){t=t?r(t):t;for(var e=t,n=0;n<this.rows.length;n++)(void 0===e||e>this.rows[n].from)&&(e=this.rows[n]);return e&&(!t||t>e)?e:t},o.prototype.getExpandedTo=function(t){t=t?r(t):t;for(var e=t,n=0;n<this.rows.length;n++)(void 0===e||e<this.rows[n].to)&&(e=this.rows[n].to);var i=this.gantt.options.value("toDate");return e&&(!i||e>i)?e:t},o.prototype.getDefaultFrom=function(){for(var t,e=0;e<this.rows.length;e++)(void 0===t||this.rows[e].from<t)&&(t=this.rows[e].from);return t},o.prototype.getDefaultTo=function(){for(var t,e=0;e<this.rows.length;e++)(void 0===t||this.rows[e].to>t)&&(t=this.rows[e].to);return t},o}])}(),function(){"use strict";angular.module("gantt").factory("GanttTask",["moment",function(t){var e=function(t,e){this.rowsManager=t.rowsManager,this.row=t,this.model=e,this.truncatedLeft=!1,this.truncatedRight=!1};return e.prototype.isMilestone=function(){return!this.model.to||this.model.from-this.model.to===0},e.prototype.isOutOfRange=function(){var t=this.rowsManager.gantt.columnsManager.getFirstColumn(),e=this.rowsManager.gantt.columnsManager.getLastColumn();return void 0===t||this.model.to<t.date||void 0===e||this.model.from>e.endDate},e.prototype.updatePosAndSize=function(){var e=this.left,n=this.width,i=this.truncatedRight,r=this.truncatedLeft;!this.isMoving&&this.isOutOfRange()?(this.modelLeft=void 0,this.modelWidth=void 0):(this.modelLeft=this.rowsManager.gantt.getPositionByDate(this.model.from),this.modelWidth=this.rowsManager.gantt.getPositionByDate(this.model.to)-this.modelLeft);var o=this.rowsManager.gantt.columnsManager.getLastColumn(),a=o?o.left+o.width:0,s=this.modelLeft,l=this.modelWidth;this.rowsManager.gantt.options.value("daily")&&(s=this.rowsManager.gantt.getPositionByDate(t(this.model.from).startOf("day")),l=this.rowsManager.gantt.getPositionByDate(t(this.model.to).endOf("day"))-s),void 0===s||void 0===l||0>s+l||s>a?(this.left=void 0,this.width=void 0):(this.left=Math.min(Math.max(s,0),this.rowsManager.gantt.width),0>s?(this.truncatedLeft=!0,l+s>this.rowsManager.gantt.width?(this.truncatedRight=!0,this.width=this.rowsManager.gantt.width):(this.truncatedRight=!1,this.width=l+s)):l+s>this.rowsManager.gantt.width?(this.truncatedRight=!0,this.truncatedLeft=!1,this.width=this.rowsManager.gantt.width-s):(this.truncatedLeft=!1,this.truncatedRight=!1,this.width=l),this.width<0&&(this.left=this.left+this.width,this.width=-this.width)),this.updateView(),this.rowsManager.gantt.isRefreshingColumns||e===this.left&&n===this.width&&i===this.truncatedRight&&r===this.truncatedLeft||this.rowsManager.gantt.api.tasks.raise.viewChange(this)},e.prototype.updateView=function(){if(this.$element)if(void 0===this.left||void 0===this.width)this.$element.css("display","none");else{if(this.$element.css({left:this.left+"px",width:this.width+"px",display:""}),this.model.priority>0)for(var t=this.model.priority,e=this.$element.children(),n=0;n<e.length;n++)angular.element(e[n]).css("z-index",t);this.$element.toggleClass("gantt-task-milestone",this.isMilestone())}},e.prototype.getBackgroundElement=function(){if(void 0!==this.$element){var t=this.$element[0].querySelector(".gantt-task-background");return void 0!==t&&(t=angular.element(t)),t}},e.prototype.getContentElement=function(){if(void 0!==this.$element){var t=this.$element[0].querySelector(".gantt-task-content");return void 0!==t&&(t=angular.element(t)),t}},e.prototype.getForegroundElement=function(){if(void 0!==this.$element){var t=this.$element[0].querySelector(".gantt-task-foreground");return void 0!==t&&(t=angular.element(t)),t}},e.prototype.setFrom=function(t,e){this.model.from=this.rowsManager.gantt.getDateByPosition(t,e),this.row.setFromTo(),this.updatePosAndSize()},e.prototype.setTo=function(t,e){this.model.to=this.rowsManager.gantt.getDateByPosition(t,e),this.row.setFromTo(),this.updatePosAndSize()},e.prototype.moveTo=function(t,e){var n,i;t>this.modelLeft?(this.model.to=this.rowsManager.gantt.getDateByPosition(t+this.modelWidth,e),n=this.rowsManager.gantt.getPositionByDate(this.model.to),i=n-this.modelWidth,this.model.from=this.rowsManager.gantt.getDateByPosition(i,!1)):(this.model.from=this.rowsManager.gantt.getDateByPosition(t,e),i=this.rowsManager.gantt.getPositionByDate(this.model.from),n=i+this.modelWidth,this.model.to=this.rowsManager.gantt.getDateByPosition(n,!1)),this.row.setFromTo(),this.updatePosAndSize()},e.prototype.clone=function(){return new e(this.row,angular.copy(this.model))},e}])}(),function(){"use strict";angular.module("gantt").factory("GanttBody",["GanttBodyColumns","GanttBodyRows","GanttBodyBackground","GanttBodyForeground",function(t,e,n,i){var r=function(r){this.gantt=r,this.background=new n(this),this.foreground=new i(this),this.columns=new t(this),this.rows=new e(this)};return r}])}(),function(){"use strict";angular.module("gantt").factory("GanttBodyBackground",[function(){var t=function(t){this.body=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttBodyColumns",[function(){var t=function(t){this.body=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttBodyForeground",[function(){var t=function(t){this.body=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttBodyRows",[function(){var t=function(t){this.body=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttHeader",["GanttHeaderColumns",function(t){var e=function(e){this.gantt=e,this.columns=new t(this),this.getHeight=function(){return this.$element[0].offsetHeight}};return e}])}(),function(){"use strict";angular.module("gantt").factory("GanttHeaderColumns",[function(){var t=function(t){this.$element=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttScroll",[function(){var t=function(e){this.gantt=e,this.gantt.api.registerEvent("scroll","scroll"),this.gantt.api.registerMethod("scroll","to",t.prototype.scrollTo,this),this.gantt.api.registerMethod("scroll","toDate",t.prototype.scrollToDate,this),this.gantt.api.registerMethod("scroll","left",t.prototype.scrollToLeft,this),this.gantt.api.registerMethod("scroll","right",t.prototype.scrollToRight,this),this.gantt.api.registerMethod("scroll","setWidth",t.prototype.setWidth,this)};return t.prototype.getScrollLeft=function(){return void 0===this.$element?void 0:(void 0===this.cachedScrollLeft&&(this.cachedScrollLeft=this.$element[0].scrollLeft),this.cachedScrollLeft)},t.prototype.getScrollWidth=function(){return void 0===this.$element?void 0:this.$element[0].scrollWidth},t.prototype.getWidth=function(){return void 0===this.$element?void 0:this.$element[0].offsetWidth},t.prototype.setWidth=function(t){this.$element[0]&&(this.$element[0].offsetWidth=t)},t.prototype.getBordersWidth=function(){if(void 0!==this.$element){if(this.$element[0].clientWidth)return this.$element[0].offsetWidth-this.$element[0].clientWidth;var t=window.getComputedStyle(this.$element[0]).getPropertyValue("border-left-width")?window.getComputedStyle(this.$element[0]).getPropertyValue("border-left-width").match(/\d+/)[0]:0,e=window.getComputedStyle(this.$element[0]).getPropertyValue("border-right-width")?window.getComputedStyle(this.$element[0]).getPropertyValue("border-right-width").match(/\d+/)[0]:0;return parseInt(t)+parseInt(e)}},t.prototype.getBordersHeight=function(){return void 0===this.$element?void 0:this.$element[0].offsetHeight-this.$element[0].clientHeight},t.prototype.isVScrollbarVisible=function(){return void 0!==this.$element?this.$element[0].scrollHeight>this.$element[0].offsetHeight:void 0},t.prototype.isHScrollbarVisible=function(){return void 0!==this.$element?this.$element[0].scrollWidth>this.$element[0].offsetWidth:void 0},t.prototype.scrollTo=function(t){this.$element[0].scrollLeft=t,this.$element.triggerHandler("scroll")},t.prototype.scrollToLeft=function(t){this.$element[0].scrollLeft-=t,this.$element.triggerHandler("scroll")},t.prototype.scrollToRight=function(t){this.$element[0].scrollLeft+=t,this.$element.triggerHandler("scroll")},t.prototype.scrollToDate=function(t){var e=this.gantt.getPositionByDate(t);void 0!==e&&(this.$element[0].scrollLeft=e-this.$element[0].offsetWidth/2)},t}])}(),function(){"use strict";angular.module("gantt").factory("GanttSide",[function(){var t=function(t){this.gantt=t};return t.prototype.getWidth=function(){if(this.gantt.options.value("showSide")){var t=this.gantt.options.value("sideWidth");if(void 0===t&&void 0!==this.$element&&void 0!==this.$element.css("width")&&this.$element.css("width",""),void 0!==this.$element&&(t=this.$element[0].offsetWidth),void 0!==t)return t}return 0},t.prototype.show=function(t){void 0!==this.$element&&this.$element.toggleClass("ng-hide",!t)},t.prototype.isShown=function(){return void 0!==this.$element?!this.$element.hasClass("ng-hide"):void 0},t}])}(),function(){"use strict";angular.module("gantt").factory("GanttTimespan",[function(){var t=function(t,e){this.gantt=t,this.model=e};return t.prototype.updatePosAndSize=function(){this.modelLeft=this.gantt.getPositionByDate(this.model.from),this.modelWidth=this.gantt.getPositionByDate(this.model.to)-this.modelLeft;var t=this.gantt.columnsManager.getLastColumn(),e=t?t.left+t.width:0;this.modelLeft+this.modelWidth<0||this.modelLeft>e?(this.left=void 0,this.width=void 0):(this.left=Math.min(Math.max(this.modelLeft,0),this.gantt.width),this.modelLeft<0?(this.truncatedLeft=!0,this.modelWidth+this.modelLeft>this.gantt.width?(this.truncatedRight=!0,this.width=this.gantt.width):(this.truncatedRight=!1,this.width=this.modelWidth+this.modelLeft)):this.modelWidth+this.modelLeft>this.gantt.width?(this.truncatedRight=!0,this.truncatedLeft=!1,this.width=this.gantt.width-this.modelLeft):(this.truncatedLeft=!1,this.truncatedRight=!1,this.width=this.modelWidth),this.width<0&&(this.left=this.left+this.width,this.width=-this.width)),this.updateView()},t.prototype.updateView=function(){this.$element&&(void 0===this.left||void 0===this.width?this.$element.css("display","none"):(this.$element.css("display",""),this.$element.css("left",this.left+"px"),this.$element.css("width",this.width+"px")))},t.prototype.setFrom=function(t){this.from=this.gantt.getDateByPosition(t),this.updatePosAndSize()},t.prototype.setTo=function(t){this.to=this.gantt.getDateByPosition(t),this.updatePosAndSize()},t.prototype.moveTo=function(t){this.from=this.gantt.getDateByPosition(t),this.to=this.gantt.getDateByPosition(t+this.width),this.updatePosAndSize()},t.prototype.clone=function(){return new t(this.gantt,angular.copy(this.model))},t}])}(),function(){"use strict";angular.module("gantt").factory("GanttTimespansManager",["GanttTimespan",function(t){var e=function(t){var e=this;this.gantt=t,this.timespansMap={},this.timespans=[],this.gantt.$scope.$watchCollection("timespans",function(t){e.clearTimespans(),e.loadTimespans(t)}),this.gantt.api.registerMethod("timespans","load",this.loadTimespans,this),this.gantt.api.registerMethod("timespans","remove",this.removeTimespans,this),this.gantt.api.registerMethod("timespans","clear",this.clearTimespans,this),this.gantt.api.registerEvent("timespans","add"),this.gantt.api.registerEvent("timespans","remove"),this.gantt.api.registerEvent("timespans","change")};return e.prototype.loadTimespans=function(t){angular.isArray(t)||(t=void 0!==t?[t]:[]),this.gantt.$scope.timespans=t;for(var e=0,n=t.length;n>e;e++){var i=t[e];this.gantt.objectModel.cleanTimespan(i),this.loadTimespan(i)}},e.prototype.loadTimespan=function(e){var n,i=!1;return e.id in this.timespansMap?(n=this.timespansMap[e.id],n.model=e,i=!0,this.gantt.api.timespans.raise.change(n)):(n=new t(this.gantt,e),this.timespansMap[e.id]=n,this.timespans.push(n),this.gantt.api.timespans.raise.add(n)),n.updatePosAndSize(),i},e.prototype.removeTimespans=function(t){angular.isArray(t)||(t=[t]);for(var e=0,n=t.length;n>e;e++){var i=t[e];this.removeTimespan(i.id)}this.updateVisibleObjects()},e.prototype.removeTimespan=function(t){if(t in this.timespansMap){delete this.timespansMap[t];for(var e,n,i=this.timespans.length-1;i>=0;i--)if(n=this.timespans[i],n.model.id===t){e=n,this.timespans.splice(i,1);break}return this.gantt.api.timespans.raise.remove(e),e}},e.prototype.clearTimespans=function(){this.timespansMap={},this.timespans=[]},e.prototype.updateTimespansPosAndSize=function(){for(var t=0,e=this.timespans.length;e>t;t++)this.timespans[t].updatePosAndSize()},e}])}(),function(){"use strict";angular.module("gantt").service("ganttArrays",[function(){return{moveToIndex:function(t,e,n){if(n>=t.length)for(var i=n-t.length;i--+1;)t.push(void 0);return t.splice(n,0,t.splice(e,1)[0]),t},getRemovedIds:function(t,e,n){void 0===n&&(n="id");var i,r,o=[];if(void 0!==e)for(i=0,r=e.length;r>i;i++)o.push(e[i][n]);if(void 0!==t)for(i=0,r=t.length;r>i;i++){var a=t[i];if(void 0!==a[n]){var s=o.indexOf(a[n]);s>-1&&o.splice(s,1)}}return o},indexOfId:function(t,e,n){var i;if(void 0===n)n="id";else if(n instanceof Array){for(i=t.length-1;i>=0;i--){for(var r=t[i],o=0,a=n.length;a>o;o++)r=r[n[o]];if(r===e)return i}return-1}for(i=t.length-1;i>=0;i--)if(t[i][n]===e)return i;return-1},removeId:function(t,e,n){var i=this.indexOfId(t,e,n);return i>-1?t.splice(i,1)[0]:void 0},remove:function(t,e){var n=t.indexOf(e);return n>-1?(t.splice(n,1),!0):!1}}}])}(),function(){"use strict";angular.module("gantt").service("ganttBinarySearch",[function(){return{getIndicesOnly:function(t,e,n,i){for(var r=-1,o=t.length;o-r>1;){var a=Math.floor((r+o)/2);(i?n(t[a])<e:n(t[a])<=e)?r=a:o=a}return i||void 0===t[r]||n(t[r])!==e||(o=r),[r,o]},get:function(t,e,n,i){var r=this.getIndicesOnly(t,e,n,i);return[t[r[0]],t[r[1]]]}}}])}(),function(){"use strict";angular.module("gantt").factory("GanttHierarchy",[function(){var t=function(){var t=this,e={},n={},i={},r={},o={},a={},s=function(t,e){if(void 0!==e){var n=i[t.model.name];void 0===n&&(n=[],i[t.model.name]=n),n.push(e);var s=r[t.model.id];void 0===s&&(s=[],r[t.model.id]=s),s.push(e),o[e.model.name]=t,a[e.model.id]=t}};this.refresh=function(l){e={},n={},i={},r={},o={},a={};for(var u,c=0;c<l.length;c++)u=l[c],e[u.model.name]=u,n[u.model.id]=u;for(c=0;c<l.length;c++){if(u=l[c],void 0!==u.model.parent){var d=e[u.model.parent];void 0===d&&(d=n[u.model.parent]),void 0!==d&&s(d,u)}if(void 0!==u.model.children)for(var h=u.model.children,f=0;f<h.length;f++){var p=h[f],m=e[p];void 0===m&&(m=n[p]),void 0!==m&&s(u,m)}}var g=[];for(c=0;c<l.length;c++)u=l[c],void 0===t.parent(u)&&g.push(u);return g},this.children=function(t){var e=r[t.model.id];return e},this.descendants=function(e){var n=[],i=t.children(e);if(n.push.apply(n,i),void 0!==i)for(var r=0;r<i.length;r++){var o=t.descendants(i[r]);n.push.apply(n,o)}return n},this.parent=function(t){var e=a[t.model.id];return e},this.ancestors=function(e){for(var n=[],i=t.parent(e);void 0!==i;)n.push(i),i=t.parent(i);return n}};return t}])}(),function(){"use strict";angular.module("gantt").service("ganttUtils",[function(){return{createBoundedWrapper:function(t,e){return function(){return e.apply(t,arguments)}},firstProperty:function(t,e,n){for(var i=0,r=t.length;r>i;i++){var o=t[i];if(void 0!==o&&e in o&&void 0!==o[e])return o[e]}return n},angularIndexOf:function(t,e){for(var n=0;n<t.length;n++)if(angular.equals(t[n],e))return n;return-1},random4:function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},randomUuid:function(){return this.random4()+this.random4()+"-"+this.random4()+"-"+this.random4()+"-"+this.random4()+"-"+this.random4()+this.random4()+this.random4()},newId:function(){var t=(new Date).getTime();return function(){return t+=1}}()}}])}(),function(){"use strict";angular.module("gantt").filter("ganttColumnLimit",["ganttBinarySearch",function(t){var e=function(t){return t.left};return function(n,i){var r=i.scroll.getScrollLeft(),o=i.getWidth()-i.side.getWidth();if(o>0){var a=t.getIndicesOnly(n,r,e)[0],s=t.getIndicesOnly(n,r+o,e)[1];return n.slice(a,s)}return n.slice()}}])}(),function(){"use strict";angular.module("gantt").filter("ganttTaskLimit",[function(){return function(t,e){var n=e.columnsManager.getFirstColumn(),i=e.columnsManager.getLastColumn();if(void 0!==n&&void 0!==i){for(var r=n.date,o=i.endDate,a=[],s=e.scroll.getScrollLeft(),l=e.getWidth()-e.side.getWidth(),u=0,c=t.length;c>u;u++){var d=t[u];d.active?a.push(d):d.model.to>=r&&d.model.from<=o&&(void 0===d.left&&d.updatePosAndSize(),(!l||d.left>=s&&d.left<=s+l||d.left+d.width>=s&&d.left+d.width<=s+l||d.left<s&&d.left+d.width>s+l)&&a.push(d))}return a}return t.splice()}}])}(),function(){"use strict";angular.module("gantt").directive("ganttResizer",["$document","$parse","$timeout","ganttMouseOffset",function(t,e,n,i){return{restrict:"A",require:"^gantt",scope:{targetElement:"=ganttResizer",enabled:"@?ganttResizerEnabled"},link:function(r,o,a,s){function l(){return s.gantt.options.value(a.resizerWidth)}function u(t){t!==l()&&(s.gantt.options.set(a.resizerWidth,t),void 0!==m&&p[m].raise.resize(t),n(function(){s.gantt.columnsManager.updateColumnsMeta()}))}function c(t){t.preventDefault(),u(void 0)}function d(t){r.$evalAsync(function(){var e=i.getOffsetForElement(r.targetElement[0],t),n=s.gantt.getWidth()-s.gantt.scroll.getBordersWidth(),o=Math.min(Math.max(e.x,0),n);u(o)})}function h(){void 0!==m&&p[m].raise.resizeEnd(l()),t.unbind("mousemove",d),t.unbind("mouseup",h)}function f(e){e.preventDefault(),void 0!==m&&p[m].raise.resizeBegin(l()),t.on("mousemove",d),t.on("mouseup",h)}var p=s.gantt.api,m=a.ganttResizerEventTopic;void 0===r.enabled&&(r.enabled=!0),a.$observe("ganttResizerEnabled",function(t){r.enabled=e(t)()}),r.$watch("enabled",function(t){void 0===t&&(t=!0),o.toggleClass("gantt-resizer-enabled",t),t?(o.on("dblclick",c),o.on("mousedown",f)):(o.off("dblclick",c),o.off("mousedown",f))}),r.$watch(function(){return l()},function(t,e){t!==e&&(r.targetElement.css("width",t+"px"),r.targetElement[0].offsetWidth>0&&u(r.targetElement[0].offsetWidth))}),m&&(p.registerEvent(m,"resize"),p.registerEvent(m,"resizeBegin"),p.registerEvent(m,"resizeEnd"),p.registerMethod(m,"setWidth",u,this),p.registerMethod(m,"getWidth",l,this))}}}])}(),function(){"use strict";angular.module("gantt").directive("ganttHorizontalScrollReceiver",function(){
return{restrict:"A",require:"^ganttScrollManager",link:function(t,e,n,i){i.registerHorizontalReceiver(e)}}})}(),function(){"use strict";angular.module("gantt").directive("ganttScrollManager",function(){return{restrict:"A",scope:{},controller:["$scope",function(t){t.horizontal=[],t.vertical=[],this.registerVerticalReceiver=function(e){e.css("position","relative"),t.vertical.push(e[0])},this.registerHorizontalReceiver=function(e){e.css("position","relative"),t.horizontal.push(e[0])},this.getHorizontalRecievers=function(){return t.horizontal},this.getVerticalRecievers=function(){return t.vertical}}]}})}(),function(){"use strict";angular.module("gantt").directive("ganttScrollSender",[function(){return{restrict:"A",require:["^gantt","^ganttScrollManager"],link:function(t,e,n,i){var r=e[0],o=function(){var t,e,n=i[1].getVerticalRecievers();for(t=0,e=n.length;e>t;t++){var o=n[t];o.parentNode.scrollTop!==r.scrollTop&&(o.parentNode.scrollTop=r.scrollTop)}var a=i[1].getHorizontalRecievers();for(t=0,e=a.length;e>t;t++){var s=a[t];s.parentNode.scrollLeft!==r.scrollLeft&&(s.parentNode.scrollLeft=r.scrollLeft)}};e.bind("scroll",o),t.$watch(function(){return i[0].gantt.width},function(t,e){if(t!==e)for(var n=i[1].getHorizontalRecievers(),r=0,o=n.length;o>r;r++){var a=n[r];a.style.width=t+"px"}})}}}])}(),function(){"use strict";angular.module("gantt").directive("ganttScrollable",["GanttDirectiveBuilder","$timeout","ganttDebounce","moment",function(t,e,n,i){var r=new t("ganttScrollable");return r.controller=function(t,r){t.gantt.scroll.$element=r;var o,a,s=function(e,n,r){var o=t.gantt.options.value("autoExpand");if("both"===o||o===!0||o===r){var a,s,l=t.gantt.options.value("viewScale");l=l.trim(),"s"===l.charAt(l.length-1)&&(l=l.substring(0,l.length-1));var u,c,d;l&&(d=l.split(" ")),d&&d.length>1?(u=parseFloat(d[0]),c=d[d.length-1]):(u=1,c=l),"left"===r?(a=i(n).add(-5*u,c),t.fromDate=a):(s=i(n).add(5*u,c),t.toDate=s),t.gantt.api.scroll.raise.scroll(e.scrollLeft,n,r)}};r.bind("scroll",n(function(){var n,i,l=r[0],u=l.scrollLeft;t.gantt.scroll.cachedScrollLeft=u,t.gantt.columnsManager.updateVisibleColumns(),t.gantt.rowsManager.updateVisibleObjects(),o>u&&0===u?(n="left",i=t.gantt.columnsManager.from):u>o&&l.offsetWidth+u>=l.scrollWidth-1&&(n="right",i=t.gantt.columnsManager.to),o=u,void 0!==i?(a&&e.cancel(a),a=e(function(){s(l,i,n)},300)):t.gantt.api.scroll.raise.scroll(u)},5)),t.getScrollableCss=function(){var e={},n=t.gantt.options.value("maxHeight");n>0&&(e["max-height"]=n-t.gantt.header.getHeight()+"px",e["overflow-y"]="auto",t.gantt.scroll.isVScrollbarVisible()&&(e["border-right"]="none"));var i=this.gantt.options.value("columnWidth"),r=0===t.gantt.width?!1:t.gantt.width<t.gantt.getWidth()-t.gantt.side.getWidth();return void 0!==i&&r&&(e.width=t.gantt.width+this.gantt.scroll.getBordersWidth()+"px"),e}},r.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttVerticalScrollReceiver",function(){return{restrict:"A",require:"^ganttScrollManager",link:function(t,e,n,i){i.registerVerticalReceiver(e)}}})}(),function(){"use strict";angular.module("gantt").directive("ganttElementHeightListener",[function(){return{restrict:"A",controller:["$scope","$element","$attrs",function(t,e,n){var i=n.ganttElementHeightListener;""===i&&(i="ganttElementHeight");for(var r=t;0===i.indexOf("$parent.");)i=i.substring("$parent.".length),r=r.$parent;r.$watch(function(){return e[0].offsetHeight},function(t){t>0&&(r[i]=t)})}]}}])}(),function(){"use strict";angular.module("gantt").directive("ganttElementWidthListener",[function(){return{restrict:"A",controller:["$scope","$element","$attrs",function(t,e,n){var i=n.ganttElementWidthListener;""===i&&(i="ganttElementWidth");for(var r=t;0===i.indexOf("$parent.");)i=i.substring("$parent.".length),r=r.$parent;r.$watch(function(){return e[0].offsetWidth},function(t){t>0&&(r[i]=t)})}]}}])}(),function(){"use strict";angular.module("gantt").directive("ganttBody",["GanttDirectiveBuilder",function(t){var e=new t("ganttBody");return e.controller=function(t,e){t.gantt.body.$element=e,t.gantt.body.$scope=t},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttBodyBackground",["GanttDirectiveBuilder",function(t){var e=new t("ganttBodyBackground");return e.controller=function(t,e){t.gantt.body.background.$element=e,t.gantt.body.background.$scope=t},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttBodyColumns",["GanttDirectiveBuilder",function(t){var e=new t("ganttBodyColumns");return e.controller=function(t,e){t.gantt.body.columns.$element=e,t.gantt.body.background.$scope=t},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttBodyForeground",["GanttDirectiveBuilder",function(t){var e=new t("ganttBodyForeground");return e.controller=function(t,e){t.gantt.body.foreground.$element=e,t.gantt.body.foreground.$scope=t},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttBodyRows",["GanttDirectiveBuilder",function(t){var e=new t("ganttBodyRows");return e.controller=function(t,e){t.gantt.body.rows.$element=e,t.gantt.body.rows.$scope=t},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttColumn",["GanttDirectiveBuilder",function(t){var e=new t("ganttColumn");return e.controller=function(t,e){t.column.$element=e,t.column.$scope=t,t.column.updateView()},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttColumnHeader",["GanttDirectiveBuilder",function(t){var e=new t("ganttColumnHeader");return e.controller=function(t,e){t.column.$element=e,t.column.$scope=t,t.column.updateView()},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttHeader",["GanttDirectiveBuilder",function(t){var e=new t("ganttHeader");return e.controller=function(t,e){t.gantt.header.$element=e,t.gantt.header.$scope=t},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttHeaderColumns",["GanttDirectiveBuilder",function(t){var e=new t("ganttHeaderColumns");return e.controller=function(t,e){t.gantt.header.columns.$element=e,t.gantt.header.columns.$scope=t},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttRow",["GanttDirectiveBuilder",function(t){var e=new t("ganttRow");return e.controller=function(t,e){t.row.$element=e,t.row.$scope=t},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttRowBackground",["GanttDirectiveBuilder",function(t){var e=new t("ganttRowBackground");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttRowLabel",["GanttDirectiveBuilder",function(t){var e=new t("ganttRowLabel");return e.restrict="A",e.templateUrl=void 0,e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttScrollableHeader",["GanttDirectiveBuilder","ganttLayout",function(t,e){var n=new t("ganttScrollableHeader");return n.controller=function(t){var n=e.getScrollBarWidth();t.getScrollableHeaderCss=function(){var e={},i=t.gantt.scroll.isVScrollbarVisible(),r=i?n:0,o=this.gantt.options.value("columnWidth"),a=0===t.gantt.width?!1:t.gantt.width<t.gantt.getWidth()-t.gantt.side.getWidth();return void 0!==o&&a?e.width=t.gantt.width-r+this.gantt.scroll.getBordersWidth()+"px":i&&(e.width=t.gantt.getWidth()-t.gantt.side.getWidth()-r+"px"),e}},n.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttSide",["GanttDirectiveBuilder",function(t){var e=new t("ganttSide");return e.controller=function(t,e){t.gantt.side.$element=e,t.gantt.side.$scope=t},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttSideBackground",["GanttDirectiveBuilder","ganttLayout",function(t,e){var n=new t("ganttSideBackground");return n.controller=function(t){var n=e.getScrollBarHeight();t.getMaxHeightCss=function(){var e={};if(t.maxHeight){var i=t.gantt.scroll.isHScrollbarVisible()?n:0;e["max-height"]=t.maxHeight-i-t.gantt.header.getHeight()+"px"}return e}},n.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttSideContent",["GanttDirectiveBuilder",function(t){var e=new t("ganttSideContent");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTask",["GanttDirectiveBuilder","moment",function(t,e){var n=new t("ganttTask");return n.controller=function(t,n){t.task.$element=n,t.task.$scope=t,t.getTaskContent=function(){return void 0!==t.task.model.content?t.task.model.content:t.task.rowsManager.gantt.options.value("taskContent")},t.simplifyMoment=function(t){return e.isMoment(t)?t.unix():t},t.$watchGroup(["simplifyMoment(task.model.from)","simplifyMoment(task.model.to)"],function(){t.task.updatePosAndSize()})},n.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTaskBackground",["GanttDirectiveBuilder",function(t){var e=new t("ganttTaskBackground");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTaskContent",["GanttDirectiveBuilder",function(t){var e=new t("ganttTaskContent");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTaskForeground",["GanttDirectiveBuilder",function(t){var e=new t("ganttTaskForeground");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTimeFrame",["GanttDirectiveBuilder",function(t){var e=new t("ganttTimeFrame");return e.controller=function(t,e){t.timeFrame.$element=e,t.timeFrame.$scope=t,t.timeFrame.updateView()},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTimespan",["GanttDirectiveBuilder",function(t){var e=new t("ganttTimespan");return e.controller=function(t,e){t.timespan.$element=e,t.timespan.$scope=t,t.timespan.updateView()},e.build()}])}(),function(){"use strict";angular.module("gantt").factory("ganttDebounce",["$timeout",function(t){function e(e,n,i){var r=0;return function(){var o=this,a=arguments;r++;var s=function(t){return function(){return t===r?e.apply(o,a):void 0}}(r);return t(s,n,void 0===i?!0:i)}}return e}])}(),function(){"use strict";angular.module("gantt").service("GanttDirectiveBuilder",["$templateCache",function(t){var e=function(e,n,i,r){var o=this;this.directiveName=e,this.templateUrl=void 0===n?"template/"+e+".tmpl.html":n,this.require=void 0===i?"^gantt":i,this.restrict=void 0===r?"E":r,this.scope=!1,this.transclude=!0,this.replace=!0,this.build=function(){var e=o.directiveName,n=o.templateUrl,i=o.controller,r={restrict:o.restrict,require:o.require,transclude:o.transclude,replace:o.replace,scope:o.scope,templateUrl:function(e,i){return void 0!==i.templateUrl&&(n=i.templateUrl),void 0!==i.template&&t.put(n,i.template),n},compile:function(){return{pre:function(t,n,i,r){t.gantt.api.directives.raise.preLink(e,t,n,i,r)},post:function(t,n,i,r){t.gantt.api.directives.raise.postLink(e,t,n,i,r)}}},controller:["$scope","$element","$attrs",function(t,n,r){var o=this;void 0!==i&&i(t,n,r,o),t.gantt.api.directives.raise.controller(e,t,n,r,o),t.$on("$destroy",function(){t.gantt.api.directives.raise.destroy(e,t,n,r,o)}),t.$applyAsync(function(){t.gantt.api.directives.raise["new"](e,t,n,r,o)})}]};return n||(delete r.templateUrl,delete r.replace,delete r.transclude),r}};return e}])}(),function(){"use strict";angular.module("gantt").service("ganttDom",["$document",function(t){return{elementFromPoint:function(e,n){return t[0].elementFromPoint(e,n)},elementsFromPoint:function(t,e,n){for(var i,r,o,a,s=[],l=[],u=0;(i=this.elementFromPoint(t,e))&&-1===s.indexOf(i)&&null!==i&&(void 0===n||n>u);)s.push(i),l.push({value:i.style.getPropertyValue("visibility"),priority:i.style.getPropertyPriority("visibility")}),i.style.setProperty("visibility","hidden","important"),u++;for(r=0,o=l.length;o>r;r++)a=l[r],s[r].style.setProperty("visibility",a.value?a.value:"",a.priority);return s},findElementFromPoint:function(t,e,n){for(var i,r,o,a,s,l=[],u=[],c=0;(i=this.elementFromPoint(t,e))&&-1===l.indexOf(i)&&null!==i;)if(l.push(i),u.push({value:i.style.getPropertyValue("visibility"),priority:i.style.getPropertyPriority("visibility")}),i.style.setProperty("visibility","hidden","important"),c++,n(i)){r=i;break}for(o=0,a=u.length;a>o;o++)s=u[o],l[o].style.setProperty("visibility",s.value?s.value:"",s.priority);return r},isElementVisible:function(t){return void 0!==t.offsetParent&&null!==t.offsetParent}}}])}(),function(){"use strict";angular.module("gantt").service("ganttEnableNgAnimate",["$injector",function(t){var e;try{e=t.get("$animate")}catch(n){}return void 0!==e?function(t,n){angular.version.major>=1&&angular.version.minor>=4?e.enabled(t,n):e.enabled(n,t)}:angular.noop}])}(),function(){"use strict";angular.module("gantt").directive("ganttBindCompileHtml",["$compile",function(t){return{restrict:"A",require:"^gantt",link:function(e,n,i,r){e.scope=r.gantt.$scope.$parent,e.$watch(function(){return e.$eval(i.ganttBindCompileHtml)},function(i){n.html(i),t(n.contents())(e)})}}}])}(),function(){"use strict";angular.module("gantt").service("ganttLayout",["$document",function(t){return{getScrollBarWidth:function(){var e=t[0].createElement("p");e.style.width="100%",e.style.height="200px";var n=t[0].createElement("div");n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.visibility="hidden",n.style.width="200px",n.style.height="150px",n.style.overflow="hidden",n.appendChild(e),t[0].body.appendChild(n);var i=e.offsetWidth;n.style.overflow="scroll";var r=e.offsetWidth;return i===r&&(r=n.clientWidth),t[0].body.removeChild(n),i-r},getScrollBarHeight:function(){var e=t[0].createElement("p");e.style.width="200px;",e.style.height="100%";var n=t[0].createElement("div");n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.visibility="hidden",n.style.width="150px",n.style.height="200px",n.style.overflow="hidden",n.appendChild(e),t[0].body.appendChild(n);var i=e.offsetHeight;n.style.overflow="scroll";var r=e.offsetHeight;return i===r&&(r=n.clientHeight),t[0].body.removeChild(n),i-r},setColumnsWidthFactor:function(t,e,n){if(t){n||(n=0);for(var i=0;i<t.length;i++){var r=t[i];r.left=e*(r.originalSize.left+n)-n,r.width=e*r.originalSize.width;for(var o=0;o<r.timeFrames.length;o++){var a=r.timeFrames[o];a.left=e*a.originalSize.left,a.width=e*a.originalSize.width}}}}}}])}(),function(){"use strict";angular.module("gantt").service("ganttMouseButton",[function(){return{getButton:function(t){return t=t||window.event,t.which?t.which:void 0===t.button?1:t.button<2?1:4===t.button?2:3}}}])}(),function(){"use strict";angular.module("gantt").service("ganttMouseOffset",[function(){return{getTouch:function(t){return void 0!==t.touches?t.touches[0]:t},getOffset:function(t){return t.offsetX&&t.offsetY?{x:t.offsetX,y:t.offsetY}:t.layerX&&t.layerY?{x:t.layerX,y:t.layerY}:this.getOffsetForElement(t.target,t)},getOffsetForElement:function(t,e){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}}}])}(),function(){"use strict";angular.module("gantt").factory("ganttSmartEvent",[function(){function t(t,e,n,i){return t.$on("$destroy",function(){e.unbind(n,i)}),{bindOnce:function(){e.one(n,i)},bind:function(){e.bind(n,i)},unbind:function(){e.unbind(n,i)}}}return t}])}(),angular.module("gantt.templates",[]).run(["$templateCache",function(t){t.put("template/gantt.tmpl.html",'<div class="gantt unselectable" ng-cloak gantt-scroll-manager gantt-element-width-listener="ganttElementWidth">\n    <gantt-side>\n        <gantt-side-background>\n        </gantt-side-background>\n        <gantt-side-content>\n        </gantt-side-content>\n        <div gantt-resizer="gantt.side.$element" gantt-resizer-event-topic="side" gantt-resizer-enabled="{{$parent.gantt.options.value(\'allowSideResizing\')}}" resizer-width="sideWidth" class="gantt-resizer">\n            <div ng-show="$parent.gantt.options.value(\'allowSideResizing\')" class="gantt-resizer-display"></div>\n        </div>\n    </gantt-side>\n    <gantt-scrollable-header>\n        <gantt-header gantt-element-height-listener="$parent.ganttHeaderHeight">\n            <gantt-header-columns>\n                <div ng-repeat="header in gantt.columnsManager.visibleHeaders track by $index">\n                    <div class="gantt-header-row" ng-class="{\'gantt-header-row-last\': $last, \'gantt-header-row-first\': $first}">\n                        <gantt-column-header ng-repeat="column in header"></gantt-column-header>\n                    </div>\n                </div>\n            </gantt-header-columns>\n        </gantt-header>\n    </gantt-scrollable-header>\n    <gantt-scrollable>\n        <gantt-body>\n            <gantt-body-background>\n                <gantt-row-background ng-repeat="row in gantt.rowsManager.visibleRows track by row.model.id"></gantt-row-background>\n            </gantt-body-background>\n            <gantt-body-foreground>\n                <div class="gantt-current-date-line" ng-show="currentDate === \'line\' && gantt.currentDateManager.position >= 0 && gantt.currentDateManager.position <= gantt.width" ng-style="{\'left\': gantt.currentDateManager.position + \'px\' }"></div>\n            </gantt-body-foreground>\n            <gantt-body-columns>\n                <gantt-column ng-repeat="column in gantt.columnsManager.visibleColumns">\n                    <gantt-time-frame ng-repeat="timeFrame in column.visibleTimeFrames"></gantt-time-frame>\n                </gantt-column>\n            </gantt-body-columns>\n            <div ng-if="gantt.columnsManager.visibleColumns == 0" style="background-color: #808080"></div>\n            <gantt-body-rows>\n                <gantt-timespan ng-repeat="timespan in gantt.timespansManager.timespans track by timespan.model.id"></gantt-timespan>\n                <gantt-row ng-repeat="row in gantt.rowsManager.visibleRows track by row.model.id">\n                    <gantt-task ng-repeat="task in row.visibleTasks track by task.model.id">\n                    </gantt-task>\n                </gantt-row>\n            </gantt-body-rows>\n        </gantt-body>\n    </gantt-scrollable>\n\n    <!-- Plugins -->\n    <ng-transclude></ng-transclude>\n\n    <!--\n    ******* Inline templates *******\n    You can specify your own templates by either changing the default ones below or by\n    adding an attribute template-url="<url to your template>" on the specific element.\n    -->\n\n    <!-- Body template -->\n    <script type="text/ng-template" id="template/ganttBody.tmpl.html">\n        <div ng-transclude class="gantt-body" ng-style="{\'width\': gantt.width > 0 ? gantt.width +\'px\' : undefined}"></div>\n    </script>\n\n    <!-- Header template -->\n    <script type="text/ng-template" id="template/ganttHeader.tmpl.html">\n        <div ng-transclude class="gantt-header"\n             ng-show="gantt.columnsManager.columns.length > 0 && gantt.columnsManager.headers.length > 0"></div>\n    </script>\n\n    <!-- Side template -->\n    <script type="text/ng-template" id="template/ganttSide.tmpl.html">\n        <div ng-transclude class="gantt-side" style="width: auto;"></div>\n    </script>\n\n    <!-- Side content template-->\n    <script type="text/ng-template" id="template/ganttSideContent.tmpl.html">\n        <div class="gantt-side-content">\n        </div>\n    </script>\n\n    <!-- Header columns template -->\n    <script type="text/ng-template" id="template/ganttHeaderColumns.tmpl.html">\n        <div ng-transclude class="gantt-header-columns"\n              gantt-horizontal-scroll-receiver></div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttColumnHeader.tmpl.html">\n        <div class="gantt-column-header" ng-class="{\'gantt-column-header-last\': $last, \'gantt-column-header-first\': $first}">{{::column.label}}</div>\n    </script>\n\n    <!-- Body background template -->\n    <script type="text/ng-template" id="template/ganttBodyBackground.tmpl.html">\n        <div ng-transclude class="gantt-body-background"></div>\n    </script>\n\n    <!-- Body foreground template -->\n    <script type="text/ng-template" id="template/ganttBodyForeground.tmpl.html">\n        <div ng-transclude class="gantt-body-foreground"></div>\n    </script>\n\n    <!-- Body columns template -->\n    <script type="text/ng-template" id="template/ganttBodyColumns.tmpl.html">\n        <div ng-transclude class="gantt-body-columns"></div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttColumn.tmpl.html">\n        <div ng-transclude class="gantt-column gantt-foreground-col" ng-class="{\'gantt-column-last\': $last, \'gantt-column-first\': $first}"></div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttTimeFrame.tmpl.html">\n        <div class="gantt-timeframe"></div>\n    </script>\n\n    <!-- Scrollable template -->\n    <script type="text/ng-template" id="template/ganttScrollable.tmpl.html">\n        <div ng-transclude class="gantt-scrollable" gantt-scroll-sender ng-style="getScrollableCss()"></div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttScrollableHeader.tmpl.html">\n        <div ng-transclude class="gantt-scrollable-header" ng-style="getScrollableHeaderCss()"></div>\n    </script>\n\n    <!-- Rows template -->\n    <script type="text/ng-template" id="template/ganttBodyRows.tmpl.html">\n        <div ng-transclude class="gantt-body-rows"></div>\n    </script>\n\n    <!-- Timespan template -->\n    <script type="text/ng-template" id="template/ganttTimespan.tmpl.html">\n        <div class="gantt-timespan" ng-class="timespan.model.classes">\n        </div>\n    </script>\n\n    <!-- Task template -->\n    <script type="text/ng-template" id="template/ganttTask.tmpl.html">\n        <div class="gantt-task" ng-class="task.model.classes">\n            <gantt-task-background></gantt-task-background>\n            <gantt-task-foreground></gantt-task-foreground>\n            <gantt-task-content></gantt-task-content>\n        </div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttTaskBackground.tmpl.html">\n        <div class="gantt-task-background" ng-style="{\'background-color\': task.model.color}"></div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttTaskForeground.tmpl.html">\n        <div class="gantt-task-foreground">\n            <div ng-if="task.truncatedRight" class="gantt-task-truncated-right">&gt;</div>\n            <div ng-if="task.truncatedLeft" class="gantt-task-truncated-left">&lt;</div>\n        </div>\n    </script>\n\n    <!-- Task content template -->\n    <script type="text/ng-template" id="template/ganttTaskContent.tmpl.html">\n        <div class="gantt-task-content" unselectable="on"><span unselectable="on" gantt-bind-compile-html="getTaskContent()"/></div>\n    </script>\n\n\n    <!-- Row background template -->\n    <script type="text/ng-template" id="template/ganttRowBackground.tmpl.html">\n        <div class="gantt-row gantt-row-height"\n             ng-class="row.model.classes"\n             ng-class-odd="\'gantt-row-odd\'"\n             ng-class-even="\'gantt-row-even\'"\n             ng-style="{\'height\': row.model.height}">\n            <div class="gantt-row-background"\n                 ng-style="{\'background-color\': row.model.color}">\n            </div>\n        </div>\n    </script>\n\n    <!-- Row template -->\n    <script type="text/ng-template" id="template/ganttRow.tmpl.html">\n        <div class="gantt-row gantt-row-height"\n             ng-class="row.model.classes"\n             ng-class-odd="\'gantt-row-odd\'"\n             ng-class-even="\'gantt-row-even\'"\n             ng-style="{\'height\': row.model.height}">\n            <div ng-transclude class="gantt-row-content"></div>\n        </div>\n    </script>\n\n    <!-- Side background template -->\n    <script type="text/ng-template" id="template/ganttSideBackground.tmpl.html">\n        <div class="gantt-side-background">\n            <div class="gantt-side-background-header" ng-style="{height: $parent.ganttHeaderHeight + \'px\'}">\n                <div ng-show="$parent.ganttHeaderHeight" class="gantt-header-row gantt-side-header-row"></div>\n            </div>\n            <div class="gantt-side-background-body" ng-style="getMaxHeightCss()">\n                <div gantt-vertical-scroll-receiver>\n                    <div class="gantt-row gantt-row-height "\n                         ng-class-odd="\'gantt-row-odd\'"\n                         ng-class-even="\'gantt-row-even\'"\n                         ng-class="row.model.classes"\n                         ng-repeat="row in gantt.rowsManager.visibleRows track by row.model.id"\n                         ng-style="{\'height\': row.model.height}">\n                        <div gantt-row-label class="gantt-row-label gantt-row-background"\n                             ng-style="{\'background-color\': row.model.color}">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </script>\n</div>\n')}]),function(){"use strict";angular.module("gantt.bounds",["gantt","gantt.bounds.templates"]).directive("ganttBounds",["moment","$compile","$document",function(t,e,n){return{restrict:"E",require:"^gantt",scope:{enabled:"=?"},link:function(i,r,o,a){var s=a.gantt.api;if(i.options&&"object"==typeof i.options.bounds)for(var l in i.options.bounds)i[l]=i.options[l];void 0===i.enabled&&(i.enabled=!0),s.directives.on["new"](i,function(t,r,a){if("ganttTask"===t){var s=r.$new();s.pluginScope=i;var l=n[0].createElement("div");angular.element(l).attr("data-ng-if","task.model.est && task.model.lct && pluginScope.enabled");var u=n[0].createElement("gantt-task-bounds");void 0!==o.templateUrl&&angular.element(u).attr("data-template-url",o.templateUrl),void 0!==o.template&&angular.element(u).attr("data-template",o.template),angular.element(l).append(u),a.append(e(l)(s))}}),s.tasks.on.clean(i,function(e){void 0===e.est||t.isMoment(e.est)||(e.est=t(e.est)),void 0===e.lct||t.isMoment(e.lct)||(e.lct=t(e.lct))})}}}])}(),function(){"use strict";angular.module("gantt.dependencies",["gantt","gantt.dependencies.templates"]).directive("ganttDependencies",["$timeout","$document","ganttDebounce","GanttDependenciesManager","GanttDependenciesChecker",function(t,e,n,i,r){return{restrict:"E",require:"^gantt",scope:{enabled:"=?",readOnly:"=?",jsPlumbDefaults:"=?",endpoints:"=?",fallbackEndpoints:"=?",conflictChecker:"=?"},link:function(t,e,o,a){function s(){return angular.element('<span><span class="gantt-endpoint-overlay start-endpoint arrow-right"></span></span>')}function l(){return angular.element('<span><span class="gantt-endpoint-overlay end-endpoint arrow-right"></span></span>')}function u(){return angular.element('<span><span class="gantt-endpoint-overlay start-endpoint fallback-endpoint"></span></span>')}function c(){return angular.element('<span><span class="gantt-endpoint-overlay end-endpoint fallback-endpoint"></span></span>')}var d=a.gantt.api;if(t.options&&"object"==typeof t.options.dependencies)for(var h in t.options.dependencies)t[h]=t.options[h];void 0===t.enabled&&(t.enabled=!0),void 0===t.readOnly&&(t.readOnly=!1),void 0===t.jsPlumbDefaults&&(t.jsPlumbDefaults={Endpoint:["Dot",{radius:4}],EndpointStyle:{fillStyle:"#456",strokeStyle:"#456",lineWidth:1},Connector:"Flowchart",ConnectionOverlays:[["Arrow",{location:1,length:12,width:12}]]}),void 0===t.endpoints&&(t.endpoints=[{anchor:"Left",isSource:!1,isTarget:!0,maxConnections:-1,cssClass:"gantt-endpoint start-endpoint target-endpoint",overlays:[["Custom",{create:s}]]},{anchor:"Right",isSource:!0,isTarget:!1,maxConnections:-1,cssClass:"gantt-endpoint end-endpoint source-endpoint",overlays:[["Custom",{create:l}]]}]),void 0===t.fallbackEndpoints&&(t.fallbackEndpoints=[{endpoint:"Blank",anchor:"Left",isSource:!1,isTarget:!0,maxConnections:0,cssClass:"gantt-endpoint start-endpoint fallback-endpoint",overlays:[["Custom",{create:u}]]},{endpoint:"Blank",anchor:"Right",isSource:!0,isTarget:!1,maxConnections:0,cssClass:"gantt-endpoint end-endpoint fallback-endpoint",overlays:[["Custom",{create:c}]]}]),void 0===t.conflictChecker&&(t.conflictChecker=!1);var f=new i(a.gantt,t,d),p=new r(f,t,d);t.$watchGroup(["conflictChecker","enabled"],function(e,n){if(e!==n){for(var i=a.gantt.rowsManager.rows,r=[],o=0;o<i.length;o++)r.push.apply(r,i[o].tasks);t.conflictChecker&&t.enabled?p.refresh(r):p.clear(r)}}),d.directives.on["new"](t,function(t,e,n){"ganttBody"===t&&f.plumb.setContainer(n)}),d.tasks.on.add(t,function(t){f.addDependenciesFromTask(t)}),d.tasks.on.remove(t,function(t){f.removeDependenciesFromTask(t)}),d.tasks.on.displayed(t,n(function(e){f.setTasks(e),f.refresh(),t.conflictChecker&&t.enabled&&p.refresh(e)})),d.rows.on.displayed(t,function(){f.refresh()}),d.tasks.on.viewChange(t,function(e){e.$element&&f.plumb.revalidate(e.$element[0]),t.conflictChecker&&t.enabled&&p.refresh([e])}),d.tasks.on.viewRowChange(t,function(e){f.setTask(e),t.conflictChecker&&t.enabled&&p.refresh([e])}),d.dependencies.on.add(t,function(e){t.conflictChecker&&t.enabled&&p.refresh([e.getFromTask(),e.getToTask()])}),d.dependencies.on.change(t,function(e){t.conflictChecker&&t.enabled&&p.refresh([e.getFromTask(),e.getToTask()])}),d.dependencies.on.remove(t,function(e){t.conflictChecker&&t.enabled&&p.refresh([e.getFromTask(),e.getToTask()])})}}}])}(),function(){"use strict";angular.module("gantt.drawtask",["gantt"]).directive("ganttDrawTask",["$document","ganttMouseOffset","ganttUtils","moment",function(t,e,n,i){return{restrict:"E",require:"^gantt",scope:{enabled:"=?",moveThreshold:"=?",taskFactory:"=?"},link:function(r,o,a,s){var l=s.gantt.api;void 0===r.enabled&&(r.enabled=!0),void 0===r.moveThreshold&&(r.moveThreshold=0),void 0===r.taskFactory&&(r.taskFactory=function(){return{}}),l.registerEvent("tasks","draw"),l.registerEvent("tasks","drawBegin"),l.registerEvent("tasks","drawEnd");var u=function(t){return t.model.drawTask&&angular.isFunction(t.model.drawTask.taskFactory)?t.model.drawTask.taskFactory():r.taskFactory()};l.directives.on["new"](r,function(o,a,s){if("ganttRow"===o){var c=function(t){var e=l.core.getDateByPosition(t,!0),n=i(e),r=u(a.row);r.from=e,r.to=n;var o=a.row.addTask(r);return o.isResizing=!0,o.updatePosAndSize(),a.row.updateVisibleTasks(),a.row.$scope.$digest(),o},d=function(e){var n=function(){a.row.rowsManager.gantt.api.tasks.raise.draw(e)};a.row.rowsManager.gantt.api.tasks.raise.drawBegin(e),t.on("mousemove",n),t.one("mouseup",function(){a.row.rowsManager.gantt.api.tasks.raise.drawEnd(e),t.off("mousemove",n)})},h=function(n){var i=function(t){var o=e.getOffset(t).x;if(Math.abs(n-o)>=r.moveThreshold){s.off("mousemove",i);var a=c(n);d(a)}};s.on("mousemove",i),t.one("mouseup",function(){s.off("mousemove",i)})},f=function(t){var i=t.target?t.target:t.srcElement,o=a.row.model.drawTask;("boolean"==typeof o||angular.isFunction(o))&&(o={enabled:o});var s=n.firstProperty([o],"enabled",r.enabled),l=angular.isFunction(s)?s(t,a.row):s;if(l&&i.className.indexOf("gantt-row")>-1){var u=e.getOffset(t).x;if(0===r.moveThreshold){var f=c(u);d(f)}else h(u)}};s.on("mousedown",f),a.drawTaskHandler=f}}),l.directives.on.destroy(r,function(t,e,n){"ganttRow"===t&&(n.off("mousedown",e.drawTaskHandler),delete e.drawTaskHandler)})}}}])}(),function(){"use strict";angular.module("gantt.groups",["gantt","gantt.groups.templates"]).directive("ganttGroups",["ganttUtils","GanttHierarchy","$compile","$document",function(t,e,n,i){return{restrict:"E",require:"^gantt",scope:{enabled:"=?",display:"=?"},link:function(t,r,o,a){function s(){t.hierarchy.refresh(a.gantt.rowsManager.filteredRows)}var l=a.gantt.api;if(t.options&&"object"==typeof t.options.sortable)for(var u in t.options.sortable)t[u]=t.options[u];void 0===t.enabled&&(t.enabled=!0),void 0===t.display&&(t.display="group"),t.hierarchy=new e,a.gantt.api.registerMethod("groups","refresh",s,this),a.gantt.$scope.$watchCollection("gantt.rowsManager.filteredRows",function(){s()}),l.directives.on["new"](t,function(e,r,a){if("ganttRow"===e){
var s=r.$new();s.pluginScope=t;var l=i[0].createElement("div");angular.element(l).attr("data-ng-if","pluginScope.enabled");var u=i[0].createElement("gantt-task-group");void 0!==o.templateUrl&&angular.element(u).attr("data-template-url",o.templateUrl),void 0!==o.template&&angular.element(u).attr("data-template",o.template),angular.element(l).append(u),a.append(n(l)(s))}})}}}])}(),function(){"use strict";angular.module("gantt.labels",["gantt","gantt.labels.templates"]).directive("ganttLabels",["ganttUtils","$compile","$document","$log",function(t,e,n,i){return{restrict:"E",require:"^gantt",scope:{enabled:"=?",header:"=?"},link:function(t,r,o,a){function s(){for(var t=a.gantt.side.$element[0].getElementsByClassName("gantt-row-label"),e=0,n=0;n<t.length;n++){var i=t[n].children[0].offsetWidth;e=Math.max(e,i)}e>=0&&l.side.setWidth(e)}var l=a.gantt.api;if(i.warn("Angular Gantt Labels plugin is deprecated. Please use Table plugin instead."),t.options&&"object"==typeof t.options.sortable)for(var u in t.options.sortable)t[u]=t.options[u];void 0===t.enabled&&(t.enabled=!0),void 0===t.header&&(t.header="Name"),l.directives.on["new"](t,function(i,r,o){if("ganttSideContent"===i){var a=r.$new();a.pluginScope=t;var s=n[0].createElement("div");angular.element(s).attr("data-ng-if","pluginScope.enabled"),angular.element(s).addClass("side-element");var l=n[0].createElement("gantt-side-content-labels");angular.element(s).append(l),o.append(e(s)(a))}}),l.registerMethod("labels","fitSideWidth",s,this)}}}])}(),function(){"use strict";angular.module("gantt.movable",["gantt"]).directive("ganttMovable",["ganttMouseButton","ganttMouseOffset","ganttSmartEvent","ganttMovableOptions","ganttUtils","ganttDom","$window","$document","$timeout",function(t,e,n,i,r,o,a,s,l){return{restrict:"E",require:"^gantt",scope:{enabled:"=?",allowMoving:"=?",allowResizing:"=?",allowRowSwitching:"=?"},link:function(u,c,d,h){var f=h.gantt.api;if(u.options&&"object"==typeof u.options.movable)for(var p in u.options.movable)u[p]=u.options[p];i.initialize(u),f.registerEvent("tasks","move"),f.registerEvent("tasks","moveBegin"),f.registerEvent("tasks","moveEnd"),f.registerEvent("tasks","resize"),f.registerEvent("tasks","resizeBegin"),f.registerEvent("tasks","resizeEnd"),f.registerEvent("tasks","change");var m,g,v="ontouchstart"in a||a.DocumentTouch&&s[0]instanceof a.DocumentTouch,y="touchstart mousedown",b="touchmove mousemove",$="touchend mouseup",w=15,x=5,C=3,S=15,k=5;f.directives.on["new"](u,function(i,c,d){if("ganttTask"===i){var f,p=angular.element(a),D=c.row.rowsManager.gantt.body.$element,E=c.row.rowsManager.gantt.scroll.$element,_=!1,M=!1,T=c.task.getForegroundElement(),P=c.task.getContentElement(),A=function(n){n.preventDefault(),v&&(n=e.getTouch(n));var i=c.task.model.movable,o=c.task.row.model.movable;("boolean"==typeof i||angular.isFunction(i))&&(i={enabled:i}),("boolean"==typeof o||angular.isFunction(o))&&(o={enabled:o});var a=r.firstProperty([i,o],"enabled",u.enabled),s=angular.isFunction(a)?a(n,c.task):a;if(s){var l=e.getOffsetForElement(T[0],n).x,d=R(l);if(""!==d&&1===t.getButton(n)){var h=e.getOffsetForElement(D[0],n).x;H(d,h)}c.$digest()}};T.on(y,A),P.on(y,A);var j=function(t){var n=c.task.model.movable,i=c.task.row.model.movable;("boolean"==typeof n||angular.isFunction(n))&&(n={enabled:n}),("boolean"==typeof i||angular.isFunction(i))&&(i={enabled:i});var o=r.firstProperty([n,i],"enabled",u.enabled),a=angular.isFunction(o)?o(t,c.task):o;if(a&&!c.task.isMoving){var s=e.getOffsetForElement(T[0],t).x,l=R(s);""!==l&&"M"!==l?(T.css("cursor",L(l)),P.css("cursor",L(l))):(T.css("cursor",""),P.css("cursor",""))}};T.on("mousemove",j),P.on("mousemove",j);var O=function(t){c.task.isMoving&&!c.destroyed&&(N(),F(t),I(t))},F=function(t){var n=_,i=e.getOffsetForElement(D[0],t),a=i.x;c.task.mouseOffsetX=a;var l=c.task.row.rowsManager.gantt.options.value("taskOutOfRange"),d=c.task.model.movable,f=c.task.row.model.movable;if(("boolean"==typeof d||angular.isFunction(d))&&(d={enabled:d}),("boolean"==typeof f||angular.isFunction(f))&&(f={enabled:f}),"M"===c.task.moveMode){var p=r.firstProperty([d,f],"allowRowSwitching",u.allowRowSwitching);if(p){var g=E[0].getBoundingClientRect(),v=g.left+g.width/2,y=angular.element(s[0].querySelectorAll(".gantt-body"));y.css("pointer-events","auto");var b=o.findElementFromPoint(v,t.clientY,function(t){return angular.element(t).hasClass("gantt-row")});y.css("pointer-events","");for(var $,w=h.gantt.rowsManager.rows,x=0,C=w.length;C>x;x++)if(b===w[x].$element[0]){$=w[x];break}var S=c.task.row;void 0!==$&&S!==$&&($.moveTaskToRow(c.task,!0),_=!0)}var k=r.firstProperty([d,f],"allowMoving",u.allowMoving);k&&(a-=m,"truncate"!==l&&(0>a?a=0:a+c.task.width>=c.gantt.width&&(a=c.gantt.width-c.task.width)),c.task.moveTo(a,!0),c.$digest(),_&&c.row.rowsManager.gantt.api.tasks.raise.move(c.task),_=!0)}else"E"===c.task.moveMode?(a<=c.task.left&&(a=c.task.left,c.task.moveMode="W",V(L(c.task.moveMode))),"truncate"!==l&&a>=c.gantt.width&&(a=c.gantt.width),c.task.setTo(a,!0),c.$digest(),_&&c.row.rowsManager.gantt.api.tasks.raise.resize(c.task),_=!0):(a>c.task.left+c.task.width&&(a=c.task.left+c.task.width,c.task.moveMode="E",V(L(c.task.moveMode))),"truncate"!==l&&0>a&&(a=0),c.task.setFrom(a,!0),c.$digest(),_&&c.row.rowsManager.gantt.api.tasks.raise.resize(c.task),_=!0);if(!n&&_&&!M){var T=c.task.getBackgroundElement();"M"===c.task.moveMode?(T.addClass("gantt-task-moving"),c.row.rowsManager.gantt.api.tasks.raise.moveBegin(c.task)):(T.addClass("gantt-task-resizing"),c.row.rowsManager.gantt.api.tasks.raise.resizeBegin(c.task))}},I=function(t){var n=e.getOffsetForElement(D[0],t),i=E[0].scrollLeft,r=E[0].offsetWidth,o=E[0].scrollWidth,a=i+r,s=!1;n.x<g?i>0&&n.x<=i+k&&(n.x-=S,s=!0,c.row.rowsManager.gantt.api.scroll.left(S)):o>a&&n.x>=a-k&&(n.x+=S,s=!0,c.row.rowsManager.gantt.api.scroll.right(S)),s&&(f=l(function(){O(t)},100,!0))},N=function(){void 0!==f&&(l.cancel(f),f=void 0)},R=function(t){var e=0,n=c.task.model.movable,i=c.task.row.model.movable;"boolean"==typeof n&&(n={enabled:n}),"boolean"==typeof i&&(i={enabled:i});var o=r.firstProperty([n,i],"allowResizing",u.allowResizing),a=r.firstProperty([n,i],"allowRowSwitching",u.allowRowSwitching),s=r.firstProperty([n,i],"allowMoving",u.allowMoving);return o&&(e=T[0].offsetWidth<w?C:x),o&&t>T[0].offsetWidth-e?"E":o&&e>t?"W":(s||a)&&t>=e&&t<=T[0].offsetWidth-e?"M":""},L=function(t){switch(t){case"E":return"e-resize";case"W":return"w-resize";case"M":return"move"}},V=function(t){d.css("cursor",t),angular.element(s[0].body).css({"-moz-user-select":""===t?"":"-moz-none","-webkit-user-select":""===t?"":"none","-ms-user-select":""===t?"":"none","user-select":""===t?"":"none",cursor:t})},H=function(t,i){void 0===c.task.originalModel&&(c.task.originalRow=c.task.row,c.task.originalModel=c.task.model,c.task.model=angular.copy(c.task.originalModel)),M||(g=i,m=i-c.task.modelLeft),_=!1,c.task.moveMode=t,c.task.isMoving=!0,c.task.active=!0;var r=function(t){t.stopImmediatePropagation(),v&&(t=e.getTouch(t)),O(t)},o=n(c,p,b,r);o.bind(),n(c,p,$,function(t){v&&(t=e.getTouch(t)),o.unbind(),B(t),c.$digest()}).bindOnce(),V(L(t))},B=function(){var t=c.task.getBackgroundElement();if(t.removeClass("gantt-task-moving"),t.removeClass("gantt-task-resizing"),void 0!==c.task.originalModel){if(c.task.originalModel.from=c.task.model.from,c.task.originalModel.to=c.task.model.to,c.task.originalModel.lct=c.task.model.lct,c.task.originalModel.est=c.task.model.est,c.task.model=c.task.originalModel,c.task.row.model.id!==c.task.originalRow.model.id){var e=c.task.row;e.removeTask(c.task.model.id,!1,!0),c.task.row=c.task.originalRow,e.moveTaskToRow(c.task,!1)}delete c.task.originalModel,delete c.task.originalRow,c.$apply()}M=!1,c.task.isMoving=!1,c.task.active=!1,N(),V(""),_===!0&&("M"===c.task.moveMode?c.row.rowsManager.gantt.api.tasks.raise.moveEnd(c.task):c.row.rowsManager.gantt.api.tasks.raise.resizeEnd(c.task),_=!1,c.task.row.sortTasks(),c.row.rowsManager.gantt.api.tasks.raise.change(c.task)),c.task.moveMode=void 0};c.$on("$destroy",function(){c.destroyed=!0,N()}),c.task.isResizing?(M=!0,H("E",c.task.mouseOffsetX),delete c.task.isResizing):c.task.isMoving&&(M=!0,H("M",c.task.mouseOffsetX))}})}}}])}(),function(){"use strict";angular.module("gantt.overlap",["gantt","gantt.overlap.templates"]).directive("ganttOverlap",["moment","$timeout",function(t,e){return{restrict:"E",require:"^gantt",scope:{enabled:"=?",global:"=?"},link:function(n,i,r,o){function a(t){var e,n;return t.model.from.isBefore(t.model.to)?(e=t.model.from,n=t.model.to):(e=t.model.to,n=t.model.from),[e,n]}function s(e){var n=a(e);return t().range(n[0],n[1])}function l(t,e){e.model.id in t||!e.$element||(e.$element.addClass("gantt-task-overlaps"),t[e.model.id]=e)}function u(t,e){for(var n=0,i=e.length;i>n;n++){var r=e[n];r.model.id in t||!r.$element||r.$element.removeClass("gantt-task-overlaps")}}function c(t){var e={};if(t.length>1)for(var n=t[0],i=s(n),r=1,o=t.length;o>r;r++){var a=t[r],c=s(a);c.overlaps(i)&&(l(e,a),l(e,n)),n.left+n.width<a.left+a.width&&(n=a,i=c)}u(e,t)}function d(t,e){return t.sort(function(t,n){return e(t)<e(n)?-1:e(t)>e(n)?1:0})}function h(t){for(var e=[],n=0;n<t.length;n++)e.push.apply(e,t[n].tasks);e=d(e,function(t){return t.model.from}),c(e)}var f=o.gantt.api;void 0===n.enabled&&(n.enabled=!0),void 0===n.global&&(n.global=!1),n.enabled&&(f.data.on.change(n,function(){e(function(){var t=f.gantt.rowsManager.rows;if(n.global)h(t);else for(var e=0;e<t.length;e++)c(t[e].tasks)})}),f.tasks.on.change(n,function(t){if(n.global){var e=t.row.rowsManager.rows;h(e)}else c(t.row.tasks)}),f.tasks.on.rowChange(n,function(t,e){if(n.global){var i=e.rowsManager.rows;h(i)}else c(e.tasks)}),f.tasks.on.add(n,function(t){e(function(){if(n.global){var e=t.row.rowsManager.rows;h(e)}else c(t.row.tasks)})}))}}}])}(),function(){"use strict";angular.module("gantt.progress",["gantt","gantt.progress.templates"]).directive("ganttProgress",["moment","$compile","$document",function(t,e,n){return{restrict:"E",require:"^gantt",scope:{enabled:"=?"},link:function(i,r,o,a){var s=a.gantt.api;if(i.options&&"object"==typeof i.options.progress)for(var l in i.options.progress)i[l]=i.options[l];void 0===i.enabled&&(i.enabled=!0),s.directives.on["new"](i,function(t,r,a){if("ganttTaskBackground"===t){var s=r.$new();s.pluginScope=i;var l=n[0].createElement("div");angular.element(l).attr("data-ng-if","task.model.progress !== undefined && pluginScope.enabled");var u=n[0].createElement("gantt-task-progress");void 0!==o.templateUrl&&angular.element(u).attr("data-template-url",o.templateUrl),void 0!==o.template&&angular.element(u).attr("data-template",o.template),angular.element(l).append(u),a.append(e(l)(s))}}),s.tasks.on.clean(i,function(e){void 0===e.est||t.isMoment(e.est)||(e.est=t(e.est)),void 0===e.lct||t.isMoment(e.lct)||(e.lct=t(e.lct))})}}}])}(),function(){"use strict";angular.module("gantt.resizeSensor",["gantt"]).directive("ganttResizeSensor",[function(){return{restrict:"E",require:"^gantt",scope:{enabled:"=?"},link:function(t,e,n,i){function r(){var t=e.parent().parent().parent()[0].querySelectorAll("div.gantt")[0];return new ResizeSensor(t,function(){i.gantt.$scope.ganttElementWidth=t.clientWidth,i.gantt.$scope.$apply()})}var o=i.gantt.api;if(t.options&&"object"==typeof t.options.progress)for(var a in t.options.progress)t[a]=t.options[a];void 0===t.enabled&&(t.enabled=!0);var s,l=!1;o.core.on.rendered(t,function(){l=!0,void 0!==s&&s.detach(),t.enabled&&(ElementQueries.update(),s=r())}),t.$watch("enabled",function(t){l&&(t&&void 0===s?(ElementQueries.update(),s=r()):t||void 0===s||(s.detach(),s=void 0))})}}}])}(),function(){"use strict";for(var t,e="gantt.sortable",n="ganttSortable",i=["gantt",{module:"ang-drag-drop",url:"https://github.com/ganarajpr/angular-dragdrop.git#master"}],r=[],o=[],a=0,s=i.length;s>a;a++){var l=i[a];try{angular.isString(l)&&(l={module:l},i[a]=l),angular.module(l.module),o.push(l.module)}catch(u){l.exception=u,r.push(l)}}r.length>0?angular.module(e,[]).directive(n,["$log",function(i){return{restrict:"E",require:"^gantt",scope:{enabled:"=?"},link:function(){i.warn(e+" module can't require some dependencies:");for(var o=0,a=r.length;a>o;o++){t=r[o];var s=t.module;t.url&&(s+=" ("+t.url+")"),t.exception&&t.exception.message&&(s+=": "+t.exception.message),i.warn(s)}i.warn(n+" plugin directive won't be available")}}}]):angular.module(e,o).directive(n,["ganttUtils","$compile",function(t,e){return{restrict:"E",require:"^gantt",scope:{enabled:"=?"},link:function(n,i,r,o){var a=o.gantt.api;if(n.options&&"object"==typeof n.options.sortable)for(var s in n.options.sortable)n[s]=n.options[s];void 0===n.enabled&&(n.enabled=!0),a.directives.on["new"](n,function(i,r,o){"ganttRowLabel"===i&&void 0===o.attr("drag")&&(r.checkDraggable=function(){var e=r.row.model.sortable;return"boolean"==typeof e&&(e={enabled:e}),t.firstProperty([e],"enabled",n.enabled)},r.onDropSuccess=function(){r.$evalAsync()},r.onDrop=function(t,e){var n=r.row.rowsManager.rowsMap[e.id];n!==r&&(r.row.rowsManager.moveRow(n,r.row),r.$evalAsync())},o.attr("ui-draggable","{{checkDraggable()}}"),o.attr("drag-channel","'sortable'"),o.attr("ui-on-drop","onDrop($event, $data)"),o.attr("on-drop-success","onDropSuccess()"),o.attr("drop-channel","'sortable'"),o.attr("drag","row.model"),e(o)(r))})}}}])}(),function(){"use strict";angular.module("gantt.table",["gantt","gantt.table.templates"]).directive("ganttTable",["ganttUtils","$compile","$document",function(t,e,n){return{restrict:"E",require:"^gantt",scope:{enabled:"=?",columns:"=?",headers:"=?",classes:"=?",contents:"=?",headerContents:"=?",formatters:"=?",headerFormatter:"=?"},link:function(t,i,r,o){var a=o.gantt.api;if(t.options&&"object"==typeof t.options.sortable)for(var s in t.options.sortable)t[s]=t.options[s];void 0===t.enabled&&(t.enabled=!0),void 0===t.columns&&(t.columns=["model.name"]),void 0===t.headers&&(t.headers={"model.name":"Name"}),void 0===t.contents&&(t.contents={}),void 0===t.headerContents&&(t.headerContents={}),void 0===t.classes&&(t.classes={}),void 0===t.formatters&&(t.formatters={}),a.directives.on["new"](t,function(i,r,o){if("ganttSideContent"===i){var a=r.$new();a.pluginScope=t;var s=n[0].createElement("div");angular.element(s).attr("data-ng-if","pluginScope.enabled"),angular.element(s).addClass("side-element");var l=n[0].createElement("gantt-side-content-table");angular.element(s).append(l),o.append(e(s)(a))}})}}}])}(),function(){"use strict";angular.module("gantt.tooltips",["gantt","gantt.tooltips.templates"]).directive("ganttTooltips",["$compile","$document",function(t,e){return{restrict:"E",require:"^gantt",scope:{enabled:"=?",dateFormat:"=?",content:"=?",delay:"=?"},link:function(n,i,r,o){var a=o.gantt.api;if(n.options&&"object"==typeof n.options.tooltips)for(var s in n.options.tooltips)n[s]=n.options[s];void 0===n.enabled&&(n.enabled=!0),void 0===n.dateFormat&&(n.dateFormat="MMM DD, HH:mm"),void 0===n.delay&&(n.delay=500),void 0===n.content&&(n.content="{{task.model.name}}</br><small>{{task.isMilestone() === true && getFromLabel() || getFromLabel() + ' - ' + getToLabel()}}</small>"),n.api=a,a.directives.on["new"](n,function(i,o,a){if("ganttTask"===i){var s=o.$new();s.pluginScope=n;var l=e[0].createElement("div");angular.element(l).attr("data-ng-if","pluginScope.enabled");var u=e[0].createElement("gantt-tooltip");void 0!==r.templateUrl&&angular.element(u).attr("data-template-url",r.templateUrl),void 0!==r.template&&angular.element(u).attr("data-template",r.template),angular.element(l).append(u),a.append(t(l)(s))}})}}}])}(),function(){"use strict";angular.module("gantt.tree",["gantt","gantt.tree.templates","ui.tree"]).directive("ganttTree",["ganttUtils","$compile","$document",function(t,e,n){return{restrict:"E",require:"^gantt",scope:{enabled:"=?",header:"=?",content:"=?",headerContent:"=?",keepAncestorOnFilterRow:"=?"},link:function(t,i,r,o){var a=o.gantt.api;if(t.options&&"object"==typeof t.options.sortable)for(var s in t.options.sortable)t[s]=t.options[s];void 0===t.enabled&&(t.enabled=!0),void 0===t.header&&(t.header="Name"),void 0===t.headerContent&&(t.headerContent="{{getHeader()}}"),void 0===t.keepAncestorOnFilterRow&&(t.keepAncestorOnFilterRow=!1),a.directives.on["new"](t,function(i,r,o){if("ganttSideContent"===i){var a=r.$new();a.pluginScope=t;var s=n[0].createElement("div");angular.element(s).attr("data-ng-if","pluginScope.enabled"),angular.element(s).addClass("side-element");var l=n[0].createElement("gantt-side-content-tree");angular.element(s).append(l),o.append(e(s)(a))}})}}}])}(),function(){"use strict";angular.module("gantt.bounds").directive("ganttTaskBounds",["$templateCache","moment",function(t,e){return{restrict:"E",templateUrl:function(e,n){var i;return i=void 0===n.templateUrl?"plugins/bounds/taskBounds.tmpl.html":n.templateUrl,n.template&&t.put(i,n.template),i},replace:!0,scope:!0,controller:["$scope","$element",function(t,n){n.toggleClass("ng-hide",!0),t.simplifyMoment=function(t){return e.isMoment(t)?t.unix():t},t.$watchGroup(["simplifyMoment(task.model.est)","simplifyMoment(task.model.lct)","task.left","task.width"],function(){var e=t.task.rowsManager.gantt.getPositionByDate(t.task.model.est),i=t.task.rowsManager.gantt.getPositionByDate(t.task.model.lct);n.css("left",e-t.task.left+"px"),n.css("width",i-e+"px"),n.toggleClass("gantt-task-bounds-in",!1),n.toggleClass("gantt-task-bounds-out",!1),void 0===t.task.model.est||void 0===t.task.model.lct?n.toggleClass("gantt-task-bounds-in",!0):t.task.model.est>t.task.model.from?n.toggleClass("gantt-task-bounds-out",!0):t.task.model.lct<t.task.model.to?n.toggleClass("gantt-task-bounds-out",!0):n.toggleClass("gantt-task-bounds-in",!0)}),t.task.$element.bind("mouseenter",function(){n.toggleClass("ng-hide",!1)}),t.task.$element.bind("mouseleave",function(){n.toggleClass("ng-hide",!0)}),t.task.rowsManager.gantt.api.directives.raise["new"]("ganttBounds",t,n),t.$on("$destroy",function(){t.task.rowsManager.gantt.api.directives.raise.destroy("ganttBounds",t,n)})}]}}])}(),function(){"use strict";angular.module("gantt.dependencies").factory("GanttDependenciesChecker",[function(){var t=function(t){function e(t,e){e.model.id in t||!e.$element||(e.$element.addClass("gantt-task-conflict"),t[e.model.id]=e)}function n(t,e){for(var n=0,i=e.length;i>n;n++){var r=e[n];r.model.id in t||!r.$element||r.$element.removeClass("gantt-task-conflict")}}this.refresh=function(i){for(var r=i.slice(0),o=[],a=0;a<i.length;a++)for(var s=t.getTaskDependencies(i[a]),l=0;l<s.length;l++){var u=s[l],c=u.getFromTask(),d=u.getToTask();c in r||r.push(c),d in r||r.push(d),c.model.to>d.model.from&&(e(o,c),e(o,d))}n(o,r)},this.clear=function(t){var e=t.slice(0);n([],e)}};return t}])}(),function(){"use strict";angular.module("gantt.dependencies").factory("GanttDependenciesEvents",[function(){var t=function(t){var e=this;this.manager=t;var n=function(){return!e.manager.pluginScope.readOnly};this.manager.plumb.bind("beforeDrag",n),this.manager.plumb.bind("beforeStartDetach",n);var i=function(t){return t.sourceId!==t.targetId};this.manager.plumb.bind("beforeDrop",i),this.manager.plumb.bind("connectionDrag",function(t){e.manager.setDraggingConnection(t)}),this.manager.plumb.bind("connectionDragStop",function(){e.manager.setDraggingConnection(void 0)}),this.manager.plumb.bind("beforeDrop",function(){return e.manager.setDraggingConnection(void 0),!0});var r=function(t,n){if(n){var i;t.connection.$dependency&&(i=t.connection.$dependency);var r=t.sourceEndpoint,o=t.targetEndpoint,a=r.$task.model,s=a.dependencies;void 0===s&&(s=[],a.dependencies=s);var l={to:o.$task.model.id};s.push(l),i&&(i.removeFromTaskModel(),e.manager.removeDependency(i,!0));var u=e.manager.addDependency(r.$task,l);t.connection.$dependency=u,u.connection=t.connection,e.manager.api.dependencies.raise.add(u)}},o=function(t,n){if(n){var i;t.connection.$dependency&&(i=t.connection.$dependency);var r=t.newSourceEndpoint,o=t.newTargetEndpoint,a=r.$task.model,s=a.dependencies;void 0===s&&(s=[],a.dependencies=s);var l={to:o.$task.model.id};s.push(l),i&&(i.removeFromTaskModel(),e.manager.removeDependency(i,!0));var u=e.manager.addDependency(r.$task,l);t.connection.$dependency=u,u.connection=t.connection,e.manager.api.dependencies.raise.change(u,i)}},a=function(t,n){if(n){var i=t.connection.$dependency;i.removeFromTaskModel(),e.manager.removeDependency(i,!0),e.manager.api.dependencies.raise.remove(i)}};this.manager.plumb.bind("connectionMoved",o),this.manager.plumb.bind("connection",r),this.manager.plumb.bind("connectionDetached",a)};return t}])}(),function(){"use strict";angular.module("gantt.dependencies").factory("GanttDependenciesManager",["GanttDependency","GanttDependenciesEvents","GanttDependencyTaskMouseHandler",function(t,e,n){var i=function(i,r,o){var a=this;this.gantt=i,this.pluginScope=r,this.api=o,this.api.registerEvent("dependencies","add"),this.api.registerEvent("dependencies","change"),this.api.registerEvent("dependencies","remove"),this.plumb=jsPlumb.getInstance(),this.plumb.importDefaults(this.pluginScope.jsPlumbDefaults),this.dependenciesFrom={},this.dependenciesTo={},this.tasksList=[],this.tasks={},this.events=new e(this),this.pluginScope.$watch("enabled",function(t,e){t!==e&&a.refresh()}),this.pluginScope.$watch("readOnly",function(t,e){t!==e&&(a.setTasks(a.tasksList),a.refresh())}),this.pluginScope.$watch("jsPlumbDefaults",function(t,e){t!==e&&(a.plumb.importDefaults(t),a.refresh())},!0),this.addDependenciesFromTask=function(t){if(this.pluginScope.enabled){var e=t.model.dependencies;if(void 0!==e&&e){angular.isArray(e)||(e=[e],t.model.dependencies=e);for(var n=0,i=e.length;i>n;n++){var r=a.addDependency(t,e[n]);r.connect()}}}},this.removeDependenciesFromTask=function(t,e){var n=this.getTaskDependencies(t);if(n)for(var i=0;i<n.length;i++)e||n[i].disconnect(),a.removeDependency(n[i])},this.addDependency=function(e,n){var i=new t(this,e,n),r=i.getFromTaskId(),o=i.getToTaskId();return r in this.dependenciesFrom||(this.dependenciesFrom[r]=[]),o in this.dependenciesTo||(this.dependenciesTo[o]=[]),r&&this.dependenciesFrom[r].push(i),o&&this.dependenciesTo[o].push(i),i},this.removeDependency=function(t,e){var n,i=this.dependenciesFrom[t.getFromTaskId()],r=[];if(i)for(n=0;n<i.length;n++)t===i[n]&&r.push(t);var o=this.dependenciesTo[t.getToTaskId()],a=[];if(o)for(n=0;n<o.length;n++)t===o[n]&&a.push(t);for(n=0;n<r.length;n++)e||r[n].disconnect(),i.splice(i.indexOf(t),1);for(n=0;n<a.length;n++)e||a[n].disconnect(),o.splice(o.indexOf(t),1);this.dependenciesFrom[t.getFromTaskId()]&&0===this.dependenciesFrom[t.getFromTaskId()].length&&delete this.dependenciesFrom[t.getFromTaskId()],this.dependenciesTo[t.getToTaskId()]&&0===this.dependenciesTo[t.getToTaskId()].length&&delete this.dependenciesTo[t.getToTaskId()]},this.getTaskDependencies=function(t){var e=[],n=a.dependenciesFrom[t.model.id];n&&(e=e.concat(n));var i=a.dependenciesTo[t.model.id];return i&&(e=e.concat(i)),e},this.setDraggingConnection=function(t){t?(a.draggingConnection=t,angular.forEach(a.tasks,function(t){t.dependencies.mouseHandler.release()})):(a.draggingConnection=void 0,angular.forEach(a.tasks,function(t){t.dependencies.mouseHandler.install()}))};var s=function(t){var e=t.row.model.dependencies;if(void 0!==e)return e!==!1;var n=t.model.dependencies;return void 0!==n?n!==!1:!0},l=function(t){if(t.dependencies||(t.dependencies={}),t.dependencies.endpoints=[],a.pluginScope.endpoints&&t.$element)for(var e=0;e<a.pluginScope.endpoints.length;e++){var n=a.plumb.addEndpoint(t.$element,a.pluginScope.endpoints[e]);n.setVisible(!1,!0,!0),n.$task=t,t.dependencies.endpoints.push(n)}},u=function(t){if(t.dependencies.endpoints){for(var e=0;e<t.dependencies.endpoints.length;e++){var n=t.dependencies.endpoints[e];a.plumb.deleteEndpoint(n),n.$task=void 0}t.dependencies.endpoints=void 0}},c=function(t){t.dependencies||(t.dependencies={}),a.pluginScope.readOnly||(t.dependencies.mouseHandler=new n(a,t),t.dependencies.mouseHandler.install())},d=function(t){t.dependencies.mouseHandler&&(t.dependencies.mouseHandler.release(),t.dependencies.mouseHandler=void 0)};this.setTasks=function(t){angular.forEach(a.tasks,function(t){d(t),u(t)});for(var e={},n=[],i=0;i<t.length;i++){var r=t[i];s(r)&&(e[r.model.id]=r,n.push(r),l(r),c(r))}a.tasks=e,a.tasksList=t};var h=function(t){var e=a.getTaskDependencies(t);if(e)for(var n=0;n<e.length;n++)e[n].disconnect();return e},f=function(t){var e=a.getTaskDependencies(t);if(e)for(var n=0;n<e.length;n++)e[n].connect();return e};this.setTask=function(t){a.plumb.setSuspendDrawing(!0);try{var e=a.tasks[t.model.id];void 0!==e&&(h(e),d(e),u(e)),s(t)&&(a.tasks[t.model.id]=t,l(t),c(t),f(t))}finally{a.plumb.setSuspendDrawing(!1,!0)}},this.getTask=function(t){return a.tasks[t]};var p=function(t){return t.dependencies.endpoints.filter(function(t){return t.isSource})},m=function(t){return t.dependencies.endpoints.filter(function(t){return t.isTarget})};this.connect=function(t,e,n){var i=p(t),r=m(e);if(i&&r){var o,s;o=n.connectParameters&&n.connectParameters.sourceEndpointIndex?i[n.connectParameters.sourceEndpointIndex]:i[0],s=n.connectParameters&&n.connectParameters.targetEndpointIndex?r[n.connectParameters.targetEndpointIndex]:r[0];var l=a.plumb.connect({source:o,target:s},n.connectParameters);return l}},this.getDependencies=function(){var t=[];return angular.forEach(this.dependenciesFrom,function(e){for(var n=0;n<e.length;n++)e[n]in t||t.push(e[n])}),t},this.refresh=function(t){a.plumb.setSuspendDrawing(!0);try{var e,n;t&&!angular.isArray(t)&&(t=[t]),void 0===t?(t=this.tasks,e=this.getDependencies()):(e=[],angular.forEach(t,function(t){var n=a.getTaskDependencies(t);angular.forEach(n,function(t){t in e||e.push(t)})}));for(n=0;n<e.length;n++)a.removeDependency(e[n]);angular.forEach(t,function(t){a.addDependenciesFromTask(t)})}finally{a.plumb.setSuspendDrawing(!1,!0)}},this.api.registerMethod("dependencies","refresh",this.refresh,this)};return i}])}(),function(){"use strict";angular.module("gantt.dependencies").factory("GanttDependency",["ganttUtils","ganttDom",function(t,e){var n=function(n,i,r){var o=this;this.manager=n,this.task=i,this.model=r,this.connection=void 0,this.fallbackEndpoints=[],this.isConnected=function(){return!!this.connection},this.disconnect=function(){this.connection&&(this.connection.endpoints&&this.manager.plumb.detach(this.connection),this.connection.$dependency=void 0,this.connection=void 0),this.deleteFallbackEndpoints()},this.deleteFallbackEndpoints=function(){if(this.fallbackEndpoints){for(var t=0;t<this.fallbackEndpoints.length;t++)o.manager.plumb.deleteEndpoint(this.fallbackEndpoints[t]);this.fallbackEndpoints=[]}},this.getFromTaskId=function(){return void 0!==this.model.from?this.model.from:this.task.model.id},this.getToTaskId=function(){return void 0!==this.model.to?this.model.to:this.task.model.id},this.getFromTask=function(){return void 0!==this.model.from?this.manager.getTask(this.model.from):this.task},this.getToTask=function(){return void 0!==this.model.to?this.manager.getTask(this.model.to):this.task},this.removeFromTaskModel=function(){var e=t.angularIndexOf(this.task.model.dependencies,this.model);return e>=0&&this.task.model.dependencies.splice(e,1),e};var a=function(t){if(void 0===t||void 0===t.$element)return!1;var n=t.$element[0];return e.isElementVisible(n)};this.connect=function(){var t=this.getFromTask(),e=this.getToTask();if(a(t)||(t=void 0),a(e)||(e=void 0),t&&e){var n=this.manager.connect(t,e,this.model);if(n)return n.$dependency=this,this.connection=n,!0}if(this.deleteFallbackEndpoints(),void 0!==t){var i=this.manager.pluginScope.fallbackEndpoints[1];this.fallbackEndpoints.push(this.manager.plumb.addEndpoint(t.$element,i))}if(void 0!==e){var r=this.manager.pluginScope.fallbackEndpoints[0];this.fallbackEndpoints.push(this.manager.plumb.addEndpoint(e.$element,r))}return!1}};return n}])}(),function(){"use strict";angular.module("gantt.dependencies").factory("GanttDependencyTaskMouseHandler",["$timeout",function(t){var e=function(e,n){var i=this;this.manager=e,this.task=n,this.installed=!1,this.elementHandlers=[],this.display=!0,this.hideEndpointsPromise=void 0;var r=function(e){this.element=e,this.mouseExitHandler=function(){t.cancel(i.hideEndpointsPromise),i.hideEndpointsPromise=t(i.hideEndpoints,1e3,!1)},this.mouseEnterHandler=function(){t.cancel(i.hideEndpointsPromise),i.displayEndpoints()},this.install=function(){this.element.bind("mouseenter",this.mouseEnterHandler),this.element.bind("mouseleave",this.mouseExitHandler)},this.release=function(){this.element.unbind("mouseenter",this.mouseEnterHandler),this.element.unbind("mouseleave",this.mouseExitHandler),t.cancel(i.hideEndpointsPromise)}};this.install=function(){i.installed||(i.hideEndpoints(),i.task.getContentElement()&&(i.elementHandlers.push(new r(i.task.getContentElement())),angular.forEach(i.task.dependencies.endpoints,function(t){i.elementHandlers.push(new r(angular.element(t.canvas)))}),angular.forEach(i.elementHandlers,function(t){t.install()}),i.installed=!0))},this.release=function(){i.installed&&(angular.forEach(i.elementHandlers,function(t){t.release()}),i.elementHandlers=[],i.displayEndpoints(),i.installed=!1)},this.displayEndpoints=function(){i.display=!0,angular.forEach(i.task.dependencies.endpoints,function(t){t.setVisible(!0,!0,!0)})},this.hideEndpoints=function(){angular.forEach(i.task.dependencies.endpoints,function(t){t.setVisible(!1,!0,!0)}),i.display=!1}};return e}])}(),function(){"use strict";angular.module("gantt.groups").controller("GanttGroupController",["$scope","GanttTaskGroup","ganttUtils",function(t,e,n){var i=function(){var i=t.row.model.groups;"boolean"==typeof i&&(i={enabled:i});var r=n.firstProperty([i],"enabled",t.pluginScope.enabled);r?(t.display=n.firstProperty([i],"display",t.pluginScope.display),t.taskGroup=new e(t.row,t.pluginScope),t.row.setFromTo(),t.row.setFromToByValues(t.taskGroup.from,t.taskGroup.to)):(t.taskGroup=void 0,t.display=void 0)};t.gantt.api.tasks.on.viewChange(t,function(e){if(void 0!==t.taskGroup)if(t.taskGroup.tasks.indexOf(e)>-1)i(),t.$$phase||t.$root.$$phase||t.$digest();else{var n=t.pluginScope.hierarchy.descendants(t.row);n.indexOf(e.row)>-1&&(i(),t.$$phase||t.$root.$$phase||t.$digest())}});var r=t.pluginScope.$watch("display",i);t.$watchCollection("gantt.rowsManager.filteredRows",i),t.gantt.api.columns.on.refresh(t,i),t.$on("$destroy",r)}])}(),function(){"use strict";angular.module("gantt.groups").directive("ganttTaskGroup",["GanttDirectiveBuilder",function(t){var e=new t("ganttTaskGroup","plugins/groups/taskGroup.tmpl.html");return e.build()}])}(),function(){"use strict";angular.module("gantt").factory("GanttTaskGroup",["ganttUtils","GanttTask",function(t,e){var n=function(n,i){var r=this;r.row=n,r.pluginScope=i,r.descendants=r.pluginScope.hierarchy.descendants(r.row),r.tasks=[],r.overviewTasks=[],r.promotedTasks=[],r.showGrouping=!1;var o=r.row.model.groups;"boolean"==typeof o&&(o={enabled:o});for(var a=function(e){var n=e.model.groups;"boolean"==typeof n&&(n={enabled:n});var i=e.row.model.groups;"boolean"==typeof i&&(i={enabled:i});var a=t.firstProperty([n,i,o],"enabled",r.pluginScope.enabled);if(a){var s=t.firstProperty([n,i,o],"display",r.pluginScope.display);return s}},s=0;s<r.descendants.length;s++)for(var l=r.descendants[s].tasks,u=0;u<l.length;u++){var c=l[u],d=a(c);if(void 0!==d){r.tasks.push(c);var h=new e(r.row,c.model);"overview"===d?r.overviewTasks.push(h):"promote"===d?r.promotedTasks.push(h):r.showGrouping=!0}}if(r.from=void 0,o&&(r.from=o.from),void 0===r.from)for(s=0;s<r.tasks.length;s++)(void 0===r.from||r.tasks[s].model.from<r.from)&&(r.from=r.tasks[s].model.from);if(r.to=void 0,o&&(r.to=o.to),void 0===r.to)for(s=0;s<r.tasks.length;s++)(void 0===r.to||r.tasks[s].model.to>r.to)&&(r.to=r.tasks[s].model.to);r.showGrouping&&(r.left=n.rowsManager.gantt.getPositionByDate(r.from),r.width=n.rowsManager.gantt.getPositionByDate(r.to)-r.left)};return n}])}(),function(){"use strict";angular.module("gantt").directive("ganttTaskOverview",["GanttDirectiveBuilder",function(t){
var e=new t("ganttTaskOverview","plugins/groups/taskOverview.tmpl.html");return e.controller=function(t,e){t.task.$element=e,t.task.$scope=t,t.task.updatePosAndSize()},e.build()}])}(),function(){"use strict";angular.module("gantt.labels").directive("ganttLabelsBody",["GanttDirectiveBuilder","ganttLayout",function(t,e){var n=new t("ganttLabelsBody","plugins/labels/labelsBody.tmpl.html");return n.controller=function(t){var n=e.getScrollBarHeight();t.getLabelsCss=function(){var e={};if(t.maxHeight){var i=t.gantt.scroll.isHScrollbarVisible()?n:0;e["max-height"]=t.maxHeight-i-t.gantt.header.getHeight()+"px"}return e}},n.build()}])}(),function(){"use strict";angular.module("gantt.labels").directive("ganttLabelsHeader",["GanttDirectiveBuilder",function(t){var e=new t("ganttLabelsHeader","plugins/labels/labelsHeader.tmpl.html");return e.build()}])}(),function(){"use strict";angular.module("gantt.labels").directive("ganttSideContentLabels",["GanttDirectiveBuilder",function(t){var e=new t("ganttSideContentLabels","plugins/labels/sideContentLabels.tmpl.html");return e.build()}])}(),function(){"use strict";angular.module("gantt.movable").factory("ganttMovableOptions",[function(){return{initialize:function(t){return t.enabled=void 0!==t.enabled?t.enabled:!0,t.allowMoving=void 0!==t.allowMoving?!!t.allowMoving:!0,t.allowResizing=void 0!==t.allowResizing?!!t.allowResizing:!0,t.allowRowSwitching=void 0!==t.allowRowSwitching?!!t.allowRowSwitching:!0,t}}}])}(),function(){"use strict";angular.module("gantt.progress").directive("ganttTaskProgress",["$templateCache",function(t){return{restrict:"E",requires:"^ganttTask",templateUrl:function(e,n){var i;return i=void 0===n.templateUrl?"plugins/progress/taskProgress.tmpl.html":n.templateUrl,void 0!==n.template&&t.put(i,n.template),i},replace:!0,scope:!0,controller:["$scope","$element",function(t,e){t.getClasses=function(){var e=[];return"object"==typeof t.task.model.progress&&(e=t.task.model.progress.classes),e},t.getCss=function(){var e,n={};return void 0!==t.task.model.progress&&(e="object"==typeof t.task.model.progress?t.task.model.progress:{percent:t.task.model.progress}),e&&(e.color?n["background-color"]=e.color:n["background-color"]="#6BC443",n.width=e.percent+"%"),n},t.task.rowsManager.gantt.api.directives.raise["new"]("ganttTaskProgress",t,e),t.$on("$destroy",function(){t.task.rowsManager.gantt.api.directives.raise.destroy("ganttTaskProgress",t,e)})}]}}])}(),function(){"use strict";angular.module("gantt.table").directive("ganttSideContentTable",["GanttDirectiveBuilder","ganttLayout",function(t,e){var n=new t("ganttSideContentTable","plugins/table/sideContentTable.tmpl.html");return n.controller=function(t){var n=e.getScrollBarHeight();t.getMaxHeightCss=function(){var e={};if(t.maxHeight){var i=t.gantt.scroll.isHScrollbarVisible()?n:0;e["max-height"]=t.maxHeight-i-t.gantt.header.getHeight()+"px"}return e}},n.build()}])}(),function(){"use strict";angular.module("gantt.table").controller("TableColumnController",["$scope",function(t){t.getHeader=function(){var e=t.pluginScope.headers[t.column];return void 0!==e?e:(void 0!==t.pluginScope.headerFormatter&&(e=t.pluginScope.headerFormatter(t.column)),void 0!==e?e:e)},t.getHeaderContent=function(){var e=t.pluginScope.headerContents[t.column];return void 0===e?"{{getHeader()}}":e},t.getClass=function(){return t.pluginScope.classes[t.column]}}])}(),function(){"use strict";angular.module("gantt.table").controller("TableColumnRowController",["$scope",function(t){t.getValue=function(){var e=t.$eval(t.column,t.row),n=t.pluginScope.formatters[t.column];return void 0!==n&&(e=n(e,t.column,t.row)),e},t.getRowContent=function(){var e;return t.row.model.columnContents&&(e=t.row.model.columnContents[t.column]),void 0===e&&"model.name"===t.column&&(e=t.row.model.content),void 0===e&&(e=t.pluginScope.contents[t.column]),void 0===e&&"model.name"===t.column&&(e=t.row.rowsManager.gantt.options.value("rowContent")),void 0===e&&void 0!==t.pluginScope.content&&(e=t.pluginScope.content),void 0===e?"{{getValue()}}":e}}])}(),function(){"use strict";angular.module("gantt.tooltips").directive("ganttTooltip",["$log","$timeout","$compile","$document","$templateCache","ganttDebounce","ganttSmartEvent",function(t,e,n,i,r,o,a){return{restrict:"E",templateUrl:function(t,e){var n;return n=void 0===e.templateUrl?"plugins/tooltips/tooltip.tmpl.html":e.templateUrl,void 0!==e.template&&r.put(n,e.template),n},scope:!0,replace:!0,controller:["$scope","$element","ganttUtils",function(t,n,r){var s,l,u,c=angular.element(i[0].body),d=t.task.$element,h=!1,f=function(){var t=i[0];return t.documentElement.clientWidth||t.documentElement.getElementById("body")[0].clientWidth},p=function(e){e+n[0].offsetWidth>f()?(n.css("left",e+20-n[0].offsetWidth+"px"),t.isRightAligned=!0):(n.css("left",e-20+"px"),t.isRightAligned=!1)},m=function(e){h=!0,u.bind(),t.displayed=!0,t.$evalAsync(function(){var i;n.hasClass("ng-hide")&&(n.removeClass("ng-hide"),i=!0),t.elementHeight=n[0].offsetHeight,i&&n.addClass("ng-hide"),t.taskRect=d[0].getBoundingClientRect(),p(e)})},g=function(){h=!1,u.unbind(),t.$evalAsync(function(){t.displayed=!1})},v=function(n,i){s&&e.cancel(s);var o=t.task.model.tooltips,a=t.task.row.model.tooltips;"boolean"==typeof o&&(o={enabled:o}),"boolean"==typeof a&&(a={enabled:a});var u=r.firstProperty([o,a],"enabled",t.pluginScope.enabled);u&&!h&&void 0!==l&&n?i?s=e(function(){m(l)},t.pluginScope.delay,!1):m(l):n||t.task.active||g()};u=a(t,c,"mousemove",o(function(e){h?((!t.taskRect||e.clientX<t.taskRect.left||e.clientX>t.taskRect.right||e.clientY>t.taskRect.bottom||e.clientY<t.taskRect.top)&&v(!1,!1),p(e.clientX)):(l=e.clientX,v(!0,!1))},5,!1)),t.getFromLabel=function(){var e=t.task.model.tooltips,n=t.task.row.model.tooltips;"boolean"==typeof e&&(e={enabled:e}),"boolean"==typeof n&&(n={enabled:n});var i=r.firstProperty([e,n],"dateFormat",t.pluginScope.dateFormat);return t.task.model.from.format(i)},t.getToLabel=function(){var e=t.task.model.tooltips,n=t.task.row.model.tooltips;"boolean"==typeof e&&(e={enabled:e}),"boolean"==typeof n&&(n={enabled:n});var i=r.firstProperty([e,n],"dateFormat",t.pluginScope.dateFormat);return t.task.model.to.format(i)},t.task.getContentElement().bind("mousemove",function(t){l=t.clientX}),t.task.getContentElement().bind("mouseenter",function(t){l=t.clientX,v(!0,!0)}),t.task.getContentElement().bind("mouseleave",function(){v(!1)}),t.pluginScope.api.tasks.on.moveBegin&&(t.pluginScope.api.tasks.on.moveBegin(t,function(e){e===t.task&&v(!0)}),t.pluginScope.api.tasks.on.moveEnd(t,function(e){e===t.task&&v(!1)}),t.pluginScope.api.tasks.on.resizeBegin(t,function(e){e===t.task&&v(!0)}),t.pluginScope.api.tasks.on.resizeEnd(t,function(e){e===t.task&&v(!1)})),t.task.isMoving&&v(!0,!1),t.gantt.api.directives.raise["new"]("ganttTooltip",t,n),t.$on("$destroy",function(){t.gantt.api.directives.raise.destroy("ganttTooltip",t,n)})}]}}])}(),function(){"use strict";angular.module("gantt.tree").directive("ganttRowTreeLabel",["GanttDirectiveBuilder",function(t){var e=new t("ganttRowTreeLabel");return e.restrict="A",e.templateUrl=void 0,e.build()}])}(),function(){"use strict";angular.module("gantt.tree").directive("ganttSideContentTree",["GanttDirectiveBuilder",function(t){var e=new t("ganttSideContentTree","plugins/tree/sideContentTree.tmpl.html");return e.build()}])}(),function(){"use strict";angular.module("gantt.tree").controller("GanttTreeController",["$scope","$filter","GanttHierarchy",function(t,e,n){t.rootRows=[],t.getHeader=function(){return t.pluginScope.header};var i=new n;t.pluginScope.$watchGroup(["keepAncestorOnFilterRow","enabled"],function(n){var r=n[0]&&n[1];if(r){var o=function(t,n,r){i.refresh(t);for(var o=[],a=0;a<t.length;a++){var s=i.children(t[a]);s&&0!==s.length||o.push(t[a])}var l=e("filter")(o,n,r),u=function(t){if(l.indexOf(t)>-1)return!0;for(var e=i.descendants(t),n=0;n<e.length;n++)if(l.indexOf(e[n])>-1)return!0;return!1};return e("filter")(t,u,r)};t.gantt.rowsManager.setFilterImpl(o)}else t.gantt.rowsManager.setFilterImpl(!1)});var r=function(e){for(var n=t.parent(e);void 0!==n;){if(void 0!==n&&n._collapsed)return!1;n=t.parent(n)}return!0},o=function(t){return t.filter(function(t){return r(t)})},a=function(e){for(var n=[],i=[],r=!1,o=0;o<e.length;o++){var a=t.parent(e[o]);void 0===a?i.push(e[o]):r=!0}var s=function(i){n.push(i);var r=t.children(i);if(void 0!==r&&r.length>0)for(var o=r.sort(function(t,n){return e.indexOf(t)-e.indexOf(n)}),a=0;a<o.length;a++)s(o[a])};for(o=0;o<i.length;o++)s(i[o]);return n};t.gantt.api.rows.addRowSorter(a),t.gantt.api.rows.addRowFilter(o),t.$on("$destroy",function(){t.gantt.api.rows.removeRowSorter(a),t.gantt.api.rows.removeRowFilter(o)});var s=function(){t.rootRows=i.refresh(t.gantt.rowsManager.filteredRows),t.gantt.rowsManager.filteredRows.length>0&&(t.gantt.api.rows.sort(),t.gantt.api.rows.refresh())};t.gantt.api.rows.on.remove(t,s),t.gantt.api.rows.on.add(t,s);var l=function(e){var n;return n="string"==typeof e?t.gantt.rowsManager.rowsMap[e]:e,void 0!==n?void 0===n._collapsed?!1:n._collapsed:void 0},u=function(e){var n;if(n="string"==typeof e?t.gantt.rowsManager.rowsMap[e]:e,void 0!==n){var i=t.nodeScopes[n.model.id];i.collapsed&&i.toggle()}},c=function(e){var n;if(n="string"==typeof e?t.gantt.rowsManager.rowsMap[e]:e,void 0!==n){var i=t.nodeScopes[n.model.id];i.collapsed||i.toggle()}},d=function(){return i};t.getHeaderContent=function(){return t.pluginScope.headerContent},t.gantt.api.registerMethod("tree","refresh",s,this),t.gantt.api.registerMethod("tree","isCollapsed",l,this),t.gantt.api.registerMethod("tree","expand",u,this),t.gantt.api.registerMethod("tree","collapse",c,this),t.gantt.api.registerEvent("tree","collapsed"),t.gantt.api.registerMethod("tree","getHierarchy",d,this),t.$watchCollection("gantt.rowsManager.filteredRows",function(){s()}),t.children=function(e){return void 0===e?t.rootRows:i.children(e)},t.parent=function(t){return i.parent(t)},t.nodeScopes={}}]).controller("GanttUiTreeController",["$scope",function(t){var e=function(){t.$broadcast("angular-ui-tree:collapse-all")},n=function(){t.$broadcast("angular-ui-tree:expand-all")};t.gantt.api.registerMethod("tree","collapseAll",e,t),t.gantt.api.registerMethod("tree","expandAll",n,t)}]).controller("GanttTreeNodeController",["$scope",function(t){t.$parent.nodeScopes[t.row.model.id]=t,t.$on("$destroy",function(){delete t.$parent.nodeScopes[t.row.model.id]}),t.$watch("children(row)",function(e){if(e){for(var n=t.row.rowsManager.filteredRows,i=[],r=0;r<e.length;r++){var o=e[r];n.indexOf(o)>-1&&i.push(o)}t.$parent.childrenRows=i}else t.$parent.childrenRows=e}),t.isCollapseDisabled=function(){return!t.$parent.childrenRows||0===t.$parent.childrenRows.length},t.getValue=function(){return t.row.model.name},t.getRowContent=function(){if(void 0!==t.row.model.content)return t.row.model.content;if(void 0!==t.pluginScope.content)return t.pluginScope.content;var e=t.row.rowsManager.gantt.options.value("rowContent");return void 0===e&&(e="{{row.model.name}}"),e},t.$watch("collapsed",function(e){if(t.$modelValue._collapsed!==e){var n=t.$modelValue._collapsed;t.$modelValue._collapsed=e,void 0!==n&&e!==n&&(t.gantt.api.tree.raise.collapsed(t,t.$modelValue,e),t.gantt.api.rows.refresh())}})}])}(),function(){"use strict";angular.module("gantt.tree").directive("ganttTreeBody",["GanttDirectiveBuilder","ganttLayout",function(t,e){var n=new t("ganttTreeBody","plugins/tree/treeBody.tmpl.html");return n.controller=function(t){var n=e.getScrollBarHeight();t.getLabelsCss=function(){var e={};if(t.maxHeight){var i=t.gantt.scroll.isHScrollbarVisible()?n:0;e["max-height"]=t.maxHeight-i-t.gantt.header.getHeight()+"px"}return e}},n.build()}])}(),function(){"use strict";angular.module("gantt.tree").directive("ganttTreeHeader",["GanttDirectiveBuilder",function(t){var e=new t("ganttTreeHeader","plugins/tree/treeHeader.tmpl.html");return e.build()}])}(),angular.module("gantt.bounds.templates",[]).run(["$templateCache",function(t){t.put("plugins/bounds/taskBounds.tmpl.html",'<div ng-cloak class="gantt-task-bounds" ng-style="getCss()" ng-class="getClass()"></div>\n')}]),angular.module("gantt.dependencies.templates",[]).run(["$templateCache",function(t){}]),angular.module("gantt.drawtask.templates",[]).run(["$templateCache",function(t){}]),angular.module("gantt.groups.templates",[]).run(["$templateCache",function(t){t.put("plugins/groups/taskGroup.tmpl.html",'<div ng-controller="GanttGroupController">\n    <div class="gantt-task-group-overview" ng-if="taskGroup.overviewTasks.length > 0">\n        <gantt-task-overview ng-repeat="task in taskGroup.overviewTasks"></gantt-task-overview>\n    </div>\n    <div class="gantt-task-group-promote" ng-if="taskGroup.row._collapsed && taskGroup.promotedTasks.length > 0">\n        <gantt-task ng-repeat="task in taskGroup.promotedTasks"></gantt-task>\n    </div>\n    <div class="gantt-task-group"\n         ng-if="taskGroup.showGrouping"\n         ng-style="{\'left\': taskGroup.left + \'px\', \'width\': taskGroup.width + \'px\'}">\n        <div class="gantt-task-group-left-main"></div>\n        <div class="gantt-task-group-right-main"></div>\n        <div class="gantt-task-group-left-symbol"></div>\n        <div class="gantt-task-group-right-symbol"></div>\n    </div>\n</div>\n\n'),t.put("plugins/groups/taskOverview.tmpl.html",'<div class="gantt-task gantt-task-overview" ng-class="task.model.classes">\n    <gantt-task-background></gantt-task-background>\n    <gantt-task-content></gantt-task-content>\n    <gantt-task-foreground></gantt-task-foreground>\n</div>\n\n')}]),angular.module("gantt.labels.templates",[]).run(["$templateCache",function(t){t.put("plugins/labels/labelsBody.tmpl.html",'<div class="gantt-labels-body" ng-style="getLabelsCss()">\n    <div gantt-vertical-scroll-receiver>\n        <div ng-repeat="row in gantt.rowsManager.visibleRows track by row.model.id">\n            <div gantt-row-label\n                 class="gantt-row-label gantt-row-height"\n                 ng-class="row.model.classes"\n                 ng-style="{\'height\': row.model.height}">\n                <span class="gantt-label-text">{{row.model.name}}</span>\n            </div>\n        </div>\n    </div>\n</div>\n'),t.put("plugins/labels/labelsHeader.tmpl.html",'<div class="gantt-labels-header">\n    <div ng-show="gantt.columnsManager.columns.length > 0 && gantt.columnsManager.headers.length > 0">\n        <div ng-repeat="header in gantt.columnsManager.headers">\n            <div class="gantt-row-height" ng-class="{\'gantt-labels-header-row\': $last, \'gantt-labels-header-row-last\': $last}"><span>{{$last ? pluginScope.header : ""}}</span></div>\n        </div>\n    </div>\n</div>\n'),t.put("plugins/labels/sideContentLabels.tmpl.html",'<div class="gantt-side-content-labels">\n    <gantt-labels-header>\n    </gantt-labels-header>\n    <gantt-labels-body>\n    </gantt-labels-body>\n</div>\n')}]),angular.module("gantt.movable.templates",[]).run(["$templateCache",function(t){}]),angular.module("gantt.overlap.templates",[]).run(["$templateCache",function(t){}]),angular.module("gantt.progress.templates",[]).run(["$templateCache",function(t){t.put("plugins/progress/taskProgress.tmpl.html",'<div ng-cloak class="gantt-task-progress" ng-style="getCss()" ng-class="getClasses()"></div>\n')}]),angular.module("gantt.resizeSensor.templates",[]).run(["$templateCache",function(t){}]),angular.module("gantt.sortable.templates",[]).run(["$templateCache",function(t){}]),angular.module("gantt.table.templates",[]).run(["$templateCache",function(t){t.put("plugins/table/sideContentTable.tmpl.html",'<div class="gantt-side-content-table">\n\n    <div class="gantt-table-column {{getClass()}}" ng-repeat="column in pluginScope.columns" ng-controller="TableColumnController">\n\n        <div class="gantt-table-header" ng-style="{height: ganttHeaderHeight + \'px\'}">\n            <div ng-show="ganttHeaderHeight" class="gantt-row-label-header gantt-row-label gantt-table-row gantt-table-header-row">\n                <span class="gantt-label-text" gantt-bind-compile-html="getHeaderContent()"/>\n            </div>\n        </div>\n\n        <div class="gantt-table-content" ng-style="getMaxHeightCss()">\n            <div gantt-vertical-scroll-receiver>\n                <div class="gantt-table-row" ng-repeat="row in gantt.rowsManager.visibleRows track by row.model.id" ng-controller="TableColumnRowController">\n                    <div gantt-row-label class="gantt-row-label gantt-row-height" ng-class="row.model.classes" ng-style="{\'height\': row.model.height}">\n                        <div class="gantt-valign-container">\n                            <div class="gantt-valign-content">\n                                <span class="gantt-label-text" gantt-bind-compile-html="getRowContent()"></span>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n\n    </div>\n</div>\n')}]),angular.module("gantt.tooltips.templates",[]).run(["$templateCache",function(t){t.put("plugins/tooltips/tooltip.tmpl.html",'<div ng-cloak\n     class="gantt-task-info"\n     ng-show="displayed"\n     ng-class="isRightAligned ? \'gantt-task-infoArrowR\' : \'gantt-task-infoArrow\'"\n     ng-style="{top: taskRect.top + \'px\', marginTop: -elementHeight - 8 + \'px\'}">\n    <div class="gantt-task-info-content">\n        <div gantt-bind-compile-html="pluginScope.content"></div>\n    </div>\n</div>\n')}]),angular.module("gantt.tree.templates",[]).run(["$templateCache",function(t){t.put("plugins/tree/sideContentTree.tmpl.html",'<div class="gantt-side-content-tree" ng-controller="GanttTreeController">\n    <gantt-tree-header>\n    </gantt-tree-header>\n    <gantt-tree-body>\n    </gantt-tree-body>\n</div>\n'),t.put("plugins/tree/treeBody.tmpl.html",'<div class="gantt-tree-body" ng-style="getLabelsCss()">\n    <div gantt-vertical-scroll-receiver>\n        <div class="gantt-row-label-background">\n            <div class="gantt-row-label gantt-row-height"\n                 ng-class="row.model.classes"\n                 ng-style="{\'height\': row.model.height}"\n                 ng-repeat="row in gantt.rowsManager.visibleRows track by row.model.id">\n                &nbsp;\n            </div>\n        </div>\n        <div ui-tree ng-controller="GanttUiTreeController" data-drag-enabled="false" data-empty-place-holder-enabled="false">\n            <ol class="gantt-tree-root" ui-tree-nodes ng-model="rootRows">\n                <li ng-repeat="row in rootRows" ui-tree-node\n                    ng-include="\'plugins/tree/treeBodyChildren.tmpl.html\'">\n                </li>\n            </ol>\n        </div>\n    </div>\n</div>\n'),t.put("plugins/tree/treeBodyChildren.tmpl.html",'<div ng-controller="GanttTreeNodeController"\n     class="gantt-row-label gantt-row-height"\n     ng-class="row.model.classes"\n     ng-style="{\'height\': row.model.height}">\n    <div class="gantt-valign-container">\n        <div class="gantt-valign-content">\n            <a ng-disabled="isCollapseDisabled()" data-nodrag\n               class="gantt-tree-handle-button btn btn-xs"\n               ng-class="{\'gantt-tree-collapsed\': collapsed, \'gantt-tree-expanded\': !collapsed}"\n               ng-click="!isCollapseDisabled() && toggle()"><span\n                class="gantt-tree-handle glyphicon glyphicon-chevron-down"\n                ng-class="{\n                \'glyphicon-chevron-right\': collapsed, \'glyphicon-chevron-down\': !collapsed,\n                \'gantt-tree-collapsed\': collapsed, \'gantt-tree-expanded\': !collapsed}"></span>\n            </a>\n            <span gantt-row-label class="gantt-label-text" gantt-bind-compile-html="getRowContent()"/>\n        </div>\n    </div>\n</div>\n<ol ui-tree-nodes ng-class="{hidden: collapsed}" ng-model="childrenRows">\n    <li ng-repeat="row in childrenRows" ui-tree-node>\n        <div ng-include="\'plugins/tree/treeBodyChildren.tmpl.html\'"></div>\n    </li>\n</ol>\n'),t.put("plugins/tree/treeHeader.tmpl.html",'<div class="gantt-tree-header" ng-style="{height: $parent.ganttHeaderHeight + \'px\'}">\n    <div ng-if="$parent.ganttHeaderHeight" class="gantt-row-label gantt-row-label-header gantt-tree-row gantt-tree-header-row"><span class="gantt-label-text" gantt-bind-compile-html="getHeaderContent()"/></div>\n</div>\n')}]),function(t,e){"function"==typeof define&&define.amd?define(["moment"],function(n){return t.DateRange=e(n)}):"object"==typeof exports?module.exports=e(require("moment")):t.DateRange=e(moment)}(this,function(t){function e(e,n){var i,r=e,o=n;1!==arguments.length&&void 0!==n||("object"==typeof e&&2===e.length?(r=e[0],o=e[1]):"string"==typeof e&&(i=e.split("/"),r=i[0],o=i[1])),this.start=t(null===r?-864e13:r),this.end=t(null===o?864e13:o)}function n(e,n,i){for(var r=t(this.start);this.contains(r,i);)n.call(this,r.clone()),r.add(1,e)}function i(e,n,i){var r=this/e,o=Math.floor(r);if(o!==1/0){o===r&&i&&o--;for(var a=0;o>=a;a++)n.call(this,t(this.start.valueOf()+e.valueOf()*a))}}var r={year:!0,month:!0,week:!0,day:!0,hour:!0,minute:!0,second:!0};return e.prototype.constructor=e,e.prototype.clone=function(){return t().range(this.start,this.end)},e.prototype.contains=function(t,n){var i=this.start,r=this.end;return t instanceof e?i<=t.start&&(r>t.end||r.isSame(t.end)&&!n):t>=i&&(r>t||r.isSame(t)&&!n)},e.prototype.overlaps=function(t){return null!==this.intersect(t)},e.prototype.intersect=function(t){var n=this.start,i=this.end;return n<=t.start&&t.start<i&&i<t.end?new e(t.start,i):t.start<n&&n<t.end&&t.end<=i?new e(n,t.end):t.start<n&&i>=n&&i<t.end?this:n<=t.start&&t.start<=t.end&&t.end<=i?t:null},e.prototype.add=function(n){return this.overlaps(n)?new e(t.min(this.start,n.start),t.max(this.end,n.end)):null},e.prototype.subtract=function(t){var n=this.start,i=this.end;return null===this.intersect(t)?[this]:t.start<=n&&i>n&&i<=t.end?[]:t.start<=n&&n<t.end&&t.end<i?[new e(t.end,i)]:n<t.start&&t.start<i&&i<=t.end?[new e(n,t.start)]:n<t.start&&t.start<t.end&&t.end<i?[new e(n,t.start),new e(t.end,i)]:n<t.start&&t.start<i&&t.end<i?[new e(n,t.start),new e(t.start,i)]:void 0},e.prototype.by=function(t,e,r){return"string"==typeof t?n.call(this,t,e,r):i.call(this,t,e,r),this},e.prototype.toString=function(){return this.start.format()+"/"+this.end.format()},e.prototype.valueOf=function(){return this.end-this.start},e.prototype.center=function(){var e=this.start+this.diff()/2;return t(e)},e.prototype.toDate=function(){return[this.start.toDate(),this.end.toDate()]},e.prototype.isSame=function(t){return this.start.isSame(t.start)&&this.end.isSame(t.end)},e.prototype.diff=function(t){return this.end.diff(this.start,t)},t.range=function(n,i){return n in r?new e(t(this).startOf(n),t(this).endOf(n)):new e(n,i)},t.range.constructor=e,t.fn.range=t.range,t.fn.within=function(t){return t.contains(this._d)},e}),function(){var t=window.ResizeSensor;"undefined"!=typeof module&&"undefined"!=typeof module.exports&&(t=require("./ResizeSensor"));var e=this.ElementQueries=function(){function n(t){t||(t=document.documentElement);var e=getComputedStyle(t,"fontSize");return parseFloat(e)||16}function i(t,e){var i=e.replace(/[0-9]*/,"");switch(e=parseFloat(e),i){case"px":return e;case"em":return e*n(t);case"rem":return e*n();case"vw":return e*document.documentElement.clientWidth/100;case"vh":return e*document.documentElement.clientHeight/100;case"vmin":case"vmax":var r=document.documentElement.clientWidth/100,o=document.documentElement.clientHeight/100,a=Math["vmin"===i?"min":"max"];return e*a(r,o);default:return e}}function r(t){this.element=t,this.options={};var e,n,r,o,a,s,l,u=0,c=0;this.addOption=function(t){var e=[t.mode,t.property,t.value].join(",");this.options[e]=t};var d=["min-width","min-height","max-width","max-height"];this.call=function(){u=this.element.offsetWidth,c=this.element.offsetHeight,a={};for(e in this.options)this.options.hasOwnProperty(e)&&(n=this.options[e],r=i(this.element,n.value),o="width"==n.property?u:c,l=n.mode+"-"+n.property,s="","min"==n.mode&&o>=r&&(s+=n.value),"max"==n.mode&&r>=o&&(s+=n.value),a[l]||(a[l]=""),s&&-1===(" "+a[l]+" ").indexOf(" "+s+" ")&&(a[l]+=" "+s));for(var t in d)d.hasOwnProperty(t)&&(a[d[t]]?this.element.setAttribute(d[t],a[d[t]].substr(1)):this.element.removeAttribute(d[t]))}}function o(e,n){e.elementQueriesSetupInformation?e.elementQueriesSetupInformation.addOption(n):(e.elementQueriesSetupInformation=new r(e),e.elementQueriesSetupInformation.addOption(n),e.elementQueriesSensor=new t(e,function(){e.elementQueriesSetupInformation.call()})),e.elementQueriesSetupInformation.call(),f&&p.indexOf(e)<0&&p.push(e)}function a(t,e,n,i){"undefined"==typeof m[e]&&(m[e]={}),"undefined"==typeof m[e][n]&&(m[e][n]={}),"undefined"==typeof m[e][n][i]?m[e][n][i]=t:m[e][n][i]+=","+t}function s(){var t;if(document.querySelectorAll&&(t=document.querySelectorAll.bind(document)),t||"undefined"==typeof $$||(t=$$),t||"undefined"==typeof jQuery||(t=jQuery),!t)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return t}function l(){var t=s();for(var e in m)if(m.hasOwnProperty(e))for(var n in m[e])if(m[e].hasOwnProperty(n))for(var i in m[e][n])if(m[e][n].hasOwnProperty(i))for(var r=t(m[e][n][i]),a=0,l=r.length;l>a;a++)o(r[a],{mode:e,property:n,value:i})}function u(e){function n(){var t,n=!1;for(t in i)i.hasOwnProperty(t)&&r[t].minWidth&&e.offsetWidth>r[t].minWidth&&(n=t);if(n||(n=a),s!=n)if(l[n])i[s].style.display="none",i[n].style.display="block",s=n;else{var u=new Image;u.onload=function(){i[n].src=o[n],i[s].style.display="none",i[n].style.display="block",l[n]=!0,s=n},u.src=o[n]}else i[n].src=o[n]}var i=[],r=[],o=[],a=0,s=-1,l=[];for(var u in e.children)if(e.children.hasOwnProperty(u)&&e.children[u].tagName&&"img"===e.children[u].tagName.toLowerCase()){i.push(e.children[u]);var c=e.children[u].getAttribute("min-width")||e.children[u].getAttribute("data-min-width"),d=e.children[u].getAttribute("data-src")||e.children[u].getAttribute("url");o.push(d);var h={minWidth:c};r.push(h),c?e.children[u].style.display="none":(a=i.length-1,e.children[u].style.display="block")}s=a,e.resizeSensor=new t(e,n),n(),f&&p.push(e)}function c(){for(var t=s(),e=t("[data-responsive-image],[responsive-image]"),n=0,i=e.length;i>n;n++)u(e[n])}function d(t){var e,n;for(t=t.replace(/'/g,'"');null!==(e=g.exec(t));)for(n=e[1]+e[3],attrs=e[2];null!==(attrMatch=v.exec(attrs));)a(n,attrMatch[1],attrMatch[2],attrMatch[3])}function h(t){var e="";if(t)if("string"==typeof t)t=t.toLowerCase(),-1===t.indexOf("min-width")&&-1===t.indexOf("max-width")||d(t);else for(var n=0,i=t.length;i>n;n++)1===t[n].type?(e=t[n].selectorText||t[n].cssText,-1!==e.indexOf("min-height")||-1!==e.indexOf("max-height")?d(e):-1===e.indexOf("min-width")&&-1===e.indexOf("max-width")||d(e)):4===t[n].type&&h(t[n].cssRules||t[n].rules)}var f=!1,p=[],m={},g=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,v=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim,y=!1;this.init=function(t){f="undefined"==typeof t?!1:t;for(var e=0,n=document.styleSheets.length;n>e;e++)try{h(document.styleSheets[e].cssRules||document.styleSheets[e].rules||document.styleSheets[e].cssText)}catch(i){if("SecurityError"!==i.name)throw i}if(!y){var r=document.createElement("style");r.type="text/css",r.innerHTML="[responsive-image] > img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img { width: 100%;}",document.getElementsByTagName("head")[0].appendChild(r),y=!0}l(),c()},this.update=function(t){this.init(t)},this.detach=function(){if(!this.withTracking)throw"withTracking is not enabled. We can not detach elements since we don not store it.Use ElementQueries.withTracking = true; before domready or call ElementQueryes.update(true).";for(var t;t=p.pop();)e.detach(t);p=[]}};e.update=function(t){e.instance.update(t)},e.detach=function(t){t.elementQueriesSetupInformation?(t.elementQueriesSensor.detach(),delete t.elementQueriesSetupInformation,delete t.elementQueriesSensor):t.resizeSensor&&(t.resizeSensor.detach(),delete t.resizeSensor)},e.withTracking=!1,e.init=function(){e.instance||(e.instance=new e),e.instance.init(e.withTracking)};var n=function(t){if(document.addEventListener)document.addEventListener("DOMContentLoaded",t,!1);else if(/KHTML|WebKit|iCab/i.test(navigator.userAgent))var e=setInterval(function(){/loaded|complete/i.test(document.readyState)&&(t(),clearInterval(e))},10);else window.onload=t};e.listen=function(){n(e.init)},"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=e:(window.ElementQueries=e,e.listen())}(),function(){var t=function(e,n){function i(){this.q=[],this.add=function(t){this.q.push(t)};var t,e;this.call=function(){for(t=0,e=this.q.length;e>t;t++)this.q[t].call()}}function r(t,e){return t.currentStyle?t.currentStyle[e]:window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue(e):t.style[e]}function o(t,e){if(t.resizedAttached){if(t.resizedAttached)return void t.resizedAttached.add(e)}else t.resizedAttached=new i,t.resizedAttached.add(e);t.resizeSensor=document.createElement("div"),t.resizeSensor.className="resize-sensor";var n="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;",o="position: absolute; left: 0; top: 0; transition: 0s;";t.resizeSensor.style.cssText=n,t.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+n+'"><div style="'+o+'"></div></div><div class="resize-sensor-shrink" style="'+n+'"><div style="'+o+' width: 200%; height: 200%"></div></div>',t.appendChild(t.resizeSensor),{fixed:1,absolute:1}[r(t,"position")]||(t.style.position="relative");var a,s,l=t.resizeSensor.childNodes[0],u=l.childNodes[0],c=t.resizeSensor.childNodes[1],d=(c.childNodes[0],function(){u.style.width=l.offsetWidth+10+"px",u.style.height=l.offsetHeight+10+"px",l.scrollLeft=l.scrollWidth,l.scrollTop=l.scrollHeight,c.scrollLeft=c.scrollWidth,c.scrollTop=c.scrollHeight,a=t.offsetWidth,s=t.offsetHeight});d();var h=function(){t.resizedAttached&&t.resizedAttached.call()},f=function(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener(e,n)},p=function(){t.offsetWidth==a&&t.offsetHeight==s||h(),d()};f(l,"scroll",p),f(c,"scroll",p)}var a=Object.prototype.toString.call(e),s="[object Array]"===a||"[object NodeList]"===a||"[object HTMLCollection]"===a||"undefined"!=typeof jQuery&&e instanceof jQuery||"undefined"!=typeof Elements&&e instanceof Elements;if(s)for(var l=0,u=e.length;u>l;l++)o(e[l],n);else o(e,n);this.detach=function(){if(s)for(var n=0,i=e.length;i>n;n++)t.detach(e[n]);else t.detach(e)}};t.detach=function(t){t.resizeSensor&&(t.removeChild(t.resizeSensor),delete t.resizeSensor,delete t.resizedAttached)},"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=t:window.ResizeSensor=t}(),function(){"undefined"==typeof Math.sgn&&(Math.sgn=function(t){return 0==t?0:t>0?1:-1});var t={subtract:function(t,e){return{x:t.x-e.x,y:t.y-e.y}},dotProduct:function(t,e){return t.x*e.x+t.y*e.y},square:function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},scale:function(t,e){return{x:t.x*e,y:t.y*e}}},e=64,n=Math.pow(2,-e-1),i=function(e,n){for(var i=[],r=o(e,n),s=n.length-1,l=2*s-1,u=a(r,l,i,0),d=t.subtract(e,n[0]),h=t.square(d),f=0,p=0;u>p;p++){d=t.subtract(e,c(n,s,i[p],null,null));var m=t.square(d);h>m&&(h=m,f=i[p])}return d=t.subtract(e,n[s]),m=t.square(d),h>m&&(h=m,f=1),{location:f,distance:h}},r=function(t,e){var n=i(t,e);return{point:c(e,e.length-1,n.location,null,null),location:n.location}},o=function(e,n){for(var i=n.length-1,r=2*i-1,o=[],a=[],s=[],l=[],u=[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]],c=0;i>=c;c++)o[c]=t.subtract(n[c],e);for(var c=0;i-1>=c;c++)a[c]=t.subtract(n[c+1],n[c]),a[c]=t.scale(a[c],3);for(var d=0;i-1>=d;d++)for(var h=0;i>=h;h++)s[d]||(s[d]=[]),s[d][h]=t.dotProduct(a[d],o[h]);
for(c=0;r>=c;c++)l[c]||(l[c]=[]),l[c].y=0,l[c].x=parseFloat(c)/r;for(var f=i,p=i-1,m=0;f+p>=m;m++){var g=Math.max(0,m-p),v=Math.min(m,f);for(c=g;v>=c;c++)j=m-c,l[c+j].y+=s[j][c]*u[j][c]}return l},a=function(t,n,i,r){var o,d,h=[],f=[],p=[],m=[];switch(s(t,n)){case 0:return 0;case 1:if(r>=e)return i[0]=(t[0].x+t[n].x)/2,1;if(l(t,n))return i[0]=u(t,n),1}c(t,n,.5,h,f),o=a(h,n,p,r+1),d=a(f,n,m,r+1);for(var g=0;o>g;g++)i[g]=p[g];for(var g=0;d>g;g++)i[g+o]=m[g];return o+d},s=function(t,e){var n,i,r=0;n=i=Math.sgn(t[0].y);for(var o=1;e>=o;o++)n=Math.sgn(t[o].y),n!=i&&r++,i=n;return r},l=function(t,e){var i,r,o,a,s,l,u,c,d,h,f,p,m,g,v,y;l=t[0].y-t[e].y,u=t[e].x-t[0].x,c=t[0].x*t[e].y-t[e].x*t[0].y;for(var b=max_distance_below=0,$=1;e>$;$++){var w=l*t[$].x+u*t[$].y+c;w>b?b=w:w<max_distance_below&&(max_distance_below=w)}return f=0,p=1,m=0,g=l,v=u,y=c-b,d=f*v-g*p,h=1/d,r=(p*y-v*m)*h,g=l,v=u,y=c-max_distance_below,d=f*v-g*p,h=1/d,o=(p*y-v*m)*h,a=Math.min(r,o),s=Math.max(r,o),i=s-a,n>i?1:0},u=function(t,e){var n=1,i=0,r=t[e].x-t[0].x,o=t[e].y-t[0].y,a=t[0].x-0,s=t[0].y-0,l=r*i-o*n,u=1/l,c=(r*s-o*a)*u;return 0+n*c},c=function(t,e,n,i,r){for(var o=[[]],a=0;e>=a;a++)o[0][a]=t[a];for(var s=1;e>=s;s++)for(var a=0;e-s>=a;a++)o[s]||(o[s]=[]),o[s][a]||(o[s][a]={}),o[s][a].x=(1-n)*o[s-1][a].x+n*o[s-1][a+1].x,o[s][a].y=(1-n)*o[s-1][a].y+n*o[s-1][a+1].y;if(null!=i)for(a=0;e>=a;a++)i[a]=o[a][0];if(null!=r)for(a=0;e>=a;a++)r[a]=o[e-a][a];return o[e][0]},d={},h=function(t){var e=d[t];if(!e){e=[];var n=function(){return function(e){return Math.pow(e,t)}},i=function(){return function(e){return Math.pow(1-e,t)}},r=function(t){return function(e){return t}},o=function(){return function(t){return t}},a=function(){return function(t){return 1-t}},s=function(t){return function(e){for(var n=1,i=0;i<t.length;i++)n*=t[i](e);return n}};e.push(new n);for(var l=1;t>l;l++){for(var u=[new r(t)],c=0;t-l>c;c++)u.push(new o);for(var c=0;l>c;c++)u.push(new a);e.push(new s(u))}e.push(new i),d[t]=e}return e},f=function(t,e){for(var n=h(t.length-1),i=0,r=0,o=0;o<t.length;o++)i+=t[o].x*n[o](e),r+=t[o].y*n[o](e);return{x:i,y:r}},p=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},m=function(t){return t[0].x==t[1].x&&t[0].y==t[1].y},g=function(t,e,n){if(m(t))return{point:t[0],location:e};for(var i=f(t,e),r=0,o=e,a=n>0?1:-1,s=null;r<Math.abs(n);)o+=.005*a,s=f(t,o),r+=p(s,i),i=s;return{point:s,location:o}},v=function(t){if(m(t))return 0;for(var e=f(t,0),n=0,i=0,r=1,o=null;1>i;)i+=.005*r,o=f(t,i),n+=p(o,e),e=o;return n},y=function(t,e,n){return g(t,e,n).point},b=function(t,e,n){return g(t,e,n).location},$=function(t,e){var n=f(t,e),i=f(t.slice(0,t.length-1),e),r=i.y-n.y,o=i.x-n.x;return 0==r?1/0:Math.atan(r/o)},w=function(t,e,n){var i=g(t,e,n);return i.location>1&&(i.location=1),i.location<0&&(i.location=0),$(t,i.location)},x=function(t,e,n,i){i=null==i?0:i;var r=g(t,e,i),o=$(t,r.location),a=Math.atan(-1/o),s=n/2*Math.sin(a),l=n/2*Math.cos(a);return[{x:r.point.x+l,y:r.point.y+s},{x:r.point.x-l,y:r.point.y-s}]};this.jsBezier={distanceFromCurve:i,gradientAtPoint:$,gradientAtPointAlongCurveFrom:w,nearestPointOnCurve:r,pointOnCurve:f,pointAlongCurveFrom:y,perpendicularToCurveAt:x,locationAlongCurveFrom:b,getLength:v}}.call(this),function(){"use strict";var t=this.Biltong={},e=function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=function(t,n,i){return t=e(t)?t:[t.x,t.y],n=e(n)?n:[n.x,n.y],i(t,n)},i=t.gradient=function(t,e){return n(t,e,function(t,e){return e[0]==t[0]?e[1]>t[1]?1/0:-(1/0):e[1]==t[1]?e[0]>t[0]?0:-0:(e[1]-t[1])/(e[0]-t[0])})},r=(t.normal=function(t,e){return-1/i(t,e)},t.lineLength=function(t,e){return n(t,e,function(t,e){return Math.sqrt(Math.pow(e[1]-t[1],2)+Math.pow(e[0]-t[0],2))})},t.quadrant=function(t,e){return n(t,e,function(t,e){return e[0]>t[0]?e[1]>t[1]?2:1:e[0]==t[0]?e[1]>t[1]?2:1:e[1]>t[1]?3:4})}),o=(t.theta=function(t,e){return n(t,e,function(t,e){var n=i(t,e),o=Math.atan(n),a=r(t,e);return 4!=a&&3!=a||(o+=Math.PI),0>o&&(o+=2*Math.PI),o})},t.intersects=function(t,e){var n=t.x,i=t.x+t.w,r=t.y,o=t.y+t.h,a=e.x,s=e.x+e.w,l=e.y,u=e.y+e.h;return a>=n&&i>=a&&l>=r&&o>=l||s>=n&&i>=s&&l>=r&&o>=l||a>=n&&i>=a&&u>=r&&o>=u||s>=n&&i>=a&&u>=r&&o>=u||n>=a&&s>=n&&r>=l&&u>=r||i>=a&&s>=i&&r>=l&&u>=r||n>=a&&s>=n&&o>=l&&u>=o||i>=a&&s>=n&&o>=l&&u>=o},t.encloses=function(t,e,n){var i=t.x,r=t.x+t.w,o=t.y,a=t.y+t.h,s=e.x,l=e.x+e.w,u=e.y,c=e.y+e.h,d=function(t,e,i,r){return n?e>=t&&i>=r:e>t&&i>r};return d(i,s,r,l)&&d(o,u,a,c)},[null,[1,-1],[1,1],[-1,1],[-1,-1]]),a=[null,[-1,-1],[-1,1],[1,1],[1,-1]];t.pointOnLine=function(t,e,n){var s=i(t,e),l=r(t,e),u=n>0?o[l]:a[l],c=Math.atan(s),d=Math.abs(n*Math.sin(c))*u[1],h=Math.abs(n*Math.cos(c))*u[0];return{x:t.x+h,y:t.y+d}},t.perpendicularLineTo=function(t,e,n){var r=i(t,e),o=Math.atan(-1/r),a=n/2*Math.sin(o),s=n/2*Math.cos(o);return[{x:e.x+s,y:e.y+a},{x:e.x-s,y:e.y-a}]}}.call(this),function(){"use strict";var t=this,e={android:navigator.userAgent.toLowerCase().indexOf("android")>-1},n=function(t,e,n){n=n||t.parentNode;for(var i=n.querySelectorAll(e),r=0;r<i.length;r++)if(i[r]===t)return!0;return!1},i=function(t){return"string"==typeof t||t.constructor===String?document.getElementById(t):t},r=function(t){return t.srcElement||t.target},o=function(t,e){for(var n=0,i=t.length;i>n&&t[n]!=e;n++);n<t.length&&t.splice(n,1)},a=1,s=function(t,e,n){var i=a++;return t.__ta=t.__ta||{},t.__ta[e]=t.__ta[e]||{},t.__ta[e][i]=n,n.__tauid=i,i},l=function(t,e,n){if(t.__ta&&t.__ta[e]&&delete t.__ta[e][n.__tauid],n.__taExtra){for(var i=0;i<n.__taExtra.length;i++)T(t,n.__taExtra[i][0],n.__taExtra[i][1]);n.__taExtra.length=0}n.__taUnstore&&n.__taUnstore()},u=function(t,e,i,o){if(null==t)return i;var a=t.split(","),s=function(t){s.__tauid=i.__tauid;for(var o=r(t),l=0;l<a.length;l++)n(o,a[l],e)&&i.apply(o,arguments)};return c(i,o,s),s},c=function(t,e,n){t.__taExtra=t.__taExtra||[],t.__taExtra.push([e,n])},d=function(t,e,n,i){if(v&&b[e]){var r=u(i,t,n,b[e]);M(t,b[e],r,n)}"focus"===e&&null==t.getAttribute("tabindex")&&t.setAttribute("tabindex","1"),M(t,e,u(i,t,n,e),n)},h=function(t,e,n,i){if(null==t.__taSmartClicks){var a=function(e){t.__tad=C(e)},s=function(e){t.__tau=C(e)},l=function(e){if(t.__tad&&t.__tau&&t.__tad[0]===t.__tau[0]&&t.__tad[1]===t.__tau[1])for(var n=0;n<t.__taSmartClicks.length;n++)t.__taSmartClicks[n].apply(r(e),[e])};d(t,"mousedown",a,i),d(t,"mouseup",s,i),d(t,"click",l,i),t.__taSmartClicks=[]}t.__taSmartClicks.push(n),n.__taUnstore=function(){o(t.__taSmartClicks,n)}},f={tap:{touches:1,taps:1},dbltap:{touches:1,taps:2},contextmenu:{touches:2,taps:1}},p=function(t,e){return function(i,a,s,l){if("contextmenu"==a&&y)d(i,a,s,l);else{if(null==i.__taTapHandler){var u=i.__taTapHandler={tap:[],dbltap:[],contextmenu:[],down:!1,taps:0,downSelectors:[]},c=function(r){for(var o=r.srcElement||r.target,a=0;a<u.downSelectors.length;a++)if(null==u.downSelectors[a]||n(o,u.downSelectors[a],i)){u.down=!0,setTimeout(p,t),setTimeout(m,e);break}},h=function(t){if(u.down){var e=t.srcElement||t.target;u.taps++;var o=_(t);for(var a in f)if(f.hasOwnProperty(a)){var s=f[a];if(s.touches===o&&(1===s.taps||s.taps===u.taps))for(var l=0;l<u[a].length;l++)(null==u[a][l][1]||n(e,u[a][l][1],i))&&u[a][l][0].apply(r(t),[t])}}},p=function(){u.down=!1},m=function(){u.taps=0};d(i,"mousedown",c),d(i,"mouseup",h)}i.__taTapHandler.downSelectors.push(l),i.__taTapHandler[a].push([s,l]),s.__taUnstore=function(){o(i.__taTapHandler[a],s)}}}},m=function(t,e,n,i){for(var r in n.__tamee[t])n.__tamee[t].hasOwnProperty(r)&&n.__tamee[t][r].apply(i,[e])},g=function(){var t=[];return function(e,i,o,a){if(!e.__tamee){e.__tamee={over:!1,mouseenter:[],mouseexit:[]};var l=function(i){var o=r(i);(null==a&&o==e&&!e.__tamee.over||n(o,a,e)&&(null==o.__tamee||!o.__tamee.over))&&(m("mouseenter",i,e,o),o.__tamee=o.__tamee||{},o.__tamee.over=!0,t.push(o))},c=function(i){for(var o=r(i),a=0;a<t.length;a++)o!=t[a]||n(i.relatedTarget||i.toElement,"*",o)||(o.__tamee.over=!1,t.splice(a,1),m("mouseexit",i,e,o))};M(e,"mouseover",u(a,e,l,"mouseover"),l),M(e,"mouseout",u(a,e,c,"mouseout"),c)}o.__taUnstore=function(){delete e.__tamee[i][o.__tauid]},s(e,i,o),e.__tamee[i][o.__tauid]=o}},v="ontouchstart"in document.documentElement,y="onmousedown"in document.documentElement,b={mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove"},$=function(){var t=-1;if("Microsoft Internet Explorer"==navigator.appName){var e=navigator.userAgent,n=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=n.exec(e)&&(t=parseFloat(RegExp.$1))}return t}(),w=$>-1&&9>$,x=function(t,e){if(null==t)return[0,0];var n=E(t),i=D(n,0);return[i[e+"X"],i[e+"Y"]]},C=function(t){return null==t?[0,0]:w?[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop]:x(t,"page")},S=function(t){return x(t,"screen")},k=function(t){return x(t,"client")},D=function(t,e){return t.item?t.item(e):t[e]},E=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},_=function(t){return E(t).length},M=function(t,e,n,i){if(s(t,e,n),i.__tauid=n.__tauid,t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent){var r=e+n.__tauid;t["e"+r]=n,t[r]=function(){t["e"+r]&&t["e"+r](window.event)},t.attachEvent("on"+e,t[r])}},T=function(t,e,n){null!=n&&P(t,function(){var r=i(this);if(l(r,e,n),null!=n.__tauid)if(r.removeEventListener)r.removeEventListener(e,n,!1),v&&b[e]&&r.removeEventListener(b[e],n,!1);else if(this.detachEvent){var o=e+n.__tauid;r[o]&&r.detachEvent("on"+e,r[o]),r[o]=null,r["e"+o]=null}n.__taTouchProxy&&T(t,n.__taTouchProxy[1],n.__taTouchProxy[0])})},P=function(t,e){if(null!=t){t="undefined"!=typeof Window&&"unknown"!=typeof t.top&&t==t.top?[t]:"string"!=typeof t&&null==t.tagName&&null!=t.length?t:"string"==typeof t?document.querySelectorAll(t):[t];for(var n=0;n<t.length;n++)e.apply(t[n])}};t.Mottle=function(t){t=t||{};var n=t.clickThreshold||150,r=t.dblClickThreshold||350,o=new g,a=new p(n,r),s=t.smartClicks,l=function(t,e,n,r){null!=n&&P(t,function(){var t=i(this);s&&"click"===e?h(t,e,n,r):"tap"===e||"dbltap"===e||"contextmenu"===e?a(t,e,n,r):"mouseenter"===e||"mouseexit"==e?o(t,e,n,r):d(t,e,n,r)})};this.remove=function(t){return P(t,function(){var t=i(this);if(t.__ta)for(var e in t.__ta)if(t.__ta.hasOwnProperty(e))for(var n in t.__ta[e])t.__ta[e].hasOwnProperty(n)&&T(t,e,t.__ta[e][n]);t.parentNode&&t.parentNode.removeChild(t)}),this},this.on=function(t,e,n,i){var r=arguments[0],o=4==arguments.length?arguments[2]:null,a=arguments[1],s=arguments[arguments.length-1];return l(r,a,s,o),this},this.off=function(t,e,n){return T(t,e,n),this},this.trigger=function(t,n,r,o){var a=y&&("undefined"==typeof MouseEvent||null==r||r.constructor===MouseEvent),s=v&&!y&&b[n]?b[n]:n,l=!(v&&!y&&b[n]),u=C(r),c=S(r),d=k(r);return P(t,function(){var t,h=i(this);r=r||{screenX:c[0],screenY:c[1],clientX:d[0],clientY:d[1]};var f=function(t){o&&(t.payload=o)},p={TouchEvent:function(t){var e=document.createTouch(window,h,0,u[0],u[1],c[0],c[1],d[0],d[1],0,0,0,0),n=document.createTouchList(e),i=document.createTouchList(e),r=document.createTouchList(e);t.initTouchEvent(s,!0,!0,window,null,c[0],c[1],d[0],d[1],!1,!1,!1,!1,n,i,r,1,0)},MouseEvents:function(t){if(t.initMouseEvent(s,!0,!0,window,0,c[0],c[1],d[0],d[1],!1,!1,!1,!1,1,h),e.android){var n=document.createTouch(window,h,0,u[0],u[1],c[0],c[1],d[0],d[1],0,0,0,0);t.touches=t.targetTouches=t.changedTouches=document.createTouchList(n)}}};if(document.createEvent){var m=!l&&!a&&v&&b[n]&&!e.android,g=m?"TouchEvent":"MouseEvents";t=document.createEvent(g),p[g](t),f(t),h.dispatchEvent(t)}else document.createEventObject&&(t=document.createEventObject(),t.eventType=t.eventName=s,t.screenX=c[0],t.screenY=c[1],t.clientX=d[0],t.clientY=d[1],f(t),h.fireEvent("on"+s,t))}),this}},t.Mottle.consume=function(t,e){t.stopPropagation?t.stopPropagation():t.returnValue=!1,!e&&t.preventDefault&&t.preventDefault()},t.Mottle.pageLocation=C,t.Mottle.setForceTouchEvents=function(t){v=t},t.Mottle.setForceMouseEvents=function(t){y=t}}.call(this),function(){"use strict";var t=function(t,e,n){return-1===t.indexOf(e)?(n?t.unshift(e):t.push(e),!0):!1},e=function(t,e){var n=t.indexOf(e);-1!=n&&t.splice(n,1)},n=function(t,e){for(var n=[],i=0;i<t.length;i++)-1==e.indexOf(t[i])&&n.push(t[i]);return n},i=function(t){return null==t?!1:"string"==typeof t||t.constructor==String},r=function(t){var e=t.getBoundingClientRect(),n=document.body,i=document.documentElement,r=window.pageYOffset||i.scrollTop||n.scrollTop,o=window.pageXOffset||i.scrollLeft||n.scrollLeft,a=i.clientTop||n.clientTop||0,s=i.clientLeft||n.clientLeft||0,l=e.top+r-a,u=e.left+o-s;return{top:Math.round(l),left:Math.round(u)}},o=function(t,e,n){n=n||t.parentNode;for(var i=n.querySelectorAll(e),r=0;r<i.length;r++)if(i[r]===t)return!0;return!1},a=function(){var t=-1;if("Microsoft Internet Explorer"==navigator.appName){var e=navigator.userAgent,n=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=n.exec(e)&&(t=parseFloat(RegExp.$1))}return t}(),s=50,l=50,u=a>-1&&9>a,c=9==a,d=function(t){if(u)return[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop];var e=f(t),n=h(e,0);return c?[n.pageX||n.clientX,n.pageY||n.clientY]:[n.pageX,n.pageY]},h=function(t,e){return t.item?t.item(e):t[e]},f=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},p={draggable:"katavorio-draggable",droppable:"katavorio-droppable",drag:"katavorio-drag",selected:"katavorio-drag-selected",active:"katavorio-drag-active",hover:"katavorio-drag-hover",noSelect:"katavorio-drag-no-select"},m="katavorio-drag-scope",g=["stop","start","drag","drop","over","out","beforeStart"],v=function(){},y=function(){return!0},b=function(t,e,n){for(var i=0;i<t.length;i++)t[i]!=n&&e(t[i])},$=function(t,e,n,i){b(t,function(t){t.setActive(e),e&&t.updatePosition(),n&&t.setHover(i,e)})},w=function(t,e){if(null!=t){t=i(t)||null!=t.tagName||null==t.length?[t]:t;for(var n=0;n<t.length;n++)e.apply(t[n],[t[n]])}},x=function(t){t.stopPropagation?(t.stopPropagation(),t.preventDefault()):t.returnValue=!1},C="input,textarea,select,button,option",S=function(t,e,n){var i=t.srcElement||t.target;return!o(i,n.getInputFilterSelector(),e)},k=function(t,e,n,i){this.params=e||{},this.el=t,this.params.addClass(this.el,this._class),this.uuid=_();var r=!0;return this.setEnabled=function(t){r=t},this.isEnabled=function(){return r},this.toggleEnabled=function(){r=!r},this.setScope=function(t){this.scopes=t?t.split(/\s+/):[i]},this.addScope=function(t){var e={};w(this.scopes,function(t){e[t]=!0}),w(t?t.split(/\s+/):[],function(t){e[t]=!0}),this.scopes=[];for(var n in e)this.scopes.push(n)},this.removeScope=function(t){var e={};w(this.scopes,function(t){e[t]=!0}),w(t?t.split(/\s+/):[],function(t){delete e[t]}),this.scopes=[];for(var n in e)this.scopes.push(n)},this.toggleScope=function(t){var e={};w(this.scopes,function(t){e[t]=!0}),w(t?t.split(/\s+/):[],function(t){e[t]?delete e[t]:e[t]=!0}),this.scopes=[];for(var n in e)this.scopes.push(n)},this.setScope(e.scope),this.k=e.katavorio,e.katavorio},D=function(t,e,n,a){this._class=n.draggable;var u=k.apply(this,arguments);this.rightButtonCanDrag=this.params.rightButtonCanDrag;var c=[0,0],h=null,f=!1,p=this.params.consumeStartEvent!==!1,m=this.el,g=this.params.clone,v=(this.params.scroll,e.multipleDrop!==!1),b=e.snapThreshold||5,w=function(t,e,n,i,r){i=i||b,r=r||b;var o=Math.floor(t[0]/e),a=e*o,s=a+e,l=Math.abs(t[0]-a)<=i?a:Math.abs(s-t[0])<=i?s:t[0],u=Math.floor(t[1]/n),c=n*u,d=c+n,h=Math.abs(t[1]-c)<=r?c:Math.abs(d-t[1])<=r?d:t[1];return[l,h]};this.posses=[],this.posseRoles={},this.toGrid=function(t){return null==this.params.grid?t:w(t,this.params.grid[0],this.params.grid[1])},this.snap=function(t,e){if(null!=m){t=t||(this.params.grid?this.params.grid[0]:s),e=e||(this.params.grid?this.params.grid[1]:l);var n=this.params.getPosition(m);this.params.setPosition(m,w(n,t,e,t,e))}},this.constrain="function"==typeof this.params.constrain?this.params.constrain:this.params.constrain||this.params.containment?function(t){return[Math.max(0,Math.min(T.w-this.size[0],t[0])),Math.max(0,Math.min(T.h-this.size[1],t[1]))]}:function(t){return t};var C=function(t){return"function"==typeof t?(t._katavorioId=_(),t._katavorioId):t},D={},E=function(t){for(var e in D){var n=D[e],i=n[0](t);if(n[1]&&(i=!i),!i)return!1}return!0},M=this.setFilter=function(e,n){if(e){var r=C(e);D[r]=[function(n){var r,a=n.srcElement||n.target;return i(e)?r=o(a,e,t):"function"==typeof e&&(r=e(n,t)),r},n!==!1]}};this.addFilter=M,this.removeFilter=function(t){var e="function"==typeof t?t._katavorioId:t;delete D[e]};this.clearAllFilters=function(){D={}},this.canDrag=this.params.canDrag||y;var T,P=[],A=[];this.downListener=function(t){var e=this.rightButtonCanDrag||3!==t.which&&2!==t.button;if(e&&this.isEnabled()&&this.canDrag()){var i=E(t)&&S(t,this.el,this.k);if(i){if(g){m=this.el.cloneNode(!0),m.setAttribute("id",null),m.style.position="absolute";var o=r(this.el);m.style.left=o.left+"px",m.style.top=o.top+"px",document.body.appendChild(m)}else m=this.el;p&&x(t),c=d(t),this.params.bind(document,"mousemove",this.moveListener),this.params.bind(document,"mouseup",this.upListener),u.markSelection(this),u.markPosses(this),this.params.addClass(document.body,n.noSelect),O("beforeStart",{el:this.el,pos:h,e:t,drag:this})}else this.params.consumeFilteredEvents&&x(t)}}.bind(this),this.moveListener=function(t){if(c){if(!f){var e=O("start",{el:this.el,pos:h,e:t,drag:this});if(e!==!1){if(!c)return;this.mark(!0),f=!0}}if(c){A.length=0;var n=d(t),i=n[0]-c[0],r=n[1]-c[1],o=this.params.ignoreZoom?1:u.getZoom();i/=o,r/=o,this.moveBy(i,r,t),u.updateSelection(i,r,this),u.updatePosses(i,r,this)}}}.bind(this),this.upListener=function(t){c&&(c=null,this.params.unbind(document,"mousemove",this.moveListener),this.params.unbind(document,"mouseup",this.upListener),this.params.removeClass(document.body,n.noSelect),this.unmark(t),u.unmarkSelection(this,t),u.unmarkPosses(this,t),this.stop(t),u.notifySelectionDragStop(this,t),u.notifyPosseDragStop(this,t),f=!1,g&&(m&&m.parentNode&&m.parentNode.removeChild(m),m=null))}.bind(this),this.getFilters=function(){return D},this.abort=function(){null!=c&&this.upListener()},this.getDragElement=function(){return m||this.el};var j={start:[],drag:[],stop:[],over:[],out:[],beforeStart:[]};e.events.start&&j.start.push(e.events.start),e.events.beforeStart&&j.beforeStart.push(e.events.beforeStart),e.events.stop&&j.stop.push(e.events.stop),e.events.drag&&j.drag.push(e.events.drag),this.on=function(t,e){j[t]&&j[t].push(e)};var O=function(t,e){if(j[t])for(var n=0;n<j[t].length;n++)try{j[t][n](e)}catch(i){}};this.notifyStart=function(t){O("start",{el:this.el,pos:this.params.getPosition(m),e:t,drag:this})},this.stop=function(t,e){if(e||f){var n=[],i=u.getSelection(),r=this.params.getPosition(m);if(i.length>1)for(var o=0;o<i.length;o++){var a=this.params.getPosition(i[o].el);n.push([i[o].el,{left:a[0],top:a[1]},i[o]])}else n.push([m,{left:r[0],top:r[1]},this]);O("stop",{el:m,pos:r,e:t,drag:this,selection:n})}},this.mark=function(t){if(h=this.params.getPosition(m),this.size=this.params.getSize(m),P=u.getMatchingDroppables(this),$(P,!0,!1,this),this.params.addClass(m,this.params.dragClass||n.drag),this.params.constrain||this.params.containment){var e=this.params.getSize(m.parentNode);T={w:e[0],h:e[1]}}t&&u.notifySelectionDragStart(this)},this.unmark=function(t,e){if($(P,!1,!0,this),this.params.removeClass(m,this.params.dragClass||n.drag),P.length=0,!e)for(var i=0;i<A.length;i++){var r=A[i].drop(this,t);if(r===!0)break}},this.moveBy=function(t,e,n){A.length=0;var i=this.constrain(this.toGrid([h[0]+t,h[1]+e]),m),r={x:i[0],y:i[1],w:this.size[0],h:this.size[1]},o=null;this.params.setPosition(m,i);for(var a=0;a<P.length;a++){var s={x:P[a].position[0],y:P[a].position[1],w:P[a].size[0],h:P[a].size[1]};this.params.intersects(r,s)&&(v||null==o||o==P[a].el)&&P[a].canDrop(this)?(o||(o=P[a].el),A.push(P[a]),P[a].setHover(this,!0,n)):P[a].isHover()&&P[a].setHover(this,!1,n)}O("drag",{el:this.el,pos:i,e:n,drag:this})},this.destroy=function(){this.params.unbind(this.el,"mousedown",this.downListener),this.params.unbind(document,"mousemove",this.moveListener),this.params.unbind(document,"mouseup",this.upListener),this.downListener=null,this.upListener=null,this.moveListener=null},this.params.bind(this.el,"mousedown",this.downListener),this.params.handle?M(this.params.handle,!1):M(this.params.filter,this.params.filterExclude)},E=function(t,e,n,i){this._class=n.droppable,this.params=e||{},this._activeClass=this.params.activeClass||n.active,this._hoverClass=this.params.hoverClass||n.hover,k.apply(this,arguments);var r=!1;this.allowLoopback=this.params.allowLoopback!==!1,this.setActive=function(t){this.params[t?"addClass":"removeClass"](this.el,this._activeClass)},this.updatePosition=function(){this.position=this.params.getPosition(this.el),this.size=this.params.getSize(this.el)},this.canDrop=this.params.canDrop||function(t){return!0},this.isHover=function(){return r},this.setHover=function(t,e,n){(e||null==this.el._katavorioDragHover||this.el._katavorioDragHover==t.el._katavorio)&&(this.params[e?"addClass":"removeClass"](this.el,this._hoverClass),this.el._katavorioDragHover=e?t.el._katavorio:null,r!==e&&this.params.events[e?"over":"out"]({el:this.el,e:n,drag:t,drop:this}),r=e)},this.drop=function(t,e){return this.params.events.drop({drag:t,e:e,drop:this})},this.destroy=function(){this._class=null,this._activeClass=null,this._hoverClass=null,r=null}},_=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"==t?e:3&e|8;return n.toString(16)})},M=function(t){return null==t?null:(t="string"==typeof t||t.constructor==String?document.getElementById(t):t,null==t?null:(t._katavorio=t._katavorio||_(),t))};this.Katavorio=function(r){var o=[],a={};this._dragsByScope={},this._dropsByScope={};var s=1,l=function(t,e){w(t,function(t){for(var n=0;n<t.scopes.length;n++)e[t.scopes[n]]=e[t.scopes[n]]||[],e[t.scopes[n]].push(t)})},u=function(t,e){var n=0;return w(t,function(t){for(var i=0;i<t.scopes.length;i++)if(e[t.scopes[i]]){var o=r.indexOf(e[t.scopes[i]],t);-1!=o&&(e[t.scopes[i]].splice(o,1),n++)}}),n>0},c=(this.getMatchingDroppables=function(t){for(var e=[],n={},i=0;i<t.scopes.length;i++){var r=this._dropsByScope[t.scopes[i]];if(r)for(var o=0;o<r.length;o++)!r[o].canDrop(t)||n[r[o].uuid]||!r[o].allowLoopback&&r[o].el===t.el||(n[r[o].uuid]=!0,e.push(r[o]))}return e},function(t){t=t||{};var e,n={events:{}};for(e in r)n[e]=r[e];for(e in t)n[e]=t[e];for(e=0;e<g.length;e++)n.events[g[e]]=t[g[e]]||v;return n.katavorio=this,n}.bind(this)),d=function(t,e){for(var n=0;n<g.length;n++)e[g[n]]&&t.on(g[n],e[g[n]])}.bind(this),h={},f=r.css||{},y=r.scope||m;for(var $ in p)h[$]=p[$];for(var $ in f)h[$]=f[$];var x=r.inputFilterSelector||C;this.getInputFilterSelector=function(){return x},this.setInputFilterSelector=function(t){return x=t,this},this.draggable=function(t,e){var n=[];return w(t,function(t){if(t=M(t),null!=t)if(null==t._katavorioDrag){var i=c(e);t._katavorioDrag=new D(t,i,h,y),l(t._katavorioDrag,this._dragsByScope),n.push(t._katavorioDrag),r.addClass(t,h.draggable)}else d(t._katavorioDrag,e)}.bind(this)),n},this.droppable=function(t,e){var n=[];return w(t,function(t){if(t=M(t),null!=t){var i=new E(t,c(e),h,y);t._katavorioDrop=t._katavorioDrop||[],t._katavorioDrop.push(i),l(i,this._dropsByScope),n.push(i),r.addClass(t,h.droppable)}}.bind(this)),n},this.select=function(t){return w(t,function(){var t=M(this);t&&t._katavorioDrag&&(a[t._katavorio]||(o.push(t._katavorioDrag),a[t._katavorio]=[t,o.length-1],r.addClass(t,h.selected)))}),this},this.deselect=function(t){return w(t,function(){var t=M(this);if(t&&t._katavorio){var e=a[t._katavorio];if(e){for(var n=[],i=0;i<o.length;i++)o[i].el!==t&&n.push(o[i]);o=n,delete a[t._katavorio],r.removeClass(t,h.selected)}}}),this},this.deselectAll=function(){for(var t in a){var e=a[t];r.removeClass(e[0],h.selected)}o.length=0,a={}},this.markSelection=function(t){b(o,function(t){t.mark()},t)},this.markPosses=function(t){t.posses&&w(t.posses,function(e){t.posseRoles[e]&&T[e]&&b(T[e].members,function(t){t.mark()},t)})},this.unmarkSelection=function(t,e){b(o,function(t){t.unmark(e)},t)},this.unmarkPosses=function(t,e){t.posses&&w(t.posses,function(n){t.posseRoles[n]&&T[n]&&b(T[n].members,function(t){t.unmark(e,!0)},t)})},this.getSelection=function(){return o.slice(0)},this.updateSelection=function(t,e,n){b(o,function(n){n.moveBy(t,e)},n)};var S=function(t,e){e.posses&&w(e.posses,function(n){e.posseRoles[n]&&T[n]&&b(T[n].members,function(e){t(e)},e)})};this.updatePosses=function(t,e,n){S(function(n){n.moveBy(t,e)},n)},this.notifyPosseDragStop=function(t,e){S(function(t){t.stop(e,!0)},t)},this.notifySelectionDragStop=function(t,e){b(o,function(t){t.stop(e,!0)},t)},this.notifySelectionDragStart=function(t,e){b(o,function(t){t.notifyStart(e)},t)},this.setZoom=function(t){s=t},this.getZoom=function(){return s};var k=function(t,e,n,i){w(t,function(t){u(t,n),t[i](e),l(t,n)})};w(["set","add","remove","toggle"],function(t){this[t+"Scope"]=function(e,n){k(e._katavorioDrag,n,this._dragsByScope,t+"Scope"),k(e._katavorioDrop,n,this._dropsByScope,t+"Scope")}.bind(this),this[t+"DragScope"]=function(e,n){k(e.constructor===D?e:e._katavorioDrag,n,this._dragsByScope,t+"Scope")}.bind(this),this[t+"DropScope"]=function(e,n){k(e.constructor===E?e:e._katavorioDrop,n,this._dropsByScope,t+"Scope")}.bind(this)}.bind(this)),this.snapToGrid=function(t,e){for(var n in this._dragsByScope)b(this._dragsByScope[n],function(n){n.snap(t,e)})},this.getDragsForScope=function(t){return this._dragsByScope[t]},this.getDropsForScope=function(t){return this._dropsByScope[t]};var _=function(t,e,n){t=M(t),t[e]&&(u(t[e],n)&&w(t[e],function(t){t.destroy()}),t[e]=null)};this.elementRemoved=function(t){this.destroyDraggable(t),this.destroyDroppable(t)},this.destroyDraggable=function(t){_(t,"_katavorioDrag",this._dragsByScope)},this.destroyDroppable=function(t){_(t,"_katavorioDrop",this._dropsByScope)},this.reset=function(){this._dragsByScope={},this._dropsByScope={},o=[],a={},T={}};var T={},P=function(e,n,r){var o=i(n)?n:n.id,a=i(n)?!0:n.active!==!1,s=T[o]||function(){var t={name:o,members:[]};return T[o]=t,t}();return w(e,function(e){if(e._katavorioDrag){if(r&&null!=e._katavorioDrag.posseRoles[s.name])return;t(s.members,e._katavorioDrag),t(e._katavorioDrag.posses,s.name),e._katavorioDrag.posseRoles[s.name]=a}}),s};this.addToPosse=function(t,e){for(var n=[],i=1;i<arguments.length;i++)n.push(P(t,arguments[i]));return 1==n.length?n[0]:n},this.setPosse=function(t,e){for(var i=[],r=1;r<arguments.length;r++)i.push(P(t,arguments[r],!0).name);return w(t,function(t){if(t._katavorioDrag){var e=n(t._katavorioDrag.posses,i),r=[];Array.prototype.push.apply(r,t._katavorioDrag.posses);for(var o=0;o<e.length;o++)this.removeFromPosse(t,e[o])}}.bind(this)),1==i.length?i[0]:i},this.removeFromPosse=function(t,n){if(arguments.length<2)throw new TypeError("No posse id provided for remove operation");for(var i=1;i<arguments.length;i++)n=arguments[i],w(t,function(t){if(t._katavorioDrag&&t._katavorioDrag.posses){var i=t._katavorioDrag;w(n,function(t){e(T[t].members,i),e(i.posses,t),delete i.posseRoles[t]})}})},this.removeFromAllPosses=function(t){w(t,function(t){if(t._katavorioDrag&&t._katavorioDrag.posses){var n=t._katavorioDrag;w(n.posses,function(t){e(T[t].members,n)}),n.posses.length=0,n.posseRoles={}}})},this.setPosseState=function(t,e,n){var i=T[e];i&&w(t,function(t){t._katavorioDrag&&t._katavorioDrag.posses&&(t._katavorioDrag.posseRoles[i.name]=n)})}}}.call(this),function(){var t=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e=function(t){return"[object Number]"===Object.prototype.toString.call(t)},n=function(t){return"string"==typeof t},i=function(t){return"boolean"==typeof t},r=function(t){return null==t},o=function(t){return null==t?!1:"[object Object]"===Object.prototype.toString.call(t)},a=function(t){return"[object Date]"===Object.prototype.toString.call(t)},s=function(t){return"[object Function]"===Object.prototype.toString.call(t)},l=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},u=this,c=u.jsPlumbUtil={isArray:t,isString:n,isBoolean:i,isNull:r,isObject:o,isDate:a,isFunction:s,isEmpty:l,isNumber:e,clone:function(e){if(n(e))return""+e;if(i(e))return!!e;if(a(e))return new Date(e.getTime());if(s(e))return e;if(t(e)){for(var r=[],l=0;l<e.length;l++)r.push(this.clone(e[l]));return r}if(o(e)){var u={};for(var c in e)u[c]=this.clone(e[c]);return u}return e},merge:function(e,r,a){var s,l,u={};for(a=a||[],l=0;l<a.length;l++)u[a[l]]=!0;var c=this.clone(e);for(l in r)if(null==c[l])c[l]=r[l];else if(n(r[l])||i(r[l]))u[l]?(s=[],s.push.apply(s,t(c[l])?c[l]:[c[l]]),s.push.apply(s,t(r[l])?r[l]:[r[l]]),c[l]=s):c[l]=r[l];else if(t(r[l]))s=[],t(c[l])&&s.push.apply(s,c[l]),s.push.apply(s,r[l]),c[l]=s;else if(o(r[l])){o(c[l])||(c[l]={});for(var d in r[l])c[l][d]=r[l][d]}return c},replace:function(t,e,n){if(null!=t){var i=t,r=i;return e.replace(/([^\.])+/g,function(t,e,i,o){var a=t.match(/([^\[0-9]+){1}(\[)([0-9+])/),s=i+t.length>=o.length,l=function(){return r[a[1]]||function(){return r[a[1]]=[],r[a[1]]}()};if(s)a?l()[a[3]]=n:r[t]=n;else if(a){var u=l();r=u[a[3]]||function(){return u[a[3]]={},u[a[3]]}()}else r=r[t]||function(){return r[t]={},r[t]}()}),t}},functionChain:function(t,e,n){for(var i=0;i<n.length;i++){var r=n[i][0][n[i][1]].apply(n[i][0],n[i][2]);if(r===e)return r}return t},populate:function(e,i,r){var a=function(t){var e=t.match(/(\${.*?})/g);if(null!=e)for(var n=0;n<e.length;n++){var r=i[e[n].substring(2,e[n].length-1)]||"";null!=r&&(t=t.replace(e[n],r))}return t},l=function(e){if(null!=e){if(n(e))return a(e);if(!s(e)||null!=r&&0!==(e.name||"").indexOf(r)){if(t(e)){for(var u=[],c=0;c<e.length;c++)u.push(l(e[c]));return u}if(o(e)){var d={};for(var h in e)d[h]=l(e[h]);return d}return e}return e(i)}};return l(e)},findWithFunction:function(t,e){if(t)for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1},removeWithFunction:function(t,e){var n=c.findWithFunction(t,e);return n>-1&&t.splice(n,1),-1!=n},remove:function(t,e){var n=t.indexOf(e);return n>-1&&t.splice(n,1),-1!=n},addWithFunction:function(t,e,n){-1==c.findWithFunction(t,n)&&t.push(e)},addToList:function(t,e,n,i){var r=t[e];return null==r&&(r=[],t[e]=r),r[i?"unshift":"push"](n),r},extend:function(e,n,i){var r;for(n=t(n)?n:[n],r=0;r<n.length;r++)for(var o in n[r].prototype)n[r].prototype.hasOwnProperty(o)&&(e.prototype[o]=n[r].prototype[o]);var a=function(t,e){return function(){for(r=0;r<n.length;r++)n[r].prototype[t]&&n[r].prototype[t].apply(this,arguments);return e.apply(this,arguments)}},s=function(t){for(var n in t)e.prototype[n]=a(n,t[n])};if(arguments.length>2)for(r=2;r<arguments.length;r++)s(arguments[r]);return e},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"==t?e:3&e|8;return n.toString(16)})},logEnabled:!0,log:function(){if(c.logEnabled&&"undefined"!=typeof console)try{var t=arguments[arguments.length-1];console.log(t)}catch(e){}},wrap:function(t,e,n){return t=t||function(){},e=e||function(){},function(){var i=null;try{i=e.apply(this,arguments)}catch(r){c.log("jsPlumb function failed : "+r)}if(null==n||i!==n)try{i=t.apply(this,arguments)}catch(r){c.log("wrapped function failed : "+r)}return i}}};c.EventGenerator=function(){var t={},e=!1,n={ready:!0};this.bind=function(e,n,i){var r=function(e){c.addToList(t,e,n,i),n.__jsPlumb=n.__jsPlumb||{},n.__jsPlumb[jsPlumbUtil.uuid()]=e};if("string"==typeof e)r(e);else if(null!=e.length)for(var o=0;o<e.length;o++)r(e[o]);return this},this.fire=function(i,r,o){if(!e&&t[i]){var a=t[i].length,s=0,l=!1,u=null;if(!this.shouldFireEvent||this.shouldFireEvent(i,r,o))for(;!l&&a>s&&u!==!1;){
if(n[i])t[i][s].apply(this,[r,o]);else try{u=t[i][s].apply(this,[r,o])}catch(d){c.log("jsPlumb: fire failed for event "+i+" : "+d)}s++,null!=t&&null!=t[i]||(l=!0)}}return this},this.unbind=function(e,n){if(0===arguments.length)t={};else if(1===arguments.length){if("string"==typeof e)delete t[e];else if(e.__jsPlumb){var i;for(var r in e.__jsPlumb)i=e.__jsPlumb[r],c.remove(t[i]||[],e)}}else 2===arguments.length&&c.remove(t[e]||[],n);return this},this.getListener=function(e){return t[e]},this.setSuspendEvents=function(t){e=t},this.isSuspendEvents=function(){return e},this.silently=function(t){this.setSuspendEvents(!0);try{t()}catch(e){jsPlumbUtil.log("Cannot execute silent function "+e)}this.setSuspendEvents(!1)},this.cleanupListeners=function(){for(var e in t)t[e]=null}},c.EventGenerator.prototype={cleanup:function(){this.cleanupListeners()}}}.call(this),function(){"use strict";var t=this,e=t.jsPlumbUtil;e.matchesSelector=function(t,e,n){n=n||t.parentNode;for(var i=n.querySelectorAll(e),r=0;r<i.length;r++)if(i[r]===t)return!0;return!1},e.consume=function(t,e){t.stopPropagation?t.stopPropagation():t.returnValue=!1,!e&&t.preventDefault&&t.preventDefault()},e.sizeElement=function(t,e,n,i,r){t&&(t.style.height=r+"px",t.height=r,t.style.width=i+"px",t.width=i,t.style.left=e+"px",t.style.top=n+"px")}}.call(this),function(){"use strict";var t,e=this,n=[],i=e.jsPlumbUtil,r=function(){return""+(new Date).getTime()},o=function(t){if(t._jsPlumb.paintStyle&&t._jsPlumb.hoverPaintStyle){var e={};v.extend(e,t._jsPlumb.paintStyle),v.extend(e,t._jsPlumb.hoverPaintStyle),delete t._jsPlumb.hoverPaintStyle,e.gradient&&t._jsPlumb.paintStyle.fillStyle&&delete e.gradient,t._jsPlumb.hoverPaintStyle=e}},a=["tap","dbltap","click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu"],s=function(t,e,n,i){var r=t.getAttachedElements();if(r)for(var o=0,a=r.length;a>o;o++)i&&i==r[o]||r[o].setHover(e,!0,n)},l=function(t){return null==t?null:t.split(" ")},u=function(t,e,n){for(var i in e)t[i]=n},c=function(t,e){e=i.isArray(e)||null!=e.length&&!i.isString(e)?e:[e];for(var n=0;n<e.length;n++)try{t.apply(e[n],[e[n]])}catch(r){i.log(".each iteration failed : "+r)}},d=function(t,e,n){if(t.getDefaultType){var r=t.getTypeDescriptor(),o={},a=t.getDefaultType(),s=i.merge({},a);u(o,a,"__default");for(var l=0,c=t._jsPlumb.types.length;c>l;l++){var d=t._jsPlumb.types[l];if("__default"!==d){var h=t._jsPlumb.instance.getType(d,r);null!=h&&(s=i.merge(s,h,["cssClass"]),u(o,h,d))}}e&&(s=i.populate(s,e,"_")),t.applyType(s,n,o),n||t.repaint()}},h=e.jsPlumbUIComponent=function(t){i.EventGenerator.apply(this,arguments);var e=this,n=arguments,r=e.idPrefix,o=r+(new Date).getTime();this._jsPlumb={instance:t._jsPlumb,parameters:t.parameters||{},paintStyle:null,hoverPaintStyle:null,paintStyleInUse:null,hover:!1,beforeDetach:t.beforeDetach,beforeDrop:t.beforeDrop,overlayPlacements:[],hoverClass:t.hoverClass||t._jsPlumb.Defaults.HoverClass,types:[],typeCache:{}},this.cacheTypeItem=function(t,e,n){this._jsPlumb.typeCache[n]=this._jsPlumb.typeCache[n]||{},this._jsPlumb.typeCache[n][t]=e},this.getCachedTypeItem=function(t,e){return this._jsPlumb.typeCache[e]?this._jsPlumb.typeCache[e][t]:null},this.getId=function(){return o};var a=t.overlays||[],s={};if(this.defaultOverlayKeys){for(var l=0;l<this.defaultOverlayKeys.length;l++)Array.prototype.push.apply(a,this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[l]]||[]);for(l=0;l<a.length;l++){var u=v.convertToFullOverlaySpec(a[l]);s[u[1].id]=u}}var c={overlays:s,parameters:t.parameters||{},scope:t.scope||this._jsPlumb.instance.getDefaultScope()};if(this.getDefaultType=function(){return c},this.appendToDefaultType=function(t){for(var e in t)c[e]=t[e]},t.events)for(l in t.events)e.bind(l,t.events[l]);this.clone=function(){var t={};return this.constructor.apply(t,n),t}.bind(this),this.isDetachAllowed=function(t){var e=!0;if(this._jsPlumb.beforeDetach)try{e=this._jsPlumb.beforeDetach(t)}catch(n){i.log("jsPlumb: beforeDetach callback failed",n)}return e},this.isDropAllowed=function(t,e,n,r,o,a,s){var l=this._jsPlumb.instance.checkCondition("beforeDrop",{sourceId:t,targetId:e,scope:n,connection:r,dropEndpoint:o,source:a,target:s});if(this._jsPlumb.beforeDrop)try{l=this._jsPlumb.beforeDrop({sourceId:t,targetId:e,scope:n,connection:r,dropEndpoint:o,source:a,target:s})}catch(u){i.log("jsPlumb: beforeDrop callback failed",u)}return l};var d=[];this.setListenerComponent=function(t){for(var e=0;e<d.length;e++)d[e][3]=t}},f=function(t,e){var n=t._jsPlumb.types[e],i=t._jsPlumb.instance.getType(n,t.getTypeDescriptor());null!=i&&i.cssClass&&t.canvas&&t._jsPlumb.instance.removeClass(t.canvas,i.cssClass)};i.extend(e.jsPlumbUIComponent,i.EventGenerator,{getParameter:function(t){return this._jsPlumb.parameters[t]},setParameter:function(t,e){this._jsPlumb.parameters[t]=e},getParameters:function(){return this._jsPlumb.parameters},setParameters:function(t){this._jsPlumb.parameters=t},getClass:function(){return v.getClass(this.canvas)},hasClass:function(t){return v.hasClass(this.canvas,t)},addClass:function(t){v.addClass(this.canvas,t)},removeClass:function(t){v.removeClass(this.canvas,t)},updateClasses:function(t,e){v.updateClasses(this.canvas,t,e)},setType:function(t,e,n){this.clearTypes(),this._jsPlumb.types=l(t)||[],d(this,e,n)},getType:function(){return this._jsPlumb.types},reapplyTypes:function(t,e){d(this,t,e)},hasType:function(t){return-1!=this._jsPlumb.types.indexOf(t)},addType:function(t,e,n){var i=l(t),r=!1;if(null!=i){for(var o=0,a=i.length;a>o;o++)this.hasType(i[o])||(this._jsPlumb.types.push(i[o]),r=!0);r&&d(this,e,n)}},removeType:function(t,e,n){var i=l(t),r=!1,o=function(t){var e=this._jsPlumb.types.indexOf(t);return-1!=e?(f(this,e),this._jsPlumb.types.splice(e,1),!0):!1}.bind(this);if(null!=i){for(var a=0,s=i.length;s>a;a++)r=o(i[a])||r;r&&d(this,e,n)}},clearTypes:function(t,e){for(var n=this._jsPlumb.types.length,i=0;n>i;i++)f(this,0),this._jsPlumb.types.splice(0,1);d(this,t,e)},toggleType:function(t,e,n){var i=l(t);if(null!=i){for(var r=0,o=i.length;o>r;r++){var a=this._jsPlumb.types.indexOf(i[r]);-1!=a?(f(this,a),this._jsPlumb.types.splice(a,1)):this._jsPlumb.types.push(i[r])}d(this,e,n)}},applyType:function(t,e){if(this.setPaintStyle(t.paintStyle,e),this.setHoverPaintStyle(t.hoverPaintStyle,e),t.parameters)for(var n in t.parameters)this.setParameter(n,t.parameters[n]);this._jsPlumb.paintStyleInUse=this.getPaintStyle()},setPaintStyle:function(t,e){this._jsPlumb.paintStyle=t,this._jsPlumb.paintStyleInUse=this._jsPlumb.paintStyle,o(this),e||this.repaint()},getPaintStyle:function(){return this._jsPlumb.paintStyle},setHoverPaintStyle:function(t,e){this._jsPlumb.hoverPaintStyle=t,o(this),e||this.repaint()},getHoverPaintStyle:function(){return this._jsPlumb.hoverPaintStyle},destroy:function(t){(t||null==this.typeId)&&(this.cleanupListeners(),this.clone=null,this._jsPlumb=null)},isHover:function(){return this._jsPlumb.hover},setHover:function(t,e,n){if(this._jsPlumb&&!this._jsPlumb.instance.currentlyDragging&&!this._jsPlumb.instance.isHoverSuspended()){if(this._jsPlumb.hover=t,null!=this.canvas){if(null!=this._jsPlumb.instance.hoverClass){var i=t?"addClass":"removeClass";this._jsPlumb.instance[i](this.canvas,this._jsPlumb.instance.hoverClass)}null!=this._jsPlumb.hoverClass&&this._jsPlumb.instance[i](this.canvas,this._jsPlumb.hoverClass)}null!=this._jsPlumb.hoverPaintStyle&&(this._jsPlumb.paintStyleInUse=t?this._jsPlumb.hoverPaintStyle:this._jsPlumb.paintStyle,this._jsPlumb.instance.isSuspendDrawing()||(n=n||r(),this.repaint({timestamp:n,recalc:!1}))),this.getAttachedElements&&!e&&s(this,t,r(),this)}}});var p=0,m=function(){var t=p+1;return p++,t},g=window.jsPlumbInstance=function(e){this.Defaults={Anchor:"Bottom",Anchors:[null,null],ConnectionsDetachable:!0,ConnectionOverlays:[],Connector:"Bezier",Container:null,DoNotThrowErrors:!1,DragOptions:{},DropOptions:{},Endpoint:"Dot",EndpointOverlays:[],Endpoints:[null,null],EndpointStyle:{fillStyle:"#456"},EndpointStyles:[null,null],EndpointHoverStyle:null,EndpointHoverStyles:[null,null],HoverPaintStyle:null,LabelStyle:{color:"black"},LogEnabled:!1,Overlays:[],MaxConnections:1,PaintStyle:{lineWidth:4,strokeStyle:"#456"},ReattachConnections:!1,RenderMode:"svg",Scope:"jsPlumb_DefaultScope"},e&&v.extend(this.Defaults,e),this.logEnabled=this.Defaults.LogEnabled,this._connectionTypes={},this._endpointTypes={},i.EventGenerator.apply(this);var o=this,s=m(),l=o.bind,u={},d=1,f=function(t){if(null==t)return null;if(3==t.nodeType||8==t.nodeType)return{el:t,text:!0};var e=o.getElement(t);return{el:e,id:i.isString(t)&&null==e?t:K(e)}};this.getInstanceIndex=function(){return s},this.setZoom=function(t,e){return d=t,o.fire("zoom",d),e&&o.repaintEverything(),!0},this.getZoom=function(){return d};for(var p in this.Defaults)u[p]=this.Defaults[p];var g,y=[];this.unbindContainer=function(){if(null!=g&&y.length>0)for(var t=0;t<y.length;t++)o.off(g,y[t][0],y[t][1])},this.setContainer=function(t){this.unbindContainer(),t=this.getElement(t),this.select().each(function(e){e.moveParent(t)}),this.selectEndpoints().each(function(e){e.moveParent(t)});var e=g;g=t,y.length=0;for(var n=function(t,e){var n=e.srcElement||e.target,i=(n&&n.parentNode?n.parentNode._jsPlumb:null)||(n?n._jsPlumb:null)||(n&&n.parentNode&&n.parentNode.parentNode?n.parentNode.parentNode._jsPlumb:null);i&&(i.fire(t,i,e),o.fire(t,i.component||i,e))},i=function(t,e,n){y.push([t,n]),o.on(g,t,e,n)},r=function(t){i(t,".jsplumb-connector > *",function(e){n(t,e)}),i(t,".jsplumb-endpoint, .jsplumb-endpoint > *, .jsplumb-endpoint svg *",function(e){n(t,e)}),i(t,".jsplumb-overlay, .jsplumb-overlay *",function(e){n(t,e)})},s=0;s<a.length;s++)r(a[s]);for(var l in S){var u=S[l].el;u.parentNode===e&&(e.removeChild(u),g.appendChild(u))}},this.getContainer=function(){return g},this.bind=function(t,e){"ready"===t&&$?e():l.apply(o,[t,e])},o.importDefaults=function(t){for(var e in t)o.Defaults[e]=t[e];return t.Container&&o.setContainer(t.Container),o},o.restoreDefaults=function(){return o.Defaults=v.extend({},u),o};var b=null,$=!1,w=[],x={},C={},S={},k={},D={},E={},_=!1,M=[],T=!1,P=null,A=this.Defaults.Scope,j=1,O=function(){return""+j++},F=function(t,e){g?g.appendChild(t):e?this.getElement(e).appendChild(t):this.appendToRoot(t)}.bind(this),I=function(t,e,n,i){if(!v.headless&&!T){var a=K(t),s=o.getDragManager().getElementsForDraggable(a);null==n&&(n=r());var l=gt({elId:a,offset:e,recalc:!1,timestamp:n});if(s)for(var u in s)gt({elId:s[u].id,offset:{left:l.o.left+s[u].offset.left,top:l.o.top+s[u].offset.top},recalc:!1,timestamp:n});if(o.anchorManager.redraw(a,e,n,null,i),s)for(var c in s)o.anchorManager.redraw(s[c].id,e,n,s[c].offset,i,!0)}},N=function(t){return C[t]},R=function(t,e,n,r){if(!v.headless){var a=null==e?!1:e;if(a&&v.isDragSupported(t,o)){var s=n||o.Defaults.DragOptions;if(s=v.extend({},s),v.isAlreadyDraggable(t,o))n.force&&o.initDraggable(t,s);else{var l=v.dragEvents.drag,u=v.dragEvents.stop,c=v.dragEvents.start,d=o.getElement(t),h=o.getDragManager().getDragAncestor(d),f={left:0,top:0},p=f,m=!1;mt(r,t),s[c]=i.wrap(s[c],function(){return p=null!=h?o.getOffset(h):f,o.setHoverSuspended(!0),o.select({source:t}).addClass(o.elementDraggingClass+" "+o.sourceElementDraggingClass,!0),o.select({target:t}).addClass(o.elementDraggingClass+" "+o.targetElementDraggingClass,!0),o.setConnectionBeingDragged(!0),s.canDrag?n.canDrag():void 0},!1),s[l]=i.wrap(s[l],function(){var e=o.getUIPosition(arguments,o.getZoom());e.left+=p.left,e.top+=p.top,I(t,e,null,!0),m&&o.addClass(t,"jsplumb-dragged"),m=!0}),s[u]=i.wrap(s[u],function(){for(var t=arguments[0].selection,e=o.getUIPosition(arguments),n=function(t){I(t[0],e),o.removeClass(t[0],"jsplumb-dragged"),o.select({source:t[0]}).removeClass(o.elementDraggingClass+" "+o.sourceElementDraggingClass,!0),o.select({target:t[0]}).removeClass(o.elementDraggingClass+" "+o.targetElementDraggingClass,!0),o.getDragManager().dragEnded(t[0])},i=0;i<t.length;i++)n(t[i]);m=!1,o.setHoverSuspended(!1),o.setConnectionBeingDragged(!1)});var g=K(t);E[g]=!0;var y=E[g];s.disabled=null==y?!1:!y,o.initDraggable(t,s),o.getDragManager().register(t)}}}},L=function(t,e){for(var n=t.scope.split(/\s/),i=e.scope.split(/\s/),r=0;r<n.length;r++)for(var o=0;o<i.length;o++)if(i[o]==n[r])return!0;return!1},V=function(t,e){var n=v.extend({},t);if(e&&v.extend(n,e),n.source&&(n.source.endpoint?n.sourceEndpoint=n.source:n.source=o.getElement(n.source)),n.target&&(n.target.endpoint?n.targetEndpoint=n.target:n.target=o.getElement(n.target)),t.uuids&&(n.sourceEndpoint=N(t.uuids[0]),n.targetEndpoint=N(t.uuids[1])),n.sourceEndpoint&&n.sourceEndpoint.isFull())return void i.log(o,"could not add connection; source endpoint is full");if(n.targetEndpoint&&n.targetEndpoint.isFull())return void i.log(o,"could not add connection; target endpoint is full");if(!n.type&&n.sourceEndpoint&&(n.type=n.sourceEndpoint.connectionType),n.sourceEndpoint&&n.sourceEndpoint.connectorOverlays){n.overlays=n.overlays||[];for(var r=0,a=n.sourceEndpoint.connectorOverlays.length;a>r;r++)n.overlays.push(n.sourceEndpoint.connectorOverlays[r])}n.sourceEndpoint&&n.sourceEndpoint.scope&&(n.scope=n.sourceEndpoint.scope),!n["pointer-events"]&&n.sourceEndpoint&&n.sourceEndpoint.connectorPointerEvents&&(n["pointer-events"]=n.sourceEndpoint.connectorPointerEvents);var s=function(t,e){var n=v.extend({},t);for(var i in e)e[i]&&(n[i]=e[i]);return n},l=function(t,e,i){return o.addEndpoint(t,s(e,{anchor:n.anchors?n.anchors[i]:n.anchor,endpoint:n.endpoints?n.endpoints[i]:n.endpoint,paintStyle:n.endpointStyles?n.endpointStyles[i]:n.endpointStyle,hoverPaintStyle:n.endpointHoverStyles?n.endpointHoverStyles[i]:n.endpointHoverStyle}))},u=function(t,e,i,r){if(n[t]&&!n[t].endpoint&&!n[t+"Endpoint"]&&!n.newConnection){var o=K(n[t]),a=i[o];if(a=a?a[r]:null){if(!a.enabled)return!1;var s=null!=a.endpoint&&a.endpoint._jsPlumb?a.endpoint:l(n[t],a.def,e);if(s.isFull())return!1;n[t+"Endpoint"]=s,s._doNotDeleteOnDetach=!1,s._deleteOnDetach=!0,a.uniqueEndpoint&&(a.endpoint?s.finalEndpoint=a.endpoint:(a.endpoint=s,s._deleteOnDetach=!1,s._doNotDeleteOnDetach=!0))}}};return u("source",0,this.sourceEndpointDefinitions,n.type||"default")!==!1&&u("target",1,this.targetEndpointDefinitions,n.type||"default")!==!1?(n.sourceEndpoint&&n.targetEndpoint&&(L(n.sourceEndpoint,n.targetEndpoint)||(n=null)),n):void 0}.bind(o),H=function(t){var e=o.Defaults.ConnectionType||o.getDefaultConnectionType();t._jsPlumb=o,t.newConnection=H,t.newEndpoint=U,t.endpointsByUUID=C,t.endpointsByElement=x,t.finaliseConnection=B,t.id="con_"+O();var n=new e(t);return n.isDetachable()&&(n.endpoints[0].initDraggable("_jsPlumbSource"),n.endpoints[1].initDraggable("_jsPlumbTarget")),n},B=o.finaliseConnection=function(t,e,n,i){if(e=e||{},t.suspendedEndpoint||w.push(t),t.pending=null,t.endpoints[0].isTemporarySource=!1,i!==!1&&o.anchorManager.newConnection(t),I(t.source),!e.doNotFireConnectionEvent&&e.fireEvent!==!1){var r={connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]};o.fire("connection",r,n)}},U=function(t,e){var n=o.Defaults.EndpointType||v.Endpoint,i=v.extend({},t);i._jsPlumb=o,i.newConnection=H,i.newEndpoint=U,i.endpointsByUUID=C,i.endpointsByElement=x,i.fireDetachEvent=J,i.elementId=e||K(i.source);var r=new n(i);return r.id="ep_"+O(),mt(i.elementId,i.source),v.headless||o.getDragManager().endpointAdded(i.source,e),r},Y=function(t,e,n){var i=x[t];if(i&&i.length)for(var r=0,o=i.length;o>r;r++){for(var a=0,s=i[r].connections.length;s>a;a++){var l=e(i[r].connections[a]);if(l)return}n&&n(i[r])}},W=function(t,e){return v.each(t,function(t){o.isDragSupported(t)&&(E[o.getAttribute(t,"id")]=e,o.setElementDraggable(t,e))})},z=function(t,e,n){e="block"===e;var i=null;n&&(i=e?function(t){t.setVisible(!0,!0,!0)}:function(t){t.setVisible(!1,!0,!0)});var r=f(t);Y(r.id,function(t){if(e&&n){var i=t.sourceId===r.id?1:0;t.endpoints[i].isVisible()&&t.setVisible(!0)}else t.setVisible(e)},i)},G=function(t){return v.each(t,function(t){var e=o.getAttribute(t,"id"),n=null==E[e]?!1:E[e];return n=!n,E[e]=n,o.setDraggable(t,n),n}.bind(this))},q=function(t,e){var n=null;e&&(n=function(t){var e=t.isVisible();t.setVisible(!e)}),Y(t,function(t){var e=t.isVisible();t.setVisible(!e)},n)},X=function(t){var e=k[t];return e?{o:e,s:M[t]}:gt({elId:t})},K=function(t,e,n){if(i.isString(t))return t;if(null==t)return null;var r=o.getAttribute(t,"id");return r&&"undefined"!==r||(2==arguments.length&&void 0!==arguments[1]?r=e:(1==arguments.length||3==arguments.length&&!arguments[2])&&(r="jsPlumb_"+s+"_"+O()),n||o.setAttribute(t,"id",r)),r};this.setConnectionBeingDragged=function(t){_=t},this.isConnectionBeingDragged=function(){return _},this.getManagedElements=function(){return S},this.getRenderMode=function(){return"svg"},this.connectorClass="jsplumb-connector",this.connectorOutlineClass="jsplumb-connector-outline",this.editableConnectorClass="jsplumb-connector-editable",this.connectedClass="jsplumb-connected",this.hoverClass="jsplumb-hover",this.endpointClass="jsplumb-endpoint",this.endpointConnectedClass="jsplumb-endpoint-connected",this.endpointFullClass="jsplumb-endpoint-full",this.endpointDropAllowedClass="jsplumb-endpoint-drop-allowed",this.endpointDropForbiddenClass="jsplumb-endpoint-drop-forbidden",this.overlayClass="jsplumb-overlay",this.draggingClass="jsplumb-dragging",this.elementDraggingClass="jsplumb-element-dragging",this.sourceElementDraggingClass="jsplumb-source-element-dragging",this.targetElementDraggingClass="jsplumb-target-element-dragging",this.endpointAnchorClassPrefix="jsplumb-endpoint-anchor",this.hoverSourceClass="jsplumb-source-hover",this.hoverTargetClass="jsplumb-target-hover",this.dragSelectClass="jsplumb-drag-select",this.Anchors={},this.Connectors={svg:{}},this.Endpoints={svg:{}},this.Overlays={svg:{}},this.ConnectorRenderers={},this.SVG="svg",this.addEndpoint=function(t,e,n){n=n||{};var r=v.extend({},n);v.extend(r,e),r.endpoint=r.endpoint||o.Defaults.Endpoint,r.paintStyle=r.paintStyle||o.Defaults.EndpointStyle;for(var a=[],s=i.isArray(t)||null!=t.length&&!i.isString(t)?t:[t],l=0,u=s.length;u>l;l++){r.source=o.getElement(s[l]),ft(r.source);var c=K(r.source),d=U(r,c),h=mt(c,r.source).info.o;i.addToList(x,c,d),T||d.paint({anchorLoc:d.anchor.compute({xy:[h.left,h.top],wh:M[c],element:d,timestamp:P}),timestamp:P}),a.push(d),d._doNotDeleteOnDetach=!0}return 1==a.length?a[0]:a},this.addEndpoints=function(t,e,n){for(var r=[],a=0,s=e.length;s>a;a++){var l=o.addEndpoint(t,e[a],n);i.isArray(l)?Array.prototype.push.apply(r,l):r.push(l)}return r},this.animate=function(t,e,n){if(!this.animationSupported)return!1;n=n||{};var r=o.getElement(t),a=K(r),s=v.animEvents.step,l=v.animEvents.complete;n[s]=i.wrap(n[s],function(){o.revalidate(a)}),n[l]=i.wrap(n[l],function(){o.revalidate(a)}),o.doAnimate(r,e,n)},this.checkCondition=function(t,e){var n=o.getListener(t),r=!0;if(n&&n.length>0){var a=Array.prototype.slice.call(arguments,1);try{for(var s=0,l=n.length;l>s;s++)r=r&&n[s].apply(n[s],a)}catch(u){i.log(o,"cannot check condition ["+t+"]"+u)}}return r},this.connect=function(t,e){var n,r=V(t,e);if(r){if(null==r.source&&null==r.sourceEndpoint)return void i.log("Cannot establish connection - source does not exist");if(null==r.target&&null==r.targetEndpoint)return void i.log("Cannot establish connection - target does not exist");ft(r.source),n=H(r),B(n,r)}return n};var Z=[{el:"source",elId:"sourceId",epDefs:"sourceEndpointDefinitions"},{el:"target",elId:"targetId",epDefs:"targetEndpointDefinitions"}],Q=function(t,e,n,i){var r,o,a,s=Z[n],l=t[s.elId],u=(t[s.el],t.endpoints[n]),c={index:n,originalSourceId:0===n?l:t.sourceId,newSourceId:t.sourceId,originalTargetId:1==n?l:t.targetId,newTargetId:t.targetId,connection:t};if(e.constructor==v.Endpoint)r=e,r.addConnection(t);else if(o=K(e),a=this[s.epDefs][o],o===t[s.elId])r=null;else if(a)for(var d in a){if(!a[d].enabled)return;r=null!=a[d].endpoint&&a[d].endpoint._jsPlumb?a[d].endpoint:this.addEndpoint(e,a[d].def),a[d].uniqueEndpoint&&(a[d].endpoint=r),r._doNotDeleteOnDetach=!1,r._deleteOnDetach=!0,r.addConnection(t)}else r=t.makeEndpoint(0===n,e,o),r._doNotDeleteOnDetach=!1,r._deleteOnDetach=!0;return null!=r&&(u.detachFromConnection(t),t.endpoints[n]=r,t[s.el]=r.element,t[s.elId]=r.elementId,c[0===n?"newSourceId":"newTargetId"]=r.elementId,tt(c),i||t.repaint()),c}.bind(this);this.setSource=function(t,e,n){var i=Q(t,e,0,n);this.anchorManager.sourceChanged(i.originalSourceId,i.newSourceId,t)},this.setTarget=function(t,e,n){var i=Q(t,e,1,n);this.anchorManager.updateOtherEndpoint(i.originalSourceId,i.originalTargetId,i.newTargetId,t)},this.deleteEndpoint=function(t,e){var n="string"==typeof t?C[t]:t;return n&&o.deleteObject({endpoint:n,dontUpdateHover:e}),o},this.deleteEveryEndpoint=function(){var t=o.setSuspendDrawing(!0);for(var e in x){var n=x[e];if(n&&n.length)for(var i=0,r=n.length;r>i;i++)o.deleteEndpoint(n[i],!0)}return x={},S={},C={},k={},D={},o.anchorManager.reset(),o.getDragManager().reset(),t||o.setSuspendDrawing(!1),o};var J=function(t,e,n){var i=o.Defaults.ConnectionType||o.getDefaultConnectionType(),r=t.constructor==i,a=r?{connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]}:t;e&&o.fire("connectionDetached",a,n),o.anchorManager.connectionDetached(a)},tt=o.fireMoveEvent=function(t,e){o.fire("connectionMoved",t,e)};this.unregisterEndpoint=function(t){t._jsPlumb.uuid&&(C[t._jsPlumb.uuid]=null),o.anchorManager.deleteEndpoint(t);for(var e in x){var n=x[e];if(n){for(var i=[],r=0,a=n.length;a>r;r++)n[r]!=t&&i.push(n[r]);x[e]=i}x[e].length<1&&delete x[e]}},this.detach=function(){if(0!==arguments.length){var t=o.Defaults.ConnectionType||o.getDefaultConnectionType(),e=arguments[0].constructor==t,n=2==arguments.length&&e?arguments[1]||{}:arguments[0],r=n.fireEvent!==!1,a=n.forceDetach,s=e?arguments[0]:n.connection;if(s)(a||i.functionChain(!0,!1,[[s.endpoints[0],"isDetachAllowed",[s]],[s.endpoints[1],"isDetachAllowed",[s]],[s,"isDetachAllowed",[s]],[o,"checkCondition",["beforeDetach",s]]]))&&s.endpoints[0].detach(s,!1,!0,r);else{var l=v.extend({},n);if(l.uuids)N(l.uuids[0]).detachFrom(N(l.uuids[1]),r);else if(l.sourceEndpoint&&l.targetEndpoint)l.sourceEndpoint.detachFrom(l.targetEndpoint);else{var u=K(o.getElement(l.source)),c=K(o.getElement(l.target));Y(u,function(t){(t.sourceId==u&&t.targetId==c||t.targetId==u&&t.sourceId==c)&&o.checkCondition("beforeDetach",t)&&t.endpoints[0].detach(t,!1,!0,r)})}}}},this.detachAllConnections=function(t,e){e=e||{},t=o.getElement(t);var n=K(t),i=x[n];if(i&&i.length)for(var r=0,a=i.length;a>r;r++)i[r].detachAll(e.fireEvent!==!1,e.forceDetach);return o},this.detachEveryConnection=function(t){return t=t||{},o.batch(function(){for(var e in x){var n=x[e];if(n&&n.length)for(var i=0,r=n.length;r>i;i++)n[i].detachAll(t.fireEvent!==!1,t.forceDetach)}w.length=0}),o},this.deleteObject=function(t){var e={endpoints:{},connections:{},endpointCount:0,connectionCount:0},n=(t.fireEvent!==!1,t.deleteAttachedObjects!==!1),r=function(i){if(null!=i&&null==e.connections[i.id]&&(t.dontUpdateHover||null==i._jsPlumb||i.setHover(!1),e.connections[i.id]=i,e.connectionCount++,n))for(var r=0;r<i.endpoints.length;r++)i.endpoints[r]._deleteOnDetach&&a(i.endpoints[r])},a=function(i){if(null!=i&&null==e.endpoints[i.id]&&(t.dontUpdateHover||null==i._jsPlumb||i.setHover(!1),e.endpoints[i.id]=i,e.endpointCount++,n))for(var o=0;o<i.connections.length;o++){var a=i.connections[o];r(a)}};t.connection?r(t.connection):a(t.endpoint);for(var s in e.connections){var l=e.connections[s];l._jsPlumb&&(i.removeWithFunction(w,function(t){return l.id==t.id}),J(l,t.fireEvent===!1?!1:!l.pending,t.originalEvent),l.endpoints[0].detachFromConnection(l),l.endpoints[1].detachFromConnection(l),l.cleanup(!0),l.destroy(!0))}for(var u in e.endpoints){var c=e.endpoints[u];c._jsPlumb&&(o.unregisterEndpoint(c),c.cleanup(!0),c.destroy(!0))}return e},this.draggable=function(t,e){var n;return c(function(t){n=f(t),n.el&&R(n.el,!0,e,n.id)},t),o},this.droppable=function(t,e){var n;return e=e||{},e.allowLoopback=!1,c(function(t){n=f(t),n.el&&o.initDroppable(n.el,e)},t),o};var et=function(t,e,n,i){for(var r=0,o=t.length;o>r;r++)t[r][e].apply(t[r],n);return i(t)},nt=function(t,e,n){for(var i=[],r=0,o=t.length;o>r;r++)i.push([t[r][e].apply(t[r],n),t[r]]);return i},it=function(t,e,n){return function(){return et(t,e,arguments,n)}},rt=function(t,e){return function(){return nt(t,e,arguments)}},ot=function(t,e){var n=[];if(t)if("string"==typeof t){if("*"===t)return t;n.push(t)}else if(e)n=t;else if(t.length)for(var i=0,r=t.length;r>i;i++)n.push(f(t[i]).id);else n.push(f(t).id);return n},at=function(t,e,n){return"*"===t?!0:t.length>0?-1!=t.indexOf(e):!n};this.getConnections=function(t,e){t?t.constructor==String&&(t={scope:t}):t={};for(var n=t.scope||o.getDefaultScope(),i=ot(n,!0),r=ot(t.source),a=ot(t.target),s=!e&&i.length>1?{}:[],l=function(t,n){if(!e&&i.length>1){var r=s[t];null==r&&(r=s[t]=[]),r.push(n)}else s.push(n)},u=0,c=w.length;c>u;u++){var d=w[u];at(i,d.scope)&&at(r,d.sourceId)&&at(a,d.targetId)&&l(d.scope,d)}return s};var st=function(t,e){return function(n){for(var i=0,r=t.length;r>i;i++)n(t[i]);return e(t)}},lt=function(t){return function(e){return t[e]}},ut=function(t,e){var n,i,r={length:t.length,each:st(t,e),get:lt(t)},o=["setHover","removeAllOverlays","setLabel","addClass","addOverlay","removeOverlay","removeOverlays","showOverlay","hideOverlay","showOverlays","hideOverlays","setPaintStyle","setHoverPaintStyle","setSuspendEvents","setParameter","setParameters","setVisible","repaint","addType","toggleType","removeType","removeClass","setType","bind","unbind"],a=["getLabel","getOverlay","isHover","getParameter","getParameters","getPaintStyle","getHoverPaintStyle","isVisible","hasType","getType","isSuspendEvents"];for(n=0,i=o.length;i>n;n++)r[o[n]]=it(t,o[n],e);for(n=0,i=a.length;i>n;n++)r[a[n]]=rt(t,a[n]);return r},ct=function(t){var e=ut(t,ct);return v.extend(e,{setDetachable:it(t,"setDetachable",ct),setReattach:it(t,"setReattach",ct),setConnector:it(t,"setConnector",ct),detach:function(){for(var e=0,n=t.length;n>e;e++)o.detach(t[e])},isDetachable:rt(t,"isDetachable"),isReattach:rt(t,"isReattach")})},dt=function(t){var e=ut(t,dt);return v.extend(e,{setEnabled:it(t,"setEnabled",dt),setAnchor:it(t,"setAnchor",dt),isEnabled:rt(t,"isEnabled"),detachAll:function(){for(var e=0,n=t.length;n>e;e++)t[e].detachAll()},remove:function(){for(var e=0,n=t.length;n>e;e++)o.deleteObject({endpoint:t[e]})}})};this.select=function(t){return t=t||{},t.scope=t.scope||"*",ct(t.connections||o.getConnections(t,!0))},this.selectEndpoints=function(t){t=t||{},t.scope=t.scope||"*";var e=!t.element&&!t.source&&!t.target,n=e?"*":ot(t.element),i=e?"*":ot(t.source),r=e?"*":ot(t.target),o=ot(t.scope,!0),a=[];for(var s in x){var l=at(n,s,!0),u=at(i,s,!0),c="*"!=i,d=at(r,s,!0),h="*"!=r;if(l||u||d)t:for(var f=0,p=x[s].length;p>f;f++){var m=x[s][f];if(at(o,m.scope,!0)){var g=c&&i.length>0&&!m.isSource,v=h&&r.length>0&&!m.isTarget;if(g||v)continue t;a.push(m)}}}return dt(a)},this.getAllConnections=function(){return w},this.getDefaultScope=function(){return A},this.getEndpoint=N,this.getEndpoints=function(t){return x[f(t).id]},this.getDefaultEndpointType=function(){return v.Endpoint},this.getDefaultConnectionType=function(){return v.Connection},this.getId=K,this.appendElement=F;var ht=!1;this.isHoverSuspended=function(){return ht},this.setHoverSuspended=function(t){ht=t},this.hide=function(t,e){return z(t,"none",e),o},this.idstamp=O,this.connectorsInitialized=!1,this.registerConnectorType=function(t,e){n.push([t,e])};var ft=function(t){if(!g&&t){var e=o.getElement(t);e.offsetParent&&o.setContainer(e.offsetParent)}},pt=function(){o.Defaults.Container&&o.setContainer(o.Defaults.Container)},mt=o.manage=function(t,e,n){return S[t]||(S[t]={el:e,endpoints:[],connections:[]},S[t].info=gt({elId:t,timestamp:P}),n||o.fire("manageElement",{id:t,info:S[t].info,el:e})),S[t]},gt=this.updateOffset=function(t){var e,n=t.timestamp,i=t.recalc,r=t.offset,a=t.elId;return T&&!n&&(n=P),!i&&n&&n===D[a]?{o:t.offset||k[a],s:M[a]}:(i||!r&&null==k[a]?(e=S[a]?S[a].el:null,null!=e&&(M[a]=o.getSize(e),k[a]=o.getOffset(e),D[a]=n)):(k[a]=r||k[a],null==M[a]&&(e=S[a].el,null!=e&&(M[a]=o.getSize(e))),D[a]=n),k[a]&&!k[a].right&&(k[a].right=k[a].left+M[a][0],k[a].bottom=k[a].top+M[a][1],k[a].width=M[a][0],k[a].height=M[a][1],k[a].centerx=k[a].left+k[a].width/2,k[a].centery=k[a].top+k[a].height/2),{o:k[a],s:M[a]})};this.init=function(){t=v.getRenderModes();var e=function(t,e,n){v.Connectors[t][e]=function(){n.apply(this,arguments),v.ConnectorRenderers[t].apply(this,arguments)},i.extend(v.Connectors[t][e],[n,v.ConnectorRenderers[t]])};if(!v.connectorsInitialized){for(var r=0;r<n.length;r++)for(var a=0;a<t.length;a++)e(t[a],n[r][1],n[r][0]);v.connectorsInitialized=!0}$||(pt(),o.anchorManager=new v.AnchorManager({jsPlumbInstance:o}),$=!0,o.fire("ready",o))}.bind(this),this.log=b,this.jsPlumbUIComponent=h,this.makeAnchor=function(){var t,e=function(t,e){if(v.Anchors[t])return new v.Anchors[t](e);if(!o.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown anchor type '"+t+"'"}};if(0===arguments.length)return null;var n=arguments[0],r=arguments[1],a=(arguments[2],null);if(n.compute&&n.getOrientation)return n;if("string"==typeof n)a=e(arguments[0],{elementId:r,jsPlumbInstance:o});else if(i.isArray(n))if(i.isArray(n[0])||i.isString(n[0]))2==n.length&&i.isObject(n[1])?i.isString(n[0])?(t=v.extend({elementId:r,jsPlumbInstance:o},n[1]),a=e(n[0],t)):(t=v.extend({elementId:r,jsPlumbInstance:o,anchors:n[0]},n[1]),a=new v.DynamicAnchor(t)):a=new v.DynamicAnchor({anchors:n,selector:null,elementId:r,jsPlumbInstance:o});else{var s={x:n[0],y:n[1],orientation:n.length>=4?[n[2],n[3]]:[0,0],offsets:n.length>=6?[n[4],n[5]]:[0,0],elementId:r,jsPlumbInstance:o,cssClass:7==n.length?n[6]:null};a=new v.Anchor(s),a.clone=function(){return new v.Anchor(s)}}return a.id||(a.id="anchor_"+O()),a},this.makeAnchors=function(t,e,n){for(var r=[],a=0,s=t.length;s>a;a++)"string"==typeof t[a]?r.push(v.Anchors[t[a]]({elementId:e,jsPlumbInstance:n})):i.isArray(t[a])&&r.push(o.makeAnchor(t[a],e,n));return r},this.makeDynamicAnchor=function(t,e){return new v.DynamicAnchor({anchors:t,selector:e,elementId:null,jsPlumbInstance:o})},this.targetEndpointDefinitions={};var vt=function(t,e,n){};this.sourceEndpointDefinitions={};var yt=function(t,e,n,i,r){for(var o=t.target||t.srcElement,a=!1,s=i.getSelector(e,n),l=0;l<s.length;l++)if(s[l]==o){a=!0;break}return r?!a:a},bt=function(t,e,n,r,a){var s=new h(e),l=e._jsPlumb.EndpointDropHandler({jsPlumb:o,enabled:function(){return t.def.enabled},isFull:function(){var e=o.select({target:t.id}).length;return t.def.maxConnections>0&&e>=t.def.maxConnections},element:t.el,elementId:t.id,isSource:r,isTarget:a,addClass:function(e){o.addClass(t.el,e)},removeClass:function(e){o.removeClass(t.el,e)},onDrop:function(t){var e=t.endpoints[0];e.anchor.locked=!1},isDropAllowed:function(){return s.isDropAllowed.apply(s,arguments)},isRedrop:function(e){return null!=e.suspendedElement&&null!=e.suspendedEndpoint&&e.suspendedEndpoint.element===t.el},getEndpoint:function(n){var i=t.def.endpoint;if(null==i||null==i._jsPlumb){var r=o.deriveEndpointAndAnchorSpec(n.getType().join(" "),!0),a=r.endpoints?v.extend(e,{endpoint:t.def.def.endpoint||r.endpoints[1]}):e;r.anchors&&(a=v.extend(a,{anchor:t.def.def.anchor||r.anchors[1]})),i=o.addEndpoint(t.el,a),i._mtNew=!0}if(e.uniqueEndpoint&&(t.def.endpoint=i),i._doNotDeleteOnDetach=!1,i._deleteOnDetach=!0,n.isDetachable()&&i.initDraggable(),null!=i.anchor.positionFinder){var s=o.getUIPosition(arguments,o.getZoom()),l=o.getOffset(t.el),u=o.getSize(t.el),c=i.anchor.positionFinder(s,l,u,i.anchor.constructorParams);i.anchor.x=c[0],i.anchor.y=c[1]}return i},maybeCleanup:function(t){t._mtNew&&0===t.connections.length?o.deleteObject({
endpoint:t}):delete t._mtNew}}),u=v.dragEvents.drop;return n.scope=n.scope||e.scope||o.Defaults.Scope,n[u]=i.wrap(n[u],l,!0),a&&(n[v.dragEvents.over]=function(){return!0}),e.allowLoopback===!1&&(n.canDrop=function(e){var n=e.getDragElement()._jsPlumbRelatedElement;return n!=t.el}),o.initDroppable(t.el,n,"internal"),l};this.makeTarget=function(t,e,n){var i=v.extend({_jsPlumb:this},n);v.extend(i,e),vt(i,1,this);for(var r=(!(i.deleteEndpointsOnDetach===!1),i.maxConnections||-1),o=function(t){var e=f(t),n=e.id,o=v.extend({},i.dropOptions||{}),a="default";this.targetEndpointDefinitions[n]=this.targetEndpointDefinitions[n]||{},ft(n);var s={def:v.extend({},i),uniqueEndpoint:i.uniqueEndpoint,maxConnections:r,enabled:!0};e.def=s,this.targetEndpointDefinitions[n][a]=s,bt(e,i,o,i.isSource===!0,!0),e.el._katavorioDrop[e.el._katavorioDrop.length-1].targetDef=s}.bind(this),a=t.length&&t.constructor!=String?t:[t],s=0,l=a.length;l>s;s++)o(a[s]);return this},this.unmakeTarget=function(t,e){var n=f(t);return v.destroyDroppable(n.el),e||delete this.targetEndpointDefinitions[n.id],this},this.makeSource=function(t,e,n){var r=v.extend({_jsPlumb:this},n);v.extend(r,e);var a=r.connectionType||"default",s=o.deriveEndpointAndAnchorSpec(a);r.endpoint=r.endpoint||s.endpoints[0],r.anchor=r.anchor||s.anchors[0],vt(r,0,this);for(var l=r.maxConnections||-1,u=r.onMaxConnections,c=function(t){var e=t.id,n=this.getElement(t.el);this.sourceEndpointDefinitions[e]=this.sourceEndpointDefinitions[e]||{},ft(e);var s={def:v.extend({},r),uniqueEndpoint:r.uniqueEndpoint,maxConnections:l,enabled:!0};this.sourceEndpointDefinitions[e][a]=s,t.def=s;var c=v.dragEvents.stop,h=v.dragEvents.drag,f=v.extend({},r.dragOptions||{}),p=f.drag,m=f.stop,g=null,y=!1;f.scope=f.scope||r.scope,f[h]=i.wrap(f[h],function(){p&&p.apply(this,arguments),y=!1}),f[c]=i.wrap(f[c],function(){if(m&&m.apply(this,arguments),this.currentlyDragging=!1,null!=g._jsPlumb){var t=r.anchor||this.Defaults.Anchor,n=g.anchor,i=g.connections[0],a=this.makeAnchor(t,e,this),s=g.element;if(null!=a.positionFinder){var l=o.getOffset(s),u=this.getSize(s),c={left:l.left+n.x*u[0],top:l.top+n.y*u[1]},d=a.positionFinder(c,l,u,a.constructorParams);a.x=d[0],a.y=d[1]}g.setAnchor(a,!0),g.repaint(),this.repaint(g.elementId),null!=i&&this.repaint(i.targetId)}}.bind(this));var b=function(s){if(3!==s.which&&2!==s.button){var c=this.sourceEndpointDefinitions[e][a];if(c.enabled){if(e=this.getId(this.getElement(t.el)),r.filter){var h=i.isString(r.filter)?yt(s,t.el,r.filter,this,r.filterExclude):r.filter(s,t.el);if(h===!1)return}var p=this.select({source:e}).length;if(c.maxConnections>=0&&p>=c.maxConnections)return u&&u({element:t.el,maxConnections:l},s),!1;var m=v.getPositionOnElement(s,n,d),b={};v.extend(b,r),b.isTemporarySource=!0,b.anchor=[m[0],m[1],0,0],b.dragOptions=f,c.def.scope&&(b.scope=c.def.scope),g=this.addEndpoint(e,b),y=!0,g._doNotDeleteOnDetach=!1,g._deleteOnDetach=!0,c.uniqueEndpoint&&(c.endpoint?g.finalEndpoint=c.endpoint:(c.endpoint=g,g._deleteOnDetach=!1,g._doNotDeleteOnDetach=!0));var $=function(){o.off(g.canvas,"mouseup",$),o.off(t.el,"mouseup",$),y&&(y=!1,o.deleteEndpoint(g))};o.on(g.canvas,"mouseup",$),o.on(t.el,"mouseup",$);var w={};if(c.def.extract)for(var x in c.def.extract){var C=s.srcElement.getAttribute(x);C&&(w[c.def.extract[x]]=C)}o.trigger(g.canvas,"mousedown",s,w),i.consume(s)}}}.bind(this);this.on(t.el,"mousedown",b),s.trigger=b,r.filter&&(i.isString(r.filter)||i.isFunction(r.filter))&&o.setDragFilter(t.el,r.filter);var $=v.extend({},r.dropOptions||{});bt(t,r,$,!0,r.isTarget===!0)}.bind(this),h=t.length&&t.constructor!=String?t:[t],p=0,m=h.length;m>p;p++)c(f(h[p]));return this},this.unmakeSource=function(t,e,n){var i=f(t),r=this.sourceEndpointDefinitions[i.id];if(r)for(var a in r)if(null==e||e===a){var s=r[a].trigger;s&&o.off(i.el,"mousedown",s),n||delete this.sourceEndpointDefinitions[i.id][a]}return this},this.unmakeEverySource=function(){for(var t in this.sourceEndpointDefinitions)o.unmakeSource(t,null,!0);return this.sourceEndpointDefinitions={},this};var $t=function(t,e,n){e=i.isArray(e)?e:[e];var r=K(t);n=n||"default";for(var o=0;o<e.length;o++){var a=this[e[o]][r];if(a&&a[n])return a[n].def.scope||this.Defaults.Scope}}.bind(this),wt=function(t,e,n,r){n=i.isArray(n)?n:[n];var o=K(t);r=r||"default";for(var a=0;a<n.length;a++){var s=this[n[a]][o];s&&s[r]&&(s[r].def.scope=e)}}.bind(this);this.getScope=function(t,e){return $t(t,["sourceEndpointDefinitions","targetEndpointDefinitions"])},this.getSourceScope=function(t){return $t(t,"sourceEndpointDefinitions")},this.getTargetScope=function(t){return $t(t,"targetEndpointDefinitions")},this.setScope=function(t,e,n){this.setSourceScope(t,e,n),this.setTargetScope(t,e,n)},this.setSourceScope=function(t,e,n){wt(t,e,"sourceEndpointDefinitions",n),this.setDragScope(t,e)},this.setTargetScope=function(t,e,n){wt(t,e,"targetEndpointDefinitions",n),this.setDropScope(t,e)},this.unmakeEveryTarget=function(){for(var t in this.targetEndpointDefinitions)o.unmakeTarget(t,!0);return this.targetEndpointDefinitions={},this};var xt=function(t,e,n,r,o){var a="source"==t?this.sourceEndpointDefinitions:this.targetEndpointDefinitions;if(o=o||"default",i.isString(e)&&a[e]&&a[e][o])a[e][o].enabled=r?!a[e][o].enabled:n;else if(e.length)for(var s=0,l=e.length;l>s;s++){var u=f(e[s]);a[u.id]&&a[u.id][o]&&(a[u.id][o].enabled=r?!a[u.id][o].enabled:n)}else{var c=f(e).id;a[c]&&a[c][o]&&(a[c][o].enabled=r?!a[c][o].enabled:n)}return this}.bind(this),Ct=function(t,e){return i.isString(t)||!t.length?e.apply(this,[t]):t.length?e.apply(this,[t[0]]):void 0}.bind(this);this.toggleSourceEnabled=function(t,e){return xt("source",t,null,!0,e),this.isSourceEnabled(t,e)},this.setSourceEnabled=function(t,e,n){return xt("source",t,e,null,n)},this.isSource=function(t,e){return e=e||"default",Ct(t,function(t){var n=this.sourceEndpointDefinitions[f(t).id];return null!=n&&null!=n[e]}.bind(this))},this.isSourceEnabled=function(t,e){return e=e||"default",Ct(t,function(t){var n=this.sourceEndpointDefinitions[f(t).id];return n&&n[e]&&n[e].enabled===!0}.bind(this))},this.toggleTargetEnabled=function(t,e){return xt("target",t,null,!0,e),this.isTargetEnabled(t,e)},this.isTarget=function(t,e){return e=e||"default",Ct(t,function(t){var n=this.targetEndpointDefinitions[f(t).id];return null!=n&&null!=n[e]}.bind(this))},this.isTargetEnabled=function(t,e){return e=e||"default",Ct(t,function(t){var n=this.targetEndpointDefinitions[f(t).id];return n&&n[e]&&n[e].enabled===!0}.bind(this))},this.setTargetEnabled=function(t,e,n){return xt("target",t,e,null,n)},this.ready=function(t){o.bind("ready",t)};var St=function(t,e){if("object"==typeof t&&t.length)for(var n=0,i=t.length;i>n;n++)e(t[n]);else e(t);return o};this.repaint=function(t,e,n){return St(t,function(t){I(t,e,n)})},this.revalidate=function(t,e,n){return St(t,function(t){var i=n?t:o.getId(t);o.updateOffset({elId:i,recalc:!0,timestamp:e}),o.repaint(t)})},this.repaintEverything=function(){var t,e=r();for(t in x)o.updateOffset({elId:t,recalc:!0,timestamp:e});for(t in x)I(t,null,e);return this},this.removeAllEndpoints=function(t,e,n){n=n||[];var i=function(t){var r,a,s=f(t),l=x[s.id];if(l)for(n.push(s),r=0,a=l.length;a>r;r++)o.deleteEndpoint(l[r],!1);if(delete x[s.id],e&&s.el&&3!=s.el.nodeType&&8!=s.el.nodeType)for(r=0,a=s.el.childNodes.length;a>r;r++)i(s.el.childNodes[r])};return i(t),this};var kt=function(t,e){o.removeAllEndpoints(t.id,!0,e);for(var n=function(t){o.getDragManager().elementRemoved(t.id),o.anchorManager.clearFor(t.id),o.anchorManager.removeFloatingConnection(t.id),delete o.floatingConnections[t.id],delete S[t.id],delete k[t.id],t.el&&(o.removeElement(t.el),t.el._jsPlumb=null)},i=1;i<e.length;i++)n(e[i]);n(t)};this.remove=function(t,e){var n=f(t),i=[];return n.text?n.el.parentNode.removeChild(n.el):n.id&&o.batch(function(){kt(n,i)},e===!1),o},this.empty=function(t,e){var n=[],i=function(t,e){var r=f(t);if(r.text)r.el.parentNode.removeChild(r.el);else if(r.el){for(;r.el.childNodes.length>0;)i(r.el.childNodes[0]);e||kt(r,n)}};return o.batch(function(){i(t,!0)},e===!1),o},this.reset=function(){o.silently(function(){o.deleteEveryEndpoint(),o.unbind(),this.targetEndpointDefinitions={},this.sourceEndpointDefinitions={},w.length=0,this.doReset&&this.doReset()}.bind(this))};var Dt=function(t){t.canvas&&t.canvas.parentNode&&t.canvas.parentNode.removeChild(t.canvas),t.cleanup(),t.destroy()};this.clear=function(){o.select().each(Dt),o.selectEndpoints().each(Dt),x={},C={}},this.setDefaultScope=function(t){return A=t,o},this.setDraggable=W,this.deriveEndpointAndAnchorSpec=function(t,e){for(var n=((e?"":"default ")+t).split(/[\s]/),i=null,r=null,a=null,s=null,l=0;l<n.length;l++){var u=o.getType(n[l],"connection");u&&(u.endpoints&&(i=u.endpoints),u.endpoint&&(r=u.endpoint),u.anchors&&(s=u.anchors),u.anchor&&(a=u.anchor))}return{endpoints:i?i:[r,r],anchors:s?s:[a,a]}},this.setId=function(t,e,n){var r;i.isString(t)?r=t:(t=this.getElement(t),r=this.getId(t));var o=this.getConnections({source:r,scope:"*"},!0),a=this.getConnections({target:r,scope:"*"},!0);e=""+e,n?t=this.getElement(e):(t=this.getElement(r),this.setAttribute(t,"id",e)),x[e]=x[r]||[];for(var s=0,l=x[e].length;l>s;s++)x[e][s].setElementId(e),x[e][s].setReferenceElement(t);delete x[r],this.sourceEndpointDefinitions[e]=this.sourceEndpointDefinitions[r],delete this.sourceEndpointDefinitions[r],this.targetEndpointDefinitions[e]=this.targetEndpointDefinitions[r],delete this.targetEndpointDefinitions[r],this.anchorManager.changeId(r,e),this.getDragManager().changeId(r,e),S[e]=S[r],delete S[r];var u=function(n,i,r){for(var o=0,a=n.length;a>o;o++)n[o].endpoints[i].setElementId(e),n[o].endpoints[i].setReferenceElement(t),n[o][r+"Id"]=e,n[o][r]=t};u(o,0,"source"),u(a,1,"target"),this.repaint(e)},this.setDebugLog=function(t){b=t},this.setSuspendDrawing=function(t,e){var n=T;return T=t,P=t?(new Date).getTime():null,e&&this.repaintEverything(),n},this.isSuspendDrawing=function(){return T},this.getSuspendedAt=function(){return P},this.batch=function(t,e){var n=this.isSuspendDrawing();n||this.setSuspendDrawing(!0);try{t()}catch(r){i.log("Function run while suspended failed",r)}n||this.setSuspendDrawing(!1,!e)},this.doWhileSuspended=this.batch,this.getCachedData=X,this.timestamp=r,this.show=function(t,e){return z(t,"block",e),o},this.toggleVisible=q,this.toggleDraggable=G,this.addListener=this.bind};i.extend(g,i.EventGenerator,{setAttribute:function(t,e,n){this.setAttribute(t,e,n)},getAttribute:function(t,e){return this.getAttribute(v.getElement(t),e)},convertToFullOverlaySpec:function(t){return i.isString(t)&&(t=[t,{}]),t[1].id=t[1].id||i.uuid(),t},registerConnectionType:function(t,e){if(this._connectionTypes[t]=v.extend({},e),e.overlays){for(var n={},i=0;i<e.overlays.length;i++){var r=this.convertToFullOverlaySpec(e.overlays[i]);n[r[1].id]=r}this._connectionTypes[t].overlays=n}},registerConnectionTypes:function(t){for(var e in t)this.registerConnectionType(e,t[e])},registerEndpointType:function(t,e){if(this._endpointTypes[t]=v.extend({},e),e.overlays){for(var n={},i=0;i<e.overlays.length;i++){var r=this.convertToFullOverlaySpec(e.overlays[i]);n[r[1].id]=r}this._endpointTypes[t].overlays=n}},registerEndpointTypes:function(t){for(var e in t)this.registerEndpointType(e,t[e])},getType:function(t,e){return"connection"===e?this._connectionTypes[t]:this._endpointTypes[t]},setIdChanged:function(t,e){this.setId(t,e,!0)},setParent:function(t,e){var n=this.getElement(t),i=this.getId(n),r=this.getElement(e),o=this.getId(r);n.parentNode.removeChild(n),r.appendChild(n),this.getDragManager().setParent(n,i,r,o)},extend:function(t,e,n){var i;if(n)for(i=0;i<n.length;i++)t[n[i]]=e[n[i]];else for(i in e)t[i]=e[i];return t},floatingConnections:{},getFloatingAnchorIndex:function(t){return t.endpoints[0].isFloating()?0:t.endpoints[1].isFloating()?1:-1}});var v=new g;e.jsPlumb=v,v.getInstance=function(t){var e=new g(t);return e.init(),e},v.each=function(t,e){if(null!=t)if("string"==typeof t)e(v.getElement(t));else if(null!=t.length)for(var n=0;n<t.length;n++)e(v.getElement(t[n]));else e(t)},"function"==typeof define&&(define("jsplumb",[],function(){return v}),define("jsplumbinstance",[],function(){return v.getInstance()})),"undefined"!=typeof exports&&(exports.jsPlumb=v)}.call(this),function(){var t=this,e=(t.jsPlumbUtil,!!window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),function(t,e){if(null==t)return[0,0];var n=a(t),i=o(n,0);return[i[e+"X"],i[e+"Y"]]}),n=function(t){return null==t?[0,0]:e(t,"page")},i=function(t){return e(t,"screen")},r=function(t){return e(t,"client")},o=function(t,e){return t.item?t.item(e):t[e]},a=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},s=function(t){var e={},n=[],i={},r={},o={};this.register=function(a){var s=t.getId(a),l=t.getOffset(a);e[s]||(e[s]=a,n.push(a),i[s]={});var u=function(e){if(e)for(var n=0;n<e.childNodes.length;n++)if(3!=e.childNodes[n].nodeType&&8!=e.childNodes[n].nodeType){var a=jsPlumb.getElement(e.childNodes[n]),c=t.getId(e.childNodes[n],null,!0);if(c&&r[c]&&r[c]>0){var d=t.getOffset(a);i[s][c]={id:c,offset:{left:d.left-l.left,top:d.top-l.top}},o[c]=s}u(e.childNodes[n])}};u(a)},this.updateOffsets=function(e){if(null!=e){var n=jsPlumb.getElement(e),r=t.getId(n),a=i[r],s=t.getOffset(n);if(a)for(var l in a)if(a.hasOwnProperty(l)){var u=jsPlumb.getElement(l),c=t.getOffset(u);i[r][l]={id:l,offset:{left:c.left-s.left,top:c.top-s.top}},o[l]=r}}},this.endpointAdded=function(n,a){a=a||t.getId(n);var s=document.body,l=n.parentNode;for(r[a]=r[a]?r[a]+1:1;null!=l&&l!=s;){var u=t.getId(l,null,!0);if(u&&e[u]){var c=t.getOffset(l);if(null==i[u][a]){var d=t.getOffset(n);i[u][a]={id:a,offset:{left:d.left-c.left,top:d.top-c.top}},o[a]=u}break}l=l.parentNode}},this.endpointDeleted=function(t){if(r[t.elementId]&&(r[t.elementId]--,r[t.elementId]<=0))for(var e in i)i.hasOwnProperty(e)&&i[e]&&(delete i[e][t.elementId],delete o[t.elementId])},this.changeId=function(t,e){i[e]=i[t],i[t]={},o[e]=o[t],o[t]=null},this.getElementsForDraggable=function(t){return i[t]},this.elementRemoved=function(t){var e=o[t];e&&(delete i[e][t],delete o[t])},this.reset=function(){e={},n=[],i={},r={}},this.dragEnded=function(e){var n=t.getId(e),i=o[n];i&&this.updateOffsets(i)},this.setParent=function(e,n,r,a){var s=o[n];if(s){i[a]||(i[a]={}),i[a][n]=i[s][n],delete i[s][n];var l=t.getOffset(r),u=t.getOffset(e);i[a][n].offset={left:u.left-l.left,top:u.top-l.top},o[n]=a}},this.getDragAncestor=function(e){var n=jsPlumb.getElement(e),i=t.getId(n),r=o[i];return r?jsPlumb.getElement(r):null}},l=function(t){return null==t?null:t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},u=function(t,e){e=l(e),"undefined"!=typeof t.className.baseVal?t.className.baseVal=e:t.className=e},c=function(t){return"undefined"==typeof t.className.baseVal?t.className:t.className.baseVal},d=function(t,e,n){e=null==e?[]:jsPlumbUtil.isArray(e)?e:e.split(/\s+/),n=null==n?[]:jsPlumbUtil.isArray(n)?n:n.split(/\s+/);var i=c(t),r=i.split(/\s+/),o=function(t,e){for(var n=0;n<e.length;n++)if(t)-1==r.indexOf(e[n])&&r.push(e[n]);else{var i=r.indexOf(e[n]);-1!=i&&r.splice(i,1)}};o(!0,e),o(!1,n),u(t,r.join(" "))};jsPlumb.extend(jsPlumbInstance.prototype,{headless:!1,pageLocation:n,screenLocation:i,clientLocation:r,getDragManager:function(){return null==this.dragManager&&(this.dragManager=new s(this)),this.dragManager},recalculateOffsets:function(t){this.getDragManager().updateOffsets(t)},createElement:function(t,e,n,i){return this.createElementNS(null,t,e,n,i)},createElementNS:function(t,e,n,i,r){var o,a=null==t?document.createElement(e):document.createElementNS(t,e);n=n||{};for(o in n)a.style[o]=n[o];i&&(a.className=i),r=r||{};for(o in r)a.setAttribute(o,""+r[o]);return a},getAttribute:function(t,e){return null!=t.getAttribute?t.getAttribute(e):null},setAttribute:function(t,e,n){null!=t.setAttribute&&t.setAttribute(e,n)},setAttributes:function(t,e){for(var n in e)e.hasOwnProperty(n)&&t.setAttribute(n,e[n])},appendToRoot:function(t){document.body.appendChild(t)},getRenderModes:function(){return["svg"]},getClass:c,addClass:function(t,e){jsPlumb.each(t,function(t){d(t,e)})},hasClass:function(t,e){return t=jsPlumb.getElement(t),t.classList?t.classList.contains(e):-1!=c(t).indexOf(e)},removeClass:function(t,e){jsPlumb.each(t,function(t){d(t,null,e)})},updateClasses:function(t,e,n){jsPlumb.each(t,function(t){d(t,e,n)})},setClass:function(t,e){jsPlumb.each(t,function(t){u(t,e)})},setPosition:function(t,e){t.style.left=e.left+"px",t.style.top=e.top+"px"},getPosition:function(t){var e=function(e){var n=t.style[e];return n?n.substring(0,n.length-2):0};return{left:e("left"),top:e("top")}},getStyle:function(t,e){return"undefined"!=typeof window.getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.currentStyle[e]},getSelector:function(t,e){var n=null;return n=1==arguments.length?null!=t.nodeType?t:document.querySelectorAll(t):t.querySelectorAll(e)},getOffset:function(t,e,n){t=jsPlumb.getElement(t),n=n||this.getContainer();for(var i={left:t.offsetLeft,top:t.offsetTop},r=e||null!=n&&t!=n&&t.offsetParent!=n?t.offsetParent:null,o=function(t){null!=t&&t!==document.body&&(t.scrollTop>0||t.scrollLeft>0)&&(i.left-=t.scrollLeft,i.top-=t.scrollTop)}.bind(this);null!=r;)i.left+=r.offsetLeft,i.top+=r.offsetTop,o(r),r=e?r.offsetParent:r.offsetParent==n?null:r.offsetParent;if(null!=n&&!e&&(n.scrollTop>0||n.scrollLeft>0)){var a=null!=t.offsetParent?this.getStyle(t.offsetParent,"position"):"static",s=this.getStyle(t,"position");"absolute"!==s&&"fixed"!==s&&"absolute"!==a&&"fixed"!=a&&(i.left-=n.scrollLeft,i.top-=n.scrollTop)}return i},getPositionOnElement:function(t,e,n){var i="undefined"!=typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:0,top:0,width:0,height:0},r=document.body,o=document.documentElement,a=window.pageYOffset||o.scrollTop||r.scrollTop,s=window.pageXOffset||o.scrollLeft||r.scrollLeft,l=o.clientTop||r.clientTop||0,u=o.clientLeft||r.clientLeft||0,c=0,d=0,h=i.top+a-l+c*n,f=i.left+s-u+d*n,p=jsPlumb.pageLocation(t),m=i.width||e.offsetWidth*n,g=i.height||e.offsetHeight*n,v=(p[0]-f)/m,y=(p[1]-h)/g;return[v,y]},getAbsolutePosition:function(t){var e=function(e){var n=t.style[e];return n?parseFloat(n.substring(0,n.length-2)):void 0};return[e("left"),e("top")]},setAbsolutePosition:function(t,e,n,i){n?this.animate(t,{left:"+="+(e[0]-n[0]),top:"+="+(e[1]-n[1])},i):(t.style.left=e[0]+"px",t.style.top=e[1]+"px")},getSize:function(t){return[t.offsetWidth,t.offsetHeight]},getWidth:function(t){return t.offsetWidth},getHeight:function(t){return t.offsetHeight}})}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i="__label",r=function(t,n){var r={cssClass:n.cssClass,labelStyle:t.labelStyle,id:i,component:t,_jsPlumb:t._jsPlumb.instance},o=jsPlumb.extend(r,n);return new(e.Overlays[t._jsPlumb.instance.getRenderMode()].Label)(o)},o=function(t,i){var r=null;if(n.isArray(i)){var o=i[0],a=e.extend({component:t,_jsPlumb:t._jsPlumb.instance},i[1]);3==i.length&&e.extend(a,i[2]),r=new(e.Overlays[t._jsPlumb.instance.getRenderMode()][o])(a)}else r=i.constructor==String?new(e.Overlays[t._jsPlumb.instance.getRenderMode()][i])({component:t,_jsPlumb:t._jsPlumb.instance}):i;return r.id=r.id||n.uuid(),t.cacheTypeItem("overlay",r,r.id),t._jsPlumb.overlays[r.id]=r,r};e.OverlayCapableJsPlumbUIComponent=function(t){jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.overlays={},this._jsPlumb.overlayPositions={},t.label&&(this.getDefaultType().overlays[i]=["Label",{label:t.label,location:t.labelLocation||this.defaultLabelLocation||.5,labelStyle:t.labelStyle||this._jsPlumb.instance.Defaults.LabelStyle,id:i}]),this.setListenerComponent=function(t){if(this._jsPlumb)for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].setListenerComponent(t)}},e.OverlayCapableJsPlumbUIComponent.applyType=function(t,e){if(e.overlays){var n,i={};for(n in e.overlays){var r=t._jsPlumb.overlays[e.overlays[n][1].id];if(r)r.updateFrom(e.overlays[n][1]),i[e.overlays[n][1].id]=!0;else{var o=t.getCachedTypeItem("overlay",e.overlays[n][1].id);null!=o?(o.reattach(t._jsPlumb.instance),o.updateFrom(e.overlays[n][1]),t._jsPlumb.overlays[o.id]=o):o=t.addOverlay(e.overlays[n],!0),i[o.id]=!0}}for(n in t._jsPlumb.overlays)null==i[t._jsPlumb.overlays[n].id]&&t.removeOverlay(t._jsPlumb.overlays[n].id,!0)}},n.extend(e.OverlayCapableJsPlumbUIComponent,t.jsPlumbUIComponent,{setHover:function(t,e){if(this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged())for(var n in this._jsPlumb.overlays)this._jsPlumb.overlays[n][t?"addClass":"removeClass"](this._jsPlumb.instance.hoverClass)},addOverlay:function(t,e){var n=o(this,t);return e||this.repaint(),n},getOverlay:function(t){return this._jsPlumb.overlays[t]},getOverlays:function(){return this._jsPlumb.overlays},hideOverlay:function(t){var e=this.getOverlay(t);e&&e.hide()},hideOverlays:function(){for(var t in this._jsPlumb.overlays)this._jsPlumb.overlays[t].hide()},showOverlay:function(t){var e=this.getOverlay(t);e&&e.show()},showOverlays:function(){for(var t in this._jsPlumb.overlays)this._jsPlumb.overlays[t].show()},removeAllOverlays:function(t){for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].cleanup&&this._jsPlumb.overlays[e].cleanup();this._jsPlumb.overlays={},this._jsPlumb.overlayPositions=null,t||this.repaint()},removeOverlay:function(t,e){var n=this._jsPlumb.overlays[t];n&&(!e&&n.cleanup&&n.cleanup(),delete this._jsPlumb.overlays[t],this._jsPlumb.overlayPositions&&delete this._jsPlumb.overlayPositions[t])},removeOverlays:function(){for(var t=0,e=arguments.length;e>t;t++)this.removeOverlay(arguments[t])},moveParent:function(t){if(this.bgCanvas&&(this.bgCanvas.parentNode.removeChild(this.bgCanvas),t.appendChild(this.bgCanvas)),this.canvas&&this.canvas.parentNode){this.canvas.parentNode.removeChild(this.canvas),t.appendChild(this.canvas);for(var e in this._jsPlumb.overlays)if(this._jsPlumb.overlays[e].isAppendedAtTopLevel){var n=this._jsPlumb.overlays[e].getElement();n.parentNode.removeChild(n),t.appendChild(n)}}},getLabel:function(){var t=this.getOverlay(i);return null!=t?t.getLabel():null},getLabelOverlay:function(){return this.getOverlay(i)},setLabel:function(t){var e=this.getOverlay(i);if(e)t.constructor==String||t.constructor==Function?e.setLabel(t):(t.label&&e.setLabel(t.label),t.location&&e.setLocation(t.location));else{var n=t.constructor==String||t.constructor==Function?{label:t}:t;e=r(this,n),this._jsPlumb.overlays[i]=e}this._jsPlumb.instance.isSuspendDrawing()||this.repaint()},cleanup:function(t){for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].cleanup(t),this._jsPlumb.overlays[e].destroy(t);t&&(this._jsPlumb.overlays={},this._jsPlumb.overlayPositions=null)},setVisible:function(t){this[t?"showOverlays":"hideOverlays"]()},setAbsoluteOverlayPosition:function(t,e){this._jsPlumb.overlayPositions[t.id]=e},getAbsoluteOverlayPosition:function(t){return this._jsPlumb.overlayPositions?this._jsPlumb.overlayPositions[t.id]:null},_clazzManip:function(t,e,n){if(!n)for(var i in this._jsPlumb.overlays)this._jsPlumb.overlays[i][t+"Class"](e)},addClass:function(t,e){this._clazzManip("add",t,e)},removeClass:function(t,e){this._clazzManip("remove",t,e)}})}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t,e,n){var i=!1;return{drag:function(){if(i)return i=!1,!0;if(e.element){var r=n.getUIPosition(arguments,n.getZoom());jsPlumb.setPosition(e.element,r),n.repaint(e.element,r),t.paint({anchorPoint:t.anchor.getCurrentLocation({element:t.element})})}},stopDrag:function(){i=!0}}},r=function(t,e,n,i){var r=jsPlumb.createElement("div",{position:"absolute"});e.appendElement(r);var o=e.getId(r);jsPlumb.setPosition(r,n),r.style.width=i[0]+"px",r.style.height=i[1]+"px",e.manage(o,r,!0),t.id=o,t.element=r},o=function(t,n,i,r,o,a,s,l){var u=new e.FloatingAnchor({reference:n,referenceCanvas:r,jsPlumbInstance:a});return s({paintStyle:t,endpoint:i,anchor:u,source:o,scope:l})},a=["connectorStyle","connectorHoverStyle","connectorOverlays","connector","connectionType","connectorClass","connectorHoverClass"],s=function(t,e){var n=0;if(null!=e)for(var i=0;i<t.connections.length;i++)if(t.connections[i].sourceId==e||t.connections[i].targetId==e){n=i;break}return t.connections[n]};e.Endpoint=function(t){var l=t._jsPlumb,u=t.newConnection,c=t.newEndpoint;this.idPrefix="_jsplumb_e_",this.defaultLabelLocation=[.5,.5],this.defaultOverlayKeys=["Overlays","EndpointOverlays"],e.OverlayCapableJsPlumbUIComponent.apply(this,arguments),this.appendToDefaultType({connectionType:t.connectionType,maxConnections:null==t.maxConnections?this._jsPlumb.instance.Defaults.MaxConnections:t.maxConnections,paintStyle:t.endpointStyle||t.paintStyle||t.style||this._jsPlumb.instance.Defaults.EndpointStyle||e.Defaults.EndpointStyle,hoverPaintStyle:t.endpointHoverStyle||t.hoverPaintStyle||this._jsPlumb.instance.Defaults.EndpointHoverStyle||e.Defaults.EndpointHoverStyle,connectorStyle:t.connectorStyle,connectorHoverStyle:t.connectorHoverStyle,connectorClass:t.connectorClass,connectorHoverClass:t.connectorHoverClass,connectorOverlays:t.connectorOverlays,connector:t.connector,connectorTooltip:t.connectorTooltip}),this._jsPlumb.enabled=!(t.enabled===!1),this._jsPlumb.visible=!0,this.element=e.getElement(t.source),this._jsPlumb.uuid=t.uuid,this._jsPlumb.floatingEndpoint=null;var d=null;this._jsPlumb.uuid&&(t.endpointsByUUID[this._jsPlumb.uuid]=this),this.elementId=t.elementId,this.dragProxy=t.dragProxy,this._jsPlumb.connectionCost=t.connectionCost,this._jsPlumb.connectionsDirected=t.connectionsDirected,this._jsPlumb.currentAnchorClass="",this._jsPlumb.events={};var h=function(){var t=l.endpointAnchorClassPrefix+"-"+this._jsPlumb.currentAnchorClass;this._jsPlumb.currentAnchorClass=this.anchor.getCssClass();var e=l.endpointAnchorClassPrefix+(this._jsPlumb.currentAnchorClass?"-"+this._jsPlumb.currentAnchorClass:"");this.removeClass(t),this.addClass(e),jsPlumb.updateClasses(this.element,e,t)}.bind(this);this.prepareAnchor=function(t){var e=this._jsPlumb.instance.makeAnchor(t,this.elementId,l);return e.bind("anchorChanged",function(t){this.fire("anchorChanged",{endpoint:this,anchor:t}),h()}.bind(this)),e},this.setPreparedAnchor=function(t,e){return this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId),this.anchor=t,h(),e||this._jsPlumb.instance.repaint(this.elementId),this},this.setAnchor=function(t,e){var n=this.prepareAnchor(t);return this.setPreparedAnchor(n,e),this};var f=function(t){if(this.connections.length>0)for(var e=0;e<this.connections.length;e++)this.connections[e].setHover(t,!1);else this.setHover(t)}.bind(this);this.bind("mouseover",function(){f(!0)}),this.bind("mouseout",function(){f(!1)}),t._transient||this._jsPlumb.instance.anchorManager.add(this,this.elementId),this.prepareEndpoint=function(i,r){var o,a=function(t,n){var i=l.getRenderMode();if(e.Endpoints[i][t])return new e.Endpoints[i][t](n);if(!l.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown endpoint type '"+t+"'"}},s={_jsPlumb:this._jsPlumb.instance,cssClass:t.cssClass,container:t.container,tooltip:t.tooltip,connectorTooltip:t.connectorTooltip,endpoint:this};return n.isString(i)?o=a(i,s):n.isArray(i)?(s=n.merge(i[1],s),o=a(i[0],s)):o=i.clone(),o.clone=function(){return n.isString(i)?a(i,s):n.isArray(i)?(s=n.merge(i[1],s),a(i[0],s)):void 0}.bind(this),o.typeId=r,o},this.setEndpoint=function(t,e){var n=this.prepareEndpoint(t);this.setPreparedEndpoint(n,!0)},this.setPreparedEndpoint=function(t,e){null!=this.endpoint&&(this.endpoint.cleanup(),this.endpoint.destroy()),this.endpoint=t,this.type=this.endpoint.type,this.canvas=this.endpoint.canvas},e.extend(this,t,a),this.isSource=t.isSource||!1,this.isTemporarySource=t.isTemporarySource||!1,this.isTarget=t.isTarget||!1,this.connections=t.connections||[],this.connectorPointerEvents=t["connector-pointer-events"],this.scope=t.scope||l.getDefaultScope(),this.timestamp=null,this.reattachConnections=t.reattach||l.Defaults.ReattachConnections,this.connectionsDetachable=l.Defaults.ConnectionsDetachable,t.connectionsDetachable!==!1&&t.detachable!==!1||(this.connectionsDetachable=!1),this.dragAllowedWhenFull=t.dragAllowedWhenFull!==!1,t.onMaxConnections&&this.bind("maxConnections",t.onMaxConnections),this.addConnection=function(t){this.connections.push(t),this[(this.connections.length>0?"add":"remove")+"Class"](l.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](l.endpointFullClass)},this.detachFromConnection=function(t,e,n){e=null==e?this.connections.indexOf(t):e,e>=0&&(this.connections.splice(e,1),this[(this.connections.length>0?"add":"remove")+"Class"](l.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](l.endpointFullClass)),!n&&this._deleteOnDetach&&0===this.connections.length&&l.deleteObject({endpoint:this,fireEvent:!1,deleteAttachedObjects:!1})},this.detach=function(t,e,n,i,r,o,a){var s=null==a?this.connections.indexOf(t):a,u=!1;return i=i!==!1,s>=0&&(n||t._forceDetach||t.isDetachable()&&t.isDetachAllowed(t)&&this.isDetachAllowed(t)&&l.checkCondition("beforeDetach",t,o))&&(l.deleteObject({connection:t,fireEvent:!e&&i,originalEvent:r,deleteAttachedObjects:!1}),u=!0),u},this.detachAll=function(t,e){for(var n=[];this.connections.length>0;){var i=this.detach(this.connections[0],!1,e===!0,t!==!1,null,this,0);i||(n.push(this.connections[0]),this.connections.splice(0,1))}return this.connections=n,this},this.detachFrom=function(t,e,n){for(var i=[],r=0;r<this.connections.length;r++)this.connections[r].endpoints[1]!=t&&this.connections[r].endpoints[0]!=t||i.push(this.connections[r]);for(var o=0;o<i.length;o++)this.detach(i[o],!1,!0,e,n);return this},this.getElement=function(){return this.element},this.setElement=function(e){var i=this._jsPlumb.instance.getId(e),r=this.elementId;return n.removeWithFunction(t.endpointsByElement[this.elementId],function(t){return t.id==this.id}.bind(this)),this.element=jsPlumb.getElement(e),this.elementId=l.getId(this.element),l.anchorManager.rehomeEndpoint(this,r,this.element),l.dragManager.endpointAdded(this.element),n.addToList(t.endpointsByElement,i,this),this},this.makeInPlaceCopy=function(){var e=this.anchor.getCurrentLocation({element:this}),n=this.anchor.getOrientation(this),i=this.anchor.getCssClass(),r={bind:function(){},compute:function(){return[e[0],e[1]]},getCurrentLocation:function(){return[e[0],e[1]]},getOrientation:function(){return n},getCssClass:function(){return i}};return c({dropOptions:t.dropOptions,anchor:r,source:this.element,paintStyle:this.getPaintStyle(),endpoint:t.hideOnDrag?"Blank":this.endpoint,_transient:!0,scope:this.scope,reference:this})},this.connectorSelector=function(){var t=this.connections[0];return t?t:this.connections.length<this._jsPlumb.maxConnections||-1==this._jsPlumb.maxConnections?null:t},this.setStyle=this.setPaintStyle,this.paint=function(t){t=t||{};var e=t.timestamp,n=!(t.recalc===!1);if(!e||this.timestamp!==e){var i=l.updateOffset({elId:this.elementId,timestamp:e}),r=t.offset?t.offset.o:i.o;if(null!=r){var o=t.anchorPoint,a=t.connectorPaintStyle;if(null==o){var u=t.dimensions||i.s,c={xy:[r.left,r.top],wh:u,element:this,timestamp:e};if(n&&this.anchor.isDynamic&&this.connections.length>0){var d=s(this,t.elementWithPrecedence),h=d.endpoints[0]==this?1:0,f=0===h?d.sourceId:d.targetId,p=l.getCachedData(f),m=p.o,g=p.s;c.txy=[m.left,m.top],c.twh=g,c.tElement=d.endpoints[h]}o=this.anchor.compute(c)}this.endpoint.compute(o,this.anchor.getOrientation(this),this._jsPlumb.paintStyleInUse,a||this.paintStyleInUse),this.endpoint.paint(this._jsPlumb.paintStyleInUse,this.anchor),this.timestamp=e;for(var v in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(v)){var y=this._jsPlumb.overlays[v];y.isVisible()&&(this._jsPlumb.overlayPlacements[v]=y.draw(this.endpoint,this._jsPlumb.paintStyleInUse),y.paint(this._jsPlumb.overlayPlacements[v]));
}}}},this.getTypeDescriptor=function(){return"endpoint"},this.isVisible=function(){return this._jsPlumb.visible},this.repaint=this.paint;var p=!1;this.initDraggable=function(){if(!p&&e.isDragSupported(this.element)){var a,s={id:null,element:null},h=null,f=!1,m=null,g=i(this,s,l),v=t.dragOptions||{},y={},b=e.dragEvents.start,$=e.dragEvents.stop,w=e.dragEvents.drag,x=e.dragEvents.beforeStart,C=function(t){a=t.e.payload||{}},S=function(e){h=this.connectorSelector();var i=!0;this.isEnabled()||(i=!1),null!=h||this.isSource||this.isTemporarySource||(i=!1),!this.isSource||!this.isFull()||null!=h&&this.dragAllowedWhenFull||(i=!1),null==h||h.isDetachable(this)||(i=!1);var d=l.checkCondition(null==h?"beforeDrag":"beforeStartDetach",{endpoint:this,source:this.element,sourceId:this.elementId,connection:h});if(d===!1?i=!1:"object"==typeof d?jsPlumb.extend(d,a||{}):d=a||{},i===!1)return l.stopDrag&&l.stopDrag(this.canvas),g.stopDrag(),!1;for(var p=0;p<this.connections.length;p++)this.connections[p].setHover(!1);this.addClass("endpointDrag"),l.setConnectionBeingDragged(!0),h&&!this.isFull()&&this.isSource&&(h=null),l.updateOffset({elId:this.elementId});var v=this._jsPlumb.instance.getOffset(this.canvas),y=this.canvas,b=this._jsPlumb.instance.getSize(this.canvas);r(s,l,v,b),l.setAttributes(this.canvas,{dragId:s.id,elId:this.elementId});var $=this.dragProxy||this.endpoint;if(null==this.dragProxy&&null!=this.connectionType){var w=this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);w.endpoints[1]&&($=w.endpoints[1])}var x=this._jsPlumb.instance.makeAnchor("Center");x.isFloating=!0,this._jsPlumb.floatingEndpoint=o(this.getPaintStyle(),x,$,this.canvas,s.element,l,c,this.scope);var C=this._jsPlumb.floatingEndpoint.anchor;if(null==h)this.setHover(!1,!1),h=u({sourceEndpoint:this,targetEndpoint:this._jsPlumb.floatingEndpoint,source:this.element,target:s.element,anchors:[this.anchor,this._jsPlumb.floatingEndpoint.anchor],paintStyle:t.connectorStyle,hoverPaintStyle:t.connectorHoverStyle,connector:t.connector,overlays:t.connectorOverlays,type:this.connectionType,cssClass:this.connectorClass,hoverClass:this.connectorHoverClass,scope:t.scope,data:d}),h.pending=!0,h.addClass(l.draggingClass),this._jsPlumb.floatingEndpoint.addClass(l.draggingClass),this._jsPlumb.floatingEndpoint.anchor=C,l.fire("connectionDrag",h),l.anchorManager.newConnection(h);else{f=!0,h.setHover(!1);var S=h.endpoints[0].id==this.id?0:1;this.detachFromConnection(h,null,!0);var k=l.getDragScope(y);l.setAttribute(this.canvas,"originalScope",k),l.fire("connectionDrag",h),0===S?(m=[h.source,h.sourceId,y,k],h.source=s.element,h.sourceId=s.id,l.anchorManager.sourceChanged(h.endpoints[S].elementId,h.sourceId,h)):(m=[h.target,h.targetId,y,k],h.target=s.element,h.targetId=s.id,l.anchorManager.updateOtherEndpoint(h.sourceId,h.endpoints[S].elementId,h.targetId,h)),h.suspendedEndpoint=h.endpoints[S],h.suspendedElement=h.endpoints[S].getElement(),h.suspendedElementId=h.endpoints[S].elementId,h.suspendedElementType=0===S?"source":"target",h.suspendedEndpoint.setHover(!1),this._jsPlumb.floatingEndpoint.referenceEndpoint=h.suspendedEndpoint,h.endpoints[S]=this._jsPlumb.floatingEndpoint,h.addClass(l.draggingClass),this._jsPlumb.floatingEndpoint.addClass(l.draggingClass)}l.floatingConnections[s.id]=h,n.addToList(t.endpointsByElement,s.id,this._jsPlumb.floatingEndpoint),l.currentlyDragging=!0}.bind(this),k=function(){if(l.setConnectionBeingDragged(!1),h&&null!=h.endpoints){var t=l.getDropEvent(arguments),e=l.getFloatingAnchorIndex(h);if(h.endpoints[0===e?1:0].anchor.locked=!1,h.removeClass(l.draggingClass),this._jsPlumb&&(h.deleteConnectionNow||h.endpoints[e]==this._jsPlumb.floatingEndpoint)&&f&&h.suspendedEndpoint){0===e?(h.floatingElement=h.source,h.floatingId=h.sourceId,h.floatingEndpoint=h.endpoints[0],h.floatingIndex=0,h.source=m[0],h.sourceId=m[1]):(h.floatingElement=h.target,h.floatingId=h.targetId,h.floatingEndpoint=h.endpoints[1],h.floatingIndex=1,h.target=m[0],h.targetId=m[1]);var n=this._jsPlumb.floatingEndpoint;l.setDragScope(m[2],m[3]),h.endpoints[e]=h.suspendedEndpoint,h.isReattach()||h._forceReattach||h._forceDetach||!h.endpoints[0===e?1:0].detach(h,!1,!1,!0,t,!0)?(h.setHover(!1),h._forceDetach=null,h._forceReattach=null,this._jsPlumb.floatingEndpoint.detachFromConnection(h),h.suspendedEndpoint.addConnection(h),1==e?l.anchorManager.updateOtherEndpoint(h.sourceId,h.floatingId,h.targetId,h):l.anchorManager.sourceChanged(h.floatingId,h.sourceId,h),l.repaint(m[1])):l.deleteObject({endpoint:n})}this.deleteAfterDragStop?l.deleteObject({endpoint:this}):this._jsPlumb&&this.paint({recalc:!1}),l.fire("connectionDragStop",h,t),h.pending&&l.fire("connectionAborted",h,t),l.currentlyDragging=!1,h=null}s&&s.element&&l.remove(s.element,!1,!1),d&&l.deleteObject({endpoint:d}),this._jsPlumb&&(this.canvas.style.visibility="visible",this.anchor.locked=!1,this._jsPlumb.floatingEndpoint=null)}.bind(this);v=e.extend(y,v),v.scope=this.scope||v.scope,v[x]=n.wrap(v[x],C,!1),v[b]=n.wrap(v[b],S,!1),v[w]=n.wrap(v[w],g.drag),v[$]=n.wrap(v[$],k),v.multipleDrop=!1,v.canDrag=function(){return this.isSource||this.isTemporarySource||this.connections.length>0}.bind(this),l.initDraggable(this.canvas,v,"internal"),this.canvas._jsPlumbRelatedElement=this.element,p=!0}};var m=t.endpoint||this._jsPlumb.instance.Defaults.Endpoint||e.Defaults.Endpoint;this.setEndpoint(m,!0);var g=t.anchor?t.anchor:t.anchors?t.anchors:l.Defaults.Anchor||"Top";this.setAnchor(g,!0);var v=["default",t.type||""].join(" ");this.addType(v,t.data,!0),this.canvas=this.endpoint.canvas,this.canvas._jsPlumb=this,this.initDraggable();var y=function(i,r,o,a){if(e.isDropSupported(this.element)){var s=t.dropOptions||l.Defaults.DropOptions||e.Defaults.DropOptions;s=e.extend({},s),s.scope=s.scope||this.scope;var u=e.dragEvents.drop,c=e.dragEvents.over,d=e.dragEvents.out,h=this,f=l.EndpointDropHandler({getEndpoint:function(){return h},jsPlumb:l,enabled:function(){return null!=o?o.isEnabled():!0},isFull:function(){return o.isFull()},element:this.element,elementId:this.elementId,isSource:this.isSource,isTarget:this.isTarget,addClass:function(t){h.addClass(t)},removeClass:function(t){h.removeClass(t)},isDropAllowed:function(){return h.isDropAllowed.apply(h,arguments)},reference:a,isRedrop:function(t,e){return t.suspendedEndpoint&&e.reference&&t.suspendedEndpoint.id===e.reference.id}});s[u]=n.wrap(s[u],f,!0),s[c]=n.wrap(s[c],function(){var t=e.getDragObject(arguments),n=l.getAttribute(e.getElement(t),"dragId"),i=l.floatingConnections[n];if(null!=i){var r=l.getFloatingAnchorIndex(i),o=this.isTarget&&0!==r||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id==i.suspendedEndpoint.id;if(o){var a=l.checkCondition("checkDropAllowed",{sourceEndpoint:i.endpoints[r],targetEndpoint:this,connection:i});this[(a?"add":"remove")+"Class"](l.endpointDropAllowedClass),this[(a?"remove":"add")+"Class"](l.endpointDropForbiddenClass),i.endpoints[r].anchor.over(this.anchor,this)}}}.bind(this)),s[d]=n.wrap(s[d],function(){var t=e.getDragObject(arguments),n=null==t?null:l.getAttribute(e.getElement(t),"dragId"),i=n?l.floatingConnections[n]:null;if(null!=i){var r=l.getFloatingAnchorIndex(i),o=this.isTarget&&0!==r||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id==i.suspendedEndpoint.id;o&&(this.removeClass(l.endpointDropAllowedClass),this.removeClass(l.endpointDropForbiddenClass),i.endpoints[r].anchor.out())}}.bind(this)),l.initDroppable(i,s,"internal",r)}}.bind(this);return this.anchor.isFloating||y(this.canvas,!(t._transient||this.anchor.isFloating),this,t.reference),this},n.extend(e.Endpoint,e.OverlayCapableJsPlumbUIComponent,{setVisible:function(t,e,n){if(this._jsPlumb.visible=t,this.canvas&&(this.canvas.style.display=t?"block":"none"),this[t?"showOverlays":"hideOverlays"](),!e)for(var i=0;i<this.connections.length;i++)if(this.connections[i].setVisible(t),!n){var r=this===this.connections[i].endpoints[0]?1:0;1==this.connections[i].endpoints[r].connections.length&&this.connections[i].endpoints[r].setVisible(t,!0,!0)}},getAttachedElements:function(){return this.connections},applyType:function(t,n){this.setPaintStyle(t.endpointStyle||t.paintStyle,n),this.setHoverPaintStyle(t.endpointHoverStyle||t.hoverPaintStyle,n),null!=t.maxConnections&&(this._jsPlumb.maxConnections=t.maxConnections),t.scope&&(this.scope=t.scope),e.extend(this,t,a),null!=t.cssClass&&this.canvas&&this._jsPlumb.instance.addClass(this.canvas,t.cssClass),e.OverlayCapableJsPlumbUIComponent.applyType(this,t)},isEnabled:function(){return this._jsPlumb.enabled},setEnabled:function(t){this._jsPlumb.enabled=t},cleanup:function(){var t=this._jsPlumb.instance.endpointAnchorClassPrefix+(this._jsPlumb.currentAnchorClass?"-"+this._jsPlumb.currentAnchorClass:"");jsPlumb.removeClass(this.element,t),this.anchor=null,this.endpoint.cleanup(!0),this.endpoint.destroy(),this.endpoint=null,this._jsPlumb.instance.destroyDraggable(this.canvas,"internal"),this._jsPlumb.instance.destroyDroppable(this.canvas,"internal")},setHover:function(t){this.endpoint&&this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged()&&this.endpoint.setHover(t)},isFull:function(){return 0===this._jsPlumb.maxConnections?!0:!(this.isFloating()||this._jsPlumb.maxConnections<0||this.connections.length<this._jsPlumb.maxConnections)},isFloating:function(){return null!=this.anchor&&this.anchor.isFloating},isConnectedTo:function(t){var e=!1;if(t)for(var n=0;n<this.connections.length;n++)if(this.connections[n].endpoints[1]==t||this.connections[n].endpoints[0]==t){e=!0;break}return e},getConnectionCost:function(){return this._jsPlumb.connectionCost},setConnectionCost:function(t){this._jsPlumb.connectionCost=t},areConnectionsDirected:function(){return this._jsPlumb.connectionsDirected},setConnectionsDirected:function(t){this._jsPlumb.connectionsDirected=t},setElementId:function(t){this.elementId=t,this.anchor.elementId=t},setReferenceElement:function(t){this.element=e.getElement(t)},setDragAllowedWhenFull:function(t){this.dragAllowedWhenFull=t},equals:function(t){return this.anchor.equals(t.anchor)},getUuid:function(){return this._jsPlumb.uuid},computeAnchor:function(t){return this.anchor.compute(t)}}),t.jsPlumbInstance.prototype.EndpointDropHandler=function(t){return function(e){var n=t.jsPlumb;t.removeClass(n.endpointDropAllowedClass),t.removeClass(n.endpointDropForbiddenClass);var i=n.getDropEvent(arguments),r=n.getDragObject(arguments),o=n.getAttribute(r,"dragId"),a=(n.getAttribute(r,"elId"),n.getAttribute(r,"originalScope")),s=n.floatingConnections[o];if(null!=s){var l=null!=s.suspendedEndpoint;if(!l||null!=s.suspendedEndpoint._jsPlumb){var u=t.getEndpoint(s);if(null!=u){if(t.isRedrop(s,t))return s._forceReattach=!0,s.setHover(!1),void(t.maybeCleanup&&t.maybeCleanup(u));var c=n.getFloatingAnchorIndex(s);if(0===c&&!t.isSource||1===c&&!t.isTarget)return void(t.maybeCleanup&&t.maybeCleanup(u));t.onDrop&&t.onDrop(s),a&&n.setDragScope(r,a);var d=t.isFull(e);if(d&&u.fire("maxConnections",{endpoint:this,connection:s,maxConnections:u._jsPlumb.maxConnections},i),!d&&t.enabled()){var h=!0;0===c?(s.floatingElement=s.source,s.floatingId=s.sourceId,s.floatingEndpoint=s.endpoints[0],s.floatingIndex=0,s.source=t.element,s.sourceId=t.elementId):(s.floatingElement=s.target,s.floatingId=s.targetId,s.floatingEndpoint=s.endpoints[1],s.floatingIndex=1,s.target=t.element,s.targetId=t.elementId),l&&s.suspendedEndpoint.id!=u.id&&(s.isDetachAllowed(s)&&s.endpoints[c].isDetachAllowed(s)&&s.suspendedEndpoint.isDetachAllowed(s)&&n.checkCondition("beforeDetach",s)||(h=!1));var f=function(t){s.endpoints[c].detachFromConnection(s),s.suspendedEndpoint&&s.suspendedEndpoint.detachFromConnection(s),s.endpoints[c]=u,u.addConnection(s);var e=u.getParameters();for(var r in e)s.setParameter(r,e[r]);if(l){var o=s.suspendedEndpoint.elementId;n.fireMoveEvent({index:c,originalSourceId:0===c?o:s.sourceId,newSourceId:0===c?u.elementId:s.sourceId,originalTargetId:1==c?o:s.targetId,newTargetId:1==c?u.elementId:s.targetId,originalSourceEndpoint:0===c?s.suspendedEndpoint:s.endpoints[0],newSourceEndpoint:0===c?u:s.endpoints[0],originalTargetEndpoint:1==c?s.suspendedEndpoint:s.endpoints[1],newTargetEndpoint:1==c?u:s.endpoints[1],connection:s},i)}else e.draggable&&n.initDraggable(this.element,dragOptions,"internal",n);if(1==c?n.anchorManager.updateOtherEndpoint(s.sourceId,s.floatingId,s.targetId,s):n.anchorManager.sourceChanged(s.floatingId,s.sourceId,s),s.endpoints[0].finalEndpoint){var a=s.endpoints[0];a.detachFromConnection(s),s.endpoints[0]=s.endpoints[0].finalEndpoint,s.endpoints[0].addConnection(s)}jsPlumbUtil.isObject(t)&&s.mergeData(t),n.finaliseConnection(s,null,i,!1),s.setHover(!1)}.bind(this),p=function(){s.suspendedEndpoint&&(s.endpoints[c]=s.suspendedEndpoint,s.setHover(!1),s._forceDetach=!0,0===c?(s.source=s.suspendedEndpoint.element,s.sourceId=s.suspendedEndpoint.elementId):(s.target=s.suspendedEndpoint.element,s.targetId=s.suspendedEndpoint.elementId),s.suspendedEndpoint.addConnection(s),1==c?n.anchorManager.updateOtherEndpoint(s.sourceId,s.floatingId,s.targetId,s):n.anchorManager.sourceChanged(s.floatingId,s.sourceId,s),n.repaint(s.sourceId),s._forceDetach=!1)};if(h=h&&t.isDropAllowed(s.sourceId,s.targetId,s.scope,s,u))return f(h),!0;p()}t.maybeCleanup&&t.maybeCleanup(u),n.currentlyDragging=!1}}}}}}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t,n,i,r,o){if(!t.Defaults.DoNotThrowErrors&&null==jsPlumb.Connectors[n][i])throw{msg:"jsPlumb: unknown connector type '"+i+"'"};return new e.Connectors[n][i](r,o)},r=function(t,e,n){return t?n.makeAnchor(t,e,n):null},o=function(t,e,i,r){null!=e&&(e._jsPlumbConnections=e._jsPlumbConnections||{},r?delete e._jsPlumbConnections[t.id]:e._jsPlumbConnections[t.id]=!0,n.isEmpty(e._jsPlumbConnections)?i.removeClass(e,i.connectedClass):i.addClass(e,i.connectedClass))};e.Connection=function(t){var i=t.newEndpoint;this.id=t.id,this.connector=null,this.idPrefix="_jsplumb_c_",this.defaultLabelLocation=.5,this.defaultOverlayKeys=["Overlays","ConnectionOverlays"],this.previousConnection=t.previousConnection,this.source=e.getElement(t.source),this.target=e.getElement(t.target),t.sourceEndpoint&&(this.source=t.sourceEndpoint.getElement()),t.targetEndpoint&&(this.target=t.targetEndpoint.getElement()),e.OverlayCapableJsPlumbUIComponent.apply(this,arguments),this.sourceId=this._jsPlumb.instance.getId(this.source),this.targetId=this._jsPlumb.instance.getId(this.target),this.scope=t.scope,this.endpoints=[],this.endpointStyles=[];var r=this._jsPlumb.instance;r.manage(this.sourceId,this.source),r.manage(this.targetId,this.target),this._jsPlumb.visible=!0,this._jsPlumb.editable=t.editable===!0,this._jsPlumb.params={cssClass:t.cssClass,container:t.container,"pointer-events":t["pointer-events"],editorParams:t.editorParams,overlays:t.overlays},this._jsPlumb.lastPaintedAt=null,this.bind("mouseover",function(){this.setHover(!0)}.bind(this)),this.bind("mouseout",function(){this.setHover(!1)}.bind(this)),this.editableRequested=t.editable!==!1,this.setEditable=function(t){return this.connector?this.connector.setEditable(t):!1},this.isEditable=function(){return this.connector?this.connector.isEditable():!1},this.isEditing=function(){return this.connector?this.connector.isEditing():!1},this.makeEndpoint=function(e,n,o,a){return o=o||this._jsPlumb.instance.getId(n),this.prepareEndpoint(r,i,this,a,e?0:1,t,n,o)},t.type&&(t.endpoints=this._jsPlumb.instance.deriveEndpointAndAnchorSpec(t.type).endpoints);var o=this.makeEndpoint(!0,this.source,this.sourceId,t.sourceEndpoint),a=this.makeEndpoint(!1,this.target,this.targetId,t.targetEndpoint);o&&n.addToList(t.endpointsByElement,this.sourceId,o),a&&n.addToList(t.endpointsByElement,this.targetId,a),this.scope||(this.scope=this.endpoints[0].scope),null!=t.deleteEndpointsOnDetach?(this.endpoints[0]._deleteOnDetach=t.deleteEndpointsOnDetach,this.endpoints[1]._deleteOnDetach=t.deleteEndpointsOnDetach):(this.endpoints[0]._doNotDeleteOnDetach||(this.endpoints[0]._deleteOnDetach=!0),this.endpoints[1]._doNotDeleteOnDetach||(this.endpoints[1]._deleteOnDetach=!0));var s=r.Defaults.ConnectionsDetachable;t.detachable===!1&&(s=!1),this.endpoints[0].connectionsDetachable===!1&&(s=!1),this.endpoints[1].connectionsDetachable===!1&&(s=!1);var l=t.reattach||this.endpoints[0].reattachConnections||this.endpoints[1].reattachConnections||r.Defaults.ReattachConnections;this.appendToDefaultType({detachable:s,reattach:l,paintStyle:this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||t.paintStyle||r.Defaults.PaintStyle||jsPlumb.Defaults.PaintStyle,hoverPaintStyle:this.endpoints[0].connectorHoverStyle||this.endpoints[1].connectorHoverStyle||t.hoverPaintStyle||r.Defaults.HoverPaintStyle||jsPlumb.Defaults.HoverPaintStyle});var u=r.getSuspendedAt();if(!r.isSuspendDrawing()){var c=r.getCachedData(this.sourceId),d=c.o,h=c.s,f=r.getCachedData(this.targetId),p=f.o,m=f.s,g=u||r.timestamp(),v=this.endpoints[0].anchor.compute({xy:[d.left,d.top],wh:h,element:this.endpoints[0],elementId:this.endpoints[0].elementId,txy:[p.left,p.top],twh:m,tElement:this.endpoints[1],timestamp:g});this.endpoints[0].paint({anchorLoc:v,timestamp:g}),v=this.endpoints[1].anchor.compute({xy:[p.left,p.top],wh:m,element:this.endpoints[1],elementId:this.endpoints[1].elementId,txy:[d.left,d.top],twh:h,tElement:this.endpoints[0],timestamp:g}),this.endpoints[1].paint({anchorLoc:v,timestamp:g})}this.getTypeDescriptor=function(){return"connection"},this.getAttachedElements=function(){return this.endpoints},this.isDetachable=function(){return this._jsPlumb.detachable===!0},this.setDetachable=function(t){this._jsPlumb.detachable=t===!0},this.isReattach=function(){return this._jsPlumb.reattach===!0||this.endpoints[0].reattachConnections===!0||this.endpoints[1].reattachConnections===!0},this.setReattach=function(t){this._jsPlumb.reattach=t===!0},this._jsPlumb.cost=t.cost||this.endpoints[0].getConnectionCost(),this._jsPlumb.directed=t.directed,null==t.directed&&(this._jsPlumb.directed=this.endpoints[0].areConnectionsDirected());var y=jsPlumb.extend({},this.endpoints[1].getParameters());e.extend(y,this.endpoints[0].getParameters()),e.extend(y,this.getParameters()),this.setParameters(y),this.setConnector(this.endpoints[0].connector||this.endpoints[1].connector||t.connector||r.Defaults.Connector||e.Defaults.Connector,!0),t.geometry&&this.connector.setGeometry(t.geometry);var b=null!=t.data&&jsPlumbUtil.isObject(t.data)?t.data:{};this.getData=function(){return b},this.setData=function(t){b=t||{}},this.mergeData=function(t){b=jsPlumb.extend(b,t)};var $=["default",this.endpoints[0].connectionType,this.endpoints[1].connectionType,t.type].join(" ");/[^\s]/.test($)&&this.addType($,t.data,!0),this.updateConnectedClass()},n.extend(e.Connection,e.OverlayCapableJsPlumbUIComponent,{applyType:function(t,n,i){null!=t.detachable&&this.setDetachable(t.detachable),null!=t.reattach&&this.setReattach(t.reattach),t.scope&&(this.scope=t.scope),null!=t.cssClass&&this.canvas&&this._jsPlumb.instance.addClass(this.canvas,t.cssClass);var r=null;t.anchor?(r=this.getCachedTypeItem("anchors",i.anchor),null==r&&(r=[this._jsPlumb.instance.makeAnchor(t.anchor),this._jsPlumb.instance.makeAnchor(t.anchor)],this.cacheTypeItem("anchors",r,i.anchor))):t.anchors&&(r=this.getCachedTypeItem("anchors",i.anchors),null==r&&(r=[this._jsPlumb.instance.makeAnchor(t.anchors[0]),this._jsPlumb.instance.makeAnchor(t.anchors[1])],this.cacheTypeItem("anchors",r,i.anchors))),null!=r&&(this.endpoints[0].anchor=r[0],this.endpoints[1].anchor=r[1],this.endpoints[1].anchor.isDynamic&&this._jsPlumb.instance.repaint(this.endpoints[1].elementId)),e.OverlayCapableJsPlumbUIComponent.applyType(this,t)},addClass:function(t,e){e&&(this.endpoints[0].addClass(t),this.endpoints[1].addClass(t),this.suspendedEndpoint&&this.suspendedEndpoint.addClass(t)),this.connector&&this.connector.addClass(t)},removeClass:function(t,e){e&&(this.endpoints[0].removeClass(t),this.endpoints[1].removeClass(t),this.suspendedEndpoint&&this.suspendedEndpoint.removeClass(t)),this.connector&&this.connector.removeClass(t)},isVisible:function(){return this._jsPlumb.visible},setVisible:function(t){this._jsPlumb.visible=t,this.connector&&this.connector.setVisible(t),this.repaint()},cleanup:function(){this.updateConnectedClass(!0),this.endpoints=null,this.source=null,this.target=null,null!=this.connector&&(this.connector.cleanup(!0),this.connector.destroy(!0)),this.connector=null},updateConnectedClass:function(t){this._jsPlumb&&(o(this,this.source,this._jsPlumb.instance,t),o(this,this.target,this._jsPlumb.instance,t))},setHover:function(e){this.connector&&this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged()&&(this.connector.setHover(e),t.jsPlumb[e?"addClass":"removeClass"](this.source,this._jsPlumb.instance.hoverSourceClass),t.jsPlumb[e?"addClass":"removeClass"](this.target,this._jsPlumb.instance.hoverTargetClass))},getUuids:function(){return[this.endpoints[0].getUuid(),this.endpoints[1].getUuid()]},getCost:function(){return this._jsPlumb?this._jsPlumb.cost:-(1/0)},setCost:function(t){this._jsPlumb.cost=t},isDirected:function(){return this._jsPlumb.directed===!0},getConnector:function(){return this.connector},getGeometry:function(){return this.connector?this.connector.getGeometry():null},setGeometry:function(t){this.connector&&this.connector.setGeometry(t)},prepareConnector:function(t,e){var r,o={_jsPlumb:this._jsPlumb.instance,cssClass:(this._jsPlumb.params.cssClass||"")+(this.isEditable()?this._jsPlumb.instance.editableConnectorClass:""),container:this._jsPlumb.params.container,"pointer-events":this._jsPlumb.params["pointer-events"],editable:this.editableRequested},a=this._jsPlumb.instance.getRenderMode();return n.isString(t)?r=i(this._jsPlumb.instance,a,t,o,this):n.isArray(t)&&(r=1==t.length?i(this._jsPlumb.instance,a,t[0],o,this):i(this._jsPlumb.instance,a,t[0],n.merge(t[1],o),this)),null!=e&&(r.typeId=e),r},setPreparedConnector:function(t,e,n,i){var r,o="";if(null!=this.connector&&(r=this.connector,o=r.getClass(),this.connector.cleanup(),this.connector.destroy()),this.connector=t,i&&this.cacheTypeItem("connector",t,i),this.canvas=this.connector.canvas,this.bgCanvas=this.connector.bgCanvas,this.addClass(o),this.canvas&&(this.canvas._jsPlumb=this),this.bgCanvas&&(this.bgCanvas._jsPlumb=this),null!=r)for(var a=this.getOverlays(),s=0;s<a.length;s++)a[s].transfer&&a[s].transfer(this.connector);n||this.setListenerComponent(this.connector),e||this.repaint()},setConnector:function(t,e,n,i){var r=this.prepareConnector(t,i);this.setPreparedConnector(r,e,n,i)},paint:function(t){if(!this._jsPlumb.instance.isSuspendDrawing()&&this._jsPlumb.visible){t=t||{};var e=t.timestamp,n=!1,i=n?this.sourceId:this.targetId,r=n?this.targetId:this.sourceId,o=n?0:1,a=n?1:0;if(null==e||e!=this._jsPlumb.lastPaintedAt){var s=this._jsPlumb.instance.updateOffset({elId:r}).o,l=this._jsPlumb.instance.updateOffset({elId:i}).o,u=this.endpoints[a],c=this.endpoints[o],d=u.anchor.getCurrentLocation({xy:[s.left,s.top],wh:[s.width,s.height],element:u,timestamp:e}),h=c.anchor.getCurrentLocation({xy:[l.left,l.top],wh:[l.width,l.height],element:c,timestamp:e});this.connector.resetBounds(),this.connector.compute({sourcePos:d,targetPos:h,sourceEndpoint:this.endpoints[a],targetEndpoint:this.endpoints[o],lineWidth:this._jsPlumb.paintStyleInUse.lineWidth,sourceInfo:s,targetInfo:l});var f={minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)};for(var p in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(p)){var m=this._jsPlumb.overlays[p];m.isVisible()&&(this._jsPlumb.overlayPlacements[p]=m.draw(this.connector,this._jsPlumb.paintStyleInUse,this.getAbsoluteOverlayPosition(m)),f.minX=Math.min(f.minX,this._jsPlumb.overlayPlacements[p].minX),f.maxX=Math.max(f.maxX,this._jsPlumb.overlayPlacements[p].maxX),f.minY=Math.min(f.minY,this._jsPlumb.overlayPlacements[p].minY),f.maxY=Math.max(f.maxY,this._jsPlumb.overlayPlacements[p].maxY))}var g=parseFloat(this._jsPlumb.paintStyleInUse.lineWidth||1)/2,v=parseFloat(this._jsPlumb.paintStyleInUse.lineWidth||0),y={xmin:Math.min(this.connector.bounds.minX-(g+v),f.minX),ymin:Math.min(this.connector.bounds.minY-(g+v),f.minY),xmax:Math.max(this.connector.bounds.maxX+(g+v),f.maxX),ymax:Math.max(this.connector.bounds.maxY+(g+v),f.maxY)};this.connector.paint(this._jsPlumb.paintStyleInUse,null,y);for(var b in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(b)){var $=this._jsPlumb.overlays[b];$.isVisible()&&$.paint(this._jsPlumb.overlayPlacements[b],y)}}this._jsPlumb.lastPaintedAt=e}},repaint:function(t){t=t||{},this.paint({elId:this.sourceId,recalc:!(t.recalc===!1),timestamp:t.timestamp})},prepareEndpoint:function(t,n,i,o,a,s,l,u){var c;if(o)i.endpoints[a]=o,o.addConnection(i);else{s.endpoints||(s.endpoints=[null,null]);var d=s.endpoints[a]||s.endpoint||t.Defaults.Endpoints[a]||jsPlumb.Defaults.Endpoints[a]||t.Defaults.Endpoint||jsPlumb.Defaults.Endpoint;s.endpointStyles||(s.endpointStyles=[null,null]),s.endpointHoverStyles||(s.endpointHoverStyles=[null,null]);var h=s.endpointStyles[a]||s.endpointStyle||t.Defaults.EndpointStyles[a]||jsPlumb.Defaults.EndpointStyles[a]||t.Defaults.EndpointStyle||jsPlumb.Defaults.EndpointStyle;null==h.fillStyle&&null!=s.paintStyle&&(h.fillStyle=s.paintStyle.strokeStyle),null==h.outlineColor&&null!=s.paintStyle&&(h.outlineColor=s.paintStyle.outlineColor),null==h.outlineWidth&&null!=s.paintStyle&&(h.outlineWidth=s.paintStyle.outlineWidth);var f=s.endpointHoverStyles[a]||s.endpointHoverStyle||t.Defaults.EndpointHoverStyles[a]||jsPlumb.Defaults.EndpointHoverStyles[a]||t.Defaults.EndpointHoverStyle||jsPlumb.Defaults.EndpointHoverStyle;null!=s.hoverPaintStyle&&(null==f&&(f={}),null==f.fillStyle&&(f.fillStyle=s.hoverPaintStyle.strokeStyle));var p=s.anchors?s.anchors[a]:s.anchor?s.anchor:r(t.Defaults.Anchors[a],u,t)||r(e.Defaults.Anchors[a],u,t)||r(t.Defaults.Anchor,u,t)||r(e.Defaults.Anchor,u,t),m=s.uuids?s.uuids[a]:null;c=n({paintStyle:h,hoverPaintStyle:f,endpoint:d,connections:[i],uuid:m,anchor:p,source:l,scope:s.scope,reattach:s.reattach||t.Defaults.ReattachConnections,detachable:s.detachable||t.Defaults.ConnectionsDetachable}),i.endpoints[a]=c,s.drawEndpoints===!1&&c.setVisible(!1,!0,!0)}return c}})}.call(this),function(){"use strict";var t=this,e=t.jsPlumbUtil,n=t.jsPlumb;n.AnchorManager=function(t){var i={},r={},o={},a={},s={HORIZONTAL:"horizontal",VERTICAL:"vertical",DIAGONAL:"diagonal",IDENTITY:"identity"},l=["left","top","right","bottom"],u={},c=this,d={},h=t.jsPlumbInstance,f={},p=function(t,e,n,i,r,o){if(t===e)return{orientation:s.IDENTITY,a:["top","top"]};var a=Math.atan2(i.centery-n.centery,i.centerx-n.centerx),u=Math.atan2(n.centery-i.centery,n.centerx-i.centerx),c=[],d={};!function(t,e){for(var n=0;n<t.length;n++)d[t[n]]={left:[e[n].left,e[n].centery],right:[e[n].right,e[n].centery],top:[e[n].centerx,e[n].top],bottom:[e[n].centerx,e[n].bottom]}}(["source","target"],[n,i]);for(var h=0;h<l.length;h++)for(var f=0;f<l.length;f++)c.push({source:l[h],target:l[f],dist:Biltong.lineLength(d.source[l[h]],d.target[l[f]])});c.sort(function(t,e){return t.dist<e.dist?-1:t.dist>e.dist?1:0});for(var p=c[0].source,m=c[0].target,g=0;g<c.length&&(p=!r.isContinuous||r.isEdgeSupported(c[g].source)?c[g].source:null,m=!o.isContinuous||o.isEdgeSupported(c[g].target)?c[g].target:null,null==p||null==m);g++);return{a:[p,m],theta:a,theta2:u}},m=function(t,e,n,i,r,o,a){for(var s=[],l=e[r?0:1]/(i.length+1),u=0;u<i.length;u++){var c=(u+1)*l,d=o*e[r?1:0];a&&(c=e[r?0:1]-c);var h=r?c:d,f=n[0]+h,p=h/e[0],m=r?d:c,g=n[1]+m,v=m/e[1];s.push([f,g,p,v,i[u][1],i[u][2]])}return s},g=function(t){return function(e,n){var i=!0;return i=t?e[0][0]<n[0][0]:e[0][0]>n[0][0],i===!1?-1:1}},v=function(t,e){var n=t[0][0]<0?-Math.PI-t[0][0]:Math.PI-t[0][0],i=e[0][0]<0?-Math.PI-e[0][0]:Math.PI-e[0][0];return n>i?1:t[0][1]>e[0][1]?1:-1},y={top:function(t,e){return t[0]>e[0]?1:-1},right:g(!0),bottom:g(!0),left:v},b=function(t,e){return t.sort(e)},$=function(t,e){var n=h.getCachedData(t),i=n.s,o=n.o,s=function(e,n,i,o,s,l,u){if(o.length>0)for(var c=b(o,y[e]),d="right"===e||"top"===e,h=m(e,n,i,c,s,l,d),f=function(t,e){r[t.id]=[e[0],e[1],e[2],e[3]],a[t.id]=u},p=0;p<h.length;p++){var g=h[p][4],v=g.endpoints[0].elementId===t,$=g.endpoints[1].elementId===t;v&&f(g.endpoints[0],h[p]),$&&f(g.endpoints[1],h[p])}};s("bottom",i,[o.left,o.top],e.bottom,!0,1,[0,1]),s("top",i,[o.left,o.top],e.top,!0,0,[0,-1]),s("left",i,[o.left,o.top],e.left,!1,0,[-1,0]),s("right",i,[o.left,o.top],e.right,!1,1,[1,0])};this.reset=function(){i={},u={},d={}},this.addFloatingConnection=function(t,e){f[t]=e},this.removeFloatingConnection=function(t){delete f[t]},this.newConnection=function(t){var i=t.sourceId,r=t.targetId,o=t.endpoints,a=!0,s=function(s,l,c,d,h){i==r&&c.isContinuous&&(t._jsPlumb.instance.removeElement(o[1].canvas),a=!1),e.addToList(u,d,[h,l,c.constructor==n.DynamicAnchor])};s(0,o[0],o[0].anchor,r,t),a&&s(1,o[1],o[1].anchor,i,t)};var w=function(t){!function(t,n){if(t){var i=function(t){return t[4]==n};e.removeWithFunction(t.top,i),e.removeWithFunction(t.left,i),e.removeWithFunction(t.bottom,i),e.removeWithFunction(t.right,i)}}(d[t.elementId],t.id)};this.connectionDetached=function(t,n){var i=t.connection||t,r=t.sourceId,o=t.targetId,a=i.endpoints,s=function(t,n,i,r,o){e.removeWithFunction(u[r],function(t){return t[0].id==o.id})};s(1,a[1],a[1].anchor,r,i),s(0,a[0],a[0].anchor,o,i),i.floatingId&&(s(i.floatingIndex,i.floatingEndpoint,i.floatingEndpoint.anchor,i.floatingId,i),w(i.floatingEndpoint)),w(i.endpoints[0]),w(i.endpoints[1]),n||(c.redraw(i.sourceId),i.targetId!==i.sourceId&&c.redraw(i.targetId))},this.add=function(t,n){e.addToList(i,n,t)},this.changeId=function(t,e){u[e]=u[t],i[e]=i[t],delete u[t],delete i[t]},this.getConnectionsFor=function(t){return u[t]||[]},this.getEndpointsFor=function(t){return i[t]||[]},this.deleteEndpoint=function(t){e.removeWithFunction(i[t.elementId],function(e){return e.id==t.id}),w(t)},this.clearFor=function(t){delete i[t],i[t]=[]};var x=function(n,i,r,o,a,s,l,u,c,d,h,f){var p,m,g=-1,v=-1,y=o.endpoints[l],b=y.id,$=[1,0][l],w=[[i,r],o,a,s,b],x=n[c],C=y._continuousAnchorEdge?n[y._continuousAnchorEdge]:null;if(C){var S=e.findWithFunction(C,function(t){return t[4]==b});if(-1!=S)for(C.splice(S,1),p=0;p<C.length;p++)m=C[p][1],e.addWithFunction(h,m,function(t){return t.id==m.id}),e.addWithFunction(f,C[p][1].endpoints[l],function(t){return t.id==m.endpoints[l].id}),e.addWithFunction(f,C[p][1].endpoints[$],function(t){return t.id==m.endpoints[$].id})}for(p=0;p<x.length;p++)m=x[p][1],1==t.idx&&x[p][3]===s&&-1==v&&(v=p),e.addWithFunction(h,m,function(t){return t.id==m.id}),e.addWithFunction(f,x[p][1].endpoints[l],function(t){return t.id==m.endpoints[l].id}),e.addWithFunction(f,x[p][1].endpoints[$],function(t){return t.id==m.endpoints[$].id});if(-1!=g)x[g]=w;else{var k=u?-1!=v?v:0:x.length;x.splice(k,0,w)}y._continuousAnchorEdge=c};this.updateOtherEndpoint=function(t,i,r,o){var a=e.findWithFunction(u[t],function(t){return t[0].id===o.id}),s=e.findWithFunction(u[i],function(t){return t[0].id===o.id});-1!=a&&(u[t][a][0]=o,u[t][a][1]=o.endpoints[1],u[t][a][2]=o.endpoints[1].anchor.constructor==n.DynamicAnchor),s>-1&&(u[i].splice(s,1),e.addToList(u,r,[o,o.endpoints[0],o.endpoints[0].anchor.constructor==n.DynamicAnchor])),o.updateConnectedClass()},this.sourceChanged=function(t,i,r){if(t!==i){e.removeWithFunction(u[t],function(t){return t[0].id===r.id});var o=e.findWithFunction(u[r.targetId],function(t){return t[0].id===r.id});o>-1&&(u[r.targetId][o][0]=r,u[r.targetId][o][1]=r.endpoints[0],u[r.targetId][o][2]=r.endpoints[0].anchor.constructor==n.DynamicAnchor),e.addToList(u,i,[r,r.endpoints[1],r.endpoints[1].anchor.constructor==n.DynamicAnchor]),r.endpoints[1].anchor.isContinuous&&(r.source===r.target?r._jsPlumb.instance.removeElement(r.endpoints[1].canvas):null==r.endpoints[1].canvas.parentNode&&r._jsPlumb.instance.appendElement(r.endpoints[1].canvas)),r.updateConnectedClass()}},this.rehomeEndpoint=function(t,e,n){
var r=i[e]||[],o=h.getId(n);if(o!==e){var a=r.indexOf(t);if(a>-1){var s=r.splice(a,1)[0];c.add(s,o)}}for(var l=0;l<t.connections.length;l++)t.connections[l].sourceId==e?(t.connections[l].sourceId=t.elementId,t.connections[l].source=t.element,c.sourceChanged(e,t.elementId,t.connections[l])):t.connections[l].targetId==e&&(t.connections[l].targetId=t.elementId,t.connections[l].target=t.element,c.updateOtherEndpoint(t.connections[l].sourceId,e,t.elementId,t.connections[l]))},this.redraw=function(t,r,o,a,s,l){if(!h.isSuspendDrawing()){var c=i[t]||[],m=u[t]||[],g=[],v=[],y=[];o=o||h.timestamp(),a=a||{left:0,top:0},r&&(r={left:r.left+a.left,top:r.top+a.top});for(var b=h.updateOffset({elId:t,offset:r,recalc:!1,timestamp:o}),w={},C=0;C<m.length;C++){var S=m[C][0],k=S.sourceId,D=S.targetId,E=S.endpoints[0].anchor.isContinuous,_=S.endpoints[1].anchor.isContinuous;if(E||_){var M=k+"_"+D,T=w[M],P=S.sourceId==t?1:0;E&&!d[k]&&(d[k]={top:[],right:[],bottom:[],left:[]}),_&&!d[D]&&(d[D]={top:[],right:[],bottom:[],left:[]}),t!=D&&h.updateOffset({elId:D,timestamp:o}),t!=k&&h.updateOffset({elId:k,timestamp:o});var A=h.getCachedData(D),j=h.getCachedData(k);D==k&&(E||_)?(x(d[k],-Math.PI/2,0,S,!1,D,0,!1,"top",k,g,v),x(d[D],-Math.PI/2,0,S,!1,k,1,!1,"top",D,g,v)):(T||(T=p(k,D,j.o,A.o,S.endpoints[0].anchor,S.endpoints[1].anchor),w[M]=T),E&&x(d[k],T.theta,0,S,!1,D,0,!1,T.a[0],k,g,v),_&&x(d[D],T.theta2,-1,S,!0,k,1,!0,T.a[1],D,g,v)),E&&e.addWithFunction(y,k,function(t){return t===k}),_&&e.addWithFunction(y,D,function(t){return t===D}),e.addWithFunction(g,S,function(t){return t.id==S.id}),(E&&0===P||_&&1===P)&&e.addWithFunction(v,S.endpoints[P],function(t){return t.id==S.endpoints[P].id})}}for(C=0;C<c.length;C++)0===c[C].connections.length&&c[C].anchor.isContinuous&&(d[t]||(d[t]={top:[],right:[],bottom:[],left:[]}),x(d[t],-Math.PI/2,0,{endpoints:[c[C],c[C]],paint:function(){}},!1,t,0,!1,c[C].anchor.getDefaultFace(),t,g,v),e.addWithFunction(y,t,function(e){return e===t}));for(C=0;C<y.length;C++)$(y[C],d[y[C]]);for(C=0;C<c.length;C++)c[C].paint({timestamp:o,offset:b,dimensions:b.s,recalc:l!==!0});for(C=0;C<v.length;C++){var O=h.getCachedData(v[C].elementId);v[C].paint({timestamp:o,offset:O,dimensions:O.s})}for(C=0;C<m.length;C++){var F=m[C][1];if(F.anchor.constructor==n.DynamicAnchor){F.paint({elementWithPrecedence:t,timestamp:o}),e.addWithFunction(g,m[C][0],function(t){return t.id==m[C][0].id});for(var I=0;I<F.connections.length;I++)F.connections[I]!==m[C][0]&&e.addWithFunction(g,F.connections[I],function(t){return t.id==F.connections[I].id})}else F.anchor.constructor==n.Anchor&&e.addWithFunction(g,m[C][0],function(t){return t.id==m[C][0].id})}var N=f[t];for(N&&N.paint({timestamp:o,recalc:!1,elId:t}),C=0;C<g.length;C++)g[C].paint({elId:t,timestamp:o,recalc:!1,clearEdits:s})}};var C=function(t){e.EventGenerator.apply(this),this.type="Continuous",this.isDynamic=!0,this.isContinuous=!0;for(var n=t.faces||["top","right","bottom","left"],i=!(t.clockwise===!1),s={},l={top:"bottom",right:"left",left:"right",bottom:"top"},u={top:"right",right:"bottom",left:"top",bottom:"left"},c={top:"left",right:"top",left:"bottom",bottom:"right"},d=i?u:c,h=i?c:u,f=t.cssClass||"",p=0;p<n.length;p++)s[n[p]]=!0;this.getDefaultFace=function(){return 0===n.length?"top":n[0]},this.verifyEdge=function(t){return s[t]?t:s[l[t]]?l[t]:s[d[t]]?d[t]:s[h[t]]?h[t]:t},this.isEdgeSupported=function(t){return s[t]===!0},this.compute=function(t){return o[t.element.id]||r[t.element.id]||[0,0]},this.getCurrentLocation=function(t){return o[t.element.id]||r[t.element.id]||[0,0]},this.getOrientation=function(t){return a[t.id]||[0,0]},this.clearUserDefinedLocation=function(){delete o[t.elementId]},this.setUserDefinedLocation=function(e){o[t.elementId]=e},this.getCssClass=function(){return f}};h.continuousAnchorFactory={get:function(t){return new C(t)},clear:function(t){delete o[t],delete r[t]}}},n.Anchor=function(t){this.x=t.x||0,this.y=t.y||0,this.elementId=t.elementId,this.cssClass=t.cssClass||"",this.userDefinedLocation=null,this.orientation=t.orientation||[0,0],this.lastReturnValue=null,this.offsets=t.offsets||[0,0],this.timestamp=null,e.EventGenerator.apply(this),this.compute=function(t){var e=t.xy,n=t.wh,i=t.timestamp;return t.clearUserDefinedLocation&&(this.userDefinedLocation=null),i&&i===self.timestamp?this.lastReturnValue:(null!=this.userDefinedLocation?this.lastReturnValue=this.userDefinedLocation:this.lastReturnValue=[e[0]+this.x*n[0]+this.offsets[0],e[1]+this.y*n[1]+this.offsets[1]],this.timestamp=i,this.lastReturnValue)},this.getCurrentLocation=function(t){return t=t||{},null==this.lastReturnValue||null!=t.timestamp&&this.timestamp!=t.timestamp?this.compute(t):this.lastReturnValue}},e.extend(n.Anchor,e.EventGenerator,{equals:function(t){if(!t)return!1;var e=t.getOrientation(),n=this.getOrientation();return this.x==t.x&&this.y==t.y&&this.offsets[0]==t.offsets[0]&&this.offsets[1]==t.offsets[1]&&n[0]==e[0]&&n[1]==e[1]},getUserDefinedLocation:function(){return this.userDefinedLocation},setUserDefinedLocation:function(t){this.userDefinedLocation=t},clearUserDefinedLocation:function(){this.userDefinedLocation=null},getOrientation:function(){return this.orientation},getCssClass:function(){return this.cssClass}}),n.FloatingAnchor=function(t){n.Anchor.apply(this,arguments);var e=t.reference,i=t.referenceCanvas,r=n.getSize(i),o=0,a=0,s=null,l=null;this.orientation=null,this.x=0,this.y=0,this.isFloating=!0,this.compute=function(t){var e=t.xy,n=[e[0]+r[0]/2,e[1]+r[1]/2];return l=n,n},this.getOrientation=function(t){if(s)return s;var n=e.getOrientation(t);return[Math.abs(n[0])*o*-1,Math.abs(n[1])*a*-1]},this.over=function(t,e){s=t.getOrientation(e)},this.out=function(){s=null},this.getCurrentLocation=function(t){return null==l?this.compute(t):l}},e.extend(n.FloatingAnchor,n.Anchor);var i=function(t,e,i){return t.constructor==n.Anchor?t:e.makeAnchor(t,i,e)};n.DynamicAnchor=function(t){n.Anchor.apply(this,arguments),this.isDynamic=!0,this.anchors=[],this.elementId=t.elementId,this.jsPlumbInstance=t.jsPlumbInstance;for(var e=0;e<t.anchors.length;e++)this.anchors[e]=i(t.anchors[e],this.jsPlumbInstance,this.elementId);this.getAnchors=function(){return this.anchors},this.locked=!1;var r=this.anchors.length>0?this.anchors[0]:null,o=r,a=this,s=function(t,e,n,i,r){var o=i[0]+t.x*r[0],a=i[1]+t.y*r[1],s=i[0]+r[0]/2,l=i[1]+r[1]/2;return Math.sqrt(Math.pow(e-o,2)+Math.pow(n-a,2))+Math.sqrt(Math.pow(s-o,2)+Math.pow(l-a,2))},l=t.selector||function(t,e,n,i,r){for(var o=n[0]+i[0]/2,a=n[1]+i[1]/2,l=-1,u=1/0,c=0;c<r.length;c++){var d=s(r[c],o,a,t,e);u>d&&(l=c+0,u=d)}return r[l]};this.compute=function(t){var e=t.xy,n=t.wh,i=t.txy,s=t.twh;this.timestamp=t.timestamp;var u=a.getUserDefinedLocation();return null!=u?u:this.locked||null==i||null==s?r.compute(t):(t.timestamp=null,r=l(e,n,i,s,this.anchors),this.x=r.x,this.y=r.y,r!=o&&this.fire("anchorChanged",r),o=r,r.compute(t))},this.getCurrentLocation=function(t){return this.getUserDefinedLocation()||(null!=r?r.getCurrentLocation(t):null)},this.getOrientation=function(t){return null!=r?r.getOrientation(t):[0,0]},this.over=function(t,e){null!=r&&r.over(t,e)},this.out=function(){null!=r&&r.out()},this.getCssClass=function(){return r&&r.getCssClass()||""}},e.extend(n.DynamicAnchor,n.Anchor);var r=function(t,e,i,r,o,a){n.Anchors[o]=function(n){var s=n.jsPlumbInstance.makeAnchor([t,e,i,r,0,0],n.elementId,n.jsPlumbInstance);return s.type=o,a&&a(s,n),s}};r(.5,0,0,-1,"TopCenter"),r(.5,1,0,1,"BottomCenter"),r(0,.5,-1,0,"LeftMiddle"),r(1,.5,1,0,"RightMiddle"),r(.5,0,0,-1,"Top"),r(.5,1,0,1,"Bottom"),r(0,.5,-1,0,"Left"),r(1,.5,1,0,"Right"),r(.5,.5,0,0,"Center"),r(1,0,0,-1,"TopRight"),r(1,1,0,1,"BottomRight"),r(0,0,0,-1,"TopLeft"),r(0,1,0,1,"BottomLeft"),n.Defaults.DynamicAnchors=function(t){return t.jsPlumbInstance.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"],t.elementId,t.jsPlumbInstance)},n.Anchors.AutoDefault=function(t){var e=t.jsPlumbInstance.makeDynamicAnchor(n.Defaults.DynamicAnchors(t));return e.type="AutoDefault",e};var o=function(t,e){n.Anchors[t]=function(n){var i=n.jsPlumbInstance.makeAnchor(["Continuous",{faces:e}],n.elementId,n.jsPlumbInstance);return i.type=t,i}};n.Anchors.Continuous=function(t){return t.jsPlumbInstance.continuousAnchorFactory.get(t)},o("ContinuousLeft",["left"]),o("ContinuousTop",["top"]),o("ContinuousBottom",["bottom"]),o("ContinuousRight",["right"]),r(0,0,0,0,"Assign",function(t,e){var n=e.position||"Fixed";t.positionFinder=n.constructor==String?e.jsPlumbInstance.AnchorPositionFinders[n]:n,t.constructorParams=e}),jsPlumbInstance.prototype.AnchorPositionFinders={Fixed:function(t,e,n){return[(t.left-e.left)/n[0],(t.top-e.top)/n[1]]},Grid:function(t,e,n,i){var r=t.left-e.left,o=t.top-e.top,a=n[0]/i.grid[0],s=n[1]/i.grid[1],l=Math.floor(r/a),u=Math.floor(o/s);return[(l*a+a/2)/n[0],(u*s+s/2)/n[1]]}},n.Anchors.Perimeter=function(t){t=t||{};var e=t.anchorCount||60,n=t.shape;if(!n)throw new Error("no shape supplied to Perimeter Anchor type");var i=function(){for(var t=.5,n=2*Math.PI/e,i=0,r=[],o=0;e>o;o++){var a=t+t*Math.sin(i),s=t+t*Math.cos(i);r.push([a,s,0,0]),i+=n}return r},r=function(t){for(var n=e/t.length,i=[],r=function(t,r,o,a,s){n=e*s;for(var l=(o-t)/n,u=(a-r)/n,c=0;n>c;c++)i.push([t+l*c,r+u*c,0,0])},o=0;o<t.length;o++)r.apply(null,t[o]);return i},o=function(t){for(var e=[],n=0;n<t.length;n++)e.push([t[n][0],t[n][1],t[n][2],t[n][3],1/t.length]);return r(e)},a=function(){return o([[0,0,1,0],[1,0,1,1],[1,1,0,1],[0,1,0,0]])},s={Circle:i,Ellipse:i,Diamond:function(){return o([[.5,0,1,.5],[1,.5,.5,1],[.5,1,0,.5],[0,.5,.5,0]])},Rectangle:a,Square:a,Triangle:function(){return o([[.5,0,1,1],[1,1,0,1],[0,1,.5,0]])},Path:function(t){for(var e=t.points,n=[],i=0,o=0;o<e.length-1;o++){var a=Math.sqrt(Math.pow(e[o][2]-e[o][0])+Math.pow(e[o][3]-e[o][1]));i+=a,n.push([e[o][0],e[o][1],e[o+1][0],e[o+1][1],a])}for(var s=0;s<n.length;s++)n[s][4]=n[s][4]/i;return r(n)}},l=function(t,e){for(var n=[],i=e/180*Math.PI,r=0;r<t.length;r++){var o=t[r][0]-.5,a=t[r][1]-.5;n.push([.5+(o*Math.cos(i)-a*Math.sin(i)),.5+(o*Math.sin(i)+a*Math.cos(i)),t[r][2],t[r][3]])}return n};if(!s[n])throw new Error("Shape ["+n+"] is unknown by Perimeter Anchor type");var u=s[n](t);t.rotation&&(u=l(u,t.rotation));var c=t.jsPlumbInstance.makeDynamicAnchor(u);return c.type="Perimeter",c}}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=t.Biltong;e.Segments={AbstractSegment:function(t){this.params=t,this.findClosestPointOnPath=function(t,e){return{d:1/0,x:null,y:null,l:null}},this.getBounds=function(){return{minX:Math.min(t.x1,t.x2),minY:Math.min(t.y1,t.y2),maxX:Math.max(t.x1,t.x2),maxY:Math.max(t.y1,t.y2)}}},Straight:function(t){var n,r,o,a,s,l,u,c=(e.Segments.AbstractSegment.apply(this,arguments),function(){n=Math.sqrt(Math.pow(s-a,2)+Math.pow(u-l,2)),r=i.gradient({x:a,y:l},{x:s,y:u}),o=-1/r});this.type="Straight",this.getLength=function(){return n},this.getGradient=function(){return r},this.getCoordinates=function(){return{x1:a,y1:l,x2:s,y2:u}},this.setCoordinates=function(t){a=t.x1,l=t.y1,s=t.x2,u=t.y2,c()},this.setCoordinates({x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}),this.getBounds=function(){return{minX:Math.min(a,s),minY:Math.min(l,u),maxX:Math.max(a,s),maxY:Math.max(l,u)}},this.pointOnPath=function(t,e){if(0!==t||e){if(1!=t||e){var r=e?t>0?t:n+t:t*n;return i.pointOnLine({x:a,y:l},{x:s,y:u},r)}return{x:s,y:u}}return{x:a,y:l}},this.gradientAtPoint=function(t){return r},this.pointAlongPathFrom=function(t,e,n){var r=this.pointOnPath(t,n),o=0>=e?{x:a,y:l}:{x:s,y:u};return 0>=e&&Math.abs(e)>1&&(e*=-1),i.pointOnLine(r,o,e)};var d=function(t,e,n){return n>=Math.min(t,e)&&n<=Math.max(t,e)},h=function(t,e,n){return Math.abs(n-t)<Math.abs(n-e)?t:e};this.findClosestPointOnPath=function(t,e){var c={d:1/0,x:null,y:null,l:null,x1:a,x2:s,y1:l,y2:u};if(0===r)c.y=l,c.x=d(a,s,t)?t:h(a,s,t);else if(r==1/0||r==-(1/0))c.x=a,c.y=d(l,u,e)?e:h(l,u,e);else{var f=l-r*a,p=e-o*t,m=(p-f)/(r-o),g=r*m+f;c.x=d(a,s,m)?m:h(a,s,m),c.y=d(l,u,g)?g:h(l,u,g)}var v=i.lineLength([c.x,c.y],[a,l]);return c.d=i.lineLength([t,e],[c.x,c.y]),c.l=v/n,c}},Arc:function(t){var n=(e.Segments.AbstractSegment.apply(this,arguments),function(e,n){return i.theta([t.cx,t.cy],[e,n])}),r=function(t,e){if(t.anticlockwise){var n=t.startAngle<t.endAngle?t.startAngle+o:t.startAngle,i=Math.abs(n-t.endAngle);return n-i*e}var r=t.endAngle<t.startAngle?t.endAngle+o:t.endAngle,a=Math.abs(r-t.startAngle);return t.startAngle+a*e},o=2*Math.PI;this.radius=t.r,this.anticlockwise=t.ac,this.type="Arc",t.startAngle&&t.endAngle?(this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.x1=t.cx+this.radius*Math.cos(t.startAngle),this.y1=t.cy+this.radius*Math.sin(t.startAngle),this.x2=t.cx+this.radius*Math.cos(t.endAngle),this.y2=t.cy+this.radius*Math.sin(t.endAngle)):(this.startAngle=n(t.x1,t.y1),this.endAngle=n(t.x2,t.y2),this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2),this.endAngle<0&&(this.endAngle+=o),this.startAngle<0&&(this.startAngle+=o);var a=this.endAngle<this.startAngle?this.endAngle+o:this.endAngle;this.sweep=Math.abs(a-this.startAngle),this.anticlockwise&&(this.sweep=o-this.sweep);var s=2*Math.PI*this.radius,l=this.sweep/o,u=s*l;this.getLength=function(){return u},this.getBounds=function(){return{minX:t.cx-t.r,maxX:t.cx+t.r,minY:t.cy-t.r,maxY:t.cy+t.r}};var c=1e-10,d=function(t){var e=Math.floor(t),n=Math.ceil(t);return c>t-e?e:c>n-t?n:t};this.pointOnPath=function(e,n){if(0===e)return{x:this.x1,y:this.y1,theta:this.startAngle};if(1==e)return{x:this.x2,y:this.y2,theta:this.endAngle};n&&(e/=u);var i=r(this,e),o=t.cx+t.r*Math.cos(i),a=t.cy+t.r*Math.sin(i);return{x:d(o),y:d(a),theta:i}},this.gradientAtPoint=function(e,n){var r=this.pointOnPath(e,n),o=i.normal([t.cx,t.cy],[r.x,r.y]);return this.anticlockwise||o!=1/0&&o!=-(1/0)||(o*=-1),o},this.pointAlongPathFrom=function(e,n,i){var r=this.pointOnPath(e,i),o=n/s*2*Math.PI,a=this.anticlockwise?-1:1,l=r.theta+a*o,u=t.cx+this.radius*Math.cos(l),c=t.cy+this.radius*Math.sin(l);return{x:u,y:c}}},Bezier:function(n){this.curve=[{x:n.x1,y:n.y1},{x:n.cp1x,y:n.cp1y},{x:n.cp2x,y:n.cp2y},{x:n.x2,y:n.y2}];e.Segments.AbstractSegment.apply(this,arguments);this.bounds={minX:Math.min(n.x1,n.x2,n.cp1x,n.cp2x),minY:Math.min(n.y1,n.y2,n.cp1y,n.cp2y),maxX:Math.max(n.x1,n.x2,n.cp1x,n.cp2x),maxY:Math.max(n.y1,n.y2,n.cp1y,n.cp2y)},this.type="Bezier";var i=function(e,n,i){return i&&(n=t.jsBezier.locationAlongCurveFrom(e,n>0?0:1,n)),n};this.pointOnPath=function(e,n){return e=i(this.curve,e,n),t.jsBezier.pointOnCurve(this.curve,e)},this.gradientAtPoint=function(e,n){return e=i(this.curve,e,n),t.jsBezier.gradientAtPoint(this.curve,e)},this.pointAlongPathFrom=function(e,n,r){return e=i(this.curve,e,r),t.jsBezier.pointAlongCurveFrom(this.curve,e,n)},this.getLength=function(){return t.jsBezier.getLength(this.curve)},this.getBounds=function(){return this.bounds}}};var r=function(){this.resetBounds=function(){this.bounds={minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}},this.resetBounds()};e.Connectors.AbstractConnector=function(t){r.apply(this,arguments);var o=[],a=0,s=[],l=[],u=t.stub||0,c=n.isArray(u)?u[0]:u,d=n.isArray(u)?u[1]:u,h=t.gap||0,f=n.isArray(h)?h[0]:h,p=n.isArray(h)?h[1]:h,m=null,g=!1,v=null,y=null,b=t.editable!==!1&&null!=jsPlumb.ConnectorEditors&&null!=jsPlumb.ConnectorEditors[this.type],$=this.setGeometry=function(t,e){g=!e,y=t},w=this.getGeometry=function(){return y};this.hasBeenEdited=function(){return g},this.isEditing=function(){return null!=this.editor&&this.editor.isActive()},this.setEditable=function(t){return b=t&&null!=jsPlumb.ConnectorEditors&&null!=jsPlumb.ConnectorEditors[this.type]&&(null==this.overrideSetEditable||this.overrideSetEditable())?t:!1},this.isEditable=function(){return b},this.findSegmentForPoint=function(t,e){for(var n={d:1/0,s:null,x:null,y:null,l:null},i=0;i<o.length;i++){var r=o[i].findClosestPointOnPath(t,e);r.d<n.d&&(n.d=r.d,n.l=r.l,n.x=r.x,n.y=r.y,n.s=o[i],n.x1=r.x1,n.x2=r.x2,n.y1=r.y1,n.y2=r.y2,n.index=i)}return n};var x=function(){for(var t=0,e=0;e<o.length;e++){var n=o[e].getLength();l[e]=n/a,s[e]=[t,t+=n/a]}},C=function(t,e){e&&(t=t>0?t/a:(a+t)/a);for(var n=s.length-1,i=1,r=0;r<s.length;r++)if(s[r][1]>=t){n=r,i=1==t?1:0===t?0:(t-s[r][0])/l[r];break}return{segment:o[n],proportion:i,index:n}},S=function(t,n,i){if(i.x1!=i.x2||i.y1!=i.y2){var r=new e.Segments[n](i);o.push(r),a+=r.getLength(),t.updateBounds(r)}},k=function(){a=o.length=s.length=l.length=0};this.setSegments=function(t){m=[],a=0;for(var e=0;e<t.length;e++)m.push(t[e]),a+=t[e].getLength()},this.getLength=function(){return a};var D=function(t){this.lineWidth=t.lineWidth;var e=i.quadrant(t.sourcePos,t.targetPos),n=t.targetPos[0]<t.sourcePos[0],r=t.targetPos[1]<t.sourcePos[1],o=t.lineWidth||1,a=t.sourceEndpoint.anchor.getOrientation(t.sourceEndpoint),s=t.targetEndpoint.anchor.getOrientation(t.targetEndpoint),l=n?t.targetPos[0]:t.sourcePos[0],u=r?t.targetPos[1]:t.sourcePos[1],h=Math.abs(t.targetPos[0]-t.sourcePos[0]),m=Math.abs(t.targetPos[1]-t.sourcePos[1]);if(0===a[0]&&0===a[1]||0===s[0]&&0===s[1]){var g=h>m?0:1,v=[1,0][g];a=[],s=[],a[g]=t.sourcePos[g]>t.targetPos[g]?-1:1,s[g]=t.sourcePos[g]>t.targetPos[g]?1:-1,a[v]=0,s[v]=0}var y=n?h+f*a[0]:f*a[0],b=r?m+f*a[1]:f*a[1],$=n?p*s[0]:h+p*s[0],w=r?p*s[1]:m+p*s[1],x=a[0]*s[0]+a[1]*s[1],C={sx:y,sy:b,tx:$,ty:w,lw:o,xSpan:Math.abs($-y),ySpan:Math.abs(w-b),mx:(y+$)/2,my:(b+w)/2,so:a,to:s,x:l,y:u,w:h,h:m,segment:e,startStubX:y+a[0]*c,startStubY:b+a[1]*c,endStubX:$+s[0]*d,endStubY:w+s[1]*d,isXGreaterThanStubTimes2:Math.abs(y-$)>c+d,isYGreaterThanStubTimes2:Math.abs(b-w)>c+d,opposite:-1==x,perpendicular:0===x,orthogonal:1==x,sourceAxis:0===a[0]?"y":"x",points:[l,u,h,m,y,b,$,w]};return C.anchorOrientation=C.opposite?"opposite":C.orthogonal?"orthogonal":"perpendicular",C};this.getSegments=function(){return o},this.updateBounds=function(t){var e=t.getBounds();this.bounds.minX=Math.min(this.bounds.minX,e.minX),this.bounds.maxX=Math.max(this.bounds.maxX,e.maxX),this.bounds.minY=Math.min(this.bounds.minY,e.minY),this.bounds.maxY=Math.max(this.bounds.maxY,e.maxY)};return this.pointOnPath=function(t,e){var n=C(t,e);return n.segment&&n.segment.pointOnPath(n.proportion,!1)||[0,0]},this.gradientAtPoint=function(t,e){var n=C(t,e);return n.segment&&n.segment.gradientAtPoint(n.proportion,!1)||0},this.pointAlongPathFrom=function(t,e,n){var i=C(t,n);return i.segment&&i.segment.pointAlongPathFrom(i.proportion,e,!1)||[0,0]},this.compute=function(t){v=D.call(this,t),k(),this._compute(v,t),this.x=v.points[0],this.y=v.points[1],this.w=v.points[2],this.h=v.points[3],this.segment=v.segment,x()},{addSegment:S,prepareCompute:D,sourceStub:c,targetStub:d,maxStub:Math.max(c,d),sourceGap:f,targetGap:p,maxGap:Math.max(f,p),setGeometry:$,getGeometry:w}},n.extend(e.Connectors.AbstractConnector,r);var o=e.Connectors.Straight=function(){this.type="Straight";var t=e.Connectors.AbstractConnector.apply(this,arguments);this._compute=function(e,n){t.addSegment(this,"Straight",{x1:e.sx,y1:e.sy,x2:e.startStubX,y2:e.startStubY}),t.addSegment(this,"Straight",{x1:e.startStubX,y1:e.startStubY,x2:e.endStubX,y2:e.endStubY}),t.addSegment(this,"Straight",{x1:e.endStubX,y1:e.endStubY,x2:e.tx,y2:e.ty})}};n.extend(e.Connectors.Straight,e.Connectors.AbstractConnector),e.registerConnectorType(o,"Straight"),e.Endpoints.AbstractEndpoint=function(t){r.apply(this,arguments);var e=this.compute=function(t,e,n,i){var r=this._compute.apply(this,arguments);return this.x=r[0],this.y=r[1],this.w=r[2],this.h=r[3],this.bounds.minX=this.x,this.bounds.minY=this.y,this.bounds.maxX=this.x+this.w,this.bounds.maxY=this.y+this.h,r};return{compute:e,cssClass:t.cssClass}},n.extend(e.Endpoints.AbstractEndpoint,r),e.Endpoints.Dot=function(t){this.type="Dot";e.Endpoints.AbstractEndpoint.apply(this,arguments);t=t||{},this.radius=t.radius||10,this.defaultOffset=.5*this.radius,this.defaultInnerRadius=this.radius/3,this._compute=function(t,e,n,i){this.radius=n.radius||this.radius;var r=t[0]-this.radius,o=t[1]-this.radius,a=2*this.radius,s=2*this.radius;if(n.strokeStyle){var l=n.lineWidth||1;r-=l,o-=l,a+=2*l,s+=2*l}return[r,o,a,s,this.radius]}},n.extend(e.Endpoints.Dot,e.Endpoints.AbstractEndpoint),e.Endpoints.Rectangle=function(t){this.type="Rectangle";e.Endpoints.AbstractEndpoint.apply(this,arguments);t=t||{},this.width=t.width||20,this.height=t.height||20,this._compute=function(t,e,n,i){var r=n.width||this.width,o=n.height||this.height,a=t[0]-r/2,s=t[1]-o/2;return[a,s,r,o]}},n.extend(e.Endpoints.Rectangle,e.Endpoints.AbstractEndpoint);var a=function(t){e.jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.displayElements=[]};n.extend(a,e.jsPlumbUIComponent,{getDisplayElements:function(){return this._jsPlumb.displayElements},appendDisplayElement:function(t){this._jsPlumb.displayElements.push(t)}}),e.Endpoints.Image=function(i){this.type="Image",a.apply(this,arguments),e.Endpoints.AbstractEndpoint.apply(this,arguments);var r=i.onload,o=i.src||i.url,s=i.cssClass?" "+i.cssClass:"";this._jsPlumb.img=new Image,this._jsPlumb.ready=!1,this._jsPlumb.initialized=!1,this._jsPlumb.deleted=!1,this._jsPlumb.widthToUse=i.width,this._jsPlumb.heightToUse=i.height,this._jsPlumb.endpoint=i.endpoint,this._jsPlumb.img.onload=function(){null!=this._jsPlumb&&(this._jsPlumb.ready=!0,this._jsPlumb.widthToUse=this._jsPlumb.widthToUse||this._jsPlumb.img.width,this._jsPlumb.heightToUse=this._jsPlumb.heightToUse||this._jsPlumb.img.height,r&&r(this))}.bind(this),this._jsPlumb.endpoint.setImage=function(t,e){var n=t.constructor==String?t:t.src;r=e,this._jsPlumb.img.src=n,null!=this.canvas&&this.canvas.setAttribute("src",this._jsPlumb.img.src)}.bind(this),this._jsPlumb.endpoint.setImage(o,r),this._compute=function(t,e,n,i){return this.anchorPoint=t,this._jsPlumb.ready?[t[0]-this._jsPlumb.widthToUse/2,t[1]-this._jsPlumb.heightToUse/2,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse]:[0,0,0,0]},this.canvas=jsPlumb.createElement("img",{position:"absolute",margin:0,padding:0,outline:0},this._jsPlumb.instance.endpointClass+s),this._jsPlumb.widthToUse&&this.canvas.setAttribute("width",this._jsPlumb.widthToUse),this._jsPlumb.heightToUse&&this.canvas.setAttribute("height",this._jsPlumb.heightToUse),this._jsPlumb.instance.appendElement(this.canvas),this.actuallyPaint=function(t,e,i){if(!this._jsPlumb.deleted){this._jsPlumb.initialized||(this.canvas.setAttribute("src",this._jsPlumb.img.src),this.appendDisplayElement(this.canvas),this._jsPlumb.initialized=!0);var r=this.anchorPoint[0]-this._jsPlumb.widthToUse/2,o=this.anchorPoint[1]-this._jsPlumb.heightToUse/2;n.sizeElement(this.canvas,r,o,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse)}},this.paint=function(e,n){null!=this._jsPlumb&&(this._jsPlumb.ready?this.actuallyPaint(e,n):t.setTimeout(function(){this.paint(e,n)}.bind(this),200))}},n.extend(e.Endpoints.Image,[a,e.Endpoints.AbstractEndpoint],{cleanup:function(t){t&&(this._jsPlumb.deleted=!0,this.canvas&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null)}}),e.Endpoints.Blank=function(t){e.Endpoints.AbstractEndpoint.apply(this,arguments);this.type="Blank",a.apply(this,arguments),this._compute=function(t,e,n,i){return[t[0],t[1],10,0]};var i=t.cssClass?" "+t.cssClass:"";this.canvas=jsPlumb.createElement("div",{display:"block",width:"1px",height:"1px",background:"transparent",position:"absolute"},this._jsPlumb.instance.endpointClass+i),this._jsPlumb.instance.appendElement(this.canvas),this.paint=function(t,e){n.sizeElement(this.canvas,this.x,this.y,this.w,this.h)}},n.extend(e.Endpoints.Blank,[e.Endpoints.AbstractEndpoint,a],{cleanup:function(){this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}),e.Endpoints.Triangle=function(t){this.type="Triangle",e.Endpoints.AbstractEndpoint.apply(this,arguments),t=t||{},t.width=t.width||55,t.height=t.height||55,this.width=t.width,this.height=t.height,this._compute=function(t,e,n,i){var r=n.width||self.width,o=n.height||self.height,a=t[0]-r/2,s=t[1]-o/2;return[a,s,r,o]}};var s=e.Overlays.AbstractOverlay=function(t){this.visible=!0,this.isAppendedAtTopLevel=!0,this.component=t.component,this.loc=null==t.location?.5:t.location,this.endpointLoc=null==t.endpointLocation?[.5,.5]:t.endpointLocation,this.visible=t.visible!==!1};s.prototype={cleanup:function(t){t&&(this.component=null,this.canvas=null,this.endpointLoc=null)},reattach:function(t){},setVisible:function(t){this.visible=t,this.component.repaint()},isVisible:function(){return this.visible},hide:function(){this.setVisible(!1)},show:function(){this.setVisible(!0)},incrementLocation:function(t){this.loc+=t,this.component.repaint()},setLocation:function(t){this.loc=t,this.component.repaint()},getLocation:function(){return this.loc},updateFrom:function(){}},e.Overlays.Arrow=function(t){this.type="Arrow",s.apply(this,arguments),this.isAppendedAtTopLevel=!1,t=t||{},this.length=t.length||20,this.width=t.width||20,this.id=t.id;var e=(t.direction||1)<0?-1:1,r=t.paintStyle||{lineWidth:1},o=t.foldback||.623;this.computeMaxSize=function(){return 1.5*self.width},this.elementCreated=function(e,n){if(this.path=e,t.events)for(var i in t.events)jsPlumb.on(e,i,t.events[i])},this.draw=function(t,a){var s,l,u,c,d;if(t.pointAlongPathFrom){if(n.isString(this.loc)||this.loc>1||this.loc<0){var h=parseInt(this.loc,10),f=this.loc<0?1:0;s=t.pointAlongPathFrom(f,h,!1),l=t.pointAlongPathFrom(f,h-e*this.length/2,!1),u=i.pointOnLine(s,l,this.length)}else if(1==this.loc){if(s=t.pointOnPath(this.loc),l=t.pointAlongPathFrom(this.loc,-this.length),u=i.pointOnLine(s,l,this.length),-1==e){var p=u;u=s,s=p}}else if(0===this.loc){if(u=t.pointOnPath(this.loc),l=t.pointAlongPathFrom(this.loc,this.length),s=i.pointOnLine(u,l,this.length),-1==e){var m=u;u=s,s=m}}else s=t.pointAlongPathFrom(this.loc,e*this.length/2),l=t.pointOnPath(this.loc),u=i.pointOnLine(s,l,this.length);c=i.perpendicularLineTo(s,u,this.width),d=i.pointOnLine(s,u,o*this.length);var g={hxy:s,tail:c,cxy:d},v=r.strokeStyle||a.strokeStyle,y=r.fillStyle||a.strokeStyle,b=r.lineWidth||a.lineWidth;return{component:t,d:g,lineWidth:b,strokeStyle:v,fillStyle:y,minX:Math.min(s.x,c[0].x,c[1].x),maxX:Math.max(s.x,c[0].x,c[1].x),minY:Math.min(s.y,c[0].y,c[1].y),maxY:Math.max(s.y,c[0].y,c[1].y)}}return{component:t,minX:0,maxX:0,minY:0,maxY:0}}},n.extend(e.Overlays.Arrow,s,{updateFrom:function(t){this.length=t.length||this.length,this.width=t.width||this.width,this.direction=null!=t.direction?t.direction:this.direction,this.foldback=t.foldback||this.foldback}}),e.Overlays.PlainArrow=function(t){t=t||{};var n=e.extend(t,{foldback:1});e.Overlays.Arrow.call(this,n),this.type="PlainArrow"},n.extend(e.Overlays.PlainArrow,e.Overlays.Arrow),e.Overlays.Diamond=function(t){t=t||{};var n=t.length||40,i=jsPlumb.extend(t,{length:n/2,foldback:2});e.Overlays.Arrow.call(this,i),this.type="Diamond"},n.extend(e.Overlays.Diamond,e.Overlays.Arrow);var l=function(t,e){return(null==t._jsPlumb.cachedDimensions||e)&&(t._jsPlumb.cachedDimensions=t.getDimensions()),t._jsPlumb.cachedDimensions},u=function(t){e.jsPlumbUIComponent.apply(this,arguments),s.apply(this,arguments);var i=this.fire;this.fire=function(){i.apply(this,arguments),this.component&&this.component.fire.apply(this.component,arguments)},this.detached=!1,this.id=t.id,this._jsPlumb.div=null,this._jsPlumb.initialised=!1,this._jsPlumb.component=t.component,this._jsPlumb.cachedDimensions=null,this._jsPlumb.create=t.create,this._jsPlumb.initiallyInvisible=t.visible===!1,this.getElement=function(){if(null==this._jsPlumb.div){var e=this._jsPlumb.div=jsPlumb.getElement(this._jsPlumb.create(this._jsPlumb.component));e.style.position="absolute",e.className=this._jsPlumb.instance.overlayClass+" "+(this.cssClass?this.cssClass:t.cssClass?t.cssClass:""),this._jsPlumb.instance.appendElement(e),this._jsPlumb.instance.getId(e),this.canvas=e;var n="translate(-50%, -50%)";e.style.webkitTransform=n,e.style.mozTransform=n,e.style.msTransform=n,e.style.oTransform=n,e.style.transform=n,e._jsPlumb=this,t.visible===!1&&(e.style.display="none")}return this._jsPlumb.div},this.draw=function(t,e,i){var r=l(this);if(null!=r&&2==r.length){var o={x:0,y:0};if(i)o={x:i[0],y:i[1]};else if(t.pointOnPath){var a=this.loc,s=!1;(n.isString(this.loc)||this.loc<0||this.loc>1)&&(a=parseInt(this.loc,10),s=!0),o=t.pointOnPath(a,s)}else{var u=this.loc.constructor==Array?this.loc:this.endpointLoc;o={x:u[0]*t.w,y:u[1]*t.h}}var c=o.x-r[0]/2,d=o.y-r[1]/2;return{component:t,d:{minx:c,miny:d,td:r,cxy:o},minX:c,maxX:c+r[0],minY:d,maxY:d+r[1]}}return{minX:0,maxX:0,minY:0,maxY:0}}};n.extend(u,[e.jsPlumbUIComponent,s],{getDimensions:function(){return[1,1]},setVisible:function(t){this._jsPlumb.div&&(this._jsPlumb.div.style.display=t?"block":"none",t&&this._jsPlumb.initiallyInvisible&&(l(this,!0),this.component.repaint(),this._jsPlumb.initiallyInvisible=!1))},clearCachedDimensions:function(){this._jsPlumb.cachedDimensions=null},cleanup:function(t){t?null!=this._jsPlumb.div&&(this._jsPlumb.div._jsPlumb=null,this._jsPlumb.instance.removeElement(this._jsPlumb.div)):(this._jsPlumb&&this._jsPlumb.div&&this._jsPlumb.div.parentNode&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div),this.detached=!0)},reattach:function(t){null!=this._jsPlumb.div&&t.getContainer().appendChild(this._jsPlumb.div),this.detached=!1},computeMaxSize:function(){var t=l(this);return Math.max(t[0],t[1])},paint:function(t,e){this._jsPlumb.initialised||(this.getElement(),t.component.appendDisplayElement(this._jsPlumb.div),this._jsPlumb.initialised=!0,this.detached&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div)),this._jsPlumb.div.style.left=t.component.x+t.d.minx+"px",this._jsPlumb.div.style.top=t.component.y+t.d.miny+"px"}}),e.Overlays.Custom=function(t){this.type="Custom",u.apply(this,arguments)},n.extend(e.Overlays.Custom,u),e.Overlays.GuideLines=function(){var t=this;t.length=50,t.lineWidth=5,this.type="GuideLines",s.apply(this,arguments),e.jsPlumbUIComponent.apply(this,arguments),this.draw=function(e,n){var r=e.pointAlongPathFrom(t.loc,t.length/2),o=e.pointOnPath(t.loc),a=i.pointOnLine(r,o,t.length),s=i.perpendicularLineTo(r,a,40),l=i.perpendicularLineTo(a,r,20);return{connector:e,head:r,tail:a,headLine:l,tailLine:s,minX:Math.min(r.x,a.x,l[0].x,l[1].x),minY:Math.min(r.y,a.y,l[0].y,l[1].y),maxX:Math.max(r.x,a.x,l[0].x,l[1].x),maxY:Math.max(r.y,a.y,l[0].y,l[1].y)}}},e.Overlays.Label=function(t){this.labelStyle=t.labelStyle;this.cssClass=null!=this.labelStyle?this.labelStyle.cssClass:null;var n=e.extend({create:function(){return jsPlumb.createElement("div")}},t);if(e.Overlays.Custom.call(this,n),this.type="Label",this.label=t.label||"",this.labelText=null,this.labelStyle){var i=this.getElement();if(this.labelStyle.font=this.labelStyle.font||"12px sans-serif",i.style.font=this.labelStyle.font,i.style.color=this.labelStyle.color||"black",this.labelStyle.fillStyle&&(i.style.background=this.labelStyle.fillStyle),this.labelStyle.borderWidth>0){var r=this.labelStyle.borderStyle?this.labelStyle.borderStyle:"black";i.style.border=this.labelStyle.borderWidth+"px solid "+r}this.labelStyle.padding&&(i.style.padding=this.labelStyle.padding)}},n.extend(e.Overlays.Label,e.Overlays.Custom,{cleanup:function(t){t&&(this.div=null,this.label=null,this.labelText=null,this.cssClass=null,this.labelStyle=null)},getLabel:function(){return this.label},setLabel:function(t){this.label=t,this.labelText=null,this.clearCachedDimensions(),this.update(),this.component.repaint()},getDimensions:function(){return this.update(),u.prototype.getDimensions.apply(this,arguments)},update:function(){if("function"==typeof this.label){var t=this.label(this);this.getElement().innerHTML=t.replace(/\r\n/g,"<br/>")}else null==this.labelText&&(this.labelText=this.label,this.getElement().innerHTML=this.labelText.replace(/\r\n/g,"<br/>"))},updateFrom:function(t){t.label&&this.setLabel(t.label)}})}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=function(e){var n=e._mottle;return n||(n=e._mottle=new t.Mottle),n};e.extend(t.jsPlumbInstance.prototype,{getEventManager:function(){
return n(this)},on:function(t,e,n){return this.getEventManager().on.apply(this,arguments),this},off:function(t,e,n){return this.getEventManager().off.apply(this,arguments),this}})}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t){this.type="Flowchart",t=t||{},t.stub=null==t.stub?30:t.stub;var n,i,r=e.Connectors.AbstractConnector.apply(this,arguments),o=null==t.midpoint?.5:t.midpoint,a=t.alwaysRespectStubs===!0,s=null,l=null,u=null!=t.cornerRadius?t.cornerRadius:0,c=(t.loopbackRadius||25,function(t){return 0>t?-1:0===t?0:1}),d=function(t,e,n,i){if(s!=e||l!=n){var r=null==s?i.sx:s,o=null==l?i.sy:l,a=r==e?"v":"h",u=c(e-r),d=c(n-o);s=e,l=n,t.push([r,o,e,n,a,u,d])}},h=function(t){return Math.sqrt(Math.pow(t[0]-t[2],2)+Math.pow(t[1]-t[3],2))},f=function(t){var e=[];return e.push.apply(e,t),e},p=function(t,e,n){for(var i,o=null,a=0;a<e.length-1;a++){if(o=o||f(e[a]),i=f(e[a+1]),u>0&&o[4]!=i[4]){var s=Math.min(u,h(o),h(i));o[2]-=o[5]*s,o[3]-=o[6]*s,i[0]+=i[5]*s,i[1]+=i[6]*s;var l=o[6]==i[5]&&1==i[5]||o[6]==i[5]&&0===i[5]&&o[5]!=i[6]||o[6]==i[5]&&-1==i[5],c=i[1]>o[3]?1:-1,d=i[0]>o[2]?1:-1,p=c==d,m=p&&l||!p&&!l?i[0]:o[2],g=p&&l||!p&&!l?o[3]:i[1];r.addSegment(t,"Straight",{x1:o[0],y1:o[1],x2:o[2],y2:o[3]}),r.addSegment(t,"Arc",{r:s,x1:o[2],y1:o[3],x2:i[0],y2:i[1],cx:m,cy:g,ac:l})}else{var v=o[2]==o[0]?0:o[2]>o[0]?n.lw/2:-(n.lw/2),y=o[3]==o[1]?0:o[3]>o[1]?n.lw/2:-(n.lw/2);r.addSegment(t,"Straight",{x1:o[0]-v,y1:o[1]-y,x2:o[2]+v,y2:o[3]+y})}o=i}null!=i&&r.addSegment(t,"Straight",{x1:i[0],y1:i[1],x2:i[2],y2:i[3]})};this._compute=function(t,e){n=[],s=null,l=null,i=null;var u=function(){return[t.startStubX,t.startStubY,t.endStubX,t.endStubY]},c={perpendicular:u,orthogonal:u,opposite:function(e){var n=t,i="x"==e?0:1,r={x:function(){return 1==n.so[i]&&(n.startStubX>n.endStubX&&n.tx>n.startStubX||n.sx>n.endStubX&&n.tx>n.sx)||-1==n.so[i]&&(n.startStubX<n.endStubX&&n.tx<n.startStubX||n.sx<n.endStubX&&n.tx<n.sx)},y:function(){return 1==n.so[i]&&(n.startStubY>n.endStubY&&n.ty>n.startStubY||n.sy>n.endStubY&&n.ty>n.sy)||-1==n.so[i]&&(n.startStubY<n.endStubY&&n.ty<n.startStubY||n.sy<n.endStubY&&n.ty<n.sy)}};return!a&&r[e]()?{x:[(t.sx+t.tx)/2,t.startStubY,(t.sx+t.tx)/2,t.endStubY],y:[t.startStubX,(t.sy+t.ty)/2,t.endStubX,(t.sy+t.ty)/2]}[e]:[t.startStubX,t.startStubY,t.endStubX,t.endStubY]}},h=c[t.anchorOrientation](t.sourceAxis),f="x"==t.sourceAxis?0:1,m="x"==t.sourceAxis?1:0,g=h[f],v=h[m],y=h[f+2],b=h[m+2];d(n,h[0],h[1],t);var $=t.startStubX+(t.endStubX-t.startStubX)*o,w=t.startStubY+(t.endStubY-t.startStubY)*o,x={x:[0,1],y:[1,0]},C={perpendicular:function(e){var n=t,i={x:[[[1,2,3,4],null,[2,1,4,3]],null,[[4,3,2,1],null,[3,4,1,2]]],y:[[[3,2,1,4],null,[2,3,4,1]],null,[[4,1,2,3],null,[1,4,3,2]]]},r={x:[[n.startStubX,n.endStubX],null,[n.endStubX,n.startStubX]],y:[[n.startStubY,n.endStubY],null,[n.endStubY,n.startStubY]]},o={x:[[$,n.startStubY],[$,n.endStubY]],y:[[n.startStubX,w],[n.endStubX,w]]},a={x:[[n.endStubX,n.startStubY]],y:[[n.startStubX,n.endStubY]]},s={x:[[n.startStubX,n.endStubY],[n.endStubX,n.endStubY]],y:[[n.endStubX,n.startStubY],[n.endStubX,n.endStubY]]},l={x:[[n.startStubX,w],[n.endStubX,w],[n.endStubX,n.endStubY]],y:[[$,n.startStubY],[$,n.endStubY],[n.endStubX,n.endStubY]]},u={x:[n.startStubY,n.endStubY],y:[n.startStubX,n.endStubX]},c=x[e][0],d=x[e][1],h=n.so[c]+1,f=n.to[d]+1,p=-1==n.to[d]&&u[e][1]<u[e][0]||1==n.to[d]&&u[e][1]>u[e][0],m=r[e][h][0],g=r[e][h][1],v=i[e][h][f];return n.segment==v[3]||n.segment==v[2]&&p?o[e]:n.segment==v[2]&&m>g?a[e]:n.segment==v[2]&&g>=m||n.segment==v[1]&&!p?l[e]:n.segment==v[0]||n.segment==v[1]&&p?s[e]:void 0},orthogonal:function(e,n,i,r,o){var a=t,s={x:-1==a.so[0]?Math.min(n,r):Math.max(n,r),y:-1==a.so[1]?Math.min(n,r):Math.max(n,r)}[e];return{x:[[s,i],[s,o],[r,o]],y:[[i,s],[o,s],[o,r]]}[e]},opposite:function(n,i,o,a){var s=t,l={x:"y",y:"x"}[n],u={x:"height",y:"width"}[n],c=s["is"+n.toUpperCase()+"GreaterThanStubTimes2"];if(e.sourceEndpoint.elementId==e.targetEndpoint.elementId){var d=o+(1-e.sourceEndpoint.anchor[l])*e.sourceInfo[u]+r.maxStub;return{x:[[i,d],[a,d]],y:[[d,i],[d,a]]}[n]}return!c||1==s.so[f]&&i>a||-1==s.so[f]&&a>i?{x:[[i,w],[a,w]],y:[[$,i],[$,a]]}[n]:1==s.so[f]&&a>i||-1==s.so[f]&&i>a?{x:[[$,s.sy],[$,s.ty]],y:[[s.sx,w],[s.tx,w]]}[n]:void 0}},S=C[t.anchorOrientation](t.sourceAxis,g,v,y,b);if(S)for(var k=0;k<S.length;k++)d(n,S[k][0],S[k][1],t);d(n,h[2],h[3],t),d(n,t.tx,t.ty,t),p(this,n,t)}};n.extend(i,e.Connectors.AbstractConnector),e.registerConnectorType(i,"Flowchart")}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil;e.Connectors.AbstractBezierConnector=function(t){t=t||{};var n,i=t.showLoopback!==!1,r=(t.curviness||10,t.margin||5),o=(t.proximityLimit||80,t.orientation&&"clockwise"===t.orientation),a=t.loopbackRadius||25,s=!1;return this.overrideSetEditable=function(){return!s},this._compute=function(t,e){var l=e.sourcePos,u=e.targetPos,c=Math.abs(l[0]-u[0]),d=Math.abs(l[1]-u[1]);if(i&&e.sourceEndpoint.elementId===e.targetEndpoint.elementId){s=!0;var h=e.sourcePos[0],f=e.sourcePos[1]-r,p=h,m=f-a,g=p-a,v=m-a;c=2*a,d=2*a,t.points[0]=g,t.points[1]=v,t.points[2]=c,t.points[3]=d,n.addSegment(this,"Arc",{loopback:!0,x1:h-g+4,y1:f-v,startAngle:0,endAngle:2*Math.PI,r:a,ac:!o,x2:h-g-4,y2:f-v,cx:p-g,cy:m-v})}else s=!1,this._computeBezier(t,e,l,u,c,d)},n=e.Connectors.AbstractConnector.apply(this,arguments)},n.extend(e.Connectors.AbstractBezierConnector,e.Connectors.AbstractConnector);var i=function(t){t=t||{},this.type="Bezier";var n=e.Connectors.AbstractBezierConnector.apply(this,arguments),i=t.curviness||150,r=10;this.getCurviness=function(){return i},this._findControlPoint=function(t,e,n,o,a,s,l){var u=s[0]!=l[0]||s[1]==l[1],c=[];return u?(0===l[0]?c.push(n[0]<e[0]?t[0]+r:t[0]-r):c.push(t[0]+i*l[0]),0===l[1]?c.push(n[1]<e[1]?t[1]+r:t[1]-r):c.push(t[1]+i*s[1])):(0===s[0]?c.push(e[0]<n[0]?t[0]+r:t[0]-r):c.push(t[0]-i*s[0]),0===s[1]?c.push(e[1]<n[1]?t[1]+r:t[1]-r):c.push(t[1]+i*l[1])),c},this._computeBezier=function(t,e,i,r,o,a){var s,l,u=this.getGeometry(),c=i[0]<r[0]?o:0,d=i[1]<r[1]?a:0,h=i[0]<r[0]?0:o,f=i[1]<r[1]?0:a;(this.hasBeenEdited()||this.isEditing())&&null!=u&&null!=u.controlPoints&&null!=u.controlPoints[0]&&null!=u.controlPoints[1]?(s=u.controlPoints[0],l=u.controlPoints[1]):(s=this._findControlPoint([c,d],i,r,e.sourceEndpoint,e.targetEndpoint,t.so,t.to),l=this._findControlPoint([h,f],r,i,e.targetEndpoint,e.sourceEndpoint,t.to,t.so)),n.setGeometry({controlPoints:[s,l]},!0),n.addSegment(this,"Bezier",{x1:c,y1:d,x2:h,y2:f,cp1x:s[0],cp1y:s[1],cp2x:l[0],cp2y:l[1]})}};n.extend(i,e.Connectors.AbstractBezierConnector),e.registerConnectorType(i,"Bezier")}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t,e,n,i){return n>=t&&e>=i?1:n>=t&&i>=e?2:t>=n&&i>=e?3:4},r=function(t,e,n,i,r,o,a,s,l){return l>=s?[t,e]:1===n?i[3]<=0&&r[3]>=1?[t+(i[2]<.5?-1*o:o),e]:i[2]>=1&&r[2]<=0?[t,e+(i[3]<.5?-1*a:a)]:[t+-1*o,e+-1*a]:2===n?i[3]>=1&&r[3]<=0?[t+(i[2]<.5?-1*o:o),e]:i[2]>=1&&r[2]<=0?[t,e+(i[3]<.5?-1*a:a)]:[t+o,e+-1*a]:3===n?i[3]>=1&&r[3]<=0?[t+(i[2]<.5?-1*o:o),e]:i[2]<=0&&r[2]>=1?[t,e+(i[3]<.5?-1*a:a)]:[t+-1*o,e+-1*a]:4===n?i[3]<=0&&r[3]>=1?[t+(i[2]<.5?-1*o:o),e]:i[2]<=0&&r[2]>=1?[t,e+(i[3]<.5?-1*a:a)]:[t+o,e+-1*a]:void 0},o=function(t){t=t||{},this.type="StateMachine";var n,o=e.Connectors.AbstractBezierConnector.apply(this,arguments),a=t.curviness||10,s=t.margin||5,l=t.proximityLimit||80;t.orientation&&"clockwise"===t.orientation;this._computeBezier=function(t,e,u,c,d,h){var f=e.sourcePos[0]<e.targetPos[0]?0:d,p=e.sourcePos[1]<e.targetPos[1]?0:h,m=e.sourcePos[0]<e.targetPos[0]?d:0,g=e.sourcePos[1]<e.targetPos[1]?h:0;0===e.sourcePos[2]&&(f-=s),1===e.sourcePos[2]&&(f+=s),0===e.sourcePos[3]&&(p-=s),1===e.sourcePos[3]&&(p+=s),0===e.targetPos[2]&&(m-=s),1===e.targetPos[2]&&(m+=s),0===e.targetPos[3]&&(g-=s),1===e.targetPos[3]&&(g+=s);var v,y,b,$,w=(f+m)/2,x=(p+g)/2,C=i(f,p,m,g),S=Math.sqrt(Math.pow(m-f,2)+Math.pow(g-p,2)),k=o.getGeometry();(this.hasBeenEdited()||this.isEditing())&&null!=k?(v=k.controlPoints[0][0],b=k.controlPoints[0][1],y=k.controlPoints[1][0],$=k.controlPoints[1][1]):(n=r(w,x,C,e.sourcePos,e.targetPos,a,a,S,l),v=n[0],y=n[0],b=n[1],$=n[1],o.setGeometry({controlPoints:[n,n]},!0)),o.addSegment(this,"Bezier",{x1:m,y1:g,x2:f,y2:p,cp1x:v,cp1y:b,cp2x:y,cp2y:$})}};n.extend(o,e.Connectors.AbstractBezierConnector),e.registerConnectorType(o,"StateMachine")}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i={"stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},r="stroke-dasharray",o="dashstyle",a="linearGradient",s="radialGradient",l="defs",u="fill",c="stop",d="stroke",h="stroke-width",f="style",p="none",m="jsplumb_gradient_",g="lineWidth",v={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml"},y=function(t,e){for(var n in e)t.setAttribute(n,""+e[n])},b=function(t,e){return e=e||{},e.version="1.1",e.xmlns=v.xhtml,jsPlumb.createElementNS(v.svg,t,null,null,e)},$=function(t){return"position:absolute;left:"+t[0]+"px;top:"+t[1]+"px"},w=function(t){for(var e=t.querySelectorAll(" defs,linearGradient,radialGradient"),n=0;n<e.length;n++)e[n].parentNode.removeChild(e[n])},x=function(t,e,n,i,r){var o=m+r._jsPlumb.instance.idstamp();w(t);var h;h=n.gradient.offset?b(s,{id:o}):b(a,{id:o,gradientUnits:"userSpaceOnUse"});var f=b(l);t.appendChild(f),f.appendChild(h);for(var p=0;p<n.gradient.stops.length;p++){var g=1==r.segment||2==r.segment?p:n.gradient.stops.length-1-p,v=n.gradient.stops[g][1],y=b(c,{offset:Math.floor(100*n.gradient.stops[p][0])+"%","stop-color":v});h.appendChild(y)}var $=n.strokeStyle?d:u;e.setAttribute($,"url(#"+o+")")},C=function(t,e,n,a,s){if(e.setAttribute(u,n.fillStyle?n.fillStyle:p),e.setAttribute(d,n.strokeStyle?n.strokeStyle:p),n.gradient?x(t,e,n,a,s):(w(t),e.setAttribute(f,"")),n.lineWidth&&e.setAttribute(h,n.lineWidth),n[o]&&n[g]&&!n[r]){var l=-1==n[o].indexOf(",")?" ":",",c=n[o].split(l),m="";c.forEach(function(t){m+=Math.floor(t*n.lineWidth)+l}),e.setAttribute(r,m)}else n[r]&&e.setAttribute(r,n[r]);for(var v in i)n[v]&&e.setAttribute(i[v],n[v])},S=function(t,e,n){t.childNodes.length>n?t.insertBefore(e,t.childNodes[n]):t.appendChild(e)};n.svg={node:b,attr:y,pos:$};var k=function(t){var i=t.pointerEventsSpec||"all",r={};e.jsPlumbUIComponent.apply(this,t.originalArgs),this.canvas=null,this.path=null,this.svg=null,this.bgCanvas=null;var o=t.cssClass+" "+(t.originalArgs[0].cssClass||""),a={style:"",width:0,height:0,"pointer-events":i,position:"absolute"};this.svg=b("svg",a),t.useDivWrapper?(this.canvas=jsPlumb.createElement("div",{position:"absolute"}),n.sizeElement(this.canvas,0,0,1,1),this.canvas.className=o):(y(this.svg,{"class":o}),this.canvas=this.svg),t._jsPlumb.appendElement(this.canvas,t.originalArgs[0].parent),t.useDivWrapper&&this.canvas.appendChild(this.svg);var s=[this.canvas];return this.getDisplayElements=function(){return s},this.appendDisplayElement=function(t){s.push(t)},this.paint=function(e,i,o){if(null!=e){var a,s=[this.x,this.y],l=[this.w,this.h];null!=o&&(o.xmin<0&&(s[0]+=o.xmin),o.ymin<0&&(s[1]+=o.ymin),l[0]=o.xmax+(o.xmin<0?-o.xmin:0),l[1]=o.ymax+(o.ymin<0?-o.ymin:0)),t.useDivWrapper?(n.sizeElement(this.canvas,s[0],s[1],l[0],l[1]),s[0]=0,s[1]=0,a=$([0,0])):a=$([s[0],s[1]]),r.paint.apply(this,arguments),y(this.svg,{style:a,width:l[0]||0,height:l[1]||0})}},{renderer:r}};n.extend(k,e.jsPlumbUIComponent,{cleanup:function(t){t||null==this.typeId?(this.canvas&&(this.canvas._jsPlumb=null),this.svg&&(this.svg._jsPlumb=null),this.bgCanvas&&(this.bgCanvas._jsPlumb=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.svg=null,this.canvas=null,this.path=null,this.group=null):(this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.bgCanvas.parentNode.removeChild(this.bgCanvas))},reattach:function(t){var e=t.getContainer();this.canvas&&null==this.canvas.parentNode&&e.appendChild(this.canvas),this.bgCanvas&&null==this.bgCanvas.parentNode&&e.appendChild(this.bgCanvas)},setVisible:function(t){this.canvas&&(this.canvas.style.display=t?"block":"none")}}),e.ConnectorRenderers.svg=function(t){var n=this,i=k.apply(this,[{cssClass:t._jsPlumb.connectorClass+(this.isEditable()?" "+t._jsPlumb.editableConnectorClass:""),originalArgs:arguments,pointerEventsSpec:"none",_jsPlumb:t._jsPlumb}]),r=this.setEditable;this.setEditable=function(t){var e=r.apply(this,[t]);jsPlumb[e?"addClass":"removeClass"](this.canvas,this._jsPlumb.instance.editableConnectorClass)},i.renderer.paint=function(i,r,o){var a=n.getSegments(),s="",l=[0,0];if(o.xmin<0&&(l[0]=-o.xmin),o.ymin<0&&(l[1]=-o.ymin),a.length>0){for(var u=0;u<a.length;u++)s+=e.Segments.svg.SegmentRenderer.getPath(a[u]),s+=" ";var c={d:s,transform:"translate("+l[0]+","+l[1]+")","pointer-events":t["pointer-events"]||"visibleStroke"},d=null,h=[n.x,n.y,n.w,n.h];if(i.outlineColor){var f=i.outlineWidth||1,p=i.lineWidth+2*f;d=e.extend({},i),delete d.gradient,d.strokeStyle=i.outlineColor,d.lineWidth=p,null==n.bgPath?(n.bgPath=b("path",c),e.addClass(n.bgPath,e.connectorOutlineClass),S(n.svg,n.bgPath,0)):y(n.bgPath,c),C(n.svg,n.bgPath,d,h,n)}null==n.path?(n.path=b("path",c),S(n.svg,n.path,i.outlineColor?1:0)):y(n.path,c),C(n.svg,n.path,i,h,n)}}},n.extend(e.ConnectorRenderers.svg,k),e.Segments.svg={SegmentRenderer:{getPath:function(t){return{Straight:function(){var e=t.getCoordinates();return"M "+e.x1+" "+e.y1+" L "+e.x2+" "+e.y2},Bezier:function(){var e=t.params;return"M "+e.x1+" "+e.y1+" C "+e.cp1x+" "+e.cp1y+" "+e.cp2x+" "+e.cp2y+" "+e.x2+" "+e.y2},Arc:function(){var e=t.params,n=t.sweep>Math.PI?1:0,i=t.anticlockwise?0:1;return"M"+t.x1+" "+t.y1+" A "+t.radius+" "+e.r+" 0 "+n+","+i+" "+t.x2+" "+t.y2}}[t.type]()}}};var D=e.SvgEndpoint=function(t){var n=k.apply(this,[{cssClass:t._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:t._jsPlumb}]);n.renderer.paint=function(t){var n=e.extend({},t);n.outlineColor&&(n.strokeWidth=n.outlineWidth,n.strokeStyle=n.outlineColor),null==this.node?(this.node=this.makeNode(n),this.svg.appendChild(this.node)):null!=this.updateNode&&this.updateNode(this.node),C(this.svg,this.node,n,[this.x,this.y,this.w,this.h],this),$(this.node,[this.x,this.y])}.bind(this)};n.extend(D,k),e.Endpoints.svg.Dot=function(){e.Endpoints.Dot.apply(this,arguments),D.apply(this,arguments),this.makeNode=function(t){return b("circle",{cx:this.w/2,cy:this.h/2,r:this.radius})},this.updateNode=function(t){y(t,{cx:this.w/2,cy:this.h/2,r:this.radius})}},n.extend(e.Endpoints.svg.Dot,[e.Endpoints.Dot,D]),e.Endpoints.svg.Rectangle=function(){e.Endpoints.Rectangle.apply(this,arguments),D.apply(this,arguments),this.makeNode=function(t){return b("rect",{width:this.w,height:this.h})},this.updateNode=function(t){y(t,{width:this.w,height:this.h})}},n.extend(e.Endpoints.svg.Rectangle,[e.Endpoints.Rectangle,D]),e.Endpoints.svg.Image=e.Endpoints.Image,e.Endpoints.svg.Blank=e.Endpoints.Blank,e.Overlays.svg.Label=e.Overlays.Label,e.Overlays.svg.Custom=e.Overlays.Custom;var E=function(t,n){t.apply(this,n),e.jsPlumbUIComponent.apply(this,n),this.isAppendedAtTopLevel=!1;this.path=null,this.paint=function(t,e){if(t.component.svg&&e){null==this.path&&(this.path=b("path",{"pointer-events":"all"}),t.component.svg.appendChild(this.path),this.elementCreated&&this.elementCreated(this.path,t.component),this.canvas=t.component.svg);var r=n&&1==n.length?n[0].cssClass||"":"",o=[0,0];e.xmin<0&&(o[0]=-e.xmin),e.ymin<0&&(o[1]=-e.ymin),y(this.path,{d:i(t.d),"class":r,stroke:t.strokeStyle?t.strokeStyle:null,fill:t.fillStyle?t.fillStyle:null,transform:"translate("+o[0]+","+o[1]+")"})}};var i=function(t){return isNaN(t.cxy.x)||isNaN(t.cxy.y)?"":"M"+t.hxy.x+","+t.hxy.y+" L"+t.tail[0].x+","+t.tail[0].y+" L"+t.cxy.x+","+t.cxy.y+" L"+t.tail[1].x+","+t.tail[1].y+" L"+t.hxy.x+","+t.hxy.y};this.transfer=function(t){t.canvas&&this.path&&this.path.parentNode&&(this.path.parentNode.removeChild(this.path),t.canvas.appendChild(this.path))}};n.extend(E,[e.jsPlumbUIComponent,e.Overlays.AbstractOverlay],{cleanup:function(t){null!=this.path&&(t?this._jsPlumb.instance.removeElement(this.path):this.path.parentNode&&this.path.parentNode.removeChild(this.path))},reattach:function(t){this.path&&this.canvas&&null==this.path.parentNode&&this.canvas.appendChild(this.path)},setVisible:function(t){null!=this.path&&(this.path.style.display=t?"block":"none")}}),e.Overlays.svg.Arrow=function(){E.apply(this,[e.Overlays.Arrow,arguments])},n.extend(e.Overlays.svg.Arrow,[e.Overlays.Arrow,E]),e.Overlays.svg.PlainArrow=function(){E.apply(this,[e.Overlays.PlainArrow,arguments])},n.extend(e.Overlays.svg.PlainArrow,[e.Overlays.PlainArrow,E]),e.Overlays.svg.Diamond=function(){E.apply(this,[e.Overlays.Diamond,arguments])},n.extend(e.Overlays.svg.Diamond,[e.Overlays.Diamond,E]),e.Overlays.svg.GuideLines=function(){var t,n,i=null,r=this;e.Overlays.GuideLines.apply(this,arguments),this.paint=function(e,a){null==i&&(i=b("path"),e.connector.svg.appendChild(i),r.attachListeners(i,e.connector),r.attachListeners(i,r),t=b("path"),e.connector.svg.appendChild(t),r.attachListeners(t,e.connector),r.attachListeners(t,r),n=b("path"),e.connector.svg.appendChild(n),r.attachListeners(n,e.connector),r.attachListeners(n,r));var s=[0,0];a.xmin<0&&(s[0]=-a.xmin),a.ymin<0&&(s[1]=-a.ymin),y(i,{d:o(e.head,e.tail),stroke:"red",fill:null,transform:"translate("+s[0]+","+s[1]+")"}),y(t,{d:o(e.tailLine[0],e.tailLine[1]),stroke:"blue",fill:null,transform:"translate("+s[0]+","+s[1]+")"}),y(n,{d:o(e.headLine[0],e.headLine[1]),stroke:"green",fill:null,transform:"translate("+s[0]+","+s[1]+")"})};var o=function(t,e){return"M "+t.x+","+t.y+" L"+e.x+","+e.y}},n.extend(e.Overlays.svg.GuideLines,e.Overlays.GuideLines)}.call(this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=t.Katavorio,r=t.Biltong,o=function(t,e){e=e||"main";var n="_katavorio_"+e,o=t[n],a=t.getEventManager();return o||(o=new i({bind:a.on,unbind:a.off,getSize:jsPlumb.getSize,getPosition:function(e){var n=t.getOffset(e,!1,e._katavorioDrag?e.offsetParent:null);return[n.left,n.top]},setPosition:function(t,e){t.style.left=e[0]+"px",t.style.top=e[1]+"px"},addClass:jsPlumb.addClass,removeClass:jsPlumb.removeClass,intersects:r.intersects,indexOf:function(t,e){return t.indexOf(e)},css:{noSelect:t.dragSelectClass,droppable:"jsplumb-droppable",draggable:"jsplumb-draggable",drag:"jsplumb-drag",selected:"jsplumb-drag-selected",active:"jsplumb-drag-active",hover:"jsplumb-drag-hover"}}),t[n]=o,t.bind("zoom",o.setZoom)),o},a=function(t,e){var i=function(i){if(null!=e[i]){if(n.isString(e[i])){var r=e[i].match(/-=/)?-1:1,o=e[i].substring(2);return t[i]+r*o}return e[i]}return t[i]};return[i("left"),i("top")]};e.extend(t.jsPlumbInstance.prototype,{animationSupported:!0,getElement:function(t){return null==t?null:(t="string"==typeof t?t:null!=t.length&&null==t.enctype?t[0]:t,"string"==typeof t?document.getElementById(t):t)},removeElement:function(t){o(this).elementRemoved(t),this.getEventManager().remove(t)},doAnimate:function(t,e,n){n=n||{};var i=this.getOffset(t),r=a(i,e),o=r[0]-i.left,s=r[1]-i.top,l=n.duration||250,u=15,c=l/u,d=u/l*o,h=u/l*s,f=0,p=setInterval(function(){jsPlumb.setPosition(t,{left:i.left+d*(f+1),top:i.top+h*(f+1)}),null!=n.step&&n.step(f,Math.ceil(c)),f++,f>=c&&(window.clearInterval(p),null!=n.complete&&n.complete())},u)},destroyDraggable:function(t,e){o(this,e).destroyDraggable(t)},destroyDroppable:function(t,e){o(this,e).destroyDroppable(t)},initDraggable:function(t,e,n){o(this,n).draggable(t,e)},initDroppable:function(t,e,n){o(this,n).droppable(t,e)},isAlreadyDraggable:function(t){return null!=t._katavorioDrag},isDragSupported:function(t,e){return!0},isDropSupported:function(t,e){return!0},isElementDraggable:function(t){return t=jsPlumb.getElement(t),t._katavorioDrag&&t._katavorioDrag.isEnabled()},getDragObject:function(t){return t[0].drag.getDragElement()},getDragScope:function(t){return t._katavorioDrag&&t._katavorioDrag.scopes.join(" ")||""},getDropEvent:function(t){return t[0].e},getUIPosition:function(t,e){var n=t[0].el,i={left:t[0].pos[0],top:t[0].pos[1]};if(n._katavorioDrag&&n.offsetParent!==this.getContainer()){var r=this.getOffset(n.offsetParent);i.left+=r.left,i.top+=r.top}return i},setDragFilter:function(t,e,n){t._katavorioDrag&&t._katavorioDrag.setFilter(e,n)},setElementDraggable:function(t,e){t=jsPlumb.getElement(t),t._katavorioDrag&&t._katavorioDrag.setEnabled(e)},setDragScope:function(t,e){t._katavorioDrag&&t._katavorioDrag.k.setDragScope(t,e)},setDropScope:function(t,e){t._katavorioDrop&&t._katavorioDrop.length>0&&t._katavorioDrop[0].k.setDropScope(t,e)},addToPosse:function(t,e){var n=Array.prototype.slice.call(arguments,1),i=o(this);jsPlumb.each(t,function(t){t=[jsPlumb.getElement(t)],t.push.apply(t,n),i.addToPosse.apply(i,t)})},setPosse:function(t,e){var n=Array.prototype.slice.call(arguments,1),i=o(this);jsPlumb.each(t,function(t){t=[jsPlumb.getElement(t)],t.push.apply(t,n),i.setPosse.apply(i,t)})},removeFromPosse:function(t,e){var n=Array.prototype.slice.call(arguments,1),i=o(this);jsPlumb.each(t,function(t){t=[jsPlumb.getElement(t)],t.push.apply(t,n),i.removeFromPosse.apply(i,t)})},removeFromAllPosses:function(t){var e=o(this);jsPlumb.each(t,function(t){e.removeFromAllPosses(jsPlumb.getElement(t))})},setPosseState:function(t,e,n){var i=o(this);jsPlumb.each(t,function(t){i.setPosseState(jsPlumb.getElement(t),e,n)})},dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete",beforeStart:"beforeStart"},animEvents:{step:"step",complete:"complete"},stopDrag:function(t){t._katavorioDrag&&t._katavorioDrag.abort()},addToDragSelection:function(t){o(this).select(t)},removeFromDragSelection:function(t){o(this).deselect(t)},clearDragSelection:function(){o(this).deselectAll()},trigger:function(t,e,n,i){this.getEventManager().trigger(t,e,n,i)},doReset:function(){for(var t in this)0===t.indexOf("_katavorio_")&&this[t].reset()}});var s=function(t){var e=function(){/complete|loaded|interactive/.test(document.readyState)&&"undefined"!=typeof document.body&&null!=document.body?t():setTimeout(e,9)};e()};s(e.init)}.call(this);