Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@osjs/gui

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@osjs/gui - npm Package Compare versions

Comparing version 4.0.7 to 4.0.8

5

CHANGELOG.md
# Changelog for osjs-gui
## 4.0.8
* Fixed some contextmenu issues
* Updated documentation
## 4.0.7

@@ -4,0 +9,0 @@

2

dist/esm.js

@@ -1,2 +0,2 @@

function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}var arrayWithoutHoles=_arrayWithoutHoles;function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}var iterableToArray=_iterableToArray;function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var nonIterableSpread=_nonIterableSpread;function _toConsumableArray(e){return arrayWithoutHoles(e)||iterableToArray(e)||nonIterableSpread()}var toConsumableArray=_toConsumableArray;function h(e,t){for(var n=[],o=[],a=arguments.length;2<a--;)n.push(arguments[a]);for(;n.length;){var s=n.pop();if(s&&s.pop)for(a=s.length;a--;)n.push(s[a]);else null!=s&&!0!==s&&!1!==s&&o.push(s)}return"function"==typeof e?e(t||{},o):{nodeName:e,attributes:t||{},children:o,key:t&&t.key}}function app(e,t,n,o){function a(e){return{nodeName:e.nodeName.toLowerCase(),attributes:{},children:k.call(e.childNodes,function(e){return 3===e.nodeType?e.nodeValue:a(e)})}}function s(e){return"function"==typeof e?s(e(S,I)):null==e?"":e}function i(){b=!b;var e=s(n);for(o&&!b&&(w=f(o,w,j,j=e)),L=!1;_.length;)_.pop()()}function r(){b||(b=!0,setTimeout(i))}function l(e,t){var n={};for(var o in e)n[o]=e[o];for(var o in t)n[o]=t[o];return n}function c(e,t,n){var o={};return e.length?(o[e[0]]=1<e.length?c(e.slice(1),t,n[e[0]]):t,l(n,o)):t}function d(e,t){for(var n=0;n<e.length;)t=t[e[n++]];return t}function p(e,t,n){for(var o in n)"function"==typeof n[o]?function(o,a){n[o]=function(o){var s=a(o);return"function"==typeof s&&(s=s(d(e,S),n)),s&&s!==(t=d(e,S))&&!s.then&&r(S=c(e,l(t,s),S)),s}}(o,n[o]):p(e.concat(o),t[o]=l(t[o]),n[o]=l(n[o]));return n}function u(e){return e?e.key:null}function g(e){return e.currentTarget.events[e.type](e)}function h(e,t,n,o,a){if("key"===t);else if("style"!==t)"o"===t[0]&&"n"===t[1]?(t=t.slice(2),e.events?!o&&(o=e.events[t]):e.events={},e.events[t]=n,n?!o&&e.addEventListener(t,g):e.removeEventListener(t,g)):t in e&&"list"!==t&&"type"!==t&&"draggable"!==t&&"spellcheck"!==t&&"translate"!==t&&!a?e[t]=null==n?"":n:null!=n&&!1!==n&&e.setAttribute(t,n),(null==n||!1===n)&&e.removeAttribute(t);else if("string"==typeof n)e.style.cssText=n;else for(var s in"string"==typeof o&&(o=e.style.cssText=""),l(o,n)){var i=null==n||null==n[s]?"":n[s];"-"===s[0]?e.style.setProperty(s,i):e.style[s]=i}}function m(e,t){var n="string"==typeof e||"number"==typeof e?document.createTextNode(e):(t=t||"svg"===e.nodeName)?document.createElementNS("http://www.w3.org/2000/svg",e.nodeName):document.createElement(e.nodeName),o=e.attributes;if(o){o.oncreate&&_.push(function(){o.oncreate(n)});for(var a=0;a<e.children.length;a++)n.appendChild(m(e.children[a]=s(e.children[a]),t));for(var r in o)h(n,r,o[r],null,t)}return n}function y(e,t,n,o){for(var a in l(t,n))n[a]!==("value"==a||"checked"==a?e[a]:t[a])&&h(e,a,n[a],t[a],o);var s=L?n.oncreate:n.onupdate;s&&_.push(function(){s(e,t)})}function v(e,t){var n=t.attributes;if(n){for(var o=0;o<t.children.length;o++)v(e.childNodes[o],t.children[o]);n.ondestroy&&n.ondestroy(e)}return e}function x(e,t,n){function o(){e.removeChild(v(t,n))}var a=n.attributes&&n.attributes.onremove;a?a(t,o):o()}function f(e,t,n,o,a){if(o===n);else if(null==n||n.nodeName!==o.nodeName){var r=m(o,a);e.insertBefore(r,t),null!=n&&x(e,t,n),t=r}else if(null==n.nodeName)t.nodeValue=o;else{y(t,n.attributes,o.attributes,a=a||"svg"===o.nodeName);for(var l={},c={},d=[],p=n.children,g=o.children,h=0;h<p.length;h++){d[h]=t.childNodes[h];var v=u(p[h]);null!=v&&(l[v]=[d[h],p[h]])}for(var h=0,b=0;b<g.length;){var v=u(p[h]),w=u(g[b]=s(g[b]));if(c[v]){h++;continue}if(null!=w&&w===u(p[h+1])){null==v&&x(t,d[h],p[h]),h++;continue}if(null==w||L)null==v&&(f(t,d[h],p[h],g[b],a),b++),h++;else{var j=l[w]||[];v===w?(f(t,j[0],j[1],g[b],a),h++):j[0]?f(t,t.insertBefore(j[0],d[h]),j[1],g[b],a):f(t,d[h],null,g[b],a),c[w]=g[b],b++}}for(;h<p.length;)null==u(p[h])&&x(t,d[h],p[h]),h++;for(var h in l)c[h]||x(t,l[h][0],l[h][1])}return t}var b,k=[].map,w=o&&o.children[0]||null,j=w&&a(w),_=[],L=!0,S=l(e),I=p([],S,l(t));return r(),I}var unitValue=function(e,t){return"number"==typeof e?"".concat(e,"px"):!1===e?t:e},boxPropNames={grow:function(e){return{flexGrow:e}},shrink:function(e){return{flexShrink:e}},basis:function(e){return{flexBasis:unitValue(e,"auto")}},align:function(e){return{alignItems:e}},justify:function(e){return{justifyContent:e}},padding:function(e){return{margin:unitValue(e,"0")}},margin:function(e){return{margin:unitValue(e,"0")}}},Element$1=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],n=e.class instanceof Array?e.class:[e.class],o=["osjs-gui"].concat(toConsumableArray(n));e.orientation&&o.push("osjs-gui-"+e.orientation);var a="string"==typeof e.style?{}:Object.assign({},e.style||{}),s=Object.keys(e).reduce(function(t,n){var o=boxPropNames[n]?boxPropNames[n](e[n]):void 0;return Object.assign({},t,o)},a);return h("div",{oncreate:e.oncreate,ondestroy:e.ondestroy,class:o.filter(function(e){return!!e}).join(" "),style:s},t)},Box=function(e,t){return h(Element$1,Object.assign({orientation:"horizontal"},e,{class:["osjs-gui-box",e.class]}),t)},BoxContainer=function(e,t){return h(Element$1,Object.assign({},e,{class:["osjs-gui-box-container",e.class]}),t)},BoxStyled=function(e,t){return h(Element$1,Object.assign({},e,{class:["osjs-gui-box-styled",e.class]}),t)};function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}var _typeof_1=createCommonjsModule(function(e){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(o){return e.exports="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?n=function(e){return t(e)}:n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},n(o)}e.exports=n}),Icon=function(e){return h("i",{"data-icon":"object"===_typeof_1(e)?e.name:void 0,class:"osjs-icon",style:{backgroundImage:"string"==typeof e?"url(".concat(e,")"):void 0}})};function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var defineProperty=_defineProperty,filteredProps=function(e,t){var n=Object.keys(e);return n.filter(function(e){return-1===t.indexOf(e)}).reduce(function(t,n){return Object.assign(defineProperty({},n,e[n]),t)},{})},doubleTap=function(){var e,t=0<arguments.length&&arguments[0]!==void 0?arguments[0]:250,n=!1;return function(o,a){return(e=clearTimeout(e),e=setTimeout(function(){return n=!1},t),n)?(o.preventDefault(),a(o)):(n=!0,!1)}},createField=function(e,t,n,o,a){var s=t.oninput||function(){},i=t.onchange||function(){},r=t.onkeydown||function(){},l=a||function(e){return[e.target.value]},c=Object.assign({oninput:function(e){return s.apply(void 0,[e].concat(toConsumableArray(l(e))))},onchange:function(e){return i.apply(void 0,[e].concat(toConsumableArray(l(e))))},onkeydown:function(e){13===e.keyCode&&t.onenter&&t.onenter.apply(t,[e].concat(toConsumableArray(l(e)))),r(e)}},n,filteredProps(t,["choices","label","box","oninput","onchange"]));return h(Element$1,Object.assign({},t.box||{},{class:"osjs-gui-field osjs-gui-"+e}),o(c))},Button=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return createField("button",e,{},function(n){var o=[];return e.icon&&o.push(h(Icon,e.icon)),"string"==typeof e.label&&o.push(h("span",{class:"osjs-label"},e.label)),h("button",n,o.concat(toConsumableArray(t)))})},Progressbar=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],n="number"==typeof e.value?Math.max(0,Math.abs(e.value))%100:0,o=h("div",{class:"osjs-gui-progressbar-wrapper"},[h("div",{className:"osjs-gui-progressbar-value",style:{width:n+""+"%"}}),h("div",{className:"osjs-gui-progressbar-label"},[h("span",{},[n+""+"%"])])]);return h(Element$1,Object.assign({},e.box||{},{class:["osjs-gui-progressbar",e.class]}),[o].concat(toConsumableArray(t)))},ul=function e(t){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0,a=function(e){var t=[];return"checkbox"===e.type||"boolean"==typeof e.checked?t.push(h("span",{class:"osjs-gui-menu-checkbox "+(e.checked?"active":"")})):e.icon&&t.push(h(Icon,e.icon)),t.push(h("span",{},e.label)),t},s=function(t,n){var s="separator"===n.type?"osjs-gui-menu-separator":"osjs-gui-menu-label "+(n.disabled?"osjs__disabled":""),i=[h("span",{class:s},a(n))];return n.items&&i.push(e(t,n.items,o+1)),i};return h("ul",{class:""},n.map(function(e){return h("li",{class:"osjs-gui-menu-entry"},[h("div",{class:"osjs-gui-menu-container","data-has-image":!!e.icon||void 0,"data-has-children":!!e.items||void 0,onmouseover:e.items?t.onshow:void 0,ontouchend:e.items?t.onshow:void 0,onclick:function(n){e.items||(e.onclick&&e.onclick(e,n),t.onclick&&t.onclick(e,n))}},s(t,e))])}))},Menu=function(e){return h("div",{id:"osjs-context-menu",className:"osjs-gui osjs-gui-menu",oncreate:e.oncreate,onupdate:e.onupdate,style:{display:!1===e.visible?"none":"block",top:e.position?e.position.top+""+"px":0,left:e.position?e.position.left+""+"px":0}},ul(e,e.menu))},Toolbar=function(e,t){return h(Element$1,Object.assign({orientation:"vertical"},e,{class:["osjs-gui-toolbar",e.class]}),t)},Statusbar=function(e,t){return h(Element$1,Object.assign({},e.box||{},{class:["osjs-gui-statusbar",e.class]}),t)},MenubarItem=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],n=e.onclick,o=e.data;return h("div",{onclick:function(e){if("function"==typeof n){var t=e.target.parentNode,a=Array.prototype.indexOf.call(t.children,e.target);n(e,o||{},a)}}},h("span",{},t))},Menubar=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return h(Element$1,Object.assign({},e,{class:["osjs-gui-menubar",e.class]}),toConsumableArray((e.items||[]).map(function(t){return h(MenubarItem,{data:t.data,onclick:t.onclick||e.onclick},t.label)})).concat(toConsumableArray(t)))};function nestable(e,t,n,o){return t._$r=function(){return{}},function(a,s){return h(o||"x-",{key:a.key,id:a.id,class:a.class,oncreate:function(o){var i=app(e,t,function(e,t){var a=n(e,t);return"function"==typeof a&&(a=a(o._$p,o._$c)),a},o);o._$p=a,o._$c=s,o._$r=i._$r,o._$u=i.uninit,i.init&&i.init(a),a.oncreate&&a.oncreate(o)},onupdate:function(e){e._$p=a,e._$c=s,e._$r(),a.onupdate&&a.onupdate(e)},ondestroy:function(e){e._$u&&e._$u()}})}}var _onmousedown=function(e,t,n){var o=e.target,a=e.clientX,s=e.clientY,i=o.previousSibling,r=i.offsetWidth,l=i.offsetHeight,c=Array.from(o.parentNode.children).indexOf(i),d=.8*i.parentNode.offsetWidth,p=.8*i.parentNode.offsetHeight;if(!(0>c)){var u=function(e){var o=Math.min;e.preventDefault();var i="vertical"===n?r:l;if("vertical"===n){var u=e.clientX-a;i=o(d,i+u)}else{var g=e.clientY-s;i=o(p,i+g)}t.setSize({index:c,size:i})},g=function e(t){t.preventDefault(),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",e)};e.preventDefault(),document.addEventListener("mousemove",u),document.addEventListener("mouseup",g)}},panes=function(e,t,n,o){var a=Array(Math.ceil(n.length/2)).fill(null).map(function(){return h("div",{class:"osjs-gui-panes-spacer",onmousedown:function(e){return _onmousedown(e,t,o)}})});return n.map(function(t,n){var o=e.sizes[n]?e.sizes[n]+""+"px":void 0;return h("div",{class:"osjs-gui-panes-pane",style:{flex:o?"0 0 ".concat(o):o}},t)}).map(function(e,t){return[e,a[t]]}).reduce(function(e,t){return e.concat(t)}).filter(function(e){return"undefined"!=typeof e})},view=function(e,t){return function(n,o){var a=n.orientation||"vertical";return h(Element$1,{orientation:a,class:"osjs-gui-panes-inner"},panes(e,t,o,a))}},inner=nestable({sizes:[]},{init:function(e){return{sizes:e.sizes||[150]}},setSize:function(e){var t=e.index,n=e.size;return function(e){var o=[].concat(e.sizes);return o[t]=n,{sizes:o}}}},view,"div"),Panes=function(e,t){return h(inner,{class:"osjs-gui-panes"},t)},tapper=doubleTap(),createView=function(e){var t=function(t){return function(n,o){var a=n.columns[t]||{},s=e.selectedIndex===o,i=a.icon?h(Icon,a.icon):null,r=[h("span",{},["object"===_typeof_1(a)?a.label:a])];return i&&r.unshift(i),h("div",{"data-has-icon":!!a.icon||void 0,class:"osjs-gui-list-view-cell"+(s?" osjs__active":""),ontouchstart:function(t){return tapper(t,function(){return e.onactivate({data:n.data,index:o,ev:t})})},ondblclick:function(t){return e.onactivate({data:n.data,index:o,ev:t})},onclick:function(t){return e.onselect({data:n.data,index:o,ev:t})},oncontextmenu:function(t){return e.oncontextmenu({data:n.data,index:o,ev:t})},oncreate:function(t){return e.oncreate({data:n.data,index:o,el:t})}},r)}},n=function(n,o){return h("div",{class:"osjs-gui-list-view-pane"},[h("div",{class:"osjs-gui-list-view-header",style:{display:e.hideColumns?"none":void 0}},"object"===_typeof_1(o)?o.label:o),h("div",{class:"rows"},e.rows.map(t(n)))])};return h("div",{class:"osjs-gui-list-view-wrapper",oncreate:function(t){return t.scrollTop=e.scrollTop},onupdate:function(t){0>e.selectedIndex&&(t.scrollTop=e.scrollTop)}},e.columns.map(function(e,t){return n(t,e)}))},ListView=function(e){return h(Element$1,Object.assign({class:"osjs-gui-list-view"},e.box||{}),createView(filteredProps(e,["box"])))},listView={component:function(e,t){var n=Object.assign({columns:[],rows:[],onselect:function(e){var n=e.data,o=e.index,a=e.ev;t.select({data:n,index:o,ev:a}),t.setSelectedIndex(o)},onactivate:function(e){var n=e.data,o=e.index,a=e.ev;t.activate({data:n,index:o,ev:a}),t.setSelectedIndex(-1)},oncontextmenu:function(e){var n=e.data,o=e.index,a=e.ev;t.select({data:n,index:o,ev:a}),t.contextmenu({data:n,index:o,ev:a}),t.setSelectedIndex(o)},oncreate:function(e){t.created(e)}},e);return function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return ListView(Object.assign(n,e))}},state:function(e){return Object.assign({selectedIndex:-1,scrollTop:0},e)},actions:function(e){return Object.assign({select:function(){return function(){return{}}},activate:function(){return function(){return{}}},contextmenu:function(){return function(){return{}}},created:function(){return function(){return{}}},setRows:function(e){return{rows:e}},setColumns:function(e){return{columns:e}},setScrollTop:function(e){return function(){return{scrollTop:e}}},setSelectedIndex:function(e){return function(){return{selectedIndex:e}}}},e||{})}},tapper$1=doubleTap(),IconViewEntry=function(e,t,n){return function(){var o=e.icon||{name:"application-x-executable"},a=n.selectedIndex===t;return h("div",{class:"osjs-gui-icon-view-entry"+(a?" osjs__active":""),ontouchstart:function(o){return tapper$1(o,function(){return n.onactivate({data:e.data,index:t,ev:o})})},ondblclick:function(o){return n.onactivate({data:e.data,index:t,ev:o})},onclick:function(o){return n.onselect({data:e.data,index:t,ev:o})},oncontextmenu:function(o){return n.oncontextmenu({data:e.data,index:t,ev:o})},oncreate:function(o){return n.oncreate({data:e.data,index:t,el:o})}},[h("div",{class:"osjs__container"},[h("div",{class:"osjs__image"},[h(Icon,o)]),h("div",{class:"osjs__label"},[h("span",{},e.label)])])])}},IconView=function(e){var t=h("div",{class:"osjs-gui-icon-view-wrapper",oncreate:function(t){return t.scrollTop=e.scrollTop},onupdate:function(t){0>e.selectedIndex&&(t.scrollTop=e.scrollTop)}},e.entries.map(function(t,n){return h(IconViewEntry(t,n,e))}));return h(Element$1,Object.assign({class:"osjs-gui-icon-view"},e.box||{}),t)},iconView={component:function(e,t){var n=Object.assign({entries:[],onselect:function(e){var n=e.data,o=e.index,a=e.ev;t.select({data:n,index:o,ev:a}),t.setSelectedIndex(o)},onactivate:function(e){var n=e.data,o=e.index,a=e.ev;t.activate({data:n,index:o,ev:a}),t.setSelectedIndex(-1)},oncontextmenu:function(e){var n=e.data,o=e.index,a=e.ev;t.select({data:n,index:o,ev:a}),t.contextmenu({data:n,index:o,ev:a}),t.setSelectedIndex(o)},oncreate:function(e){t.created(e)}},e);return function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return IconView(Object.assign(n,e))}},state:function(e){return Object.assign({selectedIndex:-1,scrollTop:0},e)},actions:function(e){return Object.assign({select:function(){return function(){return{}}},activate:function(){return function(){return{}}},contextmenu:function(){return function(){return{}}},created:function(){return function(){return{}}},setEntries:function(e){return function(){return{entries:e}}},setScrollTop:function(e){return function(){return{scrollTop:e}}},setSelectedIndex:function(e){return function(){return{selectedIndex:e}}}},e||{})}},Image=function(e){return h("div",{class:"osjs-gui osjs-gui-image",style:{width:e.width?e.width+""+"px":void 0,height:e.height?e.height+""+"px":void 0}},[h("img",{src:e.src,width:e.width,height:e.height,onload:e.onload,oncreate:e.oncreate,onupdate:e.onupdate,ondestroy:e.ondestroy})])},sources=function(e){return e.map(function(e){return h("source",e)})},isTrue=function(e){return"undefined"==typeof e||!0===e},Video=function(e){return h("div",{class:"osjs-gui osjs-gui-video",style:{width:e.width?e.width+""+"px":void 0,height:e.height?e.height+""+"px":void 0}},[h("video",{src:e.src,width:e.width,height:e.height,poster:e.poster,loop:e.loop?"loop":void 0,muted:e.muted?"muted":void 0,controls:isTrue(e.controls)?"controls":void 0,autoplay:isTrue(e.autoplay)?"autoplay":void 0,onloadeddata:e.onload,oncreate:e.oncreate,onupdate:e.onupdate,ondestroy:e.ondestroy},sources(e.sources||[]))])},headers=function(e,t,n){return(e||[]).map(function(e,o){return h("div",{class:t.selectedIndex===o?"osjs__active":"",onclick:function(){return n.setSelectedIndex(o)}},h("span",{},e))})},panes$1=function(e,t){return t.map(function(t,n){return h("div",{class:e.selectedIndex===n?"osjs__active":""},t)})},view$1=nestable({selectedIndex:0},{setSelectedIndex:function(e){return function(){return{selectedIndex:e}}}},function(e,t){return function(n,o){return h("div",{class:"osjs-gui-tabs-wrapper"},[h("div",{class:"osjs-gui-tabs-header"},headers(n.labels,e,t)),h("div",{class:"osjs-gui-tabs-panes"},panes$1(e,o))])}},"div"),Tabs=function(e,t){return h(view$1,Object.assign({class:"osjs-gui osjs-gui-tabs "+(e.class||"")},e),t)},Iframe=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return h(Element$1,Object.assign({},e.box||{},{class:["osjs-gui-iframe",e.class]}),[h("iframe",Object.assign({frameborder:0},filteredProps(e,["box"])))].concat(toConsumableArray(t)))},TextField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return createField("text-field",e,{autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",type:"text"},function(e){return h("input",e)})},TextareaField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return createField("textarea-field",e,{rows:4},function(e){return h("textarea",e,t)})},SelectField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],n=Object.keys(e.choices||{}).reduce(function(t,n){return t.push(h("option",{value:n,selected:e.key===e.choices[n]},e.choices[n])),t},[]);return createField("select-field",e,{selectedIndex:void 0},function(e){return h("div",{},h("select",e,toConsumableArray(n).concat(toConsumableArray(t))))},function(e){return[e.target.value,e.target.textContent]})},ToggleField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return createField("toggle-field",e,{type:"checkbox",checked:!1},function(n){return h("label",{},[h("input",n),h("span",{class:"osjs-toggle-input"}),h("span",{class:"osjs-toggle-label"},[e.label||""].concat(toConsumableArray(t)))])},function(t){return["radio"===e.type?JSON.parse(t.target.value):!!t.target.checked]})},RangeField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return createField("range-field",e,{type:"range"},function(e){return h("input",e)})},view$2=function(e,t){return function(n,o){return h(Element$1,Object.assign({},n.box||{},{class:["osjs-gui-expander-wrapper"]}),[h("div",{class:"osjs-gui-expander-header",onclick:function(o){return t.ontoggle({ev:o,active:!e.active,ontoggle:n.ontoggle})}},[h("div",{class:"osjs-gui-expander-header-icon","data-active":e.active+""}),h("div",{class:"osjs-gui-expander-header-label"},n.label)]),h("div",{class:"osjs-gui-expander-content",style:{display:!1===e.active?"none":void 0}},o)])}},inner$1=nestable({active:!0},{init:function(e){return{ative:!1!==e.active}},ontoggle:function(e){var t=e.ev,n=e.active,o=e.ontoggle;return(o||function(){})(t,n),{active:n}}},view$2,"div"),Expander=function(e,t){return h(inner$1,Object.assign({},e,{class:"osjs-gui osjs-gui-expander"}),t)},runtime=createCommonjsModule(function(e){!function(t){function n(e,t,n,o){var s=t&&t.prototype instanceof a?t:a,i=Object.create(s.prototype),r=new g(o||[]);return i._invoke=c(e,n,r),i}function o(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function a(){}function s(){}function i(){}function r(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(e){function t(n,a,s,i){var r=o(e[n],e,a);if("throw"===r.type)i(r.arg);else{var l=r.arg,c=l.value;return c&&"object"==typeof c&&v.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,s,i)},function(e){t("throw",e,s,i)}):Promise.resolve(c).then(function(e){l.value=e,s(l)},function(e){return t("throw",e,s,i)})}}function n(e,n){function o(){return new Promise(function(o,a){t(e,n,o,a)})}return a=a?a.then(o,o):o()}var a;this._invoke=n}function c(e,t,n){var a="suspendedStart";return function(s,i){if(a==="executing")throw new Error("Generator is already running");if("completed"===a){if("throw"===s)throw i;return m()}for(n.method=s,n.arg=i;;){var r=n.delegate;if(r){var l=d(r,n);if(l){if(l===j)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var c=o(e,t,n);if("normal"===c.type){if(a=n.done?"completed":"suspendedYield",c.arg===j)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a="completed",n.method="throw",n.arg=c.arg)}}}function d(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,d(e,t),"throw"===t.method))return j;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return j}var a=o(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,j;var s=a.arg;if(!s)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,j;if(s.done)t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0);else return s;return t.delegate=null,j}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function u(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function g(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function h(e){if(e){var t=e[f];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(v.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:m}}function m(){return{value:void 0,done:!0}}var y=Object.prototype,v=y.hasOwnProperty,x="function"==typeof Symbol?Symbol:{},f=x.iterator||"@@iterator",b=x.asyncIterator||"@@asyncIterator",k=x.toStringTag||"@@toStringTag",w=t.regeneratorRuntime;if(w)return void(e.exports=w);w=t.regeneratorRuntime=e.exports,w.wrap=n;var j={},_={};_[f]=function(){return this};var L=Object.getPrototypeOf,S=L&&L(L(h([])));S&&S!==y&&v.call(S,f)&&(_=S);var I=i.prototype=a.prototype=Object.create(_);s.prototype=I.constructor=i,i.constructor=s,i[k]=s.displayName="GeneratorFunction",w.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===s||"GeneratorFunction"===(t.displayName||t.name))},w.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,!(k in e)&&(e[k]="GeneratorFunction")),e.prototype=Object.create(I),e},w.awrap=function(e){return{__await:e}},r(l.prototype),l.prototype[b]=function(){return this},w.AsyncIterator=l,w.async=function(e,t,o,a){var s=new l(n(e,t,o,a));return w.isGeneratorFunction(t)?s:s.next().then(function(e){return e.done?e.value:s.next()})},r(I),I[k]="Generator",I[f]=function(){return this},I.toString=function(){return"[object Generator]"},w.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var o=t.pop();if(o in e)return n.value=o,n.done=!1,n}return n.done=!0,n}},w.values=h,g.prototype={constructor:g,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(u),!e)for(var t in this)"t"===t.charAt(0)&&v.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,o){return s.type="throw",s.arg=e,n.next=t,o&&(n.method="next",n.arg=void 0),!!o}if(this.done)throw e;for(var n=this,o=this.tryEntries.length-1;0<=o;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var r=v.call(a,"catchLoc"),l=v.call(a,"finallyLoc");if(r&&l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(r){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);}else if(!l)throw new Error("try statement without catch or finally");else if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}},abrupt:function(e,t){for(var n,o=this.tryEntries.length-1;0<=o;--o)if(n=this.tryEntries[o],n.tryLoc<=this.prev&&v.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=e,s.arg=t,a?(this.method="next",this.next=a.finallyLoc,j):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),j},finish:function(e){for(var t,n=this.tryEntries.length-1;0<=n;--n)if(t=this.tryEntries[n],t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),u(t),j},catch:function(e){for(var t,n=this.tryEntries.length-1;0<=n;--n)if(t=this.tryEntries[n],t.tryLoc===e){var o=t.completion;if("throw"===o.type){var a=o.arg;u(t)}return a}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:h(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),j}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())}),g=function(){return this||"object"==typeof self&&self}()||Function("return this")(),hadRuntime=g.regeneratorRuntime&&0<=Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime"),oldRuntime=hadRuntime&&g.regeneratorRuntime;g.regeneratorRuntime=void 0;var runtimeModule=runtime;if(hadRuntime)g.regeneratorRuntime=oldRuntime;else try{delete g.regeneratorRuntime}catch(t){g.regeneratorRuntime=void 0}var regenerator=runtimeModule;function asyncGeneratorStep(e,t,n,o,a,s,i){try{var r=e[s](i),l=r.value}catch(e){return void n(e)}r.done?t(l):Promise.resolve(l).then(o,a)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(o,a){function s(e){asyncGeneratorStep(r,o,a,s,i,"next",e)}function i(e){asyncGeneratorStep(r,o,a,s,i,"throw",e)}var r=e.apply(t,n);s(void 0)})}}var asyncToGenerator=_asyncToGenerator;function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var classCallCheck=_classCallCheck;function _defineProperties(e,t){for(var n,o=0;o<t.length;o++)n=t[o],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}var createClass=_createClass,clampSubMenu=function(e,t){var n=t.target.querySelector("ul");if(n&&(n.classList.contains("osjs-gui-menu-container")&&(n=n.parentNode.parentNode),n&&n.offsetParent)){n.classList.remove("clamp-right");var o=n.getBoundingClientRect();o.right>e.offsetWidth&&n.classList.add("clamp-right")}},clampMenu=function(e,t,n){var o={},a=n.top+t.offsetHeight,s=n.left+t.offsetWidth,i=e.offsetHeight-n.top,r=e.offsetWidth-n.left,l=s>e.offsetWidth,c=a>e.offsetHeight;return c&&(o.top=e.offsetHeight-t.offsetHeight-i),l&&(o.left=e.offsetWidth-t.offsetHeight-r),c||l?o:null},view$3=function(e){return function(t,n){return h(Menu,{position:t.position,visible:t.visible,menu:t.menu,onclick:e,onshow:n.onshow,onupdate:function(e){return n.clamp(e)},oncreate:function(e){return n.clamp(e)}})}},ContextMenu=function(){function e(t){classCallCheck(this,e),this.core=t,this.callback=function(){},this.actions=null}return createClass(e,[{key:"destroy",value:function(){this.callback=null,this.actions=null}},{key:"init",value:function(){var e,t=this;this.actions=app({visible:!1,menu:[],position:{top:0,left:0}},{clamp:function(n){return function(o){var a=t.core.$root;clearTimeout(e);var s=clampMenu(a,n,o.position);return s?{position:s}:{}}},onshow:function(n){return function(){clearTimeout(e),e=setTimeout(function(){return clampSubMenu(t.core.$root,n)},100)}},show:function(e){return function(){var n=e.menu,o=e.position;if(o instanceof Event)o={left:o.clientX,top:o.clientY};else if(o instanceof Element){var a=o.getBoundingClientRect();o={left:a.left,top:a.top+a.height}}return t.callback=function(){e.callback&&e.callback.apply(e,arguments),t.actions.hide()},{visible:!0,menu:n,position:o}}},hide:function(){return function(){return t.callback=null,{visible:!1}}}},view$3(function(){!t.core.destroyed&&t.callback&&t.callback.apply(t,arguments)}),this.core.$root)}},{key:"show",value:function(){var e;return this.actions?(e=this.actions).show.apply(e,arguments):null}},{key:"hide",value:function(){var e;return this.actions?(e=this.actions).hide.apply(e,arguments):null}}]),e}(),validContextMenuTarget=function(e){var t=e.target,n="TEXTAREA"===t.tagName;return n||"INPUT"!==t.tagName||(n=-1!==["text","password","number","email"].indexOf(t.type)),n},GUIServiceProvider=function(){function e(t){classCallCheck(this,e),this.core=t,this.contextmenu=new ContextMenu(t)}return createClass(e,[{key:"destroy",value:function(){var e=document.getElementById("osjs-context-menu");e&&e.remove(),this.contextmenu.destroy()}},{key:"init",value:function(){var e=asyncToGenerator(regenerator.mark(function e(){var t,n=this;return regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t={show:function(){var e;return(e=n.contextmenu).show.apply(e,arguments)},hide:function(){var e;return(e=n.contextmenu).hide.apply(e,arguments)}},this.core.instance("osjs/contextmenu",function(){return arguments.length?t.show.apply(t,arguments):t}),this.core.$root.addEventListener("contextmenu",function(e){validContextMenuTarget(e)||(e.stopPropagation(),e.preventDefault())});case 3:case"end":return e.stop();}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"start",value:function(){var e=this;this.core.$root.addEventListener("click",function(t){var n=document.getElementById("osjs-context-menu"),o=n.contains(t.target);!o&&e.contextmenu&&e.contextmenu.hide()},!0),this.contextmenu.init()}}]),e}();export{Element$1 as Element,Box,BoxContainer,BoxStyled,Button,Progressbar,Menu,Toolbar,Statusbar,MenubarItem,Menubar,Panes,ListView,listView,IconViewEntry,IconView,iconView,Image,Video,Tabs,Iframe,TextField,TextareaField,SelectField,ToggleField,RangeField,Icon,Expander,GUIServiceProvider};
function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}var arrayWithoutHoles=_arrayWithoutHoles;function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}var iterableToArray=_iterableToArray;function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var nonIterableSpread=_nonIterableSpread;function _toConsumableArray(e){return arrayWithoutHoles(e)||iterableToArray(e)||nonIterableSpread()}var toConsumableArray=_toConsumableArray;function h(e,t){for(var n=[],o=[],a=arguments.length;2<a--;)n.push(arguments[a]);for(;n.length;){var s=n.pop();if(s&&s.pop)for(a=s.length;a--;)n.push(s[a]);else null!=s&&!0!==s&&!1!==s&&o.push(s)}return"function"==typeof e?e(t||{},o):{nodeName:e,attributes:t||{},children:o,key:t&&t.key}}function app(e,t,n,o){function a(e){return{nodeName:e.nodeName.toLowerCase(),attributes:{},children:k.call(e.childNodes,function(e){return 3===e.nodeType?e.nodeValue:a(e)})}}function s(e){return"function"==typeof e?s(e(S,I)):null==e?"":e}function i(){b=!b;var e=s(n);for(o&&!b&&(w=f(o,w,j,j=e)),L=!1;_.length;)_.pop()()}function r(){b||(b=!0,setTimeout(i))}function l(e,t){var n={};for(var o in e)n[o]=e[o];for(var o in t)n[o]=t[o];return n}function c(e,t,n){var o={};return e.length?(o[e[0]]=1<e.length?c(e.slice(1),t,n[e[0]]):t,l(n,o)):t}function d(e,t){for(var n=0;n<e.length;)t=t[e[n++]];return t}function p(e,t,n){for(var o in n)"function"==typeof n[o]?function(o,a){n[o]=function(o){var s=a(o);return"function"==typeof s&&(s=s(d(e,S),n)),s&&s!==(t=d(e,S))&&!s.then&&r(S=c(e,l(t,s),S)),s}}(o,n[o]):p(e.concat(o),t[o]=l(t[o]),n[o]=l(n[o]));return n}function u(e){return e?e.key:null}function g(e){return e.currentTarget.events[e.type](e)}function h(e,t,n,o,a){if("key"===t);else if("style"!==t)"o"===t[0]&&"n"===t[1]?(t=t.slice(2),e.events?!o&&(o=e.events[t]):e.events={},e.events[t]=n,n?!o&&e.addEventListener(t,g):e.removeEventListener(t,g)):t in e&&"list"!==t&&"type"!==t&&"draggable"!==t&&"spellcheck"!==t&&"translate"!==t&&!a?e[t]=null==n?"":n:null!=n&&!1!==n&&e.setAttribute(t,n),(null==n||!1===n)&&e.removeAttribute(t);else if("string"==typeof n)e.style.cssText=n;else for(var s in"string"==typeof o&&(o=e.style.cssText=""),l(o,n)){var i=null==n||null==n[s]?"":n[s];"-"===s[0]?e.style.setProperty(s,i):e.style[s]=i}}function m(e,t){var n="string"==typeof e||"number"==typeof e?document.createTextNode(e):(t=t||"svg"===e.nodeName)?document.createElementNS("http://www.w3.org/2000/svg",e.nodeName):document.createElement(e.nodeName),o=e.attributes;if(o){o.oncreate&&_.push(function(){o.oncreate(n)});for(var a=0;a<e.children.length;a++)n.appendChild(m(e.children[a]=s(e.children[a]),t));for(var r in o)h(n,r,o[r],null,t)}return n}function y(e,t,n,o){for(var a in l(t,n))n[a]!==("value"==a||"checked"==a?e[a]:t[a])&&h(e,a,n[a],t[a],o);var s=L?n.oncreate:n.onupdate;s&&_.push(function(){s(e,t)})}function v(e,t){var n=t.attributes;if(n){for(var o=0;o<t.children.length;o++)v(e.childNodes[o],t.children[o]);n.ondestroy&&n.ondestroy(e)}return e}function x(e,t,n){function o(){e.removeChild(v(t,n))}var a=n.attributes&&n.attributes.onremove;a?a(t,o):o()}function f(e,t,n,o,a){if(o===n);else if(null==n||n.nodeName!==o.nodeName){var r=m(o,a);e.insertBefore(r,t),null!=n&&x(e,t,n),t=r}else if(null==n.nodeName)t.nodeValue=o;else{y(t,n.attributes,o.attributes,a=a||"svg"===o.nodeName);for(var l={},c={},d=[],p=n.children,g=o.children,h=0;h<p.length;h++){d[h]=t.childNodes[h];var v=u(p[h]);null!=v&&(l[v]=[d[h],p[h]])}for(var h=0,b=0;b<g.length;){var v=u(p[h]),w=u(g[b]=s(g[b]));if(c[v]){h++;continue}if(null!=w&&w===u(p[h+1])){null==v&&x(t,d[h],p[h]),h++;continue}if(null==w||L)null==v&&(f(t,d[h],p[h],g[b],a),b++),h++;else{var j=l[w]||[];v===w?(f(t,j[0],j[1],g[b],a),h++):j[0]?f(t,t.insertBefore(j[0],d[h]),j[1],g[b],a):f(t,d[h],null,g[b],a),c[w]=g[b],b++}}for(;h<p.length;)null==u(p[h])&&x(t,d[h],p[h]),h++;for(var h in l)c[h]||x(t,l[h][0],l[h][1])}return t}var b,k=[].map,w=o&&o.children[0]||null,j=w&&a(w),_=[],L=!0,S=l(e),I=p([],S,l(t));return r(),I}var unitValue=function(e,t){return"number"==typeof e?"".concat(e,"px"):!1===e?t:e},boxPropNames={grow:function(e){return{flexGrow:e}},shrink:function(e){return{flexShrink:e}},basis:function(e){return{flexBasis:unitValue(e,"auto")}},align:function(e){return{alignItems:e}},justify:function(e){return{justifyContent:e}},padding:function(e){return{margin:unitValue(e,"0")}},margin:function(e){return{margin:unitValue(e,"0")}}},Element$1=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],n=e.class instanceof Array?e.class:[e.class],o=["osjs-gui"].concat(toConsumableArray(n));e.orientation&&o.push("osjs-gui-"+e.orientation);var a="string"==typeof e.style?{}:Object.assign({},e.style||{}),s=Object.keys(e).reduce(function(t,n){var o=boxPropNames[n]?boxPropNames[n](e[n]):void 0;return Object.assign({},t,o)},a);return h("div",{oncreate:e.oncreate,ondestroy:e.ondestroy,class:o.filter(function(e){return!!e}).join(" "),style:s},t)},Box=function(e,t){return h(Element$1,Object.assign({orientation:"horizontal"},e,{class:["osjs-gui-box",e.class]}),t)},BoxContainer=function(e,t){return h(Element$1,Object.assign({},e,{class:["osjs-gui-box-container",e.class]}),t)},BoxStyled=function(e,t){return h(Element$1,Object.assign({},e,{class:["osjs-gui-box-styled",e.class]}),t)};function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}var _typeof_1=createCommonjsModule(function(e){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(o){return e.exports="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?n=function(e){return t(e)}:n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},n(o)}e.exports=n}),Icon=function(e){var t=e&&"object"===_typeof_1(e)?e.src:e,o=e&&"object"===_typeof_1(e)?e.name:void 0;return h("i",{"data-icon":o,class:"osjs-icon",style:{backgroundImage:"string"==typeof e?"url(".concat(t,")"):void 0}})};function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var defineProperty=_defineProperty,filteredProps=function(e,t){var n=Object.keys(e);return n.filter(function(e){return-1===t.indexOf(e)}).reduce(function(t,n){return Object.assign(defineProperty({},n,e[n]),t)},{})},doubleTap=function(){var e,t=0<arguments.length&&arguments[0]!==void 0?arguments[0]:250,n=!1;return function(o,a){return(e=clearTimeout(e),e=setTimeout(function(){return n=!1},t),n)?(o.preventDefault(),a(o)):(n=!0,!1)}},createField=function(e,t,n,o,a){var s=t.oninput||function(){},i=t.onchange||function(){},r=t.onkeydown||function(){},l=a||function(e){return[e.target.value]},c=Object.assign({oninput:function(e){return s.apply(void 0,[e].concat(toConsumableArray(l(e))))},onchange:function(e){return i.apply(void 0,[e].concat(toConsumableArray(l(e))))},onkeydown:function(e){13===e.keyCode&&t.onenter&&t.onenter.apply(t,[e].concat(toConsumableArray(l(e)))),r(e)}},n,filteredProps(t,["choices","label","box","oninput","onchange"]));return h(Element$1,Object.assign({},t.box||{},{class:"osjs-gui-field osjs-gui-"+e}),o(c))},Button=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return createField("button",e,{},function(n){var o=[];return e.icon&&o.push(h(Icon,e.icon)),"string"==typeof e.label&&o.push(h("span",{class:"osjs-label"},e.label)),h("button",n,o.concat(toConsumableArray(t)))})},Progressbar=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],n="number"==typeof e.value?Math.max(0,Math.abs(e.value))%100:0,o=h("div",{class:"osjs-gui-progressbar-wrapper"},[h("div",{className:"osjs-gui-progressbar-value",style:{width:n+""+"%"}}),h("div",{className:"osjs-gui-progressbar-label"},[h("span",{},[n+""+"%"])])]);return h(Element$1,Object.assign({},e.box||{},{class:["osjs-gui-progressbar",e.class]}),[o].concat(toConsumableArray(t)))},ul=function e(t){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0,a=function(e){var t=[];return"checkbox"===e.type||"boolean"==typeof e.checked?t.push(h("span",{class:"osjs-gui-menu-checkbox "+(e.checked?"active":"")})):e.icon&&t.push(h(Icon,e.icon)),t.push(h("span",{},e.label)),t},s=function(t,n){var s="separator"===n.type?"osjs-gui-menu-separator":"osjs-gui-menu-label "+(n.disabled?"osjs__disabled":""),i=[h("span",{class:s},a(n))];return n.items&&i.push(e(t,n.items,o+1)),i};return h("ul",{class:""},n.map(function(e){return h("li",{class:"osjs-gui-menu-entry"},[h("div",{class:"osjs-gui-menu-container","data-has-image":!!e.icon||void 0,"data-has-children":!!e.items||void 0,onmouseover:e.items?t.onshow:void 0,ontouchend:e.items?t.onshow:void 0,onclick:function(n){e.items||(e.onclick&&e.onclick(e,n),t.onclick&&t.onclick(e,n))}},s(t,e))])}))},Menu=function(e){return h("div",{id:"osjs-context-menu",className:"osjs-gui osjs-gui-menu",oncreate:e.oncreate,onupdate:e.onupdate,style:{display:!1===e.visible?"none":"block",top:e.position?e.position.top+""+"px":0,left:e.position?e.position.left+""+"px":0}},ul(e,e.menu))},Toolbar=function(e,t){return h(Element$1,Object.assign({orientation:"vertical"},e,{class:["osjs-gui-toolbar",e.class]}),t)},Statusbar=function(e,t){return h(Element$1,Object.assign({},e.box||{},{class:["osjs-gui-statusbar",e.class]}),t)},MenubarItem=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],n=e.onclick,o=e.data;return h("div",{onclick:function(e){if("function"==typeof n){var t=e.target.parentNode,a=Array.prototype.indexOf.call(t.children,e.target);n(e,o||{},a)}}},h("span",{},t))},Menubar=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return h(Element$1,Object.assign({},e,{class:["osjs-gui-menubar",e.class]}),toConsumableArray((e.items||[]).map(function(t){return h(MenubarItem,{data:t.data,onclick:t.onclick||e.onclick},t.label)})).concat(toConsumableArray(t)))};function nestable(e,t,n,o){return t._$r=function(){return{}},function(a,s){return h(o||"x-",{key:a.key,id:a.id,class:a.class,oncreate:function(o){var i=app(e,t,function(e,t){var a=n(e,t);return"function"==typeof a&&(a=a(o._$p,o._$c)),a},o);o._$p=a,o._$c=s,o._$r=i._$r,o._$u=i.uninit,i.init&&i.init(a),a.oncreate&&a.oncreate(o)},onupdate:function(e){e._$p=a,e._$c=s,e._$r(),a.onupdate&&a.onupdate(e)},ondestroy:function(e){e._$u&&e._$u()}})}}var _onmousedown=function(e,t,n){var o=e.target,a=e.clientX,s=e.clientY,i=o.previousSibling,r=i.offsetWidth,l=i.offsetHeight,c=Array.from(o.parentNode.children).indexOf(i),d=.8*i.parentNode.offsetWidth,p=.8*i.parentNode.offsetHeight;if(!(0>c)){var u=function(e){var o=Math.min;e.preventDefault();var i="vertical"===n?r:l;if("vertical"===n){var u=e.clientX-a;i=o(d,i+u)}else{var g=e.clientY-s;i=o(p,i+g)}t.setSize({index:c,size:i})},g=function e(t){t.preventDefault(),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",e)};e.preventDefault(),document.addEventListener("mousemove",u),document.addEventListener("mouseup",g)}},panes=function(e,t,n,o){var a=Array(Math.ceil(n.length/2)).fill(null).map(function(){return h("div",{class:"osjs-gui-panes-spacer",onmousedown:function(e){return _onmousedown(e,t,o)}})});return n.map(function(t,n){var o=e.sizes[n]?e.sizes[n]+""+"px":void 0;return h("div",{class:"osjs-gui-panes-pane",style:{flex:o?"0 0 ".concat(o):o}},t)}).map(function(e,t){return[e,a[t]]}).reduce(function(e,t){return e.concat(t)}).filter(function(e){return"undefined"!=typeof e})},view=function(e,t){return function(n,o){var a=n.orientation||"vertical";return h(Element$1,{orientation:a,class:"osjs-gui-panes-inner"},panes(e,t,o,a))}},inner=nestable({sizes:[]},{init:function(e){return{sizes:e.sizes||[150]}},setSize:function(e){var t=e.index,n=e.size;return function(e){var o=[].concat(e.sizes);return o[t]=n,{sizes:o}}}},view,"div"),Panes=function(e,t){return h(inner,{class:"osjs-gui-panes"},t)},tapper=doubleTap(),createView=function(e){var t=function(t){return function(n,o){var a=n.columns[t]||{},s=e.selectedIndex===o,i=a.icon?h(Icon,a.icon):null,r=[h("span",{},["object"===_typeof_1(a)?a.label:a])];return i&&r.unshift(i),h("div",{"data-has-icon":!!a.icon||void 0,class:"osjs-gui-list-view-cell"+(s?" osjs__active":""),ontouchstart:function(t){return tapper(t,function(){return e.onactivate({data:n.data,index:o,ev:t})})},ondblclick:function(t){return e.onactivate({data:n.data,index:o,ev:t})},onclick:function(t){return e.onselect({data:n.data,index:o,ev:t})},oncontextmenu:function(t){return e.oncontextmenu({data:n.data,index:o,ev:t})},oncreate:function(t){return e.oncreate({data:n.data,index:o,el:t})}},r)}},n=function(n,o){return h("div",{class:"osjs-gui-list-view-pane"},[h("div",{class:"osjs-gui-list-view-header",style:{display:e.hideColumns?"none":void 0}},"object"===_typeof_1(o)?o.label:o),h("div",{class:"rows"},e.rows.map(t(n)))])};return h("div",{class:"osjs-gui-list-view-wrapper",oncreate:function(t){return t.scrollTop=e.scrollTop},onupdate:function(t){0>e.selectedIndex&&(t.scrollTop=e.scrollTop)}},e.columns.map(function(e,t){return n(t,e)}))},ListView=function(e){return h(Element$1,Object.assign({class:"osjs-gui-list-view"},e.box||{}),createView(filteredProps(e,["box"])))},listView={component:function(e,t){var n=Object.assign({columns:[],rows:[],onselect:function(e){var n=e.data,o=e.index,a=e.ev;t.select({data:n,index:o,ev:a}),t.setSelectedIndex(o)},onactivate:function(e){var n=e.data,o=e.index,a=e.ev;t.activate({data:n,index:o,ev:a}),t.setSelectedIndex(-1)},oncontextmenu:function(e){var n=e.data,o=e.index,a=e.ev;t.select({data:n,index:o,ev:a}),t.contextmenu({data:n,index:o,ev:a}),t.setSelectedIndex(o)},oncreate:function(e){t.created(e)}},e);return function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return ListView(Object.assign(n,e))}},state:function(e){return Object.assign({selectedIndex:-1,scrollTop:0},e)},actions:function(e){return Object.assign({select:function(){return function(){return{}}},activate:function(){return function(){return{}}},contextmenu:function(){return function(){return{}}},created:function(){return function(){return{}}},setRows:function(e){return{rows:e}},setColumns:function(e){return{columns:e}},setScrollTop:function(e){return function(){return{scrollTop:e}}},setSelectedIndex:function(e){return function(){return{selectedIndex:e}}}},e||{})}},tapper$1=doubleTap(),IconViewEntry=function(e,t,n){return function(){var o=e.icon||{name:"application-x-executable"},a=n.selectedIndex===t;return h("div",{class:"osjs-gui-icon-view-entry"+(a?" osjs__active":""),ontouchstart:function(o){return tapper$1(o,function(){return n.onactivate({data:e.data,index:t,ev:o})})},ondblclick:function(o){return n.onactivate({data:e.data,index:t,ev:o})},onclick:function(o){return n.onselect({data:e.data,index:t,ev:o})},oncontextmenu:function(o){return n.oncontextmenu({data:e.data,index:t,ev:o})},oncreate:function(o){return n.oncreate({data:e.data,index:t,el:o})}},[h("div",{class:"osjs__container"},[h("div",{class:"osjs__image"},[h(Icon,o)]),h("div",{class:"osjs__label"},[h("span",{},e.label)])])])}},IconView=function(e){var t=h("div",{class:"osjs-gui-icon-view-wrapper",oncreate:function(t){return t.scrollTop=e.scrollTop},onupdate:function(t){0>e.selectedIndex&&(t.scrollTop=e.scrollTop)}},e.entries.map(function(t,n){return h(IconViewEntry(t,n,e))}));return h(Element$1,Object.assign({class:"osjs-gui-icon-view"},e.box||{}),t)},iconView={component:function(e,t){var n=Object.assign({entries:[],onselect:function(e){var n=e.data,o=e.index,a=e.ev;t.select({data:n,index:o,ev:a}),t.setSelectedIndex(o)},onactivate:function(e){var n=e.data,o=e.index,a=e.ev;t.activate({data:n,index:o,ev:a}),t.setSelectedIndex(-1)},oncontextmenu:function(e){var n=e.data,o=e.index,a=e.ev;t.select({data:n,index:o,ev:a}),t.contextmenu({data:n,index:o,ev:a}),t.setSelectedIndex(o)},oncreate:function(e){t.created(e)}},e);return function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return IconView(Object.assign(n,e))}},state:function(e){return Object.assign({selectedIndex:-1,scrollTop:0},e)},actions:function(e){return Object.assign({select:function(){return function(){return{}}},activate:function(){return function(){return{}}},contextmenu:function(){return function(){return{}}},created:function(){return function(){return{}}},setEntries:function(e){return function(){return{entries:e}}},setScrollTop:function(e){return function(){return{scrollTop:e}}},setSelectedIndex:function(e){return function(){return{selectedIndex:e}}}},e||{})}},Image=function(e){return h("div",{class:"osjs-gui osjs-gui-image",style:{width:e.width?e.width+""+"px":void 0,height:e.height?e.height+""+"px":void 0}},h("img",e))},sources=function(e){return e.map(function(e){return h("source",e)})},isTrue=function(e){return"undefined"==typeof e||!0===e},Video=function(e){return h("div",{class:"osjs-gui osjs-gui-video",style:{width:e.width?e.width+""+"px":void 0,height:e.height?e.height+""+"px":void 0}},[h("video",{src:e.src,width:e.width,height:e.height,poster:e.poster,loop:e.loop?"loop":void 0,muted:e.muted?"muted":void 0,controls:isTrue(e.controls)?"controls":void 0,autoplay:isTrue(e.autoplay)?"autoplay":void 0,onloadeddata:e.onload,oncreate:e.oncreate,onupdate:e.onupdate,ondestroy:e.ondestroy},sources(e.sources||[]))])},headers=function(e,t,n){return(e||[]).map(function(e,o){return h("div",{class:t.selectedIndex===o?"osjs__active":"",onclick:function(){return n.setSelectedIndex(o)}},h("span",{},e))})},panes$1=function(e,t){return t.map(function(t,n){return h("div",{class:e.selectedIndex===n?"osjs__active":""},t)})},view$1=nestable({selectedIndex:0},{setSelectedIndex:function(e){return function(){return{selectedIndex:e}}}},function(e,t){return function(n,o){return h("div",{class:"osjs-gui-tabs-wrapper"},[h("div",{class:"osjs-gui-tabs-header"},headers(n.labels,e,t)),h("div",{class:"osjs-gui-tabs-panes"},panes$1(e,o))])}},"div"),Tabs=function(e,t){return h(view$1,Object.assign({class:"osjs-gui osjs-gui-tabs "+(e.class||"")},e),t)},Iframe=function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return h(Element$1,Object.assign({},e.box||{},{class:["osjs-gui-iframe",e.class]}),[h("iframe",Object.assign({frameborder:0},filteredProps(e,["box"])))].concat(toConsumableArray(t)))},TextField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return createField("text-field",e,{autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",type:"text"},function(e){return h("input",e)})},TextareaField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return createField("textarea-field",e,{rows:4},function(e){return h("textarea",e,t)})},SelectField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],n=Object.keys(e.choices||{}).reduce(function(t,n){return t.push(h("option",{value:n,selected:e.key===e.choices[n]},e.choices[n])),t},[]);return createField("select-field",e,{selectedIndex:void 0},function(e){return h("div",{},h("select",e,toConsumableArray(n).concat(toConsumableArray(t))))},function(e){return[e.target.value,e.target.textContent]})},ToggleField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return createField("toggle-field",e,{type:"checkbox",checked:!1},function(n){return h("label",{},[h("input",n),h("span",{class:"osjs-toggle-input"}),h("span",{class:"osjs-toggle-label"},[e.label||""].concat(toConsumableArray(t)))])},function(t){return["radio"===e.type?JSON.parse(t.target.value):!!t.target.checked]})},RangeField=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return createField("range-field",e,{type:"range"},function(e){return h("input",e)})},view$2=function(e,t){return function(n,o){return h(Element$1,Object.assign({},n.box||{},{class:["osjs-gui-expander-wrapper"]}),[h("div",{class:"osjs-gui-expander-header",onclick:function(o){return t.ontoggle({ev:o,active:!e.active,ontoggle:n.ontoggle})}},[h("div",{class:"osjs-gui-expander-header-icon","data-active":e.active+""}),h("div",{class:"osjs-gui-expander-header-label"},n.label)]),h("div",{class:"osjs-gui-expander-content",style:{display:!1===e.active?"none":void 0}},o)])}},inner$1=nestable({active:!0},{init:function(e){return{ative:!1!==e.active}},ontoggle:function(e){var t=e.ev,n=e.active,o=e.ontoggle;return(o||function(){})(t,n),{active:n}}},view$2,"div"),Expander=function(e,t){return h(inner$1,Object.assign({},e,{class:"osjs-gui osjs-gui-expander"}),t)},runtime=createCommonjsModule(function(e){!function(t){function n(e,t,n,o){var s=t&&t.prototype instanceof a?t:a,i=Object.create(s.prototype),r=new g(o||[]);return i._invoke=c(e,n,r),i}function o(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function a(){}function s(){}function i(){}function r(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(e){function t(n,a,s,i){var r=o(e[n],e,a);if("throw"===r.type)i(r.arg);else{var l=r.arg,c=l.value;return c&&"object"==typeof c&&v.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,s,i)},function(e){t("throw",e,s,i)}):Promise.resolve(c).then(function(e){l.value=e,s(l)},function(e){return t("throw",e,s,i)})}}function n(e,n){function o(){return new Promise(function(o,a){t(e,n,o,a)})}return a=a?a.then(o,o):o()}var a;this._invoke=n}function c(e,t,n){var a="suspendedStart";return function(s,i){if(a==="executing")throw new Error("Generator is already running");if("completed"===a){if("throw"===s)throw i;return m()}for(n.method=s,n.arg=i;;){var r=n.delegate;if(r){var l=d(r,n);if(l){if(l===j)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var c=o(e,t,n);if("normal"===c.type){if(a=n.done?"completed":"suspendedYield",c.arg===j)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a="completed",n.method="throw",n.arg=c.arg)}}}function d(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,d(e,t),"throw"===t.method))return j;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return j}var a=o(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,j;var s=a.arg;if(!s)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,j;if(s.done)t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0);else return s;return t.delegate=null,j}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function u(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function g(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function h(e){if(e){var t=e[f];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(v.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:m}}function m(){return{value:void 0,done:!0}}var y=Object.prototype,v=y.hasOwnProperty,x="function"==typeof Symbol?Symbol:{},f=x.iterator||"@@iterator",b=x.asyncIterator||"@@asyncIterator",k=x.toStringTag||"@@toStringTag",w=t.regeneratorRuntime;if(w)return void(e.exports=w);w=t.regeneratorRuntime=e.exports,w.wrap=n;var j={},_={};_[f]=function(){return this};var L=Object.getPrototypeOf,S=L&&L(L(h([])));S&&S!==y&&v.call(S,f)&&(_=S);var I=i.prototype=a.prototype=Object.create(_);s.prototype=I.constructor=i,i.constructor=s,i[k]=s.displayName="GeneratorFunction",w.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===s||"GeneratorFunction"===(t.displayName||t.name))},w.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,!(k in e)&&(e[k]="GeneratorFunction")),e.prototype=Object.create(I),e},w.awrap=function(e){return{__await:e}},r(l.prototype),l.prototype[b]=function(){return this},w.AsyncIterator=l,w.async=function(e,t,o,a){var s=new l(n(e,t,o,a));return w.isGeneratorFunction(t)?s:s.next().then(function(e){return e.done?e.value:s.next()})},r(I),I[k]="Generator",I[f]=function(){return this},I.toString=function(){return"[object Generator]"},w.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var o=t.pop();if(o in e)return n.value=o,n.done=!1,n}return n.done=!0,n}},w.values=h,g.prototype={constructor:g,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(u),!e)for(var t in this)"t"===t.charAt(0)&&v.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,o){return s.type="throw",s.arg=e,n.next=t,o&&(n.method="next",n.arg=void 0),!!o}if(this.done)throw e;for(var n=this,o=this.tryEntries.length-1;0<=o;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var r=v.call(a,"catchLoc"),l=v.call(a,"finallyLoc");if(r&&l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(r){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);}else if(!l)throw new Error("try statement without catch or finally");else if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}},abrupt:function(e,t){for(var n,o=this.tryEntries.length-1;0<=o;--o)if(n=this.tryEntries[o],n.tryLoc<=this.prev&&v.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=e,s.arg=t,a?(this.method="next",this.next=a.finallyLoc,j):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),j},finish:function(e){for(var t,n=this.tryEntries.length-1;0<=n;--n)if(t=this.tryEntries[n],t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),u(t),j},catch:function(e){for(var t,n=this.tryEntries.length-1;0<=n;--n)if(t=this.tryEntries[n],t.tryLoc===e){var o=t.completion;if("throw"===o.type){var a=o.arg;u(t)}return a}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:h(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),j}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())}),g=function(){return this||"object"==typeof self&&self}()||Function("return this")(),hadRuntime=g.regeneratorRuntime&&0<=Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime"),oldRuntime=hadRuntime&&g.regeneratorRuntime;g.regeneratorRuntime=void 0;var runtimeModule=runtime;if(hadRuntime)g.regeneratorRuntime=oldRuntime;else try{delete g.regeneratorRuntime}catch(t){g.regeneratorRuntime=void 0}var regenerator=runtimeModule;function asyncGeneratorStep(e,t,n,o,a,s,i){try{var r=e[s](i),l=r.value}catch(e){return void n(e)}r.done?t(l):Promise.resolve(l).then(o,a)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(o,a){function s(e){asyncGeneratorStep(r,o,a,s,i,"next",e)}function i(e){asyncGeneratorStep(r,o,a,s,i,"throw",e)}var r=e.apply(t,n);s(void 0)})}}var asyncToGenerator=_asyncToGenerator;function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var classCallCheck=_classCallCheck;function _defineProperties(e,t){for(var n,o=0;o<t.length;o++)n=t[o],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}var createClass=_createClass,clampSubMenu=function(e,t){var n=t.target.querySelector("ul");if(n&&(n.classList.contains("osjs-gui-menu-container")&&(n=n.parentNode.parentNode),n&&n.offsetParent)){n.classList.remove("clamp-right");var o=n.getBoundingClientRect();o.right>e.offsetWidth&&n.classList.add("clamp-right")}},clampMenu=function(e,t,n){var o={},a=n.top+t.offsetHeight,s=n.left+t.offsetWidth,i=e.offsetHeight-n.top,r=e.offsetWidth-n.left,l=s>e.offsetWidth,c=a>e.offsetHeight;return c&&(o.top=e.offsetHeight-t.offsetHeight-i),l&&(o.left=e.offsetWidth-t.offsetWidth-r),c||l?o:null},view$3=function(e){return function(t,n){return h(Menu,{position:t.position,visible:t.visible,menu:t.menu,onclick:e,onshow:n.onshow})}},timeout=function(e){return e(),setTimeout(e,100)},ContextMenu=function(){function e(t){classCallCheck(this,e),this.core=t,this.callback=function(){},this.actions=null}return createClass(e,[{key:"destroy",value:function(){this.callback=null,this.actions=null}},{key:"init",value:function(){var e,t=this;this.actions=app({visible:!1,menu:[],position:{top:0,left:0}},{clamp:function(n){return function(o){if(n=n||document.querySelector("#osjs-context-menu"),clearTimeout(e),n){var a=t.core.$root,s=clampMenu(a,n,o.position);if(s)return{position:s}}return{}}},onshow:function(n){return function(){e=timeout(function(){return clampSubMenu(t.core.$root,n)})}},show:function(e){return function(n,o){var a=e.menu,s=e.position;if(s instanceof Event)s={left:s.clientX,top:s.clientY};else if(s instanceof Element){var i=s.getBoundingClientRect();s={left:i.left,top:i.top+i.height}}return t.callback=function(){e.callback&&e.callback.apply(e,arguments),t.actions.hide()},timeout(function(){return o.clamp()}),{visible:!0,menu:a,position:s}}},hide:function(){return function(){return t.callback=null,{visible:!1}}}},view$3(function(){!t.core.destroyed&&t.callback&&t.callback.apply(t,arguments)}),this.core.$root)}},{key:"show",value:function(){var e;return this.actions?(e=this.actions).show.apply(e,arguments):null}},{key:"hide",value:function(){var e;return this.actions?(e=this.actions).hide.apply(e,arguments):null}}]),e}(),validContextMenuTarget=function(e){var t=e.target,n="TEXTAREA"===t.tagName;return n||"INPUT"!==t.tagName||(n=-1!==["text","password","number","email"].indexOf(t.type)),n},GUIServiceProvider=function(){function e(t){classCallCheck(this,e),this.core=t,this.contextmenu=new ContextMenu(t)}return createClass(e,[{key:"destroy",value:function(){var e=document.getElementById("osjs-context-menu");e&&e.remove(),this.contextmenu.destroy()}},{key:"init",value:function(){var e=asyncToGenerator(regenerator.mark(function e(){var t,n=this;return regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t={show:function(){var e;return(e=n.contextmenu).show.apply(e,arguments)},hide:function(){var e;return(e=n.contextmenu).hide.apply(e,arguments)}},this.core.instance("osjs/contextmenu",function(){return arguments.length?t.show.apply(t,arguments):t}),this.core.$root.addEventListener("contextmenu",function(e){validContextMenuTarget(e)||(e.stopPropagation(),e.preventDefault())});case 3:case"end":return e.stop();}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"start",value:function(){var e=this;this.core.$root.addEventListener("click",function(t){var n=document.getElementById("osjs-context-menu"),o=n.contains(t.target);!o&&e.contextmenu&&e.contextmenu.hide()},!0),this.contextmenu.init()}}]),e}();export{Element$1 as Element,Box,BoxContainer,BoxStyled,Button,Progressbar,Menu,Toolbar,Statusbar,MenubarItem,Menubar,Panes,ListView,listView,IconViewEntry,IconView,iconView,Image,Video,Tabs,Iframe,TextField,TextareaField,SelectField,ToggleField,RangeField,Icon,Expander,GUIServiceProvider};
//# sourceMappingURL=esm.js.map

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("osjsGui",[],n):"object"==typeof exports?exports.osjsGui=n():t.osjsGui=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=7)}([function(t,n,e){var r=e(10),o=e(11),i=e(12);t.exports=function(t){return r(t)||o(t)||i()}},function(t,n){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(n){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=r=function(t){return e(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},r(n)}t.exports=r},function(t,n){t.exports=function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}},function(t,n){function e(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}},function(t,n,e){t.exports=e(13)},function(t,n){t.exports=function(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}},function(t,n){function e(t,n,e,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void e(t)}c.done?n(a):Promise.resolve(a).then(r,o)}t.exports=function(t){return function(){var n=this,r=arguments;return new Promise(function(o,i){var u=t.apply(n,r);function c(t){e(u,o,i,c,a,"next",t)}function a(t){e(u,o,i,c,a,"throw",t)}c(void 0)})}}},function(t,n,e){t.exports=e(15)},function(t,n,e){},,function(t,n){t.exports=function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}},function(t,n){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,n){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,n,e){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=e(14),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,n){!function(n){"use strict";var e,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",s="object"==typeof t,l=n.regeneratorRuntime;if(l)s&&(t.exports=l);else{(l=n.regeneratorRuntime=s?t.exports:{}).wrap=x;var f="suspendedStart",d="suspendedYield",p="executing",v="completed",h={},g={};g[u]=function(){return this};var y=Object.getPrototypeOf,m=y&&y(y(N([])));m&&m!==r&&o.call(m,u)&&(g=m);var b=O.prototype=w.prototype=Object.create(g);k.prototype=b.constructor=O,O.constructor=k,O[a]=k.displayName="GeneratorFunction",l.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===k||"GeneratorFunction"===(n.displayName||n.name))},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(b),t},l.awrap=function(t){return{__await:t}},S(_.prototype),_.prototype[c]=function(){return this},l.AsyncIterator=_,l.async=function(t,n,e,r){var o=new _(x(t,n,e,r));return l.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(b),b[a]="Generator",b[u]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(t){var n=[];for(var e in t)n.push(e);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},l.values=N,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],c=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var a=o.call(u,"catchLoc"),s=o.call(u,"finallyLoc");if(a&&s){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),h},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),L(e),h}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;L(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}}}function x(t,n,e,r){var o=n&&n.prototype instanceof w?n:w,i=Object.create(o.prototype),u=new I(r||[]);return i._invoke=function(t,n,e){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===o)throw i;return P()}for(e.method=o,e.arg=i;;){var u=e.delegate;if(u){var c=E(u,e);if(c){if(c===h)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(r===f)throw r=v,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r=p;var a=j(t,n,e);if("normal"===a.type){if(r=e.done?v:d,a.arg===h)continue;return{value:a.arg,done:e.done}}"throw"===a.type&&(r=v,e.method="throw",e.arg=a.arg)}}}(t,e,u),i}function j(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}function w(){}function k(){}function O(){}function S(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function _(t){var n;this._invoke=function(e,r){function i(){return new Promise(function(n,i){!function n(e,r,i,u){var c=j(t[e],t,r);if("throw"!==c.type){var a=c.arg,s=a.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(t){n("next",t,i,u)},function(t){n("throw",t,i,u)}):Promise.resolve(s).then(function(t){a.value=t,i(a)},function(t){return n("throw",t,i,u)})}u(c.arg)}(e,r,n,i)})}return n=n?n.then(i,i):i()}}function E(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=j(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function T(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function L(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function N(t){if(t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:P}}function P(){return{value:e,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},function(t,n,e){"use strict";e.r(n);e(8);var r=e(0),o=e.n(r);function i(t,n){for(var e=[],r=[],o=arguments.length;o-- >2;)e.push(arguments[o]);for(;e.length;){var i=e.pop();if(i&&i.pop)for(o=i.length;o--;)e.push(i[o]);else null!=i&&!0!==i&&!1!==i&&r.push(i)}return"function"==typeof t?t(n||{},r):{nodeName:t,attributes:n||{},children:r,key:n&&n.key}}function u(t,n,e,r){var o,i=[].map,u=r&&r.children[0]||null,c=u&&function t(n){return{nodeName:n.nodeName.toLowerCase(),attributes:{},children:i.call(n.childNodes,function(n){return 3===n.nodeType?n.nodeValue:t(n)})}}(u),a=[],s=!0,l=h(t),f=function t(n,e,r){for(var o in r)"function"==typeof r[o]?function(t,o){r[t]=function(t){var i=o(t);return"function"==typeof i&&(i=i(y(n,l),r)),i&&i!==(e=y(n,l))&&!i.then&&v(l=g(n,h(e,i),l)),i}}(o,r[o]):t(n.concat(o),e[o]=h(e[o]),r[o]=h(r[o]));return r}([],l,h(n));return v(),f;function d(t){return"function"==typeof t?d(t(l,f)):null!=t?t:""}function p(){o=!o;var t=d(e);for(r&&!o&&(u=function t(n,e,r,o,i){if(o===r);else if(null==r||r.nodeName!==o.nodeName){var u=function t(n,e){var r="string"==typeof n||"number"==typeof n?document.createTextNode(n):(e=e||"svg"===n.nodeName)?document.createElementNS("http://www.w3.org/2000/svg",n.nodeName):document.createElement(n.nodeName);var o=n.attributes;if(o){o.oncreate&&a.push(function(){o.oncreate(r)});for(var i=0;i<n.children.length;i++)r.appendChild(t(n.children[i]=d(n.children[i]),e));for(var u in o)x(r,u,o[u],null,e)}return r}(o,i);n.insertBefore(u,e),null!=r&&j(n,e,r),e=u}else if(null==r.nodeName)e.nodeValue=o;else{!function(t,n,e,r){for(var o in h(n,e))e[o]!==("value"===o||"checked"===o?t[o]:n[o])&&x(t,o,e[o],n[o],r);var i=s?e.oncreate:e.onupdate;i&&a.push(function(){i(t,n)})}(e,r.attributes,o.attributes,i=i||"svg"===o.nodeName);for(var c={},l={},f=[],p=r.children,v=o.children,g=0;g<p.length;g++){f[g]=e.childNodes[g];var y=m(p[g]);null!=y&&(c[y]=[f[g],p[g]])}for(var g=0,b=0;b<v.length;){var y=m(p[g]),w=m(v[b]=d(v[b]));if(l[y])g++;else if(null==w||w!==m(p[g+1]))if(null==w||s)null==y&&(t(e,f[g],p[g],v[b],i),b++),g++;else{var k=c[w]||[];y===w?(t(e,k[0],k[1],v[b],i),g++):k[0]?t(e,e.insertBefore(k[0],f[g]),k[1],v[b],i):t(e,f[g],null,v[b],i),l[w]=v[b],b++}else null==y&&j(e,f[g],p[g]),g++}for(;g<p.length;)null==m(p[g])&&j(e,f[g],p[g]),g++;for(var g in c)l[g]||j(e,c[g][0],c[g][1])}return e}(r,u,c,c=t)),s=!1;a.length;)a.pop()()}function v(){o||(o=!0,setTimeout(p))}function h(t,n){var e={};for(var r in t)e[r]=t[r];for(var r in n)e[r]=n[r];return e}function g(t,n,e){var r={};return t.length?(r[t[0]]=t.length>1?g(t.slice(1),n,e[t[0]]):n,h(e,r)):n}function y(t,n){for(var e=0;e<t.length;)n=n[t[e++]];return n}function m(t){return t?t.key:null}function b(t){return t.currentTarget.events[t.type](t)}function x(t,n,e,r,o){if("key"===n);else if("style"===n)if("string"==typeof e)t.style.cssText=e;else for(var i in"string"==typeof r&&(r=t.style.cssText=""),h(r,e)){var u=null==e||null==e[i]?"":e[i];"-"===i[0]?t.style.setProperty(i,u):t.style[i]=u}else"o"===n[0]&&"n"===n[1]?(n=n.slice(2),t.events?r||(r=t.events[n]):t.events={},t.events[n]=e,e?r||t.addEventListener(n,b):t.removeEventListener(n,b)):n in t&&"list"!==n&&"type"!==n&&"draggable"!==n&&"spellcheck"!==n&&"translate"!==n&&!o?t[n]=null==e?"":e:null!=e&&!1!==e&&t.setAttribute(n,e),null!=e&&!1!==e||t.removeAttribute(n)}function j(t,n,e){function r(){t.removeChild(function t(n,e){var r=e.attributes;if(r){for(var o=0;o<e.children.length;o++)t(n.childNodes[o],e.children[o]);r.ondestroy&&r.ondestroy(n)}return n}(n,e))}var o=e.attributes&&e.attributes.onremove;o?o(n,r):r()}}var c=function(t,n){return"number"==typeof t?"".concat(t,"px"):!1===t?n:t},a={grow:function(t){return{flexGrow:t}},shrink:function(t){return{flexShrink:t}},basis:function(t){return{flexBasis:c(t,"auto")}},align:function(t){return{alignItems:t}},justify:function(t){return{justifyContent:t}},padding:function(t){return{margin:c(t,"0")}},margin:function(t){return{margin:c(t,"0")}}},s=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=t.class instanceof Array?t.class:[t.class],r=["osjs-gui"].concat(o()(e));t.orientation&&r.push("osjs-gui-"+t.orientation);var u="string"==typeof t.style?{}:Object.assign({},t.style||{}),c=Object.keys(t).reduce(function(n,e){var r=a[e]?a[e](t[e]):void 0;return Object.assign({},n,r)},u);return i("div",{oncreate:t.oncreate,ondestroy:t.ondestroy,class:r.filter(function(t){return!!t}).join(" "),style:c},n)},l=function(t,n){return i(s,Object.assign({orientation:"horizontal"},t,{class:["osjs-gui-box",t.class]}),n)},f=function(t,n){return i(s,Object.assign({},t,{class:["osjs-gui-box-container",t.class]}),n)},d=function(t,n){return i(s,Object.assign({},t,{class:["osjs-gui-box-styled",t.class]}),n)},p=e(1),v=e.n(p),h=function(t,n){return i("i",{"data-icon":"object"===v()(t)?t.name:void 0,class:"osjs-icon",style:{backgroundImage:"string"==typeof t?"url(".concat(t,")"):void 0}})},g=e(5),y=e.n(g),m=function(t,n){return Object.keys(t).filter(function(t){return-1===n.indexOf(t)}).reduce(function(n,e){return Object.assign(y()({},e,t[e]),n)},{})},b=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,e=!1;return function(r,o){return t=clearTimeout(t),t=setTimeout(function(){return e=!1},n),e?(r.preventDefault(),o(r)):(e=!0,!1)}},x=function(t,n,e,r,u){var c=n.oninput||function(){},a=n.onchange||function(){},l=n.onkeydown||function(){},f=u||function(t){return[t.target.value]},d=Object.assign({oninput:function(t){return c.apply(void 0,[t].concat(o()(f(t))))},onchange:function(t){return a.apply(void 0,[t].concat(o()(f(t))))},onkeydown:function(t){13===t.keyCode&&n.onenter&&n.onenter.apply(n,[t].concat(o()(f(t)))),l(t)}},e,m(n,["choices","label","box","oninput","onchange"]));return i(s,Object.assign({},n.box||{},{class:"osjs-gui-field osjs-gui-"+t}),r(d))},j=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return x("button",t,{},function(e){var r=[];return t.icon&&r.push(i(h,t.icon)),"string"==typeof t.label&&r.push(i("span",{class:"osjs-label"},t.label)),i("button",e,r.concat(o()(n)))})},w=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e="number"==typeof t.value?Math.max(0,Math.abs(t.value))%100:0,r=i("div",{class:"osjs-gui-progressbar-wrapper"},[i("div",{className:"osjs-gui-progressbar-value",style:{width:String(e)+"%"}}),i("div",{className:"osjs-gui-progressbar-label"},[i("span",{},[String(e)+"%"])])]);return i(s,Object.assign({},t.box||{},{class:["osjs-gui-progressbar",t.class]}),[r].concat(o()(n)))},k=function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=function(n,e){var o=[i("span",{class:"separator"===e.type?"osjs-gui-menu-separator":"osjs-gui-menu-label "+(e.disabled?"osjs__disabled":"")},function(t){var n=[];return"checkbox"===t.type||"boolean"==typeof t.checked?n.push(i("span",{class:"osjs-gui-menu-checkbox "+(t.checked?"active":"")})):t.icon&&n.push(i(h,t.icon)),n.push(i("span",{},t.label)),n}(e))];return e.items&&o.push(t(n,e.items,r+1)),o};return i("ul",{class:""},e.map(function(t){return i("li",{class:"osjs-gui-menu-entry"},[i("div",{class:"osjs-gui-menu-container","data-has-image":!!t.icon||void 0,"data-has-children":!!t.items||void 0,onmouseover:t.items?n.onshow:void 0,ontouchend:t.items?n.onshow:void 0,onclick:function(e){t.items||(t.onclick&&t.onclick(t,e),n.onclick&&n.onclick(t,e))}},o(n,t))])}))},O=function(t){return i("div",{id:"osjs-context-menu",className:"osjs-gui osjs-gui-menu",oncreate:t.oncreate,onupdate:t.onupdate,style:{display:!1!==t.visible?"block":"none",top:t.position?String(t.position.top)+"px":0,left:t.position?String(t.position.left)+"px":0}},k(t,t.menu))},S=function(t,n){return i(s,Object.assign({orientation:"vertical"},t,{class:["osjs-gui-toolbar",t.class]}),n)},_=function(t,n){return i(s,Object.assign({},t.box||{},{class:["osjs-gui-statusbar",t.class]}),n)},E=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=t.onclick,r=t.data;return i("div",{onclick:function(t){if("function"==typeof e){var n=t.target.parentNode,o=Array.prototype.indexOf.call(n.children,t.target);e(t,r||{},o)}}},i("span",{},n))},T=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i(s,Object.assign({},t,{class:["osjs-gui-menubar",t.class]}),o()((t.items||[]).map(function(n){return i(E,{data:n.data,onclick:n.onclick||t.onclick},n.label)})).concat(o()(n)))};function L(t,n,e,r){return n._$r=function(){return{}},function(o,c){return i(r||"x-",{key:o.key,id:o.id,class:o.class,oncreate:function(r){var i=u(t,n,function(t,n){var o=e(t,n);return"function"==typeof o&&(o=o(r._$p,r._$c)),o},r);r._$p=o,r._$c=c,r._$r=i._$r,r._$u=i.uninit,i.init&&i.init(o),o.oncreate&&o.oncreate(r)},onupdate:function(t){t._$p=o,t._$c=c,t._$r(),o.onupdate&&o.onupdate(t)},ondestroy:function(t){t._$u&&t._$u()}})}}var I=function(t,n,e,r){var o=Array(Math.ceil(e.length/2)).fill(null).map(function(){return i("div",{class:"osjs-gui-panes-spacer",onmousedown:function(t){return function(t,n,e){var r=t.target,o=t.clientX,i=t.clientY,u=r.previousSibling,c=u.offsetWidth,a=u.offsetHeight,s=Array.from(r.parentNode.children).indexOf(u),l=.8*u.parentNode.offsetWidth,f=.8*u.parentNode.offsetHeight;if(!(s<0)){var d=function(t){t.preventDefault();var r="vertical"===e?c:a;if("vertical"===e){var u=t.clientX-o;r=Math.min(l,r+u)}else{var d=t.clientY-i;r=Math.min(f,r+d)}n.setSize({index:s,size:r})};t.preventDefault(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",function t(n){n.preventDefault(),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",t)})}}(t,n,r)}})});return e.map(function(n,e){var r=t.sizes[e]?String(t.sizes[e])+"px":void 0;return i("div",{class:"osjs-gui-panes-pane",style:{flex:r?"0 0 ".concat(r):r}},n)}).map(function(t,n){return[t,o[n]]}).reduce(function(t,n){return t.concat(n)}).filter(function(t){return void 0!==t})},N=L({sizes:[]},{init:function(t){return{sizes:t.sizes||[150]}},setSize:function(t){var n=t.index,e=t.size;return function(t){var r=[].concat(t.sizes);return r[n]=e,{sizes:r}}}},function(t,n){return function(e,r){var o=e.orientation||"vertical";return i(s,{orientation:o,class:"osjs-gui-panes-inner"},I(t,n,r,o))}},"div"),P=function(t,n){return i(N,{class:"osjs-gui-panes"},n)},$=b(),A=function(t){var n=function(n,e){return i("div",{class:"osjs-gui-list-view-pane"},[i("div",{class:"osjs-gui-list-view-header",style:{display:t.hideColumns?"none":void 0}},"object"===v()(e)?e.label:e),i("div",{class:"rows"},t.rows.map(function(n){return function(e,r){var o=e.columns[n]||{},u=t.selectedIndex===r,c=o.icon?i(h,o.icon):null,a=[i("span",{},["object"===v()(o)?o.label:o])];return c&&a.unshift(c),i("div",{"data-has-icon":!!o.icon||void 0,class:"osjs-gui-list-view-cell"+(u?" osjs__active":""),ontouchstart:function(n){return $(n,function(){return t.onactivate({data:e.data,index:r,ev:n})})},ondblclick:function(n){return t.onactivate({data:e.data,index:r,ev:n})},onclick:function(n){return t.onselect({data:e.data,index:r,ev:n})},oncontextmenu:function(n){return t.oncontextmenu({data:e.data,index:r,ev:n})},oncreate:function(n){return t.oncreate({data:e.data,index:r,el:n})}},a)}}(n)))])};return i("div",{class:"osjs-gui-list-view-wrapper",oncreate:function(n){return n.scrollTop=t.scrollTop},onupdate:function(n){t.selectedIndex<0&&(n.scrollTop=t.scrollTop)}},t.columns.map(function(t,e){return n(e,t)}))},R=function(t){return i(s,Object.assign({class:"osjs-gui-list-view"},t.box||{}),A(m(t,["box"])))},z={component:function(t,n){var e=Object.assign({columns:[],rows:[],onselect:function(t){var e=t.data,r=t.index,o=t.ev;n.select({data:e,index:r,ev:o}),n.setSelectedIndex(r)},onactivate:function(t){var e=t.data,r=t.index,o=t.ev;n.activate({data:e,index:r,ev:o}),n.setSelectedIndex(-1)},oncontextmenu:function(t){var e=t.data,r=t.index,o=t.ev;n.select({data:e,index:r,ev:o}),n.contextmenu({data:e,index:r,ev:o}),n.setSelectedIndex(r)},oncreate:function(t){n.created(t)}},t);return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return R(Object.assign(e,t))}},state:function(t){return Object.assign({selectedIndex:-1,scrollTop:0},t)},actions:function(t){return Object.assign({select:function(){return function(){return{}}},activate:function(){return function(){return{}}},contextmenu:function(){return function(){return{}}},created:function(){return function(){return{}}},setRows:function(t){return{rows:t}},setColumns:function(t){return{columns:t}},setScrollTop:function(t){return function(n){return{scrollTop:t}}},setSelectedIndex:function(t){return function(n){return{selectedIndex:t}}}},t||{})}},G=b(),C=function(t,n,e){return function(){var r=t.icon||{name:"application-x-executable"};return i("div",{class:"osjs-gui-icon-view-entry"+(e.selectedIndex===n?" osjs__active":""),ontouchstart:function(r){return G(r,function(){return e.onactivate({data:t.data,index:n,ev:r})})},ondblclick:function(r){return e.onactivate({data:t.data,index:n,ev:r})},onclick:function(r){return e.onselect({data:t.data,index:n,ev:r})},oncontextmenu:function(r){return e.oncontextmenu({data:t.data,index:n,ev:r})},oncreate:function(r){return e.oncreate({data:t.data,index:n,el:r})}},[i("div",{class:"osjs__container"},[i("div",{class:"osjs__image"},[i(h,r)]),i("div",{class:"osjs__label"},[i("span",{},t.label)])])])}},F=function(t){var n=i("div",{class:"osjs-gui-icon-view-wrapper",oncreate:function(n){return n.scrollTop=t.scrollTop},onupdate:function(n){t.selectedIndex<0&&(n.scrollTop=t.scrollTop)}},t.entries.map(function(n,e){return i(C(n,e,t))}));return i(s,Object.assign({class:"osjs-gui-icon-view"},t.box||{}),n)},M={component:function(t,n){var e=Object.assign({entries:[],onselect:function(t){var e=t.data,r=t.index,o=t.ev;n.select({data:e,index:r,ev:o}),n.setSelectedIndex(r)},onactivate:function(t){var e=t.data,r=t.index,o=t.ev;n.activate({data:e,index:r,ev:o}),n.setSelectedIndex(-1)},oncontextmenu:function(t){var e=t.data,r=t.index,o=t.ev;n.select({data:e,index:r,ev:o}),n.contextmenu({data:e,index:r,ev:o}),n.setSelectedIndex(r)},oncreate:function(t){n.created(t)}},t);return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return F(Object.assign(e,t))}},state:function(t){return Object.assign({selectedIndex:-1,scrollTop:0},t)},actions:function(t){return Object.assign({select:function(){return function(){return{}}},activate:function(){return function(){return{}}},contextmenu:function(){return function(){return{}}},created:function(){return function(){return{}}},setEntries:function(t){return function(){return{entries:t}}},setScrollTop:function(t){return function(n){return{scrollTop:t}}},setSelectedIndex:function(t){return function(n){return{selectedIndex:t}}}},t||{})}},B=function(t,n){return i("div",{class:"osjs-gui osjs-gui-image",style:{width:t.width?String(t.width)+"px":void 0,height:t.height?String(t.height)+"px":void 0}},[i("img",{src:t.src,width:t.width,height:t.height,onload:t.onload,oncreate:t.oncreate,onupdate:t.onupdate,ondestroy:t.ondestroy})])},H=function(t){return void 0===t||!0===t},V=function(t,n){return i("div",{class:"osjs-gui osjs-gui-video",style:{width:t.width?String(t.width)+"px":void 0,height:t.height?String(t.height)+"px":void 0}},[i("video",{src:t.src,width:t.width,height:t.height,poster:t.poster,loop:t.loop?"loop":void 0,muted:t.muted?"muted":void 0,controls:H(t.controls)?"controls":void 0,autoplay:H(t.autoplay)?"autoplay":void 0,onloadeddata:t.onload,oncreate:t.oncreate,onupdate:t.onupdate,ondestroy:t.ondestroy},function(t){return t.map(function(t){return i("source",t)})}(t.sources||[]))])},W=L({selectedIndex:0},{setSelectedIndex:function(t){return function(n){return{selectedIndex:t}}}},function(t,n){return function(e,r){return i("div",{class:"osjs-gui-tabs-wrapper"},[i("div",{class:"osjs-gui-tabs-header"},function(t,n,e){return(t||[]).map(function(t,r){return i("div",{class:n.selectedIndex===r?"osjs__active":"",onclick:function(t){return e.setSelectedIndex(r)}},i("span",{},t))})}(e.labels,t,n)),i("div",{class:"osjs-gui-tabs-panes"},function(t,n){return n.map(function(n,e){return i("div",{class:t.selectedIndex===e?"osjs__active":""},n)})}(t,r))])}},"div"),D=function(t,n){return i(W,Object.assign({class:"osjs-gui osjs-gui-tabs "+(t.class||"")},t),n)},Y=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i(s,Object.assign({},t.box||{},{class:["osjs-gui-iframe",t.class]}),[i("iframe",Object.assign({frameborder:0},m(t,["box"])))].concat(o()(n)))},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};arguments.length>1&&void 0!==arguments[1]&&arguments[1];return x("text-field",t,{autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",type:"text"},function(t){return i("input",t)})},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return x("textarea-field",t,{rows:4},function(t){return i("textarea",t,n)})},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=Object.keys(t.choices||{}).reduce(function(n,e){return n.push(i("option",{value:e,selected:t.key===t.choices[e]},t.choices[e])),n},[]);return x("select-field",t,{selectedIndex:void 0},function(t){return i("div",{},i("select",t,o()(e).concat(o()(n))))},function(t){return[t.target.value,t.target.textContent]})},J=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return x("toggle-field",t,{type:"checkbox",checked:!1},function(e){return i("label",{},[i("input",e),i("span",{class:"osjs-toggle-input"}),i("span",{class:"osjs-toggle-label"},[t.label||""].concat(o()(n)))])},function(n){return["radio"===t.type?JSON.parse(n.target.value):!!n.target.checked]})},K=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};arguments.length>1&&void 0!==arguments[1]&&arguments[1];return x("range-field",t,{type:"range"},function(t){return i("input",t)})},Q=L({active:!0},{init:function(t){return{ative:!1!==t.active}},ontoggle:function(t){var n=t.ev,e=t.active;return(t.ontoggle||function(){})(n,e),{active:e}}},function(t,n){return function(e,r){return i(s,Object.assign({},e.box||{},{class:["osjs-gui-expander-wrapper"]}),[i("div",{class:"osjs-gui-expander-header",onclick:function(r){return n.ontoggle({ev:r,active:!t.active,ontoggle:e.ontoggle})}},[i("div",{class:"osjs-gui-expander-header-icon","data-active":String(t.active)}),i("div",{class:"osjs-gui-expander-header-label"},e.label)]),i("div",{class:"osjs-gui-expander-content",style:{display:!1===t.active?"none":void 0}},r)])}},"div"),Z=function(t,n){return i(Q,Object.assign({},t,{class:"osjs-gui osjs-gui-expander"}),n)},tt=e(4),nt=e.n(tt),et=e(6),rt=e.n(et),ot=e(2),it=e.n(ot),ut=e(3),ct=e.n(ut),at=function(){function t(n){it()(this,t),this.core=n,this.callback=function(){},this.actions=null}return ct()(t,[{key:"destroy",value:function(){this.callback=null,this.actions=null}},{key:"init",value:function(){var t,n=this;this.actions=u({visible:!1,menu:[],position:{top:0,left:0}},{clamp:function(e){return function(r){var o=n.core.$root;clearTimeout(t);var i=function(t,n,e){var r={},o=e.top+n.offsetHeight,i=e.left+n.offsetWidth,u=t.offsetHeight-e.top,c=t.offsetWidth-e.left,a=i>t.offsetWidth,s=o>t.offsetHeight;return s&&(r.top=t.offsetHeight-n.offsetHeight-u),a&&(r.left=t.offsetWidth-n.offsetHeight-c),s||a?r:null}(o,e,r.position);return i?{position:i}:{}}},onshow:function(e){return function(r){clearTimeout(t),t=setTimeout(function(){return function(t,n){var e=n.target.querySelector("ul");e&&(e.classList.contains("osjs-gui-menu-container")&&(e=e.parentNode.parentNode),e&&e.offsetParent&&(e.classList.remove("clamp-right"),e.getBoundingClientRect().right>t.offsetWidth&&e.classList.add("clamp-right")))}(n.core.$root,e)},100)}},show:function(t){return function(e){var r=t.menu,o=t.position;if(o instanceof Event)o={left:o.clientX,top:o.clientY};else if(o instanceof Element){var i=o.getBoundingClientRect();o={left:i.left,top:i.top+i.height}}return n.callback=function(){t.callback&&t.callback.apply(t,arguments),n.actions.hide()},{visible:!0,menu:r,position:o}}},hide:function(){return function(t){return n.callback=null,{visible:!1}}}},function(t){return function(n,e){return i(O,{position:n.position,visible:n.visible,menu:n.menu,onclick:t,onshow:e.onshow,onupdate:function(t){return e.clamp(t)},oncreate:function(t){return e.clamp(t)}})}}(function(){n.core.destroyed||n.callback&&n.callback.apply(n,arguments)}),this.core.$root)}},{key:"show",value:function(){var t;return this.actions?(t=this.actions).show.apply(t,arguments):null}},{key:"hide",value:function(){var t;return this.actions?(t=this.actions).hide.apply(t,arguments):null}}]),t}(),st=function(t){var n=t.target,e="TEXTAREA"===n.tagName;return e||"INPUT"!==n.tagName||(e=-1!==["text","password","number","email"].indexOf(n.type)),e},lt=function(){function t(n){it()(this,t),this.core=n,this.contextmenu=new at(n)}return ct()(t,[{key:"destroy",value:function(){var t=document.getElementById("osjs-context-menu");t&&t.remove(),this.contextmenu.destroy()}},{key:"init",value:function(){var t=rt()(nt.a.mark(function t(){var n,e=this;return nt.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n={show:function(){var t;return(t=e.contextmenu).show.apply(t,arguments)},hide:function(){var t;return(t=e.contextmenu).hide.apply(t,arguments)}},this.core.instance("osjs/contextmenu",function(){return arguments.length?n.show.apply(n,arguments):n}),this.core.$root.addEventListener("contextmenu",function(t){st(t)||(t.stopPropagation(),t.preventDefault())});case 3:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"start",value:function(){var t=this;this.core.$root.addEventListener("click",function(n){!document.getElementById("osjs-context-menu").contains(n.target)&&t.contextmenu&&t.contextmenu.hide()},!0),this.contextmenu.init()}}]),t}();e.d(n,"Element",function(){return s}),e.d(n,"Box",function(){return l}),e.d(n,"BoxContainer",function(){return f}),e.d(n,"BoxStyled",function(){return d}),e.d(n,"Button",function(){return j}),e.d(n,"Progressbar",function(){return w}),e.d(n,"Menu",function(){return O}),e.d(n,"Toolbar",function(){return S}),e.d(n,"Statusbar",function(){return _}),e.d(n,"MenubarItem",function(){return E}),e.d(n,"Menubar",function(){return T}),e.d(n,"Panes",function(){return P}),e.d(n,"ListView",function(){return R}),e.d(n,"listView",function(){return z}),e.d(n,"IconViewEntry",function(){return C}),e.d(n,"IconView",function(){return F}),e.d(n,"iconView",function(){return M}),e.d(n,"Image",function(){return B}),e.d(n,"Video",function(){return V}),e.d(n,"Tabs",function(){return D}),e.d(n,"Iframe",function(){return Y}),e.d(n,"TextField",function(){return X}),e.d(n,"TextareaField",function(){return U}),e.d(n,"SelectField",function(){return q}),e.d(n,"ToggleField",function(){return J}),e.d(n,"RangeField",function(){return K}),e.d(n,"Icon",function(){return h}),e.d(n,"Expander",function(){return Z}),e.d(n,"GUIServiceProvider",function(){return lt})}])});
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("osjsGui",[],n):"object"==typeof exports?exports.osjsGui=n():t.osjsGui=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=7)}([function(t,n,e){var r=e(10),o=e(11),i=e(12);t.exports=function(t){return r(t)||o(t)||i()}},function(t,n){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(n){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=r=function(t){return e(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},r(n)}t.exports=r},function(t,n){t.exports=function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}},function(t,n){function e(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}},function(t,n,e){t.exports=e(13)},function(t,n){t.exports=function(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}},function(t,n){function e(t,n,e,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void e(t)}c.done?n(a):Promise.resolve(a).then(r,o)}t.exports=function(t){return function(){var n=this,r=arguments;return new Promise(function(o,i){var u=t.apply(n,r);function c(t){e(u,o,i,c,a,"next",t)}function a(t){e(u,o,i,c,a,"throw",t)}c(void 0)})}}},function(t,n,e){t.exports=e(15)},function(t,n,e){},,function(t,n){t.exports=function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}},function(t,n){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,n){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,n,e){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=e(14),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,n){!function(n){"use strict";var e,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",s="object"==typeof t,l=n.regeneratorRuntime;if(l)s&&(t.exports=l);else{(l=n.regeneratorRuntime=s?t.exports:{}).wrap=x;var f="suspendedStart",d="suspendedYield",v="executing",p="completed",h={},g={};g[u]=function(){return this};var y=Object.getPrototypeOf,m=y&&y(y(N([])));m&&m!==r&&o.call(m,u)&&(g=m);var b=O.prototype=w.prototype=Object.create(g);k.prototype=b.constructor=O,O.constructor=k,O[a]=k.displayName="GeneratorFunction",l.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===k||"GeneratorFunction"===(n.displayName||n.name))},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(b),t},l.awrap=function(t){return{__await:t}},S(_.prototype),_.prototype[c]=function(){return this},l.AsyncIterator=_,l.async=function(t,n,e,r){var o=new _(x(t,n,e,r));return l.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(b),b[a]="Generator",b[u]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(t){var n=[];for(var e in t)n.push(e);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},l.values=N,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],c=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var a=o.call(u,"catchLoc"),s=o.call(u,"finallyLoc");if(a&&s){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),h},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),h}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;T(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}}}function x(t,n,e,r){var o=n&&n.prototype instanceof w?n:w,i=Object.create(o.prototype),u=new I(r||[]);return i._invoke=function(t,n,e){var r=f;return function(o,i){if(r===v)throw new Error("Generator is already running");if(r===p){if("throw"===o)throw i;return P()}for(e.method=o,e.arg=i;;){var u=e.delegate;if(u){var c=E(u,e);if(c){if(c===h)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(r===f)throw r=p,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r=v;var a=j(t,n,e);if("normal"===a.type){if(r=e.done?p:d,a.arg===h)continue;return{value:a.arg,done:e.done}}"throw"===a.type&&(r=p,e.method="throw",e.arg=a.arg)}}}(t,e,u),i}function j(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}function w(){}function k(){}function O(){}function S(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function _(t){var n;this._invoke=function(e,r){function i(){return new Promise(function(n,i){!function n(e,r,i,u){var c=j(t[e],t,r);if("throw"!==c.type){var a=c.arg,s=a.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(t){n("next",t,i,u)},function(t){n("throw",t,i,u)}):Promise.resolve(s).then(function(t){a.value=t,i(a)},function(t){return n("throw",t,i,u)})}u(c.arg)}(e,r,n,i)})}return n=n?n.then(i,i):i()}}function E(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=j(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function L(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function T(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function N(t){if(t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:P}}function P(){return{value:e,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},function(t,n,e){"use strict";e.r(n);e(8);var r=e(0),o=e.n(r);function i(t,n){for(var e=[],r=[],o=arguments.length;o-- >2;)e.push(arguments[o]);for(;e.length;){var i=e.pop();if(i&&i.pop)for(o=i.length;o--;)e.push(i[o]);else null!=i&&!0!==i&&!1!==i&&r.push(i)}return"function"==typeof t?t(n||{},r):{nodeName:t,attributes:n||{},children:r,key:n&&n.key}}function u(t,n,e,r){var o,i=[].map,u=r&&r.children[0]||null,c=u&&function t(n){return{nodeName:n.nodeName.toLowerCase(),attributes:{},children:i.call(n.childNodes,function(n){return 3===n.nodeType?n.nodeValue:t(n)})}}(u),a=[],s=!0,l=h(t),f=function t(n,e,r){for(var o in r)"function"==typeof r[o]?function(t,o){r[t]=function(t){var i=o(t);return"function"==typeof i&&(i=i(y(n,l),r)),i&&i!==(e=y(n,l))&&!i.then&&p(l=g(n,h(e,i),l)),i}}(o,r[o]):t(n.concat(o),e[o]=h(e[o]),r[o]=h(r[o]));return r}([],l,h(n));return p(),f;function d(t){return"function"==typeof t?d(t(l,f)):null!=t?t:""}function v(){o=!o;var t=d(e);for(r&&!o&&(u=function t(n,e,r,o,i){if(o===r);else if(null==r||r.nodeName!==o.nodeName){var u=function t(n,e){var r="string"==typeof n||"number"==typeof n?document.createTextNode(n):(e=e||"svg"===n.nodeName)?document.createElementNS("http://www.w3.org/2000/svg",n.nodeName):document.createElement(n.nodeName);var o=n.attributes;if(o){o.oncreate&&a.push(function(){o.oncreate(r)});for(var i=0;i<n.children.length;i++)r.appendChild(t(n.children[i]=d(n.children[i]),e));for(var u in o)x(r,u,o[u],null,e)}return r}(o,i);n.insertBefore(u,e),null!=r&&j(n,e,r),e=u}else if(null==r.nodeName)e.nodeValue=o;else{!function(t,n,e,r){for(var o in h(n,e))e[o]!==("value"===o||"checked"===o?t[o]:n[o])&&x(t,o,e[o],n[o],r);var i=s?e.oncreate:e.onupdate;i&&a.push(function(){i(t,n)})}(e,r.attributes,o.attributes,i=i||"svg"===o.nodeName);for(var c={},l={},f=[],v=r.children,p=o.children,g=0;g<v.length;g++){f[g]=e.childNodes[g];var y=m(v[g]);null!=y&&(c[y]=[f[g],v[g]])}for(var g=0,b=0;b<p.length;){var y=m(v[g]),w=m(p[b]=d(p[b]));if(l[y])g++;else if(null==w||w!==m(v[g+1]))if(null==w||s)null==y&&(t(e,f[g],v[g],p[b],i),b++),g++;else{var k=c[w]||[];y===w?(t(e,k[0],k[1],p[b],i),g++):k[0]?t(e,e.insertBefore(k[0],f[g]),k[1],p[b],i):t(e,f[g],null,p[b],i),l[w]=p[b],b++}else null==y&&j(e,f[g],v[g]),g++}for(;g<v.length;)null==m(v[g])&&j(e,f[g],v[g]),g++;for(var g in c)l[g]||j(e,c[g][0],c[g][1])}return e}(r,u,c,c=t)),s=!1;a.length;)a.pop()()}function p(){o||(o=!0,setTimeout(v))}function h(t,n){var e={};for(var r in t)e[r]=t[r];for(var r in n)e[r]=n[r];return e}function g(t,n,e){var r={};return t.length?(r[t[0]]=t.length>1?g(t.slice(1),n,e[t[0]]):n,h(e,r)):n}function y(t,n){for(var e=0;e<t.length;)n=n[t[e++]];return n}function m(t){return t?t.key:null}function b(t){return t.currentTarget.events[t.type](t)}function x(t,n,e,r,o){if("key"===n);else if("style"===n)if("string"==typeof e)t.style.cssText=e;else for(var i in"string"==typeof r&&(r=t.style.cssText=""),h(r,e)){var u=null==e||null==e[i]?"":e[i];"-"===i[0]?t.style.setProperty(i,u):t.style[i]=u}else"o"===n[0]&&"n"===n[1]?(n=n.slice(2),t.events?r||(r=t.events[n]):t.events={},t.events[n]=e,e?r||t.addEventListener(n,b):t.removeEventListener(n,b)):n in t&&"list"!==n&&"type"!==n&&"draggable"!==n&&"spellcheck"!==n&&"translate"!==n&&!o?t[n]=null==e?"":e:null!=e&&!1!==e&&t.setAttribute(n,e),null!=e&&!1!==e||t.removeAttribute(n)}function j(t,n,e){function r(){t.removeChild(function t(n,e){var r=e.attributes;if(r){for(var o=0;o<e.children.length;o++)t(n.childNodes[o],e.children[o]);r.ondestroy&&r.ondestroy(n)}return n}(n,e))}var o=e.attributes&&e.attributes.onremove;o?o(n,r):r()}}var c=function(t,n){return"number"==typeof t?"".concat(t,"px"):!1===t?n:t},a={grow:function(t){return{flexGrow:t}},shrink:function(t){return{flexShrink:t}},basis:function(t){return{flexBasis:c(t,"auto")}},align:function(t){return{alignItems:t}},justify:function(t){return{justifyContent:t}},padding:function(t){return{margin:c(t,"0")}},margin:function(t){return{margin:c(t,"0")}}},s=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=t.class instanceof Array?t.class:[t.class],r=["osjs-gui"].concat(o()(e));t.orientation&&r.push("osjs-gui-"+t.orientation);var u="string"==typeof t.style?{}:Object.assign({},t.style||{}),c=Object.keys(t).reduce(function(n,e){var r=a[e]?a[e](t[e]):void 0;return Object.assign({},n,r)},u);return i("div",{oncreate:t.oncreate,ondestroy:t.ondestroy,class:r.filter(function(t){return!!t}).join(" "),style:c},n)},l=function(t,n){return i(s,Object.assign({orientation:"horizontal"},t,{class:["osjs-gui-box",t.class]}),n)},f=function(t,n){return i(s,Object.assign({},t,{class:["osjs-gui-box-container",t.class]}),n)},d=function(t,n){return i(s,Object.assign({},t,{class:["osjs-gui-box-styled",t.class]}),n)},v=e(1),p=e.n(v),h=function(t,n){var e=t&&"object"===p()(t)?t.src:t;return i("i",{"data-icon":t&&"object"===p()(t)?t.name:void 0,class:"osjs-icon",style:{backgroundImage:"string"==typeof t?"url(".concat(e,")"):void 0}})},g=e(5),y=e.n(g),m=function(t,n){return Object.keys(t).filter(function(t){return-1===n.indexOf(t)}).reduce(function(n,e){return Object.assign(y()({},e,t[e]),n)},{})},b=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,e=!1;return function(r,o){return t=clearTimeout(t),t=setTimeout(function(){return e=!1},n),e?(r.preventDefault(),o(r)):(e=!0,!1)}},x=function(t,n,e,r,u){var c=n.oninput||function(){},a=n.onchange||function(){},l=n.onkeydown||function(){},f=u||function(t){return[t.target.value]},d=Object.assign({oninput:function(t){return c.apply(void 0,[t].concat(o()(f(t))))},onchange:function(t){return a.apply(void 0,[t].concat(o()(f(t))))},onkeydown:function(t){13===t.keyCode&&n.onenter&&n.onenter.apply(n,[t].concat(o()(f(t)))),l(t)}},e,m(n,["choices","label","box","oninput","onchange"]));return i(s,Object.assign({},n.box||{},{class:"osjs-gui-field osjs-gui-"+t}),r(d))},j=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return x("button",t,{},function(e){var r=[];return t.icon&&r.push(i(h,t.icon)),"string"==typeof t.label&&r.push(i("span",{class:"osjs-label"},t.label)),i("button",e,r.concat(o()(n)))})},w=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e="number"==typeof t.value?Math.max(0,Math.abs(t.value))%100:0,r=i("div",{class:"osjs-gui-progressbar-wrapper"},[i("div",{className:"osjs-gui-progressbar-value",style:{width:String(e)+"%"}}),i("div",{className:"osjs-gui-progressbar-label"},[i("span",{},[String(e)+"%"])])]);return i(s,Object.assign({},t.box||{},{class:["osjs-gui-progressbar",t.class]}),[r].concat(o()(n)))},k=function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=function(n,e){var o=[i("span",{class:"separator"===e.type?"osjs-gui-menu-separator":"osjs-gui-menu-label "+(e.disabled?"osjs__disabled":"")},function(t){var n=[];return"checkbox"===t.type||"boolean"==typeof t.checked?n.push(i("span",{class:"osjs-gui-menu-checkbox "+(t.checked?"active":"")})):t.icon&&n.push(i(h,t.icon)),n.push(i("span",{},t.label)),n}(e))];return e.items&&o.push(t(n,e.items,r+1)),o};return i("ul",{class:""},e.map(function(t){return i("li",{class:"osjs-gui-menu-entry"},[i("div",{class:"osjs-gui-menu-container","data-has-image":!!t.icon||void 0,"data-has-children":!!t.items||void 0,onmouseover:t.items?n.onshow:void 0,ontouchend:t.items?n.onshow:void 0,onclick:function(e){t.items||(t.onclick&&t.onclick(t,e),n.onclick&&n.onclick(t,e))}},o(n,t))])}))},O=function(t){return i("div",{id:"osjs-context-menu",className:"osjs-gui osjs-gui-menu",oncreate:t.oncreate,onupdate:t.onupdate,style:{display:!1!==t.visible?"block":"none",top:t.position?String(t.position.top)+"px":0,left:t.position?String(t.position.left)+"px":0}},k(t,t.menu))},S=function(t,n){return i(s,Object.assign({orientation:"vertical"},t,{class:["osjs-gui-toolbar",t.class]}),n)},_=function(t,n){return i(s,Object.assign({},t.box||{},{class:["osjs-gui-statusbar",t.class]}),n)},E=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=t.onclick,r=t.data;return i("div",{onclick:function(t){if("function"==typeof e){var n=t.target.parentNode,o=Array.prototype.indexOf.call(n.children,t.target);e(t,r||{},o)}}},i("span",{},n))},L=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i(s,Object.assign({},t,{class:["osjs-gui-menubar",t.class]}),o()((t.items||[]).map(function(n){return i(E,{data:n.data,onclick:n.onclick||t.onclick},n.label)})).concat(o()(n)))};function T(t,n,e,r){return n._$r=function(){return{}},function(o,c){return i(r||"x-",{key:o.key,id:o.id,class:o.class,oncreate:function(r){var i=u(t,n,function(t,n){var o=e(t,n);return"function"==typeof o&&(o=o(r._$p,r._$c)),o},r);r._$p=o,r._$c=c,r._$r=i._$r,r._$u=i.uninit,i.init&&i.init(o),o.oncreate&&o.oncreate(r)},onupdate:function(t){t._$p=o,t._$c=c,t._$r(),o.onupdate&&o.onupdate(t)},ondestroy:function(t){t._$u&&t._$u()}})}}var I=function(t,n,e,r){var o=Array(Math.ceil(e.length/2)).fill(null).map(function(){return i("div",{class:"osjs-gui-panes-spacer",onmousedown:function(t){return function(t,n,e){var r=t.target,o=t.clientX,i=t.clientY,u=r.previousSibling,c=u.offsetWidth,a=u.offsetHeight,s=Array.from(r.parentNode.children).indexOf(u),l=.8*u.parentNode.offsetWidth,f=.8*u.parentNode.offsetHeight;if(!(s<0)){var d=function(t){t.preventDefault();var r="vertical"===e?c:a;if("vertical"===e){var u=t.clientX-o;r=Math.min(l,r+u)}else{var d=t.clientY-i;r=Math.min(f,r+d)}n.setSize({index:s,size:r})};t.preventDefault(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",function t(n){n.preventDefault(),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",t)})}}(t,n,r)}})});return e.map(function(n,e){var r=t.sizes[e]?String(t.sizes[e])+"px":void 0;return i("div",{class:"osjs-gui-panes-pane",style:{flex:r?"0 0 ".concat(r):r}},n)}).map(function(t,n){return[t,o[n]]}).reduce(function(t,n){return t.concat(n)}).filter(function(t){return void 0!==t})},N=T({sizes:[]},{init:function(t){return{sizes:t.sizes||[150]}},setSize:function(t){var n=t.index,e=t.size;return function(t){var r=[].concat(t.sizes);return r[n]=e,{sizes:r}}}},function(t,n){return function(e,r){var o=e.orientation||"vertical";return i(s,{orientation:o,class:"osjs-gui-panes-inner"},I(t,n,r,o))}},"div"),P=function(t,n){return i(N,{class:"osjs-gui-panes"},n)},$=b(),A=function(t){var n=function(n,e){return i("div",{class:"osjs-gui-list-view-pane"},[i("div",{class:"osjs-gui-list-view-header",style:{display:t.hideColumns?"none":void 0}},"object"===p()(e)?e.label:e),i("div",{class:"rows"},t.rows.map(function(n){return function(e,r){var o=e.columns[n]||{},u=t.selectedIndex===r,c=o.icon?i(h,o.icon):null,a=[i("span",{},["object"===p()(o)?o.label:o])];return c&&a.unshift(c),i("div",{"data-has-icon":!!o.icon||void 0,class:"osjs-gui-list-view-cell"+(u?" osjs__active":""),ontouchstart:function(n){return $(n,function(){return t.onactivate({data:e.data,index:r,ev:n})})},ondblclick:function(n){return t.onactivate({data:e.data,index:r,ev:n})},onclick:function(n){return t.onselect({data:e.data,index:r,ev:n})},oncontextmenu:function(n){return t.oncontextmenu({data:e.data,index:r,ev:n})},oncreate:function(n){return t.oncreate({data:e.data,index:r,el:n})}},a)}}(n)))])};return i("div",{class:"osjs-gui-list-view-wrapper",oncreate:function(n){return n.scrollTop=t.scrollTop},onupdate:function(n){t.selectedIndex<0&&(n.scrollTop=t.scrollTop)}},t.columns.map(function(t,e){return n(e,t)}))},R=function(t){return i(s,Object.assign({class:"osjs-gui-list-view"},t.box||{}),A(m(t,["box"])))},z={component:function(t,n){var e=Object.assign({columns:[],rows:[],onselect:function(t){var e=t.data,r=t.index,o=t.ev;n.select({data:e,index:r,ev:o}),n.setSelectedIndex(r)},onactivate:function(t){var e=t.data,r=t.index,o=t.ev;n.activate({data:e,index:r,ev:o}),n.setSelectedIndex(-1)},oncontextmenu:function(t){var e=t.data,r=t.index,o=t.ev;n.select({data:e,index:r,ev:o}),n.contextmenu({data:e,index:r,ev:o}),n.setSelectedIndex(r)},oncreate:function(t){n.created(t)}},t);return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return R(Object.assign(e,t))}},state:function(t){return Object.assign({selectedIndex:-1,scrollTop:0},t)},actions:function(t){return Object.assign({select:function(){return function(){return{}}},activate:function(){return function(){return{}}},contextmenu:function(){return function(){return{}}},created:function(){return function(){return{}}},setRows:function(t){return{rows:t}},setColumns:function(t){return{columns:t}},setScrollTop:function(t){return function(n){return{scrollTop:t}}},setSelectedIndex:function(t){return function(n){return{selectedIndex:t}}}},t||{})}},G=b(),C=function(t,n,e){return function(){var r=t.icon||{name:"application-x-executable"};return i("div",{class:"osjs-gui-icon-view-entry"+(e.selectedIndex===n?" osjs__active":""),ontouchstart:function(r){return G(r,function(){return e.onactivate({data:t.data,index:n,ev:r})})},ondblclick:function(r){return e.onactivate({data:t.data,index:n,ev:r})},onclick:function(r){return e.onselect({data:t.data,index:n,ev:r})},oncontextmenu:function(r){return e.oncontextmenu({data:t.data,index:n,ev:r})},oncreate:function(r){return e.oncreate({data:t.data,index:n,el:r})}},[i("div",{class:"osjs__container"},[i("div",{class:"osjs__image"},[i(h,r)]),i("div",{class:"osjs__label"},[i("span",{},t.label)])])])}},F=function(t){var n=i("div",{class:"osjs-gui-icon-view-wrapper",oncreate:function(n){return n.scrollTop=t.scrollTop},onupdate:function(n){t.selectedIndex<0&&(n.scrollTop=t.scrollTop)}},t.entries.map(function(n,e){return i(C(n,e,t))}));return i(s,Object.assign({class:"osjs-gui-icon-view"},t.box||{}),n)},M={component:function(t,n){var e=Object.assign({entries:[],onselect:function(t){var e=t.data,r=t.index,o=t.ev;n.select({data:e,index:r,ev:o}),n.setSelectedIndex(r)},onactivate:function(t){var e=t.data,r=t.index,o=t.ev;n.activate({data:e,index:r,ev:o}),n.setSelectedIndex(-1)},oncontextmenu:function(t){var e=t.data,r=t.index,o=t.ev;n.select({data:e,index:r,ev:o}),n.contextmenu({data:e,index:r,ev:o}),n.setSelectedIndex(r)},oncreate:function(t){n.created(t)}},t);return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return F(Object.assign(e,t))}},state:function(t){return Object.assign({selectedIndex:-1,scrollTop:0},t)},actions:function(t){return Object.assign({select:function(){return function(){return{}}},activate:function(){return function(){return{}}},contextmenu:function(){return function(){return{}}},created:function(){return function(){return{}}},setEntries:function(t){return function(){return{entries:t}}},setScrollTop:function(t){return function(n){return{scrollTop:t}}},setSelectedIndex:function(t){return function(n){return{selectedIndex:t}}}},t||{})}},B=function(t,n){return i("div",{class:"osjs-gui osjs-gui-image",style:{width:t.width?String(t.width)+"px":void 0,height:t.height?String(t.height)+"px":void 0}},i("img",t))},V=function(t){return void 0===t||!0===t},W=function(t,n){return i("div",{class:"osjs-gui osjs-gui-video",style:{width:t.width?String(t.width)+"px":void 0,height:t.height?String(t.height)+"px":void 0}},[i("video",{src:t.src,width:t.width,height:t.height,poster:t.poster,loop:t.loop?"loop":void 0,muted:t.muted?"muted":void 0,controls:V(t.controls)?"controls":void 0,autoplay:V(t.autoplay)?"autoplay":void 0,onloadeddata:t.onload,oncreate:t.oncreate,onupdate:t.onupdate,ondestroy:t.ondestroy},function(t){return t.map(function(t){return i("source",t)})}(t.sources||[]))])},H=T({selectedIndex:0},{setSelectedIndex:function(t){return function(n){return{selectedIndex:t}}}},function(t,n){return function(e,r){return i("div",{class:"osjs-gui-tabs-wrapper"},[i("div",{class:"osjs-gui-tabs-header"},function(t,n,e){return(t||[]).map(function(t,r){return i("div",{class:n.selectedIndex===r?"osjs__active":"",onclick:function(t){return e.setSelectedIndex(r)}},i("span",{},t))})}(e.labels,t,n)),i("div",{class:"osjs-gui-tabs-panes"},function(t,n){return n.map(function(n,e){return i("div",{class:t.selectedIndex===e?"osjs__active":""},n)})}(t,r))])}},"div"),D=function(t,n){return i(H,Object.assign({class:"osjs-gui osjs-gui-tabs "+(t.class||"")},t),n)},Y=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i(s,Object.assign({},t.box||{},{class:["osjs-gui-iframe",t.class]}),[i("iframe",Object.assign({frameborder:0},m(t,["box"])))].concat(o()(n)))},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};arguments.length>1&&void 0!==arguments[1]&&arguments[1];return x("text-field",t,{autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",type:"text"},function(t){return i("input",t)})},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return x("textarea-field",t,{rows:4},function(t){return i("textarea",t,n)})},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=Object.keys(t.choices||{}).reduce(function(n,e){return n.push(i("option",{value:e,selected:t.key===t.choices[e]},t.choices[e])),n},[]);return x("select-field",t,{selectedIndex:void 0},function(t){return i("div",{},i("select",t,o()(e).concat(o()(n))))},function(t){return[t.target.value,t.target.textContent]})},J=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return x("toggle-field",t,{type:"checkbox",checked:!1},function(e){return i("label",{},[i("input",e),i("span",{class:"osjs-toggle-input"}),i("span",{class:"osjs-toggle-label"},[t.label||""].concat(o()(n)))])},function(n){return["radio"===t.type?JSON.parse(n.target.value):!!n.target.checked]})},K=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};arguments.length>1&&void 0!==arguments[1]&&arguments[1];return x("range-field",t,{type:"range"},function(t){return i("input",t)})},Q=T({active:!0},{init:function(t){return{ative:!1!==t.active}},ontoggle:function(t){var n=t.ev,e=t.active;return(t.ontoggle||function(){})(n,e),{active:e}}},function(t,n){return function(e,r){return i(s,Object.assign({},e.box||{},{class:["osjs-gui-expander-wrapper"]}),[i("div",{class:"osjs-gui-expander-header",onclick:function(r){return n.ontoggle({ev:r,active:!t.active,ontoggle:e.ontoggle})}},[i("div",{class:"osjs-gui-expander-header-icon","data-active":String(t.active)}),i("div",{class:"osjs-gui-expander-header-label"},e.label)]),i("div",{class:"osjs-gui-expander-content",style:{display:!1===t.active?"none":void 0}},r)])}},"div"),Z=function(t,n){return i(Q,Object.assign({},t,{class:"osjs-gui osjs-gui-expander"}),n)},tt=e(4),nt=e.n(tt),et=e(6),rt=e.n(et),ot=e(2),it=e.n(ot),ut=e(3),ct=e.n(ut),at=function(t){return t(),setTimeout(t,100)},st=function(){function t(n){it()(this,t),this.core=n,this.callback=function(){},this.actions=null}return ct()(t,[{key:"destroy",value:function(){this.callback=null,this.actions=null}},{key:"init",value:function(){var t,n=this;this.actions=u({visible:!1,menu:[],position:{top:0,left:0}},{clamp:function(e){return function(r){if(e=e||document.querySelector("#osjs-context-menu"),clearTimeout(t),e){var o=function(t,n,e){var r={},o=e.top+n.offsetHeight,i=e.left+n.offsetWidth,u=t.offsetHeight-e.top,c=t.offsetWidth-e.left,a=i>t.offsetWidth,s=o>t.offsetHeight;return s&&(r.top=t.offsetHeight-n.offsetHeight-u),a&&(r.left=t.offsetWidth-n.offsetWidth-c),s||a?r:null}(n.core.$root,e,r.position);if(o)return{position:o}}return{}}},onshow:function(e){return function(r){t=at(function(){return function(t,n){var e=n.target.querySelector("ul");e&&(e.classList.contains("osjs-gui-menu-container")&&(e=e.parentNode.parentNode),e&&e.offsetParent&&(e.classList.remove("clamp-right"),e.getBoundingClientRect().right>t.offsetWidth&&e.classList.add("clamp-right")))}(n.core.$root,e)})}},show:function(t){return function(e,r){var o=t.menu,i=t.position;if(i instanceof Event)i={left:i.clientX,top:i.clientY};else if(i instanceof Element){var u=i.getBoundingClientRect();i={left:u.left,top:u.top+u.height}}return n.callback=function(){t.callback&&t.callback.apply(t,arguments),n.actions.hide()},at(function(){return r.clamp()}),{visible:!0,menu:o,position:i}}},hide:function(){return function(t){return n.callback=null,{visible:!1}}}},function(t){return function(n,e){return i(O,{position:n.position,visible:n.visible,menu:n.menu,onclick:t,onshow:e.onshow})}}(function(){n.core.destroyed||n.callback&&n.callback.apply(n,arguments)}),this.core.$root)}},{key:"show",value:function(){var t;return this.actions?(t=this.actions).show.apply(t,arguments):null}},{key:"hide",value:function(){var t;return this.actions?(t=this.actions).hide.apply(t,arguments):null}}]),t}(),lt=function(t){var n=t.target,e="TEXTAREA"===n.tagName;return e||"INPUT"!==n.tagName||(e=-1!==["text","password","number","email"].indexOf(n.type)),e},ft=function(){function t(n){it()(this,t),this.core=n,this.contextmenu=new st(n)}return ct()(t,[{key:"destroy",value:function(){var t=document.getElementById("osjs-context-menu");t&&t.remove(),this.contextmenu.destroy()}},{key:"init",value:function(){var t=rt()(nt.a.mark(function t(){var n,e=this;return nt.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n={show:function(){var t;return(t=e.contextmenu).show.apply(t,arguments)},hide:function(){var t;return(t=e.contextmenu).hide.apply(t,arguments)}},this.core.instance("osjs/contextmenu",function(){return arguments.length?n.show.apply(n,arguments):n}),this.core.$root.addEventListener("contextmenu",function(t){lt(t)||(t.stopPropagation(),t.preventDefault())});case 3:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"start",value:function(){var t=this;this.core.$root.addEventListener("click",function(n){!document.getElementById("osjs-context-menu").contains(n.target)&&t.contextmenu&&t.contextmenu.hide()},!0),this.contextmenu.init()}}]),t}();e.d(n,"Element",function(){return s}),e.d(n,"Box",function(){return l}),e.d(n,"BoxContainer",function(){return f}),e.d(n,"BoxStyled",function(){return d}),e.d(n,"Button",function(){return j}),e.d(n,"Progressbar",function(){return w}),e.d(n,"Menu",function(){return O}),e.d(n,"Toolbar",function(){return S}),e.d(n,"Statusbar",function(){return _}),e.d(n,"MenubarItem",function(){return E}),e.d(n,"Menubar",function(){return L}),e.d(n,"Panes",function(){return P}),e.d(n,"ListView",function(){return R}),e.d(n,"listView",function(){return z}),e.d(n,"IconViewEntry",function(){return C}),e.d(n,"IconView",function(){return F}),e.d(n,"iconView",function(){return M}),e.d(n,"Image",function(){return B}),e.d(n,"Video",function(){return W}),e.d(n,"Tabs",function(){return D}),e.d(n,"Iframe",function(){return Y}),e.d(n,"TextField",function(){return X}),e.d(n,"TextareaField",function(){return q}),e.d(n,"SelectField",function(){return U}),e.d(n,"ToggleField",function(){return J}),e.d(n,"RangeField",function(){return K}),e.d(n,"Icon",function(){return h}),e.d(n,"Expander",function(){return Z}),e.d(n,"GUIServiceProvider",function(){return ft})}])});
//# sourceMappingURL=main.js.map
{
"name": "@osjs/gui",
"version": "4.0.7",
"version": "4.0.8",
"description": "OS.js v3 GUI",

@@ -5,0 +5,0 @@ "module": "dist/esm.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc