lexgui 0.4.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var y={version:"0.4.2",ready:!1,components:[],signals:{},extraCommandbarEntries:[],activeDraggable:null};function f(e,t,a){return Math.min(Math.max(e,t),a)}function E(e,t){return 0==t?Math.floor(e):+e.toFixed(t??2).replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1")}function p(e,t,a,n,i){return(e-t)*(i-n)/(a-t)+n}y.MOUSE_LEFT_CLICK=0,y.MOUSE_MIDDLE_CLICK=1,y.MOUSE_RIGHT_CLICK=2,y.MOUSE_DOUBLE_CLICK=2,y.MOUSE_TRIPLE_CLICK=3,y.CURVE_MOVEOUT_CLAMP=0,y.CURVE_MOVEOUT_DELETE=1,y.DRAGGABLE_Z_INDEX=101,y.clamp=f,y.round=E,y.remapRange=p,"undefined"!=typeof performance?y.getTime=performance.now.bind(performance):"undefined"!=typeof Date&&Date.now?y.getTime=Date.now.bind(Date):"undefined"!=typeof process?y.getTime=function(){var e=process.hrtime();return.001*e[0]+1e-6*e[1]}:y.getTime=function(){return(new Date).getTime()};function m(e,t){setTimeout(e,t??0)}function c(e){return e.replace(/\s/g,"").replaceAll("@","_").replaceAll("+","_plus_").replaceAll(".","")}function d(e){return e.includes(".")?e.split(".").pop():null}function g(e){return JSON.parse(JSON.stringify(e))}function h(e){return[parseInt(e.substring(1,3),16)/255,parseInt(e.substring(3,5),16)/255,parseInt(e.substring(5,7),16)/255]}function u(e){let t="#";for(var a of e)a=Math.floor(255*a),t+=a.toString(16);return t}function v(e,t=8){var a=document.createElement("span"),e=(a.className="lexinputmeasure",a.innerHTML=e,document.body.appendChild(a),a.getBoundingClientRect());return y.UTILS.deleteElement(a),e.width+t}function b(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()}function x(s,t={}){let l=0,r=0,n=null,a=t.targetClass,o=t.dragMargin??3,i=(e,t,a)=>{var n=s.parentElement?s.parentElement.getBoundingClientRect():{x:0,y:0,width:0,height:0},i="fixed"==s.style.position?new y.vec2(n.x,n.y):new y.vec2;a=a??e.clientX-l-n.x,t=t??e.clientY-r-n.y,s.style.left=f(a,o+i.x,i.x+n.width-s.offsetWidth-o)+"px",s.style.top=f(t,o+i.y,i.y+n.height-s.offsetHeight-o)+"px",s.style.translate="none"};t.autoAdjust&&i(null,parseInt(s.style.left),parseInt(s.style.top));var e=y.UTILS.uidGenerator();s["draggable-id"]=e;let d=t.onMove?e=>{n&&t.onMove&&t.onMove(n)}:e=>{n&&i(e)},c=t.onDragStart;s.setAttribute("draggable",!0),s.addEventListener("mousedown",function(e){n=e.target.classList.contains(a)||!a?e.target:null}),s.addEventListener("dragstart",function(e){var t,a;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),n&&((t=new Image).src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",e.dataTransfer.setDragImage(t,0,0),e.dataTransfer.effectAllowed="move",t=e.target.getBoundingClientRect(),a=n.parentElement.getBoundingClientRect(),a="fixed"==n.style.position?new y.vec2(a.x,a.y):new y.vec2,l=e.clientX-t.x-a.x,r=e.clientY-t.y-a.y,document.addEventListener("mousemove",d),n._eventCatched=!0,y.activeDraggable&&(y.activeDraggable.style.zIndex=y.DRAGGABLE_Z_INDEX),y.activeDraggable=s,y.activeDraggable.style.zIndex=y.DRAGGABLE_Z_INDEX+1,c)&&c(n,e)},!1),document.addEventListener("mouseup",e=>{n&&(n=null,document.removeEventListener("mousemove",d))})}y.doAsync=m,y.getSupportedDOMName=c,y.has=function(e){return-1<y.components.indexOf(e)},y.getExtension=d,y.deepCopy=g,y.setTheme=function(e){e="light"==e?"light":"dark",document.documentElement.setAttribute("data-theme",e),y.emit("@on_new_color_scheme",e)},y.setThemeColor=function(e,t){document.querySelector(":root").style.setProperty("--"+e,t)},y.getThemeColor=function(e){var t=getComputedStyle(document.querySelector(":root"));return(e=t.getPropertyValue("--"+e)).includes("light-dark")?("light"==t.getPropertyValue("color-scheme")?e.substring(e.indexOf("(")+1,e.indexOf(",")):e.substring(e.indexOf(",")+1,e.indexOf(")"))).replace(/\s/g,""):e},y.getBase64Image=function(e){var t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t.toDataURL("image/png")},y.hexToRgb=h,y.rgbToHex=u,y.measureRealWidth=v,y.guidGenerator=b,y.buildTextPattern=function(e={}){var t=[],a=(e.lowercase&&t.push("(?=.*[a-z])"),e.uppercase&&t.push("(?=.*[A-Z])"),e.digit&&t.push("(?=.*\\d)"),e.specialChar&&t.push("(?=.*[@#$%^&+=!])"),e.noSpaces&&t.push("(?!.*\\s)"),e.minLength||0),n=e.maxLength||"",t=`^${t.join("")}.{${a},${n}}$`;return e.asRegExp?new RegExp(t):t},y.makeDraggable=x,y.makeCollapsible=function(e,t,a,n={}){e.classList.add("collapsible");var n=n.collapsed??!0,i=y.makeIcon("Right");i.classList.add("collapser"),i.dataset.collapsed=n,i.style.marginLeft="auto",i.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),this.dataset.collapsed?(delete this.dataset.collapsed,t.style.display="block"):(this.dataset.collapsed=!0,t.style.display="none")}),e.appendChild(i),(a=a??e.parentElement).appendChild(t)},y.makeCodeSnippet=function(e,t,a={}){if(y.has("CodeEditor")){var n,i,s,l=document.createElement("div"),t=(l.className="lexcodesnippet",l.style.width=t?t[0]:"auto",l.style.height=t?t[1]:"auto",new _({noAppend:!0})),r=new y.CodeEditor(t,{skipInfo:!0,disableEdition:!0,allowAddScripts:!1,name:a.tabName});if(r.setText(e,a.language??"Plain Text"),a.linesAdded){let t=r.root.querySelector(".code");for(var o of a.linesAdded)if(o.constructor==Number)t.childNodes[o-1].classList.add("added");else if(o.constructor==Array)for(let e=o[0]-1;e<=o[1]-1;e++)t.childNodes[e].classList.add("added")}if(a.linesRemoved){let t=r.root.querySelector(".code");for(var d of a.linesRemoved)if(d.constructor==Number)t.childNodes[d-1].classList.add("removed");else if(d.constructor==Array)for(let e=d[0]-1;e<=d[1]-1;e++)t.childNodes[e].classList.add("removed")}return a.windowMode&&((e=document.createElement("div")).className="lexwindowbuttons",(n=document.createElement("span")).style.background="#ee4f50",(i=document.createElement("span")).style.background="#f5b720",(s=document.createElement("span")).style.background="#53ca29",e.appendChild(n),e.appendChild(i),e.appendChild(s),r.root.querySelector(".lexareatabs").prepend(e)),(a.lineNumbers??!0)||r.root.classList.add("no-gutter"),l.appendChild(t.root),l}console.error("Import the CodeEditor component to create snippets!")},y.makeIcon=function(e,t,a=""){var n=document.createElement("a");return n.title=t??"",n.className="lexicon "+a,n.innerHTML=y.ICONS[e]??"",n},y.registerCommandbarEntry=function(e,t){y.extraCommandbarEntries.push({name:e,callback:t})};y.vec2=class o{constructor(e,t){this.x=e??0,this.y=t??e??0}get xy(){return[this.x,this.y]}get yx(){return[this.y,this.x]}set(e,t){this.x=e,this.y=t}add(e,t=new o){return t.set(this.x+e.x,this.y+e.y),t}sub(e,t=new o){return t.set(this.x-e.x,this.y-e.y),t}mul(e,t=new o){return e.constructor==Number&&(e=new o(e)),t.set(this.x*e.x,this.y*e.y),t}div(e,t=new o){return e.constructor==Number&&(e=new o(e)),t.set(this.x/e.x,this.y/e.y),t}abs(e=new o){return e.set(Math.abs(this.x),Math.abs(this.y)),e}dot(e){return this.x*e.x+this.y*e.y}len2(){return this.dot(this)}len(){return Math.sqrt(this.len2())}nrm(e=new o){return e.set(this.x,this.y),e.mul(1/this.len(),e)}dst(e){return e.sub(this).len()}clp(e,t,a=new o){return a.set(f(this.x,e,t),f(this.y,e,t)),a}},y.init=function(e={}){var t,a;return this.ready||((a=document.createElement("div")).id="lexroot",a.tabIndex=-1,(t=document.createElement("div")).id="modal",this.modal=t,this.root=a,this.container=document.body,this.modal.classList.add("hiddenOpacity"),this.modal.toggle=function(e){this.classList.toggle("hiddenOpacity",e)},e.container&&(this.container=document.getElementById(e.container)),this.usingStrictViewport=e.strictViewport??!0,document.documentElement.setAttribute("data-strictVP",this.usingStrictViewport?"true":"false"),this.usingStrictViewport||document.addEventListener("scroll",e=>{document.body.querySelectorAll(".lexmenubox").forEach(e=>{e._updatePosition()})}),this.commandbar=(e=>{let l=document.createElement("dialog"),r=(l.className="commandbar",l.tabIndex=-1,e.appendChild(l),[]),o=null;l.addEventListener("keydown",function(e){var t,a;e.stopPropagation(),e.stopImmediatePropagation(),o=o??-1,"Escape"==e.key?(this.close(),h(!0)):"Enter"==e.key?(t=r[o])&&(a=t.item.type&&"checkbox"===t.item.type,this.close(),a?(t.item.checked=!t.item.checked,t.callback.call(window,t.item.checked,t.entry_name)):t.callback.call(window,t.entry_name)):"ArrowDown"==e.key&&o<r.length-1?(o++,l.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered")),r[o].classList.add("hovered"),0<(a=r[o].offsetHeight*(o+1)-d.offsetHeight)&&d.scrollTo({top:a,behavior:"smooth"})):"ArrowUp"==e.key&&0<o&&(o--,l.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered")),r[o].classList.add("hovered"))}),l.addEventListener("focusout",function(e){e.relatedTarget!=e.currentTarget&&(e.stopPropagation(),e.stopImmediatePropagation(),this.close(),h(!0))}),e.addEventListener("keydown",e=>{if(" "==e.key&&e.ctrlKey)e.stopImmediatePropagation(),e.stopPropagation(),y.setCommandbarState(!0);else for(var t of y.components){var a;if(y[t]&&y[t].prototype.onKeyPressed)for(a of y.CodeEditor.getInstances())a.onKeyPressed(e)}}),(e=document.createElement("div")).className="gs-header";var t=document.createElement("a");t.className="fa-solid fa-magnifying-glass",e.appendChild(t);let a=document.createElement("input");a.placeholder="Search...",a.value="",e.appendChild(a);var n=(t=new _({width:"100%",skipAppend:!0,className:"gs-tabs"})).addTabs();let i,d=(n.add("All",document.createElement("div"),{selected:!0,onSelect:(e,t)=>{i=t}}),document.createElement("div")),c=(d.className="searchitembox",null),h=e=>{d.innerHTML="",r.length=0,o=null,e&&(a.value="")},u=(e,t,a,n)=>{var i,s;e.length&&(c&&c.classList.remove("last"),(i=document.createElement("div")).className="searchitem last",s=n&&n.type&&"checkbox"===n.type,i.innerHTML=s?"<a class='fa fa-check'></a><span>"+(a+e)+"</span>":a+e,i.entry_name=e,i.callback=t,i.item=n,i.addEventListener("click",function(e){this.callback.call(window,this.entry_name),y.setCommandbarState(!1),h(!0)}),i.addEventListener("mouseenter",function(e){l.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered")),this.classList.add("hovered"),o=r.indexOf(this)}),i.addEventListener("mouseleave",function(e){this.classList.remove("hovered")}),r.push(i),d.appendChild(i),c=i)},p=(e,t,a)=>{var n=Object.keys(e)[0],i=e.name??a+n;if(i.toLowerCase().includes(t)&&e.callback&&u(e.name??n,e.callback,a,e),!e.name){a+=n+" > ";for(var s of e[n])p(s,t,a)}};return l._addElements=e=>{h();for(var t of y.menubars)for(var a of t.items)p(a,e,"");for(var n of y.extraCommandbarEntries){var i=n.name;i.toLowerCase().includes(e)&&u(i,n.callback,"",{})}if(y.has("CodeEditor")){let a=y.CodeEditor.getInstances();if(a.length){var s=a[0].languages;for(let t of Object.keys(s)){var l="Language: "+t,r=a[0]._getFileIcon(null,s[t].ext),r=r.includes("fa-")?"<i class='"+r+"'></i>":"<img src='https://raw.githubusercontent.com/jxarco/lexgui.js/master/"+r+"'>";r+=l+" <span class='lang-ext'>("+s[t].ext+")</span>",l.toLowerCase().includes(e)&&u(r,()=>{for(var e of a)e._changeLanguage(t)},"",{})}}}},a.addEventListener("input",function(e){l._addElements(this.value.toLowerCase())}),l.appendChild(e),l.appendChild(t.root),l.appendChild(d),l})(this.container),this.container.appendChild(t),e.skipRoot?this.root=document.body:this.container.appendChild(a),(t=document.createElement("section")).className="notifications",this.notifications=document.createElement("ol"),this.notifications.className="",this.notifications.iWidth=0,t.appendChild(this.notifications),this.container.appendChild(t),this.notifications.addEventListener("mouseenter",()=>{this.notifications.classList.add("list")}),this.notifications.addEventListener("mouseleave",()=>{this.notifications.classList.remove("list")}),a.addEventListener("dragover",function(e){e.preventDefault()},!1),document.addEventListener("contextmenu",function(e){e.preventDefault()},!1),t=document.getElementsByTagName("HEAD")[0],(a=document.createElement("link")).rel="stylesheet",a.type="text/css",a.crossOrigin="anonymous",a.href="https://use.fontawesome.com/releases/v6.7.2/css/all.css",t.appendChild(a),this.DEFAULT_NAME_WIDTH="30%",this.DEFAULT_SPLITBAR_SIZE=4,this.OPEN_CONTEXTMENU_ENTRY="click",this.ready=!0,this.menubars=[],e.skipRoot||e.skipDefaultArea||(this.main_area=new _({id:e.id??"mainarea"})),(e.autoTheme??!0)&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&(y.setTheme("light"),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{y.setTheme(e.matches?"dark":"light")}))),this.main_area},y.setCommandbarState=function(e,t=!0){var a=this.commandbar;e?(a.show(),a.querySelector("input").focus(),t&&a._addElements(void 0)):a.close()},y.message=function(t,e,a={}){if(t)return a.modal=!0,new A(e,e=>{e.addTextArea(null,t,null,{disabled:!0,fitHeight:!0})},a);throw"No message to show"},y.popup=function(t,e,a={}){if(!t)throw"No message to show";a.size=a.size??["max-content","auto"],a.class="lexpopup";var n=a.timeout||3e3;let i=new A(e,e=>{e.addTextArea(null,t,null,{disabled:!0,fitHeight:!0})},a);return setTimeout(()=>{i.close()},Math.max(n,150)),i},y.prompt=function t(a,n,i,s={}){s.modal=!0,s.className="prompt";let l="",r=new A(n,e=>{e.addTextArea(null,a,null,{disabled:!0,fitHeight:!0}),(s.input??!0)&&e.addText(null,s.input||l,e=>l=e,{placeholder:"..."}),e.sameLine(2),e.addButton(null,"Cancel",()=>{s.on_cancel&&s.on_cancel(),r.close()}),e.addButton(null,s.accept||"Continue",()=>{s.required&&""===l?(a+=a.includes("You must fill the input text.")?"":"\nYou must fill the input text.",r.close(),t(a,n,i,s)):(i&&i.call(this,l),r.close())},{buttonClass:"primary"})},s);return(s.input??!0)&&r.root.querySelector("input").focus(),r},y.toast=function(e,t,a={}){if(!e)throw"The toast needs at least a title!";console.assert(this.notifications);let n=document.createElement("li");n.className="lextoast",n.style.translate="0 calc(100% + 30px)",this.notifications.prepend(n),m(()=>{this.notifications.offsetWidth>this.notifications.iWidth&&(this.notifications.iWidth=Math.min(this.notifications.offsetWidth,480),this.notifications.style.width=this.notifications.iWidth+"px"),n.dataset.open=!0},10);var i=document.createElement("div"),s=(i.className="lextoastcontent",n.appendChild(i),document.createElement("div"));s.className="title",s.innerHTML=e,i.appendChild(s),t&&((e=document.createElement("div")).className="desc",e.innerHTML=t,i.appendChild(e)),a.action&&((s=new k).addButton(null,a.action.name??"Accept",a.action.callback.bind(this,n),{width:"auto",maxWidth:"150px",className:"right",buttonClass:"outline"}),n.appendChild(s.root.childNodes[0]));let l=this;n.close=function(){this.dataset.closed=!0,m(()=>{this.remove(),l.notifications.childElementCount||(l.notifications.style.width="unset",l.notifications.iWidth=0)},500)},(a.closable??!0)&&((t=document.createElement("a")).className="fa fa-xmark lexicon closer",t.addEventListener("click",()=>{n.close()}),n.appendChild(t)),-1!=(i=a.timeout??3e3)&&m(()=>{n.close()},i)},y.badge=function(e,t,a={}){var n=document.createElement("div");return n.innerHTML=e,n.className="lexbadge "+(t??""),Object.assign(n.style,a.style??{}),n.outerHTML},y.makeContainer=function(e,t,a={}){var n=document.createElement("div");return n.className="lexcontainer "+(t??""),n.style.width=e&&e[0]?e[0]:"100%",n.style.height=e&&e[1]?e[1]:"100%",Object.assign(n.style,a),n};class w{constructor(e,t,a){this.name=e,this.value=t,this.domEvent=a}}y.IEvent=w;class L{static NONE=0;static NODE_SELECTED=1;static NODE_DELETED=2;static NODE_DBLCLICKED=3;static NODE_CONTEXTMENU=4;static NODE_DRAGGED=5;static NODE_RENAMED=6;static NODE_VISIBILITY=7;static NODE_CARETCHANGED=8;constructor(e,t,a){this.type=e||L.NONE,this.node=t,this.value=a,this.multiple=!1,this.panel=null}string(){switch(this.type){case L.NONE:return"tree_event_none";case L.NODE_SELECTED:return"tree_event_selected";case L.NODE_DELETED:return"tree_event_deleted";case L.NODE_DBLCLICKED:return"tree_event_dblclick";case L.NODE_CONTEXTMENU:return"tree_event_contextmenu";case L.NODE_DRAGGED:return"tree_event_dragged";case L.NODE_RENAMED:return"tree_event_renamed";case L.NODE_VISIBILITY:return"tree_event_visibility";case L.NODE_CARETCHANGED:return"tree_event_caretchanged"}}}y.TreeEvent=L,y.emit=function(e,t,a={}){var n=y.signals[e];if(n){var i=a.target;if(i)i[e]&&i[e].call(i,t);else for(var s of n)s.constructor===T?(s.set(t,a.skipCallback??!0),s.options&&s.options.callback&&s.options.callback(t,n)):s(null,t)}},y.addSignal=function(e,t,a){t[e]=a,y.signals[e]||(y.signals[e]=[]),-1<y.signals[e].indexOf(t)||y.signals[e].push(t)};class _{constructor(e={}){var n,i,t=document.createElement("div"),a=(t.className="lexarea",e.id&&(t.id=e.id),e.className&&(t.className+=" "+e.className),e.width||"calc( 100% )"),s=e.height||"100%",a=(this.setLimitBox(e.minWidth,e.minHeight,e.maxWidth,e.maxHeight),a.constructor==Number&&(a+="px"),s.constructor==Number&&(s+="px"),t.style.width=a,t.style.height=s,this.offset=0,this.root=t,this.size=[this.root.offsetWidth,this.root.offsetHeight],this.sections=[],this.panels=[],e.skipAppend||document.getElementById("lexroot").appendChild(this.root),e.overlay);function l(e){switch(n.type){case"right":var t=i[0]-e.x,a=n.root.offsetWidth+t;n.root.style.width=a+"px";break;case"left":t=i[0]-e.x,a=Math.min(document.body.clientWidth-y.DEFAULT_SPLITBAR_SIZE,n.root.offsetWidth-t);n.root.style.width=a+"px",n.splitBar.style.left=a+y.DEFAULT_SPLITBAR_SIZE/2+"px";break;case"top":t=i[1]-e.y,a=Math.min(document.body.clientHeight-y.DEFAULT_SPLITBAR_SIZE,n.root.offsetHeight-t);n.root.style.height=a+"px",n.splitBar.style.top=a+y.DEFAULT_SPLITBAR_SIZE/2+"px";break;case"bottom":t=i[1]-e.y,a=n.root.offsetHeight+t;n.root.style.height=a+"px"}i[0]=e.x,i[1]=e.y,e.stopPropagation(),e.preventDefault(),n.onresize&&n.onresize(n.root.getBoundingClientRect())}function r(e){var t=n.root.ownerDocument;t.removeEventListener("mousemove",l),t.removeEventListener("mouseup",r),document.body.classList.remove("nocursor"),n.splitBar.classList.remove("nocursor")}a&&(this.root.classList.add("overlay-"+a),e.left?this.root.style.left=e.left:e.right?this.root.style.right=e.right:e.top?this.root.style.top=e.top:e.bottom&&(this.root.style.bottom=e.bottom),(e.draggable??!0)&&x(t,e),e.resizeable&&t.classList.add("resizeable"),e.resize)&&(this.splitBar=document.createElement("div"),s="left"==a||"right"==a?"horizontal":"vertical",this.type=a,this.splitBar.className="lexsplitbar "+s,"right"==a?(this.splitBar.style.width=y.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.left=-y.DEFAULT_SPLITBAR_SIZE/2+"px"):"left"==a?(t=Math.min(document.body.clientWidth-y.DEFAULT_SPLITBAR_SIZE,this.root.clientWidth),this.splitBar.style.width=y.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.left=t+y.DEFAULT_SPLITBAR_SIZE/2+"px"):"top"==a?(e=Math.min(document.body.clientHeight-y.DEFAULT_SPLITBAR_SIZE,this.root.clientHeight),this.splitBar.style.height=y.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.top=e+y.DEFAULT_SPLITBAR_SIZE/2+"px"):"bottom"==a&&(this.splitBar.style.height=y.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.top=-y.DEFAULT_SPLITBAR_SIZE/2+"px"),this.splitBar.addEventListener("mousedown",function(e){var t=n.root.ownerDocument;t.addEventListener("mousemove",l),t.addEventListener("mouseup",r),i[0]=e.x,i[1]=e.y,e.stopPropagation(),e.preventDefault(),document.body.classList.add("nocursor"),n.splitBar.classList.add("nocursor")}),this.root.appendChild(this.splitBar),n=this,i=[0,0])}attach(e){if(this.sections.length)this.sections[1].attach(e);else{if(!e)throw"no content to attach";(e.parent=this).root.appendChild(e.root||e)}}split(t={}){this.sections.length&&(this.offset=this.root.childNodes[0].offsetHeight,this._root=this.sections[0].root,this.root=this.sections[1].root);var a=t.type||"horizontal",n=t.sizes||["50%","50%"],e="auto"===t.sizes;if(!n[1]){let e=n[0];var i=t.top||0;e.constructor==Number&&(e=e+i+"px"),n[1]="calc( 100% - "+e+" )"}var s,l,i=new _({skipAppend:!0,className:"split"+(t.menubar||t.sidebar?"":" origin")}),r=new _({skipAppend:!0,className:"split"}),o=(i.parentArea=this,r.parentArea=this,t.minimizable??!1),t=(t.resize??!0)||o,d="0px";return this.offset=0,t&&(this.resize=t,this.splitBar=document.createElement("div"),this.splitBar.className="lexsplitbar "+a,"horizontal"==a?this.splitBar.style.width=y.DEFAULT_SPLITBAR_SIZE+"px":this.splitBar.style.height=y.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.addEventListener("mousedown",function(e){var t=l.root.ownerDocument;t.addEventListener("mousemove",c),t.addEventListener("mouseup",h),e.stopPropagation(),e.preventDefault(),document.body.classList.add("nocursor"),l.splitBar.classList.add("nocursor")}),d=y.DEFAULT_SPLITBAR_SIZE/2+"px",o)&&(this.splitExtended=!1,r.root.addEventListener("animationend",e=>{var t=getComputedStyle(r.root).opacity;r.root.classList.remove(e.animationName+"-"+a),r.root.style.opacity=t,C(r.root)}),this.splitBar.addEventListener("contextmenu",e=>{e.preventDefault(),S(null,e,e=>{e.add("Extend",{disabled:this.splitExtended,callback:()=>{this.extend()}}),e.add("Reduce",{disabled:!this.splitExtended,callback:()=>{this.reduce()}})})})),"horizontal"==a?(o=n[0],s=n[1],o.constructor==Number&&(o+="px"),s.constructor==Number&&(s+="px"),i.root.style.width="calc( "+o+" - "+d+" )",i.root.style.height="calc(100% - 0px)",r.root.style.width="calc( "+s+" - "+d+" )",r.root.style.height="calc(100% - 0px)",this.root.style.display="flex"):(i.root.style.width="100%",r.root.style.width="100%",e?(i.root.style.height="auto",new ResizeObserver(e=>{for(var t of e){t=t.contentRect;r.root.style.height="calc(100% - "+(t.height+4)+"px )"}}).observe(i.root)):(o=n[0],s=n[1],o.constructor==Number&&(o+="px"),s.constructor==Number&&(s+="px"),i.root.style.width="100%",i.root.style.height="auto"==o?o:"calc( "+o+" - "+d+" )",r.root.style.height="auto"==s?s:"calc( "+s+" - "+d+" )")),this.root.appendChild(i.root),t&&this.root.appendChild(this.splitBar),this.root.appendChild(r.root),this.sections=[i,r],this.type=a,this._update(),t&&(l=this),this.sections;function c(e){var t;"horizontal"==l.type?l._moveSplit(-e.movementX):l._moveSplit(-e.movementY);for(t of l.root.querySelectorAll(".lexwidget")){var a=t.jsInstance;a.onresize&&a.onresize()}e.stopPropagation(),e.preventDefault()}function h(e){var t=l.root.ownerDocument;t.removeEventListener("mousemove",c),t.removeEventListener("mouseup",h),document.body.classList.remove("nocursor"),l.splitBar.classList.remove("nocursor")}}setLimitBox(e=0,t=0,a=1/0,n=1/0){this.minWidth=e,this.minHeight=t,this.maxWidth=a,this.maxHeight=n}setSize(e){let[t,a]=e;null!=t&&t.constructor==Number&&(t+="px"),null!=a&&a.constructor==Number&&(a+="px"),t&&(this.root.style.width=t),a&&(this.root.style.height=a),this.onresize&&this.onresize(this.root.getBoundingClientRect()),m(()=>{this.size=[this.root.clientWidth,this.root.clientHeight],this.propagateEvent("onresize")},150)}extend(){var e,t;this.splitExtended||([e,t]=this.sections,this.splitExtended=!0,"vertical"==this.type?(this.offset=t.root.offsetHeight,t.root.classList.add("fadeout-vertical"),this._moveSplit(-1/0,!0)):(this.offset=t.root.offsetWidth-8,t.root.classList.add("fadeout-horizontal"),this._moveSplit(-1/0,!0,8)),m(()=>this.propagateEvent("onresize"),150))}reduce(){var e,t;this.splitExtended&&(this.splitExtended=!1,[e,t]=this.sections,"vertical"==this.type?t.root.classList.add("fadein-vertical"):t.root.classList.add("fadein-horizontal"),this._moveSplit(this.offset),m(()=>this.propagateEvent("onresize"),150))}hide(){this.root.classList.add("hidden")}show(){this.root.classList.remove("hidden")}toggle(e){this.root.classList.toggle("hidden",e)}propagateEvent(e){for(var t=0;t<this.sections.length;t++){var a=this.sections[t];a[e]&&a[e].call(this,a.root.getBoundingClientRect()),a.propagateEvent(e)}}addPanel(e){e=new k(e);return this.attach(e),this.panels.push(e),e}addMenubar(e,t={}){var a=new i(t),[e,n]=(e&&e(a),y.menubars.push(a),this.split({type:"vertical",sizes:[48,null],resize:!1,menubar:!0}));return a.siblingArea=n,e.attach(a),e.isMenubar=!0,(t.sticky??!0)&&e.root.classList.add("sticky"),a}addSidebar(e,t={}){var a=new n(t),e=(e&&e(a),a.update(),y.menubars.push(a),t.width??"16rem"),[t,e]=this.split({type:"horizontal",sizes:[e,null],resize:!1,sidebar:!0});return a.siblingArea=e,t.attach(a),t.isSidebar=!0,a}addOverlayButtons(n,i={}){if(this.sections.length)this.sections[1].addOverlayButtons(n,i);else{console.assert(n.constructor==Array&&n.length),this.root.style.position="relative",i.className="lexoverlaybuttons";let s=this.addPanel(i),l=null,e=document.createElement("div"),t=(e.className="lexoverlaybuttonscontainer",e.appendChild(s.root),this.attach(e),i.float);if(t)for(var r=0;r<t.length;r++)switch(t[r]){case"h":break;case"v":e.className+=" vertical";break;case"t":break;case"m":e.className+=" middle";break;case"b":e.className+=" bottom";break;case"l":break;case"c":e.className+=" center";break;case"r":e.className+=" right"}let a=function(n,e,t){var a={width:"auto",selectable:n.selectable,selected:n.selected,icon:n.icon,img:n.img,className:n.class};e&&(l||((l=document.createElement("div")).className="lexoverlaygroup",s.queuedContainer=l),a.parent=l);let i=n.callback;n.options?s.addDropdown(null,n.options,n.name,i,a):s.addButton(null,n.name,function(e,t){var a;n.selectable&&(n.group?(a=n.selected,n.group.forEach(e=>e.selected=!1),n.selected=!a):n.selected=!n.selected),i(e,t)},a),l&&t&&(s.root.appendChild(l),l=null,s.clearQueue())};var o,d;s.clear();for(d of n)if(d.constructor===Array)for(let e=0;e<d.length;++e){var c=d[e];c.group=d,a(c,!0,e==d.length-1)}else a(d);t&&(o=0,s.root.childNodes.forEach(e=>{o+=e.offsetHeight}),e.className.includes("middle"))&&(e.style.top="-moz-calc( 50% - "+.5*o+"px )",e.style.top="-webkit-calc( 50% - "+.5*o+"px )",e.style.top="calc( 50% - "+.5*o+"px )")}}addTabs(e={}){var t=new l(this,e);return e.folding&&(this.parentArea._disableSplitResize(),this.root.style.paddingTop="4px"),t}_moveSplit(t,a=!1,n=0){if(!this.type)throw"No split area";if(void 0!==t){var i,s=this.sections[0],l=s.root,r=(l.classList.contains("origin")||(l=l.parentElement),this.sections[1]),o=r.root,d=" - "+y.DEFAULT_SPLITBAR_SIZE+"px";let e=null;a||(e=l.style.transition,l.style.transition=o.style.transition="none",C(l),C(o)),"horizontal"==this.type?(i=Math.max(o.offsetWidth+t,parseInt(r.minWidth)),l.style.width="-moz-calc( 100% - "+(i=n?n:i)+"px "+d+" )",l.style.width="-webkit-calc( 100% - "+i+"px "+d+" )",l.style.width="calc( 100% - "+i+"px "+d+" )",l.style.minWidth=parseInt(s.minWidth)+"px",o.style.width=i+"px",s.maxWidth!=1/0&&(o.style.minWidth="calc( 100% - "+parseInt(s.maxWidth)+"px )")):(i=Math.max(o.offsetHeight+t+r.offset,parseInt(r.minHeight)),l.style.height="-moz-calc( 100% - "+(i=n?n:i)+"px "+d+" )",l.style.height="-webkit-calc( 100% - "+i+"px "+d+" )",l.style.height="calc( 100% - "+i+"px "+d+" )",l.style.minHeight=s.minHeight+"px",o.style.height=i-r.offset+"px"),a||(l.style.transition=o.style.transition=e),this._update(),this.propagateEvent("onresize")}}_disableSplitResize(){this.resize=!1,this.splitBar.remove(),delete this.splitBar}_update(){var e=this.root.getBoundingClientRect();this.size=[e.width,e.height];for(var t=0;t<this.sections.length;t++)this.sections[t]._update()}}function C(e){e.offsetHeight}y.Area=_;class l{static TAB_SIZE=28;static TAB_ID=0;constructor(a,e={}){this.onclose=e.onclose;var t=document.createElement("div"),n=(t.className="lexareatabs "+(e.fit?"fit":"row"),e.folding??!1);n&&t.classList.add("folding");let i=this;t.addEventListener("dragenter",function(e){e.preventDefault(),this.classList.add("dockingtab")}),t.addEventListener("dragleave",function(e){e.preventDefault(),this.classList.remove("dockingtab")}),t.addEventListener("drop",function(e){e.preventDefault();var e=e.dataTransfer.getData("source"),t=document.getElementById(e);t&&(this.appendChild(t),e=document.getElementById(e+"_content"),i.area.attach(e),this.classList.remove("dockingtab"),y.emit("@on_tab_docked"),t.instance=i,t.click(),i.tabs[t.dataset.name]=e)}),a.root.classList.add("lexareatabscontainer"),a.split({type:"vertical",sizes:e.sizes??"auto",resize:!1,top:6}),a.sections[0].attach(t),this.area=a.sections[1],this.area.root.className+=" lexareatabscontent",this.selected=null,this.root=t,this.tabs={},this.tabDOMs={},e.fit&&((t=document.createElement("span")).className="lexareatab thumb",this.thumb=t,this.root.appendChild(t),new ResizeObserver(e=>{var t,a=this.thumb.item;a&&(t=this.thumb.style.transition,this.thumb.style.transition="none",this.thumb.style.transform="translate( "+a.childIndex*a.offsetWidth+"px )",this.thumb.style.width=a.offsetWidth-5+"px",this.thumb.style.height=a.offsetHeight-6+"px",C(this.thumb),this.thumb.style.transition=t)}).observe(this.area.root)),n&&(this.folded=!0,"up"==(this.folding=n)&&a.root.insertChildAtIndex(a.sections[1].root,0),new ResizeObserver(e=>{for(var t of e){t=t.contentRect;a.parentArea.sections[0].root.style.height="calc(100% - "+(42+t.height)+"px )"}}).observe(this.area.root),this.area.root.classList.add("folded"))}add(e,t,a={}){let n=a.selected??!1,i=(n&&(this.root.querySelectorAll("span").forEach(e=>e.classList.remove("selected")),this.area.root.querySelectorAll(".lextabcontent").forEach(e=>e.style.display="none")),n=!Object.keys(this.tabs).length&&!this.folding||n,t.root||t);i.originalDisplay=i.style.display,i.style.display=n?i.originalDisplay:"none",i.classList.add("lextabcontent"),a.icon&&(a.icon.includes("fa-")?a.icon="<i class='"+a.icon+"'></i>":a.icon="<img src='https://raw.githubusercontent.com/jxarco/lexgui.js/master/"+a.icon+"'>");let s=document.createElement("span");s.dataset.name=e,s.className="lexareatab"+(n?" selected":""),s.innerHTML=(a.icon??"")+e,s.id=e.replace(/\s/g,"")+l.TAB_ID++,s.title=a.title??"",s.selected=n??!1,s.fixed=a.fixed,s.instance=this,i.id=s.id+"_content",s.selected&&(this.selected=e),y.addSignal("@on_tab_docked",s,function(){1==this.parentElement.childNodes.length&&this.parentElement.childNodes[0].click()}),s.addEventListener("click",e=>{var t;e.preventDefault(),e.stopPropagation(),s.fixed||(t=s.selected,s.parentElement.querySelectorAll("span").forEach(e=>e.selected=!1),s.selected=!t,s.parentElement.querySelectorAll("span").forEach(e=>e.classList.remove("selected")),s.classList.toggle("selected",this.folding&&s.selected),s.instance.area.root.querySelectorAll(".lextabcontent").forEach(e=>e.style.display="none"),i.style.display=i.originalDisplay,s.instance.selected=s.dataset.name),this.folding&&(this.folded=s.selected,this.area.root.classList.toggle("folded",!this.folded)),a.onSelect&&a.onSelect(e,s.dataset.name),this.thumb&&(this.thumb.style.transform="translate( "+s.childIndex*s.offsetWidth+"px )",this.thumb.style.width=s.offsetWidth-5+"px",this.thumb.style.height=s.offsetHeight-6+"px",this.thumb.item=s)}),s.addEventListener("contextmenu",e=>{e.preventDefault(),e.stopPropagation(),a.onContextMenu&&a.onContextMenu(e,s.dataset.name)}),s.addEventListener("mouseup",e=>{e.preventDefault(),e.stopPropagation(),1==e.button&&this.delete(s.dataset.name)}),s.setAttribute("draggable",!0),s.addEventListener("dragstart",function(e){1==this.parentElement.childNodes.length?e.preventDefault():e.dataTransfer.setData("source",e.target.id)}),s.childIndex=this.root.childElementCount-1,this.root.appendChild(s),this.area.attach(i),this.tabDOMs[e]=s,this.tabs[e]=t,setTimeout(()=>{a.onCreate&&a.onCreate.call(this,this.area.root.getBoundingClientRect()),n&&this.thumb&&(this.thumb.style.transform="translate( "+s.childIndex*s.offsetWidth+"px )",this.thumb.style.width=s.offsetWidth-5+"px",this.thumb.style.height=s.offsetHeight-6+"px",this.thumb.item=s)},10)}select(e){this.tabDOMs[e]&&this.tabDOMs[e].click()}delete(e){var t=this.tabDOMs[e];t&&!t.fixed&&(this.onclose&&this.onclose(e),this.tabDOMs[e].remove(),delete this.tabDOMs[e],this.tabs[e].remove(),delete this.tabs[e],t=this.root.lastChild)&&!t.fixed&&this.root.lastChild.click()}}y.Tabs=l;class i{constructor(e={}){this.root=document.createElement("div"),this.root.className="lexmenubar",e.float&&(this.root.style.justifyContent=e.float),this.items=[],this.buttons=[],this.icons={},this.shorts={}}_resetMenubar(){this.root.querySelectorAll(".lexmenuentry").forEach(e=>{e.classList.remove("selected"),e.built=!1}),y.root.querySelectorAll(".lexmenubox").forEach(e=>e.remove()),this.focused=!1}_createSubmenu(e,t,a,l){let r=document.createElement("div"),n=(r.className="lexmenubox",r.tabIndex="0",((a.currentMenu=r).parentEntry=a).classList.contains("lexmenuboxentry"));n&&(r.dataset.submenu=!0),r._updatePosition=()=>{let t=r.style.transition;r.style.transition="none",C(r),m(()=>{var e=a.getBoundingClientRect();e.x+=document.scrollingElement.scrollLeft,e.y+=document.scrollingElement.scrollTop,r.style.left=(n?e.x+e.width:e.x)+"px",r.style.top=(n?e.y:e.y+e.height-4)+"px",r.style.transition=t})},r._updatePosition(),m(()=>{r.dataset.open=!0},10),y.root.appendChild(r);for(var o=0;o<e[t].length;++o){let a=e[t][o],n=Object.keys(a)[0];var d,c,h=a[n].length,u="checkbox"==a.type;let i=document.createElement("div"),s=(i.className="lexmenuboxentry",i.className+=(o==e[t].length-1?" last":"")+(a.disabled?" disabled":""),""==n?i.className=" lexseparator":(i.id=n,(d=document.createElement("div")).innerHTML="",d.classList="lexmenuboxentrycontainer",i.appendChild(d),c=this.icons[n],u?d.innerHTML+="<input type='checkbox' >":c?d.innerHTML+="<a class='"+c+" fa-sm'></a>":(d.innerHTML+="<a class='fa-solid fa-sm noicon'></a>",d.classList.add("noicon")),d.innerHTML+="<div class='lexentryname'>"+n+"</div>"),i.querySelector("input"));s&&(s.checked=a.checked??!1,s.addEventListener("change",e=>{a.checked=s.checked;var t=a.callback;t&&(t.call(this,a.checked,n,i),this._resetMenubar()),e.stopPropagation(),e.stopImmediatePropagation()})),r.appendChild(i),""!=n&&(r.addEventListener("keydown",e=>{e.preventDefault();let t=this.shorts[n];t&&(t=1==t.length?t.toLowerCase():t)==e.key&&i.click()}),i.addEventListener("click",e=>{s&&(a.checked=!a.checked);var t=a.callback;t&&(t.call(this,s?a.checked:n,s?n:i),this._resetMenubar()),e.stopPropagation(),e.stopImmediatePropagation()}),h?((u=document.createElement("a")).className="fa-solid fa-angle-right fa-xs",i.appendChild(u),i.addEventListener("mouseover",e=>{i.built||(i.built=!0,this._createSubmenu(a,n,i,++l),e.stopPropagation())}),i.addEventListener("mouseleave",e=>{i.currentMenu&&i.currentMenu!=e.toElement&&(l=-1,delete i.built,i.currentMenu.remove(),delete i.currentMenu)})):this.shorts[n]&&((c=document.createElement("div")).className="lexentryshort",c.innerText=this.shorts[n],i.appendChild(c)))}r.style.width=r.offsetWidth+"px"}add(e,s={}){s.constructor==Function&&(s={callback:s});let l=e.split("/");e=l[l.length-1];this.icons[e]=s.icon,this.shorts[e]=s.short;let r=0,o=(n,e)=>{if(null!=n){let a=null;var t,i;e.forEach(e=>{var t=Object.keys(e).find(e=>e==n);t&&(a=e[t])}),a?o(l[r++],a):((t={})[n]=[],(i=l[r++])||(t.callback=s.callback,t.disabled=s.disabled,t.type=s.type,t.checked=s.checked),e.push(t),o(i,t[n]))}};o(l[r++],this.items);for(let i of this.items){let n=Object.keys(i)[0];var d=n.replace(/\s/g,"").replaceAll(".","");if(!this.root.querySelector("#"+d)){let t=document.createElement("div"),a=(t.className="lexmenuentry",t.id=d,t.innerHTML="<span>"+n+"</span>",t.tabIndex="1","left"==s.position?this.root.prepend(t):("right"==s.position&&(t.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(t):this.root.appendChild(t)),()=>{this._resetMenubar(),t.classList.add("selected"),t.built=!0,this._createSubmenu(i,n,t,-1)});t.addEventListener("click",()=>{var e=i.callback;e?e.call(this,n,t):(a(),this.focused=!0)}),t.addEventListener("mouseover",e=>{this.focused&&!t.built&&a()}),t.addEventListener("blur",e=>{e.relatedTarget&&e.relatedTarget.classList.contains("lexmenubox")||this._resetMenubar()})}}}getButton(e){return this.buttons[e]}getSubitem(t,a){var n=a[0];for(let e=0;e<t.length;e++)if(t[e][n])return 1==a.length?t[e]:(a.splice(0,1),this.getSubitem(t[e][n],a))}getItem(e){e=e.split("/");return this.getSubitem(this.items,e)}setButtonIcon(e,n,i,s={}){if(!e)throw"Set Button Name!";let l=this.buttons[e];if(l)l.querySelector("a").className="fa-solid "+n+" lexicon";else{l=document.createElement("div");let t=s.disabled??!1,a=(l.className="lexmenubutton main"+(t?" disabled":""),l.title=e,l.innerHTML="<a class='"+n+" lexicon'></a>","right"==s.float&&(l.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(l):"left"==s.float?this.root.prepend(l):this.root.appendChild(l),l.querySelector("a"));a.addEventListener("click",e=>{i&&!t&&i.call(this,a,e)}),this.buttons[e]=l}}setButtonImage(e,n,i,s={}){if(!e)throw"Set Button Name!";let l=this.buttons[e];if(l)l.querySelector("img").src=n;else{l=document.createElement("div");let t=s.disabled??!1,a=(l.className="lexmenubutton"+(t?" disabled":""),l.title=e,l.innerHTML="<a><image src='"+n+"' class='lexicon' style='height:32px;'></a>","right"==s.float&&(l.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(l):"left"==s.float?this.root.prepend(l):this.root.appendChild(l),l.querySelector("a"));a.addEventListener("click",e=>{i&&!t&&i.call(this,a,e)}),this.buttons[e]=l}}addButtons(s,e={}){if(!s)throw"No buttons to add!";this.buttonContainer||(this.buttonContainer=document.createElement("div"),this.buttonContainer.className="lexmenubuttons",this.buttonContainer.classList.add(e.float??"center"),"right"==e.position&&(this.buttonContainer.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(this.buttonContainer):this.root.appendChild(this.buttonContainer));for(let t=0;t<s.length;++t){let a=s[t],n=document.createElement("label");var l=a.title;let i=a.disabled??!1;n.className="lexmenubutton"+(i?" disabled":""),n.title=l??"",this.buttonContainer.appendChild(n);var r=document.createElement("a");r.className=a.icon+" lexicon",n.appendChild(r);let e=r;a.swap&&(n.classList.add("swap"),r.classList.add("swap-off"),(r=document.createElement("input")).type="checkbox",n.prepend(r),e=r,(r=document.createElement("a")).className=a.swap+" swap-on lexicon",n.appendChild(r),n.swap=function(){var e=this.querySelector("input");e.checked=!e.checked},n.setState=function(e){this.querySelector("input").checked=e}),e.addEventListener("click",e=>{var t;a.callback&&!i&&(t=n.querySelector("input"),a.callback.call(this,e,t?.checked))}),l&&(this.buttons[l]=n)}}}y.Menubar=i;class n{constructor(e={}){var t;this.root=document.createElement("div"),this.root.className="lexsidebar",this.collapsable=e.collapsable??!0,this._collapseWidth=e.collapseToIcons??!0?"58px":"0px",this.collapsed=!1,this.filterString="",m(()=>{this.root.parentElement.ogWidth=this.root.parentElement.style.width,this.root.parentElement.style.transition="width 0.25s ease-out",this.resizeObserver=new ResizeObserver(e=>{for(var t of e)this.siblingArea.setSize(["calc(100% - "+t.contentRect.width+"px )",null])})},10),e.skipHeader||(this.header=e.header??this._generateDefaultHeader(e),console.assert(this.header.constructor===HTMLDivElement,"Use an HTMLDivElement to build your custom header"),this.header.className="lexsidebarheader",this.root.appendChild(this.header),this.collapsable&&(t=y.makeIcon("Sidebar","Toggle Sidebar","toggler"),this.header.appendChild(t),t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.toggleCollapsed()}))),e.filter&&((t=new k).addText(null,"",(e,t)=>{this.filterString=e,this.update()},{placeholder:"Search...",icon:"fa-solid fa-magnifying-glass"}),this.filter=t.root.childNodes[0],this.root.appendChild(this.filter)),this.content=document.createElement("div"),this.content.className="lexsidebarcontent",this.root.appendChild(this.content),e.skipFooter||(this.footer=e.footer??this._generateDefaultFooter(e),console.assert(this.footer.constructor===HTMLDivElement,"Use an HTMLDivElement to build your custom footer"),this.footer.className="lexsidebarfooter",this.root.appendChild(this.footer)),m(()=>{var e=32+(this.header?.offsetHeight??0)+(this.filter?.offsetHeight??0)+(this.footer?.offsetHeight??0);this.content.style.height=`calc(100% - ${e}px)`},10),this.items=[],this.icons={},this.groups={}}_generateDefaultHeader(t){var e=document.createElement("div"),a=(e.addEventListener("click",e=>{this.collapsed?(e.preventDefault(),e.stopPropagation(),this.toggleCollapsed()):t.onHeaderPressed&&t.onHeaderPressed(e)}),document.createElement("span")),a=(a.className="lexavatar",e.appendChild(a),t.headerImage?((n=document.createElement("img")).src=t.headerImage,a.appendChild(n)):t.headerIcon&&(n=y.makeIcon(t.headerIcon),a.appendChild(n)),document.createElement("div")),n=(a.className="infodefault",e.appendChild(a),document.createElement("span")),n=(n.innerHTML=t.headerTitle??"",a.appendChild(n),document.createElement("span"));return n.innerHTML=t.headerSubtitle??"",a.appendChild(n),e}_generateDefaultFooter(t){var e=document.createElement("div"),a=(e.addEventListener("click",e=>{t.onFooterPressed&&t.onFooterPressed(e)}),document.createElement("span")),a=(a.className="lexavatar",e.appendChild(a),t.footerImage?((n=document.createElement("img")).src=t.footerImage,a.appendChild(n)):t.footerIcon&&(n=y.makeIcon(t.footerIcon),a.appendChild(n)),document.createElement("div")),n=(a.className="infodefault",e.appendChild(a),document.createElement("span")),n=(n.innerHTML=t.footerTitle??"",a.appendChild(n),document.createElement("span")),a=(n.innerHTML=t.footerSubtitle??"",a.appendChild(n),y.makeIcon("MenuArrows"));return e.appendChild(a),e}toggleCollapsed(e){if(this.collapsable){if(this.collapsed=e??!this.collapsed,this.collapsed?(this.root.classList.add("collapsing"),this.root.parentElement.style.width=this._collapseWidth):(this.root.classList.remove("collapsing"),this.root.classList.remove("collapsed"),this.root.parentElement.style.width=this.root.parentElement.ogWidth),!this.resizeObserver)throw"Wait until ResizeObserver has been created!";this.resizeObserver.observe(this.root.parentElement),m(()=>{this.root.classList.toggle("collapsed",this.collapsed),this.resizeObserver.unobserve(this.root.parentElement)},250)}}separator(){this.currentGroup=null,this.add("")}group(e,t){this.currentGroup=e,this.groups[e]=t}add(e,s={}){s.constructor==Function&&(s={callback:s});let l=e.split("/");e=l[l.length-1];this.icons[e]=s.icon;let r=0,o=(n,e)=>{if(null!=n){let a=null;var t,i;e.forEach(e=>{var t=Object.keys(e).find(e=>e==n);t&&(a=e[t])}),a?o(l[r++],a):((t={})[n]=[],(i=l[r++])||(t.callback=s.callback,t.group=this.currentGroup,t.options=s),e.push(t),o(i,t[n]))}};o(l[r++],this.items)}select(e){let t=e.replace(/\s/g,"").replaceAll(".","");e=this.items.find(e=>e.name===t);e&&e.dom.click()}update(){this.content.innerHTML="";for(var e of this.items)delete e.dom;for(let r of this.items){let n=r.options??{};if(!r.dom){let l=Object.keys(r)[0];if(!this.filterString.length||l.toLowerCase().includes(this.filterString.toLowerCase())){var i=l.replace(/\s/g,"").replaceAll(".","");let t=null,s=document.createElement("div");if(s.className="lexsidebarentry "+(n.className??""),s.id=r.name=i,r.group){var a=r.group.replace(/\s/g,"").replaceAll(".","");if(t=this.content.querySelector("#"+a)){if(!t.classList.contains("lexsidebargroup"))throw"Bad id: "+r.group}else{(t=document.createElement("div")).id=a,t.className="lexsidebargroup",this.content.appendChild(t);var a=document.createElement("div"),o=(a.className="lexsidebargrouptitle",t.appendChild(a),document.createElement("div"));o.innerHTML=r.group,a.appendChild(o),null!=this.groups[r.group]&&((o=document.createElement("a")).className=(this.groups[r.group].icon??"")+" lexicon",a.appendChild(o),o.addEventListener("click",e=>{this.groups[r.group].callback&&this.groups[r.group].callback(r.group,e)}))}}if(""==i){a=document.createElement("div");a.className="lexsidebarseparator",this.content.appendChild(a)}else{this.collapseContainer?(this.collapseContainer.appendChild(s),this.collapseQueue--,this.collapseQueue||delete this.collapseContainer):(t||this.content).appendChild(s);let a=document.createElement("div");s.appendChild(a),r.dom=s,"checkbox"==n.type?(r.value=n.value??!1,o=new k,r.checkbox=o.addCheckbox(null,r.value,(e,t)=>{t.preventDefault(),t.stopPropagation();var a=n.callback;r.value=e,a&&a.call(this,l,e,t)},{label:l,signal:"@checkbox_"+l}),a.appendChild(o.root.childNodes[0])):(n.icon&&((i=document.createElement("i")).className=n.icon,a.appendChild(i)),(i=document.createElement("a")).innerHTML=l,a.appendChild(i)),s.addEventListener("click",e=>{var t;e.target&&e.target.classList.contains("lexcheckbox")||(n.collapsable?a.querySelector(".collapser").click():((t=n.callback)&&t.call(this,l,r.value,e),r.checkbox&&(r.value=!r.value,r.checkbox.set(r.value,!0))),this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected")),s.classList.add("selected"))});var d,i=null!=n.collapsable?n.collapsable:n.collapsable||r[l].length;n.action?(d=y.makeIcon(n.action.icon??"MoreHorizontal",n.action.name),a.appendChild(d),d.addEventListener("click",e=>{e.preventDefault(),e.stopImmediatePropagation();var t=n.action.callback;t&&t.call(this,l,e)})):i&&(d=document.createElement("div"),Object.assign(d.style,{width:"100%",display:"none"}),y.makeCollapsible(a,d,t??this.content),this.collapseQueue=n.collapsable,this.collapseContainer=d);let e=document.createElement("span");if(e.className="lexsidebarentrydesc",e.innerHTML=l,s.appendChild(e),a.addEventListener("mouseenter",()=>{setTimeout(()=>{e.style.display="unset"},150)}),a.addEventListener("mouseleave",()=>{setTimeout(()=>{e.style.display="none"},150)}),r[l].length){var c=document.createElement("div");c.className="lexsidebarsubentrycontainer",i?(this.collapseContainer.appendChild(c),delete this.collapseContainer):(t||this.content).appendChild(c);for(let e=0;e<r[l].length;++e){var h=r[l][e];let n=h.options??{},i=Object.keys(h)[0];if(!this.filterString.length||i.toLowerCase().includes(this.filterString.toLowerCase())){let a=document.createElement("div");a.innerHTML=`<span>${i}</span>`,n.action&&(h=y.makeIcon(n.action.icon??"MoreHorizontal",n.action.name),a.appendChild(h),h.addEventListener("click",e=>{e.preventDefault(),e.stopImmediatePropagation();var t=n.action.callback;t&&t.call(this,i,e)})),a.className="lexsidebarentry",a.id=i,c.appendChild(a),a.addEventListener("click",e=>{var t=n.callback;t&&t.call(this,i,a,e),this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected")),s.classList.add("selected")})}}}}}}}}}y.SideBar=n;class T{static NONE=0;static TEXT=1;static TEXTAREA=2;static BUTTON=3;static DROPDOWN=4;static CHECKBOX=5;static TOGGLE=6;static RADIO=7;static BUTTONS=8;static COLOR=9;static RANGE=10;static NUMBER=11;static TITLE=12;static VECTOR=13;static TREE=14;static PROGRESS=15;static FILE=16;static LAYERS=17;static ARRAY=18;static LIST=19;static TAGS=20;static CURVE=21;static CARD=22;static IMAGE=23;static CONTENT=24;static CUSTOM=25;static SEPARATOR=26;static KNOB=27;static SIZE=28;static PAD=29;static FORM=30;static DIAL=31;static COUNTER=32;static TABLE=33;static TABS=34;static BLANK=35;static NO_CONTEXT_TYPES=[T.BUTTON,T.LIST,T.FILE,T.PROGRESS];constructor(e,t,a,n){this.name=e,this.type=t,this.options=n,this._initialValue=a}value(){if(this.onGetValue)return this.onGetValue();console.warn("Can't get value of "+this.typeName())}set(e,t,a){var n;if(this.onSetValue)return(n=this.domEl.querySelector(".lexwidgetname .lexicon"))&&(n.style.display=e!=this.value()?"block":"none",n.style.display=e!=this._initialValue?"block":"none"),this.onSetValue(e,t??!1,a);console.warn("Can't set value of "+this.typeName())}oncontextmenu(e){T.NO_CONTEXT_TYPES.includes(this.type)||S(this.typeName(),e,e=>{e.add("Copy",()=>{this.copy()}),e.add("Paste",{disabled:!this._can_paste(),callback:()=>{this.paste()}})})}copy(){navigator.clipboard.type=this.type,navigator.clipboard.customIdx=this.customIdx,navigator.clipboard.data=this.value(),navigator.clipboard.writeText(navigator.clipboard.data)}_can_paste(){return this.type===T.CUSTOM?void 0!==navigator.clipboard.customIdx&&this.customIdx==navigator.clipboard.customIdx:navigator.clipboard.type===this.type}paste(){this._can_paste()&&this.set(navigator.clipboard.data)}typeName(){switch(this.type){case T.TEXT:return"Text";case T.TEXTAREA:return"TextArea";case T.BUTTON:return"Button";case T.DROPDOWN:return"Dropdown";case T.CHECKBOX:return"Checkbox";case T.TOGGLE:return"Toggle";case T.RADIO:return"Radio";case T.COLOR:return"Color";case T.RANGE:return"Range";case T.NUMBER:return"Number";case T.VECTOR:return"Vector";case T.TREE:return"Tree";case T.PROGRESS:return"Progress";case T.FILE:return"File";case T.LAYERS:return"Layers";case T.ARRAY:return"Array";case T.LIST:return"List";case T.TAGS:return"Tags";case T.CURVE:return"Curve";case T.KNOB:return"Knob";case T.SIZE:return"Size";case T.PAD:return"Pad";case T.FORM:return"Form";case T.DIAL:return"Dial";case T.COUNTER:return"Counter";case T.TABLE:return"Table";case T.TABS:return"Tabs";case T.BLANK:return"Blank";case T.CUSTOM:return this.customName}console.error("Unknown Widget type: "+this.type)}refresh(){}}y.Widget=T,y.ADD_CUSTOM_WIDGET=function(p,m={}){let e=b();k.prototype["add"+p]=function(i,s,l){let r=this._createWidget(T.CUSTOM,i,null,m),o=(r.customName=p,r.customIdx=e,r.onGetValue=()=>s,r.onSetValue=(e,t,a)=>{s=e,u(),o.querySelector(".lexcustomitems").toggleAttribute("hidden",!1),t||this._trigger(new w(i,s,a),l)},r.domEl);o.style.flexWrap="wrap";let d,c,h=m.default??{},u=()=>{s&&(r.instance=s=Object.assign(g(h),s)),d&&d.remove(),c&&c.remove(),(d=document.createElement("div")).className="lexcustomcontainer",d.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")",this.queue(d);var e="<a class='fa-solid "+(m.icon??"fa-cube")+"' style='float:left'></a>",e=(e=e+(p+(s?"":" [empty]"))+("<a class='fa-solid "+(s?"fa-bars-staggered":" ")+" menu' style='float:right; width:5%;'></a>"),this.addButton(null,e,(e,t)=>{s?o.querySelector(".lexcustomitems").toggleAttribute("hidden"):S(null,t,e=>{e.add("New "+p,()=>{s={},u(),o.querySelector(".lexcustomitems").toggleAttribute("hidden",!1)})})},{buttonClass:"custom"}));if(this.clearQueue(),s&&e.querySelector("a.menu").addEventListener("click",e=>{e.stopImmediatePropagation(),e.stopPropagation(),S(null,e,e=>{e.add("Clear",()=>{s=null,u()})})}),(c=document.createElement("div")).className="lexcustomitems",c.toggleAttribute("hidden",!0),o.appendChild(d),o.appendChild(c),s){this.queue(c);var t,a=(e,t,a)=>{s[e]=t,this._trigger(new w(i,s,a),l)};for(t in h){var n=s[t]??h[t];switch(n.constructor){case String:"#"===n[0]?this.addColor(t,n,a.bind(this,t)):this.addText(t,n,a.bind(this,t));break;case Number:this.addNumber(t,n,a.bind(this,t));break;case Boolean:this.addCheckbox(t,n,a.bind(this,t));break;case Array:4<n.length?this.addArray(t,n,a.bind(this,t)):this._add_vector(n.length,t,n,a.bind(this,t))}}this.clearQueue()}};u()}};class N{constructor(e,t,a){if(this.domEl=e,this.data=t,this.onevent=a.onevent,this.options=a,this.selected=[],t.constructor===Object)this._create_item(null,t);else for(var n of t)this._create_item(null,n)}_create_item(e,s,t=0,a){let l=this;var n=this.domEl.querySelector("#lexnodetree_filter");if(s.children=s.children??[],n&&!s.id.includes(n.value)||null!=a&&a!=s.id){for(var i=0;i<s.children.length;++i)this._create_item(s,s.children[i],t+1,a);return}let r=this.domEl.querySelector("ul"),o=(s.visible=s.visible??!0,s.parent=e,0<s.children.length);n=-1<this.selected.indexOf(s)||s.selected;if(this.options.onlyFolders){let t=!1;s.children.forEach(e=>t|="folder"==e.type),o=!!t}let d=document.createElement("li"),c=(d.className="lextreeitem datalevel"+t+(o?" parent":"")+(n?" selected":""),d.id=y.getSupportedDOMName(s.id),d.tabIndex="0",this.options.skip_default_icon??!0?"":"fa-solid fa-square");o&&(c=s.closed?"fa-solid fa-caret-right":"fa-solid fa-caret-down"),d.innerHTML="<a class='"+c+" hierarchy'></a>",c=s.icon,s.icon&&(s.icon.includes("fa-")?d.innerHTML+="<a class='"+s.icon+" tree-item-icon'></a>":d.innerHTML+="<img src='https://raw.githubusercontent.com/jxarco/lexgui.js/master/"+s.icon+"'>"),d.innerHTML+=s.rename?"":s.id,d.setAttribute("draggable",!0),d.style.paddingLeft=(o?0:3)+(3+15*(t+1))+"px",r.appendChild(d),d.addEventListener("click",e=>{var t;h?h=!1:(e.shiftKey||(r.querySelectorAll("li").forEach(e=>{e.classList.remove("selected")}),this.selected.length=0),-1<(t=this.selected.indexOf(s))?(d.classList.remove("selected"),this.selected.splice(t,1)):(d.classList.add("selected"),this.selected.push(s)),o&&1<s.id.length&&(s.closed=!1,l.onevent&&(t=new L(L.NODE_CARETCHANGED,s,s.closed),l.onevent(t)),l.frefresh(s.id)),l.onevent&&((t=new L(L.NODE_SELECTED,e.shiftKey?this.selected:s)).multiple=e.shiftKey,l.onevent(t)))}),d.addEventListener("dblclick",function(){var e;(l.options.rename??!0)&&(s.rename=!0,l.refresh()),l.onevent&&(e=new L(L.NODE_DBLCLICKED,s),l.onevent(e))}),d.addEventListener("contextmenu",a=>{if(a.preventDefault(),l.onevent){let t=new L(L.NODE_CONTEXTMENU,1<this.selected.length?this.selected:s,a);t.multiple=1<this.selected.length,y.addContextMenu(t.multiple?"Selected Nodes":t.node.id,t.value,e=>{t.panel=e}),l.onevent(t),1==(this.options.addDefault??!1)&&(t.panel.items&&t.panel.add(""),t.panel.add("Select Children",()=>{let a=e=>{if(!e.closed)for(var t of e.children??[])t&&(this.domEl.querySelector("#"+t.id).classList.add("selected"),this.selected.push(t),a(t))};a(s)}),t.panel.add("Delete",{callback:()=>{var e,t;s.parent&&(l.onevent&&(e=new L(L.NODE_DELETED,s,a),l.onevent(e)),t=(e=s.parent.children).indexOf(s),e.splice(t,1),this.refresh())}}))}}),d.addEventListener("keydown",e=>{if(!s.rename)if(e.preventDefault(),"Delete"==e.key){var t;l.onevent&&((i=new L(L.NODE_DELETED,1<this.selected.length?this.selected:s,e)).multiple=1<this.selected.length,l.onevent(i));for(t of this.selected){var a=t.parent.children,n=a.indexOf(t);a.splice(n,1)}this.selected.length=0,this.refresh()}else{var i;("ArrowUp"==e.key||"ArrowDown"==e.key)&&(i=1<this.selected.length?"ArrowUp"==e.key?this.selected.shift():this.selected.pop():this.selected[0],i=this.domEl.querySelector("#"+y.getSupportedDOMName(i.id)),e="ArrowUp"==e.key?i.previousSibling:i.nextSibling)&&e.click()}});n=document.createElement("input");n.toggleAttribute("hidden",!s.rename),n.value=s.id,d.appendChild(n),s.rename&&(d.classList.add("selected"),n.focus()),n.addEventListener("keyup",function(e){var t;"Enter"==e.key?(this.value=this.value.replace(/\s/g,"_"),l.onevent&&(t=new L(L.NODE_RENAMED,s,this.value),l.onevent(t)),s.id=y.getSupportedDOMName(this.value),delete s.rename,l.frefresh(s.id),r.querySelector("#"+s.id).classList.add("selected")):"Escape"==e.key&&(delete s.rename,l.frefresh(s.id))}),n.addEventListener("blur",function(e){delete s.rename,l.refresh()}),(this.options.draggable??!0)&&(e&&d.addEventListener("dragstart",e=>{window.__tree_node_dragged=s}),d.addEventListener("dragover",e=>{e.preventDefault()},!1),d.addEventListener("dragenter",e=>{e.target.classList.add("draggingover")}),d.addEventListener("dragleave",e=>{e.target.classList.remove("draggingover")}),d.addEventListener("drop",e=>{e.preventDefault();let t=window.__tree_node_dragged;if(t){var a,e=s;if(t.id==e.id)console.warn("Cannot parent node to itself!");else{let i=function(e,t){var a,n=!1;for(a of t.children){if(a.id==e.id)return!0;n|=i(e,a)}return n};i(e,t)?console.warn("Cannot parent node to a current child!"):(l.onevent&&(a=new L(L.NODE_DRAGGED,t,e),l.onevent(a)),a=t.parent.children.findIndex(e=>e.id==t.id),a=t.parent.children.splice(a,1),e.children.push(a[0]),l.refresh(),delete window.__tree_node_dragged)}}}));let h=!1;o&&d.querySelector("a.hierarchy").addEventListener("click",function(e){h=!0,e.stopImmediatePropagation(),e.stopPropagation(),s.closed=!s.closed,l.onevent&&(e=new L(L.NODE_CARETCHANGED,s,s.closed),l.onevent(e)),l.frefresh(s.id)});var u=document.createElement("div");if(d.appendChild(u),s.actions)for(let e=0;e<s.actions.length;++e){let t=s.actions[e],a=document.createElement("a");a.className="lexicon "+t.icon,a.title=t.name,a.addEventListener("click",function(e){t.callback(s,a),e.stopPropagation()}),u.appendChild(a)}if(s.skipVisibility||((n=document.createElement("a")).className="lexicon fa-solid fa-eye"+(s.visible?"":"-slash"),n.title="Toggle visible",n.addEventListener("click",function(e){e.stopPropagation(),s.visible=void 0!==s.visible&&!s.visible,this.className="lexicon fa-solid fa-eye"+(s.visible?"":"-slash"),l.onevent&&(e=new L(L.NODE_VISIBILITY,s,s.visible),l.onevent(e))}),u.appendChild(n)),null!=a&&s.id==a&&(this.selected=[s],d.click()),!s.closed)for(i=0;i<s.children.length;++i){var p=s.children[i];this.options.onlyFolders&&"folder"!=p.type||this._create_item(s,p,t+1)}}refresh(e,t){this.data=e??this.data,this.domEl.querySelector("ul").innerHTML="",this._create_item(null,this.data,0,t)}frefresh(e){this.refresh();e=this.domEl.querySelector("#"+e);e&&e.focus()}select(e){this.refresh(null,e)}}class k{constructor(e={}){var t=document.createElement("div");t.className="lexpanel",e.id&&(t.id=e.id),e.className&&(t.className+=" "+e.className),t.style.width=e.width||"calc( 100% - 6px )",t.style.height=e.height||"100%",Object.assign(t.style,e.style??{}),this._inline_widgets_left=-1,this._inline_queued_container=null,this.root=t,this.onevent=e=>{},this._branchOpen=!1,this.branches=[],this._currentBranch=null,this.widgets={},this._queue=[]}get(e){return this.widgets[e]}getValue(e){var t=this.widgets[e];if(t)return t.value();throw"No widget called "+e}setValue(e,t,a){var n=this.widgets[e];if(n)return n.set(t,a);throw"No widget called "+e}attach(e){console.assert(e,"No content to attach!"),(e.parent=this).root.appendChild(e.root||e)}clear(){for(var t in this._branchOpen=!1,this.branches=[],this._currentBranch=null,this.widgets)if(this.widgets[t].options&&this.widgets[t].options.signal){var a=this.widgets[t].options.signal;for(let e=0;e<y.signals[a].length;e++)y.signals[a][e]==this.widgets[t]&&(y.signals[a]=[...y.signals[a].slice(0,e),...y.signals[a].slice(e+1)])}if(this.signals)for(let e=0;e<this.signals.length;e++){var n=Object.values(this.signals[e])[0],i=n.options.signal;for(let e=0;e<y.signals[i].length;e++)y.signals[i][e]==n&&(y.signals[i]=[...y.signals[i].slice(0,e),...y.signals[i].slice(e+1)])}this.widgets={},this.root.innerHTML=""}sameLine(e){this._inline_queued_container=this.queuedContainer,this._inline_widgets_left=e||1/0}endLine(e){if(-1==this._inline_widgets_left)console.warn("No pending widgets to be inlined!");else{this._inline_widgets_left=-1,this._inlineContainer||(this._inlineContainer=document.createElement("div"),this._inlineContainer.className="lexinlinewidgets",e&&(this._inlineContainer.style.justifyContent=e));for(var t of this._inlineWidgets)t.constructor==Array?(this._inline_queued_container?this._inlineContainer:t[1]).appendChild(t[0]):this._inlineContainer.appendChild(t);(this._inline_queued_container||(this._currentBranch?this._currentBranch.content:this.root)).appendChild(this._inlineContainer),delete this._inlineWidgets,delete this._inlineContainer}}branch(e,t={}){this._branchOpen&&this.merge();e=new a(e,t);return(e.panel=this)._branchOpen=!0,this._currentBranch=e,0==this.branches.length&&e.root.classList.add("first"),this.root.querySelectorAll(".lexbranch.last").forEach(e=>{e.classList.remove("last")}),e.root.classList.add("last"),this.branches.push(e),this.root.appendChild(e.root),t.filter&&this._addFilter(t.filter,{callback:this._searchWidgets.bind(this,e.name)}),e}merge(){this._branchOpen=!1,this._currentBranch=null}_pick(e,t){return void 0===e?t:e}static _dispatch_event(e,t,a,n,i){t=new CustomEvent(t,{detail:a,bubbles:n,cancelable:i});e.dispatchEvent(t)}static _add_reset_property(e,t){var a=document.createElement("a");return a.style.display="none",a.style.marginRight="6px",a.className="lexicon fa fa-rotate-left",a.addEventListener("click",t),e.appendChild(a),a}_createWidget(e,t,a,n={}){y.CREATED_INSTANCES||(y.CREATED_INSTANCES=[]),y.CREATED_INSTANCES[e]=!0;let i=new T(t,e,a,n);var s=document.createElement("div"),a=(s.className="lexwidget",s.id=n.id??"",s.title=n.title??"",n.className&&(s.className+=" "+n.className),e!=T.TITLE&&(s.style.width="calc(100% - "+(this._currentBranch||e==T.FILE||e==T.TREE?10:20)+"px)",n.width&&(s.style.width=s.style.minWidth=n.width),n.maxWidth&&(s.style.maxWidth=n.maxWidth),n.minWidth&&(s.style.minWidth=n.minWidth),n.height)&&(s.style.height=s.style.minHeight=n.height),null!=t?(n.hideName||((e=document.createElement("div")).className="lexwidgetname",n.justifyName&&e.classList.add("float-"+n.justifyName),e.innerHTML=t,e.title=n.title??e.innerHTML,e.style.width=n.nameWidth||y.DEFAULT_NAME_WIDTH,s.appendChild(e),(s.domName=e).addEventListener("contextmenu",function(e){e.preventDefault(),i.oncontextmenu(e)}),n.skipReset)||null==a||k._add_reset_property(e,function(e){i.set(i._initialValue,!1,e),this.style.display="none"}),this.widgets[t]=i):n.hideName=!0,n.signal&&(t||(this.signals||(this.signals=[]),this.signals.push({[n.signal]:i})),y.addSignal(n.signal,i)),(i.domEl=s).jsInstance=i,e=>{(n.container||this.queuedContainer||(this._currentBranch?(n.skipWidget||this._currentBranch.widgets.push(i),this._currentBranch.content):(e.classList.add("nobranch"),this.root))).appendChild(e)}),e=e=>{this.queuedContainer?this._inlineWidgets.push([e,this.queuedContainer]):this._inlineWidgets.push(e)};return 0<this._inline_widgets_left&&!n.skipInlineCount?(this._inlineWidgets||(this._inlineWidgets=[]),e(s),this._inline_widgets_left--,this._inline_widgets_left||this.endLine()):a(s),i}_addFilter(e,t={}){t.placeholder=e.constructor==String?e:"Filter properties..",t.skipWidget=t.skipWidget??!0,t.skipInlineCount=!0;e=this._createWidget(T.TEXT,null,null,t).domEl;e.className+=" lexfilter noname";let a=document.createElement("input");a.className="lexinput-filter",a.setAttribute("placeholder",t.placeholder),a.style.width="calc( 100% - 17px )",a.value=t.filterValue||"";var n=document.createElement("a");return n.className="fa-solid fa-magnifying-glass",e.appendChild(n),e.appendChild(a),a.addEventListener("input",e=>{t.callback&&t.callback(a.value,e)}),e}_searchWidgets(e,t){for(var a of this.branches)if(a.name===e){for(var n of a.widgets)n.domEl.classList.contains("lexfilter")||n.domEl.remove();this.queue(a.content);var i,s=!t.length;for(i of a.widgets){if(!s){if(!i.name)continue;t.toLowerCase();if(!i.name.toLowerCase().includes(t))continue}this.queuedContainer.appendChild(i.domEl)}return void this.clearQueue()}}_filterOptions(t,a){var n=!a.length,i=[];for(let e=0;e<t.length;e++){var s=t[e];if(!n){var l="string"==typeof s?s:s.value,r=a.toLowerCase();if(!l.toLowerCase().includes(r))continue}i.push(s)}this.refresh(i)}_trigger(e,t){t&&t.call(this,e.value,e.domEvent,e.name),this.onevent&&this.onevent.call(this,e)}getBranch(t){return t?this.branches.find(e=>e.name==t):this._currentBranch}queue(e){!e&&this._currentBranch&&(e=this._currentBranch.root),this.queuedContainer&&this._queue.push(this.queuedContainer),this.queuedContainer=e}clearQueue(){this._queue&&this._queue.length?this.queuedContainer=this._queue.pop():delete this.queuedContainer}addBlank(e=8,t){var a=this._createWidget(T.BLANK);return a.domEl.className+=" blank",a.domEl.style.height=e+"px",t&&(a.domEl.style.width=t),a}addTitle(e,t={}){console.assert(e,"Can't create Title Widget without text!");var a=this._createWidget(T.TITLE,null,null,t).domEl,n=(a.className="lextitle",t.icon&&((n=document.createElement("a")).className=t.icon,n.style.color=t.iconColor||"",a.appendChild(n)),document.createElement("span"));return n.innerText=e,a.appendChild(n),Object.assign(a.style,t.style??{}),null!=t.link&&((n=document.createElement("a")).innerText=e,n.href=t.link,n.target=t.target??"",n.className="lextitle link",Object.assign(n.style,t.style??{}),a.replaceWith(n)),a}addText(n,i,s,l={}){let r=this._createWidget(T.TEXT,n,String(i),l);r.onGetValue=()=>i,r.onSetValue=(e,t,a)=>{r.valid(e)&&this._lastValueTriggered!=e&&(this._lastValueTriggered=i=e,l.disabled?o.innerText=e:o.value=e,t||this._trigger(new w(n,e,a),s))},r.valid=e=>!e.length||""==o.pattern||new RegExp(o.pattern).test(e);var e,t=r.domEl,a=document.createElement("div");a.className="lextext"+(l.warning?" lexwarning":""),a.style.width=l.inputWidth||"calc( 100% - "+y.DEFAULT_NAME_WIDTH+" )",a.style.display="flex",l.textClass&&a.classList.add(l.textClass),this.disabled=(l.disabled||l.warning)??!!l.url;let o=null;return this.disabled?(o=document.createElement(l.url?"a":"div"),l.url&&(o.href=l.url,o.target="_blank"),o.innerHTML=(l.warning?'<i class="fa-solid fa-triangle-exclamation"></i>':"")+i||"",o.style.width="100%",o.style.textAlign=l.float??""):((o=document.createElement("input")).type=l.type||"",o.value=o.iValue=i||"",o.style.width="100%",o.style.textAlign=l.float??"",o.setAttribute("placeholder",l.placeholder??""),l.required&&o.setAttribute("required",l.required),l.pattern&&o.setAttribute("pattern",l.pattern),"default"==(e=l.trigger??"default")?(o.addEventListener("keyup",function(e){"Enter"==e.key&&o.blur()}),o.addEventListener("focusout",function(e){r.set(e.target.value,!1,e)})):"input"==e&&o.addEventListener("input",function(e){r.set(e.target.value,!1,e)}),o.addEventListener("mousedown",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),l.icon&&((e=document.createElement("a")).className="inputicon "+l.icon,a.appendChild(e))),Object.assign(o.style,l.style??{}),a.appendChild(o),t.appendChild(a),l.hideName&&(t.className+=" noname",a.style.width="100%"),r}addTextArea(n,i,s,e={}){let t=this._createWidget(T.TEXTAREA,n,i,e);t.onGetValue=()=>i,t.onSetValue=(e,t,a)=>{r.value=i=e,t||this._trigger(new w(n,e,a),s)};var a=t.domEl,l=document.createElement("div");l.className="lextextarea",l.style.width=e.inputWidth||"calc( 100% - "+y.DEFAULT_NAME_WIDTH+" )",l.style.height=e.height,l.style.display="flex";let r=document.createElement("textarea");r.value=r.iValue=i||"",r.style.width="100%",r.style.textAlign=e.float??"",Object.assign(r.style,e.style??{}),e.disabled&&r.setAttribute("disabled",!0),e.placeholder&&r.setAttribute("placeholder",e.placeholder);var o=e.trigger??"default",o=("default"==o?(r.addEventListener("keyup",function(e){"Enter"==e.key&&r.blur()}),r.addEventListener("focusout",function(e){t.set(e.target.value,!1,e)})):"input"==o&&r.addEventListener("input",function(e){t.set(e.target.value,!1,e)}),e.icon&&((o=document.createElement("a")).className="inputicon "+e.icon,l.appendChild(o)),l.appendChild(r),a.appendChild(l),!e.hideName);return o||(a.className+=" noname",l.style.width="100%"),m(()=>{e.fitHeight&&(r.style.height=r.scrollHeight+"px")},10),t}addLabel(e,t={}){return t.disabled=!0,this.addText(null,e,null,t)}addButton(t,a,n,i={}){var e=this._createWidget(T.BUTTON,t,null,i),e=(e.onGetValue=()=>s.innerText,e.onSetValue=(e,t,a)=>{s.innerHTML=i.icon?"<a class='"+i.icon+"'></a>":i.img?"<img src='"+i.img+"'>":"<span>"+(e||"")+"</span>"},e.domEl),s=document.createElement("button"),l=(s.title=i.title??"",s.className="lexbutton "+(i.buttonClass??""),i.selected&&s.classList.add("selected"),s.innerHTML=i.icon?"<a class='"+i.icon+"'></a>":i.img?"<img src='"+i.img+"'>":"<span>"+(a||"")+"</span>",s.style.width="calc( 100% - "+(i.nameWidth??y.DEFAULT_NAME_WIDTH)+")",i.disabled&&s.setAttribute("disabled",!0),s.addEventListener("click",e=>{i.selectable&&(i.parent&&i.parent.querySelectorAll(".lexbutton.selected").forEach(e=>{e!=s&&e.classList.remove("selected")}),s.classList.toggle("selected")),this._trigger(new w(t,a,e),n)}),e.appendChild(s),!i.hideName&&!(i.icon||i.img));return l||(s.className+=" noname",s.style.width="100%"),e}addComboButtons(a,e,n={}){var t=this._createWidget(T.BUTTONS,a,null,n),i=t.domEl;let s=this,l=document.createElement("div");l.className="lexcombobuttons ",n.float&&(l.className+=n.float),l.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")";var r=document.createElement("div");r.className="lexcombobuttonsbox ";let o=!n.noSelection,d=o&&(n.toggle??!1);for(let t of e){if(!t.value)throw"Set 'value' for each button!";var c=document.createElement("button");c.className="lexbutton combo",c.title=t.icon?t.value:"",c.id=t.id??"",n.buttonClass&&c.classList.add(n.buttonClass),o&&(t.selected||n.selected==t.value)&&c.classList.add("selected"),c.innerHTML=(t.icon?"<a class='"+t.icon+"'></a>":"")+"<span>"+(t.icon?"":t.value)+"</span>",t.disabled&&c.setAttribute("disabled",!0),c.addEventListener("click",function(e){o&&(d?this.classList.toggle("selected"):(l.querySelectorAll("button").forEach(e=>e.classList.remove("selected")),this.classList.add("selected"))),s._trigger(new w(a,t.value,e),t.callback)}),r.appendChild(c)}return!n.hideName||(i.className+=" noname",l.style.width="100%"),l.appendChild(r),i.appendChild(l),t}addCard(t,a={}){a.hideName=!0;var e=this._createWidget(T.CARD,t,null,a),n=e.domEl;let i=document.createElement("div");i.className="lexcard",i.style.width="100%",a.img&&((l=document.createElement("img")).src=a.img,i.appendChild(l),null!=a.link)&&(l.style.cursor="pointer",l.addEventListener("click",function(){var e=i.querySelector("a");e&&e.click()}));var s,l=document.createElement("span");return l.innerText=t,null!=a.link&&((s=document.createElement("a")).innerText=t,s.href=a.link,s.target=a.target??"",l.innerText="",l.appendChild(s)),i.appendChild(l),a.callback&&(i.style.cursor="pointer",i.addEventListener("click",e=>{this._trigger(new w(t,null,e),a.callback)})),n.appendChild(i),e}addForm(e,n,i,t={}){if(n.constructor!=Object)return void console.error("Form data must be an Object");t.hideName=!0;var e=this._createWidget(T.FORM,e,null,t),a=(e.onGetValue=()=>l.formData,e.onSetValue=(t,a,e)=>{l.formData=t;var n,i,s=l.querySelectorAll(".lexwidget");for(let e=0;e<s.length;++e)s[e].jsInstance.type==y.Widget.TEXT&&(n=s[e].querySelector(".lexwidgetname").innerText,(i=s[e].querySelector(".lextext input")).value=t[n]??"",k._dispatch_event(i,"focusout",a))},e.domEl);let l=document.createElement("div");l.className="lexformdata",this.queue(l),l.formData={};for(let t in n){let e=n[t];(e=e.constructor!=Object?{}:e).placeholder=e.placeholder??t,e.width="calc(100% - 10px)",this.addLabel(t,{textClass:"formlabel"}),e.textWidget=this.addText(null,e.constructor==Object?e.value:e,e=>{l.formData[t]=e},e),l.formData[t]=e.constructor==Object?e.value:e}return this.addBlank(),this.addButton(null,t.actionName??"Submit",(e,t)=>{for(var a in n)if(!n[a].textWidget.valid())return;i&&i(l.formData,t)},{buttonClass:"primary",width:"calc(100% - 10px)"}),this.clearQueue(),a.appendChild(l),a.className+=" noname",l.style.width="100%",e}addContent(e,t,a={}){console.assert(t,"Empty content!"),t.constructor==String&&((n=document.createElement("div")).innerHTML=t,t=1<n.childElementCount?n:n.firstElementChild),a.hideName=!0;var n=this._createWidget(T.CONTENT,e,null,a);return n.domEl.appendChild(t),n}async addImage(e,t,a={}){console.assert(t,"Empty src/url for Image!");var n,e=this._createWidget(T.IMAGE,e,null,a),i=e.domEl,s=document.createElement("div"),l=(s.className="leximage",s.style.width="100%",document.createElement("img"));for(n in l.src=t,a.style)l.style[n]=a.style[n];return await l.decode(),s.appendChild(l),i.appendChild(s),e}addDropdown(n,r,o,i,e={}){let d=this._createWidget(T.DROPDOWN,n,o,e),c=(d.onGetValue=()=>c.querySelector("li.selected").getAttribute("value"),d.onSetValue=(e,t,a)=>{o=e,m.querySelectorAll("li").forEach(e=>{e.getAttribute("value")==o&&e.click()}),t||this._trigger(new w(n,o,a),i)},d.domEl);var t=document.createElement("div");t.className="lexdropdown",t.style.width=e.inputWidth||"calc( 100% - "+y.DEFAULT_NAME_WIDTH+")";let h=document.createElement("div");h.className="lexdropdown lexoption",h.name=n;var a=h.iValue=o;a+="<a class='fa-solid fa-angle-down' style='float:right; margin-right: 3px;'></a>",this.queue(t);let u=this.addButton(null,a,(e,t)=>{m.unfocus_event?delete m.unfocus_event:(p.classList.remove("place-above"),p.hasAttribute("open")?p.close():(p.show(),(a=>{var n=a.getParentArea();let i=u.getBoundingClientRect();var s=a.parentElement.closest("dialog");{var l=a.offsetHeight;let t=i.y,e=window.innerHeight;if(n&&(r=n.getBoundingClientRect(),e=r.y+r.height),s){let e=s.getBoundingClientRect();t-=e.y}a.style.top=t+u.offsetHeight+"px",t+l>e&&(a.style.top=t-l+"px",a.classList.add("place-above"))}{var r=a.offsetWidth;let t=i.x;if(a.style.minWidth=i.width+"px",s){let e=s.getBoundingClientRect();t-=e.x}a.style.left=t+"px";let e=window.innerWidth;n&&(l=n.getBoundingClientRect(),e=l.x+l.width),t+r>e&&(a.style.left=t-(r-i.width)+"px")}})(p)),g&&g.querySelector("input").focus())},{buttonClass:"array",skipInlineCount:!0,disabled:e.disabled}),p=(this.clearQueue(),u.style.width="100%",u.refresh=e=>{""==u.querySelector("span").innerText?u.querySelector("span").innerText=e:u.querySelector("span").innerHTML=u.querySelector("span").innerHTML.replaceAll(u.querySelector("span").innerText,e)},document.createElement("dialog")),m=(p.className="lexdropdownoptions",document.createElement("ul")),g=(m.tabIndex=-1,m.className="lexoptions",p.appendChild(m),m.addEventListener("focusout",function(e){if(e.stopPropagation(),e.stopImmediatePropagation(),e.relatedTarget===u.querySelector("button"))this.unfocus_event=!0,setTimeout(()=>delete this.unfocus_event,200);else{if(e.relatedTarget&&"INPUT"==e.relatedTarget.tagName)return;if("lexinput-filter"==e.target.className)return}p.close()}),null),v=(e.filter&&(g=this._addFilter(e.placeholder??"Search...",{container:m,callback:this._filterOptions.bind(m,r)}),m.appendChild(g),g.addEventListener("focusout",function(e){e.relatedTarget&&"UL"==e.relatedTarget.tagName&&e.relatedTarget.classList.contains("lexoptions")||p.close()})),document.createElement("span"));return v.style.height="calc(100% - 25px)",m.appendChild(v),m.refresh=t=>{var e,a;if(v.innerHTML="",t.length)for(let e=0;e<t.length;e++){var n,i=t[e],s=document.createElement("li"),l=document.createElement("div");l.className="option",s.appendChild(l),s.addEventListener("click",e=>{p.close();var t=c.querySelector(".lexoptions .selected");t&&t.classList.remove("selected"),o=e.currentTarget.getAttribute("value"),e.currentTarget.toggleAttribute("hidden",!1),e.currentTarget.classList.add("selected"),u.refresh(o),d.set(o,!1,e),g&&(g.querySelector("input").value="",this._filterOptions.bind(m,r,"")())}),i.constructor!=Object?(l.style.flexDirection="unset",l.innerHTML="</a><span>"+i+"</span><a class='fa-solid fa-check'>",l.value=i,s.setAttribute("value",i),s.className="lexdropdownitem",i==o&&(s.classList.add("selected"),h.innerHTML=i)):((n=document.createElement("img")).src=i.src,s.setAttribute("value",i.value),s.className="lexlistitem",l.innerText=i.value,l.className+=" media",l.prepend(n),l.setAttribute("value",i.value),l.setAttribute("data-index",e),l.setAttribute("data-src",i.src),l.setAttribute("title",i.value),o==i.value&&s.classList.add("selected")),v.appendChild(s)}else a=t.emptyMsg??"No options found.",(e=document.createElement("div")).className="option",e.style.flexDirection="unset",e.innerHTML=a,(a=document.createElement("li")).className="lexdropdownitem empty",a.appendChild(e),v.appendChild(a)},m.refresh(r),t.appendChild(p),c.appendChild(t),e.hideName&&(c.className+=" noname",t.style.width="100%"),d}addCurve(n,e,i,t={}){var a=JSON.parse(JSON.stringify(e));let s=this;var a=this._createWidget(T.CURVE,n,a,t),l=(a.onGetValue=()=>JSON.parse(JSON.stringify(o.element.value)),a.onSetValue=(e,t,a)=>{o.element.value=JSON.parse(JSON.stringify(e)),o.redraw(),t||s._trigger(new w(n,o.element.value,a),i)},a.domEl),r=document.createElement("div");r.className="lexcurve",r.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")",t.callback=(e,t)=>{s._trigger(new w(n,e,t),i)},t.name=n;let o=new D(this,e,t);return r.appendChild(o.element),l.appendChild(r),a.onresize=o.redraw.bind(o),a.curveInstance=o,m(()=>{o.canvas.width=r.offsetWidth,o.redraw()}),a}addDial(n,e,i,t={}){var a=JSON.parse(JSON.stringify(e));let s=this;var a=this._createWidget(T.DIAL,n,a,t),l=(a.onGetValue=()=>JSON.parse(JSON.stringify(o.element.value)),a.onSetValue=(e,t,a)=>{o.element.value=JSON.parse(JSON.stringify(e)),o.redraw(),t||s._trigger(new w(n,o.element.value,a),i)},a.domEl),r=document.createElement("div");r.className="lexcurve",r.style.width=a.name?"calc( 100% - "+y.DEFAULT_NAME_WIDTH+")":"100%",t.callback=(e,t)=>{s._trigger(new w(n,e,t),i)},t.name=n;let o=new M(this,e,t);return r.appendChild(o.element),l.appendChild(r),a.onresize=o.redraw.bind(o),a.curveInstance=o,m(()=>{o.element.style.height=o.element.offsetWidth+"px",o.canvas.width=o.element.offsetWidth,r.style.width=o.element.offsetWidth+"px",o.canvas.height=o.canvas.width,o.redraw()}),a}addLayers(n,s,i,e={}){let l=this,r=this._createWidget(T.LAYERS,n,s,e),o=(r.onGetValue=()=>o.value,r.onSetValue=(e,t,a)=>{s=o.value=e,c(),t||l._trigger(new w(n,s,a),i)},r.domEl);var d=document.createElement("div");d.className="lexlayers",d.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")",o.value=s;let c=()=>{d.innerHTML="";let e=s.toString(2);for(var t=e.length,a=0;a<16-t;++a)e="0"+e;for(let t=0;t<16;++t){var n,i=document.createElement("div");i.className="lexlayer",null!=s&&null!=(n=e[16-t-1])&&"1"==n&&i.classList.add("selected"),i.innerText=t+1,i.title="Bit "+t+", value "+(1<<t),d.appendChild(i),i.addEventListener("click",e=>{e.stopPropagation(),e.stopImmediatePropagation(),e.target.classList.toggle("selected"),s^=1<<t,r.set(s,!1,e)})}};return c(),o.appendChild(d),r}addArray(i,s=[],l,r={}){var e=this._createWidget(T.ARRAY,i,null,r);e.onGetValue=()=>{var e,t=[];for(e of a.querySelectorAll("input"))t.push(e.value);return t},e.onSetValue=(e,t,a)=>{s=e,h(),t||this._trigger(new w(i,s,a),l)};let a=e.domEl,o=(a.style.flexWrap="wrap","4%"),t=document.createElement("div"),n=(t.className="lexarray",t.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")",this.queue(t),"<a class='fa-solid fa-angle-down' style='float:right; margin-right: 3px;'></a>"),d="Array (size "+s.length+")",c=(d+=n,this.addButton(null,d,()=>{a.querySelector(".lexarrayitems").toggleAttribute("hidden")},{buttonClass:"array"}),this.clearQueue(),document.createElement("div")),h=(c.className="lexarrayitems",c.toggleAttribute("hidden",!0),a.appendChild(t),a.appendChild(c),()=>{var e=a.querySelector(".lexbutton.array span");e.innerHTML="Array (size "+s.length+")",e.innerHTML+=n,c.innerHTML="",this.queue(c);for(let n=0;n<s.length;++n){let a=s[n];var t=r.innerValues?"dropdown":a.constructor;switch(this.sameLine(2),t){case String:this.addText(n+"",a,function(e,t){s[n]=e,l(s)},{nameWidth:o,inputWidth:"95%",skipReset:!0});break;case Number:this.addNumber(n+"",a,function(e,t){s[n]=e,l(s)},{nameWidth:o,inputWidth:"95%",skipReset:!0});break;case"dropdown":this.addDropdown(n+"",r.innerValues,a,function(e,t){s[n]=e,l(s)},{nameWidth:o,inputWidth:"95%",skipReset:!0})}this.addButton(null,"<a class='lexicon fa-solid fa-trash'></a>",(e,t)=>{s.splice(s.indexOf(a),1),h(),this._trigger(new w(i,s,t),l)},{title:"Remove item",className:"micro"})}d="Add item",d+="<a class='fa-solid fa-plus' style='float:right; margin-right: 3px; margin-top: 2px;'></a>",this.addButton(null,d,(e,t)=>{s.push(r.innerValues?r.innerValues[0]:""),h(),this._trigger(new w(i,s,t),l)},{buttonClass:"array"}),this.clearQueue()});return h(),e}addList(i,s,l,r,e={}){var t=this._createWidget(T.LIST,i,l,e),a=(t.onGetValue=()=>l,t.onSetValue=(e,t,a)=>{o.querySelectorAll(".lexlistitem").forEach(e=>e.classList.remove("selected"));var n=s.indexOf(e);-1==n||(o.children[n].classList.toggle("selected"),l=e,t)||this._trigger(new w(i,e,a),r)},t.updateValues=e=>{s=e,o.innerHTML="";for(let n=0;n<s.length;++n){let e=null,t=s[n],a=(t.constructor===Array&&(e=t[1],t=t[0]),document.createElement("div"));a.className="lexlistitem"+(l==t?" selected":""),a.innerHTML="<span>"+t+"</span>"+(e?"<a class='"+e+"'></a>":""),a.addEventListener("click",e=>{o.querySelectorAll(".lexlistitem").forEach(e=>e.classList.remove("selected")),a.classList.toggle("selected"),l=t,this._trigger(new w(i,t,e),r)}),o.appendChild(a)}},t.domEl);let o=document.createElement("div");return o.className="lexlist",o.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")",t.updateValues(s),e.hideName&&(a.className+=" noname",o.style.width="100%"),a.appendChild(o),t}addTags(n,i,s,e={}){i=i.replace(/\s/g,"").split(",");var t=[].concat(i);let l=this._createWidget(T.TAGS,n,t,e);l.onGetValue=()=>[].concat(i),l.onSetValue=(e,t,a)=>{i=[].concat(e),d(),t||r._trigger(new w(n,i,a),s)};t=l.domEl;let r=this,o=document.createElement("div"),d=(o.className="lextags",o.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")",()=>{o.innerHTML="";for(let e=0;e<i.length;++e){let t=i[e],a=document.createElement("span");a.className="lextag",a.innerHTML=t;var n=document.createElement("a");n.className="lextagrmb fa-solid fa-xmark lexicon",a.appendChild(n),n.addEventListener("click",e=>{a.remove(),i.splice(i.indexOf(t),1),l.set(i,!1,e)}),o.appendChild(a)}var e=document.createElement("input");e.value="",e.placeholder="Add tag...",o.appendChild(e),e.onkeydown=function(e){var t=this.value.replace(/\s/g,"");" "!=e.key&&"Enter"!=e.key||(e.preventDefault(),!t.length)||-1<i.indexOf(t)||(i.push(t),l.set(i,!1,e))},e.focus()});return d(),e.hideName&&(t.className+=" noname",o.style.width="100%"),t.appendChild(o),l}addCheckbox(n,i,s,e={}){if(!n&&!e.label)throw"Set Widget Name or at least a label!";let t=this._createWidget(T.CHECKBOX,n,i,e),l=(t.onGetValue=()=>i,t.onSetValue=(e,t,a)=>{e==i||(r.checked=i=e,l.querySelector(".lexcheckboxsubmenu")?.toggleAttribute("hidden",!e),t)||this._trigger(new w(n,e,a),s)},t.domEl),a=document.createElement("div"),r=(a.className="lexcheckboxcont",document.createElement("input"));r.type="checkbox",r.className="lexcheckbox "+(e.className??""),r.checked=i,r.disabled=e.disabled??!1;var o=document.createElement("span");return o.className="checkboxtext",o.innerHTML=e.label??"On",a.appendChild(r),a.appendChild(o),r.addEventListener("change",e=>{t.set(r.checked,!1,e)}),l.appendChild(a),e.suboptions&&(l.style.flexWrap="wrap",(o=document.createElement("div")).className="lexcheckboxsubmenu",o.toggleAttribute("hidden",!r.checked),this.queue(o),e.suboptions.call(this,this),this.clearQueue(),l.appendChild(o)),t}addToggle(n,i,s,e={}){let t=this._createWidget(T.TOGGLE,n,i,e),l=(t.onGetValue=()=>r.checked,t.onSetValue=(e,t,a)=>{e==i||(r.checked=i=e,l.querySelector(".lextogglesubmenu")?.toggleAttribute("hidden",!e),t)||this._trigger(new w(n,e,a),s)},t.domEl),a=document.createElement("div"),r=(a.className="lextogglecont",document.createElement("input"));r.type="checkbox",r.className="lextoggle "+(e.className??""),r.checked=i,r.iValue=i,r.disabled=e.disabled??!1;var o=document.createElement("span");return o.className="toggletext",o.innerHTML="On",a.appendChild(r),a.appendChild(o),r.addEventListener("change",e=>{t.set(r.checked,!1,e)}),l.appendChild(a),e.suboptions&&(l.style.flexWrap="wrap",(o=document.createElement("div")).className="lextogglesubmenu",o.toggleAttribute("hidden",!r.checked),this.queue(o),e.suboptions.call(this,this),this.clearQueue(),l.appendChild(o)),t}addRadioGroup(e,t,i,s,a={}){let n=this._createWidget(T.RADIO,e,null,a),l=null;n.onGetValue=()=>{var e=r.querySelectorAll("button");return l?[l,e[l]]:void 0},n.onSetValue=(e,t,a)=>{console.assert(e.constructor==Number,"RadioGroup _value_ must be an Array index!");var n=r.querySelectorAll("button"),n=(n.forEach(e=>{e.checked=!1,e.classList.remove("checked")}),n[e]);n.checked=!n.checked,n.classList.toggle("checked"),t||d._trigger(new w(null,[e,i[e]],a),s)};var e=n.domEl,r=document.createElement("div"),o=(r.className="lexradiogroup "+(a.className??""),document.createElement("span"));o.innerHTML=t,r.appendChild(o);let d=this;for(let t=0;t<i.length;++t){var c=document.createElement("div"),h=(c.className="lexradiogroupitem",r.appendChild(c),document.createElement("button")),u=(h.className="lexbutton",h.disabled=a.disabled??!1,c.appendChild(h),h.addEventListener("click",e=>{n.set(t,!1,e)}),document.createElement("span")),h=(h.appendChild(u),document.createElement("span"));h.innerHTML=i[t],c.appendChild(h)}return a.selected&&(console.assert(a.selected.constructor==Number,"RadioGroup _selected_ must be an Array index!"),l=a.selected,n.set(l,!0)),e.appendChild(r),n}addColor(n,i,s,e={}){i=i.constructor===Array?u(i):i;let t=this._createWidget(T.COLOR,n,i,e);t.onGetValue=()=>i,t.onSetValue=(e,t,a)=>{r.useRGB&&(e=h(e)),a&&o.set(e,!0,a),r.value=i=e,t||this._trigger(new w(n,e,a),s)};var a=t.domEl,l=document.createElement("span");l.className="lexcolor",l.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")";let r=document.createElement("input"),o=(r.style.width="32px",r.type="color",r.className="colorinput",r.id="color"+b(),r.useRGB=e.useRGB??!1,r.value=r.iValue=i,e.disabled&&(r.disabled=!0),r.addEventListener("input",e=>{t.set(e.target.value,!1,e)},!1),l.appendChild(r),this.queue(l),this.addText(null,r.value,e=>{t.set(e)},{width:"calc( 100% - 32px )"}));return o.domEl.style.marginLeft="4px",this.clearQueue(),a.appendChild(l),t}addRange(n,i,s,l={}){let t=this._createWidget(T.RANGE,n,i,l);t.onGetValue=()=>i,t.onSetValue=(e,t,a)=>{isNaN(e)||(r.value=i=f(+e,+r.min,+r.max),t)||this._trigger(new w(n,l.left?+r.max-i+ +r.min:i,a),s)};var e=t.domEl,a=document.createElement("div");a.className="lexrange",a.style.width=l.inputWidth||"calc( 100% - "+y.DEFAULT_NAME_WIDTH+")";let r=document.createElement("input");return r.className="lexrangeslider "+(l.className??""),r.value=r.iValue=i,r.min=l.min,r.max=l.max,r.step=l.step??1,r.type="range",r.disabled=l.disabled??!1,l.left&&r.classList.add("left"),(l.fill??!0)||r.classList.add("no-fill"),r.addEventListener("input",e=>{t.set(e.target.valueAsNumber,!1,e)},{passive:!1}),r.addEventListener("mousedown",function(e){l.onPress&&l.onPress.bind(r)(e,r)},!1),r.addEventListener("mouseup",function(e){l.onRelease&&l.onRelease.bind(r)(e,r)},!1),t.setLimits=(e,t,a)=>{r.min=e??r.min,r.max=t??r.max,r.step=a??r.step,k._dispatch_event(r,"input",!0)},i.constructor==Number&&(i=f(i,+r.min,+r.max)),a.appendChild(r),e.appendChild(a),l.hideName&&(e.className+=" noname",a.style.width="100%"),t}addNumber(n,i,s,l={}){let r=this._createWidget(T.NUMBER,n,i,l);r.onGetValue=()=>i,r.onSetValue=(e,t,a)=>{isNaN(e)||(i=f(+e,+d.min,+d.max),d.value=i=E(i,l.precision),o.querySelector(".lexinputslider")&&(o.querySelector(".lexinputslider").value=i),l.units&&(d.unitSpan.style.left=v(i)+"px"),t)||this._trigger(new w(n,i,a),s)};var e,t=r.domEl,a=document.createElement("div");a.className="lexnumber",a.style.width=l.inputWidth||"calc( 100% - "+y.DEFAULT_NAME_WIDTH+")";let o=document.createElement("div"),d=(o.className="numberbox",document.createElement("input")),c=(d.id="number_"+b(),d.className="vecinput",d.min=l.min??-1e24,d.max=l.max??1e24,d.step=l.step??"any",d.type="number",i.constructor==Number&&(i=E(i=f(i,+d.min,+d.max),l.precision)),d.value=d.iValue=i,o.appendChild(d),l.units&&((e=document.createElement("span")).className="lexunit",e.innerText=l.units,e.style.left=v(d.value)+"px",d.unitSpan=e,o.appendChild(e)),document.createElement("a"));if(c.className="fa-solid fa-arrows-up-down drag-icon hidden",o.appendChild(c),l.disabled&&(d.disabled=!0),!l.skipSlider&&void 0!==l.min&&void 0!==l.max){let n=document.createElement("input");n.className="lexinputslider",n.min=l.min,n.max=l.max,n.step=l.step??1,n.type="range",n.value=i,n.addEventListener("input",function(e){r.set(this.valueAsNumber,!1,e)},!1),n.addEventListener("mousedown",function(e){l.onPress&&l.onPress.bind(n)(e,n)},!1),n.addEventListener("mouseup",function(e){l.onRelease&&l.onRelease.bind(n)(e,n)},!1),o.appendChild(n),r.setLimits=(e,t,a)=>{d.min=n.min=e??d.min,d.max=n.max=t??d.max,d.step=a??d.step,n.step=a??n.step,r.set(i,!0)}}d.addEventListener("input",function(e){i=E(i=+this.valueAsNumber,l.precision),l.units&&(d.unitSpan.style.left=v(d.value)+"px")},!1),d.addEventListener("wheel",function(t){if(t.preventDefault(),this===document.activeElement){let e=l.step??1;t.shiftKey?e*=10:t.altKey&&(e*=.1),i=+this.valueAsNumber-e*(0<t.deltaY?1:-1),r.set(i,!1,t)}},{passive:!1}),d.addEventListener("change",function(e){r.set(this.valueAsNumber,!1,e)},{passive:!1}),d.addEventListener("mousedown",function(e){var t;document.activeElement!=d&&((t=h.root.ownerDocument).addEventListener("mousemove",u),t.addEventListener("mouseup",p),document.body.classList.add("noevents"),c.classList.remove("hidden"),e.stopImmediatePropagation(),e.stopPropagation(),document.pointerLockElement||d.requestPointerLock(),l.onPress)&&l.onPress.bind(d)(e,d)});var h=this;function u(t){var a=-t.movementY;if(0!=a){let e=l.step??1;t.shiftKey?e*=10:t.altKey&&(e*=.1),i=+d.valueAsNumber+e*a,r.set(i,!1,t)}t.stopPropagation(),t.preventDefault()}function p(e){var t=h.root.ownerDocument;t.removeEventListener("mousemove",u),t.removeEventListener("mouseup",p),document.body.classList.remove("noevents"),c.classList.add("hidden"),document.pointerLockElement&&document.exitPointerLock(),l.onRelease&&l.onRelease.bind(d)(e,d)}return a.appendChild(o),t.appendChild(a),l.hideName&&(t.className+=" noname",a.style.width="100%"),r}static VECTOR_COMPONENTS={0:"x",1:"y",2:"z",3:"w"};_add_vector(t,i,s,l,r={}){t=f(t,2,4),s=s??new Array(t).fill(0);let o=this._createWidget(T.VECTOR,i,[].concat(s),r),d=(o.onGetValue=()=>{var e,t=[];for(e of d.querySelectorAll("input"))t.push(+e.value);return t},o.onSetValue=(t,e,a)=>{if(c.length!=t.length)console.error("Input length does not match vector length.");else{for(let e=0;e<c.length;++e){var n;n=E(f(t[e],+c[e].min,+c[e].max),r.precision)??0,c[e].value=t[e]=n}e||this._trigger(new w(i,t,a),l)}},o.domEl),c=[],n=document.createElement("div");n.className="lexvector",n.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")";for(let e=0;e<t;++e){var h=document.createElement("div");h.className="vecbox",h.innerHTML="<span class='"+k.VECTOR_COMPONENTS[e]+"'></span>";let i=document.createElement("input"),a=(i.className="vecinput v"+t,i.min=r.min??-1e24,i.max=r.max??1e24,i.step=r.step??"any",i.type="number",i.id="vec"+t+"_"+b(),i.idx=e,c[e]=i,s[e].constructor==Number&&(s[e]=f(s[e],+i.min,+i.max),s[e]=E(s[e],r.precision)),i.value=i.iValue=s[e],document.createElement("a"));a.className="fa-solid fa-arrows-up-down drag-icon hidden",h.appendChild(a),r.disabled&&(i.disabled=!0),i.addEventListener("wheel",function(t){if(t.preventDefault(),this===document.activeElement){let e=r.step??1;if(t.shiftKey?e=10:t.altKey&&(e=.1),v.locked)for(var a of d.querySelectorAll(".vecinput"))a.value=E(+a.valueAsNumber-e*(0<t.deltaY?1:-1),r.precision),k._dispatch_event(a,"change");else this.value=E(+this.valueAsNumber-e*(0<t.deltaY?1:-1),r.precision),k._dispatch_event(i,"change")}},{passive:!1}),i.addEventListener("change",e=>{if(!isNaN(e.target.value)){var t=E(f(e.target.value,+i.min,+i.max),r.precision);if(v.locked)for(var a of c)a.value=t,s[a.idx]=t;else i.value=t,s[e.target.idx]=t;o.set(s,!1,e)}},!1),i.addEventListener("mousedown",p);var u=this;function p(e){var t;document.activeElement!=i&&((t=u.root.ownerDocument).addEventListener("mousemove",m),t.addEventListener("mouseup",g),document.body.classList.add("noevents"),a.classList.remove("hidden"),e.stopImmediatePropagation(),e.stopPropagation(),document.pointerLockElement||i.requestPointerLock(),r.onPress)&&r.onPress.bind(i)(e,i)}function m(t){var a=-t.movementY;if(0!=a){let e=r.step??1;if(t.shiftKey?e=10:t.altKey&&(e=.1),v.locked)for(var n of d.querySelectorAll(".vecinput"))n.value=E(+n.valueAsNumber+e*a,r.precision),k._dispatch_event(n,"change");else i.value=E(+i.valueAsNumber+e*a,r.precision),k._dispatch_event(i,"change")}t.stopPropagation(),t.preventDefault()}function g(e){var t=u.root.ownerDocument;t.removeEventListener("mousemove",m),t.removeEventListener("mouseup",g),document.body.classList.remove("noevents"),a.classList.add("hidden"),document.pointerLockElement&&document.exitPointerLock(),r.onRelease&&r.onRelease.bind(i)(e,i)}h.appendChild(i),n.appendChild(h)}void 0===r.min&&void 0===r.max||(o.setLimits=(e,t,a)=>{for(var n of c)n.min=e??n.min,n.max=t??n.max,n.step=a??n.step;o.set(s,!0)});let v=document.createElement("a");return v.title="Lock",v.className="fa-solid fa-lock-open lexicon lock",n.appendChild(v),v.addEventListener("click",function(e){this.locked=!this.locked,this.locked?(this.classList.add("fa-lock"),this.classList.remove("fa-lock-open")):(this.classList.add("fa-lock-open"),this.classList.remove("fa-lock"))},!1),d.appendChild(n),o}addVector2(e,t,a,n){return this._add_vector(2,e,t,a,n)}addVector3(e,t,a,n){return this._add_vector(3,e,t,a,n)}addVector4(e,t,a,n){return this._add_vector(4,e,t,a,n)}addSize(e,t,s,a={}){let l=this._createWidget(T.SIZE,e,t,a),r=(l.onGetValue=()=>{var t=[];for(let e=0;e<r.dimensions.length;++e)t.push(r.dimensions[e].value());return t},l.onSetValue=(t,a,e)=>{for(let e=0;e<r.dimensions.length;++e)r.dimensions[e].set(t[e],a)},l.domEl);this.queue(r),r.aspectRatio=2==t.length?t[0]/t[1]:null,r.dimensions=[];for(let i=0;i<t.length;++i){var n;r.dimensions[i]=this.addNumber(null,t[i],e=>{var t,a,n=l.value();r.locked&&(t=0==i?1/r.aspectRatio:r.aspectRatio,n[a=(1+i)%2]=e*t,r.dimensions[a].set(n[a],!0)),s&&s(n)},{min:0,disabled:a.disabled,precision:a.precision}),i+1!=t.length&&((n=document.createElement("a")).className="lexsizecross fa-solid fa-xmark",r.appendChild(n))}this.clearQueue(),a.units&&((e=document.createElement("span")).className="lexunit",e.innerText=a.units,r.appendChild(e)),r.aspectRatio&&((e=document.createElement("a")).title="Lock Aspect Ratio",e.className="fa-solid fa-lock-open lexicon lock",r.appendChild(e),e.addEventListener("click",function(e){var t;r.locked=!r.locked,r.locked?(this.classList.add("fa-lock"),this.classList.remove("fa-lock-open"),t=l.value(),r.aspectRatio=t[0]/t[1]):(this.classList.add("fa-lock-open"),this.classList.remove("fa-lock"))},!1));e=!a.hideName;return e||(r.className+=" noname",container.style.width="100%"),l}addPad(i,e,s,a={}){var t=this._createWidget(T.PAD,i,null,a),n=(t.onGetValue=()=>o.value.xy,t.onSetValue=(e,t,a)=>{o.value.set(e[0],e[1]),d(o.value),t||this._trigger(new w(i,o.value.xy),s)},t.domEl),l=document.createElement("div");l.className="lexpad",l.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")";let r=document.createElement("div"),o=(r.id="lexpad-"+i,r.className="lexinnerpad",r.style.width=a.padSize??"96px",r.style.height=a.padSize??"96px",document.createElement("div")),d=(o.className="lexpadthumb",o.value=new y.vec2(e[0],e[1]),o.min=a.min??0,o.max=a.max??1,e=>{var[t,a]=[r.offsetWidth,r.offsetHeight],e=new y.vec2(p(e.x,o.min,o.max,0,1),p(e.y,o.min,o.max,0,1));o.style.transform=`translate(calc( ${t*e.x}px - 50% ), calc( ${a*e.y}px - 50%)`}),c=(m(()=>{d(o.value)}),r.appendChild(o),l.appendChild(r),n.appendChild(l),r.addEventListener("mousedown",function(e){var t;document.activeElement!=o&&((t=c.root.ownerDocument).addEventListener("mousemove",h),t.addEventListener("mouseup",u),document.body.classList.add("nocursor"),document.body.classList.add("noevents"),e.stopImmediatePropagation(),e.stopPropagation(),a.onPress)&&a.onPress.bind(o)(e,o)}),this);function h(e){var t=r.getBoundingClientRect(),t=new y.vec2(e.x-t.x,e.y-t.y),[a,n]=(t.clp(0,r.offsetWidth,t),[r.offsetWidth,r.offsetHeight]),t=t.div(new y.vec2(r.offsetWidth,r.offsetHeight));o.style.transform=`translate(calc( ${a*t.x}px - 50% ), calc( ${n*t.y}px - 50%)`,o.value=new y.vec2(p(t.x,0,1,o.min,o.max),p(t.y,0,1,o.min,o.max)),c._trigger(new w(i,o.value.xy,e),s),e.stopPropagation(),e.preventDefault()}function u(e){var t=c.root.ownerDocument;t.removeEventListener("mousemove",h),t.removeEventListener("mouseup",u),document.body.classList.remove("nocursor"),document.body.classList.remove("noevents"),a.onRelease&&a.onRelease.bind(o)(e,o)}return t}addProgress(n,e,i={}){var t,a=this._createWidget(T.PROGRESS,n,e,i);a.onGetValue=()=>r.value,a.onSetValue=(e,t,a)=>{s.querySelector("meter").value=e,o(),s.querySelector("span")&&(s.querySelector("span").innerText=e)};let s=a.domEl,l=document.createElement("div"),r=(l.className="lexprogress",l.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")",document.createElement("meter")),o=(r.id="lexprogressbar-"+n,r.className="lexprogressbar",r.step="any",r.min=i.min??0,r.max=i.max??1,r.low=i.low??r.low,r.high=i.high??r.high,r.optimum=i.optimum??r.optimum,r.value=e,()=>{let e=y.getThemeColor("global-selected");null!=r.low&&r.value<r.low?e=y.getThemeColor("global-color-error"):null!=r.high&&r.value<r.high&&(e=y.getThemeColor("global-color-warning")),r.style.background=`color-mix(in srgb, ${e} 20%, transparent)`});if(l.appendChild(r),s.appendChild(l),i.showValue&&(document.getElementById("progressvalue-"+n)&&document.getElementById("progressvalue-"+n).remove(),(t=document.createElement("span")).id="progressvalue-"+n,t.style.padding="0px 5px",t.innerText=e,l.appendChild(t)),i.editable){r.classList.add("editable"),r.addEventListener("mousedown",function(e){var t=a.root.ownerDocument;t.addEventListener("mousemove",d),t.addEventListener("mouseup",c),document.body.classList.add("noevents"),r.classList.add("grabbing"),e.stopImmediatePropagation(),e.stopPropagation();t=r.getBoundingClientRect(),e=E(p(e.offsetX,0,t.width,r.min,r.max));a.setValue(n,e)});let a=this;function d(e){var t;0!=e.movementX&&(t=r.getBoundingClientRect(),t=E(p(e.offsetX-t.x,0,t.width,r.min,r.max)),a.setValue(n,t),i.callback)&&i.callback(t,e),e.stopPropagation(),e.preventDefault()}function c(e){var t=a.root.ownerDocument;t.removeEventListener("mousemove",d),t.removeEventListener("mouseup",c),document.body.classList.remove("noevents"),r.classList.remove("grabbing")}}return o(),a}addFile(e,a,n={}){var e=this._createWidget(T.FILE,e,null,n),t=e.domEl,i=n.local??!0;let s=n.type??"text",l=n.read??!0,r=document.createElement("input");if(r.className="lexfileinput",r.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+" - 10%)",r.type="file",r.disabled=n.disabled??!1,n.placeholder&&(r.placeholder=n.placeholder),r.addEventListener("change",function(e){let t=e.target.files;t.length&&(l?(n.onBeforeRead&&n.onBeforeRead(),e=new FileReader,"text"===s?e.readAsText(t[0]):"buffer"===s?e.readAsArrayBuffer(t[0]):"bin"===s?e.readAsBinaryString(t[0]):"url"===s&&e.readAsDataURL(t[0]),e.onload=e=>{a.call(this,e.target.result,t[0])}):a(t[0]))}),r.addEventListener("cancel",function(e){a(null)}),t.appendChild(r),this.queue(t),i){let t=null;this.addButton(null,"<a style='margin-top: 0px;' class='fa-solid fa-gear'></a>",()=>{t=t||new A("Load Settings",e=>{e.addDropdown("Type",["text","buffer","bin","url"],s,e=>{s=e}),e.addButton(null,"Reload",e=>{r.dispatchEvent(new Event("change"))})},{onclose:e=>{e.remove(),t=null}})},{className:"micro",skipInlineCount:!0,title:"Settings"})}return this.clearQueue(),e}addTree(e,t,a={}){a.hideName=!0;var n=this._createWidget(T.TREE,e,null,a).domEl,i=document.createElement("div"),s=(i.className="lextree",n.appendChild(i),e&&((n=document.createElement("span")).innerHTML=e,i.appendChild(n)),document.createElement("div"));if(s.className="lextreetools",e||(s.className+=" notitle"),a.icons)for(var l of a.icons){var r=document.createElement("a");r.title=l.name,r.className="lexicon "+l.icon,r.addEventListener("click",l.callback),s.appendChild(r)}a.filter=a.filter??!0;n=null,a.filter&&((n=document.createElement("input")).id="lexnodetree_filter",n.setAttribute("placeholder","Filter.."),n.style.width="calc( 100% - 17px )",n.addEventListener("input",function(){o.refresh()}),(e=document.createElement("a")).className="lexicon fa-solid fa-magnifying-glass",s.appendChild(n),s.appendChild(e)),(a.icons||a.filter)&&i.appendChild(s),n=document.createElement("ul");n.addEventListener("contextmenu",function(e){e.preventDefault()}),i.appendChild(n);let o=new N(i,t,a);return o}addSeparator(){var e=document.createElement("div"),t=(e.className="lexseparator",new T(T.SEPARATOR));t.domEl=e,this._currentBranch?(this._currentBranch.content.appendChild(e),this._currentBranch.widgets.push(t)):this.root.appendChild(e)}addTabs(i,e={}){var t=this._createWidget(T.TABS,null,null,e).domEl;if(i.constructor!=Array)throw"Param @tabs must be an Array!";var a=e.vertical??!0,s=!a&&(e.showNames??!1);let l=document.createElement("div"),r=(l.className="lextabscontainer",a||(l.className+=" horizontal"),document.createElement("div"));r.className="tabs",l.appendChild(r),t.appendChild(l);for(let e=0;e<i.length;++e){let t=i[e];console.assert(t.name);var o=0==e;let a=document.createElement("div"),n=(a.className="lextab "+(e==i.length-1?"last":"")+(o?"selected":""),a.innerHTML=(s?t.name:"")+"<a class='"+(t.icon||"fa fa-hashtag")+" "+(s?"withname":"")+"'></a>",a.title=t.name,document.createElement("div"));n.id=t.name.replace(/\s/g,""),n.className="widgets",o||n.toggleAttribute("hidden",!0),l.appendChild(n),a.addEventListener("click",e=>{r.querySelectorAll(".lextab").forEach(e=>{e.classList.remove("selected")}),a.classList.add("selected"),l.querySelectorAll(".widgets").forEach(e=>{e.toggleAttribute("hidden",!0)}),l.querySelector("#"+n.id).toggleAttribute("hidden"),t.onSelect&&t.onSelect(this,n)}),r.appendChild(a),t.onCreate&&(this.queue(n),t.onCreate(this,n),this.clearQueue())}this.addSeparator()}addCounter(n,e,i,t={}){let s=this._createWidget(T.COUNTER,n,e,t);s.onGetValue=()=>c.count,s.onSetValue=(e,t,a)=>{e=f(e,l,r),c.count=e,c.innerHTML=e,t||this._trigger(new w(n,e,a),i)};var a=s.domEl;let l=t.min??0,r=t.max??100,o=t.step??1;var d=document.createElement("div"),a=(d.className="lexcounter",a.appendChild(d),this.queue(d),this.addButton(null,"<a style='margin-top: 0px;' class='fa-solid fa-minus'></a>",(e,t)=>{let a=o??1;t.shiftKey&&(a*=10),s.set(c.count-a,!1,t)},{className:"micro",skipInlineCount:!0,title:"Minus"}),this.clearQueue(),document.createElement("div"));a.className="lexcounterbox",d.appendChild(a);let c=document.createElement("span");return c.className="lexcountervalue",c.innerHTML=e,c.count=e,a.appendChild(c),t.label&&((e=document.createElement("span")).className="lexcounterlabel",e.innerHTML=t.label,a.appendChild(e)),this.queue(d),this.addButton(null,"<a style='margin-top: 0px;' class='fa-solid fa-plus'></a>",(e,t)=>{let a=o??1;t.shiftKey&&(a*=10),s.set(c.count+a,!1,t)},{className:"micro",skipInlineCount:!0,title:"Plus"}),this.clearQueue(),s}addTable(e,m,g={}){if(!m)throw"Data is needed to create a table!";let v=this._createWidget(T.TABLE,e,null,g);v.onGetValue=()=>{},v.onSetValue=(e,t,a)=>{};var e=v.domEl,t=document.createElement("div");t.className="lextable",t.style.width="calc( 100% - "+y.DEFAULT_NAME_WIDTH+")";let f=document.createElement("table");function E(e,t,a,n){return a[e]<n[e]?-t:a[e]>n[e]?t:0}return t.appendChild(f),m.head=m.head??[],m.body=m.body??[],m.orderMap={},m.checkMap={},v.refreshTable=()=>{f.innerHTML="";var e,t,a=document.createElement("thead"),n=(a.className="lextablehead",f.appendChild(a),document.createElement("tr"));g.selectable&&(e=document.createElement("th"),(t=document.createElement("input")).type="checkbox",t.className="lexcheckbox",t.checked=m.checkMap[":root"]??!1,e.appendChild(t),t.addEventListener("change",function(){var e;m.checkMap[":root"]=this.checked;for(e of f.querySelector("tbody").childNodes)m.checkMap[e.getAttribute("rowId")]=this.checked,e.querySelector("input").checked=this.checked}),n.appendChild(e));for(let t of m.head){var i=document.createElement("th");i.innerHTML=t+' <a class="fa-solid fa-sort"></a>',i.querySelector("a").addEventListener("click",()=>{m.orderMap[t]||(m.orderMap[t]=1);var e=m.head.indexOf(t);m.body=m.body.sort(E.bind(this,e,m.orderMap[t])),m.orderMap[t]=-m.orderMap[t],v.refreshTable()}),n.appendChild(i)}g.rowActions&&((t=document.createElement("th")).className="sm",n.appendChild(t)),a.appendChild(n);var s=document.createElement("tbody");s.className="lextablebody",f.appendChild(s);for(let a=0;a<m.body.length;++a){var l,r,o=m.body[a];let e=document.createElement("tr"),t=y.getSupportedDOMName(o.join("-"));e.setAttribute("rowId",t),g.selectable&&(l=document.createElement("td"),(h=document.createElement("input")).type="checkbox",h.className="lexcheckbox",h.checked=m.checkMap[t],l.appendChild(h),h.addEventListener("change",function(){m.checkMap[t]=this.checked,this.checked||(f.querySelector("thead input[type='checkbox']").checked=m.checkMap[":root"]=!1)}),e.appendChild(l));for(r of o){var d=document.createElement("td");d.innerHTML=""+r,e.appendChild(d)}if(g.rowActions){var c,h=document.createElement("td"),u=(h.className="sm",document.createElement("div"));u.className="lextablebuttons",h.appendChild(u);for(c of g.rowActions){var p=document.createElement("a");p.className="lexicon","delete"==c?(p.className+=" fa-solid fa-trash-can",p.addEventListener("click",function(){m.body.splice(a,1),e.remove()})):"menu"==c?(p.className+=" fa-solid fa-ellipsis",p.addEventListener("click",function(e){S(null,e,e=>{g.onMenuAction?g.onMenuAction(e):console.warn("Using <Menu action> without action callbacks.")})})):(console.assert(c.constructor==Object),p.className+=" "+c.icon),u.appendChild(p)}e.appendChild(h)}s.appendChild(e)}},v.refreshTable(),g.hideName&&(e.className+=" noname",t.style.width="100%"),e.appendChild(t),v}}y.Panel=k;class a{constructor(e,t={}){this.name=e;var a=document.createElement("div"),n=(a.className="lexbranch",t.id&&(a.id=t.id),t.className&&(a.className+=" "+t.className),a.style.width="calc(100% - 7px)",a.style.margin="0 auto",this),i=(this.root=a,this.widgets=[],document.createElement("div")),s=(i.className="lexbranchtitle",t.icon&&(i.innerHTML="<a class='branchicon "+t.icon+"'>"),i.innerHTML+=e||"Branch",i.innerHTML+="<a class='fa-solid fa-angle-up switch-branch-button'></a>",a.appendChild(i),document.createElement("div"));s.id=e.replace(/\s/g,""),s.className="lexbranchcontent",a.appendChild(s),this.content=s,this._addBranchSeparator(),t.closed&&(i.className+=" closed",a.className+=" closed",this.grabber.setAttribute("hidden",!0),m(()=>{this.content.setAttribute("hidden",!0)},15)),this.onclick=function(e){e.stopPropagation(),this.classList.toggle("closed"),this.parentElement.classList.toggle("closed"),n.content.toggleAttribute("hidden"),n.grabber.toggleAttribute("hidden"),y.emit("@on_branch_closed",this.classList.contains("closed"),{target:n.panel})},this.oncontextmenu=function(t){t.preventDefault(),t.stopPropagation(),this.parentElement.classList.contains("dialog")||S("Dock",t,e=>{t.preventDefault(),e.add("Floating",n._on_make_floating.bind(n))},{icon:"fa-regular fa-window-restore"})},i.addEventListener("click",this.onclick),i.addEventListener("contextmenu",this.oncontextmenu)}_on_make_floating(){new A(this.name,e=>{for(var t of this.widgets)e.root.appendChild(t.domEl)}).widgets=this.widgets;var e=this.root.parentElement,t=(this.root.remove(),e.querySelector(".lexbranch")),t=(t&&t.classList.add("first"),e.querySelectorAll(".lexbranch"));t.length&&t[t.length-1].classList.add("last")}_addBranchSeparator(){var e=document.createElement("div");e.className="lexwidgetseparator",e.style.width="100%",e.style.background="none";let a=document.createElement("div"),n=(a.innerHTML="&#9662;",e.appendChild(a),m(()=>{a.style.marginLeft=parseFloat(y.DEFAULT_NAME_WIDTH)/100*this.content.offsetWidth+"px"},10),document.createElement("div"));n.style.width="1px",n.style.marginLeft="6px",n.style.marginTop="2px",n.style.height="0px",a.appendChild(n),a.addEventListener("mousedown",function(e){var t=i.root.ownerDocument;t.addEventListener("mouseup",l),t.addEventListener("mousemove",s),e.stopPropagation(),e.preventDefault();t=i.root.offsetHeight-i.root.children[0].offsetHeight;n.style.height=t-3+"px",document.body.classList.add("nocursor")}),this.grabber=a;let i=this;function s(e){var t,e=e.movementX;0!=e&&(t=parseFloat(a.style.marginLeft),a.style.marginLeft=f(t+e,32,i.content.offsetWidth-32)+"px")}function l(e){i._updateWidgets(),n.style.height="0px";var t=i.root.ownerDocument;t.removeEventListener("mouseup",l),t.removeEventListener("mousemove",s),document.body.classList.remove("nocursor")}this.content.appendChild(e)}_updateWidgets(){for(var t=this.grabber.style.marginLeft,e=0;e<this.widgets.length;e++){var a=this.widgets[e],n=a.domEl;if(!(n.children.length<2)){var i=n.children[0],n=n.children[1];i.style.width=t;let e="0px";a.type===T.FILE&&(e="10%"),n.style.width="-moz-calc( 100% - "+t+" - "+e+" )",n.style.width="-webkit-calc( 100% - "+t+" - "+e+" )",n.style.width="calc( 100% - "+t+" - "+e+" )",a.onresize&&a.onresize()}}}}y.Branch=a;y.Footer=class{constructor(e={}){var t=document.createElement("footer"),a=(t.className="lexfooter",document.createElement("div"));if(a.className="wrapper",t.appendChild(a),e.columns&&e.columns.constructor==Array){var n,i=document.createElement("div");i.className="columns",i.style.gridTemplateColumns="1fr ".repeat(e.columns.length),a.appendChild(i);for(n of e.columns){var s=document.createElement("div"),l=(s.className="col",i.appendChild(s),document.createElement("h2"));if(l.innerHTML=n.title,s.appendChild(l),n.items&&n.items.length){var r,o=document.createElement("ul");s.appendChild(o);for(r of n.items){var d=document.createElement("li");d.innerHTML=`<a class="" href="${r.link}">${r.title}</a>`,o.appendChild(d)}}}}if(e.credits||e.socials){var c=document.createElement("hr"),c=(a.appendChild(c),document.createElement("div"));if(c.className="credits-and-socials",a.appendChild(c),e.credits&&((a=document.createElement("p")).innerHTML=e.credits,c.appendChild(a)),e.socials){var h,u=document.createElement("div");u.className="social";for(h of e.socials){var p=document.createElement("a");p.title=h.title,p.innerHTML=h.icon,p.href=h.link,p.target="_blank",u.appendChild(p)}c.appendChild(u)}}(e.parent??document.body).appendChild(t)}};class A{static _last_id=0;constructor(l,e,t={}){e||console.warn("Content is empty, add some widgets using 'callback' parameter!"),this._oncreate=e,this.id=b();let a=t.size??[],n=t.position??[],i=t.draggable??!0,s=t.modal??!1;var r=document.createElement("dialog");r.className="lexdialog "+(t.className??""),r.id=t.id??"dialog"+A._last_id++,y.root.appendChild(r),m(()=>{s?r.showModal():r.show()},10);let o=this,d=document.createElement("div"),c;l&&(d.className="lexdialogtitle",d.innerHTML=l,d.setAttribute("draggable",!1),d.oncontextmenu=function(s){s.preventDefault(),s.stopPropagation(),y.main_area&&"horizontal"===y.main_area.type&&S("Dock",s,e=>{s.preventDefault();function n(e){let t=e.panels[0];if(t)return t;for(var a of e.sections)if(t=n(a))return t}function t(e){let t=e.branches.find(e=>e.name===l);t?e.root.appendChild(t.root):(e.branch(l),t=e.branches.find(e=>e.name===l));for(var a of o.widgets)t.content.appendChild(a.domEl);t.widgets=o.widgets,e.root.querySelectorAll(".lexbranch.last").forEach(e=>{e.classList.remove("last")}),t.root.classList.add("last"),r.remove()}let a=n(y.main_area.sections[1]),i=(e.add('<i class="fa-regular fa-window-maximize fa-window-maximize fa-rotate-90">',{disabled:!a,id:"dock_options0",callback:()=>{t(a)}}),n(y.main_area.sections[0]));e.add('<i class="fa-regular fa-window-maximize fa-window-maximize fa-rotate-270">',{disabled:!i,id:"dock_options1",callback:()=>{t(i)}})},{icon:"fa-regular fa-window-restore"})},r.appendChild(d)),(t.closable??!0)&&(this.close=()=>{t.onBeforeClose&&t.onBeforeClose(this),t.onclose?t.onclose(this.root):(r.close(),m(()=>{o.panel.clear(),r.remove()},150))},(c=document.createElement("a")).className="lexdialogcloser fa-solid fa-xmark",c.title="Close",c.addEventListener("click",this.close),(l?d:(c.classList.add("notitle"),r)).appendChild(c));var h=new k;h.root.classList.add("lexdialogcontent"),l||h.root.classList.add("notitle"),e&&e.call(this,h),r.appendChild(h.root),h.root.querySelectorAll(".lexbranch").forEach(e=>e.classList.add("dialog")),this.panel=h,this.root=r,this.title=d,i&&x(r,Object.assign({targetClass:"lexdialogtitle"},t)),a.length&&"string"!=typeof a[0]&&(a[0]+="px"),a.length&&"string"!=typeof a[1]&&(a[1]+="px"),r.style.width=a[0]||"25%",r.style.height=a[1]||"auto",r.style.translate=t.position?"unset":"-50% -50%",t.size&&(this.size=a),r.style.left=n[0]??"50%",r.style.top=n[1]??"50%",h.root.style.width="calc( 100% - 30px )",h.root.style.height=l?"calc( 100% - "+(d.offsetHeight+30)+"px )":"calc( 100% - 51px )"}destroy(){this.root.remove()}refresh(){this.panel.root.innerHTML="",this._oncreate.call(this,this.panel)}setPosition(e,t){this.root.style.left=e+"px",this.root.style.top=t+"px"}setTitle(e){var t=this.root.querySelector(".lexdialogtitle");t&&(t.innerText=e)}}y.Dialog=A;class r extends A{static TOP=0;static BOTTOM=1;constructor(e,t,a={}){a.draggable=a.draggable??!1,a.closable=a.closable??!1;super(e,t,a);let n=this;if(y.addSignal("@on_branch_closed",this.panel,e=>{this.dock_pos==r.BOTTOM&&(this.root.style.top="calc(100% - "+(this.root.offsetHeight+3)+"px)")}),this.root.classList.add("pocket"),this.root.style.translate="none",this.root.style.top="0",this.root.style.left="unset",a.position||(this.root.style.right="3px",this.root.style.top="3px"),this.panel.root.style.width="calc( 100% - 12px )",this.panel.root.style.height="calc( 100% - 40px )",this.dock_pos=r.TOP,this.minimized=!1,this.title.tabIndex=-1,this.title.addEventListener("click",e=>{this.title._eventCatched?this.title._eventCatched=!1:(this.size&&(this.minimized?this.root.style.height=this.size[1]:this.root.style.height="auto"),this.root.classList.toggle("minimized"),this.minimized=!this.minimized,this.dock_pos==r.BOTTOM&&(n.root.style.top=this.root.classList.contains("minimized")?"calc(100% - "+(n.title.offsetHeight+6)+"px)":"calc(100% - "+(n.root.offsetHeight+3)+"px)"))}),!a.draggable){var i=a.float;if(i)for(var s=0;s<i.length;s++)switch(i[s]){case"b":this.root.style.top="calc(100% - "+(this.root.offsetHeight+3)+"px)";break;case"l":this.root.style.right="unset",this.root.style.left=a.position?a.position[1]:"3px"}this.root.classList.add("dockable"),this.title.addEventListener("keydown",function(e){e.ctrlKey&&(n.root.style.right="unset","ArrowLeft"==e.key?n.root.style.left="0px":"ArrowRight"==e.key?n.root.style.left="calc(100% - "+(n.root.offsetWidth+3)+"px)":"ArrowUp"==e.key?(n.root.style.top="0px",n.dock_pos=r.TOP):"ArrowDown"==e.key&&(n.root.style.top="calc(100% - "+(n.root.offsetHeight+3)+"px)",n.dock_pos=r.BOTTOM))})}}}y.PocketDialog=r;class s{constructor(e,t,a={}){document.body.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove()),this.root=document.createElement("div"),this.root.className="lexcontextmenu",this.root.style.left=e.x-48+document.scrollingElement.scrollLeft+"px",this.root.style.top=e.y-8+document.scrollingElement.scrollTop+"px",this.root.addEventListener("mouseleave",function(){this.remove()}),this.items=[],this.colors={},t&&((e={})[t]=[],e.className="cmtitle",e.icon=a.icon,this.items.push(e))}_adjustPosition(e,t,a=!1){var n=e.getBoundingClientRect();a?((a=window.innerWidth-n.right)<0&&(e.style.left=e.offsetLeft+(a-t)+"px"),(a=window.innerHeight-(n.top+n.height))<0&&(e.style.top=e.offsetTop+(a-t+20)+"px")):(a=n.width,n.left<0?e.style.left=t+"px":window.innerWidth-n.right<0&&(e.style.left=window.innerWidth-a-t+"px"),n.top<0?e.style.top=t+"px":n.top+n.height>window.innerHeight&&(e.style.top=window.innerHeight-n.height-t+"px"))}_createSubmenu(e,t,a,n){this.root.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove());var i=document.createElement("div");i.className="lexcontextmenu",a.appendChild(i);for(var s=0;s<e[t].length;++s){var l=e[t][s],r=Object.keys(l)[0];this._createEntry(l,r,i,n)}var o=a.getBoundingClientRect();i.style.left=o.width+"px",i.style.marginTop=3.5-a.offsetHeight+"px",this._adjustPosition(i,6,!0)}_createEntry(t,a,e,n){let i=t[a].length,s=document.createElement("div");s.className="lexmenuboxentry"+(t.className?" "+t.className:""),s.id=t.id??"eId"+c(a),s.innerHTML="";var l=t.icon;l&&(s.innerHTML+="<a class='"+l+" fa-sm'></a>");let r=t.disabled;s.innerHTML+="<div class='lexentryname"+(r?" disabled":"")+"'>"+a+"</div>",e.appendChild(s),this.colors[a]&&(s.style.borderColor=this.colors[a]),""==a?s.className+=" cmseparator":(s.addEventListener("click",e=>{e.stopPropagation(),e.stopImmediatePropagation(),r||((e=t.callback)&&(e.call(this,a,s),this.root.remove()),i&&"click"==y.OPEN_CONTEXTMENU_ENTRY&&this._createSubmenu(t,a,s,++n))}),i&&((l=document.createElement("a")).className="fa-solid fa-bars-staggered fa-xs",s.appendChild(l),"mouseover"==y.OPEN_CONTEXTMENU_ENTRY&&s.addEventListener("mouseover",e=>{s.built||(s.built=!0,this._createSubmenu(t,a,s,++n),e.stopPropagation())}),s.addEventListener("mouseleave",()=>{n=-1,e.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove())})))}onCreate(){m(()=>this._adjustPosition(this.root,6))}add(e,s={}){s.constructor==Function&&(s={callback:s});let l=(e+="").split("/");var t,a,e=l[l.length-1];this.colors[e]=s.color;let r=0,o=(n,e)=>{if(null!=n){let a=null;var t,i;e.forEach(e=>{var t=Object.keys(e).find(e=>e==n);t&&(a=e[t])}),a?o(l[r++],a):((t={})[n]=[],(i=l[r++])||(t.id=s.id,t.callback=s.callback,t.disabled=s.disabled??!1),e.push(t),o(i,t[n]))}},d=(o(l[r++],this.items),e=>{let t=Object.keys(e)[0];var a,n=e[t];if(n.length){null==n.find(e=>Object.keys(e)[0]==t)&&((n={})[t]=[],n.className="cmtitle",e[t].unshift(n));for(a of e[t])for(var i=Object.keys(a)[0],s=0;s<a[i].length;++s)d(a)}});for(t of this.items)d(t);for(a of this.items){var n=Object.keys(a)[0],i="eId"+c(n),i="#"+(a.id??i);this.root.querySelector(i)||this._createEntry(a,n,this.root,-1)}}setColor(e,t){"#"!==t[0]&&(t=u(t)),this.colors[e]=t}}function S(e,t,a,n){t=new s(t,e,n);return y.root.appendChild(t.root),a&&a(t),t.onCreate(),t}y.ContextMenu=s,y.addContextMenu=S;class D{constructor(e,t,a={}){let r=document.createElement("div"),o=(r.className="curve "+(a.className||""),r.style.minHeight="50px",r.style.width=a.width||"100%",r.style.minWidth="50px",r.style.minHeight="20px",r.bgcolor=a.bgColor||y.getThemeColor("global-intense-background"),r.pointscolor=a.pointsColor||y.getThemeColor("global-selected-light"),r.linecolor=a.lineColor||"#555",r.value=t||[],r.xrange=a.xrange||[0,1],r.yrange=a.yrange||[0,1],r.defaulty=null!=a.defaulty?a.defaulty:0,r.no_overlap=a.noOverlap||!1,r.show_samples=a.showSamples||0,r.allow_add_values=a.allowAddValues??!0,r.draggable_x=a.draggableX??!0,r.draggable_y=a.draggableY??!0,r.smooth=(a.smooth&&"number"==typeof a.smooth?a.smooth:.3)||!1,r.move_out=a.moveOutAction??y.CURVE_MOVEOUT_DELETE,y.addSignal("@on_new_color_scheme",(e,t)=>{r.bgcolor=a.bgColor||y.getThemeColor("global-intense-background"),r.pointscolor=a.pointsColor||y.getThemeColor("global-selected-light"),this.redraw()}),this.element=r,document.createElement("canvas"));function l(e){return[o.width*(e[0]-r.xrange[0])/r.xrange[1],o.height*(e[1]-r.yrange[0])/r.yrange[1]]}function d(e){return[e[0]*r.xrange[1]/o.width+r.xrange[0],e[1]*r.yrange[1]/o.height+r.yrange[0]]}o.width=a.width||200,o.height=a.height||50,r.appendChild(o),this.canvas=o,r.addEventListener("mousedown",function(e){document.addEventListener("mousemove",i),document.addEventListener("mouseup",u);var t=o.getBoundingClientRect(),a=e.clientX-t.left,t=e.clientY-t.top;{var n;c=((e,t)=>{for(var a=1e5,n=-1,i=0;i<r.value.length;i++){var s=l(r.value[i]),s=m([e,t],s);s<a&&s<8&&(a=s,n=i)}return n})(a,o.height-t),e.button==y.MOUSE_LEFT_CLICK&&-1==c&&r.allow_add_values&&(n=d([a,o.height-t]),r.value.push(n),g(),c=r.value.indexOf(n))}h=[a,t],r.redraw(),e.preventDefault(),e.stopPropagation()}),r.getValueAt=function(e){if(e<r.xrange[0]||e>r.xrange[1])return r.defaulty;for(var t=[r.xrange[0],r.defaulty],a=0,n=0;n<r.value.length;n+=1){var i=r.value[n];if(e==i[0])return i[1];if(e<i[0])return a=(e-t[0])/(i[0]-t[0]),t[1]*(1-a)+i[1]*a;t=i}return i=[r.xrange[1],r.defaulty],a=(e-t[0])/(i[0]-t[0]),t[1]*(1-a)+i[1]*a},r.resample=function(e){for(var t=[],a=(r.xrange[1]-r.xrange[0])/e,n=r.xrange[0];n<=r.xrange[1];n+=a)t.push(r.getValueAt(n));return t},r.addValue=function(e){for(var t=0;t<r.value;t++){var a=r.value[t];if(!(a[0]<e[0]))return r.value.splice(t,0,e),void redraw()}r.value.push(e),redraw()};var c=-1,h=(r.redraw=function(e={}){e.value&&(r.value=e.value),e.xrange&&(r.xrange=e.xrange),e.yrange&&(r.yrange=e.yrange),e.smooth&&(r.smooth=e.smooth);var e=o.parentElement.getBoundingClientRect(),t=((e=o.parentElement.parentElement?o.parentElement.parentElement.getBoundingClientRect():e)&&o.width!=e.width&&e.width&&e.width<1e3&&(o.width=e.width),o.getContext("2d")),a=(t.setTransform(1,0,0,1,0,0),t.translate(0,o.height),t.scale(1,-1),t.fillStyle=r.bgcolor,t.fillRect(0,0,o.width,o.height),t.strokeStyle=r.linecolor,t.beginPath(),l([r.xrange[0],r.defaulty])),n=(t.moveTo(a[0],a[1]),[a[0],a[1]]);for(i in r.value){a=l(r.value[i]);n.push(a[0]),n.push(a[1]),r.smooth||t.lineTo(a[0],a[1])}a=l([r.xrange[1],r.defaulty]),n.push(a[0]),n.push(a[1]),r.smooth?y.UTILS.drawSpline(t,n,r.smooth):(t.lineTo(a[0],a[1]),t.stroke());for(var i=0;i<r.value.length;i+=1)a=l(r.value[i]),t.fillStyle=c==i?"white":r.pointscolor,t.beginPath(),t.arc(a[0],a[1],c==i?4:3,0,2*Math.PI),t.fill();if(r.show_samples){var s=r.resample(r.show_samples);t.fillStyle="#888";for(i=0;i<s.length;i+=1)a=l([i*((r.xrange[1]-r.xrange[0])/r.show_samples)+r.xrange[0],s[i]]),t.beginPath(),t.arc(a[0],a[1],2,0,2*Math.PI),t.fill()}},[0,0]);function i(e){var t,a,n,i=o.getBoundingClientRect(),s=e.clientX-i.left,l=e.clientY-i.top,i=(s<0?s=0:s>o.width&&(s=o.width),l<0?l=0:l>o.height&&(l=o.height),[e.clientX-i.left,e.clientY-i.top]);-1!=c&&m(i,[s,l])>.5*o.height?(r.move_out==y.CURVE_MOVEOUT_DELETE?r.value.splice(c,1):(i=[i[0]-s,i[1]-l],(t=r.value[c])[0]=0==i[0]?t[0]:i[0]<0?r.xrange[0]:r.xrange[1],t[1]=0==i[1]?t[1]:i[1]<0?r.yrange[1]:r.yrange[0]),u(e)):(t=d([-(r.draggable_x?h[0]-s:0),r.draggable_y?h[1]-l:0]),-1!=c&&(i=r.xrange[0],a=r.xrange[1],r.no_overlap&&(0<c&&(i=r.value[c-1][0]),c<r.value.length-1)&&(a=r.value[c+1][0]),(n=r.value[c])[0]+=t[0],n[1]+=t[1],n[0]<i?n[0]=i:n[0]>a&&(n[0]=a),n[1]<r.yrange[0]?n[1]=r.yrange[0]:n[1]>r.yrange[1]&&(n[1]=r.yrange[1])),g(),r.redraw(),h[0]=s,h[1]=l,p(e),e.preventDefault(),e.stopPropagation())}function u(e){c=-1,r.redraw(),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",u),p(e),e.preventDefault(),e.stopPropagation()}function p(e){a.callback&&a.callback.call(r,r.value,e)}function m(e,t){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function g(){var e=null;-1!=c&&(e=r.value[c]),r.value.sort(function(e,t){return e[0]-t[0]}),e&&(c=r.value.indexOf(e))}return r.redraw(),this}redraw(e={}){this.element.redraw(e)}}y.Curve=D;class M{constructor(e,t,a={}){let r=document.createElement("div"),o=(r.className="dial "+(a.className||""),r.style.width=r.style.height=a.size||"100%",r.style.minWidth=r.style.minHeight="50px",r.bgcolor=a.bgColor||y.getThemeColor("global-dark-background"),r.pointscolor=a.pointsColor||y.getThemeColor("global-selected-light"),r.linecolor=a.lineColor||"#555",r.value=t||[],r.xrange=a.xrange||[0,1],r.yrange=a.yrange||[0,1],r.defaulty=null!=a.defaulty?a.defaulty:0,r.no_overlap=a.noOverlap||!1,r.show_samples=a.showSamples||0,r.allow_add_values=a.allowAddValues??!0,r.draggable_x=a.draggableX??!0,r.draggable_y=a.draggableY??!0,r.smooth=(a.smooth&&"number"==typeof a.smooth?a.smooth:.3)||!1,r.move_out=a.moveOutAction??y.CURVE_MOVEOUT_DELETE,this.element=r,document.createElement("canvas"));function l(e){return Math.pow(e[0],2),[o.width*(e[0]-r.xrange[0])/r.xrange[1],o.height*(e[1]-r.yrange[0])/r.yrange[1]]}function d(e){return[e[0]*r.xrange[1]/o.width+r.xrange[0],e[1]*r.yrange[1]/o.height+r.yrange[0]]}o.width=o.height=a.size||200,r.appendChild(o),this.canvas=o,r.addEventListener("mousedown",function(e){document.addEventListener("mousemove",i),document.addEventListener("mouseup",u);var t=o.getBoundingClientRect(),a=e.clientX-t.left,t=e.clientY-t.top;{var n;c=((e,t)=>{for(var a=1e5,n=-1,i=0;i<r.value.length;i++){var s=l(r.value[i]),s=m([e,t],s);s<a&&s<8&&(a=s,n=i)}return n})(a,o.height-t),e.button==y.MOUSE_LEFT_CLICK&&-1==c&&r.allow_add_values&&(n=d([a,o.height-t]),r.value.push(n),g(),c=r.value.indexOf(n))}h=[a,t],r.redraw(),e.preventDefault(),e.stopPropagation()}),r.getValueAt=function(e){if(e<r.xrange[0]||e>r.xrange[1])return r.defaulty;for(var t=[r.xrange[0],r.defaulty],a=0,n=0;n<r.value.length;n+=1){var i=r.value[n];if(e==i[0])return i[1];if(e<i[0])return a=(e-t[0])/(i[0]-t[0]),t[1]*(1-a)+i[1]*a;t=i}return i=[r.xrange[1],r.defaulty],a=(e-t[0])/(i[0]-t[0]),t[1]*(1-a)+i[1]*a},r.resample=function(e){for(var t=[],a=(r.xrange[1]-r.xrange[0])/e,n=r.xrange[0];n<=r.xrange[1];n+=a)t.push(r.getValueAt(n));return t},r.addValue=function(e){for(var t=0;t<r.value;t++){var a=r.value[t];if(!(a[0]<e[0]))return r.value.splice(t,0,e),void redraw()}r.value.push(e),redraw()};var c=-1,h=(r.redraw=function(e={}){e.value&&(r.value=e.value),e.xrange&&(r.xrange=e.xrange),e.yrange&&(r.yrange=e.yrange),e.smooth&&(r.smooth=e.smooth);var e=o.parentElement.getBoundingClientRect(),t=((e=o.parentElement.parentElement?o.parentElement.parentElement.getBoundingClientRect():e)&&o.width!=e.width&&e.width&&e.width<1e3&&(o.width=e.width),o.getContext("2d")),a=(t.setTransform(1,0,0,1,0,0),t.translate(0,o.height),t.scale(1,-1),t.fillStyle=r.bgcolor,t.fillRect(0,0,o.width,o.height),t.strokeStyle=r.linecolor,t.beginPath(),l([r.xrange[0],r.defaulty])),n=(t.moveTo(a[0],a[1]),[a[0],a[1]]);for(i in r.value){a=l(r.value[i]);n.push(a[0]),n.push(a[1])}a=l([r.xrange[1],r.defaulty]),n.push(a[0]),n.push(a[1]);a=l([0,0]),t.fillStyle="gray",t.beginPath(),t.arc(a[0],a[1],3,0,2*Math.PI),t.fill();for(var i=0;i<r.value.length;i+=1)a=l(r.value[i]),t.fillStyle=c==i?"white":r.pointscolor,t.beginPath(),t.arc(a[0],a[1],c==i?4:3,0,2*Math.PI),t.fill();if(r.show_samples){var s=r.resample(r.show_samples);t.fillStyle="#888";for(i=0;i<s.length;i+=1)a=l([i*((r.xrange[1]-r.xrange[0])/r.show_samples)+r.xrange[0],s[i]]),t.beginPath(),t.arc(a[0],a[1],2,0,2*Math.PI),t.fill()}},[0,0]);function i(e){var t,a,n,i=o.getBoundingClientRect(),s=e.clientX-i.left,l=e.clientY-i.top,i=(s<0?s=0:s>o.width&&(s=o.width),l<0?l=0:l>o.height&&(l=o.height),[e.clientX-i.left,e.clientY-i.top]);-1!=c&&m(i,[s,l])>.5*o.height?(r.move_out==y.CURVE_MOVEOUT_DELETE?r.value.splice(c,1):(i=[i[0]-s,i[1]-l],(t=r.value[c])[0]=0==i[0]?t[0]:i[0]<0?r.xrange[0]:r.xrange[1],t[1]=0==i[1]?t[1]:i[1]<0?r.yrange[1]:r.yrange[0]),u(e)):(t=d([-(r.draggable_x?h[0]-s:0),r.draggable_y?h[1]-l:0]),-1!=c&&(i=r.xrange[0],a=r.xrange[1],r.no_overlap&&(0<c&&(i=r.value[c-1][0]),c<r.value.length-1)&&(a=r.value[c+1][0]),(n=r.value[c])[0]+=t[0],n[1]+=t[1],n[0]<i?n[0]=i:n[0]>a&&(n[0]=a),n[1]<r.yrange[0]?n[1]=r.yrange[0]:n[1]>r.yrange[1]&&(n[1]=r.yrange[1])),g(),r.redraw(),h[0]=s,h[1]=l,p(e),e.preventDefault(),e.stopPropagation())}function u(e){c=-1,r.redraw(),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",u),p(e),e.preventDefault(),e.stopPropagation()}function p(e){a.callback&&a.callback.call(r,r.value,e)}function m(e,t){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function g(){var e=null;-1!=c&&(e=r.value[c]),r.value.sort(function(e,t){return e[0]-t[0]}),e&&(c=r.value.indexOf(e))}return r.redraw(),this}redraw(e={}){this.element.redraw(e)}}y.Dial=M;class P{static NONE=0;static ASSET_SELECTED=1;static ASSET_DELETED=2;static ASSET_RENAMED=3;static ASSET_CLONED=4;static ASSET_DBLCLICKED=5;static ENTER_FOLDER=6;static ASSET_CHECKED=7;constructor(e,t,a){this.type=e||L.NONE,this.item=t,this.value=a,this.multiple=!1}string(){switch(this.type){case P.NONE:return"assetview_event_none";case P.ASSET_SELECTED:return"assetview_event_selected";case P.ASSET_DELETED:return"assetview_event_deleted";case P.ASSET_RENAMED:return"assetview_event_renamed";case P.ASSET_CLONED:return"assetview_event_cloned";case P.ASSET_DBLCLICKED:return"assetview_event_dblclicked";case P.ENTER_FOLDER:return"assetview_event_enter_folder";case P.ASSET_CHECKED:return"assetview_event_checked"}}}y.AssetViewEvent=P;class O{static LAYOUT_CONTENT=0;static LAYOUT_LIST=1;static MAX_PAGE_ELEMENTS=50;constructor(e={}){this.rootPath="https://raw.githubusercontent.com/jxarco/lexgui.js/master/",this.layout=e.layout??O.LAYOUT_CONTENT,this.contentPage=1,e.rootPath&&(e.rootPath.constructor!==String?console.warn("Asset Root Path must be a String (now is "+path.constructor.name+")"):this.rootPath=e.rootPath);var t=document.createElement("div"),a=(t.className="lexassetbrowser",this.root=t,new y.Area({height:"100%"}));t.appendChild(a.root);let n,i,s=a;this.skipBrowser=e.skipBrowser??!1,this.skipPreview=e.skipPreview??!1,this.useNativeTitle=e.useNativeTitle??!1,this.onlyFolders=e.onlyFolders??!0,this.allowMultipleSelection=e.allowMultipleSelection??!1,this.previewActions=e.previewActions??[],this.contextMenu=e.contextMenu??[],this.onRefreshContent=e.onRefreshContent,this.skipBrowser||([n,i]=a.split({type:"horizontal",sizes:["15%","85%"]}),s=i,n.setLimitBox(210,0),i.setLimitBox(512,0)),this.skipPreview||([s,i]=s.split({type:"horizontal",sizes:["80%","20%"]})),this.allowedTypes=e.allowedTypes||["None","Image","Mesh","Script","JSON","Clip"],this.prevData=[],this.nextData=[],this.data=[],this._processData(this.data,null),this.currentData=this.data,this.path=["@"],this.skipBrowser||this._createTreePanel(n),this._createContentPanel(s),this.skipPreview||(this.previewPanel=i.addPanel({className:"lexassetcontentpanel",style:{overflow:"scroll"}}))}load(e,t){this.prevData.length=0,this.nextData.length=0,this.data=e,this._processData(this.data,null),this.currentData=this.data,this.path=["@"],this.skipBrowser||this._createTreePanel(this.area),this._refreshContent(),this.onevent=t}clear(){this.previewPanel&&this.previewPanel.clear(),this.leftPanel&&this.leftPanel.clear(),this.rightPanel&&this.rightPanel.clear()}_processData(e,t){e.constructor!==Array&&(e.folder=t,e.children=e.children??[]);for(var a=e.constructor===Array?e:e.children,n=0;n<a.length;++n)this._processData(a[n],e)}_updatePath(e){this.path.length=0;let t=e=>{e&&(e=(e.children||e)[0])&&e.folder&&(this.path.push(e.folder.id??"@"),t(e.folder.folder))};t(e),y.emit("@on_folder_change",this.path.reverse().join("/"))}_createTreePanel(e){this.leftPanel?this.leftPanel.clear():this.leftPanel=e.addPanel({className:"lexassetbrowserpanel"});e={id:"/",children:this.data};this.tree=this.leftPanel.addTree("Content Browser",e,{filter:!1,onlyFolders:this.onlyFolders,onevent:e=>{var t=e.node,a=e.value;switch(e.type){case y.TreeEvent.NODE_SELECTED:e.multiple||this._enterFolder(t),t.parent||(this.prevData.push(this.currentData),this.currentData=this.data,this._refreshContent(),this.path=["@"],y.emit("@on_folder_change",this.path.join("/")));break;case y.TreeEvent.NODE_DRAGGED:t.folder=a,this._refreshContent()}}})}_setContentLayout(e){this.layout=e,this._refreshContent()}_createContentPanel(e){this.rightPanel?this.rightPanel.clear():this.rightPanel=e.addPanel({className:"lexassetcontentpanel"});e=(e,t)=>{var a;this.allowNextPage&&(a=this.contentPage,this.contentPage+=e,this.contentPage=Math.min(this.contentPage,1+((this.currentData.length-1)/O.MAX_PAGE_ELEMENTS|0)),this.contentPage=Math.max(this.contentPage,1),a!=this.contentPage)&&this._refreshContent()};this.rightPanel.sameLine(),this.rightPanel.addDropdown("Filter",this.allowedTypes,this.allowedTypes[0],e=>this._refreshContent.call(this,null,e),{width:"30%",minWidth:"128px"}),this.rightPanel.addText(null,this.searchValue??"",e=>this._refreshContent.call(this,e,null),{placeholder:"Search assets.."}),this.rightPanel.addButton(null,"<a class='fa fa-arrow-up-short-wide'></a>",((e,t)=>{var t=S("Sort by",t,e=>{e.add("Name",()=>this._sortData("id")),e.add("Type",()=>this._sortData("type")),e.add(""),e.add("Ascending",()=>this._sortData()),e.add("Descending",()=>this._sortData(null,!0))}),a=this.parent.root.parentElement;a.classList.contains("lexdialog")&&(t.root.style.zIndex=+getComputedStyle(a).zIndex+1)}).bind(this),{className:"micro",title:"Sort"}),this.rightPanel.addButton(null,"<a class='fa-solid fa-grip'></a>",((e,t)=>{var t=S("Layout",t,e=>{e.add("Content",()=>this._setContentLayout(O.LAYOUT_CONTENT)),e.add(""),e.add("List",()=>this._setContentLayout(O.LAYOUT_LIST))}),a=this.parent.root.parentElement;a.classList.contains("lexdialog")&&(t.root.style.zIndex=+getComputedStyle(a).zIndex+1)}).bind(this),{className:"micro",title:"View"}),this.rightPanel.addButton(null,"<a class='fa-solid fa-angles-left'></a>",e.bind(this,-1),{className:"micro",title:"Previous Page"}),this.rightPanel.addButton(null,"<a class='fa-solid fa-angles-right'></a>",e.bind(this,1),{className:"micro",title:"Next Page"}),this.rightPanel.endLine(),this.skipBrowser||(this.rightPanel.sameLine(),this.rightPanel.addComboButtons(null,[{value:"Left",icon:"fa-solid fa-left-long",callback:e=>{this.prevData.length&&(this.nextData.push(this.currentData),this.currentData=this.prevData.pop(),this._refreshContent(),this._updatePath(this.currentData))}},{value:"Right",icon:"fa-solid fa-right-long",callback:e=>{this.nextData.length&&(this.prevData.push(this.currentData),this.currentData=this.nextData.pop(),this._refreshContent(),this._updatePath(this.currentData))}},{value:"Refresh",icon:"fa-solid fa-arrows-rotate",callback:e=>{this._refreshContent()}}],{width:"20%",minWidth:"164px",noSelection:!0}),this.rightPanel.addText(null,this.path.join("/"),null,{width:"70%",maxWidth:"calc(70% - 64px)",minWidth:"164px",disabled:!0,signal:"@on_folder_change",style:{fontWeight:"bolder",fontSize:"16px",color:"#aaa"}}),this.rightPanel.addText(null,"Page "+this.contentPage+" / "+(1+((this.currentData.length-1)/O.MAX_PAGE_ELEMENTS|0)),null,{disabled:!0,signal:"@on_page_change",width:"fit-content"}),this.rightPanel.endLine()),this.content=document.createElement("ul"),this.content.className="lexassetscontent",this.rightPanel.root.appendChild(this.content),this.content.addEventListener("dragenter",function(e){e.preventDefault(),this.classList.add("dragging")}),this.content.addEventListener("dragleave",function(e){e.preventDefault(),this.classList.remove("dragging")}),this.content.addEventListener("drop",e=>{e.preventDefault(),this._processDrop(e)}),this.content.addEventListener("click",function(){this.querySelectorAll(".lexassetitem").forEach(e=>e.classList.remove("selected"))}),this._refreshContent()}_refreshContent(a,n){let o=this.layout==O.LAYOUT_CONTENT,s=(this.filter=n??this.filter??"None",this.searchValue=a??this.searchValue??"",this.content.innerHTML="",this.content.className=o?"lexassetscontent":"lexassetscontent list",this);let i=new FileReader;var l=this.currentData.filter(e=>("None"==this.filter||e.type.toLowerCase()==this.filter.toLowerCase())&&e.id.toLowerCase().includes(this.searchValue.toLowerCase())),t=((n||a)&&(this.contentPage=1),(this.contentPage-1)*O.MAX_PAGE_ELEMENTS),r=Math.min(t+O.MAX_PAGE_ELEMENTS,l.length);for(let e=t;e<r;++e){let t=l[e];t.path?y.request({url:t.path,dataType:"blob",success:e=>{t.bytesize=e.size,i.readAsDataURL(e),i.onload=e=>{t.src=e.currentTarget.result,t._path=t.path,delete t.path,this._refreshContent(a,n)}}}):t.domEl=(n=>{var e=n.type.charAt(0).toUpperCase()+n.type.slice(1),t=d(n.id);let a="Folder"===e,r=document.createElement("li");if(r.className="lexassetitem "+n.type.toLowerCase(),r.tabIndex=-1,s.content.appendChild(r),s.useNativeTitle)r.title=e+": "+n.id;else{let l=document.createElement("span");l.className="lexitemdesc",l.innerHTML="File: "+n.id+"<br>Type: "+e,s.content.appendChild(l),r.addEventListener("mousemove",t=>{if(o){var a=r.getBoundingClientRect(),n=t.target.getBoundingClientRect(),i=l.parentElement.getBoundingClientRect(),s=n.x-i.x-(n.x-a.x);let e=n.y-i.y-(n.y-a.y);t.target.classList.contains("lexassettitle")&&(e+=n.y-a.y),l.style.left=s+t.offsetX+12+"px",l.style.top=e+t.offsetY+"px"}}),r.addEventListener("mouseenter",()=>{o&&(l.style.display="unset")}),r.addEventListener("mouseleave",()=>{o&&setTimeout(()=>{l.style.display="none"},100)})}s.allowMultipleSelection&&((i=document.createElement("input")).type="checkbox",i.className="lexcheckbox",i.checked=n.selected,i.addEventListener("change",(e,t)=>{var a;n.selected=!n.selected,s.onevent&&((a=new P(P.ASSET_CHECKED,e.shiftKey?[n]:n)).multiple=!!e.shiftKey,s.onevent(a)),e.stopPropagation(),e.stopImmediatePropagation()}),r.appendChild(i));var i=document.createElement("span");if(i.className="lexassettitle",i.innerText=n.id,r.appendChild(i),!s.skipPreview){let e=null;n.src&&(-1<["png","jpg"].indexOf(d(n.src))||n.src.includes("data:image/"))||a||!o?(e=document.createElement("img"),i=n.unknown_extension?s.rootPath+"images/file.png":a?s.rootPath+"images/folder.png":n.src,e.src=o||a?i:s.rootPath+"images/file.png",r.appendChild(e)):((e=document.createElement("svg")).className="asset-file-preview",r.appendChild(e),i=document.createElement("text"),e.appendChild(i),i.innerText=t&&t!=n.id?"."+t.toUpperCase():n.type.toUpperCase(),(t=2.5/i.innerText.length)<1&&(i.style.fontSize=64*t+"px",e.style.paddingTop="calc(50% - "+(.5*i.offsetHeight+10)+"px)"))}return a||((t=document.createElement("span")).className="lexassetinfo",t.innerText=e,r.appendChild(t)),r.addEventListener("click",function(e){e.stopImmediatePropagation(),e.stopPropagation();var t=e.detail==y.MOUSE_DOUBLE_CLICK;if(t){if(a)return void s._enterFolder(n)}else e.shiftKey||s.content.querySelectorAll(".lexassetitem").forEach(e=>e.classList.remove("selected")),this.classList.add("selected"),s.selectedItem=n,s.skipPreview||s._previewAsset(n);s.onevent&&((t=new P(t?P.ASSET_DBLCLICKED:P.ASSET_SELECTED,e.shiftKey?[n]:n)).multiple=!!e.shiftKey,s.onevent(t))}),s.contextMenu&&r.addEventListener("contextmenu",function(e){e.preventDefault();let t=s.content.querySelectorAll(".selected").length;y.addContextMenu(1<t?t+" selected":a?n.id:n.type,e,e=>{t<=1&&e.add("Rename"),a||e.add("Clone",s._cloneItem.bind(s,n)),t<=1&&e.add("Properties"),e.add(""),e.add("Delete",s._deleteItem.bind(s,n))})}),r.addEventListener("dragstart",function(e){e.preventDefault()},!1),r})(t)}this.allowNextPage=l.length-1>O.MAX_PAGE_ELEMENTS,y.emit("@on_page_change","Page "+this.contentPage+" / "+(1+((l.length-1)/O.MAX_PAGE_ELEMENTS|0))),this.onRefreshContent&&this.onRefreshContent(a,n)}_previewAsset(e){var t,a=e.src&&e.src.includes("data:image/"),a=(this.previewPanel.clear(),this.previewPanel.branch("Asset"),("image"==e.type||e.src)&&(-1<["png","jpg"].indexOf(d(e.src))||a)&&this.previewPanel.addImage(e.src,{style:{width:"100%"}}),{disabled:!0}),a=(this.previewPanel.addText("Filename",e.id,null,a),e.lastModified&&this.previewPanel.addText("Last Modified",new Date(e.lastModified).toLocaleString(),null,a),(e._path||e.src)&&this.previewPanel.addText("URL",e._path||e.src,null,a),this.previewPanel.addText("Path",this.path.join("/"),null,a),this.previewPanel.addText("Type",e.type,null,a),e.bytesize&&this.previewPanel.addText("Size",(e.bytesize/1024).toPrecision(3)+" KBs",null,a),"folder"==e.type&&this.previewPanel.addText("Files",e.children?e.children.length.toString():"0",null,a),this.previewPanel.addSeparator(),[...this.previewActions]);a.length||a.push({name:"Download",callback:()=>y.downloadURL(e.src,e.id)});for(t of a)t.type&&t.type!==e.type||t.path&&t.path!==this.path.join("/")||this.previewPanel.addButton(null,t.name,t.callback.bind(this,e));this.previewPanel.merge()}_processDrop(e){var t=new FileReader;let s=e.dataTransfer.files.length;for(let i=0;i<e.dataTransfer.files.length;++i){let n=e.dataTransfer.files[i];this.currentData.find(e=>e.id===n.name)||(t.readAsDataURL(n),t.onload=e=>{var t=n.name.substr(n.name.lastIndexOf(".")+1).toLowerCase(),a={id:n.name,src:e.currentTarget.result,extension:t,lastModified:n.lastModified};switch(t){case"png":case"jpg":a.type="image";break;case"js":case"css":a.type="script";break;case"json":a.type="json";break;case"obj":a.type="mesh";break;default:a.type=t,a.unknown_extension=!0}this.currentData.push(a),i==s-1&&(this._refreshContent(),this.skipBrowser||this.tree.refresh())})}}_sortData(n,i=!1){n=n??this._lastSortBy??"id",this.currentData=this.currentData.sort((e,t)=>{var a=i?t[n].localeCompare(e[n]):e[n].localeCompare(t[n]);return a=0==a?i?t.id.localeCompare(e.id):e.id.localeCompare(t.id):a}),this._lastSortBy=n,this._refreshContent()}_enterFolder(e){this.prevData.push(this.currentData),this.currentData=e.children,this.contentPage=1,this._refreshContent(),this._updatePath(this.currentData),this.onevent&&(e=new P(P.ENTER_FOLDER,e),this.onevent(e))}_deleteItem(e){var t=this.currentData.indexOf(e);t<0?console.error("[AssetView Error] Cannot delete. Item not found."):(this.currentData.splice(t,1),this._refreshContent(this.searchValue,this.filter),this.onevent&&(t=new P(P.ASSET_DELETED,e),this.onevent(t)),this.tree.refresh(),this._processData(this.data))}_cloneItem(e){var t,a=this.currentData.indexOf(e);a<0||(delete e.domEl,delete e.folder,t=g(e),this.currentData.splice(a,0,t),this._refreshContent(this.searchValue,this.filter),this.onevent&&(a=new P(P.ASSET_CLONED,e),this.onevent(a)),this._processData(this.data))}}y.AssetView=O,Object.assign(y,{request(n){var e=n.dataType||"text",t=("json"==e||"xml"==e?e="text":"binary"==e&&(e="arraybuffer",n.mimeType="application/octet-stream"),new XMLHttpRequest),a=(t.open(n.data?"POST":"GET",n.url,!0),e&&(t.responseType=e),n.mimeType&&t.overrideMimeType(n.mimeType),n.nocache&&t.setRequestHeader("Cache-Control","no-cache"),t.onload=function(e){var t,a=this.response;if(200!=this.status)t="Error "+this.status,n.error&&n.error(t);else{if("json"==n.dataType)try{a=JSON.parse(a)}catch(t){if(!n.error)throw t;n.error(t)}else if("xml"==n.dataType)try{a=(new DOMParser).parseFromString(a,"text/xml")}catch(t){if(!n.error)throw t;n.error(t)}n.success&&n.success.call(this,a,this)}},t.onerror=function(e){n.error&&n.error(e)},new FormData);if(n.data)for(var i in n.data)a.append(i,n.data[i]);return t.send(a),t},requestText(e,t,a){return this.request({url:e,dataType:"text",success:t,error:a})},requestJSON(e,t,a){return this.request({url:e,dataType:"json",success:t,error:a})},requestBinary(e,t,a){return this.request({url:e,dataType:"binary",success:t,error:a})},requireScript(e,t,a,n,i){if(!e)throw"invalid URL";var s,l=(e=e.constructor===String?[e]:e).length,r=[];for(s in e){var o=document.createElement("script");o.num=s,o.type="text/javascript",o.src=e[s]+(i?"?version="+i:""),o.original_src=e[s],o.async=!1,o.onload=function(e){l--,r.push(this),l?n&&n(this.original_src,this.num):t&&t(r)},a&&(o.onerror=function(e){a(e,this.original_src,this.num)}),document.getElementsByTagName("head")[0].appendChild(o)}},downloadURL(e,a){function t(e){var t=document.createElement("a");t.href=e,t.download=a,document.body.appendChild(t),t.click(),document.body.removeChild(t)}let n=new FileReader;e.includes("http")?y.request({url:e,dataType:"blob",success:e=>{n.readAsDataURL(e),n.onload=e=>{t(e.currentTarget.result)}}}):t(e)},downloadFile:function(e,t,a){var n,i;t?(a=a||(t.constructor===String?"text/plain":"application/octet-stream"),n=null,n=t.constructor!==File&&t.constructor!==Blob?new Blob([t],{type:a}):t,i=URL.createObjectURL(n),(a=document.createElement("a")).setAttribute("href",i),a.setAttribute("download",e),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(function(){URL.revokeObjectURL(i)},6e4)):console.warn("No file provided to download")}}),Object.defineProperty(String.prototype,"lastChar",{get:function(){return this[this.length-1]},enumerable:!0,configurable:!0}),Element.prototype.insertChildAtIndex=function(e,t=1/0){t>=this.children.length?this.appendChild(e):this.insertBefore(e,this.children[t])},Element.prototype.hasClass=function(e){return!!(e=[].concat(e)).filter(e=>this.classList.contains(e)).length},Element.prototype.addClass=function(e){e&&this.classList.add(e)},Element.prototype.getComputedSize=function(){var e=getComputedStyle(this);return{width:this.offsetWidth+e.getPropertyValue("marginLeft")+e.getPropertyValue("marginRight"),height:this.offsetHeight+e.getPropertyValue("marginTop")+e.getPropertyValue("marginBottom")}},Element.prototype.getParentArea=function(){let e=this.parentElement;for(;e;){if(e.classList.contains("lexarea"))return e;e=e.parentElement}},y.ICONS={Sidebar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_iconCarrier"> <g id="Complete"> <g id="sidebar-left"> <g> <rect id="Square-2" data-name="Square" x="3" y="3" width="18" height="18" rx="2" ry="2" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="2"></rect> <line x1="9" y1="21" x2="9" y2="3" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="2"></line> </g> </g> </g> </g></svg>',More:'<svg fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_iconCarrier"> <g id="Complete"> <g id="F-More"> <path id="Vertical" d="M12,16a2,2,0,1,1-2,2A2,2,0,0,1,12,16ZM10,6a2,2,0,1,0,2-2A2,2,0,0,0,10,6Zm0,6a2,2,0,1,0,2-2A2,2,0,0,0,10,12Z"></path> </g> </g> </g></svg>',MoreHorizontal:'<svg fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_iconCarrier"> <g id="Complete"> <g id="F-More"> <path id="Horizontal" d="M8,12a2,2,0,1,1-2-2A2,2,0,0,1,8,12Zm10-2a2,2,0,1,0,2,2A2,2,0,0,0,18,10Zm-6,0a2,2,0,1,0,2,2A2,2,0,0,0,12,10Z"></path> </g> </g> </g></svg>',MenuArrows:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#000000" transform="rotate(90)"><g id="SVGRepo_iconCarrier"> <g id="Complete"> <g id="Code"> <g> <polyline id="Right-2" data-name="Right" points="15.5 7 20.5 12 15.5 17" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></polyline> <polyline id="Left-2" data-name="Left" points="8.5 7 3.5 12 8.5 17" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></polyline> </g> </g> </g> </g></svg>',Plus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#000000"<g id="SVGRepo_iconCarrier"> <g id="Complete"> <g id="add-2" data-name="add"> <g> <line x1="12" y1="19" x2="12" y2="5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></line> <line x1="5" y1="12" x2="19" y2="12" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></line> </g> </g> </g> </g></svg>',Down:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#000000"><g id="SVGRepo_iconCarrier"> <title>i</title> <g id="Complete"> <g id="F-Chevron"> <polyline id="Down" points="5 8.5 12 15.5 19 8.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></polyline> </g> </g> </g></svg>',Up:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#000000"><g id="SVGRepo_iconCarrier"> <title>i</title> <g id="Complete"> <g id="F-Chevron"> <polyline id="Up" points="5 15.5 12 8.5 19 15.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></polyline> </g> </g> </g></svg>',Right:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#000000"><g id="SVGRepo_iconCarrier"> <title>i</title> <g id="Complete"> <g id="F-Chevron"> <polyline id="Right" points="8.5 5 15.5 12 8.5 19" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></polyline> </g> </g> </g></svg>',Left:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#000000"><g id="SVGRepo_iconCarrier"> <title>i</title> <g id="Complete"> <g id="F-Chevron"> <polyline id="Left" points="15.5 5 8.5 12 15.5 19" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></polyline> </g> </g> </g></svg>'},y.UTILS={getTime(){return(new Date).getTime()},compareThreshold(e,t,a,n){return Math.abs(e-t)>=n||Math.abs(e-a)>=n},compareThresholdRange(e,t,a,n){return a<=e&&e<=n||a<=t&&t<=n||e<=a&&n<=t},uidGenerator:b,deleteElement(e){e&&e.remove()},flushCss(e){e.offsetHeight},getControlPoints(e,t,a,n,i,s,l){var r=Math.sqrt(Math.pow(a-e,2)+Math.pow(n-t,2)),r=l*r/(r+Math.sqrt(Math.pow(i-a,2)+Math.pow(s-n,2))),l=l-r;return[a+r*(e-i),n+r*(t-s),a-l*(e-i),n-l*(t-s)]},drawSpline(e,t,a){e.save();for(var n=[],i=t.length,s=0;s<i-4;s+=2)n=n.concat(y.UTILS.getControlPoints(t[s],t[s+1],t[s+2],t[s+3],t[s+4],t[s+5],a));for(s=2;s<t.length-5;s+=2)e.beginPath(),e.moveTo(t[s],t[s+1]),e.bezierCurveTo(n[2*s-2],n[2*s-1],n[2*s],n[2*s+1],t[s+2],t[s+3]),e.stroke(),e.closePath();e.beginPath(),e.moveTo(t[0],t[1]),e.quadraticCurveTo(n[0],n[1],t[2],t[3]),e.stroke(),e.closePath(),e.beginPath(),e.moveTo(t[i-2],t[i-1]),e.quadraticCurveTo(n[2*i-10],n[2*i-9],t[i-4],t[i-3]),e.stroke(),e.closePath(),e.restore()}};export{y as LX};
1
+ var b={version:"0.5.1",ready:!1,components:[],signals:{},extraCommandbarEntries:[],activeDraggable:null};function g(e,t,s){return Math.min(Math.max(e,t),s)}function f(e,t){return 0==t?Math.floor(e):+e.toFixed(t??2).replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1")}function h(e,t,s,a,l){return(e-t)*(l-a)/(s-t)+a}b.MOUSE_LEFT_CLICK=0,b.MOUSE_MIDDLE_CLICK=1,b.MOUSE_RIGHT_CLICK=2,b.MOUSE_DOUBLE_CLICK=2,b.MOUSE_TRIPLE_CLICK=3,b.CURVE_MOVEOUT_CLAMP=0,b.CURVE_MOVEOUT_DELETE=1,b.DRAGGABLE_Z_INDEX=101,b.clamp=g,b.round=f,b.remapRange=h,"undefined"!=typeof performance?b.getTime=performance.now.bind(performance):"undefined"!=typeof Date&&Date.now?b.getTime=Date.now.bind(Date):"undefined"!=typeof process?b.getTime=function(){var e=process.hrtime();return.001*e[0]+1e-6*e[1]}:b.getTime=function(){return(new Date).getTime()};function x(e,t){setTimeout(e,t??0)}function d(e){return e.replace(/\s/g,"").replaceAll("@","_").replaceAll("+","_plus_").replaceAll(".","")}function c(e){return e.includes(".")?e.split(".").pop():null}function v(e){return JSON.parse(JSON.stringify(e))}function o(e){return[parseInt(e.substring(1,3),16)/255,parseInt(e.substring(3,5),16)/255,parseInt(e.substring(5,7),16)/255]}function s(e){let t="#";for(var s of e)s=Math.floor(255*s),t+=s.toString(16);return t}function u(e,t=8){var s=document.createElement("span"),e=(s.className="lexinputmeasure",s.innerHTML=e,document.body.appendChild(s),s.getBoundingClientRect());return b.UTILS.deleteElement(s),e.width+t}function L(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()}function p(i,t={}){let n=0,r=0,a=null,s=t.targetClass,o=t.dragMargin??3,l=(e,t,s)=>{var a=i.parentElement?i.parentElement.getBoundingClientRect():{x:0,y:0,width:0,height:0},l="fixed"==i.style.position?new b.vec2(a.x,a.y):new b.vec2;s=s??e.clientX-n-a.x,t=t??e.clientY-r-a.y,i.style.left=g(s,o+l.x,l.x+a.width-i.offsetWidth-o)+"px",i.style.top=g(t,o+l.y,l.y+a.height-i.offsetHeight-o)+"px",i.style.translate="none"};t.autoAdjust&&l(null,parseInt(i.style.left),parseInt(i.style.top));var e=b.UTILS.uidGenerator();i["draggable-id"]=e;let c=t.onMove?e=>{a&&t.onMove&&t.onMove(a)}:e=>{a&&l(e)},d=t.onDragStart;i.setAttribute("draggable",!0),i.addEventListener("mousedown",function(e){a=e.target.classList.contains(s)||!s?e.target:null}),i.addEventListener("dragstart",function(e){var t,s;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a&&((t=new Image).src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",e.dataTransfer.setDragImage(t,0,0),e.dataTransfer.effectAllowed="move",t=e.target.getBoundingClientRect(),s=a.parentElement.getBoundingClientRect(),s="fixed"==a.style.position?new b.vec2(s.x,s.y):new b.vec2,n=e.clientX-t.x-s.x,r=e.clientY-t.y-s.y,document.addEventListener("mousemove",c),a.eventCatched=!0,b.activeDraggable&&(b.activeDraggable.style.zIndex=b.DRAGGABLE_Z_INDEX),b.activeDraggable=i,b.activeDraggable.style.zIndex=b.DRAGGABLE_Z_INDEX+1,d)&&d(a,e)},!1),document.addEventListener("mouseup",e=>{a&&(a=null,document.removeEventListener("mousemove",c))})}b.doAsync=x,b.getSupportedDOMName=d,b.has=function(e){return-1<b.components.indexOf(e)},b.getExtension=c,b.deepCopy=v,b.setTheme=function(e){e="light"==e?"light":"dark",document.documentElement.setAttribute("data-theme",e),b.emit("@on_new_color_scheme",e)},b.setThemeColor=function(e,t){document.querySelector(":root").style.setProperty("--"+e,t)},b.getThemeColor=function(e){var t=getComputedStyle(document.querySelector(":root"));return(e=t.getPropertyValue("--"+e)).includes("light-dark")?("light"==t.getPropertyValue("color-scheme")?e.substring(e.indexOf("(")+1,e.indexOf(",")):e.substring(e.indexOf(",")+1,e.indexOf(")"))).replace(/\s/g,""):e},b.getBase64Image=function(e){var t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t.toDataURL("image/png")},b.hexToRgb=o,b.rgbToHex=s,b.measureRealWidth=u,b.guidGenerator=L,b.buildTextPattern=function(e={}){var t=[],s=(e.lowercase&&t.push("(?=.*[a-z])"),e.uppercase&&t.push("(?=.*[A-Z])"),e.digit&&t.push("(?=.*\\d)"),e.specialChar&&t.push("(?=.*[@#$%^&+=!])"),e.noSpaces&&t.push("(?!.*\\s)"),e.minLength||0),a=e.maxLength||"",t=`^${t.join("")}.{${s},${a}}$`;return e.asRegExp?new RegExp(t):t},b.makeDraggable=p,b.makeCollapsible=function(e,t,s,a={}){e.classList.add("collapsible");var a=a.collapsed??!0,l=b.makeIcon("right");l.classList.add("collapser"),l.dataset.collapsed=a,l.style.marginLeft="auto",l.style.marginRight="0.2rem",l.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),this.dataset.collapsed?(delete this.dataset.collapsed,t.style.display="block"):(this.dataset.collapsed=!0,t.style.display="none")}),e.appendChild(l),(s=s??e.parentElement).appendChild(t)},b.makeCodeSnippet=function(e,t,s={}){if(b.has("CodeEditor")){var a,l,i,n=document.createElement("div"),t=(n.className="lexcodesnippet",n.style.width=t?t[0]:"auto",n.style.height=t?t[1]:"auto",new m({noAppend:!0})),r=new b.CodeEditor(t,{skipInfo:!0,disableEdition:!0,allowAddScripts:!1,name:s.tabName});if(r.setText(e,s.language??"Plain Text"),s.linesAdded){let t=r.root.querySelector(".code");for(var o of s.linesAdded)if(o.constructor==Number)t.childNodes[o-1].classList.add("added");else if(o.constructor==Array)for(let e=o[0]-1;e<=o[1]-1;e++)t.childNodes[e].classList.add("added")}if(s.linesRemoved){let t=r.root.querySelector(".code");for(var c of s.linesRemoved)if(c.constructor==Number)t.childNodes[c-1].classList.add("removed");else if(c.constructor==Array)for(let e=c[0]-1;e<=c[1]-1;e++)t.childNodes[e].classList.add("removed")}return s.windowMode&&((e=document.createElement("div")).className="lexwindowbuttons",(a=document.createElement("span")).style.background="#ee4f50",(l=document.createElement("span")).style.background="#f5b720",(i=document.createElement("span")).style.background="#53ca29",e.appendChild(a),e.appendChild(l),e.appendChild(i),r.root.querySelector(".lexareatabs").prepend(e)),(s.lineNumbers??!0)||r.root.classList.add("no-gutter"),n.appendChild(t.root),n}console.error("Import the CodeEditor component to create snippets!")},b.makeIcon=function(e,t,s=""){let a=b.ICONS[e],l=(console.assert(a,`No icon named _${e}_`),a.constructor==String&&(a=b.ICONS[a]),(e=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("viewBox",`0 0 ${a[0]} `+a[1]),s&&e.classList.add(s),a[5]&&(i=a[5].split("="),e.setAttribute(i[0],i[1])),document.createElement("path"));l.setAttribute("fill","var(--color)"),l.setAttribute("d",a[4]),e.appendChild(l),a[6]&&a[6].split(" ").forEach(e=>{e=e.split("=");l.setAttribute(e[0],e[1])}),e.innerHTML+="\x3c!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--\x3e";var i=document.createElement("a");return i.title=t??"",i.className="lexicon "+s,i.appendChild(e),i},b.registerCommandbarEntry=function(e,t){b.extraCommandbarEntries.push({name:e,callback:t})};b.vec2=class R{constructor(e,t){this.x=e??0,this.y=t??e??0}get xy(){return[this.x,this.y]}get yx(){return[this.y,this.x]}set(e,t){this.x=e,this.y=t}add(e,t=new R){return t.set(this.x+e.x,this.y+e.y),t}sub(e,t=new R){return t.set(this.x-e.x,this.y-e.y),t}mul(e,t=new R){return e.constructor==Number&&(e=new R(e)),t.set(this.x*e.x,this.y*e.y),t}div(e,t=new R){return e.constructor==Number&&(e=new R(e)),t.set(this.x/e.x,this.y/e.y),t}abs(e=new R){return e.set(Math.abs(this.x),Math.abs(this.y)),e}dot(e){return this.x*e.x+this.y*e.y}len2(){return this.dot(this)}len(){return Math.sqrt(this.len2())}nrm(e=new R){return e.set(this.x,this.y),e.mul(1/this.len(),e)}dst(e){return e.sub(this).len()}clp(e,t,s=new R){return s.set(g(this.x,e,t),g(this.y,e,t)),s}},b.init=function(e={}){var t,s;return this.ready||((s=document.createElement("div")).id="lexroot",s.tabIndex=-1,(t=document.createElement("div")).id="modal",this.modal=t,this.root=s,this.container=document.body,this.modal.classList.add("hiddenOpacity"),this.modal.toggle=function(e){this.classList.toggle("hiddenOpacity",e)},e.container&&(this.container=document.getElementById(e.container)),this.usingStrictViewport=e.strictViewport??!0,document.documentElement.setAttribute("data-strictVP",this.usingStrictViewport?"true":"false"),this.usingStrictViewport||document.addEventListener("scroll",e=>{document.body.querySelectorAll(".lexmenubox").forEach(e=>{e._updatePosition()})}),this.commandbar=(e=>{let n=document.createElement("dialog"),r=(n.className="commandbar",n.tabIndex=-1,e.appendChild(n),[]),o=null;n.addEventListener("keydown",function(e){var t,s;e.stopPropagation(),e.stopImmediatePropagation(),o=o??-1,"Escape"==e.key?(this.close(),h(!0)):"Enter"==e.key?(t=r[o])&&(s=t.item.type&&"checkbox"===t.item.type,this.close(),s?(t.item.checked=!t.item.checked,t.callback.call(window,t.item.checked,t.entry_name)):t.callback.call(window,t.entry_name)):"ArrowDown"==e.key&&o<r.length-1?(o++,n.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered")),r[o].classList.add("hovered"),0<(s=r[o].offsetHeight*(o+1)-c.offsetHeight)&&c.scrollTo({top:s,behavior:"smooth"})):"ArrowUp"==e.key&&0<o&&(o--,n.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered")),r[o].classList.add("hovered"))}),n.addEventListener("focusout",function(e){e.relatedTarget!=e.currentTarget&&(e.stopPropagation(),e.stopImmediatePropagation(),this.close(),h(!0))}),e.addEventListener("keydown",e=>{if(" "==e.key&&e.ctrlKey)e.stopImmediatePropagation(),e.stopPropagation(),b.setCommandbarState(!0);else for(var t of b.components){var s;if(b[t]&&b[t].prototype.onKeyPressed)for(s of b.CodeEditor.getInstances())s.onKeyPressed(e)}}),(e=document.createElement("div")).className="gs-header";var t=document.createElement("a");t.className="fa-solid fa-magnifying-glass",e.appendChild(t);let s=document.createElement("input");s.placeholder="Search...",s.value="",e.appendChild(s);var a=(t=new m({width:"100%",skipAppend:!0,className:"gs-tabs"})).addTabs();let l,c=(a.add("All",document.createElement("div"),{selected:!0,onSelect:(e,t)=>{l=t}}),document.createElement("div")),d=(c.className="searchitembox",null),h=e=>{c.innerHTML="",r.length=0,o=null,e&&(s.value="")},u=(e,t,s,a)=>{var l,i;e.length&&(d&&d.classList.remove("last"),(l=document.createElement("div")).className="searchitem last",i=a&&a.type&&"checkbox"===a.type,l.innerHTML=i?"<a class='fa fa-check'></a><span>"+(s+e)+"</span>":s+e,l.entry_name=e,l.callback=t,l.item=a,l.addEventListener("click",function(e){this.callback.call(window,this.entry_name),b.setCommandbarState(!1),h(!0)}),l.addEventListener("mouseenter",function(e){n.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered")),this.classList.add("hovered"),o=r.indexOf(this)}),l.addEventListener("mouseleave",function(e){this.classList.remove("hovered")}),r.push(l),c.appendChild(l),d=l)},p=(e,t,s)=>{var a=Object.keys(e)[0],l=e.name??s+a;if(l.toLowerCase().includes(t)&&e.callback&&u(e.name??a,e.callback,s,e),!e.name){s+=a+" > ";for(var i of e[a])p(i,t,s)}};return n._addElements=e=>{h();for(var t of b.menubars)for(var s of t.items)p(s,e,"");for(var a of b.extraCommandbarEntries){var l=a.name;l.toLowerCase().includes(e)&&u(l,a.callback,"",{})}if(b.has("CodeEditor")){let s=b.CodeEditor.getInstances();if(s.length){var i=s[0].languages;for(let t of Object.keys(i)){var n="Language: "+t,r=s[0]._getFileIcon(null,i[t].ext),r=r.includes("fa-")?"<i class='"+r+"'></i>":"<img src='https://raw.githubusercontent.com/jxarco/lexgui.js/master/"+r+"'>";r+=n+" <span class='lang-ext'>("+i[t].ext+")</span>",n.toLowerCase().includes(e)&&u(r,()=>{for(var e of s)e._changeLanguage(t)},"",{})}}}},s.addEventListener("input",function(e){n._addElements(this.value.toLowerCase())}),n.appendChild(e),n.appendChild(t.root),n.appendChild(c),n})(this.container),this.container.appendChild(t),e.skipRoot?this.root=document.body:this.container.appendChild(s),(t=document.createElement("section")).className="notifications",this.notifications=document.createElement("ol"),this.notifications.className="",this.notifications.iWidth=0,t.appendChild(this.notifications),this.container.appendChild(t),this.notifications.addEventListener("mouseenter",()=>{this.notifications.classList.add("list")}),this.notifications.addEventListener("mouseleave",()=>{this.notifications.classList.remove("list")}),s.addEventListener("dragover",function(e){e.preventDefault()},!1),document.addEventListener("contextmenu",function(e){e.preventDefault()},!1),t=document.getElementsByTagName("HEAD")[0],(s=document.createElement("link")).rel="stylesheet",s.type="text/css",s.crossOrigin="anonymous",s.href="https://use.fontawesome.com/releases/v6.7.2/css/all.css",t.appendChild(s),this.DEFAULT_NAME_WIDTH="30%",this.DEFAULT_SPLITBAR_SIZE=4,this.OPEN_CONTEXTMENU_ENTRY="click",this.ready=!0,this.menubars=[],e.skipRoot||e.skipDefaultArea||(this.main_area=new m({id:e.id??"mainarea"})),(e.autoTheme??!0)&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&(b.setTheme("light"),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{b.setTheme(e.matches?"dark":"light")}))),this.main_area},b.setCommandbarState=function(e,t=!0){var s=this.commandbar;e?(s.show(),s.querySelector("input").focus(),t&&s._addElements(void 0)):s.close()},b.message=function(t,e,s={}){if(t)return s.modal=!0,new A(e,e=>{e.addTextArea(null,t,null,{disabled:!0,fitHeight:!0})},s);throw"No message to show"},b.popup=function(t,e,s={}){if(!t)throw"No message to show";s.size=s.size??["max-content","auto"],s.class="lexpopup";var a=s.timeout||3e3;let l=new A(e,e=>{e.addTextArea(null,t,null,{disabled:!0,fitHeight:!0})},s);return setTimeout(()=>{l.close()},Math.max(a,150)),l},b.prompt=function t(s,a,l,i={}){i.modal=!0,i.className="prompt";let n="",r=new A(a,e=>{e.addTextArea(null,s,null,{disabled:!0,fitHeight:!0}),(i.input??!0)&&e.addText(null,i.input||n,e=>n=e,{placeholder:"..."}),e.sameLine(2),e.addButton(null,"Cancel",()=>{i.on_cancel&&i.on_cancel(),r.close()}),e.addButton(null,i.accept||"Continue",()=>{i.required&&""===n?(s+=s.includes("You must fill the input text.")?"":"\nYou must fill the input text.",r.close(),t(s,a,l,i)):(l&&l.call(this,n),r.close())},{buttonClass:"primary"})},i);return(i.input??!0)&&r.root.querySelector("input").focus(),r},b.toast=function(e,t,s={}){if(!e)throw"The toast needs at least a title!";console.assert(this.notifications);let a=document.createElement("li");a.className="lextoast",a.style.translate="0 calc(100% + 30px)",this.notifications.prepend(a),x(()=>{this.notifications.offsetWidth>this.notifications.iWidth&&(this.notifications.iWidth=Math.min(this.notifications.offsetWidth,480),this.notifications.style.width=this.notifications.iWidth+"px"),a.dataset.open=!0},10);var l=document.createElement("div"),i=(l.className="lextoastcontent",a.appendChild(l),document.createElement("div"));i.className="title",i.innerHTML=e,l.appendChild(i),t&&((e=document.createElement("div")).className="desc",e.innerHTML=t,l.appendChild(e)),s.action&&((i=new z).addButton(null,s.action.name??"Accept",s.action.callback.bind(this,a),{width:"auto",maxWidth:"150px",className:"right",buttonClass:"outline"}),a.appendChild(i.root.childNodes[0]));let n=this;a.close=function(){this.dataset.closed=!0,x(()=>{this.remove(),n.notifications.childElementCount||(n.notifications.style.width="unset",n.notifications.iWidth=0)},500)},(s.closable??!0)&&((t=document.createElement("a")).className="fa fa-xmark lexicon closer",t.addEventListener("click",()=>{a.close()}),a.appendChild(t)),-1!=(l=s.timeout??3e3)&&x(()=>{a.close()},l)},b.badge=function(e,t,s={}){var a=document.createElement("div");return a.innerHTML=e,a.className="lexbadge "+(t??""),Object.assign(a.style,s.style??{}),a.outerHTML},b.makeContainer=function(e,t,s={}){var a=document.createElement("div");return a.className="lexcontainer "+(t??""),a.style.width=e&&e[0]?e[0]:"100%",a.style.height=e&&e[1]?e[1]:"100%",Object.assign(a.style,s),a};class E{constructor(e,t,s){this.name=e,this.value=t,this.domEvent=s}}b.IEvent=E;class y{static NONE=0;static NODE_SELECTED=1;static NODE_DELETED=2;static NODE_DBLCLICKED=3;static NODE_CONTEXTMENU=4;static NODE_DRAGGED=5;static NODE_RENAMED=6;static NODE_VISIBILITY=7;static NODE_CARETCHANGED=8;constructor(e,t,s){this.type=e||y.NONE,this.node=t,this.value=s,this.multiple=!1,this.panel=null}string(){switch(this.type){case y.NONE:return"tree_event_none";case y.NODE_SELECTED:return"tree_event_selected";case y.NODE_DELETED:return"tree_event_deleted";case y.NODE_DBLCLICKED:return"tree_event_dblclick";case y.NODE_CONTEXTMENU:return"tree_event_contextmenu";case y.NODE_DRAGGED:return"tree_event_dragged";case y.NODE_RENAMED:return"tree_event_renamed";case y.NODE_VISIBILITY:return"tree_event_visibility";case y.NODE_CARETCHANGED:return"tree_event_caretchanged"}}}b.TreeEvent=y,b.emit=function(e,t,s={}){var a=b.signals[e];if(a){var l,i=s.target;if(i)i[e]&&i[e].call(i,t);else for(var n of a)n instanceof w?n.set(t,s.skipCallback??!0):n.constructor===Function?n(null,t):(l=n[e],console.assert(l,`No callback registered with _${e}_ signal`),l.bind(n)(t))}},b.addSignal=function(e,t,s){t[e]=s,b.signals[e]||(b.signals[e]=[]),-1<b.signals[e].indexOf(t)||b.signals[e].push(t)};class a{static currentMenu=!1;constructor(e,t,s={}){console.assert(e,"DropdownMenu needs a DOM element as trigger!"),a.currentMenu?a.currentMenu.destroy():(((this._trigger=e).ddm=this)._items=t,this._windowPadding=4,this.side=s.side??"bottom",this.align=s.align??"center",this.avoidCollisions=s.avoidCollisions??!0,this.root=document.createElement("div"),this.root.id="root",this.root.dataset.side=this.side,this.root.tabIndex="1",this.root.className="lexdropdownmenu",b.root.appendChild(this.root),this._create(this._items),a.currentMenu=this,x(()=>{this._adjustPosition(),this.root.focus(),this._onClick=e=>{e.target&&(e.target.className.includes("lexdropdown")||e.target==this._trigger)||this.destroy()},document.body.addEventListener("click",this._onClick)},10))}destroy(){delete this._trigger.ddm,document.body.removeEventListener("click",this._onClick),b.root.querySelectorAll(".lexdropdownmenu").forEach(e=>{e.remove()}),a.currentMenu=null}_create(e,i){if(i){let t=i.getBoundingClientRect(),s=document.createElement("div");s.tabIndex="1",s.className="lexdropdownmenu",s.id=i.id,s.dataset.side="right",b.root.appendChild(s),s.currentParent=i,i=s,x(()=>{var e=[t.x+t.width,t.y];this.avoidCollisions&&(e[0]=b.clamp(e[0],0,window.innerWidth-s.offsetWidth-this._windowPadding),e[1]=b.clamp(e[1],0,window.innerHeight-s.offsetHeight-this._windowPadding)),s.style.left=e[0]+"px",s.style.top=e[1]+"px"},10)}else i=this.root;for(let l of e)if(l){let t=l.name??l;var s=t.replace(/\s/g,"").replaceAll(".","");if(!i.querySelector("#"+s)){let a=document.createElement("div");a.className="lexdropdownmenuitem"+(l.name?"":" label")+(l.disabled?" disabled":""),a.id=s,a.innerHTML=`<span>${t}</span>`,l.icon&&(s=b.makeIcon(l.icon),a.prepend(s)),a.tabIndex="1",i.appendChild(a),l.constructor===String||l.disabled||(l.submenu&&((s=document.createElement("a")).className="fa-solid fa-angle-right fa-xs",a.appendChild(s)),a.addEventListener("click",()=>{var e=l.callback;e&&e.call(this,t,a),this.destroy()}),a.addEventListener("mouseover",e=>{let t=a.id,s=i;for(;s;)t+="/"+s.id,s=s.currentParent?.parentElement;if(b.root.querySelectorAll(".lexdropdownmenu").forEach(e=>{t.includes(e.id)||(e.currentParent.built=!1,e.remove())}),l.submenu){if(a.built)return;a.built=!0,this._create(l.submenu,a)}e.stopPropagation()}))}}else this._addSeparator(i)}_adjustPosition(){var t=[document.scrollingElement.scrollLeft,document.scrollingElement.scrollTop];{var s=this._trigger.getBoundingClientRect();let e=!0;switch(this.side){case"left":t[0]+=s.x-this.root.offsetWidth,e=!1;break;case"right":t[0]+=s.x+s.width,e=!1;break;case"top":t[1]+=s.y-this.root.offsetHeight,e=!0;break;case"bottom":t[1]+=s.y+s.height,e=!0}switch(this.align){case"start":e?t[0]+=s.x:t[1]+=s.y;break;case"center":e?t[0]+=s.x+.5*s.width-.5*this.root.offsetWidth:t[1]+=s.y+.5*s.height-.5*this.root.offsetHeight;break;case"end":e?t[0]+=s.x-this.root.offsetWidth+s.width:t[1]+=s.y-this.root.offsetHeight+s.height}}this.avoidCollisions&&(t[0]=b.clamp(t[0],0,window.innerWidth-this.root.offsetWidth-this._windowPadding),t[1]=b.clamp(t[1],0,window.innerHeight-this.root.offsetHeight-this._windowPadding)),this.root.style.left=t[0]+"px",this.root.style.top=t[1]+"px"}_addSeparator(e){var t=document.createElement("div");t.className="separator",(e=e??this.root).appendChild(t)}}b.DropdownMenu=a;class m{constructor(e={}){var a,l,t=document.createElement("div"),s=(t.className="lexarea",e.id&&(t.id=e.id),e.className&&(t.className+=" "+e.className),e.width||"calc( 100% )"),i=e.height||"100%",s=(this.setLimitBox(e.minWidth,e.minHeight,e.maxWidth,e.maxHeight),s.constructor==Number&&(s+="px"),i.constructor==Number&&(i+="px"),t.style.width=s,t.style.height=i,this.offset=0,this.root=t,this.size=[this.root.offsetWidth,this.root.offsetHeight],this.sections=[],this.panels=[],e.skipAppend||document.getElementById("lexroot").appendChild(this.root),e.overlay);function n(e){switch(a.type){case"right":var t=l[0]-e.x,s=a.root.offsetWidth+t;a.root.style.width=s+"px";break;case"left":t=l[0]-e.x,s=Math.min(document.body.clientWidth-b.DEFAULT_SPLITBAR_SIZE,a.root.offsetWidth-t);a.root.style.width=s+"px",a.splitBar.style.left=s+b.DEFAULT_SPLITBAR_SIZE/2+"px";break;case"top":t=l[1]-e.y,s=Math.min(document.body.clientHeight-b.DEFAULT_SPLITBAR_SIZE,a.root.offsetHeight-t);a.root.style.height=s+"px",a.splitBar.style.top=s+b.DEFAULT_SPLITBAR_SIZE/2+"px";break;case"bottom":t=l[1]-e.y,s=a.root.offsetHeight+t;a.root.style.height=s+"px"}l[0]=e.x,l[1]=e.y,e.stopPropagation(),e.preventDefault(),a.onresize&&a.onresize(a.root.getBoundingClientRect())}function r(e){var t=a.root.ownerDocument;t.removeEventListener("mousemove",n),t.removeEventListener("mouseup",r),document.body.classList.remove("nocursor"),a.splitBar.classList.remove("nocursor")}s&&(this.root.classList.add("overlay-"+s),e.left?this.root.style.left=e.left:e.right?this.root.style.right=e.right:e.top?this.root.style.top=e.top:e.bottom&&(this.root.style.bottom=e.bottom),(e.draggable??!0)&&p(t,e),e.resizeable&&t.classList.add("resizeable"),e.resize)&&(this.splitBar=document.createElement("div"),i="left"==s||"right"==s?"horizontal":"vertical",this.type=s,this.splitBar.className="lexsplitbar "+i,"right"==s?(this.splitBar.style.width=b.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.left=-b.DEFAULT_SPLITBAR_SIZE/2+"px"):"left"==s?(t=Math.min(document.body.clientWidth-b.DEFAULT_SPLITBAR_SIZE,this.root.clientWidth),this.splitBar.style.width=b.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.left=t+b.DEFAULT_SPLITBAR_SIZE/2+"px"):"top"==s?(e=Math.min(document.body.clientHeight-b.DEFAULT_SPLITBAR_SIZE,this.root.clientHeight),this.splitBar.style.height=b.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.top=e+b.DEFAULT_SPLITBAR_SIZE/2+"px"):"bottom"==s&&(this.splitBar.style.height=b.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.top=-b.DEFAULT_SPLITBAR_SIZE/2+"px"),this.splitBar.addEventListener("mousedown",function(e){var t=a.root.ownerDocument;t.addEventListener("mousemove",n),t.addEventListener("mouseup",r),l[0]=e.x,l[1]=e.y,e.stopPropagation(),e.preventDefault(),document.body.classList.add("nocursor"),a.splitBar.classList.add("nocursor")}),this.root.appendChild(this.splitBar),a=this,l=[0,0])}attach(e){if(this.sections.length)this.sections[1].attach(e);else{if(!e)throw"no content to attach";(e.parent=this).root.appendChild(e.root||e)}}split(t={}){this.sections.length&&(this.offset=this.root.childNodes[0].offsetHeight,this._root=this.sections[0].root,this.root=this.sections[1].root);var s=t.type||"horizontal",a=t.sizes||["50%","50%"],e="auto"===t.sizes;if(!a[1]){let e=a[0];var l=t.top||0;e.constructor==Number&&(e=e+l+"px"),a[1]="calc( 100% - "+e+" )"}var i,n,l=new m({skipAppend:!0,className:"split"+(t.menubar||t.sidebar?"":" origin")}),r=new m({skipAppend:!0,className:"split"}),o=(l.parentArea=this,r.parentArea=this,t.minimizable??!1),t=(t.resize??!0)||o,c="0px";return this.offset=0,t&&(this.resize=t,this.splitBar=document.createElement("div"),this.splitBar.className="lexsplitbar "+s,"horizontal"==s?this.splitBar.style.width=b.DEFAULT_SPLITBAR_SIZE+"px":this.splitBar.style.height=b.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.addEventListener("mousedown",function(e){var t=n.root.ownerDocument;t.addEventListener("mousemove",d),t.addEventListener("mouseup",h),e.stopPropagation(),e.preventDefault(),document.body.classList.add("nocursor"),n.splitBar.classList.add("nocursor")}),c=b.DEFAULT_SPLITBAR_SIZE/2+"px",o)&&(this.splitExtended=!1,r.root.addEventListener("animationend",e=>{var t=getComputedStyle(r.root).opacity;r.root.classList.remove(e.animationName+"-"+s),r.root.style.opacity=t,C(r.root)}),this.splitBar.addEventListener("contextmenu",e=>{e.preventDefault(),P(null,e,e=>{e.add("Extend",{disabled:this.splitExtended,callback:()=>{this.extend()}}),e.add("Reduce",{disabled:!this.splitExtended,callback:()=>{this.reduce()}})})})),"horizontal"==s?(o=a[0],i=a[1],o.constructor==Number&&(o+="px"),i.constructor==Number&&(i+="px"),l.root.style.width="calc( "+o+" - "+c+" )",l.root.style.height="calc(100% - 0px)",r.root.style.width="calc( "+i+" - "+c+" )",r.root.style.height="calc(100% - 0px)",this.root.style.display="flex"):(l.root.style.width="100%",r.root.style.width="100%",e?(l.root.style.height="auto",new ResizeObserver(e=>{for(var t of e){t=t.contentRect;r.root.style.height="calc(100% - "+(t.height+4)+"px )"}}).observe(l.root)):(o=a[0],i=a[1],o.constructor==Number&&(o+="px"),i.constructor==Number&&(i+="px"),l.root.style.width="100%",l.root.style.height="auto"==o?o:"calc( "+o+" - "+c+" )",r.root.style.height="auto"==i?i:"calc( "+i+" - "+c+" )")),this.root.appendChild(l.root),t&&this.root.appendChild(this.splitBar),this.root.appendChild(r.root),this.sections=[l,r],this.type=s,this._update(),t&&(n=this),this.sections;function d(e){var t;"horizontal"==n.type?n._moveSplit(-e.movementX):n._moveSplit(-e.movementY);for(t of n.root.querySelectorAll(".lexwidget")){var s=t.jsInstance;s.onresize&&s.onresize()}e.stopPropagation(),e.preventDefault()}function h(e){var t=n.root.ownerDocument;t.removeEventListener("mousemove",d),t.removeEventListener("mouseup",h),document.body.classList.remove("nocursor"),n.splitBar.classList.remove("nocursor")}}setLimitBox(e=0,t=0,s=1/0,a=1/0){this.minWidth=e,this.minHeight=t,this.maxWidth=s,this.maxHeight=a}setSize(e){let[t,s]=e;null!=t&&t.constructor==Number&&(t+="px"),null!=s&&s.constructor==Number&&(s+="px"),t&&(this.root.style.width=t),s&&(this.root.style.height=s),this.onresize&&this.onresize(this.root.getBoundingClientRect()),x(()=>{this.size=[this.root.clientWidth,this.root.clientHeight],this.propagateEvent("onresize")},150)}extend(){var e,t;this.splitExtended||([e,t]=this.sections,this.splitExtended=!0,"vertical"==this.type?(this.offset=t.root.offsetHeight,t.root.classList.add("fadeout-vertical"),this._moveSplit(-1/0,!0)):(this.offset=t.root.offsetWidth-8,t.root.classList.add("fadeout-horizontal"),this._moveSplit(-1/0,!0,8)),x(()=>this.propagateEvent("onresize"),150))}reduce(){var e,t;this.splitExtended&&(this.splitExtended=!1,[e,t]=this.sections,"vertical"==this.type?t.root.classList.add("fadein-vertical"):t.root.classList.add("fadein-horizontal"),this._moveSplit(this.offset),x(()=>this.propagateEvent("onresize"),150))}hide(){this.root.classList.add("hidden")}show(){this.root.classList.remove("hidden")}toggle(e){this.root.classList.toggle("hidden",e)}propagateEvent(e){for(var t=0;t<this.sections.length;t++){var s=this.sections[t];s[e]&&s[e].call(this,s.root.getBoundingClientRect()),s.propagateEvent(e)}}addPanel(e){e=new z(e);return this.attach(e),this.panels.push(e),e}addMenubar(e,t={}){var s=new l(t),[e,a]=(e&&e(s),b.menubars.push(s),this.split({type:"vertical",sizes:[48,null],resize:!1,menubar:!0}));return s.siblingArea=a,e.attach(s),e.isMenubar=!0,(t.sticky??!0)&&e.root.classList.add("sticky"),s}addSidebar(e,t={}){var s=new i(t),e=(e&&e(s),s.update(),b.menubars.push(s),t.width??"16rem"),[t,e]=this.split({type:"horizontal",sizes:[e,null],resize:!1,sidebar:!0});return s.siblingArea=e,t.attach(s),t.isSidebar=!0,s}addOverlayButtons(l,i={}){if(this.sections.length)this.sections[1].addOverlayButtons(l,i);else{console.assert(l.constructor==Array&&l.length),this.root.style.position="relative",i.className="lexoverlaybuttons";let n=this.addPanel(i),a=null,e=document.createElement("div"),t=(e.className="lexoverlaybuttonscontainer",e.appendChild(n.root),this.attach(e),i.float);if(t)for(var r=0;r<t.length;r++)switch(t[r]){case"h":break;case"v":e.className+=" vertical";break;case"t":break;case"m":e.className+=" middle";break;case"b":e.className+=" bottom";break;case"l":break;case"c":e.className+=" center";break;case"r":e.className+=" right"}let s=function(l,e,t){var s={width:"auto",selectable:l.selectable,selected:l.selected,icon:l.icon,img:l.img,className:l.class};e&&(a||((a=document.createElement("div")).className="lexoverlaygroup",n.queuedContainer=a),s.parent=a);let i=l.callback;if(l.options)n.addSelect(null,l.options,l.name,i,s);else{let a=n.addButton(null,l.name,function(e,t){var s;l.selectable&&(l.group?(s=l.selected,l.group.forEach(e=>e.selected=!1),l.selected=!s):l.selected=!l.selected),i(e,t,a.root)},s)}a&&t&&(n.root.appendChild(a),a=null,n.clearQueue())};var o,c;n.clear();for(c of l)if(c.constructor===Array)for(let e=0;e<c.length;++e){var d=c[e];d.group=c,s(d,!0,e==c.length-1)}else s(c);t&&(o=0,n.root.childNodes.forEach(e=>{o+=e.offsetHeight}),e.className.includes("middle"))&&(e.style.top="-moz-calc( 50% - "+.5*o+"px )",e.style.top="-webkit-calc( 50% - "+.5*o+"px )",e.style.top="calc( 50% - "+.5*o+"px )")}}addTabs(e={}){var t=new n(this,e);return e.folding&&(this.parentArea._disableSplitResize(),this.root.style.paddingTop="4px"),t}_moveSplit(t,s=!1,a=0){if(!this.type)throw"No split area";if(void 0!==t){var l,i=this.sections[0],n=i.root,r=(n.classList.contains("origin")||(n=n.parentElement),this.sections[1]),o=r.root,c=" - "+b.DEFAULT_SPLITBAR_SIZE+"px";let e=null;s||(e=n.style.transition,n.style.transition=o.style.transition="none",C(n),C(o)),"horizontal"==this.type?(l=Math.max(o.offsetWidth+t,parseInt(r.minWidth)),n.style.width="-moz-calc( 100% - "+(l=a?a:l)+"px "+c+" )",n.style.width="-webkit-calc( 100% - "+l+"px "+c+" )",n.style.width="calc( 100% - "+l+"px "+c+" )",n.style.minWidth=parseInt(i.minWidth)+"px",o.style.width=l+"px",i.maxWidth!=1/0&&(o.style.minWidth="calc( 100% - "+parseInt(i.maxWidth)+"px )")):(l=Math.max(o.offsetHeight+t+r.offset,parseInt(r.minHeight)),n.style.height="-moz-calc( 100% - "+(l=a?a:l)+"px "+c+" )",n.style.height="-webkit-calc( 100% - "+l+"px "+c+" )",n.style.height="calc( 100% - "+l+"px "+c+" )",n.style.minHeight=i.minHeight+"px",o.style.height=l-r.offset+"px"),s||(n.style.transition=o.style.transition=e),this._update(),this.propagateEvent("onresize")}}_disableSplitResize(){this.resize=!1,this.splitBar.remove(),delete this.splitBar}_update(){var e=this.root.getBoundingClientRect();this.size=[e.width,e.height];for(var t=0;t<this.sections.length;t++)this.sections[t]._update()}}function C(e){e.offsetHeight}b.Area=m;class n{static TAB_SIZE=28;static TAB_ID=0;constructor(s,e={}){this.onclose=e.onclose;var t=document.createElement("div"),a=(t.className="lexareatabs "+(e.fit?"fit":"row"),e.folding??!1);a&&t.classList.add("folding");let n=this;t.addEventListener("dragenter",function(e){e.preventDefault(),this.classList.add("dockingtab")}),t.addEventListener("dragleave",function(e){e.preventDefault(),this.contains(e.relatedTarget)||this.classList.remove("dockingtab")}),t.addEventListener("drop",function(e){e.preventDefault();var t,s,a,l=e.dataTransfer.getData("source"),i=document.getElementById(l);i&&(t=i.parentElement,s=(a=e.target).getBoundingClientRect(),e.offsetX<.5*s.width?this.insertBefore(i,a):a.nextElementSibling?this.insertBefore(i,a.nextElementSibling):this.appendChild(i),t.childNodes.forEach((e,t)=>e.childIndex=t-1),s=/true/.test(e.dataTransfer.getData("fit")),(t.childElementCount==(s?2:1)?t.lastChild:t.querySelector(".selected")??t.childNodes[s?1:0]).click(),this.childNodes.forEach((e,t)=>e.childIndex=t-1),a=document.getElementById(l+"_content"),n.area.attach(a),this.classList.remove("dockingtab"),i.instance=n,i.click(),n.tabs[i.dataset.name]=a)}),s.root.classList.add("lexareatabscontainer"),s.split({type:"vertical",sizes:e.sizes??"auto",resize:!1,top:6}),s.sections[0].attach(t),this.area=s.sections[1],this.area.root.className+=" lexareatabscontent",this.selected=null,this.root=t,this.tabs={},this.tabDOMs={},e.fit&&((t=document.createElement("span")).className="lexareatab thumb",this.thumb=t,this.root.appendChild(t),new ResizeObserver(e=>{var t,s=this.thumb.item;s&&(t=this.thumb.style.transition,this.thumb.style.transition="none",this.thumb.style.transform="translate( "+s.childIndex*s.offsetWidth+"px )",this.thumb.style.width=s.offsetWidth-5+"px",this.thumb.style.height=s.offsetHeight-6+"px",C(this.thumb),this.thumb.style.transition=t)}).observe(this.area.root)),a&&(this.folded=!0,"up"==(this.folding=a)&&s.root.insertChildAtIndex(s.sections[1].root,0),new ResizeObserver(e=>{for(var t of e){t=t.contentRect;s.parentArea.sections[0].root.style.height="calc(100% - "+(42+t.height)+"px )"}}).observe(this.area.root),this.area.root.classList.add("folded"))}add(e,t,a={}){let s=a.selected??!1,l=(s&&(this.root.querySelectorAll("span").forEach(e=>e.classList.remove("selected")),this.area.root.querySelectorAll(".lextabcontent").forEach(e=>e.style.display="none")),s=!Object.keys(this.tabs).length&&!this.folding||s,t.root||t);l.originalDisplay=l.style.display,l.style.display=s?l.originalDisplay:"none",l.classList.add("lextabcontent"),a.icon&&(a.icon.includes("fa-")?a.icon="<i class='"+a.icon+"'></i>":a.icon="<img src='https://raw.githubusercontent.com/jxarco/lexgui.js/master/"+a.icon+"'>");let i=document.createElement("span");i.dataset.name=e,i.className="lexareatab"+(s?" selected":""),i.innerHTML=(a.icon??"")+e,i.id=e.replace(/\s/g,"")+n.TAB_ID++,i.title=a.title??"",i.selected=s??!1,i.fixed=a.fixed,i.instance=this,l.id=i.id+"_content",i.selected&&(this.selected=e),i.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();var t,s=i.instance;i.fixed||(t=i.selected,i.parentElement.querySelectorAll("span").forEach(e=>e.selected=!1),i.selected=!t,i.parentElement.querySelectorAll("span").forEach(e=>e.classList.remove("selected")),i.classList.toggle("selected",this.folding&&i.selected),s.area.root.querySelectorAll(".lextabcontent").forEach(e=>e.style.display="none"),l.style.display=l.originalDisplay,s.selected=i.dataset.name),s.folding&&(s.folded=i.selected,s.area.root.classList.toggle("folded",!s.folded)),a.onSelect&&a.onSelect(e,i.dataset.name),s.thumb&&(s.thumb.style.transform="translate( "+i.childIndex*i.offsetWidth+"px )",s.thumb.style.width=i.offsetWidth-5+"px",s.thumb.style.height=i.offsetHeight-6+"px",s.thumb.item=i)}),i.addEventListener("contextmenu",e=>{e.preventDefault(),e.stopPropagation(),a.onContextMenu&&a.onContextMenu(e,i.dataset.name)}),i.addEventListener("mouseup",e=>{e.preventDefault(),e.stopPropagation(),1==e.button&&this.delete(i.dataset.name)}),i.setAttribute("draggable",!0),i.addEventListener("dragstart",e=>{var t=!!this.thumb;i.parentElement.childNodes.length==(t?2:1)?e.preventDefault():(e.dataTransfer.setData("source",e.target.id),e.dataTransfer.setData("fit",t))}),i.childIndex=this.root.childElementCount-1,this.root.appendChild(i),this.area.attach(l),this.tabDOMs[e]=i,this.tabs[e]=t,setTimeout(()=>{a.onCreate&&a.onCreate.call(this,this.area.root.getBoundingClientRect()),s&&this.thumb&&(this.thumb.style.transform="translate( "+i.childIndex*i.offsetWidth+"px )",this.thumb.style.width=i.offsetWidth-5+"px",this.thumb.style.height=i.offsetHeight-6+"px",this.thumb.item=i)},10)}select(e){this.tabDOMs[e]&&this.tabDOMs[e].click()}delete(e){var t=this.tabDOMs[e];t&&!t.fixed&&(this.onclose&&this.onclose(e),this.tabDOMs[e].remove(),delete this.tabDOMs[e],this.tabs[e].remove(),delete this.tabs[e],t=this.root.lastChild)&&!t.fixed&&this.root.lastChild.click()}}b.Tabs=n;class l{constructor(e={}){this.root=document.createElement("div"),this.root.className="lexmenubar",e.float&&(this.root.style.justifyContent=e.float),this.items=[],this.buttons=[],this.icons={},this.shorts={}}_resetMenubar(e){this.root.querySelectorAll(".lexmenuentry").forEach(e=>{e.classList.remove("selected"),e.built=!1}),b.root.querySelectorAll(".lexmenubox").forEach(e=>e.remove()),this.focused=e??!1}_createSubmenu(e,t,s,n){let r=document.createElement("div"),a=(r.className="lexmenubox",r.tabIndex="0",((s.currentMenu=r).parentEntry=s).classList.contains("lexmenuboxentry"));a&&(r.dataset.submenu=!0),r._updatePosition=()=>{let t=r.style.transition;r.style.transition="none",C(r),x(()=>{var e=s.getBoundingClientRect();e.x+=document.scrollingElement.scrollLeft,e.y+=document.scrollingElement.scrollTop,r.style.left=(a?e.x+e.width:e.x)+"px",r.style.top=(a?e.y:e.y+e.height-4)+"px",r.style.transition=t})},r._updatePosition(),x(()=>{r.dataset.open=!0},10),b.root.appendChild(r);for(var o=0;o<e[t].length;++o){let s=e[t][o],a=Object.keys(s)[0];var c,d,h=s[a].length,u="checkbox"==s.type;let l=document.createElement("div"),i=(l.tabIndex="1",l.className="lexmenuboxentry",l.className+=(o==e[t].length-1?" last":"")+(s.disabled?" disabled":""),""==a?l.className=" lexseparator":(l.id=a,(c=document.createElement("div")).innerHTML="",c.classList="lexmenuboxentrycontainer",l.appendChild(c),d=this.icons[a],u?c.innerHTML+="<input type='checkbox' >":d?c.innerHTML+="<a class='"+d+" fa-sm'></a>":(c.innerHTML+="<a class='fa-solid fa-sm noicon'></a>",c.classList.add("noicon")),c.innerHTML+="<div class='lexentryname'>"+a+"</div>"),l.querySelector("input"));i&&(i.checked=s.checked??!1,i.addEventListener("change",e=>{s.checked=i.checked;var t=s.callback;t&&(t.call(this,s.checked,a,l),this._resetMenubar()),e.stopPropagation(),e.stopImmediatePropagation()})),r.appendChild(l),""!=a&&(r.addEventListener("keydown",e=>{e.preventDefault();let t=this.shorts[a];t&&(t=1==t.length?t.toLowerCase():t)==e.key&&l.click()}),l.addEventListener("click",e=>{i&&(s.checked=!s.checked);var t=s.callback;t&&(t.call(this,i?s.checked:a,i?a:l),this._resetMenubar()),e.stopPropagation(),e.stopImmediatePropagation()}),l.addEventListener("blur",e=>{e.target&&e.target.className.includes("lexmenu")||this._resetMenubar()}),h?((u=document.createElement("a")).className="fa-solid fa-angle-right fa-xs",l.appendChild(u),l.addEventListener("mouseover",e=>{l.built||(l.built=!0,this._createSubmenu(s,a,l,++n),e.stopPropagation())}),l.addEventListener("mouseleave",e=>{l.currentMenu&&l.currentMenu!=e.toElement&&(n=-1,delete l.built,l.currentMenu.remove(),delete l.currentMenu)})):this.shorts[a]&&((d=document.createElement("div")).className="lexentryshort",d.innerText=this.shorts[a],l.appendChild(d)))}r.style.width=r.offsetWidth+"px"}add(e,i={}){i.constructor==Function&&(i={callback:i});let n=e.split("/");e=n[n.length-1];this.icons[e]=i.icon,this.shorts[e]=i.short;let r=0,o=(a,e)=>{if(null!=a){let s=null;var t,l;e.forEach(e=>{var t=Object.keys(e).find(e=>e==a);t&&(s=e[t])}),s?o(n[r++],s):((t={})[a]=[],(l=n[r++])||(t.callback=i.callback,t.disabled=i.disabled,t.type=i.type,t.checked=i.checked),e.push(t),o(l,t[a]))}};o(n[r++],this.items);for(let l of this.items){let a=Object.keys(l)[0];var c=a.replace(/\s/g,"").replaceAll(".","");if(!this.root.querySelector("#"+c)){let t=document.createElement("div"),s=(t.className="lexmenuentry",t.id=c,t.innerHTML="<span>"+a+"</span>",t.tabIndex="1","left"==i.position?this.root.prepend(t):("right"==i.position&&(t.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(t):this.root.appendChild(t)),()=>{this._resetMenubar(!0),t.classList.add("selected"),t.built=!0,this._createSubmenu(l,a,t,-1)});t.addEventListener("click",()=>{var e=l.callback;e?e.call(this,a,t):(s(),this.focused=!0)}),t.addEventListener("mouseover",e=>{this.focused&&!t.built&&s()}),t.addEventListener("blur",e=>{e.relatedTarget&&e.relatedTarget.className.includes("lexmenubox")||this._resetMenubar()})}}}getButton(e){return this.buttons[e]}getSubitem(t,s){var a=s[0];for(let e=0;e<t.length;e++)if(t[e][a])return 1==s.length?t[e]:(s.splice(0,1),this.getSubitem(t[e][a],s))}getItem(e){e=e.split("/");return this.getSubitem(this.items,e)}setButtonIcon(e,a,l,i={}){if(!e)throw"Set Button Name!";let n=this.buttons[e];if(n)n.querySelector("a").className="fa-solid "+a+" lexicon";else{n=document.createElement("div");let t=i.disabled??!1,s=(n.className="lexmenubutton main"+(t?" disabled":""),n.title=e,n.innerHTML="<a class='"+a+" lexicon'></a>","right"==i.float&&(n.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(n):"left"==i.float?this.root.prepend(n):this.root.appendChild(n),n.querySelector("a"));s.addEventListener("click",e=>{l&&!t&&l.call(this,s,e)}),this.buttons[e]=n}}setButtonImage(e,a,l,i={}){if(!e)throw"Set Button Name!";let n=this.buttons[e];if(n)n.querySelector("img").src=a;else{n=document.createElement("div");let t=i.disabled??!1,s=(n.className="lexmenubutton"+(t?" disabled":""),n.title=e,n.innerHTML="<a><image src='"+a+"' class='lexicon' style='height:32px;'></a>","right"==i.float&&(n.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(n):"left"==i.float?this.root.prepend(n):this.root.appendChild(n),n.querySelector("a"));s.addEventListener("click",e=>{l&&!t&&l.call(this,s,e)}),this.buttons[e]=n}}addButtons(i,e={}){if(!i)throw"No buttons to add!";this.buttonContainer||(this.buttonContainer=document.createElement("div"),this.buttonContainer.className="lexmenubuttons",this.buttonContainer.classList.add(e.float??"center"),"right"==e.position&&(this.buttonContainer.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(this.buttonContainer):this.root.appendChild(this.buttonContainer));for(let t=0;t<i.length;++t){let s=i[t],a=document.createElement("label");var n=s.title;let l=s.disabled??!1;a.className="lexmenubutton"+(l?" disabled":""),a.title=n??"",this.buttonContainer.appendChild(a);var r=document.createElement("a");r.className=s.icon+" lexicon",a.appendChild(r);let e=r;s.swap&&(a.classList.add("swap"),r.classList.add("swap-off"),(r=document.createElement("input")).type="checkbox",a.prepend(r),e=r,(r=document.createElement("a")).className=s.swap+" swap-on lexicon",a.appendChild(r),a.swap=function(){var e=this.querySelector("input");e.checked=!e.checked},a.setState=function(e){this.querySelector("input").checked=e}),e.addEventListener("click",e=>{var t;s.callback&&!l&&(t=a.querySelector("input"),s.callback.call(this,e,t?.checked))}),n&&(this.buttons[n]=a)}}}b.Menubar=l;class i{constructor(e={}){var t;this.root=document.createElement("div"),this.root.className="lexsidebar",this._displaySelected=e.displaySelected??!1,Object.defineProperty(i.prototype,"displaySelected",{get:function(){return this._displaySelected},set:function(e){this._displaySelected=e,this._displaySelected||this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected"))},enumerable:!0,configurable:!0}),this.collapsable=e.collapsable??!0,this._collapseWidth=e.collapseToIcons??!0?"58px":"0px",this.collapsed=!1,this.filterString="",x(()=>{this.root.parentElement.ogWidth=this.root.parentElement.style.width,this.root.parentElement.style.transition="width 0.25s ease-out",this.resizeObserver=new ResizeObserver(e=>{for(var t of e)this.siblingArea.setSize(["calc(100% - "+t.contentRect.width+"px )",null])})},10),e.skipHeader||(this.header=e.header??this._generateDefaultHeader(e),console.assert(this.header.constructor===HTMLDivElement,"Use an HTMLDivElement to build your custom header"),this.header.className="lexsidebarheader",this.root.appendChild(this.header),this.collapsable&&(t=b.makeIcon("sidebar","Toggle Sidebar","toggler"),this.header.appendChild(t),t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.toggleCollapsed()}))),e.filter&&((t=new z).addText(null,"",(e,t)=>{this.filterString=e,this.update()},{placeholder:"Search...",icon:"fa-solid fa-magnifying-glass"}),this.filter=t.root.childNodes[0],this.root.appendChild(this.filter)),this.content=document.createElement("div"),this.content.className="lexsidebarcontent",this.root.appendChild(this.content),e.skipFooter||(this.footer=e.footer??this._generateDefaultFooter(e),console.assert(this.footer.constructor===HTMLDivElement,"Use an HTMLDivElement to build your custom footer"),this.footer.className="lexsidebarfooter",this.root.appendChild(this.footer)),x(()=>{var e=32+(this.header?.offsetHeight??0)+(this.filter?.offsetHeight??0)+(this.footer?.offsetHeight??0);this.content.style.height=`calc(100% - ${e}px)`},10),this.items=[],this.icons={},this.groups={}}_generateDefaultHeader(t){var e=document.createElement("div"),s=(e.addEventListener("click",e=>{this.collapsed?(e.preventDefault(),e.stopPropagation(),this.toggleCollapsed()):t.onHeaderPressed&&t.onHeaderPressed(e)}),document.createElement("span")),s=(s.className="lexavatar",e.appendChild(s),t.headerImage?((a=document.createElement("img")).src=t.headerImage,s.appendChild(a)):t.headerIcon&&(a=b.makeIcon(t.headerIcon),s.appendChild(a)),document.createElement("div")),a=(s.className="infodefault",e.appendChild(s),document.createElement("span")),a=(a.innerHTML=t.headerTitle??"",s.appendChild(a),document.createElement("span"));return a.innerHTML=t.headerSubtitle??"",s.appendChild(a),e}_generateDefaultFooter(t){let s=document.createElement("div");s.addEventListener("click",e=>{t.onFooterPressed&&t.onFooterPressed(e,s)});var e=document.createElement("span"),e=(e.className="lexavatar",s.appendChild(e),t.footerImage?((a=document.createElement("img")).src=t.footerImage,e.appendChild(a)):t.footerIcon&&(a=b.makeIcon(t.footerIcon),e.appendChild(a)),document.createElement("div")),a=(e.className="infodefault",s.appendChild(e),document.createElement("span")),a=(a.innerHTML=t.footerTitle??"",e.appendChild(a),document.createElement("span")),e=(a.innerHTML=t.footerSubtitle??"",e.appendChild(a),b.makeIcon("menu-arrows"));return s.appendChild(e),s}toggleCollapsed(e){if(this.collapsable){if(this.collapsed=e??!this.collapsed,this.collapsed?(this.root.classList.add("collapsing"),this.root.parentElement.style.width=this._collapseWidth):(this.root.classList.remove("collapsing"),this.root.classList.remove("collapsed"),this.root.parentElement.style.width=this.root.parentElement.ogWidth),!this.resizeObserver)throw"Wait until ResizeObserver has been created!";this.resizeObserver.observe(this.root.parentElement),x(()=>{this.root.classList.toggle("collapsed",this.collapsed),this.resizeObserver.unobserve(this.root.parentElement)},250)}}separator(){this.currentGroup=null,this.add("")}group(e,t){this.currentGroup=e,this.groups[e]=t}add(e,i={}){i.constructor==Function&&(i={callback:i});let n=e.split("/");e=n[n.length-1];this.icons[e]=i.icon;let r=0,o=(a,e)=>{if(null!=a){let s=null;var t,l;e.forEach(e=>{var t=Object.keys(e).find(e=>e==a);t&&(s=e[t])}),s?o(n[r++],s):((t={})[a]=[],(l=n[r++])||(t.callback=i.callback,t.group=this.currentGroup,t.options=i),e.push(t),o(l,t[a]))}};o(n[r++],this.items)}select(e){let t=e.replace(/\s/g,"").replaceAll(".","");e=this.items.find(e=>e.name===t);e&&e.dom.click()}update(){this.content.innerHTML="";for(var e of this.items)delete e.dom;for(let r of this.items){let l=r.options??{};if(!r.dom){let n=Object.keys(r)[0];if(!this.filterString.length||n.toLowerCase().includes(this.filterString.toLowerCase())){var o=n.replace(/\s/g,"").replaceAll(".","");let t=null,i=document.createElement("div");if(i.className="lexsidebarentry "+(l.className??""),i.id=r.name=o,r.group){var s=r.group.replace(/\s/g,"").replaceAll(".","");if(t=this.content.querySelector("#"+s)){if(!t.classList.contains("lexsidebargroup"))throw"Bad id: "+r.group}else{(t=document.createElement("div")).id=s,t.className="lexsidebargroup",this.content.appendChild(t);var s=document.createElement("div"),c=(s.className="lexsidebargrouptitle",t.appendChild(s),document.createElement("div"));c.innerHTML=r.group,s.appendChild(c),null!=this.groups[r.group]&&((c=document.createElement("a")).className=(this.groups[r.group].icon??"")+" lexicon",s.appendChild(c),c.addEventListener("click",e=>{this.groups[r.group].callback&&this.groups[r.group].callback(r.group,e)}))}}if(""==o){s=document.createElement("div");s.className="lexsidebarseparator",this.content.appendChild(s)}else{this.collapseContainer?(this.collapseContainer.appendChild(i),this.collapseQueue--,this.collapseQueue||delete this.collapseContainer):(t||this.content).appendChild(i);let s=document.createElement("div");i.appendChild(s),r.dom=i,"checkbox"==l.type?(r.value=l.value??!1,c=new z,r.checkbox=c.addCheckbox(null,r.value,(e,t)=>{t.preventDefault(),t.stopPropagation();var s=l.callback;r.value=e,s&&s.call(this,n,e,t)},{label:n,signal:"@checkbox_"+n}),s.appendChild(c.root.childNodes[0])):(l.icon&&((o=document.createElement("i")).className=l.icon,s.appendChild(o)),(o=document.createElement("a")).innerHTML=n,s.appendChild(o));let a=null!=l.collapsable?l.collapsable:l.collapsable||r[n].length,e=(i.addEventListener("click",e=>{var t;e.target&&e.target.classList.contains("lexcheckbox")||(a?s.querySelector(".collapser").click():((t=l.callback)&&t.call(this,n,r.value,e),r.checkbox&&(r.value=!r.value,r.checkbox.set(r.value,!0))),this.displaySelected&&(this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected")),i.classList.add("selected")))}),l.action?(o=b.makeIcon(l.action.icon??"more-horizontal",l.action.name),s.appendChild(o),o.addEventListener("click",e=>{e.preventDefault(),e.stopImmediatePropagation();var t=l.action.callback;t&&t.call(this,n,e)})):a&&((o=document.createElement("div")).className="collapsablecontainer",Object.assign(o.style,{width:"100%",display:"none"}),b.makeCollapsible(s,o,t??this.content),this.collapseQueue=l.collapsable,this.collapseContainer=o),document.createElement("span"));if(e.className="lexsidebarentrydesc",e.innerHTML=n,i.appendChild(e),s.addEventListener("mouseenter",()=>{setTimeout(()=>{e.style.display="unset"},150)}),s.addEventListener("mouseleave",()=>{setTimeout(()=>{e.style.display="none"},150)}),r[n].length){var d=document.createElement("div");d.className="lexsidebarsubentrycontainer",a?(this.collapseContainer.appendChild(d),delete this.collapseContainer):(t?(d.classList.add("collapsablecontainer"),t):this.content).appendChild(d);for(let e=0;e<r[n].length;++e){var h=r[n][e];let a=h.options??{},l=Object.keys(h)[0];if(!this.filterString.length||l.toLowerCase().includes(this.filterString.toLowerCase())){let s=document.createElement("div");s.innerHTML=`<span>${l}</span>`,a.action&&(h=b.makeIcon(a.action.icon??"more-horizontal",a.action.name),s.appendChild(h),h.addEventListener("click",e=>{e.preventDefault(),e.stopImmediatePropagation();var t=a.action.callback;t&&t.call(this,l,e)})),s.className="lexsidebarentry",s.id=l,d.appendChild(s),s.addEventListener("click",e=>{var t=a.callback;t&&t.call(this,l,s,e),this.displaySelected&&(this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected")),i.classList.add("selected"))})}}}}}}}}}b.SideBar=i;class w{static NONE=0;static TEXT=1;static TEXTAREA=2;static BUTTON=3;static SELECT=4;static CHECKBOX=5;static TOGGLE=6;static RADIO=7;static BUTTONS=8;static COLOR=9;static RANGE=10;static NUMBER=11;static TITLE=12;static VECTOR=13;static TREE=14;static PROGRESS=15;static FILE=16;static LAYERS=17;static ARRAY=18;static LIST=19;static TAGS=20;static CURVE=21;static CARD=22;static IMAGE=23;static CONTENT=24;static CUSTOM=25;static SEPARATOR=26;static KNOB=27;static SIZE=28;static PAD=29;static FORM=30;static DIAL=31;static COUNTER=32;static TABLE=33;static TABS=34;static LABEL=35;static BLANK=36;static NO_CONTEXT_TYPES=[w.BUTTON,w.LIST,w.FILE,w.PROGRESS];constructor(e,s,a,l={}){this.type=e,this.name=s,this.options=l,this._initialValue=a;var i=document.createElement("div");if(i.className="lexwidget",l.id&&(i.id=l.id),l.title&&(i.title=l.title),l.className&&(i.className+=" "+l.className),e!=w.TITLE&&(l.width&&(i.style.width=i.style.minWidth=l.width),l.maxWidth&&(i.style.maxWidth=l.maxWidth),l.minWidth&&(i.style.minWidth=l.minWidth),l.height)&&(i.style.height=i.style.minHeight=l.height),null!=s){if(!l.hideName){e=document.createElement("div");e.className="lexwidgetname",l.justifyName&&e.classList.add("float-"+l.justifyName),e.innerHTML=s,e.title=l.title??e.innerHTML,e.style.width=l.nameWidth||b.DEFAULT_NAME_WIDTH,i.appendChild(e),i.domName=e;let t=this;e.addEventListener("contextmenu",function(e){e.preventDefault(),t.oncontextmenu(e)}),l.skipReset||null==a||this._addResetProperty(e,function(e){t.set(t._initialValue,!1,e),this.style.display="none"})}}else l.hideName=!0;l.signal&&b.addSignal(l.signal,this),this.root=i,(this.root.jsInstance=this).options=l}static _dispatchEvent(e,t,s,a,l){t=new CustomEvent(t,{detail:s,bubbles:a,cancelable:l});e.dispatchEvent(t)}_addResetProperty(e,t){var s=b.makeIcon("rotate-left","Reset");return s.style.display="none",s.style.marginRight="6px",s.style.marginLeft="0",s.style.paddingInline="6px",s.addEventListener("click",t),e.appendChild(s),s}_canPaste(){return this.type===w.CUSTOM?void 0!==navigator.clipboard.customIdx&&this.customIdx==navigator.clipboard.customIdx:navigator.clipboard.type===this.type}_trigger(e,t,s=this){t&&t.call(s,e.value,e.domEvent,e.name)}value(){if(this.onGetValue)return this.onGetValue();console.warn("Can't get value of "+this.typeName())}set(e,t,s){var a,l;if(this.onSetValue)return(a=this.root.querySelector(".lexwidgetname .lexicon"))&&(a.style.display=e!=this.value()?"block":"none",l=e.constructor===Array?((e,t)=>{if(e!==t){if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var s=0;s<e.length;++s)if(e[s]!==t[s])return!1}return!0})(e,this._initialValue):e==this._initialValue,a.style.display=l?"none":"block"),this.onSetValue(e,t??!1,s);console.warn("Can't set value of "+this.typeName())}oncontextmenu(e){w.NO_CONTEXT_TYPES.includes(this.type)||P(this.typeName(),e,e=>{e.add("Copy",()=>{this.copy()}),e.add("Paste",{disabled:!this._canPaste(),callback:()=>{this.paste()}})})}copy(){navigator.clipboard.type=this.type,navigator.clipboard.customIdx=this.customIdx,navigator.clipboard.data=this.value(),navigator.clipboard.writeText(navigator.clipboard.data)}paste(){this._canPaste()&&this.set(navigator.clipboard.data)}typeName(){switch(this.type){case w.TEXT:return"Text";case w.TEXTAREA:return"TextArea";case w.BUTTON:return"Button";case w.SELECT:return"Select";case w.CHECKBOX:return"Checkbox";case w.TOGGLE:return"Toggle";case w.RADIO:return"Radio";case w.COLOR:return"Color";case w.RANGE:return"Range";case w.NUMBER:return"Number";case w.VECTOR:return"Vector";case w.TREE:return"Tree";case w.PROGRESS:return"Progress";case w.FILE:return"File";case w.LAYERS:return"Layers";case w.ARRAY:return"Array";case w.LIST:return"List";case w.TAGS:return"Tags";case w.CURVE:return"Curve";case w.KNOB:return"Knob";case w.SIZE:return"Size";case w.PAD:return"Pad";case w.FORM:return"Form";case w.DIAL:return"Dial";case w.COUNTER:return"Counter";case w.TABLE:return"Table";case w.TABS:return"Tabs";case w.LABEL:return"Label";case w.BLANK:return"Blank";case w.CUSTOM:return this.customName}console.error("Unknown Widget type: "+this.type)}refresh(){}}b.Widget=w,b.ADD_CUSTOM_WIDGET=function(p,m={}){let e=L();z.prototype["add"+p]=function(l,i,n){let r=new w(w.CUSTOM,l,null,m),o=(this._attachWidget(r),r.customName=p,r.customIdx=e,r.onGetValue=()=>i,r.onSetValue=(e,t,s)=>{i=e,u(),o.querySelector(".lexcustomitems").toggleAttribute("hidden",!1),t||r._trigger(new E(l,i,s),n)},r.root);o.style.flexWrap="wrap";let c,d,h=m.default??{},u=()=>{i&&(r.instance=i=Object.assign(v(h),i)),c&&c.remove(),d&&d.remove(),(c=document.createElement("div")).className="lexcustomcontainer",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";c.style.width=`calc( 100% - ${e})`});var e="<a class='fa-solid "+(m.icon??"fa-cube")+"' style='float:left'></a>",e=(e=e+(p+(i?"":" [empty]"))+("<a class='fa-solid "+(i?"fa-bars-staggered":" ")+" menu' style='float:right; width:5%;'></a>"),this.addButton(null,e,(e,t)=>{i?o.querySelector(".lexcustomitems").toggleAttribute("hidden"):P(null,t,e=>{e.add("New "+p,()=>{i={},u(),o.querySelector(".lexcustomitems").toggleAttribute("hidden",!1)})})},{buttonClass:"custom"}));if(c.appendChild(e.root),i&&e.root.querySelector("a.menu").addEventListener("click",e=>{e.stopImmediatePropagation(),e.stopPropagation(),P(null,e,e=>{e.add("Clear",()=>{i=null,u()})})}),(d=document.createElement("div")).className="lexcustomitems",d.toggleAttribute("hidden",!0),o.appendChild(c),o.appendChild(d),i){this.queue(d);var t,s=(e,t,s)=>{i[e]=t,r._trigger(new E(l,i,s),n)};for(t in h){var a=i[t]??h[t];switch(a.constructor){case String:"#"===a[0]?this.addColor(t,a,s.bind(this,t)):this.addText(t,a,s.bind(this,t));break;case Number:this.addNumber(t,a,s.bind(this,t));break;case Boolean:this.addCheckbox(t,a,s.bind(this,t));break;case Array:4<a.length?this.addArray(t,a,s.bind(this,t)):this._addVector(a.length,t,a,s.bind(this,t))}}this.clearQueue()}};u()}};class B{constructor(e,t,s){if(this.domEl=e,this.data=t,this.onevent=s.onevent,this.options=s,this.selected=[],this._forceClose=!1,t.constructor===Object)this._createItem(null,t);else for(var a of t)this._createItem(null,a)}_createItem(e,i,t=0,s){let n=this;var a=this.domEl.querySelector("#lexnodetree_filter");if(i.children=i.children??[],a&&""!=a.value&&!i.id.includes(a.value)){for(var l=0;l<i.children.length;++l)this._createItem(i,i.children[l],t+1,s);return}let r=this.domEl.querySelector("ul"),o=(i.visible=i.visible??!0,i.parent=e,0<i.children.length);a=-1<this.selected.indexOf(i)||i.selected;if(this.options.onlyFolders){let t=!1;i.children.forEach(e=>t|="folder"==e.type),o=!!t}let c=document.createElement("li"),d=(c.className="lextreeitem datalevel"+t+(o?" parent":"")+(a?" selected":""),c.id=b.getSupportedDOMName(i.id),c.tabIndex="0",c.treeData=i,this.options.skip_default_icon??!0?"":"fa-solid fa-square");o&&(d=i.closed?"fa-solid fa-caret-right":"fa-solid fa-caret-down",c.innerHTML="<a class='"+d+" hierarchy'></a>"),d=i.icon,i.icon&&(i.icon.includes("fa-")?c.innerHTML+="<a class='"+i.icon+" tree-item-icon'></a>":c.innerHTML+="<img src='https://raw.githubusercontent.com/jxarco/lexgui.js/master/"+i.icon+"'>"),c.innerHTML+=i.rename?"":i.id,c.setAttribute("draggable",!0),c.style.paddingLeft=3+15*(t+1)+"px",r.appendChild(c),c.addEventListener("click",e=>{var t;h?h=!1:(e.shiftKey||(r.querySelectorAll("li").forEach(e=>{e.classList.remove("selected")}),this.selected.length=0),-1<(t=this.selected.indexOf(i))?(c.classList.remove("selected"),this.selected.splice(t,1)):(c.classList.add("selected"),this.selected.push(i)),o&&1<i.id.length&&(i.closed=!1,n.onevent&&(t=new y(y.NODE_CARETCHANGED,i,i.closed),n.onevent(t)),n.frefresh(i.id)),n.onevent&&((t=new y(y.NODE_SELECTED,e.shiftKey?this.selected:i)).multiple=e.shiftKey,n.onevent(t)))}),c.addEventListener("dblclick",function(){var e;(n.options.rename??!0)&&(i.rename=!0,n.refresh()),n.onevent&&(e=new y(y.NODE_DBLCLICKED,i),n.onevent(e))}),c.addEventListener("contextmenu",s=>{if(s.preventDefault(),n.onevent){let t=new y(y.NODE_CONTEXTMENU,1<this.selected.length?this.selected:i,s);t.multiple=1<this.selected.length,b.addContextMenu(t.multiple?"Selected Nodes":t.node.id,t.value,e=>{t.panel=e}),n.onevent(t),this.options.addDefault&&(t.panel.items&&t.panel.add(""),t.panel.add("Select Children",()=>{let s=e=>{if(!e.closed)for(var t of e.children??[])t&&(this.domEl.querySelector("#"+t.id).classList.add("selected"),this.selected.push(t),s(t))};this.domEl.querySelectorAll(".selected").forEach(e=>e.classList.remove("selected")),this.selected.length=0,s(i)}),t.panel.add("Delete",{callback:()=>{var e,t;i.parent&&(n.onevent&&(e=new y(y.NODE_DELETED,i,s),n.onevent(e)),t=(e=i.parent.children).indexOf(i),e.splice(t,1),this.refresh())}}))}}),c.addEventListener("keydown",e=>{if(!i.rename)if(e.preventDefault(),"Delete"==e.key){var t;n.onevent&&((l=new y(y.NODE_DELETED,1<this.selected.length?this.selected:i,e)).multiple=1<this.selected.length,n.onevent(l));for(t of this.selected){var s=t.parent.children,a=s.indexOf(t);s.splice(a,1)}this.selected.length=0,this.refresh()}else{var l;("ArrowUp"==e.key||"ArrowDown"==e.key)&&(l=1<this.selected.length?"ArrowUp"==e.key?this.selected.shift():this.selected.pop():this.selected[0],l=this.domEl.querySelector("#"+b.getSupportedDOMName(l.id)),e="ArrowUp"==e.key?l.previousSibling:l.nextSibling)&&e.click()}});a=document.createElement("input");a.toggleAttribute("hidden",!i.rename),a.value=i.id,c.appendChild(a),i.rename&&(c.classList.add("selected"),a.focus()),a.addEventListener("keyup",function(e){var t;"Enter"==e.key?(this.value=this.value.replace(/\s/g,"_"),n.onevent&&(t=new y(y.NODE_RENAMED,i,this.value),n.onevent(t)),i.id=b.getSupportedDOMName(this.value),delete i.rename,n.frefresh(i.id),r.querySelector("#"+i.id).classList.add("selected")):"Escape"==e.key&&(delete i.rename,n.frefresh(i.id))}),a.addEventListener("blur",function(e){delete i.rename,n.refresh()}),(this.options.draggable??!0)&&(e&&c.addEventListener("dragstart",e=>{window.__tree_node_dragged=i}),c.addEventListener("dragover",e=>{e.preventDefault()},!1),c.addEventListener("dragenter",e=>{e.target.classList.add("draggingover")}),c.addEventListener("dragleave",e=>{e.target.classList.remove("draggingover")}),c.addEventListener("drop",e=>{e.preventDefault();let t=window.__tree_node_dragged;if(t){var s,e=i;if(t.id==e.id)console.warn("Cannot parent node to itself!");else{let l=function(e,t){var s,a=!1;for(s of t.children){if(s.id==e.id)return!0;a|=l(e,s)}return a};l(e,t)?console.warn("Cannot parent node to a current child!"):(n.onevent&&(s=new y(y.NODE_DRAGGED,t,e),n.onevent(s)),s=t.parent.children.findIndex(e=>e.id==t.id),s=t.parent.children.splice(s,1),e.children.push(s[0]),n.refresh(),delete window.__tree_node_dragged)}}}));let h=!1;o&&c.querySelector("a.hierarchy").addEventListener("click",function(e){if(h=!0,e.stopImmediatePropagation(),e.stopPropagation(),e.altKey){let s=function(e){e.closed=!e.closed;for(var t of e.children)s(t)};s(i)}else i.closed=!i.closed;n.onevent&&(e=new y(y.NODE_CARETCHANGED,i,i.closed),n.onevent(e)),n.frefresh(i.id)});var u=document.createElement("div");if(c.appendChild(u),i.actions)for(let e=0;e<i.actions.length;++e){let t=i.actions[e],s=document.createElement("a");s.className="lexicon "+t.icon,s.title=t.name,s.addEventListener("click",function(e){t.callback(i,s),e.stopPropagation()}),u.appendChild(s)}i.skipVisibility||((a=document.createElement("a")).className="lexicon fa-solid fa-eye"+(i.visible?"":"-slash"),a.title="Toggle visible",a.addEventListener("click",function(e){e.stopPropagation(),i.visible=void 0!==i.visible&&!i.visible,this.className="lexicon fa-solid fa-eye"+(i.visible?"":"-slash"),n.onevent&&(e=new y(y.NODE_VISIBILITY,i,i.visible),n.onevent(e))}),u.appendChild(a));let p=function(e,t){for(var s of e.children)return s.id==t||p(s,t)};e=p(i,s);if(!i.closed||e)for(l=0;l<i.children.length;++l){var m=i.children[l];this.options.onlyFolders&&"folder"!=m.type||this._createItem(i,m,t+1,s)}}refresh(e,t){this.data=e??this.data,this.domEl.querySelector("ul").innerHTML="",this._createItem(null,this.data,0,t)}frefresh(e){this.refresh();e=this.domEl.querySelector("#"+e);e&&e.focus()}select(e){this.refresh(null,e),this.domEl.querySelectorAll(".selected").forEach(e=>e.classList.remove("selected")),this.selected.length=0;e=this.domEl.querySelector("#"+e);e&&(e.classList.add("selected"),this.selected=[e.treeData],e.focus())}}class r extends w{constructor(e,t){super(w.BLANK),this.root.style.width=e??"auto",this.root.style.height=t??"8px"}}b.Blank=r;class _ extends w{constructor(e,t={}){console.assert(e,"Can't create Title Widget without text!"),super(w.TITLE,null,null,t),this.root.className="lextitle",t.icon&&((s=document.createElement("a")).className=t.icon,s.style.color=t.iconColor||"",this.root.appendChild(s));var s=document.createElement("span");s.innerText=e,this.root.appendChild(s),Object.assign(this.root.style,t.style??{}),null!=t.link&&((s=document.createElement("a")).innerText=e,s.href=t.link,s.target=t.target??"",s.className="lextitle link",Object.assign(s.style,t.style??{}),this.root.replaceWith(s))}}b.Title=_;class N extends w{constructor(a,l,i,n={}){super(w.TEXT,a,String(l),n),this.onGetValue=()=>l,this.onSetValue=(e,t,s)=>{this.valid(e)&&this._lastValueTriggered!=e&&(this._lastValueTriggered=l=e,n.disabled?r.innerText=e:r.value=e,t||this._trigger(new E(a,e,s),i))},this.valid=e=>!(e=e??this.value()).length||""==r.pattern||new RegExp(r.pattern).test(e);let t=document.createElement("div"),r=(t.className="lextext"+(n.warning?" lexwarning":""),t.style.display="flex",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";t.style.width=n.inputWidth??`calc( 100% - ${e})`}),n.textClass&&t.classList.add(n.textClass),this.disabled=(n.disabled||n.warning)??!!n.url,null);var e;this.disabled?(r=document.createElement(n.url?"a":"div"),n.url&&(r.href=n.url,r.target="_blank"),r.innerHTML=(n.warning?'<i class="fa-solid fa-triangle-exclamation"></i>':"")+l||"",r.style.width="100%",r.style.textAlign=n.float??""):((r=document.createElement("input")).type=n.type||"",r.value=r.iValue=l||"",r.style.width="100%",r.style.textAlign=n.float??"",r.setAttribute("placeholder",n.placeholder??""),n.required&&r.setAttribute("required",n.required),n.pattern&&r.setAttribute("pattern",n.pattern),"default"==(e=n.trigger??"default")?(r.addEventListener("keyup",e=>{"Enter"==e.key&&r.blur()}),r.addEventListener("focusout",e=>{this.set(e.target.value,!1,e)})):"input"==e&&r.addEventListener("input",e=>{this.set(e.target.value,!1,e)}),r.addEventListener("mousedown",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),n.icon&&((e=document.createElement("a")).className="inputicon "+n.icon,t.appendChild(e))),Object.assign(r.style,n.style??{}),t.appendChild(r),this.root.appendChild(t)}}b.Text=Text;class H extends w{constructor(a,l,i,t={}){super(w.TEXTAREA,a,l,t),this.onGetValue=()=>l,this.onSetValue=(e,t,s)=>{n.value=l=e,t||this._trigger(new E(a,e,s),i)};let s=document.createElement("div"),n=(s.className="lextextarea",s.style.display="flex",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";s.style.width=t.inputWidth??`calc( 100% - ${e})`,s.style.height=t.height,t.fitHeight&&(n.style.height=n.scrollHeight+"px")}),document.createElement("textarea"));n.value=n.iValue=l||"",n.style.width="100%",n.style.textAlign=t.float??"",Object.assign(n.style,t.style??{}),t.disabled&&n.setAttribute("disabled",!0),t.placeholder&&n.setAttribute("placeholder",t.placeholder);var e=t.trigger??"default";"default"==e?(n.addEventListener("keyup",function(e){"Enter"==e.key&&n.blur()}),n.addEventListener("focusout",e=>{this.set(e.target.value,!1,e)})):"input"==e&&n.addEventListener("input",e=>{this.set(e.target.value,!1,e)}),t.icon&&((e=document.createElement("a")).className="inputicon "+t.icon,s.appendChild(e)),s.appendChild(n),this.root.appendChild(s)}}b.TextArea=H;class T extends w{constructor(t,s,a,l={}){super(w.BUTTON,t,null,l),this.onGetValue=()=>i.innerText,this.onSetValue=(e,t,s)=>{i.innerHTML=l.icon?"<a class='"+l.icon+"'></a>":l.img?"<img src='"+l.img+"'>":"<span>"+(e||"")+"</span>"};var i=document.createElement("button"),e=(i.title=l.title??"",i.className="lexbutton "+(l.buttonClass??""),l.selected&&i.classList.add("selected"),i.innerHTML=l.icon?"<a class='"+l.icon+"'></a>":l.img?"<img src='"+l.img+"'>":"<span>"+(s||"")+"</span>",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";i.style.width=`calc( 100% - ${e})`}),l.disabled&&i.setAttribute("disabled",!0),i.addEventListener("click",e=>{l.selectable&&(l.parent&&l.parent.querySelectorAll(".lexbutton.selected").forEach(e=>{e!=i&&e.classList.remove("selected")}),i.classList.toggle("selected")),this._trigger(new E(t,s,e),a)}),this.root.appendChild(i),!l.hideName&&!(l.icon||l.img));e||(i.className+=" noname",i.style.width="100%")}}b.Button=T;class W extends w{constructor(a,l,e={}){let i=!e.noSelection,n=i&&(e.toggle??!1),r=document.createElement("div"),o=(r.className="lexcombobuttons ",e.skipReset=!0,e.float&&(r.className+=e.float),x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";r.style.width=`calc( 100% - ${e})`}),[]);var c=document.createElement("div");c.className="lexcombobuttonsbox ";for(let s of l){if(!s.value)throw"Set 'value' for each button!";let t=document.createElement("button");t.className="lexbutton combo",t.title=s.icon?s.value:"",t.id=s.id??"",t.dataset.value=s.value,e.buttonClass&&t.classList.add(e.buttonClass),i&&(s.selected||e.selected==s.value)&&(t.classList.add("selected"),o=o.concat([s.value])),t.innerHTML=(s.icon?"<a class='"+s.icon+"'></a>":"")+"<span>"+(s.icon?"":s.value)+"</span>",s.disabled&&t.setAttribute("disabled",!0),t.addEventListener("click",e=>{o=[],i&&(n?t.classList.toggle("selected"):(r.querySelectorAll("button").forEach(e=>e.classList.remove("selected")),t.classList.add("selected"))),r.querySelectorAll("button").forEach(e=>{e.classList.contains("selected")&&o.push(e.dataset.value)}),!n&&1<o.length?console.error("Enable _options.toggle_ to allow selecting multiple options in ComboButtons."):(o=o[0],this.set(s.value,!1,t.classList.contains("selected")))}),c.appendChild(t)}1<o.length?(e.toggle=!0,n=i,console.warn(`Multiple options selected in '${a}' ComboButtons. Enabling _toggle_ mode.`)):o=o[0],super(w.BUTTONS,a,null,e),this.onGetValue=()=>o,this.onSetValue=(t,e,s)=>{i&&null==s&&(r.querySelectorAll("button").forEach(e=>e.classList.remove("selected")),r.querySelectorAll("button").forEach(e=>{o&&-1<o.indexOf(e.dataset.value)&&e.classList.add("selected")})),e||t.constructor==Array||(e=s,s=l.filter(e=>e.value==t)[0]?.callback,this._trigger(new E(a,n?[t,e]:t,null),s))},r.appendChild(c),this.root.appendChild(r)}}b.ComboButtons=W;class V extends w{constructor(t,s={}){s.hideName=!0,super(w.CARD,t,null,s);let a=document.createElement("div");a.className="lexcard",a.style.width="100%",s.img&&((l=document.createElement("img")).src=s.img,a.appendChild(l),null!=s.link)&&(l.style.cursor="pointer",l.addEventListener("click",function(){var e=a.querySelector("a");e&&e.click()}));var e,l=document.createElement("span");l.innerText=t,null!=s.link&&((e=document.createElement("a")).innerText=t,e.href=s.link,e.target=s.target??"",l.innerText="",l.appendChild(e)),s.callback&&(a.style.cursor="pointer",a.addEventListener("click",e=>{this._trigger(new E(t,null,e),s.callback)})),a.appendChild(l),this.root.appendChild(a)}}b.Card=V;class q extends w{constructor(e,a,l,t={}){if(a.constructor!=Object)return void console.error("Form data must be an Object");t.hideName=!0,super(w.FORM,e,null,t),this.onGetValue=()=>n.formData,this.onSetValue=(t,s,e)=>{n.formData=t;var a,l,i=n.querySelectorAll(".lexwidget");for(let e=0;e<i.length;++e)i[e].jsInstance.type==b.Widget.TEXT&&(a=i[e].querySelector(".lexwidgetname").innerText,(l=i[e].querySelector(".lextext input")).value=t[a]??"",w._dispatchEvent(l,"focusout",s))};let n=document.createElement("div");n.className="lexformdata",n.style.width="100%",n.formData={};for(let t in a){let e=a[t];(e=e.constructor!=Object?{}:e).placeholder=e.placeholder??t,e.width="calc(100% - 10px)",e.textWidget=new N(null,e.constructor==Object?e.value:e,e=>{n.formData[t]=e},e),n.appendChild(e.textWidget.root),n.formData[t]=e.constructor==Object?e.value:e}n.appendChild((new r).root);e=new T(null,t.actionName??"Submit",(e,t)=>{for(var s in a)if(!a[s].textWidget.valid())return;l&&l(n.formData,t)},{buttonClass:"primary",width:"calc(100% - 10px)"});n.appendChild(e.root),this.root.appendChild(n)}}b.Form=q;class M extends w{constructor(i,n,o,r,t={}){super(w.SELECT,i,o,t),this.onGetValue=()=>o,this.onSetValue=(t,e,s)=>{o=t;let a=null;var l;m.childNodes.forEach(e=>{e.classList.remove("selected"),e.getAttribute("value")==t&&(a=e)}),console.assert(a,`Item ${t} does not exist in the Select.`),a.classList.add("selected"),d.refresh(o),p&&(p.querySelector("input").value="",l=this._filterOptions(n,""),u.refresh(l)),e||this._trigger(new E(i,o,s),r)};let s=document.createElement("div"),c=(s.className="lexselect",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";s.style.width=t.inputWidth??`calc( 100% - ${e})`}),document.createElement("div"));c.className="lexselect lexoption",c.name=i;var e=c.iValue=o;e+="<a class='fa-solid fa-angle-down' style='float:right; margin-right: 3px;'></a>";let d=new T(null,e,(e,t)=>{u.unfocus_event?delete u.unfocus_event:(h.classList.remove("place-above"),h.hasAttribute("open")?h.close():(h.show(),(s=>{var a=d.root,l=s.getParentArea();let i=a.getBoundingClientRect();var n=s.parentElement.closest("dialog");{var r=s.offsetHeight;let t=i.y,e=window.innerHeight;if(l&&(o=l.getBoundingClientRect(),e=o.y+o.height),n){let e=n.getBoundingClientRect();t-=e.y}s.style.top=t+a.offsetHeight+"px",t+r>e&&(s.style.top=t-r+"px",s.classList.add("place-above"))}{var o=s.offsetWidth;let t=i.x;if(s.style.minWidth=i.width+"px",n){let e=n.getBoundingClientRect();t-=e.x}s.style.left=t+"px";let e=window.innerWidth;l&&(a=l.getBoundingClientRect(),e=a.x+a.width),t+o>e&&(s.style.left=t-(o-i.width)+"px")}})(h)),p&&p.querySelector("input").focus())},{buttonClass:"array",skipInlineCount:!0,disabled:t.disabled}),h=(s.appendChild(d.root),d.root.style.width="100%",d.refresh=e=>{var t=d.root.querySelector("span");""==t.innerText?t.innerText=e:t.innerHTML=t.innerHTML.replaceAll(t.innerText,e)},document.createElement("dialog")),u=(h.className="lexselectoptions",document.createElement("ul")),p=(u.tabIndex=-1,u.className="lexoptions",h.appendChild(u),u.addEventListener("focusout",function(e){if(e.stopPropagation(),e.stopImmediatePropagation(),e.relatedTarget===d.root.querySelector("button"))this.unfocus_event=!0,setTimeout(()=>delete this.unfocus_event,200);else{if(e.relatedTarget&&"INPUT"==e.relatedTarget.tagName)return;if("lexinput-filter"==e.target.className)return}h.close()}),null),m=(t.filter&&((e=b.deepCopy(t)).placeholder=e.placeholder??"Search...",e.skipWidget=e.skipWidget??!0,e.trigger="input",e.icon="fa-solid fa-magnifying-glass",e.className="lexfilter noname",(e=new N(null,t.filterValue??"",e=>{e=this._filterOptions(n,e);u.refresh(e)},e)).root.querySelector(".lextext").classList.remove("lextext"),e.root.querySelector("input").addEventListener("focusout",function(e){e.relatedTarget&&"UL"==e.relatedTarget.tagName&&e.relatedTarget.classList.contains("lexoptions")||h.close()}),u.appendChild(e.root)),document.createElement("span"));m.className="lexselectinnerlist",u.appendChild(m),u.refresh=t=>{var e,s;if(m.innerHTML="",t.length)for(let e=0;e<t.length;e++){var a,l=t[e],i=document.createElement("li"),n=document.createElement("div"),r=(n.className="option",i.appendChild(n),e=>{this.set(e.currentTarget.getAttribute("value"),!1,e),h.close()});i.addEventListener("click",r),l.constructor!=Object?((a="@"===l[0])?(n.innerHTML="<span>"+l.substr(1)+"</span>",i.removeEventListener("click",r)):(n.innerHTML="</a><span>"+l+"</span><a class='fa-solid fa-check'>",n.value=l,i.setAttribute("value",l),l==o&&(i.classList.add("selected"),c.innerHTML=l)),i.classList.add(a?"lexselectlabel":"lexselectitem")):((r=document.createElement("img")).src=l.src,i.setAttribute("value",l.value),i.className="lexlistitem",n.innerText=l.value,n.className+=" media",n.prepend(r),n.setAttribute("value",l.value),n.setAttribute("data-index",e),n.setAttribute("data-src",l.src),n.setAttribute("title",l.value),o==l.value&&i.classList.add("selected")),m.appendChild(i)}else s=t.emptyMsg??"No options found.",(e=document.createElement("div")).className="option",e.innerHTML=s,(s=document.createElement("li")).className="lexselectitem empty",s.appendChild(e),m.appendChild(s)},u.refresh(n),s.appendChild(h),this.root.appendChild(s)}_filterOptions(t,s){var a=!s.length,l=[];for(let e=0;e<t.length;e++){var i=t[e];if(!a){var n="string"==typeof i?i:i.value,r=s.toLowerCase();if(!n.toLowerCase().includes(r))continue}l.push(i)}return l}}b.Select=M;class S extends w{constructor(a,e,l,t={}){var s=JSON.parse(JSON.stringify(e)),i=(super(w.CURVE,a,s,t),this.onGetValue=()=>JSON.parse(JSON.stringify(n.element.value)),this.onSetValue=(e,t,s)=>{n.element.value=JSON.parse(JSON.stringify(e)),n.redraw(),t||this._trigger(new E(a,n.element.value,s),l)},document.createElement("div"));i.className="lexcurve",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";i.style.width=`calc( 100% - ${e})`}),t.callback=(e,t)=>{this._trigger(new E(a,e,t),l)},t.name=a;let n=new de(e,t);i.appendChild(n.element),this.root.appendChild(i),this.onresize=n.redraw.bind(n),this.curveInstance=n,x(()=>{n.canvas.width=i.offsetWidth,n.redraw()})}}b.Curve=S;class U extends w{constructor(a,e,l,t={}){var s=JSON.parse(JSON.stringify(e)),i=(super(w.DIAL,a,s,t),this.onGetValue=()=>JSON.parse(JSON.stringify(n.element.value)),this.onSetValue=(e,t,s)=>{n.element.value=JSON.parse(JSON.stringify(e)),n.redraw(),t||this._trigger(new E(a,n.element.value,s),l)},document.createElement("div"));i.className="lexcurve",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";i.style.width=`calc( 100% - ${e})`}),t.callback=(e,t)=>{this._trigger(new E(a,e,t),l)},t.name=a;let n=new he(this,e,t);i.appendChild(n.element),this.root.appendChild(i),this.onresize=n.redraw.bind(n),this.curveInstance=n,x(()=>{n.element.style.height=n.element.offsetWidth+"px",n.canvas.width=n.element.offsetWidth,i.style.width=n.element.offsetWidth+"px",n.canvas.height=n.canvas.width,n.redraw()})}}b.Curve=S;class F extends w{constructor(a,l,i,e={}){super(w.LAYERS,a,l,e),this.onGetValue=()=>l,this.onSetValue=(e,t,s)=>{l=e,r(),t||this._trigger(new E(a,l,s),i)};var n=document.createElement("div");n.className="lexlayers",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";n.style.width=`calc( 100% - ${e})`});let r=()=>{n.innerHTML="";let t=l.toString(2);var s=t.length;for(let e=0;e<16-s;++e)t="0"+t;for(let s=0;s<16;++s){var e,a=document.createElement("div");a.className="lexlayer",null!=l&&null!=(e=t[16-s-1])&&"1"==e&&a.classList.add("selected"),a.innerText=s+1,a.title="Bit "+s+", value "+(1<<s),n.appendChild(a),a.addEventListener("click",e=>{e.stopPropagation(),e.stopImmediatePropagation(),e.target.classList.toggle("selected");var t=l^1<<s;this.set(t,!1,e)})}};r(),this.root.appendChild(n)}}b.Layers=F;class G extends w{constructor(l,i=[],n,r={}){super(w.ARRAY,l,null,r),this.onGetValue=()=>i,this.onSetValue=(e,t,s)=>{i=e,this._updateItems(),t||this._trigger(new E(l,i,s),n)},this.root.style.flexWrap="wrap";var t=document.createElement("div");t.className="lexarray",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";t.style.width=`calc( 100% - ${e})`});let s="<a class='fa-solid fa-angle-down' style='float:right; margin-right: 3px;'></a>",a="Array (size "+i.length+")";a+=s;var e=new T(null,a,()=>{this.root.querySelector(".lexarrayitems").toggleAttribute("hidden")},{buttonClass:"array"});t.appendChild(e.root);let o=document.createElement("div");o.className="lexarrayitems",o.toggleAttribute("hidden",!0),this.root.appendChild(t),this.root.appendChild(o),this._updateItems=()=>{var e=this.root.querySelector(".lexbutton.array span");e.innerHTML="Array (size "+i.length+")",e.innerHTML+=s,o.innerHTML="";for(let a=0;a<i.length;++a){let s=i[a];var t=r.innerValues?"select":s.constructor;let e=null;switch(t){case String:e=new N(a+"",s,function(e,t){i[a]=e,n(i)},{nameWidth:"4%",inputWidth:"95%",skipReset:!0});break;case Number:e=new k(a+"",s,function(e,t){i[a]=e,n(i)},{nameWidth:"4%",inputWidth:"95%",skipReset:!0});break;case"select":e=new M(a+"",r.innerValues,s,function(e,t){i[a]=e,n(i)},{nameWidth:"4%",inputWidth:"95%",skipReset:!0})}console.assert(e,`Value of type ${t} cannot be modified in ItemArray`),o.appendChild(e.root),e=new T(null,"<a class='lexicon fa-solid fa-trash'></a>",(e,t)=>{i.splice(i.indexOf(s),1),this._updateItems(),this._trigger(new E(l,i,t),n)},{title:"Remove item",className:"micro"}),o.appendChild(e.root)}a="Add item",a+="<a class='fa-solid fa-plus' style='float:right; margin-right: 3px; margin-top: 2px;'></a>";e=new T(null,a,(e,t)=>{i.push(r.innerValues?r.innerValues[0]:""),this._updateItems(),this._trigger(new E(l,i,t),n)},{buttonClass:"array"});o.appendChild(e.root)},this._updateItems()}}b.ItemArray=G;class j extends w{constructor(i,n,r,o,e={}){super(w.LIST,i,r,e),this.onGetValue=()=>r,this.onSetValue=(t,e,s)=>{c.querySelectorAll(".lexlistitem").forEach(e=>e.classList.remove("selected"));let a=null;for(let e=0;e<n.length;++e){var l=n[e];if(l==t||l.constructor==Array&&l[0]==t){a=e;break}}a?(c.children[a].classList.toggle("selected"),r=t,e||this._trigger(new E(i,t,s),o)):console.error(`Cannot find item ${t} in List.`)},this._updateValues=e=>{n=e,c.innerHTML="";for(let a=0;a<n.length;++a){let e=null,t=n[a],s=(t.constructor===Array&&(e=t[1],t=t[0]),document.createElement("div"));s.className="lexlistitem"+(r==t?" selected":""),s.innerHTML="<span>"+t+"</span>"+(e?"<a class='"+e+"'></a>":""),s.addEventListener("click",e=>{c.querySelectorAll(".lexlistitem").forEach(e=>e.classList.remove("selected")),s.classList.toggle("selected"),r=t,this._trigger(new E(i,t,e),o)}),c.appendChild(s)}};let c=document.createElement("div");c.className="lexlist",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";c.style.width=`calc( 100% - ${e})`}),this._updateValues(n),this.root.appendChild(c)}}b.List=j;class $ extends w{constructor(a,l,i,e={}){l=l.replace(/\s/g,"").split(",");var t=[].concat(l);super(w.TAGS,a,t,e),this.onGetValue=()=>[].concat(l),this.onSetValue=(e,t,s)=>{l=[].concat(e),r(),t||this._trigger(new E(a,l,s),i)};let n=document.createElement("div"),r=(n.className="lextags",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";n.style.width=`calc( 100% - ${e})`}),()=>{n.innerHTML="";for(let e=0;e<l.length;++e){let t=l[e],s=document.createElement("span");s.className="lextag",s.innerHTML=t;var a=document.createElement("a");a.className="lextagrmb fa-solid fa-xmark lexicon",s.appendChild(a),a.addEventListener("click",e=>{s.remove(),l.splice(l.indexOf(t),1),this.set(l,!1,e)}),n.appendChild(s)}let s=document.createElement("input");s.value="",s.placeholder="Add tag...",n.appendChild(s),s.onkeydown=e=>{var t=s.value.replace(/\s/g,"");" "!=e.key&&"Enter"!=e.key||(e.preventDefault(),!t.length)||-1<l.indexOf(t)||(l.push(t),this.set(l,!1,e))},s.focus()});r(),this.root.appendChild(n)}}b.Tags=$;class K extends w{constructor(a,l,i,t={}){if(!a&&!t.label)throw"Set Widget Name or at least a label!";super(w.CHECKBOX,a,l,t),this.onGetValue=()=>l,this.onSetValue=(e,t,s)=>{e==l||(n.checked=l=e,this.root.querySelector(".lexcheckboxsubmenu")?.toggleAttribute("hidden",!e),t)||this._trigger(new E(a,e,s),i)};var s=document.createElement("div");s.className="lexcheckboxcont",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";s.style.width=t.inputWidth??`calc( 100% - ${e})`});let n=document.createElement("input");n.type="checkbox",n.className="lexcheckbox "+(t.className??""),n.checked=l,n.disabled=t.disabled??!1;var e,r=document.createElement("span");r.className="checkboxtext",r.innerHTML=t.label??"On",s.appendChild(n),s.appendChild(r),n.addEventListener("change",e=>{this.set(n.checked,!1,e)}),this.root.appendChild(s),t.suboptions&&(this.root.style.flexWrap="wrap",(r=document.createElement("div")).className="lexcheckboxsubmenu",r.toggleAttribute("hidden",!n.checked),(e=new z).queue(r),t.suboptions.call(this,e),e.clearQueue(),this.root.appendChild(r))}}b.Checkbox=K;class Y extends w{constructor(a,l,i,t={}){if(!a&&!t.label)throw"Set Widget Name or at least a label!";super(w.TOGGLE,a,l,t),this.onGetValue=()=>n.checked,this.onSetValue=(e,t,s)=>{e==l||(n.checked=l=e,this.root.querySelector(".lextogglesubmenu")?.toggleAttribute("hidden",!e),t)||this._trigger(new E(a,e,s),i)};var s=document.createElement("div");s.className="lextogglecont",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";s.style.width=t.inputWidth??`calc( 100% - ${e})`});let n=document.createElement("input");n.type="checkbox",n.className="lextoggle "+(t.className??""),n.checked=l,n.iValue=l,n.disabled=t.disabled??!1;var e,r=document.createElement("span");r.className="toggletext",r.innerHTML=t.label??"On",s.appendChild(n),s.appendChild(r),n.addEventListener("change",e=>{this.set(n.checked,!1,e)}),this.root.appendChild(s),t.suboptions&&(this.root.style.flexWrap="wrap",(r=document.createElement("div")).className="lextogglesubmenu",r.toggleAttribute("hidden",!n.checked),(e=new z).queue(r),t.suboptions.call(this,e),e.clearQueue(),this.root.appendChild(r))}}b.Toggle=Y;class X extends w{constructor(e,t,l,i,s={}){super(w.RADIO,e,null,s);let a=null;this.onGetValue=()=>{var e=n.querySelectorAll("button");return a?[a,e[a]]:void 0},this.onSetValue=(e,t,s)=>{e=e[0]??e,console.assert(e.constructor==Number,"RadioGroup _value_ must be an Array index!");var a=n.querySelectorAll("button"),a=(a.forEach(e=>{e.checked=!1,e.classList.remove("checked")}),a[e]);a.checked=!a.checked,a.classList.toggle("checked"),t||this._trigger(new E(null,[e,l[e]],s),i)};var n=document.createElement("div"),e=(n.className="lexradiogroup "+(s.className??""),document.createElement("span"));e.innerHTML=t,n.appendChild(e);for(let t=0;t<l.length;++t){var r=document.createElement("div"),o=(r.className="lexradiogroupitem",n.appendChild(r),document.createElement("button")),c=(o.className="lexbutton",o.disabled=s.disabled??!1,r.appendChild(o),o.addEventListener("click",e=>{this.set(t,!1,e)}),document.createElement("span")),o=(o.appendChild(c),document.createElement("span"));o.innerHTML=l[t],r.appendChild(o)}s.selected&&(console.assert(s.selected.constructor==Number,"RadioGroup _selected_ must be an Array index!"),a=s.selected,this.set(a,!0)),this.root.appendChild(n)}}b.RadioGroup=X;class Z extends w{constructor(a,l,i,e={}){l=l.constructor===Array?s(l):l,super(w.COLOR,a,l,e),this.onGetValue=()=>l,this.onSetValue=(e,t,s)=>{n.useRGB&&(e=o(e)),s&&r.set(e,!0,s),n.value=l=e,t||this._trigger(new E(a,e,s),i)};var t=document.createElement("span");t.className="lexcolor",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";t.style.width=`calc( 100% - ${e})`});let n=document.createElement("input"),r=(n.style.width="32px",n.type="color",n.className="colorinput",n.id="color"+L(),n.useRGB=e.useRGB??!1,n.value=n.iValue=l,e.disabled&&(n.disabled=!0),n.addEventListener("input",e=>{this.set(e.target.value,!1,e)},!1),t.appendChild(n),new N(null,n.value,e=>{this.set(e)},{width:"calc( 100% - 32px )"}));r.root.style.marginLeft="4px",t.appendChild(r.root),this.root.appendChild(t)}}b.ColorInput=Z;class J extends w{constructor(a,l,i,n={}){super(w.RANGE,a,l,n),this.onGetValue=()=>l,this.onSetValue=(e,t,s)=>{isNaN(e)||(r.value=l=g(+e,+r.min,+r.max),t)||this._trigger(new E(a,n.left?+r.max-l+ +r.min:l,s),i)};var t=document.createElement("div");t.className="lexrange",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";t.style.width=n.inputWidth??`calc( 100% - ${e})`});let r=document.createElement("input");r.className="lexrangeslider "+(n.className??""),r.value=r.iValue=l,r.min=n.min??0,r.max=n.max??100,r.step=n.step??1,r.type="range",r.disabled=n.disabled??!1,n.left&&r.classList.add("left"),(n.fill??!0)||r.classList.add("no-fill"),r.addEventListener("input",e=>{this.set(e.target.valueAsNumber,!1,e)},{passive:!1}),r.addEventListener("mousedown",function(e){n.onPress&&n.onPress.bind(r)(e,r)},!1),r.addEventListener("mouseup",function(e){n.onRelease&&n.onRelease.bind(r)(e,r)},!1),this.setLimits=(e,t,s)=>{r.min=e??r.min,r.max=t??r.max,r.step=s??r.step,w._dispatchEvent(r,"input",!0)},l.constructor==Number&&(l=g(l,+r.min,+r.max)),t.appendChild(r),this.root.appendChild(t)}}b.RangeInput=J;class k extends w{constructor(a,l,i,n={}){super(w.NUMBER,a,l,n),this.onGetValue=()=>l,this.onSetValue=(e,t,s)=>{isNaN(e)||(l=g(+e,+o.min,+o.max),o.value=l=f(l,n.precision),r.querySelector(".lexinputslider")&&(r.querySelector(".lexinputslider").value=l),n.units&&(o.unitSpan.style.left=u(l)+"px"),t)||this._trigger(new E(a,l,s),i)};var e,t=document.createElement("div");t.className="lexnumber",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";t.style.width=n.inputWidth??`calc( 100% - ${e})`});let r=document.createElement("div"),o=(r.className="numberbox",document.createElement("input")),s=(o.id="number_"+L(),o.className="vecinput",o.min=n.min??-1e24,o.max=n.max??1e24,o.step=n.step??"any",o.type="number",l.constructor==Number&&(l=f(l=g(l,+o.min,+o.max),n.precision)),o.value=o.iValue=l,r.appendChild(o),n.units&&((e=document.createElement("span")).className="lexunit",e.innerText=n.units,e.style.left=u(o.value)+"px",o.unitSpan=e,r.appendChild(e)),document.createElement("a"));if(s.className="fa-solid fa-arrows-up-down drag-icon hidden",r.appendChild(s),n.disabled&&(o.disabled=!0),!n.skipSlider&&void 0!==n.min&&void 0!==n.max){let a=document.createElement("input");a.className="lexinputslider",a.min=n.min,a.max=n.max,a.step=n.step??1,a.type="range",a.value=l,a.addEventListener("input",e=>{this.set(a.valueAsNumber,!1,e)},!1),a.addEventListener("mousedown",function(e){n.onPress&&n.onPress.bind(a)(e,a)},!1),a.addEventListener("mouseup",function(e){n.onRelease&&n.onRelease.bind(a)(e,a)},!1),r.appendChild(a),this.setLimits=(e,t,s)=>{o.min=a.min=e??o.min,o.max=a.max=t??o.max,o.step=s??o.step,a.step=s??a.step,this.set(l,!0)}}o.addEventListener("input",function(e){l=f(l=+this.valueAsNumber,n.precision),n.units&&(o.unitSpan.style.left=u(o.value)+"px")},!1),o.addEventListener("wheel",t=>{if(t.preventDefault(),o===document.activeElement){let e=n.step??1;t.shiftKey?e*=10:t.altKey&&(e*=.1),l=+o.valueAsNumber-e*(0<t.deltaY?1:-1),this.set(l,!1,t)}},{passive:!1}),o.addEventListener("change",e=>{this.set(o.valueAsNumber,!1,e)},{passive:!1});var c=this;let d=t=>{var s=-t.movementY;if(0!=s){let e=n.step??1;t.shiftKey?e*=10:t.altKey&&(e*=.1),l=+o.valueAsNumber+e*s,this.set(l,!1,t)}t.stopPropagation(),t.preventDefault()},h=e=>{var t=c.root.ownerDocument;t.removeEventListener("mousemove",d),t.removeEventListener("mouseup",h),document.body.classList.remove("noevents"),s.classList.add("hidden"),document.pointerLockElement&&document.exitPointerLock(),n.onRelease&&n.onRelease.bind(o)(e,o)};o.addEventListener("mousedown",e=>{var t;document.activeElement!=o&&((t=c.root.ownerDocument).addEventListener("mousemove",d),t.addEventListener("mouseup",h),document.body.classList.add("noevents"),s.classList.remove("hidden"),e.stopImmediatePropagation(),e.stopPropagation(),document.pointerLockElement||o.requestPointerLock(),n.onPress)&&n.onPress.bind(o)(e,o)}),t.appendChild(r),this.root.appendChild(t)}}b.NumberInput=k;class Q extends w{constructor(t,l,i,n,r={}){t=g(t,2,4),i=i??new Array(t).fill(0),super(w.VECTOR,l,[].concat(i),r),this.onGetValue=()=>{var e,t=[];for(e of this.root.querySelectorAll("input"))t.push(+e.value);return t},this.onSetValue=(t,e,s)=>{if(o.length!=t.length)console.error("Input length does not match vector length.");else{for(let e=0;e<o.length;++e){var a;a=f(g(t[e],+o[e].min,+o[e].max),r.precision)??0,o[e].value=t[e]=a}e||this._trigger(new E(l,t,s),n)}};let o=[];var a=document.createElement("div");a.className="lexvector",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";a.style.width=`calc( 100% - ${e})`});let c=this;for(let e=0;e<t;++e){var d=document.createElement("div");d.className="vecbox",d.innerHTML="<span class='"+z.VECTOR_COMPONENTS[e]+"'></span>";let l=document.createElement("input"),s=(l.className="vecinput v"+t,l.min=r.min??-1e24,l.max=r.max??1e24,l.step=r.step??"any",l.type="number",l.id="vec"+t+"_"+L(),l.idx=e,o[e]=l,i[e].constructor==Number&&(i[e]=g(i[e],+l.min,+l.max),i[e]=f(i[e],r.precision)),l.value=l.iValue=i[e],document.createElement("a"));function h(e){var t;document.activeElement!=l&&((t=c.root.ownerDocument).addEventListener("mousemove",u),t.addEventListener("mouseup",p),document.body.classList.add("noevents"),s.classList.remove("hidden"),e.stopImmediatePropagation(),e.stopPropagation(),document.pointerLockElement||l.requestPointerLock(),r.onPress)&&r.onPress.bind(l)(e,l)}function u(t){var s=-t.movementY;if(0!=s){let e=r.step??1;if(t.shiftKey?e=10:t.altKey&&(e=.1),m.locked)for(var a of this.root.querySelectorAll(".vecinput"))a.value=f(+a.valueAsNumber+e*s,r.precision),w._dispatchEvent(a,"change");else l.value=f(+l.valueAsNumber+e*s,r.precision),w._dispatchEvent(l,"change")}t.stopPropagation(),t.preventDefault()}function p(e){var t=c.root.ownerDocument;t.removeEventListener("mousemove",u),t.removeEventListener("mouseup",p),document.body.classList.remove("noevents"),s.classList.add("hidden"),document.pointerLockElement&&document.exitPointerLock(),r.onRelease&&r.onRelease.bind(l)(e,l)}s.className="fa-solid fa-arrows-up-down drag-icon hidden",d.appendChild(s),r.disabled&&(l.disabled=!0),l.addEventListener("wheel",function(t){if(t.preventDefault(),this===document.activeElement){let e=r.step??1;if(t.shiftKey?e=10:t.altKey&&(e=.1),m.locked)for(var s of c.querySelectorAll(".vecinput"))s.value=f(+s.valueAsNumber-e*(0<t.deltaY?1:-1),r.precision),w._dispatchEvent(s,"change");else this.value=f(+this.valueAsNumber-e*(0<t.deltaY?1:-1),r.precision),w._dispatchEvent(l,"change")}},{passive:!1}),l.addEventListener("change",e=>{if(!isNaN(e.target.value)){var t=f(g(e.target.value,+l.min,+l.max),r.precision);if(m.locked)for(var s of o)s.value=t,i[s.idx]=t;else l.value=t,i[e.target.idx]=t;this.set(i,!1,e)}},!1),l.addEventListener("mousedown",h),d.appendChild(l),a.appendChild(d)}void 0===r.min&&void 0===r.max||(this.setLimits=(e,t,s)=>{for(var a of o)a.min=e??a.min,a.max=t??a.max,a.step=s??a.step;this.set(i,!0)});let m=document.createElement("a");m.title="Lock",m.className="fa-solid fa-lock-open lexicon lock",a.appendChild(m),m.addEventListener("click",function(e){this.locked=!this.locked,this.locked?(this.classList.add("fa-lock"),this.classList.remove("fa-lock-open")):(this.classList.add("fa-lock-open"),this.classList.remove("fa-lock"))},!1),this.root.appendChild(a)}}b.Vector=Q;class ee extends w{constructor(e,t,i,s={}){super(w.SIZE,e,t,s),this.onGetValue=()=>{var t=[];for(let e=0;e<this.root.dimensions.length;++e)t.push(this.root.dimensions[e].value());return t},this.onSetValue=(t,s,e)=>{for(let e=0;e<this.root.dimensions.length;++e)this.root.dimensions[e].set(t[e],s)},this.root.aspectRatio=2==t.length?t[0]/t[1]:null,this.root.dimensions=[];for(let l=0;l<t.length;++l){var a=new z;this.root.dimensions[l]=a.addNumber(null,t[l],e=>{var t,s,a=this.value();this.root.locked&&(t=0==l?1/this.root.aspectRatio:this.root.aspectRatio,a[s=(1+l)%2]=e*t,this.root.dimensions[s].set(a[s],!0)),i&&i(a)},{min:0,disabled:s.disabled,precision:s.precision}),this.root.appendChild(this.root.dimensions[l].root),l+1!=t.length&&((a=document.createElement("a")).className="lexsizecross fa-solid fa-xmark",this.root.appendChild(a))}if(s.units&&((e=document.createElement("span")).className="lexunit",e.innerText=s.units,this.root.appendChild(e)),this.root.aspectRatio){let s=document.createElement("a");s.title="Lock Aspect Ratio",s.className="fa-solid fa-lock-open lexicon lock",this.root.appendChild(s),s.addEventListener("click",e=>{var t;this.root.locked=!this.root.locked,this.root.locked?(s.classList.add("fa-lock"),s.classList.remove("fa-lock-open"),t=this.value(),this.root.aspectRatio=t[0]/t[1]):(s.classList.add("fa-lock-open"),s.classList.remove("fa-lock"))},!1)}}}b.SizeInput=ee;class te extends w{constructor(l,e,i,s={}){super(w.PAD,l,null,s),this.onGetValue=()=>r.value.xy,this.onSetValue=(e,t,s)=>{r.value.set(e[0],e[1]),a(r.value),t||this._trigger(new E(l,r.value.xy),i)};var t=document.createElement("div");t.className="lexpad",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";t.style.width=`calc( 100% - ${e})`});let n=document.createElement("div"),r=(n.id="lexpad-"+l,n.className="lexinnerpad",n.style.width=s.padSize??"96px",n.style.height=s.padSize??"96px",document.createElement("div")),a=(r.className="lexpadthumb",r.value=new b.vec2(e[0],e[1]),r.min=s.min??0,r.max=s.max??1,e=>{var[t,s]=[n.offsetWidth,n.offsetHeight],e=new b.vec2(h(e.x,r.min,r.max,0,1),h(e.y,r.min,r.max,0,1));r.style.transform=`translate(calc( ${t*e.x}px - 50% ), calc( ${s*e.y}px - 50%)`}),o=(x(()=>{a(r.value)}),n.appendChild(r),t.appendChild(n),this.root.appendChild(t),n.addEventListener("mousedown",function(e){var t;document.activeElement!=r&&((t=o.root.ownerDocument).addEventListener("mousemove",c),t.addEventListener("mouseup",d),document.body.classList.add("nocursor"),document.body.classList.add("noevents"),e.stopImmediatePropagation(),e.stopPropagation(),s.onPress)&&s.onPress.bind(r)(e,r)}),this);function c(e){var t=n.getBoundingClientRect(),t=new b.vec2(e.x-t.x,e.y-t.y),[s,a]=(t.clp(0,n.offsetWidth,t),[n.offsetWidth,n.offsetHeight]),t=t.div(new b.vec2(n.offsetWidth,n.offsetHeight));r.style.transform=`translate(calc( ${s*t.x}px - 50% ), calc( ${a*t.y}px - 50%)`,r.value=new b.vec2(h(t.x,0,1,r.min,r.max),h(t.y,0,1,r.min,r.max)),o._trigger(new E(l,r.value.xy,e),i),e.stopPropagation(),e.preventDefault()}function d(e){var t=o.root.ownerDocument;t.removeEventListener("mousemove",c),t.removeEventListener("mouseup",d),document.body.classList.remove("nocursor"),document.body.classList.remove("noevents"),s.onRelease&&s.onRelease.bind(r)(e,r)}}}b.Pad=te;class se extends w{constructor(e,t,l={}){super(w.PROGRESS,e,t,l),this.onGetValue=()=>i.value,this.onSetValue=(e,t,s)=>{this.root.querySelector("meter").value=e,n(),this.root.querySelector("span")&&(this.root.querySelector("span").innerText=e)};var s,a=document.createElement("div");a.className="lexprogress",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";a.style.width=`calc( 100% - ${e})`});let i=document.createElement("meter"),n=(i.id="lexprogressbar-"+e,i.className="lexprogressbar",i.step="any",i.min=l.min??0,i.max=l.max??1,i.low=l.low??i.low,i.high=l.high??i.high,i.optimum=l.optimum??i.optimum,i.value=t,()=>{let e=b.getThemeColor("global-selected");null!=i.low&&i.value<i.low?e=b.getThemeColor("global-color-error"):null!=i.high&&i.value<i.high&&(e=b.getThemeColor("global-color-warning")),i.style.background=`color-mix(in srgb, ${e} 20%, transparent)`});if(a.appendChild(i),this.root.appendChild(a),l.showValue&&(document.getElementById("progressvalue-"+e)&&document.getElementById("progressvalue-"+e).remove(),(s=document.createElement("span")).id="progressvalue-"+e,s.style.padding="0px 5px",s.innerText=t,a.appendChild(s)),l.editable){i.classList.add("editable");let s=e=>{var t;0!=e.movementX&&(t=i.getBoundingClientRect(),t=f(h(e.offsetX-t.x,0,t.width,i.min,i.max)),this.set(t,!1,e),l.callback)&&l.callback(t,e),e.stopPropagation(),e.preventDefault()},a=e=>{var t=this.root.ownerDocument;t.removeEventListener("mousemove",s),t.removeEventListener("mouseup",a),document.body.classList.remove("noevents"),i.classList.remove("grabbing")};i.addEventListener("mousedown",e=>{var t=this.root.ownerDocument,t=(t.addEventListener("mousemove",s),t.addEventListener("mouseup",a),document.body.classList.add("noevents"),i.classList.add("grabbing"),e.stopImmediatePropagation(),e.stopPropagation(),i.getBoundingClientRect()),t=f(h(e.offsetX,0,t.width,i.min,i.max));this.set(t,!1,e)})}n()}}b.Progress=se;class ae extends w{constructor(e,s,a={}){super(w.FILE,e,null,a);e=a.local??!0;let l=a.type??"text",i=a.read??!0,n=document.createElement("input");if(n.className="lexfileinput",n.type="file",n.disabled=a.disabled??!1,x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";n.style.width=`calc( 100% - ${e} - 10%)`}),a.placeholder&&(n.placeholder=a.placeholder),n.addEventListener("change",function(e){let t=e.target.files;t.length&&(i?(a.onBeforeRead&&a.onBeforeRead(),e=new FileReader,"text"===l?e.readAsText(t[0]):"buffer"===l?e.readAsArrayBuffer(t[0]):"bin"===l?e.readAsBinaryString(t[0]):"url"===l&&e.readAsDataURL(t[0]),e.onload=e=>{s.call(this,e.target.result,t[0])}):s(t[0]))}),n.addEventListener("cancel",function(e){s(null)}),this.root.appendChild(n),e){let t=null;e=new T(null,"<a style='margin-top: 0px;' class='fa-solid fa-gear'></a>",()=>{t=t||new A("Load Settings",e=>{e.addSelect("Type",["text","buffer","bin","url"],l,e=>{l=e}),e.addButton(null,"Reload",e=>{n.dispatchEvent(new Event("change"))})},{onclose:e=>{e.remove(),t=null}})},{className:"micro",skipInlineCount:!0,title:"Settings"});this.root.appendChild(e.root)}}}b.FileInput=ae;class le extends w{constructor(e,t,s={}){s.hideName=!0,super(w.TREE,e,null,s);var a=document.createElement("div"),l=(a.className="lextree",this.root.appendChild(a),e&&((r=document.createElement("span")).innerHTML=e,a.appendChild(r)),document.createElement("div"));if(l.className="lextreetools",e||(l.className+=" notitle"),s.icons)for(var i of s.icons){var n=document.createElement("a");n.title=i.name,n.className="lexicon "+i.icon,n.addEventListener("click",i.callback),l.appendChild(n)}s.filter=s.filter??!0;var r=null,r=(s.filter&&((r=document.createElement("input")).id="lexnodetree_filter",r.setAttribute("placeholder","Filter.."),r.style.width="calc( 100% - 17px )",r.addEventListener("input",()=>{this.innerTree.refresh()}),(e=document.createElement("a")).className="lexicon fa-solid fa-magnifying-glass",l.appendChild(r),l.appendChild(e)),(s.icons||s.filter)&&a.appendChild(l),document.createElement("ul"));r.addEventListener("contextmenu",function(e){e.preventDefault()}),a.appendChild(r),this.innerTree=new B(a,t,s)}}b.Tree=le;class ie extends w{constructor(e,l,t={}){if(t.hideName=!0,super(w.TABS,e,null,t),l.constructor!=Array)throw"Param @tabs must be an Array!";var e=t.vertical??!0,i=!e&&(t.showNames??!1);let n=document.createElement("div"),r=(n.className="lextabscontainer",e||(n.className+=" horizontal"),document.createElement("div"));r.className="tabs",n.appendChild(r),this.root.appendChild(n);for(let e=0;e<l.length;++e){let t=l[e];console.assert(t.name);var o=0==e;let s=document.createElement("div"),a=(s.className="lextab "+(e==l.length-1?"last":"")+(o?"selected":""),s.innerHTML=(i?t.name:"")+"<a class='"+(t.icon||"fa fa-hashtag")+" "+(i?"withname":"")+"'></a>",s.title=t.name,document.createElement("div"));a.id=t.name.replace(/\s/g,""),a.className="widgets",o||a.toggleAttribute("hidden",!0),n.appendChild(a),s.addEventListener("click",e=>{r.querySelectorAll(".lextab").forEach(e=>{e.classList.remove("selected")}),s.classList.add("selected"),n.querySelectorAll(".widgets").forEach(e=>{e.toggleAttribute("hidden",!0)}),n.querySelector("#"+a.id).toggleAttribute("hidden"),t.onSelect&&t.onSelect(this,a)}),r.appendChild(s),t.onCreate&&((o=new z).queue(a),t.onCreate.call(this,o),o.clearQueue())}}}b.TabSections=ie;class ne extends w{constructor(a,e,l,t={}){super(w.COUNTER,a,e,t),this.onGetValue=()=>c.count,this.onSetValue=(e,t,s)=>{e=g(e,i,n),c.count=e,c.innerHTML=e,t||this._trigger(new E(a,e,s),l)};let i=t.min??0,n=t.max??100,r=t.step??1;var s=document.createElement("div"),o=(s.className="lexcounter",this.root.appendChild(s),new T(null,"<a style='margin-top: 0px;' class='fa-solid fa-minus'></a>",(e,t)=>{let s=r??1;t.shiftKey&&(s*=10),this.set(c.count-s,!1,t)},{className:"micro",skipInlineCount:!0,title:"Minus"})),o=(s.appendChild(o.root),document.createElement("div"));o.className="lexcounterbox",s.appendChild(o);let c=document.createElement("span");c.className="lexcountervalue",c.innerHTML=e,c.count=e,o.appendChild(c),t.label&&((e=document.createElement("span")).className="lexcounterlabel",e.innerHTML=t.label,o.appendChild(e));t=new T(null,"<a style='margin-top: 0px;' class='fa-solid fa-plus'></a>",(e,t)=>{let s=r??1;t.shiftKey&&(s*=10),this.set(c.count+s,!1,t)},{className:"micro",skipInlineCount:!0,title:"Plus"});s.appendChild(t.root)}}b.Counter=ne;class re extends w{constructor(e,v,L={}){if(!v)throw"Data is needed to create a table!";super(w.TABLE,e,null,L);let t=document.createElement("div"),E=(t.className="lextable",x(()=>{var e=(this.root.domName?.offsetWidth??0)+"px";t.style.width=`calc( 100% - ${e})`}),this.centered=L.centered??!1,!0===this.centered&&t.classList.add("centered"),document.createElement("table")),s=(t.appendChild(E),v.head=v.head??[],v.body=v.body??[],v.colVisibilityMap={},v.checkMap={},(e,t,s,a)=>s[e]<a[e]?-t:s[e]>a[e]?t:0),y=(e,t)=>{v.body=v.body.sort(s.bind(this,e,t)),this.refreshTable()};this.refreshTable=()=>{E.innerHTML="";let s=0;var e,a,t,l,i=document.createElement("thead"),n=(i.className="lextablehead",E.appendChild(i),document.createElement("tr"));L.sortable&&((e=document.createElement("th")).style.width="0px",n.appendChild(e),s++),L.selectable&&((e=document.createElement("th")).style.width="0px",(t=document.createElement("input")).type="checkbox",t.className="lexcheckbox",t.checked=v.checkMap[":root"]??!1,e.appendChild(t),t.addEventListener("change",function(){var e;v.checkMap[":root"]=this.checked;for(e of E.querySelector("tbody").childNodes)v.checkMap[e.getAttribute("rowId")]=this.checked,e.querySelector("input").checked=this.checked}),s++,n.appendChild(e));for(a of v.head){var r=document.createElement("th");r.innerHTML=a+' <a class="fa-solid fa-sort"></a>';let t=v.head.indexOf(a);this.centered&&-1<this.centered.indexOf(t)&&r.classList.add("centered"),r.addEventListener("click",e=>{new b.DropdownMenu(e.target,[{name:"Asc",icon:"up",callback:y.bind(this,t,1)},{name:"Desc",icon:"down",callback:y.bind(this,t,-1)},null,{name:"Hide",icon:"eye-slash",callback:()=>{v.colVisibilityMap[t]=0,E.querySelectorAll(`tr > *:nth-child(${t+s+1})`).forEach(e=>{e.style.display="none"===e.style.display?"":"none"})}}],{side:"bottom",align:"start"})}),n.appendChild(r)}L.rowActions&&((t=document.createElement("th")).className="sm",n.appendChild(t)),i.appendChild(n);{var c,d,h,u=document.createElement("tbody");u.className="lextablebody",E.appendChild(u);let i=null,n=!1,r=null,o=(document.addEventListener("mouseup",e=>{var t;i&&(document.removeEventListener("mousemove",o),(t=E.rows[i]).dY=0,t.classList.remove("dragging"),Array.from(E.rows).forEach(e=>{e.style.transform="",e.style.transition="none"}),C(t),i=null,r&&(r[0].parentNode.insertChildAtIndex(r[0],r[1]),r=null),x(()=>{Array.from(E.rows).forEach(e=>{e.style.transition="transform 0.2s ease-in"})}))}),e=>{var t;i&&((t=E.rows[i]).dY=t.dY??0,t.dY+=e.movementY,t.style.transform=`translateY(${t.dY}px)`)});for(let l=0;l<v.body.length;++l){let s=v.body[l],a=document.createElement("tr"),e=b.getSupportedDOMName(s.join("-"));a.setAttribute("rowId",e.substr(0,16)),L.sortable&&((d=document.createElement("td")).style.width="0px",c=b.makeIcon("grip-vertical"),d.appendChild(c),c.draggable=!0,c.addEventListener("dragstart",e=>{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),i=a.rowIndex,a.classList.add("dragging"),document.addEventListener("mousemove",o)},!1),a.addEventListener("mouseenter",function(e){var t;e.preventDefault(),i&&this.rowIndex!=i&&n!=this.rowIndex&&(n=this.rowIndex,e=E.rows[i],t=""!=this.style.transform,this.rowIndex>i?(r=[e,t?this.rowIndex-1:this.rowIndex],this.style.transform=t?"":`translateY(-${this.offsetHeight}px)`):(r=[e,t?this.rowIndex:this.rowIndex-1],this.style.transform=t?"":`translateY(${this.offsetHeight}px)`),x(()=>{n=!1}))}),a.appendChild(d)),L.selectable&&(c=document.createElement("td"),(d=document.createElement("input")).type="checkbox",d.className="lexcheckbox",d.checked=v.checkMap[e],c.appendChild(d),d.addEventListener("change",function(){v.checkMap[e]=this.checked,this.checked||(E.querySelector("thead input[type='checkbox']").checked=v.checkMap[":root"]=!1)}),a.appendChild(c));for(h of s){var p=document.createElement("td"),m=(p.innerHTML=""+h,s.indexOf(h));this.centered&&-1<this.centered.indexOf(m)&&p.classList.add("centered"),a.appendChild(p)}if(L.rowActions){var g=document.createElement("td"),f=(g.style.width="0px",document.createElement("div"));f.className="lextablebuttons",g.appendChild(f);for(let t of L.rowActions){let e=null;"delete"==t?(e=b.makeIcon("trash-can","Delete Row")).addEventListener("click",function(){v.body.splice(l,1),a.remove()}):"menu"==t?(e=b.makeIcon("more-horizontal","Menu")).addEventListener("click",function(e){P(null,e,e=>{L.onMenuAction?L.onMenuAction(e):console.warn("Using <Menu action> without action callbacks.")})}):(console.assert(t.constructor==Object),e=b.makeIcon(t.icon,t.title),t.callback&&e.addEventListener("click",e=>{t.callback(s,E,e)&&this.refreshTable()})),console.assert(e),f.appendChild(e)}a.appendChild(g)}u.appendChild(a)}}for(l in v.colVisibilityMap){var o=parseInt(l);v.colVisibilityMap[o]||E.querySelectorAll(`tr > *:nth-child(${o+s+1})`).forEach(e=>{e.style.display="none"===e.style.display?"":"none"})}},this.refreshTable(),this.root.appendChild(t)}}b.Table=re;class z{constructor(e={}){var t=document.createElement("div");t.className="lexpanel",e.id&&(t.id=e.id),e.className&&(t.className+=" "+e.className),t.style.width=e.width||"calc( 100% - 6px )",t.style.height=e.height||"100%",Object.assign(t.style,e.style??{}),this.root=t,this.branches=[],this.widgets={},this._branchOpen=!1,this._currentBranch=null,this._queue=[],this._inlineWidgetsLeft=-1,this._inline_queued_container=null}get(e){return this.widgets[e]}getValue(e){var t=this.widgets[e];if(t)return t.value();throw"No widget called "+e}setValue(e,t,s){var a=this.widgets[e];if(a)return a.set(t,s);throw"No widget called "+e}attach(e){console.assert(e,"No content to attach!"),(e.parent=this).root.appendChild(e.root||e)}clear(){for(var t in this._branchOpen=!1,this.branches=[],this._currentBranch=null,this.widgets)if(this.widgets[t].options&&this.widgets[t].options.signal){var s=this.widgets[t].options.signal;for(let e=0;e<b.signals[s].length;e++)b.signals[s][e]==this.widgets[t]&&(b.signals[s]=[...b.signals[s].slice(0,e),...b.signals[s].slice(e+1)])}if(this.signals)for(let e=0;e<this.signals.length;e++){var a=Object.values(this.signals[e])[0],l=a.options.signal;for(let e=0;e<b.signals[l].length;e++)b.signals[l][e]==a&&(b.signals[l]=[...b.signals[l].slice(0,e),...b.signals[l].slice(e+1)])}this.widgets={},this.root.innerHTML=""}sameLine(e){this._inline_queued_container=this.queuedContainer,this._inlineWidgetsLeft=e||1/0}endLine(e){if(-1==this._inlineWidgetsLeft)console.warn("No pending widgets to be inlined!");else{this._inlineWidgetsLeft=-1,this._inlineContainer||(this._inlineContainer=document.createElement("div"),this._inlineContainer.className="lexinlinewidgets",e&&(this._inlineContainer.style.justifyContent=e));for(var t of this._inlineWidgets)t.constructor==Array?(this._inline_queued_container?this._inlineContainer:t[1]).appendChild(t[0]):this._inlineContainer.appendChild(t);(this._inline_queued_container||(this._currentBranch?this._currentBranch.content:this.root)).appendChild(this._inlineContainer),delete this._inlineWidgets,delete this._inlineContainer}}branch(e,t={}){this._branchOpen&&this.merge();e=new oe(e,t);return(e.panel=this)._branchOpen=!0,this._currentBranch=e,0==this.branches.length&&e.root.classList.add("first"),this.root.querySelectorAll(".lexbranch.last").forEach(e=>{e.classList.remove("last")}),e.root.classList.add("last"),this.branches.push(e),this.root.appendChild(e.root),t.filter&&this._addFilter(t.filter,{callback:this._searchWidgets.bind(this,e.name)}),e}merge(){this._branchOpen=!1,this._currentBranch=null}_pick(e,t){return void 0===e?t:e}_attachWidget(t,s={}){null!=t.name&&(this.widgets[t.name]=t),t.options.signal&&!t.name&&(this.signals||(this.signals=[]),this.signals.push({[t.options.signal]:t}));var e=e=>{(s.container||this.queuedContainer||(this._currentBranch?(s.skipWidget||this._currentBranch.widgets.push(t),this._currentBranch.content):(e.classList.add("nobranch"),this.root))).appendChild(e)},a=e=>{this.queuedContainer?this._inlineWidgets.push([e,this.queuedContainer]):this._inlineWidgets.push(e)};return 0<this._inlineWidgetsLeft&&!s.skipInlineCount?(this._inlineWidgets||(this._inlineWidgets=[]),a(t.root),this._inlineWidgetsLeft--,this._inlineWidgetsLeft||this.endLine()):e(t.root),t}_addFilter(e,t={}){t.placeholder=e.constructor==String?e:"Filter properties..",t.skipWidget=t.skipWidget??!0,t.skipInlineCount=!0;e=new N(null,null,null,t).root;e.className+=" lexfilter noname";let s=document.createElement("input");s.className="lexinput-filter",s.setAttribute("placeholder",t.placeholder),s.style.width="calc( 100% - 17px )",s.value=t.filterValue||"";var a=document.createElement("a");return a.className="fa-solid fa-magnifying-glass",e.appendChild(a),e.appendChild(s),s.addEventListener("input",e=>{t.callback&&t.callback(s.value,e)}),e}_searchWidgets(e,t){for(var s of this.branches)if(s.name===e){for(var a of s.widgets)a.domEl.classList.contains("lexfilter")||a.domEl.remove();this.queue(s.content);var l,i=!t.length;for(l of s.widgets){if(!i){if(!l.name)continue;t.toLowerCase();if(!l.name.toLowerCase().includes(t))continue}this.queuedContainer.appendChild(l.domEl)}return void this.clearQueue()}}getBranch(t){return t?this.branches.find(e=>e.name==t):this._currentBranch}queue(e){!e&&this._currentBranch&&(e=this._currentBranch.root),this.queuedContainer&&this._queue.push(this.queuedContainer),this.queuedContainer=e}clearQueue(){this._queue&&this._queue.length?this.queuedContainer=this._queue.pop():delete this.queuedContainer}addSeparator(){var e=document.createElement("div"),t=(e.className="lexseparator",new w(w.SEPARATOR));t.root=e,this._currentBranch?(this._currentBranch.content.appendChild(e),this._currentBranch.widgets.push(t)):this.root.appendChild(e)}addBlank(e,t){e=new r(e,t);return this._attachWidget(e)}addTitle(e,t={}){e=new _(e,t);return this._attachWidget(e)}addText(e,t,s,a={}){e=new N(e,t,s,a);return this._attachWidget(e)}addTextArea(e,t,s,a={}){e=new H(e,t,s,a);return this._attachWidget(e)}addLabel(e,t={}){t.disabled=!0;e=this.addText(null,e,null,t);return e.type=w.LABEL,e}addButton(e,t,s,a={}){e=new T(e,t,s,a);return this._attachWidget(e)}addComboButtons(e,t,s={}){e=new W(e,t,s);return this._attachWidget(e)}addCard(e,t={}){e=new V(e,t);return this._attachWidget(e)}addForm(e,t,s,a={}){e=new q(e,t,s,a);return this._attachWidget(e)}addContent(e,t,s={}){console.assert(t,"Empty content!"),t.constructor==String&&((a=document.createElement("div")).innerHTML=t,t=1<a.childElementCount?a:a.firstElementChild),s.hideName=!0;var a=new w(w.CONTENT,e,null,s);return a.root.appendChild(t),this._attachWidget(a)}async addImage(e,t,s={}){console.assert(t,"Empty src/url for Image!");var a=document.createElement("div"),l=(a.className="leximage",a.style.width="100%",document.createElement("img")),t=(l.src=t,Object.assign(l.style,s.style??{}),a.appendChild(l),new w(w.IMAGE,e,null,s));return t.root.appendChild(a),l.decode(),this._attachWidget(t)}addSelect(e,t,s,a,l={}){e=new M(e,t,s,a,l);return this._attachWidget(e)}addCurve(e,t,s,a={}){e=new S(e,t,s,a);return this._attachWidget(e)}addDial(e,t,s,a={}){e=new U(e,t,s,a);return this._attachWidget(e)}addLayers(e,t,s,a={}){e=new F(e,t,s,a);return this._attachWidget(e)}addArray(e,t=[],s,a={}){e=new G(e,t,s,a);return this._attachWidget(e)}addList(e,t,s,a,l={}){e=new j(e,t,s,a,l);return this._attachWidget(e)}addTags(e,t,s,a={}){e=new $(e,t,s,a);return this._attachWidget(e)}addCheckbox(e,t,s,a={}){e=new K(e,t,s,a);return this._attachWidget(e)}addToggle(e,t,s,a={}){e=new Y(e,t,s,a);return this._attachWidget(e)}addRadioGroup(e,t,s,a,l={}){e=new X(e,t,s,a,l);return this._attachWidget(e)}addColor(e,t,s,a={}){e=new Z(e,t,s,a);return this._attachWidget(e)}addRange(e,t,s,a={}){e=new J(e,t,s,a);return this._attachWidget(e)}addNumber(e,t,s,a={}){e=new k(e,t,s,a);return this._attachWidget(e)}static VECTOR_COMPONENTS={0:"x",1:"y",2:"z",3:"w"};_addVector(e,t,s,a,l={}){e=new Q(e,t,s,a,l);return this._attachWidget(e)}addVector2(e,t,s,a){return this._addVector(2,e,t,s,a)}addVector3(e,t,s,a){return this._addVector(3,e,t,s,a)}addVector4(e,t,s,a){return this._addVector(4,e,t,s,a)}addSize(e,t,s,a={}){e=new ee(e,t,s,a);return this._attachWidget(e)}addPad(e,t,s,a={}){e=new te(e,t,s,a);return this._attachWidget(e)}addProgress(e,t,s={}){e=new se(e,t,s);return this._attachWidget(e)}addFile(e,t,s={}){e=new ae(e,t,s);return this._attachWidget(e)}addTree(e,t,s={}){e=new le(e,t,s);return this._attachWidget(e)}addTabSections(e,t,s={}){e=new ie(e,t,s);return this._attachWidget(e)}addCounter(e,t,s,a={}){e=new ne(e,t,s,a);return this._attachWidget(e)}addTable(e,t,s={}){e=new re(e,t,s);return this._attachWidget(e)}}b.Panel=z;class oe{constructor(e,t={}){this.name=e;var s=document.createElement("div"),a=(s.className="lexbranch",t.id&&(s.id=t.id),t.className&&(s.className+=" "+t.className),s.style.width="calc(100% - 7px)",s.style.margin="0 auto",this),l=(this.root=s,this.widgets=[],document.createElement("div")),i=(l.className="lexbranchtitle",t.icon&&(l.innerHTML="<a class='branchicon "+t.icon+"'>"),l.innerHTML+=e||"Branch",l.innerHTML+="<a class='fa-solid fa-angle-right switch-branch-button'></a>",s.appendChild(l),document.createElement("div"));i.id=e.replace(/\s/g,""),i.className="lexbranchcontent",s.appendChild(i),this.content=i,this._addBranchSeparator(),t.closed&&(l.classList.add("closed"),s.classList.add("closed"),this.grabber.setAttribute("hidden",!0),x(()=>{this.content.setAttribute("hidden",!0)},15)),this.onclick=function(e){this.classList.toggle("closed"),this.parentElement.classList.toggle("closed"),a.content.toggleAttribute("hidden"),a.grabber.toggleAttribute("hidden"),b.emit("@on_branch_closed",this.classList.contains("closed"))},this.oncontextmenu=function(t){t.preventDefault(),t.stopPropagation(),this.parentElement.classList.contains("dialog")||P("Dock",t,e=>{t.preventDefault(),e.add("Floating",a._onMakeFloating.bind(a))},{icon:"fa-regular fa-window-restore"})},l.addEventListener("click",this.onclick),l.addEventListener("contextmenu",this.oncontextmenu)}_onMakeFloating(){new A(this.name,e=>{for(var t of this.widgets)e.root.appendChild(t.domEl)}).widgets=this.widgets;var e=this.root.parentElement,t=(this.root.remove(),e.querySelector(".lexbranch")),t=(t&&t.classList.add("first"),e.querySelectorAll(".lexbranch"));t.length&&t[t.length-1].classList.add("last")}_addBranchSeparator(){var e=document.createElement("div");e.className="lexwidgetseparator",e.style.width="100%",e.style.background="none";let s=document.createElement("div"),a=(s.innerHTML="&#9662;",e.appendChild(s),x(()=>{s.style.marginLeft=parseFloat(b.DEFAULT_NAME_WIDTH)/100*this.content.offsetWidth+"px"},10),document.createElement("div"));a.style.width="1px",a.style.marginLeft="6px",a.style.marginTop="2px",a.style.height="0px",s.appendChild(a),s.addEventListener("mousedown",function(e){var t=l.root.ownerDocument;t.addEventListener("mouseup",n),t.addEventListener("mousemove",i),e.stopPropagation(),e.preventDefault();t=l.root.offsetHeight-l.root.children[0].offsetHeight;a.style.height=t-3+"px",document.body.classList.add("nocursor")}),this.grabber=s;let l=this;function i(e){var t,e=e.movementX;0!=e&&(t=parseFloat(s.style.marginLeft),s.style.marginLeft=g(t+e,32,l.content.offsetWidth-32)+"px")}function n(e){l._updateWidgets(),a.style.height="0px";var t=l.root.ownerDocument;t.removeEventListener("mouseup",n),t.removeEventListener("mousemove",i),document.body.classList.remove("nocursor")}this.content.appendChild(e)}_updateWidgets(){for(var t=this.grabber.style.marginLeft,e=0;e<this.widgets.length;e++){var s=this.widgets[e],a=s.root;if(!(a.children.length<2)){var l=a.children[0],a=a.children[1];l.style.width=t;let e="0px";s.type===w.FILE&&(e="10%"),a.style.width="-moz-calc( 100% - "+t+" - "+e+" )",a.style.width="-webkit-calc( 100% - "+t+" - "+e+" )",a.style.width="calc( 100% - "+t+" - "+e+" )",s.onresize&&s.onresize()}}}}b.Branch=oe;b.Footer=class{constructor(e={}){var t=document.createElement("footer"),s=(t.className="lexfooter",document.createElement("div"));if(s.className="wrapper",t.appendChild(s),e.columns&&e.columns.constructor==Array){var a,l=document.createElement("div");l.className="columns",l.style.gridTemplateColumns="1fr ".repeat(e.columns.length),s.appendChild(l);for(a of e.columns){var i=document.createElement("div"),n=(i.className="col",l.appendChild(i),document.createElement("h2"));if(n.innerHTML=a.title,i.appendChild(n),a.items&&a.items.length){var r,o=document.createElement("ul");i.appendChild(o);for(r of a.items){var c=document.createElement("li");c.innerHTML=`<a class="" href="${r.link}">${r.title}</a>`,o.appendChild(c)}}}}if(e.credits||e.socials){var d=document.createElement("hr"),d=(s.appendChild(d),document.createElement("div"));if(d.className="credits-and-socials",s.appendChild(d),e.credits&&((s=document.createElement("p")).innerHTML=e.credits,d.appendChild(s)),e.socials){var h,u=document.createElement("div");u.className="social";for(h of e.socials){var p=document.createElement("a");p.title=h.title,p.innerHTML=h.icon,p.href=h.link,p.target="_blank",u.appendChild(p)}d.appendChild(u)}}(e.parent??document.body).appendChild(t)}};class A{static _last_id=0;constructor(n,e,t={}){e||console.warn("Content is empty, add some widgets using 'callback' parameter!"),this._oncreate=e,this.id=L();let s=t.size??[],a=t.position??[],l=t.draggable??!0,i=t.modal??!1;var r=document.createElement("dialog");r.className="lexdialog "+(t.className??""),r.id=t.id??"dialog"+A._last_id++,b.root.appendChild(r),x(()=>{i?r.showModal():r.show()},10);let o=this,c=document.createElement("div"),d;n&&(c.className="lexdialogtitle",c.innerHTML=n,c.setAttribute("draggable",!1),c.oncontextmenu=function(i){i.preventDefault(),i.stopPropagation(),b.main_area&&"horizontal"===b.main_area.type&&P("Dock",i,e=>{i.preventDefault();function a(e){let t=e.panels[0];if(t)return t;for(var s of e.sections)if(t=a(s))return t}function t(e){let t=e.branches.find(e=>e.name===n);t?e.root.appendChild(t.root):(e.branch(n),t=e.branches.find(e=>e.name===n));for(var s of o.widgets)t.content.appendChild(s.domEl);t.widgets=o.widgets,e.root.querySelectorAll(".lexbranch.last").forEach(e=>{e.classList.remove("last")}),t.root.classList.add("last"),r.remove()}let s=a(b.main_area.sections[1]),l=(e.add('<i class="fa-regular fa-window-maximize fa-window-maximize fa-rotate-90">',{disabled:!s,id:"dock_options0",callback:()=>{t(s)}}),a(b.main_area.sections[0]));e.add('<i class="fa-regular fa-window-maximize fa-window-maximize fa-rotate-270">',{disabled:!l,id:"dock_options1",callback:()=>{t(l)}})},{icon:"fa-regular fa-window-restore"})},r.appendChild(c)),(t.closable??!0)&&(this.close=()=>{t.onBeforeClose&&t.onBeforeClose(this),t.onclose?t.onclose(this.root):(r.close(),x(()=>{o.panel.clear(),r.remove()},150))},(d=document.createElement("a")).className="lexdialogcloser fa-solid fa-xmark",d.title="Close",d.addEventListener("click",this.close),(n?c:(d.classList.add("notitle"),r)).appendChild(d));var h=new z;h.root.classList.add("lexdialogcontent"),n||h.root.classList.add("notitle"),e&&e.call(this,h),r.appendChild(h.root),h.root.querySelectorAll(".lexbranch").forEach(e=>e.classList.add("dialog")),this.panel=h,this.root=r,this.title=c,l&&p(r,Object.assign({targetClass:"lexdialogtitle"},t)),s.length&&"string"!=typeof s[0]&&(s[0]+="px"),s.length&&"string"!=typeof s[1]&&(s[1]+="px"),r.style.width=s[0]||"25%",r.style.height=s[1]||"auto",r.style.translate=t.position?"unset":"-50% -50%",t.size&&(this.size=s),r.style.left=a[0]??"50%",r.style.top=a[1]??"50%",h.root.style.width="calc( 100% - 30px )",h.root.style.height=n?"calc( 100% - "+(c.offsetHeight+30)+"px )":"calc( 100% - 51px )"}destroy(){this.root.remove()}refresh(){this.panel.root.innerHTML="",this._oncreate.call(this,this.panel)}setPosition(e,t){this.root.style.left=e+"px",this.root.style.top=t+"px"}setTitle(e){var t=this.root.querySelector(".lexdialogtitle");t&&(t.innerText=e)}}b.Dialog=A;class D extends A{static TOP=0;static BOTTOM=1;constructor(e,t,s={}){s.draggable=s.draggable??!1,s.closable=s.closable??!1;super(e,t,s);let a=this;if(b.addSignal("@on_branch_closed",this.panel,e=>{this.dock_pos==D.BOTTOM&&(this.root.style.top="calc(100% - "+(this.root.offsetHeight+3)+"px)")}),this.root.classList.add("pocket"),this.root.style.translate="none",this.root.style.top="0",this.root.style.left="unset",s.position||(this.root.style.right="3px",this.root.style.top="3px"),this.panel.root.style.width="calc( 100% - 12px )",this.panel.root.style.height="calc( 100% - 40px )",this.dock_pos=D.TOP,this.minimized=!1,this.title.tabIndex=-1,this.title.addEventListener("click",e=>{this.title.eventCatched?this.title.eventCatched=!1:(this.size&&(this.minimized?this.root.style.height=this.size[1]:this.root.style.height="auto"),this.root.classList.toggle("minimized"),this.minimized=!this.minimized,this.dock_pos==D.BOTTOM&&(a.root.style.top=this.root.classList.contains("minimized")?"calc(100% - "+(a.title.offsetHeight+6)+"px)":"calc(100% - "+(a.root.offsetHeight+3)+"px)"))}),!s.draggable){var l=s.float;if(l)for(var i=0;i<l.length;i++)switch(l[i]){case"b":this.root.style.top="calc(100% - "+(this.root.offsetHeight+3)+"px)";break;case"l":this.root.style.right="unset",this.root.style.left=s.position?s.position[1]:"3px"}this.root.classList.add("dockable"),this.title.addEventListener("keydown",function(e){e.ctrlKey&&(a.root.style.right="unset","ArrowLeft"==e.key?a.root.style.left="0px":"ArrowRight"==e.key?a.root.style.left="calc(100% - "+(a.root.offsetWidth+3)+"px)":"ArrowUp"==e.key?(a.root.style.top="0px",a.dock_pos=D.TOP):"ArrowDown"==e.key&&(a.root.style.top="calc(100% - "+(a.root.offsetHeight+3)+"px)",a.dock_pos=D.BOTTOM))})}}}b.PocketDialog=D;class ce{constructor(e,t,s={}){document.body.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove()),this.root=document.createElement("div"),this.root.className="lexcontextmenu",this.root.style.left=e.x-48+document.scrollingElement.scrollLeft+"px",this.root.style.top=e.y-8+document.scrollingElement.scrollTop+"px",this.root.addEventListener("mouseleave",function(){this.remove()}),this.items=[],this.colors={},t&&((e={})[t]=[],e.className="cmtitle",e.icon=s.icon,this.items.push(e))}_adjustPosition(e,t,s=!1){var a=e.getBoundingClientRect();s?((s=window.innerWidth-a.right)<0&&(e.style.left=e.offsetLeft+(s-t)+"px"),(s=window.innerHeight-(a.top+a.height))<0&&(e.style.top=e.offsetTop+(s-t+20)+"px")):(s=a.width,a.left<0?e.style.left=t+"px":window.innerWidth-a.right<0&&(e.style.left=window.innerWidth-s-t+"px"),a.top<0?e.style.top=t+"px":a.top+a.height>window.innerHeight&&(e.style.top=window.innerHeight-a.height-t+"px"))}_createSubmenu(e,t,s,a){this.root.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove());var l=document.createElement("div");l.className="lexcontextmenu",s.appendChild(l);for(var i=0;i<e[t].length;++i){var n=e[t][i],r=Object.keys(n)[0];this._createEntry(n,r,l,a)}var o=s.getBoundingClientRect();l.style.left=o.width+"px",l.style.marginTop=3.5-s.offsetHeight+"px",this._adjustPosition(l,6,!0)}_createEntry(t,s,e,a){let l=t[s].length,i=document.createElement("div");i.className="lexmenuboxentry"+(t.className?" "+t.className:""),i.id=t.id??"eId"+d(s),i.innerHTML="";var n=t.icon;n&&(i.innerHTML+="<a class='"+n+" fa-sm'></a>");let r=t.disabled;i.innerHTML+="<div class='lexentryname"+(r?" disabled":"")+"'>"+s+"</div>",e.appendChild(i),this.colors[s]&&(i.style.borderColor=this.colors[s]),""==s?i.className+=" cmseparator":(i.addEventListener("click",e=>{e.stopPropagation(),e.stopImmediatePropagation(),r||((e=t.callback)&&(e.call(this,s,i),this.root.remove()),l&&"click"==b.OPEN_CONTEXTMENU_ENTRY&&this._createSubmenu(t,s,i,++a))}),l&&((n=document.createElement("a")).className="fa-solid fa-bars-staggered fa-xs",i.appendChild(n),"mouseover"==b.OPEN_CONTEXTMENU_ENTRY&&i.addEventListener("mouseover",e=>{i.built||(i.built=!0,this._createSubmenu(t,s,i,++a),e.stopPropagation())}),i.addEventListener("mouseleave",()=>{a=-1,e.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove())})))}onCreate(){x(()=>this._adjustPosition(this.root,6))}add(e,i={}){i.constructor==Function&&(i={callback:i});let n=(e+="").split("/");var t,s,e=n[n.length-1];this.colors[e]=i.color;let r=0,o=(a,e)=>{if(null!=a){let s=null;var t,l;e.forEach(e=>{var t=Object.keys(e).find(e=>e==a);t&&(s=e[t])}),s?o(n[r++],s):((t={})[a]=[],(l=n[r++])||(t.id=i.id,t.callback=i.callback,t.disabled=i.disabled??!1),e.push(t),o(l,t[a]))}},c=(o(n[r++],this.items),e=>{let t=Object.keys(e)[0];var s,a=e[t];if(a.length){null==a.find(e=>Object.keys(e)[0]==t)&&((a={})[t]=[],a.className="cmtitle",e[t].unshift(a));for(s of e[t])for(var l=Object.keys(s)[0],i=0;i<s[l].length;++i)c(s)}});for(t of this.items)c(t);for(s of this.items){var a=Object.keys(s)[0],l="eId"+d(a),l="#"+(s.id??l);this.root.querySelector(l)||this._createEntry(s,a,this.root,-1)}}setColor(e,t){"#"!==t[0]&&(t=s(t)),this.colors[e]=t}}function P(e,t,s,a){t=new ce(t,e,a);return b.root.appendChild(t.root),s&&s(t),t.onCreate(),t}b.ContextMenu=ce,b.addContextMenu=P;class de{constructor(e,s={}){let r=document.createElement("div"),o=(r.className="curve "+(s.className||""),r.style.minHeight="50px",r.style.width=s.width||"100%",r.style.minWidth="50px",r.style.minHeight="20px",r.bgcolor=s.bgColor||b.getThemeColor("global-intense-background"),r.pointscolor=s.pointsColor||b.getThemeColor("global-selected-light"),r.linecolor=s.lineColor||"#555",r.value=e||[],r.xrange=s.xrange||[0,1],r.yrange=s.yrange||[0,1],r.defaulty=null!=s.defaulty?s.defaulty:0,r.no_overlap=s.noOverlap||!1,r.show_samples=s.showSamples||0,r.allow_add_values=s.allowAddValues??!0,r.draggable_x=s.draggableX??!0,r.draggable_y=s.draggableY??!0,r.smooth=(s.smooth&&"number"==typeof s.smooth?s.smooth:.3)||!1,r.move_out=s.moveOutAction??b.CURVE_MOVEOUT_DELETE,b.addSignal("@on_new_color_scheme",(e,t)=>{r.bgcolor=s.bgColor||b.getThemeColor("global-intense-background"),r.pointscolor=s.pointsColor||b.getThemeColor("global-selected-light"),this.redraw()}),this.element=r,document.createElement("canvas"));function n(e){return[o.width*(e[0]-r.xrange[0])/r.xrange[1],o.height*(e[1]-r.yrange[0])/r.yrange[1]]}function c(e){return[e[0]*r.xrange[1]/o.width+r.xrange[0],e[1]*r.yrange[1]/o.height+r.yrange[0]]}o.width=s.width||200,o.height=s.height||50,r.appendChild(o),this.canvas=o,r.addEventListener("mousedown",function(e){document.addEventListener("mousemove",l),document.addEventListener("mouseup",u);var t=o.getBoundingClientRect(),s=e.clientX-t.left,t=e.clientY-t.top;{var a;d=((e,t)=>{for(var s=1e5,a=-1,l=0;l<r.value.length;l++){var i=n(r.value[l]),i=m([e,t],i);i<s&&i<8&&(s=i,a=l)}return a})(s,o.height-t),e.button==b.MOUSE_LEFT_CLICK&&-1==d&&r.allow_add_values&&(a=c([s,o.height-t]),r.value.push(a),g(),d=r.value.indexOf(a))}h=[s,t],r.redraw(),e.preventDefault(),e.stopPropagation()}),r.getValueAt=function(e){if(e<r.xrange[0]||e>r.xrange[1])return r.defaulty;for(var t=[r.xrange[0],r.defaulty],s=0,a=0;a<r.value.length;a+=1){var l=r.value[a];if(e==l[0])return l[1];if(e<l[0])return s=(e-t[0])/(l[0]-t[0]),t[1]*(1-s)+l[1]*s;t=l}return l=[r.xrange[1],r.defaulty],s=(e-t[0])/(l[0]-t[0]),t[1]*(1-s)+l[1]*s},r.resample=function(e){for(var t=[],s=(r.xrange[1]-r.xrange[0])/e,a=r.xrange[0];a<=r.xrange[1];a+=s)t.push(r.getValueAt(a));return t},r.addValue=function(e){for(var t=0;t<r.value;t++){var s=r.value[t];if(!(s[0]<e[0]))return r.value.splice(t,0,e),void redraw()}r.value.push(e),redraw()};var d=-1,h=(r.redraw=function(e={}){e.value&&(r.value=e.value),e.xrange&&(r.xrange=e.xrange),e.yrange&&(r.yrange=e.yrange),e.smooth&&(r.smooth=e.smooth);var e=o.parentElement.getBoundingClientRect(),t=((e=o.parentElement.parentElement?o.parentElement.parentElement.getBoundingClientRect():e)&&o.width!=e.width&&e.width&&e.width<1e3&&(o.width=e.width),o.getContext("2d")),s=(t.setTransform(1,0,0,1,0,0),t.translate(0,o.height),t.scale(1,-1),t.fillStyle=r.bgcolor,t.fillRect(0,0,o.width,o.height),t.strokeStyle=r.linecolor,t.beginPath(),n([r.xrange[0],r.defaulty])),a=(t.moveTo(s[0],s[1]),[s[0],s[1]]);for(l in r.value){s=n(r.value[l]);a.push(s[0]),a.push(s[1]),r.smooth||t.lineTo(s[0],s[1])}s=n([r.xrange[1],r.defaulty]),a.push(s[0]),a.push(s[1]),r.smooth?b.UTILS.drawSpline(t,a,r.smooth):(t.lineTo(s[0],s[1]),t.stroke());for(var l=0;l<r.value.length;l+=1)s=n(r.value[l]),t.fillStyle=d==l?"white":r.pointscolor,t.beginPath(),t.arc(s[0],s[1],d==l?4:3,0,2*Math.PI),t.fill();if(r.show_samples){var i=r.resample(r.show_samples);t.fillStyle="#888";for(l=0;l<i.length;l+=1)s=n([l*((r.xrange[1]-r.xrange[0])/r.show_samples)+r.xrange[0],i[l]]),t.beginPath(),t.arc(s[0],s[1],2,0,2*Math.PI),t.fill()}},[0,0]);function l(e){var t,s,a,l=o.getBoundingClientRect(),i=e.clientX-l.left,n=e.clientY-l.top,l=(i<0?i=0:i>o.width&&(i=o.width),n<0?n=0:n>o.height&&(n=o.height),[e.clientX-l.left,e.clientY-l.top]);-1!=d&&m(l,[i,n])>.5*o.height?(r.move_out==b.CURVE_MOVEOUT_DELETE?r.value.splice(d,1):(l=[l[0]-i,l[1]-n],(t=r.value[d])[0]=0==l[0]?t[0]:l[0]<0?r.xrange[0]:r.xrange[1],t[1]=0==l[1]?t[1]:l[1]<0?r.yrange[1]:r.yrange[0]),u(e)):(t=c([-(r.draggable_x?h[0]-i:0),r.draggable_y?h[1]-n:0]),-1!=d&&(l=r.xrange[0],s=r.xrange[1],r.no_overlap&&(0<d&&(l=r.value[d-1][0]),d<r.value.length-1)&&(s=r.value[d+1][0]),(a=r.value[d])[0]+=t[0],a[1]+=t[1],a[0]<l?a[0]=l:a[0]>s&&(a[0]=s),a[1]<r.yrange[0]?a[1]=r.yrange[0]:a[1]>r.yrange[1]&&(a[1]=r.yrange[1])),g(),r.redraw(),h[0]=i,h[1]=n,p(e),e.preventDefault(),e.stopPropagation())}function u(e){d=-1,r.redraw(),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",u),p(e),e.preventDefault(),e.stopPropagation()}function p(e){s.callback&&s.callback.call(r,r.value,e)}function m(e,t){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function g(){var e=null;-1!=d&&(e=r.value[d]),r.value.sort(function(e,t){return e[0]-t[0]}),e&&(d=r.value.indexOf(e))}return r.redraw(),this}redraw(e={}){this.element.redraw(e)}}b.CanvasCurve=de;class he{constructor(e,t,s={}){let r=document.createElement("div"),o=(r.className="dial "+(s.className||""),r.style.width=r.style.height=s.size||"100%",r.style.minWidth=r.style.minHeight="50px",r.bgcolor=s.bgColor||b.getThemeColor("global-dark-background"),r.pointscolor=s.pointsColor||b.getThemeColor("global-selected-light"),r.linecolor=s.lineColor||"#555",r.value=t||[],r.xrange=s.xrange||[0,1],r.yrange=s.yrange||[0,1],r.defaulty=null!=s.defaulty?s.defaulty:0,r.no_overlap=s.noOverlap||!1,r.show_samples=s.showSamples||0,r.allow_add_values=s.allowAddValues??!0,r.draggable_x=s.draggableX??!0,r.draggable_y=s.draggableY??!0,r.smooth=(s.smooth&&"number"==typeof s.smooth?s.smooth:.3)||!1,r.move_out=s.moveOutAction??b.CURVE_MOVEOUT_DELETE,this.element=r,document.createElement("canvas"));function n(e){return Math.pow(e[0],2),[o.width*(e[0]-r.xrange[0])/r.xrange[1],o.height*(e[1]-r.yrange[0])/r.yrange[1]]}function c(e){return[e[0]*r.xrange[1]/o.width+r.xrange[0],e[1]*r.yrange[1]/o.height+r.yrange[0]]}o.width=o.height=s.size||200,r.appendChild(o),this.canvas=o,r.addEventListener("mousedown",function(e){document.addEventListener("mousemove",l),document.addEventListener("mouseup",u);var t=o.getBoundingClientRect(),s=e.clientX-t.left,t=e.clientY-t.top;{var a;d=((e,t)=>{for(var s=1e5,a=-1,l=0;l<r.value.length;l++){var i=n(r.value[l]),i=m([e,t],i);i<s&&i<8&&(s=i,a=l)}return a})(s,o.height-t),e.button==b.MOUSE_LEFT_CLICK&&-1==d&&r.allow_add_values&&(a=c([s,o.height-t]),r.value.push(a),g(),d=r.value.indexOf(a))}h=[s,t],r.redraw(),e.preventDefault(),e.stopPropagation()}),r.getValueAt=function(e){if(e<r.xrange[0]||e>r.xrange[1])return r.defaulty;for(var t=[r.xrange[0],r.defaulty],s=0,a=0;a<r.value.length;a+=1){var l=r.value[a];if(e==l[0])return l[1];if(e<l[0])return s=(e-t[0])/(l[0]-t[0]),t[1]*(1-s)+l[1]*s;t=l}return l=[r.xrange[1],r.defaulty],s=(e-t[0])/(l[0]-t[0]),t[1]*(1-s)+l[1]*s},r.resample=function(e){for(var t=[],s=(r.xrange[1]-r.xrange[0])/e,a=r.xrange[0];a<=r.xrange[1];a+=s)t.push(r.getValueAt(a));return t},r.addValue=function(e){for(var t=0;t<r.value;t++){var s=r.value[t];if(!(s[0]<e[0]))return r.value.splice(t,0,e),void redraw()}r.value.push(e),redraw()};var d=-1,h=(r.redraw=function(e={}){e.value&&(r.value=e.value),e.xrange&&(r.xrange=e.xrange),e.yrange&&(r.yrange=e.yrange),e.smooth&&(r.smooth=e.smooth);var e=o.parentElement.getBoundingClientRect(),t=((e=o.parentElement.parentElement?o.parentElement.parentElement.getBoundingClientRect():e)&&o.width!=e.width&&e.width&&e.width<1e3&&(o.width=e.width),o.getContext("2d")),s=(t.setTransform(1,0,0,1,0,0),t.translate(0,o.height),t.scale(1,-1),t.fillStyle=r.bgcolor,t.fillRect(0,0,o.width,o.height),t.strokeStyle=r.linecolor,t.beginPath(),n([r.xrange[0],r.defaulty])),a=(t.moveTo(s[0],s[1]),[s[0],s[1]]);for(l in r.value){s=n(r.value[l]);a.push(s[0]),a.push(s[1])}s=n([r.xrange[1],r.defaulty]),a.push(s[0]),a.push(s[1]);s=n([0,0]),t.fillStyle="gray",t.beginPath(),t.arc(s[0],s[1],3,0,2*Math.PI),t.fill();for(var l=0;l<r.value.length;l+=1)s=n(r.value[l]),t.fillStyle=d==l?"white":r.pointscolor,t.beginPath(),t.arc(s[0],s[1],d==l?4:3,0,2*Math.PI),t.fill();if(r.show_samples){var i=r.resample(r.show_samples);t.fillStyle="#888";for(l=0;l<i.length;l+=1)s=n([l*((r.xrange[1]-r.xrange[0])/r.show_samples)+r.xrange[0],i[l]]),t.beginPath(),t.arc(s[0],s[1],2,0,2*Math.PI),t.fill()}},[0,0]);function l(e){var t,s,a,l=o.getBoundingClientRect(),i=e.clientX-l.left,n=e.clientY-l.top,l=(i<0?i=0:i>o.width&&(i=o.width),n<0?n=0:n>o.height&&(n=o.height),[e.clientX-l.left,e.clientY-l.top]);-1!=d&&m(l,[i,n])>.5*o.height?(r.move_out==b.CURVE_MOVEOUT_DELETE?r.value.splice(d,1):(l=[l[0]-i,l[1]-n],(t=r.value[d])[0]=0==l[0]?t[0]:l[0]<0?r.xrange[0]:r.xrange[1],t[1]=0==l[1]?t[1]:l[1]<0?r.yrange[1]:r.yrange[0]),u(e)):(t=c([-(r.draggable_x?h[0]-i:0),r.draggable_y?h[1]-n:0]),-1!=d&&(l=r.xrange[0],s=r.xrange[1],r.no_overlap&&(0<d&&(l=r.value[d-1][0]),d<r.value.length-1)&&(s=r.value[d+1][0]),(a=r.value[d])[0]+=t[0],a[1]+=t[1],a[0]<l?a[0]=l:a[0]>s&&(a[0]=s),a[1]<r.yrange[0]?a[1]=r.yrange[0]:a[1]>r.yrange[1]&&(a[1]=r.yrange[1])),g(),r.redraw(),h[0]=i,h[1]=n,p(e),e.preventDefault(),e.stopPropagation())}function u(e){d=-1,r.redraw(),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",u),p(e),e.preventDefault(),e.stopPropagation()}function p(e){s.callback&&s.callback.call(r,r.value,e)}function m(e,t){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function g(){var e=null;-1!=d&&(e=r.value[d]),r.value.sort(function(e,t){return e[0]-t[0]}),e&&(d=r.value.indexOf(e))}return r.redraw(),this}redraw(e={}){this.element.redraw(e)}}b.Dial=U;class I{static NONE=0;static ASSET_SELECTED=1;static ASSET_DELETED=2;static ASSET_RENAMED=3;static ASSET_CLONED=4;static ASSET_DBLCLICKED=5;static ENTER_FOLDER=6;static ASSET_CHECKED=7;constructor(e,t,s){this.type=e||y.NONE,this.item=t,this.value=s,this.multiple=!1}string(){switch(this.type){case I.NONE:return"assetview_event_none";case I.ASSET_SELECTED:return"assetview_event_selected";case I.ASSET_DELETED:return"assetview_event_deleted";case I.ASSET_RENAMED:return"assetview_event_renamed";case I.ASSET_CLONED:return"assetview_event_cloned";case I.ASSET_DBLCLICKED:return"assetview_event_dblclicked";case I.ENTER_FOLDER:return"assetview_event_enter_folder";case I.ASSET_CHECKED:return"assetview_event_checked"}}}b.AssetViewEvent=I;class O{static LAYOUT_CONTENT=0;static LAYOUT_LIST=1;static MAX_PAGE_ELEMENTS=50;constructor(e={}){this.rootPath="https://raw.githubusercontent.com/jxarco/lexgui.js/master/",this.layout=e.layout??O.LAYOUT_CONTENT,this.contentPage=1,e.rootPath&&(e.rootPath.constructor!==String?console.warn("Asset Root Path must be a String (now is "+path.constructor.name+")"):this.rootPath=e.rootPath);var t=document.createElement("div"),s=(t.className="lexassetbrowser",this.root=t,new b.Area({height:"100%"}));t.appendChild(s.root);let a,l,i=s;this.skipBrowser=e.skipBrowser??!1,this.skipPreview=e.skipPreview??!1,this.useNativeTitle=e.useNativeTitle??!1,this.onlyFolders=e.onlyFolders??!0,this.allowMultipleSelection=e.allowMultipleSelection??!1,this.previewActions=e.previewActions??[],this.contextMenu=e.contextMenu??[],this.onRefreshContent=e.onRefreshContent,this.skipBrowser||([a,l]=s.split({type:"horizontal",sizes:["15%","85%"]}),i=l,a.setLimitBox(210,0),l.setLimitBox(512,0)),this.skipPreview||([i,l]=i.split({type:"horizontal",sizes:["80%","20%"]})),this.allowedTypes=e.allowedTypes||["None","Image","Mesh","Script","JSON","Clip"],this.prevData=[],this.nextData=[],this.data=[],this._processData(this.data,null),this.currentData=this.data,this.path=["@"],this.skipBrowser||this._createTreePanel(a),this._createContentPanel(i),this.skipPreview||(this.previewPanel=l.addPanel({className:"lexassetcontentpanel",style:{overflow:"scroll"}}))}load(e,t){this.prevData.length=0,this.nextData.length=0,this.data=e,this._processData(this.data,null),this.currentData=this.data,this.path=["@"],this.skipBrowser||this._createTreePanel(this.area),this._refreshContent(),this.onevent=t}clear(){this.previewPanel&&this.previewPanel.clear(),this.leftPanel&&this.leftPanel.clear(),this.rightPanel&&this.rightPanel.clear()}_processData(e,t){e.constructor!==Array&&(e.folder=t,e.children=e.children??[]);for(var s=e.constructor===Array?e:e.children,a=0;a<s.length;++a)this._processData(s[a],e)}_updatePath(e){this.path.length=0;let t=e=>{e&&(e=(e.children||e)[0])&&e.folder&&(this.path.push(e.folder.id??"@"),t(e.folder.folder))};t(e),b.emit("@on_folder_change",this.path.reverse().join("/"))}_createTreePanel(e){this.leftPanel?this.leftPanel.clear():this.leftPanel=e.addPanel({className:"lexassetbrowserpanel"});e={id:"/",children:this.data},e=this.leftPanel.addTree("Content Browser",e,{filter:!1,onlyFolders:this.onlyFolders,onevent:e=>{var t=e.node,s=e.value;switch(e.type){case b.TreeEvent.NODE_SELECTED:e.multiple||this._enterFolder(t),t.parent||(this.prevData.push(this.currentData),this.currentData=this.data,this._refreshContent(),this.path=["@"],b.emit("@on_folder_change",this.path.join("/")));break;case b.TreeEvent.NODE_DRAGGED:t.folder=s,this._refreshContent()}}});this.tree=e.innerTree}_setContentLayout(e){this.layout=e,this._refreshContent()}_createContentPanel(e){this.rightPanel?this.rightPanel.clear():this.rightPanel=e.addPanel({className:"lexassetcontentpanel"});e=(e,t)=>{var s;this.allowNextPage&&(s=this.contentPage,this.contentPage+=e,this.contentPage=Math.min(this.contentPage,1+((this.currentData.length-1)/O.MAX_PAGE_ELEMENTS|0)),this.contentPage=Math.max(this.contentPage,1),s!=this.contentPage)&&this._refreshContent()};this.rightPanel.sameLine(),this.rightPanel.addSelect("Filter",this.allowedTypes,this.allowedTypes[0],e=>this._refreshContent.call(this,null,e),{width:"30%",minWidth:"128px"}),this.rightPanel.addText(null,this.searchValue??"",e=>this._refreshContent.call(this,e,null),{placeholder:"Search assets.."}),this.rightPanel.addButton(null,"<a class='fa fa-arrow-up-short-wide'></a>",((e,t)=>{var t=P("Sort by",t,e=>{e.add("Name",()=>this._sortData("id")),e.add("Type",()=>this._sortData("type")),e.add(""),e.add("Ascending",()=>this._sortData()),e.add("Descending",()=>this._sortData(null,!0))}),s=this.parent.root.parentElement;s.classList.contains("lexdialog")&&(t.root.style.zIndex=+getComputedStyle(s).zIndex+1)}).bind(this),{className:"micro",title:"Sort"}),this.rightPanel.addButton(null,"<a class='fa-solid fa-grip'></a>",((e,t)=>{var t=P("Layout",t,e=>{e.add("Content",()=>this._setContentLayout(O.LAYOUT_CONTENT)),e.add(""),e.add("List",()=>this._setContentLayout(O.LAYOUT_LIST))}),s=this.parent.root.parentElement;s.classList.contains("lexdialog")&&(t.root.style.zIndex=+getComputedStyle(s).zIndex+1)}).bind(this),{className:"micro",title:"View"}),this.rightPanel.addButton(null,"<a class='fa-solid fa-angles-left'></a>",e.bind(this,-1),{className:"micro",title:"Previous Page"}),this.rightPanel.addButton(null,"<a class='fa-solid fa-angles-right'></a>",e.bind(this,1),{className:"micro",title:"Next Page"}),this.rightPanel.endLine(),this.skipBrowser||(this.rightPanel.sameLine(),this.rightPanel.addComboButtons(null,[{value:"Left",icon:"fa-solid fa-left-long",callback:e=>{this.prevData.length&&(this.nextData.push(this.currentData),this.currentData=this.prevData.pop(),this._refreshContent(),this._updatePath(this.currentData))}},{value:"Right",icon:"fa-solid fa-right-long",callback:e=>{this.nextData.length&&(this.prevData.push(this.currentData),this.currentData=this.nextData.pop(),this._refreshContent(),this._updatePath(this.currentData))}},{value:"Refresh",icon:"fa-solid fa-arrows-rotate",callback:e=>{this._refreshContent()}}],{width:"20%",minWidth:"164px",noSelection:!0}),this.rightPanel.addText(null,this.path.join("/"),null,{width:"70%",maxWidth:"calc(70% - 64px)",minWidth:"164px",disabled:!0,signal:"@on_folder_change",style:{fontWeight:"bolder",fontSize:"16px",color:"#aaa"}}),this.rightPanel.addText(null,"Page "+this.contentPage+" / "+(1+((this.currentData.length-1)/O.MAX_PAGE_ELEMENTS|0)),null,{disabled:!0,signal:"@on_page_change",width:"fit-content"}),this.rightPanel.endLine()),this.content=document.createElement("ul"),this.content.className="lexassetscontent",this.rightPanel.root.appendChild(this.content),this.content.addEventListener("dragenter",function(e){e.preventDefault(),this.classList.add("dragging")}),this.content.addEventListener("dragleave",function(e){e.preventDefault(),this.classList.remove("dragging")}),this.content.addEventListener("drop",e=>{e.preventDefault(),this._processDrop(e)}),this.content.addEventListener("click",function(){this.querySelectorAll(".lexassetitem").forEach(e=>e.classList.remove("selected"))}),this._refreshContent()}_refreshContent(s,a){let o=this.layout==O.LAYOUT_CONTENT,i=(this.filter=a??this.filter??"None",this.searchValue=s??this.searchValue??"",this.content.innerHTML="",this.content.className=o?"lexassetscontent":"lexassetscontent list",this);let l=new FileReader;var n=this.currentData.filter(e=>("None"==this.filter||e.type.toLowerCase()==this.filter.toLowerCase())&&e.id.toLowerCase().includes(this.searchValue.toLowerCase())),t=((a||s)&&(this.contentPage=1),(this.contentPage-1)*O.MAX_PAGE_ELEMENTS),r=Math.min(t+O.MAX_PAGE_ELEMENTS,n.length);for(let e=t;e<r;++e){let t=n[e];t.path?b.request({url:t.path,dataType:"blob",success:e=>{t.bytesize=e.size,l.readAsDataURL(e),l.onload=e=>{t.src=e.currentTarget.result,t._path=t.path,delete t.path,this._refreshContent(s,a)}}}):t.domEl=(a=>{var e=a.type.charAt(0).toUpperCase()+a.type.slice(1),t=c(a.id);let s="Folder"===e,r=document.createElement("li");if(r.className="lexassetitem "+a.type.toLowerCase(),r.tabIndex=-1,i.content.appendChild(r),i.useNativeTitle)r.title=e+": "+a.id;else{let n=document.createElement("span");n.className="lexitemdesc",n.innerHTML="File: "+a.id+"<br>Type: "+e,i.content.appendChild(n),r.addEventListener("mousemove",t=>{if(o){var s=r.getBoundingClientRect(),a=t.target.getBoundingClientRect(),l=n.parentElement.getBoundingClientRect(),i=a.x-l.x-(a.x-s.x);let e=a.y-l.y-(a.y-s.y);t.target.classList.contains("lexassettitle")&&(e+=a.y-s.y),n.style.left=i+t.offsetX+12+"px",n.style.top=e+t.offsetY+"px"}}),r.addEventListener("mouseenter",()=>{o&&(n.style.display="unset")}),r.addEventListener("mouseleave",()=>{o&&setTimeout(()=>{n.style.display="none"},100)})}i.allowMultipleSelection&&((l=document.createElement("input")).type="checkbox",l.className="lexcheckbox",l.checked=a.selected,l.addEventListener("change",(e,t)=>{var s;a.selected=!a.selected,i.onevent&&((s=new I(I.ASSET_CHECKED,e.shiftKey?[a]:a)).multiple=!!e.shiftKey,i.onevent(s)),e.stopPropagation(),e.stopImmediatePropagation()}),r.appendChild(l));var l=document.createElement("span");if(l.className="lexassettitle",l.innerText=a.id,r.appendChild(l),!i.skipPreview){let e=null;a.src&&(-1<["png","jpg"].indexOf(c(a.src))||a.src.includes("data:image/"))||s||!o?(e=document.createElement("img"),l=a.unknown_extension?i.rootPath+"images/file.png":s?i.rootPath+"images/folder.png":a.src,e.src=o||s?l:i.rootPath+"images/file.png",r.appendChild(e)):((e=document.createElement("svg")).className="asset-file-preview",r.appendChild(e),l=document.createElement("text"),e.appendChild(l),l.innerText=t&&t!=a.id?"."+t.toUpperCase():a.type.toUpperCase(),(t=2.5/l.innerText.length)<1&&(l.style.fontSize=64*t+"px",e.style.paddingTop="calc(50% - "+(.5*l.offsetHeight+10)+"px)"))}return s||((t=document.createElement("span")).className="lexassetinfo",t.innerText=e,r.appendChild(t)),r.addEventListener("click",function(e){e.stopImmediatePropagation(),e.stopPropagation();var t=e.detail==b.MOUSE_DOUBLE_CLICK;if(t){if(s)return void i._enterFolder(a)}else e.shiftKey||i.content.querySelectorAll(".lexassetitem").forEach(e=>e.classList.remove("selected")),this.classList.add("selected"),i.selectedItem=a,i.skipPreview||i._previewAsset(a);i.onevent&&((t=new I(t?I.ASSET_DBLCLICKED:I.ASSET_SELECTED,e.shiftKey?[a]:a)).multiple=!!e.shiftKey,i.onevent(t))}),i.contextMenu&&r.addEventListener("contextmenu",function(e){e.preventDefault();let t=i.content.querySelectorAll(".selected").length;b.addContextMenu(1<t?t+" selected":s?a.id:a.type,e,e=>{t<=1&&e.add("Rename"),s||e.add("Clone",i._cloneItem.bind(i,a)),t<=1&&e.add("Properties"),e.add(""),e.add("Delete",i._deleteItem.bind(i,a))})}),r.addEventListener("dragstart",function(e){e.preventDefault()},!1),r})(t)}this.allowNextPage=n.length-1>O.MAX_PAGE_ELEMENTS,b.emit("@on_page_change","Page "+this.contentPage+" / "+(1+((n.length-1)/O.MAX_PAGE_ELEMENTS|0))),this.onRefreshContent&&this.onRefreshContent(s,a)}_previewAsset(e){var t,s=e.src&&e.src.includes("data:image/"),s=(this.previewPanel.clear(),this.previewPanel.branch("Asset"),("image"==e.type||e.src)&&(-1<["png","jpg"].indexOf(c(e.src))||s)&&this.previewPanel.addImage(e.src,{style:{width:"100%"}}),{disabled:!0}),s=(this.previewPanel.addText("Filename",e.id,null,s),e.lastModified&&this.previewPanel.addText("Last Modified",new Date(e.lastModified).toLocaleString(),null,s),(e._path||e.src)&&this.previewPanel.addText("URL",e._path||e.src,null,s),this.previewPanel.addText("Path",this.path.join("/"),null,s),this.previewPanel.addText("Type",e.type,null,s),e.bytesize&&this.previewPanel.addText("Size",(e.bytesize/1024).toPrecision(3)+" KBs",null,s),"folder"==e.type&&this.previewPanel.addText("Files",e.children?e.children.length.toString():"0",null,s),this.previewPanel.addSeparator(),[...this.previewActions]);s.length||s.push({name:"Download",callback:()=>b.downloadURL(e.src,e.id)});for(t of s)t.type&&t.type!==e.type||t.path&&t.path!==this.path.join("/")||this.previewPanel.addButton(null,t.name,t.callback.bind(this,e));this.previewPanel.merge()}_processDrop(e){var t=new FileReader;let i=e.dataTransfer.files.length;for(let l=0;l<e.dataTransfer.files.length;++l){let a=e.dataTransfer.files[l];this.currentData.find(e=>e.id===a.name)||(t.readAsDataURL(a),t.onload=e=>{var t=a.name.substr(a.name.lastIndexOf(".")+1).toLowerCase(),s={id:a.name,src:e.currentTarget.result,extension:t,lastModified:a.lastModified};switch(t){case"png":case"jpg":s.type="image";break;case"js":case"css":s.type="script";break;case"json":s.type="json";break;case"obj":s.type="mesh";break;default:s.type=t,s.unknown_extension=!0}this.currentData.push(s),l==i-1&&(this._refreshContent(),this.skipBrowser||this.tree.refresh())})}}_sortData(a,l=!1){a=a??this._lastSortBy??"id",this.currentData=this.currentData.sort((e,t)=>{var s=l?t[a].localeCompare(e[a]):e[a].localeCompare(t[a]);return s=0==s?l?t.id.localeCompare(e.id):e.id.localeCompare(t.id):s}),this._lastSortBy=a,this._refreshContent()}_enterFolder(e){this.prevData.push(this.currentData),this.currentData=e.children,this.contentPage=1,this._refreshContent(),this._updatePath(this.currentData),this.onevent&&(e=new I(I.ENTER_FOLDER,e),this.onevent(e))}_deleteItem(e){var t=this.currentData.indexOf(e);t<0?console.error("[AssetView Error] Cannot delete. Item not found."):(this.currentData.splice(t,1),this._refreshContent(this.searchValue,this.filter),this.onevent&&(t=new I(I.ASSET_DELETED,e),this.onevent(t)),this.tree.refresh(),this._processData(this.data))}_cloneItem(e){var t,s=this.currentData.indexOf(e);s<0||(delete e.domEl,delete e.folder,t=v(e),this.currentData.splice(s,0,t),this._refreshContent(this.searchValue,this.filter),this.onevent&&(s=new I(I.ASSET_CLONED,e),this.onevent(s)),this._processData(this.data))}}b.AssetView=O,Object.assign(b,{request(a){var e=a.dataType||"text",t=("json"==e||"xml"==e?e="text":"binary"==e&&(e="arraybuffer",a.mimeType="application/octet-stream"),new XMLHttpRequest),s=(t.open(a.data?"POST":"GET",a.url,!0),e&&(t.responseType=e),a.mimeType&&t.overrideMimeType(a.mimeType),a.nocache&&t.setRequestHeader("Cache-Control","no-cache"),t.onload=function(e){var t,s=this.response;if(200!=this.status)t="Error "+this.status,a.error&&a.error(t);else{if("json"==a.dataType)try{s=JSON.parse(s)}catch(t){if(!a.error)throw t;a.error(t)}else if("xml"==a.dataType)try{s=(new DOMParser).parseFromString(s,"text/xml")}catch(t){if(!a.error)throw t;a.error(t)}a.success&&a.success.call(this,s,this)}},t.onerror=function(e){a.error&&a.error(e)},new FormData);if(a.data)for(var l in a.data)s.append(l,a.data[l]);return t.send(s),t},requestText(e,t,s){return this.request({url:e,dataType:"text",success:t,error:s})},requestJSON(e,t,s){return this.request({url:e,dataType:"json",success:t,error:s})},requestBinary(e,t,s){return this.request({url:e,dataType:"binary",success:t,error:s})},requireScript(e,t,s,a,l){if(!e)throw"invalid URL";var i,n=(e=e.constructor===String?[e]:e).length,r=[];for(i in e){var o=document.createElement("script");o.num=i,o.type="text/javascript",o.src=e[i]+(l?"?version="+l:""),o.original_src=e[i],o.async=!1,o.onload=function(e){n--,r.push(this),n?a&&a(this.original_src,this.num):t&&t(r)},s&&(o.onerror=function(e){s(e,this.original_src,this.num)}),document.getElementsByTagName("head")[0].appendChild(o)}},downloadURL(e,s){function t(e){var t=document.createElement("a");t.href=e,t.download=s,document.body.appendChild(t),t.click(),document.body.removeChild(t)}let a=new FileReader;e.includes("http")?b.request({url:e,dataType:"blob",success:e=>{a.readAsDataURL(e),a.onload=e=>{t(e.currentTarget.result)}}}):t(e)},downloadFile:function(e,t,s){var a,l;t?(s=s||(t.constructor===String?"text/plain":"application/octet-stream"),a=null,a=t.constructor!==File&&t.constructor!==Blob?new Blob([t],{type:s}):t,l=URL.createObjectURL(a),(s=document.createElement("a")).setAttribute("href",l),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(function(){URL.revokeObjectURL(l)},6e4)):console.warn("No file provided to download")}}),Object.defineProperty(String.prototype,"lastChar",{get:function(){return this[this.length-1]},enumerable:!0,configurable:!0}),Element.prototype.insertChildAtIndex=function(e,t=1/0){t>=this.children.length?this.appendChild(e):this.insertBefore(e,this.children[t])},Element.prototype.hasClass=function(e){return!!(e=[].concat(e)).filter(e=>this.classList.contains(e)).length},Element.prototype.addClass=function(e){e&&this.classList.add(e)},Element.prototype.getComputedSize=function(){var e=getComputedStyle(this);return{width:this.offsetWidth+e.getPropertyValue("marginLeft")+e.getPropertyValue("marginRight"),height:this.offsetHeight+e.getPropertyValue("marginTop")+e.getPropertyValue("marginBottom")}},Element.prototype.getParentArea=function(){let e=this.parentElement;for(;e;){if(e.classList.contains("lexarea"))return e;e=e.parentElement}},b.UTILS={getTime(){return(new Date).getTime()},compareThreshold(e,t,s,a){return Math.abs(e-t)>=a||Math.abs(e-s)>=a},compareThresholdRange(e,t,s,a){return s<=e&&e<=a||s<=t&&t<=a||e<=s&&a<=t},uidGenerator:L,deleteElement(e){e&&e.remove()},flushCss(e){e.offsetHeight},getControlPoints(e,t,s,a,l,i,n){var r=Math.sqrt(Math.pow(s-e,2)+Math.pow(a-t,2)),r=n*r/(r+Math.sqrt(Math.pow(l-s,2)+Math.pow(i-a,2))),n=n-r;return[s+r*(e-l),a+r*(t-i),s-n*(e-l),a-n*(t-i)]},drawSpline(e,t,s){e.save();for(var a=[],l=t.length,i=0;i<l-4;i+=2)a=a.concat(b.UTILS.getControlPoints(t[i],t[i+1],t[i+2],t[i+3],t[i+4],t[i+5],s));for(i=2;i<t.length-5;i+=2)e.beginPath(),e.moveTo(t[i],t[i+1]),e.bezierCurveTo(a[2*i-2],a[2*i-1],a[2*i],a[2*i+1],t[i+2],t[i+3]),e.stroke(),e.closePath();e.beginPath(),e.moveTo(t[0],t[1]),e.quadraticCurveTo(a[0],a[1],t[2],t[3]),e.stroke(),e.closePath(),e.beginPath(),e.moveTo(t[l-2],t[l-1]),e.quadraticCurveTo(a[2*l-10],a[2*l-9],t[l-4],t[l-3]),e.stroke(),e.closePath(),e.restore()}},b.ICONS={"align-center":[448,512,[],"solid","M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"],"align-justify":[448,512,[],"solid","M448 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32L32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32z"],"align-left":[448,512,[],"solid","M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"],"align-right":[448,512,[],"solid","M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"],bell:[448,512,[],"regular","M224 0c-17.7 0-32 14.3-32 32l0 19.2C119 66 64 130.6 64 208l0 25.4c0 45.4-15.5 89.5-43.8 124.9L5.3 377c-5.8 7.2-6.9 17.1-2.9 25.4S14.8 416 24 416l400 0c9.2 0 17.6-5.3 21.6-13.6s2.9-18.2-2.9-25.4l-14.9-18.6C399.5 322.9 384 278.8 384 233.4l0-25.4c0-77.4-55-142-128-156.8L256 32c0-17.7-14.3-32-32-32zm0 96c61.9 0 112 50.1 112 112l0 25.4c0 47.9 13.9 94.6 39.7 134.6L72.3 368C98.1 328 112 281.3 112 233.4l0-25.4c0-61.9 50.1-112 112-112zm64 352l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"],"bell-slash":[640,512,[],"regular","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L542.6 400c2.7-7.8 1.3-16.5-3.9-23l-14.9-18.6C495.5 322.9 480 278.8 480 233.4l0-33.4c0-75.8-55.5-138.6-128-150.1L352 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 17.9c-43.9 7-81.5 32.7-104.4 68.7L38.8 5.1zM221.7 148.4C239.6 117.1 273.3 96 312 96l8 0 8 0c57.4 0 104 46.6 104 104l0 33.4c0 32.7 6.4 64.8 18.7 94.5L221.7 148.4zM406.2 416l-60.9-48-176.9 0c21.2-32.8 34.4-70.3 38.4-109.1L160 222.1l0 11.4c0 45.4-15.5 89.5-43.8 124.9L101.3 377c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l286.2 0zM384 448l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"],display:[576,512,[],"solid","M64 0C28.7 0 0 28.7 0 64L0 352c0 35.3 28.7 64 64 64l176 0-10.7 32L160 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-69.3 0L336 416l176 0c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64L64 0zM512 64l0 288L64 352 64 64l448 0z"],fingerprint:[512,512,[],"regular","M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256l0 24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"],"mobile-screen":[384,512,[],"solid","M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM144 448c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zM304 64L80 64l0 320 224 0 0-320z"],"vr-cardboard":[640,512,["vr"],"solid","M576 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l120.4 0c24.2 0 46.4-13.7 57.2-35.4l32-64c8.8-17.5 26.7-28.6 46.3-28.6s37.5 11.1 46.3 28.6l32 64c10.8 21.7 33 35.4 57.2 35.4L576 448c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64zM96 240a64 64 0 1 1 128 0A64 64 0 1 1 96 240zm384-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"],gamepad:[640,512,[],"solid","M192 64C86 64 0 150 0 256S86 448 192 448l256 0c106 0 192-86 192-192s-86-192-192-192L192 64zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32z"],keyboard:[576,512,[],"regular","M64 112c-8.8 0-16 7.2-16 16l0 256c0 8.8 7.2 16 16 16l448 0c8.8 0 16-7.2 16-16l0-256c0-8.8-7.2-16-16-16L64 112zM0 128C0 92.7 28.7 64 64 64l448 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM176 320l224 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm-72-72c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16z"],headset:[512,512,[],"solid","M256 48C141.1 48 48 141.1 48 256l0 40c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-40C0 114.6 114.6 0 256 0S512 114.6 512 256l0 144.1c0 48.6-39.4 88-88.1 88L313.6 488c-8.3 14.3-23.8 24-41.6 24l-32 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l32 0c17.8 0 33.3 9.7 41.6 24l110.4 .1c22.1 0 40-17.9 40-40L464 256c0-114.9-93.1-208-208-208zM144 208l16 0c17.7 0 32 14.3 32 32l0 112c0 17.7-14.3 32-32 32l-16 0c-35.3 0-64-28.7-64-64l0-48c0-35.3 28.7-64 64-64zm224 0c35.3 0 64 28.7 64 64l0 48c0 35.3-28.7 64-64 64l-16 0c-17.7 0-32-14.3-32-32l0-112c0-17.7 14.3-32 32-32l16 0z"],camera:[512,512,[],"solid","M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L362.9 64.8C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"],print:[512,512,[],"solid","M128 0C92.7 0 64 28.7 64 64l0 96 64 0 0-96 226.7 0L384 93.3l0 66.7 64 0 0-66.7c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0L128 0zM384 352l0 32 0 64-256 0 0-64 0-16 0-16 256 0zm64 32l32 0c17.7 0 32-14.3 32-32l0-96c0-35.3-28.7-64-64-64L64 192c-35.3 0-64 28.7-64 64l0 96c0 17.7 14.3 32 32 32l32 0 0 64c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-64zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"],bookmark:[384,512,[],"regular","M0 48C0 21.5 21.5 0 48 0l0 48 0 393.4 130.1-92.9c8.3-6 19.6-6 27.9 0L336 441.4 336 48 48 48 48 0 336 0c26.5 0 48 21.5 48 48l0 440c0 9-5 17.2-13 21.3s-17.6 3.4-24.9-1.8L192 397.5 37.9 507.5c-7.3 5.2-16.9 5.9-24.9 1.8S0 497 0 488L0 48z"],calendar:[448,512,[],"regular","M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L64 64C28.7 64 0 92.7 0 128l0 16 0 48L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-256 0-48 0-16c0-35.3-28.7-64-64-64l-40 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L152 64l0-40zM48 192l352 0 0 256c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256z"],chart:[448,512,[],"solid","M160 80c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-352zM0 272c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48L0 272zM368 96l32 0c26.5 0 48 21.5 48 48l0 288c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48z"],check:[448,512,[],"solid","M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"],clone:[512,512,[],"regular","M64 464l224 0c8.8 0 16-7.2 16-16l0-64 48 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l64 0 0 48-64 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zM224 304l224 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16L224 48c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zm-64-16l0-224c0-35.3 28.7-64 64-64L448 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-224 0c-35.3 0-64-28.7-64-64z"],copy:[448,512,[],"regular","M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L400 115.9 400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-32-48 0 0 32c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l32 0 0-48-32 0z"],paste:[512,512,[],"regular","M104.6 48L64 48C28.7 48 0 76.7 0 112L0 384c0 35.3 28.7 64 64 64l96 0 0-48-96 0c-8.8 0-16-7.2-16-16l0-272c0-8.8 7.2-16 16-16l16 0c0 17.7 14.3 32 32 32l72.4 0C202 108.4 227.6 96 256 96l62 0c-7.1-27.6-32.2-48-62-48l-40.6 0C211.6 20.9 188.2 0 160 0s-51.6 20.9-55.4 48zM144 56a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM448 464l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L464 243.9 464 448c0 8.8-7.2 16-16 16zM256 512l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9l-67.9-67.9c-9-9-21.2-14.1-33.9-14.1L256 128c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64z"],edit:[512,512,[],"regular","M441 58.9L453.1 71c9.4 9.4 9.4 24.6 0 33.9L424 134.1 377.9 88 407 58.9c9.4-9.4 24.6-9.4 33.9 0zM209.8 256.2L344 121.9 390.1 168 255.8 302.2c-2.9 2.9-6.5 5-10.4 6.1l-58.5 16.7 16.7-58.5c1.1-3.9 3.2-7.5 6.1-10.4zM373.1 25L175.8 222.2c-8.7 8.7-15 19.4-18.3 31.1l-28.6 100c-2.4 8.4-.1 17.4 6.1 23.6s15.2 8.5 23.6 6.1l100-28.6c11.8-3.4 22.5-9.7 31.1-18.3L487 138.9c28.1-28.1 28.1-73.7 0-101.8L474.9 25C446.8-3.1 401.2-3.1 373.1 25zM88 64C39.4 64 0 103.4 0 152L0 424c0 48.6 39.4 88 88 88l272 0c48.6 0 88-39.4 88-88l0-112c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 112c0 22.1-17.9 40-40 40L88 464c-22.1 0-40-17.9-40-40l0-272c0-22.1 17.9-40 40-40l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L88 64z"],envelope:[512,512,[],"regular","M64 112c-8.8 0-16 7.2-16 16l0 22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1l0-22.1c0-8.8-7.2-16-16-16L64 112zM48 212.2L48 384c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-171.8L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128z"],"envelope-open":[512,512,[],"regular","M255.4 48.2c.2-.1 .4-.2 .6-.2s.4 .1 .6 .2L460.6 194c2.1 1.5 3.4 3.9 3.4 6.5l0 13.6L291.5 355.7c-20.7 17-50.4 17-71.1 0L48 214.1l0-13.6c0-2.6 1.2-5 3.4-6.5L255.4 48.2zM48 276.2L190 392.8c38.4 31.5 93.7 31.5 132 0L464 276.2 464 456c0 4.4-3.6 8-8 8L56 464c-4.4 0-8-3.6-8-8l0-179.8zM256 0c-10.2 0-20.2 3.2-28.5 9.1L23.5 154.9C8.7 165.4 0 182.4 0 200.5L0 456c0 30.9 25.1 56 56 56l400 0c30.9 0 56-25.1 56-56l0-255.5c0-18.1-8.7-35.1-23.4-45.6L284.5 9.1C276.2 3.2 266.2 0 256 0z"],map:[576,512,[],"regular","M565.6 36.2C572.1 40.7 576 48.1 576 56l0 336c0 10-6.2 18.9-15.5 22.4l-168 64c-5.2 2-10.9 2.1-16.1 .3L192.5 417.5l-160 61c-7.4 2.8-15.7 1.8-22.2-2.7S0 463.9 0 456L0 120c0-10 6.1-18.9 15.5-22.4l168-64c5.2-2 10.9-2.1 16.1-.3L383.5 94.5l160-61c7.4-2.8 15.7-1.8 22.2 2.7zM48 136.5l0 284.6 120-45.7 0-284.6L48 136.5zM360 422.7l0-285.4-144-48 0 285.4 144 48zm48-1.5l120-45.7 0-284.6L408 136.5l0 284.6z"],"note-sticky":[448,512,["sticky-note"],"regular","M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l224 0 0-80c0-17.7 14.3-32 32-32l80 0 0-224c0-8.8-7.2-16-16-16L64 80zM288 480L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 224 0 5.5c0 17-6.7 33.3-18.7 45.3l-90.5 90.5c-12 12-28.3 18.7-45.3 18.7l-5.5 0z"],file:[384,512,[],"regular","M320 464c8.8 0 16-7.2 16-16l0-288-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0zM0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64z"],"file-video":[384,512,[],"regular","M320 464c8.8 0 16-7.2 16-16l0-288-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0zM0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM80 288c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32l0 16 44.9-29.9c2-1.3 4.4-2.1 6.8-2.1c6.8 0 12.3 5.5 12.3 12.3l0 103.4c0 6.8-5.5 12.3-12.3 12.3c-2.4 0-4.8-.7-6.8-2.1L240 368l0 16c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-96z"],"file-code":[384,512,[],"regular","M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm97 289c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L79 303c-9.4 9.4-9.4 24.6 0 33.9l48 48c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-31-31 31-31zM257 255c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9l-48-48z"],"file-zip":[384,512,[],"regular","M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l48 0c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l48 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm48 112c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm-6.3 71.8L82.1 335.9c-1.4 5.4-2.1 10.9-2.1 16.4c0 35.2 28.8 63.7 64 63.7s64-28.5 64-63.7c0-5.5-.7-11.1-2.1-16.4l-23.5-88.2c-3.7-14-16.4-23.8-30.9-23.8l-14.8 0c-14.5 0-27.2 9.7-30.9 23.8zM128 336l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"],"file-pdf":[512,512,[],"regular","M64 464l48 0 0 48-48 0c-35.3 0-64-28.7-64-64L0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 304l-48 0 0-144-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16zM176 352l32 0c30.9 0 56 25.1 56 56s-25.1 56-56 56l-16 0 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-80c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0 48 16 0zm96-80l32 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16l0-128c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-16 0 0 96 16 0zm80-112c0-8.8 7.2-16 16-16l48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64 0-64z"],scroll:[576,512,["script"],"solid","M0 80l0 48c0 17.7 14.3 32 32 32l16 0 48 0 0-80c0-26.5-21.5-48-48-48S0 53.5 0 80zM112 32c10 13.4 16 30 16 48l0 304c0 35.3 28.7 64 64 64s64-28.7 64-64l0-5.3c0-32.4 26.3-58.7 58.7-58.7L480 320l0-192c0-53-43-96-96-96L112 32zM464 480c61.9 0 112-50.1 112-112c0-8.8-7.2-16-16-16l-245.3 0c-14.7 0-26.7 11.9-26.7 26.7l0 5.3c0 53-43 96-96 96l176 0 96 0z"],"floppy-disk":[448,512,["save"],"regular","M48 96l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-245.5c0-4.2-1.7-8.3-4.7-11.3l33.9-33.9c12 12 18.7 28.3 18.7 45.3L448 416c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l245.5 0c17 0 33.3 6.7 45.3 18.7l74.5 74.5-33.9 33.9L320.8 84.7c-.3-.3-.5-.5-.8-.8L320 184c0 13.3-10.7 24-24 24l-192 0c-13.3 0-24-10.7-24-24L80 80 64 80c-8.8 0-16 7.2-16 16zm80-16l0 80 144 0 0-80L128 80zm32 240a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"],download:[512,512,[],"solid","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"],upload:[512,512,[],"solid","M288 109.3L288 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-242.7-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352l128 0c0 35.3 28.7 64 64 64s64-28.7 64-64l128 0c35.3 0 64 28.7 64 64l0 32c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64l0-32c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"],eye:[576,512,[],"regular","M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z"],"eye-slash":[640,512,[],"regular","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"],comment:[512,512,[],"regular","M123.6 391.3c12.9-9.4 29.6-11.8 44.6-6.4c26.5 9.6 56.2 15.1 87.8 15.1c124.7 0 208-80.5 208-160s-83.3-160-208-160S48 160.5 48 240c0 32 12.4 62.8 35.7 89.2c8.6 9.7 12.8 22.5 11.8 35.5c-1.4 18.1-5.7 34.7-11.3 49.4c17-7.9 31.1-16.7 39.4-22.7zM21.2 431.9c1.8-2.7 3.5-5.4 5.1-8.1c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208s-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6c-15.1 6.6-32.3 12.6-50.1 16.1c-.8 .2-1.6 .3-2.4 .5c-4.4 .8-8.7 1.5-13.2 1.9c-.2 0-.5 .1-.7 .1c-5.1 .5-10.2 .8-15.3 .8c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c4.1-4.2 7.8-8.7 11.3-13.5c1.7-2.3 3.3-4.6 4.8-6.9l.3-.5z"],message:[512,512,[],"regular","M160 368c26.5 0 48 21.5 48 48l0 16 72.5-54.4c8.3-6.2 18.4-9.6 28.8-9.6L448 368c8.8 0 16-7.2 16-16l0-288c0-8.8-7.2-16-16-16L64 48c-8.8 0-16 7.2-16 16l0 288c0 8.8 7.2 16 16 16l96 0zm48 124l-.2 .2-5.1 3.8-17.1 12.8c-4.8 3.6-11.3 4.2-16.8 1.5s-8.8-8.2-8.8-14.3l0-21.3 0-6.4 0-.3 0-4 0-48-48 0-48 0c-35.3 0-64-28.7-64-64L0 64C0 28.7 28.7 0 64 0L448 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64l-138.7 0L208 492z"],folder:[512,512,[],"regular","M0 96C0 60.7 28.7 32 64 32l132.1 0c19.1 0 37.4 7.6 50.9 21.1L289.9 96 448 96c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-256c0-8.8-7.2-16-16-16l-161.4 0c-10.6 0-20.8-4.2-28.3-11.7L213.1 87c-4.5-4.5-10.6-7-17-7L64 80z"],"folder-closed":[512,512,[],"regular","M251.7 127.6s0 0 0 0c10.5 10.5 24.7 16.4 39.6 16.4L448 144c8.8 0 16 7.2 16 16l0 32L48 192l0-96c0-8.8 7.2-16 16-16l133.5 0c4.2 0 8.3 1.7 11.3 4.7l33.9-33.9L208.8 84.7l42.9 42.9zM48 240l416 0 0 176c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16l0-176zM285.7 93.7L242.7 50.7c-12-12-28.3-18.7-45.3-18.7L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L291.3 96c-2.1 0-4.2-.8-5.7-2.3z"],"folder-open":[576,512,[],"regular","M384 480l48 0c11.4 0 21.9-6 27.6-15.9l112-192c5.8-9.9 5.8-22.1 .1-32.1S555.5 224 544 224l-400 0c-11.4 0-21.9 6-27.6 15.9L48 357.1 48 96c0-8.8 7.2-16 16-16l117.5 0c4.2 0 8.3 1.7 11.3 4.7l26.5 26.5c21 21 49.5 32.8 79.2 32.8L416 144c8.8 0 16 7.2 16 16l0 32 48 0 0-32c0-35.3-28.7-64-64-64L298.5 96c-17 0-33.3-6.7-45.3-18.7L226.7 50.7c-12-12-28.3-18.7-45.3-18.7L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l23.7 0L384 480z"],"grip-vertical":[320,512,[],"solid","M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z"],image:[512,512,[],"regular","M448 80c8.8 0 16 7.2 16 16l0 319.8-5-6.5-136-176c-4.5-5.9-11.6-9.3-19-9.3s-14.4 3.4-19 9.3L202 340.7l-30.5-42.7C167 291.7 159.8 288 152 288s-15 3.7-19.5 10.1l-80 112L48 416.3l0-.3L48 96c0-8.8 7.2-16 16-16l384 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm80 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"],images:[576,512,[],"regular","M160 80l352 0c8.8 0 16 7.2 16 16l0 224c0 8.8-7.2 16-16 16l-21.2 0L388.1 178.9c-4.4-6.8-12-10.9-20.1-10.9s-15.7 4.1-20.1 10.9l-52.2 79.8-12.4-16.9c-4.5-6.2-11.7-9.8-19.4-9.8s-14.8 3.6-19.4 9.8L175.6 336 160 336c-8.8 0-16-7.2-16-16l0-224c0-8.8 7.2-16 16-16zM96 96l0 224c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32c-35.3 0-64 28.7-64 64zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 344c0 75.1 60.9 136 136 136l320 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-320 0c-48.6 0-88-39.4-88-88l0-224zm208 24a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"],"photo-film":[640,512,["media"],"solid","M256 0L576 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64l0-224c0-35.3 28.7-64 64-64zM476 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84L362.7 169c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l80 0 48 0 144 0c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6l-96-144zM336 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM64 128l96 0 0 256 0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32 160 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zm8 64c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm336 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z"],left:[320,512,[],"solid","M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"],right:[320,512,[],"solid","M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"],up:[448,512,[],"solid","M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"],down:[448,512,[],"solid","M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"],arrows:[512,512,["arrows-up-down-left-right"],"solid","M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4L224 224l-114.7 0 9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4L224 288l0 114.7-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4L288 288l114.7 0-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4L288 224l0-114.7 9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z"],rotate:[512,512,[],"solid","M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z"],"rotate-right":[512,512,["rotate-forward"],"solid","M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"],"rotate-left":[512,512,["rotate-back"],"solid","M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"],"arrow-pointer":[320,512,[],"solid","M0 55.2L0 426c0 12.2 9.9 22 22 22c6.3 0 12.4-2.7 16.6-7.5L121.2 346l58.1 116.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9L179.8 320l118.1 0c12.2 0 22.1-9.9 22.1-22.1c0-6.3-2.7-12.3-7.4-16.5L38.6 37.9C34.3 34.1 28.9 32 23.2 32C10.4 32 0 42.4 0 55.2z"],"hand-pointer":[448,512,[],"regular","M160 64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 136c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c8.8 0 16 7.2 16 16c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c7.8 0 14.3 5.6 15.7 13c1.6 8.2 7.3 15.1 15.1 18s16.7 1.6 23.3-3.6c2.7-2.1 6.1-3.4 9.9-3.4c8.8 0 16 7.2 16 16l0 16 0 104c0 39.8-32.2 72-72 72l-56 0-59.8 0-.9 0c-37.4 0-72.4-18.7-93.2-49.9L50.7 312.9c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4L116 353.2c5.9 8.8 16.8 12.7 26.9 9.7s17-12.4 17-23l0-19.9 0-256zM176 0c-35.3 0-64 28.7-64 64l0 197.7C91.2 238 55.5 232.8 28.5 250.7C-.9 270.4-8.9 310.1 10.8 339.5L78.3 440.8c29.7 44.5 79.6 71.2 133.1 71.2l.9 0 59.8 0 56 0c66.3 0 120-53.7 120-120l0-104 0-16c0-35.3-28.7-64-64-64c-4.5 0-8.8 .5-13 1.3c-11.7-15.4-30.2-25.3-51-25.3c-6.9 0-13.5 1.1-19.7 3.1C288.7 170.7 269.6 160 248 160c-2.7 0-5.4 .2-8 .5L240 64c0-35.3-28.7-64-64-64zm48 304c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96zm48-16c-8.8 0-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96z"],"log-in":[512,512,[],"solid","M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"],"log-out":[512,512,[],"solid","M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 192 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128zM160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0z"],"menu-arrows":[512,512,[],"solid","M352 144l96 112-96 112M160 144L64 256l96 112","transform=rotate(90)","fill=none stroke=currentColor stroke-width=60 stroke-linejoin=round stroke-linecap=round"],more:[128,512,[],"solid","M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"],minus:[448,512,[],"solid","M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"],"more-horizontal":[448,512,[],"solid","M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"],plus:[448,512,[],"solid","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"],search:[512,512,[],"solid","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"],compass:[512,512,[],"regular","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm306.7 69.1L162.4 380.6c-19.4 7.5-38.5-11.6-31-31l55.5-144.3c3.3-8.5 9.9-15.1 18.4-18.4l144.3-55.5c19.4-7.5 38.5 11.6 31 31L325.1 306.7c-3.2 8.5-9.9 15.1-18.4 18.4zM288 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"],sidebar:[512,512,[],"regular","M64 64h384a32 32 0 0 1 32 32v320a32 32 0 0 1-32 32H64a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32zm128 0v384",null,"fill=none stroke=currentColor stroke-width=50 stroke-linejoin=round stroke-linecap=round"],"table-cells":[512,512,[],"solid","M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm88 64l0 64-88 0 0-64 88 0zm56 0l88 0 0 64-88 0 0-64zm240 0l0 64-88 0 0-64 88 0zM64 224l88 0 0 64-88 0 0-64zm232 0l0 64-88 0 0-64 88 0zm64 0l88 0 0 64-88 0 0-64zM152 352l0 64-88 0 0-64 88 0zm56 0l88 0 0 64-88 0 0-64zm240 0l0 64-88 0 0-64 88 0z"],"table-cells-large":[512,512,[],"solid","M448 96l0 128-160 0 0-128 160 0zm0 192l0 128-160 0 0-128 160 0zM224 224L64 224 64 96l160 0 0 128zM64 288l160 0 0 128L64 416l0-128zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"],lightbulb:[384,512,[],"regular","M297.2 248.9C311.6 228.3 320 203.2 320 176c0-70.7-57.3-128-128-128S64 105.3 64 176c0 27.2 8.4 52.3 22.8 72.9c3.7 5.3 8.1 11.3 12.8 17.7c0 0 0 0 0 0c12.9 17.7 28.3 38.9 39.8 59.8c10.4 19 15.7 38.8 18.3 57.5L109 384c-2.2-12-5.9-23.7-11.8-34.5c-9.9-18-22.2-34.9-34.5-51.8c0 0 0 0 0 0s0 0 0 0c-5.2-7.1-10.4-14.2-15.4-21.4C27.6 247.9 16 213.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176c0 37.3-11.6 71.9-31.4 100.3c-5 7.2-10.2 14.3-15.4 21.4c0 0 0 0 0 0s0 0 0 0c-12.3 16.8-24.6 33.7-34.5 51.8c-5.9 10.8-9.6 22.5-11.8 34.5l-48.6 0c2.6-18.7 7.9-38.6 18.3-57.5c11.5-20.9 26.9-42.1 39.8-59.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0c4.7-6.4 9-12.4 12.7-17.7zM192 128c-26.5 0-48 21.5-48 48c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16s-7.2 16-16 16zm0 384c-44.2 0-80-35.8-80-80l0-16 160 0 0 16c0 44.2-35.8 80-80 80z"],flag:[448,512,[],"regular","M48 24C48 10.7 37.3 0 24 0S0 10.7 0 24L0 64 0 350.5 0 400l0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-100 80.3-20.1c41.1-10.3 84.6-5.5 122.5 13.4c44.2 22.1 95.5 24.8 141.7 7.4l34.7-13c12.5-4.7 20.8-16.6 20.8-30l0-279.7c0-23-24.2-38-44.8-27.7l-9.6 4.8c-46.3 23.2-100.8 23.2-147.1 0c-35.1-17.6-75.4-22-113.5-12.5L48 52l0-28zm0 77.5l96.6-24.2c27-6.7 55.5-3.6 80.4 8.8c54.9 27.4 118.7 29.7 175 6.8l0 241.8-24.4 9.1c-33.7 12.6-71.2 10.7-103.4-5.4c-48.2-24.1-103.3-30.1-155.6-17.1L48 338.5l0-237z"],shuffle:[512,512,[],"solid","M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"],"credit-card":[576,512,[],"regular","M512 80c8.8 0 16 7.2 16 16l0 32L48 128l0-32c0-8.8 7.2-16 16-16l448 0zm16 144l0 192c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16l0-192 480 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm56 304c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0zm128 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0z"],lock:[448,512,[],"solid","M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"],"lock-open":[576,512,[],"solid","M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z"],"trash-can":[448,512,[],"regular","M170.5 51.6L151.5 80l145 0-19-28.4c-1.5-2.2-4-3.6-6.7-3.6l-93.7 0c-2.7 0-5.2 1.3-6.7 3.6zm147-26.6L354.2 80 368 80l48 0 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 304c0 44.2-35.8 80-80 80l-224 0c-44.2 0-80-35.8-80-80l0-304-8 0c-13.3 0-24-10.7-24-24S10.7 80 24 80l8 0 48 0 13.8 0 36.7-55.1C140.9 9.4 158.4 0 177.1 0l93.7 0c18.7 0 36.2 9.4 46.6 24.9zM80 128l0 304c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-304L80 128zm80 64l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16z"],user:[448,512,[],"regular","M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464l349.5 0c-8.9-63.3-63.3-112-129-112l-91.4 0c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3z"],"street-view":[512,512,[],"solid","M320 64A64 64 0 1 0 192 64a64 64 0 1 0 128 0zm-96 96c-35.3 0-64 28.7-64 64l0 48c0 17.7 14.3 32 32 32l1.8 0 11.1 99.5c1.8 16.2 15.5 28.5 31.8 28.5l38.7 0c16.3 0 30-12.3 31.8-28.5L318.2 304l1.8 0c17.7 0 32-14.3 32-32l0-48c0-35.3-28.7-64-64-64l-64 0zM132.3 394.2c13-2.4 21.7-14.9 19.3-27.9s-14.9-21.7-27.9-19.3c-32.4 5.9-60.9 14.2-82 24.8c-10.5 5.3-20.3 11.7-27.8 19.6C6.4 399.5 0 410.5 0 424c0 21.4 15.5 36.1 29.1 45c14.7 9.6 34.3 17.3 56.4 23.4C130.2 504.7 190.4 512 256 512s125.8-7.3 170.4-19.6c22.1-6.1 41.8-13.8 56.4-23.4c13.7-8.9 29.1-23.6 29.1-45c0-13.5-6.4-24.5-14-32.6c-7.5-7.9-17.3-14.3-27.8-19.6c-21-10.6-49.5-18.9-82-24.8c-13-2.4-25.5 6.3-27.9 19.3s6.3 25.5 19.3 27.9c30.2 5.5 53.7 12.8 69 20.5c3.2 1.6 5.8 3.1 7.9 4.5c3.6 2.4 3.6 7.2 0 9.6c-8.8 5.7-23.1 11.8-43 17.3C374.3 457 318.5 464 256 464s-118.3-7-157.7-17.9c-19.9-5.5-34.2-11.6-43-17.3c-3.6-2.4-3.6-7.2 0-9.6c2.1-1.4 4.8-2.9 7.9-4.5c15.3-7.7 38.8-14.9 69-20.5z"],"closed-captioning":[576,512,["cc"],"regular","M512 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l448 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM200 208c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48s21.5-48 48-48zm144 48c0-26.5 21.5-48 48-48c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48z"],bone:[576,512,[],"solid","M153.7 144.8c6.9 16.3 20.6 31.2 38.3 31.2l192 0c17.7 0 31.4-14.9 38.3-31.2C434.4 116.1 462.9 96 496 96c44.2 0 80 35.8 80 80c0 30.4-17 56.9-42 70.4c-3.6 1.9-6 5.5-6 9.6s2.4 7.7 6 9.6c25 13.5 42 40 42 70.4c0 44.2-35.8 80-80 80c-33.1 0-61.6-20.1-73.7-48.8C415.4 350.9 401.7 336 384 336l-192 0c-17.7 0-31.4 14.9-38.3 31.2C141.6 395.9 113.1 416 80 416c-44.2 0-80-35.8-80-80c0-30.4 17-56.9 42-70.4c3.6-1.9 6-5.5 6-9.6s-2.4-7.7-6-9.6C17 232.9 0 206.4 0 176c0-44.2 35.8-80 80-80c33.1 0 61.6 20.1 73.7 48.8z"],"hands-asl-interpreting":[640,512,["asl"],"solid","M156.6 46.3c7.9-15.8 1.5-35-14.3-42.9s-35-1.5-42.9 14.3L13.5 189.4C4.6 207.2 0 226.8 0 246.7L0 256c0 70.7 57.3 128 128 128l72 0 8 0 0-.3c35.2-2.7 65.4-22.8 82.1-51.7c8.8-15.3 3.6-34.9-11.7-43.7s-34.9-3.6-43.7 11.7c-7 12-19.9 20-34.7 20c-22.1 0-40-17.9-40-40s17.9-40 40-40c14.8 0 27.7 8 34.7 20c8.8 15.3 28.4 20.5 43.7 11.7s20.5-28.4 11.7-43.7c-12.8-22.1-33.6-39.1-58.4-47.1l80.8-22c17-4.6 27.1-22.2 22.5-39.3s-22.2-27.1-39.3-22.5L194.9 124.6l81.6-68c13.6-11.3 15.4-31.5 4.1-45.1S249.1-3.9 235.5 7.4L133.6 92.3l23-46zM483.4 465.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l85.9-171.7c8.9-17.8 13.5-37.4 13.5-57.2l0-9.3c0-70.7-57.3-128-128-128l-72 0-8 0 0 .3c-35.2 2.7-65.4 22.8-82.1 51.7c-8.9 15.3-3.6 34.9 11.7 43.7s34.9 3.6 43.7-11.7c7-12 19.9-20 34.7-20c22.1 0 40 17.9 40 40s-17.9 40-40 40c-14.8 0-27.7-8-34.7-20c-8.9-15.3-28.4-20.5-43.7-11.7s-20.5 28.4-11.7 43.7c12.8 22.1 33.6 39.1 58.4 47.1l-80.8 22c-17.1 4.7-27.1 22.2-22.5 39.3s22.2 27.1 39.3 22.5l100.7-27.5-81.6 68c-13.6 11.3-15.4 31.5-4.1 45.1s31.5 15.4 45.1 4.1l101.9-84.9-23 46z"],sun:[512,512,[],"regular","M375.7 19.7c-1.5-8-6.9-14.7-14.4-17.8s-16.1-2.2-22.8 2.4L256 61.1 173.5 4.2c-6.7-4.6-15.3-5.5-22.8-2.4s-12.9 9.8-14.4 17.8l-18.1 98.5L19.7 136.3c-8 1.5-14.7 6.9-17.8 14.4s-2.2 16.1 2.4 22.8L61.1 256 4.2 338.5c-4.6 6.7-5.5 15.3-2.4 22.8s9.8 13 17.8 14.4l98.5 18.1 18.1 98.5c1.5 8 6.9 14.7 14.4 17.8s16.1 2.2 22.8-2.4L256 450.9l82.5 56.9c6.7 4.6 15.3 5.5 22.8 2.4s12.9-9.8 14.4-17.8l18.1-98.5 98.5-18.1c8-1.5 14.7-6.9 17.8-14.4s2.2-16.1-2.4-22.8L450.9 256l56.9-82.5c4.6-6.7 5.5-15.3 2.4-22.8s-9.8-12.9-17.8-14.4l-98.5-18.1L375.7 19.7zM269.6 110l65.6-45.2 14.4 78.3c1.8 9.8 9.5 17.5 19.3 19.3l78.3 14.4L402 242.4c-5.7 8.2-5.7 19 0 27.2l45.2 65.6-78.3 14.4c-9.8 1.8-17.5 9.5-19.3 19.3l-14.4 78.3L269.6 402c-8.2-5.7-19-5.7-27.2 0l-65.6 45.2-14.4-78.3c-1.8-9.8-9.5-17.5-19.3-19.3L64.8 335.2 110 269.6c5.7-8.2 5.7-19 0-27.2L64.8 176.8l78.3-14.4c9.8-1.8 17.5-9.5 19.3-19.3l14.4-78.3L242.4 110c8.2 5.7 19 5.7 27.2 0zM256 368a112 112 0 1 0 0-224 112 112 0 1 0 0 224zM192 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"],moon:[384,512,[],"regular","M144.7 98.7c-21 34.1-33.1 74.3-33.1 117.3c0 98 62.8 181.4 150.4 211.7c-12.4 2.8-25.3 4.3-38.6 4.3C126.6 432 48 353.3 48 256c0-68.9 39.4-128.4 96.8-157.3zm62.1-66C91.1 41.2 0 137.9 0 256C0 379.7 100 480 223.5 480c47.8 0 92-15 128.4-40.6c1.9-1.3 3.7-2.7 5.5-4c4.8-3.6 9.4-7.4 13.9-11.4c2.7-2.4 5.3-4.8 7.9-7.3c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-3.7 .6-7.4 1.2-11.1 1.6c-5 .5-10.1 .9-15.3 1c-1.2 0-2.5 0-3.7 0l-.3 0c-96.8-.2-175.2-78.9-175.2-176c0-54.8 24.9-103.7 64.1-136c1-.9 2.1-1.7 3.2-2.6c4-3.2 8.2-6.2 12.5-9c3.1-2 6.3-4 9.6-5.8c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-3.6-.3-7.1-.5-10.7-.6c-2.7-.1-5.5-.1-8.2-.1c-3.3 0-6.5 .1-9.8 .2c-2.3 .1-4.6 .2-6.9 .4z"],heart:[512,512,[],"regular","M225.8 468.2l-2.5-2.3L48.1 303.2C17.4 274.7 0 234.7 0 192.8l0-3.3c0-70.4 50-130.8 119.2-144C158.6 37.9 198.9 47 231 69.6c9 6.4 17.4 13.8 25 22.3c4.2-4.8 8.7-9.2 13.5-13.3c3.7-3.2 7.5-6.2 11.5-9c0 0 0 0 0 0C313.1 47 353.4 37.9 392.8 45.4C462 58.6 512 119.1 512 189.5l0 3.3c0 41.9-17.4 81.9-48.1 110.4L288.7 465.9l-2.5 2.3c-8.2 7.6-19 11.9-30.2 11.9s-22-4.2-30.2-11.9zM239.1 145c-.4-.3-.7-.7-1-1.1l-17.8-20-.1-.1s0 0 0 0c-23.1-25.9-58-37.7-92-31.2C81.6 101.5 48 142.1 48 189.5l0 3.3c0 28.5 11.9 55.8 32.8 75.2L256 430.7 431.2 268c20.9-19.4 32.8-46.7 32.8-75.2l0-3.3c0-47.3-33.6-88-80.1-96.9c-34-6.5-69 5.4-92 31.2c0 0 0 0-.1 .1s0 0-.1 .1l-17.8 20c-.3 .4-.7 .7-1 1.1c-4.5 4.5-10.6 7-16.9 7s-12.4-2.5-16.9-7z"],xmark:[384,512,[],"solid","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"],"wand-sparkles":[512,512,[],"solid","M464 6.1c9.5-8.5 24-8.1 33 .9l8 8c9 9 9.4 23.5 .9 33l-85.8 95.9c-2.6 2.9-4.1 6.7-4.1 10.7l0 21.4c0 8.8-7.2 16-16 16l-15.8 0c-4.6 0-8.9 1.9-11.9 5.3L100.7 500.9C94.3 508 85.3 512 75.8 512c-8.8 0-17.3-3.5-23.5-9.8L9.7 459.7C3.5 453.4 0 445 0 436.2c0-9.5 4-18.5 11.1-24.8l111.6-99.8c3.4-3 5.3-7.4 5.3-11.9l0-27.6c0-8.8 7.2-16 16-16l34.6 0c3.9 0 7.7-1.5 10.7-4.1L464 6.1zM432 288c3.6 0 6.7 2.4 7.7 5.8l14.8 51.7 51.7 14.8c3.4 1 5.8 4.1 5.8 7.7s-2.4 6.7-5.8 7.7l-51.7 14.8-14.8 51.7c-1 3.4-4.1 5.8-7.7 5.8s-6.7-2.4-7.7-5.8l-14.8-51.7-51.7-14.8c-3.4-1-5.8-4.1-5.8-7.7s2.4-6.7 5.8-7.7l51.7-14.8 14.8-51.7c1-3.4 4.1-5.8 7.7-5.8zM87.7 69.8l14.8 51.7 51.7 14.8c3.4 1 5.8 4.1 5.8 7.7s-2.4 6.7-5.8 7.7l-51.7 14.8L87.7 218.2c-1 3.4-4.1 5.8-7.7 5.8s-6.7-2.4-7.7-5.8L57.5 166.5 5.8 151.7c-3.4-1-5.8-4.1-5.8-7.7s2.4-6.7 5.8-7.7l51.7-14.8L72.3 69.8c1-3.4 4.1-5.8 7.7-5.8s6.7 2.4 7.7 5.8zM208 0c3.7 0 6.9 2.5 7.8 6.1l6.8 27.3 27.3 6.8c3.6 .9 6.1 4.1 6.1 7.8s-2.5 6.9-6.1 7.8l-27.3 6.8-6.8 27.3c-.9 3.6-4.1 6.1-7.8 6.1s-6.9-2.5-7.8-6.1l-6.8-27.3-27.3-6.8c-3.6-.9-6.1-4.1-6.1-7.8s2.5-6.9 6.1-7.8l27.3-6.8 6.8-27.3c.9-3.6 4.1-6.1 7.8-6.1z"],star:[576,512,[],"regular","M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.7 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z"],"puzzle-piece":[512,512,[],"solid","M192 104.8c0-9.2-5.8-17.3-13.2-22.8C167.2 73.3 160 61.3 160 48c0-26.5 28.7-48 64-48s64 21.5 64 48c0 13.3-7.2 25.3-18.8 34c-7.4 5.5-13.2 13.6-13.2 22.8c0 12.8 10.4 23.2 23.2 23.2l56.8 0c26.5 0 48 21.5 48 48l0 56.8c0 12.8 10.4 23.2 23.2 23.2c9.2 0 17.3-5.8 22.8-13.2c8.7-11.6 20.7-18.8 34-18.8c26.5 0 48 28.7 48 64s-21.5 64-48 64c-13.3 0-25.3-7.2-34-18.8c-5.5-7.4-13.6-13.2-22.8-13.2c-12.8 0-23.2 10.4-23.2 23.2L384 464c0 26.5-21.5 48-48 48l-56.8 0c-12.8 0-23.2-10.4-23.2-23.2c0-9.2 5.8-17.3 13.2-22.8c11.6-8.7 18.8-20.7 18.8-34c0-26.5-28.7-48-64-48s-64 21.5-64 48c0 13.3 7.2 25.3 18.8 34c7.4 5.5 13.2 13.6 13.2 22.8c0 12.8-10.4 23.2-23.2 23.2L48 512c-26.5 0-48-21.5-48-48L0 343.2C0 330.4 10.4 320 23.2 320c9.2 0 17.3 5.8 22.8 13.2C54.7 344.8 66.7 352 80 352c26.5 0 48-28.7 48-64s-21.5-64-48-64c-13.3 0-25.3 7.2-34 18.8C40.5 250.2 32.4 256 23.2 256C10.4 256 0 245.6 0 232.8L0 176c0-26.5 21.5-48 48-48l120.8 0c12.8 0 23.2-10.4 23.2-23.2z"],discord:[640,512,[],"brands","M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"],github:[496,512,[],"brands","M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"],"square-js":[448,512,[],"brands","M448 96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96zM180.9 444.9c-33.7 0-53.2-17.4-63.2-38.5L152 385.7c6.6 11.7 12.6 21.6 27.1 21.6c13.8 0 22.6-5.4 22.6-26.5V237.7h42.1V381.4c0 43.6-25.6 63.5-62.9 63.5zm85.8-43L301 382.1c9 14.7 20.8 25.6 41.5 25.6c17.4 0 28.6-8.7 28.6-20.8c0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5c0-31.6 24.1-55.6 61.6-55.6c26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18c-12.3 0-20.1 7.8-20.1 18c0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2c0 37.8-29.8 58.6-69.7 58.6c-39.1 0-64.4-18.6-76.7-43z"],python:[448,512,[],"brands","M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"],microsoft:[448,512,[],"brands","M0 32h214.6v214.6H0V32zm233.4 0H448v214.6H233.4V32zM0 265.4h214.6V480H0V265.4zm233.4 0H448V480H233.4V265.4z"],apple:[384,512,[],"brands","M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"],youtube:[576,512,[],"brands","M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"],"x-twitter":[512,512,[],"brands","M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"],chrome:[512,512,[],"brands","M0 256C0 209.4 12.47 165.6 34.27 127.1L144.1 318.3C166 357.5 207.9 384 256 384C270.3 384 283.1 381.7 296.8 377.4L220.5 509.6C95.9 492.3 0 385.3 0 256zM365.1 321.6C377.4 302.4 384 279.1 384 256C384 217.8 367.2 183.5 340.7 160H493.4C505.4 189.6 512 222.1 512 256C512 397.4 397.4 511.1 256 512L365.1 321.6zM477.8 128H256C193.1 128 142.3 172.1 130.5 230.7L54.19 98.47C101 38.53 174 0 256 0C350.8 0 433.5 51.48 477.8 128V128zM168 256C168 207.4 207.4 168 256 168C304.6 168 344 207.4 344 256C344 304.6 304.6 344 256 344C207.4 344 168 304.6 168 256z"],reddit:[512,512,[],"brands","M0 256C0 114.6 114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256L37.1 512c-13.7 0-20.5-16.5-10.9-26.2L75 437C28.7 390.7 0 326.7 0 256zM349.6 153.6c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7c-20.6 0-37.8 14.6-41.8 34c-34.5 3.7-61.4 33-61.4 68.4l0 .2c-37.5 1.6-71.8 12.3-99 29.1c-10.1-7.8-22.8-12.5-36.5-12.5c-33 0-59.8 26.8-59.8 59.8c0 24 14.1 44.6 34.4 54.1c2 69.4 77.6 125.2 170.6 125.2s168.7-55.9 170.6-125.3c20.2-9.6 34.1-30.2 34.1-54c0-33-26.8-59.8-59.8-59.8c-13.7 0-26.3 4.6-36.4 12.4c-27.4-17-62.1-27.7-100-29.1l0-.2c0-25.4 18.9-46.5 43.4-49.9l0 0c4.4 18.8 21.3 32.8 41.5 32.8zM177.1 246.9c16.7 0 29.5 17.6 28.5 39.3s-13.5 29.6-30.3 29.6s-31.4-8.8-30.4-30.5s15.4-38.3 32.1-38.3zm190.1 38.3c1 21.7-13.7 30.5-30.4 30.5s-29.3-7.9-30.3-29.6c-1-21.7 11.8-39.3 28.5-39.3s31.2 16.6 32.1 38.3zm-48.1 56.7c-10.3 24.6-34.6 41.9-63 41.9s-52.7-17.3-63-41.9c-1.2-2.9 .8-6.2 3.9-6.5c18.4-1.9 38.3-2.9 59.1-2.9s40.7 1 59.1 2.9c3.1 .3 5.1 3.6 3.9 6.5z"],ubuntu:[576,512,[],"brands","M469.2 75A75.6 75.6 0 1 0 317.9 75a75.6 75.6 0 1 0 151.2 0zM154.2 240.7A75.6 75.6 0 1 0 3 240.7a75.6 75.6 0 1 0 151.2 0zM57 346C75.6 392.9 108 433 150 461.1s91.5 42.6 142 41.7c-14.7-18.6-22.9-41.5-23.2-65.2c-6.8-.9-13.3-2.1-19.5-3.4c-26.8-5.7-51.9-17.3-73.6-34s-39.3-38.1-51.7-62.5c-20.9 9.9-44.5 12.8-67.1 8.2zm395.1 89.8a75.6 75.6 0 1 0 -151.2 0 75.6 75.6 0 1 0 151.2 0zM444 351.6c18.5 14.8 31.6 35.2 37.2 58.2c33.3-41.3 52.6-92.2 54.8-145.2s-12.5-105.4-42.2-149.4c-8.6 21.5-24 39.6-43.8 51.6c15.4 28.6 22.9 60.8 21.9 93.2s-10.7 64-28 91.6zM101.1 135.4c12.4 2.7 24.3 7.5 35.1 14.3c16.6-24.2 38.9-44.1 64.8-58S255.8 70.4 285.2 70c.2-5.9 .9-11.9 2-17.7c3.6-16.7 11.1-32.3 21.8-45.5c-47.7-3.8-95.4 6-137.6 28.5S94.3 91.7 70.8 133.4c2.7-.2 5.3-.3 8-.3c7.5 0 15 .8 22.4 2.3z"],whatsapp:[448,512,[],"brands","M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"],linux:[448,512,[],"brands","M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z"],instagram:[448,512,[],"brands","M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"],facebook:[512,512,[],"brands","M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z"],safari:[512,512,[],"brands","M274.69,274.69l-37.38-37.38L166,346ZM256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8ZM411.85,182.79l14.78-6.13A8,8,0,0,1,437.08,181h0a8,8,0,0,1-4.33,10.46L418,197.57a8,8,0,0,1-10.45-4.33h0A8,8,0,0,1,411.85,182.79ZM314.43,94l6.12-14.78A8,8,0,0,1,331,74.92h0a8,8,0,0,1,4.33,10.45l-6.13,14.78a8,8,0,0,1-10.45,4.33h0A8,8,0,0,1,314.43,94ZM256,60h0a8,8,0,0,1,8,8V84a8,8,0,0,1-8,8h0a8,8,0,0,1-8-8V68A8,8,0,0,1,256,60ZM181,74.92a8,8,0,0,1,10.46,4.33L197.57,94a8,8,0,1,1-14.78,6.12l-6.13-14.78A8,8,0,0,1,181,74.92Zm-63.58,42.49h0a8,8,0,0,1,11.31,0L140,128.72A8,8,0,0,1,140,140h0a8,8,0,0,1-11.31,0l-11.31-11.31A8,8,0,0,1,117.41,117.41ZM60,256h0a8,8,0,0,1,8-8H84a8,8,0,0,1,8,8h0a8,8,0,0,1-8,8H68A8,8,0,0,1,60,256Zm40.15,73.21-14.78,6.13A8,8,0,0,1,74.92,331h0a8,8,0,0,1,4.33-10.46L94,314.43a8,8,0,0,1,10.45,4.33h0A8,8,0,0,1,100.15,329.21Zm4.33-136h0A8,8,0,0,1,94,197.57l-14.78-6.12A8,8,0,0,1,74.92,181h0a8,8,0,0,1,10.45-4.33l14.78,6.13A8,8,0,0,1,104.48,193.24ZM197.57,418l-6.12,14.78a8,8,0,0,1-14.79-6.12l6.13-14.78A8,8,0,1,1,197.57,418ZM264,444a8,8,0,0,1-8,8h0a8,8,0,0,1-8-8V428a8,8,0,0,1,8-8h0a8,8,0,0,1,8,8Zm67-6.92h0a8,8,0,0,1-10.46-4.33L314.43,418a8,8,0,0,1,4.33-10.45h0a8,8,0,0,1,10.45,4.33l6.13,14.78A8,8,0,0,1,331,437.08Zm63.58-42.49h0a8,8,0,0,1-11.31,0L372,383.28A8,8,0,0,1,372,372h0a8,8,0,0,1,11.31,0l11.31,11.31A8,8,0,0,1,394.59,394.59ZM286.25,286.25,110.34,401.66,225.75,225.75,401.66,110.34ZM437.08,331h0a8,8,0,0,1-10.45,4.33l-14.78-6.13a8,8,0,0,1-4.33-10.45h0A8,8,0,0,1,418,314.43l14.78,6.12A8,8,0,0,1,437.08,331ZM444,264H428a8,8,0,0,1-8-8h0a8,8,0,0,1,8-8h16a8,8,0,0,1,8,8h0A8,8,0,0,1,444,264Z"],google:[488,512,[],"brands","M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"],npm:[576,512,[],"brands","M288 288h-32v-64h32v64zm288-128v192H288v32H160v-32H0V160h576zm-416 32H32v128h64v-96h32v96h32V192zm160 0H192v160h64v-32h64V192zm224 0H352v128h64v-96h32v96h32v-96h32v96h32V192z"],"bluetooth-b":[320,512,[],"brands","M196.48 260.023l92.626-103.333L143.125 0v206.33l-86.111-86.111-31.406 31.405 108.061 108.399L25.608 368.422l31.406 31.405 86.111-86.111L145.84 512l148.552-148.644-97.912-103.333zm40.86-102.996l-49.977 49.978-.338-100.295 50.315 50.317zM187.363 313.04l49.977 49.978-50.315 50.316.338-100.294z"],vr:"vr-cardboard","sticky-note":"note-sticky",script:"scroll",save:"floppy-disk",media:"photo-film","arrows-up-down-left-right":"arrows","rotate-forward":"rotate-right","rotate-back":"rotate-left",cc:"closed-captioning",asl:"hands-asl-interpreting"};export{b as LX};