/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./node_modules/htm/dist/htm.js":
/*!**************************************!*\
  !*** ./node_modules/htm/dist/htm.js ***!
  \**************************************/
/***/ ((module) => {

!function(){var n=function(t,e,s,u){var r;e[0]=0;for(var h=1;h<e.length;h++){var p=e[h++],a=e[h]?(e[0]|=p?1:2,s[e[h++]]):e[++h];3===p?u[0]=a:4===p?u[1]=Object.assign(u[1]||{},a):5===p?(u[1]=u[1]||{})[e[++h]]=a:6===p?u[1][e[++h]]+=a+"":p?(r=t.apply(a,n(t,a,s,["",null])),u.push(r),a[0]?e[0]|=2:(e[h-2]=0,e[h]=r)):u.push(a)}return u},t=new Map,e=function(e){var s=t.get(this);return s||(s=new Map,t.set(this,s)),(s=n(this,s.get(e)||(s.set(e,s=function(n){for(var t,e,s=1,u="",r="",h=[0],p=function(n){1===s&&(n||(u=u.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?h.push(0,n,u):3===s&&(n||u)?(h.push(3,n,u),s=2):2===s&&"..."===u&&n?h.push(4,n,0):2===s&&u&&!n?h.push(5,0,!0,u):s>=5&&((u||!n&&5===s)&&(h.push(s,0,u,e),s=6),n&&(h.push(s,n,0,e),s=6)),u=""},a=0;a<n.length;a++){a&&(1===s&&p(),p(a));for(var o=0;o<n[a].length;o++)t=n[a][o],1===s?"<"===t?(p(),h=[h],s=3):u+=t:4===s?"--"===u&&">"===t?(s=1,u=""):u=t+u[0]:r?t===r?r="":u+=t:'"'===t||"'"===t?r=t:">"===t?(p(),s=1):s&&("="===t?(s=5,e=u,u=""):"/"===t&&(s<5||">"===n[a][o+1])?(p(),3===s&&(h=h[0]),s=h,(h=h[0]).push(2,0,s),s=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(p(),s=2):u+=t),3===s&&"!--"===u&&(s=4,h=h[0])}return p(),h}(e)),s),arguments,[])).length>1?s:s[0]}; true?module.exports=e:0}();


/***/ }),

/***/ "./node_modules/preact/dist/preact.js":
/*!********************************************!*\
  !*** ./node_modules/preact/dist/preact.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, exports) => {

var n,l,u,t,i,o,r,f,e,c={},s=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,a=Array.isArray;function v(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function y(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d(l,f,i,o,null)}function d(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function _(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?x(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function g(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!m.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(m)}function m(){var n,l,u,t,o,r,e,c;for(i.sort(f);n=i.shift();)n.__d&&(l=i.length,t=void 0,o=void 0,e=(r=(u=n).__v).__e,(c=u.__P)&&(t=[],(o=v({},r)).__v=r.__v+1,j(c,r,o,u.__n,void 0!==c.ownerSVGElement,null!=r.__h?[e]:null,t,null==e?x(r):e,r.__h),z(t,r),r.__e!=e&&b(r)),i.length>l&&i.sort(f));m.__r=0}function w(n,l,u,t,i,o,r,f,e,p){var v,h,y,k,b,g,m,w=t&&t.__k||s,$=w.length;for(u.__k=[],v=0;v<l.length;v++)if(null!=(k=u.__k[v]=null==(k=l[v])||"boolean"==typeof k||"function"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?d(null,k,null,null,k):a(k)?d(_,{children:k},null,null,null):k.__b>0?d(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(y=w[v])||y&&k.key==y.key&&k.type===y.type)w[v]=void 0;else for(h=0;h<$;h++){if((y=w[h])&&k.key==y.key&&k.type===y.type){w[h]=void 0;break}y=null}j(n,k,y=y||c,i,o,r,f,e,p),b=k.__e,(h=k.ref)&&y.ref!=h&&(m||(m=[]),y.ref&&m.push(y.ref,null,k),m.push(h,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===y.__k?k.__d=e=P(k,e,n):e=C(n,k,y,w,b,e),"function"==typeof u.type&&(u.__d=e)):e&&y.__e==e&&e.parentNode!=n&&(e=x(y))}for(u.__e=g,v=$;v--;)null!=w[v]&&("function"==typeof u.type&&null!=w[v].__e&&w[v].__e==u.__d&&(u.__d=S(t).nextSibling),N(w[v],w[v]));if(m)for(v=0;v<m.length;v++)M(m[v],m[++v],m[++v])}function P(n,l,u){for(var t,i=n.__k,o=0;i&&o<i.length;o++)(t=i[o])&&(t.__=n,l="function"==typeof t.type?P(t,l,u):C(u,t,t,i,t.__e,l));return l}function C(n,l,u,t,i,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||i!=o||null==i.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(i),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<t.length;e+=1)if(f==i)break n;n.insertBefore(i,o),r=o}return void 0!==r?r:i.nextSibling}function S(n){var l,u,t;if(null==n.type||"string"==typeof n.type)return n.__e;if(n.__k)for(l=n.__k.length-1;l>=0;l--)if((u=n.__k[l])&&(t=S(u)))return t;return null}function $(n,l,u,t,i){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],t);for(o in l)i&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],t)}function A(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||p.test(l)?u:u+"px"}function H(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||A(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||A(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if("dangerouslySetInnerHTML"!==l){if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u))}}function I(n){return this.l[n.type+!1](l.event?l.event(n):n)}function T(n){return this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,t,i,o,r,f,e,c){var s,p,h,y,d,x,b,g,m,P,C,S,$,A,H,I=u.type;if(void 0!==u.constructor)return null;null!=t.__h&&(c=t.__h,e=u.__e=t.__e,u.__h=null,r=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof I){if(g=u.props,m=(s=I.contextType)&&i[s.__c],P=s?m?m.props.value:s.__:i,t.__c?b=(p=u.__c=t.__c).__=p.__E:("prototype"in I&&I.prototype.render?u.__c=p=new I(g,P):(u.__c=p=new k(g,P),p.constructor=I,p.render=O),m&&m.sub(p),p.props=g,p.state||(p.state={}),p.context=P,p.__n=i,h=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,I.getDerivedStateFromProps(g,p.__s))),y=p.props,d=p.state,p.__v=u,h)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==I.getDerivedStateFromProps&&g!==y&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,P),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,P)||u.__v===t.__v){for(u.__v!==t.__v&&(p.props=g,p.state=p.__s,p.__d=!1),p.__e=!1,u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u)}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&f.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,P),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(y,d,x)})}if(p.context=P,p.props=g,p.__P=n,S=l.__r,$=0,"prototype"in I&&I.prototype.render){for(p.state=p.__s,p.__d=!1,S&&S(u),s=p.render(p.props,p.state,p.context),A=0;A<p._sb.length;A++)p.__h.push(p._sb[A]);p._sb=[]}else do{p.__d=!1,S&&S(u),s=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++$<25);p.state=p.__s,null!=p.getChildContext&&(i=v(v({},i),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(x=p.getSnapshotBeforeUpdate(y,d)),w(n,a(H=null!=s&&s.type===_&&null==s.key?s.props.children:s)?H:[H],u,t,i,o,r,f,e,c),p.base=u.__e,u.__h=null,p.__h.length&&f.push(p),b&&(p.__E=p.__=null),p.__e=!1}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=L(t.__e,u,t,i,o,r,f,c);(s=l.diffed)&&s(u)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,t)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,t,i,o,r,f,e){var s,p,v,y=t.props,d=u.props,_=u.type,k=0;if("svg"===_&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!_&&(_?s.localName===_:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===_)return document.createTextNode(d);l=o?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,d.is&&d),r=null,e=!1}if(null===_)y===d||e&&l.data===d||(l.data=d);else{if(r=r&&n.call(l.childNodes),p=(y=t.props||c).dangerouslySetInnerHTML,v=d.dangerouslySetInnerHTML,!e){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||p)&&(v&&(p&&v.__html==p.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""))}if($(l,d,y,o,e),v)u.__k=[];else if(w(l,a(k=u.props.children)?k:[k],u,t,i,o&&"foreignObject"!==_,r,f,r?r[0]:t.__k&&x(t,0),e),null!=r)for(k=r.length;k--;)null!=r[k]&&h(r[k]);e||("value"in d&&void 0!==(k=d.value)&&(k!==l.value||"progress"===_&&!k||"option"===_&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in d&&void 0!==(k=d.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1))}return l}function M(n,u,t){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,t)}}function N(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||M(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&N(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||h(n.__e),n.__=n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function q(u,t,i){var o,r,f;l.__&&l.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],j(t,u=(!o&&i||t).__k=y(_,null,[u]),r||c,c,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o),z(f,u)}n=s.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&void 0===n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof n&&(n=n(v({},u),this.props)),n&&v(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),g(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),g(this))},k.prototype.render=_,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},m.__r=0,e=0,exports.Component=k,exports.Fragment=_,exports.cloneElement=function(l,u,t){var i,o,r,f,e=v({},l.props);for(r in l.type&&l.type.defaultProps&&(f=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=void 0===u[r]&&void 0!==f?f[r]:u[r];return arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),d(l.type,e,i||l.key,o||l.ref,null)},exports.createContext=function(n,l){var u={__c:l="__cC"+e++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,g(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u},exports.createElement=y,exports.createRef=function(){return{current:null}},exports.h=y,exports.hydrate=function n(l,u){q(l,u,n)},exports.isValidElement=t,exports.options=l,exports.render=q,exports.toChildArray=function n(l,u){return u=u||[],null==l||"boolean"==typeof l||(a(l)?l.some(function(l){n(l,u)}):u.push(l)),u};
//# sourceMappingURL=preact.js.map


/***/ }),

/***/ "./node_modules/preact/hooks/dist/hooks.js":
/*!*************************************************!*\
  !*** ./node_modules/preact/hooks/dist/hooks.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

var n,t,r,u,o=__webpack_require__(/*! preact */ "./node_modules/preact/dist/preact.js"),i=0,f=[],c=[],e=o.options.__b,a=o.options.__r,v=o.options.diffed,s=o.options.__c,l=o.options.unmount;function p(n,r){o.options.__h&&o.options.__h(t,n,i||r),i=0;var u=t.__H||(t.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({__V:c}),u.__[n]}function x(n){return i=1,d(P,n)}function d(r,u,o){var i=p(n++,2);if(i.t=r,!i.__c&&(i.__=[o?o(u):P(void 0,u),function(n){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,n);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=t,!t.u)){var f=function(n,t,r){if(!i.__c.__H)return!0;var u=i.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var o=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(o=!0)}}),!(!o&&i.__c.props===n)&&(!c||c.call(this,n,t,r))};t.u=!0;var c=t.shouldComponentUpdate,e=t.componentWillUpdate;t.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},t.shouldComponentUpdate=f}return i.__N||i.__}function m(r,u){var i=p(n++,4);!o.options.__s&&T(i.__H,u)&&(i.__=r,i.o=u,t.__h.push(i))}function h(t,r){var u=p(n++,7);return T(u.__H,r)?(u.__V=t(),u.o=r,u.__h=t,u.__V):u.__}function y(){for(var n;n=f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(A),n.__H.__h.forEach(F),n.__H.__h=[]}catch(t){n.__H.__h=[],o.options.__e(t,n.__v)}}o.options.__b=function(n){t=null,e&&e(n)},o.options.__r=function(u){a&&a(u),n=0;var o=(t=u.__c).__H;o&&(r===t?(o.__h=[],t.__h=[],o.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.o=void 0})):(o.__h.forEach(A),o.__h.forEach(F),o.__h=[],n=0)),r=t},o.options.diffed=function(n){v&&v(n);var i=n.__c;i&&i.__H&&(i.__H.__h.length&&(1!==f.push(i)&&u===o.options.requestAnimationFrame||((u=o.options.requestAnimationFrame)||q)(y)),i.__H.__.forEach(function(n){n.o&&(n.__H=n.o),n.__V!==c&&(n.__=n.__V),n.o=void 0,n.__V=c})),r=t=null},o.options.__c=function(n,t){t.some(function(n){try{n.__h.forEach(A),n.__h=n.__h.filter(function(n){return!n.__||F(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],o.options.__e(r,n.__v)}}),s&&s(n,t)},o.options.unmount=function(n){l&&l(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{A(n)}catch(n){t=n}}),r.__H=void 0,t&&o.options.__e(t,r.__v))};var _="function"==typeof requestAnimationFrame;function q(n){var t,r=function(){clearTimeout(u),_&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);_&&(t=requestAnimationFrame(r))}function A(n){var r=t,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),t=r}function F(n){var r=t;n.__c=n.__(),t=r}function T(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function P(n,t){return"function"==typeof t?t(n):t}exports.useCallback=function(n,t){return i=8,h(function(){return n},t)},exports.useContext=function(r){var u=t.context[r.__c],o=p(n++,9);return o.c=r,u?(null==o.__&&(o.__=!0,u.sub(t)),u.props.value):r.__},exports.useDebugValue=function(n,t){o.options.useDebugValue&&o.options.useDebugValue(t?t(n):n)},exports.useEffect=function(r,u){var i=p(n++,3);!o.options.__s&&T(i.__H,u)&&(i.__=r,i.o=u,t.__H.__h.push(i))},exports.useErrorBoundary=function(r){var u=p(n++,10),o=x();return u.__=r,t.componentDidCatch||(t.componentDidCatch=function(n,t){u.__&&u.__(n,t),o[1](n)}),[o[0],function(){o[1](void 0)}]},exports.useId=function(){var r=p(n++,11);if(!r.__){for(var u=t.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var o=u.__m||(u.__m=[0,0]);r.__="P"+o[0]+"-"+o[1]++}return r.__},exports.useImperativeHandle=function(n,t,r){i=6,m(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))},exports.useLayoutEffect=m,exports.useMemo=h,exports.useReducer=d,exports.useRef=function(n){return i=5,h(function(){return{current:n}},[])},exports.useState=x;
//# sourceMappingURL=hooks.js.map


/***/ }),

