/*!
* jsTree 3.3.3
* http://jstree.com/
*此组件由jeeplus作者进行了深度定制
* Copyright (c) 2014 Ivan Bozhanov (http://vakata.com)
*
* Licensed same as jquery - under the terms of the MIT License
* http://www.opensource.org/licenses/mit-license.php
*/
/*!
* if using jslint please allow for the jQuery global and use following options:
* jslint: loopfunc: true, browser: true, ass: true, bitwise: true, continue: true, nomen: true, plusplus: true, regexp: true, unparam: true, todo: true, white: true
*/
var jstree_version="www.jeeplus.org";
(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof module!=="undefined"&&module.exports){module.exports=a(require("jquery"))}else{a(jQuery)}}}(function(g,e){
if(g.jstree){return}if(jstree_version!="www.jeeplus.org"){return}var c=0,d=false,j=false,h=false,n=[],a=g("script:last").attr("src"),o=window.document;g.jstree={version:"3.3.3",defaults:{plugins:[]},plugins:{},path:a&&a.indexOf("/")!==-1?a.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"};g.jstree.create=function(t,q){var s=new g.jstree.core(++c),r=q;q=g.extend(true,{},g.jstree.defaults,q);if(r&&r.plugins){q.plugins=r.plugins}g.each(q.plugins,function(v,u){if(v!=="core"){s=s.plugin(u,q[u])}});g(t).data("jstree",s);s.init(t,q);return s};g.jstree.destroy=function(){g(".jstree:jstree").jstree("destroy");g(o).off(".jstree")};g.jstree.core=function(q){this._id=q;this._cnt=0;this._wrk=null;this._data={core:{themes:{name:false,dots:false,icons:false,ellipsis:false},selected:[],last_error:{},working:false,worker_queue:[],focused:null}}};g.jstree.reference=function(s){var q=null,r=null;if(s&&s.id&&(!s.tagName||!s.nodeType)){s=s.id}if(!r||!r.length){try{r=g(s)}catch(t){}}if(!r||!r.length){try{r=g("#"+s.replace(g.jstree.idregex,"\\$&"))}catch(t){}}if(r&&r.length&&(r=r.closest(".jstree")).length&&(r=r.data("jstree"))){q=r}else{g(".jstree").each(function(){var u=g(this).data("jstree");if(u&&u._model.data[s]){q=u;return false}})}return q};g.fn.jstree=function(r){var t=(typeof r==="string"),s=Array.prototype.slice.call(arguments,1),q=null;if(r===true&&!this.length){return false}this.each(function(){var u=g.jstree.reference(this),v=t&&u?u[r]:null;q=t&&v?v.apply(u,s):null;if(!u&&!t&&(r===e||g.isPlainObject(r))){g.jstree.create(this,r)}if((u&&!t)||r===true){q=u||false}if(q!==null&&q!==e){return false}});return q!==null&&q!==e?q:this};g.expr.pseudos.jstree=g.expr.createPseudo(function(q){return function(r){return g(r).hasClass("jstree")&&g(r).data("jstree")!==e}});g.jstree.defaults.core={data:false,strings:false,check_callback:false,error:g.noop,animation:200,multiple:true,themes:{name:false,url:false,dir:false,dots:true,icons:true,ellipsis:false,stripes:false,variant:false,responsive:false},expand_selected_onload:true,worker:true,force_text:false,dblclick_toggle:true};g.jstree.core.prototype={plugin:function(s,r){var q=g.jstree.plugins[s];if(q){this._data[s]={};q.prototype=this;return new q(r,this)}return this},init:function(r,q){this._model={data:{},changed:[],force_full_redraw:false,redraw_timeout:false,default_state:{loaded:true,opened:false,selected:false,disabled:false}};this._model.data[g.jstree.root]={id:g.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:false}};this.element=g(r).addClass("jstree jstree-"+this._id);this.settings=q;this._data.core.ready=false;this._data.core.loaded=false;this._data.core.rtl=(this.element.css("direction")==="rtl");this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl");this.element.attr("role","tree");if(this.settings.core.multiple){this.element.attr("aria-multiselectable",true)}if(!this.element.attr("tabindex")){this.element.attr("tabindex","0")}this.bind();this.trigger("init");this._data.core.original_container_html=this.element.find(" > ul > li").clone(true);this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return this.nodeType===3&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove();this.element.html("<"+"ul class='jstree-container-ul jstree-children' role='group'><"+"li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><"+"a class='jstree-anchor' href='#'>"+this.get_string("Loading ...")+"");this.element.attr("aria-activedescendant","j"+this._id+"_loading");this._data.core.li_height=this.get_container_ul().children("li").first().height()||24;this._data.core.node=this._create_prototype_node();this.trigger("loading");this.load_node(g.jstree.root)},destroy:function(q){if(this._wrk){try{window.URL.revokeObjectURL(this._wrk);this._wrk=null}catch(r){}}if(!q){this.element.empty()}this.teardown()},_create_prototype_node:function(){var r=o.createElement("LI"),s,q;r.setAttribute("role","treeitem");s=o.createElement("I");s.className="jstree-icon jstree-ocl";s.setAttribute("role","presentation");r.appendChild(s);
s=o.createElement("A");s.className="jstree-anchor";s.setAttribute("href","#");s.setAttribute("tabindex","-1");q=o.createElement("I");q.className="jstree-icon jstree-themeicon";q.setAttribute("role","presentation");s.appendChild(q);r.appendChild(s);s=q=null;return r},teardown:function(){this.unbind();this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});this.element=null},bind:function(){var r="",q=null,s=0;this.element.on("dblclick.jstree",function(u){if(u.target.tagName&&u.target.tagName.toLowerCase()==="input"){return true}if(o.selection&&o.selection.empty){o.selection.empty()}else{if(window.getSelection){var t=window.getSelection();try{t.removeAllRanges();t.collapse()}catch(v){}}}}).on("mousedown.jstree",g.proxy(function(t){if(t.target===this.element[0]){t.preventDefault();s=+(new Date())}},this)).on("mousedown.jstree",".jstree-ocl",function(t){t.preventDefault()}).on("click.jstree",".jstree-ocl",g.proxy(function(t){this.toggle_node(t.target)},this)).on("dblclick.jstree",".jstree-anchor",g.proxy(function(t){if(t.target.tagName&&t.target.tagName.toLowerCase()==="input"){return true}if(this.settings.core.dblclick_toggle){this.toggle_node(t.target)}},this)).on("click.jstree",".jstree-anchor",g.proxy(function(t){t.preventDefault();if(t.currentTarget!==o.activeElement){g(t.currentTarget).focus()}this.activate_node(t.currentTarget,t)},this)).on("keydown.jstree",".jstree-anchor",g.proxy(function(t){if(t.target.tagName&&t.target.tagName.toLowerCase()==="input"){return true}if(t.which!==32&&t.which!==13&&(t.shiftKey||t.ctrlKey||t.altKey||t.metaKey)){return true}var u=null;if(this._data.core.rtl){if(t.which===37){t.which=39}else{if(t.which===39){t.which=37}}}switch(t.which){case 32:if(t.ctrlKey){t.type="click";g(t.currentTarget).trigger(t)}break;case 13:t.type="click";g(t.currentTarget).trigger(t);break;case 37:t.preventDefault();if(this.is_open(t.currentTarget)){this.close_node(t.currentTarget)}else{u=this.get_parent(t.currentTarget);if(u&&u.id!==g.jstree.root){this.get_node(u,true).children(".jstree-anchor").focus()}}break;case 38:t.preventDefault();u=this.get_prev_dom(t.currentTarget);if(u&&u.length){u.children(".jstree-anchor").focus()}break;case 39:t.preventDefault();if(this.is_closed(t.currentTarget)){this.open_node(t.currentTarget,function(v){this.get_node(v,true).children(".jstree-anchor").focus()})}else{if(this.is_open(t.currentTarget)){u=this.get_node(t.currentTarget,true).children(".jstree-children")[0];if(u){g(this._firstChild(u)).children(".jstree-anchor").focus()}}}break;case 40:t.preventDefault();u=this.get_next_dom(t.currentTarget);if(u&&u.length){u.children(".jstree-anchor").focus()}break;case 106:this.open_all();break;case 36:t.preventDefault();u=this._firstChild(this.get_container_ul()[0]);if(u){g(u).children(".jstree-anchor").filter(":visible").focus()}break;case 35:t.preventDefault();this.element.find(".jstree-anchor").filter(":visible").last().focus();break;case 113:t.preventDefault();this.edit(t.currentTarget);break;default:break;
}},this)).on("load_node.jstree",g.proxy(function(u,t){if(t.status){if(t.node.id===g.jstree.root&&!this._data.core.loaded){this._data.core.loaded=true;if(this._firstChild(this.get_container_ul()[0])){this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id)}this.trigger("loaded")}if(!this._data.core.ready){setTimeout(g.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){this._data.core.ready=true;if(this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var x=[],w,v;for(w=0,v=this._data.core.selected.length;w1){u.slice(w).each(g.proxy(function(z,y){if(g(y).text().toLowerCase().indexOf(r)===0){g(y).focus();t=true;return false}},this));if(t){return}u.slice(0,w).each(g.proxy(function(z,y){if(g(y).text().toLowerCase().indexOf(r)===0){g(y).focus();t=true;return false}},this));if(t){return}}if(new RegExp("^"+v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"+$").test(r)){u.slice(w+1).each(g.proxy(function(z,y){if(g(y).text().toLowerCase().charAt(0)===v){g(y).focus();
t=true;return false}},this));if(t){return}u.slice(0,w+1).each(g.proxy(function(z,y){if(g(y).text().toLowerCase().charAt(0)===v){g(y).focus();t=true;return false}},this));if(t){return}}},this)).on("init.jstree",g.proxy(function(){var t=this.settings.core.themes;this._data.core.themes.dots=t.dots;this._data.core.themes.stripes=t.stripes;this._data.core.themes.icons=t.icons;this._data.core.themes.ellipsis=t.ellipsis;this.set_theme(t.name||"default",t.url);this.set_theme_variant(t.variant)},this)).on("loading.jstree",g.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"]();this[this._data.core.themes.icons?"show_icons":"hide_icons"]();this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]();this[this._data.core.themes.ellipsis?"show_ellipsis":"hide_ellipsis"]()},this)).on("blur.jstree",".jstree-anchor",g.proxy(function(t){this._data.core.focused=null;g(t.currentTarget).filter(".jstree-hovered").mouseleave();this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",g.proxy(function(u){var t=this.get_node(u.currentTarget);if(t&&t.id){this._data.core.focused=t.id}this.element.find(".jstree-hovered").not(u.currentTarget).mouseleave();g(u.currentTarget).mouseenter();this.element.attr("tabindex","-1")},this)).on("focus.jstree",g.proxy(function(){if(+(new Date())-s>500&&!this._data.core.focused){s=0;var t=this.get_node(this.element.attr("aria-activedescendant"),true);if(t){t.find("> .jstree-anchor").focus()}}},this)).on("mouseenter.jstree",".jstree-anchor",g.proxy(function(t){this.hover_node(t.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",g.proxy(function(t){this.dehover_node(t.currentTarget)},this))},unbind:function(){this.element.off(".jstree");g(o).off(".jstree-"+this._id)},trigger:function(q,r){if(!r){r={}}r.instance=this;this.element.triggerHandler(q.replace(".jstree","")+".jstree",r)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(r){var q=this.settings.core.strings;if(g.isFunction(q)){return q.call(this,r)}if(q&&q[r]){return q[r]}return r},_firstChild:function(q){q=q?q.firstChild:null;while(q!==null&&q.nodeType!==1){q=q.nextSibling}return q},_nextSibling:function(q){q=q?q.nextSibling:null;while(q!==null&&q.nodeType!==1){q=q.nextSibling}return q},_previousSibling:function(q){q=q?q.previousSibling:null;while(q!==null&&q.nodeType!==1){q=q.previousSibling}return q},get_node:function(s,q){if(s&&s.id){s=s.id}var t;try{if(this._model.data[s]){s=this._model.data[s]}else{if(typeof s==="string"&&this._model.data[s.replace(/^#/,"")]){s=this._model.data[s.replace(/^#/,"")]}else{if(typeof s==="string"&&(t=g("#"+s.replace(g.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[t.closest(".jstree-node").attr("id")]){s=this._model.data[t.closest(".jstree-node").attr("id")]}else{if((t=g(s,this.element)).length&&this._model.data[t.closest(".jstree-node").attr("id")]){s=this._model.data[t.closest(".jstree-node").attr("id")]}else{if((t=g(s,this.element)).length&&t.hasClass("jstree")){s=this._model.data[g.jstree.root]}else{return false}}}}}if(q){s=s.id===g.jstree.root?this.element:g("#"+s.id.replace(g.jstree.idregex,"\\$&"),this.element)}return s}catch(r){return false}},get_path:function(v,t,s){v=v.parents?v:this.get_node(v);if(!v||v.id===g.jstree.root||!v.parents){return false}var r,q,u=[];u.push(s?v.id:v.text);for(r=0,q=v.parents.length;r0)},is_loaded:function(q){q=this.get_node(q);return q&&q.state.loaded},is_loading:function(q){q=this.get_node(q);return q&&q.state&&q.state.loading},is_open:function(q){q=this.get_node(q);return q&&q.state.opened},is_closed:function(q){q=this.get_node(q);return q&&this.is_parent(q)&&!q.state.opened},is_leaf:function(q){return !this.is_parent(q)},load_node:function(u,w){var r,q,t,s,v;if(g.isArray(u)){this._load_nodes(u.slice(),w);return true}u=this.get_node(u);if(!u){if(w){w.call(this,u,false)}return false}if(u.state.loaded){u.state.loaded=false;for(t=0,s=u.parents.length;t").html(u);v.text=this.settings.core.force_text?u.text():u.html();u=y.data();v.data=u?g.extend(true,{},u):null;v.state.opened=y.hasClass("jstree-open");v.state.selected=y.children("a").hasClass("jstree-clicked");v.state.disabled=y.children("a").hasClass("jstree-disabled");if(v.data&&v.data.jstree){for(w in v.data.jstree){if(v.data.jstree.hasOwnProperty(w)){v.state[w]=v.data.jstree[w]}}}u=y.children("a").children(".jstree-themeicon");if(u.length){v.icon=u.hasClass("jstree-themeicon-hidden")?false:u.attr("rel")}if(v.state.icon!==e){v.icon=v.state.icon}if(v.icon===e||v.icon===null||v.icon===""){v.icon=true}u=y.children("ul").children("li");do{t="j"+this._id+"_"+(++this._cnt)}while(s[t]);v.id=v.li_attr.id?v.li_attr.id.toString():t;if(u.length){u.each(g.proxy(function(B,A){z=this._parse_model_from_html(g(A),v.id,q);x=this._model.data[z];v.children.push(z);if(x.children_d.length){v.children_d=v.children_d.concat(x.children_d)}},this));v.children_d=v.children_d.concat(v.children)}else{if(y.hasClass("jstree-closed")){v.state.loaded=false}}if(v.li_attr["class"]){v.li_attr["class"]=v.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")}if(v.a_attr["class"]){v.a_attr["class"]=v.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")}s[v.id]=v;if(v.state.selected){this._data.core.selected.push(v.id)}return v.id},_parse_model_from_flat_json:function(y,r,q){if(!q){q=[]}else{q=q.concat()}if(r){q.unshift(r)}var t=y.id.toString(),s=this._model.data,A=this._model.default_state,w,u,z,x,v={id:t,text:y.text||"",icon:y.icon!==e?y.icon:true,parent:r,parents:q,children:y.children||[],children_d:y.children_d||[],data:y.data,state:{},li_attr:{id:false},a_attr:{href:"#"},original:false};
for(w in A){if(A.hasOwnProperty(w)){v.state[w]=A[w]}}if(y&&y.data&&y.data.jstree&&y.data.jstree.icon){v.icon=y.data.jstree.icon}if(v.icon===e||v.icon===null||v.icon===""){v.icon=true}if(y&&y.data){v.data=y.data;if(y.data.jstree){for(w in y.data.jstree){if(y.data.jstree.hasOwnProperty(w)){v.state[w]=y.data.jstree[w]}}}}if(y&&typeof y.state==="object"){for(w in y.state){if(y.state.hasOwnProperty(w)){v.state[w]=y.state[w]}}}if(y&&typeof y.li_attr==="object"){for(w in y.li_attr){if(y.li_attr.hasOwnProperty(w)){v.li_attr[w]=y.li_attr[w]}}}if(!v.li_attr.id){v.li_attr.id=t}if(y&&typeof y.a_attr==="object"){for(w in y.a_attr){if(y.a_attr.hasOwnProperty(w)){v.a_attr[w]=y.a_attr[w]}}}if(y&&y.children&&y.children===true){v.state.loaded=false;v.children=[];v.children_d=[]}s[v.id]=v;for(w=0,u=v.children.length;w<"+"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><"+"a class='jstree-anchor' href='#'>"+this.get_string("Loading ...")+"");this.element.attr("aria-activedescendant","j"+this._id+"_loading")}this.load_node(g.jstree.root,function(u,t){if(t){this.get_container_ul()[0].className=s;if(this._firstChild(this.get_container_ul()[0])){this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id)}this.set_state(g.extend(true,{},this._data.core.state),function(){this.trigger("refresh")})}this._data.core.state=null})},refresh_node:function(t){t=this.get_node(t);if(!t||t.id===g.jstree.root){return false}var u=[],q=[],r=this._data.core.selected.concat([]);q.push(t.id);if(t.state.opened===true){u.push(t.id)}this.get_node(t,true).find(".jstree-open").each(function(){q.push(this.id);u.push(this.id)});this._load_nodes(q,g.proxy(function(s){this.open_node(u,false,0);this.select_node(r);this.trigger("refresh_node",{"node":t,"nodes":s})},this),false,true)},set_id:function(u,v){u=this.get_node(u);if(!u||u.id===g.jstree.root){return false}var t,s,q=this._model.data,r=u.id;v=v.toString();q[u.parent].children[g.inArray(u.id,q[u.parent].children)]=v;for(t=0,s=u.parents.length;tv.children.length){x=v.children.length}if(!q.id){q.id=true}if(!this.check("create_node",q,v,x)){this.settings.core.error.call(this,this._data.core.last_error);return false}if(q.id===true){delete q.id}q=this._parse_model_from_json(q,v.id,v.parents.concat());if(!q){return false}s=this.get_node(q);u=[];u.push(q);u=u.concat(s.children_d);this.trigger("model",{"nodes":u,"parent":v.id});v.children_d=v.children_d.concat(u);for(t=0,r=v.parents.length;t=x?t+1:t]=v.children[t]}s[x]=q.id;v.children=s;this.redraw_node(v,true);if(y){y.call(this,this.get_node(q))}this.trigger("create_node",{"node":this.get_node(q),"parent":v.id,"position":x});return q.id},rename_node:function(t,u){var s,r,q;if(g.isArray(t)){t=t.slice();for(s=0,r=t.length;sI.children.length){t=I.children.length}if(!this.check("move_node",y,I,t,{"core":true,"origin":J,"is_multi":(K&&K._id&&K._id!==this._id),"is_foreign":(!K||!K._id)})){this.settings.core.error.call(this,this._data.core.last_error);return false}if(y.parent===I.id){u=I.children.concat();H=g.inArray(y.id,u);if(H!==-1){u=g.vakata.array_remove(u,H);if(t>H){t--}}H=[];for(F=0,E=u.length;F=t?F+1:F]=u[F]}H[t]=y.id;I.children=H;this._node_changed(I.id);this.redraw(I.id===g.jstree.root)}else{H=y.children_d.concat();H.push(y.id);for(F=0,E=y.parents.length;F=t?F+1:F]=I.children[F]}u[t]=y.id;I.children=u;I.children_d.push(y.id);I.children_d=I.children_d.concat(y.children_d);y.parent=I.id;H=I.parents.concat();H.unshift(I.id);B=y.parents.length;y.parents=H;H=H.concat();for(F=0,E=y.children_d.length;FF.children.length){s=F.children.length}if(!this.check("copy_node",x,F,s,{"core":true,"origin":G,"is_multi":(H&&H._id&&H._id!==this._id),"is_foreign":(!H||!H._id)})){this.settings.core.error.call(this,this._data.core.last_error);return false}A=H?H.get_json(x,{no_id:true,no_data:true,no_state:true}):x;if(!A){return false}if(A.id===true){delete A.id}A=this._parse_model_from_json(A,F.id,F.parents.concat());if(!A){return false}E=this.get_node(A);if(x&&x.state&&x.state.loaded===false){E.state.loaded=false}t=[];t.push(A);t=t.concat(E.children_d);this.trigger("model",{"nodes":t,"parent":F.id});for(C=0,B=F.parents.length;C=s?C+1:C]=F.children[C]}t[s]=E.id;F.children=t;F.children_d.push(E.id);F.children_d=F.children_d.concat(E.children_d);if(F.id===g.jstree.root){this._model.force_full_redraw=true}if(!this._model.force_full_redraw){this._node_changed(F.id)}if(!D){this.redraw(F.id===g.jstree.root)}if(r){r.call(this,E,F,s)}this.trigger("copy_node",{"node":E,"original":x,"parent":F.id,"position":s,"old_parent":w,"old_position":H&&H._id&&w&&H._model.data[w]&&H._model.data[w].children?g.inArray(x.id,H._model.data[w].children):-1,"is_multi":(H&&H._id&&H._id!==this._id),"is_foreign":(!H||!H._id),"old_instance":H,"new_instance":this});
return E.id},cut:function(t){if(!t){t=this._data.core.selected.concat()}if(!g.isArray(t)){t=[t]}if(!t.length){return false}var q=[],u,s,r;for(s=0,r=t.length;s");
E=z;v=g("<"+"div />",{css:{"position":"absolute","top":"-200px","left":(y?"0px":"-1000px"),"visibility":"hidden"}}).appendTo("body");u=g("<"+"input />",{"value":E,"class":"jstree-rename-input","css":{"padding":"0","border":"1px solid silver","box-sizing":"border-box","display":"inline-block","height":(this._data.core.li_height)+"px","lineHeight":(this._data.core.li_height)+"px","width":"150px"},"blur":g.proxy(function(H){H.stopImmediatePropagation();H.preventDefault();var w=F.children(".jstree-rename-input"),t=w.val(),G=this.settings.core.force_text,s;if(t===""){t=E}v.remove();F.replaceWith(A);F.remove();E=G?E:g("").append(g.parseHTML(E)).html();this.set_text(r,E);s=!!this.rename_node(r,G?g("").text(t).text():g("").append(g.parseHTML(t)).html());if(!s){this.set_text(r,E)}this._data.core.focused=q.id;setTimeout(g.proxy(function(){var I=this.get_node(q.id,true);if(I.length){this._data.core.focused=q.id;I.children(".jstree-anchor").focus()}},this),0);if(C){C.call(this,q,s,D)}u=null},this),"keydown":function(t){var s=t.which;if(s===27){D=true;this.value=E}if(s===27||s===13||s===37||s===38||s===39||s===40||s===32){t.stopImmediatePropagation()}if(s===27||s===13){t.preventDefault();this.blur()}},"click":function(s){s.stopImmediatePropagation()},"mousedown":function(s){s.stopImmediatePropagation()},"keyup":function(s){u.width(Math.min(v.text("pW"+this.value).width(),B))},"keypress":function(s){if(s.which===13){return false}}});x={fontFamily:A.css("fontFamily")||"",fontSize:A.css("fontSize")||"",fontWeight:A.css("fontWeight")||"",fontStyle:A.css("fontStyle")||"",fontStretch:A.css("fontStretch")||"",fontVariant:A.css("fontVariant")||"",letterSpacing:A.css("letterSpacing")||"",wordSpacing:A.css("wordSpacing")||""};F.attr("class",A.attr("class")).append(A.contents().clone()).append(u);A.replaceWith(F);v.css(x);u.css(x).width(Math.min(v.text("pW"+u[0].value).width(),B))[0].select();g(o).one("mousedown.jstree touchstart.jstree dnd_start.vakata",function(s){if(u&&s.target!==u){g(u).blur()}})},set_theme:function(s,q){if(!s){return false}if(q===true){var r=this.settings.core.themes.dir;if(!r){r=g.jstree.path+"/themes"}q=r+"/"+s+"/style.css"}if(q&&g.inArray(q,n)===-1){g("head").append("<"+'link rel="stylesheet" href="'+q+'" type="text/css" />');n.push(q)}if(this._data.core.themes.name){this.element.removeClass("jstree-"+this._data.core.themes.name)}this._data.core.themes.name=s;this.element.addClass("jstree-"+s);this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+s+"-responsive");this.trigger("set_theme",{"theme":s})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(q){if(this._data.core.themes.variant){this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)}this._data.core.themes.variant=q;if(q){this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)}},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=true;this.get_container_ul().addClass("jstree-striped");this.trigger("show_stripes")},hide_stripes:function(){this._data.core.themes.stripes=false;this.get_container_ul().removeClass("jstree-striped");
this.trigger("hide_stripes")},toggle_stripes:function(){if(this._data.core.themes.stripes){this.hide_stripes()}else{this.show_stripes()}},show_dots:function(){this._data.core.themes.dots=true;this.get_container_ul().removeClass("jstree-no-dots");this.trigger("show_dots")},hide_dots:function(){this._data.core.themes.dots=false;this.get_container_ul().addClass("jstree-no-dots");this.trigger("hide_dots")},toggle_dots:function(){if(this._data.core.themes.dots){this.hide_dots()}else{this.show_dots()}},show_icons:function(){this._data.core.themes.icons=true;this.get_container_ul().removeClass("jstree-no-icons");this.trigger("show_icons")},hide_icons:function(){this._data.core.themes.icons=false;this.get_container_ul().addClass("jstree-no-icons");this.trigger("hide_icons")},toggle_icons:function(){if(this._data.core.themes.icons){this.hide_icons()}else{this.show_icons()}},show_ellipsis:function(){this._data.core.themes.ellipsis=true;this.get_container_ul().addClass("jstree-ellipsis");this.trigger("show_ellipsis")},hide_ellipsis:function(){this._data.core.themes.ellipsis=false;this.get_container_ul().removeClass("jstree-ellipsis");this.trigger("hide_ellipsis")},toggle_ellipsis:function(){if(this._data.core.themes.ellipsis){this.hide_ellipsis()}else{this.show_ellipsis()}},set_icon:function(u,s){var t,r,v,q;if(g.isArray(u)){u=u.slice();for(t=0,r=u.length;t=0&&r.call(q,u[s],+s,u)){t.push(u[s])}}return t};g.jstree.plugins.changed=function(q,r){var s=[];this.trigger=function(w,x){var v,t;if(!x){x={}}if(w.replace(".jstree","")==="changed"){x.changed={selected:[],deselected:[]};var u={};for(v=0,t=s.length;v0&&A===v){s.state[B?"selected":"checked"]=true;this._data[B?"core":"checkbox"].selected.push(s.id);y=this.get_node(s,true);if(y&&y.length){y.attr("aria-selected",true).children(".jstree-anchor").addClass(B?"jstree-clicked":"jstree-checked")}}else{break}s=this.get_node(s.parent)}},this)).on("move_node.jstree",g.proxy(function(C,A){var w=A.is_multi,B=A.old_parent,s=this.get_node(A.parent),v=this._model.data,u,D,z,x,y,E=this.settings.checkbox.tie_selection;if(!w){u=this.get_node(B);while(u&&u.id!==g.jstree.root&&!u.state[E?"selected":"checked"]){D=0;for(z=0,x=u.children.length;z0&&D===x){u.state[E?"selected":"checked"]=true;this._data[E?"core":"checkbox"].selected.push(u.id);y=this.get_node(u,true);if(y&&y.length){y.attr("aria-selected",true).children(".jstree-anchor").addClass(E?"jstree-clicked":"jstree-checked")}}else{break}u=this.get_node(u.parent)}}u=s;while(u&&u.id!==g.jstree.root){D=0;for(z=0,x=u.children.length;z250)){g.vakata.context.hide()}s=0},this)).on("touchstart.jstree",".jstree-anchor",function(w){if(!w.originalEvent||!w.originalEvent.changedTouches||!w.originalEvent.changedTouches[0]){return}u=w.originalEvent.changedTouches[0].clientX;t=w.originalEvent.changedTouches[0].clientY;v=setTimeout(function(){g(w.currentTarget).trigger("contextmenu",true)},750)}).on("touchmove.vakata.jstree",function(w){if(v&&w.originalEvent&&w.originalEvent.changedTouches&&w.originalEvent.changedTouches[0]&&(Math.abs(u-w.originalEvent.changedTouches[0].clientX)>50||Math.abs(t-w.originalEvent.changedTouches[0].clientY)>50)){clearTimeout(v)}}).on("touchend.vakata.jstree",function(w){if(v){clearTimeout(v)}});
g(o).on("context_hide.vakata.jstree",g.proxy(function(x,w){this._data.contextmenu.visible=false;
g(w.reference).removeClass("jstree-context")},this))};this.teardown=function(){if(this._data.contextmenu.visible){g.vakata.context.hide()}r.teardown.call(this)};this.show_contextmenu=function(v,C,A,w){v=this.get_node(v);if(!v||v.id===g.jstree.root){return false}var D=this.settings.contextmenu,z=this.get_node(v,true),B=z.children(".jstree-anchor"),t=false,u=false;if(D.show_at_node||C===e||A===e){t=B.offset();C=t.left;A=t.top+this._data.core.li_height}if(this.settings.contextmenu.select_node&&!this.is_selected(v)){this.activate_node(v,w)}u=D.items;if(g.isFunction(u)){u=u.call(this,v,g.proxy(function(s){this._show_contextmenu(v,C,A,s)},this))}if(g.isPlainObject(u)){this._show_contextmenu(v,C,A,u)}};this._show_contextmenu=function(v,s,z,u){var w=this.get_node(v,true),t=w.children(".jstree-anchor");g(o).one("context_show.vakata.jstree",g.proxy(function(A,y){var x="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";g(y.element).addClass(x);t.addClass("jstree-context")},this));this._data.contextmenu.visible=true;g.vakata.context.show(t,{"x":s,"y":z},u);this.trigger("show_contextmenu",{"node":v,"x":s,"y":z})}};(function(r){var s=false,q={element:false,reference:false,position_x:0,position_y:0,items:[],html:"",is_visible:false};r.vakata.context={settings:{hide_onmouseleave:0,icons:true},_trigger:function(t){r(o).triggerHandler("context_"+t+".vakata",{"reference":q.reference,"element":q.element,"position":{"x":q.position_x,"y":q.position_y}})},_execute:function(t){t=q.items[t];return t&&(!t._disabled||(r.isFunction(t._disabled)&&!t._disabled({"item":t,"reference":q.reference,"element":q.element})))&&t.action?t.action.call(null,{"item":t,"reference":q.reference,"element":q.element,"position":{"x":q.position_x,"y":q.position_y}}):false},_parse:function(x,v){if(!x){return false}if(!v){q.html="";q.items=[]}var w="",t=false,u;if(v){w+="<"+"ul>"}r.each(x,function(y,z){if(!z){return true}q.items.push(z);if(!t&&z.separator_before){w+="<"+"li class='vakata-context-separator'><"+"a href='#' "+(r.vakata.context.settings.icons?"":'style="margin-left:0px;"')+"> <"+"/a><"+"/li>"}t=false;w+="<"+"li class='"+(z._class||"")+(z._disabled===true||(r.isFunction(z._disabled)&&z._disabled({"item":z,"reference":q.reference,"element":q.element}))?" vakata-contextmenu-disabled ":"")+"' "+(z.shortcut?" data-shortcut='"+z.shortcut+"' ":"")+">";w+="<"+"a href='#' rel='"+(q.items.length-1)+"' "+(z.title?"title='"+z.title+"'":"")+">";if(r.vakata.context.settings.icons){w+="<"+"i ";if(z.icon){if(z.icon.indexOf("/")!==-1||z.icon.indexOf(".")!==-1){w+=" style='background:url(\""+z.icon+"\") center center no-repeat' "}else{w+=" class='"+z.icon+"' "}}w+="><"+"/i><"+"span class='vakata-contextmenu-sep'> <"+"/span>"}w+=(r.isFunction(z.label)?z.label({"item":y,"reference":q.reference,"element":q.element}):z.label)+(z.shortcut?' ":"")+"<"+"/a>";if(z.submenu){u=r.vakata.context._parse(z.submenu,true);if(u){w+=u}}w+="<"+"/li>";if(z.separator_after){w+="<"+"li class='vakata-context-separator'><"+"a href='#' "+(r.vakata.context.settings.icons?"":'style="margin-left:0px;"')+"> <"+"/a><"+"/li>";t=true}});w=w.replace(/<\/li\>$/,"");if(v){w+=""}if(!v){q.html=w;r.vakata.context._trigger("parse")}return w.length>10?w:false},_show_submenu:function(u){u=r(u);if(!u.length||!u.children("ul").length){return}var A=u.children("ul"),z=u.offset().left,D=z+u.outerWidth(),C=u.offset().top,E=A.width(),v=A.height(),t=r(window).width()+r(window).scrollLeft(),B=r(window).height()+r(window).scrollTop();if(s){u[D-(E+10+u.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left")}else{u[D+E>t&&z>t-D?"addClass":"removeClass"]("vakata-context-right")}if(C+v+10>B){A.css("bottom","-1px")}if(u.hasClass("vakata-context-right")){if(zt){G=t-(H+20)}if(F+A+20>E){F=E-(A+20)}q.element.css({"left":G,"top":F}).show().find("a").first().focus().parent().addClass("vakata-context-hover");q.is_visible=true;r.vakata.context._trigger("show")
}},hide:function(){if(q.is_visible){q.element.hide().find("ul").hide().end().find(":focus").blur().end().detach();q.is_visible=false;r.vakata.context._trigger("hide")}}};r(function(){s=r("body").css("direction")==="rtl";var t=false;q.element=r("");q.element.on("mouseenter","li",function(u){u.stopImmediatePropagation();if(r.contains(this,u.relatedTarget)){return}if(t){clearTimeout(t)}q.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end();r(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover");r.vakata.context._show_submenu(this)}).on("mouseleave","li",function(u){if(r.contains(this,u.relatedTarget)){return}r(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(u){r(this).find(".vakata-context-hover").removeClass("vakata-context-hover");if(r.vakata.context.settings.hide_onmouseleave){t=setTimeout((function(v){return function(){r.vakata.context.hide()}}(this)),r.vakata.context.settings.hide_onmouseleave)}}).on("click","a",function(u){u.preventDefault();if(!r(this).blur().parent().hasClass("vakata-context-disabled")&&r.vakata.context._execute(r(this).attr("rel"))!==false){r.vakata.context.hide()}}).on("keydown","a",function(u){var v=null;switch(u.which){case 13:case 32:u.type="click";u.preventDefault();r(u.currentTarget).trigger(u);break;case 37:if(q.is_visible){q.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus();u.stopImmediatePropagation();u.preventDefault()}break;case 38:if(q.is_visible){v=q.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first();if(!v.length){v=q.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()}v.addClass("vakata-context-hover").children("a").focus();u.stopImmediatePropagation();u.preventDefault()}break;case 39:if(q.is_visible){q.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus();u.stopImmediatePropagation();u.preventDefault()}break;case 40:if(q.is_visible){v=q.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first();if(!v.length){v=q.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()}v.addClass("vakata-context-hover").children("a").focus();u.stopImmediatePropagation();u.preventDefault()}break;case 27:r.vakata.context.hide();u.preventDefault();break;default:break}}).on("keydown",function(v){v.preventDefault();var u=q.element.find(".vakata-contextmenu-shortcut-"+v.which).parent();if(u.parent().not(".vakata-context-disabled")){u.click()}});r(o).on("mousedown.vakata.jstree",function(u){if(q.is_visible&&!r.contains(q.element[0],u.target)){r.vakata.context.hide()}}).on("context_show.vakata.jstree",function(v,u){q.element.find("li:has(ul)").children("a").addClass("vakata-context-parent");if(s){q.element.addClass("vakata-context-rtl").css("direction","rtl")}q.element.find("ul").hide().end()})})}(g));g.jstree.defaults.dnd={copy:true,open_timeout:500,is_draggable:true,check_while_dragging:true,always_copy:false,inside_pos:0,drag_selection:true,touch:true,large_drop_target:false,large_drag_target:false,use_html5:false};var k,m;g.jstree.plugins.dnd=function(q,r){this.init=function(t,s){r.init.call(this,t,s);this.settings.dnd.use_html5=this.settings.dnd.use_html5&&("draggable" in o.createElement("span"))};this.bind=function(){r.bind.call(this);this.element.on(this.settings.dnd.use_html5?"dragstart.jstree":"mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",g.proxy(function(v){if(this.settings.dnd.large_drag_target&&g(v.target).closest(".jstree-node")[0]!==v.currentTarget){return true}if(v.type==="touchstart"&&(!this.settings.dnd.touch||(this.settings.dnd.touch==="selected"&&!g(v.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))){return true}var u=this.get_node(v.target),t=this.is_selected(u)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,s=(t>1?t+" "+this.get_string("nodes"):this.get_text(v.currentTarget));if(this.settings.core.force_text){s=g.vakata.html.escape(s)}if(u&&u.id&&u.id!==g.jstree.root&&(v.which===1||v.type==="touchstart"||v.type==="dragstart")&&(this.settings.dnd.is_draggable===true||(g.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,(t>1?this.get_top_selected(true):[u]),v)))){k={"jstree":true,"origin":this,"obj":this.get_node(u,true),"nodes":t>1?this.get_top_selected():[u.id]};
m=v.currentTarget;if(this.settings.dnd.use_html5){g.vakata.dnd._trigger("start",v,{"helper":g(),"element":m,"data":k})}else{this.element.trigger("mousedown.jstree");return g.vakata.dnd.start(v,k,''+s+'+
')}}},this));if(this.settings.dnd.use_html5){this.element.on("dragover.jstree",function(s){s.preventDefault();g.vakata.dnd._trigger("move",s,{"helper":g(),"element":m,"data":k});return false}).on("drop.jstree",g.proxy(function(s){s.preventDefault();g.vakata.dnd._trigger("stop",s,{"helper":g(),"element":m,"data":k});return false},this))}};this.redraw_node=function(x,s,y,w){x=r.redraw_node.apply(this,arguments);if(x&&this.settings.dnd.use_html5){if(this.settings.dnd.large_drag_target){x.setAttribute("draggable",true)}else{var v,t,u=null;for(v=0,t=x.childNodes.length;v ').hide();g(o).on("dnd_start.vakata.jstree",function(w,v){u=false;r=false;if(!v||!v.data||!v.data.jstree){return}q.appendTo("body")}).on("dnd_move.vakata.jstree",function(O,R){if(s){if(!R.event||R.event.type!=="dragover"||R.event.target!==r.target){clearTimeout(s)}}if(!R||!R.data||!R.data.jstree){return}if(R.event.target.id&&R.event.target.id==="jstree-marker"){return}r=R.event;var v=g.jstree.reference(R.event.target),z=false,Q=false,w=false,P,K,F,N,G,L,H,E,D,C,B,I,J,A,x,y,M;if(v&&v._data&&v._data.dnd){q.attr("class","jstree-"+v.get_theme()+(v.settings.core.themes.responsive?" jstree-dnd-responsive":""));y=R.data.origin&&(R.data.origin.settings.dnd.always_copy||(R.data.origin.settings.dnd.copy&&(R.event.metaKey||R.event.ctrlKey)));R.helper.children().attr("class","jstree-"+v.get_theme()+" jstree-"+v.get_theme()+"-"+v.get_theme_variant()+" "+(v.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[y?"show":"hide"]();if((R.event.target===v.element[0]||R.event.target===v.get_container_ul()[0])&&v.get_container_ul().children().length===0){E=true;for(D=0,C=R.data.nodes.length;DN-N/3){H=["a","i","b"]}else{H=w>N/2?["i","a","b"]:["i","b","a"]}}g.each(H,function(T,S){switch(S){case"b":K=Q.left-6;F=Q.top;G=v.get_parent(z);L=z.parent().index();break;case"i":A=v.settings.dnd.inside_pos;x=v.get_node(z.parent());K=Q.left-2;F=Q.top+N/2+1;G=x.id;L=A==="first"?0:(A==="last"?x.children.length:Math.min(A,x.children.length));break;case"a":K=Q.left-6;F=Q.top+N;G=v.get_parent(z);L=z.parent().index()+1;break}E=true;for(D=0,C=R.data.nodes.length;Dg.inArray(R.data.nodes[D],J.children)){I-=1}}E=E&&((v&&v.settings&&v.settings.dnd&&v.settings.dnd.check_while_dragging===false)||v.check(B,(R.data.origin&&R.data.origin!==v?R.data.origin.get_node(R.data.nodes[D]):R.data.nodes[D]),G,I,{"dnd":true,"ref":v.get_node(z.parent()),"pos":S,"origin":R.data.origin,"is_multi":(R.data.origin&&R.data.origin!==v),"is_foreign":(!R.data.origin)}));if(!E){if(v&&v.last_error){t=v.last_error()}break}}if(S==="i"&&z.parent().is(".jstree-closed")&&v.settings.dnd.open_timeout){s=setTimeout((function(U,V){return function(){U.open_node(V)}}(v,z)),v.settings.dnd.open_timeout)}if(E){M=v.get_node(G,true);if(!M.hasClass(".jstree-dnd-parent")){g(".jstree-dnd-parent").removeClass("jstree-dnd-parent");
M.addClass("jstree-dnd-parent")}u={"ins":v,"par":G,"pos":S==="i"&&A==="last"&&L===0&&!v.is_loaded(x)?"last":L};q.css({"left":K+"px","top":F+"px"}).show();R.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok");if(R.event.originalEvent&&R.event.originalEvent.dataTransfer){R.event.originalEvent.dataTransfer.dropEffect=y?"copy":"move"}t={};H=true;return false}});if(H===true){return}}}}g(".jstree-dnd-parent").removeClass("jstree-dnd-parent");u=false;R.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er");if(R.event.originalEvent&&R.event.originalEvent.dataTransfer){R.event.originalEvent.dataTransfer.dropEffect="none"}q.hide()}).on("dnd_scroll.vakata.jstree",function(w,v){if(!v||!v.data||!v.data.jstree){return}q.hide();u=false;r=false;v.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er")}).on("dnd_stop.vakata.jstree",function(z,y){g(".jstree-dnd-parent").removeClass("jstree-dnd-parent");if(s){clearTimeout(s)}if(!y||!y.data||!y.data.jstree){return}q.hide().detach();var x,w,v=[];if(u){for(x=0,w=y.data.nodes.length;x"),escape:function(s){return r.vakata.html.div.text(s).html()},strip:function(s){return r.vakata.html.div.empty().append(r.parseHTML(s)).text()}};var q={element:false,target:false,is_down:false,is_drag:false,helper:false,helper_w:0,data:false,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:false,scroll_i:false,is_touch:false};r.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:50},_trigger:function(u,t,s){if(s===e){s=r.vakata.dnd._get()}s.event=t;r(o).triggerHandler("dnd_"+u+".vakata",s)},_get:function(){return{"data":q.data,"element":q.element,"helper":q.helper}},_clean:function(){if(q.helper){q.helper.remove()}if(q.scroll_i){clearInterval(q.scroll_i);q.scroll_i=false}q={element:false,target:false,is_down:false,is_drag:false,helper:false,helper_w:0,data:false,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:false,scroll_i:false,is_touch:false};r(o).off("mousemove.vakata.jstree touchmove.vakata.jstree",r.vakata.dnd.drag);r(o).off("mouseup.vakata.jstree touchend.vakata.jstree",r.vakata.dnd.stop)},_scroll:function(u){if(!q.scroll_e||(!q.scroll_l&&!q.scroll_t)){if(q.scroll_i){clearInterval(q.scroll_i);q.scroll_i=false}return false}if(!q.scroll_i){q.scroll_i=setInterval(r.vakata.dnd._scroll,100);return false}if(u===true){return false}var t=q.scroll_e.scrollTop(),s=q.scroll_e.scrollLeft();q.scroll_e.scrollTop(t+q.scroll_t*r.vakata.dnd.settings.scroll_speed);q.scroll_e.scrollLeft(s+q.scroll_l*r.vakata.dnd.settings.scroll_speed);if(t!==q.scroll_e.scrollTop()||s!==q.scroll_e.scrollLeft()){r.vakata.dnd._trigger("scroll",q.scroll_e)}},start:function(u,t,s){if(u.type==="touchstart"&&u.originalEvent&&u.originalEvent.changedTouches&&u.originalEvent.changedTouches[0]){u.pageX=u.originalEvent.changedTouches[0].pageX;u.pageY=u.originalEvent.changedTouches[0].pageY;u.target=o.elementFromPoint(u.originalEvent.changedTouches[0].pageX-window.pageXOffset,u.originalEvent.changedTouches[0].pageY-window.pageYOffset)}if(q.is_drag){r.vakata.dnd.stop({})}try{u.currentTarget.unselectable="on";u.currentTarget.onselectstart=function(){return false};if(u.currentTarget.style){u.currentTarget.style.touchAction="none";u.currentTarget.style.msTouchAction="none";u.currentTarget.style.MozUserSelect="none"}}catch(v){}q.init_x=u.pageX;q.init_y=u.pageY;q.data=t;q.is_down=true;q.element=u.currentTarget;q.target=u.target;q.is_touch=u.type==="touchstart";if(s!==false){q.helper=r("").html(s).css({"display":"block","margin":"0","padding":"0","position":"absolute","top":"-2000px","lineHeight":"16px","zIndex":"10000"})}r(o).on("mousemove.vakata.jstree touchmove.vakata.jstree",r.vakata.dnd.drag);r(o).on("mouseup.vakata.jstree touchend.vakata.jstree",r.vakata.dnd.stop);return false},drag:function(z){if(z.type==="touchmove"&&z.originalEvent&&z.originalEvent.changedTouches&&z.originalEvent.changedTouches[0]){z.pageX=z.originalEvent.changedTouches[0].pageX;
z.pageY=z.originalEvent.changedTouches[0].pageY;z.target=o.elementFromPoint(z.originalEvent.changedTouches[0].pageX-window.pageXOffset,z.originalEvent.changedTouches[0].pageY-window.pageYOffset)}if(!q.is_down){return}if(!q.is_drag){if(Math.abs(z.pageX-q.init_x)>(q.is_touch?r.vakata.dnd.settings.threshold_touch:r.vakata.dnd.settings.threshold)||Math.abs(z.pageY-q.init_y)>(q.is_touch?r.vakata.dnd.settings.threshold_touch:r.vakata.dnd.settings.threshold)){if(q.helper){q.helper.appendTo("body");q.helper_w=q.helper.outerWidth()}q.is_drag=true;r(q.target).one("click.vakata",false);r.vakata.dnd._trigger("start",z)}else{return}}var A=false,D=false,B=false,t=false,s=false,x=false,v=false,y=false,C=false,u=false;q.scroll_t=0;q.scroll_l=0;q.scroll_e=false;r(r(z.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return(/^auto|scroll$/).test(r(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var w=r(this),E=w.offset();if(this.scrollHeight>this.offsetHeight){if(E.top+w.height()-z.pageYthis.offsetWidth){if(E.left+w.width()-z.pageXt&&z.pageY-vt&&t-(z.pageY-v)x&&z.pageX-yx&&x-(z.pageX-y)B){C=B-50}if(s&&u+q.helper_w>s){u=s-(q.helper_w+2)}q.helper.css({left:u+"px",top:C+"px"})}r.vakata.dnd._trigger("move",z);return false},stop:function(s){if(s.type==="touchend"&&s.originalEvent&&s.originalEvent.changedTouches&&s.originalEvent.changedTouches[0]){s.pageX=s.originalEvent.changedTouches[0].pageX;s.pageY=s.originalEvent.changedTouches[0].pageY;s.target=o.elementFromPoint(s.originalEvent.changedTouches[0].pageX-window.pageXOffset,s.originalEvent.changedTouches[0].pageY-window.pageYOffset)}if(q.is_drag){if(s.target!==q.target){r(q.target).off("click.vakata")}r.vakata.dnd._trigger("stop",s)}else{if(s.type==="touchend"&&s.target===q.target){var t=setTimeout(function(){r(s.target).click()},100);r(s.target).one("click",function(){if(t){clearTimeout(t)}})}}r.vakata.dnd._clean();return false}}}(g));g.jstree.defaults.massload=null;g.jstree.plugins.massload=function(q,r){this.init=function(t,s){this._data.massload={};r.init.call(this,t,s)};this._load_nodes=function(u,C,B,A){var D=this.settings.massload,t=JSON.stringify(u),v=[],w=this._model.data,z,y,x;if(!B){for(z=0,y=u.length;z32){B.fuzzy=false}if(B.fuzzy){s=1<<(r-1);t=(function(){var C={},D=0;for(D=0;D=E;J--){Q=t[P.charAt(J-1)];if(K===0){R[J]=((R[J+1]<<1)|1)&Q}else{R[J]=((R[J+1]<<1)|1)&Q|(((C[J+1]|C[J])<<1)|1)|C[J+1]}if(R[J]&s){H=v(K,J-1);if(H<=G){G=H;I=J-1;L.push(I);if(I>y){E=Math.max(1,2*y-I)}else{break}}}}if(v(K+1,y)>G){break}C=R}return{isMatch:I>=0,score:H}};return u===true?{"search":A}:A(u)};q.vakata.search.defaults={location:0,distance:100,threshold:0.6,fuzzy:false,caseSensitive:false}}(g));g.jstree.defaults.sort=function(r,q){return this.get_text(r)>this.get_text(q)?1:-1};g.jstree.plugins.sort=function(q,r){this.bind=function(){r.bind.call(this);this.element.on("model.jstree",g.proxy(function(t,s){this.sort(s.parent,true)},this)).on("rename_node.jstree create_node.jstree",g.proxy(function(t,s){this.sort(s.parent||s.node.parent,false);this.redraw_node(s.parent||s.node.parent,true)},this)).on("move_node.jstree copy_node.jstree",g.proxy(function(t,s){this.sort(s.parent,false);this.redraw_node(s.parent,true)},this))};this.sort=function(v,s){var u,t;v=this.get_node(v);if(v&&v.children&&v.children.length){v.children.sort(g.proxy(this.settings.sort,this));if(s){for(u=0,t=v.children_d.length;us.ttl){return false}if(!!s&&s.state){s=s.state}if(!!s&&g.isFunction(this.settings.state.filter)){s=this.settings.state.filter.call(this,s)}if(!!s){this.element.one("set_state.jstree",function(v,u){u.instance.trigger("restore_state",{"state":g.extend(true,{},s)})});this.set_state(s);return true}return false};this.clear_state=function(){return g.vakata.storage.del(this.settings.state.key)}};(function(q,r){q.vakata.storage={set:function(s,t){return window.localStorage.setItem(s,t)},get:function(s){return window.localStorage.getItem(s)},del:function(s){return window.localStorage.removeItem(s)}}}(g));g.jstree.defaults.types={"default":{}};g.jstree.defaults.types[g.jstree.root]={};g.jstree.plugins.types=function(q,r){this.init=function(v,t){var u,s;if(t&&t.types&&t.types["default"]){for(u in t.types){if(u!=="default"&&u!==g.jstree.root&&t.types.hasOwnProperty(u)){for(s in t.types["default"]){if(t.types["default"].hasOwnProperty(s)&&t.types[u][s]===e){t.types[u][s]=t.types["default"][s]}}}}}r.init.call(this,v,t);this._model.data[g.jstree.root].type=g.jstree.root};this.refresh=function(t,s){r.refresh.call(this,t,s);this._model.data[g.jstree.root].type=g.jstree.root};this.bind=function(){this.element.on("model.jstree",g.proxy(function(z,w){var s=this._model.data,y=w.nodes,B=this.settings.types,x,v,A="default",u;for(x=0,v=y.length;x .jstree-ocl",g.proxy(function(t){t.stopImmediatePropagation();var s=g.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});g(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(s).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",g.proxy(function(s){s.stopImmediatePropagation();if(!this.is_disabled(s.currentTarget)){this.hover_node(s.currentTarget)}return false},this)).on("mouseleave.jstree",".jstree-node",g.proxy(function(s){this.dehover_node(s.currentTarget)},this))};this.teardown=function(){if(this.settings.wholerow){this.element.find(".jstree-wholerow").remove()}r.teardown.call(this)};this.redraw_node=function(v,s,w,u){v=r.redraw_node.apply(this,arguments);if(v){var t=b.cloneNode(true);if(g.inArray(v.id,this._data.core.selected)!==-1){t.className+=" jstree-wholerow-clicked"}if(this._data.core.focused&&this._data.core.focused===v.id){t.className+=" jstree-wholerow-hovered"}v.insertBefore(t,v.childNodes[0])}return v}};if(o.registerElement&&Object&&Object.create){var i=Object.create(HTMLElement.prototype);i.createdCallback=function(){var r={core:{},plugins:[]},q;for(q in g.jstree.plugins){if(g.jstree.plugins.hasOwnProperty(q)&&this.attributes[q]){r.plugins.push(q);if(this.getAttribute(q)&&JSON.parse(this.getAttribute(q))){r[q]=JSON.parse(this.getAttribute(q))}}}for(q in g.jstree.defaults.core){if(g.jstree.defaults.core.hasOwnProperty(q)&&this.attributes[q]){r.core[q]=JSON.parse(this.getAttribute(q))||this.getAttribute(q)}}g(this).jstree(r)};try{o.registerElement("vakata-jstree",{prototype:i})}catch(l){}}}));