metamaps--metamaps/public/assets/application.js

34 lines
653 KiB
JavaScript
Raw Normal View History

2013-01-24 03:56:52 +00:00
/*!
* jQuery JavaScript Library v1.8.1
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: Thu Aug 30 2012 17:17:22 GMT-0400 (Eastern Daylight Time)
*/
function BestInPlaceEditor(e){this.element=e,this.initOptions(),this.bindForm(),this.initNil(),jQuery(this.activator).bind("click",{editor:this},this.clickHandler)}function openAnalyze(){analyzeOpen=!0,findOpen&&closeFind(),organizeOpen&&closeOrganize(),$("#sideOptionFind").css("z-index","8"),$("#sideOptionAnalyze, #closeAnalyze").css("z-index","10"),$("#sideOptionOrganize").css("z-index","8"),$("#sideOptionAnalyze").animate({width:"100px",height:"76px"},100),$("#closeAnalyze").css("display","block"),$("#sideOptionAnalyze").css("cursor","default");var e=Object.keys(Mconsole.graph.nodes).length,t=0;Mconsole.graph.eachNode(function(e){e.eachAdjacency(function(){t++})}),t/=2,$(".analysis").html("<p>"+e+" topics</p><p>"+t+" synapses</p>")}function closeAnalyze(){analyzeOpen=!1,$("#closeAnalyze").css("display","none"),$("#sideOptionAnalyze").css("cursor","pointer"),$("#sideOptionAnalyze").animate({width:"64px",height:"32px"},100)}function switchVisible(e,t){categoryVisible[e]==1?hideCategory(e,t):categoryVisible[e]==0&&showCategory(e,t)}function hideCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",.4,"end"),t.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function showCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",1,"end"),t.eachAdjacency(function(e){e.setData("alpha",1,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function hideAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){!e.getData("inCommons")&&!e.getData("onCanvas")&&(e.setData("alpha",.4,"end"),e.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function showAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){e.setData("alpha",1,"end"),e.eachAdjacency(function(e){e.setData("alpha",1,"end")})}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function onCanvasSearch(e,t,n){Mconsole.graph.eachNode(function(r){e!=null?r.name.indexOf(e)!==-1&&e!=""?r.setData("onCanvas",!0):r.setData("onCanvas",!1):t!=null?r.getData("inmaps").indexOf(parseInt(t))!==-1?r.setData("onCanvas",!0):r.setData("onCanvas",!1):n!=null&&(r.getData("userid").toString()==n?r.setData("onCanvas",!0):r.setData("onCanvas",!1)),Mconsole.plot()})}function clearCanvas(){Mconsole.graph.eachNode(function(e){Mconsole.graph.removeNode(e.id),Mconsole.labels.disposeLabel(e.id)}),Mconsole.plot()}function clearFoundData(){Mconsole.graph.eachNode(function(e){e.getData("inCommons")===!0&&(Mconsole.graph.removeNode(e.id),Mconsole.labels.disposeLabel(e.id))}),Mconsole.plot()}function openFind(){findOpen=!0,analyzeOpen&&closeAnalyze(),organizeOpen&&closeOrganize(),$("#sideOptionFind, #closeFind").css("z-index","10"),$("#sideOptionAnalyze").css("z-index","9"),$("#sideOptionOrganize").css("z-index","8"),firstVal=$('#sideOptionFind option[value="name"]').attr("selected"),secondVal=$('#sideOptionFind option[value="metacode"]').attr("selected"),thirdVal=$('#sideOptionFind option[value="map (by name)"]').attr("selected"),fourthVal=$('#sideOptionFind option[value="mapper (by name)"]').attr("selected"),firstVal==="selected"||thirdVal==="selected"||fourthVal==="selected"?$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#topic_by_name_input").focus()}):secondVal==="selected"?$("#sideOptionFind").animate({width:"380px",height:"463px"},100,function(){}):thirdVal==="selected"?$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#map_by_name_input").focus()}):fourthVal==="selected"&&$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#mapper_by_name_input").focus()}),$("#closeFind, #findWhere").css("display","block"),$("#sideOptionFind").css("cursor","default")}function closeFind(){findOpen=!1,Mconsole.graph.eachNode(function(e){e.setData
(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to
))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,l,c,h,p=(v._data(this,"events")||{})[n.type]||[],d=p.delegateCount,m=[].slice.call(arguments),g=!n.exclusive&&!n.namespace,y=v.event.special[n.type]||{},b=[];m[0]=n,n.delegateTarget=this;if(y.preDispatch&&y.preDispatch.call(this,n)===!1)return;if(d&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<d;r++)l=p[r],c=l.selector,u[c]===t&&(u[c]=v(c,this).index(s)>=0),u[c]&&f.push(l);f.length&&b.push({elem:s,matches:f})}p.length>d&&b.push({elem:this,matches:p.slice(d)});for(r=0;r<b.length&&!n.isPropagationStopped();r++){a=b[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){l=a.matches[i];if(g||!n.namespace&&!l.namespace||n.namespace_re&&n.namespace_re.test(l.namespace))n.data=l.data,n.handleObj=l,o=((v.event.special[l.origType]||{}).handle||l.handler).apply(a.elem,m),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return y.postDispatch&&y.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.
)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for
:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which==1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.browser.msie||document.documentMode>=9||!!t.button?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):this._mouseUp(t)},_mouseUp:function(t){return e(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)),!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(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{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},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(n.iframeFix&&e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.u
(c),this._trigger("resize",t,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),i<u.maxWidth&&(u.maxWidth=i),o<u.maxHeight&&(u.maxHeight=o);this._vBoundaries=u},_updateCache:function(e){var t=this.options;this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e,t){var n=this.options,i=this.position,s=this.size,o=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),o=="sw"&&(e.left=i.left+(s.width-e.width),e.top=null),o=="nw"&&(e.top=i.top+(s.height-e.height),e.left=i.left+(s.width-e.width)),e},_respectSize:function(e,t){var n=this.helper,i=this._vBoundaries,s=this._aspectRatio||t.shiftKey,o=this.axis,u=r(e.width)&&i.maxWidth&&i.maxWidth<e.width,a=r(e.height)&&i.maxHeight&&i.maxHeight<e.height,f=r(e.width)&&i.minWidth&&i.minWidth>e.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r<this._proportionallyResizeElements.length;r++){var i=this._proportionallyResizeElements[r];if(!this.borderDif){var s=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=e.map(s,function(e,t){var n=parseInt(e,10)||0,r=parseInt(o[t],10)||0;return n+r})}if(!(!e.browser.msie||!e(n).is(":hidden")&&!e(n).parents(":hidden").length))continue;i.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var r=e.browser.msie&&e.browser.version<7,i=r?1:0,s=r?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+s,height:this.element.outerHeight()+s,position:"absolute",left:this.elementOffset.left-i+"px",top:this.elementOffset.top-i+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;r
.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)){var n=e(t.containment)[0],r=e(t.containment).offset(),i=e(n).css("overflow")!="hidden";this.containment=[r.left+(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0)-this.margins.top,r.left+(i?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(i?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(e.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r),left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(e.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r)}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var s=t.pageX,o=t.pageY;if(this.originalPosition){this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=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]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top));if(n.grid){var u=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?u-this.offset.click.top<this.containment[1]||u-this.offset.click.top>this.containment[3]?u-this.offset.click.top<this.containment[1]?u+n.grid[1]:u-n.grid[1]:u:u;var a=this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0];s=this.containment?a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2]?a-this.offset.click.left<this.containment[0]?a+n.grid[0]:a-n.grid[0]:a:a}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(e.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(e.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this,s=this.counter;window.setTimeout(function(){s==i.counter&&i.refreshPositions(!r)},0)},_clear:function(t,n){this.reverting=!1;var r=[],i=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var s in this._storedCSS)if(this._storedCSS[s]=="auto"||this._storedCSS[s]=="static")this._storedCSS[s]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!n&&r.push(function(e){this._
this.active,o=u.next(),i=this.active.next(),s={options:r,newHeader:a&&r.collapsible?e([]):u,oldHeader:this.active,newContent:a&&r.collapsible?e([]):o,oldContent:i},l=this.headers.index(this.active[0])>this.headers.index(u[0]);this.active=a?e([]):u,this._toggle(o,i,s,a,l),f.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(r.icons.headerSelected).addClass(r.icons.header),a||(u.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(r.icons.header).addClass(r.icons.headerSelected),u.next().addClass("ui-accordion-content-active"));return},_toggle:function(t,n,r,i,s){var o=this,u=o.options;o.toShow=t,o.toHide=n,o.data=r;var a=function(){if(!o)return;return o._completed.apply(o,arguments)};o._trigger("changestart",null,o.data),o.running=n.size()===0?t.size():n.size();if(u.animated){var f={};u.collapsible&&i?f={toShow:e([]),toHide:n,complete:a,down:s,autoHeight:u.autoHeight||u.fillSpace}:f={toShow:t,toHide:n,complete:a,down:s,autoHeight:u.autoHeight||u.fillSpace},u.proxied||(u.proxied=u.animated),u.proxiedDuration||(u.proxiedDuration=u.duration),u.animated=e.isFunction(u.proxied)?u.proxied(f):u.proxied,u.duration=e.isFunction(u.proxiedDuration)?u.proxiedDuration(f):u.proxiedDuration;var l=e.ui.accordion.animations,c=u.duration,h=u.animated;h&&!l[h]&&!e.easing[h]&&(h="slide"),l[h]||(l[h]=function(e){this.slide(e,{easing:h,duration:c||700})}),l[h](f)}else u.collapsible&&i?t.toggle():(n.hide(),t.show()),a(!0);n.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),t.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(e){this.running=e?0:--this.running;if(this.running)return;this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data)}}),e.extend(e.ui.accordion,{version:"1.8.23",animations:{slide:function(t,n){t=e.extend({easing:"swing",duration:300},t,n);if(!t.toHide.size()){t.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},t);return}if(!t.toShow.size()){t.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},t);return}var r=t.toShow.css("overflow"),i=0,s={},o={},u=["height","paddingTop","paddingBottom"],a,f=t.toShow;a=f[0].style.width,f.width(f.parent().width()-parseFloat(f.css("paddingLeft"))-parseFloat(f.css("paddingRight"))-(parseFloat(f.css("borderLeftWidth"))||0)-(parseFloat(f.css("borderRightWidth"))||0)),e.each(u,function(n,r){o[r]="hide";var i=(""+e.css(t.toShow[0],r)).match(/^([\d+-.]+)(.*)$/);s[r]={value:i[1],unit:i[2]||"px"}}),t.toShow.css({height:0,overflow:"hidden"}).show(),t.toHide.filter(":hidden").each(t.complete).end().filter(":visible").animate(o,{step:function(e,n){n.prop=="height"&&(i=n.end-n.start===0?0:(n.now-n.start)/(n.end-n.start)),t.toShow[0].style[n.prop]=i*s[n.prop].value+s[n.prop].unit},duration:t.duration,easing:t.easing,complete:function(){t.autoHeight||t.toShow.css("height",""),t.toShow.css({width:a,overflow:r}),t.complete()}})},bounceslide:function(e){this.slide(e,{easing:e.down?"easeOutBounce":"swing",duration:e.down?1e3:200})}}})}(jQuery),function(e,t){var n=0;e.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var t=this,n=this.element[0].ownerDocument,r;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(n){if(t.options.disabled||t.element.propAttr("readOnly"))return;r=!1;var i=e.ui.keyCode;switch(n.keyCode){case i.PAGE_UP:t._move("previousPage",n);break;case i.PAGE_DOWN:t._move("nextPage",n);break;case i.UP:t._keyEvent("previous",n);b
._curInst.input[0]));var n=$.datepicker._get(t,"beforeShow"),r=n?n.apply(e,[e,t]):{};if(r===!1)return;extendRemove(t.settings,r),t.lastVal=null,$.datepicker._lastInput=e,$.datepicker._setDateFromField(t),$.datepicker._inDialog&&(e.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(e),$.datepicker._pos[1]+=e.offsetHeight);var i=!1;$(e).parents().each(function(){return i|=$(this).css("position")=="fixed",!i}),i&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var s={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(t),s=$.datepicker._checkOffset(t,s,i),t.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":i?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"});if(!t.inline){var o=$.datepicker._get(t,"showAnim"),u=$.datepicker._get(t,"duration"),a=function(){var e=t.dpDiv.find("iframe.ui-datepicker-cover");if(!!e.length){var n=$.datepicker._getBorders(t.dpDiv);e.css({left:-n[0],top:-n[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()})}};t.dpDiv.zIndex($(e).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[o]?t.dpDiv.show(o,$.datepicker._get(t,"showOptions"),u,a):t.dpDiv[o||"show"](o?u:null,a),(!o||!u)&&a(),t.input.is(":visible")&&!t.input.is(":disabled")&&t.input.focus(),$.datepicker._curInst=t}},_updateDatepicker:function(e){var t=this;t.maxRows=4;var n=$.datepicker._getBorders(e.dpDiv);instActive=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var r=e.dpDiv.find("iframe.ui-datepicker-cover");!r.length||r.css({left:-n[0],top:-n[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i=this._getNumberOfMonths(e),s=i[1],o=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&e.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",o*s+"em"),e.dpDiv[(i[0]!=1||i[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e==$.datepicker._curInst&&$.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var u=e.yearshtml;setTimeout(function(){u===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),u=e.yearshtml=null},0)}},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(e,t,n){var r=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,u=document.documentElement.clientWidth+(n?0:$(document).scrollLeft()),a=document.documentElement.clientHeight+(n?0:$(document).scrollTop());return t.left-=this._get(e,"isRTL")?r-s:0,t.left-=n&&t.left==e.input.offset().left?$(document).scrollLeft():0,t.top-=n&&t.top==e.input.offset().top+o?$(document).scrollTop():0,t.left-=Math.min(t.left,t.left+r>u&&u>r?Math.abs(t.left+r-u):0),t.top-=Math.min(t.top,t.top+i>a&&a>i?Math.abs(i+o):0),t},_findPos:function(e){var t=this._getInst(e),n=this._get(t,"isRTL");while(e&&(e.type=="hidden"||e.nodeType!=1||$.expr.filters.hidden(e)))e=e[n?"previousSibling":"nextSibling"];var r=$(e).offset();return[r.left,r.top]},_hideDatepicker:function(e){var t=this._curInst;if(!t||e&&t!=$.data(e,PROP_NAME))return;if(this._datepickerShowing){var n=this._get(t,"showAnim"),r=this._get(t,"duration"),i=function(){$.datepicker._tidyDialog(t)};$.effects&&$.effects[n]?t.dpDiv.hide(n,$.datepicker._get(t,"showOptions"),r,i):t.dpDiv[n=="slideDown"?"slideUp":n=="fadeIn"?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1;var s=this._get(t,"onClose");s&&s.apply(t.input?t.input[0]:null,[t.input?t.input.val():"",t]),this._lastInput=null,th
$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(document).bind("keydown.dialog-overlay",function(n){t.options.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var n=(this.oldInstances.pop()||e("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances);n!=-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.remove();var r=0;e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.browser.msie&&e.browser.version<7?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t<n?e(window).height()+"px":t+"px"):e(document).height()+"px"},width:function(){var t,n;return e.browser.msie?(t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),t<n?e(window).width()+"px":t+"px"):e(document).width()+"px"},resize:function(){var t=e([]);e.each(e.ui.dialog.overlay.instances,function(){t=t.add(this)}),t.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}}),e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})}(jQuery),function(e,t){e.ui=e.ui||{};var n=/left|center|right/,r=/top|center|bottom/,i="center",s={},o=e.fn.position,u=e.fn.offset;e.fn.position=function(t){if(!t||!t.of)return o.apply(this,arguments);t=e.extend({},t);var u=e(t.of),a=u[0],f=(t.collision||"flip").split(" "),l=t.offset?t.offset.split(" "):[0,0],c,h,p;return a.nodeType===9?(c=u.width(),h=u.height(),p={top:0,left:0}):a.setTimeout?(c=u.width(),h=u.height(),p={top:u.scrollTop(),left:u.scrollLeft()}):a.preventDefault?(t.at="left top",c=h=0,p={top:t.of.pageY,left:t.of.pageX}):(c=u.outerWidth(),h=u.outerHeight(),p=u.offset()),e.each(["my","at"],function(){var e=(t[this]||"").split(" ");e.length===1&&(e=n.test(e[0])?e.concat([i]):r.test(e[0])?[i].concat(e):[i,i]),e[0]=n.test(e[0])?e[0]:i,e[1]=r.test(e[1])?e[1]:i,t[this]=e}),f.length===1&&(f[1]=f[0]),l[0]=parseInt(l[0],10)||0,l.length===1&&(l[1]=l[0]),l[1]=parseInt(l[1],10)||0,t.at[0]==="right"?p.left+=c:t.at[0]===i&&(p.left+=c/2),t.at[1]==="bottom"?p.top+=h:t.at[1]===i&&(p.top+=h/2),p.left+=l[0],p.top+=l[1],this.each(function(){var n=e(this),r=n.outerWidth(),o=n.outerHeight(),u=parseInt(e.curCSS(this,"marginLeft",!0))||0,a=parseInt(e.curCSS(this,"marginTop",!0))||0,d=r+u+(parseInt(e.curCSS(this,"marginRight",!0))||0),v=o+a+(parseInt(e.curCSS(this,"marginBottom",!0))||0),m=e.extend({},p),g;t.my[0]==="right"?m.left-=r:t.my[0]===i&&(m.left-=r/2),t.my[1]==="bottom"?m.top-=o:t.my[1]===i&&(m.top-=o/2),s.fractions||(m.left=Math.round(m.left),m.top=Math.round(m.top)),g={left:m.left-u,top:m.top-a},e.each(["left","top"],function(n,i){e.ui.position[f[n]]&&e.ui.position[f[n]][i](m,{targetWidth:c,targetHeight:h,elemWidth:r,elemHeight:o,collisionPosition:g,collisionWidth:d,collisionHeight:v,offset:l,my:t.my,at:t.at})}),e.fn.bgiframe&&n.bgiframe(),n.offset(e.extend(m,{using:t.using}))})},e.ui.position={fit:{left:function(t,n){var r=e(window),i=n.collisionPosition.left+n.collisionWidth-r.width()-r.scrollLeft();t.left=i>0?t.left-i:Math.max(t.left-n.collisionPosition.left,t.left)},top:function(t,n){var r=e(window),i=n.
,e.inner_class=e.element.attr("data-inner-class")||e.inner_class||null,e.html_attrs=e.element.attr("data-html-attrs")||e.html_attrs,e.original_content=e.element.attr("data-original-content")||e.original_content,e.collectionValue=e.element.attr("data-value")||e.collectionValue,e.element.attr("data-sanitize")?e.sanitize=e.element.attr("data-sanitize")=="true":e.sanitize=!0,e.element.attr("data-use-confirm")?e.useConfirm=e.element.attr("data-use-confirm")!="false":e.useConfirm=!0,(e.formType=="select"||e.formType=="checkbox")&&e.collection!==null&&(e.values=jQuery.parseJSON(e.collection))},bindForm:function(){this.activateForm=BestInPlaceEditor.forms[this.formType].activateForm,this.getValue=BestInPlaceEditor.forms[this.formType].getValue},initNil:function(){this.element.text()===""&&(this.isNil=!0,this.element.html(this.nil))},getValue:function(){alert("The form was not properly initialized. getValue is unbound")},sanitizeValue:function(e){return jQuery.trim(e)},requestData:function(){csrf_token=jQuery("meta[name=csrf-token]").attr("content"),csrf_param=jQuery("meta[name=csrf-param]").attr("content");var e="_method=put";return e+="&"+this.objectName+"["+this.attributeName+"]="+encodeURIComponent(this.getValue()),csrf_param!==undefined&&csrf_token!==undefined&&(e+="&"+csrf_param+"="+encodeURIComponent(csrf_token)),e},ajax:function(e){return e.url=this.url,e.beforeSend=function(e){e.setRequestHeader("Accept","application/json")},jQuery.ajax(e)},loadSuccessCallback:function(e){var t=jQuery.parseJSON(jQuery.trim(e));t!==null&&t.hasOwnProperty("display_as")&&(this.element.attr("data-original-content",this.element.text()),this.original_content=this.element.text(),this.element.html(t.display_as)),this.element.trigger(jQuery.Event("ajax:success"),e),jQuery(this.activator).bind("click",{editor:this},this.clickHandler),this.element.trigger(jQuery.Event("best_in_place:deactivate")),this.collectionValue!==null&&(this.collectionValue=this.previousCollectionValue,this.previousCollectionValue=null)},loadErrorCallback:function(e,t){this.element.html(this.oldValue),this.element.trigger(jQuery.Event("best_in_place:error"),[e,t]),this.element.trigger(jQuery.Event("ajax:error")),jQuery(this.activator).bind("click",{editor:this},this.clickHandler),this.element.trigger(jQuery.Event("best_in_place:deactivate"))},clickHandler:function(e){e.preventDefault(),e.data.editor.activate()},setHtmlAttributes:function(){var e=this.element.find(this.formType),t=jQuery.parseJSON(this.html_attrs);for(var n in t)e.attr(n,t[n])}},BestInPlaceEditor.forms={input:{activateForm:function(){var e=jQuery(document.createElement("form")).addClass("form_in_place").attr("action","javascript:void(0);").attr("style","display:inline"),t=jQuery(document.createElement("input")).attr("type","text").attr("name",this.attributeName).val(this.display_value);this.inner_class!==null&&t.addClass(this.inner_class),e.append(t),this.okButton&&e.append(jQuery(document.createElement("input")).attr("type","submit").attr("value",this.okButton)),this.cancelButton&&e.append(jQuery(document.createElement("input")).attr("type","button").attr("value",this.cancelButton)),this.element.html(e),this.setHtmlAttributes(),this.element.find("input[type='text']")[0].select(),this.element.find("form").bind("submit",{editor:this},BestInPlaceEditor.forms.input.submitHandler),this.cancelButton&&this.element.find("input[type='button']").bind("click",{editor:this},BestInPlaceEditor.forms.input.cancelButtonHandler),this.element.find("input[type='text']").bind("blur",{editor:this},BestInPlaceEditor.forms.input.inputBlurHandler),this.element.find("input[type='text']").bind("keyup",{editor:this},BestInPlaceEditor.forms.input.keyupHandler),this.blurTimer=null,this.userClicked=!1},getValue:function(){return this.sanitizeValue(this.element.find("input").val())},inputBlurHandler:function(e){e.data.editor.okButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.abort()},500):e.data.editor.cancelButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.
.currentPath_.length;l++){var c=this.currentPath_[l],h;switch(c.type){case"moveTo":h=c,n.push(" m ",t(c.x),",",t(c.y));break;case"lineTo":n.push(" l ",t(c.x),",",t(c.y));break;case"close":n.push(" x "),c=null;break;case"bezierCurveTo":n.push(" c ",t(c.cp1x),",",t(c.cp1y),",",t(c.cp2x),",",t(c.cp2y),",",t(c.x),",",t(c.y));break;case"at":case"wa":n.push(" ",c.type," ",t(c.x-this.arcScaleX_*c.radius),",",t(c.y-this.arcScaleY_*c.radius)," ",t(c.x+this.arcScaleX_*c.radius),",",t(c.y+this.arcScaleY_*c.radius)," ",t(c.xStart),",",t(c.yStart)," ",t(c.xEnd),",",t(c.yEnd))}if(c){if(a.x==null||c.x<a.x)a.x=c.x;if(f.x==null||c.x>f.x)f.x=c.x;if(a.y==null||c.y<a.y)a.y=c.y;if(f.y==null||c.y>f.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push("</g_vml_:shape>"),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push('<g_vml_:line from="',-f,' 0" to="',l,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!s,'" stroked="',!!s,'" style="position:absolute;width:1px;height:1px;">'),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('<g_vml_:skew on="t" matrix="',b,'" ',' offset="',w,'" origin="',f,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',h(e),'" style="v-text-align:',g,";font:",h(v),'" /></g_vml_:line>'),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,Canv
(e,t))){var r=this.viz.graph.getNode(n.id);if(r.selected)return;this.hoveredNode=r,this.toggleStylesOnHover(this.hoveredNode,!0)}},onMouseDown:function(e,t,n,r){if(r)return;var i;this.dom&&(i=this.isLabel(e,t))?this.down=this.viz.graph.getNode(i.id):this.dom||(this.down=n.getNode()),this.move=!1},onMouseUp:function(e,t,n,r){if(r)return;this.move||this.onClick(n.getNode()),this.down=this.move=!1},getRestoredStyles:function(e,t){var n={},r=this["nodeStylesOn"+t];for(var i in r)n[i]=e.styles["$"+i];return n},toggleStylesOnHover:function(e,t){this.nodeStylesOnHover&&this.toggleStylesOn("Hover",e,t)},toggleStylesOnClick:function(e,t){this.nodeStylesOnClick&&this.toggleStylesOn("Click",e,t)},toggleStylesOn:function(t,r,i){var s=this.viz,o=this.nStyles;if(i){var u=this;r.styles||(r.styles=e.merge(r.data,{}));for(var a in this["nodeStylesOn"+t]){var f="$"+a;f in r.styles||(r.styles[f]=r.getData(a))}s.fx.nodeFx(e.extend({elements:{id:r.id,properties:u["nodeStylesOn"+t]},transition:n.Quart.easeOut,duration:300,fps:40},this.config))}else{var l=this.getRestoredStyles(r,t);s.fx.nodeFx(e.extend({elements:{id:r.id,properties:l},transition:n.Quart.easeOut,duration:300,fps:40},this.config))}},onClick:function(e){if(!e)return;var t=this.nodeStylesOnClick;if(!t)return;e.selected?(this.toggleStylesOnClick(e,!1),delete e.selected):(this.viz.graph.eachNode(function(e){if(e.selected){for(var n in t)e.setData(n,e.styles["$"+n],"end");delete e.selected}}),this.toggleStylesOnClick(e,!0),e.selected=!0,delete e.hovered,this.hoveredNode=!1)},onMouseMove:function(e,t,n){this.down&&(this.move=!0);if(this.dom&&this.isLabel(e,t))return;var r=this.nodeStylesOnHover;if(!r)return;if(!this.dom){if(this.hoveredNode){var i=this.types[this.hoveredNode.getData("type")],s=i&&i.contains&&i.contains.call(this.fx,this.hoveredNode,n.getPos());if(s)return}var o=n.getNode();if(!this.hoveredNode&&!o)return;if(o.hovered)return;o&&!o.selected?(this.fx.nodeFxAnimation.stopTimer(),this.viz.graph.eachNode(function(e){if(e.hovered&&!e.selected){for(var t in r)e.setData(t,e.styles["$"+t],"end");delete e.hovered}}),o.hovered=!0,this.hoveredNode=o,this.toggleStylesOnHover(o,!0)):this.hoveredNode&&!this.hoveredNode.selected&&(this.fx.nodeFxAnimation.stopTimer(),this.toggleStylesOnHover(this.hoveredNode,!1),delete this.hoveredNode.hovered,this.hoveredNode=!1)}}}),a.Classes.Navigation=new t({Implements:[s,o],initializePost:function(){this.pos=!1,this.pressed=!1},onMouseWheel:function(t,n,r){if(!this.config.zooming)return;e.event.stop(e.event.get(t,n));var i=this.config.zooming/1e3,s=1+r*i;this.canvas.scale(s,s)},onMouseDown:function(e,t,n){if(!this.config.panning)return;if(this.config.panning=="avoid nodes"&&n.getNode())return;this.pressed=!0,this.pos=n.getPos();var r=this.canvas,i=r.translateOffsetX,s=r.translateOffsetY,o=r.scaleOffsetX,u=r.scaleOffsetY;this.pos.x*=o,this.pos.x+=i,this.pos.y*=u,this.pos.y+=s},onMouseMove:function(e,t,n){if(!this.config.panning)return;if(!this.pressed)return;if(this.config.panning=="avoid nodes"&&n.getNode())return;var r=this.pos,i=n.getPos(),s=this.canvas,o=s.translateOffsetX,u=s.translateOffsetY,a=s.scaleOffsetX,f=s.scaleOffsetY;i.x*=a,i.y*=f,i.x+=o,i.y+=u;var l=i.x-r.x,c=i.y-r.y;this.pos=i,this.canvas.translate(l*1/a,c*1/f)},onMouseUp:function(e,t,n,r){if(!this.config.panning)return;this.pressed=!1}});var f;(function(){function i(t,n){var i=document.createElement(t);for(var s in n)typeof n[s]=="object"?e.extend(i[s],n[s]):i[s]=n[s];return t=="canvas"&&!r&&G_vmlCanvasManager&&(i=G_vmlCanvasManager.initElement(document.body.appendChild(i))),i}var n=typeof HTMLCanvasElement,r=n=="object"||n=="function";$jit.Canvas=f=new t({canvases:[],pos:!1,element:!1,labelContainer:!1,translateOffsetX:0,translateOffsetY:0,scaleOffsetX:1,scaleOffsetY:1,initialize:function(t,n){this.viz=t,this.opt=n;var r=e.type(n.injectInto)=="string"?n.injectInto:n.injectInto.id,s=r+"-label",o=e(r),u=n.width||o.offsetWidth,a=n.height||o.offsetHeight;this.id=r;var l={injectInto:r,width:u,height:a};this.element=i("div",{id:r+"-canvaswidget",style:{position:"relative",width:u+"px"
e||this.viz.controller;e.clearCanvas&&i.clear();var f=r.getNode(s);if(!f)return;var l=!!f.visited;r.eachNode(function(n){var r=n.getData("alpha");n.eachAdjacency(function(s){var f=s.nodeTo;!!f.visited===l&&n.drawn&&f.drawn&&(!t&&e.onBeforePlotLine(s),u.save(),u.globalAlpha=a(r,f.getData("alpha"),s.getData("alpha")),o.plotLine(s,i,t),u.restore(),!t&&e.onAfterPlotLine(s))}),u.save(),n.drawn&&(!t&&e.onBeforePlotNode(n),o.plotNode(n,i,t),!t&&e.onAfterPlotNode(n)),!o.labelsHidden&&e.withLabels&&(n.drawn&&r>=.95?o.labels.plotLabel(i,n,e):o.labels.hideLabel(n,!1)),u.restore(),n.visited=!l})},plotTree:function(e,t,n){var r=this,i=this.viz,s=i.canvas,o=this.config,u=s.getCtx(),a=e.getData("alpha");e.eachSubnode(function(i){if(t.plotSubtree(e,i)&&i.exist&&i.drawn){var o=e.getAdjacency(i.id);!n&&t.onBeforePlotLine(o),u.globalAlpha=Math.min(a,i.getData("alpha")),r.plotLine(o,s,n),!n&&t.onAfterPlotLine(o),r.plotTree(i,t,n)}}),e.drawn?(!n&&t.onBeforePlotNode(e),this.plotNode(e,s,n),!n&&t.onAfterPlotNode(e),!t.hideLabels&&t.withLabels&&a>=.95?this.labels.plotLabel(s,e,t):this.labels.hideLabel(e,!1)):this.labels.hideLabel(e,!0)},plotNode:function(e,t,n){var r=e.getData("type"),i=this.node.CanvasStyles;if(r!="none"){var s=e.getData("lineWidth"),o=e.getData("color"),u=e.getData("alpha"),a=t.getCtx();a.lineWidth=s,a.fillStyle=a.strokeStyle=o,a.globalAlpha=u;for(var f in i)a[f]=e.getCanvasStyle(f);this.nodeTypes[r].render.call(this,e,t,n)}},plotLine:function(e,t,n){var r=e.getData("type"),i=this.edge.CanvasStyles;if(r!="none"){var s=e.getData("lineWidth"),o=e.getData("color"),u=t.getCtx();u.lineWidth=s,u.fillStyle=u.strokeStyle=o;for(var a in i)u[a]=e.getCanvasStyle(a);this.edgeTypes[r].render.call(this,e,t,n)}}},d.Label={},d.Label.Native=new t({plotLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0);r.font=t.getLabelData("style")+" "+t.getLabelData("size")+"px "+t.getLabelData("family"),r.textAlign=t.getLabelData("textAlign"),r.fillStyle=r.strokeStyle=t.getLabelData("color"),r.textBaseline=t.getLabelData("textBaseline"),this.renderLabel(e,t,n)},renderLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0);r.fillText(t.name,i.x,i.y+t.getData("height")/2)},hideLabel:e.empty,hideLabels:e.empty}),d.Label.DOM=new t({labelsHidden:!1,labelContainer:!1,labels:{},getLabelContainer:function(){return this.labelContainer?this.labelContainer:this.labelContainer=document.getElementById(this.viz.config.labelContainer)},getLabel:function(e){return e in this.labels&&this.labels[e]!=null?this.labels[e]:this.labels[e]=document.getElementById(e)},hideLabels:function(e){var t=this.getLabelContainer();e?t.style.display="none":t.style.display="",this.labelsHidden=e},clearLabels:function(e){for(var t in this.labels)if(e||!this.viz.graph.hasNode(t))this.disposeLabel(t),delete this.labels[t]},disposeLabel:function(e){var t=this.getLabel(e);t&&t.parentNode&&t.parentNode.removeChild(t)},hideLabel:function(t,n){t=e.splat(t);var r=n?"":"none",i,s=this;e.each(t,function(e){var t=s.getLabel(e.id);t&&(t.style.display=r)})},fitsInCanvas:function(e,t){var n=t.getSize();return e.x>=n.width||e.x<0||e.y>=n.height||e.y<0?!1:!0}}),d.Label.HTML=new t({Implements:d.Label.DOM,plotLabel:function(e,t,n){var r=t.id,i=this.getLabel(r);if(!i&&!(i=document.getElementById(r))){i=document.createElement("div");var s=this.getLabelContainer();i.id=r,i.className="node",i.style.position="absolute",n.onCreateLabel(i,t),s.appendChild(i),this.labels[t.id]=i}this.placeLabel(i,t,n)}}),d.Label.SVG=new t({Implements:d.Label.DOM,plotLabel:function(e,t,n){var r=t.id,i=this.getLabel(r);if(!i&&!(i=document.getElementById(r))){var s="http://www.w3.org/2000/svg";i=document.createElementNS(s,"svg:text");var o=document.createElementNS(s,"svg:tspan");i.appendChild(o);var u=this.getLabelContainer();i.setAttribute("id",r),i.setAttribute("class","node"),u.appendChild(i),n.onCreateLabel(i,t),this.labels[t.id]=i}this.placeLabel(i,t,n)}}),d.Geom=new t({initialize:function(e){this.viz=e,this.config=e.config,this.node=e.config.Node,this.edge=e.config.Edge},translate:function(t,n){n=e.splat(n),this.viz.graph.eachN
:s,$next:v.label,$prev:d?d.label:!1,$config:u,$gradient:a},children:[]})}var E={id:n+"$root",name:"",data:{$type:"none",$width:1,$height:1},children:r};i.loadJSON(E),this.normalizeDims(),i.compute(),i.select(i.root),f&&i.fx.animate({modes:["node-property:height:dimArray"],duration:1500})},updateJSON:function(t,n){if(this.busy)return;this.busy=!0;var r=this.st,i=r.graph,s=t.label&&e.splat(t.label),o=t.values,u=this.config.animate,a=this;e.each(o,function(t){var n=i.getByName(t.label);if(n){t.values=e.splat(t.values);var r=n.getData("stringArray"),o=n.getData("valueArray");e.each(o,function(e,n){e[0]=t.values[n],s&&(r[n]=s[n])}),n.setData("valueArray",o);var u=n.getData("prev"),a=n.getData("next"),f=i.getByName(a);if(u){var l=i.getByName(u);if(l){var o=l.getData("valueArray");e.each(o,function(e,n){e[1]=t.values[n]})}}if(!f){var o=n.getData("valueArray");e.each(o,function(e,n){e[1]=t.values[n]})}}}),this.normalizeDims(),r.compute(),r.select(r.root),u&&r.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){a.busy=!1,n&&n.onComplete()}})},filter:function(){if(this.busy)return;this.busy=!0,this.config.Tips.enable&&this.st.tips.hide(),this.select(!1,!1,!1);var t=Array.prototype.slice.call(arguments),n=this.st.graph.getNode(this.st.root),r=this;n.eachAdjacency(function(n){var r=n.nodeTo,i=r.getData("dimArray"),s=r.getData("stringArray");r.setData("dimArray",e.map(i,function(n,r){return e.indexOf(t,s[r])>-1?n:[0,0]}),"end")}),this.st.fx.animate({modes:["node-property:dimArray"],duration:1500,onComplete:function(){r.busy=!1}})},restore:function(){if(this.busy)return;this.busy=!0,this.config.Tips.enable&&this.st.tips.hide(),this.select(!1,!1,!1),this.normalizeDims();var e=this;this.st.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){e.busy=!1}})},select:function(e,t,n){if(!this.config.selectOnHover)return;var r=this.selected;if(r.id!=e||r.name!=t||r.index!=n){r.id=e,r.name=t,r.index=n,this.st.graph.eachNode(function(e){e.setData("border",!1)});if(e){var i=this.st.graph.getNode(e);i.setData("border",r);var s=n===0?"prev":"next";s=i.getData(s),s&&(i=this.st.graph.getByName(s),i&&i.setData("border",{name:t,index:1-n}))}this.st.plot()}},getLegend:function(){var t={},n;this.st.graph.getNode(this.st.root).eachAdjacency(function(e){n=e.nodeTo});var r=n.getData("colorArray"),i=r.length;return e.each(n.getData("stringArray"),function(e,n){t[e]=r[n%i]}),t},getMaxValue:function(){var t=0;return this.st.graph.eachNode(function(n){var r=n.getData("valueArray"),i=0,s=0;e.each(r,function(e){i+=+e[0],s+=+e[1]});var o=s>i?s:i;t=t>o?t:o}),t},normalizeDims:function(){var t=this.st.graph.getNode(this.st.root),n=0;t.eachAdjacency(function(){n++});var r=this.getMaxValue()||1,i=this.st.canvas.getSize(),s=this.config,o=s.Margin,u=s.labelOffset+s.Label.size,a=(i.width-(o.left+o.right))/n,f=s.animate,l=i.height-(o.top+o.bottom)-(s.showAggregates&&u)-(s.showLabels&&u);this.st.graph.eachNode(function(t){var n=0,i=0,s=[];e.each(t.getData("valueArray"),function(e){n+=+e[0],i+=+e[1],s.push([0,0])});var o=i>n?i:n;t.setData("width",a);if(f){t.setData("height",o*l/r,"end"),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return[e[0]*l/r,e[1]*l/r]}),"end");var u=t.getData("dimArray");u||t.setData("dimArray",s)}else t.setData("height",o*l/r),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return[e[0]*l/r,e[1]*l/r]}))})}}),i.BarChart={$extend:!0,animate:!0,type:"stacked",labelOffset:3,barsOffset:0,hoveredColor:"#9fd4ff",orientation:"horizontal",showAggregates:!0,showLabels:!0,Tips:{enable:!1,onShow:e.empty,onHide:e.empty},Events:{enable:!1,onClick:e.empty}},$jit.ST.Plot.NodeTypes.implement({"barchart-stacked":{render:function(t,n){var r=t.pos.getc(!0),i=t.getData("width"),s=t.getData("height"),o=this.getAlignedPos(r,i,s),u=o.x,a=o.y,f=t.getData("dimArray"),l=t.getData("valueArray"),c=t.getData("colorArray"),h=c.length,p=t.getData("stringArray"),d=n.getCtx(),v={},m=t.getData("border"),g=t.getData("gradient"),y=t.getData("config"),b=y.orientation=="horizontal",w=y.sh
._area=i*a[s]/u;var f=this.layout.horizontal()?n.height:n.width;t.sort(function(e,t){var n=t._area-e._area;return n?n:t.id==e.id?0:t.id<e.id?1:-1});var l=[t[0]],c=t.slice(1);this.squarify(c,l,f,n,r)},squarify:function(e,t,n,r,i){this.computeDim(e,t,n,r,this.worstAspectRatio,i)},layoutRow:function(e,t,n,r){return this.layout.horizontal()?this.layoutV(e,t,n,r):this.layoutH(e,t,n,r)},layoutV:function(t,n,r,i){var s=0,o=function(e){return e};e.each(t,function(e){s+=e._area});var u=o(s/n),a=0;for(var f=0,l=t.length;f<l;f++){var c=o(t[f]._area/u),h=t[f];h.getPos(i).setc(r.left,r.top+a),h.setData("width",u,i),h.setData("height",c,i),a+=c}var p={height:r.height,width:r.width-u,top:r.top,left:r.left+u};return p.dim=Math.min(p.width,p.height),p.dim!=p.height&&this.layout.change(),p},layoutH:function(t,n,r,i){var s=0;e.each(t,function(e){s+=e._area});var o=s/n,u=r.top,a=0;for(var f=0,l=t.length;f<l;f++){var c=t[f],n=c._area/o;c.getPos(i).setc(r.left+a,u),c.setData("width",n,i),c.setData("height",o,i),a+=n}var h={height:r.height-o,width:r.width,top:r.top+o,left:r.left};return h.dim=Math.min(h.width,h.height),h.dim!=h.width&&this.layout.change(),h}}),b.TM.Strip=new t({Implements:b.TM.Area,computePositions:function(e,t,n){var r=e.getSubnodes([1,1],"ignore"),i=this.config;if(r.length>0){this.processChildrenLayout(e,r,t,n);for(var s=0,o=r.length;s<o;s++){var u=r[s],a=i.offset,f=u.getData("height",n)-a-i.titleHeight,l=u.getData("width",n)-a,c=u.getPos(n);t={width:l,height:f,top:c.y+i.titleHeight,left:c.x},this.computePositions(u,t,n)}}},processChildrenLayout:function(e,t,n,r){var i=n.width*n.height,s,o=t.length,u=0,a=[];for(s=0;s<o;s++)a[s]=+t[s].getData("area",r),u+=a[s];for(s=0;s<o;s++)t[s]._area=i*a[s]/u;var f=this.layout.horizontal()?n.width:n.height,l=[t[0]],c=t.slice(1);this.stripify(c,l,f,n,r)},stripify:function(e,t,n,r,i){this.computeDim(e,t,n,r,this.avgAspectRatio,i)},layoutRow:function(e,t,n,r){return this.layout.horizontal()?this.layoutH(e,t,n,r):this.layoutV(e,t,n,r)},layoutV:function(t,n,r,i){var s=0;e.each(t,function(e){s+=e._area});var o=s/n,u=0;for(var a=0,f=t.length;a<f;a++){var l=t[a],c=l._area/o;l.getPos(i).setc(r.left,r.top+(n-c-u)),l.setData("width",o,i),l.setData("height",c,i),u+=c}return{height:r.height,width:r.width-o,top:r.top,left:r.left+o,dim:n}},layoutH:function(t,n,r,i){var s=0;e.each(t,function(e){s+=e._area});var o=s/n,u=r.height-o,a=0;for(var f=0,l=t.length;f<l;f++){var c=t[f],h=c._area/o;c.getPos(i).setc(r.left+a,r.top+u),c.setData("width",h,i),c.setData("height",o,i),a+=h}return{height:r.height-o,width:r.width,top:r.top,left:r.left,dim:n}}}),b.Icicle=new t({compute:function(e){e=e||"current";var t=this.graph.getNode(this.root),n=this.config,r=this.canvas.getSize(),i=r.width,s=r.height,o=n.offset,u=n.constrained?n.levelsToShow:Number.MAX_VALUE;this.controller.onBeforeCompute(t),d.Util.computeLevels(this.graph,t.id,0,"ignore");var a=0;d.Util.eachLevel(t,0,!1,function(e,t){t>a&&(a=t)});var f=this.graph.getNode(this.clickedNode&&this.clickedNode.id||t.id),l=Math.min(a,u-1),c=f._depth;this.layout.horizontal()?this.computeSubtree(f,-i/2,-s/2,i/(l+1),s,c,l,e):this.computeSubtree(f,-i/2,-s/2,i,s/(l+1),c,l,e)},computeSubtree:function(t,n,r,i,s,o,u,a){t.getPos(a).setc(n,r),t.setData("width",i,a),t.setData("height",s,a);var f,l=0,c=0,h=d.Util.getSubnodes(t,[1,1]);if(!h.length)return;e.each(h,function(e){c+=e.getData("dim")});for(var p=0,v=h.length;p<v;p++)this.layout.horizontal()?(f=s*h[p].getData("dim")/c,this.computeSubtree(h[p],n+i,r,i,f,o,u,a),r+=f):(f=i*h[p].getData("dim")/c,this.computeSubtree(h[p],n,r+s,f,s,o,u,a),n+=f)}}),$jit.Icicle=new t({Implements:[y,a,b.Icicle],layout:{orientation:"h",vertical:function(){return this.orientation=="v"},horizontal:function(){return this.orientation=="h"},change:function(){this.orientation=this.vertical()?"h":"v"}},initialize:function(t){var n={animate:!1,orientation:"h",offset:2,levelsToShow:Number.MAX_VALUE,constrained:!1,Node:{type:"rectangle",overridable:!0},Edge:{type:"none"},Label:{type:"Native"},duration:700,fps:45},r=i("Canvas","Node","Edge","Fx","Tips","NodeStyle
e.lambda(!1)},circle:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.circle.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.circle.contains(r,t,n)}},ellipse:{render:function(e,t){var n=e.pos.getc().$scale(e.scale),r=e.getData("width"),i=e.getData("height");this.nodeHelper.ellipse.render("fill",n,r,i,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=e.pos.getc().$scale(e.scale);return this.nodeHelper.circle.contains(i,t,n,r)}},square:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.square.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.square.contains(r,t,n)}},rectangle:{render:function(e,t){var n=this.node,r=e.getData("width"),i=e.getData("height"),s=e.pos.getc();r=n.transform?r*(1-s.squaredNorm()):r,i=n.transform?i*(1-s.squaredNorm()):i,s.$scale(e.scale),r>.2&&i>.2&&this.nodeHelper.rectangle.render("fill",s,r,i,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=e.pos.getc().$scale(e.scale);return this.nodeHelper.square.contains(i,t,n,r)}},triangle:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.triangle.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.triangle.contains(r,t,n)}},star:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.star.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.star.contains(r,t,n)}}}),n.Plot.EdgeTypes=new t({none:e.empty,line:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.line.render({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.line.contains({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t,this.edge.epsilon)}},arrow:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale,s=e.getData("dim"),o=e.data.$direction,u=o&&o.length>1&&o[0]!=e.nodeFrom.id;this.edgeHelper.arrow.render({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},s,u,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.arrow.contains({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t,this.edge.epsilon)}},hyperline:{render:function(e,t){var n=e.nodeFrom.pos.getc(),r=e.nodeTo.pos.getc(),i=this.viz.getRadius();this.edgeHelper.hyperline.render(n,r,i,t)},contains:e.lambda(!1)}})}($jit.Hypertree)})(),function(){window.$jit=function(e){e=e||window;for(var t in $jit)$jit[t].$extend&&(e[t]=$jit[t])},$jit.version="2.0.0b";var e=function(e){return document.getElementById(e)};e.empty=function(){},e.extend=function(e,t){for(var n in t||{})e[n]=t[n];return e},e.lambda=function(e){return typeof e=="function"?e:function(){return e}},e.time=Date.now||function(){return+(new Date)},e.splat=function(t){var n=e.type(t);return n?n!="array"?[t]:t:[]},e.type=function(t){var n=e.type.s.call(t).match(/^\[object\s(.*)\]$/)[1].toLowerCase();return n!="object"?n:t&&t.$$family?t.$$family:t&&t.nodeName&&t.nodeType==1?"element":n},e.type.s=Object.prototype.toString,e.each=function(t,n){var r=e.type(t);if(r=="object")for(var i in t)n(t[i],i);else for(var s=0,o=t.length;s<o;s++)n(t[s],s)},e.indexOf=function(e,t){if(Array.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},e.map=function(t,n){var r=[];return e.each(t,function(e,t){r.push(n(e,t))}),r},e.reduce=function(e,t,n){var r=e.length;if(r==0)return n;var i=arguments.length==3?n:e[--r];while(r--)i=t(i,e[r]);ret
(e),this.hasNode(t.id)||this.addNode(t),e=this.nodes[e.id],t=this.nodes[t.id];if(!e.adjacentTo(t)){var r=this.edges[e.id]=this.edges[e.id]||{},i=this.edges[t.id]=this.edges[t.id]||{};return r[t.id]=i[e.id]=new d.Adjacence(e,t,n,this.Edge,this.Label),r[t.id]}return this.edges[e.id][t.id]},removeNode:function(e){if(this.hasNode(e)){delete this.nodes[e];var t=this.edges[e];for(var n in t)delete this.edges[n][e];delete this.edges[e]}},removeAdjacence:function(e,t){delete this.edges[e][t],delete this.edges[t][e]},hasNode:function(e){return e in this.nodes},empty:function(){this.nodes={},this.edges={}}});var d=$jit.Graph,v;(function(){var t=function(e,t,n,r,i){var s;n=n||"current",e="$"+(e?e+"-":""),n=="current"?s=this.data:n=="start"?s=this.startData:n=="end"&&(s=this.endData);var o=e+t;return r?s[o]:this.Config.overridable?o in s?s[o]:o in this.data?this.data[o]:i[t]||0:i[t]||0},n=function(e,t,n,r){r=r||"current",e="$"+(e?e+"-":"");var i;r=="current"?i=this.data:r=="start"?i=this.startData:r=="end"&&(i=this.endData),i[e+t]=n},r=function(t,n){t="$"+(t?t+"-":"");var r=this;e.each(n,function(e){var n=t+e;delete r.data[n],delete r.endData[n],delete r.startData[n]})};v={getData:function(e,n,r){return t.call(this,"",e,n,r,this.Config)},setData:function(e,t,r){n.call(this,"",e,t,r)},setDataset:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i<o;i++)this.setData(r,s[i],t[i])},removeData:function(){r.call(this,"",Array.prototype.slice.call(arguments))},getCanvasStyle:function(e,n,r){return t.call(this,"canvas",e,n,r,this.Config.CanvasStyles)},setCanvasStyle:function(e,t,r){n.call(this,"canvas",e,t,r)},setCanvasStyles:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i<o;i++)this.setCanvasStyle(r,s[i],t[i])},removeCanvasStyle:function(){r.call(this,"canvas",Array.prototype.slice.call(arguments))},getLabelData:function(e,n,r){return t.call(this,"label",e,n,r,this.Label)},setLabelData:function(e,t,r){n.call(this,"label",e,t,r)},setLabelDataset:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i<o;i++)this.setLabelData(r,s[i],t[i])},removeLabelData:function(){r.call(this,"label",Array.prototype.slice.call(arguments))}}})(),d.Node=new t({initialize:function(t,n,r,i,s){var o={id:"",name:"",data:{},startData:{},endData:{},adjacencies:{},selected:!1,drawn:!1,exist:!1,angleSpan:{begin:0,end:0},pos:n&&p(0,0)||c(0,0),startPos:n&&p(0,0)||c(0,0),endPos:n&&p(0,0)||c(0,0)};e.extend(this,e.extend(o,t)),this.Config=this.Node=r,this.Edge=i,this.Label=s},adjacentTo:function(e){return e.id in this.adjacencies},getAdjacency:function(e){return this.adjacencies[e]},getPos:function(e){e=e||"current";if(e=="current")return this.pos;if(e=="end")return this.endPos;if(e=="start")return this.startPos},setPos:function(e,t){t=t||"current";var n;t=="current"?n=this.pos:t=="end"?n=this.endPos:t=="start"&&(n=this.startPos),n.set(e)}}),d.Node.implement(v),d.Adjacence=new t({initialize:function(e,t,n,r,i){this.nodeFrom=e,this.nodeTo=t,this.data=n||{},this.startData={},this.endData={},this.Config=this.Edge=r,this.Label=i}}),d.Adjacence.implement(v),d.Util={filter:function(t){if(!t||e.type(t)!="string")return function(){return!0};var n=t.split(" ");return function(e){for(var t=0;t<n.length;t++)if(e[n[t]])return!1;return!0}},getNode:function(e,t){return e.nodes[t]},eachNode:function(e,t,n){var r=this.filter(n);for(var i in e.nodes)r(e.nodes[i])&&t(e.nodes[i])},eachAdjacency:function(e,t,n){var r=e.adjacencies,i=this.filter(n);for(var s in r){var o=r[s];if(i(o)){if(o.nodeFrom!=e){var u=o.nodeFrom;o.nodeFrom=o.nodeTo,o.nodeTo=u}t(o,s)}}},computeLevels:function(e,t,n,r){n=n||0;var i=this.filter(r);this.eachNode(e,function(e){e._flag=!1,e._depth=-1},r);var s=e.getNode(t);s._depth=n;var o=[s];while(o.length!=0){var u=o.pop();u._flag=!0,this.eachAdjacency(u,function(e){var t=e.nodeTo;t._flag==0&&i(t)&&(t._depth<0&&(t._depth=u._depth+1+n),o.unshift(t))},r)}},eachBFS:function(e,t,n,r){var i=this.filter(r);this.clean(e);var s=[e.getNode(t)];while(s.length!=0){var o=s.pop();o._flag=!0,n(
(this.root,function(e){var r=e.angleSpan.end-e.angleSpan.begin,i=e.angleSpan.begin,o=t(e),u=0,a=[],f={};e.eachSubnode(function(e){u+=e._treeAngularWidth;for(var t=0,r=n.length;t<r;t++){var i=n[t],s=e.getData("dim",i);f[i]=i in f?s>f[i]?s:f[i]:s}a.push(e)},"ignore"),s&&s.id==e.id&&a.length>0&&a[0].dist&&a.sort(function(e,t){return(e.dist>=t.dist)-(e.dist<=t.dist)});for(var l=0,h=a.length;l<h;l++){var p=a[l];if(!p._flag){var d=p._treeAngularWidth/u*r,v=i+d/2;for(var m=0,g=n.length;m<g;m++){var y=n[m];p.setPos(c(v,o),y),p.setData("span",d,y),p.setData("dim-quotient",p.getData("dim",y)/f[y],y)}p.angleSpan={begin:i,end:i+d},i+=d}}},"ignore")},setAngularWidthForNodes:function(e){this.graph.eachBFS(this.root,function(t,n){var r=t.getData("angularWidth",e[0])||5;t._angularWidth=r/n},"ignore")},setSubtreesAngularWidth:function(){var e=this;this.graph.eachNode(function(t){e.setSubtreeAngularWidth(t)},"ignore")},setSubtreeAngularWidth:function(e){var t=this,n=e._angularWidth,r=0;e.eachSubnode(function(e){t.setSubtreeAngularWidth(e),r+=e._treeAngularWidth},"ignore"),e._treeAngularWidth=Math.max(n,r)},computeAngularWidths:function(e){this.setAngularWidthForNodes(e),this.setSubtreesAngularWidth()}}),$jit.ForceDirected=new t({Implements:[y,a,b.ForceDirected],initialize:function(t){var n=$jit.ForceDirected,r={iterations:50,levelDistance:50};this.controller=this.config=e.merge(i("Canvas","Node","Edge","Fx","Tips","NodeStyles","Events","Navigation","Controller","Label"),r,t);var s=this.config;s.useCanvas?(this.canvas=s.useCanvas,this.config.labelContainer=this.canvas.id+"-label"):(s.background&&(s.background=e.merge({type:"Circles"},s.background)),this.canvas=new f(this,s),this.config.labelContainer=(typeof s.injectInto=="string"?s.injectInto:s.injectInto.id)+"-label"),this.graphOptions={complex:!0,Node:{selected:!1,exist:!0,drawn:!0}},this.graph=new d(this.graphOptions,this.config.Node,this.config.Edge),this.labels=new n.Label[s.Label.type](this),this.fx=new n.Plot(this,n),this.op=new n.Op(this),this.json=null,this.busy=!1,this.initializeExtras()},refresh:function(){this.compute(),this.plot()},reposition:function(){this.compute("end")},computeIncremental:function(t){t=e.merge({iter:20,property:"end",onStep:e.empty,onComplete:e.empty},t||{}),this.config.onBeforeCompute(this.graph.getNode(this.root)),this.compute(t.property,t)},plot:function(){this.fx.plot()},animate:function(t){this.fx.animate(e.merge({modes:["linear"]},t||{}))}}),$jit.ForceDirected.$extend=!0,function(n){n.Op=new t({Implements:d.Op}),n.Plot=new t({Implements:d.Plot}),n.Label={},n.Label.Native=new t({Implements:d.Label.Native}),n.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l={x:Math.round(r.x*u+s+f.width/2),y:Math.round(r.y*a+o+f.height/2)};e.setAttribute("x",l.x),e.setAttribute("y",l.y),n.onPlaceLabel(e,t)}}),n.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l={x:Math.round(r.x*u+s+f.width/2),y:Math.round(r.y*a+o+f.height/2)},c=e.style;c.left=l.x+"px",c.top=l.y+"px",c.display=this.fitsInCanvas(l,i)?"":"none",n.onPlaceLabel(e,t)}}),n.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.circle.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.circle.contains(n,t,r)}},ellipse:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");this.nodeHelper.ellipse.render("fill",n,r,i,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.ellipse.contains(n,t,r,i)}},square:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.square.render("fill",n,r,t)},
[0];return!n||!n.ownerDocument?null:t?e.isFunction(t)?this.each(function(n){e(this).offset(t.call(this,n,e(this).offset()))}):this.each(function(){e.offset.setOffset(this,t)}):u.call(this)}),e.curCSS||(e.curCSS=e.css),function(){var t=document.getElementsByTagName("body")[0],n=document.createElement("div"),r,i,o,u,l;r=document.createElement(t?"div":"body"),o={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},t&&e.extend(o,{position:"absolute",left:"-1000px",top:"-1000px"});for(var c in o)r.style[c]=o[c];r.appendChild(n),i=t||document.documentElement,i.insertBefore(r,i.firstChild),n.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",u=e(n).offset(function(e,t){return t}).offset(),r.innerHTML="",i.removeChild(r),l=u.top+u.left+(t?2e3:0),s.fractions=l>21&&l<22}()}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{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},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(n.iframeFix&&e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=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(),this.offset=this.positionAbs=this.element.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.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.rever
),r=n.children(".mCSB_container");e(document).data("mCS-is-touch-device")||r.removeClass("mCS_no_scrollbar");var i=n.children(".mCSB_scrollTools"),s=i.children(".mCSB_draggerContainer"),o=s.children(".mCSB_dragger");if(t.data("horizontalScroll")){var u=i.children(".mCSB_buttonLeft"),a=i.children(".mCSB_buttonRight"),f=n.width();t.data("autoExpandHorizontalScroll")&&r.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:r.outerWidth(),position:"relative"}).unwrap();var l=r.outerWidth()}else var c=i.children(".mCSB_buttonUp"),h=i.children(".mCSB_buttonDown"),p=n.height(),d=r.outerHeight();if(d>p&&!t.data("horizontalScroll")&&!e(document).data("mCS-is-touch-device")){i.css("display","block");var v=s.height();if(t.data("autoDraggerLength")){var m=Math.round(p/d*v),g=o.data("minDraggerHeight");if(m<=g)o.css({height:g});else if(m>=v-10){var y=v-10;o.css({height:y})}else o.css({height:m});o.children(".mCSB_dragger_bar").css({"line-height":o.height()+"px"})}var w=o.height(),E=(d-p)/(v-w);t.data("scrollAmount",E),t.mCustomScrollbar("scrolling",n,r,s,o,c,h,u,a);var S=Math.abs(Math.round(r.position().top));t.mCustomScrollbar("scrollTo",S,{callback:!1})}else if(l>f&&t.data("horizontalScroll")&&!e(document).data("mCS-is-touch-device")){i.css("display","block");var x=s.width();if(t.data("autoDraggerLength")){var T=Math.round(f/l*x),N=o.data("minDraggerWidth");if(T<=N)o.css({width:N});else if(T>=x-10){var C=x-10;o.css({width:C})}else o.css({width:T})}var k=o.width(),E=(l-f)/(x-k);t.data("scrollAmount",E),t.mCustomScrollbar("scrolling",n,r,s,o,c,h,u,a);var S=Math.abs(Math.round(r.position().left));t.mCustomScrollbar("scrollTo",S,{callback:!1})}else n.unbind("mousewheel"),n.unbind("focusin"),t.data("horizontalScroll")?o.add(r).css("left",0):o.add(r).css("top",0),i.css("display","none"),r.addClass("mCS_no_scrollbar")},scrolling:function(t,n,r,i,s,o,u,a){var f=e(this);if(!i.hasClass("ui-draggable")){if(f.data("horizontalScroll"))var l="x";else var l="y";i.draggable({axis:l,containment:"parent",drag:function(e,t){f.mCustomScrollbar("scroll"),i.addClass("mCSB_dragger_onDrag")},stop:function(e,t){i.removeClass("mCSB_dragger_onDrag")}})}r.unbind("click").bind("click",function(e){if(f.data("horizontalScroll")){var t=e.pageX-r.offset().left;if(t<i.position().left||t>i.position().left+i.width()){var n=t;n>=r.width()-i.width()&&(n=r.width()-i.width()),i.css("left",n),f.mCustomScrollbar("scroll")}}else{var t=e.pageY-r.offset().top;if(t<i.position().top||t>i.position().top+i.height()){var n=t;n>=r.height()-i.height()&&(n=r.height()-i.height()),i.css("top",n),f.mCustomScrollbar("scroll")}}});if(f.data("mouseWheel")){var c=f.data("mouseWheel");if(f.data("mouseWheel")==="auto"){c=8;var h=navigator.userAgent;h.indexOf("Mac")!=-1&&h.indexOf("Safari")!=-1&&h.indexOf("AppleWebKit")!=-1&&h.indexOf("Chrome")==-1&&(c=1)}t.unbind("mousewheel").bind("mousewheel",function(e,t){e.preventDefault();var n=Math.abs(t*c);if(f.data("horizontalScroll")){var s=i.position().left-t*n;i.css("left",s),i.position().left<0&&i.css("left",0);var o=r.width(),u=i.width();i.position().left>o-u&&i.css("left",o-u)}else{var a=i.position().top-t*n;i.css("top",a),i.position().top<0&&i.css("top",0);var l=r.height(),h=i.height();i.position().top>l-h&&i.css("top",l-h)}f.mCustomScrollbar("scroll")})}if(f.data("scrollButtons-enable"))if(f.data("scrollButtons-scrollType")==="pixels"){var p;e.browser.msie&&parseInt(e.browser.version)<9&&f.data("scrollInertia",0),f.data("horizontalScroll")?(a.add(u).unbind("click mousedown mouseup mouseout",g,w),a.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().left)+f.data("scrollButtons-scrollAmount"),f.mCustomScrollbar("scrollTo",p))}),u.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().left)-f.data("scrollButtons-scrollAmount"),n.position().left>=-f.data("scrollButtons-scrollAmount")&&(p="left"),f.mCustomScrollbar("scrollTo",p))})):(o.add(s).unbind("click mousedown mouseup mouseout",T,C),o.bin