/***/ "./src/tab-manager/preload.keyboard-shortcuts.js":
/*!*******************************************************!*\
  !*** ./src/tab-manager/preload.keyboard-shortcuts.js ***!
  \*******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

/*
   Copyright 2019 Marc Nuri San Felix

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
/* eslint-disable no-undef */
const {ipcRenderer} = __webpack_require__(/*! electron */ "electron");

const eventKey = ({key, shiftKey = false, ctrlKey = false, altKey = false, metaKey = false}) =>
  `${key}-${shiftKey}-${ctrlKey}-${altKey}-${metaKey}`;

const EVENTS = new Map();

EVENTS.set(eventKey({key: 'F5'}), () => ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.reload));
EVENTS.set(eventKey({key: 'R', ctrlKey: true}), () => ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.reload));
EVENTS.set(eventKey({key: 'r', ctrlKey: true}), () => ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.reload));
EVENTS.set(eventKey({key: 'R', metaKey: true}), () => ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.reload));
EVENTS.set(eventKey({key: 'r', metaKey: true}), () => ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.reload));
EVENTS.set(eventKey({key: '+', ctrlKey: true}), () => ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.zoomIn));
EVENTS.set(eventKey({key: '-', ctrlKey: true}), () => ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.zoomOut));
EVENTS.set(eventKey({key: '0', ctrlKey: true}), () => ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.zoomReset));

