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

react-dev-os

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dev-os - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17

2

dist/bundle.js

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.devOS=t(require("react")):e.devOS=t(e.react)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=6)}([function(t,r){t.exports=e},function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n={error:function(e,t){if(e instanceof Error)return e;try{return t(e)}catch(e){return e instanceof Error?e:Error(e)}},maybe:function(e,t){return null!=e?t(e):null},sync:function(e,t){return e instanceof Promise?e.then((function(e){return t(e)})):t(e)}};t.default=function(e){var t=function(e,t){return t(e)};return function e(r){return{bind:function(o){return t="string"==typeof o?n[o]:o,e(r)},flow:function(n){return e(t(r,n))},close:function(e){return e?e(r):r}}}(e)}}]).default},function(e,t){},function(e,t){},function(e,t,r){window,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=0)}([function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.r(t),r.d(t,"Store",(function(){return v}));var a={isPending:!1,isError:!1,error:null,shouldThrowErrors:!0,shouldTrackAsyncState:!0},f=function(e){return Object.entries(e).reduce((function(e,t){var r=c(t,2),n=r[0],i=r[1],u="function"!=typeof i;return e[n]={configs:u?o({},a,{},i.configs):a,reducer:u?i.reducer:i},e}),{})},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((function(e,t){var r=c(t,2),n=(r[0],r[1]),o=n.actions,i=void 0===o?{}:o,u=n.name,a=n.state,s=void 0===a?null:a;return e[u]={actions:f(i),state:s},e}),{})};function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function O(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var v=function(){function e(t){var r=t.name,n=void 0===r?"":r,o=t.services,i=void 0===o?{}:o,c=t.types;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastUid=0,this.name=n,this.services=i,this.subscribers={},this.types=s(c),this._typeConfigs=c}var t,r;return t=e,(r=[{key:"dispatch",value:function(e,t){var r=y(this._tokenizeAction(e),2),n=r[0],o=r[1],i=this.types[n],c=i.actions[o];return this._setState({typeName:n})(c.reducer({prevState:i.state,services:this.services},t)),this.types[n].state}},{key:"dispatchAsync",value:function(e,t){var r=y(this._tokenizeAction(e),2),n=r[0],o=r[1],i=this.types[n],c=i.actions[o],u=c.configs.shouldTrackAsyncState,a=this._setConfigs({actionName:o,typeName:n}),f=this._setState({typeName:n});return u&&a({isPending:!0,isError:!1,error:null}),Promise.resolve(c.reducer({prevState:i.state,services:this.services},t)).then((function(e){return u&&a({isPending:!1},!1),f(e),e})).catch((function(e){return u&&a({isPending:!1,isError:!0,error:e}),u?c.configs.shouldThrowErrors&&Promise.reject(e):Promise.reject(e)}))}},{key:"getError",value:function(e){var t=y(this._tokenizeAction(e),2),r=t[0],n=t[1];return this.types[r].actions[n].configs.error}},{key:"getState",value:function(e){return e?this.types[e].state:Object.entries(this.types).reduce((function(e,t){var r=y(t,2),n=r[0],o=r[1].state;return e[n]=o,e}),{})}},{key:"isError",value:function(e){var t=y(this._tokenizeAction(e),2),r=t[0],n=t[1];return this.types[r].actions[n].configs.isError}},{key:"isPending",value:function(e){var t=y(this._tokenizeAction(e),2),r=t[0],n=t[1];return this.types[r].actions[n].configs.isPending}},{key:"subscribe",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},r="uid_".concat(++this.lastUid);return this.subscribers[r]=t,t(this),{onNotify:t,token:r,unsubscribe:function(){return e._unsubscribe(r)}}}},{key:"_notify",value:function(){var e=this;Object.values(this.subscribers).forEach((function(t){return t(e)}))}},{key:"reset",value:function(){this.lastUid=0,this.subscribers={},this.types=s(this._typeConfigs)}},{key:"_setConfigs",value:function(e){var t=this,r=e.actionName,n=e.typeName;return function(e){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t.types[n].actions[r].configs;return t.types[n].actions[r].configs=p({},i,{},e),o&&t._notify()}}},{key:"_setState",value:function(e){var t=this,r=e.typeName;return function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.types[r].state=e,n&&t._notify()}}},{key:"_tokenizeAction",value:function(e){var t=y(e.split("."),1)[0];return[t,e.slice(t.length+1)]}},{key:"_unsubscribe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;delete this.subscribers[e]}}])&&O(t.prototype,r),e}()}])},function(e,t){},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),i=function(e){return{height:"5px",width:"5px",cursor:e}};function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f=function(e){var t=e.cursor,r=e.onResize,c=e.onResizeEnd,a=e.onResizeStart,f=e.style,s=Object(n.useRef)(!1).current,l=function e(t){document.body.style.cursor="auto",document.body.style.userSelect="",window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",e),s&&(s=!1,c(t))},p=function(e){s&&(e.stopImmediatePropagation(),r(e))};return o.a.createElement(R,{style:u(u({},i(t)),f),draggable:!1,onMouseDown:function(e){document.body.style.cursor=t,document.body.style.userSelect="none",s=!0,a(e),window.addEventListener("mousemove",p),window.addEventListener("mouseup",l)}})};f.defaultProps={cursor:"nwse-resize",onResize:function(){},onResizeEnd:function(){},onResizeStart:function(){},style:{}};var s=f,l={top:{position:"absolute",top:"-2px",left:"0px",width:"100%"},left:{position:"absolute",top:"0px",left:"-2px",height:"100%"},right:{position:"absolute",top:"0px",right:"-2px",height:"100%"},bottom:{position:"absolute",bottom:"-2px",left:"0px",width:"100%"},topLeft:{position:"absolute",top:"-2px",left:"-2px",height:"10px",width:"10px"},topRight:{position:"absolute",top:"-2px",right:"-2px",height:"10px",width:"10px"},bottomLeft:{position:"absolute",bottom:"-2px",left:"-2px",height:"10px",width:"10px"},bottomRight:{position:"absolute",bottom:"-2px",right:"-2px",height:"10px",width:"10px"}},p=function(e){var t=e.onResize,r=e.onResizeEnd,i=e.onResizeStart;return o.a.createElement(n.Fragment,null,o.a.createElement(s,{style:l.top,cursor:"ns-resize",onResize:function(e){return t(e,"top")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.left,cursor:"ew-resize",onResize:function(e){return t(e,"left")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.right,cursor:"ew-resize",onResize:function(e){return t(e,"right")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.bottom,cursor:"ns-resize",onResize:function(e){return t(e,"bottom")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.topLeft,cursor:"nwse-resize",onResize:function(e){return t(e,"topLeft")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.topRight,cursor:"nesw-resize",onResize:function(e){return t(e,"topRight")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.bottomLeft,cursor:"nesw-resize",onResize:function(e){return t(e,"bottomLeft")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.bottomRight,cursor:"nwse-resize",onResize:function(e){return t(e,"bottomRight")},onResizeEnd:r,onResizeStart:i}))};p.defaultProps={onResize:function(){},onResizeEnd:function(){},onResiseStart:function(){}};var b=p,y={bottom:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.height+r.movementY;return{width:t.width,height:o>n.height?o:t.height,top:t.top,left:t.left}},bottomLeft:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width-r.movementX,i=t.height+r.movementY;return{width:o>n.width?o:t.width,height:i>n.height?i:t.height,top:t.top,left:o>n.width?t.left+r.movementX:t.left}},bottomRight:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width+r.movementX,i=t.height+r.movementY;return{width:o>n.width?o:t.width,height:i>n.height?i:t.height,top:t.top,left:t.left}},left:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width-r.movementX;return{width:o>n.width?o:t.width,height:t.height,top:t.top,left:o>n.width?t.left+r.movementX:t.left}},right:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width+r.movementX;return{width:o>n.width?o:t.width,height:t.height,top:t.top,left:t.left}},top:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.height-r.movementY;return{width:t.width,height:o>n.height?o:t.height,top:o>n.height?t.top+r.movementY:t.top,left:t.left}},topLeft:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width-r.movementX,i=t.height-r.movementY;return{width:o>n.width?o:t.width,height:i>n.height?i:t.height,top:i>n.height?t.top+r.movementY:t.top,left:o>n.width?t.left+r.movementX:t.left}},topRight:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width+r.movementX,i=t.height-r.movementY;return{width:o>n.width?o:t.width,height:i>n.height?i:t.height,top:i>n.height?t.top+r.movementY:t.top,left:t.left}}},d=function(e){var t=e.elem,r=e.event,n=e.handleType,o=e.minSize;return y[n]({elem:t.getBoundingClientRect(),event:r,minSize:o})},O=r(2),v=r.n(O);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var w=function(e){var t=e.children,r=e.isActive,i=e.minHeight,c=e.minWidth,u=e.onResize,a=e.onResizeEnd,f=e.onResizeStart,s=e.style,l=Object(n.useRef)(null);return o.a.createElement(I,{style:g(g({},v.a.view),s),ref:l},t,r&&o.a.createElement(b,{onResize:function(e,t){return u(d({elem:l.current,event:e,handleType:t,minSize:{height:i,width:c}}))},onResizeEnd:a,onResizeStart:f}))};w.defaultProps={children:null,isActive:!0,minHeight:1,minWidth:1,onResize:function(){},onResizeEnd:function(){},onResizeStart:function(){},style:{}};var j=w,P=r(3),S=r.n(P);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){D(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var z=function(e){return o.a.createElement("div",{style:E(E({},S.a.container),e.style),title:e.title},e.children)};z.defaultProps={children:null,title:null};var A=z,R=function(e){return o.a.createElement("div",e)};function k(){return(k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var I=o.a.forwardRef((function(e,t){return o.a.createElement("div",k({},e,{ref:t}))}));function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var L=function(e){var t=e.isActive,r=Object(n.useRef)(null),o=_(B({event:null,isOpen:!1,position:{x:0,y:0}}),2),i=o[0],c=o[1],u=function(e){t&&!i.isOpen&&(c({event:e,isOpen:!0,position:{x:e.clientX,y:e.clientY}}),e.preventDefault(),e.stopPropagation())},a=function(){return c({isOpen:!1})},f=function(){return a()},s=function(){return a()};return Object(n.useEffect)((function(){return window.addEventListener("mousedown",s),window.addEventListener("click",f),function(){window.removeEventListener("mousedown",s),window.removeEventListener("click",f)}}),[i.isOpen]),Object(n.useEffect)((function(){var e=r.current;if(e)return e.addEventListener("contextmenu",u),function(){e.removeEventListener("contextmenu",u)}}),[r.current,t]),function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){C(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({ref:r},i)};function W(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return U(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var H=function(){var e=Object(n.useRef)(null),t=W(Object(n.useState)(!1),2),r=t[0],o=t[1],i=function(){return o(!0)},c=function(){return o(!1)};return Object(n.useEffect)((function(){var t=e.current;if(t)return t.addEventListener("mouseover",i),t.addEventListener("mouseleave",c),function(){t.removeEventListener("mouseover",i),t.removeEventListener("mouseleave",c)}}),[e.current]),{isHovered:r,ref:e,setIsHovered:o}};function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){Y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return F(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var B=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(n.useState)(e),r=$(t,2),o=r[0],i=r[1],c=function(e){i(e instanceof Function?function(t){return N(N({},t),e(t))}:function(t){return N(N({},t),e)})};return[o,c]};function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return V(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function G(e){return function(e){if(Array.isArray(e))return J(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){Z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){re(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ne(e){return function(e){if(Array.isArray(e))return oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ie(e){return function(e){if(Array.isArray(e))return ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ce(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach((function(t){fe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var be={actions:{add:function(e,t){var r=e.prevState,n=Q({},r.byId),o=G(r.orderedIds);return n[t.id]=t,o.push(t.id),Q(Q({},r),{},{byId:n,orderedIds:o})},focus:function(e,t){var r=e.prevState,n=ne(r.orderedIds).sort((function(e,r){return e===t?1:r===t?-1:0}));return te(te({},r),{},{orderedIds:n})},remove:function(e,t){var r=e.prevState,n=ae({},r.byId),o=ie(r.orderedIds).filter((function(e){return e!==t}));return delete n[t],ae(ae({},r),{},{byId:n,orderedIds:o})},update:function(e,t){var r=e.prevState,n=le({},r.byId),o=n[t.id];return n[t.id]=le(le({},o),t),le(le({},r),{},{byId:n})}},name:"windows",state:{byId:{},orderedIds:[]}},ye=new(r(4).Store)({name:"DEV_TOOLS",types:{windows:be}});window.store=ye;var de=ye;function Oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(r),!0).forEach((function(t){he(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function he(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ge=0,me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.contextMenu,n=void 0===r?{}:r,o=e.events,i=void 0===o?{}:o;return ve(ve({id:ge+=1,isOpaque:!0,type:t.toUpperCase().replace(/\s+/g,"_"),title:"",component:function(){return null},position:{x:24,y:24},size:{width:300,height:200}},e),{},{contextMenu:ve({items:[],width:100},n),events:ve({onMove:function(){}},i)})},we=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=me(e,t);de.dispatch("windows.add",r)},je={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1"},Pe={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",550:"#898989",600:"#757575",700:"#616161",750:"#424242",800:"#323232",900:"#212121"},Se={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},xe={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c"},Ee="#ffffff",De={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17"},ze={ellipsis:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},Ae={none:{WebkitUserSelect:"none",MozUserSelect:"none",MsUserSelect:"none",userSelect:"none"},text:{WebkitUserSelect:"text",MozUserSelect:"text",MsUserSelect:"text",userSelect:"text"}};function Re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(r),!0).forEach((function(t){Ie(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Me={view:ke(ke({cursor:"pointer",padding:"3px 8px",fontSize:"13px",fontWeight:"700",color:Ee},Ae.none),ze.ellipsis),stripe:function(e){return e%2!=0&&{backgroundColor:Pe[800]}},hovered:function(e){return e&&{backgroundColor:je[800]}}};function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){Te(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Te(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Le=function(e){var t=e.closeWindow,r=e.configs,n=e.createWindow,i=e.index,c=e.label,u=e.style,a=H(),f=a.isHovered,s=a.ref;return o.a.createElement(I,{style:_e(_e(_e(_e({},Me.view),u),Me.stripe(i)),Me.hovered(f)),onClick:function(){t(),n(r,c)},ref:s},c)};Le.defaultProps={closeWindow:function(){},configs:{},createWindow:function(){},index:0,label:"",style:{}};var We=Le,Ue={height:"100%",width:"100%",overflowY:"auto"};function He(){return(He=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach((function(t){Ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $e=function(e){var t=e.closeWindow,r=e.createWindow,n=e.style,i=e.tools;return o.a.createElement(R,{style:Ne(Ne({},Ue),n)},i.map((function(e,n){return o.a.createElement(We,He({key:"ITEM_".concat(n),closeWindow:t,createWindow:r,index:n},e))})))};$e.defaultProps={closeWindow:function(){},createWindow:function(){},style:{},tools:[]};var Fe=$e;function Be(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ve=function(e){var t,r,o=e.tools;return t="keyup",r=function(e){var t=e.target.tagName.toUpperCase();"INPUT"!==t&&"TEXTAREA"!==t&&84===e.keyCode&&we({type:"TOOL_BROWSER",component:function(e){return Fe(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(r),!0).forEach((function(t){qe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({tools:o},e))},position:{x:24,y:window.innerHeight-184},size:{width:140,height:160}})},Object(n.useEffect)((function(){return window.addEventListener(t,r),function(){return window.removeEventListener(t,r)}}),[t,r]),null};Ve.defaultProps={tools:[]};var Ge=Ve,Je=function(e){return function(t,r){var o=q(Object(n.useState)(void 0===r?t(e):r),2),i=o[0],c=o[1];return Object(n.useEffect)((function(){var r=!1,n=e.subscribe((function(e){setTimeout((function(){return!r&&c(t(e))}),0)}));return function(){r=!0,n.unsubscribe()}}),[]),i}}(de),Ke=r(1),Qe=r.n(Ke);function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach((function(t){tt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rt=function(e){var t={x:e.position.x,y:e.position.y<0?0:e.position.y};return et(et({},e),{},{position:t})},nt=function(e){var t=window.innerHeight-25,r={x:e.position.x,y:e.position.y>t?t:e.position.y};return et(et({},e),{},{position:r})},ot=function(e){var t=-(e.size.width-25),r={x:e.position.x<t?t:e.position.x,y:e.position.y};return et(et({},e),{},{position:r})},it=function(e){var t=window.innerWidth-25,r={x:e.position.x>t?t:e.position.x,y:e.position.y};return et(et({},e),{},{position:r})},ct=function(e){var t=e.elem,r=e.event,n=e.id,o=e.shouldDispatch,i=void 0!==o&&o,c=de.getState("windows").byId[n];if(c){var u=function(e){var t=e.elem,r=e.event,n=e.window,o=t.getBoundingClientRect(),i=o.top,c=o.left;return Qe()({position:{x:c+r.movementX,y:i+r.movementY},size:n.size}).flow(rt).flow(nt).flow(ot).flow(it).close().position}({elem:t,event:r,window:c});t.style.transform="translate(".concat(u.x,"px, ").concat(u.y,"px)"),c.events.onMove(r),i&&de.dispatch("windows.update",{id:n,position:u})}r.stopPropagation(),r.preventDefault()};function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){ft(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ft(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var st=function(e){var t={x:e.position.x,y:e.position.y<0?0:e.position.y};return at(at({},e),{},{position:t})},lt=function(e){var t=window.innerHeight-25,r={x:e.position.x,y:e.position.y>t?t:e.position.y};return at(at({},e),{},{position:r})},pt=function(e){var t=-(e.size.width-25),r={x:e.position.x<t?t:e.position.x,y:e.position.y};return at(at({},e),{},{position:r})},bt=function(e){var t=window.innerWidth-25,r={x:e.position.x>t?t:e.position.x,y:e.position.y};return at(at({},e),{},{position:r})},yt=function(e){var t=e.dimensions,r=e.elem,n=e.id,o=e.shouldDispatch,i=void 0!==o&&o;if(de.getState("windows").byId[n]){var c=function(e,t){return t?{position:{x:e.left,y:e.top},size:{height:e.height,width:e.width}}:Qe()({position:{x:e.left,y:e.top},size:{height:e.height,width:e.width}}).flow(st).flow(lt).flow(pt).flow(bt).close()}(t,i),u=c.position,a=c.size;r.style.transform="translate(".concat(u.x,"px, ").concat(u.y,"px)"),r.style.height="".concat(a.height,"px"),r.style.width="".concat(a.width,"px"),i&&de.dispatch("windows.update",{id:n,position:u,size:a})}};function dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ot(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ot(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vt=function(e){var t=dt(de.getState("windows").orderedIds.slice(-2,-1),1)[0];de.dispatch("windows.remove",e),de.dispatch("windows.focus",t)},ht={view:{flex:1,position:"relative",borderRight:"1px solid ".concat(Pe[700]),borderBottom:"1px solid ".concat(Pe[700]),borderLeft:"1px solid ".concat(Pe[700]),borderRadius:"0px 0px 6px 6px",backgroundColor:Pe[900],overflow:"hidden"}};function gt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(r),!0).forEach((function(t){wt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jt=Object(n.memo)((function(e){var t=e.id,r=e.style,n=de.getState("windows").byId[t].component;return o.a.createElement(R,{style:mt(mt({},ht.view),r)},o.a.createElement(n,{closeWindow:function(){return vt(t)},createWindow:we}))}));jt.defaultProps={id:null,style:{}};var Pt=jt;function St(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?St(Object(r),!0).forEach((function(t){Et(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Et(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Dt={view:xt(xt({color:Ee,fontSize:"14px",lineHeight:"24px",fontWeight:600,cursor:"pointer",textAlign:"left",padding:"0px 12px"},Ae.none),ze.ellipsis),hovered:function(e){return e&&{backgroundColor:je[800]}}};function zt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(r),!0).forEach((function(t){Rt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Rt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var kt=function(e){var t=e.contextMenuEvent,r=e.label,n=e.onClick,i=e.style,c=H(),u=c.isHovered,a=c.ref;return o.a.createElement(I,{style:At(At(At({},Dt.view),i),Dt.hovered(u)),onClick:function(e){n(e,t)},ref:a},r)};kt.defaultProps={contextMenuEvent:null,label:"",onClick:function(){},style:{}};var It=kt,Mt=function(e){var t=e.position,r=t.x,n=t.y,o=e.width;return{position:"absolute",top:"".concat(n,"px"),left:"".concat(r,"px"),width:"".concat(o,"px"),display:"flex",flexDirection:"column",borderRadius:"6px",boxShadow:"rgba(0, 0, 0, 0.19) 0px 10px 15px -3px, 0 4px 6px -2px rgba(0, 0, 0, 0.05)",border:"1px solid ".concat(Pe[600]),backgroundColor:Pe[800],overflow:"hidden",padding:"6px 0px",zIndex:1}};function Ct(){return(Ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function _t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(r),!0).forEach((function(t){Lt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Wt=function(e){var t=e.event,r=e.isOpen,n=e.items,i=e.position,c=e.style,u=e.width;return r&&o.a.createElement(R,{style:Tt(Tt({},Mt({position:i,width:u})),c),onMouseDown:function(e){return e.stopPropagation()}},n.map((function(e,r){return o.a.createElement(It,Ct({key:"CONTEXT_ITEM_".concat(r),contextMenuEvent:t},e))})))};Wt.defaultProps={event:null,isOpen:!1,items:[],position:{x:0,y:0},style:{},width:0};var Ut=Wt,Ht=function(e){return{height:"12px",width:"12px",borderRadius:"50%",backgroundColor:e.primaryColor}};function Xt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xt(Object(r),!0).forEach((function(t){Yt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $t=function(e){var t=e.onClick,r=e.primaryColor,n=e.style;return o.a.createElement(R,{style:Nt(Nt({},Ht({primaryColor:r})),n),onClick:t})};$t.defaultProps={onClick:function(){},primaryColor:"",style:{}};var Ft=$t,Bt={view:{display:"flex"},marginRight:{marginRight:"6px"}};function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){Gt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Jt=function(e){var t=e.isFocused,r=e.onClose,n=e.style;return o.a.createElement(R,{style:Vt(Vt({},Bt.view),n)},o.a.createElement(Ft,{style:Bt.marginRight,primaryColor:t?xe[500]:Pe[550],onClick:r}),o.a.createElement(Ft,{style:Bt.marginRight,primaryColor:t?De[700]:Pe[550]}),o.a.createElement(Ft,{primaryColor:t?Se[500]:Pe[550]}))};Jt.defaultProps={isFocused:!1,onClose:function(){},style:{}};var Kt=Jt;function Qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Zt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(r),!0).forEach((function(t){er(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function er(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tr={view:{display:"flex",justifyContent:"center",alignItems:"center",padding:"0px 6px",backgroundColor:Pe[750],overflow:"hidden",borderTop:"1px solid ".concat(Pe[600]),borderRight:"1px solid ".concat(Pe[600]),borderLeft:"1px solid ".concat(Pe[600]),borderRadius:"6px 6px 0px 0px"},focused:function(e){return e&&{backgroundColor:Pe[800]}},actionButtons:{flex:1,paddingRight:"16px"},title:Zt(Zt({color:Pe[50],fontSize:"13px",fontWeight:700,paddingRight:"16px"},Ae.none),ze.ellipsis),flexSpacer:{flex:1}};function rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rr(Object(r),!0).forEach((function(t){or(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function or(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ir=function(e){var t=e.id,r=e.isFocused,i=e.onMove,c=e.onMoveEnd,u=e.onMoveStart,a=e.style,f=function(e){var t=e.onMove,r=void 0===t?function(){}:t,o=e.onMoveEnd,i=void 0===o?function(){}:o,c=e.onMoveStart,u=void 0===c?function(){}:c,a=Object(n.useRef)(!1).current,f=Object(n.useRef)(null),s=function(e){return a&&r(e)},l=function e(t){a=!1,i(t),window.removeEventListener("mouseup",e),window.removeEventListener("mousemove",s)},p=function(e){a=!0,u(e),window.addEventListener("mouseup",l),window.addEventListener("mousemove",s)};return Object(n.useEffect)((function(){var e=f.current;if(e)return e.addEventListener("mousedown",p),function(){e.removeEventListener("mousedown",p)}}),[f.current]),{ref:f}}({onMove:i,onMoveEnd:c,onMoveStart:u}).ref,s=Je((function(e){return e.getState("windows").byId[t]})),l=s.isOpaque,p=s.title;return o.a.createElement(I,{style:nr(nr(nr({},tr.view),a),tr.focused(r)),onDoubleClick:function(){return store.dispatch("windows.update",{id:t,isOpaque:!l})},ref:f},o.a.createElement(Kt,{style:tr.actionButtons,isFocused:r,onClose:function(){return l&&vt(t)}}),o.a.createElement(A,{style:tr.title},p),o.a.createElement(R,{style:tr.flexSpacer}))};ir.defaultProps={id:null,isFocused:!1,onMove:function(){},onMoveEnd:function(){},onMoveStart:function(){},style:{}};var cr=ir,ur={view:function(e){var t=e.position,r=t.x,n=t.y,o=e.size,i=o.width,c=o.height,u=e.isOpaque;return{position:"absolute",transform:"translate(".concat(r,"px, ").concat(n,"px)"),display:"flex",height:"".concat(c,"px"),width:"".concat(i,"px"),borderRadius:"6px",opacity:u?1:.1,pointerEvents:u?"auto":"none",boxShadow:"rgba(0, 0, 0, 0.19) 0px 10px 15px -3px, 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}},resizable:{display:"flex",flex:1,flexDirection:"column",minWidth:0,minHeight:0},header:{pointerEvents:"auto",minHeight:"24px",height:"24px"}};function ar(){return(ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function fr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fr(Object(r),!0).forEach((function(t){lr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return br(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return br(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function br(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var yr=function(e){var t=e.id,r=e.style,n=Je((function(e){return e.getState("windows").byId[t]})),i=L({isActive:n.contextMenu.items.length>0}),c=i.event,u=i.isOpen,a=i.position,f=i.ref,s=Je((function(e){var r=pr(e.getState("windows").orderedIds.slice(-1),1)[0];return t===r}));return o.a.createElement(I,{style:sr(sr({},ur.view(n)),r),onMouseDown:function(){return!s&&de.dispatch("windows.focus",t)},ref:f},o.a.createElement(j,{style:ur.resizable,minHeight:25,minWidth:95,onResize:function(e){return yt({dimensions:e,elem:f.current,id:t})},onResizeEnd:function(){var e=f.current.getBoundingClientRect(),r=e.top,n=e.left,o=e.width,i=e.height;yt({dimensions:{width:o,height:i,top:r,left:n},elem:f.current,id:t,shouldDispatch:!0})}},o.a.createElement(cr,{style:ur.header,id:t,isFocused:s,onMove:function(e){return ct({elem:f.current,event:e,id:t})},onMoveEnd:function(e){ct({elem:f.current,event:e,id:t,shouldDispatch:!0})}}),o.a.createElement(Pt,{id:t}),o.a.createElement(Ut,ar({event:c,isOpen:u,position:{x:a.x-n.position.x,y:a.y-n.position.y}},n.contextMenu))))};yr.defaultProps={id:null,style:{}};var dr=yr,Or=r(5),vr=r.n(Or);function hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(r),!0).forEach((function(t){mr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function mr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var wr=function(e){var t=e.style,r=Je((function(e){return e.getState("windows").orderedIds}));return o.a.createElement(R,{style:gr(gr({},vr.a.view),t)},r.map((function(e){return o.a.createElement(dr,{key:"WINDOW_".concat(e),id:e})})))};wr.defaultProps={style:{}};var jr=wr,Pr={position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:2147483647,boxSizing:"border-box",verticalAlign:"baseline",lineHeight:"1.5",border:0,margin:0,padding:0,overflow:"hidden",pointerEvents:"none"};function Sr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sr(Object(r),!0).forEach((function(t){Er(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Er(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Dr=function(e){var t=e.style,r=e.tools;return o.a.createElement(R,{style:xr(xr({},Pr),t)},o.a.createElement(Ge,{tools:r}),o.a.createElement(jr,null))};Dr.defaultProps={style:{},tools:[]};var zr=Dr;t.default=zr}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.devOS=t(require("react")):e.devOS=t(e.react)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=6)}([function(t,r){t.exports=e},function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n={error:function(e,t){if(e instanceof Error)return e;try{return t(e)}catch(e){return e instanceof Error?e:Error(e)}},maybe:function(e,t){return null!=e?t(e):null},sync:function(e,t){return e instanceof Promise?e.then((function(e){return t(e)})):t(e)}};t.default=function(e){var t=function(e,t){return t(e)};return function e(r){return{bind:function(o){return t="string"==typeof o?n[o]:o,e(r)},flow:function(n){return e(t(r,n))},close:function(e){return e?e(r):r}}}(e)}}]).default},function(e,t){},function(e,t){},function(e,t,r){window,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=0)}([function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.r(t),r.d(t,"Store",(function(){return v}));var a={isPending:!1,isError:!1,error:null,shouldThrowErrors:!0,shouldTrackAsyncState:!0},f=function(e){return Object.entries(e).reduce((function(e,t){var r=c(t,2),n=r[0],i=r[1],u="function"!=typeof i;return e[n]={configs:u?o({},a,{},i.configs):a,reducer:u?i.reducer:i},e}),{})},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((function(e,t){var r=c(t,2),n=(r[0],r[1]),o=n.actions,i=void 0===o?{}:o,u=n.name,a=n.state,s=void 0===a?null:a;return e[u]={actions:f(i),state:s},e}),{})};function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function O(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var v=function(){function e(t){var r=t.name,n=void 0===r?"":r,o=t.services,i=void 0===o?{}:o,c=t.types;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastUid=0,this.name=n,this.services=i,this.subscribers={},this.types=s(c),this._typeConfigs=c}var t,r;return t=e,(r=[{key:"dispatch",value:function(e,t){var r=y(this._tokenizeAction(e),2),n=r[0],o=r[1],i=this.types[n],c=i.actions[o];return this._setState({typeName:n})(c.reducer({prevState:i.state,services:this.services},t)),this.types[n].state}},{key:"dispatchAsync",value:function(e,t){var r=y(this._tokenizeAction(e),2),n=r[0],o=r[1],i=this.types[n],c=i.actions[o],u=c.configs.shouldTrackAsyncState,a=this._setConfigs({actionName:o,typeName:n}),f=this._setState({typeName:n});return u&&a({isPending:!0,isError:!1,error:null}),Promise.resolve(c.reducer({prevState:i.state,services:this.services},t)).then((function(e){return u&&a({isPending:!1},!1),f(e),e})).catch((function(e){return u&&a({isPending:!1,isError:!0,error:e}),u?c.configs.shouldThrowErrors&&Promise.reject(e):Promise.reject(e)}))}},{key:"getError",value:function(e){var t=y(this._tokenizeAction(e),2),r=t[0],n=t[1];return this.types[r].actions[n].configs.error}},{key:"getState",value:function(e){return e?this.types[e].state:Object.entries(this.types).reduce((function(e,t){var r=y(t,2),n=r[0],o=r[1].state;return e[n]=o,e}),{})}},{key:"isError",value:function(e){var t=y(this._tokenizeAction(e),2),r=t[0],n=t[1];return this.types[r].actions[n].configs.isError}},{key:"isPending",value:function(e){var t=y(this._tokenizeAction(e),2),r=t[0],n=t[1];return this.types[r].actions[n].configs.isPending}},{key:"subscribe",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},r="uid_".concat(++this.lastUid);return this.subscribers[r]=t,t(this),{onNotify:t,token:r,unsubscribe:function(){return e._unsubscribe(r)}}}},{key:"_notify",value:function(){var e=this;Object.values(this.subscribers).forEach((function(t){return t(e)}))}},{key:"reset",value:function(){this.lastUid=0,this.subscribers={},this.types=s(this._typeConfigs)}},{key:"_setConfigs",value:function(e){var t=this,r=e.actionName,n=e.typeName;return function(e){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t.types[n].actions[r].configs;return t.types[n].actions[r].configs=p({},i,{},e),o&&t._notify()}}},{key:"_setState",value:function(e){var t=this,r=e.typeName;return function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.types[r].state=e,n&&t._notify()}}},{key:"_tokenizeAction",value:function(e){var t=y(e.split("."),1)[0];return[t,e.slice(t.length+1)]}},{key:"_unsubscribe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;delete this.subscribers[e]}}])&&O(t.prototype,r),e}()}])},function(e,t){},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),i=function(e){return{height:"5px",width:"5px",cursor:e}};function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f=function(e){var t=e.cursor,r=e.onResize,c=e.onResizeEnd,a=e.onResizeStart,f=e.style,s=Object(n.useRef)(!1).current,l=function e(t){document.body.style.cursor="auto",document.body.style.userSelect="",window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",e),s&&(s=!1,c(t))},p=function(e){s&&(e.stopImmediatePropagation(),r(e))};return o.a.createElement(R,{style:u(u({},i(t)),f),draggable:!1,onMouseDown:function(e){document.body.style.cursor=t,document.body.style.userSelect="none",s=!0,a(e),window.addEventListener("mousemove",p),window.addEventListener("mouseup",l)}})};f.defaultProps={cursor:"nwse-resize",onResize:function(){},onResizeEnd:function(){},onResizeStart:function(){},style:{}};var s=f,l={top:{position:"absolute",top:"-2px",left:"0px",width:"100%"},left:{position:"absolute",top:"0px",left:"-2px",height:"100%"},right:{position:"absolute",top:"0px",right:"-2px",height:"100%"},bottom:{position:"absolute",bottom:"-2px",left:"0px",width:"100%"},topLeft:{position:"absolute",top:"-2px",left:"-2px",height:"10px",width:"10px"},topRight:{position:"absolute",top:"-2px",right:"-2px",height:"10px",width:"10px"},bottomLeft:{position:"absolute",bottom:"-2px",left:"-2px",height:"10px",width:"10px"},bottomRight:{position:"absolute",bottom:"-2px",right:"-2px",height:"10px",width:"10px"}},p=function(e){var t=e.onResize,r=e.onResizeEnd,i=e.onResizeStart;return o.a.createElement(n.Fragment,null,o.a.createElement(s,{style:l.top,cursor:"ns-resize",onResize:function(e){return t(e,"top")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.left,cursor:"ew-resize",onResize:function(e){return t(e,"left")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.right,cursor:"ew-resize",onResize:function(e){return t(e,"right")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.bottom,cursor:"ns-resize",onResize:function(e){return t(e,"bottom")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.topLeft,cursor:"nwse-resize",onResize:function(e){return t(e,"topLeft")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.topRight,cursor:"nesw-resize",onResize:function(e){return t(e,"topRight")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.bottomLeft,cursor:"nesw-resize",onResize:function(e){return t(e,"bottomLeft")},onResizeEnd:r,onResizeStart:i}),o.a.createElement(s,{style:l.bottomRight,cursor:"nwse-resize",onResize:function(e){return t(e,"bottomRight")},onResizeEnd:r,onResizeStart:i}))};p.defaultProps={onResize:function(){},onResizeEnd:function(){},onResiseStart:function(){}};var b=p,y={bottom:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.height+r.movementY;return{width:t.width,height:o>n.height?o:t.height,top:t.top,left:t.left}},bottomLeft:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width-r.movementX,i=t.height+r.movementY;return{width:o>n.width?o:t.width,height:i>n.height?i:t.height,top:t.top,left:o>n.width?t.left+r.movementX:t.left}},bottomRight:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width+r.movementX,i=t.height+r.movementY;return{width:o>n.width?o:t.width,height:i>n.height?i:t.height,top:t.top,left:t.left}},left:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width-r.movementX;return{width:o>n.width?o:t.width,height:t.height,top:t.top,left:o>n.width?t.left+r.movementX:t.left}},right:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width+r.movementX;return{width:o>n.width?o:t.width,height:t.height,top:t.top,left:t.left}},top:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.height-r.movementY;return{width:t.width,height:o>n.height?o:t.height,top:o>n.height?t.top+r.movementY:t.top,left:t.left}},topLeft:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width-r.movementX,i=t.height-r.movementY;return{width:o>n.width?o:t.width,height:i>n.height?i:t.height,top:i>n.height?t.top+r.movementY:t.top,left:o>n.width?t.left+r.movementX:t.left}},topRight:function(e){var t=e.elem,r=e.event,n=e.minSize,o=t.width+r.movementX,i=t.height-r.movementY;return{width:o>n.width?o:t.width,height:i>n.height?i:t.height,top:i>n.height?t.top+r.movementY:t.top,left:t.left}}},d=function(e){var t=e.elem,r=e.event,n=e.handleType,o=e.minSize;return y[n]({elem:t.getBoundingClientRect(),event:r,minSize:o})},O=r(2),v=r.n(O);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var w=function(e){var t=e.children,r=e.isActive,i=e.minHeight,c=e.minWidth,u=e.onResize,a=e.onResizeEnd,f=e.onResizeStart,s=e.style,l=Object(n.useRef)(null);return o.a.createElement(I,{style:g(g({},v.a.view),s),ref:l},t,r&&o.a.createElement(b,{onResize:function(e,t){return u(d({elem:l.current,event:e,handleType:t,minSize:{height:i,width:c}}))},onResizeEnd:a,onResizeStart:f}))};w.defaultProps={children:null,isActive:!0,minHeight:1,minWidth:1,onResize:function(){},onResizeEnd:function(){},onResizeStart:function(){},style:{}};var j=w,P=r(3),S=r.n(P);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){D(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var z=function(e){return o.a.createElement("div",{style:E(E({},S.a.container),e.style),title:e.title},e.children)};z.defaultProps={children:null,title:null};var A=z,R=function(e){return o.a.createElement("div",e)};function k(){return(k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var I=o.a.forwardRef((function(e,t){return o.a.createElement("div",k({},e,{ref:t}))}));function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var L=function(e){var t=e.isActive,r=Object(n.useRef)(null),o=_(B({event:null,isOpen:!1,position:{x:0,y:0}}),2),i=o[0],c=o[1],u=function(e){t&&!i.isOpen&&(c({event:e,isOpen:!0,position:{x:e.clientX,y:e.clientY}}),e.preventDefault(),e.stopPropagation())},a=function(){return c({isOpen:!1})},f=function(){return a()},s=function(){return a()};return Object(n.useEffect)((function(){return window.addEventListener("mousedown",s),window.addEventListener("click",f),function(){window.removeEventListener("mousedown",s),window.removeEventListener("click",f)}}),[i.isOpen]),Object(n.useEffect)((function(){var e=r.current;if(e)return e.addEventListener("contextmenu",u),function(){e.removeEventListener("contextmenu",u)}}),[r.current,t]),function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){C(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({ref:r},i)};function W(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return U(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var H=function(){var e=Object(n.useRef)(null),t=W(Object(n.useState)(!1),2),r=t[0],o=t[1],i=function(){return o(!0)},c=function(){return o(!1)};return Object(n.useEffect)((function(){var t=e.current;if(t)return t.addEventListener("mouseover",i),t.addEventListener("mouseleave",c),function(){t.removeEventListener("mouseover",i),t.removeEventListener("mouseleave",c)}}),[e.current]),{isHovered:r,ref:e,setIsHovered:o}};function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){Y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return F(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var B=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(n.useState)(e),r=$(t,2),o=r[0],i=r[1],c=function(e){i(e instanceof Function?function(t){return N(N({},t),e(t))}:function(t){return N(N({},t),e)})};return[o,c]};function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return V(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function G(e){return function(e){if(Array.isArray(e))return J(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){Z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){re(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ne(e){return function(e){if(Array.isArray(e))return oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ie(e){return function(e){if(Array.isArray(e))return ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ce(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach((function(t){fe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var be={actions:{add:function(e,t){var r=e.prevState,n=Q({},r.byId),o=G(r.orderedIds);return n[t.id]=t,o.push(t.id),Q(Q({},r),{},{byId:n,orderedIds:o})},focus:function(e,t){var r=e.prevState,n=ne(r.orderedIds).sort((function(e,r){return e===t?1:r===t?-1:0}));return te(te({},r),{},{orderedIds:n})},remove:function(e,t){var r=e.prevState,n=ae({},r.byId),o=ie(r.orderedIds).filter((function(e){return e!==t}));return delete n[t],ae(ae({},r),{},{byId:n,orderedIds:o})},update:function(e,t){var r=e.prevState,n=le({},r.byId),o=n[t.id];return n[t.id]=le(le({},o),t),le(le({},r),{},{byId:n})}},name:"windows",state:{byId:{},orderedIds:[]}},ye=new(r(4).Store)({name:"DEV_TOOLS",types:{windows:be}});window.store=ye;var de=ye;function Oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(r),!0).forEach((function(t){he(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function he(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ge=0,me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.contextMenu,n=void 0===r?{}:r,o=e.events,i=void 0===o?{}:o;return ve(ve({id:ge+=1,isOpaque:!0,type:t.toUpperCase().replace(/\s+/g,"_"),title:"",component:function(){return null},position:{x:24,y:24},size:{width:300,height:200}},e),{},{contextMenu:ve({items:[],width:100},n),events:ve({onMove:function(){}},i)})},we=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=me(e,t);de.dispatch("windows.add",r)},je={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1"},Pe={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",550:"#898989",600:"#757575",700:"#616161",750:"#424242",800:"#323232",900:"#212121"},Se={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},xe={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c"},Ee="#ffffff",De={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17"},ze={ellipsis:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},Ae={none:{WebkitUserSelect:"none",MozUserSelect:"none",MsUserSelect:"none",userSelect:"none"},text:{WebkitUserSelect:"text",MozUserSelect:"text",MsUserSelect:"text",userSelect:"text"}};function Re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(r),!0).forEach((function(t){Ie(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Me={view:ke(ke({cursor:"pointer",padding:"3px 8px",fontSize:"13px",fontWeight:"700",color:Ee},Ae.none),ze.ellipsis),stripe:function(e){return e%2!=0&&{backgroundColor:Pe[800]}},hovered:function(e){return e&&{backgroundColor:je[800]}}};function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){Te(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Te(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Le=function(e){var t=e.closeWindow,r=e.configs,n=e.createWindow,i=e.index,c=e.label,u=e.style,a=H(),f=a.isHovered,s=a.ref;return o.a.createElement(I,{style:_e(_e(_e(_e({},Me.view),u),Me.stripe(i)),Me.hovered(f)),onClick:function(){t(),n(r,c)},ref:s},c)};Le.defaultProps={closeWindow:function(){},configs:{},createWindow:function(){},index:0,label:"",style:{}};var We=Le,Ue={height:"100%",width:"100%",overflowY:"auto"};function He(){return(He=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach((function(t){Ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $e=function(e){var t=e.closeWindow,r=e.createWindow,n=e.style,i=e.tools;return o.a.createElement(R,{style:Ne(Ne({},Ue),n)},i.map((function(e,n){return o.a.createElement(We,He({key:"ITEM_".concat(n),closeWindow:t,createWindow:r,index:n},e))})))};$e.defaultProps={closeWindow:function(){},createWindow:function(){},style:{},tools:[]};var Fe=$e;function Be(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ve=function(e){var t,r,o=e.tools;return t="keyup",r=function(e){var t=e.target.tagName.toUpperCase();"INPUT"!==t&&"TEXTAREA"!==t&&84===e.keyCode&&we({type:"TOOL_BROWSER",component:function(e){return Fe(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(r),!0).forEach((function(t){qe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({tools:o},e))},position:{x:24,y:window.innerHeight-184},size:{width:140,height:160}})},Object(n.useEffect)((function(){return window.addEventListener(t,r),function(){return window.removeEventListener(t,r)}}),[t,r]),null};Ve.defaultProps={tools:[]};var Ge=Ve,Je=function(e){return function(t,r){var o=q(Object(n.useState)(void 0===r?t(e):r),2),i=o[0],c=o[1];return Object(n.useEffect)((function(){var r=!1,n=e.subscribe((function(e){setTimeout((function(){return!r&&c(t(e))}),0)}));return function(){r=!0,n.unsubscribe()}}),[]),i}}(de),Ke=r(1),Qe=r.n(Ke);function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach((function(t){tt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rt=function(e){var t={x:e.position.x,y:e.position.y<0?0:e.position.y};return et(et({},e),{},{position:t})},nt=function(e){var t=window.innerHeight-25,r={x:e.position.x,y:e.position.y>t?t:e.position.y};return et(et({},e),{},{position:r})},ot=function(e){var t=-(e.size.width-25),r={x:e.position.x<t?t:e.position.x,y:e.position.y};return et(et({},e),{},{position:r})},it=function(e){var t=window.innerWidth-25,r={x:e.position.x>t?t:e.position.x,y:e.position.y};return et(et({},e),{},{position:r})},ct=function(e){var t=e.elem,r=e.event,n=e.id,o=e.shouldDispatch,i=void 0!==o&&o,c=de.getState("windows").byId[n];if(c){var u=function(e){var t=e.elem,r=e.event,n=e.window,o=t.getBoundingClientRect(),i=o.top,c=o.left;return Qe()({position:{x:c+r.movementX,y:i+r.movementY},size:n.size}).flow(rt).flow(nt).flow(ot).flow(it).close().position}({elem:t,event:r,window:c});t.style.transform="translate(".concat(u.x,"px, ").concat(u.y,"px)"),c.events.onMove(r),i&&de.dispatch("windows.update",{id:n,position:u})}r.stopPropagation(),r.preventDefault()};function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){ft(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ft(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var st=function(e){var t={x:e.position.x,y:e.position.y<0?0:e.position.y};return at(at({},e),{},{position:t})},lt=function(e){var t=window.innerHeight-25,r={x:e.position.x,y:e.position.y>t?t:e.position.y};return at(at({},e),{},{position:r})},pt=function(e){var t=-(e.size.width-25),r={x:e.position.x<t?t:e.position.x,y:e.position.y};return at(at({},e),{},{position:r})},bt=function(e){var t=window.innerWidth-25,r={x:e.position.x>t?t:e.position.x,y:e.position.y};return at(at({},e),{},{position:r})},yt=function(e){var t=e.dimensions,r=e.elem,n=e.id,o=e.shouldDispatch,i=void 0!==o&&o;if(de.getState("windows").byId[n]){var c=function(e,t){return t?{position:{x:e.left,y:e.top},size:{height:e.height,width:e.width}}:Qe()({position:{x:e.left,y:e.top},size:{height:e.height,width:e.width}}).flow(st).flow(lt).flow(pt).flow(bt).close()}(t,i),u=c.position,a=c.size;r.style.transform="translate(".concat(u.x,"px, ").concat(u.y,"px)"),r.style.height="".concat(a.height,"px"),r.style.width="".concat(a.width,"px"),i&&de.dispatch("windows.update",{id:n,position:u,size:a})}};function dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ot(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ot(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vt=function(e){var t=dt(de.getState("windows").orderedIds.slice(-2,-1),1)[0];de.dispatch("windows.remove",e),de.dispatch("windows.focus",t)},ht={view:{flex:1,position:"relative",borderRight:"1px solid ".concat(Pe[700]),borderBottom:"1px solid ".concat(Pe[700]),borderLeft:"1px solid ".concat(Pe[700]),borderRadius:"0px 0px 6px 6px",backgroundColor:Pe[900],overflow:"hidden"}};function gt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(r),!0).forEach((function(t){wt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jt=Object(n.memo)((function(e){var t=e.elemRef,r=e.id,n=e.style,i=de.getState("windows").byId[r].component;return o.a.createElement(I,{style:mt(mt({},ht.view),n),ref:t},o.a.createElement(i,{closeWindow:function(){return vt(r)},createWindow:we}))}));jt.defaultProps={elemRef:null,id:null,style:{}};var Pt=jt;function St(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?St(Object(r),!0).forEach((function(t){Et(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Et(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Dt={view:xt(xt({color:Ee,fontSize:"14px",lineHeight:"24px",fontWeight:600,cursor:"pointer",textAlign:"left",padding:"0px 12px"},Ae.none),ze.ellipsis),hovered:function(e){return e&&{backgroundColor:je[800]}}};function zt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(r),!0).forEach((function(t){Rt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Rt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var kt=function(e){var t=e.contextMenuEvent,r=e.label,n=e.onClick,i=e.style,c=H(),u=c.isHovered,a=c.ref;return o.a.createElement(I,{style:At(At(At({},Dt.view),i),Dt.hovered(u)),onClick:function(e){n(e,t)},ref:a},r)};kt.defaultProps={contextMenuEvent:null,label:"",onClick:function(){},style:{}};var It=kt,Mt=function(e){var t=e.position,r=t.x,n=t.y,o=e.width;return{position:"absolute",top:"".concat(n,"px"),left:"".concat(r,"px"),width:"".concat(o,"px"),display:"flex",flexDirection:"column",borderRadius:"6px",boxShadow:"rgba(0, 0, 0, 0.19) 0px 10px 15px -3px, 0 4px 6px -2px rgba(0, 0, 0, 0.05)",border:"1px solid ".concat(Pe[600]),backgroundColor:Pe[800],overflow:"hidden",padding:"6px 0px",zIndex:1}};function Ct(){return(Ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function _t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(r),!0).forEach((function(t){Lt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Wt=function(e){var t=e.event,r=e.isOpen,n=e.items,i=e.position,c=e.style,u=e.width;return r&&o.a.createElement(R,{style:Tt(Tt({},Mt({position:i,width:u})),c),onMouseDown:function(e){return e.stopPropagation()}},n.map((function(e,r){return o.a.createElement(It,Ct({key:"CONTEXT_ITEM_".concat(r),contextMenuEvent:t},e))})))};Wt.defaultProps={event:null,isOpen:!1,items:[],position:{x:0,y:0},style:{},width:0};var Ut=Wt,Ht=function(e){return{height:"12px",width:"12px",borderRadius:"50%",backgroundColor:e.primaryColor}};function Xt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xt(Object(r),!0).forEach((function(t){Yt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $t=function(e){var t=e.onClick,r=e.primaryColor,n=e.style;return o.a.createElement(R,{style:Nt(Nt({},Ht({primaryColor:r})),n),onClick:t})};$t.defaultProps={onClick:function(){},primaryColor:"",style:{}};var Ft=$t,Bt={view:{display:"flex"},marginRight:{marginRight:"6px"}};function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){Gt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Jt=function(e){var t=e.isFocused,r=e.onClose,n=e.style;return o.a.createElement(R,{style:Vt(Vt({},Bt.view),n)},o.a.createElement(Ft,{style:Bt.marginRight,primaryColor:t?xe[500]:Pe[550],onClick:r}),o.a.createElement(Ft,{style:Bt.marginRight,primaryColor:t?De[700]:Pe[550]}),o.a.createElement(Ft,{primaryColor:t?Se[500]:Pe[550]}))};Jt.defaultProps={isFocused:!1,onClose:function(){},style:{}};var Kt=Jt;function Qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Zt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(r),!0).forEach((function(t){er(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function er(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tr={view:{display:"flex",justifyContent:"center",alignItems:"center",padding:"0px 6px",backgroundColor:Pe[750],overflow:"hidden",borderTop:"1px solid ".concat(Pe[600]),borderRight:"1px solid ".concat(Pe[600]),borderLeft:"1px solid ".concat(Pe[600]),borderRadius:"6px 6px 0px 0px"},focused:function(e){return e&&{backgroundColor:Pe[800]}},actionButtons:{flex:1,paddingRight:"16px"},title:Zt(Zt({color:Pe[50],fontSize:"13px",fontWeight:700,paddingRight:"16px"},Ae.none),ze.ellipsis),flexSpacer:{flex:1}};function rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rr(Object(r),!0).forEach((function(t){or(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function or(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ir=function(e){var t=e.id,r=e.isFocused,i=e.onMove,c=e.onMoveEnd,u=e.onMoveStart,a=e.style,f=function(e){var t=e.onMove,r=void 0===t?function(){}:t,o=e.onMoveEnd,i=void 0===o?function(){}:o,c=e.onMoveStart,u=void 0===c?function(){}:c,a=Object(n.useRef)(!1).current,f=Object(n.useRef)(null),s=function(e){return a&&r(e)},l=function e(t){a=!1,i(t),window.removeEventListener("mouseup",e),window.removeEventListener("mousemove",s)},p=function(e){a=!0,u(e),window.addEventListener("mouseup",l),window.addEventListener("mousemove",s)};return Object(n.useEffect)((function(){var e=f.current;if(e)return e.addEventListener("mousedown",p),function(){e.removeEventListener("mousedown",p)}}),[f.current]),{ref:f}}({onMove:i,onMoveEnd:c,onMoveStart:u}).ref,s=Je((function(e){return e.getState("windows").byId[t]})),l=s.isOpaque,p=s.title;return o.a.createElement(I,{style:nr(nr(nr({},tr.view),a),tr.focused(r)),onDoubleClick:function(){return store.dispatch("windows.update",{id:t,isOpaque:!l})},ref:f},o.a.createElement(Kt,{style:tr.actionButtons,isFocused:r,onClose:function(){return l&&vt(t)}}),o.a.createElement(A,{style:tr.title},p),o.a.createElement(R,{style:tr.flexSpacer}))};ir.defaultProps={id:null,isFocused:!1,onMove:function(){},onMoveEnd:function(){},onMoveStart:function(){},style:{}};var cr=ir,ur={view:function(e){var t=e.position,r=t.x,n=t.y,o=e.size,i=o.width,c=o.height,u=e.isOpaque;return{position:"absolute",transform:"translate(".concat(r,"px, ").concat(n,"px)"),display:"flex",height:"".concat(c,"px"),width:"".concat(i,"px"),borderRadius:"6px",opacity:u?1:.1,pointerEvents:u?"auto":"none",boxShadow:"rgba(0, 0, 0, 0.19) 0px 10px 15px -3px, 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}},resizable:{display:"flex",flex:1,flexDirection:"column",minWidth:0,minHeight:0},header:{pointerEvents:"auto",minHeight:"24px",height:"24px"}};function ar(){return(ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function fr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fr(Object(r),!0).forEach((function(t){lr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(n=(c=u.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return br(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return br(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function br(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var yr=function(e){var t=e.id,r=e.style,i=Object(n.useRef)(null),c=Je((function(e){return e.getState("windows").byId[t]})),u=L({isActive:c.contextMenu.items.length>0}),a=u.event,f=u.isOpen,s=u.position,l=u.ref,p=Je((function(e){var r=pr(e.getState("windows").orderedIds.slice(-1),1)[0];return t===r}));return o.a.createElement(I,{style:sr(sr({},ur.view(c)),r),onMouseDown:function(){return!p&&de.dispatch("windows.focus",t)},ref:l},o.a.createElement(j,{style:ur.resizable,minHeight:25,minWidth:95,onResize:function(e){return yt({dimensions:e,elem:l.current,id:t})},onResizeEnd:function(){var e=l.current.getBoundingClientRect(),r=e.top,n=e.left,o=e.width,c=e.height;yt({dimensions:{width:o,height:c,top:r,left:n},elem:l.current,id:t,shouldDispatch:!0}),i.current.style.pointerEvents=""},onResizeStart:function(){return i.current.style.pointerEvents="none"}},o.a.createElement(cr,{style:ur.header,id:t,isFocused:p,onMove:function(e){return ct({elem:l.current,event:e,id:t})},onMoveEnd:function(e){ct({elem:l.current,event:e,id:t,shouldDispatch:!0}),i.current.style.pointerEvents=""},onMoveStart:function(){return i.current.style.pointerEvents="none"}}),o.a.createElement(Pt,{id:t,elemRef:i}),o.a.createElement(Ut,ar({event:a,isOpen:f,position:{x:s.x-c.position.x,y:s.y-c.position.y}},c.contextMenu))))};yr.defaultProps={id:null,style:{}};var dr=yr,Or=r(5),vr=r.n(Or);function hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(r),!0).forEach((function(t){mr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function mr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var wr=function(e){var t=e.style,r=Je((function(e){return e.getState("windows").orderedIds}));return o.a.createElement(R,{style:gr(gr({},vr.a.view),t)},r.map((function(e){return o.a.createElement(dr,{key:"WINDOW_".concat(e),id:e})})))};wr.defaultProps={style:{}};var jr=wr,Pr={position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:2147483647,boxSizing:"border-box",verticalAlign:"baseline",lineHeight:"1.5",border:0,margin:0,padding:0,overflow:"hidden",pointerEvents:"none"};function Sr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sr(Object(r),!0).forEach((function(t){Er(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Er(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Dr=function(e){var t=e.style,r=e.tools;return o.a.createElement(R,{style:xr(xr({},Pr),t)},o.a.createElement(Ge,{tools:r}),o.a.createElement(jr,null))};Dr.defaultProps={style:{},tools:[]};var zr=Dr;t.default=zr}])}));
{
"name": "react-dev-os",
"author": "Scotty Rogers",
"version": "0.0.16",
"version": "0.0.17",
"description": "An interactive development environment for react apps.",

@@ -6,0 +6,0 @@ "license": "ISC",

import React, { memo } from "react";
import { View } from "@library/ui";
import { ViewRef } from "@library/ui";
import closeWindow from "@procedures/windows/close";

@@ -8,3 +8,3 @@ import createWindow from "@procedures/windows/create";

const Content = memo(({ id, style }) => {
const Content = memo(({ elemRef, id, style }) => {
const Component = store.getState("windows").byId[id].component;

@@ -14,5 +14,5 @@ const handleClose = () => closeWindow(id);

return (
<View style={{ ...styles.view, ...style }}>
<ViewRef style={{ ...styles.view, ...style }} ref={elemRef}>
<Component closeWindow={handleClose} createWindow={createWindow} />
</View>
</ViewRef>
);

@@ -22,2 +22,3 @@ });

Content.defaultProps = {
elemRef: null,
id: null,

@@ -24,0 +25,0 @@ style: {},

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

import React, { useState } from "react";
import React, { useRef } from "react";
import { Resizable, ViewRef } from "@library/ui";

@@ -14,2 +14,3 @@ import { useContextMenu } from "@library/hooks";

const Window = ({ id, style }) => {
const contentElem = useRef(null);
const state = useStore((store) => store.getState("windows").byId[id]);

@@ -28,10 +29,14 @@ const { event: contextMenuEvent, isOpen: isMenuOpen, position: menuPosition, ref } = useContextMenu({

const handleMove = (event) => moveWindow({ elem: ref.current, event, id });
const handleMoveStart = () => (contentElem.current.style.pointerEvents = "none");
const handleMoveEnd = (event) => {
moveWindow({ elem: ref.current, event, id, shouldDispatch: true });
contentElem.current.style.pointerEvents = "";
};
const handleResize = (dimensions) => resizeWindow({ dimensions, elem: ref.current, id });
const handleResizeStart = () => (contentElem.current.style.pointerEvents = "none");
const handleResizeEnd = () => {
const { top, left, width, height } = ref.current.getBoundingClientRect();
resizeWindow({ dimensions: { width, height, top, left }, elem: ref.current, id, shouldDispatch: true });
contentElem.current.style.pointerEvents = "";
};

@@ -41,5 +46,19 @@

<ViewRef style={{ ...styles.view(state), ...style }} onMouseDown={handleMouseDown} ref={ref}>
<Resizable style={styles.resizable} minHeight={25} minWidth={95} onResize={handleResize} onResizeEnd={handleResizeEnd}>
<Header style={styles.header} id={id} isFocused={isFocused} onMove={handleMove} onMoveEnd={handleMoveEnd} />
<Content id={id} />
<Resizable
style={styles.resizable}
minHeight={25}
minWidth={95}
onResize={handleResize}
onResizeEnd={handleResizeEnd}
onResizeStart={handleResizeStart}
>
<Header
style={styles.header}
id={id}
isFocused={isFocused}
onMove={handleMove}
onMoveEnd={handleMoveEnd}
onMoveStart={handleMoveStart}
/>
<Content id={id} elemRef={contentElem} />
<ContextMenu

@@ -46,0 +65,0 @@ event={contextMenuEvent}

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