trilium/libraries/fancytree/jquery.fancytree-all-deps.min.js

2 lines
122 KiB
JavaScript

!function(e){e.ui=e.ui||{};e.ui.version="1.12.1";var t=0,n=Array.prototype.slice;e.cleanData=function(t){return function(n){var i,r,o;for(o=0;null!=(r=n[o]);o++)try{(i=e._data(r,"events"))&&i.remove&&e(r).triggerHandler("remove")}catch(e){}t(n)}}(e.cleanData),e.widget=function(t,n,i){var r,o,s,a={},l=t.split(".")[0],d=l+"-"+(t=t.split(".")[1]);return i||(i=n,n=e.Widget),e.isArray(i)&&(i=e.extend.apply(null,[{}].concat(i))),e.expr[":"][d.toLowerCase()]=function(t){return!!e.data(t,d)},e[l]=e[l]||{},r=e[l][t],o=e[l][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,r,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),s=new n,s.options=e.widget.extend({},s.options),e.each(i,function(t,i){e.isFunction(i)?a[t]=function(){function e(){return n.prototype[t].apply(this,arguments)}function r(e){return n.prototype[t].apply(this,e)}return function(){var t,n=this._super,o=this._superApply;return this._super=e,this._superApply=r,t=i.apply(this,arguments),this._super=n,this._superApply=o,t}}():a[t]=i}),o.prototype=e.widget.extend(s,{widgetEventPrefix:r?s.widgetEventPrefix||t:t},a,{constructor:o,namespace:l,widgetName:t,widgetFullName:d}),r?(e.each(r._childConstructors,function(t,n){var i=n.prototype;e.widget(i.namespace+"."+i.widgetName,o,n._proto)}),delete r._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,r,o=n.call(arguments,1),s=0,a=o.length;s<a;s++)for(i in o[s])r=o[s][i],o[s].hasOwnProperty(i)&&void 0!==r&&(e.isPlainObject(r)?t[i]=e.isPlainObject(t[i])?e.widget.extend({},t[i],r):e.widget.extend({},r):t[i]=r);return t},e.widget.bridge=function(t,i){var r=i.prototype.widgetFullName||t;e.fn[t]=function(o){var s="string"==typeof o,a=n.call(arguments,1),l=this;return s?this.length||"instance"!==o?this.each(function(){var n,i=e.data(this,r);return"instance"===o?(l=i,!1):i?e.isFunction(i[o])&&"_"!==o.charAt(0)?(n=i[o].apply(i,a))!==i&&void 0!==n?(l=n&&n.jquery?l.pushStack(n.get()):n,!1):void 0:e.error("no such method '"+o+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+o+"'")}):l=void 0:(a.length&&(o=e.widget.extend.apply(null,[o].concat(a))),this.each(function(){var t=e.data(this,r);t?(t.option(o||{}),t._init&&t._init()):e.data(this,r,new i(o,this))})),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(n,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),n),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,function(e,n){t._removeClass(n,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var i,r,o,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},i=t.split("."),t=i.shift(),i.length){for(r=s[t]=e.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)r[i[o]]=r[i[o]]||{},r=r[i[o]];if(t=i.pop(),1===arguments.length)return void 0===r[t]?null:r[t];r[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=n}return this._setOptions(s),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var n,i,r;for(n in t)r=this.classesElementLookup[n],t[n]!==this.options.classes[n]&&r&&r.length&&(i=e(r.get()),this._removeClass(r,n),i.addClass(this._classes({element:i,keys:n,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){function n(n,o){var s,a;for(a=0;a<n.length;a++)s=r.classesElementLookup[n[a]]||e(),s=t.add?e(e.unique(s.get().concat(t.element.get()))):e(s.not(t.element).get()),r.classesElementLookup[n[a]]=s,i.push(n[a]),o&&t.classes[n[a]]&&i.push(t.classes[n[a]])}var i=[],r=this;return t=e.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&n(t.keys.match(/\S+/g)||[],!0),t.extra&&n(t.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(t){var n=this;e.each(n.classesElementLookup,function(i,r){-1!==e.inArray(t.target,r)&&(n.classesElementLookup[i]=e(r.not(t.target).get()))})},_removeClass:function(e,t,n){return this._toggleClass(e,t,n,!1)},_addClass:function(e,t,n){return this._toggleClass(e,t,n,!0)},_toggleClass:function(e,t,n,i){i="boolean"==typeof i?i:n;var r="string"==typeof e||null===e,o={extra:r?t:n,keys:r?e:t,element:r?this.element:e,add:i};return o.element.toggleClass(this._classes(o),i),this},_on:function(t,n,i){var r,o=this;"boolean"!=typeof t&&(i=n,n=t,t=!1),i?(n=r=e(n),this.bindings=this.bindings.add(n)):(i=n,n=this.element,r=this.widget()),e.each(i,function(i,s){function a(){if(t||!0!==o.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof s?o[s]:s).apply(o,arguments)}"string"!=typeof s&&(a.guid=s.guid=s.guid||a.guid||e.guid++);var l=i.match(/^([\w:-]*)\s*(.*)$/),d=l[1]+o.eventNamespace,c=l[2];c?r.on(d,c,a):n.on(d,a)})},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(n).off(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){var n=this;return setTimeout(function(){return("string"==typeof e?n[e]:e).apply(n,arguments)},t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,n,i){var r,o,s=this.options[t];if(i=i||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],o=n.originalEvent)for(r in o)r in n||(n[r]=o[r]);return this.element.trigger(n,i),!(e.isFunction(s)&&!1===s.apply(this.element[0],[n].concat(i))||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(i,r,o){"string"==typeof r&&(r={effect:r});var s,a=r?!0===r||"number"==typeof r?n:r.effect||n:t;"number"==typeof(r=r||{})&&(r={duration:r}),s=!e.isEmptyObject(r),r.complete=o,r.delay&&i.delay(r.delay),s&&e.effects&&e.effects.effect[a]?i[t](r):a!==t&&i[a]?i[a](r.duration,r.easing,o):i.queue(function(n){e(this)[t](),o&&o.call(i[0]),n()})}});e.widget;!function(){function t(e,t,n){return[parseFloat(e[0])*(c.test(e[0])?t/100:1),parseFloat(e[1])*(c.test(e[1])?n/100:1)]}function n(t,n){return parseInt(e.css(t,n),10)||0}var i,r=Math.max,o=Math.abs,s=/left|center|right/,a=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,c=/%$/,u=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==i)return i;var t,n,r=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=r.children()[0];return e("body").append(r),t=o.offsetWidth,r.css("overflow","scroll"),n=o.offsetWidth,t===n&&(n=r[0].clientWidth),r.remove(),i=t-n},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),r="scroll"===n||"auto"===n&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:r?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),i=e.isWindow(n[0]),r=!!n[0]&&9===n[0].nodeType;return{element:n,isWindow:i,isDocument:r,offset:!i&&!r?e(t).offset():{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},e.fn.position=function(i){if(!i||!i.of)return u.apply(this,arguments);i=e.extend({},i);var c,h,f,p,g,y,v=e(i.of),m=e.position.getWithinInfo(i.within),x=e.position.getScrollInfo(m),b=(i.collision||"flip").split(" "),C={};return y=function(t){var n=t[0];return 9===n.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}(v),v[0].preventDefault&&(i.at="left top"),h=y.width,f=y.height,p=y.offset,g=e.extend({},p),e.each(["my","at"],function(){var e,t,n=(i[this]||"").split(" ");1===n.length&&(n=s.test(n[0])?n.concat(["center"]):a.test(n[0])?["center"].concat(n):["center","center"]),n[0]=s.test(n[0])?n[0]:"center",n[1]=a.test(n[1])?n[1]:"center",e=l.exec(n[0]),t=l.exec(n[1]),C[this]=[e?e[0]:0,t?t[0]:0],i[this]=[d.exec(n[0])[0],d.exec(n[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===i.at[0]?g.left+=h:"center"===i.at[0]&&(g.left+=h/2),"bottom"===i.at[1]?g.top+=f:"center"===i.at[1]&&(g.top+=f/2),c=t(C.at,h,f),g.left+=c[0],g.top+=c[1],this.each(function(){var s,a,l=e(this),d=l.outerWidth(),u=l.outerHeight(),y=n(this,"marginLeft"),_=n(this,"marginTop"),k=d+y+n(this,"marginRight")+x.width,w=u+_+n(this,"marginBottom")+x.height,N=e.extend({},g),S=t(C.my,l.outerWidth(),l.outerHeight());"right"===i.my[0]?N.left-=d:"center"===i.my[0]&&(N.left-=d/2),"bottom"===i.my[1]?N.top-=u:"center"===i.my[1]&&(N.top-=u/2),N.left+=S[0],N.top+=S[1],s={marginLeft:y,marginTop:_},e.each(["left","top"],function(t,n){e.ui.position[b[t]]&&e.ui.position[b[t]][n](N,{targetWidth:h,targetHeight:f,elemWidth:d,elemHeight:u,collisionPosition:s,collisionWidth:k,collisionHeight:w,offset:[c[0]+S[0],c[1]+S[1]],my:i.my,at:i.at,within:m,elem:l})}),i.using&&(a=function(e){var t=p.left-N.left,n=t+h-d,s=p.top-N.top,a=s+f-u,c={target:{element:v,left:p.left,top:p.top,width:h,height:f},element:{element:l,left:N.left,top:N.top,width:d,height:u},horizontal:n<0?"left":t>0?"right":"center",vertical:a<0?"top":s>0?"bottom":"middle"};h<d&&o(t+n)<h&&(c.horizontal="center"),f<u&&o(s+a)<f&&(c.vertical="middle"),r(o(t),o(n))>r(o(s),o(a))?c.important="horizontal":c.important="vertical",i.using.call(this,e,c)}),l.offset(e.extend(N,{using:a}))})},e.ui.position={fit:{left:function(e,t){var n,i=t.within,o=i.isWindow?i.scrollLeft:i.offset.left,s=i.width,a=e.left-t.collisionPosition.marginLeft,l=o-a,d=a+t.collisionWidth-s-o;t.collisionWidth>s?l>0&&d<=0?(n=e.left+l+t.collisionWidth-s-o,e.left+=l-n):e.left=d>0&&l<=0?o:l>d?o+s-t.collisionWidth:o:l>0?e.left+=l:d>0?e.left-=d:e.left=r(e.left-a,e.left)},top:function(e,t){var n,i=t.within,o=i.isWindow?i.scrollTop:i.offset.top,s=t.within.height,a=e.top-t.collisionPosition.marginTop,l=o-a,d=a+t.collisionHeight-s-o;t.collisionHeight>s?l>0&&d<=0?(n=e.top+l+t.collisionHeight-s-o,e.top+=l-n):e.top=d>0&&l<=0?o:l>d?o+s-t.collisionHeight:o:l>0?e.top+=l:d>0?e.top-=d:e.top=r(e.top-a,e.top)}},flip:{left:function(e,t){var n,i,r=t.within,s=r.offset.left+r.scrollLeft,a=r.width,l=r.isWindow?r.scrollLeft:r.offset.left,d=e.left-t.collisionPosition.marginLeft,c=d-l,u=d+t.collisionWidth-a-l,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,f="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,p=-2*t.offset[0];c<0?((n=e.left+h+f+p+t.collisionWidth-a-s)<0||n<o(c))&&(e.left+=h+f+p):u>0&&((i=e.left-t.collisionPosition.marginLeft+h+f+p-l)>0||o(i)<u)&&(e.left+=h+f+p)},top:function(e,t){var n,i,r=t.within,s=r.offset.top+r.scrollTop,a=r.height,l=r.isWindow?r.scrollTop:r.offset.top,d=e.top-t.collisionPosition.marginTop,c=d-l,u=d+t.collisionHeight-a-l,h="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,p=-2*t.offset[1];c<0?((i=e.top+h+f+p+t.collisionHeight-a-s)<0||i<o(c))&&(e.top+=h+f+p):u>0&&((n=e.top-t.collisionPosition.marginTop+h+f+p-l)>0||o(n)<u)&&(e.top+=h+f+p)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}();e.ui.position,e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.fn.scrollParent=function(t){var n=this.css("position"),i="absolute"===n,r=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var t=e(this);return(!i||"static"!==t.css("position"))&&r.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==n&&o.length?o:e(this[0].ownerDocument||document)},e.fn.extend({uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}})}(jQuery),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree.ui-deps"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree.ui-deps"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(t,n){t||(n=n?": "+n:"",e.error("Fancytree assertion failed"+n))}function n(e,t){var n,i,r=window.console?window.console[e]:null;if(r)try{r.apply(window.console,t)}catch(e){for(i="",n=0;n<t.length;n++)i+=t[n];r(i)}}function i(){var t,n,r,o,s,a=arguments[0]||{},l=1,d=arguments.length;if("object"==typeof a||e.isFunction(a)||(a={}),l===d)throw"need at least two args";for(;l<d;l++)if(null!=(t=arguments[l]))for(n in t)r=a[n],a!==(o=t[n])&&(o&&e.isPlainObject(o)?(s=r&&e.isPlainObject(r)?r:{},a[n]=i(s,o)):void 0!==o&&(a[n]=o));return a}function r(e,t,n,i,r){return function(){var n=t[e],o=i[e],s=t.ext[r],a=function(){return n.apply(t,arguments)},l=function(e){return n.apply(t,e)};return function(){var e=t._local,n=t._super,i=t._superApply;try{return t._local=s,t._super=a,t._superApply=l,o.apply(t,arguments)}finally{t._local=e,t._super=n,t._superApply=i}}}()}function o(t,n,i,o){for(var s in i)"function"==typeof i[s]?"function"==typeof t[s]?t[s]=r(s,t,0,i,o):"_"===s.charAt(0)?t.ext[o][s]=r(s,t,0,i,o):e.error("Could not override tree."+s+". Use prefix '_' to create tree."+o+"._"+s):"options"!==s&&(t.ext[o][s]=i[s])}function s(t,n){return void 0===t?e.Deferred(function(){this.resolve()}).promise():e.Deferred(function(){this.resolveWith(t,n)}).promise()}function a(t,n){return void 0===t?e.Deferred(function(){this.reject()}).promise():e.Deferred(function(){this.rejectWith(t,n)}).promise()}function l(e,t){return function(){e.resolveWith(t)}}function d(t){var n=e.extend({},t.data()),i=n.json;return delete n.fancytree,delete n.uiFancytree,i&&(delete n.json,n=e.extend(n,i)),n}function c(e){return(""+e).replace(x,function(e){return C[e]})}function u(e){return e=e.toLowerCase(),function(t){return t.title.toLowerCase().indexOf(e)>=0}}function h(n,i){var r,o,s,a;for(this.parent=n,this.tree=n.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},r=0,o=A.length;r<o;r++)this[s=A[r]]=i[s];null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),i.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),i.data&&e.extend(this.data,i.data);for(s in i)O[s]||e.isFunction(i[s])||P[s]||(this.data[s]=i[s]);null==this.key?this.tree.options.defaultKey?(this.key=this.tree.options.defaultKey(this),t(this.key,"defaultKey() must return a unique key")):this.key="_"+y._nextNodeKey++:this.key=""+this.key,i.active&&(t(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),i.selected&&(this.tree.lastSelectedNode=this),(a=i.children)?a.length?this._setChildren(a):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function f(t){this.widget=t,this.$div=t.element,this.options=t.options,this.options&&(e.isFunction(this.options.lazyload)&&!e.isFunction(this.options.lazyLoad)&&(this.options.lazyLoad=function(){return y.warn("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),t.options.lazyload.apply(this,arguments)}),e.isFunction(this.options.loaderror)&&e.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&y.warn("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&e.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=d(this.$div),this._id=e.ui.fancytree._nextId++,this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var n,i={tree:this};this.rootNode=new h(i,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,n=e("<ul>",{class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=n,this.rootNode.ul=n[0],null==this.options.debugLevel&&(this.options.debugLevel=y.debugLevel)}{if(!e.ui||!e.ui.fancytree){var p,g,y=null,v=new RegExp(/\.|\//),m=/[&<>"'\/]/g,x=/[<>"'\/]/g,b="$recursive_request",C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},_={16:!0,17:!0,18:!0},k={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},w={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},N={0:"",1:"left",2:"middle",3:"right"},S="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),E={},T="columns types".split(" "),A="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),O={},F={},P={active:!0,children:!0,data:!0,focus:!0};for(p=0;p<S.length;p++)E[S[p]]=!0;for(p=0;p<A.length;p++)g=A[p],O[g]=!0,g!==g.toLowerCase()&&(F[g.toLowerCase()]=g);return t(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),h.prototype={_findDirectChild:function(e){var t,n,i=this.children;if(i)if("string"==typeof e){for(t=0,n=i.length;t<n;t++)if(i[t].key===e)return i[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){t(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var n=0,i=e.length;n<i;n++)this.children.push(new h(this,e[n]))},addChildren:function(n,i){var r,o,s,a=this.getFirstChild(),l=this.getLastChild(),d=null,c=[];for(e.isPlainObject(n)&&(n=[n]),this.children||(this.children=[]),r=0,o=n.length;r<o;r++)c.push(new h(this,n[r]));if(d=c[0],null==i?this.children=this.children.concat(c):(i=this._findDirectChild(i),t((s=e.inArray(i,this.children))>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[s,0].concat(c))),a&&!i){for(r=0,o=c.length;r<o;r++)c[r].render();a!==this.getFirstChild()&&a.renderStatus(),l!==this.getLastChild()&&l.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===c.length?c[0]:null),d},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,n){switch(void 0!==n&&"over"!==n||(n="child"),n){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var i=this.children?this.children[0]:null;return this.addChildren(e,i);case"child":case"over":return this.addChildren(e)}t(!1,"Invalid mode: "+n)},addPagingNode:function(t,n){var i,r;n=n||"child";{if(!1!==t)return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,n);for(i=this.children.length-1;i>=0;i--)"paging"===(r=this.children[i]).statusNodeType&&this.removeChild(r);this.partload=!1}},appendSibling:function(e){return this.addNode(e,"after")},applyPatch:function(t){if(null===t)return this.remove(),s(this);var n,i,r={children:!0,expanded:!0,parent:!0};for(n in t)i=t[n],r[n]||e.isFunction(i)||(O[n]?this[n]=i:this.data[n]=i);return t.hasOwnProperty("children")&&(this.removeChildren(),t.children&&this._setChildren(t.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),t.hasOwnProperty("expanded")?this.setExpanded(t.expanded):s(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,n){return e.addNode(this.toDict(!0,n),t)},countChildren:function(e){var t,n,i,r=this.children;if(!r)return 0;if(i=r.length,!1!==e)for(t=0,n=i;t<n;t++)i+=r[t].countChildren();return i},debug:function(e){this.tree.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),n("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){var t=e?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(t,this)},error:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),n("error",arguments))},findAll:function(t){t=e.isFunction(t)?t:u(t);var n=[];return this.visit(function(e){t(e)&&n.push(e)}),n},findFirst:function(t){t=e.isFunction(t)?t:u(t);var n=null;return this.visit(function(e){if(t(e))return n=e,!1}),n},_changeSelectStatusAttrs:function(e){var n=!1,i=this.tree.options,r=y.evalOption("unselectable",this,this,i,!1),o=y.evalOption("unselectableStatus",this,this,i,void 0);switch(r&&null!=o&&(e=o),e){case!1:n=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:n=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:n=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:t(!1,"invalid state: "+e)}return n&&this.renderStatus(),n},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit(function(e){e._changeSelectStatusAttrs(t)}),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){function n(e){var t,r,o,s,a,l,d,c,u=e.children;if(u&&u.length){for(l=!0,d=!1,t=0,r=u.length;t<r;t++)s=n(o=u[t]),y.evalOption("unselectableIgnore",o,o,i,!1)||(!1!==s&&(d=!0),!0!==s&&(l=!1));a=!!l||!!d&&void 0}else a=null==(c=y.evalOption("unselectableStatus",e,e,i,void 0))?!!e.selected:!!c;return e._changeSelectStatusAttrs(a),a}var i=this.tree.options;t(3===i.selectMode,"expected selectMode 3"),n(this),this.visitParents(function(e){var t,n,r,o,s,a=e.children,l=!0,d=!1;for(t=0,n=a.length;t<n;t++)r=a[t],y.evalOption("unselectableIgnore",r,r,i,!1)||(((o=null==(s=y.evalOption("unselectableStatus",r,r,i,void 0))?!!r.selected:!!s)||r.partsel)&&(d=!0),o||(l=!1));o=!!l||!!d&&void 0,e._changeSelectStatusAttrs(o)})},fromDict:function(t){for(var n in t)O[n]?this[n]=t[n]:"data"===n?e.extend(this.data,t.data):e.isFunction(t[n])||P[n]||(this.data[n]=t[n]);t.children&&(this.removeChildren(),this.addChildren(t.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return e.inArray(this,this.parent.children)},getIndexHier:function(t,n){t=t||".";var i,r=[];return e.each(this.getParentList(!1,!0),function(e,t){i=""+(t.getIndex()+1),n&&(i=("0000000"+i).substr(-n)),r.push(i)}),r.join(t)},getKeyPath:function(e){var t=[],n=this.tree.options.keyPathSeparator;return this.visitParents(function(e){e.parent&&t.unshift(e.key)},!e),n+t.join(n)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},getNextSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=0,t=n.length-1;e<t;e++)if(n[e]===this)return n[e+1]}return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var n=[],i=t?this:this.parent;i;)(e||i.parent)&&n.unshift(i),i=i.parent;return n},getPrevSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=1,t=n.length;e<t;e++)if(n[e]===this)return n[e-1]}return null},getSelectedNodes:function(e){var t=[];return this.visit(function(n){if(n.selected&&(t.push(n),!0===e))return"skip"}),t},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(e){this.tree.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),n("info",arguments))},isActive:function(){return this.tree.activeNode===this},isBelowOf:function(e){return this.getIndexHier(".",5)>e.getIndexHier(".",5)},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(t){if(!t||t.tree!==this.tree)return!1;for(var n=this.parent;n;){if(n===t)return!0;n===n.parent&&e.error("Recursive parent link: "+n),n=n.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var e=this.parent;return!e||e.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var e=this.parent;return!e||e.children[e.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var e,t,n=this.getParentList(!1,!1);for(e=0,t=n.length;e<t;e++)if(!n[e].expanded)return!1;return!0},lazyLoad:function(e){return this.warn("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead."),this.load(e)},load:function(e){var n,i,r=this,o=this.isExpanded();return t(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(i=this.tree._triggerNodeEvent("lazyLoad",this))?s(this):(t("boolean"!=typeof i,"lazyLoad event must return source in data.result"),n=this.tree._callHook("nodeLoadChildren",this,i),o?(this.expanded=!0,n.always(function(){r.render()})):n.always(function(){r.renderStatus()}),n)):s(this)},makeVisible:function(t){var n,i=this,r=[],o=new e.Deferred,s=this.getParentList(!1,!1),a=s.length,l=!(t&&!0===t.noAnimation),d=!(t&&!1===t.scrollIntoView);for(n=a-1;n>=0;n--)r.push(s[n].setExpanded(!0,t));return e.when.apply(e,r).done(function(){d?i.scrollIntoView(l).done(function(){o.resolve()}):o.resolve()}),o.promise()},moveTo:function(n,i,r){void 0===i||"over"===i?i="child":"firstChild"===i&&(n.children&&n.children.length?(i="before",n=n.children[0]):i="child");var o,s=this.parent,a="child"===i?n:n.parent;if(this!==n){if(this.parent?a.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),a!==s&&s.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===a)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else t((o=e.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(o,1);if(this.parent=a,a.hasChildren())switch(i){case"child":a.children.push(this);break;case"before":t((o=e.inArray(n,a.children))>=0,"invalid target parent"),a.children.splice(o,0,this);break;case"after":t((o=e.inArray(n,a.children))>=0,"invalid target parent"),a.children.splice(o+1,0,this);break;default:e.error("Invalid mode "+i)}else a.children=[this];r&&n.visit(r,!0),a===s?a.triggerModifyChild("move",this):a.triggerModifyChild("add",this),this.tree!==n.tree&&(this.warn("Cross-tree moveTo is experimantal!"),this.visit(function(e){e.tree=n.tree},!0)),s.isDescendantOf(a)||s.render(),a.isDescendantOf(s)||a===s||a.render()}},navigate:function(t,n){function i(i){if(i){try{i.makeVisible({scrollIntoView:!1})}catch(e){}return e(i.span).is(":visible")?!1===n?i.setFocus():i.setActive():(i.debug("Navigate: skipping hidden node"),void i.navigate(t,n))}}var r,o,a,l=e.ui.keyCode,d=null;switch(t){case l.BACKSPACE:this.parent&&this.parent.parent&&(a=i(this.parent));break;case l.HOME:this.tree.visit(function(t){if(e(t.span).is(":visible"))return a=i(t),!1});break;case l.END:this.tree.visit(function(t){e(t.span).is(":visible")&&(a=t)}),a&&(a=i(a));break;case l.LEFT:this.expanded?(this.setExpanded(!1),a=i(this)):this.parent&&this.parent.parent&&(a=i(this.parent));break;case l.RIGHT:this.expanded||!this.children&&!this.lazy?this.children&&this.children.length&&(a=i(this.children[0])):(this.setExpanded(),a=i(this));break;case l.UP:for(d=this.getPrevSibling();d&&!e(d.span).is(":visible");)d=d.getPrevSibling();for(;d&&d.expanded&&d.children&&d.children.length;)d=d.children[d.children.length-1];!d&&this.parent&&this.parent.parent&&(d=this.parent),a=i(d);break;case l.DOWN:if(this.expanded&&this.children&&this.children.length)d=this.children[0];else for(r=(o=this.getParentList(!1,!0)).length-1;r>=0;r--){for(d=o[r].getNextSibling();d&&!e(d.span).is(":visible");)d=d.getNextSibling();if(d)break}a=i(d);break;default:!1}return a||s()},remove:function(){return this.parent.removeChild(this)},removeChild:function(e){return this.tree._callHook("nodeRemoveChild",this,e)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(e){return this.toggleClass(e,!1)},render:function(e,t){return this.tree._callHook("nodeRender",this,e,t)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(n){var i,r=this.parent,o=e.inArray(this,r.children),s=this;return t(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(i=this.tree._callHook("nodeLoadChildren",this,n)).done(function(e){var t=s.children;for(p=0;p<t.length;p++)t[p].parent=r;r.children.splice.apply(r.children,[o+1,0].concat(t)),s.children=null,s.remove(),r.render()}).fail(function(){s.setExpanded()}),i},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(t,n){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.debug("clearTimeout(%o)",this.tree.timer)),this.tree.timer=null;var i=this;switch(t){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){i.tree.debug("setTimeout: trigger expand"),i.setExpanded(!0)},n);break;case"activate":this.tree.timer=setTimeout(function(){i.tree.debug("setTimeout: trigger activate"),i.setActive(!0)},n);break;default:e.error("Invalid mode "+t)}},scrollIntoView:function(n,i){if(void 0!==i&&function(e){return!(!e.tree||void 0===e.statusNodeType)}(i))throw"scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.";var r=e.extend({effects:!0===n?{duration:200,queue:!1}:n,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},i),o=r.scrollParent,a=this.tree.$container,l=a.css("overflow-y");o?o.jquery||(o=e(o)):o=this.tree.tbody?a.scrollParent():"scroll"===l||"auto"===l?a:a.scrollParent(),o[0]!==document&&o[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",o[0]),o=e(window));var d,c,u,h=new e.Deferred,f=this,p=e(this.span).height(),g=r.scrollOfs.top||0,y=r.scrollOfs.bottom||0,v=o.height(),m=o.scrollTop(),x=o,b=o[0]===window,C=r.topNode||null,_=null;return e(this.span).is(":visible")?(b?(c=e(this.span).offset().top,d=C&&C.span?e(C.span).offset().top:0,x=e("html,body")):(t(o[0]!==document&&o[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),u=o.offset().top,c=e(this.span).offset().top-u+m,d=C?e(C.span).offset().top-u+m:0,v-=Math.max(0,o.innerHeight()-o[0].clientHeight)),c<m+g?_=c-g:c+p>m+v-y&&(_=c+p-v+y,C&&(t(C.isRootNode()||e(C.span).is(":visible"),"topNode must be visible"),d<_&&(_=d-g))),null!==_?r.effects?(r.effects.complete=function(){h.resolveWith(f)},x.stop(!0).animate({scrollTop:_},r.effects)):(x[0].scrollTop=_,h.resolveWith(this)):h.resolveWith(this),h.promise()):(this.warn("scrollIntoView(): node is invisible."),s())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,n){return this.tree._callHook("nodeSetStatus",this,e,t,n)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var n,i,r=this.children;if(r){if(e=e||function(e,t){var n=e.title.toLowerCase(),i=t.title.toLowerCase();return n===i?0:n>i?1:-1},r.sort(e),t)for(n=0,i=r.length;n<i;n++)r[n].children&&r[n].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,n){var i,r,o,s={},a=this;if(e.each(A,function(e,t){(a[t]||!1===a[t])&&(s[t]=a[t])}),e.isEmptyObject(this.data)||(s.data=e.extend({},this.data),e.isEmptyObject(s.data)&&delete s.data),n&&n(s,a),t&&this.hasChildren())for(s.children=[],i=0,r=this.children.length;i<r;i++)(o=this.children[i]).isStatusNode()||s.children.push(o.toDict(!0,n));return s},toggleClass:function(t,n){var i,r,o=t.match(/\S+/g)||[],s=0,a=!1,l=this[this.tree.statusClassPropName],d=" "+(this.extraClasses||"")+" ";for(l&&e(l).toggleClass(t,n);i=o[s++];)if(r=d.indexOf(" "+i+" ")>=0,n=void 0===n?!r:!!n)r||(d+=i+" ",a=!0);else for(;d.indexOf(" "+i+" ")>-1;)d=d.replace(" "+i+" "," ");return this.extraClasses=e.trim(d),a},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"FancytreeNode@"+this.key+"[title='"+this.title+"']"},triggerModifyChild:function(t,n,i){var r,o=this.tree.options.modifyChild;o&&(n&&n.parent!==this&&e.error("childNode "+n+" is not a child of "+this),r={node:this,tree:this.tree,operation:t,childNode:n||null},i&&e.extend(r,i),o({type:"modifyChild"},r))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var n,i,r=!0,o=this.children;if(!0===t&&(!1===(r=e(this))||"skip"===r))return r;if(o)for(n=0,i=o.length;n<i&&!1!==(r=o[n].visit(e,!0));n++);return r},visitAndLoad:function(t,n,i){var r,o,a,l=this;return!t||!0!==n||!1!==(o=t(l))&&"skip"!==o?l.children||l.lazy?(r=new e.Deferred,a=[],l.load().done(function(){for(var n=0,i=l.children.length;n<i;n++){if(!1===(o=l.children[n].visitAndLoad(t,!0,!0))){r.reject();break}"skip"!==o&&a.push(o)}e.when.apply(this,a).then(function(){r.resolve()})}),r.promise()):s():i?o:s()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var n=this.parent;n;){if(!1===e(n))return!1;n=n.parent}return!0},visitSiblings:function(e,t){var n,i,r,o=this.parent.children;for(n=0,i=o.length;n<i;n++)if(r=o[n],(t||r!==this)&&!1===e(r))return!1;return!0},warn:function(e){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),n("warn",arguments))}},f.prototype={_makeHookContext:function(t,n,i){var r,o;return void 0!==t.node?(n&&t.originalEvent!==n&&e.error("invalid args"),r=t):t.tree?r={node:t,tree:o=t.tree,widget:o.widget,options:o.widget.options,originalEvent:n,typeInfo:o.types[t.type]||{}}:t.widget?r={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:n}:e.error("invalid args"),i&&e.extend(r,i),r},_callHook:function(t,n,i){var r=this._makeHookContext(n),o=this[t],s=Array.prototype.slice.call(arguments,2);return e.isFunction(o)||e.error("_callHook('"+t+"') is not a function"),s.unshift(r),o.apply(this,s)},_setExpiringValue:function(e,t,n){this._tempCache[e]={value:t,expire:Date.now()+(+n||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_requireExtension:function(n,i,r,o){null!=r&&(r=!!r);var s=this._local.name,a=this.options.extensions,l=e.inArray(n,a)<e.inArray(s,a),d=i&&null==this.ext[n],c=!d&&null!=r&&r!==l;return t(s&&s!==n,"invalid or same name"),!d&&!c||(o||(d||i?(o="'"+s+"' extension requires '"+n+"'",c&&(o+=" to be registered "+(r?"before":"after")+" itself")):o="If used together, `"+n+"` must be registered "+(r?"before":"after")+" `"+s+"`"),e.error(o),!1)},activateKey:function(e,t){var n=this.getNodeByKey(e);return n?n.setActive(!0,t):this.activeNode&&this.activeNode.setActive(!1,t),n},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyPatch:function(n){var i,r,o,s,a,d,c=n.length,u=[];for(r=0;r<c;r++)t(2===(o=n[r]).length,"patchList must be an array of length-2-arrays"),s=o[0],a=o[1],(d=null===s?this.rootNode:this.getNodeByKey(s))?(i=new e.Deferred,u.push(i),d.applyPatch(a).always(l(i,d))):this.warn("could not find node with key '"+s+"'");return e.when.apply(e,u).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){this.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),n("log",arguments))},enable:function(e){!1===e?this.widget.disable():this.widget.enable()},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!e?e:(this._enableUpdate=e,e?(this.debug("enableUpdate(true): redraw "),this.render()):this.debug("enableUpdate(false)..."),!e)},expandAll:function(e,t){e=!1!==e,this.visit(function(n){!1!==n.hasChildren()&&n.isExpanded()!==e&&n.setExpanded(e,t)})},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(t,n,i){t="string"==typeof t?function(e){var t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}(t):t;var r=null,o=(n=n||this.getFirstChild()).parent.children,s=null,a=function(e,t,n){var i,r,o=e.children,s=o.length,l=o[t];if(l&&!1===n(l))return!1;if(l&&l.children&&l.expanded&&!1===a(l,0,n))return!1;for(i=t+1;i<s;i++)if(!1===a(e,i,n))return!1;return(r=e.parent)?a(r,r.children.indexOf(e)+1,n):a(e,0,n)};return a(n.parent,o.indexOf(n),function(i){if(i===r)return!1;r=r||i;{if(e(i.span).is(":visible"))return(!t(i)||(s=i)===n)&&void 0;i.debug("quicksearch: skipping hidden node")}}),s},generateFormElements:function(t,n,i){function r(t){d.append(e("<input>",{type:"checkbox",name:s,value:t.key,checked:!0}))}i=i||{};var o,s="string"==typeof t?t:"ft_"+this._id+"[]",a="string"==typeof n?n:"ft_"+this._id+"_active",l="fancytree_result_"+this._id,d=e("#"+l),c=3===this.options.selectMode&&!1!==i.stopOnParents;d.length?d.empty():d=e("<div>",{id:l}).hide().insertAfter(this.$container),!1!==n&&this.activeNode&&d.append(e("<input>",{type:"radio",name:a,value:this.activeNode.key,checked:!0})),i.filter?this.visit(function(e){var t=i.filter(e);if("skip"===t)return t;!1!==t&&r(e)}):!1!==t&&(o=this.getSelectedNodes(c),e.each(o,function(e,t){r(t)}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getOption:function(e){return this.widget.option(e)},getNodeByKey:function(e,t){var n,i;return!t&&(n=document.getElementById(this.options.idPrefix+e))?n.ftnode?n.ftnode:null:(t=t||this.rootNode,i=null,t.visit(function(t){if(t.key===e)return i=t,!1},!0),i)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){this.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),n("info",arguments))},loadKeyPath:function(t,n){var i,r,o,s=this,a=new e.Deferred,l=this.getRootNode(),d=this.options.keyPathSeparator,c=[],u=e.extend({},n);for("function"==typeof n?i=n:n&&n.callback&&(i=n.callback),u.callback=function(e,t,n){i&&i.call(e,t,n),a.notifyWith(e,[{node:t,status:n}])},null==u.matchKey&&(u.matchKey=function(e,t){return e.key===t}),e.isArray(t)||(t=[t]),r=0;r<t.length;r++)(o=t[r]).charAt(0)===d&&(o=o.substr(1)),c.push(o.split(d));return setTimeout(function(){s._loadKeyPathImpl(a,u,l,c).done(function(){a.resolve()})},0),a.promise()},_loadKeyPathImpl:function(t,n,i,r){function o(e,t){var i,r,o=e.children;if(o)for(i=0,r=o.length;i<r;i++)if(n.matchKey(o[i],t))return o[i];return null}function s(e,t,i){n.callback(y,t,"loading"),t.load().done(function(){y._loadKeyPathImpl.call(y,e,n,t,i).always(l(e,y))}).fail(function(i){y.warn("loadKeyPath: error loading lazy "+t),n.callback(y,u,"error"),e.rejectWith(y)})}var a,d,c,u,h,f,p,g,y=this;for(h={},d=0;d<r.length;d++)for(p=r[d],f=i;p.length;){if(c=p.shift(),!(u=o(f,c))){this.warn("loadKeyPath: key not found: "+c+" (parent: "+f+")"),n.callback(this,c,"error");break}if(0===p.length){n.callback(this,u,"ok");break}if(u.lazy&&void 0===u.hasChildren()){n.callback(this,u,"loaded"),h[c=u.key]?h[c].pathSegList.push(p):h[c]={parent:u,pathSegList:[p]};break}n.callback(this,u,"loaded"),f=u}a=[];for(var v in h){var m=h[v];g=new e.Deferred,a.push(g),s(g,m.parent,m.pathSegList)}return e.when.apply(e,a).promise()},reactivate:function(e){var t,n=this.activeNode;return n?(this.activeNode=null,t=n.setActive(!0,{noFocus:!0}),e&&n.setFocus(),t):s()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},selectAll:function(e){this.visit(function(t){t.setSelected(e)})},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},setOption:function(e,t){return this.widget.option(e,t)},toDict:function(e,t){var n=this.rootNode.toDict(!0,t);return e?n:n.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,n,i){var r=this._makeHookContext(t,n,i),o=this.widget._trigger(e,n,r);return!1!==o&&void 0!==r.result?r.result:o},_triggerTreeEvent:function(e,t,n){var i=this._makeHookContext(this,t,n),r=this.widget._trigger(e,t,i);return!1!==r&&void 0!==i.result?i.result:r},visit:function(e){return this.rootNode.visit(e,!1)},visitRows:function(e,t){if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);var n,i,r,o=0,s=!1===t.includeSelf,a=!!t.includeHidden,l=t.start||this.rootNode.children[0];for(i=l.parent;i;){for(n=(r=i.children).indexOf(l)+o;n<r.length;n++){if(l=r[n],!s&&!1===e(l))return!1;if(s=!1,l.children&&l.children.length&&(a||l.expanded)&&!1===l.visit(function(t){return!1!==e(t)&&(a||!t.children||t.expanded?void 0:"skip")},!1))return!1}l=i,i=i.parent,o=1}return!0},_visitRowsUp:function(t,n){for(var i,r,o=!!n.includeHidden,s=n.start||this.rootNode.children[0];;){if(r=s.parent,(i=r.children)[0]===s)s=r,i=r.children;else for(s=i[i.indexOf(s)-1];(o||s.expanded)&&s.children&&s.children.length;)r=s,s=(i=s.children)[i.length-1];if((o||e(s.span).is(":visible"))&&!1===t(s))return!1}},warn:function(e){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),n("warn",arguments))}},e.extend(f.prototype,{nodeClick:function(e){var t,n,i=e.targetType,r=e.node;if("expander"===i){if(r.isLoading())return void r.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===i)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(n=!1,t=!0,r.folder)switch(e.options.clickFolderMode){case 2:n=!0,t=!1;break;case 3:t=!0,n=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),n&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var n,i,r,o=e.node;if(o.parent)for(i=0,r=(n=o.parent.children).length;i<r;i++)n[i]!==o&&n[i].expanded&&this._callHook("nodeSetExpanded",n[i],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(t){var n,i,r,o=t.originalEvent,s=t.node,a=t.tree,l=t.options,d=o.which,c=o.key||String.fromCharCode(d),u=!!(o.altKey||o.ctrlKey||o.metaKey),h=!w[d]&&!k[d]&&!u,f=e(o.target),p=!0,g=!(o.ctrlKey||!l.autoActivate);if(s||(r=this.getActiveNode()||this.getFirstChild())&&(r.setFocus(),(s=t.node=this.focusNode).debug("Keydown force focus on active node")),l.quicksearch&&h&&!f.is(":input:enabled"))return(i=Date.now())-a.lastQuicksearchTime>500&&(a.lastQuicksearchTerm=""),a.lastQuicksearchTime=i,a.lastQuicksearchTerm+=c,(n=a.findNextNode(a.lastQuicksearchTerm,a.getActiveNode()))&&n.setActive(),void o.preventDefault();switch(y.eventToString(o)){case"+":case"=":a.nodeSetExpanded(t,!0);break;case"-":a.nodeSetExpanded(t,!1);break;case"space":s.isPagingNode()?a._triggerNodeEvent("clickPaging",t,o):y.evalOption("checkbox",s,s,l,!1)?a.nodeToggleSelected(t):a.nodeSetActive(t,!0);break;case"return":a.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":s.navigate(o.which,g);break;default:p=!1}p&&o.preventDefault()},nodeLoadChildren:function(n,i){var r,o,s,a=n.tree,l=n.node,d=Date.now();if(e.isFunction(i)&&(i=i.call(a,{type:"source"},n),t(!e.isFunction(i),"source callback must not return another function")),i.url&&(l._requestId&&l.warn("Recursive load request #"+d+" while #"+l._requestId+" is pending."),r=e.extend({},n.options.ajax,i),l._requestId=d,r.debugDelay?(o=r.debugDelay,delete r.debugDelay,e.isArray(o)&&(o=o[0]+Math.random()*(o[1]-o[0])),l.warn("nodeLoadChildren waiting debugDelay "+Math.round(o)+" ms ..."),s=e.Deferred(function(t){setTimeout(function(){e.ajax(r).done(function(){t.resolveWith(this,arguments)}).fail(function(){t.rejectWith(this,arguments)})},o)})):s=e.ajax(r),i=new e.Deferred,s.done(function(t,r,o){var s,c;if("json"!==this.dataType&&"jsonp"!==this.dataType||"string"!=typeof t||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),l._requestId&&l._requestId>d)i.rejectWith(this,[b]);else{if(n.options.postProcess){try{c=a._triggerNodeEvent("postProcess",n,n.originalEvent,{response:t,error:null,dataType:this.dataType})}catch(e){c={error:e,message:""+e,details:"postProcess failed"}}if(c.error)return s=e.isPlainObject(c.error)?c.error:{message:c.error},s=a._makeHookContext(l,null,s),void i.rejectWith(this,[s]);(e.isArray(c)||e.isPlainObject(c)&&e.isArray(c.children))&&(t=c)}else t&&t.hasOwnProperty("d")&&n.options.enableAspx&&(t="string"==typeof t.d?e.parseJSON(t.d):t.d);i.resolveWith(this,[t])}}).fail(function(e,t,n){var r=a._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:n,details:e.status+": "+n});i.rejectWith(this,[r])})),e.isFunction(i.then)&&e.isFunction(i.catch)&&(s=i,i=new e.Deferred,s.then(function(e){i.resolve(e)},function(e){i.reject(e)})),e.isFunction(i.promise))a.nodeSetStatus(n,"loading"),i.done(function(e){a.nodeSetStatus(n,"ok"),l._requestId=null}).fail(function(e){var t;e!==b?(e.node&&e.error&&e.message?t=e:"[object Object]"===(t=a._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(t.message=""),l.warn("Load children failed ("+t.message+")",t),!1!==a._triggerNodeEvent("loadError",t,null)&&a.nodeSetStatus(n,"error",t.message,t.details)):l.warn("Ignored response for obsolete load request #"+d+" (expected #"+l._requestId+")")});else if(n.options.postProcess){var c=a._triggerNodeEvent("postProcess",n,n.originalEvent,{response:i,error:null,dataType:typeof i});(e.isArray(c)||e.isPlainObject(c)&&e.isArray(c.children))&&(i=c)}return e.when(i).done(function(i){var r,o;e.isPlainObject(i)&&(t(l.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),t(e.isArray(i.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),r=i,i=i.children,delete r.children,e.each(T,function(e,t){void 0!==r[t]&&(a[t]=r[t],delete r[t])}),e.extend(a.data,r)),t(e.isArray(i),"expected array of children"),l._setChildren(i),a.options.nodata&&0===i.length&&(e.isFunction(a.options.nodata)?o=a.options.nodata.call(a,{type:"nodata"},n):!0===a.options.nodata&&l.isRootNode()?o=a.options.strings.nodata:"string"==typeof a.options.nodata&&l.isRootNode()&&(o=a.options.nodata),o&&l.setStatus("nodata",o)),a._triggerNodeEvent("loadChildren",l)})},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(n,i){var r,o=n.node,s=e.extend({},n,{node:i}),a=o.children;if(1===a.length)return t(i===a[0],"invalid single child"),this.nodeRemoveChildren(n);this.activeNode&&(i===this.activeNode||this.activeNode.isDescendantOf(i))&&this.activeNode.setActive(!1),this.focusNode&&(i===this.focusNode||this.focusNode.isDescendantOf(i))&&(this.focusNode=null),this.nodeRemoveMarkup(s),this.nodeRemoveChildren(s),t((r=e.inArray(i,a))>=0,"invalid child"),o.triggerModifyChild("remove",i),i.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,i),a.splice(r,1)},nodeRemoveChildMarkup:function(t){var n=t.node;n.ul&&(n.isRootNode()?e(n.ul).empty():(e(n.ul).remove(),n.ul=null),n.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(t){var n=t.tree,i=t.node;i.children&&(this.activeNode&&this.activeNode.isDescendantOf(i)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(i)&&(this.focusNode=null),this.nodeRemoveChildMarkup(t),e.extend({},t),i.triggerModifyChild("remove",null),i.visit(function(e){e.parent=null,n._callHook("treeRegisterNode",n,!1,e)}),i.lazy?i.children=[]:i.children=null,i.isRootNode()||(i.expanded=!1),this.nodeRenderStatus(t))},nodeRemoveMarkup:function(t){var n=t.node;n.li&&(e(n.li).remove(),n.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(n,i,r,o,s){var a,l,d,c,u,h,f,p=n.node,g=n.tree,y=n.options,v=y.aria,m=!1,x=p.parent,b=!x,C=p.children,_=null;if(!1!==g._enableUpdate&&(b||x.ul)){if(t(b||x.ul,"parent UL must exist"),b||(p.li&&(i||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode===p.parent.ul?_=p.li.nextSibling:this.debug("Unlinking "+p+" (must be child of "+p.parent+")"),this.nodeRemoveMarkup(n)),p.li?this.nodeRenderStatus(n):(m=!0,p.li=document.createElement("li"),p.li.ftnode=p,p.key&&y.generateIds&&(p.li.id=y.idPrefix+p.key),p.span=document.createElement("span"),p.span.className="fancytree-node",v&&!p.tr&&e(p.li).attr("role","treeitem"),p.li.appendChild(p.span),this.nodeRenderTitle(n),y.createNode&&y.createNode.call(g,{type:"createNode"},n)),y.renderNode&&y.renderNode.call(g,{type:"renderNode"},n)),C){if(b||p.expanded||!0===r){for(p.ul||(p.ul=document.createElement("ul"),(!0!==o||s)&&p.expanded||(p.ul.style.display="none"),v&&e(p.ul).attr("role","group"),p.li?p.li.appendChild(p.ul):p.tree.$div.append(p.ul)),c=0,u=C.length;c<u;c++)f=e.extend({},n,{node:C[c]}),this.nodeRender(f,i,r,!1,!0);for(a=p.ul.firstChild;a;)(d=a.ftnode)&&d.parent!==p?(p.debug("_fixParent: remove missing "+d,a),h=a.nextSibling,a.parentNode.removeChild(a),a=h):a=a.nextSibling;for(a=p.ul.firstChild,c=0,u=C.length-1;c<u;c++)(l=C[c])!==(d=a.ftnode)?p.ul.insertBefore(l.li,d.li):a=a.nextSibling}}else p.ul&&(this.warn("remove child markup for "+p),this.nodeRemoveChildMarkup(n));b||m&&x.ul.insertBefore(p.li,_)}},nodeRenderTitle:function(t,n){var i,r,o,s,a,l,d,u=t.node,h=t.tree,f=t.options,p=f.aria,g=u.getLevel(),m=[];void 0!==n&&(u.title=n),u.span&&!1!==h._enableUpdate&&(a=p&&!1!==u.hasChildren()?" role='button'":"",g<f.minExpandLevel?(u.lazy||(u.expanded=!0),g>1&&m.push("<span "+a+" class='fancytree-expander fancytree-expander-fixed'></span>")):m.push("<span "+a+" class='fancytree-expander'></span>"),(i=y.evalOption("checkbox",u,u,f,!1))&&!u.isStatusNode()&&(a=p?" role='checkbox'":"",r="fancytree-checkbox",("radio"===i||u.parent&&u.parent.radiogroup)&&(r+=" fancytree-radio"),m.push("<span "+a+" class='"+r+"'></span>")),void 0!==u.data.iconClass&&(u.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(u.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),u.icon=u.data.iconClass)),!1!==(o=y.evalOption("icon",u,u,f,!0))&&(a=p?" role='presentation'":"",d=(d=y.evalOption("iconTooltip",u,u,f,null))?" title='"+c(d)+"'":"","string"==typeof o?v.test(o)?(o="/"===o.charAt(0)?o:(f.imagePath||"")+o,m.push("<img src='"+o+"' class='fancytree-icon'"+d+" alt='' />")):m.push("<span "+a+" class='fancytree-custom-icon "+o+"'"+d+"></span>"):o.text?m.push("<span "+a+" class='fancytree-custom-icon "+(o.addClass||"")+"'"+d+">"+y.escapeHtml(o.text)+"</span>"):o.html?m.push("<span "+a+" class='fancytree-custom-icon "+(o.addClass||"")+"'"+d+">"+o.html+"</span>"):m.push("<span "+a+" class='fancytree-icon'"+d+"></span>")),s="",f.renderTitle&&(s=f.renderTitle.call(h,{type:"renderTitle"},t)||""),s||(!0===(l=y.evalOption("tooltip",u,u,f,null))&&(l=u.title),s="<span class='fancytree-title'"+(l=l?" title='"+c(l)+"'":"")+(f.titlesTabbable?" tabindex='0'":"")+">"+(f.escapeTitles?y.escapeHtml(u.title):u.title)+"</span>"),m.push(s),u.span.innerHTML=m.join(""),this.nodeRenderStatus(t),f.enhanceTitle&&(t.$title=e(">span.fancytree-title",u.span),s=f.enhanceTitle.call(h,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var n,i=t.node,r=t.tree,o=t.options,s=i.hasChildren(),a=i.isLastSibling(),l=o.aria,d=o._classNames,c=[],u=i[r.statusClassPropName];u&&!1!==r._enableUpdate&&(l&&(n=e(i.tr||i.li)),c.push(d.node),r.activeNode===i&&c.push(d.active),r.focusNode===i&&c.push(d.focused),i.expanded&&c.push(d.expanded),l&&(!1!==s?n.attr("aria-expanded",Boolean(i.expanded)):n.removeAttr("aria-expanded")),i.folder&&c.push(d.folder),!1!==s&&c.push(d.hasChildren),a&&c.push(d.lastsib),i.lazy&&null==i.children&&c.push(d.lazy),i.partload&&c.push(d.partload),i.partsel&&c.push(d.partsel),y.evalOption("unselectable",i,i,o,!1)&&c.push(d.unselectable),i._isLoading&&c.push(d.loading),i._error&&c.push(d.error),i.statusNodeType&&c.push(d.statusNodePrefix+i.statusNodeType),i.selected?(c.push(d.selected),l&&n.attr("aria-selected",!0)):l&&n.attr("aria-selected",!1),i.extraClasses&&c.push(i.extraClasses),!1===s?c.push(d.combinedExpanderPrefix+"n"+(a?"l":"")):c.push(d.combinedExpanderPrefix+(i.expanded?"e":"c")+(i.lazy&&null==i.children?"d":"")+(a?"l":"")),c.push(d.combinedIconPrefix+(i.expanded?"e":"c")+(i.folder?"f":"")),u.className=c.join(" "),i.li&&e(i.li).toggleClass(d.lastsib,a))},nodeSetActive:function(n,i,r){r=r||{};var o,l=n.node,d=n.tree,c=n.options,u=!0===r.noEvents,h=!0===r.noFocus,f=!1!==r.scrollIntoView;return i=!1!==i,l===d.activeNode===i?s(l):i&&!u&&!1===this._triggerNodeEvent("beforeActivate",l,n.originalEvent)?a(l,["rejected"]):(i?(d.activeNode&&(t(d.activeNode!==l,"node was active (inconsistency)"),o=e.extend({},n,{node:d.activeNode}),d.nodeSetActive(o,!1),t(null===d.activeNode,"deactivate was out of sync?")),c.activeVisible&&l.makeVisible({scrollIntoView:f}),d.activeNode=l,d.nodeRenderStatus(n),h||d.nodeSetFocus(n),u||d._triggerNodeEvent("activate",l,n.originalEvent)):(t(d.activeNode===l,"node was not active (inconsistency)"),d.activeNode=null,this.nodeRenderStatus(n),u||n.tree._triggerNodeEvent("deactivate",l,n.originalEvent)),s(l))},nodeSetExpanded:function(t,n,i){i=i||{};var r,o,l,d,c,u,h=t.node,f=t.tree,p=t.options,g=!0===i.noAnimation,y=!0===i.noEvents;if(n=!1!==n,h.expanded&&n||!h.expanded&&!n)return s(h);if(n&&!h.lazy&&!h.hasChildren())return s(h);if(!n&&h.getLevel()<p.minExpandLevel)return a(h,["locked"]);if(!y&&!1===this._triggerNodeEvent("beforeExpand",h,t.originalEvent))return a(h,["rejected"]);if(g||h.isVisible()||(g=i.noAnimation=!0),o=new e.Deferred,n&&!h.expanded&&p.autoCollapse){c=h.getParentList(!1,!0),u=p.autoCollapse;try{for(p.autoCollapse=!1,l=0,d=c.length;l<d;l++)this._callHook("nodeCollapseSiblings",c[l],i)}finally{p.autoCollapse=u}}return o.done(function(){var e=h.getLastChild();n&&p.autoScroll&&!g&&e?e.scrollIntoView(!0,{topNode:h}).always(function(){y||t.tree._triggerNodeEvent(n?"expand":"collapse",t)}):y||t.tree._triggerNodeEvent(n?"expand":"collapse",t)}),r=function(i){var r,o,s=p._classNames,a=p.toggleEffect;if(h.expanded=n,f._callHook("nodeRender",t,!1,!1,!0),h.ul)if(r="none"!==h.ul.style.display,o=!!h.expanded,r===o)h.warn("nodeSetExpanded: UL.style.display already set");else{if(a&&!g)return e(h.li).addClass(s.animating),void(e.isFunction(e(h.ul)[a.effect])?(f.debug("use jquery."+a.effect+" method"),e(h.ul)[a.effect]({duration:a.duration,always:function(){e(this).removeClass(s.animating),e(h.li).removeClass(s.animating),i()}})):(e(h.ul).stop(!0,!0),e(h.ul).parent().find(".ui-effects-placeholder").remove(),e(h.ul).toggle(a.effect,a.options,a.duration,function(){e(this).removeClass(s.animating),e(h.li).removeClass(s.animating),i()})));h.ul.style.display=h.expanded||!parent?"":"none"}i()},n&&h.lazy&&void 0===h.hasChildren()?h.load().done(function(){o.notifyWith&&o.notifyWith(h,["loaded"]),r(function(){o.resolveWith(h)})}).fail(function(e){r(function(){o.rejectWith(h,["load failed ("+e+")"])})}):r(function(){o.resolveWith(h)}),o.promise()},nodeSetFocus:function(t,n){var i,r=t.tree,o=t.node,s=r.options,a=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(n=!1!==n,r.focusNode){if(r.focusNode===o&&n)return;i=e.extend({},t,{node:r.focusNode}),r.focusNode=null,this._triggerNodeEvent("blur",i),this._callHook("nodeRenderStatus",i)}n&&(this.hasFocus()||(o.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),o.makeVisible({scrollIntoView:!1}),r.focusNode=o,s.titlesTabbable?a||e(o.span).find(".fancytree-title").focus():0===e(document.activeElement).closest(".fancytree-container").length&&e(r.$container).focus(),s.aria&&e(r.$container).attr("aria-activedescendant",e(o.tr||o.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),s.autoScroll&&o.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,n){n=n||{};var i=e.node,r=e.tree,o=e.options,s=!0===n.noEvents,a=i.parent;if(t=!1!==t,!y.evalOption("unselectable",i,i,o,!1)){if(i._lastSelectIntent=t,!!i.selected===t&&(3!==o.selectMode||!i.partsel||t))return t;if(!s&&!1===this._triggerNodeEvent("beforeSelect",i,e.originalEvent))return!!i.selected;t&&1===o.selectMode?(r.lastSelectedNode&&r.lastSelectedNode.setSelected(!1),i.selected=t):3!==o.selectMode||!a||a.radiogroup||i.radiogroup?a&&a.radiogroup?i.visitSiblings(function(e){e._changeSelectStatusAttrs(t&&e===i)},!0):i.selected=t:(i.selected=t,i.fixSelection3AfterClick(n)),this.nodeRenderStatus(e),r.lastSelectedNode=t?i:null,s||r._triggerNodeEvent("select",e)}},nodeSetStatus:function(t,n,i,r){function o(t,n){var i=s.children?s.children[0]:null;return i&&i.isStatusNode()?(e.extend(i,t),i.statusNodeType=n,a._callHook("nodeRenderTitle",i)):(s._setChildren([t]),s.children[0].statusNodeType=n,a.render()),s.children[0]}var s=t.node,a=t.tree;switch(n){case"ok":!function(){var e=s.children?s.children[0]:null;if(e&&e.isStatusNode()){try{s.ul&&(s.ul.removeChild(e.li),e.li=null)}catch(e){}1===s.children.length?s.children=[]:s.children.shift()}}(),s._isLoading=!1,s._error=null,s.renderStatus();break;case"loading":s.parent||o({title:a.options.strings.loading+(i?" ("+i+")":""),checkbox:!1,tooltip:r},n),s._isLoading=!0,s._error=null,s.renderStatus();break;case"error":o({title:a.options.strings.loadError+(i?" ("+i+")":""),checkbox:!1,tooltip:r},n),s._isLoading=!1,s._error={message:i,details:r},s.renderStatus();break;case"nodata":o({title:i||a.options.strings.noData,checkbox:!1,tooltip:r},n),s._isLoading=!1,s._error=null,s.renderStatus();break;default:e.error("invalid node status "+n)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,n=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(n=!1,t.selected=!0),t._lastSelectIntent=n,this.nodeSetSelected(e,n)},treeClear:function(e){var t=e.tree;t.activeNode=null,t.focusNode=null,t.$div.find(">ul.fancytree-container").empty(),t.rootNode.children=null},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("fancytree-helper-hidden")},treeInit:function(t){var n=t.tree,i=n.options;n.$container.attr("tabindex",i.tabindex),e.each(T,function(e,t){void 0!==i[t]&&(n.info("Move option "+t+" to tree"),n[t]=i[t],delete i[t])}),i.rtl?n.$container.attr("DIR","RTL").addClass("fancytree-rtl"):n.$container.removeAttr("DIR").removeClass("fancytree-rtl"),i.aria&&(n.$container.attr("role","tree"),1!==i.selectMode&&n.$container.attr("aria-multiselectable",!0)),this.treeLoad(t)},treeLoad:function(n,i){var r,o,s,a=n.tree,l=n.widget.element,c=e.extend({},n,{node:this.rootNode});if(a.rootNode.children&&this.treeClear(n),i=i||this.options.source)"string"==typeof i&&e.error("Not implemented");else switch(o=l.data("type")||"html"){case"html":(s=l.find(">ul:first")).addClass("ui-fancytree-source fancytree-helper-hidden"),i=e.ui.fancytree.parseHtml(s),this.data=e.extend(this.data,d(s));break;case"json":i=e.parseJSON(l.text()),l.contents().filter(function(){return 3===this.nodeType}).remove(),e.isPlainObject(i)&&(t(e.isArray(i.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),r=i,i=i.children,delete r.children,e.each(T,function(e,t){void 0!==r[t]&&(a[t]=r[t],delete r[t])}),e.extend(a.data,r));break;default:e.error("Invalid data-type: "+o)}return this.nodeLoadChildren(c,i).done(function(){a.render(),3===n.options.selectMode&&a.rootNode.fixSelection3FromEndNodes(),a.activeNode&&a.options.activeVisible&&a.activeNode.makeVisible(),a._triggerTreeEvent("init",null,{status:!0})}).fail(function(){a.render(),a._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,n){},treeSetFocus:function(t,n,i){var r;(n=!1!==n)!==this.hasFocus()&&(this._hasFocus=n,!n&&this.focusNode?this.focusNode.setFocus(!1):!n||i&&i.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",n),this._triggerTreeEvent(n?"focusTree":"blurTree"),n&&!this.activeNode&&(r=this._lastMousedownNode||this.getFirstChild())&&r.setFocus())},treeSetOption:function(t,n,i){var r=t.tree,o=!0,s=!1,a=!1;switch(n){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":s=!0,a=!0;break;case"escapeTitles":case"tooltip":a=!0;break;case"rtl":!1===i?r.$container.removeAttr("DIR").removeClass("fancytree-rtl"):r.$container.attr("DIR","RTL").addClass("fancytree-rtl"),a=!0;break;case"source":o=!1,r._callHook("treeLoad",r,i),a=!0}r.debug("set option "+n+"="+i+" <"+typeof i+">"),o&&(this.widget._super?this.widget._super.call(this.widget,n,i):e.Widget.prototype._setOption.call(this.widget,n,i)),s&&r._callHook("treeCreate",r),a&&r.render(!0,!1)}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,debugLevel:null,disabled:!1,enableAspx:!0,escapeTitles:!1,extensions:[],toggleEffect:{effect:"slideToggle",duration:200},generateIds:!1,icon:!0,idPrefix:"ft_",focusOnSelect:!1,keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,nodata:!0,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,tooltip:!1,_classNames:{node:"fancytree-node",folder:"fancytree-folder",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",hasChildren:"fancytree-has-children",active:"fancytree-active",selected:"fancytree-selected",expanded:"fancytree-expanded",lazy:"fancytree-lazy",focused:"fancytree-focused",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",unselectable:"fancytree-unselectable",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error",statusNodePrefix:"fancytree-statusnode-"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new f(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var n,r,s,a=this.options,l=a.extensions;this.tree;for(s=0;s<l.length;s++)r=l[s],(n=e.ui.fancytree._extensions[r])||e.error("Could not apply extension '"+r+"' (it is not registered, did you forget to include it?)"),this.tree.options[r]=i({},n.options,this.tree.options[r]),t(void 0===this.tree.ext[r],"Extension name must not exist as Fancytree.ext attribute: '"+r+"'"),this.tree.ext[r]={},o(this.tree,0,n,r),n;void 0!==a.icons&&(!0!==a.icon?e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),a.icon=a.icons)),void 0!==a.iconClass&&(a.icon?e.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),a.icon=a.iconClass)),void 0!==a.tabbable&&(a.tabindex=a.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+a.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(e,t){return this.tree._callHook("treeSetOption",this.tree,e,t)},destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree),e.Widget.prototype.destroy.call(this)},_unbind:function(){var t=this.tree._ns;this.element.off(t),this.tree.$container.off(t),e(document).off(t)},_bind:function(){var t=this,n=this.options,i=this.tree,r=i._ns;this._unbind(),i.$container.on("focusin"+r+" focusout"+r,function(t){var n=y.getNode(t),r="focusin"===t.type;if(!r&&n&&e(t.target).is("a"))n.debug("Ignored focusout on embedded <a> element.");else{if(r){if(i._getExpiringValue("focusin"))return void i.debug("Ignored double focusin.");i._setExpiringValue("focusin",!0,50),n||(n=i._getExpiringValue("mouseDownNode"))&&i.debug("Reconstruct mouse target for focusin from recent event.")}n?i._callHook("nodeSetFocus",i._makeHookContext(n,t),r):i.tbody&&e(t.target).parents("table.fancytree-container > thead").length?i.debug("Ignore focus event outside table body.",t):i._callHook("treeSetFocus",i,r)}}).on("selectstart"+r,"span.fancytree-title",function(e){e.preventDefault()}).on("keydown"+r,function(e){if(n.disabled||!1===n.keyboard)return!0;var t,r=i.focusNode,o=i._makeHookContext(r||i,e),s=i.phase;try{return i.phase="userEvent","preventNav"===(t=r?i._triggerNodeEvent("keydown",r,e):i._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=i._callHook("nodeKeydown",o)),t}finally{i.phase=s}}).on("mousedown"+r,function(e){var t=y.getEventTarget(e);i._lastMousedownNode=t?t.node:null,i._setExpiringValue("mouseDownNode",i._lastMousedownNode)}).on("click"+r+" dblclick"+r,function(e){if(n.disabled)return!0;var i,r=y.getEventTarget(e),o=r.node,s=t.tree,a=s.phase;if(!o)return!0;i=s._makeHookContext(o,e);try{switch(s.phase="userEvent",e.type){case"click":return i.targetType=r.type,o.isPagingNode()?!0===s._triggerNodeEvent("clickPaging",i,e):!1!==s._triggerNodeEvent("click",i,e)&&s._callHook("nodeClick",i);case"dblclick":return i.targetType=r.type,!1!==s._triggerNodeEvent("dblclick",i,e)&&s._callHook("nodeDblclick",i)}}finally{s.phase=a}})},getActiveNode:function(){return this.tree.activeNode},getNodeByKey:function(e){return this.tree.getNodeByKey(e)},getRootNode:function(){return this.tree.rootNode},getTree:function(){return this.tree}}),y=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.30.2",buildType: "production",debugLevel: 3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:f,_FancytreeNodeClass:h,jquerySupports:{positionMyOfs:function(t,n,i,r){var o,s,a,l=e.map(e.trim(t).split("."),function(e){return parseInt(e,10)}),d=e.map(Array.prototype.slice.call(arguments,1),function(e){return parseInt(e,10)});for(o=0;o<d.length;o++)if(s=l[o]||0,a=d[o]||0,s!==a)return s>a;return!0}(e.ui.version,1,9)},assert:function(e,n){return t(e,n)},createTree:function(t,n){return e(t).fancytree(n).fancytree("getTree")},debounce:function(e,t,n,i){var r;return 3===arguments.length&&"boolean"!=typeof n&&(i=n,n=!1),function(){var o=arguments;i=i||this,n&&!r&&t.apply(i,o),clearTimeout(r),r=setTimeout(function(){n||t.apply(i,o),r=null},e)}},debug:function(t){e.ui.fancytree.debugLevel>=4&&n("log",arguments)},error:function(t){e.ui.fancytree.debugLevel>=1&&n("error",arguments)},escapeHtml:function(e){return(""+e).replace(m,function(e){return C[e]})},fixPositionOptions:function(t){if((t.offset||(""+t.my+t.at).indexOf("%")>=0)&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),r=(n[2]?+n[2]:0)+(i[2]?+i[2]:0),o=(n[4]?+n[4]:0)+(i[4]?+i[4]:0);t=e.extend({},t,{my:n[1]+" "+n[3],at:i[1]+" "+i[3]}),(r||o)&&(t.offset=r+" "+o)}return t},getEventTarget:function(t){var n,i=t&&t.target?t.target.className:"",r={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(i)?r.type="title":/\bfancytree-expander\b/.test(i)?r.type=!1===r.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(i)?r.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(i)?r.type="icon":/\bfancytree-node\b/.test(i)?r.type="title":t&&t.target&&((n=e(t.target)).is("ul[role=group]")?((r.node&&r.node.tree||y).debug("Ignoring click on outer UL."),r.node=null):n.closest(".fancytree-title").length?r.type="title":n.closest(".fancytree-checkbox").length?r.type="checkbox":n.closest(".fancytree-expander").length&&(r.type="expander")),r},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof h)return t;for(t instanceof e?t=t[0]:void 0!==t.originalEvent&&(t=t.target);t;){if(t.ftnode)return t.ftnode;t=t.parentNode}return null},getTree:function(t){var n;return t instanceof f?t:(void 0===t&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?t=e(t).eq(0):t instanceof e?t=t.eq(0):void 0!==t.originalEvent&&(t=e(t.target)),t=t.closest(":ui-fancytree"),(n=t.data("ui-fancytree")||t.data("fancytree"))?n.tree:null)},evalOption:function(t,n,i,r,o){var s,a,l=n.tree,d=r[t],c=i[t];return e.isFunction(d)?(s={node:n,tree:l,widget:l.widget,options:l.widget.options,typeInfo:l.types[n.type]||{}},null==(a=d.call(l,{type:t},s))&&(a=c)):a=null!=c?c:d,null==a&&(a=o),a},setSpanIcon:function(t,n,i){var r=e(t);"string"==typeof i?r.attr("class",n+" "+i):(i.text?r.text(""+i.text):i.html&&(t.innerHTML=i.html),r.attr("class",n+" "+(i.addClass||"")))},eventToString:function(e){var t=e.which,n=e.type,i=[];return e.altKey&&i.push("alt"),e.ctrlKey&&i.push("ctrl"),e.metaKey&&i.push("meta"),e.shiftKey&&i.push("shift"),"click"===n||"dblclick"===n?i.push(N[e.button]+n):_[t]||i.push(k[t]||String.fromCharCode(t).toLowerCase()),i.join("+")},info:function(t){e.ui.fancytree.debugLevel>=3&&n("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,n,i,r){var o,s=t[n]||e.noop;t[n]=function(){var e=r||this;try{return o=e._super,e._super=s,i.apply(e,arguments)}finally{e._super=o}}},parseHtml:function(t){var n,i,r,o,s,a,l,c,u=[];return t.find(">li").each(function(){var h,f,p=e(this),g=p.find(">span:first",this),y=g.length?null:p.find(">a:first"),v={tooltip:null,data:{}};for(g.length?v.title=g.html():y&&y.length?(v.title=y.html(),v.data.href=y.attr("href"),v.data.target=y.attr("target"),v.tooltip=y.attr("title")):(v.title=p.html(),(s=v.title.search(/<ul/i))>=0&&(v.title=v.title.substring(0,s))),v.title=e.trim(v.title),o=0,a=S.length;o<a;o++)v[S[o]]=void 0;for(n=this.className.split(" "),r=[],o=0,a=n.length;o<a;o++)i=n[o],E[i]?v[i]=!0:r.push(i);if(v.extraClasses=r.join(" "),(l=p.attr("title"))&&(v.tooltip=l),(l=p.attr("id"))&&(v.key=l),p.attr("hideCheckbox")&&(v.checkbox=!1),(h=d(p))&&!e.isEmptyObject(h)){for(f in F)h.hasOwnProperty(f)&&(h[F[f]]=h[f],delete h[f]);for(o=0,a=A.length;o<a;o++)l=A[o],null!=(c=h[l])&&(delete h[l],v[l]=c);e.extend(v.data,h)}(t=p.find(">ul:first")).length?v.children=e.ui.fancytree.parseHtml(t):v.children=v.lazy?void 0:null,u.push(v)}),u},registerExtension:function(n){t(null!=n.name,"extensions must have a `name` property."),t(null!=n.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[n.name]=n},unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(t){e.ui.fancytree.debugLevel>=2&&n("warn",arguments)}}),e.ui.fancytree}e.ui.fancytree.warn("Fancytree: ignored duplicate include")}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";return e.ui.fancytree._FancytreeClass.prototype.countSelected=function(e){this.options;return this.getSelectedNodes(e).length},e.ui.fancytree._FancytreeNodeClass.prototype.updateCounters=function(){var t=e("span.fancytree-childcounter",this.span),n=this.tree.options.childcounter,i=this.countChildren(n.deep);this.data.childCounter=i,!i&&n.hideZeros||this.isExpanded()&&n.hideExpanded?t.remove():(t.length||(t=e("<span class='fancytree-childcounter'/>").appendTo(e("span.fancytree-icon,span.fancytree-custom-icon",this.span))),t.text(i)),!n.deep||this.isTopLevel()||this.isRoot()||this.parent.updateCounters()},e.ui.fancytree.prototype.widgetMethod1=function(e){this.tree;return e},e.ui.fancytree.registerExtension({name:"childcounter",version:"2.30.2",options:{deep:!0,hideZeros:!0,hideExpanded:!1},foo:42,_appendCounter:function(e){},treeInit:function(e){e.options,e.options.childcounter;this._superApply(arguments),this.$container.addClass("fancytree-ext-childcounter")},treeDestroy:function(e){this._superApply(arguments)},nodeRenderTitle:function(t,n){var i=t.node,r=t.options.childcounter,o=null==i.data.childCounter?i.countChildren(r.deep):+i.data.childCounter;this._super(t,n),!o&&r.hideZeros||i.isExpanded()&&r.hideExpanded||e("span.fancytree-icon,span.fancytree-custom-icon",i.span).append(e("<span class='fancytree-childcounter'/>").text(o))},nodeSetExpanded:function(e,t,n){var i=e.tree;e.node;return this._superApply(arguments).always(function(){i.nodeRenderTitle(e)})}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(t,n){t||(n=n?": "+n:"",e.error("Assertion failed"+n))}return e.ui.fancytree._FancytreeNodeClass.prototype.getCloneList=function(t){var n,i=this.tree,r=i.refMap[this.refKey]||null,o=i.keyMap;return r&&(n=this.key,t?r=e.map(r,function(e){return o[e]}):(r=e.map(r,function(e){return e===n?null:o[e]})).length<1&&(r=null)),r},e.ui.fancytree._FancytreeNodeClass.prototype.isClone=function(){var e=this.refKey||null,t=e&&this.tree.refMap[e]||null;return!!(t&&t.length>1)},e.ui.fancytree._FancytreeNodeClass.prototype.reRegister=function(t,n){t=null==t?null:""+t,n=null==n?null:""+n;var i=this.tree,r=this.key,o=this.refKey,s=i.keyMap,a=i.refMap,l=a[o]||null,d=!1;return null!=t&&t!==this.key&&(s[t]&&e.error("[ext-clones] reRegister("+t+"): already exists: "+this),delete s[r],s[t]=this,l&&(a[o]=e.map(l,function(e){return e===r?t:e})),this.key=t,d=!0),null!=n&&n!==this.refKey&&(l&&(1===l.length?delete a[o]:a[o]=e.map(l,function(e){return e===r?null:e})),a[n]?a[n].append(t):a[n]=[this.key],this.refKey=n,d=!0),d},e.ui.fancytree._FancytreeNodeClass.prototype.setRefKey=function(e){return this.reRegister(null,e)},e.ui.fancytree._FancytreeClass.prototype.getNodesByRef=function(t,n){var i=this.keyMap,r=this.refMap[t]||null;return r&&(r=n?e.map(r,function(e){var t=i[e];return t.isDescendantOf(n)?t:null}):e.map(r,function(e){return i[e]})).length<1&&(r=null),r},e.ui.fancytree._FancytreeClass.prototype.changeRefKey=function(e,t){var n,i=this.keyMap,r=this.refMap[e]||null;if(r){for(n=0;n<r.length;n++)i[r[n]].refKey=t;delete this.refMap[e],this.refMap[t]=r}},e.ui.fancytree.registerExtension({name:"clones",version:"2.30.2",options:{highlightActiveClones:!0,highlightClones:!1},treeCreate:function(e){this._superApply(arguments),e.tree.refMap={},e.tree.keyMap={}},treeInit:function(n){this.$container.addClass("fancytree-ext-clones"),t(null==n.options.defaultKey),n.options.defaultKey=function(t){return function(t){var n=e.map(t.getParentList(!1,!0),function(e){return e.refKey||e.key});return n=n.join("/"),"id_"+function(e,t,n){for(var i,r,o=3&e.length,s=e.length-o,a=n,l=0;l<s;)r=255&e.charCodeAt(l)|(255&e.charCodeAt(++l))<<8|(255&e.charCodeAt(++l))<<16|(255&e.charCodeAt(++l))<<24,++l,a=27492+(65535&(i=5*(65535&(a=(a^=r=461845907*(65535&(r=(r=3432918353*(65535&r)+((3432918353*(r>>>16)&65535)<<16)&4294967295)<<15|r>>>17))+((461845907*(r>>>16)&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(r=0,o){case 3:r^=(255&e.charCodeAt(l+2))<<16;case 2:r^=(255&e.charCodeAt(l+1))<<8;case 1:a^=r=461845907*(65535&(r=(r=3432918353*(65535&(r^=255&e.charCodeAt(l)))+((3432918353*(r>>>16)&65535)<<16)&4294967295)<<15|r>>>17))+((461845907*(r>>>16)&65535)<<16)&4294967295}return a^=e.length,a^=a>>>16,a=2246822507*(65535&a)+((2246822507*(a>>>16)&65535)<<16)&4294967295,a^=a>>>13,a=3266489909*(65535&a)+((3266489909*(a>>>16)&65535)<<16)&4294967295,a^=a>>>16,t?("0000000"+(a>>>0).toString(16)).substr(-8):a>>>0}(n,!0)}(t)},this._superApply(arguments)},treeClear:function(e){return e.tree.refMap={},e.tree.keyMap={},this._superApply(arguments)},treeRegisterNode:function(n,i,r){var o,s,a=n.tree,l=a.keyMap,d=a.refMap,c=r.key,u=r&&null!=r.refKey?""+r.refKey:null;return r.isStatusNode()?this._super(n,i,r):(i?(null!=l[r.key]&&e.error("clones.treeRegisterNode: node.key already exists: "+r),l[c]=r,u&&((o=d[u])?(o.push(c),2===o.length&&n.options.clones.highlightClones&&l[o[0]].renderStatus()):d[u]=[c])):(null==l[c]&&e.error("clones.treeRegisterNode: node.key not registered: "+r.key),delete l[c],u&&(o=d[u])&&((s=o.length)<=1?(t(1===s),t(o[0]===c),delete d[u]):(!function(e,t){var n;for(n=e.length-1;n>=0;n--)if(e[n]===t)return e.splice(n,1),!0}(o,c),2===s&&n.options.clones.highlightClones&&l[o[0]].renderStatus()))),this._super(n,i,r))},nodeRenderStatus:function(t){var n,i,r=t.node;return i=this._super(t),t.options.clones.highlightClones&&(n=e(r[t.tree.statusClassPropName])).length&&r.isClone()&&n.addClass("fancytree-clone"),i},nodeSetActive:function(t,n,i){var r,o=t.tree.statusClassPropName,s=t.node;return r=this._superApply(arguments),t.options.clones.highlightActiveClones&&s.isClone()&&e.each(s.getCloneList(!0),function(t,i){e(i[o]).toggleClass("fancytree-active-clone",!1!==n)}),r}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(){y=null,v=null,m&&m.removeClass(s+" "+a),m=null,x=null,C=null}function n(e){return 0===e?"":e>0?"+"+e:""+e}function i(t,i){if(i.options.dnd5.scroll&&function(t,n){var i,r,o=t.options.dnd5,s=t.$scrollParent[0],a=o.scrollSensitivity,l=o.scrollSpeed,d=0;s!==document&&"HTML"!==s.tagName?(i=t.$scrollParent.offset(),r=s.scrollTop,i.top+s.offsetHeight-n.pageY<a?s.scrollHeight-t.$scrollParent.innerHeight()-r>0&&(s.scrollTop=d=r+l):r>0&&n.pageY-i.top<a&&(s.scrollTop=d=r-l)):(r=e(document).scrollTop())>0&&n.pageY-r<a?(d=r-l,e(document).scrollTop(d)):e(window).height()-(n.pageY-r)<a&&(d=r+l,e(document).scrollTop(d)),d&&t.debug("autoScroll: "+d+"px")}(i.tree,t),!i.node)return i.tree.warn("Ignored dragover for non-node"),b;var o,s,a,p,y=null,v=i.tree,m=v.options,C=m.dnd5,_=i.node,k=i.otherNode,w="center",N=e(_.span),S=N.find("span.fancytree-title");if(!1===x)return v.debug("Ignored dragover, since dragenter returned false."),!1;if("string"==typeof x?e.error("assert failed: dragenter returned string"):(s=N.offset(),p=(t.pageY-s.top)/N.height(),x.after&&p>.75?y="after":!x.over&&x.after&&p>.5?y="after":x.before&&p<=.25?y="before":!x.over&&x.before&&p<=.5?y="before":x.over&&(y="over"),C.preventVoidMoves&&(_===k?(_.debug("Drop over source node prevented."),y=null):"before"===y&&k&&_===k.getNextSibling()?(_.debug("Drop after source node prevented."),y=null):"after"===y&&k&&_===k.getPrevSibling()?(_.debug("Drop before source node prevented."),y=null):"over"===y&&k&&k.parent===_&&k.isLastSibling()&&(_.debug("Drop last child over own parent prevented."),y=null))),i.hitMode=y,y&&C.dragOver&&(C.dragOver(_,i),y=i.hitMode),b=y,"after"===y||"before"===y||"over"===y){switch(o=C.dropMarkerOffsetX||0,y){case"before":w="top",o+=C.dropMarkerInsertOffsetX||0;break;case"after":w="bottom",o+=C.dropMarkerInsertOffsetX||0}a={my:"left"+n(o)+" center",at:"left "+w,of:S},m.rtl&&(a.my="right"+n(-o)+" center",a.at="right "+w),g.toggleClass(d,"after"===y).toggleClass(u,"over"===y).toggleClass(c,"before"===y).show().position(r.fixPositionOptions(a))}else g.hide();return e(_.span).toggleClass(f,"after"===y||"before"===y||"over"===y).toggleClass(d,"after"===y).toggleClass(c,"before"===y).toggleClass(l,"over"===y).toggleClass(h,!1===y),y}var r=e.ui.fancytree,o=/Mac/.test(navigator.platform),s="fancytree-drag-source",a="fancytree-drag-remove",l="fancytree-drop-accept",d="fancytree-drop-after",c="fancytree-drop-before",u="fancytree-drop-over",h="fancytree-drop-reject",f="fancytree-drop-target",p="application/x-fancytree-node",g=null,y=null,v=null,m=null,x=null,b=null,C=null;return e.ui.fancytree.registerExtension({name:"dnd5",version:"2.30.2",options:{autoExpandMS:1500,dropMarkerInsertOffsetX:-16,dropMarkerOffsetX:-24,multiSource:!1,dragImage:null,dropEffect:null,dropEffectDefault:"move",preventForeignNodes:!1,preventNonNodes:!1,preventRecursiveMoves:!0,preventVoidMoves:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,setTextTypeJson:!1,dragStart:null,dragDrag:e.noop,dragEnd:e.noop,dragEnter:null,dragOver:e.noop,dragExpand:e.noop,dragDrop:e.noop,dragLeave:e.noop},treeInit:function(n){var d,c,f,_=n.tree,k=n.options,w=k.glyph||null,N=k.dnd5,S=r.getNode;e.inArray("dnd",k.extensions)>=0&&e.error("Extensions 'dnd' and 'dnd5' are mutually exclusive."),N.dragStop&&e.error("dragStop is not used by ext-dnd5. Use dragEnd instead."),N.dragStart&&r.overrideMethod(n.options,"createNode",function(e,t){this._super.apply(this,arguments),t.node.span.draggable=!0}),this._superApply(arguments),this.$container.addClass("fancytree-ext-dnd5"),f=e("<span>").appendTo(this.$container),this.$scrollParent=f.scrollParent(),f.remove(),(g=e("#fancytree-drop-marker")).length||(g=e("<div id='fancytree-drop-marker'></div>").hide().css({"z-index":1e3,"pointer-events":"none"}).prependTo("body"),w&&r.setSpanIcon(g[0],w.map._addClass,w.map.dropMarker)),g.toggleClass("fancytree-rtl",!!k.rtl),N.dragStart&&_.$container.on("dragstart drag dragend",function(n){var i,r=S(n),l=n.dataTransfer||n.originalEvent.dataTransfer,u={node:r,tree:_,options:_.options,originalEvent:n,dataTransfer:l,isCancelled:void 0},h=function(e,t){var n=t.options.dnd5,i=n.dropEffectDefault;if(n.dropEffect)return n.dropEffect(e,t);if(o){if(e.metaKey&&e.altKey)return"link";if(e.metaKey)return"move";if(e.altKey)return"copy"}else{if(e.ctrlKey)return"copy";if(e.shiftKey)return"move";if(e.altKey)return"link"}return i}(n,u),f="move"===h;switch(n.type){case"dragstart":if(!r)return _.info("Ignored dragstart on a non-node."),!1;y=r,!1===N.multiSource?v=[r]:!0===N.multiSource?(v=_.getSelectedNodes(),r.isSelected()||v.unshift(r)):v=N.multiSource(r,u),(m=e(e.map(v,function(e){return e.span}))).addClass(s),i=JSON.stringify(r.toDict());try{l.setData(p,i),l.setData("text/html",e(r.span).html()),l.setData("text/plain",r.title)}catch(e){_.warn("Could not set data (IE only accepts 'text') - "+e)}return N.setTextTypeJson?l.setData("text",i):l.setData("text",r.title),l.effectAllowed="all",c=null,N.dragImage?N.dragImage(r,u):(d=e(r.span).find(".fancytree-title"),v&&v.length>1&&(c=e("<span class='fancytree-childcounter'/>").text("+"+(v.length-1)).appendTo(d)),l.setDragImage&&l.setDragImage(d[0],-10,-10)),!1!==N.dragStart(r,u)?!0:(t(),!1);case"drag":m.toggleClass(a,f),N.dragDrag(r,u);break;case"dragend":t(),u.isCancelled="none"===h,g.hide(),c&&(c.remove(),c=null),N.dragEnd(r,u)}}),N.dragEnter&&_.$container.on("dragenter dragover dragleave drop",function(n){var r,o,s,a,d=null,c=S(n),f=n.dataTransfer||n.originalEvent.dataTransfer,m={node:c,tree:_,options:_.options,hitMode:x,originalEvent:n,dataTransfer:f,otherNode:y||null,otherNodeList:v||null,otherNodeData:null,dropEffect:void 0,isCancelled:void 0};switch(n.type){case"dragenter":if(C=null,!c){_.debug("Ignore non-node "+n.type+": "+n.target.tagName+"."+n.target.className),x=!1;break}if(e(c.span).addClass(u).removeClass(l+" "+h),s=e.inArray(p,f.types)>=0,N.preventNonNodes&&!s){c.debug("Reject dropping a non-node."),x=!1;break}if(N.preventForeignNodes&&(!y||y.tree!==c.tree)){c.debug("Reject dropping a foreign node."),x=!1;break}g.show(),N.preventRecursiveMoves&&c.isDescendantOf(m.otherNode)?(c.debug("Reject dropping below own ancestor."),a=!1):a=function(t){var n;return!!t&&(n=e.isPlainObject(t)?{over:!!t.over,before:!!t.before,after:!!t.after}:e.isArray(t)?{over:e.inArray("over",t)>=0,before:e.inArray("before",t)>=0,after:e.inArray("after",t)>=0}:{over:!0===t||"over"===t,before:!0===t||"before"===t,after:!0===t||"after"===t},0!==Object.keys(n).length&&n)}(N.dragEnter(c,m)),x=a,d=a&&(a.over||a.before||a.after);break;case"dragover":if(!c){_.debug("Ignore non-node "+n.type+": "+n.target.tagName+"."+n.target.className);break}d=!!(b=i(n,m)),"over"!==b||c.expanded||!1===c.hasChildren()?C=null:C?N.autoExpandMS&&Date.now()-C>N.autoExpandMS&&(!N.dragExpand||!1!==N.dragExpand(c,m))&&c.setExpanded():C=Date.now();break;case"dragleave":if(!c){_.debug("Ignore non-node "+n.type+": "+n.target.tagName+"."+n.target.className);break}if(!e(c.span).hasClass(u)){c.debug("Ignore dragleave (multi).");break}e(c.span).removeClass(u+" "+l+" "+h),c.scheduleAction("cancel"),N.dragLeave(c,m),g.hide();break;case"drop":if(e.inArray(p,f.types)>=0&&(o=f.getData(p),_.info(n.type+": getData('application/x-fancytree-node'): '"+o+"'")),o||(o=f.getData("text"),_.info(n.type+": getData('text'): '"+o+"'")),o)try{void 0!==(r=JSON.parse(o)).title&&(m.otherNodeData=r)}catch(e){}_.debug(n.type+": nodeData: '"+o+"', otherNodeData: ",m.otherNodeData),e(c.span).removeClass(u+" "+l+" "+h),g.hide(),m.hitMode=b,m.dropEffect=f.dropEffect,m.isCancelled="none"===m.dropEffect,N.dragDrop(c,m),n.preventDefault(),t()}if(d)return n.preventDefault(),!1})}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";var t=/Mac/.test(navigator.platform),n=e.ui.fancytree.escapeHtml,i=e.ui.fancytree.unescapeHtml;return e.ui.fancytree._FancytreeNodeClass.prototype.editStart=function(){var t,n=this,r=this.tree,o=r.ext.edit,s=r.options.edit,a=e(".fancytree-title",n.span),l={node:n,tree:r,options:r.options,isNew:e(n[r.statusClassPropName]).hasClass("fancytree-edit-new"),orgTitle:n.title,input:null,dirty:!1};if(!1===s.beforeEdit.call(n,{type:"beforeEdit"},l))return!1;e.ui.fancytree.assert(!o.currentNode,"recursive edit"),o.currentNode=this,o.eventData=l,r.widget._unbind(),o.lastDraggableAttrValue=n.span.draggable,o.lastDraggableAttrValue&&(n.span.draggable=!1),e(document).on("mousedown.fancytree-edit",function(t){e(t.target).hasClass("fancytree-edit-input")||n.editEnd(!0,t)}),t=e("<input />",{class:"fancytree-edit-input",type:"text",value:r.options.escapeTitles?l.orgTitle:i(l.orgTitle)}),o.eventData.input=t,null!=s.adjustWidthOfs&&t.width(a.width()+s.adjustWidthOfs),null!=s.inputCss&&t.css(s.inputCss),a.html(t),t.focus().change(function(e){t.addClass("fancytree-edit-dirty")}).keydown(function(t){switch(t.which){case e.ui.keyCode.ESCAPE:n.editEnd(!1,t);break;case e.ui.keyCode.ENTER:return n.editEnd(!0,t),!1}t.stopPropagation()}).blur(function(e){return n.editEnd(!0,e)}),s.edit.call(n,{type:"edit"},l)},e.ui.fancytree._FancytreeNodeClass.prototype.editEnd=function(t,i){var r,o=this,s=this.tree,a=s.ext.edit,l=a.eventData,d=s.options.edit,c=e(".fancytree-title",o.span).find("input.fancytree-edit-input");return d.trim&&c.val(e.trim(c.val())),r=c.val(),l.dirty=r!==o.title,l.originalEvent=i,!1===t?l.save=!1:l.isNew?l.save=""!==r:l.save=l.dirty&&""!==r,!1!==d.beforeClose.call(o,{type:"beforeClose"},l)&&((!l.save||!1!==d.save.call(o,{type:"save"},l))&&(c.removeClass("fancytree-edit-dirty").off(),e(document).off(".fancytree-edit"),l.save?(o.setTitle(s.options.escapeTitles?r:n(r)),o.setFocus()):l.isNew?(o.remove(),o=l.node=null,a.relatedNode.setFocus()):(o.renderTitle(),o.setFocus()),a.eventData=null,a.currentNode=null,a.relatedNode=null,s.widget._bind(),a.lastDraggableAttrValue&&(o.span.draggable=!0),e(s.$container).focus(),l.input=null,d.close.call(o,{type:"close"},l),!0))},e.ui.fancytree._FancytreeNodeClass.prototype.editCreateNode=function(t,n){var i,r=this.tree,o=this;t=t||"child",null==n?n={title:""}:"string"==typeof n?n={title:n}:e.ui.fancytree.assert(e.isPlainObject(n)),"child"!==t||this.isExpanded()||!1===this.hasChildren()?((i=this.addNode(n,t)).match=!0,e(i[r.statusClassPropName]).removeClass("fancytree-hide").addClass("fancytree-match"),i.makeVisible().done(function(){e(i[r.statusClassPropName]).addClass("fancytree-edit-new"),o.tree.ext.edit.relatedNode=o,i.editStart()})):this.setExpanded().done(function(){o.editCreateNode(t,n)})},e.ui.fancytree._FancytreeClass.prototype.isEditing=function(){return this.ext.edit?this.ext.edit.currentNode:null},e.ui.fancytree._FancytreeNodeClass.prototype.isEditing=function(){return!!this.tree.ext.edit&&this.tree.ext.edit.currentNode===this},e.ui.fancytree.registerExtension({name:"edit",version:"2.30.2",options:{adjustWidthOfs:4,allowEmpty:!1,inputCss:{minWidth:"3em"},triggerStart:["f2","mac+enter","shift+click"],trim:!0,beforeClose:e.noop,beforeEdit:e.noop,close:e.noop,edit:e.noop,save:e.noop},currentNode:null,treeInit:function(e){this._superApply(arguments),this.$container.addClass("fancytree-ext-edit")},nodeClick:function(t){var n=e.ui.fancytree.eventToString(t.originalEvent),i=t.options.edit.triggerStart;return"shift+click"===n&&e.inArray("shift+click",i)>=0&&t.originalEvent.shiftKey?(t.node.editStart(),!1):"click"===n&&e.inArray("clickActive",i)>=0&&t.node.isActive()&&!t.node.isEditing()&&e(t.originalEvent.target).hasClass("fancytree-title")?(t.node.editStart(),!1):this._superApply(arguments)},nodeDblclick:function(t){return e.inArray("dblclick",t.options.edit.triggerStart)>=0?(t.node.editStart(),!1):this._superApply(arguments)},nodeKeydown:function(n){switch(n.originalEvent.which){case 113:if(e.inArray("f2",n.options.edit.triggerStart)>=0)return n.node.editStart(),!1;break;case e.ui.keyCode.ENTER:if(e.inArray("mac+enter",n.options.edit.triggerStart)>=0&&t)return n.node.editStart(),!1}return this._superApply(arguments)}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(e){return(e+"").replace(/([.?*+\^\$\[\]\\(){}|-])/g,"\\$1")}var n="__not_found__",i=e.ui.fancytree.escapeHtml;return e.ui.fancytree._FancytreeClass.prototype._applyFilterImpl=function(r,o,s){var a,l,d,c,u,h=0,f=this.options,p=f.escapeTitles,g=f.autoCollapse,y=e.extend({},f.filter,s),v="hide"===y.mode,m=!!y.leavesOnly&&!o;if("string"==typeof r){if(""===r)return this.warn("Fancytree passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();a=y.fuzzy?r.split("").reduce(function(e,t){return e+"[^"+t+"]*"+t}):t(r),d=new RegExp(".*"+a+".*","i"),c=new RegExp(t(r),"gi"),r=function(t){if(!t.title)return!1;var n=p?t.title:function(t){return t.indexOf(">")>=0?e("<div/>").html(t).text():t}(t.title),r=!!d.test(n);return r&&y.highlight&&(p?(u=n.replace(c,function(e){return"\ufff7"+e+"\ufff8"}),t.titleWithHighlight=i(u).replace(/\uFFF7/g,"<mark>").replace(/\uFFF8/g,"</mark>")):t.titleWithHighlight=n.replace(c,function(e){return"<mark>"+e+"</mark>"})),r}}return this.enableFilter=!0,this.lastFilterArgs=arguments,this.$div.addClass("fancytree-ext-filter"),v?this.$div.addClass("fancytree-ext-filter-hide"):this.$div.addClass("fancytree-ext-filter-dimm"),this.$div.toggleClass("fancytree-ext-filter-hide-expanders",!!y.hideExpanders),this.visit(function(e){delete e.match,delete e.titleWithHighlight,e.subMatchCount=0}),(l=this.getRootNode()._findDirectChild(n))&&l.remove(),f.autoCollapse=!1,this.visit(function(e){if(!m||null==e.children){var t=r(e),n=!1;if("skip"===t)return e.visit(function(e){e.match=!1},!0),"skip";t||!o&&"branch"!==t||!e.parent.match||(t=!0,n=!0),t&&(h++,e.match=!0,e.visitParents(function(e){e.subMatchCount+=1,!y.autoExpand||n||e.expanded||(e.setExpanded(!0,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),e._filterAutoExpanded=!0)}))}}),f.autoCollapse=g,0===h&&y.nodata&&v&&(l=y.nodata,e.isFunction(l)&&(l=l()),!0===l?l={}:"string"==typeof l&&(l={title:l}),l=e.extend({statusNodeType:"nodata",key:n,title:this.options.strings.noData},l),this.getRootNode().addNode(l).match=!0),this.render(),h},e.ui.fancytree._FancytreeClass.prototype.filterNodes=function(e,t){return"boolean"==typeof t&&(t={leavesOnly:t},this.warn("Fancytree.filterNodes() leavesOnly option is deprecated since 2.9.0 / 2015-04-19. Use opts.leavesOnly instead.")),this._applyFilterImpl(e,!1,t)},e.ui.fancytree._FancytreeClass.prototype.applyFilter=function(e){return this.warn("Fancytree.applyFilter() is deprecated since 2.1.0 / 2014-05-29. Use .filterNodes() instead."),this.filterNodes.apply(this,arguments)},e.ui.fancytree._FancytreeClass.prototype.filterBranches=function(e,t){return this._applyFilterImpl(e,!0,t)},e.ui.fancytree._FancytreeClass.prototype.clearFilter=function(){var t,i=this.getRootNode()._findDirectChild(n),r=this.options.escapeTitles,o=this.options.enhanceTitle;i&&i.remove(),this.visit(function(n){n.match&&n.span&&(t=e(n.span).find(">span.fancytree-title"),r?t.text(n.title):t.html(n.title),o&&o({type:"enhanceTitle"},{node:n,$title:t})),delete n.match,delete n.subMatchCount,delete n.titleWithHighlight,n.$subMatchBadge&&(n.$subMatchBadge.remove(),delete n.$subMatchBadge),n._filterAutoExpanded&&n.expanded&&n.setExpanded(!1,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),delete n._filterAutoExpanded}),this.enableFilter=!1,this.lastFilterArgs=null,this.$div.removeClass("fancytree-ext-filter fancytree-ext-filter-dimm fancytree-ext-filter-hide"),this.render()},e.ui.fancytree._FancytreeClass.prototype.isFilterActive=function(){return!!this.enableFilter},e.ui.fancytree._FancytreeNodeClass.prototype.isMatched=function(){return!(this.tree.enableFilter&&!this.match)},e.ui.fancytree.registerExtension({name:"filter",version:"2.30.2",options:{autoApply:!0,autoExpand:!1,counter:!0,fuzzy:!1,hideExpandedCounter:!0,hideExpanders:!1,highlight:!0,leavesOnly:!1,nodata:!0,mode:"dimm"},nodeLoadChildren:function(e,t){return this._superApply(arguments).done(function(){e.tree.enableFilter&&e.tree.lastFilterArgs&&e.options.filter.autoApply&&e.tree._applyFilterImpl.apply(e.tree,e.tree.lastFilterArgs)})},nodeSetExpanded:function(e,t,n){return delete e.node._filterAutoExpanded,!t&&e.options.filter.hideExpandedCounter&&e.node.$subMatchBadge&&e.node.$subMatchBadge.show(),this._superApply(arguments)},nodeRenderStatus:function(t){var n,i=t.node,r=t.tree,o=t.options.filter,s=e(i.span).find("span.fancytree-title"),a=e(i[r.statusClassPropName]),l=t.options.enhanceTitle,d=t.options.escapeTitles;return n=this._super(t),a.length&&r.enableFilter?(a.toggleClass("fancytree-match",!!i.match).toggleClass("fancytree-submatch",!!i.subMatchCount).toggleClass("fancytree-hide",!(i.match||i.subMatchCount)),!o.counter||!i.subMatchCount||i.isExpanded()&&o.hideExpandedCounter?i.$subMatchBadge&&i.$subMatchBadge.hide():(i.$subMatchBadge||(i.$subMatchBadge=e("<span class='fancytree-childcounter'/>"),e("span.fancytree-icon, span.fancytree-custom-icon",i.span).append(i.$subMatchBadge)),i.$subMatchBadge.show().text(i.subMatchCount)),!i.span||i.isEditing&&i.isEditing.call(i)||(i.titleWithHighlight?s.html(i.titleWithHighlight):d?s.text(i.title):s.html(i.title),l&&l({type:"enhanceTitle"},{node:i,$title:s})),n):n}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(t,n,i,r){var o=i.map,s=o[r],a=e(t),l=n+" "+(o._addClass||"");"string"==typeof s?(t.innerHTML="",a.attr("class",l+" "+s)):s&&(s.text?t.textContent=""+s.text:s.html?t.innerHTML=s.html:t.innerHTML="",a.attr("class",l+" "+(s.addClass||"")))}var n=e.ui.fancytree,i={awesome3:{_addClass:"",checkbox:"icon-check-empty",checkboxSelected:"icon-check",checkboxUnknown:"icon-check icon-muted",dragHelper:"icon-caret-right",dropMarker:"icon-caret-right",error:"icon-exclamation-sign",expanderClosed:"icon-caret-right",expanderLazy:"icon-angle-right",expanderOpen:"icon-caret-down",loading:"icon-refresh icon-spin",nodata:"icon-meh",noExpander:"",radio:"icon-circle-blank",radioSelected:"icon-circle",doc:"icon-file-alt",docOpen:"icon-file-alt",folder:"icon-folder-close-alt",folderOpen:"icon-folder-open-alt"},awesome4:{_addClass:"fa",checkbox:"fa-square-o",checkboxSelected:"fa-check-square-o",checkboxUnknown:"fa-square fancytree-helper-indeterminate-cb",dragHelper:"fa-arrow-right",dropMarker:"fa-long-arrow-right",error:"fa-warning",expanderClosed:"fa-caret-right",expanderLazy:"fa-angle-right",expanderOpen:"fa-caret-down",loading:{html:"<span class='fa fa-spinner fa-pulse' />"},nodata:"fa-meh-o",noExpander:"",radio:"fa-circle-thin",radioSelected:"fa-circle",doc:"fa-file-o",docOpen:"fa-file-o",folder:"fa-folder-o",folderOpen:"fa-folder-open-o"},awesome5:{_addClass:"",checkbox:"far fa-square",checkboxSelected:"far fa-check-square",checkboxUnknown:"fas fa-square fancytree-helper-indeterminate-cb",radio:"far fa-circle",radioSelected:"fas fa-circle",radioUnknown:"far fa-dot-circle",dragHelper:"fas fa-arrow-right",dropMarker:"fas fa-long-arrow-alt-right",error:"fas fa-exclamation-triangle",expanderClosed:"fas fa-caret-right",expanderLazy:"fas fa-angle-right",expanderOpen:"fas fa-caret-down",loading:"fas fa-spinner fa-pulse",nodata:"far fa-meh",noExpander:"",doc:"far fa-file",docOpen:"far fa-file",folder:"far fa-folder",folderOpen:"far fa-folder-open"},bootstrap3:{_addClass:"glyphicon",checkbox:"glyphicon-unchecked",checkboxSelected:"glyphicon-check",checkboxUnknown:"glyphicon-expand fancytree-helper-indeterminate-cb",dragHelper:"glyphicon-play",dropMarker:"glyphicon-arrow-right",error:"glyphicon-warning-sign",expanderClosed:"glyphicon-menu-right",expanderLazy:"glyphicon-menu-right",expanderOpen:"glyphicon-menu-down",loading:"glyphicon-refresh fancytree-helper-spin",nodata:"glyphicon-info-sign",noExpander:"",radio:"glyphicon-remove-circle",radioSelected:"glyphicon-ok-circle",doc:"glyphicon-file",docOpen:"glyphicon-file",folder:"glyphicon-folder-close",folderOpen:"glyphicon-folder-open"},material:{_addClass:"material-icons",checkbox:{text:"check_box_outline_blank"},checkboxSelected:{text:"check_box"},checkboxUnknown:{text:"indeterminate_check_box"},dragHelper:{text:"play_arrow"},dropMarker:{text:"arrow-forward"},error:{text:"warning"},expanderClosed:{text:"chevron_right"},expanderLazy:{text:"last_page"},expanderOpen:{text:"expand_more"},loading:{text:"autorenew",addClass:"fancytree-helper-spin"},nodata:{text:"info"},noExpander:{text:""},radio:{text:"radio_button_unchecked"},radioSelected:{text:"radio_button_checked"},doc:{text:"insert_drive_file"},docOpen:{text:"insert_drive_file"},folder:{text:"folder"},folderOpen:{text:"folder_open"}}};return e.ui.fancytree.registerExtension({name:"glyph",version:"2.30.2",options:{preset:null,map:{}},treeInit:function(t){var r=t.tree,o=t.options.glyph;o.preset?(n.assert(!!i[o.preset],"Invalid value for `options.glyph.preset`: "+o.preset),o.map=e.extend({},i[o.preset],o.map)):r.warn("ext-glyph: missing `preset` option."),this._superApply(arguments),r.$container.addClass("fancytree-ext-glyph")},nodeRenderStatus:function(i){var r,o,s,a=i.node,l=e(a.span),d=i.options.glyph;return o=this._super(i),a.isRoot()?o:((s=l.children("span.fancytree-expander").get(0))&&t(s,"fancytree-expander",d,a.expanded&&a.hasChildren()?"expanderOpen":a.isUndefined()?"expanderLazy":a.hasChildren()?"expanderClosed":"noExpander"),(s=a.tr?e("td",a.tr).find("span.fancytree-checkbox").get(0):l.children("span.fancytree-checkbox").get(0))&&(r=n.evalOption("checkbox",a,a,d,!1),a.parent&&a.parent.radiogroup||"radio"===r?t(s,"fancytree-checkbox fancytree-radio",d,a.selected?"radioSelected":"radio"):t(s,"fancytree-checkbox",d,a.selected?"checkboxSelected":a.partsel?"checkboxUnknown":"checkbox")),(s=l.children("span.fancytree-icon").get(0))&&t(s,"fancytree-icon",d,a.statusNodeType?a.statusNodeType:a.folder?a.expanded&&a.hasChildren()?"folderOpen":"folder":a.expanded?"docOpen":"doc"),o)},nodeSetStatus:function(n,i,r,o){var s,a,l=n.options.glyph,d=n.node;return s=this._superApply(arguments),"error"!==i&&"loading"!==i&&"nodata"!==i||(d.parent?(a=e("span.fancytree-expander",d.span).get(0))&&t(a,"fancytree-expander",l,i):(a=e(".fancytree-statusnode-"+i,d[this.nodeContainerAttrName]).find("span.fancytree-icon").get(0))&&t(a,"fancytree-icon",l,i)),s}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree","./jquery.fancytree.table"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree.table"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(t,n){var i,r=null,o=0;return t.children().each(function(){if(o>=n)return r=e(this),!1;i=e(this).prop("colspan"),o+=i||1}),r}function n(n,r){var o,s,a=n.closest("td"),l=null;switch(r){case i.LEFT:l=a.prev();break;case i.RIGHT:l=a.next();break;case i.UP:case i.DOWN:for(s=function(t,n){var i,r=n.get(0),o=0;return t.children().each(function(){if(this===r)return!1;i=e(this).prop("colspan"),o+=i||1}),o}(o=a.parent(),a);(o=r===i.UP?o.prev():o.next()).length&&(o.is(":hidden")||!(l=t(o,s))||!l.find(":input,a").length););}return l}var i=e.ui.keyCode,r={text:[i.UP,i.DOWN],checkbox:[i.UP,i.DOWN,i.LEFT,i.RIGHT],link:[i.UP,i.DOWN,i.LEFT,i.RIGHT],radiobutton:[i.UP,i.DOWN,i.LEFT,i.RIGHT],"select-one":[i.LEFT,i.RIGHT],"select-multiple":[i.LEFT,i.RIGHT]};return e.ui.fancytree.registerExtension({name:"gridnav",version:"2.30.2",options:{autofocusInput:!1,handleCursorKeys:!0},treeInit:function(t){this._requireExtension("table",!0,!0),this._superApply(arguments),this.$container.addClass("fancytree-ext-gridnav"),this.$container.on("focusin",function(n){var i,r=e.ui.fancytree.getNode(n.target);r&&!r.isActive()&&(i=t.tree._makeHookContext(r,n),t.tree._callHook("nodeSetActive",i,!0))})},nodeSetActive:function(t,n,i){var r=t.options.gridnav,o=t.node,s=t.originalEvent||{},a=e(s.target).is(":input");n=!1!==n,this._superApply(arguments),n&&(t.options.titlesTabbable?(a||(e(o.span).find("span.fancytree-title").focus(),o.setFocus()),t.tree.$container.attr("tabindex","-1")):r.autofocusInput&&!a&&e(o.tr||o.span).find(":input:enabled:first").focus())},nodeKeydown:function(t){var i,o,s,a=t.options.gridnav,l=t.originalEvent,d=e(l.target);return d.is(":input:enabled")?i=d.prop("type"):d.is("a")&&(i="link"),i&&a.handleCursorKeys?!((o=r[i])&&e.inArray(l.which,o)>=0&&(s=n(d,l.which))&&s.length&&(s.find(":input:enabled,a").focus(),1)):this._superApply(arguments)}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";return e.ui.fancytree.registerExtension({name:"multi",version:"2.30.2",options:{allowNoSelect:!1,mode:"sameParent"},treeInit:function(t){this._superApply(arguments),this.$container.addClass("fancytree-ext-multi"),1===t.options.selectMode&&e.error("Fancytree ext-multi: selectMode: 1 (single) is not compatible.")},nodeClick:function(t){var n=t.tree,i=t.node,r=n.getActiveNode()||n.getFirstChild(),o="checkbox"===t.targetType,s="expander"===t.targetType;switch(e.ui.fancytree.eventToString(t.originalEvent)){case"click":if(s)break;o||(n.selectAll(!1),i.setSelected());break;case"shift+click":n.visitRows(function(e){if(e.setSelected(),e===i)return!1},{start:r,reverse:r.isBelowOf(i)});break;case"ctrl+click":case"meta+click":return void i.toggleSelected()}return this._superApply(arguments)},nodeKeydown:function(t){var n=t.tree,i=t.node,r=t.originalEvent;switch(e.ui.fancytree.eventToString(r)){case"up":case"down":n.selectAll(!1),i.navigate(r.which,!0),n.getActiveNode().setSelected();break;case"shift+up":case"shift+down":i.navigate(r.which,!0),n.getActiveNode().setSelected()}return this._superApply(arguments)}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(n,i,r,o,a){var l,d,c,u,h=!1,f=n.options.persist.expandOpts,p=[],g=[];for(r=r||[],a=a||e.Deferred(),l=0,c=r.length;l<c;l++)d=r[l],(u=n.getNodeByKey(d))?o&&u.isUndefined()?(h=!0,n.debug("_loadLazyNodes: "+u+" is lazy: loading..."),"expand"===o?p.push(u.setExpanded(!0,f)):p.push(u.load())):(n.debug("_loadLazyNodes: "+u+" already loaded."),u.setExpanded(!0,f)):(g.push(d),n.debug("_loadLazyNodes: "+u+" was not yet found."));return e.when.apply(e,p).always(function(){if(h&&g.length>0)t(n,i,g,o,a);else{if(g.length)for(n.warn("_loadLazyNodes: could not load those keys: ",g),l=0,c=g.length;l<c;l++)d=r[l],i._appendKey(s,r[l],!1);a.resolve()}}),a}var n=null,i=window.localStorage?{get:function(e){return window.localStorage.getItem(e)},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)}}:null,r=window.sessionStorage?{get:function(e){return window.sessionStorage.getItem(e)},set:function(e,t){window.sessionStorage.setItem(e,t)},remove:function(e){window.sessionStorage.removeItem(e)}}:null,o=e.ui.fancytree.assert,s="expanded",a="selected";return"function"==typeof Cookies?n={get:Cookies.get,set:function(e,t){Cookies.set(e,t,this.options.persist.cookie)},remove:Cookies.remove}:e&&"function"==typeof e.cookie&&(n={get:e.cookie,set:function(t,n){e.cookie.set(t,n,this.options.persist.cookie)},remove:e.removeCookie}),e.ui.fancytree._FancytreeClass.prototype.clearPersistData=function(e){var t=this.ext.persist,n=t.cookiePrefix;(e=e||"active expanded focus selected").indexOf("active")>=0&&t._data(n+"active",null),e.indexOf(s)>=0&&t._data(n+s,null),e.indexOf("focus")>=0&&t._data(n+"focus",null),e.indexOf(a)>=0&&t._data(n+a,null)},e.ui.fancytree._FancytreeClass.prototype.clearCookies=function(e){return this.warn("'tree.clearCookies()' is deprecated since v2.27.0: use 'clearPersistData()' instead."),this.clearPersistData(e)},e.ui.fancytree._FancytreeClass.prototype.getPersistData=function(){var e=this.ext.persist,t=e.cookiePrefix,n=e.cookieDelimiter,i={};return i.active=e._data(t+"active"),i[s]=(e._data(t+s)||"").split(n),i[a]=(e._data(t+a)||"").split(n),i.focus=e._data(t+"focus"),i},e.ui.fancytree.registerExtension({name:"persist",version:"2.30.2",options:{cookieDelimiter:"~",cookiePrefix:void 0,cookie:{raw:!1,expires:"",path:"",domain:"",secure:!1},expandLazy:!1,expandOpts:void 0,fireActivate:!0,overrideSource:!0,store:"auto",types:"active expanded focus selected"},_data:function(e,t){var n=this._local.store;if(void 0===t)return n.get.call(this,e);null===t?n.remove.call(this,e):n.set.call(this,e,t)},_appendKey:function(t,n,i){n=""+n;var r=this._local,o=this.options.persist.cookieDelimiter,s=r.cookiePrefix+t,a=r._data(s),l=a?a.split(o):[],d=e.inArray(n,l);d>=0&&l.splice(d,1),i&&l.push(n),r._data(s,l.join(o))},treeInit:function(l){var d=l.tree,c=l.options,u=this._local,h=this.options.persist;return u.cookiePrefix=h.cookiePrefix||"fancytree-"+d._id+"-",u.storeActive=h.types.indexOf("active")>=0,u.storeExpanded=h.types.indexOf(s)>=0,u.storeSelected=h.types.indexOf(a)>=0,u.storeFocus=h.types.indexOf("focus")>=0,u.store=null,"auto"===h.store&&(h.store=i?"local":"cookie"),e.isPlainObject(h.store)?u.store=h.store:"cookie"===h.store?u.store=n:"local"===h.store?u.store="local"===h.store?i:r:"session"===h.store&&(u.store="local"===h.store?i:r),o(u.store,"Need a valid store."),d.$div.on("fancytreeinit",function(n){if(!1!==d._triggerTreeEvent("beforeRestore",null,{})){var i,r,o,l,f=u._data(u.cookiePrefix+"focus"),p=!1===h.fireActivate;i=u._data(u.cookiePrefix+s),o=i&&i.split(h.cookieDelimiter),(u.storeExpanded?t(d,u,o,!!h.expandLazy&&"expand",null):(new e.Deferred).resolve()).done(function(){if(u.storeSelected){if(i=u._data(u.cookiePrefix+a))for(o=i.split(h.cookieDelimiter),r=0;r<o.length;r++)(l=d.getNodeByKey(o[r]))?(void 0===l.selected||h.overrideSource&&!1===l.selected)&&(l.selected=!0,l.renderStatus()):u._appendKey(a,o[r],!1);3===d.options.selectMode&&d.visit(function(e){if(e.selected)return e.fixSelection3AfterClick(),"skip"})}u.storeActive&&(!(i=u._data(u.cookiePrefix+"active"))||!c.persist.overrideSource&&d.activeNode||(l=d.getNodeByKey(i))&&(l.debug("persist: set active",i),l.setActive(!0,{noFocus:!0,noEvents:p}))),u.storeFocus&&f&&(l=d.getNodeByKey(f))&&(d.options.titlesTabbable?e(l.span).find(".fancytree-title").focus():e(d.$container).focus()),d._triggerTreeEvent("restore",null,{})})}}),this._superApply(arguments)},nodeSetActive:function(e,t,n){var i,r=this._local;return t=!1!==t,i=this._superApply(arguments),r.storeActive&&r._data(r.cookiePrefix+"active",this.activeNode?this.activeNode.key:null),i},nodeSetExpanded:function(e,t,n){var i,r=e.node,o=this._local;return t=!1!==t,i=this._superApply(arguments),o.storeExpanded&&o._appendKey(s,r.key,t),i},nodeSetFocus:function(e,t){var n,i=this._local;return t=!1!==t,n=this._superApply(arguments),i.storeFocus&&i._data(i.cookiePrefix+"focus",this.focusNode?this.focusNode.key:null),n},nodeSetSelected:function(t,n,i){var r,o,s=t.tree,l=t.node,d=this._local;return n=!1!==n,r=this._superApply(arguments),d.storeSelected&&(3===s.options.selectMode?(o=(o=e.map(s.getSelectedNodes(!0),function(e){return e.key})).join(t.options.persist.cookieDelimiter),d._data(d.cookiePrefix+a,o)):d._appendKey(a,l.key,l.selected)),r}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(t,n){n=n||"",t||e.error("Assertion failed "+n)}function n(e,t){e.visit(function(e){var n=e.tr;if(n&&(n.style.display=e.hide||!t?"none":""),!e.expanded)return"skip"})}return e.ui.fancytree.registerExtension({name:"table",version:"2.30.2",options:{checkboxColumnIdx:null,mergeStatusColumns:!0,indentation:16,nodeColumnIdx:0},treeInit:function(n){var i,r,o,s,a=n.tree,l=n.options,d=l.table,c=a.widget.element;if(null!=d.customStatus&&(null!=l.renderStatusColumns?e.error("The 'customStatus' option is deprecated since v2.15.0. Use 'renderStatusColumns' only instead."):(a.warn("The 'customStatus' option is deprecated since v2.15.0. Use 'renderStatusColumns' instead."),l.renderStatusColumns=d.customStatus)),l.renderStatusColumns&&!0===l.renderStatusColumns&&(l.renderStatusColumns=l.renderColumns),c.addClass("fancytree-container fancytree-ext-table"),(s=c.find(">tbody")).length||(c.find(">tr").length&&e.error("Expected table > tbody > tr. If you see this please open an issue."),s=e("<tbody>").appendTo(c)),a.tbody=s[0],a.columnCount=e("thead >tr:last >th",c).length,(o=s.children("tr:first")).length)r=o.children("td").length,a.columnCount&&r!==a.columnCount&&(a.warn("Column count mismatch between thead ("+a.columnCount+") and tbody ("+r+"): using tbody."),a.columnCount=r),o=o.clone();else for(t(a.columnCount>=1,"Need either <thead> or <tbody> with <td> elements to determine column count."),o=e("<tr />"),i=0;i<a.columnCount;i++)o.append("<td />");o.find(">td").eq(d.nodeColumnIdx).html("<span class='fancytree-node' />"),l.aria&&(o.attr("role","row"),o.find("td").attr("role","gridcell")),a.rowFragment=document.createDocumentFragment(),a.rowFragment.appendChild(o.get(0)),s.empty(),a.statusClassPropName="tr",a.ariaPropName="tr",this.nodeContainerAttrName="tr",a.$container=c,this._superApply(arguments),e(a.rootNode.ul).remove(),a.rootNode.ul=null,this.$container.attr("tabindex",l.tabindex),l.aria&&a.$container.attr("role","treegrid").attr("aria-readonly",!0)},nodeRemoveChildMarkup:function(t){t.node.visit(function(t){t.tr&&(e(t.tr).remove(),t.tr=null)})},nodeRemoveMarkup:function(t){var n=t.node;n.tr&&(e(n.tr).remove(),n.tr=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(i,r,o,s,a){var l,d,c,u,h,f,p,g,y=i.tree,v=i.node,m=i.options,x=!v.parent;if(!1!==y._enableUpdate){if(a||(i.hasCollapsedParents=v.parent&&!v.parent.expanded),!x)if(v.tr&&r&&this.nodeRemoveMarkup(i),v.tr)r?this.nodeRenderTitle(i):this.nodeRenderStatus(i);else{if(i.hasCollapsedParents&&!o)return;h=y.rowFragment.firstChild.cloneNode(!0),t(f=function(n){var i,r,o=n.parent,s=o?o.children:null;if(s&&s.length>1&&s[0]!==n)for(t((r=s[e.inArray(n,s)-1]).tr);r.children&&r.children.length&&(i=r.children[r.children.length-1]).tr;)r=i;else r=o;return r}(v)),!0===s&&a?h.style.display="none":o&&i.hasCollapsedParents&&(h.style.display="none"),f.tr?function(e,t){e.parentNode.insertBefore(t,e.nextSibling)}(f.tr,h):(t(!f.parent,"prev. row must have a tr, or be system root"),function(e,t){e.insertBefore(t,e.firstChild)}(y.tbody,h)),v.tr=h,v.key&&m.generateIds&&(v.tr.id=m.idPrefix+v.key),v.tr.ftnode=v,v.span=e("span.fancytree-node",v.tr).get(0),this.nodeRenderTitle(i),m.createNode&&m.createNode.call(y,{type:"createNode"},i)}if(m.renderNode&&m.renderNode.call(y,{type:"renderNode"},i),(l=v.children)&&(x||o||v.expanded))for(c=0,u=l.length;c<u;c++)(g=e.extend({},i,{node:l[c]})).hasCollapsedParents=g.hasCollapsedParents||!v.expanded,this.nodeRender(g,r,o,s,!0);l&&!a&&(p=v.tr||null,d=y.tbody.firstChild,v.visit(function(e){if(e.tr){if(e.parent.expanded||"none"===e.tr.style.display||(e.tr.style.display="none",n(e,!1)),e.tr.previousSibling!==p){v.debug("_fixOrder: mismatch at node: "+e);var t=p?p.nextSibling:d;y.tbody.insertBefore(e.tr,t)}p=e.tr}}))}},nodeRenderTitle:function(t,n){var i,r,o=t.tree,s=t.node,a=t.options,l=s.isStatusNode();if(r=this._super(t,n),s.isRootNode())return r;if(a.checkbox&&!l&&null!=a.table.checkboxColumnIdx&&(i=e("span.fancytree-checkbox",s.span),e(s.tr).find("td").eq(+a.table.checkboxColumnIdx).html(i)),this.nodeRenderStatus(t),l){if(a.renderStatusColumns)a.renderStatusColumns.call(t.tree,{type:"renderStatusColumns"},t);else if(a.table.mergeStatusColumns&&s.isTopLevel()){e(s.tr).find(">td").eq(0).prop("colspan",o.columnCount).text(s.title).addClass("fancytree-status-merged").nextAll().remove()}}else a.renderColumns&&a.renderColumns.call(t.tree,{type:"renderColumns"},t);return r},nodeRenderStatus:function(t){var n,i=t.node,r=t.options;this._super(t),e(i.tr).removeClass("fancytree-node"),n=(i.getLevel()-1)*r.table.indentation,r.rtl?e(i.span).css({paddingRight:n+"px"}):e(i.span).css({paddingLeft:n+"px"})},nodeSetExpanded:function(t,i,r){function o(e){n(t.node,i),e?i&&t.options.autoScroll&&!r.noAnimation&&t.node.hasChildren()?t.node.getLastChild().scrollIntoView(!0,{topNode:t.node}).always(function(){r.noEvents||t.tree._triggerNodeEvent(i?"expand":"collapse",t),s.resolveWith(t.node)}):(r.noEvents||t.tree._triggerNodeEvent(i?"expand":"collapse",t),s.resolveWith(t.node)):(r.noEvents||t.tree._triggerNodeEvent(i?"expand":"collapse",t),s.rejectWith(t.node))}if(i=!1!==i,t.node.expanded&&i||!t.node.expanded&&!i)return this._superApply(arguments);var s=new e.Deferred,a=e.extend({},r,{noEvents:!0,noAnimation:!0});return r=r||{},this._super(t,i,a).done(function(){o(!0)}).fail(function(){o(!1)}),s.promise()},nodeSetStatus:function(t,n,i,r){if("ok"===n){var o=t.node,s=o.children?o.children[0]:null;s&&s.isStatusNode()&&e(s.tr).remove()}return this._superApply(arguments)},treeClear:function(e){return this.nodeRemoveChildMarkup(this._makeHookContext(this.rootNode)),this._superApply(arguments)},treeDestroy:function(e){return this.$container.find("tbody").empty(),this.$source&&this.$source.removeClass("fancytree-helper-hidden"),this._superApply(arguments)}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";return e.ui.fancytree.registerExtension({name:"themeroller",version:"2.30.2",options:{activeClass:"ui-state-active",addClass:"ui-corner-all",focusClass:"ui-state-focus",hoverClass:"ui-state-hover",selectedClass:"ui-state-highlight"},treeInit:function(t){var n=t.widget.element,i=t.options.themeroller;this._superApply(arguments),"TABLE"===n[0].nodeName?(n.addClass("ui-widget ui-corner-all"),n.find(">thead tr").addClass("ui-widget-header"),n.find(">tbody").addClass("ui-widget-conent")):n.addClass("ui-widget ui-widget-content ui-corner-all"),n.delegate(".fancytree-node","mouseenter mouseleave",function(t){var n=e.ui.fancytree.getNode(t.target),r="mouseenter"===t.type;e(n.tr?n.tr:n.span).toggleClass(i.hoverClass+" "+i.addClass,r)})},treeDestroy:function(e){this._superApply(arguments),e.widget.element.removeClass("ui-widget ui-widget-content ui-corner-all")},nodeRenderStatus:function(t){var n={},i=t.node,r=e(i.tr?i.tr:i.span),o=t.options.themeroller;this._super(t),n[o.activeClass]=!1,n[o.focusClass]=!1,n[o.selectedClass]=!1,i.isActive()&&(n[o.activeClass]=!0),i.hasFocus()&&(n[o.focusClass]=!0),i.isSelected()&&!i.isActive()&&(n[o.selectedClass]=!0),r.toggleClass(o.activeClass,n[o.activeClass]),r.toggleClass(o.focusClass,n[o.focusClass]),r.toggleClass(o.selectedClass,n[o.selectedClass]),r.addClass(o.addClass)}}),e.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(t,n){var i=e("#"+(t="fancytree-style-"+t));if(!n)return i.remove(),null;i.length||(i=e("<style />").attr("id",t).addClass("fancytree-style").prop("type","text/css").appendTo("head"));try{i.html(n)}catch(e){i[0].styleSheet.cssText=n}return i}function n(e,t,n,i,r,o){var s,a="#"+e+" span.fancytree-level-",l=[];for(s=0;s<t;s++)l.push(a+(s+1)+" span.fancytree-title { padding-left: "+(s*n+i)+o+"; }");return l.push("#"+e+" div.ui-effects-wrapper ul li span.fancytree-title, #"+e+" li.fancytree-animating span.fancytree-title { padding-left: "+r+o+"; position: static; width: auto; }"),l.join("\n")}var i=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;return e.ui.fancytree.registerExtension({name:"wide",version:"2.30.2",options:{iconWidth:null,iconSpacing:null,labelSpacing:null,levelOfs:null},treeCreate:function(r){this._superApply(arguments),this.$container.addClass("fancytree-ext-wide");var o,s,a,l,d,c=r.options.wide,u=e("<li id='fancytreeTemp'><span class='fancytree-node'><span class='fancytree-icon' /><span class='fancytree-title' /></span><ul />").appendTo(r.tree.$container),h=u.find(".fancytree-icon"),f=u.find("ul"),p=c.iconSpacing||h.css("margin-left"),g=c.iconWidth||h.css("width"),y=c.labelSpacing||"3px",v=c.levelOfs||f.css("padding-left");u.remove(),s=p.match(i)[2],p=parseFloat(p,10),a=y.match(i)[2],y=parseFloat(y,10),l=g.match(i)[2],g=parseFloat(g,10),d=v.match(i)[2],s===l&&d===l&&a===l||e.error("iconWidth, iconSpacing, and levelOfs must have the same css measure unit"),this._local.measureUnit=l,this._local.levelOfs=parseFloat(v),this._local.lineOfs=(1+(r.options.checkbox?1:0)+(!1===r.options.icon?0:1))*(g+p)+p,this._local.labelOfs=y,this._local.maxDepth=10,t(o=this.$container.uniqueId().attr("id"),n(o,this._local.maxDepth,this._local.levelOfs,this._local.lineOfs,this._local.labelOfs,this._local.measureUnit))},treeDestroy:function(e){return t(this.$container.attr("id"),null),this._superApply(arguments)},nodeRenderStatus:function(i){var r,o,s=i.node,a=s.getLevel();return o=this._super(i),a>this._local.maxDepth&&(r=this.$container.attr("id"),this._local.maxDepth*=2,s.debug("Define global ext-wide css up to level "+this._local.maxDepth),t(r,n(r,this._local.maxDepth,this._local.levelOfs,this._local.lineOfs,this._local.labelSpacing,this._local.measureUnit))),e(s.span).addClass("fancytree-level-"+a),o}}),e.ui.fancytree}),e.ui.fancytree});
//# sourceMappingURL=jquery.fancytree-all-deps.min.js.map