$(document).ready(function(){var e="#5A8DEE",t="#FDAC41",c="#FFEED9",a="#fff",l=[{text:"Parent 1",href:"#parent1",tags:["4"],nodes:[{text:"Child 1",href:"#child1",tags:["2"],nodes:[{text:"Grandchild 1",href:"#grandchild1",tags:["0"]},{text:"Grandchild 2",href:"#grandchild2",tags:["0"]}]},{text:"Child 2",href:"#child2",tags:["0"]}]},{text:"Parent 2",href:"#parent2",tags:["0"]},{text:"Parent 3",href:"#parent3",tags:["0"]},{text:"Parent 4",href:"#parent4",tags:["0"]},{text:"Parent 5",href:"#parent5",tags:["0"]}],o=[{text:"Parent 1",tags:["2"],nodes:[{text:"Child 1",tags:["2"],nodes:[{text:"Grandchild 1",tags:["0"]},{text:"Grandchild 2",tags:["0"]}]},{text:"Child 2",tags:["3"]}]},{text:"Parent 2",tags:["7"]},{text:"Parent 3",icon:"bx bx-map",href:"#demo",tags:["11"]},{text:"Parent 4",icon:"bx bx-cloud-download",href:"/index.html",tags:["19"],selected:!0},{text:"Parent 5",icon:"bx bx-message-square",color:[a],backColor:"#FDAC41",href:"http://www.pixinvent.com",tags:["0","available"]}];$("#default-treeview").treeview({selectedBackColor:[e],data:l}),$("#collapsed-treeview").treeview({selectedBackColor:[e],levels:1,data:l}),$("#expanded-treeview").treeview({selectedBackColor:[e],levels:99,data:l}),$("#primary-color-treeview").treeview({selectedBackColor:[e],color:["#FF5B5C"],data:l}),$("#custom-icon-treeview").treeview({selectedBackColor:[e],color:[e],expandIcon:"bx bx-chevron-right",collapseIcon:"bx bx-chevron-down",nodeIcon:"bx bx-bookmark",data:l}),$("#tags-badge-treeview").treeview({selectedBackColor:[e],color:[e],expandIcon:"bx bx-stop-circle",collapseIcon:"bx bx-check-square",nodeIcon:"bx bx-user",showTags:!0,data:l}),$("#no-border-treeview").treeview({selectedBackColor:[e],color:[e],showBorder:!1,data:l}),$("#colorful-treeview").treeview({expandIcon:"bx bx-stop-circle",collapseIcon:"bx bx-check-square",nodeIcon:"icon-head",color:[a],backColor:[e],onhoverColor:["#6999f3"],borderColor:[e],showBorder:!1,showTags:!0,highlightSelected:!0,selectedColor:[a],selectedBackColor:["#2c6de9"],data:l}),$("#node-override-treeview").treeview({expandIcon:"bx bx-stop-circle",collapseIcon:"bx bx-check-square",nodeIcon:"icon-head",color:[t],backColor:[c],onhoverColor:["#fed8a6"],borderColor:[c],showBorder:!1,highlightSelected:!0,showTags:!0,selectedColor:[a],selectedBackColor:[t],data:o}),$("#link-enabled-treeview").treeview({selectedBackColor:[e],color:[e],enableLinks:!0,data:l});var r=$("#disabled-treeview").treeview({selectedBackColor:[e],data:l});$("#btn-disable-all").on("click",function(e){r.treeview("disableAll",{silent:$("#chk-disable-silent").is(":checked")})}),$("#btn-enable-all").on("click",function(e){r.treeview("enableAll",{silent:$("#chk-disable-silent").is(":checked")})});$("#data-treeview").treeview({selectedBackColor:[e],color:[e],data:'[{"text": "Parent 1","nodes": [{"text": "Child 1","nodes": [{"text": "Grandchild 1"},{"text": "Grandchild 2"}]},{"text": "Child 2"}]},{"text": "Parent 2"},{"text": "Parent 3"},{"text": "Parent 4"},{"text": "Parent 5"}]'});var n=$("#searchable-tree").treeview({selectedBackColor:[e],color:[e],showBorder:!0,data:l}),d=function(e){var t=$("#input-search").val(),c={ignoreCase:$("#chk-ignore-case").is(":checked"),exactMatch:$("#chk-exact-match").is(":checked"),revealResults:$("#chk-reveal-results").is(":checked")},a=n.treeview("search",[t,c]),l="<p>"+a.length+" matches found</p>";$.each(a,function(e,t){l+="<p>- "+t.text+"</p>"}),$("#search-output").html(l)};$("#btn-search").on("click",d),$("#input-search").on("keyup",d),$("#btn-clear-search").on("click",function(e){n.treeview("clearSearch"),$("#input-search").val(""),$("#search-output").html("")});var i=$("#expandible-tree").treeview({selectedBackColor:[e],data:l});$("#btn-expand-all").on("click",function(e){$("#select-expand-all-levels").val();i.treeview("expandAll",{levels:2})}),$("#btn-collapse-all").on("click",function(e){i.treeview("collapseAll")});var s=$("#checkable-tree").treeview({selectedBackColor:[e],data:l,showIcon:!1,showCheckbox:!0});$("#btn-check-all").on("click",function(e){s.treeview("checkAll",{silent:$("#chk-check-silent").is(":checked")})}),$("#btn-uncheck-all").on("click",function(e){s.treeview("uncheckAll",{silent:$("#chk-check-silent").is(":checked")})})});