const initKeyboardShortcuts = () => {
  window.addEventListener('keyup', event => {
    const func = EVENTS.get(eventKey(event));
    if (func) {
      event.preventDefault();
      func();
    }
  });
  window.addEventListener('load', () => {
    document.addEventListener('wheel', event => {
      const ctrlOrCommand = event.ctrlKey || event.metaKey;
      if (ctrlOrCommand && event.deltaY < 0) {
        ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.zoomIn);
      } else if (ctrlOrCommand && event.deltaY > 0) {
        ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.zoomOut);
      }
    });
  });
};

module.exports = {initKeyboardShortcuts};


/***/ }),

/***/ "./src/tab-manager/preload.mediadevices-shim.js":
/*!******************************************************!*\
  !*** ./src/tab-manager/preload.mediadevices-shim.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

/*
   Copyright 2019 Marc Nuri San Felix

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
const {ipcRenderer} = __webpack_require__(/*! electron */ "electron");
const {h, render} = __webpack_require__(/*! preact */ "./node_modules/preact/dist/preact.js");
const {useEffect, useState} = __webpack_require__(/*! preact/hooks */ "./node_modules/preact/hooks/dist/hooks.js");
const htm = __webpack_require__(/*! htm */ "./node_modules/htm/dist/htm.js");
const html = htm.bind(h);

