!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={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,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});

jQuery.uaMatch=function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||/(trident)[\/]([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};};if(!jQuery.browser){matched=jQuery.uaMatch(navigator.userAgent);browser={};if(matched.browser){browser[matched.browser]=true;browser.version=matched.version;}
if(browser.chrome){browser.webkit=true;}else if(browser.webkit){browser.safari=true;}
jQuery.browser=browser;}

(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(d.inline?d.dpDiv.parent()[0]:d.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var h=0,l=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=l.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=l.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var u=!1;e(document).mouseup(function(){u=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!u){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),u=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),u=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,N=e.extend({},y),M=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?N.left-=d:"center"===n.my[0]&&(N.left-=d/2),"bottom"===n.my[1]?N.top-=c:"center"===n.my[1]&&(N.top-=c/2),N.left+=M[0],N.top+=M[1],a||(N.left=h(N.left),N.top=h(N.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](N,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+M[0],p[1]+M[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-N.left,i=t+m-d,s=v.top-N.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:N.left,top:N.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(N,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var d;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),d===n&&(d=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,d=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,N,M,C,P,A,I,H,z,F,E,W,O,L,j=new Date,R=this._daylightSavingAdjust(new Date(j.getFullYear(),j.getMonth(),j.getDate())),Y=this._get(e,"isRTL"),J=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),K=this._get(e,"navigationAsDateFormat"),U=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),q=this._get(e,"stepMonths"),G=1!==U[0]||1!==U[1],X=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-U[0]*U[1]+1,$.getDate())),t=Q&&Q>t?Q:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-q,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+q,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?X:R,o=K?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=J?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;U[0]>w;w++){for(k="",this.maxRows=4,T=0;U[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",N="",G){if(N+="<div class='ui-datepicker-group",U[1]>1)switch(T){case 0:N+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:N+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:N+=" ui-datepicker-group-middle",S=""}N+="'>"}for(N+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,Q,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)C=(x+u)%7,M+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[C]+"'>"+p[C]+"</span></th>";for(N+=M+"</tr></thead><tbody>",P=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,P)),A=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((A+P)/7),H=G?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-A)),F=0;H>F;F++){for(N+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)W=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],O=z.getMonth()!==Z,L=O&&!y||!W[0]||Q&&Q>z||$&&z>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(O?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(O&&!v?"":" "+W[1]+(z.getTime()===X.getTime()?" "+this._currentClass:"")+(z.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(O&&!v||!W[2]?"":" title='"+W[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(O&&!v?"&#xa0;":L?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===R.getTime()?" ui-state-highlight":"")+(z.getTime()===X.getTime()?" ui-state-active":"")+(O?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);N+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),N+="</tbody></table>"+(G?"</div>"+(U[0]>0&&T===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=N}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker});
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{factory(jQuery);}}(function($){$.extend($.fn,{validate:function(options){if(!this.length){if(options&&options.debug&&window.console){console.warn("Nothing selected, can't validate, returning nothing.");}
return;}
var validator=$.data(this[0],"validator");if(validator){return validator;}
this.attr("novalidate","novalidate");validator=new $.validator(options,this[0]);$.data(this[0],"validator",validator);if(validator.settings.onsubmit){this.on("click.validate",":submit",function(event){if(validator.settings.submitHandler){validator.submitButton=event.target;}
if($(this).hasClass("cancel")){validator.cancelSubmit=true;}
if($(this).attr("formnovalidate")!==undefined){validator.cancelSubmit=true;}});this.on("submit.validate",function(event){if(validator.settings.debug){event.preventDefault();}
function handle(){var hidden,result;if(validator.settings.submitHandler){if(validator.submitButton){hidden=$("<input type='hidden'/>")
.attr("name",validator.submitButton.name)
.val($(validator.submitButton).val())
.appendTo(validator.currentForm);}
result=validator.settings.submitHandler.call(validator,validator.currentForm,event);if(validator.submitButton){hidden.remove();}
if(result!==undefined){return result;}
return false;}
return true;}
if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}
if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}
return handle();}else{validator.focusInvalid();return false;}});}
return validator;},valid:function(){var valid,validator,errorList;if($(this[0]).is("form")){valid=this.validate().form();}else{errorList=[];valid=true;validator=$(this[0].form).validate();this.each(function(){valid=validator.element(this)&&valid;errorList=errorList.concat(validator.errorList);});validator.errorList=errorList;}
return valid;},rules:function(command,argument){var element=this[0],settings,staticRules,existingRules,data,param,filtered;if(command){settings=$.data(element.form,"validator").settings;staticRules=settings.rules;existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));delete existingRules.messages;staticRules[element.name]=existingRules;if(argument.messages){settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);}
break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}
filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];if(method==="required"){$(element).removeAttr("aria-required");}});return filtered;}}
data=$.validator.normalizeRules($.extend({},$.validator.classRules(element),$.validator.attributeRules(element),$.validator.dataRules(element),$.validator.staticRules(element)),element);if(data.required){param=data.required;delete data.required;data=$.extend({required:param},data);$(element).attr("aria-required","true");}
if(data.remote){param=data.remote;delete data.remote;data=$.extend(data,{remote:param});}
return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+$(a).val());},filled:function(a){return!!$.trim(""+$(a).val());},unchecked:function(a){return!$(a).prop("checked");}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length===1){return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};}
if(arguments.length>2&&params.constructor!==Array){params=$.makeArray(arguments).slice(1);}
if(params.constructor!==Array){params=[params];}
$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),function(){return n;});});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:false,focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);}
this.hideThese(this.errorsFor(element));}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element,event){var excludedKeys=[16,17,18,20,35,36,37,38,39,40,45,144,225];if(event.which===9&&this.elementValue(element)===""||$.inArray(event.keyCode,excludedKeys)!==-1){return;}else if(element.name in this.submitted||element===this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted){this.element(element);}else if(element.parentNode.name in this.submitted){this.element(element.parentNode);}},highlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).addClass(errorClass).removeClass(validClass);}else{$(element).addClass(errorClass).removeClass(validClass);}},unhighlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).removeClass(errorClass).addClass(validClass);}else{$(element).removeClass(errorClass).addClass(validClass);}}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={}),rules;$.each(this.settings.groups,function(key,value){if(typeof value==="string"){value=value.split(/\s/);}
$.each(value,function(index,name){groups[name]=key;});});rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this.form,"validator"),eventType="on"+event.type.replace(/^validate/,""),settings=validator.settings;if(settings[eventType]&&!$(this).is(settings.ignore)){settings[eventType].call(validator,this,event);}}
$(this.currentForm)
.on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], "+
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], "+
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], "+
"[type='radio'], [type='checkbox']",delegate)
.on("click.validate","select, option, [type='radio'], [type='checkbox']",delegate);if(this.settings.invalidHandler){$(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler);}
$(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true");},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid()){$(this.currentForm).triggerHandler("invalid-form",[this]);}
this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}
return this.valid();},element:function(element){var cleanElement=this.clean(element),checkElement=this.validationTargetFor(cleanElement),result=true;this.lastElement=checkElement;if(checkElement===undefined){delete this.invalid[cleanElement.name];}else{this.prepareElement(checkElement);this.currentElements=$(checkElement);result=this.check(checkElement)!==false;if(result){delete this.invalid[checkElement.name];}else{this.invalid[checkElement.name]=true;}}
$(element).attr("aria-invalid",!result);if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}
this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}
this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}
if(this.settings.showErrors){this.settings.showErrors.call(this,this.errorMap,this.errorList);}else{this.defaultShowErrors();}},resetForm:function(){if($.fn.resetForm){$(this.currentForm).resetForm();}
this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();var i,elements=this.elements()
.removeData("previousValue")
.removeAttr("aria-invalid");if(this.settings.unhighlight){for(i=0;elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,"");}}else{elements.removeClass(this.settings.errorClass);}},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0,i;for(i in obj){count++;}
return count;},hideErrors:function(){this.hideThese(this.toHide);},hideThese:function(errors){errors.not(this.containers).text("");this.addWrapper(errors).hide();},valid:function(){return this.size()===0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[])
.filter(":visible")
.focus()
.trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name===lastActive.name;}).length===1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $(this.currentForm)
.find("input, select, textarea")
.not(":submit, :reset, :image, :disabled")
.not(this.settings.ignore)
.filter(function(){if(!this.name&&validator.settings.debug&&window.console){console.error("%o has no name assigned",this);}
if(this.name in rulesCache||!validator.objectLength($(this).rules())){return false;}
rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){var errorClass=this.settings.errorClass.split(" ").join(".");return $(this.settings.errorElement+"."+errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},elementValue:function(element){var val,$element=$(element),type=element.type;if(type==="radio"||type==="checkbox"){return this.findByName(element.name).filter(":checked").val();}else if(type==="number"&&typeof element.validity!=="undefined"){return element.validity.badInput?false:$element.val();}
val=$element.val();if(typeof val==="string"){return val.replace(/\r/g,"");}
return val;},check:function(element){element=this.validationTargetFor(this.clean(element));var rules=$(element).rules(),rulesCount=$.map(rules,function(n,i){return i;}).length,dependencyMismatch=false,val=this.elementValue(element),result,method,rule;for(method in rules){rule={method:method,parameters:rules[method]};try{result=$.validator.methods[method].call(this,val,element,rule.parameters);if(result==="dependency-mismatch"&&rulesCount===1){dependencyMismatch=true;continue;}
dependencyMismatch=false;if(result==="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}
if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){if(this.settings.debug&&window.console){console.log("Exception occurred when checking element "+element.id+", check the '"+rule.method+"' method.",e);}
if(e instanceof TypeError){e.message+=".  Exception occurred when checking element "+element.id+", check the '"+rule.method+"' method.";}
throw e;}}
if(dependencyMismatch){return;}
if(this.objectLength(rules)){this.successList.push(element);}
return true;},customDataMessage:function(element,method){return $(element).data("msg"+method.charAt(0).toUpperCase()+
method.substring(1).toLowerCase())||$(element).data("msg");},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor===String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined){return arguments[i];}}
return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customDataMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message==="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=$.validator.format(message.replace(theregex,"{$1}"),rule.parameters);}
this.errorList.push({message:message,element:element,method:rule.method});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper){toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));}
return toToggle;},defaultShowErrors:function(){var i,elements,error;for(i=0;this.errorList[i];i++){error=this.errorList[i];if(this.settings.highlight){this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);}
this.showLabel(error.element,error.message);}
if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}
if(this.settings.success){for(i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}
if(this.settings.unhighlight){for(i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}
this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var place,group,errorID,error=this.errorsFor(element),elementID=this.idOrName(element),describedBy=$(element).attr("aria-describedby");if(error.length){error.removeClass(this.settings.validClass).addClass(this.settings.errorClass);error.html(message);}else{error=$("<"+this.settings.errorElement+">")
.attr("id",elementID+"-error")
.addClass(this.settings.errorClass)
.html(message||"");place=error;if(this.settings.wrapper){place=error.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}
if(this.labelContainer.length){this.labelContainer.append(place);}else if(this.settings.errorPlacement){this.settings.errorPlacement(place,$(element));}else{place.insertAfter(element);}
if(error.is("label")){error.attr("for",elementID);}else if(error.parents("label[for='"+elementID+"']").length===0){errorID=error.attr("id").replace(/(:|\.|\[|\]|\$)/g,"\\$1");if(!describedBy){describedBy=errorID;}else if(!describedBy.match(new RegExp("\\b"+errorID+"\\b"))){describedBy+=" "+errorID;}
$(element).attr("aria-describedby",describedBy);group=this.groups[element.name];if(group){$.each(this.groups,function(name,testgroup){if(testgroup===group){$("[name='"+name+"']",this.currentForm)
.attr("aria-describedby",error.attr("id"));}});}}}
if(!message&&this.settings.success){error.text("");if(typeof this.settings.success==="string"){error.addClass(this.settings.success);}else{this.settings.success(error,element);}}
this.toShow=this.toShow.add(error);},errorsFor:function(element){var name=this.idOrName(element),describer=$(element).attr("aria-describedby"),selector="label[for='"+name+"'], label[for='"+name+"'] *";if(describer){selector=selector+", #"+describer.replace(/\s+/g,", #");}
return this
.errors()
.filter(selector);},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},validationTargetFor:function(element){if(this.checkable(element)){element=this.findByName(element.name);}
return $(element).not(this.settings.ignore)[0];},checkable:function(element){return(/radio|checkbox/i).test(element.type);},findByName:function(name){return $(this.currentForm).find("[name='"+name+"']");},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element)){return this.findByName(element.name).filter(":checked").length;}}
return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){var val=this.elementValue(element);return!$.validator.methods.required.call(this,val,element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0;}
delete this.pending[element.name];if(valid&&this.pendingRequest===0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest===0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});},destroy:function(){this.resetForm();$(this.currentForm)
.off(".validate")
.removeData("validator");}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},number:{number:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){if(className.constructor===String){this.classRuleSettings[className]=rules;}else{$.extend(this.classRuleSettings,className);}},classRules:function(element){var rules={},classes=$(element).attr("class");if(classes){$.each(classes.split(" "),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});}
return rules;},normalizeAttributeRule:function(rules,type,method,value){if(/min|max/.test(method)&&(type===null||/number|range|text/.test(type))){value=Number(value);if(isNaN(value)){value=undefined;}}
if(value||value===0){rules[method]=value;}else if(type===method&&type!=="range"){rules[method]=true;}},attributeRules:function(element){var rules={},$element=$(element),type=element.getAttribute("type"),method,value;for(method in $.validator.methods){if(method==="required"){value=element.getAttribute(method);if(value===""){value=true;}
value=!!value;}else{value=$element.attr(method);}
this.normalizeAttributeRule(rules,type,method,value);}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}
return rules;},dataRules:function(element){var rules={},$element=$(element),type=element.getAttribute("type"),method,value;for(method in $.validator.methods){value=$element.data("rule"+method.charAt(0).toUpperCase()+method.substring(1).toLowerCase());this.normalizeAttributeRule(rules,type,method,value);}
return rules;},staticRules:function(element){var rules={},validator=$.data(element.form,"validator");if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}
if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}
if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(["minlength","maxlength"],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(["rangelength","range"],function(){var parts;if(rules[this]){if($.isArray(rules[this])){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}else if(typeof rules[this]==="string"){parts=rules[this].replace(/[\[\]]/g,"").split(/[\s,]+/);rules[this]=[Number(parts[0]),Number(parts[1])];}}});if($.validator.autoCreateRanges){if(rules.min!=null&&rules.max!=null){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}
if(rules.minlength!=null&&rules.maxlength!=null){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}
return rules;},normalizeRule:function(data){if(typeof data==="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}
return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!==undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element)){return"dependency-mismatch";}
if(element.nodeName.toLowerCase()==="select"){var val=$(element).val();return val&&val.length>0;}
if(this.checkable(element)){return this.getLength(value,element)>0;}
return value.length>0;},email:function(value,element){return this.optional(element)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);},url:function(value,element){return this.optional(element)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value).toString());},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);},number:function(value,element){return this.optional(element)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element)){return"dependency-mismatch";}
if(/[^0-9 \-]+/.test(value)){return false;}
var nCheck=0,nDigit=0,bEven=false,n,cDigit;value=value.replace(/\D/g,"");if(value.length<13||value.length>19){return false;}
for(n=value.length-1;n>=0;n--){cDigit=value.charAt(n);nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9){nDigit-=9;}}
nCheck+=nDigit;bEven=!bEven;}
return(nCheck%10)===0;},minlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||length>=param;},maxlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||length<=param;},rangelength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},equalTo:function(value,element,param){var target=$(param);if(this.settings.onfocusout){target.off(".validate-equalTo").on("blur.validate-equalTo",function(){$(element).valid();});}
return value===target.val();},remote:function(value,element,param){if(this.optional(element)){return"dependency-mismatch";}
var previous=this.previousValue(element),validator,data;if(!this.settings.messages[element.name]){this.settings.messages[element.name]={};}
previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param==="string"&&{url:param}||param;if(previous.old===value){return previous.valid;}
previous.old=value;validator=this;this.startRequest(element);data={};data[element.name]=value;$.ajax($.extend(true,{mode:"abort",port:"validate"+element.name,dataType:"json",data:data,context:validator.currentForm,success:function(response){var valid=response===true||response==="true",errors,message,submitted;validator.settings.messages[element.name].remote=previous.originalMessage;if(valid){submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);delete validator.invalid[element.name];validator.showErrors();}else{errors={};message=response||validator.defaultMessage(element,"remote");errors[element.name]=previous.message=$.isFunction(message)?message(value):message;validator.invalid[element.name]=true;validator.showErrors(errors);}
previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}}});var pendingRequests={},ajax;if($.ajaxPrefilter){$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;if(settings.mode==="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
pendingRequests[port]=xhr;}});}else{ajax=$.ajax;$.ajax=function(settings){var mode=("mode"in settings?settings:$.ajaxSettings).mode,port=("port"in settings?settings:$.ajaxSettings).port;if(mode==="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
pendingRequests[port]=ajax.apply(this,arguments);return pendingRequests[port];}
return ajax.apply(this,arguments);};}}));
(function(global,factory){if(typeof exports==='object'){module.exports=factory();}else if(typeof define==='function'&&define.amd){define(factory);}else{global.printStackTrace=factory();}}(this,function(){function printStackTrace(options){options=options||{guess:true};var ex=options.e||null,guess=!!options.guess,mode=options.mode||null;var p=new printStackTrace.implementation(),result=p.run(ex,mode);return(guess)?p.guessAnonymousFunctions(result):result;}
printStackTrace.implementation=function(){};printStackTrace.implementation.prototype={run:function(ex,mode){ex=ex||this.createException();mode=mode||this.mode(ex);if(mode==='other'){return this.other(arguments.callee);}else{return this[mode](ex);}},createException:function(){try{this.undef();}catch(e){return e;}},mode:function(e){if(typeof window!=='undefined'&&window.navigator.userAgent.indexOf('PhantomJS')>-1){return'phantomjs';}
if(e['arguments']&&e.stack){return'chrome';}
if(e.stack&&e.sourceURL){return'safari';}
if(e.stack&&e.number){return'ie';}
if(e.stack&&e.fileName){return'firefox';}
if(e.message&&e['opera#sourceloc']){if(!e.stacktrace){return'opera9';}
if(e.message.indexOf('\n')>-1&&e.message.split('\n').length>e.stacktrace.split('\n').length){return'opera9';}
return'opera10a';}
if(e.message&&e.stack&&e.stacktrace){if(e.stacktrace.indexOf("called from line")<0){return'opera10b';}
return'opera11';}
if(e.stack&&!e.fileName){return'chrome';}
return'other';},instrumentFunction:function(context,functionName,callback){context=context||window;var original=context[functionName];context[functionName]=function instrumented(){callback.call(this,printStackTrace().slice(4));return context[functionName]._instrumented.apply(this,arguments);};context[functionName]._instrumented=original;},deinstrumentFunction:function(context,functionName){if(context[functionName].constructor===Function&&context[functionName]._instrumented&&context[functionName]._instrumented.constructor===Function){context[functionName]=context[functionName]._instrumented;}},chrome:function(e){return(e.stack+'\n')
.replace(/^[\s\S]+?\s+at\s+/,' at ')
.replace(/^\s+(at eval )?at\s+/gm,'')
.replace(/^([^\(]+?)([\n$])/gm,'{anonymous}() ($1)$2')
.replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm,'{anonymous}() ($1)')
.replace(/^(.+) \((.+)\)$/gm,'$1@$2')
.split('\n')
.slice(0,-1);},safari:function(e){return e.stack.replace(/\[native code\]\n/m,'')
.replace(/^(?=\w+Error\:).*$\n/m,'')
.replace(/^@/gm,'{anonymous}()@')
.split('\n');},ie:function(e){return e.stack
.replace(/^\s*at\s+(.*)$/gm,'$1')
.replace(/^Anonymous function\s+/gm,'{anonymous}() ')
.replace(/^(.+)\s+\((.+)\)$/gm,'$1@$2')
.split('\n')
.slice(1);},firefox:function(e){return e.stack.replace(/(?:\n@:0)?\s+$/m,'')
.replace(/^(?:\((\S*)\))?@/gm,'{anonymous}($1)@')
.split('\n');},opera11:function(e){var ANON='{anonymous}',lineRE=/^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/;var lines=e.stacktrace.split('\n'),result=[];for(var i=0,len=lines.length;i<len;i+=2){var match=lineRE.exec(lines[i]);if(match){var location=match[4]+':'+match[1]+':'+match[2];var fnName=match[3]||"global code";fnName=fnName.replace(/<anonymous function: (\S+)>/,"$1").replace(/<anonymous function>/,ANON);result.push(fnName+'@'+location+' -- '+lines[i+1].replace(/^\s+/,''));}}
return result;},opera10b:function(e){var lineRE=/^(.*)@(.+):(\d+)$/;var lines=e.stacktrace.split('\n'),result=[];for(var i=0,len=lines.length;i<len;i++){var match=lineRE.exec(lines[i]);if(match){var fnName=match[1]?(match[1]+'()'):"global code";result.push(fnName+'@'+match[2]+':'+match[3]);}}
return result;},opera10a:function(e){var ANON='{anonymous}',lineRE=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;var lines=e.stacktrace.split('\n'),result=[];for(var i=0,len=lines.length;i<len;i+=2){var match=lineRE.exec(lines[i]);if(match){var fnName=match[3]||ANON;result.push(fnName+'()@'+match[2]+':'+match[1]+' -- '+lines[i+1].replace(/^\s+/,''));}}
return result;},opera9:function(e){var ANON='{anonymous}',lineRE=/Line (\d+).*script (?:in )?(\S+)/i;var lines=e.message.split('\n'),result=[];for(var i=2,len=lines.length;i<len;i+=2){var match=lineRE.exec(lines[i]);if(match){result.push(ANON+'()@'+match[2]+':'+match[1]+' -- '+lines[i+1].replace(/^\s+/,''));}}
return result;},phantomjs:function(e){var ANON='{anonymous}',lineRE=/(\S+) \((\S+)\)/i;var lines=e.stack.split('\n'),result=[];for(var i=1,len=lines.length;i<len;i++){lines[i]=lines[i].replace(/^\s+at\s+/gm,'');var match=lineRE.exec(lines[i]);if(match){result.push(match[1]+'()@'+match[2]);}
else{result.push(ANON+'()@'+lines[i]);}}
return result;},other:function(curr){var ANON='{anonymous}',fnRE=/function(?:\s+([\w$]+))?\s*\(/,stack=[],fn,args,maxStackSize=10;var slice=Array.prototype.slice;while(curr&&stack.length<maxStackSize){fn=fnRE.test(curr.toString())?RegExp.$1||ANON:ANON;try{args=slice.call(curr['arguments']||[]);}catch(e){args=['Cannot access arguments: '+e];}
stack[stack.length]=fn+'('+this.stringifyArguments(args)+')';try{curr=curr.caller;}catch(e){stack[stack.length]='Cannot access caller: '+e;break;}}
return stack;},stringifyArguments:function(args){var result=[];var slice=Array.prototype.slice;for(var i=0;i<args.length;++i){var arg=args[i];if(arg===undefined){result[i]='undefined';}else if(arg===null){result[i]='null';}else if(arg.constructor){if(arg.constructor===Array){if(arg.length<3){result[i]='['+this.stringifyArguments(arg)+']';}else{result[i]='['+this.stringifyArguments(slice.call(arg,0,1))+'...'+this.stringifyArguments(slice.call(arg,-1))+']';}}else if(arg.constructor===Object){result[i]='#object';}else if(arg.constructor===Function){result[i]='#function';}else if(arg.constructor===String){result[i]='"'+arg+'"';}else if(arg.constructor===Number){result[i]=arg;}else{result[i]='?';}}}
return result.join(',');},sourceCache:{},ajax:function(url){var req=this.createXMLHTTPObject();if(req){try{req.open('GET',url,false);req.send(null);return req.responseText;}catch(e){}}
return'';},createXMLHTTPObject:function(){var xmlhttp,XMLHttpFactories=[function(){return new XMLHttpRequest();},function(){return new ActiveXObject('Msxml2.XMLHTTP');},function(){return new ActiveXObject('Msxml3.XMLHTTP');},function(){return new ActiveXObject('Microsoft.XMLHTTP');}];for(var i=0;i<XMLHttpFactories.length;i++){try{xmlhttp=XMLHttpFactories[i]();this.createXMLHTTPObject=XMLHttpFactories[i];return xmlhttp;}catch(e){}}},isSameDomain:function(url){return typeof location!=="undefined"&&url.indexOf(location.hostname)!==-1;},getSource:function(url){if(!(url in this.sourceCache)){this.sourceCache[url]=this.ajax(url).split('\n');}
return this.sourceCache[url];},guessAnonymousFunctions:function(stack){for(var i=0;i<stack.length;++i){var reStack=/\{anonymous\}\(.*\)@(.*)/,reRef=/^(.*?)(?::(\d+))(?::(\d+))?(?: -- .+)?$/,frame=stack[i],ref=reStack.exec(frame);if(ref){var m=reRef.exec(ref[1]);if(m){var file=m[1],lineno=m[2],charno=m[3]||0;if(file&&this.isSameDomain(file)&&lineno){var functionName=this.guessAnonymousFunction(file,lineno,charno);stack[i]=frame.replace('{anonymous}',functionName);}}}}
return stack;},guessAnonymousFunction:function(url,lineNo,charNo){var ret;try{ret=this.findFunctionName(this.getSource(url),lineNo);}catch(e){ret='getSource failed with url: '+url+', exception: '+e.toString();}
return ret;},findFunctionName:function(source,lineNo){var reFunctionDeclaration=/function\s+([^(]*?)\s*\(([^)]*)\)/;var reFunctionExpression=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/;var reFunctionEvaluation=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/;var code="",line,maxLines=Math.min(lineNo,20),m,commentPos;for(var i=0;i<maxLines;++i){line=source[lineNo-i-1];commentPos=line.indexOf('//');if(commentPos>=0){line=line.substr(0,commentPos);}
if(line){code=line+code;m=reFunctionExpression.exec(code);if(m&&m[1]){return m[1];}
m=reFunctionDeclaration.exec(code);if(m&&m[1]){return m[1];}
m=reFunctionEvaluation.exec(code);if(m&&m[1]){return m[1];}}}
return'(?)';}};return printStackTrace;}));
;(function(d){var cache={};d.publish=function(topic,args){cache[topic]&&d.each(cache[topic],function(){this.apply(d,args||[]);});};d.subscribe=function(topic,callback){if(!cache[topic]){cache[topic]=[];}
cache[topic].push(callback);return[topic,callback];};d.unsubscribe=function(handle){var t=handle[0];cache[t]&&d.each(cache[t],function(idx){if(this==handle[1]){cache[t].splice(idx,1);}});};})(jQuery);

(function(factory){"use strict";if(typeof define==='function'&&define.amd){define(['jquery'],factory);}
else if(typeof exports==='object'){factory(require('jquery'));}
else{factory(jQuery);}}(function($,undefined){"use strict";if($.jstree){return;}
var instance_counter=0,ccp_node=false,ccp_mode=false,ccp_inst=false,themes_loaded=[],src=$('script:last').attr('src'),document=window.document,_node=document.createElement('LI'),_temp1,_temp2;_node.setAttribute('role','treeitem');_temp1=document.createElement('I');_temp1.className='jstree-icon jstree-ocl';_temp1.setAttribute('role','presentation');_node.appendChild(_temp1);_temp1=document.createElement('A');_temp1.className='jstree-anchor';_temp1.setAttribute('href','#');_temp1.setAttribute('tabindex','-1');_temp2=document.createElement('I');_temp2.className='jstree-icon jstree-themeicon';_temp2.setAttribute('role','presentation');_temp1.appendChild(_temp2);_node.appendChild(_temp1);_temp1=_temp2=null;$.jstree={version:'3.1.1',defaults:{plugins:[]},plugins:{},path:src&&src.indexOf('/')!==-1?src.replace(/\/[^\/]+$/,''):'',idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g};$.jstree.create=function(el,options){var tmp=new $.jstree.core(++instance_counter),opt=options;options=$.extend(true,{},$.jstree.defaults,options);if(opt&&opt.plugins){options.plugins=opt.plugins;}
$.each(options.plugins,function(i,k){if(i!=='core'){tmp=tmp.plugin(k,options[k]);}});$(el).data('jstree',tmp);tmp.init(el,options);return tmp;};$.jstree.destroy=function(){$('.jstree:jstree').jstree('destroy');$(document).off('.jstree');};$.jstree.core=function(id){this._id=id;this._cnt=0;this._wrk=null;this._data={core:{themes:{name:false,dots:false,icons:false},selected:[],last_error:{},working:false,worker_queue:[],focused:null}};};$.jstree.reference=function(needle){var tmp=null,obj=null;if(needle&&needle.id&&(!needle.tagName||!needle.nodeType)){needle=needle.id;}
if(!obj||!obj.length){try{obj=$(needle);}catch(ignore){}}
if(!obj||!obj.length){try{obj=$('#'+needle.replace($.jstree.idregex,'\\$&'));}catch(ignore){}}
if(obj&&obj.length&&(obj=obj.closest('.jstree')).length&&(obj=obj.data('jstree'))){tmp=obj;}
else{$('.jstree').each(function(){var inst=$(this).data('jstree');if(inst&&inst._model.data[needle]){tmp=inst;return false;}});}
return tmp;};$.fn.jstree=function(arg){var is_method=(typeof arg==='string'),args=Array.prototype.slice.call(arguments,1),result=null;if(arg===true&&!this.length){return false;}
this.each(function(){var instance=$.jstree.reference(this),method=is_method&&instance?instance[arg]:null;result=is_method&&method?method.apply(instance,args):null;if(!instance&&!is_method&&(arg===undefined||$.isPlainObject(arg))){$.jstree.create(this,arg);}
if((instance&&!is_method)||arg===true){result=instance||false;}
if(result!==null&&result!==undefined){return false;}});return result!==null&&result!==undefined?result:this;};$.expr[':'].jstree=$.expr.createPseudo(function(search){return function(a){return $(a).hasClass('jstree')&&$(a).data('jstree')!==undefined;};});$.jstree.defaults.core={data:false,strings:false,check_callback:false,error:$.noop,animation:200,multiple:true,themes:{name:false,url:false,dir:false,dots:true,icons:true,stripes:false,variant:false,responsive:false},expand_selected_onload:true,worker:true,force_text:false,dblclick_toggle:true};$.jstree.core.prototype={plugin:function(deco,opts){var Child=$.jstree.plugins[deco];if(Child){this._data[deco]={};Child.prototype=this;return new Child(opts,this);}
return this;},init:function(el,options){this._model={data:{'#':{id:'#',parent:null,parents:[],children:[],children_d:[],state:{loaded:false}}},changed:[],force_full_redraw:false,redraw_timeout:false,default_state:{loaded:true,opened:false,selected:false,disabled:false}};this.element=$(el).addClass('jstree jstree-'+this._id);this.settings=options;this._data.core.ready=false;this._data.core.loaded=false;this._data.core.rtl=(this.element.css("direction")==="rtl");this.element[this._data.core.rtl?'addClass':'removeClass']("jstree-rtl");this.element.attr('role','tree');if(this.settings.core.multiple){this.element.attr('aria-multiselectable',true);}
if(!this.element.attr('tabindex')){this.element.attr('tabindex','0');}
this.bind();this.trigger("init");this._data.core.original_container_html=this.element.find(" > ul > li").clone(true);this._data.core.original_container_html
.find("li").addBack()
.contents().filter(function(){return this.nodeType===3&&(!this.nodeValue||/^\s+$/.test(this.nodeValue));})
.remove();this.element.html("<"+"ul class='jstree-container-ul jstree-children' role='group'><"+"li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><i class='jstree-icon jstree-ocl'></i><"+"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>");this.element.attr('aria-activedescendant','j'+this._id+'_loading');this._data.core.li_height=this.get_container_ul().children("li").first().height()||24;this.trigger("loading");this.load_node('#');},destroy:function(keep_html){if(this._wrk){try{window.URL.revokeObjectURL(this._wrk);this._wrk=null;}
catch(ignore){}}
if(!keep_html){this.element.empty();}
this.teardown();},teardown:function(){this.unbind();this.element
.removeClass('jstree')
.removeData('jstree')
.find("[class^='jstree']")
.addBack()
.attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,'');});this.element=null;},bind:function(){var word='',tout=null,was_click=0;this.element
.on("dblclick.jstree",function(){if(document.selection&&document.selection.empty){document.selection.empty();}
else{if(window.getSelection){var sel=window.getSelection();try{sel.removeAllRanges();sel.collapse();}catch(ignore){}}}})
.on("mousedown.jstree",$.proxy(function(e){if(e.target===this.element[0]){e.preventDefault();was_click=+(new Date());}},this))
.on("mousedown.jstree",".jstree-ocl",function(e){e.preventDefault();})
.on("click.jstree",".jstree-ocl",$.proxy(function(e){this.toggle_node(e.target);},this))
.on("dblclick.jstree",".jstree-anchor",$.proxy(function(e){if(this.settings.core.dblclick_toggle){this.toggle_node(e.target);}},this))
.on("click.jstree",".jstree-anchor",$.proxy(function(e){e.preventDefault();if(e.currentTarget!==document.activeElement){$(e.currentTarget).focus();}
this.activate_node(e.currentTarget,e);},this))
.on('keydown.jstree','.jstree-anchor',$.proxy(function(e){if(e.target.tagName==="INPUT"){return true;}
if(e.which!==32&&e.which!==13&&(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)){return true;}
var o=null;if(this._data.core.rtl){if(e.which===37){e.which=39;}
else if(e.which===39){e.which=37;}}
switch(e.which){case 32:if(e.ctrlKey){e.type="click";$(e.currentTarget).trigger(e);}
break;case 13:e.type="click";$(e.currentTarget).trigger(e);break;case 37:e.preventDefault();if(this.is_open(e.currentTarget)){this.close_node(e.currentTarget);}
else{o=this.get_parent(e.currentTarget);if(o&&o.id!=='#'){this.get_node(o,true).children('.jstree-anchor').focus();}}
break;case 38:e.preventDefault();o=this.get_prev_dom(e.currentTarget);if(o&&o.length){o.children('.jstree-anchor').focus();}
break;case 39:e.preventDefault();if(this.is_closed(e.currentTarget)){this.open_node(e.currentTarget,function(o){this.get_node(o,true).children('.jstree-anchor').focus();});}
else if(this.is_open(e.currentTarget)){o=this.get_node(e.currentTarget,true).children('.jstree-children')[0];if(o){$(this._firstChild(o)).children('.jstree-anchor').focus();}}
break;case 40:e.preventDefault();o=this.get_next_dom(e.currentTarget);if(o&&o.length){o.children('.jstree-anchor').focus();}
break;case 106:this.open_all();break;case 36:e.preventDefault();o=this._firstChild(this.get_container_ul()[0]);if(o){$(o).children('.jstree-anchor').filter(':visible').focus();}
break;case 35:e.preventDefault();this.element.find('.jstree-anchor').filter(':visible').last().focus();break;}},this))
.on("load_node.jstree",$.proxy(function(e,data){if(data.status){if(data.node.id==='#'&&!this._data.core.loaded){this._data.core.loaded=true;if(this._firstChild(this.get_container_ul()[0])){this.element.attr('aria-activedescendant',this._firstChild(this.get_container_ul()[0]).id);}
this.trigger("loaded");}
if(!this._data.core.ready){setTimeout($.proxy(function(){if(this.element&&!this.get_container_ul().find('.jstree-loading').length){this._data.core.ready=true;if(this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var tmp=[],i,j;for(i=0,j=this._data.core.selected.length;i<j;i++){tmp=tmp.concat(this._model.data[this._data.core.selected[i]].parents);}
tmp=$.vakata.array_unique(tmp);for(i=0,j=tmp.length;i<j;i++){this.open_node(tmp[i],false,0);}}
this.trigger('changed',{'action':'ready','selected':this._data.core.selected});}
this.trigger("ready");}},this),0);}}},this))
.on('keypress.jstree',$.proxy(function(e){if(e.target.tagName==="INPUT"){return true;}
if(tout){clearTimeout(tout);}
tout=setTimeout(function(){word='';},500);var chr=String.fromCharCode(e.which).toLowerCase(),col=this.element.find('.jstree-anchor').filter(':visible'),ind=col.index(document.activeElement)||0,end=false;word+=chr;if(word.length>1){col.slice(ind).each($.proxy(function(i,v){if($(v).text().toLowerCase().indexOf(word)===0){$(v).focus();end=true;return false;}},this));if(end){return;}
col.slice(0,ind).each($.proxy(function(i,v){if($(v).text().toLowerCase().indexOf(word)===0){$(v).focus();end=true;return false;}},this));if(end){return;}}
if(new RegExp('^'+chr+'+$').test(word)){col.slice(ind+1).each($.proxy(function(i,v){if($(v).text().toLowerCase().charAt(0)===chr){$(v).focus();end=true;return false;}},this));if(end){return;}
col.slice(0,ind+1).each($.proxy(function(i,v){if($(v).text().toLowerCase().charAt(0)===chr){$(v).focus();end=true;return false;}},this));if(end){return;}}},this))
.on("init.jstree",$.proxy(function(){var s=this.settings.core.themes;this._data.core.themes.dots=s.dots;this._data.core.themes.stripes=s.stripes;this._data.core.themes.icons=s.icons;this.set_theme(s.name||"default",s.url);this.set_theme_variant(s.variant);},this))
.on("loading.jstree",$.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"]();this[this._data.core.themes.icons?"show_icons":"hide_icons"]();this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]();},this))
.on('blur.jstree','.jstree-anchor',$.proxy(function(e){this._data.core.focused=null;$(e.currentTarget).filter('.jstree-hovered').mouseleave();this.element.attr('tabindex','0');},this))
.on('focus.jstree','.jstree-anchor',$.proxy(function(e){var tmp=this.get_node(e.currentTarget);if(tmp&&tmp.id){this._data.core.focused=tmp.id;}
this.element.find('.jstree-hovered').not(e.currentTarget).mouseleave();$(e.currentTarget).mouseenter();this.element.attr('tabindex','-1');},this))
.on('focus.jstree',$.proxy(function(){if(+(new Date())-was_click>500&&!this._data.core.focused){was_click=0;var act=this.get_node(this.element.attr('aria-activedescendant'),true);if(act){act.find('> .jstree-anchor').focus();}}},this))
.on('mouseenter.jstree','.jstree-anchor',$.proxy(function(e){this.hover_node(e.currentTarget);},this))
.on('mouseleave.jstree','.jstree-anchor',$.proxy(function(e){this.dehover_node(e.currentTarget);},this));},unbind:function(){this.element.off('.jstree');$(document).off('.jstree-'+this._id);},trigger:function(ev,data){if(!data){data={};}
data.instance=this;this.element.triggerHandler(ev.replace('.jstree','')+'.jstree',data);},get_container:function(){return this.element;},get_container_ul:function(){return this.element.children(".jstree-children").first();},get_string:function(key){var a=this.settings.core.strings;if($.isFunction(a)){return a.call(this,key);}
if(a&&a[key]){return a[key];}
return key;},_firstChild:function(dom){dom=dom?dom.firstChild:null;while(dom!==null&&dom.nodeType!==1){dom=dom.nextSibling;}
return dom;},_nextSibling:function(dom){dom=dom?dom.nextSibling:null;while(dom!==null&&dom.nodeType!==1){dom=dom.nextSibling;}
return dom;},_previousSibling:function(dom){dom=dom?dom.previousSibling:null;while(dom!==null&&dom.nodeType!==1){dom=dom.previousSibling;}
return dom;},get_node:function(obj,as_dom){if(obj&&obj.id){obj=obj.id;}
var dom;try{if(this._model.data[obj]){obj=this._model.data[obj];}
else if(typeof obj==="string"&&this._model.data[obj.replace(/^#/,'')]){obj=this._model.data[obj.replace(/^#/,'')];}
else if(typeof obj==="string"&&(dom=$('#'+obj.replace($.jstree.idregex,'\\$&'),this.element)).length&&this._model.data[dom.closest('.jstree-node').attr('id')]){obj=this._model.data[dom.closest('.jstree-node').attr('id')];}
else if((dom=$(obj,this.element)).length&&this._model.data[dom.closest('.jstree-node').attr('id')]){obj=this._model.data[dom.closest('.jstree-node').attr('id')];}
else if((dom=$(obj,this.element)).length&&dom.hasClass('jstree')){obj=this._model.data['#'];}
else{return false;}
if(as_dom){obj=obj.id==='#'?this.element:$('#'+obj.id.replace($.jstree.idregex,'\\$&'),this.element);}
return obj;}catch(ex){return false;}},get_path:function(obj,glue,ids){obj=obj.parents?obj:this.get_node(obj);if(!obj||obj.id==='#'||!obj.parents){return false;}
var i,j,p=[];p.push(ids?obj.id:obj.text);for(i=0,j=obj.parents.length;i<j;i++){p.push(ids?obj.parents[i]:this.get_text(obj.parents[i]));}
p=p.reverse().slice(1);return glue?p.join(glue):p;},get_next_dom:function(obj,strict){var tmp;obj=this.get_node(obj,true);if(obj[0]===this.element[0]){tmp=this._firstChild(this.get_container_ul()[0]);while(tmp&&tmp.offsetHeight===0){tmp=this._nextSibling(tmp);}
return tmp?$(tmp):false;}
if(!obj||!obj.length){return false;}
if(strict){tmp=obj[0];do{tmp=this._nextSibling(tmp);}while(tmp&&tmp.offsetHeight===0);return tmp?$(tmp):false;}
if(obj.hasClass("jstree-open")){tmp=this._firstChild(obj.children('.jstree-children')[0]);while(tmp&&tmp.offsetHeight===0){tmp=this._nextSibling(tmp);}
if(tmp!==null){return $(tmp);}}
tmp=obj[0];do{tmp=this._nextSibling(tmp);}while(tmp&&tmp.offsetHeight===0);if(tmp!==null){return $(tmp);}
return obj.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first();},get_prev_dom:function(obj,strict){var tmp;obj=this.get_node(obj,true);if(obj[0]===this.element[0]){tmp=this.get_container_ul()[0].lastChild;while(tmp&&tmp.offsetHeight===0){tmp=this._previousSibling(tmp);}
return tmp?$(tmp):false;}
if(!obj||!obj.length){return false;}
if(strict){tmp=obj[0];do{tmp=this._previousSibling(tmp);}while(tmp&&tmp.offsetHeight===0);return tmp?$(tmp):false;}
tmp=obj[0];do{tmp=this._previousSibling(tmp);}while(tmp&&tmp.offsetHeight===0);if(tmp!==null){obj=$(tmp);while(obj.hasClass("jstree-open")){obj=obj.children(".jstree-children").first().children(".jstree-node:visible:last");}
return obj;}
tmp=obj[0].parentNode.parentNode;return tmp&&tmp.className&&tmp.className.indexOf('jstree-node')!==-1?$(tmp):false;},get_parent:function(obj){obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
return obj.parent;},get_children_dom:function(obj){obj=this.get_node(obj,true);if(obj[0]===this.element[0]){return this.get_container_ul().children(".jstree-node");}
if(!obj||!obj.length){return false;}
return obj.children(".jstree-children").children(".jstree-node");},is_parent:function(obj){obj=this.get_node(obj);return obj&&(obj.state.loaded===false||obj.children.length>0);},is_loaded:function(obj){obj=this.get_node(obj);return obj&&obj.state.loaded;},is_loading:function(obj){obj=this.get_node(obj);return obj&&obj.state&&obj.state.loading;},is_open:function(obj){obj=this.get_node(obj);return obj&&obj.state.opened;},is_closed:function(obj){obj=this.get_node(obj);return obj&&this.is_parent(obj)&&!obj.state.opened;},is_leaf:function(obj){return!this.is_parent(obj);},load_node:function(obj,callback){var k,l,i,j,c;if($.isArray(obj)){this._load_nodes(obj.slice(),callback);return true;}
obj=this.get_node(obj);if(!obj){if(callback){callback.call(this,obj,false);}
return false;}
if(obj.state.loaded){obj.state.loaded=false;for(k=0,l=obj.children_d.length;k<l;k++){for(i=0,j=obj.parents.length;i<j;i++){this._model.data[obj.parents[i]].children_d=$.vakata.array_remove_item(this._model.data[obj.parents[i]].children_d,obj.children_d[k]);}
if(this._model.data[obj.children_d[k]].state.selected){c=true;this._data.core.selected=$.vakata.array_remove_item(this._data.core.selected,obj.children_d[k]);}
delete this._model.data[obj.children_d[k]];}
obj.children=[];obj.children_d=[];if(c){this.trigger('changed',{'action':'load_node','node':obj,'selected':this._data.core.selected});}}
obj.state.failed=false;obj.state.loading=true;this.get_node(obj,true).addClass("jstree-loading").attr('aria-busy',true);this._load_node(obj,$.proxy(function(status){obj=this._model.data[obj.id];obj.state.loading=false;obj.state.loaded=status;obj.state.failed=!obj.state.loaded;var dom=this.get_node(obj,true);if(obj.state.loaded&&!obj.children.length&&dom&&dom.length&&!dom.hasClass('jstree-leaf')){dom.removeClass('jstree-closed jstree-open').addClass('jstree-leaf');}
dom.removeClass("jstree-loading").attr('aria-busy',false);this.trigger('load_node',{"node":obj,"status":status});if(callback){callback.call(this,obj,status);}},this));return true;},_load_nodes:function(nodes,callback,is_callback){var r=true,c=function(){this._load_nodes(nodes,callback,true);},m=this._model.data,i,j,tmp=[];for(i=0,j=nodes.length;i<j;i++){if(m[nodes[i]]&&((!m[nodes[i]].state.loaded&&!m[nodes[i]].state.failed)||!is_callback)){if(!this.is_loading(nodes[i])){this.load_node(nodes[i],c);}
r=false;}}
if(r){for(i=0,j=nodes.length;i<j;i++){if(m[nodes[i]]&&m[nodes[i]].state.loaded){tmp.push(nodes[i]);}}
if(callback&&!callback.done){callback.call(this,tmp);callback.done=true;}}},load_all:function(obj,callback){if(!obj){obj='#';}
obj=this.get_node(obj);if(!obj){return false;}
var to_load=[],m=this._model.data,c=m[obj.id].children_d,i,j;if(obj.state&&!obj.state.loaded){to_load.push(obj.id);}
for(i=0,j=c.length;i<j;i++){if(m[c[i]]&&m[c[i]].state&&!m[c[i]].state.loaded){to_load.push(c[i]);}}
if(to_load.length){this._load_nodes(to_load,function(){this.load_all(obj,callback);});}
else{if(callback){callback.call(this,obj);}
this.trigger('load_all',{"node":obj});}},_load_node:function(obj,callback){var s=this.settings.core.data,t;if(!s){if(obj.id==='#'){return this._append_html_data(obj,this._data.core.original_container_html.clone(true),function(status){callback.call(this,status);});}
else{return callback.call(this,false);}
}
if($.isFunction(s)){return s.call(this,obj,$.proxy(function(d){if(d===false){callback.call(this,false);}
this[typeof d==='string'?'_append_html_data':'_append_json_data'](obj,typeof d==='string'?$($.parseHTML(d)).filter(function(){return this.nodeType!==3;}):d,function(status){callback.call(this,status);});},this));}
if(typeof s==='object'){if(s.url){s=$.extend(true,{},s);if($.isFunction(s.url)){s.url=s.url.call(this,obj);}
if($.isFunction(s.data)){s.data=s.data.call(this,obj);}
return $.ajax(s)
.done($.proxy(function(d,t,x){var type=x.getResponseHeader('Content-Type');if((type&&type.indexOf('json')!==-1)||typeof d==="object"){return this._append_json_data(obj,d,function(status){callback.call(this,status);});}
if((type&&type.indexOf('html')!==-1)||typeof d==="string"){return this._append_html_data(obj,$($.parseHTML(d)).filter(function(){return this.nodeType!==3;}),function(status){callback.call(this,status);});}
this._data.core.last_error={'error':'ajax','plugin':'core','id':'core_04','reason':'Could not load node','data':JSON.stringify({'id':obj.id,'xhr':x})};this.settings.core.error.call(this,this._data.core.last_error);return callback.call(this,false);},this))
.fail($.proxy(function(f){callback.call(this,false);this._data.core.last_error={'error':'ajax','plugin':'core','id':'core_04','reason':'Could not load node','data':JSON.stringify({'id':obj.id,'xhr':f})};this.settings.core.error.call(this,this._data.core.last_error);},this));}
t=($.isArray(s)||$.isPlainObject(s))?JSON.parse(JSON.stringify(s)):s;if(obj.id==='#'){return this._append_json_data(obj,t,function(status){callback.call(this,status);});}
else{this._data.core.last_error={'error':'nodata','plugin':'core','id':'core_05','reason':'Could not load node','data':JSON.stringify({'id':obj.id})};this.settings.core.error.call(this,this._data.core.last_error);return callback.call(this,false);}
}
if(typeof s==='string'){if(obj.id==='#'){return this._append_html_data(obj,$($.parseHTML(s)).filter(function(){return this.nodeType!==3;}),function(status){callback.call(this,status);});}
else{this._data.core.last_error={'error':'nodata','plugin':'core','id':'core_06','reason':'Could not load node','data':JSON.stringify({'id':obj.id})};this.settings.core.error.call(this,this._data.core.last_error);return callback.call(this,false);}
}
return callback.call(this,false);},_node_changed:function(obj){obj=this.get_node(obj);if(obj){this._model.changed.push(obj.id);}},_append_html_data:function(dom,data,cb){dom=this.get_node(dom);dom.children=[];dom.children_d=[];var dat=data.is('ul')?data.children():data,par=dom.id,chd=[],dpc=[],m=this._model.data,p=m[par],s=this._data.core.selected.length,tmp,i,j;dat.each($.proxy(function(i,v){tmp=this._parse_model_from_html($(v),par,p.parents.concat());if(tmp){chd.push(tmp);dpc.push(tmp);if(m[tmp].children_d.length){dpc=dpc.concat(m[tmp].children_d);}}},this));p.children=chd;p.children_d=dpc;for(i=0,j=p.parents.length;i<j;i++){m[p.parents[i]].children_d=m[p.parents[i]].children_d.concat(dpc);}
this.trigger('model',{"nodes":dpc,'parent':par});if(par!=='#'){this._node_changed(par);this.redraw();}
else{this.get_container_ul().children('.jstree-initial-node').remove();this.redraw(true);}
if(this._data.core.selected.length!==s){this.trigger('changed',{'action':'model','selected':this._data.core.selected});}
cb.call(this,true);},_append_json_data:function(dom,data,cb,force_processing){if(this.element===null){return;}
dom=this.get_node(dom);dom.children=[];dom.children_d=[];if(data.d){data=data.d;if(typeof data==="string"){data=JSON.parse(data);}}
if(!$.isArray(data)){data=[data];}
var w=null,args={'df':this._model.default_state,'dat':data,'par':dom.id,'m':this._model.data,'t_id':this._id,'t_cnt':this._cnt,'sel':this._data.core.selected},func=function(data,undefined){if(data.data){data=data.data;}
var dat=data.dat,par=data.par,chd=[],dpc=[],add=[],df=data.df,t_id=data.t_id,t_cnt=data.t_cnt,m=data.m,p=m[par],sel=data.sel,tmp,i,j,rslt,parse_flat=function(d,p,ps){if(!ps){ps=[];}
else{ps=ps.concat();}
if(p){ps.unshift(p);}
var tid=d.id.toString(),i,j,c,e,tmp={id:tid,text:d.text||'',icon:d.icon!==undefined?d.icon:true,parent:p,parents:ps,children:d.children||[],children_d:d.children_d||[],data:d.data,state:{},li_attr:{id:false},a_attr:{href:'#'},original:false};for(i in df){if(df.hasOwnProperty(i)){tmp.state[i]=df[i];}}
if(d&&d.data&&d.data.jstree&&d.data.jstree.icon){tmp.icon=d.data.jstree.icon;}
if(tmp.icon===undefined||tmp.icon===null||tmp.icon===""){tmp.icon=true;}
if(d&&d.data){tmp.data=d.data;if(d.data.jstree){for(i in d.data.jstree){if(d.data.jstree.hasOwnProperty(i)){tmp.state[i]=d.data.jstree[i];}}}}
if(d&&typeof d.state==='object'){for(i in d.state){if(d.state.hasOwnProperty(i)){tmp.state[i]=d.state[i];}}}
if(d&&typeof d.li_attr==='object'){for(i in d.li_attr){if(d.li_attr.hasOwnProperty(i)){tmp.li_attr[i]=d.li_attr[i];}}}
if(!tmp.li_attr.id){tmp.li_attr.id=tid;}
if(d&&typeof d.a_attr==='object'){for(i in d.a_attr){if(d.a_attr.hasOwnProperty(i)){tmp.a_attr[i]=d.a_attr[i];}}}
if(d&&d.children&&d.children===true){tmp.state.loaded=false;tmp.children=[];tmp.children_d=[];}
m[tmp.id]=tmp;for(i=0,j=tmp.children.length;i<j;i++){c=parse_flat(m[tmp.children[i]],tmp.id,ps);e=m[c];tmp.children_d.push(c);if(e.children_d.length){tmp.children_d=tmp.children_d.concat(e.children_d);}}
delete d.data;delete d.children;m[tmp.id].original=d;if(tmp.state.selected){add.push(tmp.id);}
return tmp.id;},parse_nest=function(d,p,ps){if(!ps){ps=[];}
else{ps=ps.concat();}
if(p){ps.unshift(p);}
var tid=false,i,j,c,e,tmp;do{tid='j'+t_id+'_'+(++t_cnt);}while(m[tid]);tmp={id:false,text:typeof d==='string'?d:'',icon:typeof d==='object'&&d.icon!==undefined?d.icon:true,parent:p,parents:ps,children:[],children_d:[],data:null,state:{},li_attr:{id:false},a_attr:{href:'#'},original:false};for(i in df){if(df.hasOwnProperty(i)){tmp.state[i]=df[i];}}
if(d&&d.id){tmp.id=d.id.toString();}
if(d&&d.text){tmp.text=d.text;}
if(d&&d.data&&d.data.jstree&&d.data.jstree.icon){tmp.icon=d.data.jstree.icon;}
if(tmp.icon===undefined||tmp.icon===null||tmp.icon===""){tmp.icon=true;}
if(d&&d.data){tmp.data=d.data;if(d.data.jstree){for(i in d.data.jstree){if(d.data.jstree.hasOwnProperty(i)){tmp.state[i]=d.data.jstree[i];}}}}
if(d&&typeof d.state==='object'){for(i in d.state){if(d.state.hasOwnProperty(i)){tmp.state[i]=d.state[i];}}}
if(d&&typeof d.li_attr==='object'){for(i in d.li_attr){if(d.li_attr.hasOwnProperty(i)){tmp.li_attr[i]=d.li_attr[i];}}}
if(tmp.li_attr.id&&!tmp.id){tmp.id=tmp.li_attr.id.toString();}
if(!tmp.id){tmp.id=tid;}
if(!tmp.li_attr.id){tmp.li_attr.id=tmp.id;}
if(d&&typeof d.a_attr==='object'){for(i in d.a_attr){if(d.a_attr.hasOwnProperty(i)){tmp.a_attr[i]=d.a_attr[i];}}}
if(d&&d.children&&d.children.length){for(i=0,j=d.children.length;i<j;i++){c=parse_nest(d.children[i],tmp.id,ps);e=m[c];tmp.children.push(c);if(e.children_d.length){tmp.children_d=tmp.children_d.concat(e.children_d);}}
tmp.children_d=tmp.children_d.concat(tmp.children);}
if(d&&d.children&&d.children===true){tmp.state.loaded=false;tmp.children=[];tmp.children_d=[];}
delete d.data;delete d.children;tmp.original=d;m[tmp.id]=tmp;if(tmp.state.selected){add.push(tmp.id);}
return tmp.id;};if(dat.length&&dat[0].id!==undefined&&dat[0].parent!==undefined){for(i=0,j=dat.length;i<j;i++){if(!dat[i].children){dat[i].children=[];}
m[dat[i].id.toString()]=dat[i];}
for(i=0,j=dat.length;i<j;i++){m[dat[i].parent.toString()].children.push(dat[i].id.toString());p.children_d.push(dat[i].id.toString());}
for(i=0,j=p.children.length;i<j;i++){tmp=parse_flat(m[p.children[i]],par,p.parents.concat());dpc.push(tmp);if(m[tmp].children_d.length){dpc=dpc.concat(m[tmp].children_d);}}
for(i=0,j=p.parents.length;i<j;i++){m[p.parents[i]].children_d=m[p.parents[i]].children_d.concat(dpc);}
rslt={'cnt':t_cnt,'mod':m,'sel':sel,'par':par,'dpc':dpc,'add':add};}
else{for(i=0,j=dat.length;i<j;i++){tmp=parse_nest(dat[i],par,p.parents.concat());if(tmp){chd.push(tmp);dpc.push(tmp);if(m[tmp].children_d.length){dpc=dpc.concat(m[tmp].children_d);}}}
p.children=chd;p.children_d=dpc;for(i=0,j=p.parents.length;i<j;i++){m[p.parents[i]].children_d=m[p.parents[i]].children_d.concat(dpc);}
rslt={'cnt':t_cnt,'mod':m,'sel':sel,'par':par,'dpc':dpc,'add':add};}
if(typeof window==='undefined'||typeof window.document==='undefined'){postMessage(rslt);}
else{return rslt;}},rslt=function(rslt,worker){if(this.element===null){return;}
this._cnt=rslt.cnt;this._model.data=rslt.mod;if(worker){var i,j,a=rslt.add,r=rslt.sel,s=this._data.core.selected.slice(),m=this._model.data;if(r.length!==s.length||$.vakata.array_unique(r.concat(s)).length!==r.length){for(i=0,j=r.length;i<j;i++){if($.inArray(r[i],a)===-1&&$.inArray(r[i],s)===-1){m[r[i]].state.selected=false;}}
for(i=0,j=s.length;i<j;i++){if($.inArray(s[i],r)===-1){m[s[i]].state.selected=true;}}}}
if(rslt.add.length){this._data.core.selected=this._data.core.selected.concat(rslt.add);}
this.trigger('model',{"nodes":rslt.dpc,'parent':rslt.par});if(rslt.par!=='#'){this._node_changed(rslt.par);this.redraw();}
else{this.redraw(true);}
if(rslt.add.length){this.trigger('changed',{'action':'model','selected':this._data.core.selected});}
cb.call(this,true);};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker){try{if(this._wrk===null){this._wrk=window.URL.createObjectURL(new window.Blob(['self.onmessage = '+func.toString()],{type:"text/javascript"}));}
if(!this._data.core.working||force_processing){this._data.core.working=true;w=new window.Worker(this._wrk);w.onmessage=$.proxy(function(e){rslt.call(this,e.data,true);try{w.terminate();w=null;}catch(ignore){}
if(this._data.core.worker_queue.length){this._append_json_data.apply(this,this._data.core.worker_queue.shift());}
else{this._data.core.working=false;}},this);if(!args.par){if(this._data.core.worker_queue.length){this._append_json_data.apply(this,this._data.core.worker_queue.shift());}
else{this._data.core.working=false;}}
else{w.postMessage(args);}}
else{this._data.core.worker_queue.push([dom,data,cb,true]);}}
catch(e){rslt.call(this,func(args),false);if(this._data.core.worker_queue.length){this._append_json_data.apply(this,this._data.core.worker_queue.shift());}
else{this._data.core.working=false;}}}
else{rslt.call(this,func(args),false);}},_parse_model_from_html:function(d,p,ps){if(!ps){ps=[];}
else{ps=[].concat(ps);}
if(p){ps.unshift(p);}
var c,e,m=this._model.data,data={id:false,text:false,icon:true,parent:p,parents:ps,children:[],children_d:[],data:null,state:{},li_attr:{id:false},a_attr:{href:'#'},original:false},i,tmp,tid;for(i in this._model.default_state){if(this._model.default_state.hasOwnProperty(i)){data.state[i]=this._model.default_state[i];}}
tmp=$.vakata.attributes(d,true);$.each(tmp,function(i,v){v=$.trim(v);if(!v.length){return true;}
data.li_attr[i]=v;if(i==='id'){data.id=v.toString();}});tmp=d.children('a').first();if(tmp.length){tmp=$.vakata.attributes(tmp,true);$.each(tmp,function(i,v){v=$.trim(v);if(v.length){data.a_attr[i]=v;}});}
tmp=d.children("a").first().length?d.children("a").first().clone():d.clone();tmp.children("ins, i, ul").remove();tmp=tmp.html();tmp=$('<div />').html(tmp);data.text=this.settings.core.force_text?tmp.text():tmp.html();tmp=d.data();data.data=tmp?$.extend(true,{},tmp):null;data.state.opened=d.hasClass('jstree-open');data.state.selected=d.children('a').hasClass('jstree-clicked');data.state.disabled=d.children('a').hasClass('jstree-disabled');if(data.data&&data.data.jstree){for(i in data.data.jstree){if(data.data.jstree.hasOwnProperty(i)){data.state[i]=data.data.jstree[i];}}}
tmp=d.children("a").children(".jstree-themeicon");if(tmp.length){data.icon=tmp.hasClass('jstree-themeicon-hidden')?false:tmp.attr('rel');}
if(data.state.icon!==undefined){data.icon=data.state.icon;}
if(data.icon===undefined||data.icon===null||data.icon===""){data.icon=true;}
tmp=d.children("ul").children("li");do{tid='j'+this._id+'_'+(++this._cnt);}while(m[tid]);data.id=data.li_attr.id?data.li_attr.id.toString():tid;if(tmp.length){tmp.each($.proxy(function(i,v){c=this._parse_model_from_html($(v),data.id,ps);e=this._model.data[c];data.children.push(c);if(e.children_d.length){data.children_d=data.children_d.concat(e.children_d);}},this));data.children_d=data.children_d.concat(data.children);}
else{if(d.hasClass('jstree-closed')){data.state.loaded=false;}}
if(data.li_attr['class']){data.li_attr['class']=data.li_attr['class'].replace('jstree-closed','').replace('jstree-open','');}
if(data.a_attr['class']){data.a_attr['class']=data.a_attr['class'].replace('jstree-clicked','').replace('jstree-disabled','');}
m[data.id]=data;if(data.state.selected){this._data.core.selected.push(data.id);}
return data.id;},_parse_model_from_flat_json:function(d,p,ps){if(!ps){ps=[];}
else{ps=ps.concat();}
if(p){ps.unshift(p);}
var tid=d.id.toString(),m=this._model.data,df=this._model.default_state,i,j,c,e,tmp={id:tid,text:d.text||'',icon:d.icon!==undefined?d.icon:true,parent:p,parents:ps,children:d.children||[],children_d:d.children_d||[],data:d.data,state:{},li_attr:{id:false},a_attr:{href:'#'},original:false};for(i in df){if(df.hasOwnProperty(i)){tmp.state[i]=df[i];}}
if(d&&d.data&&d.data.jstree&&d.data.jstree.icon){tmp.icon=d.data.jstree.icon;}
if(tmp.icon===undefined||tmp.icon===null||tmp.icon===""){tmp.icon=true;}
if(d&&d.data){tmp.data=d.data;if(d.data.jstree){for(i in d.data.jstree){if(d.data.jstree.hasOwnProperty(i)){tmp.state[i]=d.data.jstree[i];}}}}
if(d&&typeof d.state==='object'){for(i in d.state){if(d.state.hasOwnProperty(i)){tmp.state[i]=d.state[i];}}}
if(d&&typeof d.li_attr==='object'){for(i in d.li_attr){if(d.li_attr.hasOwnProperty(i)){tmp.li_attr[i]=d.li_attr[i];}}}
if(!tmp.li_attr.id){tmp.li_attr.id=tid;}
if(d&&typeof d.a_attr==='object'){for(i in d.a_attr){if(d.a_attr.hasOwnProperty(i)){tmp.a_attr[i]=d.a_attr[i];}}}
if(d&&d.children&&d.children===true){tmp.state.loaded=false;tmp.children=[];tmp.children_d=[];}
m[tmp.id]=tmp;for(i=0,j=tmp.children.length;i<j;i++){c=this._parse_model_from_flat_json(m[tmp.children[i]],tmp.id,ps);e=m[c];tmp.children_d.push(c);if(e.children_d.length){tmp.children_d=tmp.children_d.concat(e.children_d);}}
delete d.data;delete d.children;m[tmp.id].original=d;if(tmp.state.selected){this._data.core.selected.push(tmp.id);}
return tmp.id;},_parse_model_from_json:function(d,p,ps){if(!ps){ps=[];}
else{ps=ps.concat();}
if(p){ps.unshift(p);}
var tid=false,i,j,c,e,m=this._model.data,df=this._model.default_state,tmp;do{tid='j'+this._id+'_'+(++this._cnt);}while(m[tid]);tmp={id:false,text:typeof d==='string'?d:'',icon:typeof d==='object'&&d.icon!==undefined?d.icon:true,parent:p,parents:ps,children:[],children_d:[],data:null,state:{},li_attr:{id:false},a_attr:{href:'#'},original:false};for(i in df){if(df.hasOwnProperty(i)){tmp.state[i]=df[i];}}
if(d&&d.id){tmp.id=d.id.toString();}
if(d&&d.text){tmp.text=d.text;}
if(d&&d.data&&d.data.jstree&&d.data.jstree.icon){tmp.icon=d.data.jstree.icon;}
if(tmp.icon===undefined||tmp.icon===null||tmp.icon===""){tmp.icon=true;}
if(d&&d.data){tmp.data=d.data;if(d.data.jstree){for(i in d.data.jstree){if(d.data.jstree.hasOwnProperty(i)){tmp.state[i]=d.data.jstree[i];}}}}
if(d&&typeof d.state==='object'){for(i in d.state){if(d.state.hasOwnProperty(i)){tmp.state[i]=d.state[i];}}}
if(d&&typeof d.li_attr==='object'){for(i in d.li_attr){if(d.li_attr.hasOwnProperty(i)){tmp.li_attr[i]=d.li_attr[i];}}}
if(tmp.li_attr.id&&!tmp.id){tmp.id=tmp.li_attr.id.toString();}
if(!tmp.id){tmp.id=tid;}
if(!tmp.li_attr.id){tmp.li_attr.id=tmp.id;}
if(d&&typeof d.a_attr==='object'){for(i in d.a_attr){if(d.a_attr.hasOwnProperty(i)){tmp.a_attr[i]=d.a_attr[i];}}}
if(d&&d.children&&d.children.length){for(i=0,j=d.children.length;i<j;i++){c=this._parse_model_from_json(d.children[i],tmp.id,ps);e=m[c];tmp.children.push(c);if(e.children_d.length){tmp.children_d=tmp.children_d.concat(e.children_d);}}
tmp.children_d=tmp.children_d.concat(tmp.children);}
if(d&&d.children&&d.children===true){tmp.state.loaded=false;tmp.children=[];tmp.children_d=[];}
delete d.data;delete d.children;tmp.original=d;m[tmp.id]=tmp;if(tmp.state.selected){this._data.core.selected.push(tmp.id);}
return tmp.id;},_redraw:function(){var nodes=this._model.force_full_redraw?this._model.data['#'].children.concat([]):this._model.changed.concat([]),f=document.createElement('UL'),tmp,i,j,fe=this._data.core.focused;for(i=0,j=nodes.length;i<j;i++){tmp=this.redraw_node(nodes[i],true,this._model.force_full_redraw);if(tmp&&this._model.force_full_redraw){f.appendChild(tmp);}}
if(this._model.force_full_redraw){f.className=this.get_container_ul()[0].className;f.setAttribute('role','group');this.element.empty().append(f);}
if(fe!==null){tmp=this.get_node(fe,true);if(tmp&&tmp.length&&tmp.children('.jstree-anchor')[0]!==document.activeElement){tmp.children('.jstree-anchor').focus();}
else{this._data.core.focused=null;}}
this._model.force_full_redraw=false;this._model.changed=[];this.trigger('redraw',{"nodes":nodes});},redraw:function(full){if(full){this._model.force_full_redraw=true;}
this._redraw();},draw_children:function(node){var obj=this.get_node(node),i=false,j=false,k=false,d=document;if(!obj){return false;}
if(obj.id==='#'){return this.redraw(true);}
node=this.get_node(node,true);if(!node||!node.length){return false;}
node.children('.jstree-children').remove();node=node[0];if(obj.children.length&&obj.state.loaded){k=d.createElement('UL');k.setAttribute('role','group');k.className='jstree-children';for(i=0,j=obj.children.length;i<j;i++){k.appendChild(this.redraw_node(obj.children[i],true,true));}
node.appendChild(k);}},redraw_node:function(node,deep,is_callback,force_render){var obj=this.get_node(node),par=false,ind=false,old=false,i=false,j=false,k=false,c='',d=document,m=this._model.data,f=false,s=false,tmp=null,t=0,l=0;if(!obj){return false;}
if(obj.id==='#'){return this.redraw(true);}
deep=deep||obj.children.length===0;node=!document.querySelector?document.getElementById(obj.id):this.element[0].querySelector('#'+("0123456789".indexOf(obj.id[0])!==-1?'\\3'+obj.id[0]+' '+obj.id.substr(1).replace($.jstree.idregex,'\\$&'):obj.id.replace($.jstree.idregex,'\\$&')));if(!node){deep=true;if(!is_callback){par=obj.parent!=='#'?$('#'+obj.parent.replace($.jstree.idregex,'\\$&'),this.element)[0]:null;if(par!==null&&(!par||!m[obj.parent].state.opened)){return false;}
ind=$.inArray(obj.id,par===null?m['#'].children:m[obj.parent].children);}}
else{node=$(node);if(!is_callback){par=node.parent().parent()[0];if(par===this.element[0]){par=null;}
ind=node.index();}
if(!deep&&obj.children.length&&!node.children('.jstree-children').length){deep=true;}
if(!deep){old=node.children('.jstree-children')[0];}
f=node.children('.jstree-anchor')[0]===document.activeElement;node.remove();}
node=_node.cloneNode(true);c='jstree-node ';for(i in obj.li_attr){if(obj.li_attr.hasOwnProperty(i)){if(i==='id'){continue;}
if(i!=='class'){node.setAttribute(i,obj.li_attr[i]);}
else{c+=obj.li_attr[i];}}}
if(!obj.a_attr.id){obj.a_attr.id=obj.id+'_anchor';}
node.setAttribute('aria-selected',!!obj.state.selected);node.setAttribute('aria-level',obj.parents.length);node.setAttribute('aria-labelledby',obj.a_attr.id);if(obj.state.disabled){node.setAttribute('aria-disabled',true);}
if(obj.state.loaded&&!obj.children.length){c+=' jstree-leaf';}
else{c+=obj.state.opened&&obj.state.loaded?' jstree-open':' jstree-closed';node.setAttribute('aria-expanded',(obj.state.opened&&obj.state.loaded));}
if(obj.parent!==null&&m[obj.parent].children[m[obj.parent].children.length-1]===obj.id){c+=' jstree-last';}
node.id=obj.id;node.className=c;c=(obj.state.selected?' jstree-clicked':'')+(obj.state.disabled?' jstree-disabled':'');for(j in obj.a_attr){if(obj.a_attr.hasOwnProperty(j)){if(j==='href'&&obj.a_attr[j]==='#'){continue;}
if(j!=='class'){node.childNodes[1].setAttribute(j,obj.a_attr[j]);}
else{c+=' '+obj.a_attr[j];}}}
if(c.length){node.childNodes[1].className='jstree-anchor '+c;}
if((obj.icon&&obj.icon!==true)||obj.icon===false){if(obj.icon===false){node.childNodes[1].childNodes[0].className+=' jstree-themeicon-hidden';}
else if(obj.icon.indexOf('/')===-1&&obj.icon.indexOf('.')===-1){node.childNodes[1].childNodes[0].className+=' '+obj.icon+' jstree-themeicon-custom';}
else{node.childNodes[1].childNodes[0].style.backgroundImage='url('+obj.icon+')';node.childNodes[1].childNodes[0].style.backgroundPosition='center center';node.childNodes[1].childNodes[0].style.backgroundSize='auto';node.childNodes[1].childNodes[0].className+=' jstree-themeicon-custom';}}
if(this.settings.core.force_text){node.childNodes[1].appendChild(d.createTextNode(obj.text));}
else{node.childNodes[1].innerHTML+=obj.text;}
if(deep&&obj.children.length&&(obj.state.opened||force_render)&&obj.state.loaded){k=d.createElement('UL');k.setAttribute('role','group');k.className='jstree-children';for(i=0,j=obj.children.length;i<j;i++){k.appendChild(this.redraw_node(obj.children[i],deep,true));}
node.appendChild(k);}
if(old){node.appendChild(old);}
if(!is_callback){if(!par){par=this.element[0];}
for(i=0,j=par.childNodes.length;i<j;i++){if(par.childNodes[i]&&par.childNodes[i].className&&par.childNodes[i].className.indexOf('jstree-children')!==-1){tmp=par.childNodes[i];break;}}
if(!tmp){tmp=d.createElement('UL');tmp.setAttribute('role','group');tmp.className='jstree-children';par.appendChild(tmp);}
par=tmp;if(ind<par.childNodes.length){par.insertBefore(node,par.childNodes[ind]);}
else{par.appendChild(node);}
if(f){t=this.element[0].scrollTop;l=this.element[0].scrollLeft;node.childNodes[1].focus();this.element[0].scrollTop=t;this.element[0].scrollLeft=l;}}
if(obj.state.opened&&!obj.state.loaded){obj.state.opened=false;setTimeout($.proxy(function(){this.open_node(obj.id,false,0);},this),0);}
return node;},open_node:function(obj,callback,animation){var t1,t2,d,t;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.open_node(obj[t1],callback,animation);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
animation=animation===undefined?this.settings.core.animation:animation;if(!this.is_closed(obj)){if(callback){callback.call(this,obj,false);}
return false;}
if(!this.is_loaded(obj)){if(this.is_loading(obj)){return setTimeout($.proxy(function(){this.open_node(obj,callback,animation);},this),500);}
this.load_node(obj,function(o,ok){return ok?this.open_node(o,callback,animation):(callback?callback.call(this,o,false):false);});}
else{d=this.get_node(obj,true);t=this;if(d.length){if(animation&&d.children(".jstree-children").length){d.children(".jstree-children").stop(true,true);}
if(obj.children.length&&!this._firstChild(d.children('.jstree-children')[0])){this.draw_children(obj);}
if(!animation){this.trigger('before_open',{"node":obj});d[0].className=d[0].className.replace('jstree-closed','jstree-open');d[0].setAttribute("aria-expanded",true);}
else{this.trigger('before_open',{"node":obj});d
.children(".jstree-children").css("display","none").end()
.removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",true)
.children(".jstree-children").stop(true,true)
.slideDown(animation,function(){this.style.display="";t.trigger("after_open",{"node":obj});});}}
obj.state.opened=true;if(callback){callback.call(this,obj,true);}
if(!d.length){this.trigger('before_open',{"node":obj});}
this.trigger('open_node',{"node":obj});if(!animation||!d.length){this.trigger("after_open",{"node":obj});}}},_open_to:function(obj){obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
var i,j,p=obj.parents;for(i=0,j=p.length;i<j;i+=1){if(i!=='#'){this.open_node(p[i],false,0);}}
return $('#'+obj.id.replace($.jstree.idregex,'\\$&'),this.element);},close_node:function(obj,animation){var t1,t2,t,d;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.close_node(obj[t1],animation);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
if(this.is_closed(obj)){return false;}
animation=animation===undefined?this.settings.core.animation:animation;t=this;d=this.get_node(obj,true);if(d.length){if(!animation){d[0].className=d[0].className.replace('jstree-open','jstree-closed');d.attr("aria-expanded",false).children('.jstree-children').remove();}
else{d
.children(".jstree-children").attr("style","display:block !important").end()
.removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",false)
.children(".jstree-children").stop(true,true).slideUp(animation,function(){this.style.display="";d.children('.jstree-children').remove();t.trigger("after_close",{"node":obj});});}}
obj.state.opened=false;this.trigger('close_node',{"node":obj});if(!animation||!d.length){this.trigger("after_close",{"node":obj});}},toggle_node:function(obj){var t1,t2;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.toggle_node(obj[t1]);}
return true;}
if(this.is_closed(obj)){return this.open_node(obj);}
if(this.is_open(obj)){return this.close_node(obj);}},open_all:function(obj,animation,original_obj){if(!obj){obj='#';}
obj=this.get_node(obj);if(!obj){return false;}
var dom=obj.id==='#'?this.get_container_ul():this.get_node(obj,true),i,j,_this;if(!dom.length){for(i=0,j=obj.children_d.length;i<j;i++){if(this.is_closed(this._model.data[obj.children_d[i]])){this._model.data[obj.children_d[i]].state.opened=true;}}
return this.trigger('open_all',{"node":obj});}
original_obj=original_obj||dom;_this=this;dom=this.is_closed(obj)?dom.find('.jstree-closed').addBack():dom.find('.jstree-closed');dom.each(function(){_this.open_node(this,function(node,status){if(status&&this.is_parent(node)){this.open_all(node,animation,original_obj);}},animation||0);});if(original_obj.find('.jstree-closed').length===0){this.trigger('open_all',{"node":this.get_node(original_obj)});}},close_all:function(obj,animation){if(!obj){obj='#';}
obj=this.get_node(obj);if(!obj){return false;}
var dom=obj.id==='#'?this.get_container_ul():this.get_node(obj,true),_this=this,i,j;if(!dom.length){for(i=0,j=obj.children_d.length;i<j;i++){this._model.data[obj.children_d[i]].state.opened=false;}
return this.trigger('close_all',{"node":obj});}
dom=this.is_open(obj)?dom.find('.jstree-open').addBack():dom.find('.jstree-open');$(dom.get().reverse()).each(function(){_this.close_node(this,animation||0);});this.trigger('close_all',{"node":obj});},is_disabled:function(obj){obj=this.get_node(obj);return obj&&obj.state&&obj.state.disabled;},enable_node:function(obj){var t1,t2;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.enable_node(obj[t1]);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
obj.state.disabled=false;this.get_node(obj,true).children('.jstree-anchor').removeClass('jstree-disabled').attr('aria-disabled',false);this.trigger('enable_node',{'node':obj});},disable_node:function(obj){var t1,t2;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.disable_node(obj[t1]);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
obj.state.disabled=true;this.get_node(obj,true).children('.jstree-anchor').addClass('jstree-disabled').attr('aria-disabled',true);this.trigger('disable_node',{'node':obj});},activate_node:function(obj,e){if(this.is_disabled(obj)){return false;}
this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==undefined?this.get_node(this._data.core.last_clicked.id):null;if(this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected){this._data.core.last_clicked=null;}
if(!this._data.core.last_clicked&&this._data.core.selected.length){this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1]);}
if(!this.settings.core.multiple||(!e.metaKey&&!e.ctrlKey&&!e.shiftKey)||(e.shiftKey&&(!this._data.core.last_clicked||!this.get_parent(obj)||this.get_parent(obj)!==this._data.core.last_clicked.parent))){if(!this.settings.core.multiple&&(e.metaKey||e.ctrlKey||e.shiftKey)&&this.is_selected(obj)){this.deselect_node(obj,false,e);}
else{this.deselect_all(true);this.select_node(obj,false,false,e);this._data.core.last_clicked=this.get_node(obj);}}
else{if(e.shiftKey){var o=this.get_node(obj).id,l=this._data.core.last_clicked.id,p=this.get_node(this._data.core.last_clicked.parent).children,c=false,i,j;for(i=0,j=p.length;i<j;i+=1){if(p[i]===o){c=!c;}
if(p[i]===l){c=!c;}
if(!this.is_disabled(p[i])&&(c||p[i]===o||p[i]===l)){this.select_node(p[i],true,false,e);}
else{this.deselect_node(p[i],true,e);}}
this.trigger('changed',{'action':'select_node','node':this.get_node(obj),'selected':this._data.core.selected,'event':e});}
else{if(!this.is_selected(obj)){this.select_node(obj,false,false,e);}
else{this.deselect_node(obj,false,e);}}}
this.trigger('activate_node',{'node':this.get_node(obj)});},hover_node:function(obj){obj=this.get_node(obj,true);if(!obj||!obj.length||obj.children('.jstree-hovered').length){return false;}
var o=this.element.find('.jstree-hovered'),t=this.element;if(o&&o.length){this.dehover_node(o);}
obj.children('.jstree-anchor').addClass('jstree-hovered');this.trigger('hover_node',{'node':this.get_node(obj)});setTimeout(function(){t.attr('aria-activedescendant',obj[0].id);},0);},dehover_node:function(obj){obj=this.get_node(obj,true);if(!obj||!obj.length||!obj.children('.jstree-hovered').length){return false;}
obj.children('.jstree-anchor').removeClass('jstree-hovered');this.trigger('dehover_node',{'node':this.get_node(obj)});},select_node:function(obj,supress_event,prevent_open,e){var dom,t1,t2,th;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.select_node(obj[t1],supress_event,prevent_open,e);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
dom=this.get_node(obj,true);if(!obj.state.selected){obj.state.selected=true;this._data.core.selected.push(obj.id);if(!prevent_open){dom=this._open_to(obj);}
if(dom&&dom.length){dom.attr('aria-selected',true).children('.jstree-anchor').addClass('jstree-clicked');}
this.trigger('select_node',{'node':obj,'selected':this._data.core.selected,'event':e});if(!supress_event){this.trigger('changed',{'action':'select_node','node':obj,'selected':this._data.core.selected,'event':e});}}},deselect_node:function(obj,supress_event,e){var t1,t2,dom;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.deselect_node(obj[t1],supress_event,e);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
dom=this.get_node(obj,true);if(obj.state.selected){obj.state.selected=false;this._data.core.selected=$.vakata.array_remove_item(this._data.core.selected,obj.id);if(dom.length){dom.attr('aria-selected',false).children('.jstree-anchor').removeClass('jstree-clicked');}
this.trigger('deselect_node',{'node':obj,'selected':this._data.core.selected,'event':e});if(!supress_event){this.trigger('changed',{'action':'deselect_node','node':obj,'selected':this._data.core.selected,'event':e});}}},select_all:function(supress_event){var tmp=this._data.core.selected.concat([]),i,j;this._data.core.selected=this._model.data['#'].children_d.concat();for(i=0,j=this._data.core.selected.length;i<j;i++){if(this._model.data[this._data.core.selected[i]]){this._model.data[this._data.core.selected[i]].state.selected=true;}}
this.redraw(true);this.trigger('select_all',{'selected':this._data.core.selected});if(!supress_event){this.trigger('changed',{'action':'select_all','selected':this._data.core.selected,'old_selection':tmp});}},deselect_all:function(supress_event){var tmp=this._data.core.selected.concat([]),i,j;for(i=0,j=this._data.core.selected.length;i<j;i++){if(this._model.data[this._data.core.selected[i]]){this._model.data[this._data.core.selected[i]].state.selected=false;}}
this._data.core.selected=[];this.element.find('.jstree-clicked').removeClass('jstree-clicked').parent().attr('aria-selected',false);this.trigger('deselect_all',{'selected':this._data.core.selected,'node':tmp});if(!supress_event){this.trigger('changed',{'action':'deselect_all','selected':this._data.core.selected,'old_selection':tmp});}},is_selected:function(obj){obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
return obj.state.selected;},get_selected:function(full){return full?$.map(this._data.core.selected,$.proxy(function(i){return this.get_node(i);},this)):this._data.core.selected.slice();},get_top_selected:function(full){var tmp=this.get_selected(true),obj={},i,j,k,l;for(i=0,j=tmp.length;i<j;i++){obj[tmp[i].id]=tmp[i];}
for(i=0,j=tmp.length;i<j;i++){for(k=0,l=tmp[i].children_d.length;k<l;k++){if(obj[tmp[i].children_d[k]]){delete obj[tmp[i].children_d[k]];}}}
tmp=[];for(i in obj){if(obj.hasOwnProperty(i)){tmp.push(i);}}
return full?$.map(tmp,$.proxy(function(i){return this.get_node(i);},this)):tmp;},get_bottom_selected:function(full){var tmp=this.get_selected(true),obj=[],i,j;for(i=0,j=tmp.length;i<j;i++){if(!tmp[i].children.length){obj.push(tmp[i].id);}}
return full?$.map(obj,$.proxy(function(i){return this.get_node(i);},this)):obj;},get_state:function(){var state={'core':{'open':[],'scroll':{'left':this.element.scrollLeft(),'top':this.element.scrollTop()},'selected':[]}},i;for(i in this._model.data){if(this._model.data.hasOwnProperty(i)){if(i!=='#'){if(this._model.data[i].state.opened){state.core.open.push(i);}
if(this._model.data[i].state.selected){state.core.selected.push(i);}}}}
return state;},set_state:function(state,callback){if(state){if(state.core){var res,n,t,_this,i;if(state.core.open){if(!$.isArray(state.core.open)||!state.core.open.length){delete state.core.open;this.set_state(state,callback);}
else{this._load_nodes(state.core.open,function(nodes){this.open_node(nodes,false,0);delete state.core.open;this.set_state(state,callback);},true);}
return false;}
if(state.core.scroll){if(state.core.scroll&&state.core.scroll.left!==undefined){this.element.scrollLeft(state.core.scroll.left);}
if(state.core.scroll&&state.core.scroll.top!==undefined){this.element.scrollTop(state.core.scroll.top);}
delete state.core.scroll;this.set_state(state,callback);return false;}
if(state.core.selected){_this=this;this.deselect_all();$.each(state.core.selected,function(i,v){_this.select_node(v,false,true);});delete state.core.selected;this.set_state(state,callback);return false;}
for(i in state){if(state.hasOwnProperty(i)&&i!=="core"&&$.inArray(i,this.settings.plugins)===-1){delete state[i];}}
if($.isEmptyObject(state.core)){delete state.core;this.set_state(state,callback);return false;}}
if($.isEmptyObject(state)){state=null;if(callback){callback.call(this);}
this.trigger('set_state');return false;}
return true;}
return false;},refresh:function(skip_loading,forget_state){this._data.core.state=forget_state===true?{}:this.get_state();if(forget_state&&$.isFunction(forget_state)){this._data.core.state=forget_state.call(this,this._data.core.state);}
this._cnt=0;this._model.data={'#':{id:'#',parent:null,parents:[],children:[],children_d:[],state:{loaded:false}}};var c=this.get_container_ul()[0].className;if(!skip_loading){this.element.html("<"+"ul class='"+c+"' role='group'><"+"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><i class='jstree-icon jstree-ocl'></i><"+"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>");this.element.attr('aria-activedescendant','j'+this._id+'_loading');}
this.load_node('#',function(o,s){if(s){this.get_container_ul()[0].className=c;if(this._firstChild(this.get_container_ul()[0])){this.element.attr('aria-activedescendant',this._firstChild(this.get_container_ul()[0]).id);}
this.set_state($.extend(true,{},this._data.core.state),function(){this.trigger('refresh');});}
this._data.core.state=null;});},refresh_node:function(obj){obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
var opened=[],to_load=[],s=this._data.core.selected.concat([]);to_load.push(obj.id);if(obj.state.opened===true){opened.push(obj.id);}
this.get_node(obj,true).find('.jstree-open').each(function(){opened.push(this.id);});this._load_nodes(to_load,$.proxy(function(nodes){this.open_node(opened,false,0);this.select_node(this._data.core.selected);this.trigger('refresh_node',{'node':obj,'nodes':nodes});},this));},set_id:function(obj,id){obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
var i,j,m=this._model.data;id=id.toString();m[obj.parent].children[$.inArray(obj.id,m[obj.parent].children)]=id;for(i=0,j=obj.parents.length;i<j;i++){m[obj.parents[i]].children_d[$.inArray(obj.id,m[obj.parents[i]].children_d)]=id;}
for(i=0,j=obj.children.length;i<j;i++){m[obj.children[i]].parent=id;}
for(i=0,j=obj.children_d.length;i<j;i++){m[obj.children_d[i]].parents[$.inArray(obj.id,m[obj.children_d[i]].parents)]=id;}
i=$.inArray(obj.id,this._data.core.selected);if(i!==-1){this._data.core.selected[i]=id;}
i=this.get_node(obj.id,true);if(i){i.attr('id',id).children('.jstree-anchor').attr('id',id+'_anchor').end().attr('aria-labelledby',id+'_anchor');if(this.element.attr('aria-activedescendant')===obj.id){this.element.attr('aria-activedescendant',id);}}
delete m[obj.id];obj.id=id;obj.li_attr.id=id;m[id]=obj;return true;},get_text:function(obj){obj=this.get_node(obj);return(!obj||obj.id==='#')?false:obj.text;},set_text:function(obj,val){var t1,t2;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.set_text(obj[t1],val);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
obj.text=val;if(this.get_node(obj,true).length){this.redraw_node(obj.id);}
this.trigger('set_text',{"obj":obj,"text":val});return true;},get_json:function(obj,options,flat){obj=this.get_node(obj||'#');if(!obj){return false;}
if(options&&options.flat&&!flat){flat=[];}
var tmp={'id':obj.id,'text':obj.text,'icon':this.get_icon(obj),'li_attr':$.extend(true,{},obj.li_attr),'a_attr':$.extend(true,{},obj.a_attr),'state':{},'data':options&&options.no_data?false:$.extend(true,{},obj.data)
},i,j;if(options&&options.flat){tmp.parent=obj.parent;}
else{tmp.children=[];}
if(!options||!options.no_state){for(i in obj.state){if(obj.state.hasOwnProperty(i)){tmp.state[i]=obj.state[i];}}}
if(options&&options.no_id){delete tmp.id;if(tmp.li_attr&&tmp.li_attr.id){delete tmp.li_attr.id;}
if(tmp.a_attr&&tmp.a_attr.id){delete tmp.a_attr.id;}}
if(options&&options.flat&&obj.id!=='#'){flat.push(tmp);}
if(!options||!options.no_children){for(i=0,j=obj.children.length;i<j;i++){if(options&&options.flat){this.get_json(obj.children[i],options,flat);}
else{tmp.children.push(this.get_json(obj.children[i],options));}}}
return options&&options.flat?flat:(obj.id==='#'?tmp.children:tmp);},create_node:function(par,node,pos,callback,is_loaded){if(par===null){par="#";}
par=this.get_node(par);if(!par){return false;}
pos=pos===undefined?"last":pos;if(!pos.toString().match(/^(before|after)$/)&&!is_loaded&&!this.is_loaded(par)){return this.load_node(par,function(){this.create_node(par,node,pos,callback,true);});}
if(!node){node={"text":this.get_string('New node')};}
if(typeof node==="string"){node={"text":node};}
if(node.text===undefined){node.text=this.get_string('New node');}
var tmp,dpc,i,j;if(par.id==='#'){if(pos==="before"){pos="first";}
if(pos==="after"){pos="last";}}
switch(pos){case"before":tmp=this.get_node(par.parent);pos=$.inArray(par.id,tmp.children);par=tmp;break;case"after":tmp=this.get_node(par.parent);pos=$.inArray(par.id,tmp.children)+1;par=tmp;break;case"inside":case"first":pos=0;break;case"last":pos=par.children.length;break;default:if(!pos){pos=0;}
break;}
if(pos>par.children.length){pos=par.children.length;}
if(!node.id){node.id=true;}
if(!this.check("create_node",node,par,pos)){this.settings.core.error.call(this,this._data.core.last_error);return false;}
if(node.id===true){delete node.id;}
node=this._parse_model_from_json(node,par.id,par.parents.concat());if(!node){return false;}
tmp=this.get_node(node);dpc=[];dpc.push(node);dpc=dpc.concat(tmp.children_d);this.trigger('model',{"nodes":dpc,"parent":par.id});par.children_d=par.children_d.concat(dpc);for(i=0,j=par.parents.length;i<j;i++){this._model.data[par.parents[i]].children_d=this._model.data[par.parents[i]].children_d.concat(dpc);}
node=tmp;tmp=[];for(i=0,j=par.children.length;i<j;i++){tmp[i>=pos?i+1:i]=par.children[i];}
tmp[pos]=node.id;par.children=tmp;this.redraw_node(par,true);if(callback){callback.call(this,this.get_node(node));}
this.trigger('create_node',{"node":this.get_node(node),"parent":par.id,"position":pos});return node.id;},rename_node:function(obj,val){var t1,t2,old;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.rename_node(obj[t1],val);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
old=obj.text;if(!this.check("rename_node",obj,this.get_parent(obj),val)){this.settings.core.error.call(this,this._data.core.last_error);return false;}
this.set_text(obj,val);this.trigger('rename_node',{"node":obj,"text":val,"old":old});return true;},delete_node:function(obj){var t1,t2,par,pos,tmp,i,j,k,l,c;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.delete_node(obj[t1]);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
par=this.get_node(obj.parent);pos=$.inArray(obj.id,par.children);c=false;if(!this.check("delete_node",obj,par,pos)){this.settings.core.error.call(this,this._data.core.last_error);return false;}
if(pos!==-1){par.children=$.vakata.array_remove(par.children,pos);}
tmp=obj.children_d.concat([]);tmp.push(obj.id);for(k=0,l=tmp.length;k<l;k++){for(i=0,j=obj.parents.length;i<j;i++){pos=$.inArray(tmp[k],this._model.data[obj.parents[i]].children_d);if(pos!==-1){this._model.data[obj.parents[i]].children_d=$.vakata.array_remove(this._model.data[obj.parents[i]].children_d,pos);}}
if(this._model.data[tmp[k]].state.selected){c=true;pos=$.inArray(tmp[k],this._data.core.selected);if(pos!==-1){this._data.core.selected=$.vakata.array_remove(this._data.core.selected,pos);}}}
this.trigger('delete_node',{"node":obj,"parent":par.id});if(c){this.trigger('changed',{'action':'delete_node','node':obj,'selected':this._data.core.selected,'parent':par.id});}
for(k=0,l=tmp.length;k<l;k++){delete this._model.data[tmp[k]];}
this.redraw_node(par,true);return true;},check:function(chk,obj,par,pos,more){obj=obj&&obj.id?obj:this.get_node(obj);par=par&&par.id?par:this.get_node(par);var tmp=chk.match(/^move_node|copy_node|create_node$/i)?par:obj,chc=this.settings.core.check_callback;if(chk==="move_node"||chk==="copy_node"){if((!more||!more.is_multi)&&(obj.id===par.id||$.inArray(obj.id,par.children)===pos||$.inArray(par.id,obj.children_d)!==-1)){this._data.core.last_error={'error':'check','plugin':'core','id':'core_01','reason':'Moving parent inside child','data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};return false;}}
if(tmp&&tmp.data){tmp=tmp.data;}
if(tmp&&tmp.functions&&(tmp.functions[chk]===false||tmp.functions[chk]===true)){if(tmp.functions[chk]===false){this._data.core.last_error={'error':'check','plugin':'core','id':'core_02','reason':'Node data prevents function: '+chk,'data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};}
return tmp.functions[chk];}
if(chc===false||($.isFunction(chc)&&chc.call(this,chk,obj,par,pos,more)===false)||(chc&&chc[chk]===false)){this._data.core.last_error={'error':'check','plugin':'core','id':'core_03','reason':'User config for core.check_callback prevents function: '+chk,'data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};return false;}
return true;},last_error:function(){return this._data.core.last_error;},move_node:function(obj,par,pos,callback,is_loaded,skip_redraw,origin){var t1,t2,old_par,old_pos,new_par,old_ins,is_multi,dpc,tmp,i,j,k,l,p;par=this.get_node(par);pos=pos===undefined?0:pos;if(!par){return false;}
if(!pos.toString().match(/^(before|after)$/)&&!is_loaded&&!this.is_loaded(par)){return this.load_node(par,function(){this.move_node(obj,par,pos,callback,true,false,origin);});}
if($.isArray(obj)){if(obj.length===1){obj=obj[0];}
else{for(t1=0,t2=obj.length;t1<t2;t1++){if((tmp=this.move_node(obj[t1],par,pos,callback,is_loaded,false,origin))){par=tmp;pos="after";}}
this.redraw();return true;}}
obj=obj&&obj.id?obj:this.get_node(obj);if(!obj||obj.id==='#'){return false;}
old_par=(obj.parent||'#').toString();new_par=(!pos.toString().match(/^(before|after)$/)||par.id==='#')?par:this.get_node(par.parent);old_ins=origin?origin:(this._model.data[obj.id]?this:$.jstree.reference(obj.id));is_multi=!old_ins||!old_ins._id||(this._id!==old_ins._id);old_pos=old_ins&&old_ins._id&&old_par&&old_ins._model.data[old_par]&&old_ins._model.data[old_par].children?$.inArray(obj.id,old_ins._model.data[old_par].children):-1;if(old_ins&&old_ins._id){obj=old_ins._model.data[obj.id];}
if(is_multi){if((tmp=this.copy_node(obj,par,pos,callback,is_loaded,false,origin))){if(old_ins){old_ins.delete_node(obj);}
return tmp;}
return false;}
if(par.id==='#'){if(pos==="before"){pos="first";}
if(pos==="after"){pos="last";}}
switch(pos){case"before":pos=$.inArray(par.id,new_par.children);break;case"after":pos=$.inArray(par.id,new_par.children)+1;break;case"inside":case"first":pos=0;break;case"last":pos=new_par.children.length;break;default:if(!pos){pos=0;}
break;}
if(pos>new_par.children.length){pos=new_par.children.length;}
if(!this.check("move_node",obj,new_par,pos,{'core':true,'origin':origin,'is_multi':(old_ins&&old_ins._id&&old_ins._id!==this._id),'is_foreign':(!old_ins||!old_ins._id)})){this.settings.core.error.call(this,this._data.core.last_error);return false;}
if(obj.parent===new_par.id){dpc=new_par.children.concat();tmp=$.inArray(obj.id,dpc);if(tmp!==-1){dpc=$.vakata.array_remove(dpc,tmp);if(pos>tmp){pos--;}}
tmp=[];for(i=0,j=dpc.length;i<j;i++){tmp[i>=pos?i+1:i]=dpc[i];}
tmp[pos]=obj.id;new_par.children=tmp;this._node_changed(new_par.id);this.redraw(new_par.id==='#');}
else{tmp=obj.children_d.concat();tmp.push(obj.id);for(i=0,j=obj.parents.length;i<j;i++){dpc=[];p=old_ins._model.data[obj.parents[i]].children_d;for(k=0,l=p.length;k<l;k++){if($.inArray(p[k],tmp)===-1){dpc.push(p[k]);}}
old_ins._model.data[obj.parents[i]].children_d=dpc;}
old_ins._model.data[old_par].children=$.vakata.array_remove_item(old_ins._model.data[old_par].children,obj.id);for(i=0,j=new_par.parents.length;i<j;i++){this._model.data[new_par.parents[i]].children_d=this._model.data[new_par.parents[i]].children_d.concat(tmp);}
dpc=[];for(i=0,j=new_par.children.length;i<j;i++){dpc[i>=pos?i+1:i]=new_par.children[i];}
dpc[pos]=obj.id;new_par.children=dpc;new_par.children_d.push(obj.id);new_par.children_d=new_par.children_d.concat(obj.children_d);obj.parent=new_par.id;tmp=new_par.parents.concat();tmp.unshift(new_par.id);p=obj.parents.length;obj.parents=tmp;tmp=tmp.concat();for(i=0,j=obj.children_d.length;i<j;i++){this._model.data[obj.children_d[i]].parents=this._model.data[obj.children_d[i]].parents.slice(0,p*-1);Array.prototype.push.apply(this._model.data[obj.children_d[i]].parents,tmp);}
if(old_par==='#'||new_par.id==='#'){this._model.force_full_redraw=true;}
if(!this._model.force_full_redraw){this._node_changed(old_par);this._node_changed(new_par.id);}
if(!skip_redraw){this.redraw();}}
if(callback){callback.call(this,obj,new_par,pos);}
this.trigger('move_node',{"node":obj,"parent":new_par.id,"position":pos,"old_parent":old_par,"old_position":old_pos,'is_multi':(old_ins&&old_ins._id&&old_ins._id!==this._id),'is_foreign':(!old_ins||!old_ins._id),'old_instance':old_ins,'new_instance':this});return obj.id;},copy_node:function(obj,par,pos,callback,is_loaded,skip_redraw,origin){var t1,t2,dpc,tmp,i,j,node,old_par,new_par,old_ins,is_multi;par=this.get_node(par);pos=pos===undefined?0:pos;if(!par){return false;}
if(!pos.toString().match(/^(before|after)$/)&&!is_loaded&&!this.is_loaded(par)){return this.load_node(par,function(){this.copy_node(obj,par,pos,callback,true,false,origin);});}
if($.isArray(obj)){if(obj.length===1){obj=obj[0];}
else{for(t1=0,t2=obj.length;t1<t2;t1++){if((tmp=this.copy_node(obj[t1],par,pos,callback,is_loaded,true,origin))){par=tmp;pos="after";}}
this.redraw();return true;}}
obj=obj&&obj.id?obj:this.get_node(obj);if(!obj||obj.id==='#'){return false;}
old_par=(obj.parent||'#').toString();new_par=(!pos.toString().match(/^(before|after)$/)||par.id==='#')?par:this.get_node(par.parent);old_ins=origin?origin:(this._model.data[obj.id]?this:$.jstree.reference(obj.id));is_multi=!old_ins||!old_ins._id||(this._id!==old_ins._id);if(old_ins&&old_ins._id){obj=old_ins._model.data[obj.id];}
if(par.id==='#'){if(pos==="before"){pos="first";}
if(pos==="after"){pos="last";}}
switch(pos){case"before":pos=$.inArray(par.id,new_par.children);break;case"after":pos=$.inArray(par.id,new_par.children)+1;break;case"inside":case"first":pos=0;break;case"last":pos=new_par.children.length;break;default:if(!pos){pos=0;}
break;}
if(pos>new_par.children.length){pos=new_par.children.length;}
if(!this.check("copy_node",obj,new_par,pos,{'core':true,'origin':origin,'is_multi':(old_ins&&old_ins._id&&old_ins._id!==this._id),'is_foreign':(!old_ins||!old_ins._id)})){this.settings.core.error.call(this,this._data.core.last_error);return false;}
node=old_ins?old_ins.get_json(obj,{no_id:true,no_data:true,no_state:true}):obj;if(!node){return false;}
if(node.id===true){delete node.id;}
node=this._parse_model_from_json(node,new_par.id,new_par.parents.concat());if(!node){return false;}
tmp=this.get_node(node);if(obj&&obj.state&&obj.state.loaded===false){tmp.state.loaded=false;}
dpc=[];dpc.push(node);dpc=dpc.concat(tmp.children_d);this.trigger('model',{"nodes":dpc,"parent":new_par.id});for(i=0,j=new_par.parents.length;i<j;i++){this._model.data[new_par.parents[i]].children_d=this._model.data[new_par.parents[i]].children_d.concat(dpc);}
dpc=[];for(i=0,j=new_par.children.length;i<j;i++){dpc[i>=pos?i+1:i]=new_par.children[i];}
dpc[pos]=tmp.id;new_par.children=dpc;new_par.children_d.push(tmp.id);new_par.children_d=new_par.children_d.concat(tmp.children_d);if(new_par.id==='#'){this._model.force_full_redraw=true;}
if(!this._model.force_full_redraw){this._node_changed(new_par.id);}
if(!skip_redraw){this.redraw(new_par.id==='#');}
if(callback){callback.call(this,tmp,new_par,pos);}
this.trigger('copy_node',{"node":tmp,"original":obj,"parent":new_par.id,"position":pos,"old_parent":old_par,"old_position":old_ins&&old_ins._id&&old_par&&old_ins._model.data[old_par]&&old_ins._model.data[old_par].children?$.inArray(obj.id,old_ins._model.data[old_par].children):-1,'is_multi':(old_ins&&old_ins._id&&old_ins._id!==this._id),'is_foreign':(!old_ins||!old_ins._id),'old_instance':old_ins,'new_instance':this});return tmp.id;},cut:function(obj){if(!obj){obj=this._data.core.selected.concat();}
if(!$.isArray(obj)){obj=[obj];}
if(!obj.length){return false;}
var tmp=[],o,t1,t2;for(t1=0,t2=obj.length;t1<t2;t1++){o=this.get_node(obj[t1]);if(o&&o.id&&o.id!=='#'){tmp.push(o);}}
if(!tmp.length){return false;}
ccp_node=tmp;ccp_inst=this;ccp_mode='move_node';this.trigger('cut',{"node":obj});},copy:function(obj){if(!obj){obj=this._data.core.selected.concat();}
if(!$.isArray(obj)){obj=[obj];}
if(!obj.length){return false;}
var tmp=[],o,t1,t2;for(t1=0,t2=obj.length;t1<t2;t1++){o=this.get_node(obj[t1]);if(o&&o.id&&o.id!=='#'){tmp.push(o);}}
if(!tmp.length){return false;}
ccp_node=tmp;ccp_inst=this;ccp_mode='copy_node';this.trigger('copy',{"node":obj});},get_buffer:function(){return{'mode':ccp_mode,'node':ccp_node,'inst':ccp_inst};},can_paste:function(){return ccp_mode!==false&&ccp_node!==false;},paste:function(obj,pos){obj=this.get_node(obj);if(!obj||!ccp_mode||!ccp_mode.match(/^(copy_node|move_node)$/)||!ccp_node){return false;}
if(this[ccp_mode](ccp_node,obj,pos,false,false,false,ccp_inst)){this.trigger('paste',{"parent":obj.id,"node":ccp_node,"mode":ccp_mode});}
ccp_node=false;ccp_mode=false;ccp_inst=false;},clear_buffer:function(){ccp_node=false;ccp_mode=false;ccp_inst=false;this.trigger('clear_buffer');},edit:function(obj,default_text,callback){var rtl,w,a,s,t,h1,h2,fn,tmp;obj=this.get_node(obj);if(!obj){return false;}
if(this.settings.core.check_callback===false){this._data.core.last_error={'error':'check','plugin':'core','id':'core_07','reason':'Could not edit node because of check_callback'};this.settings.core.error.call(this,this._data.core.last_error);return false;}
tmp=obj;default_text=typeof default_text==='string'?default_text:obj.text;this.set_text(obj,"");obj=this._open_to(obj);tmp.text=default_text;rtl=this._data.core.rtl;w=this.element.width();a=obj.children('.jstree-anchor');s=$('<span>');t=default_text;h1=$("<"+"div />",{css:{"position":"absolute","top":"-200px","left":(rtl?"0px":"-1000px"),"visibility":"hidden"}}).appendTo("body");h2=$("<"+"input />",{"value":t,"class":"jstree-rename-input","css":{"padding":"0","border":"1px solid silver","box-sizing":"border-box","display":"inline-block","height":(this._data.core.li_height)+"px","lineHeight":(this._data.core.li_height)+"px","width":"150px"},"blur":$.proxy(function(){var i=s.children(".jstree-rename-input"),v=i.val(),f=this.settings.core.force_text,nv;if(v===""){v=t;}
h1.remove();s.replaceWith(a);s.remove();t=f?t:$('<div></div>').append($.parseHTML(t)).html();this.set_text(obj,t);nv=!!this.rename_node(obj,f?$('<div></div>').text(v).text():$('<div></div>').append($.parseHTML(v)).html());if(!nv){this.set_text(obj,t);}
if(callback){callback.call(this,tmp,nv);}},this),"keydown":function(event){var key=event.which;if(key===27){this.value=t;}
if(key===27||key===13||key===37||key===38||key===39||key===40||key===32){event.stopImmediatePropagation();}
if(key===27||key===13){event.preventDefault();this.blur();}},"click":function(e){e.stopImmediatePropagation();},"mousedown":function(e){e.stopImmediatePropagation();},"keyup":function(event){h2.width(Math.min(h1.text("pW"+this.value).width(),w));},"keypress":function(event){if(event.which===13){return false;}}});fn={fontFamily:a.css('fontFamily')||'',fontSize:a.css('fontSize')||'',fontWeight:a.css('fontWeight')||'',fontStyle:a.css('fontStyle')||'',fontStretch:a.css('fontStretch')||'',fontVariant:a.css('fontVariant')||'',letterSpacing:a.css('letterSpacing')||'',wordSpacing:a.css('wordSpacing')||''};s.attr('class',a.attr('class')).append(a.contents().clone()).append(h2);a.replaceWith(s);h1.css(fn);h2.css(fn).width(Math.min(h1.text("pW"+h2[0].value).width(),w))[0].select();},set_theme:function(theme_name,theme_url){if(!theme_name){return false;}
if(theme_url===true){var dir=this.settings.core.themes.dir;if(!dir){dir=$.jstree.path+'/themes';}
theme_url=dir+'/'+theme_name+'/style.css';}
if(theme_url&&$.inArray(theme_url,themes_loaded)===-1){$('head').append('<'+'link rel="stylesheet" href="'+theme_url+'" type="text/css" />');themes_loaded.push(theme_url);}
if(this._data.core.themes.name){this.element.removeClass('jstree-'+this._data.core.themes.name);}
this._data.core.themes.name=theme_name;this.element.addClass('jstree-'+theme_name);this.element[this.settings.core.themes.responsive?'addClass':'removeClass']('jstree-'+theme_name+'-responsive');this.trigger('set_theme',{'theme':theme_name});},get_theme:function(){return this._data.core.themes.name;},set_theme_variant:function(variant_name){if(this._data.core.themes.variant){this.element.removeClass('jstree-'+this._data.core.themes.name+'-'+this._data.core.themes.variant);}
this._data.core.themes.variant=variant_name;if(variant_name){this.element.addClass('jstree-'+this._data.core.themes.name+'-'+this._data.core.themes.variant);}},get_theme_variant:function(){return this._data.core.themes.variant;},show_stripes:function(){this._data.core.themes.stripes=true;this.get_container_ul().addClass("jstree-striped");},hide_stripes:function(){this._data.core.themes.stripes=false;this.get_container_ul().removeClass("jstree-striped");},toggle_stripes:function(){if(this._data.core.themes.stripes){this.hide_stripes();}else{this.show_stripes();}},show_dots:function(){this._data.core.themes.dots=true;this.get_container_ul().removeClass("jstree-no-dots");},hide_dots:function(){this._data.core.themes.dots=false;this.get_container_ul().addClass("jstree-no-dots");},toggle_dots:function(){if(this._data.core.themes.dots){this.hide_dots();}else{this.show_dots();}},show_icons:function(){this._data.core.themes.icons=true;this.get_container_ul().removeClass("jstree-no-icons");},hide_icons:function(){this._data.core.themes.icons=false;this.get_container_ul().addClass("jstree-no-icons");},toggle_icons:function(){if(this._data.core.themes.icons){this.hide_icons();}else{this.show_icons();}},set_icon:function(obj,icon){var t1,t2,dom,old;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.set_icon(obj[t1],icon);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
old=obj.icon;obj.icon=icon===true||icon===null||icon===undefined||icon===''?true:icon;dom=this.get_node(obj,true).children(".jstree-anchor").children(".jstree-themeicon");if(icon===false){this.hide_icon(obj);}
else if(icon===true||icon===null||icon===undefined||icon===''){dom.removeClass('jstree-themeicon-custom '+old).css("background","").removeAttr("rel");if(old===false){this.show_icon(obj);}}
else if(icon.indexOf("/")===-1&&icon.indexOf(".")===-1){dom.removeClass(old).css("background","");dom.addClass(icon+' jstree-themeicon-custom').attr("rel",icon);if(old===false){this.show_icon(obj);}}
else{dom.removeClass(old).css("background","");dom.addClass('jstree-themeicon-custom').css("background","url('"+icon+"') center center no-repeat").attr("rel",icon);if(old===false){this.show_icon(obj);}}
return true;},get_icon:function(obj){obj=this.get_node(obj);return(!obj||obj.id==='#')?false:obj.icon;},hide_icon:function(obj){var t1,t2;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.hide_icon(obj[t1]);}
return true;}
obj=this.get_node(obj);if(!obj||obj==='#'){return false;}
obj.icon=false;this.get_node(obj,true).children(".jstree-anchor").children(".jstree-themeicon").addClass('jstree-themeicon-hidden');return true;},show_icon:function(obj){var t1,t2,dom;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.show_icon(obj[t1]);}
return true;}
obj=this.get_node(obj);if(!obj||obj==='#'){return false;}
dom=this.get_node(obj,true);obj.icon=dom.length?dom.children(".jstree-anchor").children(".jstree-themeicon").attr('rel'):true;if(!obj.icon){obj.icon=true;}
dom.children(".jstree-anchor").children(".jstree-themeicon").removeClass('jstree-themeicon-hidden');return true;}};$.vakata={};$.vakata.attributes=function(node,with_values){node=$(node)[0];var attr=with_values?{}:[];if(node&&node.attributes){$.each(node.attributes,function(i,v){if($.inArray(v.name.toLowerCase(),['style','contenteditable','hasfocus','tabindex'])!==-1){return;}
if(v.value!==null&&$.trim(v.value)!==''){if(with_values){attr[v.name]=v.value;}
else{attr.push(v.name);}}});}
return attr;};$.vakata.array_unique=function(array){var a=[],i,j,l,o={};for(i=0,l=array.length;i<l;i++){if(o[array[i]]===undefined){a.push(array[i]);o[array[i]]=true;}}
return a;};$.vakata.array_remove=function(array,from,to){var rest=array.slice((to||from)+1||array.length);array.length=from<0?array.length+from:from;array.push.apply(array,rest);return array;};$.vakata.array_remove_item=function(array,item){var tmp=$.inArray(item,array);return tmp!==-1?$.vakata.array_remove(array,tmp):array;};var _i=document.createElement('I');_i.className='jstree-icon jstree-checkbox';_i.setAttribute('role','presentation');$.jstree.defaults.checkbox={visible:true,three_state:true,whole_node:true,keep_selected_style:true,cascade:'',tie_selection:true};$.jstree.plugins.checkbox=function(options,parent){this.bind=function(){parent.bind.call(this);this._data.checkbox.uto=false;this._data.checkbox.selected=[];if(this.settings.checkbox.three_state){this.settings.checkbox.cascade='up+down+undetermined';}
this.element
.on("init.jstree",$.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible;if(!this.settings.checkbox.keep_selected_style){this.element.addClass('jstree-checkbox-no-clicked');}
if(this.settings.checkbox.tie_selection){this.element.addClass('jstree-checkbox-selection');}},this))
.on("loading.jstree",$.proxy(function(){this[this._data.checkbox.visible?'show_checkboxes':'hide_checkboxes']();},this));if(this.settings.checkbox.cascade.indexOf('undetermined')!==-1){this.element
.on('changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree',$.proxy(function(){if(this._data.checkbox.uto){clearTimeout(this._data.checkbox.uto);}
this._data.checkbox.uto=setTimeout($.proxy(this._undetermined,this),50);},this));}
if(!this.settings.checkbox.tie_selection){this.element
.on('model.jstree',$.proxy(function(e,data){var m=this._model.data,p=m[data.parent],dpc=data.nodes,i,j;for(i=0,j=dpc.length;i<j;i++){m[dpc[i]].state.checked=(m[dpc[i]].original&&m[dpc[i]].original.state&&m[dpc[i]].original.state.checked);if(m[dpc[i]].state.checked){this._data.checkbox.selected.push(dpc[i]);}}},this));}
if(this.settings.checkbox.cascade.indexOf('up')!==-1||this.settings.checkbox.cascade.indexOf('down')!==-1){this.element
.on('model.jstree',$.proxy(function(e,data){var m=this._model.data,p=m[data.parent],dpc=data.nodes,chd=[],c,i,j,k,l,tmp,s=this.settings.checkbox.cascade,t=this.settings.checkbox.tie_selection;if(s.indexOf('down')!==-1){if(p.state[t?'selected':'checked']){for(i=0,j=dpc.length;i<j;i++){m[dpc[i]].state[t?'selected':'checked']=true;}
this._data[t?'core':'checkbox'].selected=this._data[t?'core':'checkbox'].selected.concat(dpc);}
else{for(i=0,j=dpc.length;i<j;i++){if(m[dpc[i]].state[t?'selected':'checked']){for(k=0,l=m[dpc[i]].children_d.length;k<l;k++){m[m[dpc[i]].children_d[k]].state[t?'selected':'checked']=true;}
this._data[t?'core':'checkbox'].selected=this._data[t?'core':'checkbox'].selected.concat(m[dpc[i]].children_d);}}}}
if(s.indexOf('up')!==-1){for(i=0,j=p.children_d.length;i<j;i++){if(!m[p.children_d[i]].children.length){chd.push(m[p.children_d[i]].parent);}}
chd=$.vakata.array_unique(chd);for(k=0,l=chd.length;k<l;k++){p=m[chd[k]];while(p&&p.id!=='#'){c=0;for(i=0,j=p.children.length;i<j;i++){c+=m[p.children[i]].state[t?'selected':'checked'];}
if(c===j){p.state[t?'selected':'checked']=true;this._data[t?'core':'checkbox'].selected.push(p.id);tmp=this.get_node(p,true);if(tmp&&tmp.length){tmp.attr('aria-selected',true).children('.jstree-anchor').addClass(t?'jstree-clicked':'jstree-checked');}}
else{break;}
p=this.get_node(p.parent);}}}
this._data[t?'core':'checkbox'].selected=$.vakata.array_unique(this._data[t?'core':'checkbox'].selected);},this))
.on(this.settings.checkbox.tie_selection?'select_node.jstree':'check_node.jstree',$.proxy(function(e,data){var obj=data.node,m=this._model.data,par=this.get_node(obj.parent),dom=this.get_node(obj,true),i,j,c,tmp,s=this.settings.checkbox.cascade,t=this.settings.checkbox.tie_selection;if(s.indexOf('down')!==-1){this._data[t?'core':'checkbox'].selected=$.vakata.array_unique(this._data[t?'core':'checkbox'].selected.concat(obj.children_d));for(i=0,j=obj.children_d.length;i<j;i++){tmp=m[obj.children_d[i]];tmp.state[t?'selected':'checked']=true;if(tmp&&tmp.original&&tmp.original.state&&tmp.original.state.undetermined){tmp.original.state.undetermined=false;}}}
if(s.indexOf('up')!==-1){while(par&&par.id!=='#'){c=0;for(i=0,j=par.children.length;i<j;i++){c+=m[par.children[i]].state[t?'selected':'checked'];}
if(c===j){par.state[t?'selected':'checked']=true;this._data[t?'core':'checkbox'].selected.push(par.id);tmp=this.get_node(par,true);if(tmp&&tmp.length){tmp.attr('aria-selected',true).children('.jstree-anchor').addClass(t?'jstree-clicked':'jstree-checked');}}
else{break;}
par=this.get_node(par.parent);}}
if(s.indexOf('down')!==-1&&dom.length){dom.find('.jstree-anchor').addClass(t?'jstree-clicked':'jstree-checked').parent().attr('aria-selected',true);}},this))
.on(this.settings.checkbox.tie_selection?'deselect_all.jstree':'uncheck_all.jstree',$.proxy(function(e,data){var obj=this.get_node('#'),m=this._model.data,i,j,tmp;for(i=0,j=obj.children_d.length;i<j;i++){tmp=m[obj.children_d[i]];if(tmp&&tmp.original&&tmp.original.state&&tmp.original.state.undetermined){tmp.original.state.undetermined=false;}}},this))
.on(this.settings.checkbox.tie_selection?'deselect_node.jstree':'uncheck_node.jstree',$.proxy(function(e,data){var obj=data.node,dom=this.get_node(obj,true),i,j,tmp,s=this.settings.checkbox.cascade,t=this.settings.checkbox.tie_selection;if(obj&&obj.original&&obj.original.state&&obj.original.state.undetermined){obj.original.state.undetermined=false;}
if(s.indexOf('down')!==-1){for(i=0,j=obj.children_d.length;i<j;i++){tmp=this._model.data[obj.children_d[i]];tmp.state[t?'selected':'checked']=false;if(tmp&&tmp.original&&tmp.original.state&&tmp.original.state.undetermined){tmp.original.state.undetermined=false;}}}
if(s.indexOf('up')!==-1){for(i=0,j=obj.parents.length;i<j;i++){tmp=this._model.data[obj.parents[i]];tmp.state[t?'selected':'checked']=false;if(tmp&&tmp.original&&tmp.original.state&&tmp.original.state.undetermined){tmp.original.state.undetermined=false;}
tmp=this.get_node(obj.parents[i],true);if(tmp&&tmp.length){tmp.attr('aria-selected',false).children('.jstree-anchor').removeClass(t?'jstree-clicked':'jstree-checked');}}}
tmp=[];for(i=0,j=this._data[t?'core':'checkbox'].selected.length;i<j;i++){if((s.indexOf('down')===-1||$.inArray(this._data[t?'core':'checkbox'].selected[i],obj.children_d)===-1)&&(s.indexOf('up')===-1||$.inArray(this._data[t?'core':'checkbox'].selected[i],obj.parents)===-1)){tmp.push(this._data[t?'core':'checkbox'].selected[i]);}}
this._data[t?'core':'checkbox'].selected=$.vakata.array_unique(tmp);if(s.indexOf('down')!==-1&&dom.length){dom.find('.jstree-anchor').removeClass(t?'jstree-clicked':'jstree-checked').parent().attr('aria-selected',false);}},this));}
if(this.settings.checkbox.cascade.indexOf('up')!==-1){this.element
.on('delete_node.jstree',$.proxy(function(e,data){var p=this.get_node(data.parent),m=this._model.data,i,j,c,tmp,t=this.settings.checkbox.tie_selection;while(p&&p.id!=='#'){c=0;for(i=0,j=p.children.length;i<j;i++){c+=m[p.children[i]].state[t?'selected':'checked'];}
if(c===j){p.state[t?'selected':'checked']=true;this._data[t?'core':'checkbox'].selected.push(p.id);tmp=this.get_node(p,true);if(tmp&&tmp.length){tmp.attr('aria-selected',true).children('.jstree-anchor').addClass(t?'jstree-clicked':'jstree-checked');}}
else{break;}
p=this.get_node(p.parent);}},this))
.on('move_node.jstree',$.proxy(function(e,data){var is_multi=data.is_multi,old_par=data.old_parent,new_par=this.get_node(data.parent),m=this._model.data,p,c,i,j,tmp,t=this.settings.checkbox.tie_selection;if(!is_multi){p=this.get_node(old_par);while(p&&p.id!=='#'){c=0;for(i=0,j=p.children.length;i<j;i++){c+=m[p.children[i]].state[t?'selected':'checked'];}
if(c===j){p.state[t?'selected':'checked']=true;this._data[t?'core':'checkbox'].selected.push(p.id);tmp=this.get_node(p,true);if(tmp&&tmp.length){tmp.attr('aria-selected',true).children('.jstree-anchor').addClass(t?'jstree-clicked':'jstree-checked');}}
else{break;}
p=this.get_node(p.parent);}}
p=new_par;while(p&&p.id!=='#'){c=0;for(i=0,j=p.children.length;i<j;i++){c+=m[p.children[i]].state[t?'selected':'checked'];}
if(c===j){if(!p.state[t?'selected':'checked']){p.state[t?'selected':'checked']=true;this._data[t?'core':'checkbox'].selected.push(p.id);tmp=this.get_node(p,true);if(tmp&&tmp.length){tmp.attr('aria-selected',true).children('.jstree-anchor').addClass(t?'jstree-clicked':'jstree-checked');}}}
else{if(p.state[t?'selected':'checked']){p.state[t?'selected':'checked']=false;this._data[t?'core':'checkbox'].selected=$.vakata.array_remove_item(this._data[t?'core':'checkbox'].selected,p.id);tmp=this.get_node(p,true);if(tmp&&tmp.length){tmp.attr('aria-selected',false).children('.jstree-anchor').removeClass(t?'jstree-clicked':'jstree-checked');}}
else{break;}}
p=this.get_node(p.parent);}},this));}};this._undetermined=function(){if(this.element===null){return;}
var i,j,k,l,o={},m=this._model.data,t=this.settings.checkbox.tie_selection,s=this._data[t?'core':'checkbox'].selected,p=[],tt=this;for(i=0,j=s.length;i<j;i++){if(m[s[i]]&&m[s[i]].parents){for(k=0,l=m[s[i]].parents.length;k<l;k++){if(o[m[s[i]].parents[k]]===undefined&&m[s[i]].parents[k]!=='#'){o[m[s[i]].parents[k]]=true;p.push(m[s[i]].parents[k]);}}}}
this.element.find('.jstree-closed').not(':has(.jstree-children)')
.each(function(){var tmp=tt.get_node(this),tmp2;if(!tmp.state.loaded){if(tmp.original&&tmp.original.state&&tmp.original.state.undetermined&&tmp.original.state.undetermined===true){if(o[tmp.id]===undefined&&tmp.id!=='#'){o[tmp.id]=true;p.push(tmp.id);}
for(k=0,l=tmp.parents.length;k<l;k++){if(o[tmp.parents[k]]===undefined&&tmp.parents[k]!=='#'){o[tmp.parents[k]]=true;p.push(tmp.parents[k]);}}}}
else{for(i=0,j=tmp.children_d.length;i<j;i++){tmp2=m[tmp.children_d[i]];if(!tmp2.state.loaded&&tmp2.original&&tmp2.original.state&&tmp2.original.state.undetermined&&tmp2.original.state.undetermined===true){if(o[tmp2.id]===undefined&&tmp2.id!=='#'){o[tmp2.id]=true;p.push(tmp2.id);}
for(k=0,l=tmp2.parents.length;k<l;k++){if(o[tmp2.parents[k]]===undefined&&tmp2.parents[k]!=='#'){o[tmp2.parents[k]]=true;p.push(tmp2.parents[k]);}}}}}});this.element.find('.jstree-undetermined').removeClass('jstree-undetermined');for(i=0,j=p.length;i<j;i++){if(!m[p[i]].state[t?'selected':'checked']){s=this.get_node(p[i],true);if(s&&s.length){s.children('.jstree-anchor').children('.jstree-checkbox').addClass('jstree-undetermined');}}}};this.redraw_node=function(obj,deep,is_callback,force_render){obj=parent.redraw_node.apply(this,arguments);if(obj){var i,j,tmp=null;for(i=0,j=obj.childNodes.length;i<j;i++){if(obj.childNodes[i]&&obj.childNodes[i].className&&obj.childNodes[i].className.indexOf("jstree-anchor")!==-1){tmp=obj.childNodes[i];break;}}
if(tmp){if(!this.settings.checkbox.tie_selection&&this._model.data[obj.id].state.checked){tmp.className+=' jstree-checked';}
tmp.insertBefore(_i.cloneNode(false),tmp.childNodes[0]);}}
if(!is_callback&&this.settings.checkbox.cascade.indexOf('undetermined')!==-1){if(this._data.checkbox.uto){clearTimeout(this._data.checkbox.uto);}
this._data.checkbox.uto=setTimeout($.proxy(this._undetermined,this),50);}
return obj;};this.show_checkboxes=function(){this._data.core.themes.checkboxes=true;this.get_container_ul().removeClass("jstree-no-checkboxes");};this.hide_checkboxes=function(){this._data.core.themes.checkboxes=false;this.get_container_ul().addClass("jstree-no-checkboxes");};this.toggle_checkboxes=function(){if(this._data.core.themes.checkboxes){this.hide_checkboxes();}else{this.show_checkboxes();}};this.is_undetermined=function(obj){obj=this.get_node(obj);var s=this.settings.checkbox.cascade,i,j,t=this.settings.checkbox.tie_selection,d=this._data[t?'core':'checkbox'].selected,m=this._model.data;if(!obj||obj.state[t?'selected':'checked']===true||s.indexOf('undetermined')===-1||(s.indexOf('down')===-1&&s.indexOf('up')===-1)){return false;}
if(!obj.state.loaded&&obj.original.state.undetermined===true){return true;}
for(i=0,j=obj.children_d.length;i<j;i++){if($.inArray(obj.children_d[i],d)!==-1||(!m[obj.children_d[i]].state.loaded&&m[obj.children_d[i]].original.state.undetermined)){return true;}}
return false;};this.activate_node=function(obj,e){if(this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||$(e.target).hasClass('jstree-checkbox'))){e.ctrlKey=true;}
if(this.settings.checkbox.tie_selection||(!this.settings.checkbox.whole_node&&!$(e.target).hasClass('jstree-checkbox'))){return parent.activate_node.call(this,obj,e);}
if(this.is_disabled(obj)){return false;}
if(this.is_checked(obj)){this.uncheck_node(obj,e);}
else{this.check_node(obj,e);}
this.trigger('activate_node',{'node':this.get_node(obj)});};this.check_node=function(obj,e){if(this.settings.checkbox.tie_selection){return this.select_node(obj,false,true,e);}
var dom,t1,t2,th;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.check_node(obj[t1],e);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
dom=this.get_node(obj,true);if(!obj.state.checked){obj.state.checked=true;this._data.checkbox.selected.push(obj.id);if(dom&&dom.length){dom.children('.jstree-anchor').addClass('jstree-checked');}
this.trigger('check_node',{'node':obj,'selected':this._data.checkbox.selected,'event':e});}};this.uncheck_node=function(obj,e){if(this.settings.checkbox.tie_selection){return this.deselect_node(obj,false,e);}
var t1,t2,dom;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.uncheck_node(obj[t1],e);}
return true;}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
dom=this.get_node(obj,true);if(obj.state.checked){obj.state.checked=false;this._data.checkbox.selected=$.vakata.array_remove_item(this._data.checkbox.selected,obj.id);if(dom.length){dom.children('.jstree-anchor').removeClass('jstree-checked');}
this.trigger('uncheck_node',{'node':obj,'selected':this._data.checkbox.selected,'event':e});}};this.check_all=function(){if(this.settings.checkbox.tie_selection){return this.select_all();}
var tmp=this._data.checkbox.selected.concat([]),i,j;this._data.checkbox.selected=this._model.data['#'].children_d.concat();for(i=0,j=this._data.checkbox.selected.length;i<j;i++){if(this._model.data[this._data.checkbox.selected[i]]){this._model.data[this._data.checkbox.selected[i]].state.checked=true;}}
this.redraw(true);this.trigger('check_all',{'selected':this._data.checkbox.selected});};this.uncheck_all=function(){if(this.settings.checkbox.tie_selection){return this.deselect_all();}
var tmp=this._data.checkbox.selected.concat([]),i,j;for(i=0,j=this._data.checkbox.selected.length;i<j;i++){if(this._model.data[this._data.checkbox.selected[i]]){this._model.data[this._data.checkbox.selected[i]].state.checked=false;}}
this._data.checkbox.selected=[];this.element.find('.jstree-checked').removeClass('jstree-checked');this.trigger('uncheck_all',{'selected':this._data.checkbox.selected,'node':tmp});};this.is_checked=function(obj){if(this.settings.checkbox.tie_selection){return this.is_selected(obj);}
obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
return obj.state.checked;};this.get_checked=function(full){if(this.settings.checkbox.tie_selection){return this.get_selected(full);}
return full?$.map(this._data.checkbox.selected,$.proxy(function(i){return this.get_node(i);},this)):this._data.checkbox.selected;};this.get_top_checked=function(full){if(this.settings.checkbox.tie_selection){return this.get_top_selected(full);}
var tmp=this.get_checked(true),obj={},i,j,k,l;for(i=0,j=tmp.length;i<j;i++){obj[tmp[i].id]=tmp[i];}
for(i=0,j=tmp.length;i<j;i++){for(k=0,l=tmp[i].children_d.length;k<l;k++){if(obj[tmp[i].children_d[k]]){delete obj[tmp[i].children_d[k]];}}}
tmp=[];for(i in obj){if(obj.hasOwnProperty(i)){tmp.push(i);}}
return full?$.map(tmp,$.proxy(function(i){return this.get_node(i);},this)):tmp;};this.get_bottom_checked=function(full){if(this.settings.checkbox.tie_selection){return this.get_bottom_selected(full);}
var tmp=this.get_checked(true),obj=[],i,j;for(i=0,j=tmp.length;i<j;i++){if(!tmp[i].children.length){obj.push(tmp[i].id);}}
return full?$.map(obj,$.proxy(function(i){return this.get_node(i);},this)):obj;};this.load_node=function(obj,callback){var k,l,i,j,c,tmp;if(!$.isArray(obj)&&!this.settings.checkbox.tie_selection){tmp=this.get_node(obj);if(tmp&&tmp.state.loaded){for(k=0,l=tmp.children_d.length;k<l;k++){if(this._model.data[tmp.children_d[k]].state.checked){c=true;this._data.checkbox.selected=$.vakata.array_remove_item(this._data.checkbox.selected,tmp.children_d[k]);}}}}
return parent.load_node.apply(this,arguments);};this.get_state=function(){var state=parent.get_state.apply(this,arguments);if(this.settings.checkbox.tie_selection){return state;}
state.checkbox=this._data.checkbox.selected.slice();return state;};this.set_state=function(state,callback){var res=parent.set_state.apply(this,arguments);if(res&&state.checkbox){if(!this.settings.checkbox.tie_selection){this.uncheck_all();var _this=this;$.each(state.checkbox,function(i,v){_this.check_node(v);});}
delete state.checkbox;this.set_state(state,callback);return false;}
return res;};};$.jstree.defaults.contextmenu={select_node:true,show_at_node:true,items:function(o,cb){return{"create":{"separator_before":false,"separator_after":true,"_disabled":false,"label":"Create","action":function(data){var inst=$.jstree.reference(data.reference),obj=inst.get_node(data.reference);inst.create_node(obj,{},"last",function(new_node){setTimeout(function(){inst.edit(new_node);},0);});}},"rename":{"separator_before":false,"separator_after":false,"_disabled":false,"label":"Rename","action":function(data){var inst=$.jstree.reference(data.reference),obj=inst.get_node(data.reference);inst.edit(obj);}},"remove":{"separator_before":false,"icon":false,"separator_after":false,"_disabled":false,"label":"Delete","action":function(data){var inst=$.jstree.reference(data.reference),obj=inst.get_node(data.reference);if(inst.is_selected(obj)){inst.delete_node(inst.get_selected());}
else{inst.delete_node(obj);}}},"ccp":{"separator_before":true,"icon":false,"separator_after":false,"label":"Edit","action":false,"submenu":{"cut":{"separator_before":false,"separator_after":false,"label":"Cut","action":function(data){var inst=$.jstree.reference(data.reference),obj=inst.get_node(data.reference);if(inst.is_selected(obj)){inst.cut(inst.get_top_selected());}
else{inst.cut(obj);}}},"copy":{"separator_before":false,"icon":false,"separator_after":false,"label":"Copy","action":function(data){var inst=$.jstree.reference(data.reference),obj=inst.get_node(data.reference);if(inst.is_selected(obj)){inst.copy(inst.get_top_selected());}
else{inst.copy(obj);}}},"paste":{"separator_before":false,"icon":false,"_disabled":function(data){return!$.jstree.reference(data.reference).can_paste();},"separator_after":false,"label":"Paste","action":function(data){var inst=$.jstree.reference(data.reference),obj=inst.get_node(data.reference);inst.paste(obj);}}}}};}};$.jstree.plugins.contextmenu=function(options,parent){this.bind=function(){parent.bind.call(this);var last_ts=0,cto=null,ex,ey;this.element
.on("contextmenu.jstree",".jstree-anchor",$.proxy(function(e,data){e.preventDefault();last_ts=e.ctrlKey?+new Date():0;if(data||cto){last_ts=(+new Date())+10000;}
if(cto){clearTimeout(cto);}
if(!this.is_loading(e.currentTarget)){this.show_contextmenu(e.currentTarget,e.pageX,e.pageY,e);}},this))
.on("click.jstree",".jstree-anchor",$.proxy(function(e){if(this._data.contextmenu.visible&&(!last_ts||(+new Date())-last_ts>250)){$.vakata.context.hide();}
last_ts=0;},this))
.on("touchstart.jstree",".jstree-anchor",function(e){if(!e.originalEvent||!e.originalEvent.changedTouches||!e.originalEvent.changedTouches[0]){return;}
ex=e.pageX;ey=e.pageY;cto=setTimeout(function(){$(e.currentTarget).trigger('contextmenu',true);},750);})
.on('touchmove.vakata.jstree',function(e){if(cto&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(Math.abs(ex-e.pageX)>50||Math.abs(ey-e.pageY)>50)){clearTimeout(cto);}})
.on('touchend.vakata.jstree',function(e){if(cto){clearTimeout(cto);}});$(document).on("context_hide.vakata.jstree",$.proxy(function(){this._data.contextmenu.visible=false;},this));};this.teardown=function(){if(this._data.contextmenu.visible){$.vakata.context.hide();}
parent.teardown.call(this);};this.show_contextmenu=function(obj,x,y,e){obj=this.get_node(obj);if(!obj||obj.id==='#'){return false;}
var s=this.settings.contextmenu,d=this.get_node(obj,true),a=d.children(".jstree-anchor"),o=false,i=false;if(s.show_at_node||x===undefined||y===undefined){o=a.offset();x=o.left;y=o.top+this._data.core.li_height;}
if(this.settings.contextmenu.select_node&&!this.is_selected(obj)){this.activate_node(obj,e);}
i=s.items;if($.isFunction(i)){i=i.call(this,obj,$.proxy(function(i){this._show_contextmenu(obj,x,y,i);},this));}
if($.isPlainObject(i)){this._show_contextmenu(obj,x,y,i);}};this._show_contextmenu=function(obj,x,y,i){var d=this.get_node(obj,true),a=d.children(".jstree-anchor");$(document).one("context_show.vakata.jstree",$.proxy(function(e,data){var cls='jstree-contextmenu jstree-'+this.get_theme()+'-contextmenu';$(data.element).addClass(cls);},this));this._data.contextmenu.visible=true;$.vakata.context.show(a,{'x':x,'y':y},i);this.trigger('show_contextmenu',{"node":obj,"x":x,"y":y});};};(function($){var right_to_left=false,vakata_context={element:false,reference:false,position_x:0,position_y:0,items:[],html:"",is_visible:false};$.vakata.context={settings:{hide_onmouseleave:0,icons:true},_trigger:function(event_name){$(document).triggerHandler("context_"+event_name+".vakata",{"reference":vakata_context.reference,"element":vakata_context.element,"position":{"x":vakata_context.position_x,"y":vakata_context.position_y}});},_execute:function(i){i=vakata_context.items[i];return i&&(!i._disabled||($.isFunction(i._disabled)&&!i._disabled({"item":i,"reference":vakata_context.reference,"element":vakata_context.element})))&&i.action?i.action.call(null,{"item":i,"reference":vakata_context.reference,"element":vakata_context.element,"position":{"x":vakata_context.position_x,"y":vakata_context.position_y}}):false;},_parse:function(o,is_callback){if(!o){return false;}
if(!is_callback){vakata_context.html="";vakata_context.items=[];}
var str="",sep=false,tmp;if(is_callback){str+="<"+"ul>";}
$.each(o,function(i,val){if(!val){return true;}
vakata_context.items.push(val);if(!sep&&val.separator_before){str+="<"+"li class='vakata-context-separator'><"+"a href='#' "+($.vakata.context.settings.icons?'':'style="margin-left:0px;"')+">&#160;<"+"/a><"+"/li>";}
sep=false;str+="<"+"li class='"+(val._class||"")+(val._disabled===true||($.isFunction(val._disabled)&&val._disabled({"item":val,"reference":vakata_context.reference,"element":vakata_context.element}))?" vakata-contextmenu-disabled ":"")+"' "+(val.shortcut?" data-shortcut='"+val.shortcut+"' ":'')+">";str+="<"+"a href='#' rel='"+(vakata_context.items.length-1)+"'>";if($.vakata.context.settings.icons){str+="<"+"i ";if(val.icon){if(val.icon.indexOf("/")!==-1||val.icon.indexOf(".")!==-1){str+=" style='background:url(\""+val.icon+"\") center center no-repeat' ";}
else{str+=" class='"+val.icon+"' ";}}
str+="><"+"/i><"+"span class='vakata-contextmenu-sep'>&#160;<"+"/span>";}
str+=($.isFunction(val.label)?val.label({"item":i,"reference":vakata_context.reference,"element":vakata_context.element}):val.label)+(val.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+val.shortcut+'">'+(val.shortcut_label||'')+'</span>':'')+"<"+"/a>";if(val.submenu){tmp=$.vakata.context._parse(val.submenu,true);if(tmp){str+=tmp;}}
str+="<"+"/li>";if(val.separator_after){str+="<"+"li class='vakata-context-separator'><"+"a href='#' "+($.vakata.context.settings.icons?'':'style="margin-left:0px;"')+">&#160;<"+"/a><"+"/li>";sep=true;}});str=str.replace(/<li class\='vakata-context-separator'\><\/li\>$/,"");if(is_callback){str+="</ul>";}
if(!is_callback){vakata_context.html=str;$.vakata.context._trigger("parse");}
return str.length>10?str:false;},_show_submenu:function(o){o=$(o);if(!o.length||!o.children("ul").length){return;}
var e=o.children("ul"),x=o.offset().left+o.outerWidth(),y=o.offset().top,w=e.width(),h=e.height(),dw=$(window).width()+$(window).scrollLeft(),dh=$(window).height()+$(window).scrollTop();if(right_to_left){o[x-(w+10+o.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left");}
else{o[x+w+10>dw?"addClass":"removeClass"]("vakata-context-right");}
if(y+h+10>dh){e.css("bottom","-1px");}
e.show();},show:function(reference,position,data){var o,e,x,y,w,h,dw,dh,cond=true;if(vakata_context.element&&vakata_context.element.length){vakata_context.element.width('');}
switch(cond){case(!position&&!reference):return false;case(!!position&&!!reference):vakata_context.reference=reference;vakata_context.position_x=position.x;vakata_context.position_y=position.y;break;case(!position&&!!reference):vakata_context.reference=reference;o=reference.offset();vakata_context.position_x=o.left+reference.outerHeight();vakata_context.position_y=o.top;break;case(!!position&&!reference):vakata_context.position_x=position.x;vakata_context.position_y=position.y;break;}
if(!!reference&&!data&&$(reference).data('vakata_contextmenu')){data=$(reference).data('vakata_contextmenu');}
if($.vakata.context._parse(data)){vakata_context.element.html(vakata_context.html);}
if(vakata_context.items.length){vakata_context.element.appendTo("body");e=vakata_context.element;x=vakata_context.position_x;y=vakata_context.position_y;w=e.width();h=e.height();dw=$(window).width()+$(window).scrollLeft();dh=$(window).height()+$(window).scrollTop();if(right_to_left){x-=(e.outerWidth()-$(reference).outerWidth());if(x<$(window).scrollLeft()+20){x=$(window).scrollLeft()+20;}}
if(x+w+20>dw){x=dw-(w+20);}
if(y+h+20>dh){y=dh-(h+20);}
vakata_context.element
.css({"left":x,"top":y})
.show()
.find('a').first().focus().parent().addClass("vakata-context-hover");vakata_context.is_visible=true;$.vakata.context._trigger("show");}},hide:function(){if(vakata_context.is_visible){vakata_context.element.hide().find("ul").hide().end().find(':focus').blur().end().detach();vakata_context.is_visible=false;$.vakata.context._trigger("hide");}}};$(function(){right_to_left=$("body").css("direction")==="rtl";var to=false;vakata_context.element=$("<ul class='vakata-context'></ul>");vakata_context.element
.on("mouseenter","li",function(e){e.stopImmediatePropagation();if($.contains(this,e.relatedTarget)){return;}
if(to){clearTimeout(to);}
vakata_context.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end();$(this)
.siblings().find("ul").hide().end().end()
.parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover");$.vakata.context._show_submenu(this);})
.on("mouseleave","li",function(e){if($.contains(this,e.relatedTarget)){return;}
$(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover");})
.on("mouseleave",function(e){$(this).find(".vakata-context-hover").removeClass("vakata-context-hover");if($.vakata.context.settings.hide_onmouseleave){to=setTimeout((function(t){return function(){$.vakata.context.hide();};}(this)),$.vakata.context.settings.hide_onmouseleave);}})
.on("click","a",function(e){e.preventDefault();if(!$(this).blur().parent().hasClass("vakata-context-disabled")&&$.vakata.context._execute($(this).attr("rel"))!==false){$.vakata.context.hide();}})
.on('keydown','a',function(e){var o=null;switch(e.which){case 13:case 32:e.type="mouseup";e.preventDefault();$(e.currentTarget).trigger(e);break;case 37:if(vakata_context.is_visible){vakata_context.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children('a').focus();e.stopImmediatePropagation();e.preventDefault();}
break;case 38:if(vakata_context.is_visible){o=vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first();if(!o.length){o=vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last();}
o.addClass("vakata-context-hover").children('a').focus();e.stopImmediatePropagation();e.preventDefault();}
break;case 39:if(vakata_context.is_visible){vakata_context.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children('a').focus();e.stopImmediatePropagation();e.preventDefault();}
break;case 40:if(vakata_context.is_visible){o=vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first();if(!o.length){o=vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first();}
o.addClass("vakata-context-hover").children('a').focus();e.stopImmediatePropagation();e.preventDefault();}
break;case 27:$.vakata.context.hide();e.preventDefault();break;default:break;}})
.on('keydown',function(e){e.preventDefault();var a=vakata_context.element.find('.vakata-contextmenu-shortcut-'+e.which).parent();if(a.parent().not('.vakata-context-disabled')){a.click();}});$(document)
.on("mousedown.vakata.jstree",function(e){if(vakata_context.is_visible&&!$.contains(vakata_context.element[0],e.target)){$.vakata.context.hide();}})
.on("context_show.vakata.jstree",function(e,data){vakata_context.element.find("li:has(ul)").children("a").addClass("vakata-context-parent");if(right_to_left){vakata_context.element.addClass("vakata-context-rtl").css("direction","rtl");}
vakata_context.element.find("ul").hide().end();});});}($));$.jstree.defaults.dnd={copy:true,open_timeout:500,is_draggable:true,check_while_dragging:true,always_copy:false,inside_pos:0,drag_selection:true,touch:true,large_drop_target:false,large_drag_target:false};$.jstree.plugins.dnd=function(options,parent){this.bind=function(){parent.bind.call(this);this.element
.on('mousedown.jstree touchstart.jstree',this.settings.dnd.large_drag_target?'.jstree-node':'.jstree-anchor',$.proxy(function(e){if(this.settings.dnd.large_drag_target&&$(e.target).closest('.jstree-node')[0]!==e.currentTarget){return true;}
if(e.type==="touchstart"&&(!this.settings.dnd.touch||(this.settings.dnd.touch==='selected'&&!$(e.currentTarget).closest('.jstree-node').children('.jstree-anchor').hasClass('jstree-clicked')))){return true;}
var obj=this.get_node(e.target),mlt=this.is_selected(obj)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,txt=(mlt>1?mlt+' '+this.get_string('nodes'):this.get_text(e.currentTarget));if(this.settings.core.force_text){txt=$.vakata.html.escape(txt);}
if(obj&&obj.id&&obj.id!=="#"&&(e.which===1||e.type==="touchstart")&&(this.settings.dnd.is_draggable===true||($.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,(mlt>1?this.get_top_selected(true):[obj]))))){this.element.trigger('mousedown.jstree');return $.vakata.dnd.start(e,{'jstree':true,'origin':this,'obj':this.get_node(obj,true),'nodes':mlt>1?this.get_top_selected():[obj.id]},'<div id="jstree-dnd" class="jstree-'+this.get_theme()+' jstree-'+this.get_theme()+'-'+this.get_theme_variant()+' '+(this.settings.core.themes.responsive?' jstree-dnd-responsive':'')+'"><i class="jstree-icon jstree-er"></i>'+txt+'<ins class="jstree-copy" style="display:none;">+</ins></div>');}},this));};};$(function(){var lastmv=false,laster=false,opento=false,marker=$('<div id="jstree-marker">&#160;</div>').hide();$(document)
.on('dnd_start.vakata.jstree',function(e,data){lastmv=false;if(!data||!data.data||!data.data.jstree){return;}
marker.appendTo('body');})
.on('dnd_move.vakata.jstree',function(e,data){if(opento){clearTimeout(opento);}
if(!data||!data.data||!data.data.jstree){return;}
if(data.event.target.id&&data.event.target.id==='jstree-marker'){return;}
var ins=$.jstree.reference(data.event.target),ref=false,off=false,rel=false,tmp,l,t,h,p,i,o,ok,t1,t2,op,ps,pr,ip,tm;if(ins&&ins._data&&ins._data.dnd){marker.attr('class','jstree-'+ins.get_theme()+(ins.settings.core.themes.responsive?' jstree-dnd-responsive':''));data.helper
.children().attr('class','jstree-'+ins.get_theme()+' jstree-'+ins.get_theme()+'-'+ins.get_theme_variant()+' '+(ins.settings.core.themes.responsive?' jstree-dnd-responsive':''))
.find('.jstree-copy').first()[data.data.origin&&(data.data.origin.settings.dnd.always_copy||(data.data.origin.settings.dnd.copy&&(data.event.metaKey||data.event.ctrlKey)))?'show':'hide']();if((data.event.target===ins.element[0]||data.event.target===ins.get_container_ul()[0])&&ins.get_container_ul().children().length===0){ok=true;for(t1=0,t2=data.data.nodes.length;t1<t2;t1++){ok=ok&&ins.check((data.data.origin&&(data.data.origin.settings.dnd.always_copy||(data.data.origin.settings.dnd.copy&&(data.event.metaKey||data.event.ctrlKey)))?"copy_node":"move_node"),(data.data.origin&&data.data.origin!==ins?data.data.origin.get_node(data.data.nodes[t1]):data.data.nodes[t1]),'#','last',{'dnd':true,'ref':ins.get_node('#'),'pos':'i','origin':data.data.origin,'is_multi':(data.data.origin&&data.data.origin!==ins),'is_foreign':(!data.data.origin)});if(!ok){break;}}
if(ok){lastmv={'ins':ins,'par':'#','pos':'last'};marker.hide();data.helper.find('.jstree-icon').first().removeClass('jstree-er').addClass('jstree-ok');return;}}
else{ref=ins.settings.dnd.large_drop_target?$(data.event.target).closest('.jstree-node').children('.jstree-anchor'):$(data.event.target).closest('.jstree-anchor');if(ref&&ref.length&&ref.parent().is('.jstree-closed, .jstree-open, .jstree-leaf')){off=ref.offset();rel=data.event.pageY-off.top;h=ref.outerHeight();if(rel<h/3){o=['b','i','a'];}
else if(rel>h-h/3){o=['a','i','b'];}
else{o=rel>h/2?['i','a','b']:['i','b','a'];}
$.each(o,function(j,v){switch(v){case'b':l=off.left-6;t=off.top;p=ins.get_parent(ref);i=ref.parent().index();break;case'i':ip=ins.settings.dnd.inside_pos;tm=ins.get_node(ref.parent());l=off.left-2;t=off.top+h/2+1;p=tm.id;i=ip==='first'?0:(ip==='last'?tm.children.length:Math.min(ip,tm.children.length));break;case'a':l=off.left-6;t=off.top+h;p=ins.get_parent(ref);i=ref.parent().index()+1;break;}
ok=true;for(t1=0,t2=data.data.nodes.length;t1<t2;t1++){op=data.data.origin&&(data.data.origin.settings.dnd.always_copy||(data.data.origin.settings.dnd.copy&&(data.event.metaKey||data.event.ctrlKey)))?"copy_node":"move_node";ps=i;if(op==="move_node"&&v==='a'&&(data.data.origin&&data.data.origin===ins)&&p===ins.get_parent(data.data.nodes[t1])){pr=ins.get_node(p);if(ps>$.inArray(data.data.nodes[t1],pr.children)){ps-=1;}}
ok=ok&&((ins&&ins.settings&&ins.settings.dnd&&ins.settings.dnd.check_while_dragging===false)||ins.check(op,(data.data.origin&&data.data.origin!==ins?data.data.origin.get_node(data.data.nodes[t1]):data.data.nodes[t1]),p,ps,{'dnd':true,'ref':ins.get_node(ref.parent()),'pos':v,'origin':data.data.origin,'is_multi':(data.data.origin&&data.data.origin!==ins),'is_foreign':(!data.data.origin)}));if(!ok){if(ins&&ins.last_error){laster=ins.last_error();}
break;}}
if(v==='i'&&ref.parent().is('.jstree-closed')&&ins.settings.dnd.open_timeout){opento=setTimeout((function(x,z){return function(){x.open_node(z);};}(ins,ref)),ins.settings.dnd.open_timeout);}
if(ok){lastmv={'ins':ins,'par':p,'pos':v==='i'&&ip==='last'&&i===0&&!ins.is_loaded(tm)?'last':i};marker.css({'left':l+'px','top':t+'px'}).show();data.helper.find('.jstree-icon').first().removeClass('jstree-er').addClass('jstree-ok');laster={};o=true;return false;}});if(o===true){return;}}}}
lastmv=false;data.helper.find('.jstree-icon').removeClass('jstree-ok').addClass('jstree-er');marker.hide();})
.on('dnd_scroll.vakata.jstree',function(e,data){if(!data||!data.data||!data.data.jstree){return;}
marker.hide();lastmv=false;data.helper.find('.jstree-icon').first().removeClass('jstree-ok').addClass('jstree-er');})
.on('dnd_stop.vakata.jstree',function(e,data){if(opento){clearTimeout(opento);}
if(!data||!data.data||!data.data.jstree){return;}
marker.hide().detach();var i,j,nodes=[];if(lastmv){for(i=0,j=data.data.nodes.length;i<j;i++){nodes[i]=data.data.origin?data.data.origin.get_node(data.data.nodes[i]):data.data.nodes[i];}
lastmv.ins[data.data.origin&&(data.data.origin.settings.dnd.always_copy||(data.data.origin.settings.dnd.copy&&(data.event.metaKey||data.event.ctrlKey)))?'copy_node':'move_node'](nodes,lastmv.par,lastmv.pos,false,false,false,data.data.origin);}
else{i=$(data.event.target).closest('.jstree');if(i.length&&laster&&laster.error&&laster.error==='check'){i=i.jstree(true);if(i){i.settings.core.error.call(this,laster);}}}})
.on('keyup.jstree keydown.jstree',function(e,data){data=$.vakata.dnd._get();if(data&&data.data&&data.data.jstree){data.helper.find('.jstree-copy').first()[data.data.origin&&(data.data.origin.settings.dnd.always_copy||(data.data.origin.settings.dnd.copy&&(e.metaKey||e.ctrlKey)))?'show':'hide']();}});});(function($){$.vakata.html={div:$('<div />'),escape:function(str){return $.vakata.html.div.text(str).html();},strip:function(str){return $.vakata.html.div.empty().append($.parseHTML(str)).text();}};var vakata_dnd={element:false,target:false,is_down:false,is_drag:false,helper:false,helper_w:0,data:false,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:false,scroll_i:false,is_touch:false};$.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:50},_trigger:function(event_name,e){var data=$.vakata.dnd._get();data.event=e;$(document).triggerHandler("dnd_"+event_name+".vakata",data);},_get:function(){return{"data":vakata_dnd.data,"element":vakata_dnd.element,"helper":vakata_dnd.helper};},_clean:function(){if(vakata_dnd.helper){vakata_dnd.helper.remove();}
if(vakata_dnd.scroll_i){clearInterval(vakata_dnd.scroll_i);vakata_dnd.scroll_i=false;}
vakata_dnd={element:false,target:false,is_down:false,is_drag:false,helper:false,helper_w:0,data:false,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:false,scroll_i:false,is_touch:false};$(document).off("mousemove.vakata.jstree touchmove.vakata.jstree",$.vakata.dnd.drag);$(document).off("mouseup.vakata.jstree touchend.vakata.jstree",$.vakata.dnd.stop);},_scroll:function(init_only){if(!vakata_dnd.scroll_e||(!vakata_dnd.scroll_l&&!vakata_dnd.scroll_t)){if(vakata_dnd.scroll_i){clearInterval(vakata_dnd.scroll_i);vakata_dnd.scroll_i=false;}
return false;}
if(!vakata_dnd.scroll_i){vakata_dnd.scroll_i=setInterval($.vakata.dnd._scroll,100);return false;}
if(init_only===true){return false;}
var i=vakata_dnd.scroll_e.scrollTop(),j=vakata_dnd.scroll_e.scrollLeft();vakata_dnd.scroll_e.scrollTop(i+vakata_dnd.scroll_t*$.vakata.dnd.settings.scroll_speed);vakata_dnd.scroll_e.scrollLeft(j+vakata_dnd.scroll_l*$.vakata.dnd.settings.scroll_speed);if(i!==vakata_dnd.scroll_e.scrollTop()||j!==vakata_dnd.scroll_e.scrollLeft()){$.vakata.dnd._trigger("scroll",vakata_dnd.scroll_e);}},start:function(e,data,html){if(e.type==="touchstart"&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]){e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;e.target=document.elementFromPoint(e.originalEvent.changedTouches[0].pageX-window.pageXOffset,e.originalEvent.changedTouches[0].pageY-window.pageYOffset);}
if(vakata_dnd.is_drag){$.vakata.dnd.stop({});}
try{e.currentTarget.unselectable="on";e.currentTarget.onselectstart=function(){return false;};if(e.currentTarget.style){e.currentTarget.style.MozUserSelect="none";}}catch(ignore){}
vakata_dnd.init_x=e.pageX;vakata_dnd.init_y=e.pageY;vakata_dnd.data=data;vakata_dnd.is_down=true;vakata_dnd.element=e.currentTarget;vakata_dnd.target=e.target;vakata_dnd.is_touch=e.type==="touchstart";if(html!==false){vakata_dnd.helper=$("<div id='vakata-dnd'></div>").html(html).css({"display":"block","margin":"0","padding":"0","position":"absolute","top":"-2000px","lineHeight":"16px","zIndex":"10000"});}
$(document).on("mousemove.vakata.jstree touchmove.vakata.jstree",$.vakata.dnd.drag);$(document).on("mouseup.vakata.jstree touchend.vakata.jstree",$.vakata.dnd.stop);return false;},drag:function(e){if(e.type==="touchmove"&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]){e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;e.target=document.elementFromPoint(e.originalEvent.changedTouches[0].pageX-window.pageXOffset,e.originalEvent.changedTouches[0].pageY-window.pageYOffset);}
if(!vakata_dnd.is_down){return;}
if(!vakata_dnd.is_drag){if(Math.abs(e.pageX-vakata_dnd.init_x)>(vakata_dnd.is_touch?$.vakata.dnd.settings.threshold_touch:$.vakata.dnd.settings.threshold)||Math.abs(e.pageY-vakata_dnd.init_y)>(vakata_dnd.is_touch?$.vakata.dnd.settings.threshold_touch:$.vakata.dnd.settings.threshold)){if(vakata_dnd.helper){vakata_dnd.helper.appendTo("body");vakata_dnd.helper_w=vakata_dnd.helper.outerWidth();}
vakata_dnd.is_drag=true;$.vakata.dnd._trigger("start",e);}
else{return;}}
var d=false,w=false,dh=false,wh=false,dw=false,ww=false,dt=false,dl=false,ht=false,hl=false;vakata_dnd.scroll_t=0;vakata_dnd.scroll_l=0;vakata_dnd.scroll_e=false;$($(e.target).parentsUntil("body").addBack().get().reverse())
.filter(function(){return(/^auto|scroll$/).test($(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth);})
.each(function(){var t=$(this),o=t.offset();if(this.scrollHeight>this.offsetHeight){if(o.top+t.height()-e.pageY<$.vakata.dnd.settings.scroll_proximity){vakata_dnd.scroll_t=1;}
if(e.pageY-o.top<$.vakata.dnd.settings.scroll_proximity){vakata_dnd.scroll_t=-1;}}
if(this.scrollWidth>this.offsetWidth){if(o.left+t.width()-e.pageX<$.vakata.dnd.settings.scroll_proximity){vakata_dnd.scroll_l=1;}
if(e.pageX-o.left<$.vakata.dnd.settings.scroll_proximity){vakata_dnd.scroll_l=-1;}}
if(vakata_dnd.scroll_t||vakata_dnd.scroll_l){vakata_dnd.scroll_e=$(this);return false;}});if(!vakata_dnd.scroll_e){d=$(document);w=$(window);dh=d.height();wh=w.height();dw=d.width();ww=w.width();dt=d.scrollTop();dl=d.scrollLeft();if(dh>wh&&e.pageY-dt<$.vakata.dnd.settings.scroll_proximity){vakata_dnd.scroll_t=-1;}
if(dh>wh&&wh-(e.pageY-dt)<$.vakata.dnd.settings.scroll_proximity){vakata_dnd.scroll_t=1;}
if(dw>ww&&e.pageX-dl<$.vakata.dnd.settings.scroll_proximity){vakata_dnd.scroll_l=-1;}
if(dw>ww&&ww-(e.pageX-dl)<$.vakata.dnd.settings.scroll_proximity){vakata_dnd.scroll_l=1;}
if(vakata_dnd.scroll_t||vakata_dnd.scroll_l){vakata_dnd.scroll_e=d;}}
if(vakata_dnd.scroll_e){$.vakata.dnd._scroll(true);}
if(vakata_dnd.helper){ht=parseInt(e.pageY+$.vakata.dnd.settings.helper_top,10);hl=parseInt(e.pageX+$.vakata.dnd.settings.helper_left,10);if(dh&&ht+25>dh){ht=dh-50;}
if(dw&&hl+vakata_dnd.helper_w>dw){hl=dw-(vakata_dnd.helper_w+2);}
vakata_dnd.helper.css({left:hl+"px",top:ht+"px"});}
$.vakata.dnd._trigger("move",e);return false;},stop:function(e){if(e.type==="touchend"&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]){e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;e.target=document.elementFromPoint(e.originalEvent.changedTouches[0].pageX-window.pageXOffset,e.originalEvent.changedTouches[0].pageY-window.pageYOffset);}
if(vakata_dnd.is_drag){$.vakata.dnd._trigger("stop",e);}
else{if(e.type==="touchend"&&e.target===vakata_dnd.target){var to=setTimeout(function(){$(e.target).click();},100);$(e.target).one('click',function(){if(to){clearTimeout(to);}});}}
$.vakata.dnd._clean();return false;}};}($));$.jstree.defaults.massload=null;$.jstree.plugins.massload=function(options,parent){this.init=function(el,options){parent.init.call(this,el,options);this._data.massload={};};this._load_nodes=function(nodes,callback,is_callback){var s=this.settings.massload;if(is_callback&&!$.isEmptyObject(this._data.massload)){return parent._load_nodes.call(this,nodes,callback,is_callback);}
if($.isFunction(s)){return s.call(this,nodes,$.proxy(function(data){if(data){for(var i in data){if(data.hasOwnProperty(i)){this._data.massload[i]=data[i];}}}
parent._load_nodes.call(this,nodes,callback,is_callback);},this));}
if(typeof s==='object'&&s&&s.url){s=$.extend(true,{},s);if($.isFunction(s.url)){s.url=s.url.call(this,nodes);}
if($.isFunction(s.data)){s.data=s.data.call(this,nodes);}
return $.ajax(s)
.done($.proxy(function(data,t,x){if(data){for(var i in data){if(data.hasOwnProperty(i)){this._data.massload[i]=data[i];}}}
parent._load_nodes.call(this,nodes,callback,is_callback);},this))
.fail($.proxy(function(f){parent._load_nodes.call(this,nodes,callback,is_callback);},this));}
return parent._load_nodes.call(this,nodes,callback,is_callback);};this._load_node=function(obj,callback){var d=this._data.massload[obj.id];if(d){return this[typeof d==='string'?'_append_html_data':'_append_json_data'](obj,typeof d==='string'?$($.parseHTML(d)).filter(function(){return this.nodeType!==3;}):d,function(status){callback.call(this,status);delete this._data.massload[obj.id];});}
return parent._load_node.call(this,obj,callback);};};$.jstree.defaults.search={ajax:false,fuzzy:false,case_sensitive:false,show_only_matches:false,show_only_matches_children:false,close_opened_onclear:true,search_leaves_only:false,search_callback:false};$.jstree.plugins.search=function(options,parent){this.bind=function(){parent.bind.call(this);this._data.search.str="";this._data.search.dom=$();this._data.search.res=[];this._data.search.opn=[];this._data.search.som=false;this._data.search.smc=false;this.element
.on('before_open.jstree',$.proxy(function(e,data){var i,j,f,r=this._data.search.res,s=[],o=$();if(r&&r.length){this._data.search.dom=$(this.element[0].querySelectorAll('#'+$.map(r,function(v){return"0123456789".indexOf(v[0])!==-1?'\\3'+v[0]+' '+v.substr(1).replace($.jstree.idregex,'\\$&'):v.replace($.jstree.idregex,'\\$&');}).join(', #')));this._data.search.dom.children(".jstree-anchor").addClass('jstree-search');if(this._data.search.som&&this._data.search.res.length){for(i=0,j=r.length;i<j;i++){s=s.concat(this.get_node(r[i]).parents);}
s=$.vakata.array_remove_item($.vakata.array_unique(s),'#');o=s.length?$(this.element[0].querySelectorAll('#'+$.map(s,function(v){return"0123456789".indexOf(v[0])!==-1?'\\3'+v[0]+' '+v.substr(1).replace($.jstree.idregex,'\\$&'):v.replace($.jstree.idregex,'\\$&');}).join(', #'))):$();this.element.find(".jstree-node").hide().filter('.jstree-last').filter(function(){return this.nextSibling;}).removeClass('jstree-last');o=o.add(this._data.search.dom);if(this._data.search.smc){this._data.search.dom.children(".jstree-children").find(".jstree-node").show();}
o.parentsUntil(".jstree").addBack().show()
.filter(".jstree-children").each(function(){$(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last");});}}},this))
.on("search.jstree",$.proxy(function(e,data){if(this._data.search.som){if(data.nodes.length){this.element.find(".jstree-node").hide().filter('.jstree-last').filter(function(){return this.nextSibling;}).removeClass('jstree-last');if(this._data.search.smc){data.nodes.children(".jstree-children").find(".jstree-node").show();}
data.nodes.parentsUntil(".jstree").addBack().show()
.filter(".jstree-children").each(function(){$(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last");});}}},this))
.on("clear_search.jstree",$.proxy(function(e,data){if(this._data.search.som&&data.nodes.length){this.element.find(".jstree-node").css("display","").filter('.jstree-last').filter(function(){return this.nextSibling;}).removeClass('jstree-last');}},this));};this.search=function(str,skip_async,show_only_matches,inside,append,show_only_matches_children){if(str===false||$.trim(str.toString())===""){return this.clear_search();}
inside=this.get_node(inside);inside=inside&&inside.id?inside.id:null;str=str.toString();var s=this.settings.search,a=s.ajax?s.ajax:false,m=this._model.data,f=null,r=[],p=[],i,j;if(this._data.search.res.length&&!append){this.clear_search();}
if(show_only_matches===undefined){show_only_matches=s.show_only_matches;}
if(show_only_matches_children===undefined){show_only_matches_children=s.show_only_matches_children;}
if(!skip_async&&a!==false){if($.isFunction(a)){return a.call(this,str,$.proxy(function(d){if(d&&d.d){d=d.d;}
this._load_nodes(!$.isArray(d)?[]:$.vakata.array_unique(d),function(){this.search(str,true,show_only_matches,inside,append);},true);},this),inside);}
else{a=$.extend({},a);if(!a.data){a.data={};}
a.data.str=str;if(inside){a.data.inside=inside;}
return $.ajax(a)
.fail($.proxy(function(){this._data.core.last_error={'error':'ajax','plugin':'search','id':'search_01','reason':'Could not load search parents','data':JSON.stringify(a)};this.settings.core.error.call(this,this._data.core.last_error);},this))
.done($.proxy(function(d){if(d&&d.d){d=d.d;}
this._load_nodes(!$.isArray(d)?[]:$.vakata.array_unique(d),function(){this.search(str,true,show_only_matches,inside,append);},true);},this));}}
if(!append){this._data.search.str=str;this._data.search.dom=$();this._data.search.res=[];this._data.search.opn=[];this._data.search.som=show_only_matches;this._data.search.smc=show_only_matches_children;}
f=new $.vakata.search(str,true,{caseSensitive:s.case_sensitive,fuzzy:s.fuzzy});$.each(m[inside?inside:'#'].children_d,function(ii,i){var v=m[i];if(v.text&&((s.search_callback&&s.search_callback.call(this,str,v))||(!s.search_callback&&f.search(v.text).isMatch))&&(!s.search_leaves_only||(v.state.loaded&&v.children.length===0))){r.push(i);p=p.concat(v.parents);}});if(r.length){p=$.vakata.array_unique(p);this._search_open(p);if(!append){this._data.search.dom=$(this.element[0].querySelectorAll('#'+$.map(r,function(v){return"0123456789".indexOf(v[0])!==-1?'\\3'+v[0]+' '+v.substr(1).replace($.jstree.idregex,'\\$&'):v.replace($.jstree.idregex,'\\$&');}).join(', #')));this._data.search.res=r;}
else{this._data.search.dom=this._data.search.dom.add($(this.element[0].querySelectorAll('#'+$.map(r,function(v){return"0123456789".indexOf(v[0])!==-1?'\\3'+v[0]+' '+v.substr(1).replace($.jstree.idregex,'\\$&'):v.replace($.jstree.idregex,'\\$&');}).join(', #'))));this._data.search.res=$.vakata.array_unique(this._data.search.res.concat(r));}
this._data.search.dom.children(".jstree-anchor").addClass('jstree-search');}
this.trigger('search',{nodes:this._data.search.dom,str:str,res:this._data.search.res,show_only_matches:show_only_matches});};this.clear_search=function(){this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search");if(this.settings.search.close_opened_onclear){this.close_node(this._data.search.opn,0);}
this.trigger('clear_search',{'nodes':this._data.search.dom,str:this._data.search.str,res:this._data.search.res});this._data.search.str="";this._data.search.res=[];this._data.search.opn=[];this._data.search.dom=$();};this._search_open=function(d){var t=this;$.each(d.concat([]),function(i,v){if(v==="#"){return true;}
try{v=$('#'+v.replace($.jstree.idregex,'\\$&'),t.element);}catch(ignore){}
if(v&&v.length){if(t.is_closed(v)){t._data.search.opn.push(v[0].id);t.open_node(v,function(){t._search_open(d);},0);}}});};};(function($){$.vakata.search=function(pattern,txt,options){options=options||{};options=$.extend({},$.vakata.search.defaults,options);if(options.fuzzy!==false){options.fuzzy=true;}
pattern=options.caseSensitive?pattern:pattern.toLowerCase();var MATCH_LOCATION=options.location,MATCH_DISTANCE=options.distance,MATCH_THRESHOLD=options.threshold,patternLen=pattern.length,matchmask,pattern_alphabet,match_bitapScore,search;if(patternLen>32){options.fuzzy=false;}
if(options.fuzzy){matchmask=1<<(patternLen-1);pattern_alphabet=(function(){var mask={},i=0;for(i=0;i<patternLen;i++){mask[pattern.charAt(i)]=0;}
for(i=0;i<patternLen;i++){mask[pattern.charAt(i)]|=1<<(patternLen-i-1);}
return mask;}());match_bitapScore=function(e,x){var accuracy=e/patternLen,proximity=Math.abs(MATCH_LOCATION-x);if(!MATCH_DISTANCE){return proximity?1.0:accuracy;}
return accuracy+(proximity/MATCH_DISTANCE);};}
search=function(text){text=options.caseSensitive?text:text.toLowerCase();if(pattern===text||text.indexOf(pattern)!==-1){return{isMatch:true,score:0};}
if(!options.fuzzy){return{isMatch:false,score:1};}
var i,j,textLen=text.length,scoreThreshold=MATCH_THRESHOLD,bestLoc=text.indexOf(pattern,MATCH_LOCATION),binMin,binMid,binMax=patternLen+textLen,lastRd,start,finish,rd,charMatch,score=1,locations=[];if(bestLoc!==-1){scoreThreshold=Math.min(match_bitapScore(0,bestLoc),scoreThreshold);bestLoc=text.lastIndexOf(pattern,MATCH_LOCATION+patternLen);if(bestLoc!==-1){scoreThreshold=Math.min(match_bitapScore(0,bestLoc),scoreThreshold);}}
bestLoc=-1;for(i=0;i<patternLen;i++){binMin=0;binMid=binMax;while(binMin<binMid){if(match_bitapScore(i,MATCH_LOCATION+binMid)<=scoreThreshold){binMin=binMid;}else{binMax=binMid;}
binMid=Math.floor((binMax-binMin)/2+binMin);}
binMax=binMid;start=Math.max(1,MATCH_LOCATION-binMid+1);finish=Math.min(MATCH_LOCATION+binMid,textLen)+patternLen;rd=new Array(finish+2);rd[finish+1]=(1<<i)-1;for(j=finish;j>=start;j--){charMatch=pattern_alphabet[text.charAt(j-1)];if(i===0){rd[j]=((rd[j+1]<<1)|1)&charMatch;}else{rd[j]=((rd[j+1]<<1)|1)&charMatch|(((lastRd[j+1]|lastRd[j])<<1)|1)|lastRd[j+1];}
if(rd[j]&matchmask){score=match_bitapScore(i,j-1);if(score<=scoreThreshold){scoreThreshold=score;bestLoc=j-1;locations.push(bestLoc);if(bestLoc>MATCH_LOCATION){start=Math.max(1,2*MATCH_LOCATION-bestLoc);}else{break;}}}}
if(match_bitapScore(i+1,MATCH_LOCATION)>scoreThreshold){break;}
lastRd=rd;}
return{isMatch:bestLoc>=0,score:score};};return txt===true?{'search':search}:search(txt);};$.vakata.search.defaults={location:0,distance:100,threshold:0.6,fuzzy:false,caseSensitive:false};}($));$.jstree.defaults.sort=function(a,b){return this.get_text(a)>this.get_text(b)?1:-1;};$.jstree.plugins.sort=function(options,parent){this.bind=function(){parent.bind.call(this);this.element
.on("model.jstree",$.proxy(function(e,data){this.sort(data.parent,true);},this))
.on("rename_node.jstree create_node.jstree",$.proxy(function(e,data){this.sort(data.parent||data.node.parent,false);this.redraw_node(data.parent||data.node.parent,true);},this))
.on("move_node.jstree copy_node.jstree",$.proxy(function(e,data){this.sort(data.parent,false);this.redraw_node(data.parent,true);},this));};this.sort=function(obj,deep){var i,j;obj=this.get_node(obj);if(obj&&obj.children&&obj.children.length){obj.children.sort($.proxy(this.settings.sort,this));if(deep){for(i=0,j=obj.children_d.length;i<j;i++){this.sort(obj.children_d[i],false);}}}};};var to=false;$.jstree.defaults.state={key:'jstree',events:'changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree',ttl:false,filter:false};$.jstree.plugins.state=function(options,parent){this.bind=function(){parent.bind.call(this);var bind=$.proxy(function(){this.element.on(this.settings.state.events,$.proxy(function(){if(to){clearTimeout(to);}
to=setTimeout($.proxy(function(){this.save_state();},this),100);},this));this.trigger('state_ready');},this);this.element
.on("ready.jstree",$.proxy(function(e,data){this.element.one("restore_state.jstree",bind);if(!this.restore_state()){bind();}},this));};this.save_state=function(){var st={'state':this.get_state(),'ttl':this.settings.state.ttl,'sec':+(new Date())};$.vakata.storage.set(this.settings.state.key,JSON.stringify(st));};this.restore_state=function(){var k=$.vakata.storage.get(this.settings.state.key);if(!!k){try{k=JSON.parse(k);}catch(ex){return false;}}
if(!!k&&k.ttl&&k.sec&&+(new Date())-k.sec>k.ttl){return false;}
if(!!k&&k.state){k=k.state;}
if(!!k&&$.isFunction(this.settings.state.filter)){k=this.settings.state.filter.call(this,k);}
if(!!k){this.element.one("set_state.jstree",function(e,data){data.instance.trigger('restore_state',{'state':$.extend(true,{},k)});});this.set_state(k);return true;}
return false;};this.clear_state=function(){return $.vakata.storage.del(this.settings.state.key);};};(function($,undefined){$.vakata.storage={set:function(key,val){return window.localStorage.setItem(key,val);},get:function(key){return window.localStorage.getItem(key);},del:function(key){return window.localStorage.removeItem(key);}};}($));$.jstree.defaults.types={'#':{},'default':{}};$.jstree.plugins.types=function(options,parent){this.init=function(el,options){var i,j;if(options&&options.types&&options.types['default']){for(i in options.types){if(i!=="default"&&i!=="#"&&options.types.hasOwnProperty(i)){for(j in options.types['default']){if(options.types['default'].hasOwnProperty(j)&&options.types[i][j]===undefined){options.types[i][j]=options.types['default'][j];}}}}}
parent.init.call(this,el,options);this._model.data['#'].type='#';};this.refresh=function(skip_loading,forget_state){parent.refresh.call(this,skip_loading,forget_state);this._model.data['#'].type='#';};this.bind=function(){this.element
.on('model.jstree',$.proxy(function(e,data){var m=this._model.data,dpc=data.nodes,t=this.settings.types,i,j,c='default';for(i=0,j=dpc.length;i<j;i++){c='default';if(m[dpc[i]].original&&m[dpc[i]].original.type&&t[m[dpc[i]].original.type]){c=m[dpc[i]].original.type;}
if(m[dpc[i]].data&&m[dpc[i]].data.jstree&&m[dpc[i]].data.jstree.type&&t[m[dpc[i]].data.jstree.type]){c=m[dpc[i]].data.jstree.type;}
m[dpc[i]].type=c;if(m[dpc[i]].icon===true&&t[c].icon!==undefined){m[dpc[i]].icon=t[c].icon;}}
m['#'].type='#';},this));parent.bind.call(this);};this.get_json=function(obj,options,flat){var i,j,m=this._model.data,opt=options?$.extend(true,{},options,{no_id:false}):{},tmp=parent.get_json.call(this,obj,opt,flat);if(tmp===false){return false;}
if($.isArray(tmp)){for(i=0,j=tmp.length;i<j;i++){tmp[i].type=tmp[i].id&&m[tmp[i].id]&&m[tmp[i].id].type?m[tmp[i].id].type:"default";if(options&&options.no_id){delete tmp[i].id;if(tmp[i].li_attr&&tmp[i].li_attr.id){delete tmp[i].li_attr.id;}
if(tmp[i].a_attr&&tmp[i].a_attr.id){delete tmp[i].a_attr.id;}}}}
else{tmp.type=tmp.id&&m[tmp.id]&&m[tmp.id].type?m[tmp.id].type:"default";if(options&&options.no_id){tmp=this._delete_ids(tmp);}}
return tmp;};this._delete_ids=function(tmp){if($.isArray(tmp)){for(var i=0,j=tmp.length;i<j;i++){tmp[i]=this._delete_ids(tmp[i]);}
return tmp;}
delete tmp.id;if(tmp.li_attr&&tmp.li_attr.id){delete tmp.li_attr.id;}
if(tmp.a_attr&&tmp.a_attr.id){delete tmp.a_attr.id;}
if(tmp.children&&$.isArray(tmp.children)){tmp.children=this._delete_ids(tmp.children);}
return tmp;};this.check=function(chk,obj,par,pos,more){if(parent.check.call(this,chk,obj,par,pos,more)===false){return false;}
obj=obj&&obj.id?obj:this.get_node(obj);par=par&&par.id?par:this.get_node(par);var m=obj&&obj.id?(more&&more.origin?more.origin:$.jstree.reference(obj.id)):null,tmp,d,i,j;m=m&&m._model&&m._model.data?m._model.data:null;switch(chk){case"create_node":case"move_node":case"copy_node":if(chk!=='move_node'||$.inArray(obj.id,par.children)===-1){tmp=this.get_rules(par);if(tmp.max_children!==undefined&&tmp.max_children!==-1&&tmp.max_children===par.children.length){this._data.core.last_error={'error':'check','plugin':'types','id':'types_01','reason':'max_children prevents function: '+chk,'data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};return false;}
if(tmp.valid_children!==undefined&&tmp.valid_children!==-1&&$.inArray((obj.type||'default'),tmp.valid_children)===-1){this._data.core.last_error={'error':'check','plugin':'types','id':'types_02','reason':'valid_children prevents function: '+chk,'data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};return false;}
if(m&&obj.children_d&&obj.parents){d=0;for(i=0,j=obj.children_d.length;i<j;i++){d=Math.max(d,m[obj.children_d[i]].parents.length);}
d=d-obj.parents.length+1;}
if(d<=0||d===undefined){d=1;}
do{if(tmp.max_depth!==undefined&&tmp.max_depth!==-1&&tmp.max_depth<d){this._data.core.last_error={'error':'check','plugin':'types','id':'types_03','reason':'max_depth prevents function: '+chk,'data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};return false;}
par=this.get_node(par.parent);tmp=this.get_rules(par);d++;}while(par);}
break;}
return true;};this.get_rules=function(obj){obj=this.get_node(obj);if(!obj){return false;}
var tmp=this.get_type(obj,true);if(tmp.max_depth===undefined){tmp.max_depth=-1;}
if(tmp.max_children===undefined){tmp.max_children=-1;}
if(tmp.valid_children===undefined){tmp.valid_children=-1;}
return tmp;};this.get_type=function(obj,rules){obj=this.get_node(obj);return(!obj)?false:(rules?$.extend({'type':obj.type},this.settings.types[obj.type]):obj.type);};this.set_type=function(obj,type){var t,t1,t2,old_type,old_icon;if($.isArray(obj)){obj=obj.slice();for(t1=0,t2=obj.length;t1<t2;t1++){this.set_type(obj[t1],type);}
return true;}
t=this.settings.types;obj=this.get_node(obj);if(!t[type]||!obj){return false;}
old_type=obj.type;old_icon=this.get_icon(obj);obj.type=type;if(old_icon===true||(t[old_type]&&t[old_type].icon!==undefined&&old_icon===t[old_type].icon)){this.set_icon(obj,t[type].icon!==undefined?t[type].icon:true);}
return true;};};$.jstree.defaults.unique={case_sensitive:false,duplicate:function(name,counter){return name+' ('+counter+')';}};$.jstree.plugins.unique=function(options,parent){this.check=function(chk,obj,par,pos,more){if(parent.check.call(this,chk,obj,par,pos,more)===false){return false;}
obj=obj&&obj.id?obj:this.get_node(obj);par=par&&par.id?par:this.get_node(par);if(!par||!par.children){return true;}
var n=chk==="rename_node"?pos:obj.text,c=[],s=this.settings.unique.case_sensitive,m=this._model.data,i,j;for(i=0,j=par.children.length;i<j;i++){c.push(s?m[par.children[i]].text:m[par.children[i]].text.toLowerCase());}
if(!s){n=n.toLowerCase();}
switch(chk){case"delete_node":return true;case"rename_node":i=($.inArray(n,c)===-1||(obj.text&&obj.text[s?'toString':'toLowerCase']()===n));if(!i){this._data.core.last_error={'error':'check','plugin':'unique','id':'unique_01','reason':'Child with name '+n+' already exists. Preventing: '+chk,'data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};}
return i;case"create_node":i=($.inArray(n,c)===-1);if(!i){this._data.core.last_error={'error':'check','plugin':'unique','id':'unique_04','reason':'Child with name '+n+' already exists. Preventing: '+chk,'data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};}
return i;case"copy_node":i=($.inArray(n,c)===-1);if(!i){this._data.core.last_error={'error':'check','plugin':'unique','id':'unique_02','reason':'Child with name '+n+' already exists. Preventing: '+chk,'data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};}
return i;case"move_node":i=((obj.parent===par.id&&(!more||!more.is_multi))||$.inArray(n,c)===-1);if(!i){this._data.core.last_error={'error':'check','plugin':'unique','id':'unique_03','reason':'Child with name '+n+' already exists. Preventing: '+chk,'data':JSON.stringify({'chk':chk,'pos':pos,'obj':obj&&obj.id?obj.id:false,'par':par&&par.id?par.id:false})};}
return i;}
return true;};this.create_node=function(par,node,pos,callback,is_loaded){if(!node||node.text===undefined){if(par===null){par="#";}
par=this.get_node(par);if(!par){return parent.create_node.call(this,par,node,pos,callback,is_loaded);}
pos=pos===undefined?"last":pos;if(!pos.toString().match(/^(before|after)$/)&&!is_loaded&&!this.is_loaded(par)){return parent.create_node.call(this,par,node,pos,callback,is_loaded);}
if(!node){node={};}
var tmp,n,dpc,i,j,m=this._model.data,s=this.settings.unique.case_sensitive,cb=this.settings.unique.duplicate;n=tmp=this.get_string('New node');dpc=[];for(i=0,j=par.children.length;i<j;i++){dpc.push(s?m[par.children[i]].text:m[par.children[i]].text.toLowerCase());}
i=1;while($.inArray(s?n:n.toLowerCase(),dpc)!==-1){n=cb.call(this,tmp,(++i)).toString();}
node.text=n;}
return parent.create_node.call(this,par,node,pos,callback,is_loaded);};};var div=document.createElement('DIV');div.setAttribute('unselectable','on');div.setAttribute('role','presentation');div.className='jstree-wholerow';div.innerHTML='&#160;';$.jstree.plugins.wholerow=function(options,parent){this.bind=function(){parent.bind.call(this);this.element
.on('ready.jstree set_state.jstree',$.proxy(function(){this.hide_dots();},this))
.on("init.jstree loading.jstree ready.jstree",$.proxy(function(){this.get_container_ul().addClass('jstree-wholerow-ul');},this))
.on("deselect_all.jstree",$.proxy(function(e,data){this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');},this))
.on("changed.jstree",$.proxy(function(e,data){this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');var tmp=false,i,j;for(i=0,j=data.selected.length;i<j;i++){tmp=this.get_node(data.selected[i],true);if(tmp&&tmp.length){tmp.children('.jstree-wholerow').addClass('jstree-wholerow-clicked');}}},this))
.on("open_node.jstree",$.proxy(function(e,data){this.get_node(data.node,true).find('.jstree-clicked').parent().children('.jstree-wholerow').addClass('jstree-wholerow-clicked');},this))
.on("hover_node.jstree dehover_node.jstree",$.proxy(function(e,data){if(e.type==="hover_node"&&this.is_disabled(data.node)){return;}
this.get_node(data.node,true).children('.jstree-wholerow')[e.type==="hover_node"?"addClass":"removeClass"]('jstree-wholerow-hovered');},this))
.on("contextmenu.jstree",".jstree-wholerow",$.proxy(function(e){e.preventDefault();var tmp=$.Event('contextmenu',{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,pageX:e.pageX,pageY:e.pageY});$(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp);},this))
.on("click.jstree",".jstree-wholerow",function(e){e.stopImmediatePropagation();var tmp=$.Event('click',{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});$(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus();})
.on("click.jstree",".jstree-leaf > .jstree-ocl",$.proxy(function(e){e.stopImmediatePropagation();var tmp=$.Event('click',{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});$(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus();},this))
.on("mouseover.jstree",".jstree-wholerow, .jstree-icon",$.proxy(function(e){e.stopImmediatePropagation();if(!this.is_disabled(e.currentTarget)){this.hover_node(e.currentTarget);}
return false;},this))
.on("mouseleave.jstree",".jstree-node",$.proxy(function(e){this.dehover_node(e.currentTarget);},this));};this.teardown=function(){if(this.settings.wholerow){this.element.find(".jstree-wholerow").remove();}
parent.teardown.call(this);};this.redraw_node=function(obj,deep,callback,force_render){obj=parent.redraw_node.apply(this,arguments);if(obj){var tmp=div.cloneNode(true);if($.inArray(obj.id,this._data.core.selected)!==-1){tmp.className+=' jstree-wholerow-clicked';}
if(this._data.core.focused&&this._data.core.focused===obj.id){tmp.className+=' jstree-wholerow-hovered';}
obj.insertBefore(tmp,obj.childNodes[0]);}
return obj;};};if(document.registerElement&&Object&&Object.create){var proto=Object.create(HTMLElement.prototype);proto.createdCallback=function(){var c={core:{},plugins:[]},i;for(i in $.jstree.plugins){if($.jstree.plugins.hasOwnProperty(i)&&this.attributes[i]){c.plugins.push(i);if(this.getAttribute(i)&&JSON.parse(this.getAttribute(i))){c[i]=JSON.parse(this.getAttribute(i));}}}
for(i in $.jstree.defaults.core){if($.jstree.defaults.core.hasOwnProperty(i)&&this.attributes[i]){c.core[i]=JSON.parse(this.getAttribute(i))||this.getAttribute(i);}}
$(this).jstree(c);};try{document.registerElement("vakata-jstree",{prototype:proto});}catch(ignore){}}}));
"use strict";(function(){window.isJQueryObject=function(){var I;if(typeof jQuery==='undefined'){return false;}
for(I=0;I<arguments.length;I++){if(!(arguments[I]instanceof jQuery)){return false;}}
return true;};}());

"use strict";var Core=Core||{};Core.Debug=(function(TargetNS){var DebugConsole,DebugLog;if(typeof console==='object'&&typeof console.log==='function'){DebugConsole=console;DebugLog=console.log;}
else if(typeof opera==='object'&&typeof opera.PostError==='function'){DebugConsole=opera;DebugLog=opera.PostError;}
TargetNS.Log=DebugConsole?function(){DebugLog.apply(DebugConsole,arguments);}:function(){};TargetNS.CheckDependency=function(TargetNamespace,Required,RequiredLabel,Silent){var RequiredEval,ErrorMessage;try{RequiredEval=eval('try{ typeof '+Required+'} catch (E) {}');}
catch(Event){$.noop(Event);}
if(RequiredEval==='function'||RequiredEval==='object'){return true;}
if(!Silent){ErrorMessage='Namespace '+TargetNamespace+' could not be initialized, because '+
RequiredLabel+' could not be found.';alert(ErrorMessage);throw ErrorMessage;}
return false;};TargetNS.SimulateRTLPage=function(){var ExcludeTags={'html':1,'head':1,'style':1,'title':1,'link':1,'meta':1,'script':1,'object':1,'iframe':1},Replacement='رسال الإجابة (البريد الإلكتروني';$('body').addClass('RTL');function ReplaceAllText(Node){var ChildNodes=(Node||document.body).childNodes,CurrentNode,InputType,InputValue,ReplacementValue,CurrentText,I=0;while(I<ChildNodes.length){CurrentNode=ChildNodes[I++];if(CurrentNode.nodeType===1&&!ExcludeTags[CurrentNode.nodeName])
{ReplaceAllText(CurrentNode);if(CurrentNode.nodeName==='INPUT'){InputType=CurrentNode.getAttribute('type');if(InputType==='button'||InputType==='submit'||InputType==='reset'||InputType==='text'){InputValue=CurrentNode.getAttribute('value');if(InputValue&&InputValue.length){ReplacementValue=Replacement.substr(0,InputValue.length);CurrentNode.setAttribute('value',ReplacementValue);}}}}
if(CurrentNode.nodeType!==3){continue;}
CurrentText=CurrentNode.nodeValue;if(!CurrentText){continue;}
CurrentText=CurrentText.replace(/\s+/g,'');if(!CurrentText.length){continue;}
CurrentNode.nodeValue=Replacement.substr(0,CurrentText.length);}}
return ReplaceAllText();};return TargetNS;}(Core.Debug||{}));

"use strict";var Core=Core||{};Core.Exception=(function(TargetNS){TargetNS.Init=function(){$(window).bind('beforeunload.Exception',function(){TargetNS.AboutToLeave=true;});};TargetNS.ApplicationError=function(ErrorMessage,ErrorType){var Type=ErrorType,Message=ErrorMessage,Types=['Error','InternalError','TypeError','CommunicationError'],DefaultType='Error';if(!$.inArray(Type,Types)){Type=DefaultType;}
this.GetType=function(){return Type;};this.GetMessage=function(){return Message;};};TargetNS.Throw=function(ErrorMessage,ErrorType){throw new TargetNS.ApplicationError(ErrorMessage,ErrorType);};TargetNS.IsErrorOfType=function(ErrorObject,ErrorType){return(ErrorObject instanceof TargetNS.ApplicationError&&ErrorObject.GetType===ErrorType);};TargetNS.HandleFinalError=function(ErrorObject,Trace){var UserErrorMessage='An error occurred! Do you want to see the complete error message?',ErrorType=ErrorObject.GetType();if(ErrorObject instanceof TargetNS.ApplicationError){if(TargetNS.AboutToLeave&&(ErrorType==='CommunicationError'||ErrorType==='ConnectionError')){return false;}
if(ErrorType==='ConnectionError'){Core.App.Publish('Core.App.AjaxError');}
else{TargetNS.ShowError(ErrorObject.GetMessage(),ErrorType,Trace);if(window.confirm(UserErrorMessage)){alert(ErrorObject.GetMessage()+(Trace?('\n\n'+Trace):''));}}
return true;}
else if(ErrorObject instanceof Error){TargetNS.ShowError(ErrorObject.message,'JavaScriptError',Trace);if(window.confirm(UserErrorMessage)){alert(ErrorObject.message+(Trace?('\n\n'+Trace):''));}
throw ErrorObject;}
else{TargetNS.ShowError(ErrorObject,'UndefinedError',Trace);if(window.confirm(UserErrorMessage)){alert(ErrorObject+(Trace?('\n\n'+Trace):''));}
throw ErrorObject;}};TargetNS.ShowError=function(ErrorMessage,ErrorType,Trace){Core.Debug.Log('[ERROR] '+ErrorType+': '+ErrorMessage);if(typeof Trace!=='undefined'){Core.Debug.Log('[STACKTRACE] '+Trace);}};return TargetNS;}(Core.Exception||{}));

"use strict";var Core=Core||{};Core.Data=(function(TargetNS){TargetNS.Set=function($Element,Name,Object){if(isJQueryObject($Element)){$Element.data(Name,Object);}};TargetNS.Get=function($Element,Name){var DataObject;if(isJQueryObject($Element)){DataObject=$Element.data(Name);if(typeof DataObject==='undefined'||DataObject===null){return{};}
else{return DataObject;}}
return{};};TargetNS.CompareObject=function(ObjectOne,ObjectTwo){var Key;if(!ObjectOne||!ObjectTwo){return false;}
if(typeof ObjectOne!=='object'||typeof ObjectTwo!=='object'){return false;}
if(ObjectOne.constructor!==ObjectTwo.constructor){return false;}
for(Key in ObjectOne){if((typeof ObjectOne[Key]==='object')&&(typeof ObjectTwo[Key]==='object')){if(!Core.Data.CompareObject(ObjectOne[Key],ObjectTwo[Key])){return false;}}
else{if(ObjectOne[Key]!==ObjectTwo[Key]){return false;}}}
for(Key in ObjectTwo){if((typeof ObjectTwo[Key]==='object')&&(typeof ObjectOne[Key]==='object')){if(!Core.Data.CompareObject(ObjectTwo[Key],ObjectOne[Key])){return false;}}
else{if(ObjectTwo[Key]!==ObjectOne[Key]){return false;}}}
return true;};TargetNS.CopyObject=function(Data){var Key='',TempObject;if(!Data||typeof Data!=='object'){return Data;}
TempObject=new Data.constructor();for(Key in Data){if(Data.hasOwnProperty(Key)){TempObject[Key]=Core.Data.CopyObject(Data[Key]);}}
return TempObject;};return TargetNS;}(Core.Data||{}));

"use strict";var Core=Core||{};Core.Config=(function(TargetNS){var Config={},ConfigPrefix='Config';if(!Core.Debug.CheckDependency('Core.Config','Core.Data','Core.Data')){return false;}
TargetNS.Set=function(Key,Value){var Keys=Key.split('.'),KeyToken,ConfigLevel=Config,Count=0;for(KeyToken in Keys){if(Keys.hasOwnProperty(KeyToken)){if(Keys.length===Count+1){ConfigLevel[ConfigPrefix+Keys[KeyToken]]=Value;}
else if(typeof ConfigLevel[ConfigPrefix+Keys[KeyToken]]==='undefined'){ConfigLevel[ConfigPrefix+Keys[KeyToken]]={};ConfigLevel=ConfigLevel[ConfigPrefix+Keys[KeyToken]];}
else{ConfigLevel=ConfigLevel[ConfigPrefix+Keys[KeyToken]];}
Count++;}}};TargetNS.Get=function(Key,DefaultValue){var Keys=Key.split('.'),KeyToken,ConfigLevel=Config,Count=0;for(KeyToken in Keys){if(Keys.hasOwnProperty(KeyToken)){if(typeof ConfigLevel!=='object'){return DefaultValue;}
if(Keys.length===Count+1){return ConfigLevel[ConfigPrefix+Keys[KeyToken]]||DefaultValue;}
else{ConfigLevel=ConfigLevel[ConfigPrefix+Keys[KeyToken]];}
Count++;}}};TargetNS.AddConfig=function(Data,ConfigKey){var ConfigOptions,Keys,KeyToken,ConfigLevel=Config,Count=0;ConfigOptions=Core.Data.CopyObject(Data);if(typeof ConfigKey==='undefined'){$.each(Data,function(Key,Value){ConfigLevel[ConfigPrefix+Key]=Value;});}
else{Keys=ConfigKey.split('.');for(KeyToken in Keys){if(Keys.length===Count+1){ConfigLevel[ConfigPrefix+Keys[KeyToken]]=ConfigOptions;}
else{if(typeof ConfigLevel[ConfigPrefix+Keys[KeyToken]]==='undefined'){ConfigLevel=ConfigLevel[ConfigPrefix+Keys[KeyToken]];}
else{ConfigLevel=ConfigLevel[ConfigPrefix+Keys[KeyToken]];}
Count++;}}}};TargetNS.AddConfig({'Microsoft Internet Explorer 5.5':function(){return($.browser.msie&&$.browser.version==='5.5');},'Microsoft Internet Explorer 6':function(){return($.browser.msie&&$.browser.version==='6.0');},'Microsoft Internet Explorer 7':function(){return($.browser.msie&&$.browser.version==='7.0');},'Microsoft Internet Explorer 8':function(){return($.browser.msie&&$.browser.version==='8.0');},'Microsoft Internet Explorer 9':function(){return($.browser.msie&&$.browser.version==='9.0');},'Konqueror (without WebKit engine)':function(){return($.browser.webkit&&navigator.vendor==='KDE');},'Netscape, old Mozilla, old Firefox':function(){var BrowserVersion,BrowserDetected=false;if($.browser.mozilla){BrowserVersion=$.browser.version.split('.');if(parseInt(BrowserVersion[0],10)<10){BrowserDetected=true;}}
return BrowserDetected;}},'BrowserBlackList::Agent');TargetNS.AddConfig({'Microsoft Internet Explorer 5.5':function(){return($.browser.msie&&$.browser.version==='5.5');},'Microsoft Internet Explorer 6':function(){return($.browser.msie&&$.browser.version==='6.0');},'Microsoft Internet Explorer 7':function(){return($.browser.msie&&$.browser.version==='7.0');},'Microsoft Internet Explorer 8':function(){return($.browser.msie&&$.browser.version==='8.0');},'Microsoft Internet Explorer 9':function(){return($.browser.msie&&$.browser.version==='9.0');},'Konqueror (without WebKit engine)':function(){return($.browser.webkit&&navigator.vendor==='KDE');},'Netscape, old Mozilla, old Firefox':function(){var BrowserVersion,BrowserDetected=false;if($.browser.mozilla){BrowserVersion=$.browser.version.split('.');if(parseInt(BrowserVersion[0],10)<10){BrowserDetected=true;}}
return BrowserDetected;}},'BrowserBlackList::Customer');return TargetNS;}(Core.Config||{}));

"use strict";var Core=Core||{};Core.JSON=(function(TargetNS){if(!Core.Debug.CheckDependency('Core.JSON','JSON.parse','JSON parser',true)){return false;}
TargetNS.Parse=function(JSONString){var JSONObject;try{JSONObject=JSON.parse(JSONString);}
catch(e){JSONObject={};}
return JSONObject;};TargetNS.Stringify=function(JSONObject){var JSONString;try{JSONString=JSON.stringify(JSONObject);}
catch(e){JSONString="";}
return JSONString;};return TargetNS;}(Core.JSON||{}));

"use strict";var Core=Core||{};Core.App=(function(TargetNS){if(!Core.Debug.CheckDependency('Core.App','Core.Exception','Core.Exception')){return false;}
if(!Core.Debug.CheckDependency('Core.App','Core.Config','Core.Config')){return false;}
function SerializeData(Data){var QueryString='';$.each(Data,function(Key,Value){QueryString+=encodeURIComponent(Key)+'='+encodeURIComponent(Value)+';';});return QueryString;}
TargetNS.BindWindowUnloadEvent=function(Namespace,CallbackFunction){if(!$.isFunction(CallbackFunction)){return;}
if($.browser.msie&&parseInt($.browser.version,10)<11){$(window).on('unload.'+Namespace,function(){CallbackFunction();});}
else{$(window).on('pagehide.'+Namespace,function(){CallbackFunction();});}};TargetNS.UnbindWindowUnloadEvent=function(Namespace){$(window).off('unload.'+Namespace);$(window).off('pagehide.'+Namespace);};TargetNS.GetSessionInformation=function(){var Data={};if(!Core.Config.Get('SessionIDCookie')){Data[Core.Config.Get('SessionName')]=Core.Config.Get('SessionID');Data[Core.Config.Get('CustomerPanelSessionName')]=Core.Config.Get('SessionID');}
Data.ChallengeToken=Core.Config.Get('ChallengeToken');return Data;};TargetNS.BrowserCheck=function(Interface){var AppropriateBrowser=true,BrowserBlackList=Core.Config.Get('BrowserBlackList::'+Interface);if(typeof BrowserBlackList!=='undefined'){$.each(BrowserBlackList,function(Key,Value){if($.isFunction(Value)){if(Value()){AppropriateBrowser=false;}}});return AppropriateBrowser;}
alert('Error: Browser Check failed!');};TargetNS.BrowserCheckIECompatibilityMode=function(){var IE7=($.browser.msie&&$.browser.version==='7.0');if(!IE7){return false;}
if(navigator&&navigator.userAgent&&(navigator.userAgent.match(/Trident\/4.0/)||navigator.userAgent.match(/Trident\/5.0/)||navigator.userAgent.match(/Trident\/6.0/)||navigator.userAgent.match(/Trident\/7.0/))){return true;}
return false;};TargetNS.Ready=function(Callback){if($.isFunction(Callback)){$(document).ready(function(){var Trace;try{Callback();}
catch(Error){Trace=printStackTrace({e:Error,guess:true}).join('\n');Core.Exception.HandleFinalError(Error,Trace);}});}
else{Core.Exception.ShowError('No function parameter given in Core.App.Ready','TypeError');}
TargetNS.Subscribe('Core.App.AjaxErrorResolved',function(){var $DialogObj=$('#AjaxErrorDialog');window.clearInterval(TargetNS.AjaxConnectionCheckInterval);delete TargetNS.AjaxConnectionCheckInterval;$('body').removeClass('ConnectionErrorDialogClosed');if(!$('body').hasClass('ConnectionErrorDetected')){return false;}
$('body').removeClass('ConnectionErrorDetected');if($('#AjaxErrorDialogInner').is(':visible')){$('#AjaxErrorDialogInner').find('.NoConnection').hide();$('#AjaxErrorDialogInner').find('.ConnectionReEstablished').show().delay(1000).find('.Icon').addClass('Green');}
else{$DialogObj.find('.NoConnection').hide();$DialogObj.find('.ConnectionReEstablished').show().find('.Icon').addClass('Green');Core.UI.Dialog.ShowDialog({HTML:$DialogObj,Title:Core.Config.Get('ConnectionErrorTitle'),Modal:true,CloseOnClickOutside:false,CloseOnEscape:false,PositionTop:'100px',PositionLeft:'Center',Buttons:[{Label:Core.Config.Get('ConnectionErrorReloadButton'),Class:'Primary',Function:function(){location.reload();}},{Label:Core.Config.Get('DialogCloseMsg'),Function:function(){if($('#AjaxErrorDialogInner').find('.NoConnection').is(':visible')){$('body').addClass('ConnectionErrorDialogClosed');}
Core.UI.Dialog.CloseDialog($('#AjaxErrorDialogInner'));}}],AllowAutoGrow:true});$('#AjaxErrorDialogInner').closest('.Dialog').find('.Close').remove();}});TargetNS.Subscribe('Core.App.AjaxError',function(){var $DialogObj=$('#AjaxErrorDialog');$('body').addClass('ConnectionErrorDetected');if($('body').hasClass('ConnectionErrorDialogClosed')){return false;}
if($('#AjaxErrorDialogInner').find('.NoConnection').is(':visible')){return false;}
if(!TargetNS.AjaxConnectionCheckInterval){TargetNS.AjaxConnectionCheckInterval=window.setInterval(function(){Core.AJAX.FunctionCall(Core.Config.Get('CGIHandle'),null,function(){TargetNS.Publish('Core.App.AjaxErrorResolved');},'html');},5000);}
if($('#AjaxErrorDialogInner').find('.ConnectionReEstablished').is(':visible')){$('#AjaxErrorDialogInner').find('.ConnectionReEstablished').hide().prev('.NoConnection').show();return false;}
$DialogObj.find('.NoConnection').show();Core.UI.Dialog.ShowDialog({HTML:$DialogObj,Title:Core.Config.Get('ConnectionErrorTitle'),Modal:true,CloseOnClickOutside:false,CloseOnEscape:false,PositionTop:'100px',PositionLeft:'Center',Buttons:[{Label:Core.Config.Get('ConnectionErrorReloadButton'),Class:'Primary',Function:function(){location.reload();}},{Label:Core.Config.Get('DialogCloseMsg'),Function:function(){if($('#AjaxErrorDialogInner').find('.NoConnection').is(':visible')){$('body').addClass('ConnectionErrorDialogClosed');}
Core.UI.Dialog.CloseDialog($('#AjaxErrorDialogInner'));}}],AllowAutoGrow:true});$('#AjaxErrorDialogInner').closest('.Dialog').find('.Close').remove();});};TargetNS.InternalRedirect=function(Data){var URL;URL=Core.Config.Get('Baselink')+SerializeData(Data);URL+=SerializeData(TargetNS.GetSessionInformation());window.location.href=URL;};TargetNS.EscapeSelector=function(Selector){if(Selector&&Selector.length){return Selector.replace(/( |#|:|\.|\[|\]|@|!|"|\$|%|&|<|=|>|'|\(|\)|\*|\+|,|\?|\/|;|\\|\^|{|}|`|\||~)/g,'\\$1');}
return'';};TargetNS.EscapeHTML=function(StringToEscape){var HTMLEntities={'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;'};if(!StringToEscape){return'';}
return StringToEscape.replace(/[&<>"]/g,function(Entity){return HTMLEntities[Entity]||Entity;});};TargetNS.Publish=function(Topic,Args){$.publish(Topic,Args);};TargetNS.Subscribe=function(Topic,Callback){return $.subscribe(Topic,Callback);};TargetNS.Unsubscribe=function(Handle){$.unsubscribe(Handle);};return TargetNS;}(Core.App||{}));

"use strict";var Core=Core||{};Core.App=Core.App||{};Core.App.Responsive=(function(TargetNS){var ActiveScreenSize='ScreenXL',ScreenSizes={'ScreenXS':['ScreenS','ScreenM','ScreenL','ScreenXL'],'ScreenS':['ScreenM','ScreenL','ScreenXL'],'ScreenM':['ScreenL','ScreenXL'],'ScreenL':['ScreenXL'],'ScreenXL':[]};function GetAllScreenClasses(){var Classes=[],Key;for(Key in ScreenSizes){Classes.push('Visible-'+Key);}
return Classes;}
function CheckScreenResolution(){var $ResponsiveFooter=$('#ResponsiveFooter'),AllClasses=GetAllScreenClasses().join(' '),Key,i;Core.App.Publish('Event.App.Responsive.CheckScreenResolution');for(Key in ScreenSizes){if($ResponsiveFooter.find('.Visible-'+Key).is(':visible')&&Key!==ActiveScreenSize){ActiveScreenSize=Key;break;}}
if(!$('body').hasClass('Visible-'+ActiveScreenSize)){$('body')
.removeClass(AllClasses)
.addClass('Visible-'+ActiveScreenSize);Core.App.Publish('Event.App.Responsive.'+ActiveScreenSize);Core.App.Publish('Event.App.Responsive.SmallerOrEqual'+ActiveScreenSize);for(i=0;i<ScreenSizes[ActiveScreenSize].length;i++){Core.App.Publish('Event.App.Responsive.SmallerOrEqual'+ScreenSizes[ActiveScreenSize][i]);}}}
TargetNS.GetScreenSize=function(){return ActiveScreenSize;};TargetNS.IsSmallerOrEqual=function(ScreenSize,CompareSize){var i;if(ScreenSize===CompareSize){return true;}
for(i=0;i<ScreenSizes[ScreenSize].length;i++){if(ScreenSizes[ScreenSize][i]===CompareSize){return true;}}
return false;};TargetNS.CheckIfTouchDevice=function(){if(('ontouchstart'in window)||(navigator.msMaxTouchPoints>0)){$('body').addClass('TouchDevice');}};TargetNS.IsTouchDevice=function(){return($('body').hasClass('TouchDevice'));};TargetNS.Init=function(){var TimeoutID=0;try{if((top.location.href!==location.href&&window.name.search(/^OTRSPopup_/)===-1)||parseInt(localStorage.getItem("DesktopMode"),10)>0){if(!$('#ViewModeSwitch').length){$('#Footer').append('<div id="ViewModeSwitch"><a href="#">'+Core.Config.Get('ViewModeSwitchMobile')+'</a></div>');$('#ViewModeSwitch').on('click.Responsive',function(){localStorage.setItem("DesktopMode",0);location.reload();return false;});}
$('body').addClass('Visible-ScreenXL');return;}}
catch(Exception){$.noop(Exception);}
$(window).on('resize',function(){clearTimeout(TimeoutID);TimeoutID=window.setTimeout(function(){CheckScreenResolution();},50);});Core.App.Subscribe('Event.App.Responsive.ScreenXS',function(){});Core.App.Subscribe('Event.App.Responsive.SmallerOrEqualScreenXS',function(){});Core.App.Subscribe('Event.App.Responsive.ScreenS',function(){});Core.App.Subscribe('Event.App.Responsive.SmallerOrEqualScreenS',function(){});Core.App.Subscribe('Event.App.Responsive.ScreenM',function(){});Core.App.Subscribe('Event.App.Responsive.SmallerOrEqualScreenM',function(){});Core.App.Subscribe('Event.App.Responsive.ScreenL',function(){});Core.App.Subscribe('Event.App.Responsive.SmallerOrEqualScreenL',function(){});Core.App.Subscribe('Event.App.Responsive.ScreenXL',function(){});Core.App.Subscribe('Event.App.Responsive.SmallerOrEqualScreenXL',function(){});CheckScreenResolution();};return TargetNS;}(Core.App.Responsive||{}));

"use strict";var Core=Core||{};Core.AJAX=(function(TargetNS){var AJAXLoaderPrefix='AJAXLoader',ActiveAJAXCalls={};if(!Core.Debug.CheckDependency('Core.AJAX','Core.Exception','Core.Exception')){return;}
if(!Core.Debug.CheckDependency('Core.AJAX','Core.App','Core.App')){return;}
function HandleAJAXError(XHRObject,Status,Error){var ErrorMessage='Error during AJAX communication. Status: '+Status+', Error: '+Error;if(RedirectAfterSessionTimeOut(XHRObject)){return;}
if(Status==='abort'){return;}
if(Core.Config.Get('AjaxDebug')&&typeof XHRObject==='object'){ErrorMessage+="\n\nResponse status: "+XHRObject.status+" ("+XHRObject.statusText+")\n";ErrorMessage+="Response headers: "+XHRObject.getAllResponseHeaders()+"\n";ErrorMessage+="Response content: "+XHRObject.responseText;}
if(!XHRObject.status){Core.Exception.HandleFinalError(new Core.Exception.ApplicationError(ErrorMessage,'ConnectionError'));return;}
Core.Exception.HandleFinalError(new Core.Exception.ApplicationError(ErrorMessage,'CommunicationError'));}
function ToggleAJAXLoader(FieldID,Show){var $Element=$('#'+FieldID),$Loader=$('#'+AJAXLoaderPrefix+FieldID),LoaderHTML='<span id="'+AJAXLoaderPrefix+FieldID+'" class="AJAXLoader"></span>';if($Element.is('[type=hidden]')){return;}
if(!$Element.length){ActiveAJAXCalls[FieldID]=0;return;}
if(typeof ActiveAJAXCalls[FieldID]==='undefined'){ActiveAJAXCalls[FieldID]=0;}
if(Show){ActiveAJAXCalls[FieldID]++;}
else{ActiveAJAXCalls[FieldID]--;if(ActiveAJAXCalls[FieldID]<=0){ActiveAJAXCalls[FieldID]=0;}}
if(ActiveAJAXCalls[FieldID]>0){if(!$Loader.length){$Element.after(LoaderHTML);}
else{$Loader.show();}}
else{$Loader.hide();}}
function SerializeData(Data){var QueryString='';$.each(Data,function(Key,Value){QueryString+=';'+encodeURIComponent(Key)+'='+encodeURIComponent(Value);});return QueryString;}
function GetSessionInformation(){var Data={};if(!Core.Config.Get('SessionIDCookie')){Data[Core.Config.Get('SessionName')]=Core.Config.Get('SessionID');Data[Core.Config.Get('CustomerPanelSessionName')]=Core.Config.Get('SessionID');}
Data.ChallengeToken=Core.Config.Get('ChallengeToken');return Data;}
function GetAdditionalDefaultData(){var Data={};Data=GetSessionInformation();Data.Action=Core.Config.Get('Action');return Data;}
function UpdateTicketAttachments(Value){var DeleteText=Core.Config.Get('Localization.Delete'),FileID,ButtonStrg,InputStrg;$('#FileUpload').parent().siblings('li').remove();$(Value).each(function(){FileID=this.FileID;ButtonStrg='<button type="button" id="AttachmentDeleteButton'+FileID+'" name="AttachmentDeleteButton'+FileID+'" value="Delete" class="CallForAction SpacingLeft"><span>'+DeleteText+'</span></button>';InputStrg='<input type="hidden" id="AttachmentDelete'+this.FileID+'" name="AttachmentDelete'+this.FileID+'" />';$('#FileUpload').parent().before('<li>'+this.Filename+' ('+this.Filesize+')'+ButtonStrg+InputStrg+'</li>');$('#AttachmentDeleteButton'+FileID).bind('click',function(){var $Form=$(this).closest('form');$(this).next('input[type=hidden]').val(1);Core.Form.Validate.DisableValidation($Form);$Form.trigger('submit');});});}
function UpdateTextarea($Element,Value){var $ParentBody,ParentBody,Range,StartRange=0,NewPosition=0,CKEditorObj=parent.CKEDITOR;if($Element.length){$ParentBody=$Element;ParentBody=$ParentBody[0];if(Core.App.Responsive.IsSmallerOrEqual(Core.App.Responsive.GetScreenSize(),'ScreenL')&&(!localStorage.getItem("DesktopMode")||parseInt(localStorage.getItem("DesktopMode"),10)<=0)){CKEditorObj=CKEDITOR;}
if(CKEditorObj&&CKEditorObj.instances.RichText){CKEditorObj.instances.RichText.focus();window.setTimeout(function(){try{CKEditorObj.instances.RichText.setData(Value);}
catch(Error){$.noop();}},100);return;}
else{if($Element.parent().data('Cursor')){StartRange=parent.$Element.data('Cursor').StartRange;}
$ParentBody.val(Value);NewPosition=StartRange+Value.length;if(ParentBody.selectionStart){ParentBody.selectionStart=NewPosition;ParentBody.selectionEnd=NewPosition;}
else if(document.selection){Range=document.selection.createRange().duplicate();Range.moveStart('character',NewPosition);Range.select();}
return;}}
else{alert('$JSText{"This window must be called from compose window"}');return;}}
function UpdateFormElements(Data){if(typeof Data!=='object'){return;}
$.each(Data,function(DataKey,DataValue){var $Element=$('#'+DataKey);if(DataKey==='TicketAttachments'){UpdateTicketAttachments(DataValue);return;}
if((!$Element.length||!DataValue)&&!$Element.is('textarea')){return;}
if($Element.is('select')){$Element.empty();$.each(DataValue,function(Index,Value){var NewOption,OptionText=Core.App.EscapeHTML(Value[1]);NewOption=new Option(OptionText,Value[0],Value[2],Value[3]);if(Value[4]){NewOption.disabled=true;}
NewOption.innerHTML=OptionText;$Element.append(NewOption);});if($Element.hasClass('Modernize')){$Element.trigger('redraw.InputField');}
return;}
if($Element.is('textarea')){UpdateTextarea($Element,DataValue);return;}
$Element.val(DataValue);if($Element.hasClass('Modernize')){$Element.trigger('redraw.InputField');}});}
function RedirectAfterSessionTimeOut(XHRObject){var Headers=XHRObject.getAllResponseHeaders(),OldUrl=location.href,NewUrl=Core.Config.Get('Baselink')+"RequestedURL="+encodeURIComponent(OldUrl);if(Headers.match(/X-OTRS-Login: /)){location.href=NewUrl;return true;}
return false;}
TargetNS.SerializeForm=function($Element,Ignore){var QueryString="";if(typeof Ignore==='undefined'){Ignore={};}
if(isJQueryObject($Element)&&$Element.length){$Element.closest('form').find('input:not(:file), textarea, select').filter(':not([disabled=disabled])').each(function(){var Name=$(this).attr('name')||'';if(!Name.length||typeof Ignore[Name]!=='undefined'){return;}
if($(this).is(':checkbox, :radio')){if($(this).is(':checked')){QueryString+=encodeURIComponent(Name)+'='+encodeURIComponent($(this).val()||'on')+";";}}
else if($(this).is('select')){$.each($(this).find('option:selected'),function(){QueryString+=encodeURIComponent(Name)+'='+encodeURIComponent($(this).val()||'')+";";});}
else{QueryString+=encodeURIComponent(Name)+'='+encodeURIComponent($(this).val()||'')+";";}});}
return QueryString;};TargetNS.FormUpdate=function($EventElement,Subaction,ChangedElement,FieldsToUpdate,SuccessCallback){var URL=Core.Config.Get('Baselink'),Data=GetAdditionalDefaultData(),QueryString;Data.Subaction=Subaction;Data.ElementChanged=ChangedElement;QueryString=TargetNS.SerializeForm($EventElement,Data)+SerializeData(Data);if(FieldsToUpdate){$.each(FieldsToUpdate,function(Index,Value){ToggleAJAXLoader(Value,true);});}
return $.ajax({type:'POST',url:URL,data:QueryString,dataType:'json',success:function(Response,Status,XHRObject){Core.App.Publish('Core.App.AjaxErrorResolved');if(RedirectAfterSessionTimeOut(XHRObject)){return false;}
if(!Response){Core.Exception.HandleFinalError(new Core.Exception.ApplicationError("Invalid JSON from: "+URL,'CommunicationError'));}
else{UpdateFormElements(Response,FieldsToUpdate);if(typeof SuccessCallback==='function'){SuccessCallback();}
Core.App.Publish('Event.AJAX.FormUpdate.Callback',[Response]);}},complete:function(){if(FieldsToUpdate){$.each(FieldsToUpdate,function(Index,Value){ToggleAJAXLoader(Value,false);});}},error:function(XHRObject,Status,Error){HandleAJAXError(XHRObject,Status,Error)}});};TargetNS.ContentUpdate=function($ElementToUpdate,URL,Callback){var QueryString,QueryIndex=URL.indexOf("?"),GlobalResponse;if(QueryIndex>=0){QueryString=URL.substr(QueryIndex+1);URL=URL.substr(0,QueryIndex);}
QueryString+=SerializeData(GetSessionInformation());return $.ajax({type:'POST',url:URL,data:QueryString,dataType:'html',success:function(Response,Status,XHRObject){Core.App.Publish('Core.App.AjaxErrorResolved');if(RedirectAfterSessionTimeOut(XHRObject)){return false;}
if(!Response){Core.Exception.HandleFinalError(new Core.Exception.ApplicationError("No content from: "+URL,'CommunicationError'));}
else if($ElementToUpdate&&isJQueryObject($ElementToUpdate)&&$ElementToUpdate.length){GlobalResponse=Response;$ElementToUpdate.html(Response);}
else{Core.Exception.HandleFinalError(new Core.Exception.ApplicationError("No such element id: "+$ElementToUpdate.attr('id')+" in page!",'CommunicationError'));}},complete:function(){if($.isFunction(Callback)){Callback();}
Core.App.Publish('Event.AJAX.ContentUpdate.Callback',[GlobalResponse]);},error:function(XHRObject,Status,Error){HandleAJAXError(XHRObject,Status,Error)}});};TargetNS.FunctionCall=function(URL,Data,Callback,DataType){if(typeof Data==='string'){Data+=SerializeData(GetSessionInformation());}else{Data=$.extend(Data,GetSessionInformation());}
return $.ajax({type:'POST',url:URL,data:Data,dataType:(typeof DataType==='undefined')?'json':DataType,success:function(Response,Status,XHRObject){Core.App.Publish('Core.App.AjaxErrorResolved');if(RedirectAfterSessionTimeOut(XHRObject)){return false;}
if($.isFunction(Callback)){Callback(Response);Core.App.Publish('Event.AJAX.FunctionCall.Callback',[Response]);}
else{Core.Exception.HandleFinalError(new Core.Exception.ApplicationError("Invalid callback method: "+((typeof Callback==='undefined')?'undefined':Callback.toString())));}},error:function(XHRObject,Status,Error){HandleAJAXError(XHRObject,Status,Error)}});};return TargetNS;}(Core.AJAX||{}));

"use strict";var Core=Core||{};Core.UI=(function(TargetNS){var IDGeneratorCount=0;TargetNS.InitWidgetActionToggle=function(){$(".WidgetAction.Toggle > a")
.each(function(){var $WidgetElement=$(this).closest("div.Header").parent('div'),ContentDivID=TargetNS.GetID($WidgetElement.children('.Content'));if(!$WidgetElement.hasClass('Expanded')&&!$WidgetElement.hasClass('Collapsed')){$WidgetElement.addClass('Expanded');}
$(this)
.attr('aria-controls',ContentDivID)
.attr('aria-expanded',$WidgetElement.hasClass('Expanded'));})
.unbind('click.WidgetToggle')
.bind('click.WidgetToggle',function(Event){var $WidgetElement=$(this).closest("div.Header").parent('div'),Animate=$WidgetElement.hasClass('Animate'),$that=$(this);function ToggleWidget(){$WidgetElement
.toggleClass('Collapsed')
.toggleClass('Expanded')
.end()
.end()
.attr('aria-expanded',$that.closest("div.Header").parent('div').hasClass('Expanded'));Core.App.Publish('Event.UI.ToggleWidget',[$WidgetElement]);}
if(Animate&&Core.Config.Get('AnimationEnabled')){$WidgetElement.addClass('AnimationRunning').find('.Content').slideToggle("fast",function(){ToggleWidget();$WidgetElement.removeClass('AnimationRunning');});}else{ToggleWidget();}
Event.preventDefault();});};TargetNS.InitMessageBoxClose=function(){$(".MessageBox > a.Close")
.unbind('click.MessageBoxClose')
.bind('click.MessageBoxClose',function(Event){$(this).parent().remove();Event.preventDefault();});};TargetNS.GetID=function($Element){var ID;function GenerateID(){return'Core_UI_AutogeneratedID_'+IDGeneratorCount++;}
if($Element){if($Element.attr('id')){ID=$Element.attr('id');}
else{ID=GenerateID();$Element.attr('id',ID);}}
else{ID=GenerateID();}
return ID;};TargetNS.ToggleTwoContainer=function($Element1,$Element2){if(isJQueryObject($Element1,$Element2)&&$Element1.length&&$Element2.length){$Element1.slideToggle('fast',function(){$Element2.slideToggle('fast',function(){Core.UI.InputFields.InitSelect($Element2.find('.Modernize'));});Core.UI.InputFields.InitSelect($Element1.find('.Modernize'));});}};TargetNS.RegisterToggleTwoContainer=function($ClickedElement,$Element1,$Element2){if(isJQueryObject($ClickedElement)&&$ClickedElement.length){$ClickedElement.off('click.UI').on('click.UI',function(){var $ContainerObj=$(this).closest('.WidgetSimple').find('.AllocationListContainer'),FieldName,Data={};if($Element1.is(':visible')){TargetNS.ToggleTwoContainer($Element1,$Element2);}
else{TargetNS.ToggleTwoContainer($Element2,$Element1);}
Data.Columns={};Data.Order=[];$ContainerObj.find('.AvailableFields').find('li').each(function(){FieldName=$(this).attr('data-fieldname');Data.Columns[FieldName]=0;});$ContainerObj.find('.AssignedFields').find('li').each(function(){FieldName=$(this).attr('data-fieldname');Data.Columns[FieldName]=1;Data.Order.push(FieldName);});$ContainerObj.closest('form').find('.ColumnsJSON').val(Core.JSON.Stringify(Data));return false;});}};TargetNS.ScrollTo=function($Element){if(isJQueryObject($Element)&&$Element.length){window.scrollTo(0,$Element.offset().top);}};TargetNS.InitCheckboxSelection=function($Element){if(!$Element.length){return;}
$Element.unbind('click.CheckboxSelection').bind('click.CheckboxSelection',function(Event){var $Checkbox=$(this).find('input[type="checkbox"]');if(!$Checkbox.length){return;}
if($(Event.target).is('input[type="checkbox"]')){return;}
Event.stopPropagation();$Checkbox
.prop('checked',!$Checkbox.prop('checked'))
.triggerHandler('click');});};function ShakeMe($id,Position,PostionEnd){var PositionStart=Position.shift();$id.css('left',PositionStart+'px');if(Position.length>0){setTimeout(function(){ShakeMe($id,Position,PostionEnd);},PostionEnd);}
else{try{$id.css('position','static');}
catch(Event){$.noop(Event);}}}
TargetNS.Shake=function($id){var Position=[15,30,15,0,-15,-30,-15,0];Position=Position.concat(Position.concat(Position));$id.css('position','relative');ShakeMe($id,Position,20);};return TargetNS;}(Core.UI||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.InputFields=(function(TargetNS){var Config={InputFieldPadding:3,SelectionBoxOffsetLeft:5,SelectionBoxOffsetRight:5,ErrorClass:'Error',ServerErrorClass:'ServerError',FadeDuration:150,ResizeEvent:'onorientationchange'in window?'orientationchange':'resize',ResizeTimeout:0,SafeMargin:30,MaxNumberOfOptions:1000,MinQueryLength:4,Diacritics:{"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u0152":"OE","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u1E9E":"SS","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u0153":"oe","\u0276":"oe","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u017F":"s","\u1E9B":"s","\u00DF":"ss","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z","\uFF10":"0","\u2080":"0","\u24EA":"0","\u2070":"0","\u00B9":"1","\u2474":"1","\u2081":"1","\u2776":"1","\u24F5":"1","\u2488":"1","\u2460":"1","\uFF11":"1","\u00B2":"2","\u2777":"2","\u2475":"2","\uFF12":"2","\u2082":"2","\u24F6":"2","\u2461":"2","\u2489":"2","\u00B3":"3","\uFF13":"3","\u248A":"3","\u2476":"3","\u2083":"3","\u2778":"3","\u24F7":"3","\u2462":"3","\u24F8":"4","\u2463":"4","\u248B":"4","\uFF14":"4","\u2074":"4","\u2084":"4","\u2779":"4","\u2477":"4","\u248C":"5","\u2085":"5","\u24F9":"5","\u2478":"5","\u277A":"5","\u2464":"5","\uFF15":"5","\u2075":"5","\u2479":"6","\u2076":"6","\uFF16":"6","\u277B":"6","\u2086":"6","\u2465":"6","\u24FA":"6","\u248D":"6","\uFF17":"7","\u2077":"7","\u277C":"7","\u24FB":"7","\u248E":"7","\u2087":"7","\u247A":"7","\u2466":"7","\u2467":"8","\u248F":"8","\u24FC":"8","\u247B":"8","\u2078":"8","\uFF18":"8","\u277D":"8","\u2088":"8","\u24FD":"9","\uFF19":"9","\u2490":"9","\u277E":"9","\u247C":"9","\u2089":"9","\u2468":"9","\u2079":"9"}};TargetNS.Activate=function($Context){if(Core.Config.Get('InputFieldsActivated')===1){TargetNS.InitSelect($('select.Modernize',$Context));}};TargetNS.Deactivate=function($Context){$('select.Modernize',$Context).each(function(Index,SelectObj){var $SelectObj=$(SelectObj),$ShowTreeObj=$SelectObj.next('.ShowTreeSelection');if($SelectObj.data('modernized')){$('#'+Core.App.EscapeSelector($SelectObj.data('modernized'))).parents('.InputField_Container')
.blur()
.remove();$SelectObj.show()
.removeData('modernized');$ShowTreeObj.show();}});};function InitCallback(){TargetNS.Activate();}
TargetNS.Init=function(){InitCallback();Core.App.Subscribe('Event.UI.ToggleWidget',InitCallback);};function CheckAvailability($SelectObj,$SearchObj,$InputContainerObj){if($SelectObj.attr('disabled')||$SearchObj.data('form-disabled')){$SearchObj.attr('disabled','disabled');$SearchObj.attr('readonly','readonly');$InputContainerObj.addClass('AlreadyDisabled');return;}
$SearchObj.removeAttr('readonly','readonly');$InputContainerObj.removeClass('AlreadyDisabled');if($SelectObj.find('option')
.not("[value='']")
.not("[value='-||']")
.not('[disabled]')
.length===0)
{$SearchObj
.attr('readonly','readonly')
.attr('title',Core.Config.Get('InputFieldsNotAvailable'));$InputContainerObj.find('.InputField_Selection').remove();$InputContainerObj.find('.InputField_More').remove();}
else{$SearchObj
.removeAttr('readonly title')
.val('');}}
function ValidateFormElement($SelectObj){var $FormObj=$SelectObj.closest('form');if($FormObj.hasClass('Validate')){Core.Form.Validate.ValidateElement($SelectObj);}}
function CloseOpenSelections(){$('select.Modernize').each(function(){$('#'+Core.App.EscapeSelector($(this).data('modernized'))).filter('[aria-expanded=true]').trigger('blur');});}
function ShowSelectionBoxes($SelectObj,$InputContainerObj){var Selection,SelectionLength,i=0,OffsetLeft=0,OffsetRight=Config.SelectionBoxOffsetRight,MoreBox=false,Multiple=($SelectObj.attr('multiple')!==''&&$SelectObj.attr('multiple')!==undefined)?true:false,PossibleNone=false,MoreString=Core.Config.Get('InputFieldsMore'),MaxWidth,$SearchObj=$InputContainerObj.find('.InputField_Search'),$TempMoreObj;if($SearchObj.attr('aria-expanded'))return;if($SearchObj.attr('readonly'))return;$InputContainerObj.find('.InputField_Selection').remove();$InputContainerObj.find('.InputField_More').remove();$SelectObj.find('option').each(function(Index,Option){if($(Option).attr('value')===''||$(Option).attr('value')==='||-'){PossibleNone=true;return true;}});if($SelectObj.attr('size')&&parseInt($SelectObj.attr('size'),10)>1){PossibleNone=true;}
if($SelectObj.val()){MaxWidth=$SearchObj.width();if($.isArray($SelectObj.val())){Selection=$.unique($SelectObj.val());SelectionLength=Selection.length;}else{Selection=[$SelectObj.val()];SelectionLength=1;}
if(SelectionLength>1){$TempMoreObj=$('<div />').hide()
.addClass('InputField_More')
.text(MoreString.replace(/%s/,'##'))
.appendTo($InputContainerObj);MaxWidth-=$TempMoreObj.outerWidth();$TempMoreObj.remove();}
$.each(Selection,function(Index,Value){var $SelectionObj,Text,$TextObj,$RemoveObj;if(Value===''||Value==='||-'){return true;}
$SelectionObj=$('<div />').appendTo($InputContainerObj);$SelectionObj.addClass('InputField_Selection')
.data('value',Value);Text=$SelectObj.find('option[value="'+Core.App.EscapeSelector(Value)+'"]').first().text().trim();$TextObj=$('<div />').appendTo($SelectionObj);$TextObj.addClass('Text')
.text(Text)
.off('click.InputField').on('click.InputField',function(){$SearchObj.trigger('focus');});if(PossibleNone||Multiple){$RemoveObj=$('<div />').appendTo($SelectionObj);$RemoveObj.addClass('Remove')
.append($('<a />').attr('href','#')
.attr('title',Core.Config.Get('InputFieldsRemoveSelection'))
.text('x')
.attr('role','button')
.attr('tabindex','-1')
.attr('aria-label',Core.Config.Get('InputFieldsRemoveSelection')+': '+Text)
.off('click.InputField').on('click.InputField',function(){var HasEmptyElement=$SelectObj.find('option[value=""]').length===0?false:true,SelectedValue=$(this).parents('.InputField_Selection')
.data('value');Selection.splice(Selection.indexOf(SelectedValue),1);if(HasEmptyElement&&Selection.length===0){$SelectObj.val('');}
else{$SelectObj.val(Selection);}
ShowSelectionBoxes($SelectObj,$InputContainerObj);setTimeout(function(){$SelectObj.trigger('change');ValidateFormElement($SelectObj);},0);return false;}));}
if(OffsetLeft===0){OffsetLeft=Config.SelectionBoxOffsetLeft;}
if(OffsetLeft+$SelectionObj.outerWidth()<MaxWidth){if($('body').hasClass('RTL')){$SelectionObj.css('right',OffsetLeft+'px')
.show();}
else{$SelectionObj.css('left',OffsetLeft+'px')
.show();}}else{if(i===0){while(MaxWidth>0&&OffsetLeft+$SelectionObj.outerWidth()>=MaxWidth){$TextObj.text($TextObj.text().substring(0,$TextObj.text().length-4)
+'...');}
if($('body').hasClass('RTL')){$SelectionObj.css('right',OffsetLeft+'px')
.show();}
else{$SelectionObj.css('left',OffsetLeft+'px')
.show();}}
else{if(!MoreBox){$SelectionObj.after($('<div />').addClass('InputField_More')
.css(($('body').hasClass('RTL')?'right':'left'),OffsetLeft+'px')
.text(MoreString.replace(/%s/,SelectionLength-i))
.on('click.InputField',function(){$SearchObj.trigger('focus');}));MoreBox=true;}
$SelectionObj.remove();return false;}}
OffsetLeft+=$SelectionObj.outerWidth()+OffsetRight;i++;});}}
function HideSelectList($SelectObj,$InputContainerObj,$SearchObj,$ListContainerObj,$TreeContainerObj){if($ListContainerObj&&$TreeContainerObj){$ListContainerObj.fadeOut(Config.FadeDuration,function(){$TreeContainerObj.find('.jstree')
.jstree('destroy')
.remove();$(this).remove();Core.App.Publish('Event.UI.InputFields.Closed',$SearchObj);});$InputContainerObj.find('.InputField_ClearSearch')
.remove();$SearchObj.removeAttr('aria-expanded');}
if(!$SearchObj.attr('readonly')){$SearchObj.val('');}
ShowSelectionBoxes($SelectObj,$InputContainerObj);if($SelectObj.data('changed')){$SelectObj.removeData('changed');setTimeout(function(){$SelectObj.trigger('change');ValidateFormElement($SelectObj);},0);}}
function RegisterActionEvent($TreeObj,$ActionObj,ActionType){switch(ActionType){case'SelectAll':$ActionObj.off('click.InputField').on('click.InputField',function(){$TreeObj.jstree('open_all');$TreeObj.find('li')
.not('.jstree-clicked,.Disabled')
.each(function(){$TreeObj.jstree('select_node',this);});return false;}).on('mousedown.InputField',function(){return false;});break;case'SelectAll_Search':$ActionObj.off('click.InputField').on('click.InputField',function(){$TreeObj.find('li:visible .jstree-search')
.not('.jstree-clicked,.Disabled')
.each(function(){$TreeObj.jstree('select_node',this);});return false;});break;case'ClearAll':$ActionObj.off('click.InputField').on('click.InputField',function(){$TreeObj.jstree('deselect_node',$TreeObj.jstree('get_selected'));return false;}).on('mousedown.InputField',function(){return false;});break;case'ClearAll_Search':$ActionObj.off('click.InputField').on('click.InputField',function(){var SelectedNodesIDs=$TreeObj.jstree('get_selected');$.each(SelectedNodesIDs,function(){var $Node=$('#'+this);if($Node.is(':visible')){$TreeObj.jstree('deselect_node',this);}});return false;});break;case'Confirm':$ActionObj.off('click.InputField').on('click.InputField',function(){$TreeObj.blur();return false;});break;}}
function ApplyFilter($SelectObj,$ToolbarContainerObj){var Selection,FilterIndex;if($SelectObj.val()){if($.isArray($SelectObj.val())){Selection=$SelectObj.val();}else{Selection=[$SelectObj.val()];}
$SelectObj.data('selection',Selection);}
$SelectObj.empty();if($SelectObj.data('filtered')&&$SelectObj.data('filtered')!=='0'){FilterIndex=parseInt($SelectObj.data('filtered'),10)-1;$.each($SelectObj.data('filters').Filters[FilterIndex].Data,function(Index,Option){var $OptionObj=$('<option />');$OptionObj.attr('value',Option.Key)
.text(Option.Value);if(Option.Disabled){$OptionObj.attr('disabled',true);}
if(Option.Selected){$OptionObj.attr('selected',true);}
$SelectObj.append($OptionObj);});if($ToolbarContainerObj){if(!$ToolbarContainerObj.find('.InputField_Filters')
.hasClass('Active'))
{$ToolbarContainerObj.find('.InputField_Filters')
.addClass('Active')
.prepend('<i class="fa fa-filter" /> ');}}}
else{if($ToolbarContainerObj){$ToolbarContainerObj.find('.InputField_Filters')
.removeClass('Active')
.find('.fa.fa-filter')
.remove();}
$SelectObj.append($SelectObj.data('original'));}
if($SelectObj.data('selection')){$SelectObj.val($SelectObj.data('selection'));$SelectObj.removeData('selection');}}
function RegisterFilterEvent($SelectObj,$InputContainerObj,$ToolbarContainerObj,$FilterObj,ActionType){var $SearchObj;switch(ActionType){case'ShowFilters':$FilterObj.off('click.InputField').on('click.InputField',function(){var $FiltersListObj=$ToolbarContainerObj.find('.InputField_FiltersList');if($FiltersListObj.is(':visible')){$FiltersListObj.hide();}
else{$FiltersListObj.show();}
return false;}).on('mousedown.InputField',function(){return false;});break;case'Filter':$FilterObj.off('click.InputField').on('click.InputField',function(Event){$FilterObj.siblings('input').each(function(Index,Filter){if($(Filter).attr('id')!==$FilterObj.attr('id')){$(Filter).attr('checked',false);}});Event.stopPropagation();})
.off('change.InputField').on('change.InputField',function(){if(this.checked){$SelectObj.data('filtered',$FilterObj.data('index'));}
else{$SelectObj.data('filtered','0');}
ApplyFilter($SelectObj,$ToolbarContainerObj);$SearchObj=$('#'+Core.App.EscapeSelector($SelectObj.data('modernized')));$SearchObj.width($SelectObj.outerWidth())
.trigger('blur');CheckAvailability($SelectObj,$SearchObj,$InputContainerObj);setTimeout(function(){$SearchObj.focus();},0);})
.on('mousedown.InputField',function(){return false;});break;}}
function FocusNextElement($Element){var $TabbableElements=$Element.closest('form')
.find(':tabbable:visible')
.not($Element.closest('.InputField_Container').find(':tabbable:visible'))
.add($Element);setTimeout(function(){$TabbableElements.eq($TabbableElements.index($Element)+1)
.focus();},0);}
function FocusPreviousElement($Element){var $TabbableElements=$Element.closest('form')
.find(':tabbable:visible')
.not($Element.closest('.InputField_Container').find(':tabbable:visible'))
.add($Element);setTimeout(function(){$TabbableElements.eq($TabbableElements.index($Element)-1)
.focus();},0);}
TargetNS.RemoveDiacritics=function(Str){var Chars=Str.split(''),i=Chars.length-1,Alter=false,Ch;for(;i>=0;i--){Ch=Chars[i];if(Config.Diacritics.hasOwnProperty(Ch)){Chars[i]=Config.Diacritics[Ch];Alter=true;}}
if(Alter){Str=Chars.join('');}
return Str;}
TargetNS.InitSelect=function($SelectFields){if(!$SelectFields.length){return false;}
$SelectFields.each(function(Index,SelectObj){var $ToolbarContainerObj,$InputContainerObj,$TreeContainerObj,$ListContainerObj,$ContainerObj,$ToolbarObj,$SearchObj,$SelectObj,$LabelObj,Multiple,TreeView,Focused,TabFocus,SearchID,SkipFocus,Searching,Filterable,SelectWidth,SearchLabel,$FiltersObj,$ShowTreeObj,$FiltersListObj,WholeRowClicked,ScrollEventListener;if($(SelectObj).children('option').length>Config.MaxNumberOfOptions){return;}
if($(SelectObj).is(':visible')){$SelectObj=$(SelectObj);Multiple=($SelectObj.attr('multiple')!==''&&$SelectObj.attr('multiple')!==undefined)?true:false;Filterable=($SelectObj.data('filters')!==''&&$SelectObj.data('filters')!==undefined)?true:false;TreeView=false;SkipFocus=false;TabFocus=false;Searching=false;Focused=null;SelectWidth=$SelectObj.outerWidth();$SelectObj.hide();$ShowTreeObj=$SelectObj.next('.ShowTreeSelection');if($SelectObj.data('tree')||$ShowTreeObj.length){if($ShowTreeObj.length){$ShowTreeObj.hide();}
$SelectObj.data('tree',true);TreeView=true;}
$ContainerObj=$('<div />').insertBefore($SelectObj);$ContainerObj.addClass('InputField_Container')
.attr('tabindex','-1');$InputContainerObj=$('<div />').appendTo($ContainerObj);$InputContainerObj.addClass('InputField_InputContainer');SearchID=$SelectObj.attr('id');if(!SearchID){SearchID=Core.UI.GetID($SelectObj);}
SearchID+='_Search';$SelectObj.data('modernized',SearchID);$SearchObj=$('<input />').appendTo($InputContainerObj);$SearchObj.attr('id',SearchID)
.addClass('InputField_Search')
.attr('type','text')
.attr('role','search')
.attr('autocomplete','off');if($SelectObj.hasClass('Small')){$SearchObj.addClass('Small');}
$SearchObj.width(SelectWidth);Core.App.Subscribe('Event.UI.InputFields.Resize',function(){$SearchObj.blur().hide();SelectWidth=$SelectObj.show().outerWidth();$SelectObj.hide();$SearchObj.width(SelectWidth).show();});if($SelectObj.attr('id')){$LabelObj=$('label[for="'+Core.App.EscapeSelector($SelectObj.attr('id'))+'"]');if($LabelObj.length>0){$LabelObj.on('click.InputField',function(){$SearchObj.focus();});$SearchObj.attr('aria-label',$LabelObj.text());}}
if(!$LabelObj||$LabelObj.length===0){if($SelectObj.attr('aria-label')){SearchLabel=$SelectObj.attr('aria-label');}
else if($SelectObj.attr('title')){SearchLabel=$SelectObj.attr('title');}
else{SearchLabel=SearchID.replace(/_/g,' ');}
$SearchObj.attr('aria-label',SearchLabel);}
if($SelectObj.hasClass(Config.ErrorClass)){$SearchObj.addClass(Config.ErrorClass);}
if($SelectObj.hasClass(Config.ServerErrorClass)){$SearchObj.addClass(Config.ServerErrorClass);}
if(Filterable){$SelectObj.data('original',$SelectObj.children());if($SelectObj.data('filtered')&&$SelectObj.data('filtered')!=='0')
{ApplyFilter($SelectObj,$ToolbarContainerObj);}}
ShowSelectionBoxes($SelectObj,$InputContainerObj);CheckAvailability($SelectObj,$SearchObj,$InputContainerObj);Core.App.Subscribe('Event.Form.DisableForm',function($Form){if($Form.find($SearchObj).attr('readonly')){$SearchObj.data('form-disabled',true);CheckAvailability($SelectObj,$SearchObj,$InputContainerObj);}});Core.App.Subscribe('Event.Form.EnableForm',function($Form){if(!$Form.find($SearchObj).attr('readonly')){$SearchObj.removeData('form-disabled');CheckAvailability($SelectObj,$SearchObj,$InputContainerObj);}});Core.App.Subscribe('Event.UI.Dialog.ShowDialog.DragStart',function(){CloseOpenSelections();});Core.App.Subscribe('Event.UI.Dialog.ShowDialog.BeforeOpen',function(){CloseOpenSelections();});Core.App.Subscribe('Event.UI.Dialog.CloseDialog.Close',function(){CloseOpenSelections();});Core.App.Subscribe('Event.UI.RichTextEditor.Focus',function(){CloseOpenSelections();});Core.App.Subscribe('Event.Agent.TicketZoom.ArticleClick',function(){CloseOpenSelections();});$SearchObj.off('focus.InputField')
.on('focus.InputField',function(){var TreeID,$TreeObj,SelectedID,OldSelectedID,Elements,SelectedNodes,AvailableHeightBottom,AvailableHeightTop,AvailableMaxHeight,PossibleNone,$ClearAllObj,$SelectAllObj,$ConfirmObj,ErrorTooltipPosition='TongueTop';function CalculateListPosition(){AvailableHeightBottom=parseInt($(window).scrollTop()+$(window).height()
-($InputContainerObj.offset().top
+$InputContainerObj.outerHeight()
+Config.SafeMargin),10);AvailableHeightTop=parseInt($InputContainerObj.offset().top-$(window).scrollTop()-Config.SafeMargin,10);$ListContainerObj
.css({left:$InputContainerObj.offset().left});if(AvailableHeightTop>AvailableHeightBottom){AvailableMaxHeight=AvailableHeightTop;$SearchObj.removeClass('ExpandToBottom')
.addClass('ExpandToTop');$ListContainerObj
.removeClass('ExpandToBottom')
.addClass('ExpandToTop')
.css({top:'auto',bottom:parseInt($('body').height()-$InputContainerObj.offset().top,10)});}
else{AvailableMaxHeight=AvailableHeightBottom;$SearchObj.removeClass('ExpandToTop')
.addClass('ExpandToBottom');$ListContainerObj
.removeClass('ExpandToTop')
.addClass('ExpandToBottom')
.css({top:parseInt($InputContainerObj.offset().top+$InputContainerObj.outerHeight(),10),bottom:'auto'});}}
$SelectObj.find('option').each(function(Index,Option){if($(Option).attr('value')===''||$(Option).attr('value')==='||-'){PossibleNone=true;return true;}});function ShowErrorToolTip(){if($SelectObj.attr('id')){if($SearchObj.hasClass('ExpandToTop')){ErrorTooltipPosition='TongueBottom';}
else{ErrorTooltipPosition='TongueTop';}
if($SelectObj.hasClass(Config.ErrorClass)){Core.Form.ErrorTooltips.ShowTooltip($SearchObj,$('#'+Core.App.EscapeSelector($SelectObj.attr('id'))+Config.ErrorClass).html(),ErrorTooltipPosition);}
if($SelectObj.hasClass(Config.ServerErrorClass)){Core.Form.ErrorTooltips.ShowTooltip($SearchObj,$('#'+Core.App.EscapeSelector($SelectObj.attr('id'))+Config.ServerErrorClass).html(),ErrorTooltipPosition);}}}
ShowErrorToolTip();Focused=this;SkipFocus=false;if($SearchObj.attr('aria-expanded')){return false;}
if($SearchObj.attr('readonly')){return false;}
CloseOpenSelections();$SearchObj.attr('aria-expanded',true);$InputContainerObj.find('.InputField_Selection').remove();$InputContainerObj.find('.InputField_More').remove();$ListContainerObj=$('<div />')
.addClass('InputField_ListContainer')
.attr('tabindex','-1')
.appendTo('body');CalculateListPosition();ScrollEventListener=function(Event){if(!$ListContainerObj){return;}
CalculateListPosition();ShowErrorToolTip();if(Event.target!==document&&!$(Event.target).hasClass('InputField_TreeContainer')){if($InputContainerObj.position().top+$InputContainerObj.outerHeight()-$(Event.target).outerHeight()>=0)
{$ListContainerObj.hide();}else{$ListContainerObj.show();}}};document.addEventListener('scroll',ScrollEventListener,true);$TreeContainerObj=$('<div />').appendTo($ListContainerObj);$TreeContainerObj.addClass('InputField_TreeContainer')
.attr('tabindex','-1');if(Filterable){AvailableMaxHeight-=$SelectObj.data('filters').Filters.length*Config.SafeMargin;}
if(AvailableMaxHeight<90){AvailableMaxHeight=90;}
$TreeContainerObj.css('max-height',AvailableMaxHeight+'px');$TreeContainerObj.width($SearchObj.width()
+Config.InputFieldPadding*2);TreeID=$SelectObj.attr('id');if(!TreeID){TreeID=Core.UI.GetID($SelectObj);}
TreeID+='_Select';$TreeObj=$('<div id="'+Core.App.EscapeSelector(TreeID)+'"><ul></ul></div>');SelectedID=$SelectObj.val();Elements={};SelectedNodes=[];Elements=Core.UI.TreeSelection.BuildElementsArray($SelectObj,TreeView);if(Elements.HighestLevel===0&&!$SelectObj.data('tree')){TreeView=false;}
$TreeObj.jstree({core:{animation:70,data:Elements,multiple:Multiple,expand_selected_onload:true,check_callback:true,themes:{name:'InputField',variant:(TreeView)?'Tree':'NoTree',icons:false,dots:false,url:false}},search:{show_only_matches:true,show_only_matches_children:true,search_callback:function(Search,Node){var SearchString=TargetNS.RemoveDiacritics(Search),NodeString=TargetNS.RemoveDiacritics(Node.text);return((NodeString.toLowerCase().indexOf(SearchString.toLowerCase())!==-1||NodeString.toUpperCase().indexOf(SearchString.toUpperCase())!==-1));}},plugins:['multiselect','search','wholerow']})
.on('focus.jstree','.jstree-anchor',function(){if(!SkipFocus){Focused=this;}else{SkipFocus=false;}})
.on('focus.jstree',function(){if(!SkipFocus){Focused=this;}else{SkipFocus=false;}
if(TabFocus){$($TreeObj.find('a.jstree-anchor:visible')
.not('.jstree-disabled')
.get(0)).trigger('focus.jstree');TabFocus=false;}})
.on('mousedown.jstree',function(Event){var $Target=$(Event.target);if($Target.hasClass('jstree-wholerow')){WholeRowClicked=$Target;}})
.on('blur.jstree','.jstree-anchor',function(){setTimeout(function(){if(!Focused){HideSelectList($SelectObj,$InputContainerObj,$SearchObj,$ListContainerObj,$TreeContainerObj);}
Focused=null;},0);})
.on('blur.jstree',function(){setTimeout(function(){if(!Focused&&!WholeRowClicked){HideSelectList($SelectObj,$InputContainerObj,$SearchObj,$ListContainerObj,$TreeContainerObj);}
Focused=null;WholeRowClicked=null;},0);})
.on('select_node.jstree',function(Node,Selected,Event){var $SelectedNode=$('#'+Selected.node.id),SelectedNodesIDs;if($SelectedNode.hasClass('Disabled')||!$SelectedNode.is(':visible')){$TreeObj.jstree('deselect_node',Selected.node);}
SelectedNodes=[];SelectedNodesIDs=$TreeObj.jstree('get_selected');$.each(SelectedNodesIDs,function(){var $Node=$('#'+this);SelectedNodes.push($Node.data('id'));});$SelectObj.val(SelectedNodes);OldSelectedID=SelectedID;SelectedID=$SelectObj.val();if(!Multiple){SkipFocus=true;$TreeObj.blur();}
$SelectObj.data('changed',true);return false;})
.on('click.jstree',function(Event){var $HoveredNode,HoveredValue;Event.preventDefault();if(typeof Event.originalEvent!=='undefined'&&Event.originalEvent.type==='keydown'&&Event.originalEvent.which===$.ui.keyCode.ENTER){$HoveredNode=$TreeObj.find('.jstree-hovered');HoveredValue=$HoveredNode.closest('li').data('id');if(!Multiple){if(HoveredValue!==OldSelectedID){$TreeObj.jstree('deselect_all');$TreeObj.jstree('select_node',$HoveredNode.get(0));}
else{if(PossibleNone){$TreeObj.jstree('deselect_all');$SelectObj.val('');}}
FocusNextElement($SearchObj);}}
Event.stopPropagation();return false;})
.on('deselect_node.jstree',function(){var SelectedNodesIDs,HasEmptyElement=$SelectObj.find('option[value=""]').length===0?false:true;if(Multiple){SelectedNodes=[];SelectedNodesIDs=$TreeObj.jstree('get_selected');$.each(SelectedNodesIDs,function(){var $Node=$('#'+this);SelectedNodes.push($Node.data('id'));});if(HasEmptyElement&&SelectedNodes.length===0){$SelectObj.val('');}
else{$SelectObj.val(SelectedNodes);}
OldSelectedID=SelectedID;SelectedID=$SelectObj.val();$SelectObj.data('changed',true);}})
.on('dblclick.jstree','.jstree-wholerow',function(Event){var Node;if(TreeView){Node=$(Event.target).closest('li');$TreeObj.jstree('toggle_node',Node);}})
.keydown(function(Event){var $HoveredNode;switch(Event.which){case $.ui.keyCode.TAB:$HoveredNode=$TreeObj.find('.jstree-hovered');if(!Multiple){$TreeObj.jstree('deselect_all');}
$TreeObj.jstree('select_node',$HoveredNode.get(0));if(Event.shiftKey){FocusPreviousElement($SearchObj);}
else{FocusNextElement($SearchObj);}
break;case $.ui.keyCode.ESCAPE:Event.preventDefault();$TreeObj.blur();break;case $.ui.keyCode.SPACE:Event.preventDefault();$HoveredNode=$TreeObj.find('.jstree-hovered');if(!Multiple){if(!$HoveredNode.hasClass('jstree-clicked')){$TreeObj.jstree('deselect_all');$TreeObj.jstree('select_node',$HoveredNode.get(0));}
else{if(PossibleNone){$TreeObj.jstree('deselect_all');$SelectObj.val('');setTimeout(function(){$SelectObj.trigger('change');ValidateFormElement($SelectObj);},0);}}
FocusNextElement($SearchObj);}
else{if($HoveredNode.hasClass('jstree-clicked')){$TreeObj.jstree('deselect_node',$HoveredNode.get(0));}
else{$TreeObj.jstree('select_node',$HoveredNode.get(0));}}
break;case 65:if(Event.ctrlKey||Event.metaKey){Event.preventDefault();$ListContainerObj.find('.InputField_SelectAll')
.click();}
break;case 68:if(Event.ctrlKey||Event.metaKey){Event.preventDefault();$ListContainerObj.find('.InputField_ClearAll')
.click();}
break;case 70:if(Event.ctrlKey||Event.metaKey){Event.preventDefault();$ListContainerObj.find('.InputField_Filters')
.click();$ListContainerObj.find('.InputField_FiltersList').children('input').first().focus();}
break;}})
.on('loaded.jstree',function(){if(SelectedID){if(typeof SelectedID==='object'){$.each(SelectedID,function(NodeIndex,Data){$TreeObj.jstree('select_node',$TreeObj.find('li[data-id="'+Core.App.EscapeSelector(Data)+'"]'));});}
else{$TreeObj.jstree('select_node',$TreeObj.find('li[data-id="'+Core.App.EscapeSelector(SelectedID)+'"]'));}}
Core.App.Publish('Event.UI.InputFields.Expanded',$SearchObj);});$TreeContainerObj.on('focus.InputField',function(){if(!SkipFocus){Focused=this;}else{SkipFocus=false;}}).on('blur.jstree',function(){setTimeout(function(){if(!Focused){HideSelectList($SelectObj,$InputContainerObj,$SearchObj,$ListContainerObj,$TreeContainerObj);}
Focused=null;},0);});$TreeObj
.appendTo($TreeContainerObj)
.show();$ToolbarContainerObj=$('<div />').appendTo($ListContainerObj);$ToolbarContainerObj.addClass('InputField_ToolbarContainer')
.attr('tabindex','-1')
.width($TreeContainerObj.width());$ToolbarObj=$('<ul />').appendTo($ToolbarContainerObj)
.attr('tabindex','-1')
.on('focus.InputField',function(){if(!SkipFocus){Focused=this;}else{SkipFocus=false;}}).on('blur.InputField',function(){setTimeout(function(){if(!Focused){HideSelectList($SelectObj,$InputContainerObj,$SearchObj,$ListContainerObj,$TreeContainerObj);}
Focused=null;},0);});if(Multiple){$SelectAllObj=$('<a />').addClass('InputField_SelectAll')
.attr('href','#')
.attr('role','button')
.attr('tabindex','-1')
.text(Core.Config.Get('InputFieldsSelectAll'))
.attr('aria-label',Core.Config.Get('InputFieldsSelectAll'))
.appendTo($ToolbarObj)
.wrap('<li />');RegisterActionEvent($TreeObj,$SelectAllObj,'SelectAll');$ClearAllObj=$('<a />').addClass('InputField_ClearAll')
.attr('href','#')
.attr('role','button')
.attr('tabindex','-1')
.text(Core.Config.Get('InputFieldsClearAll'))
.attr('aria-label',Core.Config.Get('InputFieldsClearAll'))
.appendTo($ToolbarObj)
.wrap('<li />');RegisterActionEvent($TreeObj,$ClearAllObj,'ClearAll');}
if(Filterable){$FiltersObj=$('<a />').addClass('InputField_Filters')
.attr('href','#')
.attr('role','button')
.attr('tabindex','-1')
.text(Core.Config.Get('InputFieldsFilters'))
.attr('aria-label',Core.Config.Get('InputFieldsFilters'))
.appendTo($ToolbarObj)
.wrap('<li />');RegisterFilterEvent($SelectObj,$InputContainerObj,$ToolbarContainerObj,$FiltersObj,'ShowFilters');if(!$SelectObj.data('filtered')){$SelectObj.data('filtered','0');}else if($SelectObj.data('filtered')!=='0'){$FiltersObj.addClass('Active')
.prepend('<i class="fa fa-filter" /> ');}
$FiltersListObj=$('<div />').appendTo($ToolbarContainerObj);$FiltersListObj.addClass('InputField_FiltersList')
.attr('tabindex','-1');if(!$SelectObj.data('expand-filters')&&$SelectObj.data('expand-filters')!=='0')
{$FiltersListObj.hide();}
$.each($SelectObj.data('filters').Filters,function(FilterIndex,Filter){var $FilterObj=$('<input />').appendTo($FiltersListObj),$SpanObj=$('<span />').appendTo($FiltersListObj);$FilterObj.attr('type','checkbox')
.attr('tabindex','-1')
.data('index',FilterIndex+1);if($SelectObj.data('filtered')&&parseInt($SelectObj.data('filtered'),10)===FilterIndex+1)
{$FilterObj.attr('checked',true);}
if(Filter.Data.length===1&&(Filter.Data[0].Key===''||Filter.Data[0].Key==='||-'))
{$FilterObj.attr('disabled',true);}
Core.UI.GetID($FilterObj);$SpanObj.text(Filter.Name);$SpanObj.on('click',function(Event){$FilterObj.click();Event.stopPropagation();});$('<br />').appendTo($FiltersListObj);RegisterFilterEvent($SelectObj,$InputContainerObj,$ToolbarContainerObj,$FilterObj,'Filter');});$FiltersListObj
.on('focus','input',function(){Focused=this;})
.on('keydown','input',function(Event){var $FilterElements,FilterElementIndex;switch(Event.which){case $.ui.keyCode.TAB:$FilterElements=$FiltersListObj.find('input');FilterElementIndex=$FilterElements.index(Event.target);if(!Event.shiftKey){Event.preventDefault();Event.stopPropagation();if(FilterElementIndex+1===$FilterElements.length){$FilterElements.first().focus();}
else{$FilterElements.eq(FilterElementIndex+1).focus();}}
else{Event.preventDefault();Event.stopPropagation();if(FilterElementIndex===0){$FilterElements.last().focus();}
else{$FilterElements.eq(FilterElementIndex-1).focus();}}
break;case $.ui.keyCode.ESCAPE:$ListContainerObj.find('.InputField_Filters')
.click();$SearchObj.focus();break;case 70:if(Event.ctrlKey||Event.metaKey){Event.preventDefault();$ListContainerObj.find('.InputField_Filters')
.click();$SearchObj.focus();}
break;}});}
if(Multiple){$ConfirmObj=$('<a />').addClass('InputField_Confirm')
.attr('href','#')
.attr('role','button')
.attr('tabindex','-1')
.text(Core.Config.Get('InputFieldsConfirm'))
.attr('aria-label',Core.Config.Get('InputFieldsConfirm'))
.appendTo($ToolbarObj)
.prepend('<i class="fa fa-check-square-o" /> ')
.wrap('<li />');RegisterActionEvent($TreeObj,$ConfirmObj,'Confirm');}
if($ToolbarObj.children().length===0){$ToolbarContainerObj.hide();}
$SearchObj.off('keyup.InputField').on('keyup.InputField',function(){var SearchValue=$SearchObj.val().trim(),NoMatchNodeJSON,$ClearSearchObj,SearchTimeout;window.clearTimeout(SearchTimeout);SearchTimeout=window.setTimeout(function(){if(SearchValue===''){$TreeObj.jstree('delete_node',$TreeObj.find('.jstree-no-match'));$TreeObj.jstree('clear_search');Searching=false;$SearchObj.siblings('.InputField_ClearSearch')
.remove();if(Multiple){$SelectAllObj.off('click.InputField').on('click.InputField',function(){$TreeObj.jstree('open_all');$TreeObj.find('li')
.not('.jstree-clicked,.Disabled')
.each(function(){$TreeObj.jstree('select_node',this);});return false;});$ClearAllObj.off('click.InputField').on('click.InputField',function(){$TreeObj.jstree('deselect_node',$TreeObj.jstree('get_selected'));return false;});}
return false;}
$TreeObj.jstree('delete_node',$TreeObj.find('.jstree-no-match'));$TreeObj.jstree('search',Core.App.EscapeHTML(SearchValue));Searching=true;if(Multiple){RegisterActionEvent($TreeObj,$SelectAllObj,'SelectAll_Search');RegisterActionEvent($TreeObj,$ClearAllObj,'ClearAll_Search');}
if($TreeObj.find('.jstree-search').length===0){NoMatchNodeJSON={text:Core.Config.Get('InputFieldsNoMatchMsg'),state:{disabled:true},'li_attr':{class:'Disabled jstree-no-match'}};$TreeObj.jstree('create_node',$TreeObj,NoMatchNodeJSON);$TreeObj.find('li:visible')
.not('.jstree-no-match')
.hide();}
if($SearchObj.siblings('.InputField_ClearSearch').length===0){$ClearSearchObj=$('<a />').insertAfter($SearchObj);$ClearSearchObj.addClass('InputField_Action InputField_ClearSearch')
.attr('href','#')
.attr('title',Core.Config.Get('InputFieldsClearSearch'))
.css(($('body').hasClass('RTL')?'left':'right'),Config.SelectionBoxOffsetRight+'px')
.append($('<i />').addClass('fa fa-times-circle'))
.attr('role','button')
.attr('tabindex','-1')
.attr('aria-label',Core.Config.Get('InputFieldsClearSearch'))
.off('click.InputField').on('click.InputField',function(){$SearchObj.val('');$TreeObj.jstree('delete_node',$TreeObj.find('.jstree-no-match'));$TreeObj.jstree('clear_search');Searching=false;if(Multiple){RegisterActionEvent($TreeObj,$SelectAllObj,'SelectAll');RegisterActionEvent($TreeObj,$ClearAllObj,'ClearAll');}
$(this).remove();return false;}).on('mousedown.InputField',function(){return false;});}},250);});if(!$SearchObj.parents('.Dialog').length||$SearchObj.parents('.Dialog').length&&($InputContainerObj.position().top+$InputContainerObj.outerHeight()-$SearchObj.parents('.Dialog').find('.InnerContent').outerHeight()<0)){$ListContainerObj.fadeIn(Config.FadeDuration);}})
.off('blur.InputField').on('blur.InputField',function(){document.removeEventListener('scroll',ScrollEventListener,true);setTimeout(function(){if(!Focused){HideSelectList($SelectObj,$InputContainerObj,$SearchObj,$ListContainerObj,$TreeContainerObj);}
Focused=null;},0);Core.Form.ErrorTooltips.HideTooltip();})
.keydown(function(Event){var $TreeObj=$TreeContainerObj.find('.jstree');switch(Event.which){case $.ui.keyCode.ENTER:Event.preventDefault();Event.stopPropagation();break;case $.ui.keyCode.TAB:if(!Event.shiftKey){TabFocus=true;}
Focused=null;break;case $.ui.keyCode.ESCAPE:Event.preventDefault();$TreeObj.blur();$SearchObj.blur();break;case $.ui.keyCode.UP:Event.preventDefault();$($TreeObj.find('a.jstree-anchor:visible')
.not('.jstree-disabled')
.last()
.get(0)).trigger('focus.jstree');break;case $.ui.keyCode.DOWN:Event.preventDefault();$($TreeObj.find('a.jstree-anchor:visible')
.not('.jstree-disabled')
.get(0)).trigger('focus.jstree');break;case 65:if(Event.ctrlKey||Event.metaKey){if(!Searching){Event.preventDefault();$ListContainerObj.find('.InputField_SelectAll')
.click();}}
break;case 68:if(Event.ctrlKey||Event.metaKey){Event.preventDefault();$ListContainerObj.find('.InputField_ClearAll')
.click();}
break;case 70:if(Event.ctrlKey||Event.metaKey){Event.preventDefault();$ListContainerObj.find('.InputField_Filters')
.click();$ListContainerObj.find('.InputField_FiltersList').children('input').first().focus();}
break;}})
.off('remove.InputField').on('remove.InputField',function(){CloseOpenSelections();});$SelectObj.off('redraw.InputField').on('redraw.InputField',function(){if(!$SearchObj.is(':visible'))return;CloseOpenSelections();if(Filterable){$SelectObj.data('original',$SelectObj.children());if($SelectObj.data('filtered')&&$SelectObj.data('filtered')!=='0')
{ApplyFilter($SelectObj,$ToolbarContainerObj);}}
CheckAvailability($SelectObj,$SearchObj,$InputContainerObj);$SearchObj.width($SelectObj.outerWidth());ShowSelectionBoxes($SelectObj,$InputContainerObj);})
.off('error.InputField').on('error.InputField',function(){if($SelectObj.hasClass(Config.ErrorClass)){$SearchObj.addClass(Config.ErrorClass);}
else{$SearchObj.removeClass(Config.ErrorClass);}
if($SelectObj.hasClass(Config.ServerErrorClass)){$SearchObj.addClass(Config.ServerErrorClass);}
else{$SearchObj.removeClass(Config.ServerErrorClass);}});}});$('body').off('click.InputField').on('click.InputField',function(){if($('.InputField_ListContainer').length&&(!$(document.activeElement).parents('.InputField_Container').length||document.activeElement.tagName.toUpperCase()!=='INPUT')){CloseOpenSelections();}});return true;};TargetNS.IsEnabled=function($Element){if($Element.data('modernized')&&$Element.data('modernized')!==''){return true;}
return false;};$.jstree.defaults.multiselect={};$.jstree.plugins.multiselect=function(options,parent){this.activate_node=function(obj,e){e.ctrlKey=true;parent.activate_node.call(this,obj,e);};};$(window).on(Config.ResizeEvent+'.InputField',function(){clearTimeout(Config.ResizeTimeout);Config.ResizeTimeout=setTimeout(function(){Core.App.Publish('Event.UI.InputFields.Resize');},100);});return TargetNS;}(Core.UI.InputFields||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Accordion=(function(TargetNS){var AccordionAnimationRunning=false;TargetNS.AnimationIsRunning=function(){return AccordionAnimationRunning;};TargetNS.StartAnimation=function(){AccordionAnimationRunning=true;};TargetNS.StopAnimation=function(){AccordionAnimationRunning=false;};TargetNS.ContentSelector=undefined;TargetNS.Init=function($Element,LinkSelector,ContentSelector){var $LinkSelectors=$Element.find(LinkSelector);if(!isJQueryObject($Element)||$Element.length===0){return false;}
if($LinkSelectors.length===0){return false;}
TargetNS.ContentSelector=ContentSelector;$LinkSelectors.click(function(){var $ListElement=$(this).closest('li');TargetNS.OpenElement($ListElement,true);return false;});};TargetNS.OpenElement=function($ListElement,WithAnimation){var $AllListElements,$ActiveListElement;if($ListElement.hasClass('Active')){return false;}
if(TargetNS.AnimationIsRunning()){return false;}
$AllListElements=$ListElement.parent('ul').find('li');$ActiveListElement=$AllListElements.filter('.Active');if(WithAnimation){TargetNS.StartAnimation();$AllListElements.find('div.Content div').css('overflow','hidden');$AllListElements.find('div.Content div').each(function(){$(this).data('overflow',$(this).css('overflow'));$(this).css('overflow','hidden');});$ActiveListElement.find(TargetNS.ContentSelector).add($ListElement.find(TargetNS.ContentSelector)).slideToggle("slow",function(){$AllListElements.find('div.Content div').each(function(){$(this).css('overflow',$(this).data('overflow'));});$ListElement.addClass('Active');$ActiveListElement.removeClass('Active');TargetNS.StopAnimation();});}
else{$ActiveListElement.find(TargetNS.ContentSelector).add($ListElement.find(TargetNS.ContentSelector)).toggle();$ListElement.addClass('Active');$ActiveListElement.removeClass('Active');}};return TargetNS;}(Core.UI.Accordion||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Datepicker=(function(TargetNS){var VacationDays,VacationDaysOneTime,LocalizationData,DatepickerCount=0;if(!Core.Debug.CheckDependency('Core.UI.Datepicker','$([]).datepicker','jQuery UI datepicker')){return false;}
function CheckDate(DateObject){var DayDescription='',DayClass='';if(typeof VacationDays==='undefined'){VacationDays=Core.Config.Get('Datepicker.VacationDays').TimeVacationDays;}
if(typeof VacationDaysOneTime==='undefined'){VacationDaysOneTime=Core.Config.Get('Datepicker.VacationDays').TimeVacationDaysOneTime;}
if(typeof VacationDays[DateObject.getMonth()+1]!=='undefined'&&typeof VacationDays[DateObject.getMonth()+1][DateObject.getDate()]!=='undefined'){DayDescription+=VacationDays[DateObject.getMonth()+1][DateObject.getDate()];DayClass='Highlight ';}
if(typeof VacationDaysOneTime[DateObject.getFullYear()]!=='undefined'&&typeof VacationDaysOneTime[DateObject.getFullYear()][DateObject.getMonth()+1]!=='undefined'&&typeof VacationDaysOneTime[DateObject.getFullYear()][DateObject.getMonth()+1][DateObject.getDate()]!=='undefined'){DayDescription+=VacationDaysOneTime[DateObject.getFullYear()][DateObject.getMonth()+1][DateObject.getDate()];DayClass='Highlight ';}
if(DayClass.length){return[true,DayClass,DayDescription];}
else{return[true,''];}}
TargetNS.Init=function(Element){var $DatepickerElement,HasDateSelectBoxes=false,Options,ErrorMessage;if(typeof Element.VacationDays==='object'){Core.Config.Set('Datepicker.VacationDays',Element.VacationDays);}
function LeadingZero(Number){if(Number.toString().length===1){return'0'+Number;}
else{return Number;}}
if(typeof LocalizationData==='undefined'){LocalizationData=Core.Config.Get('Datepicker.Localization');if(typeof LocalizationData==='undefined'){throw new Core.Exception.ApplicationError('Datepicker localization data could not be found!','InternalError');}}
DatepickerCount++;if(typeof Element==='object'&&typeof Element.Day!=='undefined'&&typeof Element.Month!=='undefined'&&typeof Element.Year!=='undefined'&&isJQueryObject(Element.Day,Element.Month,Element.Year)&&Element.Day.length){$DatepickerElement=$('<input>').attr('type','hidden').attr('id','Datepicker'+DatepickerCount);Element.Year.after($DatepickerElement);if(Element.Day.is('select')&&Element.Month.is('select')&&Element.Year.is('select')){HasDateSelectBoxes=true;}}
else{return false;}
Options={beforeShowDay:function(DateObject){return CheckDate(DateObject);},showOn:'focus',prevText:LocalizationData.PrevText,nextText:LocalizationData.NextText,firstDay:Element.WeekDayStart,showMonthAfterYear:0,monthNames:LocalizationData.MonthNames,monthNamesShort:LocalizationData.MonthNamesShort,dayNames:LocalizationData.DayNames,dayNamesShort:LocalizationData.DayNamesShort,dayNamesMin:LocalizationData.DayNamesMin,isRTL:LocalizationData.IsRTL};Options.onSelect=function(DateText,Instance){var Year=Instance.selectedYear,Month=Instance.selectedMonth+1,Day=Instance.selectedDay;if(HasDateSelectBoxes){Element.Year.find('option[value='+Year+']').prop('selected',true);Element.Month.find('option[value='+Month+']').prop('selected',true);Element.Day.find('option[value='+Day+']').prop('selected',true);}
else{Element.Year.val(Year);Element.Month.val(LeadingZero(Month));Element.Day.val(LeadingZero(Day));}};Options.beforeShow=function(Input){$(Input).val('');return{defaultDate:new Date(Element.Year.val(),Element.Month.val()-1,Element.Day.val())};};$DatepickerElement.datepicker(Options);if(!$('#'+Core.App.EscapeSelector(Element.Day.attr('id'))+'DatepickerIcon').length){$DatepickerElement.after('<a href="#" class="DatepickerIcon" id="'+Element.Day.attr('id')+'DatepickerIcon" title="'+LocalizationData.IconText+'"><i class="fa fa-calendar"></i></a>');if(Element.DateInFuture){ErrorMessage=Core.Config.Get('Datepicker.ErrorMessageDateInFuture');}
else if(Element.DateNotInFuture){ErrorMessage=Core.Config.Get('Datepicker.ErrorMessageDateNotInFuture');}
else{ErrorMessage=Core.Config.Get('Datepicker.ErrorMessage');}
Element.Year
.after('<div id="'+Element.Day.attr('id')+'Error" class="TooltipErrorMessage"><p>'+ErrorMessage+'</p></div>')
.after('<div id="'+Element.Month.attr('id')+'Error" class="TooltipErrorMessage"><p>'+ErrorMessage+'</p></div>')
.after('<div id="'+Element.Year.attr('id')+'Error" class="TooltipErrorMessage"><p>'+ErrorMessage+'</p></div>');if(Element.Hour&&Element.Hour.length){Element.Hour
.after('<div id="'+Element.Hour.attr('id')+'Error" class="TooltipErrorMessage"><p>'+ErrorMessage+'</p></div>')
.after('<div id="'+Element.Minute.attr('id')+'Error" class="TooltipErrorMessage"><p>'+ErrorMessage+'</p></div>');}}
$('#'+Core.App.EscapeSelector(Element.Day.attr('id'))+'DatepickerIcon').unbind('click.Datepicker').bind('click.Datepicker',function(){$DatepickerElement.datepicker('show');return false;});$('#ui-datepicker-div').hide();};return TargetNS;}(Core.UI.Datepicker||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.DnD=(function(TargetNS){if(!Core.Debug.CheckDependency('Core.UI.DnD','$([]).sortable','jQuery UI sortable')){return false;}
TargetNS.Sortable=function($Elements,Options){$Elements.sortable({handle:Options.Handle,items:Options.Items,axis:Options.Axis,placeholder:Options.Placeholder,helper:Options.Helper,containment:Options.Containment,forcePlaceholderSize:true,distance:Options.Distance,opacity:Options.Opacity,tolerance:Options.Tolerance,update:Options.Update});};return TargetNS;}(Core.UI.DnD||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Floater=(function(TargetNS){TargetNS.Init=function(){var FloaterHoverTimer={},FloaterTriggerHoverTimer={};function CreateFloaterOpenTimeout($Element,TimeoutFunction){FloaterTriggerHoverTimer[$Element]=setTimeout(TimeoutFunction,500);}
function ClearFloaterOpenTimeout($Element){if(typeof FloaterTriggerHoverTimer[$Element]!=='undefined'){clearTimeout(FloaterTriggerHoverTimer[$Element]);}}
function CreateFloaterCloseTimeout($Element,TimeoutFunction){FloaterHoverTimer[$Element]=setTimeout(TimeoutFunction,500);}
function ClearFloaterCloseTimeout($Element){if(typeof FloaterHoverTimer[$Element]!=='undefined'){clearTimeout(FloaterHoverTimer[$Element]);}}
function RemoveActiveFloater($FloaterObj){if(!$FloaterObj){$FloaterObj=$('div.MetaFloater:visible');}
$('[data-trigger="floater"]').removeClass('FloaterOpen');$FloaterObj.fadeOut('fast',function(){$(this).remove();ClearFloaterCloseTimeout($(this));});}
$('body').off('click.FloaterClose').on('click.FloaterClose','.MetaFloater > a.Close',function(){RemoveActiveFloater($(this).closest('.MetaFloater'));return false;});$('body').off('click.FloaterScale').on('click.FloaterScale','.MetaFloater > a.Scale',function(){var $IconObj=$(this).find('i'),$IframeObj=$(this).closest('.MetaFloater').find('iframe');if($IconObj.hasClass('fa-search-plus')){$IconObj.removeClass('fa-search-plus').addClass('fa-search-minus');$IframeObj.addClass('NoScale');}
else{$IconObj.removeClass('fa-search-minus').addClass('fa-search-plus');$IframeObj.removeClass('NoScale');}
return false;});$('body').off('mouseenter.Floater').on('mouseenter.Floater','div.MetaFloater',function(){ClearFloaterCloseTimeout($(this));});$('body').off('mouseleave.Floater').on('mouseleave.Floater','div.MetaFloater',function(){CreateFloaterCloseTimeout($(this),function(){RemoveActiveFloater();});});$('body').off('mouseleave.FloaterTrigger').on('mouseleave.FloaterTrigger','[data-trigger="floater"]',function(Event){ClearFloaterOpenTimeout($(Event.target));CreateFloaterCloseTimeout($(this),function(){RemoveActiveFloater();});});$('body').off('mouseenter.FloaterTrigger').on('mouseenter.FloaterTrigger','[data-trigger="floater"]',function(Event){ClearFloaterCloseTimeout($(this));CreateFloaterOpenTimeout($(Event.target),function(){var $TriggerObj=$(Event.target),TriggerOffset=$TriggerObj.offset(),ViewportWidth=parseInt($(window).width(),10),AvailableHeightBottom,AvailableHeightTop,FloaterWidth,$FloaterObj,Margin=25,iFrameURL=$TriggerObj.data('floater-url');if(!iFrameURL){return false;}
if($TriggerObj.hasClass('FloaterOpen')){return false;}
$('[data-trigger="floater"]').removeClass('FloaterOpen');$TriggerObj.addClass('FloaterOpen');$FloaterObj=$('.MetaFloater.Template').clone();$FloaterObj.removeClass('Template');$('body > div.MetaFloater:visible').remove();$FloaterObj.removeClass('Hidden').appendTo('body').css('display','none');FloaterWidth=parseInt($FloaterObj.outerWidth(),10);if(TriggerOffset.left-ViewportWidth/50<FloaterWidth/2){$FloaterObj.addClass('Left').css({right:'auto',left:TriggerOffset.left});}
else if(ViewportWidth-TriggerOffset.left+($TriggerObj.outerWidth()/2)-ViewportWidth/50<FloaterWidth/2){$FloaterObj.addClass('Right').css({right:'auto',left:TriggerOffset.left-FloaterWidth+$TriggerObj.outerWidth()});}
else{$FloaterObj.addClass('Center').css({right:'auto',left:parseInt(TriggerOffset.left+($TriggerObj.outerWidth()/2)-FloaterWidth/2,10)});}
AvailableHeightBottom=parseInt($(window).scrollTop()+$(window).height()-(TriggerOffset.top+$TriggerObj.outerHeight()),10);AvailableHeightTop=parseInt(TriggerOffset.top-$(window).scrollTop(),10);if(AvailableHeightTop>AvailableHeightBottom){$FloaterObj.addClass('Bottom').css({top:'auto',bottom:parseInt($('body').height()-TriggerOffset.top,10)+Margin});}
else{$FloaterObj.addClass('Top').css({top:parseInt(TriggerOffset.top+$TriggerObj.outerHeight(),10)+Margin,bottom:'auto'});}
$FloaterObj.find('iframe').attr('src',iFrameURL);$FloaterObj.find('a.Open').attr('href',$TriggerObj.attr('href'));$FloaterObj.fadeIn();$('div.MetaFloater:visible iframe').off('load.MetaFloater').on('load.MetaFloater',function(){$(this).closest('.Content').fadeIn('fast',function(){var $ActiveFloaterObj=$('div.MetaFloater:visible');$ActiveFloaterObj
.children('div.NoPreview, a.Scale, a.Open').fadeIn()
.parent()
.children('i').remove();});});});});}
return TargetNS;}(Core.UI.Floater||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Resizable=(function(TargetNS){var ScrollerMinHeight=101,HandleHeight=9;TargetNS.Init=function($Element,ScrollerHeight,Callback){var CurrentTableHeight,InitScroller=true;ScrollerHeight=Math.max(ScrollerHeight||0,ScrollerMinHeight);if(isJQueryObject($Element)&&$Element.length){CurrentTableHeight=$Element.find('table').outerHeight();if((CurrentTableHeight)<=ScrollerMinHeight){$Element.find('.Scroller').height(CurrentTableHeight);InitScroller=false;}
else if((CurrentTableHeight)<ScrollerHeight){$Element.find('.Scroller').height(CurrentTableHeight);}
else{$Element.find('.Scroller').height(ScrollerHeight);}
if(InitScroller){$Element.resizable({handles:{s:$Element.find('.Handle a')},minHeight:ScrollerMinHeight+HandleHeight,maxHeight:$Element.find('table').outerHeight()+HandleHeight,resize:function(Event,UI){var Height,Width;Height=UI.size.height-HandleHeight;Width=UI.size.width-2;$Element.find('div.Scroller').height(Height+'px').width(Width+'px');if($.isFunction(Callback)){Callback(Event,UI,Height,Width);}}});}
else{$('div.Handle').hide();$Element.find('.Scroller').css('margin-bottom','1px');}}};return TargetNS;}(Core.UI.Resizable||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Table=(function(TargetNS){TargetNS.InitTableFilter=function($FilterInput,$Container,ColumnNumber){var Timeout;$FilterInput.off('keydown.FilterInput').on('keydown.FilterInput',function(){window.clearTimeout(Timeout);Timeout=window.setTimeout(function(){var FilterText=($FilterInput.val()||'').toLowerCase(),$Rows=$Container.find('tbody tr:not(.FilterMessage), li:not(.Header):not(.FilterMessage)'),$Elements=$Rows.closest('tr, li');if(typeof ColumnNumber==='string'||typeof ColumnNumber==='number'){$Rows=$Rows.find('td:eq('+ColumnNumber+')');}
function CheckText($Element,Filter){var Text;Text=$Element.text();if(Text&&Text.toLowerCase().indexOf(Filter)>-1){return true;}
if($Element.is('li, td')){Text=$Element.attr('title');if(Text&&Text.toLowerCase().indexOf(Filter)>-1){return true;}}
else{$Element.find('td').each(function(){Text=$(this).attr('title');if(Text&&Text.toLowerCase().indexOf(Filter)>-1){return true;}});}
return false;}
if(FilterText.length){$Elements.hide();$Rows.each(function(){if(CheckText($(this),FilterText)){$(this).closest('tr, li').show();}});}
else{$Elements.show();}
if($Rows.filter(':visible').length){$Container.find('.FilterMessage').hide();}
else{$Container.find('.FilterMessage').show();}
Core.App.Publish('Event.UI.Table.InitTableFilter.Change',[$FilterInput,$Container,ColumnNumber]);},100);});$FilterInput.off('keypress.FilterInput').on('keypress.FilterInput',function(Event){if((Event.charCode||Event.keyCode)===13){Event.preventDefault();}});};return TargetNS;}(Core.UI.Table||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Accessibility=(function(TargetNS){TargetNS.Init=function(){$('.ARIARoleBanner')
.attr('role','banner');$('.ARIARoleNavigation')
.attr('role','navigation');$('.ARIARoleSearch')
.attr('role','search');$('.ARIARoleContentinfo')
.attr('role','contentinfo');$('.ARIARoleMain')
.attr('role','main');$('.ARIAHasPopup')
.attr('aria-haspopup','true');$('.Validate_Required, .Validate_DependingRequiredAND, .Validate_DependingRequiredOR')
.attr('aria-required','true');TargetNS.AccessibleNavigation();};TargetNS.AccessibleNavigation=function(){$('#Navigation > ul > li a').on('focus',function(){$(this)
.next('ul')
.addClass('Expanded');});$('#Navigation > ul > li > ul').on('mouseleave',function(){$(this).removeClass('Expanded');});$('#Navigation > ul > li > ul li a').on('focus',function(){$(this)
.closest('ul')
.addClass('Expanded');});$('#Navigation > ul > li > ul li:last-child').prev('li').find('a').on('focusout',function(){$(this)
.closest('ul')
.removeClass('Expanded');});};TargetNS.AudibleAlert=function(Text){var AlertMessageID='Accessibility_AlertMessage';$('#'+AlertMessageID).remove();$('body').append('<div role="alert" id="'+AlertMessageID+'" class="ARIAAlertMessage">'+Text+'</div>');};return TargetNS;}(Core.UI.Accessibility||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.RichTextEditor=(function(TargetNS){var $FormID,TimeOutRTEOnChange;function CheckFormID($EditorArea){if(typeof $FormID==='undefined'){$FormID=$EditorArea.closest('form').find('input:hidden[name=FormID]');}
return $FormID;}
function SerializeData(Data){var QueryString='';$.each(Data,function(Key,Value){QueryString+=';'+encodeURIComponent(Key)+'='+encodeURIComponent(Value);});return QueryString;}
TargetNS.Init=function($EditorArea){var EditorID='',Editor,UserLanguage,UploadURL='';if(isJQueryObject($EditorArea)&&$EditorArea.hasClass('HasCKEInstance')){return false;}
if(isJQueryObject($EditorArea)&&$EditorArea.length===1){EditorID=$EditorArea.attr('id');}
if(EditorID===''){Core.Exception.Throw('RichTextEditor: Need exactly one EditorArea!','TypeError');}
$EditorArea.addClass('HasCKEInstance');CKEDITOR.on('instanceCreated',function(Editor){CKEDITOR.addCss(Core.Config.Get('RichText.EditingAreaCSS'));Editor.editor.on('change',function(){window.clearTimeout(TimeOutRTEOnChange);TimeOutRTEOnChange=window.setTimeout(function(){Core.Form.Validate.ValidateElement($(Editor.editor.element.$));},250);});Editor.editor.on('paste',function(){Core.Config.Set('TextIsSpellChecked',false);});Editor.editor.on('key',function(){Core.Config.Set('TextIsSpellChecked',false);});Core.App.Publish('Event.UI.RichTextEditor.InstanceCreated',[Editor]);});CKEDITOR.on('instanceReady',function(Editor){Core.App.Publish('Event.UI.RichTextEditor.InstanceReady',[Editor]);});UserLanguage=Core.Config.Get('UserLanguage').replace(/_/,"-");if(CheckFormID($EditorArea).length){UploadURL=Core.Config.Get('Baselink')
+'Action='
+Core.Config.Get('RichText.PictureUploadAction','PictureUpload')
+'&FormID='
+CheckFormID($EditorArea).val()
+SerializeData(Core.App.GetSessionInformation());}
Editor=CKEDITOR.replace(EditorID,{customConfig:'',defaultLanguage:UserLanguage,language:UserLanguage,width:Core.Config.Get('RichText.Width',620),resize_minWidth:Core.Config.Get('RichText.Width',620),height:Core.Config.Get('RichText.Height',320),removePlugins:CheckFormID($EditorArea).length?'':'image2,uploadimage',forcePasteAsPlainText:false,format_tags:'p;h1;h2;h3;h4;h5;h6;pre',fontSize_sizes:'8px;10px;12px;16px;18px;20px;22px;24px;26px;28px;30px;',extraAllowedContent:'div[type]{*}; img[*]; col[width]; style[*]{*}; *[id](*)',enterMode:CKEDITOR.ENTER_BR,shiftEnterMode:CKEDITOR.ENTER_BR,contentsLangDirection:Core.Config.Get('RichText.TextDir','ltr'),disableNativeSpellChecker:false,toolbar:CheckFormID($EditorArea).length?Core.Config.Get('RichText.Toolbar'):Core.Config.Get('RichText.ToolbarWithoutImage'),filebrowserBrowseUrl:'',filebrowserUploadUrl:UploadURL,extraPlugins:Core.Config.Get('RichText.SpellChecker')?'aspell,splitquote,contextmenu_linkopen,preventimagepaste':'splitquote,contextmenu_linkopen,preventimagepaste',entities:false,skin:'bootstrapck'});CKEDITOR.config.spellerPagesServerScript=Core.Config.Get('Baselink');if(typeof Editor!=='undefined'){CKEDITOR.instances[EditorID].updateElementOriginal=CKEDITOR.instances[EditorID].updateElement;CKEDITOR.instances[EditorID].updateElement=function(){var Data;CKEDITOR.instances[EditorID].updateElementOriginal();Data=this.element.getValue();if(!Data.match(/<img/)){Data=Data.replace(/\s+|&nbsp;|<\/?\w+[^>]*\/?>/g,'');if(!Data.length){this.element.setValue('');}}};CKEDITOR.instances[EditorID].on('blur',function(){CKEDITOR.instances[EditorID].updateElement();Core.Form.Validate.ValidateElement($EditorArea);});CKEDITOR.instances[EditorID].on('focus',function(){Core.App.Publish('Event.UI.RichTextEditor.Focus',[Editor]);if($EditorArea.attr('class').match(/Error/)){window.setTimeout(function(){CKEDITOR.instances[EditorID].updateElement();Core.Form.Validate.ValidateElement($EditorArea);},0);}});$EditorArea.focus(function(){TargetNS.Focus($EditorArea);Core.UI.ScrollTo($("label[for="+$EditorArea.attr('id')+"]"));});}};TargetNS.InitAll=function(){$('textarea.RichText').each(function(){TargetNS.Init($(this));});};TargetNS.GetRTE=function($EditorArea){var $RTE;if(isJQueryObject($EditorArea)){$RTE=$('#cke_'+$EditorArea.attr('id'));return($RTE.length?$RTE:undefined);}};TargetNS.UpdateLinkedField=function($EditorArea){var EditorID='',Data,StrippedContent;if(isJQueryObject($EditorArea)&&$EditorArea.length===1){EditorID=$EditorArea.attr('id');}
if(EditorID===''){Core.Exception.Throw('RichTextEditor: Need exactly one EditorArea!','TypeError');}
Data=CKEDITOR.instances[EditorID].getData();StrippedContent=Data.replace(/\s+|&nbsp;|<\/?\w+[^>]*\/?>/g,'');if(StrippedContent.length===0&&!Data.match(/<img/)){$EditorArea.val('');}
else{$EditorArea.val(Data);}};TargetNS.IsEnabled=function($EditorArea){if(typeof CKEDITOR==='undefined'){return false;}
if(isJQueryObject($EditorArea)&&$EditorArea.length){return(CKEDITOR.instances[$EditorArea[0].id]?true:false);}
return false;};TargetNS.Focus=function($EditorArea){var EditorID='';if(isJQueryObject($EditorArea)&&$EditorArea.length===1){EditorID=$EditorArea.attr('id');}
if(EditorID===''){Core.Exception.Throw('RichTextEditor: Need exactly one EditorArea!','TypeError');}
if(typeof CKEDITOR==='object'){CKEDITOR.instances[EditorID].focus();}
else{$EditorArea.focus();}};return TargetNS;}(Core.UI.RichTextEditor||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Dialog=(function(TargetNS){if(!Core.Debug.CheckDependency('Core.UI.Dialog','$([]).draggable','jQuery UI draggable')){return false;}
if(!Core.Debug.CheckDependency('Core.UI.Dialog','Core.Config','Core.Config')){return false;}
if(!Core.Debug.CheckDependency('Core.UI.Dialog','Core.UI.InputFields','Core.UI.InputFields')){return false;}
function AdjustScrollableHeight(AllowAutoGrow){var ContentScrollHeight=0,WindowHeight=$(window).height(),WindowScrollTop=$(window).scrollTop(),DialogTopMargin=$('.Dialog:visible').offset().top,DialogHeight=$('.Dialog:visible').height();if($('.Dialog:visible').hasClass('Fullsize')){ContentScrollHeight=WindowHeight-80;}
else if(AllowAutoGrow||DialogHeight>300){ContentScrollHeight=WindowHeight-((DialogTopMargin-WindowScrollTop)*2)-100;}
else{ContentScrollHeight=200;}
$('.Dialog:visible .Content .InnerContent').css('max-height',ContentScrollHeight);}
function FocusFirstElement(){var $FirstElement=$('div.Dialog:visible .Content')
.find('a:visible, input:visible, textarea:visible, select:visible, button:visible')
.filter(':first'),$FocusField;if(!$FirstElement){return;}
if($FirstElement.hasClass('InputField_Search')){$FocusField=$('<input/>')
.addClass('FocusField')
.insertBefore($FirstElement);$FocusField.focus();}
else{$FirstElement.focus();}}
function InitKeyEvent(CloseOnEscape){var $Dialog=$('div.Dialog:visible');$(document).unbind('keypress.Dialog').bind('keypress.Dialog',function(Event){if($.browser.opera&&(Event.keyCode===9||(Event.keyCode===27&&CloseOnEscape))){Event.preventDefault();Event.stopPropagation();return false;}}).unbind('keydown.Dialog').bind('keydown.Dialog',function(Event){var $Tabbables,$First,$Last;if(Event.keyCode===9){$Tabbables=$('a:visible, input:visible, textarea:visible, select:visible, button:visible',$Dialog);$First=$Tabbables.filter(':first');$Last=$Tabbables.filter(':last');if(Event.target===$Last[0]&&!Event.shiftKey){$First.focus(1);Event.preventDefault();Event.stopPropagation();return false;}
else if(Event.target===$First[0]&&Event.shiftKey){$Last.focus(1);Event.preventDefault();Event.stopPropagation();return false;}}
else if(Event.keyCode===27&&CloseOnEscape){TargetNS.CloseDialog($Dialog);Event.preventDefault();Event.stopPropagation();return false;}});}
function DefaultSubmitFunction(){$('.Dialog:visible form').submit();}
function DefaultCloseFunction(){TargetNS.CloseDialog($('.Dialog:visible'));}
TargetNS.ShowDialog=function(Params){var $Dialog,$Content,$ButtonFooter,HTMLBackup,DialogCopy,DialogCopySelector,DialogHTML='<div class="Dialog"><div class="Header"><a class="Close" title="'+Core.Config.Get('DialogCloseMsg')+'" href="#"><i class="fa fa-times"></i></a></div><div class="Content"></div><div class="Footer"></div></div>',FullsizeMode=false;function HandleClosingAction(){var $CloseButton=$('.Dialog:visible button.Close');Core.App.Publish('Event.UI.Dialog.CloseDialog.Close',[$Dialog]);if(Core.Form&&Core.Form.ErrorTooltips){Core.Form.ErrorTooltips.HideTooltip();}
if($CloseButton.length){$CloseButton.trigger('click');}
else{DefaultCloseFunction();}}
function CalculateDialogPosition(Position,Type){var ScrollTop=$(window).scrollTop(),WindowHeight=$(window).height();Type=Type||'top';Position=Position.toString();if(Position.match(/%/)){Position=parseInt(Position.replace(/%/,''),10);if(Type==='top'){Position=parseInt(WindowHeight*(Position/100),10)+ScrollTop;}
else if(Type==='bottom'){Position=WindowHeight+ScrollTop-parseInt(WindowHeight*(Position/100),10);}}
else{Position=parseInt(Position.replace(/px/,''),10);if(Type==='top'){Position=Position+ScrollTop;}
else if(Type==='bottom'){Position=WindowHeight+ScrollTop-Position;}}
return(Position+'px');}
Core.App.Publish('Event.UI.Dialog.ShowDialog.BeforeOpen');if($('.Dialog:visible').length){TargetNS.CloseDialog($('.Dialog:visible'));}
if(Params.Modal){$('<div id="Overlay" tabindex="-1">').appendTo('body');$('body').css({'overflow':'hidden'});$('#Overlay').height($(document).height()).css('top',0);$('body').css('min-height',$(window).height());}
$Dialog=$(DialogHTML);if(Core.App.Responsive.IsSmallerOrEqual(Core.App.Responsive.GetScreenSize(),'ScreenL')){FullsizeMode=true;$Dialog.addClass('Fullsize');}
if(Params.Modal){$Dialog.addClass('Modal');}
if(Params.HTML){if(typeof Params.HTML!=='string'&&isJQueryObject(Params.HTML)){DialogCopy=Core.Data.Get($('body'),'DialogCopy');HTMLBackup=(Params.HTML)[0].innerHTML;DialogCopySelector=Params.HTML.selector;DialogCopy[DialogCopySelector]=HTMLBackup;Core.Data.Set($('body'),'DialogCopy',DialogCopy);Params.HTML.empty();Params.HTML=HTMLBackup;}}
if(Params.Type==='Alert'){$Dialog.addClass('Alert');$Dialog.attr("role","alertdialog");$Content=$Dialog.find('.Content').append('<div class="InnerContent"></div>').find('.InnerContent');$Content.append('<i class="fa fa-warning"></i>');if(Params.Headline){$Content.append('<h2>'+Params.Headline+'</h2>');}
if(Params.Text){$Content.append('<p>'+Params.Text+'</p>');}
Params.Buttons=[{Label:'OK',Type:'Close',Function:Params.OnClose}];$Content.append('<div class="Center Spacing"><button type="button" id="DialogButton1" class="CallForAction Close"><span>OK</span></button></div>');}
else if(Params.Type==='Search'){$Dialog.addClass('Search');$Dialog.attr("role","dialog");$Content=$Dialog.find('.Content');if(Params.HTML){$Content.append(Params.HTML);}}
else{$Dialog.attr("role","dialog");$Content=$Dialog.find('.Content');if(Params.Buttons){$Content.append('<div class="InnerContent"></div>').find('.InnerContent').append(Params.HTML);$ButtonFooter=$('<div class="ContentFooter Center"></div>');$.each(Params.Buttons,function(Index,Value){var Classes='CallForAction';if(Value.Type==='Close'){Classes+=' Close';}
if(Value.Class){Classes+=' '+Value.Class;}
$ButtonFooter.append('<button id="DialogButton'+(Index-0+1)+'" class="'+Classes+'" type="button"><span>'+Value.Label+'</span></button> ');});$ButtonFooter.appendTo($Content);}
else{if(Params.HTML){$Content.append(Params.HTML);}}}
if(Params.Title){$Dialog.find('div.Header').append('<h1>'+Params.Title+'</h1>');}
$Dialog.appendTo('body');if($Dialog.find('.Content .ContentFooter').length){$Dialog.find('.Footer').addClass('ContentFooter');}
if(DialogCopySelector&&DialogCopySelector.length){Core.Data.Set($Dialog,'DialogCopySelector',DialogCopySelector);}
if(Params.Type==='Alert'){$Dialog.css({top:$(window).scrollTop()+($(window).height()*0.3),left:Math.round(($(window).width()-$Dialog.width())/2)});}
if(typeof Params.PositionTop!=='undefined'){$Dialog.css('top',CalculateDialogPosition(Params.PositionTop,'top'));}
if(typeof Params.PositionLeft!=='undefined'){if(Params.PositionLeft==='Center'){$Dialog.css('left',Math.round(($(window).width()-$Dialog.width())/2));}
else{$Dialog.css('left',Params.PositionLeft);}}
if(typeof Params.PositionBottom!=='undefined'){$Dialog.css('bottom',CalculateDialogPosition(Params.PositionBottom,'bottom'));}
if(typeof Params.PositionRight!=='undefined'){$Dialog.css('right',Params.PositionRight);}
AdjustScrollableHeight(Params.AllowAutoGrow);if(FullsizeMode){$Dialog.css('top',$(window).scrollTop());}
if(!FullsizeMode){$Dialog.draggable({containment:'body',handle:'.Header',start:function(){Core.App.Publish('Event.UI.Dialog.ShowDialog.DragStart',$Dialog);if(Core.Form&&Core.Form.ErrorTooltips){Core.Form.ErrorTooltips.HideTooltip();}},stop:function(){Core.App.Publish('Event.UI.Dialog.ShowDialog.DragStop',$Dialog);}});}
if(Params.Buttons){$.each(Params.Buttons,function(Index,Value){$('#DialogButton'+(Index-0+1)).click(function(){if(Value.Type==='Submit'){if($.isFunction(Value.Function)){if(Value.Function()){DefaultSubmitFunction();}}
else{DefaultSubmitFunction();}}
else if(Value.Type==='Close'){if($.isFunction(Value.Function)){if(Value.Function()){DefaultCloseFunction();}}
else{DefaultCloseFunction();}}
else{if($.isFunction(Value.Function)){Value.Function();}}});});}
$Dialog.find('.Header a.Close').click(function(){HandleClosingAction();return false;});if(Params.CloseOnClickOutside){$(document).unbind('click.Dialog').bind('click.Dialog',function(event){if($(event.target).parents('html').length&&$(event.target).closest('div.Dialog').length===0){HandleClosingAction();}});}
$(window).unbind('resize.Dialog').bind('resize.Dialog',function(){AdjustScrollableHeight(Params.AllowAutoGrow);});Core.App.Subscribe('Event.App.Responsive.SmallerOrEqualScreenL',function(){$Dialog.addClass('Fullsize');});Core.App.Subscribe('Event.App.Responsive.ScreenXL',function(){$Dialog.removeClass('Fullsize');});InitKeyEvent(Params.CloseOnEscape);Core.UI.InputFields.Activate($Dialog);FocusFirstElement();};TargetNS.ShowContentDialog=function(HTML,Title,PositionTop,PositionLeft,Modal,Buttons,AllowAutoGrow){TargetNS.ShowDialog({HTML:HTML,Title:Title,Modal:Modal,CloseOnClickOutside:true,CloseOnEscape:true,PositionTop:PositionTop,PositionLeft:PositionLeft,Buttons:Buttons,AllowAutoGrow:AllowAutoGrow});};TargetNS.ShowAlert=function(Headline,Text,CloseFunction){TargetNS.ShowDialog({Type:'Alert',Modal:true,Title:Headline,Text:Text,OnClose:CloseFunction});};TargetNS.CloseDialog=function(Object){var $Dialog,DialogCopy,DialogCopySelector,BackupHTML;$Dialog=$(Object).closest('.Dialog:visible');DialogCopySelector=Core.Data.Get($Dialog,'DialogCopySelector');Core.App.Publish('Event.UI.Dialog.CloseDialog.Close',[$Dialog]);$Dialog.remove();$('#Overlay').remove();$('body').css({'overflow':'auto'});$(document).unbind('keydown.Dialog').unbind('keypress.Dialog').unbind('click.Dialog');$(window).unbind('resize.Dialog');$('body').css('min-height','auto');if(DialogCopySelector.length){DialogCopy=Core.Data.Get($('body'),'DialogCopy');if(typeof DialogCopy!=='undefined'){BackupHTML=DialogCopy[DialogCopySelector];if(BackupHTML&&BackupHTML.length){$(DialogCopySelector).append(BackupHTML);}
delete DialogCopy[DialogCopySelector];}
Core.Data.Set($('body'),'DialogCopy',DialogCopy);}};return TargetNS;}(Core.UI.Dialog||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.ActionRow=(function(TargetNS){var TicketElementSelectors={'Small':'div.Overview table td input[type="checkbox"][name=TicketID]','Medium':'ul.Overview input[type="checkbox"][name=TicketID]','Large':'ul.Overview input[type="checkbox"][name=TicketID]'},TicketView;if(!Core.Debug.CheckDependency('Core.UI.ActionRow','Core.JSON','JSON API')){return false;}
if(!Core.Debug.CheckDependency('Core.UI.ActionRow','Core.Data','Data API')){return false;}
function SerializeData(Data){var QueryString='';$.each(Data,function(Key,Value){QueryString+=';'+encodeURIComponent(Key)+'='+encodeURIComponent(Value);});return QueryString;}
TargetNS.AddActions=function($Element,JSONString){var Actions;if(isJQueryObject($Element)){if(typeof JSONString==='string'){Actions=Core.JSON.Parse(JSONString);}
else{Actions=JSONString;}
Core.Data.Set($Element,'Actions',Actions);}
else{Core.Debug.Log('Element does not exist or no valid data structure passed.');}};TargetNS.UpdateActionRow=function($ClickedElement,$Checkboxes,$ActionRow){var TicketActionData,ActionRowElement;$Checkboxes=$Checkboxes.filter(':checked');if(!$Checkboxes.length){$ActionRow
.find('li').filter(':not(.AlwaysPresent)').remove()
.end().end()
.find('#BulkAction').addClass('Inactive');}
else if($Checkboxes.length===1&&!$('#SelectAllTickets').is(':checked')){$ActionRow.find('#BulkAction').removeClass('Inactive');TicketActionData=Core.Data.Get($Checkboxes.closest('li, tr'),'Actions');if(typeof TicketActionData!=='undefined'){$.each(TicketActionData,function(Index,Value){if(Value.HTML){$(Value.HTML).attr('id',Value.ID).appendTo($ActionRow);ActionRowElement=$ActionRow.find('#'+Value.ID).find('a');if(typeof Value.Target==='undefined'||Value.Target===""){ActionRowElement.attr('href',Value.Link);}
if(Value.PopupType){ActionRowElement.bind('click.Popup',function(){Core.UI.Popup.OpenPopup(Value.Link,Value.PopupType);return false;});}}});}}
else{$ActionRow
.find('li').filter(':not(.AlwaysPresent)').remove()
.end().end()
.find('#BulkAction').removeClass('Inactive');}};TargetNS.Init=function(){if($('#TicketOverviewMedium').length){TicketView='Medium';}
else if($('#TicketOverviewLarge').length){TicketView='Large';}
else{TicketView='Small';}
if((TicketView==='Medium'||TicketView==='Large')&&$('#EmptyMessage'+TicketView).length===1){$('#SelectAllTickets').closest('li').addClass('Hidden');}
$('#SelectAllTickets').on('click',function(){var Status=$(this).prop('checked');$(TicketElementSelectors[TicketView]).prop('checked',Status).triggerHandler('click');});$(TicketElementSelectors[TicketView]).bind('click',function(Event){Event.stopPropagation();Core.UI.ActionRow.UpdateActionRow($(this),$(TicketElementSelectors[TicketView]),$('div.OverviewActions ul.Actions'));Core.Form.SelectAllCheckboxes($(this),$('#SelectAllTickets'));});$('#BulkAction a').bind('click',function(){var $Element=$(this),$SelectedTickets,TicketIDParameter="TicketID=",TicketIDs="",URL;if($Element.parent('li').hasClass('Inactive')){return false;}
else{$SelectedTickets=$(TicketElementSelectors[TicketView]+':checked');$SelectedTickets.each(function(){TicketIDs+=TicketIDParameter+$(this).val()+";";});URL=Core.Config.Get('Baselink')+"Action=AgentTicketBulk;"+TicketIDs;URL+=SerializeData(Core.App.GetSessionInformation());Core.UI.Popup.OpenPopup(URL,'TicketAction');}
return false;});};return TargetNS;}(Core.UI.ActionRow||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Popup=(function(TargetNS){var OpenPopups={},PopupProfiles,PopupDefaultProfile='Default',RegisterPopupTimeOut=1000,WindowMode='Popup';if(!Core.Debug.CheckDependency('Core.UI.Dialog','Core.Config','Core.Config')){return false;}
PopupProfiles={'Default':{WindowURLParams:"dependent=yes,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no",Left:100,Top:100,Width:1040,Height:700}};function CheckOpenPopups(){$.each(OpenPopups,function(Key,Value){if(Value.closed){delete OpenPopups[Key];}});}
function GetPopupObjectByType(Type){return OpenPopups[Type];}
function GetWindowParentObject(){if(window.opener!==null&&typeof window.opener!=='undefined'){if(typeof window.opener.Core!=='undefined'){return window.opener;}
else{return window.parent;}}
else{return window.parent;}}
function CurrentIsPopupWindow(){var PopupType;if(window.name.match(/OTRSPopup_([^_]+)_.+/)){PopupType=RegExp.$1;}
return PopupType;}
TargetNS.CurrentIsPopupWindow=function(){return CurrentIsPopupWindow();};TargetNS.ProfileAdd=function(Key,Values){PopupProfiles[Key]=Values;};TargetNS.ProfileList=function(){return PopupProfiles;};TargetNS.RegisterPopupEvent=function(){$(window).bind('Popup',function(Event,Type,Param){if(Type&&typeof Type!=='undefined'){if(Type==='Reload'){window.location.reload();}
else if(Type==='URL'){if(Param&&typeof Param.URL!=='undefined'){window.location.href=Param.URL;}}}});};TargetNS.FirePopupEvent=function(Type,Param,ExecuteInMobileMode){if(ExecuteInMobileMode===false&&!$('body').hasClass('Visible-ScreenXL')&&(!localStorage.getItem("DesktopMode")||parseInt(localStorage.getItem("DesktopMode"),10)<=0)){return;}
$(window).unbind('beforeunload.Popup');Core.App.UnbindWindowUnloadEvent('Popup');$(window).trigger('Popup',[Type,Param]);};TargetNS.CheckPopupsOnUnload=function(){var Size=0;CheckOpenPopups();$.each(OpenPopups,function(Key,Value){if(Value.name.match(/OTRSPopup_.+/)){Size++;}});if(Size){return Core.Config.Get('PopupLeaveParentWindowMsg');}};TargetNS.ClosePopupsOnUnload=function(){CheckOpenPopups();$.each(OpenPopups,function(Key,Value){if(Value.name.match(/OTRSPopup_.+/)){TargetNS.ClosePopup(Value);}});};TargetNS.RegisterPopupAtParentWindow=function(WindowObject){var Type;/OTRSPopup_([^_]+)_.*/.exec(WindowObject.name);Type=RegExp.$1;if(typeof OpenPopups[Type]==='undefined'){OpenPopups[Type]=WindowObject;}
else{if(OpenPopups[Type]!==WindowObject){OpenPopups[Type]=WindowObject;}}};TargetNS.InitRegisterPopupAtParentWindow=function(){window.setTimeout(function(){var PopupType=CurrentIsPopupWindow(),ParentWindow;if(typeof PopupType!=='undefined'){ParentWindow=GetWindowParentObject();}
if(ParentWindow&&!ParentWindow.name&&ParentWindow.Core&&ParentWindow.Core.UI&&ParentWindow.Core.UI.Popup){try{ParentWindow.Core.UI.Popup.RegisterPopupAtParentWindow(window,PopupType);}
catch(Event){$.noop(Event);}}
Core.UI.Popup.InitRegisterPopupAtParentWindow();},RegisterPopupTimeOut);};TargetNS.GetPopupObject=function(Type){return GetPopupObjectByType(Type);};TargetNS.GetWindowMode=function(){if(WindowMode==='Popup'||WindowMode==='Iframe'){return WindowMode;}
else{return undefined;}};TargetNS.SetWindowMode=function(Mode){if(Mode==='Popup'||Mode==='Iframe'){WindowMode=Mode;}
else{WindowMode=undefined;}};TargetNS.Resize=function(Type,Width,Height){var PopupObject=GetPopupObjectByType(Type);if(WindowMode==='Iframe'){return;}
if(typeof PopupObject!=='undefined'){PopupObject.resizeTo(Width,Height);}};TargetNS.OpenPopup=function(URL,Type,Profile,Unlinked){var PopupObject,PopupProfile,NewWindow,WindowName,ConfirmClosePopup=true,PopupFeatures;if(Core.App.Responsive.IsSmallerOrEqual(Core.App.Responsive.GetScreenSize(),'ScreenL')&&(!localStorage.getItem("DesktopMode")||parseInt(localStorage.getItem("DesktopMode"),10)<=0)){TargetNS.SetWindowMode('Iframe');}
else{TargetNS.SetWindowMode('Popup');}
CheckOpenPopups();if(URL){PopupObject=GetPopupObjectByType(Type);if(!Unlinked){if(typeof PopupObject!=='undefined'){ConfirmClosePopup=window.confirm(Core.Config.Get('PopupAlreadyOpenMsg'));if(ConfirmClosePopup){TargetNS.ClosePopup(PopupObject);}}}
if(ConfirmClosePopup){PopupProfile=PopupProfiles[Profile]?Profile:PopupDefaultProfile;if(Unlinked&&Unlinked===1){WindowName='PopupOTRS_'+Type+'_'+Date.parse(new Date());}
else{WindowName='OTRSPopup_'+Type+'_'+Date.parse(new Date());}
if(WindowMode==='Popup'){PopupFeatures=PopupProfiles[PopupProfile].WindowURLParams;PopupFeatures+=',left='+((window.screen.left||0)+PopupProfiles[PopupProfile].Left);PopupFeatures+=',width='+PopupProfiles[PopupProfile].Width;if(window.screen.availHeight<PopupProfiles[PopupProfile].Height+PopupProfiles[PopupProfile].Top){PopupFeatures+=',height='+(window.screen.availHeight-PopupProfiles[PopupProfile].Top-20);PopupFeatures+=',top='+((window.screen.top||0)+(PopupProfiles[PopupProfile].Top/2));}
else{PopupFeatures+=',height='+PopupProfiles[PopupProfile].Height;PopupFeatures+=',top='+((window.screen.top||0)+PopupProfiles[PopupProfile].Top);}
NewWindow=window.open(URL,WindowName,PopupFeatures);if(!NewWindow||NewWindow.closed||typeof NewWindow.closed==='undefined'){window.alert(Core.Config.Get('PopupBlockerMsg'));}
else{OpenPopups[Type]=NewWindow;}}
else if(WindowMode==='Iframe'){window.scrollTo(0,0);$('html').addClass('NoScroll');$('body').append('<iframe data-popuptype="'+Type+'" name="'+WindowName+'" class="PopupIframe" src="'+URL+'"></iframe>');$('iframe.PopupIframe').height($(window).height());}}}};TargetNS.HasOpenPopups=function(){var HasOpenPopups=false,Popup;CheckOpenPopups();for(Popup in OpenPopups){if(OpenPopups.hasOwnProperty(Popup)){HasOpenPopups=true;break;}}
return HasOpenPopups;};TargetNS.ClosePopup=function(PopupType){var PopupObject,ParentObject,PlaceOfExecution,LocalWindowMode;if(typeof PopupType==='undefined'){PlaceOfExecution='Popup';PopupType=CurrentIsPopupWindow();PopupObject=window;ParentObject=GetWindowParentObject();}
else{PlaceOfExecution='Parent';if(typeof PopupType==='string'){PopupObject=GetPopupObjectByType(PopupType);ParentObject=window;}
else{PopupObject=PopupType;if(PopupObject&&typeof PopupObject.name!=='undefined'&&PopupObject.name.match(/OTRSPopup_([^_]+)_.+/)){PopupType=RegExp.$1;}
ParentObject=window;}}
if(typeof PopupObject!=='undefined'&&typeof ParentObject!=='undefined'){if(PlaceOfExecution==='Parent'){LocalWindowMode=TargetNS.GetWindowMode();}
else if(PlaceOfExecution==='Popup'){LocalWindowMode=ParentObject.Core.UI.Popup.GetWindowMode();}
if(LocalWindowMode==='Popup'){PopupObject.close();}
else if(LocalWindowMode==='Iframe'){$('iframe.PopupIframe[data-popuptype='+PopupType+']',ParentObject.document).remove();$('html',ParentObject.document).removeClass('NoScroll');}}
CheckOpenPopups();};TargetNS.ExecuteInParentWindow=function(FunctionToExecute,FunctionParameters){var ParentWindow=GetWindowParentObject();if(typeof ParentWindow==='undefined'||ParentWindow===null){return;}
if(typeof FunctionParameters==='undefined'){FunctionParameters=[ParentWindow];}
else{FunctionParameters.unshift(ParentWindow);}
if(typeof FunctionToExecute!=='undefined'&&$.isFunction(FunctionToExecute)){FunctionToExecute.apply(ParentWindow,FunctionParameters);}};TargetNS.Init=function(){$(window).bind('beforeunload.Popup',function(){return Core.UI.Popup.CheckPopupsOnUnload();});Core.App.BindWindowUnloadEvent('Popup',Core.UI.Popup.ClosePopupsOnUnload);Core.UI.Popup.RegisterPopupEvent();if(CurrentIsPopupWindow()){Core.UI.Popup.InitRegisterPopupAtParentWindow();$('.CancelClosePopup').bind('click',function(){TargetNS.ClosePopup();});$('.UndoClosePopup').bind('click',function(){var RedirectURL=$(this).attr('href'),ParentWindow=GetWindowParentObject();ParentWindow.Core.UI.Popup.FirePopupEvent('URL',{URL:RedirectURL});TargetNS.ClosePopup();});if(window.opener){$('body').addClass('RealPopup');}}};return TargetNS;}(Core.UI.Popup||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.TreeSelection=(function(TargetNS){function GetChildren(Elements,Index,Data){var NewElements=Elements;$.each(Elements,function(InnerIndex,InnerData){if(typeof InnerData!=='object'){return false;}
if(InnerData.ID===Data.ChildOf){NewElements[InnerIndex].children.push(Data);delete NewElements[Index];}});return NewElements;}
function CollectElements(Elements,Level){var NewElements=Elements;$.each(Elements,function(Index,Data){if(typeof Data!=='object'){return false;}
if(Data.Level===Level){if(Level>0){NewElements=GetChildren(NewElements,Index,Data);}}});return NewElements;}
TargetNS.BuildElementsArray=function($Element,Sort){var Elements=[],Level,HighestLevel=0;if(typeof Sort==='undefined'){Sort=true;}
$Element.find('option').each(function(){var ElementID=$(this).attr('value'),ElementDisabled=$(this).is(':disabled'),ElementName=Core.App.EscapeHTML($(this).text()),ElementSelected=$(this).is(':selected'),ElementNameTrim=ElementName.replace(/(^[\xA0]+)/g,''),CurrentLevel=(ElementName.length-ElementNameTrim.length)/2,ChildOf=0,ElementIndex=0,CurrentElement;if(!ElementID||ElementID==="||-"||(ElementDisabled&&ElementName.match(/^-+$/))){return true;}
if(Elements.length&&CurrentLevel>0){if(CurrentLevel>Elements[Elements.length-1].Level){ChildOf=Elements[Elements.length-1].ID;}
else if(CurrentLevel===Elements[Elements.length-1].Level){ChildOf=Elements[Elements.length-1].ChildOf;}
else{for(ElementIndex=Elements.length;ElementIndex>=0;ElementIndex--){if(CurrentLevel>Elements[ElementIndex-1].Level){ChildOf=Elements[ElementIndex-1].ID;break;}}}}
if(ElementDisabled&&ElementID==='-'){ElementID=Core.UI.GetID();}
CurrentElement={ID:ElementID,Name:ElementNameTrim,Level:CurrentLevel,ChildOf:ChildOf,children:[],text:ElementNameTrim,state:{selected:ElementSelected},li_attr:{'data-id':ElementID,'class':(ElementDisabled)?'Disabled':''}};Elements.push(CurrentElement);if(CurrentLevel>HighestLevel){HighestLevel=CurrentLevel;}});if(Sort){Elements.sort(function(a,b){if(a.Level-b.Level===0){return(a.Name.localeCompare(b.Name));}
else{return(a.Level-b.Level);}});}
for(Level=HighestLevel;Level>=0;Level--){Elements=CollectElements(Elements,Level);}
Elements.HighestLevel=HighestLevel;return Elements;};TargetNS.ShowTreeSelection=function($TriggerObj){var $TreeObj=$('<div id="JSTree"><ul></ul></div>'),$SelectObj=$TriggerObj.prevAll('select'),SelectSize=$SelectObj.attr('size'),Multiple=($SelectObj.attr('multiple')!==''&&$SelectObj.attr('multiple')!==undefined)?true:false,ElementCount=$SelectObj.find('option').length,DialogTitle=$SelectObj.parent().prev('label').clone().children().remove().end().text(),Elements={},InDialog=false,StyleSheetURL,SelectedNodesTree,SelectedNodes=[],$CurrentFocusedObj;if(!$SelectObj){return false;}
if($SelectObj.closest('.Dialog').length){InDialog=true;}
if(InDialog&&$TriggerObj.hasClass('TreeSelectionVisible')){$TriggerObj
.removeClass('TreeSelectionVisible')
.prev('.jstree')
.jstree('destroy')
.remove();$SelectObj.show();return false;}
if(!DialogTitle){DialogTitle=$SelectObj.prev('label').text();}
DialogTitle=$.trim(DialogTitle);DialogTitle=DialogTitle.substr(0,DialogTitle.length-1);DialogTitle=DialogTitle.replace(/^\*\s+/,'');if(ElementCount===1&&$SelectObj.find('option').text()==='-'){alert(Core.Config.Get('NoElementsToSelectFromMsg'));return false;}
Elements=Core.UI.TreeSelection.BuildElementsArray($SelectObj);StyleSheetURL=Core.Config.Get('WebPath')+'skins/Agent/default/css/thirdparty/jstree-theme/default/style.css';$TreeObj.jstree({core:{animation:70,data:Elements,multiple:((SelectSize&&Multiple)||Multiple)?true:false,expand_selected_onload:true,themes:{theme:'default',icons:false,responsive:true,variant:'small',url:StyleSheetURL}},search:{show_only_matches:true,show_only_matches_children:true},plugins:['search']})
.bind('select_node.jstree',function(node,selected,event){var $Node=$('#'+selected.node.id);if($Node.hasClass('Disabled')||!$Node.is(':visible')){$TreeObj.jstree('deselect_node',selected.node);}
$TreeObj.jstree('toggle_node',selected.node);if(InDialog){SelectedNodes=[];SelectedNodesTree=$TreeObj.jstree('get_selected');$.each(SelectedNodesTree,function(){SelectedNodes.push($('#'+Core.App.EscapeSelector(this)).data('id'));});$SelectObj.val(SelectedNodes);}
if((event&&event.type!==undefined)&&!InDialog&&!Multiple){$TreeObj.next('#SubmitTree').focus();}})
.bind('deselect_node.jstree',function(){if(InDialog){SelectedNodes=[];SelectedNodesTree=$TreeObj.jstree('get_selected');$.each(SelectedNodesTree,function(){SelectedNodes.push($('#'+Core.App.EscapeSelector(this)).data('id'));});$SelectObj.val(SelectedNodes);}});if(!InDialog){Core.UI.Dialog.ShowContentDialog('<div class="OverlayTreeSelector" id="TreeContainer"></div>',DialogTitle,'20%','Center',true);$('#TreeContainer')
.prepend($TreeObj)
.prepend('<div id="TreeSearch"><input type="text" id="TreeSearchInput" placeholder="'+Core.Config.Get('SearchMsg')+'..." /><span title="'+Core.Config.Get('DeleteMsg')+'">x</span></div>')
.append('<input type="button" id="SubmitTree" class="Primary" title="'+Core.Config.Get('ApplyButtonText')+'" value="'+Core.Config.Get('ApplyButtonText')+'" />');}
else{$TreeObj
.addClass('Hidden InOverlay')
.insertAfter($SelectObj)
.show();$SelectObj.hide();$TriggerObj.addClass('TreeSelectionVisible');}
$CurrentFocusedObj=document.activeElement;$('#TreeSearch').find('input').focus();$('#TreeSearch').find('input').bind('keyup',function(){$TreeObj.jstree('search',$(this).val());$('.jstree-search')
.parent()
.removeClass('jstree-open')
.addClass('jstree-closed')
.find('ins').click(function(){$(this).nextAll('ul').find('li').show();});});$('#TreeSearch').find('span').bind('click',function(){$(this).prev('input').val('');$TreeObj.jstree('clear_search');});$('#TreeContainer').find('input#SubmitTree').bind('click',function(){var SelectedObj=$TreeObj.jstree('get_selected',true),$Node;if(typeof SelectedObj==='object'&&SelectedObj[0]){if(SelectedObj.length>1){$(SelectedObj).each(function(){var $SelectedNode=$('#'+this.id);SelectedNodes.push($SelectedNode.attr('data-id'));});$SelectObj
.val(SelectedNodes)
.trigger('change');}
else{$Node=$('#'+SelectedObj[0].id);if($Node.attr('data-id')!==$SelectObj.val()){$SelectObj
.val($Node.attr('data-id'))
.trigger('change');}}}
else{$SelectObj
.val('')
.trigger('change');}
Core.UI.Dialog.CloseDialog($('.Dialog'));});Core.App.Subscribe('Event.UI.Dialog.CloseDialog.Close',function(Dialog){if($(Dialog).find('#TreeContainer').length&&!$(Dialog).find('#SearchForm').length){$CurrentFocusedObj.focus();}});};TargetNS.InitTreeSelection=function(){$('.Field, fieldset').off('click.ShowTreeSelection').on('click.ShowTreeSelection','.ShowTreeSelection',function(){Core.UI.TreeSelection.ShowTreeSelection($(this));return false;});};TargetNS.InitDynamicFieldTreeViewRestore=function(){$('.DynamicFieldWithTreeView').each(function(){var Data=[];$(this).find('option').each(function(){Data.push([$(this).attr('value'),$(this).text(),$(this).prop('selected'),$(this).prop('disabled')]);});Core.UI.TreeSelection.RestoreDynamicFieldTreeView($(this),Data,1);});};TargetNS.RestoreDynamicFieldTreeView=function($FieldObj,Data,CheckClass,AJAXUpdate){var Key,Value,Selected,SelectedAttr,Disabled,DisabledAttr,SelectData=[],NeededSpaces,Spaces,i;if(CheckClass&&$FieldObj.hasClass('TreeViewRestored')){return false;}
$FieldObj.find('option').remove();$.each(Data,function(index,OptionData){Key=OptionData[0]||'';Value=OptionData[1]||'';Spaces='';NeededSpaces=0;Selected=OptionData[2]||false;Disabled=OptionData[3]||false;if(AJAXUpdate===1){Selected=OptionData[3];Disabled=OptionData[4];}
if(Key.match(/::/g)){NeededSpaces=Key.match(/::/g).length;}
if(NeededSpaces>0){NeededSpaces=NeededSpaces*2;for(i=0;i<NeededSpaces;i++){Spaces='&nbsp;'+Spaces;}}
Value=Spaces+Value;SelectedAttr='';if(Selected){SelectedAttr=' selected="selected"';}
DisabledAttr='';if(Disabled){DisabledAttr=' disabled="disabled"';}
SelectData.push({'Key':Key,'Value':Value,'SelectedAttr':SelectedAttr,'DisabledAttr':DisabledAttr});});SelectData.sort(function(a,b){var KeyA=a.Key.toLowerCase(),KeyB=b.Key.toLowerCase();if(KeyA<KeyB){return-1;}
if(KeyA>KeyB){return 1;}
return 0;});$.each(SelectData,function(index,SelectedData){$FieldObj.append('<option value="'+SelectedData.Key+'"'+SelectedData.SelectedAttr+SelectedData.DisabledAttr+'>'+SelectedData.Value+'</option>');});$FieldObj.addClass('TreeViewRestored');};return TargetNS;}(Core.UI.TreeSelection||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Autocomplete=(function(TargetNS){var ConfigFallback={AutoCompleteActive:1,MinQueryLength:2,QueryDelay:100,MaxResultsDisplayed:20},ConfigElements=['AutoCompleteActive','MinQueryLength','QueryDelay','MaxResultsDisplayed','ButtonText'],Config={},AJAXLoaderPrefix='AJAXLoader';function InitConfig(Type,Options){var TypeConfig=Core.Config.Get('Autocomplete');$.each(ConfigElements,function(ConfigKey,ConfigElement){if(Options&&typeof Options[ConfigElement]!=='undefined'){Config[ConfigElement]=Options[ConfigElement];}
else if(Type&&TypeConfig[Type]){Config[ConfigElement]=TypeConfig[Type][ConfigElement];}
else{Config[ConfigElement]=ConfigFallback[ConfigElement];}});Config.AutoCompleteActive=parseInt(Config.AutoCompleteActive,10);if(!Config.AutoCompleteActive){Config.MinQueryLength=500;}
return Config;}
TargetNS.GetConfig=function(Key){return Config[Key];};TargetNS.SearchButtonClicked={};TargetNS.Init=function($Element,SourceFunction,SelectFunction,Type,Options){var AutocompleteConfig,$Loader;if(!isJQueryObject($Element)||!$Element.length){return;}
AutocompleteConfig=InitConfig(Type,Options);$Element.each(function(){var $SingleElement=$(this);$SingleElement.autocomplete({minLength:AutocompleteConfig.MinQueryLength,delay:AutocompleteConfig.QueryDelay,search:function(){var FieldID=$SingleElement.attr('id'),LoaderHTML='<span id="'+AJAXLoaderPrefix+FieldID+'" class="AJAXLoader"></span>';$Loader=$('#'+AJAXLoaderPrefix+Core.App.EscapeSelector(FieldID));if(!$Loader.length){$SingleElement.after(LoaderHTML);$Loader=$('#'+AJAXLoaderPrefix+Core.App.EscapeSelector(FieldID));}
else{$Loader.show();}},response:function(){$Loader.hide();},open:function(){$SingleElement.autocomplete('widget').addClass('ui-overlay-autocomplete');return false;},source:function(Request,Response){if($SingleElement.data('AutoCompleteXHR')){$SingleElement.data('AutoCompleteXHR').abort();$SingleElement.removeData('AutoCompleteXHR');Response({});}
if(SourceFunction){SourceFunction(Request,Response);}
},select:function(Event,UI){if(SelectFunction){SelectFunction(Event,UI);}
Event.preventDefault();return false;}});});if(!AutocompleteConfig.AutoCompleteActive){$Element.each(function(){var $SelectedElement=$(this);$SelectedElement.after('<button id="'+Core.App.EscapeSelector($SelectedElement.attr('id'))+'Search" type="button">'+Config.ButtonText+'</button>');$('#'+Core.App.EscapeSelector($SelectedElement.attr('id'))+'Search').click(function(){TargetNS.SearchButtonClicked[$SelectedElement.attr('id')]=true;$SelectedElement.autocomplete("option","minLength",0);$SelectedElement.autocomplete("search");$SelectedElement.autocomplete("option","minLength",500);});});}};return TargetNS;}(Core.UI.Autocomplete||{}));

"use strict";var Core=Core||{};Core.Form=(function(TargetNS){if(!Core.Debug.CheckDependency('Core.Form','Core.Data','Core.Data')){return false;}
TargetNS.DisableForm=function($Form){if(!isJQueryObject($Form)){$Form=$('body');}
if(!$Form.hasClass('AlreadyDisabled')){$.each($Form.find("input:not([type='hidden']), textarea, select, button"),function(){var ReadonlyValue=$(this).attr('readonly'),TagnameValue=$(this).prop('tagName'),DisabledValue=$(this).attr('disabled');if(TagnameValue==='BUTTON'){Core.Data.Set($(this),'OldDisabledStatus',DisabledValue);}
else{Core.Data.Set($(this),'OldReadonlyStatus',ReadonlyValue);}});$Form
.find("input:not([type='hidden']), textarea, select")
.attr('readonly','readonly')
.end()
.find('button')
.attr('disabled','disabled');$Form.addClass('AlreadyDisabled');Core.App.Publish('Event.Form.DisableForm',[$Form]);}};TargetNS.EnableForm=function($Form){if(!isJQueryObject($Form)){$Form=$('body');}
$Form
.find("input:not([type=hidden]), textarea, select")
.removeAttr('readonly')
.end()
.find('button')
.removeAttr('disabled');$.each($Form.find("input:not([type='hidden']), textarea, select, button"),function(){var TagnameValue=$(this).prop('tagName'),ReadonlyValue=Core.Data.Get($(this),'OldReadonlyStatus'),DisabledValue=Core.Data.Get($(this),'OldDisabledStatus');if(TagnameValue==='BUTTON'){if(DisabledValue==='disabled'){$(this).attr('disabled','disabled');}}
else{if(ReadonlyValue==='readonly'){$(this).attr('readonly','readonly');}}});$Form.removeClass('AlreadyDisabled');Core.App.Publish('Event.Form.EnableForm',[$Form]);};TargetNS.SelectAllCheckboxes=function($ClickedBox,$SelectAllCheckbox){var ElementName,SelectAllID,$Elements,Status,CountCheckboxes,CountSelectedCheckboxes;if(isJQueryObject($ClickedBox,$SelectAllCheckbox)){ElementName=$ClickedBox.attr('name');SelectAllID=$SelectAllCheckbox.attr('id');$Elements=$('input[type="checkbox"][name='+ElementName+']').filter('[id!='+SelectAllID+']:visible');Status=$ClickedBox.prop('checked');if($ClickedBox.attr('id')&&$ClickedBox.attr('id')===SelectAllID){$Elements.prop('checked',Status).triggerHandler('click');}
else{CountCheckboxes=$Elements.length;CountSelectedCheckboxes=$Elements.filter(':checked').length;if(CountCheckboxes===CountSelectedCheckboxes){$SelectAllCheckbox.prop('checked',true);}
else{$SelectAllCheckbox.prop('checked',false);}}}};TargetNS.InitSelectAllCheckboxes=function($Checkboxes,$SelectAllCheckbox){if(isJQueryObject($Checkboxes,$SelectAllCheckbox)){if($Checkboxes.filter(':checked').length&&($Checkboxes.filter('[id!='+$SelectAllCheckbox.attr('id')+']').length===$Checkboxes.filter(':checked').length)){$SelectAllCheckbox.prop('checked',true);}
Core.App.Subscribe('Event.UI.Table.InitTableFilter.Change',function($FilterInput,$Container){var CountCheckboxesVisible=$Checkboxes.filter('[id!='+$SelectAllCheckbox.attr('id')+']:visible');if(!$.contains($Container[0],$SelectAllCheckbox[0])){return;}
if(CountCheckboxesVisible.length&&(CountCheckboxesVisible.filter(':checked').length===CountCheckboxesVisible.length)){$SelectAllCheckbox.prop('checked',true);}
else{$SelectAllCheckbox.prop('checked',false);}});}};return TargetNS;}(Core.Form||{}));

"use strict";var Core=Core||{};Core.Form=Core.Form||{};Core.Form.ErrorTooltips=(function(TargetNS){var TooltipContainerID='OTRS_UI_Tooltips_ErrorTooltip',TooltipOffsetTop=20,TooltipOffsetLeft=20,TongueClass='TongueLeft',TonguePosition='TongueBottom',TongueHeight=10,$TooltipContent=$('<div class="Content" role="tooltip"></div>'),$Tooltip,Offset;TargetNS.ShowTooltip=function($Element,TooltipContent,TooltipPosition){var $TooltipContainer=$('#'+TooltipContainerID),TopOffset;if(TooltipPosition==null){TooltipPosition=TonguePosition;}
if(!$TooltipContainer.length){$('body').append('<div id="'+TooltipContainerID+'" class="TooltipContainer"></div>');$TooltipContainer=$('#'+TooltipContainerID);}
if(($(document).width()-$Element.offset().left)<250){TongueClass='TongueRight';}
$Tooltip=$('<div class="Tooltip '+TongueClass+' '+TooltipPosition+'"></div>');$TooltipContent.html(TooltipContent);$Tooltip.append($TooltipContent);Offset=$Element.offset();$TooltipContainer
.empty()
.append($Tooltip)
.show();if(TooltipPosition==='TongueBottom'){TopOffset=Offset.top+TooltipOffsetTop;}
else if(TooltipPosition==='TongueTop'){TopOffset=Offset.top+$Element.height()-$TooltipContainer.height()-TooltipOffsetTop+TongueHeight;}
$TooltipContainer
.css('left',Offset.left+TooltipOffsetLeft)
.css('top',TopOffset);};TargetNS.HideTooltip=function(){$('#'+TooltipContainerID).hide().empty();};TargetNS.InitTooltip=function($Element,TooltipContent){$Element.unbind('focus.Tooltip');$Element.bind('focus.Tooltip',function(){TargetNS.ShowTooltip($Element,TooltipContent);});$Element.unbind('blur.Tooltip');$Element.bind('blur.Tooltip',TargetNS.HideTooltip);};TargetNS.RemoveTooltip=function($Element){TargetNS.HideTooltip();$Element.unbind('focus.Tooltip');$Element.unbind('blur.Tooltip');};function ShowRTETooltip(Event){TargetNS.ShowTooltip($('#cke_'+Event.listenerData.ElementID+' .cke_contents'),Event.listenerData.Message);}
function RemoveRTETooltip(){TargetNS.HideTooltip();}
TargetNS.InitRTETooltip=function($Element,Message){var ElementID=$Element.attr('id');CKEDITOR.instances[ElementID].on('focus',ShowRTETooltip,null,{ElementID:ElementID,Message:Message});CKEDITOR.instances[ElementID].on('blur',RemoveRTETooltip,null,ElementID);};TargetNS.RemoveRTETooltip=function($Element){var ElementID=$Element.attr('id');CKEDITOR.instances[ElementID].removeListener('focus',ShowRTETooltip);CKEDITOR.instances[ElementID].removeListener('blur',RemoveRTETooltip);TargetNS.HideTooltip();};return TargetNS;}(Core.Form.ErrorTooltips||{}));

"use strict";var Core=Core||{};Core.Form=Core.Form||{};Core.Form.Validate=(function(TargetNS){var Options={FormClass:'Validate',ErrorClass:'Error',ErrorLabelClass:'LabelError',ServerErrorClass:'ServerError',ServerLabelClass:'ServerLabelError',IgnoreClass:'ValidationIgnore',SubmitFunction:{}};if(!Core.Debug.CheckDependency('Core.Form.Validate','Core.UI.Accessibility','Core.UI.Accessibility')){return false;}
if(!Core.Debug.CheckDependency('Core.Form.Validate','Core.UI.Dialog','Core.UI.Dialog')){return false;}
if(!Core.Debug.CheckDependency('Core.Form.Validate','Core.Form','Core.Form')){return false;}
if(!Core.Debug.CheckDependency('Core.Form.Validate','Core.UI.RichTextEditor','Core.UI.RichTextEditor')){return false;}
if(!Core.Debug.CheckDependency('Core.Form.Validate','Core.Form.ErrorTooltips','Core.Form.ErrorTooltips')){return false;}
if(!Core.Debug.CheckDependency('Core.Form.Validate','Core.App','Core.App')){return false;}
TargetNS.HighlightError=function(Element,ErrorType){var $Element=$(Element),InputErrorMessageHTML,InputErrorMessageText;if(ErrorType!=='Error'&&ErrorType!=='ServerError'){ErrorType='Error';}
if(Core.UI.RichTextEditor.IsEnabled($Element)){window.setTimeout(function(){$Element.focus();},0);}
if(Core.UI.InputFields.IsEnabled($Element)){window.setTimeout(function(){$('#'+$Element.data('modernized')).focus();},0);}
if($Element.hasClass(Options.ErrorClass)){return false;}
$Element.addClass(Options.ErrorClass).triggerHandler('error.InputField');$(Element.form).find("label[for="+Core.App.EscapeSelector(Element.id)+"]").addClass(Options.ErrorLabelClass);$Element.attr('aria-invalid',true);if($Element.is('input[type="checkbox"], input[type="radio"]')){$Element.data('ValidateOldValue',$Element.prop('checked'));}
else{$Element.data('ValidateOldValue',$Element.val());}
InputErrorMessageHTML=$('#'+Core.App.EscapeSelector($Element.attr('id'))+ErrorType).html();InputErrorMessageText=$('#'+Core.App.EscapeSelector($Element.attr('id'))+ErrorType).text();if(InputErrorMessageHTML&&InputErrorMessageHTML.length){if($('#cke_'+Core.App.EscapeSelector(Element.id)).length){Core.Form.ErrorTooltips.InitRTETooltip($Element,InputErrorMessageHTML);}
else if($Element.hasClass('RichText')&&parseInt(Core.Config.Get('RichTextSet'),10)===1)
{Core.App.Subscribe('Event.UI.RichTextEditor.InstanceReady',function(){Core.Form.ErrorTooltips.InitRTETooltip($Element,InputErrorMessageHTML);});}
else{Core.Form.ErrorTooltips.InitTooltip($Element,InputErrorMessageHTML);}}
Core.UI.Accessibility.AudibleAlert(InputErrorMessageText);if($Element.closest('.WidgetSimple.Collapsed').find('.WidgetAction.Toggle > a').length){$Element.closest('.WidgetSimple.Collapsed').find('.WidgetAction.Toggle > a').trigger('click');}};TargetNS.UnHighlightError=function(Element){var $Element=$(Element),ElementValue,RemoveError=true;if($Element.hasClass(Options.ServerErrorClass)){if($Element.is('input[type="checkbox"], input[type="radio"]')){ElementValue=$Element.prop('checked');}
else{ElementValue=$Element.val();}
if($Element.data('ValidateOldValue')===ElementValue){RemoveError=false;}
else{$Element.removeData('ValidateOldValue');}}
if(RemoveError){$Element.removeClass(Options.ErrorClass).removeClass(Options.ServerErrorClass).triggerHandler('error.InputField');if(Element.id&&Element.id.length){$(Element.form).find("label[for="+Core.App.EscapeSelector(Element.id)+"]").removeClass(Options.ErrorLabelClass);}
$Element.attr('aria-invalid',false);if($('#cke_'+Core.App.EscapeSelector(Element.id)).length){Core.Form.ErrorTooltips.RemoveRTETooltip($Element);}else{Core.Form.ErrorTooltips.RemoveTooltip($Element);}}};function OnErrorElement(){return true;}
function OnSubmit(Form){$(Form).removeClass('ClientError').removeClass('LabelError');if($.isFunction(Options.SubmitFunction[Form.id])){Options.SubmitFunction[Form.id](Form);}
else{Form.submit();}
if($(Form).hasClass("PreventMultipleSubmits")){window.setTimeout(function(){Core.Form.DisableForm($(Form));},0);}}
function ValidatorMethodRequired(Value,Element){var Text,$Element=$(Element);if(Element.nodeName.toLowerCase()==='select'){Text=$(Element).find('option:selected').text();return(Text.length&&Text!=='-');}
if(Core.UI.RichTextEditor.IsEnabled($Element)){Value=CKEDITOR.instances[Element.id].getData();if(!Value.match(/<img/)){Value=Value.replace(/\s+|&nbsp;|<\/?\w+[^>]*\/?>/g,'');}}
if($Element.filter('input[type="checkbox"], input[type="radio"]').length){return $Element.filter(':checked').length>0;}
return $.trim(Value).length>0;}
$.validator.addMethod("Validate_Required",ValidatorMethodRequired,"");$.validator.addMethod("Validate_Number",$.validator.methods.digits,"");$.validator.addMethod("Validate_Email",ValidatorMethodRequired,"");$.validator.addMethod("Validate_MaxLength",function(Value,Element){return(Value.replace(/\n\r?/g,"\n\r").length<=$(Element).data('maxlength'));},"");$.validator.addMethod("Validate_DateYear",function(Value){return(parseInt(Value,10)>999&&parseInt(Value,10)<10000);},"");$.validator.addMethod("Validate_DateMonth",function(Value){return(parseInt(Value,10)>0&&parseInt(Value,10)<13);},"");function DateValidator(Value,Element,DateOptions){var Classes=$(Element).attr('class'),DateObject,RegExYear,RegExMonth,RegExHour,RegExMinute,YearElement='',MonthElement='',HourElement='',MinuteElement='',DateYearClassPrefix='Validate_DateYear_',DateMonthClassPrefix='Validate_DateMonth_',DateHourClassPrefix='Validate_DateHour_',DateMinuteClassPrefix='Validate_DateMinute_',DateCheck,$UsedObj;$UsedObj=$(Element).siblings('input.DynamicFieldText[id*="Used"][type="checkbox"]');if($UsedObj.length>0&&$UsedObj.is(':checked')===false){return true;}
RegExYear=new RegExp(DateYearClassPrefix);RegExMonth=new RegExp(DateMonthClassPrefix);RegExHour=new RegExp(DateHourClassPrefix);RegExMinute=new RegExp(DateMinuteClassPrefix);$.each(Classes.split(' '),function(Index,ClassValue){if(RegExYear.test(ClassValue)){YearElement=ClassValue.replace(DateYearClassPrefix,'');}
if(RegExMonth.test(ClassValue)){MonthElement=ClassValue.replace(DateMonthClassPrefix,'');}
if(RegExHour.test(ClassValue)){HourElement=ClassValue.replace(DateHourClassPrefix,'');}
if(RegExMinute.test(ClassValue)){MinuteElement=ClassValue.replace(DateMinuteClassPrefix,'');}});if(YearElement.length&&MonthElement.length&&$('#'+Core.App.EscapeSelector(YearElement)).length&&$('#'+Core.App.EscapeSelector(MonthElement)).length){DateObject=new Date($('#'+Core.App.EscapeSelector(YearElement)).val(),$('#'+Core.App.EscapeSelector(MonthElement)).val()-1,Value);if(DateObject.getFullYear()===parseInt($('#'+Core.App.EscapeSelector(YearElement)).val(),10)&&DateObject.getMonth()+1===parseInt($('#'+Core.App.EscapeSelector(MonthElement)).val(),10)&&DateObject.getDate()===parseInt(Value,10)){DateCheck=new Date();if(MinuteElement.length&&HourElement.length){DateObject.setHours($('#'+Core.App.EscapeSelector(HourElement)).val(),$('#'+Core.App.EscapeSelector(MinuteElement)).val(),0,0);}
else{DateCheck.setHours(0,0,0,0);}
if(DateOptions.DateInFuture){if(DateObject>=DateCheck){return true;}}
else if(DateOptions.DateNotInFuture){if(DateObject<=DateCheck){return true;}}
else{return true;}}}
return false;}
$.validator.addMethod("Validate_DateDay",function(Value,Element){return DateValidator(Value,Element,{});},"");$.validator.addMethod("Validate_DateInFuture",function(Value,Element){var $DateSelection=$(Element).parent().find('input[type=checkbox].DateSelection, input[type=radio].DateSelection');if($DateSelection.length&&!$DateSelection.prop("checked")){return true;}
return DateValidator(Value,Element,{DateInFuture:true});},"");$.validator.addMethod("Validate_DateNotInFuture",function(Value,Element){var $DateSelection=$(Element).parent().find('input[type=checkbox].DateSelection, input[type=radio].DateSelection');if($DateSelection.length&&!$DateSelection.prop("checked")){return true;}
return DateValidator(Value,Element,{DateNotInFuture:true});},"");$.validator.addMethod("Validate_DateHour",function(Value){return(parseInt(Value,10)>=0&&parseInt(Value,10)<24);},"");$.validator.addMethod("Validate_DateMinute",function(Value){return(parseInt(Value,10)>=0&&parseInt(Value,10)<60);},"");$.validator.addMethod("Validate_TimeUnits",function(Value){return(Value===""||/^-{0,1}\d+?((\.|,){0,1}\d+?){0,1}$/.test(Value));},"");$.validator.addMethod("Validate_Equal",function(Value,Element){var Classes=$(Element).attr('class'),EqualElements=[],ApplyRule=0,EqualClassPrefix='Validate_Equal_',RegExEqual,I;RegExEqual=new RegExp(EqualClassPrefix);$.each(Classes.split(' '),function(Index,ClassValue){if(RegExEqual.test(ClassValue)){EqualElements.push(ClassValue.replace(EqualClassPrefix,''));}});if(EqualElements.length){for(I=0;I<EqualElements.length;I++){if($('#'+$.trim(EqualElements[I])).val()===Value){ApplyRule++;}}
return(ApplyRule===EqualElements.length);}});$.validator.addMethod("Validate_NotEqual",function(Value,Element){var Classes=$(Element).attr('class'),GroupClass='',ApplyRule=1,EqualClassPrefix='Validate_NotEqual_',RegExEqual;RegExEqual=new RegExp(EqualClassPrefix);$.each(Classes.split(' '),function(Index,ClassValue){if(RegExEqual.test(ClassValue)){GroupClass=ClassValue;}});if(GroupClass!==''){$(Element).closest('fieldset fieldset.TableLike').find('.'+GroupClass).each(function(){if($(Element).attr('id')!==$(this).attr('id')&&$(this).val()===Value){ApplyRule=0;}});}
return ApplyRule;});$.validator.addClassRules("Validate_Required",{Validate_Required:true});$.validator.addClassRules("Validate_Number",{Validate_Number:true});$.validator.addClassRules("Validate_Email",{Validate_Email:true});$.validator.addClassRules("Validate_MaxLength",{Validate_MaxLength:true});$.validator.addClassRules("Validate_RequiredDropdown",{Validate_Required:true});$.validator.addClassRules("Validate_RequiredRichText",{Validate_Required:true});$.validator.addClassRules("Validate_DateYear",{Validate_DateYear:true});$.validator.addClassRules("Validate_DateMonth",{Validate_DateMonth:true});$.validator.addClassRules("Validate_DateDay",{Validate_DateDay:true});$.validator.addClassRules("Validate_DateHour",{Validate_DateHour:true});$.validator.addClassRules("Validate_DateMinute",{Validate_DateMinute:true});$.validator.addClassRules("Validate_TimeUnits",{Validate_TimeUnits:true});$.validator.addClassRules("Validate_Equal",{Validate_Equal:true});$.validator.addClassRules("Validate_NotEqual",{Validate_NotEqual:true});function GetDependentElements(Element){var Classes=$(Element).attr('class'),DependentElementIDs=[],RegEx,DependingClassPrefix='Validate_Depending_';RegEx=new RegExp(DependingClassPrefix);$.each(Classes.split(' '),function(Index,Value){if(RegEx.test(Value)){DependentElementIDs.push(Value.replace(DependingClassPrefix,''));}});return DependentElementIDs;}
$.validator.addMethod("Validate_DependingRequiredAND",function(Value,Element){var I,DependentElementIDs=[],$DependentElement;DependentElementIDs=GetDependentElements(Element);for(I=0;I<DependentElementIDs.length;I++){$DependentElement=$('#'+$.trim(DependentElementIDs[I]));if($DependentElement.length&&ValidatorMethodRequired($DependentElement.val(),$DependentElement[0])){return ValidatorMethodRequired(Value,Element);}}
return true;},"");$.validator.addClassRules("Validate_DependingRequiredAND",{Validate_DependingRequiredAND:true
});$.validator.addMethod("Validate_DependingRequiredOR",function(Value,Element){var I,DependentElementIDs=[],$DependentElement;DependentElementIDs=GetDependentElements(Element);for(I=0;I<DependentElementIDs.length;I++){$DependentElement=$('#'+$.trim(DependentElementIDs[I]));if($DependentElement.length&&ValidatorMethodRequired($DependentElement.val(),$DependentElement[0])){return true;}}
return ValidatorMethodRequired(Value,Element);},"");$.validator.addClassRules("Validate_DependingRequiredOR",{Validate_DependingRequiredOR:true
});TargetNS.Init=function(){var FormSelector,$ServerErrors,ServerErrorDialogCloseFunction;if(Options.FormClass){FormSelector='form.'+Options.FormClass;}
else{FormSelector='form';}
if(Core.Config.Get('CheckEmailAddresses')){$.validator.addMethod("Validate_Email",$.validator.methods.email,"");}
$(FormSelector).each(function(){$(this).validate({ignoreTitle:true,errorClass:Options.ErrorClass,highlight:TargetNS.HighlightError,unhighlight:TargetNS.UnHighlightError,errorPlacement:OnErrorElement,submitHandler:OnSubmit,ignore:'.'+Options.IgnoreClass});});$ServerErrors=$('input.'+Options.ServerErrorClass)
.add('textarea.'+Options.ServerErrorClass)
.add('select.'+Options.ServerErrorClass);if($ServerErrors.length){$ServerErrors.each(function(){$(this).parents('.WidgetSimple.Collapsed').toggleClass('Collapsed Expanded');TargetNS.HighlightError(this,'ServerError');});ServerErrorDialogCloseFunction=function(){Core.UI.Dialog.CloseDialog($('.Dialog:visible'));$ServerErrors.eq(0).focus();};Core.UI.Dialog.ShowAlert(Core.Config.Get('ValidateServerErrorTitle'),Core.Config.Get('ValidateServerErrorMsg'),ServerErrorDialogCloseFunction);}};TargetNS.ValidateElement=function($Element){if(isJQueryObject($Element)){return $Element.closest('form').validate().element($Element);}
return false;};TargetNS.SetSubmitFunction=function($Form,Func){if(!isJQueryObject($Form)){return false;}
if($.isFunction(Func)&&$Form.length){Options.SubmitFunction[$Form.attr('id')]=Func;}};TargetNS.AddDependingValidation=function(Name,Basis,Depends){var RuleHash={};RuleHash[Basis]={depends:Depends};$.validator.addClassRules(Name,RuleHash);};TargetNS.AddMethod=function(Name,Function){if(Name&&$.isFunction(Function)){$.validator.addMethod(Name,Function,"");}};TargetNS.AddRule=function(Name,MethodHash){if(Name&&typeof MethodHash==="object"){$.validator.addClassRules(Name,MethodHash);}};TargetNS.DisableValidation=function($Form){if(!isJQueryObject($Form)){$Form=$('body');}
$Form
.find("input:not([type='hidden']), textarea, select")
.addClass(Options.IgnoreClass);};TargetNS.EnableValidation=function($Form){if(!isJQueryObject($Form)){$Form=$('body');}
$Form
.find("input:not([type='hidden']), textarea, select")
.removeClass(Options.IgnoreClass);};return TargetNS;}(Core.Form.Validate||{}));

"use strict";var Core=Core||{};Core.Agent=(function(TargetNS){if(!Core.Debug.CheckDependency('Core.Agent','Core.UI','Core.UI')){return false;}
if(!Core.Debug.CheckDependency('Core.Agent','Core.Form','Core.Form')){return false;}
if(!Core.Debug.CheckDependency('Core.Agent','Core.Form.Validate','Core.Form.Validate')){return false;}
if(!Core.Debug.CheckDependency('Core.Agent','Core.UI.Accessibility','Core.UI.Accessibility')){return false;}
if(!Core.Debug.CheckDependency('Core.Agent','Core.UI.InputFields','Core.UI.InputFields')){return false;}
if(!Core.Debug.CheckDependency('Core.Agent','Core.UI.TreeSelection','Core.UI.TreeSelection')){return false;}
if(!Core.Debug.CheckDependency('Core.Agent','Core.AJAX','Core.AJAX')){return false;}
function InitNavigation(){var NavigationTimer={},NavigationDuration=500,NavigationHoverTimer={},NavigationHoverDuration=350,InitialNavigationContainerHeight=$('#NavigationContainer').css('height'),NavigationResizeTimeout;function CreateSubnavCloseTimeout($Element,TimeoutFunction){NavigationTimer[$Element.attr('id')]=setTimeout(TimeoutFunction,NavigationDuration);}
function ClearSubnavCloseTimeout($Element){if(typeof NavigationTimer[$Element.attr('id')]!=='undefined'){clearTimeout(NavigationTimer[$Element.attr('id')]);}}
function CreateSubnavOpenTimeout($Element,TimeoutFunction){NavigationHoverTimer[$Element.attr('id')]=setTimeout(TimeoutFunction,NavigationHoverDuration);}
function ClearSubnavOpenTimeout($Element){if(typeof NavigationHoverTimer[$Element.attr('id')]!=='undefined'){clearTimeout(NavigationHoverTimer[$Element.attr('id')]);}}
function SetNavContainerHeight($ParentElement){if($ParentElement.find('ul').length){$('#NavigationContainer').css('height',parseInt(InitialNavigationContainerHeight,10)+parseInt($ParentElement.find('ul').outerHeight(),10));}}
$('#Navigation > li')
.addClass('CanDrag')
.filter(function(){return $('ul',this).length;})
.bind('mouseenter',function(){var $Element=$(this);ClearSubnavCloseTimeout($Element);if($('body').hasClass('Visible-ScreenXL')&&!Core.App.Responsive.IsTouchDevice()&&($Element.parent().attr('id')!=='Navigation'||Core.Config.Get('OpenMainMenuOnHover'))){CreateSubnavOpenTimeout($Element,function(){$Element.addClass('Active').attr('aria-expanded',true)
.siblings().removeClass('Active');SetNavContainerHeight($Element);ClearSubnavCloseTimeout($Element);});}})
.bind('mouseleave',function(){var $Element=$(this);if($('body').hasClass('Visible-ScreenXL')){ClearSubnavOpenTimeout($Element);if(!$Element.hasClass('Active')){return false;}
CreateSubnavCloseTimeout($Element,function(){$Element.removeClass('Active').attr('aria-expanded',false);$Element.parent().parent().removeClass('NavContainerZIndex');if(!$('#Navigation > li.Active').length){$('#NavigationContainer').css('height',InitialNavigationContainerHeight);}});}})
.bind('click',function(Event){var $Element=$(this),$Target=$(Event.target);if($Target.attr('onclick')){return false;}
if($('body').hasClass('Visible-ScreenXL')&&!Core.App.Responsive.IsTouchDevice()&&Core.Config.Get('OpenMainMenuOnHover')){return true;}
if(!Core.Config.Get('OTRSBusinessIsInstalled')&&$Target.hasClass('OTRSBusinessRequired')){return true;}
if(navigator&&navigator.userAgent&&navigator.userAgent.match(/Windows Phone/i)&&$Target.closest('ul').attr('id')!=='Navigation'){window.location.href=$Target.closest('a').attr('href');Event.stopPropagation();Event.preventDefault();return true;}
if($Element.hasClass('Active')){$Element.removeClass('Active').attr('aria-expanded',false);$Element.parent().parent().removeClass('NavContainerZIndex');if($('body').hasClass('Visible-ScreenXL')){$('#NavigationContainer').css('height',InitialNavigationContainerHeight);}}
else{$Element.addClass('Active').attr('aria-expanded',true)
.siblings().removeClass('Active');if($('body').hasClass('Visible-ScreenXL')){SetNavContainerHeight($Element);ClearSubnavCloseTimeout($Element);$Element.parent().parent().addClass('NavContainerZIndex');}}
if($Target.closest('li').find('ul').length){Event.preventDefault();Event.stopPropagation();return false;}})
.each(function(){var $Li=$(this),ARIAControlsID=$Li.children('ul').attr('id');if(ARIAControlsID&&ARIAControlsID.length){$Li.attr('aria-controls',ARIAControlsID).attr('aria-expanded',false);}});if(Core.Config.Get('MenuDragDropEnabled')===1){Core.App.Subscribe('Event.App.Responsive.ScreenXL',function(){$('#NavigationContainer').css('height','35px');Core.UI.DnD.Sortable($('#Navigation'),{Items:'li.CanDrag',Tolerance:'pointer',Distance:15,Opacity:0.6,Helper:'clone',Axis:'x',Containment:$('#Navigation'),Update:function(){var Items=[];$.each($('#Navigation').children('li'),function(){Items.push($(this).attr('id'));});TargetNS.PreferencesUpdate('UserNavBarItemsOrder',Core.JSON.Stringify(Items));$('#Navigation').after('<i class="fa fa-check"></i>').next('.fa-check').css('left',$('#Navigation').outerWidth()+10).delay(200).fadeIn(function(){$(this).delay(1500).fadeOut();});$('#NavigationContainer').css('height',InitialNavigationContainerHeight);}});});Core.App.Subscribe('Event.App.Responsive.SmallerOrEqualScreenL',function(){if($('#Navigation').sortable("instance")){$('#Navigation').sortable("destroy");$('#NavigationContainer').css('height','100%');}});}
$('#Navigation li').filter(function(){return $('ul',this).length;}).attr('aria-haspopup','true');$('#GlobalSearchNav, #GlobalSearchNavResponsive').bind('click',function(){var SearchFrontend=Core.Config.Get('SearchFrontend');if(SearchFrontend){try{eval(SearchFrontend);}
catch(Error){$.noop(Error);}}
else{Core.Agent.Search.OpenSearchDialog();}
return false;});TargetNS.ResizeNavigationBar();$(window).resize(function(){if(!$('body').hasClass('Visible-ScreenXL')){return;}
window.clearTimeout(NavigationResizeTimeout);NavigationResizeTimeout=window.setTimeout(function(){TargetNS.ResizeNavigationBar(true);},400);});}
function NavigationBarShowSlideButton(Direction,Difference){var Opposites=(Direction==='Right')?'Left':'Right',NewPosition,HideButton=false,Delay=150;if(!$('#NavigationContainer').find('.NavigationBarNavigate'+Direction).length){$('#NavigationContainer')
.append('<a href="#" title="'+Core.Config.Get('SlideNavigationText')+'" class="Hidden NavigationBarNavigate'+Direction+'"><i class="fa fa-chevron-'+Direction.toLowerCase()+'"></i></a>')
.find('.NavigationBarNavigate'+Direction)
.delay(Delay)
.fadeIn()
.bind('click',function(){if(Direction==='Right'){NewPosition=(parseInt($('#Navigation').css('left'),10)*-1)+parseInt($('#NavigationContainer').width(),10);if(NewPosition>=(parseInt($('#Navigation').width(),10)-parseInt($('#NavigationContainer').width(),10))){NewPosition=parseInt($('#Navigation').width(),10)-parseInt($('#NavigationContainer').width(),10);HideButton=true;}
$('#Navigation')
.animate({'left':NewPosition*-1},'fast',function(){if(HideButton){$('#NavigationContainer')
.find('.NavigationBarNavigate'+Direction)
.fadeOut(Delay,function(){$(this).remove();});}
NavigationBarShowSlideButton(Opposites,Difference);});}
else{NewPosition=(parseInt($('#Navigation').css('left'),10)*-1)-parseInt($('#NavigationContainer').width(),10);if(NewPosition<=0){NewPosition=0;HideButton=true;}
$('#Navigation')
.animate({'left':NewPosition*-1},'fast',function(){if(HideButton){$('#NavigationContainer')
.find('.NavigationBarNavigate'+Direction)
.fadeOut(Delay,function(){$(this).remove();});}
NavigationBarShowSlideButton(Opposites,Difference);});}
return false;});}}
TargetNS.ReorderNavigationItems=function(NavbarCustomOrderItems){var CurrentItems;if(NavbarCustomOrderItems&&Core.Config.Get('MenuDragDropEnabled')===1){CurrentItems=$('#Navigation').children('li').get();CurrentItems.sort(function(a,b){var IDA,IDB;IDA=$(a).attr('id');IDB=$(b).attr('id');if($.inArray(IDA,NavbarCustomOrderItems)<$.inArray(IDB,NavbarCustomOrderItems)){return-1;}
if($.inArray(IDA,NavbarCustomOrderItems)>$.inArray(IDB,NavbarCustomOrderItems)){return 1;}
return 0;});$('#Navigation').empty().append(CurrentItems);InitNavigation();}
$('#Navigation').hide().css('visibility','visible').show();};function ToolBarIsAside(){if((!$('body').hasClass('RTL')&&(parseInt($('#ToolBar').css('left'),10)>parseInt($('#ToolBar').css('right'),10)||isNaN(parseInt($('#ToolBar').css('left'),10)))&&parseInt($('#NavigationContainer').css('top'),10)<parseInt($('#ToolBar').height(),10))||($('body').hasClass('RTL')&&(parseInt($('#ToolBar').css('left'),10)<parseInt($('#ToolBar').css('right'),10)||isNaN(parseInt($('#ToolBar').css('right'),10)))&&parseInt($('#NavigationContainer').css('top'),10)<parseInt($('#ToolBar').height(),10))){return true;}
return false;}
TargetNS.ResizeNavigationBar=function(RealResizeEvent){var NavigationBarWidth=0,NewContainerWidth;if(RealResizeEvent&&!$('body').hasClass('Visible-ScreenXL')){return;}
if(!$('#NavigationContainer').attr('data-original-width')){$('#NavigationContainer').attr('data-original-width',parseInt(parseInt($('#NavigationContainer').css('width'),10)/$('body').width()*100,10)+'%');}
$('#Navigation').css('left','0px');$('.NavigationBarNavigateLeft').remove();if(ToolBarIsAside()&&(!$('#NavigationContainer').hasClass('IsResized')||RealResizeEvent)){$('#NavigationContainer').css('width',$('#NavigationContainer').attr('data-original-width'));NewContainerWidth=$('#NavigationContainer').width()-$('#ToolBar').width()-parseInt($('#ToolBar').css('right'),10);if($('body').hasClass('RTL')){NewContainerWidth=$('#NavigationContainer').width()-$('#ToolBar').width()-parseInt($('#ToolBar').css('left'),10);}
$('#NavigationContainer')
.css('width',NewContainerWidth)
.addClass('IsResized');}
$('#Navigation > li').each(function(){NavigationBarWidth+=$(this)[0].getBoundingClientRect().width
+parseInt($(this).css('margin-left'),10)
+parseInt($(this).css('margin-right'),10)
+parseInt($(this).css('border-left-width'),10)
+parseInt($(this).css('border-right-width'),10);});if($.browser.msie||$.browser.trident){NavigationBarWidth+=1;}
$('#Navigation').css('width',Math.ceil(NavigationBarWidth));if(NavigationBarWidth>$('#NavigationContainer').outerWidth()){NavigationBarShowSlideButton('Right',parseInt($('#NavigationContainer').outerWidth(true)-NavigationBarWidth,10));}
else if(NavigationBarWidth<$('#NavigationContainer').outerWidth(true)){$('.NavigationBarNavigateRight, .NavigationBarNavigateLeft').remove();if($('body').hasClass('RTL')){$('#Navigation').css({'left':'auto','right':'0px'});}
else{$('#Navigation').css({'left':'0px','right':'auto'});}}};TargetNS.SupportedBrowser=true;TargetNS.IECompatibilityMode=false;TargetNS.Init=function(){TargetNS.SupportedBrowser=Core.App.BrowserCheck('Agent');TargetNS.IECompatibilityMode=Core.App.BrowserCheckIECompatibilityMode();if(TargetNS.IECompatibilityMode){TargetNS.SupportedBrowser=false;alert(Core.Config.Get('TurnOffCompatibilityModeMsg'));}
if(!TargetNS.SupportedBrowser){alert(Core.Config.Get('BrowserTooOldMsg')+' '+Core.Config.Get('BrowserListMsg')+' '+Core.Config.Get('BrowserDocumentationMsg'));}
Core.App.Responsive.CheckIfTouchDevice();InitNavigation();Core.Exception.Init();Core.UI.InitWidgetActionToggle();Core.UI.InitMessageBoxClose();Core.Form.Validate.Init();Core.UI.Popup.Init();Core.UI.InputFields.Init();Core.UI.TreeSelection.InitTreeSelection();Core.UI.TreeSelection.InitDynamicFieldTreeViewRestore();if(typeof Core.Agent.Chat!=='undefined'&&typeof Core.Agent.Chat.Toolbar!=='undefined'&&typeof Core.Agent.Chat.Toolbar.InitChatButtons!=='undefined')
{Core.Agent.Chat.Toolbar.InitChatButtons();}
Core.UI.Accessibility.Init();};TargetNS.PreferencesUpdate=function(Key,Value){var URL=Core.Config.Get('Baselink'),Data={Action:'AgentPreferences',Subaction:'UpdateAJAX',Key:Key,Value:Value};Core.AJAX.FunctionCall(URL,Data,$.noop);return true;};TargetNS.CheckSessionExpiredAndReload=function(){if($('#LoginBox').length){location.reload();}};return TargetNS;}(Core.Agent||{}));

"use strict";var Core=Core||{};Core.Agent=Core.Agent||{};Core.Agent.Search=(function(TargetNS){var AJAXStopWordCheckRunning=false;TargetNS.AdditionalAttributeSelectionRebuild=function(){var $AttributeClone=$('#AttributeOrig option').clone(),$AttributeSelection=$('#Attribute').empty();$AttributeClone.each(function(){if(!$('#SearchInsert label#Label'+$(this).attr('value')).length){$AttributeSelection.append($(this));}});$AttributeSelection.trigger('redraw.InputField');return true;};TargetNS.SearchAttributeAdd=function(Attribute){var $Label=$('#SearchAttributesHidden label#Label'+Attribute);if($Label.length){$Label.prev().clone().appendTo('#SearchInsert');$Label.clone().appendTo('#SearchInsert');$Label.next().clone().appendTo('#SearchInsert')
.find('.RemoveButton').bind('click',function(){var $Element=$(this).parent();TargetNS.SearchAttributeRemove($Element);TargetNS.AdditionalAttributeSelectionRebuild();return false;});Core.UI.TreeSelection.InitTreeSelection();Core.UI.InputFields.Activate($('#SearchInsert'));Core.UI.TreeSelection.InitDynamicFieldTreeViewRestore();}
return false;};TargetNS.SearchAttributeRemove=function($Element){$Element.prev().prev().remove();$Element.prev().remove();$Element.remove();};function SearchProfileDelete(Profile){var Data={Action:'AgentTicketSearch',Subaction:'AJAXProfileDelete',Profile:Profile};Core.AJAX.FunctionCall(Core.Config.Get('CGIHandle'),Data,function(){});}
function CheckForSearchedValues(){var SearchValueFlag=false;$('#SearchForm label').each(function(){var ElementName,$Element,$LabelElement=$(this),$FieldElement=$LabelElement.next('.Field');if($(this).attr('id')){ElementName=$(this).attr('id').substring(5);$Element=$('#SearchForm input[name='+Core.App.EscapeSelector(ElementName)+']');if(!$Element.length){$Element=$(this).next().find('select');}
if($FieldElement.find('input[name$="SearchType"]').val()==='TimeSlot'&&!$FieldElement.find('select').length){$Element=$FieldElement.find('input[type=text]').first();}
if($Element.length){if($Element.val()&&$Element.val()!==''){SearchValueFlag=true;}}}});if(!SearchValueFlag){alert(Core.Config.Get('EmptySearchMsg'));}
return SearchValueFlag;}
function ShowWaitingDialog(){Core.UI.Dialog.ShowContentDialog('<div class="Spacing Center"><span class="AJAXLoader" title="'+Core.Config.Get('LoadingMsg')+'"></span></div>',Core.Config.Get('LoadingMsg'),'10px','Center',true);}
function AJAXStopWordCheck(SearchStrings,CallbackStopWordsFound,CallbackNoStopWordsFound){var StopWordCheckData={Action:'AgentTicketSearch',Subaction:'AJAXStopWordCheck',SearchStrings:SearchStrings};if(AJAXStopWordCheckRunning){return;}
AJAXStopWordCheckRunning=true;Core.Form.DisableForm($('#SearchForm'));Core.AJAX.FunctionCall(Core.Config.Get('CGIHandle'),StopWordCheckData,function(Result){var FoundStopWords='';$.each(Result.FoundStopWords,function(Key,StopWords){var TranslatedKey=Core.Config.Get('FieldTitle'+Key);if(!StopWords.length){return;}
if(!TranslatedKey){TranslatedKey=Key;}
FoundStopWords+=TranslatedKey+': '+StopWords.join(', ')+"\n";});AJAXStopWordCheckRunning=false;Core.Form.EnableForm($('#SearchForm'));if(FoundStopWords.length){CallbackStopWordsFound(FoundStopWords);}
else{CallbackNoStopWordsFound();}});}
function CheckSearchStringsForStopWords(Callback){var SearchStrings={},SearchStringsFound=0,RelevantElementNames={'From':1,'To':1,'Cc':1,'Subject':1,'Body':1,'Fulltext':1};if(!Core.Config.Get('CheckSearchStringsForStopWords')){Callback();return;}
$('#SearchForm label').each(function(){var ElementName,$Element;if($(this).attr('id')){ElementName=$(this).attr('id').substring(5);if(!RelevantElementNames[ElementName]){return;}
$Element=$('#SearchForm input[name='+ElementName+']');if($Element.length){if($Element.val()&&$Element.val()!==''){SearchStrings[ElementName]=$Element.val();SearchStringsFound=1;}}}});if(!SearchStringsFound){Callback();return;}
AJAXStopWordCheck(SearchStrings,function(FoundStopWords){alert(Core.Config.Get('SearchStringsContainStopWordsMsg')+"\n"+FoundStopWords);},Callback);}
TargetNS.OpenSearchDialog=function(Action,Profile,EmptySearch){var Referrer=Core.Config.Get('Action'),Data;if(!Action){Action='AgentSearch';}
Data={Action:Action,Referrer:Referrer,Profile:Profile,EmptySearch:EmptySearch,Subaction:'AJAX'};ShowWaitingDialog();Core.AJAX.FunctionCall(Core.Config.Get('CGIHandle'),Data,function(HTML){if(!$('.Dialog:visible').length){return;}
Core.UI.Dialog.ShowContentDialog(HTML,Core.Config.Get('SearchMsg'),'10px','Center',true,undefined,true);$('#SearchProfileAddBlock').hide();$('#SaveProfile').parent().hide().prev().hide().prev().hide();if($('#SearchProfile').val()&&$('#SearchProfile').val()!=='last-search'){$('#SearchProfileDelete').show();$('#SearchProfileAsLink').show();$('#SaveProfile').parent().show().prev().show().prev().show();$('#SaveProfile').prop('checked',false);}
Core.UI.InputFields.Activate($('.Dialog:visible'));$('.AddButton').bind('click',function(){var Attribute=$('#Attribute').val();TargetNS.SearchAttributeAdd(Attribute);TargetNS.AdditionalAttributeSelectionRebuild();$('.ShowTreeSelection').unbind('click').bind('click',function(){Core.UI.TreeSelection.ShowTreeSelection($(this));return false;});return false;});$('#SearchForm').unbind('keypress.FilterInput').bind('keypress.FilterInput',function(Event){if((Event.charCode||Event.keyCode)===13){if(!CheckForSearchedValues()){return false;}
else{$('#SearchFormSubmit').trigger('click');}
return false;}});$('#SearchFormSubmit').bind('click',function(){var ShownAttributes=[];if($('#SearchProfileAddAction, #SearchProfileAddName').is(':visible')&&$('#SearchProfileAddName').val()){$('#SearchProfileAddAction').trigger('click');}
$('#SearchInsert label').each(function(){if($(this).attr('id')){ShownAttributes.push($(this).attr('id'));}});$('#SearchForm #ShownAttributes').val(ShownAttributes.join(';'));if($('#SearchForm #ResultForm').val()==='Normal'){if(!CheckForSearchedValues()){return false;}
else{CheckSearchStringsForStopWords(function(){$('#SearchForm').submit();return false;});}}
else{$('#SearchForm').attr('target','SearchResultPage');if(!CheckForSearchedValues()){return false;}
else{CheckSearchStringsForStopWords(function(){$('#SearchForm').submit();$('#SearchForm').attr('target','');});}}
return false;});Core.Form.Validate.Init();Core.Form.Validate.SetSubmitFunction($('#SearchForm'),function(Form){Form.submit();ShowWaitingDialog();});$('#SearchProfile').bind('change',function(){var SearchProfile=$('#SearchProfile').val(),SearchProfileEmptySearch=$('#EmptySearch').val(),SearchProfileAction=$('#SearchAction').val();TargetNS.OpenSearchDialog(SearchProfileAction,SearchProfile,SearchProfileEmptySearch);return false;});$('#SearchProfileNew').bind('click',function(Event){$('#SearchProfileAddBlock').toggle();$('#SearchProfileAddName').focus();Event.preventDefault();return false;});$('#SearchProfileAddAction').bind('click',function(){var ProfileName,$Element1;ProfileName=$('#SearchProfileAddName').val();if(!ProfileName.length||ProfileName.length<2){return;}
$Element1=$('#SearchProfile').children().first().clone();$Element1.text(ProfileName);$Element1.attr('value',ProfileName);$Element1.prop('selected',true);$('#SearchProfile').append($Element1).trigger('redraw.InputField');$('#SearchProfileAddName').val('');$('#SearchProfileAddBlock').hide();$('#SaveProfile').parent().hide().prev().hide().prev().hide();$('#SaveProfile').prop('checked',true);$('#SearchProfileDelete').show();$('#SearchProfileAsLink').show();});$('#SearchProfileAsLink').bind('click',function(){var SearchProfile=$('#SearchProfile').val(),SearchProfileAction=$('#SearchAction').val();window.location.href=Core.Config.Get('Baselink')+'Action='+SearchProfileAction+
';Subaction=Search;TakeLastSearch=1;SaveProfile=1;Profile='+encodeURIComponent(SearchProfile);return false;});$('#SearchProfileDelete').bind('click',function(Event){$('#SearchProfile').find('option:selected').each(function(){if($(this).attr('value')!=='last-search'){$('#SearchInsert').text('');SearchProfileDelete($(this).val());$(this).remove();TargetNS.SearchAttributeAdd('Fulltext');TargetNS.AdditionalAttributeSelectionRebuild();}});$('#SearchProfile').trigger('change');if($('#SearchProfile').val()&&$('#SearchProfile').val()==='last-search'){$('#SearchProfileDelete').hide();$('#SearchProfileAsLink').hide();}
Event.preventDefault();return false;});},'html');};TargetNS.InitToolbarFulltextSearch=function(){$('#ToolBar li.Extended.SearchFulltext form[name="SearchFulltext"]').unbind('keypress.FilterInput').bind('keypress.FilterInput',function(Event){var SearchString;if((Event.charCode||Event.keyCode)===13){SearchString=$('#Fulltext').val();if(!SearchString.length||!Core.Config.Get('CheckSearchStringsForStopWords')){return true;}
AJAXStopWordCheck({Fulltext:SearchString},function(FoundStopWords){alert(Core.Config.Get('SearchStringsContainStopWordsMsg')+"\n"+FoundStopWords);},function(){$('#ToolBar li.Extended.SearchFulltext form[name="SearchFulltext"]').submit();});return false;}});};return TargetNS;}(Core.Agent.Search||{}));

"use strict";var Core=Core||{};Core.Agent=Core.Agent||{};Core.Agent.CustomerInformationCenterSearch=(function(TargetNS){function ShowWaitingDialog(){Core.UI.Dialog.ShowContentDialog('<div class="Spacing Center"><span class="AJAXLoader" title="'+Core.Config.Get('LoadingMsg')+'"></span></div>',Core.Config.Get('LoadingMsg'),'10px','Center',true);}
function Redirect(CustomerID,Event){var Session='';Event.preventDefault();Event.stopPropagation();ShowWaitingDialog();if(!Core.Config.Get('SessionIDCookie')){Session=';'+Core.Config.Get('SessionName')+'='+Core.Config.Get('SessionID');}
window.location.href=Core.Config.Get('Baselink')+'Action=AgentCustomerInformationCenter;CustomerID='+encodeURIComponent(CustomerID)+Session;}
TargetNS.InitAutocomplete=function($Input,Subaction){Core.UI.Autocomplete.Init($Input,function(Request,Response){var URL=Core.Config.Get('Baselink'),Data={Action:'AgentCustomerInformationCenterSearch',Subaction:Subaction,Term:Request.term,MaxResults:Core.UI.Autocomplete.GetConfig('MaxResultsDisplayed')};$Input.data('AutoCompleteXHR',Core.AJAX.FunctionCall(URL,Data,function(Result){var ValueData=[];$Input.removeData('AutoCompleteXHR');$.each(Result,function(){ValueData.push({label:this.Label,value:this.Value});});Response(ValueData);}));},function(Event,UI){Redirect(UI.item.value,Event);},'CustomerSearch');};TargetNS.OpenSearchDialog=function(){var Data={Action:'AgentCustomerInformationCenterSearch'};ShowWaitingDialog();Core.AJAX.FunctionCall(Core.Config.Get('CGIHandle'),Data,function(HTML){if(!$('.Dialog:visible').length){return;}
Core.UI.Dialog.ShowContentDialog(HTML,Core.Config.Get('SearchMsg'),'10px','Center',true);},'html');};TargetNS.Init=function(){TargetNS.InitAutocomplete($("#AgentCustomerInformationCenterSearchCustomerID"),'SearchCustomerID');TargetNS.InitAutocomplete($("#AgentCustomerInformationCenterSearchCustomerUser"),'SearchCustomerUser');};return TargetNS;}(Core.Agent.CustomerInformationCenterSearch||{}));

"use strict";var Core=Core||{};Core.UI=Core.UI||{};Core.UI.Notification=(function(TargetNS){var Notification=window.Notification||window.mozNotification||window.webkitNotification;TargetNS.RequestPermission=function(){return Notification.requestPermission(function(Result){if(Result==='denied'||Result==='default'){return false;}
return true;});};TargetNS.Show=function(Header,Body,Sticky,Icon,Action){var Options,NewNotification;if(!Notification){alert(Header+" \n "+Body);return true;}
if(Sticky===1){Sticky=true;}else{Sticky=false;}
return Notification.requestPermission(function(Result){if(Result==='denied'||Result==='default'){return false;}
Options={body:Body,sticky:Sticky,icon:Icon,vibrate:[200,100,200]};NewNotification=new Notification(Header,Options);if(Action){NewNotification.onclick=function(){window.location.href=Core.Config.Get('Baselink')+"Action="+Action;NewNotification.close();};}
return true;});};return TargetNS;}(Core.UI.Notification||{}));

"use strict";var Core=Core||{};Core.Agent=Core.Agent||{};Core.Agent.Responsive=(function(TargetNS){Core.App.Subscribe('Event.App.Responsive.SmallerOrEqualScreenL',function(){if(!$('#ViewModeSwitch').length){$('#Footer').append('<div id="ViewModeSwitch"><a href="#">'+Core.Config.Get('ViewModeSwitchDesktop')+'</a></div>');$('#ViewModeSwitch a').on('click.Responsive',function(){localStorage.setItem("DesktopMode",1);location.reload(true);return false;});}
$('.Dashboard .WidgetSimple .Header').off('click.Responsive').on('click.Responsive',function(){$(this).find('.ActionMenu').fadeToggle();});$('.D3GraphMessage, .D3GraphCanvas').closest('.WidgetSimple').hide();$('span.Pagination a:first-child').parent().closest('.WidgetSimple').each(function(){if(!$(this).find('.ShowPagination').length){$(this).find('.WidgetAction.Close').after('<div class="WidgetAction ShowPagination"><a title="Close" href=""><i class="fa fa-angle-double-right"></i></a></div>');}});$('.WidgetAction.ShowPagination').off('click.Responsive').on('click.Responsive',function(){$(this).closest('.WidgetSimple').find('.Pagination').toggleClass('AsBlock');return false;});$('#Header').off().on('click',function(){var TargetHeight='70px',TargetFade='out';if(parseInt($('#ToolBar').height(),10)>0){TargetHeight='0px';TargetFade='in';}
$('#ToolBar').animate({height:TargetHeight,easing:'easeOutQuart'},'fast');if(TargetFade==='in'){$('.ResponsiveHandle').fadeIn();}
else{$('.ResponsiveHandle').fadeOut();}});if($('.SidebarColumn').children().length&&!$('.SidebarColumn').closest('.ResponsiveSidebarContainer').length){$('.SidebarColumn').wrap('<div class="ResponsiveSidebarContainer" />');}
if(!$('#NavigationContainer').closest('.ResponsiveSidebarContainer').length){$('#NavigationContainer').wrap('<div class="ResponsiveSidebarContainer" />');}
$('.ResponsiveSidebarContainer').off().on('click',function(Event){if(Event.target!==this){return;}
$(this).prev('.ResponsiveHandle').trigger('click');});if(!$('#ResponsiveSidebarHandle').length){$('.SidebarColumn').closest('.ResponsiveSidebarContainer').before('<span class="ResponsiveHandle" id="ResponsiveSidebarHandle"><i class="fa fa-caret-square-o-left"></i></span>');}
if(!$('#ResponsiveNavigationHandle').length){$('#NavigationContainer').closest('.ResponsiveSidebarContainer').before('<span class="ResponsiveHandle" id="ResponsiveNavigationHandle"><i class="fa fa-navicon"></i></span>');}
$('#ResponsiveNavigationHandle').off().on('click',function(){if(parseInt($('#NavigationContainer').css('left'),10)<0||parseInt($('#NavigationContainer').css('left'),10)===10){$('#ResponsiveSidebarHandle').animate({'right':'-45px'});$('#NavigationContainer').closest('.ResponsiveSidebarContainer').fadeIn();$('html').addClass('NoScroll');$('#NavigationContainer').animate({'left':'0px'});}
else{$('#ResponsiveSidebarHandle').animate({'right':'0px'});$('#NavigationContainer').closest('.ResponsiveSidebarContainer').fadeOut();$('html').removeClass('NoScroll');$('#NavigationContainer').animate({'left':'-280px'});}
return false;});$('#ResponsiveSidebarHandle').off().on('click',function(){if(parseInt($('.SidebarColumn').css('right'),10)<0){$('#ResponsiveNavigationHandle').animate({'left':'-45px'});$('.SidebarColumn').closest('.ResponsiveSidebarContainer').fadeIn();$('html').addClass('NoScroll');$('.SidebarColumn').animate({'right':'0px'});}
else{$('#ResponsiveNavigationHandle').animate({'left':'0px'});$('.SidebarColumn').closest('.ResponsiveSidebarContainer').fadeOut();$('html').removeClass('NoScroll');$('.SidebarColumn').animate({'right':'-300px'});}
return false;});Core.App.Subscribe('Event.Agent.CustomerSearch.GetCustomerInfo.Callback',function(){$('#ResponsiveSidebarHandle').after('<span class="ResponsiveHandle" id="ResponsiveSidebarNotification"><i class="fa fa-exclamation"></i></span>');$('#ResponsiveSidebarNotification').fadeIn().delay(3000).fadeOut(function(){$(this).remove();});});$('#OptionCustomer').closest('.Field').hide().prev('label').hide();$('#NavigationContainer').css('left','-280px');$('#ToolBar').detach().prependTo('body');$('.FormScreen select').each(function(){if($(this).nextAll('a:visible:not(".DatepickerIcon")').length){$(this).css('width','85%');}});$('.PreferencesScreen .Size1of3 > .WidgetSimple').removeClass('Expanded').addClass('Collapsed');});Core.App.Subscribe('Event.App.Responsive.ScreenXL',function(){$('.WidgetAction.ShowPagination, #ViewModeSwitch').remove();$('.D3GraphMessage, .D3GraphCanvas').closest('.WidgetSimple').show();$('.ResponsiveSidebarContainer').children('.SidebarColumn, #NavigationContainer').unwrap();$('#OptionCustomer').closest('.Field').show().prev('label').show();$('#NavigationContainer').css('left','10px');$('#ToolBar').detach().prependTo('#Header');$('.FormScreen select').each(function(){if($(this).nextAll('a:visible:not(".DatepickerIcon")').length){$(this).css('width','');}});$('.PreferencesScreen .WidgetSimple').removeClass('Collapsed').addClass('Expanded');});return TargetNS;}(Core.Agent.Responsive||{}));

"use strict";var Core=Core||{};Core.Agent=Core.Agent||{};Core.Agent.Daemon=(function(TargetNS){TargetNS.Init=function(Params){TargetNS.Localization=Params.Localization;};function ShowWaitingDialog(){Core.UI.Dialog.ShowContentDialog('<div class="Spacing Center"><span class="AJAXLoader" title="'+Core.Config.Get('LoadingMsg')+'"></span></div>',Core.Config.Get('LoadingMsg'),'240px','Center',true);}
TargetNS.OpenDaemonStartDialog=function(){var Data={Action:'AgentDaemonInfo'};ShowWaitingDialog();Core.AJAX.FunctionCall(Core.Config.Get('CGIHandle'),Data,function(HTML){if(!$('.Dialog:visible').length){return;}
Core.UI.Dialog.ShowContentDialog(HTML,Core.Config.Get('OTRSDaemonDialogTitleMsg'),'240px','Center',true);$('#DaemonFormCancel').bind('click',function(){Core.UI.Dialog.CloseDialog($('#DaemonRunDialog'));});},'html');};return TargetNS;}(Core.Agent.Daemon||{}));$('.DaemonInfo').bind('click',function(){Core.Agent.Daemon.OpenDaemonStartDialog();return false;});

