(()=>{var e={72888:(e,t,n)=>{"use strict";var r=n(33112),o=r(n(60326)),a=r(n(37731));e.exports=function(e,t){t.addEventListener("message",(function(){var n=(0,a.default)(o.default.mark((function n(r){var a,i,u,c,f,s,_;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=r.data.request){n.next=3;break}return n.abrupt("return");case 3:if(i=a.id,u=a.path,c=a.args,n.prev=4,"function"!=typeof(f=u.reduce((function(e,t){return e[t]}),e))){n.next=13;break}return _=u.slice(0,u.length-1).reduce((function(e,t){return e[t]}),e),n.next=10,f.apply(_,c);case 10:s=n.sent,n.next=16;break;case 13:return n.next=15,f;case 15:s=n.sent;case 16:t.postMessage({response:{id:i,result:{data:s}}}),n.next=22;break;case 19:n.prev=19,n.t0=n.catch(4),t.postMessage({response:{id:i,result:{error:n.t0}}});case 22:case"end":return n.stop()}}),n,null,[[4,19]])})));return function(e){return n.apply(this,arguments)}})()),this.call=(function(){var e=(0,a.default)(o.default.mark((function e(n,r){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Math.random().toString(32).slice(2),e.abrupt("return",new Promise((function(e,o){t.addEventListener("message",(function n(r){var i=r.data.response;i&&i.id===a&&(t.removeEventListener("message",n),"error"in i.result?o(i.result.error):e(i.result.data))})),t.postMessage({request:{id:a,path:n,args:r}})})));case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}})()}},67001:(e,t,n)=>{"use strict";var r=n(33112);Object.defineProperty(t,"__esModule",{value:!0}),t.analytics=function(e,t){o.analytics(E(e),E(t))},t.decode_stream=function(e){return m(o.decode_stream(E(e)))},t.default=void 0,t.dispatch=function(e,t,n){o.dispatch(E(e),E(t),E(n))},t.get_state=function(e){return m(o.get_state(E(e)))},t.initialize_runtime=function(e){return m(o.initialize_runtime(E(e)))},t.start=function(){o.start()};var o,a=r(n(60326)),i=r(n(37731)),u=r(n(77900)),c={url:new URL("/stremio_core_web.js",document.baseURI).href},f=new Array(32).fill(void 0);function s(e){return f[e]}f.push(void 0,null,!0,!1);var _=0,l=null;function b(){return null!==l&&l.buffer===o.memory.buffer||(l=new Uint8Array(o.memory.buffer)),l}var g=new TextEncoder("utf-8"),d="function"==typeof g.encodeInto?function(e,t){return g.encodeInto(e,t)}:function(e,t){var n=g.encode(e);return t.set(n),{read:e.length,written:n.length}};function w(e,t,n){if(void 0===n){var r=g.encode(e),o=t(r.length);return b().subarray(o,o+r.length).set(r),_=r.length,o}for(var a=e.length,i=t(a),u=b(),c=0;c127)break;u[i+c]=f}if(c!==a){0!==c&&(e=e.slice(c)),i=n(i,a,a=c+3*e.length);var s=b().subarray(i+c,i+a);c+=d(e,s).written}return _=c,i}function p(e){return null==e}var h=null;function y(){return null!==h&&h.buffer===o.memory.buffer||(h=new Int32Array(o.memory.buffer)),h}var v=f.length;function m(e){var t=s(e);return(function(e){e<36||(f[e]=v,v=e)})(e),t}var x=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});function S(e,t){return x.decode(b().subarray(e,e+t))}function E(e){v===f.length&&f.push(f.length+1);var t=v;return v=f[t],f[t]=e,t}function k(e){var t=(0,u.default)(e);if("number"==t||"boolean"==t||null==e)return"".concat(e);if("string"==t)return'"'.concat(e,'"');if("symbol"==t){var n=e.description;return null==n?"Symbol":"Symbol(".concat(n,")")}if("function"==t){var r=e.name;return"string"==typeof r&&r.length>0?"Function(".concat(r,")"):"Function"}if(Array.isArray(e)){var o=e.length,a="[";o>0&&(a+=k(e[0]));for(var i=1;i1))return toString.call(e);if("Object"==(c=f[1]))try{return"Object("+JSON.stringify(e)+")"}catch(e){return"Object"}return e instanceof Error?"".concat(e.name,": ").concat(e.message,"\n").concat(e.stack):c}function L(e,t,n,r){var a={a:e,b:t,cnt:1,dtor:n},i=function(){a.cnt++;var e=a.a;a.a=0;try{for(var t=arguments.length,n=new Array(t),i=0;i>>0,n>>>0))},r.wbg.__wbg_new_a7ce447f15ff496f=function(e){return E(new Uint8Array(s(e)))},r.wbg.__wbg_set_969ad0a60e51d320=function(e,t,n){s(e).set(s(t),n>>>0)},r.wbg.__wbg_newwithlength_929232475839a482=function(e){return E(new Uint8Array(e>>>0))},r.wbg.__wbg_subarray_8b658422a224f479=function(e,t,n){return E(s(e).subarray(t>>>0,n>>>0))},r.wbg.__wbg_set_82a4e8a85e31ac42=function(){return R((function(e,t,n){return Reflect.set(s(e),s(t),s(n))}),arguments)},r.wbg.__wbg_parse_ccb2cd4fe8ead0cb=function(){return R((function(e,t){return E(JSON.parse(S(e,t)))}),arguments)},r.wbg.__wbg_stringify_d4507a59932eed0c=function(){return R((function(e){return E(JSON.stringify(s(e)))}),arguments)},r.wbg.__wbindgen_debug_string=function(e,t){var n=w(k(s(t)),o.__wbindgen_malloc,o.__wbindgen_realloc),r=_;y()[e/4+1]=r,y()[e/4+0]=n},r.wbg.__wbindgen_throw=function(e,t){throw new Error(S(e,t))},r.wbg.__wbindgen_memory=function(){return E(o.memory)},r.wbg.__wbindgen_closure_wrapper5769=function(e,t,n){return E(L(e,t,531,O))},r.wbg.__wbindgen_closure_wrapper7528=function(e,t,n){return E(L(e,t,900,j))},("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t)),e.t0=T,e.next=78,t;case 78:return e.t1=e.sent,e.t2=r,e.next=82,(0,e.t0)(e.t1,e.t2);case 82:return i=e.sent,f=i.instance,l=i.module,o=f.exports,P.__wbindgen_wasm_module=l,o.__wbindgen_start(),e.abrupt("return",o);case 89:case"end":return e.stop()}}),e)}))),M.apply(this,arguments)}x.decode();t.default=P},43139:(e,t,n)=>{"use strict";e.exports=n.p+"binaries/stremio_core_web_bg.wasm"},37731:e=>{function t(e,t,n,r,o,a,i){try{var u=e[a](i),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,a){var i=e.apply(n,r);function u(e){t(i,o,a,u,c,"next",e)}function c(e){t(i,o,a,u,c,"throw",e)}u(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},33112:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},90867:(e,t,n)=>{var r=n(77900).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,i=a.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},f=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",_=c.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function b(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),i=new P(r||[]);return u(a,"_invoke",{value:R(e,n,i)}),a}function g(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=b;var d="suspendedStart",w="suspendedYield",p="executing",h="completed",y={};function v(){}function m(){}function x(){}var S={};l(S,f,(function(){return this}));var E=Object.getPrototypeOf,k=E&&E(E(M([])));k&&k!==a&&i.call(k,f)&&(S=k);var L=x.prototype=v.prototype=Object.create(S);function O(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(o,a,u,c){var f=g(e[o],e,a);if("throw"!==f.type){var s=f.arg,_=s.value;return _&&"object"==r(_)&&i.call(_,"__await")?t.resolve(_.__await).then((function(e){n("next",e,u,c)}),(function(e){n("throw",e,u,c)})):t.resolve(_).then((function(e){s.value=e,u(s)}),(function(e){return n("throw",e,u,c)}))}c(f.arg)}var o;u(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(a,a):a()}})}function R(e,n,r){var o=d;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(r.method=a,r.arg=i;;){var u=r.delegate;if(u){var c=A(u,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var f=g(e,n,r);if("normal"===f.type){if(o=r.done?h:w,f.arg===y)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(o=h,r.method="throw",r.arg=f.arg)}}}function A(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,A(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=g(o,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function M(e){if(e||""===e){var n=e[f];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),f=i.call(a,"finallyLoc");if(c&&f){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},77900:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},60326:(e,t,n)=>{var r=n(90867)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.g=(function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}})(),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e+"../"})(),(()=>{"use strict";var e=n(33112),t=e(n(60326)),r=e(n(37731)),o=new(n(72888))(self,self);self.init=(function(){var e=(0,r.default)(t.default.mark((function e(a){var i,u,c,f,s,_,l,b,g,d;return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.appVersion,u=a.shellVersion,self.document={baseURI:self.location.href},self.app_version=i,self.shell_version=u,self.get_location_hash=(0,r.default)(t.default.mark((function e(){return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.call(["location","hash"],[]));case 1:case"end":return e.stop()}}),e)}))),self.local_storage_get_item=(function(){var e=(0,r.default)(t.default.mark((function e(n){return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.call(["localStorage","getItem"],[n]));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}})(),self.local_storage_set_item=(function(){var e=(0,r.default)(t.default.mark((function e(n,r){return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.call(["localStorage","setItem"],[n,r]));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}})(),self.local_storage_remove_item=(function(){var e=(0,r.default)(t.default.mark((function e(n){return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.call(["localStorage","removeItem"],[n]));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}})(),c=n(67001),f=c.default,s=c.initialize_runtime,_=c.get_state,l=c.get_debug_state,b=c.dispatch,g=c.analytics,d=c.decode_stream,self.getState=_,self.getDebugState=l,self.dispatch=b,self.analytics=g,self.decodeStream=d,e.next=16,f(n(43139));case 16:return e.next=18,s((function(e){return o.call(["onCoreEvent"],[e])}));case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}})()})()})(); //# sourceMappingURL=worker.js.map