const ROOT_CLASS = 'electron-desktop-capturer-root';
const DEFAULT_SOURCES_OPTIONS = {
  types: ['screen', 'window']
};

const desktopCapturer = {
  // eslint-disable-next-line no-undef
  getSources: opts => ipcRenderer.invoke({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.desktopCapturerGetSources, opts)
};

let currentRoot = null;

const removeRoot = () => {
  const $root = document.querySelector(`.${ROOT_CLASS}`);
  if ($root) {
    render(null, $root, currentRoot);
    $root.remove();
  }
};

const getOrCreateRoot = () => {
  removeRoot();
  const $root = document.createElement('div');
  $root.classList.add(ROOT_CLASS);
  document.body.append($root);
  return $root;
};

const stream = async id => window.navigator.mediaDevices.getUserMedia({
  audio: false,
  video: {
    mandatory: {
      chromeMediaSource: 'desktop',
      chromeMediaSourceId: id
    }
  }
});

const Style = () => html`
  <style>
    .${ROOT_CLASS} {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100vh;
      background: rgba(30,30,30,.75);
      color: #fff;
      z-index: 999999;
    }
    .${ROOT_CLASS} .${ROOT_CLASS}__overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .${ROOT_CLASS} .${ROOT_CLASS}__sources {
      overflow: auto;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      max-height: 100vh;
      padding: 6px;
    }
    .${ROOT_CLASS} .${ROOT_CLASS}__source {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      width: 145px;
      margin: 6px;
      pointer-events: bounding-box;
      cursor: pointer;
      background: rgba(30,30,30,.5);
      padding: 6px;
      border-radius: 3px;
    }
    .${ROOT_CLASS} .${ROOT_CLASS}__source:hover,
    .${ROOT_CLASS} .${ROOT_CLASS}__source:focus {
      background: rgba(255,255,255,.1);
    }
    .${ROOT_CLASS} .${ROOT_CLASS}__thumbnail {
      margin: 0 auto;
      width: 100%;
      height: 81px;
      object-fit: cover;
    }
    .${ROOT_CLASS} .${ROOT_CLASS}__name {
      margin-top: 3px;
      text-align: center;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      user-select: none;
    }
  </style>
`;

// eslint-disable-next-line no-unused-vars
const Source = ({id, name, thumbnail, _display_id, _appIcon, resolve}) => {
  const selectStream = async event => {
    event.preventDefault();
    event.stopPropagation();
    resolve(await stream(id));
    removeRoot();
  };
  return html`
    <div class="${ROOT_CLASS}__source" onclick=${selectStream}>
      <img class="${ROOT_CLASS}__thumbnail" alt=${id} src=${thumbnail.toDataURL()} />
      <span class="${ROOT_CLASS}__name">${name}</span>
    </div>
  `;
};

const LoadingSources = ({sources}) => sources === null && html`
  <div>Loading sources...</div>
`;

const NoSourcesFound = ({sources}) => sources !== null && sources.length === 0 &&
  html`<div>No sources found</div>`;

const Container = ({resolve, reject}) => {
  const [sources, setSources] = useState(null);
  const updateSourcesFunction = async () => setSources(await desktopCapturer.getSources(DEFAULT_SOURCES_OPTIONS));
  useEffect(() => {
    setTimeout(updateSourcesFunction, sources ? 300 : 0);
  }, [sources]);
  const cancel = () => {
    reject(new Error('Screen share aborted by user'));
    removeRoot();
  };
  return html`
    <${Style}/>
    <div class="${ROOT_CLASS}__overlay" onclick=${cancel}>
      <div class="${ROOT_CLASS}__sources" >
        <${NoSourcesFound} sources=${sources}/>
        <${LoadingSources} sources=${sources}/>
        ${sources !== null && sources.map(source => (html`
          <${Source} resolve=${resolve} ...${source} />
        `))}
      </div>
    </div>
  `;
};

const getDisplayMedia = async (resolve, reject) => {
  currentRoot = render(html`<${Container} resolve=${resolve} reject=${reject}/>`, getOrCreateRoot());
};

// Some web applications break the mediaDevices capability
if (window.navigator.mediaDevices) {
  window.navigator.mediaDevices.getDisplayMedia = () => new Promise(getDisplayMedia);
}


/***/ }),

