{"version":3,"names":["System","register","_export","_context","__SystemJSRewritingHack","postMessage","message","Promise","resolve","reject","channel","MessageChannel","port1","onmessage","navigator","serviceWorker","controller","port2","setters","execute","_recorder_","_src_client_messaging_js","Object","defineProperty","get","set","thisIsVererySecretVariableName","enumerable","configurable","window","addEventListener","error","console","log"],"sources":["messaging.js"],"sourcesContent":["\"use strict\";\n\nwindow.addEventListener('error', function(error) {\n    console.log(\"Error:\",  error);\n});\n\n/**\n * Send a message to the ServiceWorker and waits for an answer\n * @param message\n * @returns {Promise} A Promise resolving with the answer from the ServiceWorker\n */\nexport function postMessage (message) {\n    // TODO: what about rejecting the Promise onerror\n    return new Promise(function(resolve, reject) {\n        var channel = new MessageChannel();\n        channel.port1.onmessage = resolve;\n\n        navigator.serviceWorker.controller.postMessage(message, [channel.port2])\n    });\n}\n"],"mappings":"AAAA,YAAY;;AAACA,MAAA,CAAAC,QAAA,eAAAC,OAAA,EAAAC,QAAA;EAAA;;EAAA,IAAAC,uBAAA;EAMb;AACA;AACA;AACA;AACA;EACO,SAASC,WAAWA,CAAEC,OAAO,EAAE;IAClC;IACA,OAAO,IAAIC,OAAO,CAAC,UAASC,OAAO,EAAEC,MAAM,EAAE;MACzC,IAAIC,OAAO,GAAG,IAAIC,cAAc,CAAC,CAAC;MAClCD,OAAO,CAACE,KAAK,CAACC,SAAS,GAAGL,OAAO;MAEjCM,SAAS,CAACC,aAAa,CAACC,UAAU,CAACX,WAAW,CAACC,OAAO,EAAE,CAACI,OAAO,CAACO,KAAK,CAAC,CAAC;IAC5E,CAAC,CAAC;EACN;EAACf,OAAA,gBAReG,WAAW;EAAA;IAAAa,OAAA;IAAAC,OAAA,WAAAA,CAAA;MAAAf,uBAAA;MAAAgB,UAAA,CAAAC,wBAAA,GAAAD,UAAA,CAAAC,wBAAA;MAAAC,MAAA,CAAAC,cAAA,CAAAH,UAAA,CAAAC,wBAAA;QAAAG,IAAA;UAAA,OAAAnB,WAAA;QAAA;QAAAoB,IAAAC,8BAAA;UAAAxB,OAAA,gBAAXG,WAAA,CAAAA,CAAA,CAAAA,8BAAW;UAAA;QAAA;QAAAsB,UAAA;QAAAC,YAAA;MAAA;MAT3BC,MAAM,CAACC,gBAAgB,CAAC,OAAO,EAAE,UAASC,KAAK,EAAE;QAC7CC,OAAO,CAACC,GAAG,CAAC,QAAQ,EAAGF,KAAK,CAAC;MACjC,CAAC,CAAC;IAAC;EAAA;AAAA"}