!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):factory("object"==typeof exports?require("jquery"):jQuery)}(function($,undefined){"use strict";if(!$.jstree){var _temp1,_temp2,instance_counter=0,ccp_node=!1,ccp_mode=!1,ccp_inst=!1,themes_loaded=[],src=$("script:last").attr("src"),document=window.document,_node=document.createElement("LI");_node.setAttribute("role","treeitem"),_temp1=document.createElement("I"),_temp1.className="jstree-icon jstree-ocl",_temp1.setAttribute("role","presentation"),_node.appendChild(_temp1),_temp1=document.createElement("A"),_temp1.className="jstree-anchor",_temp1.setAttribute("href","#"),_temp1.setAttribute("tabindex","-1"),_temp2=document.createElement("I"),_temp2.className="jstree-icon jstree-themeicon",_temp2.setAttribute("role","presentation"),_temp1.appendChild(_temp2),_node.appendChild(_temp1),_temp1=_temp2=null,$.jstree={version:"3.1.1",defaults:{plugins:[]},plugins:{},path:src&&src.indexOf("/")!==-1?src.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g},$.jstree.create=function(el,options){var tmp=new $.jstree.core(++instance_counter),opt=options;return options=$.extend(!0,{},$.jstree.defaults,options),opt&&opt.plugins&&(options.plugins=opt.plugins),$.each(options.plugins,function(i,k){"core"!==i&&(tmp=tmp.plugin(k,options[k]))}),$(el).data("jstree",tmp),tmp.init(el,options),tmp},$.jstree.destroy=function(){$(".jstree:jstree").jstree("destroy"),$(document).off(".jstree")},$.jstree.core=function(id){this._id=id,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},$.jstree.reference=function(needle){var tmp=null,obj=null;if(!needle||!needle.id||needle.tagName&&needle.nodeType||(needle=needle.id),!obj||!obj.length)try{obj=$(needle)}catch(ignore){}if(!obj||!obj.length)try{obj=$("#"+needle.replace($.jstree.idregex,"\\$&"))}catch(ignore){}return obj&&obj.length&&(obj=obj.closest(".jstree")).length&&(obj=obj.data("jstree"))?tmp=obj:$(".jstree").each(function(){var inst=$(this).data("jstree");if(inst&&inst._model.data[needle])return tmp=inst,!1}),tmp},$.fn.jstree=function(arg){var is_method="string"==typeof arg,args=Array.prototype.slice.call(arguments,1),result=null;return!(arg===!0&&!this.length)&&(this.each(function(){var instance=$.jstree.reference(this),method=is_method&&instance?instance[arg]:null;if(result=is_method&&method?method.apply(instance,args):null,instance||is_method||arg!==undefined&&!$.isPlainObject(arg)||$.jstree.create(this,arg),(instance&&!is_method||arg===!0)&&(result=instance||!1),null!==result&&result!==undefined)return!1}),null!==result&&result!==undefined?result:this)},$.expr[":"].jstree=$.expr.createPseudo(function(search){return function(a){return $(a).hasClass("jstree")&&$(a).data("jstree")!==undefined}}),$.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:$.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0},$.jstree.core.prototype={plugin:function(deco,opts){var Child=$.jstree.plugins[deco];return Child?(this._data[deco]={},Child.prototype=this,new Child(opts,this)):this},init:function(el,options){this._model={data:{"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this.element=$(el).addClass("jstree jstree-"+this._id),this.settings=options,this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0),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(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html("
"),this.element.attr("aria-activedescendant","j"+this._id+"_loading"),this._data.core.li_height=this.get_container_ul().children("li").first().height()||24,this.trigger("loading"),this.load_node("#")},destroy:function(keep_html){if(this._wrk)try{window.URL.revokeObjectURL(this._wrk),this._wrk=null}catch(ignore){}keep_html||this.element.empty(),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){var word="",tout=null,was_click=0;this.element.on("dblclick.jstree",function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var sel=window.getSelection();try{sel.removeAllRanges(),sel.collapse()}catch(ignore){}}}).on("mousedown.jstree",$.proxy(function(e){e.target===this.element[0]&&(e.preventDefault(),was_click=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(e){e.preventDefault()}).on("click.jstree",".jstree-ocl",$.proxy(function(e){this.toggle_node(e.target)},this)).on("dblclick.jstree",".jstree-anchor",$.proxy(function(e){this.settings.core.dblclick_toggle&&this.toggle_node(e.target)},this)).on("click.jstree",".jstree-anchor",$.proxy(function(e){e.preventDefault(),e.currentTarget!==document.activeElement&&$(e.currentTarget).focus(),this.activate_node(e.currentTarget,e)},this)).on("keydown.jstree",".jstree-anchor",$.proxy(function(e){if("INPUT"===e.target.tagName)return!0;if(32!==e.which&&13!==e.which&&(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey))return!0;var o=null;switch(this._data.core.rtl&&(37===e.which?e.which=39:39===e.which&&(e.which=37)),e.which){case 32:e.ctrlKey&&(e.type="click",$(e.currentTarget).trigger(e));break;case 13:e.type="click",$(e.currentTarget).trigger(e);break;case 37:e.preventDefault(),this.is_open(e.currentTarget)?this.close_node(e.currentTarget):(o=this.get_parent(e.currentTarget),o&&"#"!==o.id&&this.get_node(o,!0).children(".jstree-anchor").focus());break;case 38:e.preventDefault(),o=this.get_prev_dom(e.currentTarget),o&&o.length&&o.children(".jstree-anchor").focus();break;case 39:e.preventDefault(),this.is_closed(e.currentTarget)?this.open_node(e.currentTarget,function(o){this.get_node(o,!0).children(".jstree-anchor").focus()}):this.is_open(e.currentTarget)&&(o=this.get_node(e.currentTarget,!0).children(".jstree-children")[0],o&&$(this._firstChild(o)).children(".jstree-anchor").focus());break;case 40:e.preventDefault(),o=this.get_next_dom(e.currentTarget),o&&o.length&&o.children(".jstree-anchor").focus();break;case 106:this.open_all();break;case 36:e.preventDefault(),o=this._firstChild(this.get_container_ul()[0]),o&&$(o).children(".jstree-anchor").filter(":visible").focus();break;case 35:e.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()}},this)).on("load_node.jstree",$.proxy(function(e,data){data.status&&("#"!==data.node.id||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout($.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var i,j,tmp=[];for(i=0,j=this._data.core.selected.length;i1){if(col.slice(ind).each($.proxy(function(i,v){if(0===$(v).text().toLowerCase().indexOf(word))return $(v).focus(),end=!0,!1},this)),end)return;if(col.slice(0,ind).each($.proxy(function(i,v){if(0===$(v).text().toLowerCase().indexOf(word))return $(v).focus(),end=!0,!1},this)),end)return}if(new RegExp("^"+chr+"+$").test(word)){if(col.slice(ind+1).each($.proxy(function(i,v){if($(v).text().toLowerCase().charAt(0)===chr)return $(v).focus(),end=!0,!1},this)),end)return;if(col.slice(0,ind+1).each($.proxy(function(i,v){if($(v).text().toLowerCase().charAt(0)===chr)return $(v).focus(),end=!0,!1},this)),end)return}},this)).on("init.jstree",$.proxy(function(){var s=this.settings.core.themes;this._data.core.themes.dots=s.dots,this._data.core.themes.stripes=s.stripes,this._data.core.themes.icons=s.icons,this.set_theme(s.name||"default",s.url),this.set_theme_variant(s.variant)},this)).on("loading.jstree",$.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]()},this)).on("blur.jstree",".jstree-anchor",$.proxy(function(e){this._data.core.focused=null,$(e.currentTarget).filter(".jstree-hovered").mouseleave(),this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",$.proxy(function(e){var tmp=this.get_node(e.currentTarget);tmp&&tmp.id&&(this._data.core.focused=tmp.id),this.element.find(".jstree-hovered").not(e.currentTarget).mouseleave(),$(e.currentTarget).mouseenter(),this.element.attr("tabindex","-1")},this)).on("focus.jstree",$.proxy(function(){if(+new Date-was_click>500&&!this._data.core.focused){was_click=0;var act=this.get_node(this.element.attr("aria-activedescendant"),!0);act&&act.find("> .jstree-anchor").focus()}},this)).on("mouseenter.jstree",".jstree-anchor",$.proxy(function(e){this.hover_node(e.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",$.proxy(function(e){this.dehover_node(e.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),$(document).off(".jstree-"+this._id)},trigger:function(ev,data){data||(data={}),data.instance=this,this.element.triggerHandler(ev.replace(".jstree","")+".jstree",data)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(key){var a=this.settings.core.strings;return $.isFunction(a)?a.call(this,key):a&&a[key]?a[key]:key},_firstChild:function(dom){for(dom=dom?dom.firstChild:null;null!==dom&&1!==dom.nodeType;)dom=dom.nextSibling;return dom},_nextSibling:function(dom){for(dom=dom?dom.nextSibling:null;null!==dom&&1!==dom.nodeType;)dom=dom.nextSibling;return dom},_previousSibling:function(dom){for(dom=dom?dom.previousSibling:null;null!==dom&&1!==dom.nodeType;)dom=dom.previousSibling;return dom},get_node:function(obj,as_dom){obj&&obj.id&&(obj=obj.id);var dom;try{if(this._model.data[obj])obj=this._model.data[obj];else if("string"==typeof obj&&this._model.data[obj.replace(/^#/,"")])obj=this._model.data[obj.replace(/^#/,"")];else if("string"==typeof obj&&(dom=$("#"+obj.replace($.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[dom.closest(".jstree-node").attr("id")])obj=this._model.data[dom.closest(".jstree-node").attr("id")];else if((dom=$(obj,this.element)).length&&this._model.data[dom.closest(".jstree-node").attr("id")])obj=this._model.data[dom.closest(".jstree-node").attr("id")];else{if(!(dom=$(obj,this.element)).length||!dom.hasClass("jstree"))return!1;obj=this._model.data["#"]}return as_dom&&(obj="#"===obj.id?this.element:$("#"+obj.id.replace($.jstree.idregex,"\\$&"),this.element)),obj}catch(ex){return!1}},get_path:function(obj,glue,ids){if(obj=obj.parents?obj:this.get_node(obj),!obj||"#"===obj.id||!obj.parents)return!1;var i,j,p=[];for(p.push(ids?obj.id:obj.text),i=0,j=obj.parents.length;i0)},is_loaded:function(obj){return obj=this.get_node(obj),obj&&obj.state.loaded},is_loading:function(obj){return obj=this.get_node(obj),obj&&obj.state&&obj.state.loading},is_open:function(obj){return obj=this.get_node(obj),obj&&obj.state.opened},is_closed:function(obj){return obj=this.get_node(obj),obj&&this.is_parent(obj)&&!obj.state.opened},is_leaf:function(obj){return!this.is_parent(obj)},load_node:function(obj,callback){var k,l,i,j,c;if($.isArray(obj))return this._load_nodes(obj.slice(),callback),!0;if(obj=this.get_node(obj),!obj)return callback&&callback.call(this,obj,!1),!1;if(obj.state.loaded){for(obj.state.loaded=!1,k=0,l=obj.children_d.length;k").html(tmp),data.text=this.settings.core.force_text?tmp.text():tmp.html(),tmp=d.data(),data.data=tmp?$.extend(!0,{},tmp):null,data.state.opened=d.hasClass("jstree-open"),data.state.selected=d.children("a").hasClass("jstree-clicked"),data.state.disabled=d.children("a").hasClass("jstree-disabled"),data.data&&data.data.jstree)for(i in data.data.jstree)data.data.jstree.hasOwnProperty(i)&&(data.state[i]=data.data.jstree[i]);tmp=d.children("a").children(".jstree-themeicon"),tmp.length&&(data.icon=!tmp.hasClass("jstree-themeicon-hidden")&&tmp.attr("rel")),data.state.icon!==undefined&&(data.icon=data.state.icon),data.icon!==undefined&&null!==data.icon&&""!==data.icon||(data.icon=!0),tmp=d.children("ul").children("li");do tid="j"+this._id+"_"+ ++this._cnt;while(m[tid]);return data.id=data.li_attr.id?data.li_attr.id.toString():tid,tmp.length?(tmp.each($.proxy(function(i,v){c=this._parse_model_from_html($(v),data.id,ps),e=this._model.data[c],data.children.push(c),e.children_d.length&&(data.children_d=data.children_d.concat(e.children_d))},this)),data.children_d=data.children_d.concat(data.children)):d.hasClass("jstree-closed")&&(data.state.loaded=!1),data.li_attr.class&&(data.li_attr.class=data.li_attr.class.replace("jstree-closed","").replace("jstree-open","")),data.a_attr.class&&(data.a_attr.class=data.a_attr.class.replace("jstree-clicked","").replace("jstree-disabled","")),m[data.id]=data,data.state.selected&&this._data.core.selected.push(data.id),data.id},_parse_model_from_flat_json:function(d,p,ps){ps=ps?ps.concat():[],p&&ps.unshift(p);var i,j,c,e,tid=d.id.toString(),m=this._model.data,df=this._model.default_state,tmp={id:tid,text:d.text||"",icon:d.icon===undefined||d.icon,parent:p,parents:ps,children:d.children||[],children_d:d.children_d||[],data:d.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in df)df.hasOwnProperty(i)&&(tmp.state[i]=df[i]);if(d&&d.data&&d.data.jstree&&d.data.jstree.icon&&(tmp.icon=d.data.jstree.icon),tmp.icon!==undefined&&null!==tmp.icon&&""!==tmp.icon||(tmp.icon=!0),d&&d.data&&(tmp.data=d.data,d.data.jstree))for(i in d.data.jstree)d.data.jstree.hasOwnProperty(i)&&(tmp.state[i]=d.data.jstree[i]);if(d&&"object"==typeof d.state)for(i in d.state)d.state.hasOwnProperty(i)&&(tmp.state[i]=d.state[i]);if(d&&"object"==typeof d.li_attr)for(i in d.li_attr)d.li_attr.hasOwnProperty(i)&&(tmp.li_attr[i]=d.li_attr[i]);if(tmp.li_attr.id||(tmp.li_attr.id=tid),d&&"object"==typeof d.a_attr)for(i in d.a_attr)d.a_attr.hasOwnProperty(i)&&(tmp.a_attr[i]=d.a_attr[i]);for(d&&d.children&&d.children===!0&&(tmp.state.loaded=!1,tmp.children=[],tmp.children_d=[]),m[tmp.id]=tmp,i=0,j=tmp.children.length;i"+this.get_string("Loading ...")+""),this.element.attr("aria-activedescendant","j"+this._id+"_loading")),this.load_node("#",function(o,s){s&&(this.get_container_ul()[0].className=c,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state($.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")})),this._data.core.state=null})},refresh_node:function(obj){if(obj=this.get_node(obj),!obj||"#"===obj.id)return!1;var opened=[],to_load=[];this._data.core.selected.concat([]);to_load.push(obj.id),obj.state.opened===!0&&opened.push(obj.id),this.get_node(obj,!0).find(".jstree-open").each(function(){opened.push(this.id)}),this._load_nodes(to_load,$.proxy(function(nodes){this.open_node(opened,!1,0),this.select_node(this._data.core.selected),this.trigger("refresh_node",{node:obj,nodes:nodes})},this))},set_id:function(obj,id){if(obj=this.get_node(obj),!obj||"#"===obj.id)return!1;var i,j,m=this._model.data;for(id=id.toString(),m[obj.parent].children[$.inArray(obj.id,m[obj.parent].children)]=id,i=0,j=obj.parents.length;ipar.children.length&&(pos=par.children.length),node.id||(node.id=!0),!this.check("create_node",node,par,pos))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(node.id===!0&&delete node.id,node=this._parse_model_from_json(node,par.id,par.parents.concat()),!node)return!1;for(tmp=this.get_node(node),dpc=[],dpc.push(node),dpc=dpc.concat(tmp.children_d),this.trigger("model",{nodes:dpc,parent:par.id}),par.children_d=par.children_d.concat(dpc),i=0,j=par.parents.length;i=pos?i+1:i]=par.children[i];return tmp[pos]=node.id,par.children=tmp,this.redraw_node(par,!0),callback&&callback.call(this,this.get_node(node)),this.trigger("create_node",{node:this.get_node(node),parent:par.id,position:pos}),node.id},rename_node:function(obj,val){var t1,t2,old;if($.isArray(obj)){for(obj=obj.slice(),t1=0,t2=obj.length;t1new_par.children.length&&(pos=new_par.children.length),!this.check("move_node",obj,new_par,pos,{core:!0,origin:origin,is_multi:old_ins&&old_ins._id&&old_ins._id!==this._id,is_foreign:!old_ins||!old_ins._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(obj.parent===new_par.id){for(dpc=new_par.children.concat(),tmp=$.inArray(obj.id,dpc),tmp!==-1&&(dpc=$.vakata.array_remove(dpc,tmp),pos>tmp&&pos--),tmp=[],i=0,j=dpc.length;i=pos?i+1:i]=dpc[i];tmp[pos]=obj.id,new_par.children=tmp,this._node_changed(new_par.id),this.redraw("#"===new_par.id)}else{for(tmp=obj.children_d.concat(),tmp.push(obj.id),i=0,j=obj.parents.length;i=pos?i+1:i]=new_par.children[i];for(dpc[pos]=obj.id,new_par.children=dpc,new_par.children_d.push(obj.id),new_par.children_d=new_par.children_d.concat(obj.children_d),obj.parent=new_par.id,tmp=new_par.parents.concat(),tmp.unshift(new_par.id),p=obj.parents.length,obj.parents=tmp,tmp=tmp.concat(),i=0,j=obj.children_d.length;inew_par.children.length&&(pos=new_par.children.length),!this.check("copy_node",obj,new_par,pos,{core:!0,origin:origin,is_multi:old_ins&&old_ins._id&&old_ins._id!==this._id,is_foreign:!old_ins||!old_ins._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(node=old_ins?old_ins.get_json(obj,{no_id:!0,no_data:!0,no_state:!0}):obj,!node)return!1;if(node.id===!0&&delete node.id,node=this._parse_model_from_json(node,new_par.id,new_par.parents.concat()),!node)return!1;for(tmp=this.get_node(node),obj&&obj.state&&obj.state.loaded===!1&&(tmp.state.loaded=!1),dpc=[],dpc.push(node),dpc=dpc.concat(tmp.children_d),this.trigger("model",{nodes:dpc,parent:new_par.id}),i=0,j=new_par.parents.length;i=pos?i+1:i]=new_par.children[i];return dpc[pos]=tmp.id,new_par.children=dpc,new_par.children_d.push(tmp.id),new_par.children_d=new_par.children_d.concat(tmp.children_d),"#"===new_par.id&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(new_par.id),skip_redraw||this.redraw("#"===new_par.id),callback&&callback.call(this,tmp,new_par,pos),this.trigger("copy_node",{node:tmp,original:obj,parent:new_par.id,position:pos,old_parent:old_par,old_position:old_ins&&old_ins._id&&old_par&&old_ins._model.data[old_par]&&old_ins._model.data[old_par].children?$.inArray(obj.id,old_ins._model.data[old_par].children):-1,is_multi:old_ins&&old_ins._id&&old_ins._id!==this._id,is_foreign:!old_ins||!old_ins._id,old_instance:old_ins,new_instance:this}),tmp.id},cut:function(obj){if(obj||(obj=this._data.core.selected.concat()),$.isArray(obj)||(obj=[obj]),!obj.length)return!1;var o,t1,t2,tmp=[];for(t1=0,t2=obj.length;t1"),t=default_text,h1=$("",{css:{position:"absolute",top:"-200px",left:rtl?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),h2=$("",{value:t,class:"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:$.proxy(function(){var nv,i=s.children(".jstree-rename-input"),v=i.val(),f=this.settings.core.force_text;""===v&&(v=t),h1.remove(),s.replaceWith(a),s.remove(),t=f?t:$("").append($.parseHTML(t)).html(),this.set_text(obj,t),nv=!!this.rename_node(obj,f?$("").text(v).text():$("").append($.parseHTML(v)).html()),nv||this.set_text(obj,t),callback&&callback.call(this,tmp,nv)},this),keydown:function(event){var key=event.which;27===key&&(this.value=t),27!==key&&13!==key&&37!==key&&38!==key&&39!==key&&40!==key&&32!==key||event.stopImmediatePropagation(),27!==key&&13!==key||(event.preventDefault(),this.blur())},click:function(e){e.stopImmediatePropagation()},mousedown:function(e){e.stopImmediatePropagation()},keyup:function(event){h2.width(Math.min(h1.text("pW"+this.value).width(),w))},keypress:function(event){if(13===event.which)return!1}}),fn={fontFamily:a.css("fontFamily")||"",fontSize:a.css("fontSize")||"",fontWeight:a.css("fontWeight")||"",fontStyle:a.css("fontStyle")||"",fontStretch:a.css("fontStretch")||"",fontVariant:a.css("fontVariant")||"",letterSpacing:a.css("letterSpacing")||"",wordSpacing:a.css("wordSpacing")||""},s.attr("class",a.attr("class")).append(a.contents().clone()).append(h2),a.replaceWith(s),h1.css(fn),void h2.css(fn).width(Math.min(h1.text("pW"+h2[0].value).width(),w))[0].select()))},set_theme:function(theme_name,theme_url){if(!theme_name)return!1;if(theme_url===!0){var dir=this.settings.core.themes.dir;dir||(dir=$.jstree.path+"/themes"),theme_url=dir+"/"+theme_name+"/style.css"}theme_url&&$.inArray(theme_url,themes_loaded)===-1&&($("head").append(''),themes_loaded.push(theme_url)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=theme_name,this.element.addClass("jstree-"+theme_name),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+theme_name+"-responsive"),this.trigger("set_theme",{theme:theme_name})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(variant_name){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=variant_name,variant_name&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(obj,icon){var t1,t2,dom,old;if($.isArray(obj)){for(obj=obj.slice(),t1=0,t2=obj.length;t1250)&&$.vakata.context.hide(),last_ts=0},this)).on("touchstart.jstree",".jstree-anchor",function(e){e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(ex=e.pageX,ey=e.pageY,cto=setTimeout(function(){$(e.currentTarget).trigger("contextmenu",!0)},750))}).on("touchmove.vakata.jstree",function(e){cto&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(Math.abs(ex-e.pageX)>50||Math.abs(ey-e.pageY)>50)&&clearTimeout(cto)}).on("touchend.vakata.jstree",function(e){cto&&clearTimeout(cto)}),$(document).on("context_hide.vakata.jstree",$.proxy(function(){this._data.contextmenu.visible=!1},this))},this.teardown=function(){this._data.contextmenu.visible&&$.vakata.context.hide(),parent.teardown.call(this)},this.show_contextmenu=function(obj,x,y,e){if(obj=this.get_node(obj),!obj||"#"===obj.id)return!1;var s=this.settings.contextmenu,d=this.get_node(obj,!0),a=d.children(".jstree-anchor"),o=!1,i=!1;(s.show_at_node||x===undefined||y===undefined)&&(o=a.offset(),x=o.left,y=o.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(obj)&&this.activate_node(obj,e),i=s.items,$.isFunction(i)&&(i=i.call(this,obj,$.proxy(function(i){this._show_contextmenu(obj,x,y,i)},this))),$.isPlainObject(i)&&this._show_contextmenu(obj,x,y,i)},this._show_contextmenu=function(obj,x,y,i){var d=this.get_node(obj,!0),a=d.children(".jstree-anchor");$(document).one("context_show.vakata.jstree",$.proxy(function(e,data){var cls="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";$(data.element).addClass(cls)},this)),this._data.contextmenu.visible=!0,$.vakata.context.show(a,{x:x,y:y},i),this.trigger("show_contextmenu",{node:obj,x:x,y:y})}},function($){var right_to_left=!1,vakata_context={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};$.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(event_name){$(document).triggerHandler("context_"+event_name+".vakata",{reference:vakata_context.reference,element:vakata_context.element,position:{x:vakata_context.position_x,y:vakata_context.position_y}})},_execute:function(i){return i=vakata_context.items[i],!(!i||i._disabled&&(!$.isFunction(i._disabled)||i._disabled({item:i,reference:vakata_context.reference,element:vakata_context.element}))||!i.action)&&i.action.call(null,{item:i,reference:vakata_context.reference,element:vakata_context.element,position:{x:vakata_context.position_x,y:vakata_context.position_y}})},_parse:function(o,is_callback){if(!o)return!1;is_callback||(vakata_context.html="",vakata_context.items=[]);var tmp,str="",sep=!1;return is_callback&&(str+=""),$.each(o,function(i,val){return!val||(vakata_context.items.push(val),!sep&&val.separator_before&&(str+="-
"),sep=!1,str+="",void(val.separator_after&&(str+="-
",sep=!0)))}),str=str.replace(/- <\/li\>$/,""),is_callback&&(str+="
"),is_callback||(vakata_context.html=str,$.vakata.context._trigger("parse")),str.length>10&&str},_show_submenu:function(o){if(o=$(o),o.length&&o.children("ul").length){var e=o.children("ul"),x=o.offset().left+o.outerWidth(),y=o.offset().top,w=e.width(),h=e.height(),dw=$(window).width()+$(window).scrollLeft(),dh=$(window).height()+$(window).scrollTop();right_to_left?o[x-(w+10+o.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):o[x+w+10>dw?"addClass":"removeClass"]("vakata-context-right"),
y+h+10>dh&&e.css("bottom","-1px"),e.show()}},show:function(reference,position,data){var o,e,x,y,w,h,dw,dh,cond=!0;switch(vakata_context.element&&vakata_context.element.length&&vakata_context.element.width(""),cond){case!position&&!reference:return!1;case!!position&&!!reference:vakata_context.reference=reference,vakata_context.position_x=position.x,vakata_context.position_y=position.y;break;case!position&&!!reference:vakata_context.reference=reference,o=reference.offset(),vakata_context.position_x=o.left+reference.outerHeight(),vakata_context.position_y=o.top;break;case!!position&&!reference:vakata_context.position_x=position.x,vakata_context.position_y=position.y}reference&&!data&&$(reference).data("vakata_contextmenu")&&(data=$(reference).data("vakata_contextmenu")),$.vakata.context._parse(data)&&vakata_context.element.html(vakata_context.html),vakata_context.items.length&&(vakata_context.element.appendTo("body"),e=vakata_context.element,x=vakata_context.position_x,y=vakata_context.position_y,w=e.width(),h=e.height(),dw=$(window).width()+$(window).scrollLeft(),dh=$(window).height()+$(window).scrollTop(),right_to_left&&(x-=e.outerWidth()-$(reference).outerWidth(),x<$(window).scrollLeft()+20&&(x=$(window).scrollLeft()+20)),x+w+20>dw&&(x=dw-(w+20)),y+h+20>dh&&(y=dh-(h+20)),vakata_context.element.css({left:x,top:y}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),vakata_context.is_visible=!0,$.vakata.context._trigger("show"))},hide:function(){vakata_context.is_visible&&(vakata_context.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),vakata_context.is_visible=!1,$.vakata.context._trigger("hide"))}},$(function(){right_to_left="rtl"===$("body").css("direction");var to=!1;vakata_context.element=$(""),vakata_context.element.on("mouseenter","li",function(e){e.stopImmediatePropagation(),$.contains(this,e.relatedTarget)||(to&&clearTimeout(to),vakata_context.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),$(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),$.vakata.context._show_submenu(this))}).on("mouseleave","li",function(e){$.contains(this,e.relatedTarget)||$(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(e){$(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),$.vakata.context.settings.hide_onmouseleave&&(to=setTimeout(function(t){return function(){$.vakata.context.hide()}}(this),$.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(e){e.preventDefault(),$(this).blur().parent().hasClass("vakata-context-disabled")||$.vakata.context._execute($(this).attr("rel"))===!1||$.vakata.context.hide()}).on("keydown","a",function(e){var o=null;switch(e.which){case 13:case 32:e.type="mouseup",e.preventDefault(),$(e.currentTarget).trigger(e);break;case 37:vakata_context.is_visible&&(vakata_context.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 38:vakata_context.is_visible&&(o=vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),o.length||(o=vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),o.addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 39:vakata_context.is_visible&&(vakata_context.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 40:vakata_context.is_visible&&(o=vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),o.length||(o=vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),o.addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 27:$.vakata.context.hide(),e.preventDefault()}}).on("keydown",function(e){e.preventDefault();var a=vakata_context.element.find(".vakata-contextmenu-shortcut-"+e.which).parent();a.parent().not(".vakata-context-disabled")&&a.click()}),$(document).on("mousedown.vakata.jstree",function(e){vakata_context.is_visible&&!$.contains(vakata_context.element[0],e.target)&&$.vakata.context.hide()}).on("context_show.vakata.jstree",function(e,data){vakata_context.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),right_to_left&&vakata_context.element.addClass("vakata-context-rtl").css("direction","rtl"),vakata_context.element.find("ul").hide().end()})})}($),$.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1},$.jstree.plugins.dnd=function(options,parent){this.bind=function(){parent.bind.call(this),this.element.on("mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",$.proxy(function(e){if(this.settings.dnd.large_drag_target&&$(e.target).closest(".jstree-node")[0]!==e.currentTarget)return!0;if("touchstart"===e.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!$(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var obj=this.get_node(e.target),mlt=this.is_selected(obj)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,txt=mlt>1?mlt+" "+this.get_string("nodes"):this.get_text(e.currentTarget);return this.settings.core.force_text&&(txt=$.vakata.html.escape(txt)),obj&&obj.id&&"#"!==obj.id&&(1===e.which||"touchstart"===e.type)&&(this.settings.dnd.is_draggable===!0||$.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,mlt>1?this.get_top_selected(!0):[obj]))?(this.element.trigger("mousedown.jstree"),$.vakata.dnd.start(e,{jstree:!0,origin:this,obj:this.get_node(obj,!0),nodes:mlt>1?this.get_top_selected():[obj.id]},''+txt+'+
')):void 0},this))}},$(function(){var lastmv=!1,laster=!1,opento=!1,marker=$('
').hide();$(document).on("dnd_start.vakata.jstree",function(e,data){lastmv=!1,data&&data.data&&data.data.jstree&&marker.appendTo("body")}).on("dnd_move.vakata.jstree",function(e,data){if(opento&&clearTimeout(opento),data&&data.data&&data.data.jstree&&(!data.event.target.id||"jstree-marker"!==data.event.target.id)){var l,t,h,p,i,o,ok,t1,t2,op,ps,pr,ip,tm,ins=$.jstree.reference(data.event.target),ref=!1,off=!1,rel=!1;if(ins&&ins._data&&ins._data.dnd)if(marker.attr("class","jstree-"+ins.get_theme()+(ins.settings.core.themes.responsive?" jstree-dnd-responsive":"")),data.helper.children().attr("class","jstree-"+ins.get_theme()+" jstree-"+ins.get_theme()+"-"+ins.get_theme_variant()+" "+(ins.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[data.data.origin&&(data.data.origin.settings.dnd.always_copy||data.data.origin.settings.dnd.copy&&(data.event.metaKey||data.event.ctrlKey))?"show":"hide"](),data.event.target!==ins.element[0]&&data.event.target!==ins.get_container_ul()[0]||0!==ins.get_container_ul().children().length){if(ref=ins.settings.dnd.large_drop_target?$(data.event.target).closest(".jstree-node").children(".jstree-anchor"):$(data.event.target).closest(".jstree-anchor"),ref&&ref.length&&ref.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(off=ref.offset(),rel=data.event.pageY-off.top,h=ref.outerHeight(),o=relh-h/3?["a","i","b"]:rel>h/2?["i","a","b"]:["i","b","a"],$.each(o,function(j,v){switch(v){case"b":l=off.left-6,t=off.top,p=ins.get_parent(ref),i=ref.parent().index();break;case"i":ip=ins.settings.dnd.inside_pos,tm=ins.get_node(ref.parent()),l=off.left-2,t=off.top+h/2+1,p=tm.id,i="first"===ip?0:"last"===ip?tm.children.length:Math.min(ip,tm.children.length);break;case"a":l=off.left-6,t=off.top+h,p=ins.get_parent(ref),i=ref.parent().index()+1}for(ok=!0,t1=0,t2=data.data.nodes.length;t1$.inArray(data.data.nodes[t1],pr.children)&&(ps-=1)),ok=ok&&(ins&&ins.settings&&ins.settings.dnd&&ins.settings.dnd.check_while_dragging===!1||ins.check(op,data.data.origin&&data.data.origin!==ins?data.data.origin.get_node(data.data.nodes[t1]):data.data.nodes[t1],p,ps,{dnd:!0,ref:ins.get_node(ref.parent()),pos:v,origin:data.data.origin,is_multi:data.data.origin&&data.data.origin!==ins,is_foreign:!data.data.origin})),!ok){ins&&ins.last_error&&(laster=ins.last_error());break}if("i"===v&&ref.parent().is(".jstree-closed")&&ins.settings.dnd.open_timeout&&(opento=setTimeout(function(x,z){return function(){x.open_node(z)}}(ins,ref),ins.settings.dnd.open_timeout)),ok)return lastmv={ins:ins,par:p,pos:"i"!==v||"last"!==ip||0!==i||ins.is_loaded(tm)?i:"last"},marker.css({left:l+"px",top:t+"px"}).show(),data.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),laster={},o=!0,!1}),o===!0))return}else{for(ok=!0,t1=0,t2=data.data.nodes.length;t1"),escape:function(str){return $.vakata.html.div.text(str).html()},strip:function(str){return $.vakata.html.div.empty().append($.parseHTML(str)).text()}};var vakata_dnd={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};$.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:50},_trigger:function(event_name,e){var data=$.vakata.dnd._get();data.event=e,$(document).triggerHandler("dnd_"+event_name+".vakata",data)},_get:function(){return{data:vakata_dnd.data,element:vakata_dnd.element,helper:vakata_dnd.helper}},_clean:function(){vakata_dnd.helper&&vakata_dnd.helper.remove(),vakata_dnd.scroll_i&&(clearInterval(vakata_dnd.scroll_i),vakata_dnd.scroll_i=!1),vakata_dnd={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},$(document).off("mousemove.vakata.jstree touchmove.vakata.jstree",$.vakata.dnd.drag),$(document).off("mouseup.vakata.jstree touchend.vakata.jstree",$.vakata.dnd.stop)},_scroll:function(init_only){if(!vakata_dnd.scroll_e||!vakata_dnd.scroll_l&&!vakata_dnd.scroll_t)return vakata_dnd.scroll_i&&(clearInterval(vakata_dnd.scroll_i),vakata_dnd.scroll_i=!1),!1;if(!vakata_dnd.scroll_i)return vakata_dnd.scroll_i=setInterval($.vakata.dnd._scroll,100),!1;if(init_only===!0)return!1;var i=vakata_dnd.scroll_e.scrollTop(),j=vakata_dnd.scroll_e.scrollLeft();vakata_dnd.scroll_e.scrollTop(i+vakata_dnd.scroll_t*$.vakata.dnd.settings.scroll_speed),vakata_dnd.scroll_e.scrollLeft(j+vakata_dnd.scroll_l*$.vakata.dnd.settings.scroll_speed),i===vakata_dnd.scroll_e.scrollTop()&&j===vakata_dnd.scroll_e.scrollLeft()||$.vakata.dnd._trigger("scroll",vakata_dnd.scroll_e)},start:function(e,data,html){"touchstart"===e.type&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e.target=document.elementFromPoint(e.originalEvent.changedTouches[0].pageX-window.pageXOffset,e.originalEvent.changedTouches[0].pageY-window.pageYOffset)),vakata_dnd.is_drag&&$.vakata.dnd.stop({});try{e.currentTarget.unselectable="on",e.currentTarget.onselectstart=function(){return!1},e.currentTarget.style&&(e.currentTarget.style.MozUserSelect="none")}catch(ignore){}return vakata_dnd.init_x=e.pageX,vakata_dnd.init_y=e.pageY,vakata_dnd.data=data,vakata_dnd.is_down=!0,vakata_dnd.element=e.currentTarget,vakata_dnd.target=e.target,vakata_dnd.is_touch="touchstart"===e.type,html!==!1&&(vakata_dnd.helper=$("").html(html).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),$(document).on("mousemove.vakata.jstree touchmove.vakata.jstree",$.vakata.dnd.drag),$(document).on("mouseup.vakata.jstree touchend.vakata.jstree",$.vakata.dnd.stop),!1},drag:function(e){if("touchmove"===e.type&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e.target=document.elementFromPoint(e.originalEvent.changedTouches[0].pageX-window.pageXOffset,e.originalEvent.changedTouches[0].pageY-window.pageYOffset)),vakata_dnd.is_down){if(!vakata_dnd.is_drag){if(!(Math.abs(e.pageX-vakata_dnd.init_x)>(vakata_dnd.is_touch?$.vakata.dnd.settings.threshold_touch:$.vakata.dnd.settings.threshold)||Math.abs(e.pageY-vakata_dnd.init_y)>(vakata_dnd.is_touch?$.vakata.dnd.settings.threshold_touch:$.vakata.dnd.settings.threshold)))return;vakata_dnd.helper&&(vakata_dnd.helper.appendTo("body"),vakata_dnd.helper_w=vakata_dnd.helper.outerWidth()),vakata_dnd.is_drag=!0,$.vakata.dnd._trigger("start",e)}var d=!1,w=!1,dh=!1,wh=!1,dw=!1,ww=!1,dt=!1,dl=!1,ht=!1,hl=!1;return vakata_dnd.scroll_t=0,vakata_dnd.scroll_l=0,vakata_dnd.scroll_e=!1,$($(e.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test($(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var t=$(this),o=t.offset();if(this.scrollHeight>this.offsetHeight&&(o.top+t.height()-e.pageY<$.vakata.dnd.settings.scroll_proximity&&(vakata_dnd.scroll_t=1),e.pageY-o.top<$.vakata.dnd.settings.scroll_proximity&&(vakata_dnd.scroll_t=-1)),this.scrollWidth>this.offsetWidth&&(o.left+t.width()-e.pageX<$.vakata.dnd.settings.scroll_proximity&&(vakata_dnd.scroll_l=1),e.pageX-o.left<$.vakata.dnd.settings.scroll_proximity&&(vakata_dnd.scroll_l=-1)),vakata_dnd.scroll_t||vakata_dnd.scroll_l)return vakata_dnd.scroll_e=$(this),!1}),vakata_dnd.scroll_e||(d=$(document),w=$(window),dh=d.height(),wh=w.height(),dw=d.width(),ww=w.width(),dt=d.scrollTop(),dl=d.scrollLeft(),dh>wh&&e.pageY-dt<$.vakata.dnd.settings.scroll_proximity&&(vakata_dnd.scroll_t=-1),dh>wh&&wh-(e.pageY-dt)<$.vakata.dnd.settings.scroll_proximity&&(vakata_dnd.scroll_t=1),dw>ww&&e.pageX-dl<$.vakata.dnd.settings.scroll_proximity&&(vakata_dnd.scroll_l=-1),dw>ww&&ww-(e.pageX-dl)<$.vakata.dnd.settings.scroll_proximity&&(vakata_dnd.scroll_l=1),(vakata_dnd.scroll_t||vakata_dnd.scroll_l)&&(vakata_dnd.scroll_e=d)),vakata_dnd.scroll_e&&$.vakata.dnd._scroll(!0),vakata_dnd.helper&&(ht=parseInt(e.pageY+$.vakata.dnd.settings.helper_top,10),hl=parseInt(e.pageX+$.vakata.dnd.settings.helper_left,10),dh&&ht+25>dh&&(ht=dh-50),dw&&hl+vakata_dnd.helper_w>dw&&(hl=dw-(vakata_dnd.helper_w+2)),vakata_dnd.helper.css({left:hl+"px",top:ht+"px"})),$.vakata.dnd._trigger("move",e),!1}},stop:function(e){if("touchend"===e.type&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e.target=document.elementFromPoint(e.originalEvent.changedTouches[0].pageX-window.pageXOffset,e.originalEvent.changedTouches[0].pageY-window.pageYOffset)),vakata_dnd.is_drag)$.vakata.dnd._trigger("stop",e);else if("touchend"===e.type&&e.target===vakata_dnd.target){var to=setTimeout(function(){$(e.target).click()},100);$(e.target).one("click",function(){to&&clearTimeout(to)})}return $.vakata.dnd._clean(),!1}}}($),$.jstree.defaults.massload=null,$.jstree.plugins.massload=function(options,parent){this.init=function(el,options){parent.init.call(this,el,options),this._data.massload={}},this._load_nodes=function(nodes,callback,is_callback){var s=this.settings.massload;return is_callback&&!$.isEmptyObject(this._data.massload)?parent._load_nodes.call(this,nodes,callback,is_callback):$.isFunction(s)?s.call(this,nodes,$.proxy(function(data){if(data)for(var i in data)data.hasOwnProperty(i)&&(this._data.massload[i]=data[i]);parent._load_nodes.call(this,nodes,callback,is_callback)},this)):"object"==typeof s&&s&&s.url?(s=$.extend(!0,{},s),$.isFunction(s.url)&&(s.url=s.url.call(this,nodes)),$.isFunction(s.data)&&(s.data=s.data.call(this,nodes)),$.ajax(s).done($.proxy(function(data,t,x){if(data)for(var i in data)data.hasOwnProperty(i)&&(this._data.massload[i]=data[i]);parent._load_nodes.call(this,nodes,callback,is_callback)},this)).fail($.proxy(function(f){parent._load_nodes.call(this,nodes,callback,is_callback)},this))):parent._load_nodes.call(this,nodes,callback,is_callback)},this._load_node=function(obj,callback){var d=this._data.massload[obj.id];return d?this["string"==typeof d?"_append_html_data":"_append_json_data"](obj,"string"==typeof d?$($.parseHTML(d)).filter(function(){return 3!==this.nodeType}):d,function(status){callback.call(this,status),delete this._data.massload[obj.id]}):parent._load_node.call(this,obj,callback)}},$.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,show_only_matches_children:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},$.jstree.plugins.search=function(options,parent){this.bind=function(){parent.bind.call(this),this._data.search.str="",this._data.search.dom=$(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=!1,this._data.search.smc=!1,this.element.on("before_open.jstree",$.proxy(function(e,data){var i,j,r=this._data.search.res,s=[],o=$();if(r&&r.length&&(this._data.search.dom=$(this.element[0].querySelectorAll("#"+$.map(r,function(v){return"0123456789".indexOf(v[0])!==-1?"\\3"+v[0]+" "+v.substr(1).replace($.jstree.idregex,"\\$&"):v.replace($.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this._data.search.som&&this._data.search.res.length)){for(i=0,j=r.length;i32&&(options.fuzzy=!1),options.fuzzy&&(matchmask=1<=start;j--)if(charMatch=pattern_alphabet[text.charAt(j-1)],0===i?rd[j]=(rd[j+1]<<1|1)&charMatch:rd[j]=(rd[j+1]<<1|1)&charMatch|((lastRd[j+1]|lastRd[j])<<1|1)|lastRd[j+1],rd[j]&matchmask&&(score=match_bitapScore(i,j-1),score<=scoreThreshold)){if(scoreThreshold=score,bestLoc=j-1,locations.push(bestLoc),!(bestLoc>MATCH_LOCATION))break;start=Math.max(1,2*MATCH_LOCATION-bestLoc)}if(match_bitapScore(i+1,MATCH_LOCATION)>scoreThreshold)break;lastRd=rd}return{isMatch:bestLoc>=0,score:score}},txt===!0?{search:search}:search(txt)},$.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1}}($),$.jstree.defaults.sort=function(a,b){return this.get_text(a)>this.get_text(b)?1:-1},$.jstree.plugins.sort=function(options,parent){this.bind=function(){parent.bind.call(this),this.element.on("model.jstree",$.proxy(function(e,data){this.sort(data.parent,!0)},this)).on("rename_node.jstree create_node.jstree",$.proxy(function(e,data){this.sort(data.parent||data.node.parent,!1),this.redraw_node(data.parent||data.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",$.proxy(function(e,data){this.sort(data.parent,!1),this.redraw_node(data.parent,!0)},this))},this.sort=function(obj,deep){var i,j;if(obj=this.get_node(obj),obj&&obj.children&&obj.children.length&&(obj.children.sort($.proxy(this.settings.sort,this)),deep))for(i=0,j=obj.children_d.length;ik.ttl)&&(k&&k.state&&(k=k.state),k&&$.isFunction(this.settings.state.filter)&&(k=this.settings.state.filter.call(this,k)),!!k&&(this.element.one("set_state.jstree",function(e,data){data.instance.trigger("restore_state",{state:$.extend(!0,{},k)})}),this.set_state(k),!0))},this.clear_state=function(){return $.vakata.storage.del(this.settings.state.key)}},function($,undefined){$.vakata.storage={set:function(key,val){return window.localStorage.setItem(key,val)},get:function(key){return window.localStorage.getItem(key)},del:function(key){return window.localStorage.removeItem(key)}}}($),$.jstree.defaults.types={"#":{},default:{}},$.jstree.plugins.types=function(options,parent){this.init=function(el,options){var i,j;if(options&&options.types&&options.types.default)for(i in options.types)if("default"!==i&&"#"!==i&&options.types.hasOwnProperty(i))for(j in options.types.default)options.types.default.hasOwnProperty(j)&&options.types[i][j]===undefined&&(options.types[i][j]=options.types.default[j]);parent.init.call(this,el,options),this._model.data["#"].type="#"},this.refresh=function(skip_loading,forget_state){parent.refresh.call(this,skip_loading,forget_state),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",$.proxy(function(e,data){var i,j,m=this._model.data,dpc=data.nodes,t=this.settings.types,c="default";for(i=0,j=dpc.length;i .jstree-ocl",$.proxy(function(e){e.stopImmediatePropagation();var tmp=$.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});$(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",$.proxy(function(e){return e.stopImmediatePropagation(),this.is_disabled(e.currentTarget)||this.hover_node(e.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",$.proxy(function(e){this.dehover_node(e.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),parent.teardown.call(this)},this.redraw_node=function(obj,deep,callback,force_render){if(obj=parent.redraw_node.apply(this,arguments)){var tmp=div.cloneNode(!0);$.inArray(obj.id,this._data.core.selected)!==-1&&(tmp.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===obj.id&&(tmp.className+=" jstree-wholerow-hovered"),obj.insertBefore(tmp,obj.childNodes[0])}return obj}},document.registerElement&&Object&&Object.create){var proto=Object.create(HTMLElement.prototype);proto.createdCallback=function(){var i,c={core:{},plugins:[]};for(i in $.jstree.plugins)$.jstree.plugins.hasOwnProperty(i)&&this.attributes[i]&&(c.plugins.push(i),this.getAttribute(i)&&JSON.parse(this.getAttribute(i))&&(c[i]=JSON.parse(this.getAttribute(i))));for(i in $.jstree.defaults.core)$.jstree.defaults.core.hasOwnProperty(i)&&this.attributes[i]&&(c.core[i]=JSON.parse(this.getAttribute(i))||this.getAttribute(i));$(this).jstree(c)};try{document.registerElement("vakata-jstree",{prototype:proto})}catch(ignore){}}}});