/***/ "./src/tab-manager/preload.notification-shim.js":
/*!******************************************************!*\
  !*** ./src/tab-manager/preload.notification-shim.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

/*
   Copyright 2019 Marc Nuri San Felix

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
/* eslint-disable no-global-assign,no-native-reassign,no-undef */

// Delegate for Notification API as specified in: https://notifications.spec.whatwg.org/

const {ipcRenderer} = __webpack_require__(/*! electron */ "electron");

const NativeNotification = Notification;

const bubbleNotification = () => ipcRenderer.send({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.notificationClick, {tabId: window.tabId});

const canNotify = () => ipcRenderer.sendSync({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.canNotify, window.tabId);

const setDelegateMinimumBehavior = delegate => {
  delegate.onclick = bubbleNotification;
};

// noinspection JSValidateTypes
Notification = function() {
  if (canNotify()) {
    const delegate = new NativeNotification(...arguments);
    setDelegateMinimumBehavior(delegate);
    return {
      get actions() {
        return delegate.actions;
      },
      get badge() {
        return delegate.badge;
      },
      get body() {
        return delegate.body;
      },
      get data() {
        return delegate.data;
      },
      get dir() {
        return delegate.dir;
      },
      get lang() {
        return delegate.lang;
      },
      get tag() {
        return delegate.tag;
      },
      get icon() {
        return delegate.icon;
      },
      get image() {
        return delegate.image;
      },
      get renotify() {
        return delegate.renotify;
      },
      get requireInteraction() {
        return delegate.requireInteraction;
      },
      get silent() {
        return delegate.silent;
      },
      get timestamp() {
        return delegate.timestamp;
      },
      get title() {
        return delegate.title;
      },
      get vibrate() {
        return delegate.vibrate;
      },
      get onclick() {
        return delegate.onclick;
      },
      set onclick(func) {
        delegate.onclick = event => {
          bubbleNotification();
          func(event);
        };
      },
      get onclose() {
        return delegate.onclose;
      },
      set onclose(func) {
        delegate.onclose = func;
      },
      get onerror() {
        return delegate.onerror;
      },
      set onerror(func) {
        delegate.onerror = func;
      },
      get onshow() {
        return delegate.onshow;
      },
      set onshow(func) {
        delegate.onshow = func;
      },
      get close() {
        return delegate.close;
      }
    };
  }
  return {};
};

Notification.maxActions = NativeNotification.maxActions;
Notification.permission = NativeNotification.permission;
Notification.requestPermission = NativeNotification.requestPermission;


/***/ }),

