!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=98)}({38:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}));class o{constructor(){var e,t,n;n={},(t="listeners")in(e=this)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}addEventListener(e,t){this.listeners[e]=t}removeEventListener(e){this.listeners[e]=void 0}dispatchEvent(e,t){const n={...this.listeners,[e]:void 0};Object.values(n).forEach(e=>e&&e(t))}connectedSources(){return Object.keys(this.listeners)}}const r=()=>{}},40:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}));const o="exchange",r="devtools"},98:function(e,t,n){"use strict";n.r(t);var o=n(40),r=n(38);const s={},i=({tabId:e,port:t,source:n})=>{void 0===s[e]&&(s[e]=new r.a);const o=s[e],i=t.name;Object(r.b)("Connect: ",{tabId:e,portName:i}),o.addEventListener(i,e=>t.postMessage(e)),t.onMessage.addListener(t=>{Object(r.b)("Message: ",{tabId:e,portName:i,message:t}),o.dispatchEvent(i,t)}),t.onDisconnect.addListener(()=>{Object(r.b)("Disconnect: ",{tabId:e,portName:i}),o.removeEventListener(i),o.dispatchEvent(i,{type:"connection-disconnect",source:n})})},c={[o.a]:e=>{var t,n;if(null==e||null===(t=e.sender)||void 0===t||null===(n=t.tab)||void 0===n?void 0:n.id){const t=e.sender.tab.id;i({tabId:t,port:e,source:"exchange"}),chrome.pageAction.setIcon({tabId:t,path:"/assets/icon-32.png"}),e.onDisconnect.addListener(()=>{chrome.pageAction.setIcon({tabId:t,path:"/assets/icon-disabled-32.png"},()=>!0)})}},[o.b]:e=>{const t=n=>{Object(r.b)("Devtools Initial Message: ",{msg:n}),"connection-init"===n.type&&(void 0!==n.tabId?(i({tabId:n.tabId,port:e,source:"devtools"}),s[n.tabId].dispatchEvent("devtools",n),e.onMessage.removeListener(t)):console.error("Recieved devtools panel connection but no tabId was specified."))};e.onMessage.addListener(t)}};chrome.runtime.onConnect.addListener(e=>{const t=c[e.name];return t&&t(e)})}});
//# sourceMappingURL=background.js.map