User:Mr Pie 5/common.js

//syntax highlighter from https://www.mediawiki.org/wiki/User:Remember_the_dot/Syntax_highlighter mw.loader.load('//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-DotsSyntaxHighlighter.js&action=raw&ctype=text/javascript');

mw.config['debug'] = true; /*! jQuery UI - v1.12.1 - 2019-01-11
 * http://jqueryui.com
 * Includes: widget.js, keycode.js, unique-id.js, widgets/tabs.js
 * Copyright jQuery Foundation and other contributors; Licensed MIT */

(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){t.ui=t.ui||{},t.ui.version="1.12.1";var e=0,i=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function{function t{return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function{var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}},void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var s,n,o=i.call(arguments,1),a=0,r=o.length;r>a;a++)for(s in o[a])n=o[a][s],o[a].hasOwnProperty(s)&&void 0!==n&&(e[s]=t.isPlainObject(n)?t.isPlainObject(e[s])?t.widget.extend({},e[s],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,s){var n=s.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=i.call(arguments,1),l=this;return a?this.length||"instance"!==o?this.each(function{var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):l=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function{var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init):t.data(this,n,new s(o,this))})),l}},t.Widget=function{},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:" ",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t,this.hoverable=t,this.focusable=t,this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions,i),this._create,this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData),this._init},_getCreateOptions:function{return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function{var e=this;this._destroy,t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget.off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function{return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift,s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop,1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget,this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function{return this._setOptions({disabled:!1})},disable:function{return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t,a=e.add?t(t.unique(a.get.concat(e.element.get))):t(a.not(e.element).get),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget),t.each(s,function(s,a){function r{return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get),this.focusable=t(this.focusable.not(e).get),this.hoverable=t(this.hoverable.not(e).get)},_delay:function(t,e){function i{return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase,i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented)}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e],o&&o.call(s[0]),i})}}),t.widget,t.ui.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},t.fn.extend({uniqueId:function{var t=0;return function{return this.each(function{this.id||(this.id="ui-id-"+ ++t)})}},removeUniqueId:function{return this.each(function{/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.escapeSelector=function{var t=/([!"#$%&'*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function{var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return e.hash.length>1&&i===s}},_create:function{var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs,i.active=this._initialActive,t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t,this._refresh,this.active.length&&this.load(i.active)},_initialActive:function{var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each(function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function{return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault,clearTimeout(this.activating),this._activate(s),void 0;case t.ui.keyCode.ENTER:return e.preventDefault,clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preventDefault,clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function{this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault,this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function s{return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s,this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function{var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs,e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t),this._refresh},_refresh:function{this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide.attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show.attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function{var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList.attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function{t(this).closest("li").is(".ui-state-disabled")&&this.blur}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function{return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t,this.anchors.each(function(i,s){var n,o,a,r=t(s).uniqueId.attr("id"),l=t(s).closest("li"),h=l.attr("aria-controls");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSelector(n))):(a=l.attr("aria-controls")||t({}).uniqueId[0].id,n="#"+a,o=e.element.find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),h&&l.data("ui-tabs-aria-controls",h),l.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function{return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t(" ").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget,this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent;"fill"===e?(i=s.height,i-=this.element.outerHeight-this.element.height,this.element.siblings(":visible").each(function{var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children.not(this.panels).each(function{i-=t(this).outerHeight(!0)}),this.panels.each(function{t(this).height(Math.max(0,i-t(this).innerHeight+t(this).height))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function{i=Math.max(i,t(this).height("").height)}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,l=r?t:this._getPanelForTab(o),h=s.length?this._getPanelForTab(s):t,c={oldTab:s,oldPanel:h,newTab:r?t:o,newPanel:l};e.preventDefault,o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t:o,this.xhr&&this.xhr.abort,h.length||l.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s{o.running=!1,o._trigger("activate",e,i)}function n{o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show,s)}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function{o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide,n),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function{return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t:this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function{this.xhr&&this.xhr.abort,this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId,this.tabs.add(this.panels).each(function{t.data(this,"ui-tabs-destroy")?t(this).remove:t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function{var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show,"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort:[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},l=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,n){setTimeout(function{a.html(t),s._trigger("load",i,r),l(n,e)},1)}).fail(function(t,e){setTimeout(function{l(t,e)},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function{this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs});

/* Teantjs



!function{var t=null,e={inheritAttrs:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]instanceof Object&&e[i]instanceof Object&&"function"!=typeof e[i]?this.inheritAttrs(t[i],e[i]):t[i]=e[i])},createMerge:function(t,e){var i={};return t&&this.inheritAttrs(i,this.cloneObj(t)),e&&this.inheritAttrs(i,e),i},extend:function{return t?(Array.prototype.unshift.apply(arguments,[!0,{}]),t.extend.apply(t,arguments)):e.createMerge.apply(this,arguments)},cloneObj:function(t){if(Object(t)!==t)return t;var e=new t.constructor;for(var i in t)t.hasOwnProperty(i)&&(e[i]=this.cloneObj(t[i]));return e},addEvent:function(e,i,n){t?t(e).on(i+".treant",n):e.addEventListener?e.addEventListener(i,n,!1):e.attachEvent?e.attachEvent("on"+i,n):e["on"+i]=n},findEl:function(e,i,n){if(n=n||document,t){var r=t(e,n);return i?r.get(0):r}if("#"==e.charAt(0))return n.getElementById(e.substring(1));if("."==e.charAt(0)){var o=n.getElementsByClassName(e.substring(1));return o.length?o[0]:null}throw new Error("Unknown container element")},getOuterHeight:function(i){var n=1;return"function"==typeof i.getBoundingClientRect?i.getBoundingClientRect.height:t?Math.ceil(t(i).outerHeight)+n:Math.ceil(i.clientHeight+e.getStyle(i,"border-top-width",!0)+e.getStyle(i,"border-bottom-width",!0)+e.getStyle(i,"padding-top",!0)+e.getStyle(i,"padding-bottom",!0)+n)},getOuterWidth:function(i){var n=1;return"function"==typeof i.getBoundingClientRect?i.getBoundingClientRect.width:t?Math.ceil(t(i).outerWidth)+n:Math.ceil(i.clientWidth+e.getStyle(i,"border-left-width",!0)+e.getStyle(i,"border-right-width",!0)+e.getStyle(i,"padding-left",!0)+e.getStyle(i,"padding-right",!0)+n)},getStyle:function(t,e,i){var n="";return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,"").getPropertyValue(e):t.currentStyle&&(e=e.replace(/\-(\w)/g,function(t,e){return e.toUpperCase}),n=t.currentStyle[e]),i?parseFloat(n):n},addClass:function(i,n){t?t(i).addClass(n):e.hasClass(i,n)||(i.classList?i.classList.add(n):i.className+=" "+n)},hasClass:function(t,e){return(" "+t.className+" ").replace(/[\n\t]/g," ").indexOf(" "+e+" ")>-1},toggleClass:function(e,i,n){t?t(e).toggleClass(i,n):n?e.classList.add(i):e.classList.remove(i)},setDimensions:function(e,i,n){t?t(e).width(i).height(n):(e.style.width=i+"px",e.style.height=n+"px")}},i=function{this.reset};i.prototype={reset:function{return this.loading=[],this},processNode:function(t){for(var e=t.nodeDOM.getElementsByTagName("img"),i=e.length;i--;)this.create(t,e[i]);return this},removeAll:function(t){for(var e=this.loading.length;e--;)this.loading[e]===t&&this.loading.splice(e,1);return this},create:function(t,i){function n{r.removeAll(o),t.width=t.nodeDOM.offsetWidth,t.height=t.nodeDOM.offsetHeight}var r=this,o=i.src;if(0!==i.src.indexOf("data:")){if(this.loading.push(o),i.complete)return n;e.addEvent(i,"load",n),e.addEvent(i,"error",n),i.src+="?"+(new Date).getTime}else n},isNotLoading:function{return 0===this.loading.length}};var n={store:[],createTree:function(t){var e=this.store.length;return this.store.push(new r(t,e)),this.get(e)},get:function(t){return this.store[t]},destroy:function(t){var e=this.get(t);if(e){e._R.remove;for(var i=e.drawArea;i.firstChild;)i.removeChild(i.firstChild);for(var n=i.className.split(" "),r=[],o=0;o<n.length;o++){var s=n[o];"Treant"!=s&&"Treant-loaded"!=s&&r.push(s)}i.style.overflowY="",i.style.overflowX="",i.className=r.join(" "),this.store[t]=null}return this}},r=function(t,n){this.reset=function(t,n){if(this.initJsonConfig=t,this.initTreeId=n,this.id=n,this.CONFIG=e.extend(r.CONFIG,t.chart),this.drawArea=e.findEl(this.CONFIG.container,!0),!this.drawArea)throw new Error('Failed to find element by selector "'+selector+'"');return e.addClass(this.drawArea,"Treant"),this.drawArea.innerHTML="",this.imageLoader=new i,this.nodeDB=new o(t.nodeStructure,this),this.connectionStore={},this.loaded=!1,this._R=new Raphael(this.drawArea,100,100),this},this.reload=function{return this.reset(this.initJsonConfig,this.initTreeId).redraw,this},this.reset(t,n)};r.prototype={getNodeDb:function{return this.nodeDB},addNode:function(t,e){this.nodeDB.get(t.id);this.CONFIG.callback.onBeforeAddNode.apply(this,[t,e]);var i=this.nodeDB.createNode(e,t.id,this);return i.createGeometry(this),i.parent.createSwitchGeometry(this),this.positionTree,this.CONFIG.callback.onAfterAddNode.apply(this,[i,t,e]),i},redraw:function{return this.positionTree,this},positionTree:function(t){var i=this;if(this.imageLoader.isNotLoading){var n=this.root;this.CONFIG.rootOrientation;this.resetLevelData,this.firstWalk(n,0),this.secondWalk(n,0,0,0),this.positionNodes,this.CONFIG.animateOnInit&&setTimeout(function{n.toggleCollapse},this.CONFIG.animateOnInitDelay),this.loaded||(e.addClass(this.drawArea,"Treant-loaded"),"[object Function]"===Object.prototype.toString.call(t)&&t(i),i.CONFIG.callback.onTreeLoaded.apply(i,[n]),this.loaded=!0)}else setTimeout(function{i.positionTree(t)},10);return this},firstWalk:function(t,e){t.prelim=null,t.modifier=null,this.setNeighbors(t,e),this.calcLevelDim(t,e);var i=t.leftSibling;if(0===t.childrenCount||e==this.CONFIG.maxDepth)i?t.prelim=i.prelim+i.size+this.CONFIG.siblingSeparation:t.prelim=0;else{for(var n=0,r=t.childrenCount;n<r;n++)this.firstWalk(t.childAt(n),e+1);var o=t.childrenCenter-t.size/2;i?(t.prelim=i.prelim+i.size+this.CONFIG.siblingSeparation,t.modifier=t.prelim-o,this.apportion(t,e)):t.prelim=o,t.stackParent?t.modifier+=this.nodeDB.get(t.stackChildren[0]).size/2+t.connStyle.stackIndent:t.stackParentId&&(t.prelim=0)}return this},apportion:function(t,e){for(var i=t.firstChild,n=i.leftNeighbor,r=1,o=this.CONFIG.maxDepth-e;i&&n&&r<=o;){for(var s=0,h=0,a=n,l=i,d=0;d0){for(var u=t,f=0;u&&u.id!=a.id;)u=u.leftSibling,f++;if(u)for(var p=t,g=c/f;p.id!=a.id;)p.prelim+=c,p.modifier+=c,c-=g,p=p.leftSibling}r++,i=0===i.childrenCount?t.leftMost(0,r):i=i.firstChild,i&&(n=i.leftNeighbor)}},secondWalk:function(t,e,i,n){if(e<=this.CONFIG.maxDepth){var r,o,s=t.prelim+i,h=n,a=this.CONFIG.nodeAlign,l=this.CONFIG.rootOrientation;if("NORTH"==l||"SOUTH"==l?(r=this.levelMaxDim[e].height,o=t.height,t.pseudo&&(t.height=r)):"WEST"!=l&&"EAST"!=l||(r=this.levelMaxDim[e].width,o=t.width,t.pseudo&&(t.width=r)),t.X=s,t.pseudo?"NORTH"==l||"WEST"==l?t.Y=h:"SOUTH"!=l&&"EAST"!=l||(t.Y=h+(r-o)):t.Y="CENTER"==a?h+(r-o)/2:"TOP"==a?h+(r-o):h,"WEST"==l||"EAST"==l){var d=t.X;t.X=t.Y,t.Y=d}"SOUTH"==l?t.Y=-t.Y-o:"EAST"==l&&(t.X=-t.X-o),0!==t.childrenCount&&(0===t.id&&this.CONFIG.hideRootNode?this.secondWalk(t.firstChild,e+1,i+t.modifier,n):this.secondWalk(t.firstChild,e+1,i+t.modifier,n+r+this.CONFIG.levelSeparation)),t.rightSibling&&this.secondWalk(t.rightSibling,e,i,n)}},positionNodes:function{var t=this,e={x:t.nodeDB.getMinMaxCoord("X",null,null),y:t.nodeDB.getMinMaxCoord("Y",null,null)},i=e.x.max-e.x.min,n=e.y.max-e.y.min,r={x:e.x.max-i/2,y:e.y.max-n/2};this.handleOverflow(i,n);var o,s,h,a={x:t.drawArea.clientWidth/2,y:t.drawArea.clientHeight/2},l=a.x-r.x,d=a.y-r.y,c=e.x.min+l<=0?Math.abs(e.x.min):0,u=e.y.min+d<=0?Math.abs(e.y.min):0;for(o=0,s=this.nodeDB.db.length;o<s;o++)if(h=this.nodeDB.get(o),t.CONFIG.callback.onBeforePositionNode.apply(t,[h,o,a,r]),0===h.id&&this.CONFIG.hideRootNode)t.CONFIG.callback.onAfterPositionNode.apply(t,[h,o,a,r]);else{h.X+=c+(i<this.drawArea.clientWidth?l:this.CONFIG.padding),h.Y+=u+(n<this.drawArea.clientHeight?d:this.CONFIG.padding);var f=h.collapsedParent,p=null;f?(p=f.connectorPoint(!0),h.hide(p)):h.positioned?h.show:(h.nodeDOM.style.left=h.X+"px",h.nodeDOM.style.top=h.Y+"px",h.positioned=!0),0===h.id||0===h.parent.id&&this.CONFIG.hideRootNode?!this.CONFIG.hideRootNode&&h.drawLineThrough&&h.drawLineThroughMe:this.setConnectionToParent(h,p),t.CONFIG.callback.onAfterPositionNode.apply(t,[h,o,a,r])}return this},handleOverflow:function(i,n){var r=i<this.drawArea.clientWidth?this.drawArea.clientWidth:i+2*this.CONFIG.padding,o=n<this.drawArea.clientHeight?this.drawArea.clientHeight:n+2*this.CONFIG.padding;if(this._R.setSize(r,o),"resize"==this.CONFIG.scrollbar)e.setDimensions(this.drawArea,r,o);else if(void 0==t||"native"==this.CONFIG.scrollbar)this.drawArea.clientWidth<i&&(this.drawArea.style.overflowX="auto"),this.drawArea.clientHeight<n&&(this.drawArea.style.overflowY="auto");else if("fancy"==this.CONFIG.scrollbar){var s=t(this.drawArea);if(s.hasClass("ps-container"))s.find(".Treant").css({width:r,height:o}),s.perfectScrollbar("update");else{var h=s.wrapInner(' '),a=h.find(".Treant");a.css({width:r,height:o}),h.perfectScrollbar}}return this},setConnectionToParent:function(t,e){var i,n=t.stackParentId,r=n?this.nodeDB.get(n):t.parent,o=e?this.getPointPathString(e):this.getPathString(r,t,n);return this.connectionStore[t.id]?(i=this.connectionStore[t.id],this.animatePath(i,o)):(i=this._R.path(o),this.connectionStore[t.id]=i,t.pseudo&&delete r.connStyle.style["arrow-end"],r.pseudo&&delete r.connStyle.style["arrow-start"],i.attr(r.connStyle.style),(t.drawLineThrough||t.pseudo)&&t.drawLineThroughMe(e)),t.connector=i,this},getPointPathString:function(t){return["_M",t.x,",",t.y,"L",t.x,",",t.y,t.x,",",t.y].join(" ")},animatePath:function(t,e){return t.hidden&&"_"!==e.charAt(0)&&(t.show,t.hidden=!1),t.animate({path:"_"===e.charAt(0)?e.substring(1):e},this.CONFIG.animation.connectorsSpeed,this.CONFIG.animation.connectorsAnimation,function{"_"===e.charAt(0)&&(t.hide,t.hidden=!0)}),this},getPathString:function(t,e,i){var n=t.connectorPoint(!0),r=e.connectorPoint(!1),o=this.CONFIG.rootOrientation,s=t.connStyle.type,h={},a={};"NORTH"==o||"SOUTH"==o?(h.y=a.y=(n.y+r.y)/2,h.x=n.x,a.x=r.x):"EAST"!=o&&"WEST"!=o||(h.x=a.x=(n.x+r.x)/2,h.y=n.y,a.y=r.y);var l,d,c=n.x+","+n.y,u=h.x+","+h.y,f=a.x+","+a.y,p=r.x+","+r.y,g=(h.x+a.x)/2+","+(h.y+a.y)/2;if(i){if(d="EAST"==o||"WEST"==o?r.x+","+n.y:n.x+","+r.y,"step"==s||"straight"==s)l=["M",c,"L",d,"L",p];else if("curve"==s||"bCurve"==s){var m,y=t.connStyle.stackIndent;"NORTH"==o?m=r.x-y+","+(r.y-y):"SOUTH"==o?m=r.x-y+","+(r.y+y):"EAST"==o?m=r.x+y+","+n.y:"WEST"==o&&(m=r.x-y+","+n.y),l=["M",c,"L",m,"S",d,p]}}else"step"==s?l=["M",c,"L",u,"L",f,"L",p]:"curve"==s?l=["M",c,"C",u,f,p]:"bCurve"==s?l=["M",c,"Q",u,g,"T",p]:"straight"==s&&(l=["M",c,"L",c,p]);return l.join(" ")},setNeighbors:function(t,e){return t.leftNeighborId=this.lastNodeOnLevel[e],t.leftNeighborId&&(t.leftNeighbor.rightNeighborId=t.id),this.lastNodeOnLevel[e]=t.id,this},calcLevelDim:function(t,e){return this.levelMaxDim[e]={width:Math.max(this.levelMaxDim[e]?this.levelMaxDim[e].width:0,t.width),height:Math.max(this.levelMaxDim[e]?this.levelMaxDim[e].height:0,t.height)},this},resetLevelData:function{return this.lastNodeOnLevel=[],this.levelMaxDim=[],this},root:function{return this.nodeDB.get(0)}};var o=function(t,e){this.reset(t,e)};o.prototype={reset:function(t,i){function n(t,o){var s=r.createNode(t,o,i,null);if(t.children){if(t.childrenDropLevel&&t.childrenDropLevel>0)for(t.childrenDropLevel--;){var h=e.cloneObj(s.connStyle);s=r.createNode("pseudo",s.id,i,null),s.connStyle=h,s.children=[]}var a=t.stackChildren&&!r.hasGrandChildren(t)?s.id:null;null!==a&&(s.stackChildren=[]);for(var l=0,d=t.children.length;l<d;l++)null!==a?(s=r.createNode(t.children[l],s.id,i,a),l+1=0){var o=this.get(e);if(t.position)if("left"==t.position)o.children.push(r.id);else if("right"==t.position)o.children.splice(0,0,r.id);else if("center"==t.position)o.children.splice(Math.floor(o.children.length/2),0,r.id);else{var h=parseInt(t.position);1==o.children.length&&h>0?o.children.splice(0,0,r.id):o.children.splice(Math.max(h,o.children.length-1),0,r.id)}else o.children.push(r.id)}return n&&(this.get(n).stackParent=!0,this.get(n).stackChildren.push(r.id)),r},getMinMaxCoord:function(t,e,i){e=e||this.get(0),i=i||{min:e[t],max:e[t]+("X"==t?e.width:e.height)};for(var n=e.childrenCount;n--;){var r=e.childAt(n),o=r[t]+("X"==t?r.width:r.height),s=r[t];o>i.max&&(i.max=o),s<i.min&&(i.min=s),this.getMinMaxCoord(t,r,i)}return i},hasGrandChildren:function(t){for(var e=t.children.length;e--;)if(t.children[e].children)return!0;return!1}};var s=function(t,e,i,n,r){this.reset(t,e,i,n,r)};s.prototype={reset:function(t,i,n,r,o){return this.id=i,this.parentId=n,this.treeId=r.id,this.prelim=0,this.modifier=0,this.leftNeighborId=null,this.stackParentId=o,this.pseudo="pseudo"===t||t.pseudo,this.meta=t.meta||{},this.image=t.image||null,this.link=e.createMerge(r.CONFIG.node.link,t.link),this.connStyle=e.createMerge(r.CONFIG.connectors,t.connectors),this.connector=null,this.drawLineThrough=t.drawLineThrough!==!1&&(t.drawLineThrough||r.CONFIG.node.drawLineThrough),this.collapsable=t.collapsable!==!1&&(t.collapsable||r.CONFIG.node.collapsable),this.collapsed=t.collapsed,this.text=t.text,this.nodeInnerHTML=t.innerHTML,this.nodeHTMLclass=(r.CONFIG.node.HTMLclass?r.CONFIG.node.HTMLclass:"")+(t.HTMLclass?" "+t.HTMLclass:""),this.nodeHTMLid=t.HTMLid,this.children=[],this},getTree:function{return n.get(this.treeId)},getTreeConfig:function{return this.getTree.CONFIG},getTreeNodeDb:function{return this.getTree.getNodeDb},lookupNode:function(t){return this.getTreeNodeDb.get(t)},Tree:function{return n.get(this.treeId)},dbGet:function(t){return this.getTreeNodeDb.get(t)},size:function{var t=this.getTreeConfig.rootOrientation;return this.pseudo?-this.getTreeConfig.subTeeSeparation:"NORTH"==t||"SOUTH"==t?this.width:"WEST"==t||"EAST"==t?this.height:void 0},childrenCount:function{return this.collapsed||!this.children?0:this.children.length},childAt:function(t){return this.dbGet(this.children[t])},firstChild:function{return this.childAt(0)},lastChild:function{return this.childAt(this.children.length-1)},parent:function{return this.lookupNode(this.parentId)},leftNeighbor:function{if(this.leftNeighborId)return this.lookupNode(this.leftNeighborId)},rightNeighbor:function{if(this.rightNeighborId)return this.lookupNode(this.rightNeighborId)},leftSibling:function{var t=this.leftNeighbor;if(t&&t.parentId==this.parentId)return t},rightSibling:function{var t=this.rightNeighbor;if(t&&t.parentId==this.parentId)return t},childrenCenter:function{var t=this.firstChild,e=this.lastChild;return t.prelim+(e.prelim-t.prelim+e.size)/2},collapsedParent:function{var t=this.parent;return!!t&&(t.collapsed?t:t.collapsedParent)},leftMost:function(t,e){if(t>=e)return this;if(0!==this.childrenCount)for(var i=0,n=this.childrenCount;i<n;i++){var r=this.childAt(i).leftMost(t+1,e);if(r)return r}},connectorPoint:function(t){var e=this.Tree.CONFIG.rootOrientation,i={};return this.stackParentId&&("NORTH"==e||"SOUTH"==e?e="WEST":"EAST"!=e&&"WEST"!=e||(e="NORTH")),"NORTH"==e?(i.x=this.pseudo?this.X-this.Tree.CONFIG.subTeeSeparation/2:this.X+this.width/2,i.y=t?this.Y+this.height:this.Y):"SOUTH"==e?(i.x=this.pseudo?this.X-this.Tree.CONFIG.subTeeSeparation/2:this.X+this.width/2,i.y=t?this.Y:this.Y+this.height):"EAST"==e?(i.x=t?this.X:this.X+this.width,i.y=this.pseudo?this.Y-this.Tree.CONFIG.subTeeSeparation/2:this.Y+this.height/2):"WEST"==e&&(i.x=t?this.X+this.width:this.X,i.y=this.pseudo?this.Y-this.Tree.CONFIG.subTeeSeparation/2:this.Y+this.height/2),i},pathStringThrough:function{var t=this.connectorPoint(!0),e=this.connectorPoint(!1);return["M",t.x+","+t.y,"L",e.x+","+e.y].join(" ")},drawLineThroughMe:function(t){var i=t?this.Tree.getPointPathString(t):this.pathStringThrough;this.lineThroughMe=this.lineThroughMe||this.Tree._R.path(i);var n=e.cloneObj(this.connStyle.style);delete n["arrow-start"],delete n["arrow-end"],this.lineThroughMe.attr(n),t&&(this.lineThroughMe.hide,this.lineThroughMe.hidden=!0)},addSwitchEvent:function(t){var i=this;e.addEvent(t,"click",function(e){return e.preventDefault,i.getTreeConfig.callback.onBeforeClickCollapseSwitch.apply(i,[t,e])!==!1&&(i.toggleCollapse,void i.getTreeConfig.callback.onAfterClickCollapseSwitch.apply(i,[t,e]))})},collapse:function{return this.collapsed||this.toggleCollapse,this},expand:function{return this.collapsed&&this.toggleCollapse,this},toggleCollapse:function{var t=this.getTree;if(!t.inAnimation){t.inAnimation=!0,this.collapsed=!this.collapsed,e.toggleClass(this.nodeDOM,"collapsed",this.collapsed),t.positionTree;var i=this;setTimeout(function{t.inAnimation=!1,t.CONFIG.callback.onToggleCollapseFinished.apply(t,[i,i.collapsed])},t.CONFIG.animation.nodeSpeed>t.CONFIG.animation.connectorsSpeed?t.CONFIG.animation.nodeSpeed:t.CONFIG.animation.connectorsSpeed)}return this},hide:function(e){e=e||!1;var i=this.hidden;this.hidden=!0,this.nodeDOM.style.overflow="hidden";var n=this.getTree,r=this.getTreeConfig,o={opacity:0};if(e&&(o.left=e.x,o.top=e.y),!this.positioned||i?(this.nodeDOM.style.visibility="hidden",t?t(this.nodeDOM).css(o):(this.nodeDOM.style.left=o.left+"px",this.nodeDOM.style.top=o.top+"px"),this.positioned=!0):t?t(this.nodeDOM).animate(o,r.animation.nodeSpeed,r.animation.nodeAnimation,function{this.style.visibility="hidden"}):(this.nodeDOM.style.transition="all "+r.animation.nodeSpeed+"ms ease",this.nodeDOM.style.transitionProperty="opacity, left, top",this.nodeDOM.style.opacity=o.opacity,this.nodeDOM.style.left=o.left+"px",this.nodeDOM.style.top=o.top+"px",this.nodeDOM.style.visibility="hidden"),this.lineThroughMe){var s=n.getPointPathString(e);i?this.lineThroughMe.attr({path:s}):n.animatePath(this.lineThroughMe,n.getPointPathString(e))}return this},hideConnector:function{var t=this.Tree,e=t.connectionStore[this.id];return e&&e.animate({opacity:0},t.CONFIG.animation.connectorsSpeed,t.CONFIG.animation.connectorsAnimation),this},show:function{this.hidden;this.hidden=!1,this.nodeDOM.style.visibility="visible";var e=(this.Tree,{left:this.X,top:this.Y,opacity:1}),i=this.getTreeConfig;return t?t(this.nodeDOM).animate(e,i.animation.nodeSpeed,i.animation.nodeAnimation,function{this.style.overflow=""}):(this.nodeDOM.style.transition="all "+i.animation.nodeSpeed+"ms ease",this.nodeDOM.style.transitionProperty="opacity, left, top",this.nodeDOM.style.left=e.left+"px",this.nodeDOM.style.top=e.top+"px",this.nodeDOM.style.opacity=e.opacity,this.nodeDOM.style.overflow=""),this.lineThroughMe&&this.getTree.animatePath(this.lineThroughMe,this.pathStringThrough),this},showConnector:function{var t=this.Tree,e=t.connectionStore[this.id];return e&&e.animate({opacity:1},t.CONFIG.animation.connectorsSpeed,t.CONFIG.animation.connectorsAnimation),this}},s.prototype.createGeometry=function(e){if(0===this.id&&e.CONFIG.hideRootNode)return this.width=0,void(this.height=0);var i,n=e.drawArea,r=document.createElement(this.link.href?"a":"div");if(r.className=this.pseudo?"pseudo":s.CONFIG.nodeHTMLclass,this.nodeHTMLclass&&!this.pseudo&&(r.className+=" "+this.nodeHTMLclass),this.nodeHTMLid&&(r.id=this.nodeHTMLid),this.link.href&&(r.href=this.link.href,r.target=this.link.target),t?t(r).data("treenode",this):r.data={treenode:this},!this.pseudo){if(this.nodeInnerHTML)if("#"===this.nodeInnerHTML.charAt(0)){var o=document.getElementById(this.nodeInnerHTML.substring(1));o?(r=o.cloneNode(!0),r.id+="-clone",r.className+=" node"):r.innerHTML=" Wrong ID selector "}else r.innerHTML=this.nodeInnerHTML;else if(this.image&&(i=document.createElement("img"),i.src=this.image,r.appendChild(i)),this.text)for(var h in this.text)if(s.CONFIG.textClass[h]){var a=document.createElement(this.text[h].href?"a":"p");this.text[h].href&&(a.href=this.text[h].href,this.text[h].target&&(a.target=this.text[h].target)),a.className=s.CONFIG.textClass[h],a.appendChild(document.createTextNode(this.text[h].val?this.text[h].val:this.text[h]instanceof Object?"'val' param missing!":this.text[h])),r.appendChild(a)}(this.collapsed||this.collapsable&&this.childrenCount&&!this.stackParentId)&&this.createSwitchGeometry(e,r)}e.CONFIG.callback.onCreateNode.apply(e,[this,r]),n.appendChild(r),this.width=r.offsetWidth,this.height=r.offsetHeight,this.nodeDOM=r,e.imageLoader.processNode(this)},s.prototype.createSwitchGeometry=function(t,i){i=i||this.nodeDOM;var n=e.findEl(".collapse-switch",!0,i);return n||(n=document.createElement("a"),n.className="collapse-switch",i.appendChild(n),this.addSwitchEvent(n),this.collapsed&&(i.className+=" collapsed"),t.CONFIG.callback.onCreateNodeCollapseSwitch.apply(t,[this,i,n])),n},r.CONFIG={maxDepth:100,rootOrientation:"NORTH",nodeAlign:"CENTER",levelSeparation:30,siblingSeparation:30,subTeeSeparation:30,hideRootNode:!1,animateOnInit:!1,animateOnInitDelay:500,padding:15,scrollbar:"native",connectors:{type:"curve",style:{stroke:"black"},stackIndent:15},node:{link:{target:"_self"}},animation:{nodeSpeed:450,nodeAnimation:"linear",connectorsSpeed:450,connectorsAnimation:"linear"},callback:{onCreateNode:function(t,e){},onCreateNodeCollapseSwitch:function(t,e,i){},onAfterAddNode:function(t,e,i){},onBeforeAddNode:function(t,e){},onAfterPositionNode:function(t,e,i,n){},onBeforePositionNode:function(t,e,i,n){},onToggleCollapseFinished:function(t,e){},onAfterClickCollapseSwitch:function(t,e){},onBeforeClickCollapseSwitch:function(t,e){},onTreeLoaded:function(t){}}},s.CONFIG={nodeHTMLclass:"node",textClass:{name:"node-name",title:"node-title",desc:"node-desc",contact:"node-contact"}};var h={make:function(t){var e,i=t.length;for(this.jsonStructure={chart:null,nodeStructure:null};i--;)e=t[i],e.hasOwnProperty("container")?this.jsonStructure.chart=e:e.hasOwnProperty("parent")||e.hasOwnProperty("container")||(this.jsonStructure.nodeStructure=e,e.myID=this.getID);return this.findChildren(t),this.jsonStructure},findChildren:function(t){for(var e=[0];e.length;){for(var i=e.pop,n=this.findNode(this.jsonStructure.nodeStructure,i),r=0,o=t.length,s=[];r<o;r++){var h=t[r];h.parent&&h.parent.myID==i&&(h.myID=this.getID,delete h.parent,s.push(h),e.push(h.myID))}s.length&&(n.children=s)}},findNode:function(t,e){var i,n;if(t.myID===e)return t;if(t.children)for(i=t.children.length;i--;)if(n=this.findNode(t.children[i],e))return n},getID:function{var t=0;return function{return t++}}},a=function(e,i,r){e instanceof Array&&(e=h.make(e)),r&&(t=r),this.tree=n.createTree(e),this.tree.positionTree(i)};a.prototype.destroy=function{n.destroy(this.tree.id)},window.Treant=a}; //# sourceMappingURL=Treant.min.js.map

//-- //- Skilltree code -

/* html class for wikitable: sktree = skdata = a wikitable containing data, you can have multiple of them. they need to have the same format */ function createBaseConfig{ var baseconfig = { rootOrientation: 'NORTH', // NORTH || EAST || WEST || SOUTH hideRootNode: true, // levelSeparation: 30, siblingSeparation:  40, subTeeSeparation:   30, connectors: { type: "step", style: { 'stroke': '#bbb', "stroke-width": 2

}       }

}	return baseconfig; }

function acallbackui(attr) {		console.log(attr); console.log(attr.nodeDB.db[1]); };

function getImage(e){ out = $(e).find("img").first; out = $(out).attr("src"); return out; } function getName(n){ var out = $(n).text; out = out.trim; return out; } function getPreconditions(e){ var out = []; $(e).find("div > a").each(function{		 var txt = $(this).text;		 if(txt != null && txt != ""){			out.push(txt.trim);		 }	 });

return out; } function parseLine(e){

console.log(e); var skill = new Object; skill['name'] = getName(e.children[0]); var txt = new Object; txt.name = skill['name']; skill['text'] = txt; //skill['text'].name = getName(namevalue); //skill['text'].skillpoints = e.children[3]; //skill['descr'] = e.children[1]; //skill['text'].unlocks = $(e).children[3]; skill['image'] = getImage(e.children[0]); skill['precondition'] = getPreconditions(e.children[4]); //skill['children'] = [] return skill; }; function loadTableContent(c,root){ var skills = new Object; var out = []; var find = $("."+c).find("tbody > tr"); $(find).each(function (e,d) {		if ( $(this).children.first.is( "td" ) ) {			var skill = parseLine(d);			skills[skill.name] = skill;

}	});	for(var sk in skills){			if(skills[sk].precondition.length == 0){				skills[sk]['parent'] = root;			}else{				skills[sk]['parent'] = skills[skills[sk].precondition[0]];			}			out.push(skills[sk]);	}	console.log(out);	return out; }; function createTree(c){	  var config = createBaseConfig;		config['container'] = "#" + c;	    var root = {};		var settings = [config,root];		var ext = loadTableContent(c,root);		settings = settings.concat(ext);		return new Treant(settings,acallbackui);

} $('document').ready(function{	$('[class*=" sktree-"]').each(function { var treeClass = "" classes = $(this).attr('class').split(" "); for(var c in classes){ if(classes[c].includes("sktree-")){ createTree(classes[c]); }		}	});	//var mytree = new Treant(ALTERNATIVE);	   $( function { $( "#tabs" ).tabs; } ); });

//--