/***/ "./src/tab-manager/preload.spell-check.js":
/*!************************************************!*\
  !*** ./src/tab-manager/preload.spell-check.js ***!
  \************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

/*
   Copyright 2019 Marc Nuri San Felix

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
/* eslint-disable no-undef */
const {ipcRenderer, webFrame} = __webpack_require__(/*! electron */ "electron");

const spellCheckFunction = async (words, callback) => {
  // eslint-disable-next-line no-undef
  const misspelled = await ipcRenderer.invoke({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.dictionaryGetMisspelled, words);
  callback(misspelled);
};

const initSpellChecker = () => new Promise(resolve => {
  ipcRenderer.invoke({"aboutOpenDialog":"aboutOpenDialog","activateTab":"activateTab","activateTabInContainer":"activateTabInContainer","addTabs":"addTabs","appMenuOpen":"appMenuOpen","appMenuClose":"appMenuClose","canNotify":"canNotify","closeDialog":"closeDialog","desktopCapturerGetSources":"desktopCapturerGetSources","dictionaryGetAvailable":"dictionaryGetAvailable","dictionaryGetAvailableNative":"dictionaryGetAvailableNative","dictionaryGetEnabled":"dictionaryGetEnabled","dictionaryGetMisspelled":"dictionaryGetMisspelled","electronimNewVersionAvailable":"electronimNewVersionAvailable","fullscreenToggle":"fullscreenToggle","helpOpenDialog":"helpOpenDialog","notificationClick":"notificationClick","quit":"quit","reload":"reload","restore":"restore","settingsLoad":"settingsLoad","settingsOpenDialog":"settingsOpenDialog","settingsSave":"settingsSave","setTabFavicon":"setTabFavicon","setTabTitle":"setTabTitle","tabsReady":"tabsReady","tabReorder":"tabReorder","tabSwitchToPosition":"tabSwitchToPosition","tabTraverseNext":"tabTraverseNext","tabTraversePrevious":"tabTraversePrevious","trayInit":"trayInit","zoomIn":"zoomIn","zoomOut":"zoomOut","zoomReset":"zoomReset"}.settingsLoad)
    .then(settings => {
      if (!settings.useNativeSpellChecker) {
        webFrame.setSpellCheckProvider(navigator.language, {spellCheck: spellCheckFunction});
      }
      resolve();
    })
    .catch(initSpellChecker);
});

module.exports = {initSpellChecker};


/***/ }),

/***/ "electron":
/*!***************************!*\
  !*** external "electron" ***!
  \***************************/
/***/ ((module) => {

"use strict";
module.exports = require("electron");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
/*!************************************!*\
  !*** ./src/tab-manager/preload.js ***!
  \************************************/
/*
   Copyright 2019 Marc Nuri San Felix

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
__webpack_require__(/*! ./preload.notification-shim */ "./src/tab-manager/preload.notification-shim.js");
__webpack_require__(/*! ./preload.mediadevices-shim */ "./src/tab-manager/preload.mediadevices-shim.js");
(__webpack_require__(/*! ./preload.keyboard-shortcuts */ "./src/tab-manager/preload.keyboard-shortcuts.js").initKeyboardShortcuts)();
(__webpack_require__(/*! ./preload.spell-check */ "./src/tab-manager/preload.spell-check.js").initSpellChecker)()
  // eslint-disable-next-line no-console
  .catch(err => console.error('Error initializing spell check', err));


})();

/******/ })()
;