diff --git a/CHANGES.md b/CHANGES.md index c9ea919..722b51d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ ## CHANGES +v1.7.6 +- Bug Fix: Ensure Flash (via ruffle.js) loading is working (via wabac.js 2.13.11) +- Dependencies: Update wabac.js to 2.13.11, update Ruffle to 2022-11-25 release + v1.7.5 - Library: Readd assets dir to package (needed for archiveweb.page) diff --git a/_data/package.json b/_data/package.json index 7bd81a6..238737e 100644 --- a/_data/package.json +++ b/_data/package.json @@ -1,7 +1,7 @@ { "name": "replaywebpage", "productName": "ReplayWeb.page", - "version": "1.7.5", + "version": "1.7.6", "description": "Serverless Web Archive Replay", "repository": "https://github.com/webrecorder/replayweb.page", "homepage": "https://replayweb.page/", @@ -9,7 +9,7 @@ "license": "AGPL-3.0-or-later", "dependencies": { "@fortawesome/fontawesome-free": "^5.15.4", - "@webrecorder/wabac": "^2.13.10", + "@webrecorder/wabac": "^2.13.11", "auto-js-ipfs": "^1.5.1", "bulma": "^0.9.3", "electron-log": "^4.4.1", diff --git a/embed.html b/embed.html index c6d7c6c..26533ce 100644 --- a/embed.html +++ b/embed.html @@ -9,7 +9,7 @@ body { - + diff --git a/package.json b/package.json index 7bd81a6..238737e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "replaywebpage", "productName": "ReplayWeb.page", - "version": "1.7.5", + "version": "1.7.6", "description": "Serverless Web Archive Replay", "repository": "https://github.com/webrecorder/replayweb.page", "homepage": "https://replayweb.page/", @@ -9,7 +9,7 @@ "license": "AGPL-3.0-or-later", "dependencies": { "@fortawesome/fontawesome-free": "^5.15.4", - "@webrecorder/wabac": "^2.13.10", + "@webrecorder/wabac": "^2.13.11", "auto-js-ipfs": "^1.5.1", "bulma": "^0.9.3", "electron-log": "^4.4.1", diff --git a/ruffle/69052e08f0f291fb6d82.wasm b/ruffle/69052e08f0f291fb6d82.wasm deleted file mode 100644 index 5c8ccec..0000000 Binary files a/ruffle/69052e08f0f291fb6d82.wasm and /dev/null differ diff --git a/ruffle/824f57d600b8c30ee747.wasm b/ruffle/824f57d600b8c30ee747.wasm deleted file mode 100644 index fc1d220..0000000 Binary files a/ruffle/824f57d600b8c30ee747.wasm and /dev/null differ diff --git a/ruffle/core.ruffle.53a2873dad31763672e1.js b/ruffle/core.ruffle.53a2873dad31763672e1.js deleted file mode 100644 index 90138f2..0000000 --- a/ruffle/core.ruffle.53a2873dad31763672e1.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkruffle_selfhosted=self.webpackChunkruffle_selfhosted||[]).push([[966],{762:(n,e,_)=>{function t(n,e,_){e&&n.getChannelData(0).set(e),_&&n.getChannelData(1).set(_)}function r(n){return n.currentTime-n.baseLatency}_.d(e,{K:()=>t,T:()=>r})},966:(n,e,_)=>{_.r(e),_.d(e,{Ruffle:()=>N,default:()=>$});var t=_(762);const r="undefined"!=typeof AudioContext?AudioContext:"undefined"!=typeof webkitAudioContext?webkitAudioContext:void 0;let b;const c=new Array(32).fill(void 0);function o(n){return c[n]}c.push(void 0,null,!0,!1);let f=c.length;function u(n){const e=o(n);return function(n){n<36||(c[n]=f,f=n)}(n),e}function i(n){f===c.length&&c.push(c.length+1);const e=f;return f=c[e],c[e]=n,e}const a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});a.decode();let g=null;function w(){return null!==g&&g.buffer===b.memory.buffer||(g=new Uint8Array(b.memory.buffer)),g}function d(n,e){return a.decode(w().subarray(n,n+e))}let s=0;const l=new TextEncoder("utf-8"),m="function"==typeof l.encodeInto?function(n,e){return l.encodeInto(n,e)}:function(n,e){const _=l.encode(n);return e.set(_),{read:n.length,written:_.length}};function p(n,e,_){if(void 0===_){const _=l.encode(n),t=e(_.length);return w().subarray(t,t+_.length).set(_),s=_.length,t}let t=n.length,r=e(t);const b=w();let c=0;for(;c127)break;b[r+c]=e}if(c!==t){0!==c&&(n=n.slice(c)),r=_(r,t,t=c+3*n.length);const e=w().subarray(r+c,r+t);c+=m(n,e).written}return s=c,r}let y=null;function h(){return null!==y&&y.buffer===b.memory.buffer||(y=new Int32Array(b.memory.buffer)),y}function v(n){return null==n}let x=null;function A(){return null!==x&&x.buffer===b.memory.buffer||(x=new Float64Array(b.memory.buffer)),x}function C(n){const e=typeof n;if("number"==e||"boolean"==e||null==n)return`${n}`;if("string"==e)return`"${n}"`;if("symbol"==e){const e=n.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=n.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){const e=n.length;let _="[";e>0&&(_+=C(n[0]));for(let t=1;t1))return toString.call(n);if(t=_[1],"Object"==t)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:t}function R(n,e,_,t){const r={a:n,b:e,cnt:1,dtor:_},c=(...n)=>{r.cnt++;const e=r.a;r.a=0;try{return t(e,r.b,...n)}finally{0==--r.cnt?b.__wbindgen_export_2.get(r.dtor)(e,r.b):r.a=e}};return c.original=r,c}function S(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function T(n,e){b._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4d1a73f89c33f719(n,e)}function k(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function E(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function F(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function M(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b93465580b7c726(n,e,_)}function O(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function P(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function L(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfd95dd93812f7ed4(n,e,i(_))}function D(n,e){try{return n.apply(this,e)}catch(n){b.__wbindgen_exn_store(i(n))}}let W=32;function I(n){if(1==W)throw new Error("out of js stack");return c[--W]=n,W}let B=null;let j=null;function V(n,e){return(null!==j&&j.buffer===b.memory.buffer||(j=new Float32Array(b.memory.buffer)),j).subarray(n/4,n/4+e)}function U(n,e){return w().subarray(n/1,n/1+e)}function q(n,e){return A().subarray(n/8,n/8+e)}let G=null;function H(n,e){return(null!==G&&G.buffer===b.memory.buffer||(G=new Uint8ClampedArray(b.memory.buffer)),G).subarray(n/1,n/1+e)}class N{static __wrap(n){const e=Object.create(N.prototype);return e.ptr=n,e}__destroy_into_raw(){const n=this.ptr;return this.ptr=0,n}free(){const n=this.__destroy_into_raw();b.__wbg_ruffle_free(n)}constructor(n,e,_){try{return u(b.ruffle_new(i(n),i(e),I(_)))}finally{c[W++]=void 0}}stream_from(n,e){try{const t=b.__wbindgen_add_to_stack_pointer(-16),r=p(n,b.__wbindgen_malloc,b.__wbindgen_realloc),o=s;b.ruffle_stream_from(t,this.ptr,r,o,I(e));var _=h()[t/4+0];if(h()[t/4+1])throw u(_)}finally{b.__wbindgen_add_to_stack_pointer(16),c[W++]=void 0}}load_data(n,e){try{const t=b.__wbindgen_add_to_stack_pointer(-16);b.ruffle_load_data(t,this.ptr,i(n),I(e));var _=h()[t/4+0];if(h()[t/4+1])throw u(_)}finally{b.__wbindgen_add_to_stack_pointer(16),c[W++]=void 0}}play(){b.ruffle_play(this.ptr)}pause(){b.ruffle_pause(this.ptr)}is_playing(){return 0!==b.ruffle_is_playing(this.ptr)}prepare_context_menu(){return u(b.ruffle_prepare_context_menu(this.ptr))}run_context_menu_callback(n){b.ruffle_run_context_menu_callback(this.ptr,n)}set_fullscreen(n){b.ruffle_set_fullscreen(this.ptr,n)}clear_custom_menu_items(){b.ruffle_clear_custom_menu_items(this.ptr)}destroy(){b.ruffle_destroy(this.ptr)}call_exposed_callback(n,e){const _=p(n,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s,r=function(n,e){const _=e(4*n.length),t=(null!==B&&B.buffer===b.memory.buffer||(B=new Uint32Array(b.memory.buffer)),B);for(let e=0;e>>0,a>>>0)},c.wbg.__wbg_createVertexArray_d502151c473563b2=function(n){const e=o(n).createVertexArray();return v(e)?0:i(e)},c.wbg.__wbg_renderbufferStorageMultisample_90aa1df2657b1a0a=function(n,e,_,t,r,b){o(n).renderbufferStorageMultisample(e>>>0,_,t>>>0,r,b)},c.wbg.__wbg_texImage2D_ebd74c4d7f0e6728=function(){return D((function(n,e,_,t,r,b,c,f,u,i,a){o(n).texImage2D(e>>>0,_,t,r,b,c,f>>>0,u>>>0,0===i?void 0:U(i,a))}),arguments)},c.wbg.__wbg_bindFramebuffer_6ef149f7d398d19f=function(n,e,_){o(n).bindFramebuffer(e>>>0,o(_))},c.wbg.__wbg_bindRenderbuffer_1974e9f4fdd0b3af=function(n,e,_){o(n).bindRenderbuffer(e>>>0,o(_))},c.wbg.__wbg_bindTexture_dbddb0b0c3efa1b9=function(n,e,_){o(n).bindTexture(e>>>0,o(_))},c.wbg.__wbg_createFramebuffer_f656a97f24d2caf3=function(n){const e=o(n).createFramebuffer();return v(e)?0:i(e)},c.wbg.__wbg_createRenderbuffer_e66ea157342e02e9=function(n){const e=o(n).createRenderbuffer();return v(e)?0:i(e)},c.wbg.__wbg_createTexture_0df375980a9c46c9=function(n){const e=o(n).createTexture();return v(e)?0:i(e)},c.wbg.__wbg_deleteFramebuffer_609d82d380c88142=function(n,e){o(n).deleteFramebuffer(o(e))},c.wbg.__wbg_deleteRenderbuffer_d12ade31b823658c=function(n,e){o(n).deleteRenderbuffer(o(e))},c.wbg.__wbg_deleteTexture_8c7434cb1b20f64f=function(n,e){o(n).deleteTexture(o(e))},c.wbg.__wbg_framebufferRenderbuffer_d73f3cb3e5a605a2=function(n,e,_,t,r){o(n).framebufferRenderbuffer(e>>>0,_>>>0,t>>>0,o(r))},c.wbg.__wbg_framebufferTexture2D_e07b69d4972eccfd=function(n,e,_,t,r,b){o(n).framebufferTexture2D(e>>>0,_>>>0,t>>>0,o(r),b)},c.wbg.__wbg_getError_cc18cbef4864f62f=function(n){return o(n).getError()},c.wbg.__wbg_getParameter_00a3d89e6e005c2f=function(){return D((function(n,e){return i(o(n).getParameter(e>>>0))}),arguments)},c.wbg.__wbg_texParameteri_7414cf15f83e1d52=function(n,e,_,t){o(n).texParameteri(e>>>0,_>>>0,t)},c.wbg.__wbg_instanceof_Window_0e6c0f1096d66c3c=function(n){return o(n)instanceof Window},c.wbg.__wbg_document_99eddbbc11ec831e=function(n){const e=o(n).document;return v(e)?0:i(e)},c.wbg.__wbg_location_fa9019d2eb2195e8=function(n){return i(o(n).location)},c.wbg.__wbg_devicePixelRatio_cac0b66c0e1e056b=function(n){return o(n).devicePixelRatio},c.wbg.__wbg_localStorage_6e9ba4e9a3771427=function(){return D((function(n){const e=o(n).localStorage;return v(e)?0:i(e)}),arguments)},c.wbg.__wbg_cancelAnimationFrame_7a4ff0365b95acb4=function(){return D((function(n,e){o(n).cancelAnimationFrame(e)}),arguments)},c.wbg.__wbg_focus_086a81eb632614fb=function(){return D((function(n){o(n).focus()}),arguments)},c.wbg.__wbg_open_fd57bd436de42549=function(){return D((function(n,e,_,t,r){const b=o(n).open(d(e,_),d(t,r));return v(b)?0:i(b)}),arguments)},c.wbg.__wbg_requestAnimationFrame_8e3c7028c69ebaef=function(){return D((function(n,e){return o(n).requestAnimationFrame(o(e))}),arguments)},c.wbg.__wbg_fetch_ef7a6623d1fcd3b8=function(n,e){return i(o(n).fetch(o(e)))},c.wbg.__wbg_setProperty_ae9adf5d00216c03=function(){return D((function(n,e,_,t,r){o(n).setProperty(d(e,_),d(t,r))}),arguments)},c.wbg.__wbg_inverse_8af605ed9705f947=function(n){return i(o(n).inverse())},c.wbg.__wbg_protocol_8a7c3a0ad0534fb9=function(){return D((function(n,e){const _=p(o(e).protocol,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_}),arguments)},c.wbg.__wbg_assign_8412f2d177f8543c=function(){return D((function(n,e,_){o(n).assign(d(e,_))}),arguments)},c.wbg.__wbg_get_f2a42b72d9c3121e=function(){return D((function(n,e,_,t){const r=o(e)[d(_,t)];var c=v(r)?0:p(r,b.__wbindgen_malloc,b.__wbindgen_realloc),f=s;h()[n/4+1]=f,h()[n/4+0]=c}),arguments)},c.wbg.__wbg_set_fae17f247c4c8723=function(){return D((function(n,e,_,t,r){o(n)[d(e,_)]=d(t,r)}),arguments)},c.wbg.__wbg_delete_2a53f5694592407e=function(){return D((function(n,e,_){delete o(n)[d(e,_)]}),arguments)},c.wbg.__wbg_length_9132be38635fece5=function(n){return o(n).length},c.wbg.__wbg_offsetX_5888d22032ed9bd8=function(n){return o(n).offsetX},c.wbg.__wbg_offsetY_ca0bdbbd593cafb7=function(n){return o(n).offsetY},c.wbg.__wbg_button_78dae8616402469e=function(n){return o(n).button},c.wbg.__wbg_new_fcc3bfd6f1d02d9b=function(){return D((function(){return i(new Path2D)}),arguments)},c.wbg.__wbg_addPath_3f9b52fe12b3a8f4=function(n,e,_){o(n).addPath(o(e),o(_))},c.wbg.__wbg_closePath_e8740a8a4b33f4a2=function(n){o(n).closePath()},c.wbg.__wbg_lineTo_611f952172f57ea1=function(n,e,_){o(n).lineTo(e,_)},c.wbg.__wbg_moveTo_9b09fc77b253b4ff=function(n,e,_){o(n).moveTo(e,_)},c.wbg.__wbg_quadraticCurveTo_39645457683c039c=function(n,e,_,t,r){o(n).quadraticCurveTo(e,_,t,r)},c.wbg.__wbg_rect_e4248453dba3e49b=function(n,e,_,t,r){o(n).rect(e,_,t,r)},c.wbg.__wbg_connect_7fe7ce5856f531e9=function(){return D((function(n,e){return i(o(n).connect(o(e)))}),arguments)},c.wbg.__wbg_connect_3d91d2d170d6ecd4=function(){return D((function(n,e,_){return i(o(n).connect(o(e),_>>>0))}),arguments)},c.wbg.__wbg_connect_e916aa2972b69a20=function(){return D((function(n,e,_,t){return i(o(n).connect(o(e),_>>>0,t>>>0))}),arguments)},c.wbg.__wbg_disconnect_a00625849153bced=function(){return D((function(n){o(n).disconnect()}),arguments)},c.wbg.__wbg_outputBuffer_e9801f4e66879b0d=function(){return D((function(n){return i(o(n).outputBuffer)}),arguments)},c.wbg.__wbg_bindVertexArrayOES_35d97084dfc5f6f4=function(n,e){o(n).bindVertexArrayOES(o(e))},c.wbg.__wbg_createVertexArrayOES_69c38b2b74e927fa=function(n){const e=o(n).createVertexArrayOES();return v(e)?0:i(e)},c.wbg.__wbg_instanceof_Response_ccfeb62399355bcd=function(n){return o(n)instanceof Response},c.wbg.__wbg_url_06c0f822d68d195c=function(n,e){const _=p(o(e).url,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_ok_1538f4695dab1792=function(n){return o(n).ok},c.wbg.__wbg_statusText_750d3bf8e134b8f8=function(n,e){const _=p(o(e).statusText,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_arrayBuffer_5a99283a3954c850=function(){return D((function(n){return i(o(n).arrayBuffer())}),arguments)},c.wbg.__wbg_deltaY_f78bae9413139a24=function(n){return o(n).deltaY},c.wbg.__wbg_deltaMode_08c2fcea70146506=function(n){return o(n).deltaMode},c.wbg.__wbg_setbuffer_72cfecac4d22725d=function(n,e){o(n).buffer=o(e)},c.wbg.__wbg_setloop_b1a61b62498fa9e4=function(n,e){o(n).loop=0!==e},c.wbg.__wbg_setloopStart_f54e061b1de3b268=function(n,e){o(n).loopStart=e},c.wbg.__wbg_setloopEnd_d6430450275c920c=function(n,e){o(n).loopEnd=e},c.wbg.__wbg_setonended_f22c38d46d048b5e=function(n,e){o(n).onended=o(e)},c.wbg.__wbg_start_4f1790870dabedcf=function(){return D((function(n){o(n).start()}),arguments)},c.wbg.__wbg_start_19389908a04585e5=function(){return D((function(n,e,_){o(n).start(e,_)}),arguments)},c.wbg.__wbg_stop_f4ba0ccf4eeeda42=function(){return D((function(n,e){o(n).stop(e)}),arguments)},c.wbg.__wbg_setTransform_6a58eea25fa31e41=function(n,e){o(n).setTransform(o(e))},c.wbg.__wbg_instanceof_HtmlFormElement_e51c7005ee225f19=function(n){return o(n)instanceof HTMLFormElement},c.wbg.__wbg_submit_da9a1351634ab083=function(){return D((function(n){o(n).submit()}),arguments)},c.wbg.__wbg_now_20d2aadcf3cc17f7=function(n){return o(n).now()},c.wbg.__wbg_pointerId_8b2b0e9ad7c38495=function(n){return o(n).pointerId},c.wbg.__wbg_a_d41d0786eae57b41=function(n){return o(n).a},c.wbg.__wbg_seta_7a0efce1e1267ca4=function(n,e){o(n).a=e},c.wbg.__wbg_b_4662b7a44f9d4a9c=function(n){return o(n).b},c.wbg.__wbg_c_0486825ee52e1586=function(n){return o(n).c},c.wbg.__wbg_d_cbaa259381ebdb12=function(n){return o(n).d},c.wbg.__wbg_setd_7910219e2e519b38=function(n,e){o(n).d=e},c.wbg.__wbg_e_b35a73e0bbfb7f50=function(n){return o(n).e},c.wbg.__wbg_f_ad257c92a791f32b=function(n){return o(n).f},c.wbg.__wbg_new_ca9cc0487e8ea6fd=function(){return D((function(){return i(new DOMMatrix)}),arguments)},c.wbg.__wbg_newwitharray64_78b84021a57a1de8=function(){return D((function(n,e){return i(new DOMMatrix(q(n,e)))}),arguments)},c.wbg.__wbg_currentTarget_327b27bfa936c61f=function(n){const e=o(n).currentTarget;return v(e)?0:i(e)},c.wbg.__wbg_preventDefault_747982fd5fe3b6d0=function(n){o(n).preventDefault()},c.wbg.__wbg_instanceof_HtmlCanvasElement_b94545433bb4d2ef=function(n){return o(n)instanceof HTMLCanvasElement},c.wbg.__wbg_width_20b7a9ebdd5f4232=function(n){return o(n).width},c.wbg.__wbg_setwidth_654d8adcd4979eed=function(n,e){o(n).width=e>>>0},c.wbg.__wbg_height_57f43816c2227a89=function(n){return o(n).height},c.wbg.__wbg_setheight_2b662384bfacb65c=function(n,e){o(n).height=e>>>0},c.wbg.__wbg_getContext_0c19ba5c037e057f=function(){return D((function(n,e,_){const t=o(n).getContext(d(e,_));return v(t)?0:i(t)}),arguments)},c.wbg.__wbg_getContext_d7d734e1c1199dd1=function(){return D((function(n,e,_,t){const r=o(n).getContext(d(e,_),o(t));return v(r)?0:i(r)}),arguments)},c.wbg.__wbg_key_a8ae33ddc6ff786b=function(n,e){const _=p(o(e).key,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_code_a637bfca56413948=function(n,e){const _=p(o(e).code,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_newwithstrandinit_fd99688f189f053e=function(){return D((function(n,e,_){return i(new Request(d(n,e),o(_)))}),arguments)},c.wbg.__wbg_setonaudioprocess_691238df792e5983=function(n,e){o(n).onaudioprocess=o(e)},c.wbg.__wbg_body_2a1ff14b05042a51=function(n){const e=o(n).body;return v(e)?0:i(e)},c.wbg.__wbg_createElement_3c9b5f3aa42457a1=function(){return D((function(n,e,_){return i(o(n).createElement(d(e,_)))}),arguments)},c.wbg.__wbg_createElementNS_a0904ea4c02292f4=function(){return D((function(n,e,_,t,r){return i(o(n).createElementNS(0===e?void 0:d(e,_),d(t,r)))}),arguments)},c.wbg.__wbg_setid_ea9f00ecb5da9dde=function(n,e,_){o(n).id=d(e,_)},c.wbg.__wbg_clientWidth_11f72beceb108bff=function(n){return o(n).clientWidth},c.wbg.__wbg_clientHeight_205d93d6eadff351=function(n){return o(n).clientHeight},c.wbg.__wbg_querySelector_277db48579b05107=function(){return D((function(n,e,_){const t=o(n).querySelector(d(e,_));return v(t)?0:i(t)}),arguments)},c.wbg.__wbg_releasePointerCapture_9ccf528d12801791=function(){return D((function(n,e){o(n).releasePointerCapture(e)}),arguments)},c.wbg.__wbg_setAttribute_8d90e00d652037be=function(){return D((function(n,e,_,t,r){o(n).setAttribute(d(e,_),d(t,r))}),arguments)},c.wbg.__wbg_setAttributeNS_59dc39cb257152af=function(){return D((function(n,e,_,t,r,b,c){o(n).setAttributeNS(0===e?void 0:d(e,_),d(t,r),d(b,c))}),arguments)},c.wbg.__wbg_setPointerCapture_c6fe2a502d7c4f27=function(){return D((function(n,e){o(n).setPointerCapture(e)}),arguments)},c.wbg.__wbg_remove_0bfd44c3622f33b2=function(n){o(n).remove()},c.wbg.__wbg_instanceof_WebGlRenderingContext_b0885da52b151d86=function(n){return o(n)instanceof WebGLRenderingContext},c.wbg.__wbg_drawingBufferWidth_d531da9205a735a4=function(n){return o(n).drawingBufferWidth},c.wbg.__wbg_drawingBufferHeight_6a1b146e4b52493c=function(n){return o(n).drawingBufferHeight},c.wbg.__wbg_bufferData_c4192729016213be=function(n,e,_,t,r){o(n).bufferData(e>>>0,U(_,t),r>>>0)},c.wbg.__wbg_texImage2D_60614361e73b0339=function(){return D((function(n,e,_,t,r,b,c,f,u,i,a){o(n).texImage2D(e>>>0,_,t,r,b,c,f>>>0,u>>>0,0===i?void 0:U(i,a))}),arguments)},c.wbg.__wbg_uniform1fv_e75d6126004bb5f7=function(n,e,_,t){o(n).uniform1fv(o(e),V(_,t))},c.wbg.__wbg_uniform4fv_54aeb419c88f21df=function(n,e,_,t){o(n).uniform4fv(o(e),V(_,t))},c.wbg.__wbg_uniformMatrix3fv_81c8f94bf3a05d08=function(n,e,_,t,r){o(n).uniformMatrix3fv(o(e),0!==_,V(t,r))},c.wbg.__wbg_uniformMatrix4fv_caf5129a09f4f267=function(n,e,_,t,r){o(n).uniformMatrix4fv(o(e),0!==_,V(t,r))},c.wbg.__wbg_activeTexture_1ba5758f0a8358b6=function(n,e){o(n).activeTexture(e>>>0)},c.wbg.__wbg_attachShader_0867104b37cae2d6=function(n,e,_){o(n).attachShader(o(e),o(_))},c.wbg.__wbg_bindBuffer_28e62f648e99e251=function(n,e,_){o(n).bindBuffer(e>>>0,o(_))},c.wbg.__wbg_bindFramebuffer_b7a06305d2823b34=function(n,e,_){o(n).bindFramebuffer(e>>>0,o(_))},c.wbg.__wbg_bindRenderbuffer_0fe389ab46c4d00d=function(n,e,_){o(n).bindRenderbuffer(e>>>0,o(_))},c.wbg.__wbg_bindTexture_27a724e7303eec67=function(n,e,_){o(n).bindTexture(e>>>0,o(_))},c.wbg.__wbg_blendFunc_08a6e279418be6da=function(n,e,_){o(n).blendFunc(e>>>0,_>>>0)},c.wbg.__wbg_clear_786a8deca6672a9d=function(n,e){o(n).clear(e>>>0)},c.wbg.__wbg_clearColor_2c1d714dee770474=function(n,e,_,t,r){o(n).clearColor(e,_,t,r)},c.wbg.__wbg_colorMask_0cfe7588f073be4e=function(n,e,_,t,r){o(n).colorMask(0!==e,0!==_,0!==t,0!==r)},c.wbg.__wbg_compileShader_1b371763cfd802f7=function(n,e){o(n).compileShader(o(e))},c.wbg.__wbg_createBuffer_48c0376fc0746386=function(n){const e=o(n).createBuffer();return v(e)?0:i(e)},c.wbg.__wbg_createProgram_c2675d2cc83435a6=function(n){const e=o(n).createProgram();return v(e)?0:i(e)},c.wbg.__wbg_createShader_8d2a55e7777bbea7=function(n,e){const _=o(n).createShader(e>>>0);return v(_)?0:i(_)},c.wbg.__wbg_createTexture_23de5d8f7988e663=function(n){const e=o(n).createTexture();return v(e)?0:i(e)},c.wbg.__wbg_disable_ada50e27543b1ebd=function(n,e){o(n).disable(e>>>0)},c.wbg.__wbg_disableVertexAttribArray_e1c513cfd55355c9=function(n,e){o(n).disableVertexAttribArray(e>>>0)},c.wbg.__wbg_drawElements_efa6c15e2787a58c=function(n,e,_,t,r){o(n).drawElements(e>>>0,_,t>>>0,r)},c.wbg.__wbg_enable_981a414a11bbed87=function(n,e){o(n).enable(e>>>0)},c.wbg.__wbg_enableVertexAttribArray_1d5f3ff6e7da7095=function(n,e){o(n).enableVertexAttribArray(e>>>0)},c.wbg.__wbg_getAttribLocation_f875dcf14748b9d4=function(n,e,_,t){return o(n).getAttribLocation(o(e),d(_,t))},c.wbg.__wbg_getExtension_bea19db80bdbefef=function(){return D((function(n,e,_){const t=o(n).getExtension(d(e,_));return v(t)?0:i(t)}),arguments)},c.wbg.__wbg_getParameter_f511b92ebf87c44e=function(){return D((function(n,e){return i(o(n).getParameter(e>>>0))}),arguments)},c.wbg.__wbg_getProgramInfoLog_e70b0120bda14895=function(n,e,_){const t=o(e).getProgramInfoLog(o(_));var r=v(t)?0:p(t,b.__wbindgen_malloc,b.__wbindgen_realloc),c=s;h()[n/4+1]=c,h()[n/4+0]=r},c.wbg.__wbg_getProgramParameter_e4fe54d806806081=function(n,e,_){return i(o(n).getProgramParameter(o(e),_>>>0))},c.wbg.__wbg_getShaderInfoLog_95d068aeccc5dbb3=function(n,e,_){const t=o(e).getShaderInfoLog(o(_));var r=v(t)?0:p(t,b.__wbindgen_malloc,b.__wbindgen_realloc),c=s;h()[n/4+1]=c,h()[n/4+0]=r},c.wbg.__wbg_getUniformLocation_776a1f58e7904d81=function(n,e,_,t){const r=o(n).getUniformLocation(o(e),d(_,t));return v(r)?0:i(r)},c.wbg.__wbg_linkProgram_b98c8967f45a44fd=function(n,e){o(n).linkProgram(o(e))},c.wbg.__wbg_pixelStorei_707653d2f29a6c67=function(n,e,_){o(n).pixelStorei(e>>>0,_)},c.wbg.__wbg_shaderSource_daca520f63ef8fca=function(n,e,_,t){o(n).shaderSource(o(e),d(_,t))},c.wbg.__wbg_stencilFunc_5e3584d9ea466585=function(n,e,_,t){o(n).stencilFunc(e>>>0,_,t>>>0)},c.wbg.__wbg_stencilMask_9ea2bf2fb1616a9b=function(n,e){o(n).stencilMask(e>>>0)},c.wbg.__wbg_stencilOp_612a592601e921f5=function(n,e,_,t){o(n).stencilOp(e>>>0,_>>>0,t>>>0)},c.wbg.__wbg_texParameteri_1298d8804b59bbc0=function(n,e,_,t){o(n).texParameteri(e>>>0,_>>>0,t)},c.wbg.__wbg_uniform1f_bb331865fe6d123b=function(n,e,_){o(n).uniform1f(o(e),_)},c.wbg.__wbg_uniform1i_42b99e992f794a51=function(n,e,_){o(n).uniform1i(o(e),_)},c.wbg.__wbg_useProgram_022d72a653706891=function(n,e){o(n).useProgram(o(e))},c.wbg.__wbg_vertexAttribPointer_a75ea424ba9fa4e8=function(n,e,_,t,r,b,c){o(n).vertexAttribPointer(e>>>0,_,t>>>0,0!==r,b,c)},c.wbg.__wbg_viewport_6c864379ded67e8a=function(n,e,_,t,r){o(n).viewport(e,_,t,r)},c.wbg.__wbg_debug_fda1f49ea6af7a1d=function(n){console.debug(o(n))},c.wbg.__wbg_error_8ff19d586a987aef=function(n){console.error(o(n))},c.wbg.__wbg_info_c8f1b00be4ef10bc=function(n){console.info(o(n))},c.wbg.__wbg_log_e8ba7b992c7ad0eb=function(n){console.log(o(n))},c.wbg.__wbg_warn_0227db1aa6989248=function(n){console.warn(o(n))},c.wbg.__wbg_style_dd3ba68ea919f1b0=function(n){return i(o(n).style)},c.wbg.__wbg_setvalue_adeb9030ea412869=function(n,e){o(n).value=e},c.wbg.__wbg_linearRampToValueAtTime_81378d2935036506=function(){return D((function(n,e,_){return i(o(n).linearRampToValueAtTime(e,_))}),arguments)},c.wbg.__wbg_setValueAtTime_9b2c1dde4f1815e3=function(){return D((function(n,e,_){return i(o(n).setValueAtTime(e,_))}),arguments)},c.wbg.__wbg_newwithbuffersourcesequenceandoptions_1c1614ce7cfbc5e4=function(){return D((function(n,e){return i(new Blob(o(n),o(e)))}),arguments)},c.wbg.__wbg_addEventListener_78d3aa7e06ee5b73=function(){return D((function(n,e,_,t){o(n).addEventListener(d(e,_),o(t))}),arguments)},c.wbg.__wbg_addEventListener_be0c061a1359c1dd=function(){return D((function(n,e,_,t,r){o(n).addEventListener(d(e,_),o(t),o(r))}),arguments)},c.wbg.__wbg_addEventListener_fbf7ce59794a417b=function(){return D((function(n,e,_,t,r){o(n).addEventListener(d(e,_),o(t),0!==r)}),arguments)},c.wbg.__wbg_removeEventListener_ab2f93784dae0528=function(){return D((function(n,e,_,t){o(n).removeEventListener(d(e,_),o(t))}),arguments)},c.wbg.__wbg_removeEventListener_3e7319b5d7c8be8f=function(){return D((function(n,e,_,t,r){o(n).removeEventListener(d(e,_),o(t),0!==r)}),arguments)},c.wbg.__wbg_data_454197b135a25142=function(n,e){const _=function(n,e){const _=e(1*n.length);return w().set(n,_/1),s=n.length,_}(o(e).data,b.__wbindgen_malloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_newwithu8clampedarray_decce474908c8867=function(){return D((function(n,e,_){return i(new ImageData(H(n,e),_>>>0))}),arguments)},c.wbg.__wbg_instanceof_CanvasRenderingContext2d_405495bb0ea92c4f=function(n){return o(n)instanceof CanvasRenderingContext2D},c.wbg.__wbg_setglobalAlpha_d6d2f5636a624c43=function(n,e){o(n).globalAlpha=e},c.wbg.__wbg_setglobalCompositeOperation_2752e9ced94fe641=function(){return D((function(n,e,_){o(n).globalCompositeOperation=d(e,_)}),arguments)},c.wbg.__wbg_setstrokeStyle_32540003cbfe210b=function(n,e){o(n).strokeStyle=o(e)},c.wbg.__wbg_setfillStyle_1d391c4891a6ec4d=function(n,e){o(n).fillStyle=o(e)},c.wbg.__wbg_setfilter_9710e4517560e4a6=function(n,e,_){o(n).filter=d(e,_)},c.wbg.__wbg_setimageSmoothingEnabled_3f82e28e8673fe7d=function(n,e){o(n).imageSmoothingEnabled=0!==e},c.wbg.__wbg_setlineWidth_6f1b76036ab98bfc=function(n,e){o(n).lineWidth=e},c.wbg.__wbg_setlineCap_8c6c8fa23d88cb4f=function(n,e,_){o(n).lineCap=d(e,_)},c.wbg.__wbg_setlineJoin_be4495c94d43d8b0=function(n,e,_){o(n).lineJoin=d(e,_)},c.wbg.__wbg_setmiterLimit_87c6ceb7bc2d2662=function(n,e){o(n).miterLimit=e},c.wbg.__wbg_drawImage_5d4f6b1d51d3b118=function(){return D((function(n,e,_,t){o(n).drawImage(o(e),_,t)}),arguments)},c.wbg.__wbg_clip_68e3eb8a51018328=function(n,e,_){o(n).clip(o(e),u(_))},c.wbg.__wbg_fill_d568e4c6dfc20014=function(n,e,_){o(n).fill(o(e),u(_))},c.wbg.__wbg_stroke_269216709f852773=function(n,e){o(n).stroke(o(e))},c.wbg.__wbg_createLinearGradient_76b30efa01034289=function(n,e,_,t,r){return i(o(n).createLinearGradient(e,_,t,r))},c.wbg.__wbg_createPattern_7151c7f4606f1f65=function(){return D((function(n,e,_,t){const r=o(n).createPattern(o(e),d(_,t));return v(r)?0:i(r)}),arguments)},c.wbg.__wbg_createRadialGradient_c70ef75c8c93c6be=function(){return D((function(n,e,_,t,r,b,c){return i(o(n).createRadialGradient(e,_,t,r,b,c))}),arguments)},c.wbg.__wbg_getImageData_47b530423f896826=function(){return D((function(n,e,_,t,r){return i(o(n).getImageData(e,_,t,r))}),arguments)},c.wbg.__wbg_putImageData_fad983ad6d58ee62=function(){return D((function(n,e,_,t){o(n).putImageData(o(e),_,t)}),arguments)},c.wbg.__wbg_clearRect_5e0469d0d11a7aee=function(n,e,_,t,r){o(n).clearRect(e,_,t,r)},c.wbg.__wbg_fillRect_59b38b7e6f8d0717=function(n,e,_,t,r){o(n).fillRect(e,_,t,r)},c.wbg.__wbg_restore_56c80343ddc70aeb=function(n){o(n).restore()},c.wbg.__wbg_save_faa4566184f134f6=function(n){o(n).save()},c.wbg.__wbg_resetTransform_be6d3f0c0e150bac=function(){return D((function(n){o(n).resetTransform()}),arguments)},c.wbg.__wbg_setTransform_f06275e4cc6b9b71=function(){return D((function(n,e,_,t,r,b,c){o(n).setTransform(e,_,t,r,b,c)}),arguments)},c.wbg.__wbg_transform_1875a09bb4212e88=function(){return D((function(n,e,_,t,r,b,c){o(n).transform(e,_,t,r,b,c)}),arguments)},c.wbg.__wbg_destination_f4f5ac55ff6e3785=function(n){return i(o(n).destination)},c.wbg.__wbg_sampleRate_310f869d3d9e8715=function(n){return o(n).sampleRate},c.wbg.__wbg_currentTime_510dde7d31c119e8=function(n){return o(n).currentTime},c.wbg.__wbg_new_14af17251d0bf480=function(){return D((function(){return i(new r)}),arguments)},c.wbg.__wbg_suspend_c2247addb78d3e2e=function(){return D((function(n){return i(o(n).suspend())}),arguments)},c.wbg.__wbg_createBuffer_19d3c1651316a6c2=function(){return D((function(n,e,_,t){return i(o(n).createBuffer(e>>>0,_>>>0,t))}),arguments)},c.wbg.__wbg_createBufferSource_414d1e25fd67f353=function(){return D((function(n){return i(o(n).createBufferSource())}),arguments)},c.wbg.__wbg_createChannelMerger_c8ea5e970b0215b7=function(){return D((function(n,e){return i(o(n).createChannelMerger(e>>>0))}),arguments)},c.wbg.__wbg_createChannelSplitter_1e34548bc282d3e6=function(){return D((function(n,e){return i(o(n).createChannelSplitter(e>>>0))}),arguments)},c.wbg.__wbg_createGain_ec81f7114545acfb=function(){return D((function(n){return i(o(n).createGain())}),arguments)},c.wbg.__wbg_createScriptProcessor_68a6f46b3c8337eb=function(){return D((function(n,e,_,t){return i(o(n).createScriptProcessor(e>>>0,_>>>0,t>>>0))}),arguments)},c.wbg.__wbg_decodeAudioData_080cb9872a95b009=function(){return D((function(n,e,_,t){return i(o(n).decodeAudioData(o(e),o(_),o(t)))}),arguments)},c.wbg.__wbg_resume_00606714ccb596ff=function(){return D((function(n){return i(o(n).resume())}),arguments)},c.wbg.__wbg_addColorStop_d8e4383b19c1dc6f=function(){return D((function(n,e,_,t){o(n).addColorStop(e,d(_,t))}),arguments)},c.wbg.__wbg_gain_30b6e9ac5fa0f7b0=function(n){return i(o(n).gain)},c.wbg.__wbg_baseURI_9c41e8e6d59451b1=function(){return D((function(n,e){const _=o(e).baseURI;var t=v(_)?0:p(_,b.__wbindgen_malloc,b.__wbindgen_realloc),r=s;h()[n/4+1]=r,h()[n/4+0]=t}),arguments)},c.wbg.__wbg_appendChild_a86c0da8d152eae4=function(){return D((function(n,e){return i(o(n).appendChild(o(e)))}),arguments)},c.wbg.__wbg_get_590a2cd912f2ae46=function(n,e){return i(o(n)[e>>>0])},c.wbg.__wbg_new_94fb1279cf6afea5=function(){return i(new Array)},c.wbg.__wbg_newnoargs_e23b458e372830de=function(n,e){return i(new Function(d(n,e)))},c.wbg.__wbg_next_bf3d83fc18df496e=function(){return D((function(n){return i(o(n).next())}),arguments)},c.wbg.__wbg_done_040f966faa9a72b3=function(n){return o(n).done},c.wbg.__wbg_value_419afbd9b9574c4c=function(n){return i(o(n).value)},c.wbg.__wbg_get_a9cab131e3152c49=function(){return D((function(n,e){return i(Reflect.get(o(n),o(e)))}),arguments)},c.wbg.__wbg_call_ae78342adc33730a=function(){return D((function(n,e){return i(o(n).call(o(e)))}),arguments)},c.wbg.__wbg_new_36359baae5a47e27=function(){return i(new Object)},c.wbg.__wbg_self_99737b4dcdf6f0d8=function(){return D((function(){return i(self.self)}),arguments)},c.wbg.__wbg_window_9b61fbbf3564c4fb=function(){return D((function(){return i(window.window)}),arguments)},c.wbg.__wbg_globalThis_8e275ef40caea3a3=function(){return D((function(){return i(globalThis.globalThis)}),arguments)},c.wbg.__wbg_global_5de1e0f82bddcd27=function(){return D((function(){return i(_.g.global)}),arguments)},c.wbg.__wbg_isArray_6721f2e508996340=function(n){return Array.isArray(o(n))},c.wbg.__wbg_of_1dbd33a0abd074ce=function(n,e){return i(Array.of(o(n),o(e)))},c.wbg.__wbg_push_40c6a90f1805aa90=function(n,e){return o(n).push(o(e))},c.wbg.__wbg_instanceof_ArrayBuffer_b81b40c2ae0ab898=function(n){return o(n)instanceof ArrayBuffer},c.wbg.__wbg_new_e3b1f44ea72e4e03=function(n){return i(new ArrayBuffer(n>>>0))},c.wbg.__wbg_slice_86a0334a3c44d85f=function(n,e,_){return i(o(n).slice(e>>>0,_>>>0))},c.wbg.__wbg_values_b1b9e8c63dbe01c2=function(n){return i(o(n).values())},c.wbg.__wbg_apply_f2d0f65c219e5594=function(){return D((function(n,e,_){return i(o(n).apply(o(e),o(_)))}),arguments)},c.wbg.__wbg_call_3ed288a247f13ea5=function(){return D((function(n,e,_){return i(o(n).call(o(e),o(_)))}),arguments)},c.wbg.__wbg_getTime_bffb1c09df09618b=function(n){return o(n).getTime()},c.wbg.__wbg_getTimezoneOffset_9c9a2f880882a1d7=function(n){return o(n).getTimezoneOffset()},c.wbg.__wbg_new0_0ff7eb5c1486f3ec=function(){return i(new Date)},c.wbg.__wbg_instanceof_Object_ac36a5f4244e4963=function(n){return o(n)instanceof Object},c.wbg.__wbg_entries_aaf7a1fbe90f014a=function(n){return i(Object.entries(o(n)))},c.wbg.__wbg_fromEntries_753a5d6f3530e028=function(){return D((function(n){return i(Object.fromEntries(o(n)))}),arguments)},c.wbg.__wbg_is_40969b082b54c84d=function(n,e){return Object.is(o(n),o(e))},c.wbg.__wbg_new_37705eed627d5ed9=function(n,e){try{var _={a:n,b:e};const t=new Promise(((n,e)=>{const t=_.a;_.a=0;try{return function(n,e,_,t){b.wasm_bindgen__convert__closures__invoke2_mut__h5cbcd8424861da9d(n,e,i(_),i(t))}(t,_.b,n,e)}finally{_.a=t}}));return i(t)}finally{_.a=_.b=0}},c.wbg.__wbg_resolve_a9a87bdd64e9e62c=function(n){return i(Promise.resolve(o(n)))},c.wbg.__wbg_then_ce526c837d07b68f=function(n,e){return i(o(n).then(o(e)))},c.wbg.__wbg_then_842e65b843962f56=function(n,e,_){return i(o(n).then(o(e),o(_)))},c.wbg.__wbg_buffer_7af23f65f6c64548=function(n){return i(o(n).buffer)},c.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974=function(n,e,_){return i(new Uint8Array(o(n),e>>>0,_>>>0))},c.wbg.__wbg_new_cc9018bd6f283b6f=function(n){return i(new Uint8Array(o(n)))},c.wbg.__wbg_set_f25e869e4565d2a2=function(n,e,_){o(n).set(o(e),_>>>0)},c.wbg.__wbg_length_0acb1cf9bbaf8519=function(n){return o(n).length},c.wbg.__wbg_newwithlength_8f0657faca9f1422=function(n){return i(new Uint8Array(n>>>0))},c.wbg.__wbg_fill_86476dd77be83461=function(n,e,_,t){return i(o(n).fill(e,_>>>0,t>>>0))},c.wbg.__wbg_buffer_0e70c88190dd0999=function(n){return i(o(n).buffer)},c.wbg.__wbg_subarray_da527dbd24eafb6b=function(n,e,_){return i(o(n).subarray(e>>>0,_>>>0))},c.wbg.__wbg_byteLength_e07852258f592e80=function(n){return o(n).byteLength},c.wbg.__wbg_byteOffset_3e0482615c7f74fd=function(n){return o(n).byteOffset},c.wbg.__wbg_ownKeys_9a927fb2995888f1=function(){return D((function(n){return i(Reflect.ownKeys(o(n)))}),arguments)},c.wbg.__wbg_set_93b1c87ee2af852e=function(){return D((function(n,e,_){return Reflect.set(o(n),o(e),o(_))}),arguments)},c.wbg.__wbindgen_debug_string=function(n,e){const _=p(C(o(e)),b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbindgen_throw=function(n,e){throw new Error(d(n,e))},c.wbg.__wbindgen_memory=function(){return i(b.memory)},c.wbg.__wbindgen_closure_wrapper339=function(n,e,_){return i(R(n,e,3,S))},c.wbg.__wbindgen_closure_wrapper341=function(n,e,_){return i(R(n,e,3,T))},c.wbg.__wbindgen_closure_wrapper343=function(n,e,_){return i(R(n,e,3,k))},c.wbg.__wbindgen_closure_wrapper345=function(n,e,_){return i(R(n,e,3,E))},c.wbg.__wbindgen_closure_wrapper347=function(n,e,_){return i(R(n,e,3,F))},c.wbg.__wbindgen_closure_wrapper349=function(n,e,_){return i(R(n,e,3,M))},c.wbg.__wbindgen_closure_wrapper351=function(n,e,_){return i(R(n,e,3,O))},c.wbg.__wbindgen_closure_wrapper353=function(n,e,_){return i(R(n,e,3,P))},c.wbg.__wbindgen_closure_wrapper7025=function(n,e,_){return i(R(n,e,2784,L))},("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:f,module:a}=await async function(n,e){if("function"==typeof Response&&n instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,e)}catch(e){if("application/wasm"==n.headers.get("Content-Type"))throw e;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e)}const _=await n.arrayBuffer();return await WebAssembly.instantiate(_,e)}{const _=await WebAssembly.instantiate(n,e);return _ instanceof WebAssembly.Instance?{instance:_,module:n}:_}}(await e,c);return b=f.exports,n.__wbindgen_wasm_module=a,b}},285:(n,e,_)=>{n.exports=_.p+"69052e08f0f291fb6d82.wasm"}}]); -//# sourceMappingURL=core.ruffle.53a2873dad31763672e1.js.map \ No newline at end of file diff --git a/ruffle/core.ruffle.be482e0399eaff7f47ec.js b/ruffle/core.ruffle.be482e0399eaff7f47ec.js deleted file mode 100644 index 660d1ba..0000000 --- a/ruffle/core.ruffle.be482e0399eaff7f47ec.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkruffle_selfhosted=self.webpackChunkruffle_selfhosted||[]).push([[662],{762:(n,e,_)=>{function t(n,e,_){e&&n.getChannelData(0).set(e),_&&n.getChannelData(1).set(_)}function r(n){return n.currentTime-n.baseLatency}_.d(e,{K:()=>t,T:()=>r})},662:(n,e,_)=>{_.r(e),_.d(e,{Ruffle:()=>N,default:()=>$});var t=_(762);const r="undefined"!=typeof AudioContext?AudioContext:"undefined"!=typeof webkitAudioContext?webkitAudioContext:void 0;let b;const c=new Array(32).fill(void 0);function o(n){return c[n]}c.push(void 0,null,!0,!1);let f=c.length;function u(n){const e=o(n);return function(n){n<36||(c[n]=f,f=n)}(n),e}function i(n){f===c.length&&c.push(c.length+1);const e=f;return f=c[e],c[e]=n,e}const a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});a.decode();let g=null;function w(){return null!==g&&g.buffer===b.memory.buffer||(g=new Uint8Array(b.memory.buffer)),g}function d(n,e){return a.decode(w().subarray(n,n+e))}let s=0;const l=new TextEncoder("utf-8"),m="function"==typeof l.encodeInto?function(n,e){return l.encodeInto(n,e)}:function(n,e){const _=l.encode(n);return e.set(_),{read:n.length,written:_.length}};function p(n,e,_){if(void 0===_){const _=l.encode(n),t=e(_.length);return w().subarray(t,t+_.length).set(_),s=_.length,t}let t=n.length,r=e(t);const b=w();let c=0;for(;c127)break;b[r+c]=e}if(c!==t){0!==c&&(n=n.slice(c)),r=_(r,t,t=c+3*n.length);const e=w().subarray(r+c,r+t);c+=m(n,e).written}return s=c,r}let y=null;function h(){return null!==y&&y.buffer===b.memory.buffer||(y=new Int32Array(b.memory.buffer)),y}function v(n){return null==n}let x=null;function A(){return null!==x&&x.buffer===b.memory.buffer||(x=new Float64Array(b.memory.buffer)),x}function C(n){const e=typeof n;if("number"==e||"boolean"==e||null==n)return`${n}`;if("string"==e)return`"${n}"`;if("symbol"==e){const e=n.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=n.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){const e=n.length;let _="[";e>0&&(_+=C(n[0]));for(let t=1;t1))return toString.call(n);if(t=_[1],"Object"==t)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:t}function R(n,e,_,t){const r={a:n,b:e,cnt:1,dtor:_},c=(...n)=>{r.cnt++;const e=r.a;r.a=0;try{return t(e,r.b,...n)}finally{0==--r.cnt?b.__wbindgen_export_2.get(r.dtor)(e,r.b):r.a=e}};return c.original=r,c}function S(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function T(n,e){b._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4d1a73f89c33f719(n,e)}function k(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function E(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function F(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function M(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b93465580b7c726(n,e,_)}function O(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function P(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e1d881a28d06434(n,e,i(_))}function L(n,e,_){b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfd95dd93812f7ed4(n,e,i(_))}function D(n,e){try{return n.apply(this,e)}catch(n){b.__wbindgen_exn_store(i(n))}}let W=32;function I(n){if(1==W)throw new Error("out of js stack");return c[--W]=n,W}let B=null;let j=null;function V(n,e){return(null!==j&&j.buffer===b.memory.buffer||(j=new Float32Array(b.memory.buffer)),j).subarray(n/4,n/4+e)}function U(n,e){return w().subarray(n/1,n/1+e)}function q(n,e){return A().subarray(n/8,n/8+e)}let G=null;function H(n,e){return(null!==G&&G.buffer===b.memory.buffer||(G=new Uint8ClampedArray(b.memory.buffer)),G).subarray(n/1,n/1+e)}class N{static __wrap(n){const e=Object.create(N.prototype);return e.ptr=n,e}__destroy_into_raw(){const n=this.ptr;return this.ptr=0,n}free(){const n=this.__destroy_into_raw();b.__wbg_ruffle_free(n)}constructor(n,e,_){try{return u(b.ruffle_new(i(n),i(e),I(_)))}finally{c[W++]=void 0}}stream_from(n,e){try{const t=b.__wbindgen_add_to_stack_pointer(-16),r=p(n,b.__wbindgen_malloc,b.__wbindgen_realloc),o=s;b.ruffle_stream_from(t,this.ptr,r,o,I(e));var _=h()[t/4+0];if(h()[t/4+1])throw u(_)}finally{b.__wbindgen_add_to_stack_pointer(16),c[W++]=void 0}}load_data(n,e){try{const t=b.__wbindgen_add_to_stack_pointer(-16);b.ruffle_load_data(t,this.ptr,i(n),I(e));var _=h()[t/4+0];if(h()[t/4+1])throw u(_)}finally{b.__wbindgen_add_to_stack_pointer(16),c[W++]=void 0}}play(){b.ruffle_play(this.ptr)}pause(){b.ruffle_pause(this.ptr)}is_playing(){return 0!==b.ruffle_is_playing(this.ptr)}prepare_context_menu(){return u(b.ruffle_prepare_context_menu(this.ptr))}run_context_menu_callback(n){b.ruffle_run_context_menu_callback(this.ptr,n)}set_fullscreen(n){b.ruffle_set_fullscreen(this.ptr,n)}clear_custom_menu_items(){b.ruffle_clear_custom_menu_items(this.ptr)}destroy(){b.ruffle_destroy(this.ptr)}call_exposed_callback(n,e){const _=p(n,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s,r=function(n,e){const _=e(4*n.length),t=(null!==B&&B.buffer===b.memory.buffer||(B=new Uint32Array(b.memory.buffer)),B);for(let e=0;e>>0,a>>>0)},c.wbg.__wbg_createVertexArray_d502151c473563b2=function(n){const e=o(n).createVertexArray();return v(e)?0:i(e)},c.wbg.__wbg_renderbufferStorageMultisample_90aa1df2657b1a0a=function(n,e,_,t,r,b){o(n).renderbufferStorageMultisample(e>>>0,_,t>>>0,r,b)},c.wbg.__wbg_texImage2D_ebd74c4d7f0e6728=function(){return D((function(n,e,_,t,r,b,c,f,u,i,a){o(n).texImage2D(e>>>0,_,t,r,b,c,f>>>0,u>>>0,0===i?void 0:U(i,a))}),arguments)},c.wbg.__wbg_bindFramebuffer_6ef149f7d398d19f=function(n,e,_){o(n).bindFramebuffer(e>>>0,o(_))},c.wbg.__wbg_bindRenderbuffer_1974e9f4fdd0b3af=function(n,e,_){o(n).bindRenderbuffer(e>>>0,o(_))},c.wbg.__wbg_bindTexture_dbddb0b0c3efa1b9=function(n,e,_){o(n).bindTexture(e>>>0,o(_))},c.wbg.__wbg_createFramebuffer_f656a97f24d2caf3=function(n){const e=o(n).createFramebuffer();return v(e)?0:i(e)},c.wbg.__wbg_createRenderbuffer_e66ea157342e02e9=function(n){const e=o(n).createRenderbuffer();return v(e)?0:i(e)},c.wbg.__wbg_createTexture_0df375980a9c46c9=function(n){const e=o(n).createTexture();return v(e)?0:i(e)},c.wbg.__wbg_deleteFramebuffer_609d82d380c88142=function(n,e){o(n).deleteFramebuffer(o(e))},c.wbg.__wbg_deleteRenderbuffer_d12ade31b823658c=function(n,e){o(n).deleteRenderbuffer(o(e))},c.wbg.__wbg_deleteTexture_8c7434cb1b20f64f=function(n,e){o(n).deleteTexture(o(e))},c.wbg.__wbg_framebufferRenderbuffer_d73f3cb3e5a605a2=function(n,e,_,t,r){o(n).framebufferRenderbuffer(e>>>0,_>>>0,t>>>0,o(r))},c.wbg.__wbg_framebufferTexture2D_e07b69d4972eccfd=function(n,e,_,t,r,b){o(n).framebufferTexture2D(e>>>0,_>>>0,t>>>0,o(r),b)},c.wbg.__wbg_getError_cc18cbef4864f62f=function(n){return o(n).getError()},c.wbg.__wbg_getParameter_00a3d89e6e005c2f=function(){return D((function(n,e){return i(o(n).getParameter(e>>>0))}),arguments)},c.wbg.__wbg_texParameteri_7414cf15f83e1d52=function(n,e,_,t){o(n).texParameteri(e>>>0,_>>>0,t)},c.wbg.__wbg_instanceof_Window_0e6c0f1096d66c3c=function(n){return o(n)instanceof Window},c.wbg.__wbg_document_99eddbbc11ec831e=function(n){const e=o(n).document;return v(e)?0:i(e)},c.wbg.__wbg_location_fa9019d2eb2195e8=function(n){return i(o(n).location)},c.wbg.__wbg_devicePixelRatio_cac0b66c0e1e056b=function(n){return o(n).devicePixelRatio},c.wbg.__wbg_localStorage_6e9ba4e9a3771427=function(){return D((function(n){const e=o(n).localStorage;return v(e)?0:i(e)}),arguments)},c.wbg.__wbg_cancelAnimationFrame_7a4ff0365b95acb4=function(){return D((function(n,e){o(n).cancelAnimationFrame(e)}),arguments)},c.wbg.__wbg_focus_086a81eb632614fb=function(){return D((function(n){o(n).focus()}),arguments)},c.wbg.__wbg_open_fd57bd436de42549=function(){return D((function(n,e,_,t,r){const b=o(n).open(d(e,_),d(t,r));return v(b)?0:i(b)}),arguments)},c.wbg.__wbg_requestAnimationFrame_8e3c7028c69ebaef=function(){return D((function(n,e){return o(n).requestAnimationFrame(o(e))}),arguments)},c.wbg.__wbg_fetch_ef7a6623d1fcd3b8=function(n,e){return i(o(n).fetch(o(e)))},c.wbg.__wbg_setProperty_ae9adf5d00216c03=function(){return D((function(n,e,_,t,r){o(n).setProperty(d(e,_),d(t,r))}),arguments)},c.wbg.__wbg_inverse_8af605ed9705f947=function(n){return i(o(n).inverse())},c.wbg.__wbg_protocol_8a7c3a0ad0534fb9=function(){return D((function(n,e){const _=p(o(e).protocol,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_}),arguments)},c.wbg.__wbg_assign_8412f2d177f8543c=function(){return D((function(n,e,_){o(n).assign(d(e,_))}),arguments)},c.wbg.__wbg_get_f2a42b72d9c3121e=function(){return D((function(n,e,_,t){const r=o(e)[d(_,t)];var c=v(r)?0:p(r,b.__wbindgen_malloc,b.__wbindgen_realloc),f=s;h()[n/4+1]=f,h()[n/4+0]=c}),arguments)},c.wbg.__wbg_set_fae17f247c4c8723=function(){return D((function(n,e,_,t,r){o(n)[d(e,_)]=d(t,r)}),arguments)},c.wbg.__wbg_delete_2a53f5694592407e=function(){return D((function(n,e,_){delete o(n)[d(e,_)]}),arguments)},c.wbg.__wbg_length_9132be38635fece5=function(n){return o(n).length},c.wbg.__wbg_offsetX_5888d22032ed9bd8=function(n){return o(n).offsetX},c.wbg.__wbg_offsetY_ca0bdbbd593cafb7=function(n){return o(n).offsetY},c.wbg.__wbg_button_78dae8616402469e=function(n){return o(n).button},c.wbg.__wbg_new_fcc3bfd6f1d02d9b=function(){return D((function(){return i(new Path2D)}),arguments)},c.wbg.__wbg_addPath_3f9b52fe12b3a8f4=function(n,e,_){o(n).addPath(o(e),o(_))},c.wbg.__wbg_closePath_e8740a8a4b33f4a2=function(n){o(n).closePath()},c.wbg.__wbg_lineTo_611f952172f57ea1=function(n,e,_){o(n).lineTo(e,_)},c.wbg.__wbg_moveTo_9b09fc77b253b4ff=function(n,e,_){o(n).moveTo(e,_)},c.wbg.__wbg_quadraticCurveTo_39645457683c039c=function(n,e,_,t,r){o(n).quadraticCurveTo(e,_,t,r)},c.wbg.__wbg_rect_e4248453dba3e49b=function(n,e,_,t,r){o(n).rect(e,_,t,r)},c.wbg.__wbg_connect_7fe7ce5856f531e9=function(){return D((function(n,e){return i(o(n).connect(o(e)))}),arguments)},c.wbg.__wbg_connect_3d91d2d170d6ecd4=function(){return D((function(n,e,_){return i(o(n).connect(o(e),_>>>0))}),arguments)},c.wbg.__wbg_connect_e916aa2972b69a20=function(){return D((function(n,e,_,t){return i(o(n).connect(o(e),_>>>0,t>>>0))}),arguments)},c.wbg.__wbg_disconnect_a00625849153bced=function(){return D((function(n){o(n).disconnect()}),arguments)},c.wbg.__wbg_outputBuffer_e9801f4e66879b0d=function(){return D((function(n){return i(o(n).outputBuffer)}),arguments)},c.wbg.__wbg_bindVertexArrayOES_35d97084dfc5f6f4=function(n,e){o(n).bindVertexArrayOES(o(e))},c.wbg.__wbg_createVertexArrayOES_69c38b2b74e927fa=function(n){const e=o(n).createVertexArrayOES();return v(e)?0:i(e)},c.wbg.__wbg_instanceof_Response_ccfeb62399355bcd=function(n){return o(n)instanceof Response},c.wbg.__wbg_url_06c0f822d68d195c=function(n,e){const _=p(o(e).url,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_ok_1538f4695dab1792=function(n){return o(n).ok},c.wbg.__wbg_statusText_750d3bf8e134b8f8=function(n,e){const _=p(o(e).statusText,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_arrayBuffer_5a99283a3954c850=function(){return D((function(n){return i(o(n).arrayBuffer())}),arguments)},c.wbg.__wbg_deltaY_f78bae9413139a24=function(n){return o(n).deltaY},c.wbg.__wbg_deltaMode_08c2fcea70146506=function(n){return o(n).deltaMode},c.wbg.__wbg_setbuffer_72cfecac4d22725d=function(n,e){o(n).buffer=o(e)},c.wbg.__wbg_setloop_b1a61b62498fa9e4=function(n,e){o(n).loop=0!==e},c.wbg.__wbg_setloopStart_f54e061b1de3b268=function(n,e){o(n).loopStart=e},c.wbg.__wbg_setloopEnd_d6430450275c920c=function(n,e){o(n).loopEnd=e},c.wbg.__wbg_setonended_f22c38d46d048b5e=function(n,e){o(n).onended=o(e)},c.wbg.__wbg_start_4f1790870dabedcf=function(){return D((function(n){o(n).start()}),arguments)},c.wbg.__wbg_start_19389908a04585e5=function(){return D((function(n,e,_){o(n).start(e,_)}),arguments)},c.wbg.__wbg_stop_f4ba0ccf4eeeda42=function(){return D((function(n,e){o(n).stop(e)}),arguments)},c.wbg.__wbg_setTransform_6a58eea25fa31e41=function(n,e){o(n).setTransform(o(e))},c.wbg.__wbg_instanceof_HtmlFormElement_e51c7005ee225f19=function(n){return o(n)instanceof HTMLFormElement},c.wbg.__wbg_submit_da9a1351634ab083=function(){return D((function(n){o(n).submit()}),arguments)},c.wbg.__wbg_now_20d2aadcf3cc17f7=function(n){return o(n).now()},c.wbg.__wbg_pointerId_8b2b0e9ad7c38495=function(n){return o(n).pointerId},c.wbg.__wbg_a_d41d0786eae57b41=function(n){return o(n).a},c.wbg.__wbg_seta_7a0efce1e1267ca4=function(n,e){o(n).a=e},c.wbg.__wbg_b_4662b7a44f9d4a9c=function(n){return o(n).b},c.wbg.__wbg_c_0486825ee52e1586=function(n){return o(n).c},c.wbg.__wbg_d_cbaa259381ebdb12=function(n){return o(n).d},c.wbg.__wbg_setd_7910219e2e519b38=function(n,e){o(n).d=e},c.wbg.__wbg_e_b35a73e0bbfb7f50=function(n){return o(n).e},c.wbg.__wbg_f_ad257c92a791f32b=function(n){return o(n).f},c.wbg.__wbg_new_ca9cc0487e8ea6fd=function(){return D((function(){return i(new DOMMatrix)}),arguments)},c.wbg.__wbg_newwitharray64_78b84021a57a1de8=function(){return D((function(n,e){return i(new DOMMatrix(q(n,e)))}),arguments)},c.wbg.__wbg_currentTarget_327b27bfa936c61f=function(n){const e=o(n).currentTarget;return v(e)?0:i(e)},c.wbg.__wbg_preventDefault_747982fd5fe3b6d0=function(n){o(n).preventDefault()},c.wbg.__wbg_instanceof_HtmlCanvasElement_b94545433bb4d2ef=function(n){return o(n)instanceof HTMLCanvasElement},c.wbg.__wbg_width_20b7a9ebdd5f4232=function(n){return o(n).width},c.wbg.__wbg_setwidth_654d8adcd4979eed=function(n,e){o(n).width=e>>>0},c.wbg.__wbg_height_57f43816c2227a89=function(n){return o(n).height},c.wbg.__wbg_setheight_2b662384bfacb65c=function(n,e){o(n).height=e>>>0},c.wbg.__wbg_getContext_0c19ba5c037e057f=function(){return D((function(n,e,_){const t=o(n).getContext(d(e,_));return v(t)?0:i(t)}),arguments)},c.wbg.__wbg_getContext_d7d734e1c1199dd1=function(){return D((function(n,e,_,t){const r=o(n).getContext(d(e,_),o(t));return v(r)?0:i(r)}),arguments)},c.wbg.__wbg_key_a8ae33ddc6ff786b=function(n,e){const _=p(o(e).key,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_code_a637bfca56413948=function(n,e){const _=p(o(e).code,b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_newwithstrandinit_fd99688f189f053e=function(){return D((function(n,e,_){return i(new Request(d(n,e),o(_)))}),arguments)},c.wbg.__wbg_setonaudioprocess_691238df792e5983=function(n,e){o(n).onaudioprocess=o(e)},c.wbg.__wbg_body_2a1ff14b05042a51=function(n){const e=o(n).body;return v(e)?0:i(e)},c.wbg.__wbg_createElement_3c9b5f3aa42457a1=function(){return D((function(n,e,_){return i(o(n).createElement(d(e,_)))}),arguments)},c.wbg.__wbg_createElementNS_a0904ea4c02292f4=function(){return D((function(n,e,_,t,r){return i(o(n).createElementNS(0===e?void 0:d(e,_),d(t,r)))}),arguments)},c.wbg.__wbg_setid_ea9f00ecb5da9dde=function(n,e,_){o(n).id=d(e,_)},c.wbg.__wbg_clientWidth_11f72beceb108bff=function(n){return o(n).clientWidth},c.wbg.__wbg_clientHeight_205d93d6eadff351=function(n){return o(n).clientHeight},c.wbg.__wbg_querySelector_277db48579b05107=function(){return D((function(n,e,_){const t=o(n).querySelector(d(e,_));return v(t)?0:i(t)}),arguments)},c.wbg.__wbg_releasePointerCapture_9ccf528d12801791=function(){return D((function(n,e){o(n).releasePointerCapture(e)}),arguments)},c.wbg.__wbg_setAttribute_8d90e00d652037be=function(){return D((function(n,e,_,t,r){o(n).setAttribute(d(e,_),d(t,r))}),arguments)},c.wbg.__wbg_setAttributeNS_59dc39cb257152af=function(){return D((function(n,e,_,t,r,b,c){o(n).setAttributeNS(0===e?void 0:d(e,_),d(t,r),d(b,c))}),arguments)},c.wbg.__wbg_setPointerCapture_c6fe2a502d7c4f27=function(){return D((function(n,e){o(n).setPointerCapture(e)}),arguments)},c.wbg.__wbg_remove_0bfd44c3622f33b2=function(n){o(n).remove()},c.wbg.__wbg_instanceof_WebGlRenderingContext_b0885da52b151d86=function(n){return o(n)instanceof WebGLRenderingContext},c.wbg.__wbg_drawingBufferWidth_d531da9205a735a4=function(n){return o(n).drawingBufferWidth},c.wbg.__wbg_drawingBufferHeight_6a1b146e4b52493c=function(n){return o(n).drawingBufferHeight},c.wbg.__wbg_bufferData_c4192729016213be=function(n,e,_,t,r){o(n).bufferData(e>>>0,U(_,t),r>>>0)},c.wbg.__wbg_texImage2D_60614361e73b0339=function(){return D((function(n,e,_,t,r,b,c,f,u,i,a){o(n).texImage2D(e>>>0,_,t,r,b,c,f>>>0,u>>>0,0===i?void 0:U(i,a))}),arguments)},c.wbg.__wbg_uniform1fv_e75d6126004bb5f7=function(n,e,_,t){o(n).uniform1fv(o(e),V(_,t))},c.wbg.__wbg_uniform4fv_54aeb419c88f21df=function(n,e,_,t){o(n).uniform4fv(o(e),V(_,t))},c.wbg.__wbg_uniformMatrix3fv_81c8f94bf3a05d08=function(n,e,_,t,r){o(n).uniformMatrix3fv(o(e),0!==_,V(t,r))},c.wbg.__wbg_uniformMatrix4fv_caf5129a09f4f267=function(n,e,_,t,r){o(n).uniformMatrix4fv(o(e),0!==_,V(t,r))},c.wbg.__wbg_activeTexture_1ba5758f0a8358b6=function(n,e){o(n).activeTexture(e>>>0)},c.wbg.__wbg_attachShader_0867104b37cae2d6=function(n,e,_){o(n).attachShader(o(e),o(_))},c.wbg.__wbg_bindBuffer_28e62f648e99e251=function(n,e,_){o(n).bindBuffer(e>>>0,o(_))},c.wbg.__wbg_bindFramebuffer_b7a06305d2823b34=function(n,e,_){o(n).bindFramebuffer(e>>>0,o(_))},c.wbg.__wbg_bindRenderbuffer_0fe389ab46c4d00d=function(n,e,_){o(n).bindRenderbuffer(e>>>0,o(_))},c.wbg.__wbg_bindTexture_27a724e7303eec67=function(n,e,_){o(n).bindTexture(e>>>0,o(_))},c.wbg.__wbg_blendFunc_08a6e279418be6da=function(n,e,_){o(n).blendFunc(e>>>0,_>>>0)},c.wbg.__wbg_clear_786a8deca6672a9d=function(n,e){o(n).clear(e>>>0)},c.wbg.__wbg_clearColor_2c1d714dee770474=function(n,e,_,t,r){o(n).clearColor(e,_,t,r)},c.wbg.__wbg_colorMask_0cfe7588f073be4e=function(n,e,_,t,r){o(n).colorMask(0!==e,0!==_,0!==t,0!==r)},c.wbg.__wbg_compileShader_1b371763cfd802f7=function(n,e){o(n).compileShader(o(e))},c.wbg.__wbg_createBuffer_48c0376fc0746386=function(n){const e=o(n).createBuffer();return v(e)?0:i(e)},c.wbg.__wbg_createProgram_c2675d2cc83435a6=function(n){const e=o(n).createProgram();return v(e)?0:i(e)},c.wbg.__wbg_createShader_8d2a55e7777bbea7=function(n,e){const _=o(n).createShader(e>>>0);return v(_)?0:i(_)},c.wbg.__wbg_createTexture_23de5d8f7988e663=function(n){const e=o(n).createTexture();return v(e)?0:i(e)},c.wbg.__wbg_disable_ada50e27543b1ebd=function(n,e){o(n).disable(e>>>0)},c.wbg.__wbg_disableVertexAttribArray_e1c513cfd55355c9=function(n,e){o(n).disableVertexAttribArray(e>>>0)},c.wbg.__wbg_drawElements_efa6c15e2787a58c=function(n,e,_,t,r){o(n).drawElements(e>>>0,_,t>>>0,r)},c.wbg.__wbg_enable_981a414a11bbed87=function(n,e){o(n).enable(e>>>0)},c.wbg.__wbg_enableVertexAttribArray_1d5f3ff6e7da7095=function(n,e){o(n).enableVertexAttribArray(e>>>0)},c.wbg.__wbg_getAttribLocation_f875dcf14748b9d4=function(n,e,_,t){return o(n).getAttribLocation(o(e),d(_,t))},c.wbg.__wbg_getExtension_bea19db80bdbefef=function(){return D((function(n,e,_){const t=o(n).getExtension(d(e,_));return v(t)?0:i(t)}),arguments)},c.wbg.__wbg_getParameter_f511b92ebf87c44e=function(){return D((function(n,e){return i(o(n).getParameter(e>>>0))}),arguments)},c.wbg.__wbg_getProgramInfoLog_e70b0120bda14895=function(n,e,_){const t=o(e).getProgramInfoLog(o(_));var r=v(t)?0:p(t,b.__wbindgen_malloc,b.__wbindgen_realloc),c=s;h()[n/4+1]=c,h()[n/4+0]=r},c.wbg.__wbg_getProgramParameter_e4fe54d806806081=function(n,e,_){return i(o(n).getProgramParameter(o(e),_>>>0))},c.wbg.__wbg_getShaderInfoLog_95d068aeccc5dbb3=function(n,e,_){const t=o(e).getShaderInfoLog(o(_));var r=v(t)?0:p(t,b.__wbindgen_malloc,b.__wbindgen_realloc),c=s;h()[n/4+1]=c,h()[n/4+0]=r},c.wbg.__wbg_getUniformLocation_776a1f58e7904d81=function(n,e,_,t){const r=o(n).getUniformLocation(o(e),d(_,t));return v(r)?0:i(r)},c.wbg.__wbg_linkProgram_b98c8967f45a44fd=function(n,e){o(n).linkProgram(o(e))},c.wbg.__wbg_pixelStorei_707653d2f29a6c67=function(n,e,_){o(n).pixelStorei(e>>>0,_)},c.wbg.__wbg_shaderSource_daca520f63ef8fca=function(n,e,_,t){o(n).shaderSource(o(e),d(_,t))},c.wbg.__wbg_stencilFunc_5e3584d9ea466585=function(n,e,_,t){o(n).stencilFunc(e>>>0,_,t>>>0)},c.wbg.__wbg_stencilMask_9ea2bf2fb1616a9b=function(n,e){o(n).stencilMask(e>>>0)},c.wbg.__wbg_stencilOp_612a592601e921f5=function(n,e,_,t){o(n).stencilOp(e>>>0,_>>>0,t>>>0)},c.wbg.__wbg_texParameteri_1298d8804b59bbc0=function(n,e,_,t){o(n).texParameteri(e>>>0,_>>>0,t)},c.wbg.__wbg_uniform1f_bb331865fe6d123b=function(n,e,_){o(n).uniform1f(o(e),_)},c.wbg.__wbg_uniform1i_42b99e992f794a51=function(n,e,_){o(n).uniform1i(o(e),_)},c.wbg.__wbg_useProgram_022d72a653706891=function(n,e){o(n).useProgram(o(e))},c.wbg.__wbg_vertexAttribPointer_a75ea424ba9fa4e8=function(n,e,_,t,r,b,c){o(n).vertexAttribPointer(e>>>0,_,t>>>0,0!==r,b,c)},c.wbg.__wbg_viewport_6c864379ded67e8a=function(n,e,_,t,r){o(n).viewport(e,_,t,r)},c.wbg.__wbg_debug_fda1f49ea6af7a1d=function(n){console.debug(o(n))},c.wbg.__wbg_error_8ff19d586a987aef=function(n){console.error(o(n))},c.wbg.__wbg_info_c8f1b00be4ef10bc=function(n){console.info(o(n))},c.wbg.__wbg_log_e8ba7b992c7ad0eb=function(n){console.log(o(n))},c.wbg.__wbg_warn_0227db1aa6989248=function(n){console.warn(o(n))},c.wbg.__wbg_style_dd3ba68ea919f1b0=function(n){return i(o(n).style)},c.wbg.__wbg_setvalue_adeb9030ea412869=function(n,e){o(n).value=e},c.wbg.__wbg_linearRampToValueAtTime_81378d2935036506=function(){return D((function(n,e,_){return i(o(n).linearRampToValueAtTime(e,_))}),arguments)},c.wbg.__wbg_setValueAtTime_9b2c1dde4f1815e3=function(){return D((function(n,e,_){return i(o(n).setValueAtTime(e,_))}),arguments)},c.wbg.__wbg_newwithbuffersourcesequenceandoptions_1c1614ce7cfbc5e4=function(){return D((function(n,e){return i(new Blob(o(n),o(e)))}),arguments)},c.wbg.__wbg_addEventListener_78d3aa7e06ee5b73=function(){return D((function(n,e,_,t){o(n).addEventListener(d(e,_),o(t))}),arguments)},c.wbg.__wbg_addEventListener_be0c061a1359c1dd=function(){return D((function(n,e,_,t,r){o(n).addEventListener(d(e,_),o(t),o(r))}),arguments)},c.wbg.__wbg_addEventListener_fbf7ce59794a417b=function(){return D((function(n,e,_,t,r){o(n).addEventListener(d(e,_),o(t),0!==r)}),arguments)},c.wbg.__wbg_removeEventListener_ab2f93784dae0528=function(){return D((function(n,e,_,t){o(n).removeEventListener(d(e,_),o(t))}),arguments)},c.wbg.__wbg_removeEventListener_3e7319b5d7c8be8f=function(){return D((function(n,e,_,t,r){o(n).removeEventListener(d(e,_),o(t),0!==r)}),arguments)},c.wbg.__wbg_data_454197b135a25142=function(n,e){const _=function(n,e){const _=e(1*n.length);return w().set(n,_/1),s=n.length,_}(o(e).data,b.__wbindgen_malloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbg_newwithu8clampedarray_decce474908c8867=function(){return D((function(n,e,_){return i(new ImageData(H(n,e),_>>>0))}),arguments)},c.wbg.__wbg_instanceof_CanvasRenderingContext2d_405495bb0ea92c4f=function(n){return o(n)instanceof CanvasRenderingContext2D},c.wbg.__wbg_setglobalAlpha_d6d2f5636a624c43=function(n,e){o(n).globalAlpha=e},c.wbg.__wbg_setglobalCompositeOperation_2752e9ced94fe641=function(){return D((function(n,e,_){o(n).globalCompositeOperation=d(e,_)}),arguments)},c.wbg.__wbg_setstrokeStyle_32540003cbfe210b=function(n,e){o(n).strokeStyle=o(e)},c.wbg.__wbg_setfillStyle_1d391c4891a6ec4d=function(n,e){o(n).fillStyle=o(e)},c.wbg.__wbg_setfilter_9710e4517560e4a6=function(n,e,_){o(n).filter=d(e,_)},c.wbg.__wbg_setimageSmoothingEnabled_3f82e28e8673fe7d=function(n,e){o(n).imageSmoothingEnabled=0!==e},c.wbg.__wbg_setlineWidth_6f1b76036ab98bfc=function(n,e){o(n).lineWidth=e},c.wbg.__wbg_setlineCap_8c6c8fa23d88cb4f=function(n,e,_){o(n).lineCap=d(e,_)},c.wbg.__wbg_setlineJoin_be4495c94d43d8b0=function(n,e,_){o(n).lineJoin=d(e,_)},c.wbg.__wbg_setmiterLimit_87c6ceb7bc2d2662=function(n,e){o(n).miterLimit=e},c.wbg.__wbg_drawImage_5d4f6b1d51d3b118=function(){return D((function(n,e,_,t){o(n).drawImage(o(e),_,t)}),arguments)},c.wbg.__wbg_clip_68e3eb8a51018328=function(n,e,_){o(n).clip(o(e),u(_))},c.wbg.__wbg_fill_d568e4c6dfc20014=function(n,e,_){o(n).fill(o(e),u(_))},c.wbg.__wbg_stroke_269216709f852773=function(n,e){o(n).stroke(o(e))},c.wbg.__wbg_createLinearGradient_76b30efa01034289=function(n,e,_,t,r){return i(o(n).createLinearGradient(e,_,t,r))},c.wbg.__wbg_createPattern_7151c7f4606f1f65=function(){return D((function(n,e,_,t){const r=o(n).createPattern(o(e),d(_,t));return v(r)?0:i(r)}),arguments)},c.wbg.__wbg_createRadialGradient_c70ef75c8c93c6be=function(){return D((function(n,e,_,t,r,b,c){return i(o(n).createRadialGradient(e,_,t,r,b,c))}),arguments)},c.wbg.__wbg_getImageData_47b530423f896826=function(){return D((function(n,e,_,t,r){return i(o(n).getImageData(e,_,t,r))}),arguments)},c.wbg.__wbg_putImageData_fad983ad6d58ee62=function(){return D((function(n,e,_,t){o(n).putImageData(o(e),_,t)}),arguments)},c.wbg.__wbg_clearRect_5e0469d0d11a7aee=function(n,e,_,t,r){o(n).clearRect(e,_,t,r)},c.wbg.__wbg_fillRect_59b38b7e6f8d0717=function(n,e,_,t,r){o(n).fillRect(e,_,t,r)},c.wbg.__wbg_restore_56c80343ddc70aeb=function(n){o(n).restore()},c.wbg.__wbg_save_faa4566184f134f6=function(n){o(n).save()},c.wbg.__wbg_resetTransform_be6d3f0c0e150bac=function(){return D((function(n){o(n).resetTransform()}),arguments)},c.wbg.__wbg_setTransform_f06275e4cc6b9b71=function(){return D((function(n,e,_,t,r,b,c){o(n).setTransform(e,_,t,r,b,c)}),arguments)},c.wbg.__wbg_transform_1875a09bb4212e88=function(){return D((function(n,e,_,t,r,b,c){o(n).transform(e,_,t,r,b,c)}),arguments)},c.wbg.__wbg_destination_f4f5ac55ff6e3785=function(n){return i(o(n).destination)},c.wbg.__wbg_sampleRate_310f869d3d9e8715=function(n){return o(n).sampleRate},c.wbg.__wbg_currentTime_510dde7d31c119e8=function(n){return o(n).currentTime},c.wbg.__wbg_new_14af17251d0bf480=function(){return D((function(){return i(new r)}),arguments)},c.wbg.__wbg_suspend_c2247addb78d3e2e=function(){return D((function(n){return i(o(n).suspend())}),arguments)},c.wbg.__wbg_createBuffer_19d3c1651316a6c2=function(){return D((function(n,e,_,t){return i(o(n).createBuffer(e>>>0,_>>>0,t))}),arguments)},c.wbg.__wbg_createBufferSource_414d1e25fd67f353=function(){return D((function(n){return i(o(n).createBufferSource())}),arguments)},c.wbg.__wbg_createChannelMerger_c8ea5e970b0215b7=function(){return D((function(n,e){return i(o(n).createChannelMerger(e>>>0))}),arguments)},c.wbg.__wbg_createChannelSplitter_1e34548bc282d3e6=function(){return D((function(n,e){return i(o(n).createChannelSplitter(e>>>0))}),arguments)},c.wbg.__wbg_createGain_ec81f7114545acfb=function(){return D((function(n){return i(o(n).createGain())}),arguments)},c.wbg.__wbg_createScriptProcessor_68a6f46b3c8337eb=function(){return D((function(n,e,_,t){return i(o(n).createScriptProcessor(e>>>0,_>>>0,t>>>0))}),arguments)},c.wbg.__wbg_decodeAudioData_080cb9872a95b009=function(){return D((function(n,e,_,t){return i(o(n).decodeAudioData(o(e),o(_),o(t)))}),arguments)},c.wbg.__wbg_resume_00606714ccb596ff=function(){return D((function(n){return i(o(n).resume())}),arguments)},c.wbg.__wbg_addColorStop_d8e4383b19c1dc6f=function(){return D((function(n,e,_,t){o(n).addColorStop(e,d(_,t))}),arguments)},c.wbg.__wbg_gain_30b6e9ac5fa0f7b0=function(n){return i(o(n).gain)},c.wbg.__wbg_baseURI_9c41e8e6d59451b1=function(){return D((function(n,e){const _=o(e).baseURI;var t=v(_)?0:p(_,b.__wbindgen_malloc,b.__wbindgen_realloc),r=s;h()[n/4+1]=r,h()[n/4+0]=t}),arguments)},c.wbg.__wbg_appendChild_a86c0da8d152eae4=function(){return D((function(n,e){return i(o(n).appendChild(o(e)))}),arguments)},c.wbg.__wbg_get_590a2cd912f2ae46=function(n,e){return i(o(n)[e>>>0])},c.wbg.__wbg_new_94fb1279cf6afea5=function(){return i(new Array)},c.wbg.__wbg_newnoargs_e23b458e372830de=function(n,e){return i(new Function(d(n,e)))},c.wbg.__wbg_next_bf3d83fc18df496e=function(){return D((function(n){return i(o(n).next())}),arguments)},c.wbg.__wbg_done_040f966faa9a72b3=function(n){return o(n).done},c.wbg.__wbg_value_419afbd9b9574c4c=function(n){return i(o(n).value)},c.wbg.__wbg_get_a9cab131e3152c49=function(){return D((function(n,e){return i(Reflect.get(o(n),o(e)))}),arguments)},c.wbg.__wbg_call_ae78342adc33730a=function(){return D((function(n,e){return i(o(n).call(o(e)))}),arguments)},c.wbg.__wbg_new_36359baae5a47e27=function(){return i(new Object)},c.wbg.__wbg_self_99737b4dcdf6f0d8=function(){return D((function(){return i(self.self)}),arguments)},c.wbg.__wbg_window_9b61fbbf3564c4fb=function(){return D((function(){return i(window.window)}),arguments)},c.wbg.__wbg_globalThis_8e275ef40caea3a3=function(){return D((function(){return i(globalThis.globalThis)}),arguments)},c.wbg.__wbg_global_5de1e0f82bddcd27=function(){return D((function(){return i(_.g.global)}),arguments)},c.wbg.__wbg_isArray_6721f2e508996340=function(n){return Array.isArray(o(n))},c.wbg.__wbg_of_1dbd33a0abd074ce=function(n,e){return i(Array.of(o(n),o(e)))},c.wbg.__wbg_push_40c6a90f1805aa90=function(n,e){return o(n).push(o(e))},c.wbg.__wbg_instanceof_ArrayBuffer_b81b40c2ae0ab898=function(n){return o(n)instanceof ArrayBuffer},c.wbg.__wbg_new_e3b1f44ea72e4e03=function(n){return i(new ArrayBuffer(n>>>0))},c.wbg.__wbg_slice_86a0334a3c44d85f=function(n,e,_){return i(o(n).slice(e>>>0,_>>>0))},c.wbg.__wbg_values_b1b9e8c63dbe01c2=function(n){return i(o(n).values())},c.wbg.__wbg_apply_f2d0f65c219e5594=function(){return D((function(n,e,_){return i(o(n).apply(o(e),o(_)))}),arguments)},c.wbg.__wbg_call_3ed288a247f13ea5=function(){return D((function(n,e,_){return i(o(n).call(o(e),o(_)))}),arguments)},c.wbg.__wbg_getTime_bffb1c09df09618b=function(n){return o(n).getTime()},c.wbg.__wbg_getTimezoneOffset_9c9a2f880882a1d7=function(n){return o(n).getTimezoneOffset()},c.wbg.__wbg_new0_0ff7eb5c1486f3ec=function(){return i(new Date)},c.wbg.__wbg_instanceof_Object_ac36a5f4244e4963=function(n){return o(n)instanceof Object},c.wbg.__wbg_entries_aaf7a1fbe90f014a=function(n){return i(Object.entries(o(n)))},c.wbg.__wbg_fromEntries_753a5d6f3530e028=function(){return D((function(n){return i(Object.fromEntries(o(n)))}),arguments)},c.wbg.__wbg_is_40969b082b54c84d=function(n,e){return Object.is(o(n),o(e))},c.wbg.__wbg_new_37705eed627d5ed9=function(n,e){try{var _={a:n,b:e};const t=new Promise(((n,e)=>{const t=_.a;_.a=0;try{return function(n,e,_,t){b.wasm_bindgen__convert__closures__invoke2_mut__h5cbcd8424861da9d(n,e,i(_),i(t))}(t,_.b,n,e)}finally{_.a=t}}));return i(t)}finally{_.a=_.b=0}},c.wbg.__wbg_resolve_a9a87bdd64e9e62c=function(n){return i(Promise.resolve(o(n)))},c.wbg.__wbg_then_ce526c837d07b68f=function(n,e){return i(o(n).then(o(e)))},c.wbg.__wbg_then_842e65b843962f56=function(n,e,_){return i(o(n).then(o(e),o(_)))},c.wbg.__wbg_buffer_7af23f65f6c64548=function(n){return i(o(n).buffer)},c.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974=function(n,e,_){return i(new Uint8Array(o(n),e>>>0,_>>>0))},c.wbg.__wbg_new_cc9018bd6f283b6f=function(n){return i(new Uint8Array(o(n)))},c.wbg.__wbg_set_f25e869e4565d2a2=function(n,e,_){o(n).set(o(e),_>>>0)},c.wbg.__wbg_length_0acb1cf9bbaf8519=function(n){return o(n).length},c.wbg.__wbg_newwithlength_8f0657faca9f1422=function(n){return i(new Uint8Array(n>>>0))},c.wbg.__wbg_fill_86476dd77be83461=function(n,e,_,t){return i(o(n).fill(e,_>>>0,t>>>0))},c.wbg.__wbg_buffer_0e70c88190dd0999=function(n){return i(o(n).buffer)},c.wbg.__wbg_subarray_da527dbd24eafb6b=function(n,e,_){return i(o(n).subarray(e>>>0,_>>>0))},c.wbg.__wbg_byteLength_e07852258f592e80=function(n){return o(n).byteLength},c.wbg.__wbg_byteOffset_3e0482615c7f74fd=function(n){return o(n).byteOffset},c.wbg.__wbg_ownKeys_9a927fb2995888f1=function(){return D((function(n){return i(Reflect.ownKeys(o(n)))}),arguments)},c.wbg.__wbg_set_93b1c87ee2af852e=function(){return D((function(n,e,_){return Reflect.set(o(n),o(e),o(_))}),arguments)},c.wbg.__wbindgen_debug_string=function(n,e){const _=p(C(o(e)),b.__wbindgen_malloc,b.__wbindgen_realloc),t=s;h()[n/4+1]=t,h()[n/4+0]=_},c.wbg.__wbindgen_throw=function(n,e){throw new Error(d(n,e))},c.wbg.__wbindgen_memory=function(){return i(b.memory)},c.wbg.__wbindgen_closure_wrapper339=function(n,e,_){return i(R(n,e,3,S))},c.wbg.__wbindgen_closure_wrapper341=function(n,e,_){return i(R(n,e,3,T))},c.wbg.__wbindgen_closure_wrapper343=function(n,e,_){return i(R(n,e,3,k))},c.wbg.__wbindgen_closure_wrapper345=function(n,e,_){return i(R(n,e,3,E))},c.wbg.__wbindgen_closure_wrapper347=function(n,e,_){return i(R(n,e,3,F))},c.wbg.__wbindgen_closure_wrapper349=function(n,e,_){return i(R(n,e,3,M))},c.wbg.__wbindgen_closure_wrapper351=function(n,e,_){return i(R(n,e,3,O))},c.wbg.__wbindgen_closure_wrapper353=function(n,e,_){return i(R(n,e,3,P))},c.wbg.__wbindgen_closure_wrapper7025=function(n,e,_){return i(R(n,e,2784,L))},("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:f,module:a}=await async function(n,e){if("function"==typeof Response&&n instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,e)}catch(e){if("application/wasm"==n.headers.get("Content-Type"))throw e;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e)}const _=await n.arrayBuffer();return await WebAssembly.instantiate(_,e)}{const _=await WebAssembly.instantiate(n,e);return _ instanceof WebAssembly.Instance?{instance:_,module:n}:_}}(await e,c);return b=f.exports,n.__wbindgen_wasm_module=a,b}},931:(n,e,_)=>{n.exports=_.p+"824f57d600b8c30ee747.wasm"}}]); -//# sourceMappingURL=core.ruffle.be482e0399eaff7f47ec.js.map \ No newline at end of file diff --git a/ruffle/ruffle.js b/ruffle/ruffle.js index 1d75a81..531414e 100644 --- a/ruffle/ruffle.js +++ b/ruffle/ruffle.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t,n={},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,s),r.exports}s.m=n,s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"core.ruffle."+{662:"be482e0399eaff7f47ec",966:"53a2873dad31763672e1"}[e]+".js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="ruffle-selfhosted:",s.l=(n,i,r,o)=>{if(e[n])e[n].push(i);else{var a,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{a.onerror=a.onload=null,clearTimeout(f);var s=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),s&&s.forEach((e=>e(i))),t)return t(i)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.p="",(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var i=s.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var r=new Promise(((n,s)=>i=e[t]=[n,s]));n.push(i[2]=r);var o=s.p+s.u(t),a=new Error;s.l(o,(n=>{if(s.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var r=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,i[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var i,r,[o,a,l]=n,c=0;if(o.some((t=>0!==e[t]))){for(i in a)s.o(a,i)&&(s.m[i]=a[i]);l&&l(s)}for(t&&t(n);cWebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),o=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11])),a=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11])),l=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]));function c(e){const t="function"==typeof Function.prototype.toString?Function.prototype.toString():null;return"string"==typeof t&&t.indexOf("[native code]")>=0&&Function.prototype.toString.call(e).indexOf("[native code]")>=0}let u="";try{if(void 0!==document.currentScript&&null!==document.currentScript&&"src"in document.currentScript&&""!==document.currentScript.src){let e=document.currentScript.src;e.endsWith(".js")||e.endsWith("/")||(e+="/"),u=new URL(".",e).href}}catch(e){console.warn("Unable to get currentScript URL")}function d(e){let t=u;return void 0!==e&&void 0!==e.publicPath&&(t=e.publicPath),""===t||t.endsWith("/")||(t+="/"),t}let h=null;function f(e){return null===h&&(h=async function(e){"function"==typeof Array.prototype.reduce&&c(Array.prototype.reduce)||Object.defineProperty(Array.prototype,"reduce",{value(...e){if(0===e.length&&window.Prototype&&window.Prototype.Version&&window.Prototype.Version<"1.6.1")return this.length>1?this:this[0];const t=e[0];if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof t)throw new TypeError(`${t} is not a function`);const n=Object(this),i=n.length>>>0;let s,r=0;if(e.length>=2)s=e[1];else{for(;r=i)throw new TypeError("Reduce of empty array with no initial value");s=n[r++]}for(;re[t]}),"function"!=typeof Reflect.set&&Object.defineProperty(Reflect,"set",{value(e,t,n){e[t]=n}});const t=(await Promise.all([r(),l(),o(),a()])).every(Boolean);t||console.log("Some WebAssembly extensions are NOT available, falling back to the vanilla WebAssembly module"),s.p=d(e);const{default:n,Ruffle:i}=await(t?s.e(966).then(s.bind(s,966)):s.e(662).then(s.bind(s,662)));return await n(),i}(e)),h}class p{constructor(e){if(this.__mimetypes=[],this.__named_mimetypes={},e)for(let t=0;t\n :host {\n --ruffle-blue: #37528c;\n --ruffle-orange: #ffad33;\n\n display: inline-block;\n position: relative;\n /* Default width/height; this will get overridden by user styles/attributes. */\n width: 550px;\n height: 400px;\n font-family: Arial, sans-serif;\n letter-spacing: 0.4px;\n touch-action: none;\n user-select: none;\n -webkit-user-select: none;\n -webkit-tap-highlight-color: transparent;\n }\n\n /* Ruffle\'s width/height CSS interferes Safari fullscreen CSS. */\n /* Ensure that Safari\'s fullscreen mode actually fills the screen. */\n :host(:-webkit-full-screen) {\n display: block;\n width: 100% !important;\n height: 100% !important;\n }\n\n /* All of these use the dimensions specified by the embed. */\n #container,\n #play_button,\n #unmute_overlay,\n #unmute_overlay .background,\n #panic,\n #message_overlay {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n #container {\n overflow: hidden;\n }\n\n #container canvas {\n width: 100%;\n height: 100%;\n }\n\n #play_button,\n #unmute_overlay {\n cursor: pointer;\n display: none;\n }\n\n #unmute_overlay .background {\n background: black;\n opacity: 0.7;\n }\n\n #play_button .icon,\n #unmute_overlay .icon {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 50%;\n height: 50%;\n max-width: 384px;\n max-height: 384px;\n transform: translate(-50%, -50%);\n opacity: 0.8;\n }\n\n #play_button:hover .icon,\n #unmute_overlay:hover .icon {\n opacity: 1;\n }\n\n #panic {\n font-size: 20px;\n text-align: center;\n /* Inverted colors from play button! */\n background: linear-gradient(180deg, #fd3a40 0%, #fda138 100%);\n color: white;\n display: flex;\n flex-flow: column;\n justify-content: space-around;\n }\n\n #panic a {\n color: var(--ruffle-blue);\n font-weight: bold;\n }\n\n #panic-title {\n font-size: xxx-large;\n font-weight: bold;\n }\n\n #panic-body.details {\n flex: 0.9;\n margin: 0 10px;\n }\n\n #panic-body textarea {\n width: 100%;\n height: 100%;\n resize: none;\n }\n\n #panic ul {\n padding: 0;\n display: flex;\n list-style-type: none;\n justify-content: space-evenly;\n }\n\n #message_overlay {\n position: absolute;\n background: var(--ruffle-blue);\n color: var(--ruffle-orange);\n opacity: 1;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: auto;\n }\n\n #message_overlay .message {\n text-align: center;\n max-height: 100%;\n max-width: 100%;\n padding: 5%;\n\t font-size: 20px;\n }\n\n #message_overlay p {\n margin: 0.5em 0;\n }\n\n #message_overlay .message div {\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n column-gap: 1em;\n }\n\n #message_overlay a, #message_overlay button {\n cursor: pointer;\n background: var(--ruffle-blue);\n color: var(--ruffle-orange);\n border: 2px solid var(--ruffle-orange);\n font-weight: bold;\n font-size: 1.25em;\n border-radius: 0.6em;\n padding: 10px;\n text-decoration: none;\n margin: 2% 0;\n }\n\n #message_overlay a:hover, #message_overlay button:hover {\n background: #ffffff4c;\n }\n\n #continue-btn {\n cursor: pointer;\n background: var(--ruffle-blue);\n color: var(--ruffle-orange);\n border: 2px solid var(--ruffle-orange);\n font-weight: bold;\n font-size: 20px;\n border-radius: 20px;\n padding: 10px;\n }\n\n #continue-btn:hover {\n background: #ffffff4c;\n }\n\n #context-menu {\n display: none;\n color: black;\n background: #fafafa;\n border: 1px solid gray;\n box-shadow: 0px 5px 10px -5px black;\n position: absolute;\n font-size: 14px;\n text-align: left;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n #context-menu .menu_item {\n padding: 5px 10px;\n cursor: pointer;\n color: black;\n }\n\n #context-menu .menu_item.disabled {\n cursor: default;\n color: gray;\n }\n\n #context-menu .menu_item:not(.disabled):hover {\n background: lightgray;\n }\n\n #context-menu .menu_separator hr {\n border: none;\n border-bottom: 1px solid lightgray;\n margin: 2px;\n }\n \n \n\n
\n
\n
Click to unmute
\n
\n\n
    \n';const y={};function b(e,t){if(void 0!==y[e]){if(y[e].class!==t)throw new Error("Internal naming conflict on "+e);return y[e].name}let n=0;if(void 0!==window.customElements)for(;n<999;){let i=e;if(n>0&&(i=i+"-"+n),void 0===window.customElements.get(i))return window.customElements.define(i,t),y[e]={class:t,name:i,internalName:e},i;n+=1}throw new Error("Failed to assign custom element "+e)}const x="application/x-shockwave-flash",k="application/futuresplash",E="application/x-shockwave-flash2-preview",I="application/vnd.adobe.flash-movie",_="https://ruffle.rs",S=/^\s*(\d+(\.\d+)?(%)?)/;let A=!1;function C(e){if(null==e)return{};e instanceof URLSearchParams||(e=new URLSearchParams(e));const t={};for(const[n,i]of e)t[n]=i.toString();return t}class R extends HTMLElement{constructor(){return super(),this.hasContextMenu=!1,this.contextMenuForceDisabled=!1,this.isTouch=!1,this.showSwfDownload=!1,this.panicked=!1,this.isExtension=!1,this.config={},this.shadow=this.attachShadow({mode:"open"}),this.shadow.appendChild(v.content.cloneNode(!0)),this.dynamicStyles=this.shadow.getElementById("dynamic_styles"),this.container=this.shadow.getElementById("container"),this.playButton=this.shadow.getElementById("play_button"),this.playButton&&this.playButton.addEventListener("click",(()=>this.play())),this.unmuteOverlay=this.shadow.getElementById("unmute_overlay"),this.contextMenuElement=this.shadow.getElementById("context-menu"),this.addEventListener("contextmenu",this.showContextMenu.bind(this)),this.addEventListener("pointerdown",this.pointerDown.bind(this)),this.addEventListener("fullscreenchange",this.fullScreenChange.bind(this)),this.addEventListener("webkitfullscreenchange",this.fullScreenChange.bind(this)),window.addEventListener("click",this.hideContextMenu.bind(this)),this.instance=null,this.options=null,this.onFSCommand=null,this._readyState=0,this._metadata=null,this.lastActivePlayingState=!1,this.setupPauseOnTabHidden(),this}get readyState(){return this._readyState}get metadata(){return this._metadata}setupPauseOnTabHidden(){document.addEventListener("visibilitychange",(()=>{this.instance&&(document.hidden&&(this.lastActivePlayingState=this.instance.is_playing(),this.instance.pause()),document.hidden||!0!==this.lastActivePlayingState||this.instance.play())}),!1)}connectedCallback(){this.updateStyles()}static get observedAttributes(){return["width","height"]}attributeChangedCallback(e,t,n){"width"!==e&&"height"!==e||this.updateStyles()}disconnectedCallback(){this.destroy()}updateStyles(){if(this.dynamicStyles.sheet){if(this.dynamicStyles.sheet.rules)for(let e=0;e{if(console.error(`Serious error loading Ruffle: ${e}`),"file:"===window.location.protocol)e.ruffleIndexError=2;else{e.ruffleIndexError=9;const t=String(e.message).toLowerCase();t.includes("mime")?e.ruffleIndexError=8:t.includes("networkerror")||t.includes("failed to fetch")?e.ruffleIndexError=6:t.includes("disallowed by embedder")?e.ruffleIndexError=1:"CompileError"===e.name?e.ruffleIndexError=3:t.includes("could not download wasm module")&&"TypeError"===e.name?e.ruffleIndexError=7:"TypeError"===e.name?e.ruffleIndexError=5:navigator.userAgent.includes("Edg")&&t.includes("webassembly is not defined")&&(e.ruffleIndexError=10)}throw this.panic(e),e}));if(this.instance=await new n(this.container,this,e),console.log("New Ruffle instance created (WebAssembly extensions: "+(n.is_wasm_simd_used()?"ON":"OFF")+")"),"running"!==this.audioState()&&(this.container.style.visibility="hidden",await new Promise((e=>{window.setTimeout((()=>{e()}),200)})),this.container.style.visibility=""),this.unmuteAudioContext(),"on"===e.autoplay||"off"!==e.autoplay&&"running"===this.audioState()){if(this.play(),"running"!==this.audioState()){"hidden"!==e.unmuteOverlay&&(this.unmuteOverlay.style.display="block"),this.container.addEventListener("click",this.unmuteOverlayClicked.bind(this),{once:!0});const n=null===(t=this.instance)||void 0===t?void 0:t.audio_context();n&&(n.onstatechange=()=>{"running"===n.state&&this.unmuteOverlayClicked(),n.onstatechange=null})}}else this.playButton.style.display="block"}destroy(){this.instance&&(this.instance.destroy(),this.instance=null,this._metadata=null,this._readyState=0,console.log("Ruffle instance destroyed."))}async load(e){var t,n;let i="";switch(typeof e){case"string":e={url:e};break;case"object":null===e?i="Argument 0 must be a string or object":"url"in e||"data"in e?"url"in e&&"string"!=typeof e.url&&(i="`url` must be a string"):i="Argument 0 must contain a `url` or `data` key";break;default:i="Argument 0 must be a string or object"}if(i.length>0){const e=new TypeError(i);throw e.ruffleIndexError=4,this.panic(e),e}if(this.isConnected&&!this.isUnusedFallbackObject()){if(!T(this))try{const i=Object.assign(Object.assign(Object.assign({},null!==(n=null===(t=window.RufflePlayer)||void 0===t?void 0:t.config)&&void 0!==n?n:{}),this.config),e);if(i.allowScriptAccess=e.allowScriptAccess,this.showSwfDownload=!0===i.showSwfDownload,this.options=e,this.hasContextMenu=!1!==i.contextMenu,i.backgroundColor&&"transparent"!==i.wmode&&(this.container.style.backgroundColor=i.backgroundColor),await this.ensureFreshInstance(i),"url"in e){console.log(`Loading SWF file ${e.url}`),this.swfUrl=new URL(e.url,document.location.href);const t=Object.assign(Object.assign({},C(e.url.substring(e.url.indexOf("?")))),C(e.parameters));this.instance.stream_from(this.swfUrl.href,t)}else"data"in e&&(console.log("Loading SWF data"),this.instance.load_data(new Uint8Array(e.data),C(e.parameters)))}catch(e){throw console.error(`Serious error occurred loading SWF file: ${e}`),e}}else console.warn("Ignoring attempt to play a disconnected or suspended Ruffle element")}play(){this.instance&&(this.instance.play(),this.playButton&&(this.playButton.style.display="none"))}get isPlaying(){return!!this.instance&&this.instance.is_playing()}get fullscreenEnabled(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}get isFullscreen(){return(document.fullscreenElement||document.webkitFullscreenElement)===this}setFullscreen(e){this.fullscreenEnabled&&(e?this.enterFullscreen():this.exitFullscreen())}enterFullscreen(){const e={navigationUI:"hide"};this.requestFullscreen?this.requestFullscreen(e):this.webkitRequestFullscreen?this.webkitRequestFullscreen(e):this.webkitRequestFullScreen&&this.webkitRequestFullScreen(e)}exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}fullScreenChange(){var e;null===(e=this.instance)||void 0===e||e.set_fullscreen(this.isFullscreen)}pointerDown(e){"touch"!==e.pointerType&&"pen"!==e.pointerType||(this.isTouch=!0)}async downloadSwf(){try{if(this.swfUrl){console.log("Downloading SWF: "+this.swfUrl);const e=await fetch(this.swfUrl.href);if(!e.ok)return void console.error("SWF download failed");const t=await e.blob(),n=URL.createObjectURL(t),i=document.createElement("a");i.style.display="none",i.href=n,i.download=function(e){const t=e.pathname;return t.substring(t.lastIndexOf("/")+1)}(this.swfUrl),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}else console.error("SWF download failed")}catch(e){console.error("SWF download failed")}}contextMenuItems(){const e=String.fromCharCode(10003),t=[];this.instance&&this.instance.prepare_context_menu().forEach(((n,i)=>{n.separatorBefore&&t.push(null),t.push({text:n.caption+(n.checked?` (${e})`:""),onClick:()=>{var e;return null===(e=this.instance)||void 0===e?void 0:e.run_context_menu_callback(i)},enabled:n.enabled})})),t.push(null),this.fullscreenEnabled&&(this.isFullscreen?t.push({text:"Exit fullscreen",onClick:()=>{var e;return null===(e=this.instance)||void 0===e?void 0:e.set_fullscreen(!1)}}):t.push({text:"Enter fullscreen",onClick:()=>{var e;return null===(e=this.instance)||void 0===e?void 0:e.set_fullscreen(!0)}})),this.instance&&this.swfUrl&&this.showSwfDownload&&(t.push(null),t.push({text:"Download .swf",onClick:this.downloadSwf.bind(this)})),t.push(null);const n=this.isExtension?"extension":"";return t.push({text:`About Ruffle ${n} (nightly 2022-07-02)`,onClick(){window.open(_,"_blank")}}),this.isTouch&&(t.push(null),t.push({text:"Hide this menu",onClick:()=>this.contextMenuForceDisabled=!0})),t}showContextMenu(e){if(e.preventDefault(),!this.hasContextMenu||this.contextMenuForceDisabled)return;for(;this.contextMenuElement.firstChild;)this.contextMenuElement.removeChild(this.contextMenuElement.firstChild);for(const e of this.contextMenuItems())if(null===e){if(!this.contextMenuElement.lastElementChild)continue;if(this.contextMenuElement.lastElementChild.classList.contains("menu_separator"))continue;const e=document.createElement("li");e.className="menu_separator";const t=document.createElement("hr");e.appendChild(t),this.contextMenuElement.appendChild(e)}else{const{text:t,onClick:n,enabled:i}=e,s=document.createElement("li");s.className="menu_item",s.textContent=t,this.contextMenuElement.appendChild(s),!1!==i?s.addEventListener("click",n):s.classList.add("disabled")}this.contextMenuElement.style.left="0",this.contextMenuElement.style.top="0",this.contextMenuElement.style.display="block";const t=this.getBoundingClientRect(),n=e.clientX-t.x,i=e.clientY-t.y,s=t.width-this.contextMenuElement.clientWidth-1,r=t.height-this.contextMenuElement.clientHeight-1;this.contextMenuElement.style.left=Math.floor(Math.min(n,s))+"px",this.contextMenuElement.style.top=Math.floor(Math.min(i,r))+"px"}hideContextMenu(){var e;null===(e=this.instance)||void 0===e||e.clear_custom_menu_items(),this.contextMenuElement.style.display="none"}pause(){this.instance&&(this.instance.pause(),this.playButton&&(this.playButton.style.display="block"))}audioState(){if(this.instance){const e=this.instance.audio_context();return e&&e.state||"running"}return"suspended"}unmuteOverlayClicked(){if(this.instance){if("running"!==this.audioState()){const e=this.instance.audio_context();e&&e.resume()}this.unmuteOverlay&&(this.unmuteOverlay.style.display="none")}}unmuteAudioContext(){A||(navigator.maxTouchPoints<1?A=!0:this.container.addEventListener("click",(()=>{var e;if(A)return;const t=null===(e=this.instance)||void 0===e?void 0:e.audio_context();if(!t)return;const n=new Audio;n.src=(()=>{const e=new ArrayBuffer(10),n=new DataView(e),i=t.sampleRate;return n.setUint32(0,i,!0),n.setUint32(4,i,!0),n.setUint16(8,1,!0),`data:audio/wav;base64,UklGRisAAABXQVZFZm10IBAAAAABAAEA${window.btoa(String.fromCharCode(...new Uint8Array(e))).slice(0,13)}AgAZGF0YQcAAACAgICAgICAAAA=`})(),n.load(),n.play().then((()=>{A=!0})).catch((e=>{console.warn(`Failed to play dummy sound: ${e}`)}))}),{once:!0}))}copyElement(e){if(e){for(let t=0;tnull==t?void 0:t.call_exposed_callback(e,n)}set traceObserver(e){var t;null===(t=this.instance)||void 0===t||t.set_trace_observer(e)}panic(e){var t;if(this.panicked)return;if(this.panicked=!0,e instanceof Error&&("AbortError"===e.name||e.message.includes("AbortError")))return;const n=null!==(t=null==e?void 0:e.ruffleIndexError)&&void 0!==t?t:0,i=Object.assign([],{stackIndex:-1});if(i.push("# Error Info\n"),e instanceof Error){if(i.push(`Error name: ${e.name}\n`),i.push(`Error message: ${e.message}\n`),e.stack){const t=i.push(`Error stack:\n\`\`\`\n${e.stack}\n\`\`\`\n`)-1;i.stackIndex=t}}else i.push(`Error: ${e}\n`);i.push("\n# Player Info\n"),i.push(this.debugPlayerInfo()),i.push("\n# Page Info\n"),i.push(`Page URL: ${document.location.href}\n`),this.swfUrl&&i.push(`SWF URL: ${this.swfUrl}\n`),i.push("\n# Browser Info\n"),i.push(`User Agent: ${window.navigator.userAgent}\n`),i.push(`Platform: ${window.navigator.platform}\n`),i.push(`Has touch support: ${window.navigator.maxTouchPoints>0}\n`),i.push("\n# Ruffle Info\n"),i.push("Version: 0.1.0\n"),i.push("Name: nightly 2022-07-02\n"),i.push("Channel: nightly\n"),i.push("Built: 2022-07-02T00:15:33.972Z\n"),i.push("Commit: 79a341d106e0e69acf4d3a2dd90632bd84e6713c\n"),i.push(`Is extension: ${this.isExtension}\n`);const s=i.join(""),r=new Date("2022-07-02T00:15:33.972Z"),o=new Date;o.setMonth(o.getMonth()-6);const a=o>r;let l,c,u;if(a)l=`Update Ruffle`;else{const e=document.location.href.split(/[?#]/)[0];let t=`https://github.com/ruffle-rs/ruffle/issues/new?title=${encodeURIComponent(`Error on ${e}`)}&template=error_report.md&labels=error-report&body=`,n=encodeURIComponent(s);i.stackIndex>-1&&String(t+n).length>8195&&(i[i.stackIndex]=null,n=encodeURIComponent(i.join(""))),t+=n,l=`Report Bug`}switch(n){case 2:c='\n

    It appears you are running Ruffle on the "file:" protocol.

    \n

    This doesn\'t work as browsers block many features from working for security reasons.

    \n

    Instead, we invite you to setup a local server or either use the web demo or the desktop application.

    \n ',u=`\n
  • Web Demo
  • \n
  • Desktop Application
  • \n `;break;case 4:c="\n

    Ruffle has encountered a major issue due to an incorrect JavaScript configuration.

    \n

    If you are the server administrator, we invite you to check the error details to find out which parameter is at fault.

    \n

    You can also consult the Ruffle wiki for help.

    \n ",u='\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n ';break;case 9:c='\n

    Ruffle failed to load the required ".wasm" file component.

    \n

    If you are the server administrator, please ensure the file has correctly been uploaded.

    \n

    If the issue persists, you may need to use the "publicPath" setting: please consult the Ruffle wiki for help.

    \n ',u='\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n ';break;case 8:c='\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    This web server is not serving ".wasm" files with the correct MIME type.

    \n

    If you are the server administrator, please consult the Ruffle wiki for help.

    \n ',u='\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n ';break;case 11:c="\n

    Ruffle failed to load the Flash SWF file.

    \n

    The most likely reason is that the file no longer exists, so there is nothing for Ruffle to load.

    \n

    Try contacting the website administrator for help.

    \n ",u='\n
  • View Error Details
  • \n ';break;case 6:c='\n

    Ruffle failed to load the required ".wasm" file component.

    \n

    Access to fetch has likely been blocked by CORS policy.

    \n

    If you are the server administrator, please consult the Ruffle wiki for help.

    \n ',u='\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n ';break;case 3:c="\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    It seems like this page has missing or invalid files for running Ruffle.

    \n

    If you are the server administrator, please consult the Ruffle wiki for help.

    \n ",u='\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n ';break;case 7:c="\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    This can often resolve itself, so you can try reloading the page.

    \n

    Otherwise, please contact the website administrator.

    \n ",u='\n
  • View Error Details
  • \n ';break;case 10:c='\n

    Ruffle failed to load the required ".wasm" file component.

    \n

    To fix this, try opening your browser\'s settings, clicking "Privacy, search, and services", scrolling down, and turning off "Enhance your security on the web".

    \n

    This will allow your browser to load the required ".wasm" files.

    \n

    If the issue persists, you might have to use a different browser.

    \n ',u='\n
  • More Information
  • \n
  • View Error Details
  • \n ';break;case 5:c="\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    It seems like this page uses JavaScript code that conflicts with Ruffle.

    \n

    If you are the server administrator, we invite you to try loading the file on a blank page.

    \n ",a&&(c+="

    You can also try to upload a more recent version of Ruffle that may circumvent the issue (current build is outdated: 2022-07-02T00:15:33.972Z).

    "),u=`\n
  • ${l}
  • \n
  • View Error Details
  • \n `;break;case 1:c='\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    This web server\'s Content Security Policy does not allow the required ".wasm" component to run.

    \n

    If you are the server administrator, please consult the Ruffle wiki for help.

    \n ',u='\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n ';break;default:c="

    Ruffle has encountered a major issue whilst trying to display this Flash content.

    ",c+=a?"

    If you are the server administrator, please try to upload a more recent version of Ruffle (current build is outdated: 2022-07-02T00:15:33.972Z).

    ":"

    This isn't supposed to happen, so we'd really appreciate if you could file a bug!

    ",u=`\n
  • ${l}
  • \n
  • View Error Details
  • \n `}this.container.innerHTML=`\n
    \n
    Something went wrong :(
    \n
    ${c}
    \n \n
    \n `;const d=this.container.querySelector("#panic-view-details");d&&(d.onclick=()=>{const e=this.container.querySelector("#panic-body");return e.classList.add("details"),e.innerHTML=``,!1}),this.destroy()}displayRootMovieDownloadFailedMessage(){if(window.location.origin===this.swfUrl.origin||!this.isExtension||!window.location.protocol.includes("http")){const e=new Error("Failed to fetch: "+this.swfUrl);return e.ruffleIndexError=11,void this.panic(e)}const e=document.createElement("div");e.id="message_overlay",e.innerHTML=`
    \n

    Ruffle wasn't able to run the Flash embedded in this page.

    \n

    You can try to open the file in a separate tab, to sidestep this issue.

    \n \n
    `,this.container.prepend(e)}displayUnsupportedMessage(){const e=document.createElement("div");e.id="message_overlay",e.innerHTML='
    \n

    The Ruffle emulator does not yet support ActionScript 3, required by this content.

    \n

    If you choose to run it anyway, interactivity will be missing or limited.

    \n
    \n More info\n \n
    \n
    ',this.container.prepend(e),e.querySelector("#run-anyway-btn").onclick=()=>{e.parentNode.removeChild(e)}}displayMessage(e){const t=document.createElement("div");t.id="message_overlay",t.innerHTML=`
    \n

    ${e}

    \n
    \n \n
    \n
    `,this.container.prepend(t),this.container.querySelector("#continue-btn").onclick=()=>{t.parentNode.removeChild(t)}}debugPlayerInfo(){var e,t;return`Allows script access: ${null!==(t=null===(e=this.options)||void 0===e?void 0:e.allowScriptAccess)&&void 0!==t&&t}\n`}setMetadata(e){this._metadata=e,this._readyState=2,this.dispatchEvent(new Event(R.LOADED_METADATA)),this.dispatchEvent(new Event(R.LOADED_DATA))}setIsExtension(e){this.isExtension=e}}function F(e,t){switch(e||(e="sameDomain"),e.toLowerCase()){case"always":return!0;case"never":return!1;default:try{return new URL(window.location.href).origin===new URL(t,window.location.href).origin}catch(e){return!1}}}function j(e){return null===e||"true"===e.toLowerCase()}function P(e){if(e){let t="",n="";try{const i=new URL(e,_);t=i.pathname,n=i.hostname.replace("www.","")}catch(e){}if(t.startsWith("/v/")&&("youtube.com"===n||"youtube-nocookie.com"===n))return!0}return!1}function N(e,t){var n,i;const s=e.getAttribute(t),r=null!==(i=null===(n=window.RufflePlayer)||void 0===n?void 0:n.config)&&void 0!==i?i:{};if(s)try{const n=new URL(s);"http:"===n.protocol&&"https:"===window.location.protocol&&!1!==r.upgradeToHttps&&(n.protocol="https:",e.setAttribute(t,n.toString()))}catch(e){}}function O(e){if(e){let t="";try{t=new URL(e,_).pathname}catch(e){}if(t&&t.length>=4){const e=t.slice(-4).toLowerCase();if(".swf"===e||".spl"===e)return!0}}return!1}function T(e){let t=e.parentElement;for(;null!==t;){switch(t.tagName){case"AUDIO":case"VIDEO":return!0}t=t.parentElement}return!1}R.LOADED_METADATA="loadedmetadata",R.LOADED_DATA="loadeddata";class L extends R{constructor(){super()}connectedCallback(){var e,t,n,i,s,r,o,a,l,c,u,d,h,f,p;super.connectedCallback();const m=this.attributes.getNamedItem("src");if(m){const g=null!==(t=null===(e=this.attributes.getNamedItem("allowScriptAccess"))||void 0===e?void 0:e.value)&&void 0!==t?t:null,w=null!==(i=null===(n=this.attributes.getNamedItem("menu"))||void 0===n?void 0:n.value)&&void 0!==i?i:null;this.load({url:m.value,allowScriptAccess:F(g,m.value),parameters:null===(s=this.attributes.getNamedItem("flashvars"))||void 0===s?void 0:s.value,backgroundColor:null===(r=this.attributes.getNamedItem("bgcolor"))||void 0===r?void 0:r.value,base:null===(o=this.attributes.getNamedItem("base"))||void 0===o?void 0:o.value,menu:j(w),salign:null!==(l=null===(a=this.attributes.getNamedItem("salign"))||void 0===a?void 0:a.value)&&void 0!==l?l:"",quality:null!==(u=null===(c=this.attributes.getNamedItem("quality"))||void 0===c?void 0:c.value)&&void 0!==u?u:"high",scale:null!==(h=null===(d=this.attributes.getNamedItem("scale"))||void 0===d?void 0:d.value)&&void 0!==h?h:"showAll",wmode:null!==(p=null===(f=this.attributes.getNamedItem("wmode"))||void 0===f?void 0:f.value)&&void 0!==p?p:"window"})}}get src(){var e;return null===(e=this.attributes.getNamedItem("src"))||void 0===e?void 0:e.value}set src(e){if(e){const t=document.createAttribute("src");t.value=e,this.attributes.setNamedItem(t)}else this.attributes.removeNamedItem("src")}static get observedAttributes(){return["src","width","height"]}attributeChangedCallback(e,t,n){var i;if(super.attributeChangedCallback(e,t,n),this.isConnected&&"src"===e){let e;const t=this.attributes.getNamedItem("flashvars");t&&(e=t.value);const n=this.attributes.getNamedItem("src");n&&this.load({url:n.value,parameters:e,base:null===(i=this.attributes.getNamedItem("base"))||void 0===i?void 0:i.value})}}static isInterdictable(e){if(T(e))return!1;if(!e.getAttribute("src"))return!1;if(P(e.getAttribute("src")))return N(e,"src"),!1;const t=e.getAttribute("type");if(!t)return O(e.getAttribute("src"));switch(t.toLowerCase()){case x.toLowerCase():case k.toLowerCase():case E.toLowerCase():case I.toLowerCase():return!0;default:return!1}}static fromNativeEmbedElement(e){const t=b("ruffle-embed",L),n=document.createElement(t);return n.copyElement(e),n}}function M(e,t,n){t=t.toLowerCase();for(const n in e)if(Object.hasOwnProperty.call(e,n)&&t===n.toLowerCase())return e[n];return n}function U(e){var t,n;const i={};for(const s of e.children)if(s instanceof HTMLParamElement){const e=null===(t=s.attributes.getNamedItem("name"))||void 0===t?void 0:t.value,r=null===(n=s.attributes.getNamedItem("value"))||void 0===n?void 0:n.value;e&&r&&(i[e]=r)}return i}class D extends R{constructor(){super(),this.params={}}connectedCallback(){var e;super.connectedCallback(),this.params=U(this);let t=null;this.attributes.getNamedItem("data")?t=null===(e=this.attributes.getNamedItem("data"))||void 0===e?void 0:e.value:this.params.movie&&(t=this.params.movie);const n=M(this.params,"allowScriptAccess",null),i=M(this.params,"flashvars",this.getAttribute("flashvars")),s=M(this.params,"bgcolor",this.getAttribute("bgcolor")),r=M(this.params,"base",this.getAttribute("base")),o=M(this.params,"menu",null),a=M(this.params,"salign",""),l=M(this.params,"quality","high"),c=M(this.params,"scale","showAll"),u=M(this.params,"wmode","window");if(t){const e={url:t};e.allowScriptAccess=F(n,t),i&&(e.parameters=i),s&&(e.backgroundColor=s),r&&(e.base=r),e.menu=j(o),a&&(e.salign=a),l&&(e.quality=l),c&&(e.scale=c),u&&(e.wmode=u),this.load(e)}}debugPlayerInfo(){var e;let t=super.debugPlayerInfo();t+="Player type: Object\n";let n=null;return this.attributes.getNamedItem("data")?n=null===(e=this.attributes.getNamedItem("data"))||void 0===e?void 0:e.value:this.params.movie&&(n=this.params.movie),t+=`SWF URL: ${n}\n`,Object.keys(this.params).forEach((e=>{t+=`Param ${e}: ${this.params[e]}\n`})),Object.keys(this.attributes).forEach((e=>{var n;t+=`Attribute ${e}: ${null===(n=this.attributes.getNamedItem(e))||void 0===n?void 0:n.value}\n`})),t}get data(){return this.getAttribute("data")}set data(e){if(e){const t=document.createAttribute("data");t.value=e,this.attributes.setNamedItem(t)}else this.attributes.removeNamedItem("data")}static isInterdictable(e){var t,n;if(T(e))return!1;if(e.getElementsByTagName("ruffle-object").length>0||e.getElementsByTagName("ruffle-embed").length>0)return!1;const i=null===(t=e.attributes.getNamedItem("data"))||void 0===t?void 0:t.value.toLowerCase(),s=U(e);let r;if(i){if(P(i))return N(e,"data"),!1;r=O(i)}else{if(!s||!s.movie)return!1;if(P(s.movie)){const t=e.querySelector("param[name='movie']");if(t){N(t,"value");const n=t.getAttribute("value");n&&e.setAttribute("data",n)}return!1}r=O(s.movie)}const o=null===(n=e.attributes.getNamedItem("classid"))||void 0===n?void 0:n.value.toLowerCase();if(o==="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000".toLowerCase())return!Array.from(e.getElementsByTagName("object")).some(D.isInterdictable)&&!Array.from(e.getElementsByTagName("embed")).some(L.isInterdictable);if(o)return!1;const a=e.attributes.getNamedItem("type");if(!a)return r;switch(a.value.toLowerCase()){case x.toLowerCase():case k.toLowerCase():case E.toLowerCase():case I.toLowerCase():return!0;default:return!1}}static fromNativeObjectElement(e){const t=b("ruffle-object",D),n=document.createElement(t);for(const t of Array.from(e.getElementsByTagName("embed")))L.isInterdictable(t)&&t.remove();for(const t of Array.from(e.getElementsByTagName("object")))D.isInterdictable(t)&&t.remove();return n.copyElement(e),n}}var $,B;let q;const W=null!==(B=null===($=window.RufflePlayer)||void 0===$?void 0:$.config)&&void 0!==B?B:{},V=d(W)+"ruffle.js";let z,H,Y,Z;function Q(){try{z=null!=z?z:document.getElementsByTagName("object"),H=null!=H?H:document.getElementsByTagName("embed");for(const e of Array.from(z))if(D.isInterdictable(e)){const t=D.fromNativeObjectElement(e);t.setIsExtension(q),e.replaceWith(t)}for(const e of Array.from(H))if(L.isInterdictable(e)){const t=L.fromNativeEmbedElement(e);t.setIsExtension(q),e.replaceWith(t)}}catch(e){console.error(`Serious error encountered when polyfilling native Flash elements: ${e}`)}}function G(){Y=null!=Y?Y:document.getElementsByTagName("iframe"),Z=null!=Z?Z:document.getElementsByTagName("frame"),[Y,Z].forEach((e=>{for(let t=0;t{J(i,s)}),!1)}}))}async function J(e,t){var n;let i;await new Promise((e=>{window.setTimeout((()=>{e()}),100)}));try{if(i=e.document,!i)return}catch(e){return void(q||console.warn(t+e))}if(q||void 0===i.documentElement.dataset.ruffleOptout)if(q)e.RufflePlayer||(e.RufflePlayer={}),e.RufflePlayer.config=Object.assign(Object.assign({},W),null!==(n=e.RufflePlayer.config)&&void 0!==n?n:{});else if(!e.RufflePlayer){const t=i.createElement("script");t.setAttribute("src",V),t.onload=()=>{e.RufflePlayer={},e.RufflePlayer.config=W},i.head.appendChild(t)}}class X{constructor(e,t,n,i,s){this.major=e,this.minor=t,this.patch=n,this.prIdent=i,this.buildIdent=s}static fromSemver(e){const t=e.split("+"),n=t[0].split("-"),i=n[0].split("."),s=parseInt(i[0],10);let r=0,o=0,a=null,l=null;return void 0!==i[1]&&(r=parseInt(i[1],10)),void 0!==i[2]&&(o=parseInt(i[2],10)),void 0!==n[1]&&(a=n[1].split(".")),void 0!==t[1]&&(l=t[1].split(".")),new X(s,r,o,a,l)}isCompatibleWith(e){return 0!==this.major&&this.major===e.major||0===this.major&&0===e.major&&0!==this.minor&&this.minor===e.minor||0===this.major&&0===e.major&&0===this.minor&&0===e.minor&&0!==this.patch&&this.patch===e.patch}hasPrecedenceOver(e){if(this.major>e.major)return!0;if(this.majore.minor)return!0;if(this.minore.patch)return!0;if(this.patchparseInt(e.prIdent[n],10))return!0;if(parseInt(this.prIdent[n],10)e.prIdent[n])return!0;if(this.prIdent[n]e.prIdent.length}return!1}isEqual(e){return this.major===e.major&&this.minor===e.minor&&this.patch===e.patch}isStableOrCompatiblePrerelease(e){return null===e.prIdent||this.major===e.major&&this.minor===e.minor&&this.patch===e.patch}}class K{constructor(e){this.requirements=e}satisfiedBy(e){for(let t=0;t"===s?n=n&&e.hasPrecedenceOver(r):">="===s?n=n&&(e.hasPrecedenceOver(r)||r.isEqual(e)):"<"===s?n=n&&r.hasPrecedenceOver(e):"<="===s?n=n&&(r.hasPrecedenceOver(e)||r.isEqual(e)):"^"===s&&(n=n&&r.isCompatibleWith(e))}if(n)return!0}return!1}static fromRequirementString(e){const t=e.split(" ");let n=[];const i=[];for(let e=0;e0&&(i.push(n),n=[]);else if(t[e].length>0){const i=/[0-9]/.exec(t[e]);if(i){const s=t[e].slice(0,i.index).trim(),r=X.fromSemver(t[e].slice(i.index).trim());n.push({comparator:s,version:r})}}return n.length>0&&i.push(n),new K(i)}}class ee{constructor(e){this.sources={},this.config={},this.invoked=!1,this.newestName=null,this.conflict=null,null!=e&&(e instanceof ee?(this.sources=e.sources,this.config=e.config,this.invoked=e.invoked,this.conflict=e.conflict,this.newestName=e.newestName,e.superseded()):e.constructor===Object&&e.config instanceof Object?this.config=e.config:this.conflict=e),"loading"===document.readyState?document.addEventListener("readystatechange",this.init.bind(this)):window.setTimeout(this.init.bind(this),0)}get version(){return"0.1.0"}registerSource(e,t){this.sources[e]=t}newestSourceName(){let e=null,t=X.fromSemver("0.0.0");for(const n in this.sources)if(Object.prototype.hasOwnProperty.call(this.sources,n)){const i=X.fromSemver(this.sources[n].version);i.hasPrecedenceOver(t)&&(e=n,t=i)}return e}init(){if(!this.invoked){if(this.invoked=!0,this.newestName=this.newestSourceName(),null===this.newestName)throw new Error("No registered Ruffle source!");!1!==this.config.polyfills&&this.sources[this.newestName].polyfill("extension"===this.newestName)}}newest(){const e=this.newestSourceName();return null!==e?this.sources[e]:null}satisfying(e){const t=K.fromRequirementString(e);let n=null;for(const e in this.sources)if(Object.prototype.hasOwnProperty.call(this.sources,e)){const i=X.fromSemver(this.sources[e].version);t.satisfiedBy(i)&&(n=this.sources[e])}return n}localCompatible(){return void 0!==this.sources.local?this.satisfying("^"+this.sources.local.version):this.newest()}local(){return void 0!==this.sources.local?this.satisfying("="+this.sources.local.version):this.newest()}superseded(){this.invoked=!0}static negotiate(e,t,n){let i;return i=e instanceof ee?e:new ee(e),void 0!==t&&void 0!==n&&(i.registerSource(t,n),!1!==i.config.polyfills&&n.pluginPolyfill()),i}}window.RufflePlayer=ee.negotiate(window.RufflePlayer,"local",new class{constructor(e){this.name=e}get version(){return"0.1.0"}polyfill(e){!function(e){q=e,Q(),G(),new MutationObserver((function(e){e.some((e=>e.addedNodes.length>0))&&(Q(),G())})).observe(document,{childList:!0,subtree:!0})}(e)}pluginPolyfill(){!function(e){"install"in navigator.plugins&&navigator.plugins.install||Object.defineProperty(navigator,"plugins",{value:new g(navigator.plugins),writable:!1}),navigator.plugins.install(e),!(e.length>0)||"install"in navigator.mimeTypes&&navigator.mimeTypes.install||Object.defineProperty(navigator,"mimeTypes",{value:new p(navigator.mimeTypes),writable:!1});const t=navigator.mimeTypes;for(let n=0;n{"use strict";var e,t,n={285:(e,t,n)=>{e.exports=n.p+"2c87713f8cc6dda8ca91.wasm"},931:(e,t,n)=>{e.exports=n.p+"45264ba09d429505f426.wasm"}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,loaded:!1,exports:{}};return n[e](r,r.exports,s),r.loaded=!0,r.exports}s.m=n,s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"core.ruffle."+{662:"93de25ca9a00e07a2eca",966:"f45b5c0662b515254bf0"}[e]+".js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="ruffle-selfhosted:",s.l=(n,i,r,o)=>{if(e[n])e[n].push(i);else{var a,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{a.onerror=a.onload=null,clearTimeout(f);var s=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),s&&s.forEach((e=>e(i))),t)return t(i)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.p="",(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var i=s.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var r=new Promise(((n,s)=>i=e[t]=[n,s]));n.push(i[2]=r);var o=s.p+s.u(t),a=new Error;s.l(o,(n=>{if(s.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var r=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,i[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var i,r,[o,a,l]=n,c=0;if(o.some((t=>0!==e[t]))){for(i in a)s.o(a,i)&&(s.m[i]=a[i]);l&&l(s)}for(t&&t(n);c{const e=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11])),n=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11])),i=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11])),r=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]));function o(e){const t="function"==typeof Function.prototype.toString?Function.prototype.toString():null;return"string"==typeof t&&t.indexOf("[native code]")>=0&&Function.prototype.toString.call(e).indexOf("[native code]")>=0}let a="";try{if(void 0!==document.currentScript&&null!==document.currentScript&&"src"in document.currentScript&&""!==document.currentScript.src){let e=document.currentScript.src;e.endsWith(".js")||e.endsWith("/")||(e+="/"),a=new URL(".",e).href}}catch(e){console.warn("Unable to get currentScript URL")}function l(e){let t=a;return null!==e.publicPath&&void 0!==e.publicPath&&(t=e.publicPath),""===t||t.endsWith("/")||(t+="/"),t}let c=null;function u(a,u){return null===c&&(c=async function(a,c){"function"==typeof Array.prototype.reduce&&o(Array.prototype.reduce)||Object.defineProperty(Array.prototype,"reduce",{value(...e){if(0===e.length&&window.Prototype&&window.Prototype.Version&&window.Prototype.Version<"1.6.1")return this.length>1?this:this[0];const t=e[0];if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof t)throw new TypeError(`${t} is not a function`);const n=Object(this),i=n.length>>>0;let s,r=0;if(e.length>=2)s=e[1];else{for(;r=i)throw new TypeError("Reduce of empty array with no initial value");s=n[r++]}for(;re[t]}),"function"!=typeof Reflect.set&&Object.defineProperty(Reflect,"set",{value(e,t,n){e[t]=n}}),"function"!=typeof Reflect.has&&Object.defineProperty(Reflect,"has",{value:(e,t)=>t in e}),"function"!=typeof Reflect.ownKeys&&Object.defineProperty(Reflect,"ownKeys",{value:e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]});const u=(await Promise.all([e(),r(),n(),i(),t()])).every(Boolean);u||console.log("Some WebAssembly extensions are NOT available, falling back to the vanilla WebAssembly module"),s.p=l(a);const{default:d,Ruffle:h}=await(u?s.e(966).then(s.bind(s,966)):s.e(662).then(s.bind(s,662)));let f;const p=u?new URL(s(285),s.b):new URL(s(931),s.b),m=await fetch(p);if(c){const e=m.headers.get("content-length")||"";let t=0;const n=parseInt(e);f=new Response(new ReadableStream({async start(e){var i;const s=null===(i=m.body)||void 0===i?void 0:i.getReader();if(!s)throw"Response had no body";for(c(t,n);;){const{done:i,value:r}=await s.read();if(i)break;(null==r?void 0:r.byteLength)&&(t+=null==r?void 0:r.byteLength),e.enqueue(r),c(t,n)}e.close()}}),m)}else f=m;return await d(f),h}(a,u)),c}const d=document.createElement("template");d.innerHTML='\n \n \n\n
    \n
    \n
    Click to unmute
    \n
    \n \n\n
      \n';const h={};function f(e,t){if(void 0!==h[e]){if(h[e].class!==t)throw new Error("Internal naming conflict on "+e);return h[e].name}let n=0;if(void 0!==window.customElements)for(;n<999;){let i=e;if(n>0&&(i=i+"-"+n),void 0===window.customElements.get(i))return window.customElements.define(i,t),h[e]={class:t,name:i,internalName:e},i;n+=1}throw new Error("Failed to assign custom element "+e)}const p={allowScriptAccess:!1,parameters:{},autoplay:"auto",backgroundColor:null,letterbox:"fullscreen",unmuteOverlay:"visible",upgradeToHttps:!0,warnOnUnsupportedContent:!0,logLevel:"error",showSwfDownload:!1,contextMenu:!0,preloader:!0,maxExecutionDuration:{secs:15,nanos:0},base:null,menu:!0,salign:"",quality:"high",scale:"showAll",wmode:"opaque",publicPath:null,polyfills:!0},m="application/x-shockwave-flash",g="application/futuresplash",v="application/x-shockwave-flash2-preview",w="application/vnd.adobe.flash.movie",y="https://ruffle.rs",b=/^\s*(\d+(\.\d+)?(%)?)/;let x=!1;function k(e){if(null==e)return{};e instanceof URLSearchParams||(e=new URLSearchParams(e));const t={};for(const[n,i]of e)t[n]=i.toString();return t}class E extends HTMLElement{constructor(){return super(),this.contextMenuForceDisabled=!1,this.isTouch=!1,this.loadedConfig=p,this.panicked=!1,this.isExtension=!1,this.config={},this.shadow=this.attachShadow({mode:"open"}),this.shadow.appendChild(d.content.cloneNode(!0)),this.dynamicStyles=this.shadow.getElementById("dynamic_styles"),this.container=this.shadow.getElementById("container"),this.playButton=this.shadow.getElementById("play_button"),this.playButton.addEventListener("click",(()=>this.play())),this.unmuteOverlay=this.shadow.getElementById("unmute_overlay"),this.preloader=this.shadow.getElementById("preloader"),this.contextMenuElement=this.shadow.getElementById("context-menu"),this.addEventListener("contextmenu",this.showContextMenu.bind(this)),this.addEventListener("pointerdown",this.pointerDown.bind(this)),this.addEventListener("fullscreenchange",this.fullScreenChange.bind(this)),this.addEventListener("webkitfullscreenchange",this.fullScreenChange.bind(this)),window.addEventListener("click",this.hideContextMenu.bind(this)),this.instance=null,this.onFSCommand=null,this._readyState=0,this._metadata=null,this.lastActivePlayingState=!1,this.setupPauseOnTabHidden(),this}get readyState(){return this._readyState}get metadata(){return this._metadata}setupPauseOnTabHidden(){document.addEventListener("visibilitychange",(()=>{this.instance&&(document.hidden&&(this.lastActivePlayingState=this.instance.is_playing(),this.instance.pause()),document.hidden||!0!==this.lastActivePlayingState||this.instance.play())}),!1)}connectedCallback(){this.updateStyles()}static get observedAttributes(){return["width","height"]}attributeChangedCallback(e,t,n){"width"!==e&&"height"!==e||this.updateStyles()}disconnectedCallback(){this.destroy()}updateStyles(){if(this.dynamicStyles.sheet){if(this.dynamicStyles.sheet.rules)for(let e=0;e{if(console.error(`Serious error loading Ruffle: ${e}`),"file:"===window.location.protocol)e.ruffleIndexError=2;else{e.ruffleIndexError=9;const t=String(e.message).toLowerCase();t.includes("mime")?e.ruffleIndexError=8:t.includes("networkerror")||t.includes("failed to fetch")?e.ruffleIndexError=6:t.includes("disallowed by embedder")?e.ruffleIndexError=1:"CompileError"===e.name?e.ruffleIndexError=3:t.includes("could not download wasm module")&&"TypeError"===e.name?e.ruffleIndexError=7:"TypeError"===e.name?e.ruffleIndexError=5:navigator.userAgent.includes("Edg")&&t.includes("webassembly is not defined")&&(e.ruffleIndexError=10)}throw this.panic(e),e}));if(this.instance=await new t(this.container,this,this.loadedConfig),console.log("New Ruffle instance created (WebAssembly extensions: "+(t.is_wasm_simd_used()?"ON":"OFF")+")"),"running"!==this.audioState()&&(this.container.style.visibility="hidden",await new Promise((e=>{window.setTimeout((()=>{e()}),200)})),this.container.style.visibility=""),this.unmuteAudioContext(),"on"===this.loadedConfig.autoplay||"off"!==this.loadedConfig.autoplay&&"running"===this.audioState()){if(this.play(),"running"!==this.audioState()){"hidden"!==this.loadedConfig.unmuteOverlay&&(this.unmuteOverlay.style.display="block"),this.container.addEventListener("click",this.unmuteOverlayClicked.bind(this),{once:!0});const t=null===(e=this.instance)||void 0===e?void 0:e.audio_context();t&&(t.onstatechange=()=>{"running"===t.state&&this.unmuteOverlayClicked(),t.onstatechange=null})}}else this.playButton.style.display="block"}onRuffleDownloadProgress(e,t){const n=this.preloader.querySelector(".loadbarInner"),i=this.preloader.querySelector(".loadbar");Number.isNaN(t)?i&&(i.style.display="none"):n.style.width=e/t*100+"%"}destroy(){this.instance&&(this.instance.destroy(),this.instance=null,this._metadata=null,this._readyState=0,console.log("Ruffle instance destroyed."))}checkOptions(e){if("string"==typeof e)return{url:e};const t=(e,t)=>{if(!e){const e=new TypeError(t);throw e.ruffleIndexError=4,this.panic(e),e}};return t(null!==e&&"object"==typeof e,"Argument 0 must be a string or object"),t("url"in e||"data"in e,"Argument 0 must contain a `url` or `data` key"),t(!("url"in e)||"string"==typeof e.url,"`url` must be a string"),e}async load(e){var t,n;if(e=this.checkOptions(e),this.isConnected&&!this.isUnusedFallbackObject()){if(!q(this))try{if(this.loadedConfig=Object.assign(Object.assign(Object.assign(Object.assign({},p),null!==(n=null===(t=window.RufflePlayer)||void 0===t?void 0:t.config)&&void 0!==n?n:{}),this.config),e),this.loadedConfig.allowScriptAccess=!0===e.allowScriptAccess,this.loadedConfig.backgroundColor&&"transparent"!==this.loadedConfig.wmode&&(this.container.style.backgroundColor=this.loadedConfig.backgroundColor),await this.ensureFreshInstance(),"url"in e){console.log(`Loading SWF file ${e.url}`),this.swfUrl=new URL(e.url,document.baseURI);const t=Object.assign(Object.assign({},k(e.url.substring(e.url.indexOf("?")))),k(e.parameters));this.instance.stream_from(this.swfUrl.href,t)}else"data"in e&&(console.log("Loading SWF data"),this.instance.load_data(new Uint8Array(e.data),k(e.parameters)))}catch(e){throw console.error(`Serious error occurred loading SWF file: ${e}`),e}}else console.warn("Ignoring attempt to play a disconnected or suspended Ruffle element")}play(){this.instance&&(this.instance.play(),this.playButton.style.display="none")}get isPlaying(){return!!this.instance&&this.instance.is_playing()}get volume(){return this.instance?this.instance.volume():1}set volume(e){this.instance&&this.instance.set_volume(e)}get fullscreenEnabled(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}get isFullscreen(){return(document.fullscreenElement||document.webkitFullscreenElement)===this}setFullscreen(e){this.fullscreenEnabled&&(e?this.enterFullscreen():this.exitFullscreen())}enterFullscreen(){const e={navigationUI:"hide"};this.requestFullscreen?this.requestFullscreen(e):this.webkitRequestFullscreen?this.webkitRequestFullscreen(e):this.webkitRequestFullScreen&&this.webkitRequestFullScreen(e)}exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}fullScreenChange(){var e;null===(e=this.instance)||void 0===e||e.set_fullscreen(this.isFullscreen)}pointerDown(e){"touch"!==e.pointerType&&"pen"!==e.pointerType||(this.isTouch=!0)}async downloadSwf(){try{if(this.swfUrl){console.log("Downloading SWF: "+this.swfUrl);const e=await fetch(this.swfUrl.href);if(!e.ok)return void console.error("SWF download failed");const t=await e.blob(),n=URL.createObjectURL(t),i=document.createElement("a");i.style.display="none",i.href=n,i.download=function(e){const t=e.pathname;return t.substring(t.lastIndexOf("/")+1)}(this.swfUrl),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}else console.error("SWF download failed")}catch(e){console.error("SWF download failed")}}contextMenuItems(){const e=String.fromCharCode(10003),t=[];this.instance&&this.instance.prepare_context_menu().forEach(((n,i)=>{n.separatorBefore&&t.push(null),t.push({text:n.caption+(n.checked?` (${e})`:""),onClick:()=>{var e;return null===(e=this.instance)||void 0===e?void 0:e.run_context_menu_callback(i)},enabled:n.enabled})})),t.push(null),this.fullscreenEnabled&&(this.isFullscreen?t.push({text:"Exit fullscreen",onClick:()=>{var e;return null===(e=this.instance)||void 0===e?void 0:e.set_fullscreen(!1)}}):t.push({text:"Enter fullscreen",onClick:()=>{var e;return null===(e=this.instance)||void 0===e?void 0:e.set_fullscreen(!0)}})),this.instance&&this.swfUrl&&!0===this.loadedConfig.showSwfDownload&&(t.push(null),t.push({text:"Download .swf",onClick:this.downloadSwf.bind(this)})),window.isSecureContext&&t.push({text:"Copy debug info",onClick:()=>navigator.clipboard.writeText(this.getPanicData())}),t.push(null);const n=this.isExtension?"extension":"";return t.push({text:`About Ruffle ${n} (nightly 2022-11-25)`,onClick(){window.open(y,"_blank")}}),this.isTouch&&(t.push(null),t.push({text:"Hide this menu",onClick:()=>this.contextMenuForceDisabled=!0})),t}showContextMenu(e){if(e.preventDefault(),!1===this.loadedConfig.contextMenu||this.contextMenuForceDisabled)return;for(;this.contextMenuElement.firstChild;)this.contextMenuElement.removeChild(this.contextMenuElement.firstChild);for(const e of this.contextMenuItems())if(null===e){if(!this.contextMenuElement.lastElementChild)continue;if(this.contextMenuElement.lastElementChild.classList.contains("menu_separator"))continue;const e=document.createElement("li");e.className="menu_separator";const t=document.createElement("hr");e.appendChild(t),this.contextMenuElement.appendChild(e)}else{const{text:t,onClick:n,enabled:i}=e,s=document.createElement("li");s.className="menu_item",s.textContent=t,this.contextMenuElement.appendChild(s),!1!==i?s.addEventListener("click",n):s.classList.add("disabled")}this.contextMenuElement.style.left="0",this.contextMenuElement.style.top="0",this.contextMenuElement.style.display="block";const t=this.getBoundingClientRect(),n=e.clientX-t.x,i=e.clientY-t.y,s=t.width-this.contextMenuElement.clientWidth-1,r=t.height-this.contextMenuElement.clientHeight-1;this.contextMenuElement.style.left=Math.floor(Math.min(n,s))+"px",this.contextMenuElement.style.top=Math.floor(Math.min(i,r))+"px"}hideContextMenu(){var e;null===(e=this.instance)||void 0===e||e.clear_custom_menu_items(),this.contextMenuElement.style.display="none"}pause(){this.instance&&(this.instance.pause(),this.playButton.style.display="block")}audioState(){if(this.instance){const e=this.instance.audio_context();return e&&e.state||"running"}return"suspended"}unmuteOverlayClicked(){if(this.instance){if("running"!==this.audioState()){const e=this.instance.audio_context();e&&e.resume()}this.unmuteOverlay.style.display="none"}}unmuteAudioContext(){x||(navigator.maxTouchPoints<1?x=!0:this.container.addEventListener("click",(()=>{var e;if(x)return;const t=null===(e=this.instance)||void 0===e?void 0:e.audio_context();if(!t)return;const n=new Audio;n.src=(()=>{const e=new ArrayBuffer(10),n=new DataView(e),i=t.sampleRate;return n.setUint32(0,i,!0),n.setUint32(4,i,!0),n.setUint16(8,1,!0),`data:audio/wav;base64,UklGRisAAABXQVZFZm10IBAAAAABAAEA${window.btoa(String.fromCharCode(...new Uint8Array(e))).slice(0,13)}AgAZGF0YQcAAACAgICAgICAAAA=`})(),n.load(),n.play().then((()=>{x=!0})).catch((e=>{console.warn(`Failed to play dummy sound: ${e}`)}))}),{once:!0}))}copyElement(e){if(e){for(let t=0;tnull==t?void 0:t.call_exposed_callback(e,n)}set traceObserver(e){var t;null===(t=this.instance)||void 0===t||t.set_trace_observer(e)}getPanicData(){const e=[];if(e.push("\n# Player Info\n"),e.push(this.debugPlayerInfo()),e.push("\n# Page Info\n"),e.push(`Page URL: ${document.location.href}\n`),this.swfUrl&&e.push(`SWF URL: ${this.swfUrl}\n`),e.push("\n# Browser Info\n"),e.push(`User Agent: ${window.navigator.userAgent}\n`),e.push(`Platform: ${window.navigator.platform}\n`),e.push(`Has touch support: ${window.navigator.maxTouchPoints>0}\n`),e.push("\n# Ruffle Info\n"),e.push("Version: 0.1.0\n"),e.push("Name: nightly 2022-11-25\n"),e.push("Channel: nightly\n"),e.push("Built: 2022-11-25T00:16:08.207Z\n"),e.push("Commit: 14f27a9e4a2f7c838bb680c98cf8697df2888022\n"),e.push(`Is extension: ${this.isExtension}\n`),e.push("\n# Metadata\n"),this.metadata)for(const[t,n]of Object.entries(this.metadata))e.push(`${t}: ${n}\n`);return e.join("")}panic(e){var t;if(this.panicked)return;if(this.panicked=!0,this.hidePreloader(),e instanceof Error&&("AbortError"===e.name||e.message.includes("AbortError")))return;const n=null!==(t=null==e?void 0:e.ruffleIndexError)&&void 0!==t?t:0,i=Object.assign([],{stackIndex:-1,avmStackIndex:-1});if(i.push("# Error Info\n"),e instanceof Error){if(i.push(`Error name: ${e.name}\n`),i.push(`Error message: ${e.message}\n`),e.stack){const t=i.push(`Error stack:\n\`\`\`\n${e.stack}\n\`\`\`\n`)-1;if(e.avmStack){const t=i.push(`AVM2 stack:\n\`\`\`\n ${e.avmStack.trim().replace(/\t/g," ")}\n\`\`\`\n`)-1;i.avmStackIndex=t}i.stackIndex=t}}else i.push(`Error: ${e}\n`);i.push(this.getPanicData());const s=i.join(""),r=new Date("2022-11-25T00:16:08.207Z"),o=new Date;o.setMonth(o.getMonth()-6);const a=o>r;let l,c,u;if(a)l=`Update Ruffle`;else{const e=document.location.href.split(/[?#]/)[0];let t=`https://github.com/ruffle-rs/ruffle/issues/new?title=${encodeURIComponent(`Error on ${e}`)}&template=error_report.md&labels=error-report&body=`,n=encodeURIComponent(s);i.stackIndex>-1&&String(t+n).length>8195&&(i[i.stackIndex]=null,i.avmStackIndex>-1&&(i[i.avmStackIndex]=null),n=encodeURIComponent(i.join(""))),t+=n,l=`Report Bug`}switch(n){case 2:c='\n

      It appears you are running Ruffle on the "file:" protocol.

      \n

      This doesn\'t work as browsers block many features from working for security reasons.

      \n

      Instead, we invite you to setup a local server or either use the web demo or the desktop application.

      \n ',u=`\n
    • Web Demo
    • \n
    • Desktop Application
    • \n `;break;case 4:c="\n

      Ruffle has encountered a major issue due to an incorrect JavaScript configuration.

      \n

      If you are the server administrator, we invite you to check the error details to find out which parameter is at fault.

      \n

      You can also consult the Ruffle wiki for help.

      \n ",u='\n
    • View Ruffle Wiki
    • \n
    • View Error Details
    • \n ';break;case 9:c='\n

      Ruffle failed to load the required ".wasm" file component.

      \n

      If you are the server administrator, please ensure the file has correctly been uploaded.

      \n

      If the issue persists, you may need to use the "publicPath" setting: please consult the Ruffle wiki for help.

      \n ',u='\n
    • View Ruffle Wiki
    • \n
    • View Error Details
    • \n ';break;case 8:c='\n

      Ruffle has encountered a major issue whilst trying to initialize.

      \n

      This web server is not serving ".wasm" files with the correct MIME type.

      \n

      If you are the server administrator, please consult the Ruffle wiki for help.

      \n ',u='\n
    • View Ruffle Wiki
    • \n
    • View Error Details
    • \n ';break;case 11:c="\n

      Ruffle failed to load the Flash SWF file.

      \n

      The most likely reason is that the file no longer exists, so there is nothing for Ruffle to load.

      \n

      Try contacting the website administrator for help.

      \n ",u='\n
    • View Error Details
    • \n ';break;case 6:c='\n

      Ruffle failed to load the required ".wasm" file component.

      \n

      Access to fetch has likely been blocked by CORS policy.

      \n

      If you are the server administrator, please consult the Ruffle wiki for help.

      \n ',u='\n
    • View Ruffle Wiki
    • \n
    • View Error Details
    • \n ';break;case 3:c="\n

      Ruffle has encountered a major issue whilst trying to initialize.

      \n

      It seems like this page has missing or invalid files for running Ruffle.

      \n

      If you are the server administrator, please consult the Ruffle wiki for help.

      \n ",u='\n
    • View Ruffle Wiki
    • \n
    • View Error Details
    • \n ';break;case 7:c="\n

      Ruffle has encountered a major issue whilst trying to initialize.

      \n

      This can often resolve itself, so you can try reloading the page.

      \n

      Otherwise, please contact the website administrator.

      \n ",u='\n
    • View Error Details
    • \n ';break;case 10:c='\n

      Ruffle failed to load the required ".wasm" file component.

      \n

      To fix this, try opening your browser\'s settings, clicking "Privacy, search, and services", scrolling down, and turning off "Enhance your security on the web".

      \n

      This will allow your browser to load the required ".wasm" files.

      \n

      If the issue persists, you might have to use a different browser.

      \n ',u='\n
    • More Information
    • \n
    • View Error Details
    • \n ';break;case 5:c="\n

      Ruffle has encountered a major issue whilst trying to initialize.

      \n

      It seems like this page uses JavaScript code that conflicts with Ruffle.

      \n

      If you are the server administrator, we invite you to try loading the file on a blank page.

      \n ",a&&(c+="

      You can also try to upload a more recent version of Ruffle that may circumvent the issue (current build is outdated: 2022-11-25T00:16:08.207Z).

      "),u=`\n
    • ${l}
    • \n
    • View Error Details
    • \n `;break;case 1:c='\n

      Ruffle has encountered a major issue whilst trying to initialize.

      \n

      This web server\'s Content Security Policy does not allow the required ".wasm" component to run.

      \n

      If you are the server administrator, please consult the Ruffle wiki for help.

      \n ',u='\n
    • View Ruffle Wiki
    • \n
    • View Error Details
    • \n ';break;default:c="

      Ruffle has encountered a major issue whilst trying to display this Flash content.

      ",c+=a?"

      If you are the server administrator, please try to upload a more recent version of Ruffle (current build is outdated: 2022-11-25T00:16:08.207Z).

      ":"

      This isn't supposed to happen, so we'd really appreciate if you could file a bug!

      ",u=`\n
    • ${l}
    • \n
    • View Error Details
    • \n `}this.container.innerHTML=`\n
      \n
      Something went wrong :(
      \n
      ${c}
      \n \n
      \n `;const d=this.container.querySelector("#panic-view-details");d&&(d.onclick=()=>{const e=this.container.querySelector("#panic-body");return e.classList.add("details"),e.innerHTML=``,!1}),this.destroy()}displayRootMovieDownloadFailedMessage(){if(window.location.origin===this.swfUrl.origin||!this.isExtension||!window.location.protocol.includes("http")){const e=new Error("Failed to fetch: "+this.swfUrl);return e.ruffleIndexError=11,void this.panic(e)}this.hidePreloader();const e=document.createElement("div");e.id="message_overlay",e.innerHTML=`
      \n

      Ruffle wasn't able to run the Flash embedded in this page.

      \n

      You can try to open the file in a separate tab, to sidestep this issue.

      \n \n
      `,this.container.prepend(e)}displayUnsupportedMessage(){const e=document.createElement("div");e.id="message_overlay",e.innerHTML='
      \n

      The Ruffle emulator does not yet support ActionScript 3, required by this content.

      \n

      If you choose to run it anyway, interactivity will be missing or limited.

      \n
      \n More info\n \n
      \n
      ',this.container.prepend(e),e.querySelector("#run-anyway-btn").onclick=()=>{e.parentNode.removeChild(e)}}displayMessage(e){const t=document.createElement("div");t.id="message_overlay",t.innerHTML=`
      \n

      ${e}

      \n
      \n \n
      \n
      `,this.container.prepend(t),this.container.querySelector("#continue-btn").onclick=()=>{t.parentNode.removeChild(t)}}debugPlayerInfo(){let e=`Allows script access: ${this.loadedConfig.allowScriptAccess}\n`;return this.instance&&(e+=`Renderer: ${this.instance.renderer_name()}\n`),e}hidePreloader(){this.preloader.classList.add("hidden"),this.container.classList.remove("hidden")}showPreloader(){this.preloader.classList.remove("hidden"),this.container.classList.add("hidden")}setMetadata(e){this._metadata=e,this._readyState=2,this.hidePreloader(),this.dispatchEvent(new Event(E.LOADED_METADATA)),this.dispatchEvent(new Event(E.LOADED_DATA))}setIsExtension(e){this.isExtension=e}}function I(e,t){switch(e||(e="sameDomain"),e.toLowerCase()){case"always":return!0;case"never":return!1;default:try{return new URL(window.location.href).origin===new URL(t,window.location.href).origin}catch(e){return!1}}}function S(e){return null===e||"true"===e.toLowerCase()}function _(e){if(e){let t="",n="";try{const i=new URL(e,y);t=i.pathname,n=i.hostname.replace("www.","")}catch(e){}if(t.startsWith("/v/")&&("youtube.com"===n||"youtube-nocookie.com"===n))return!0}return!1}function A(e,t){var n,i;const s=e.getAttribute(t),r=null!==(i=null===(n=window.RufflePlayer)||void 0===n?void 0:n.config)&&void 0!==i?i:{};if(s)try{const n=new URL(s);"http:"===n.protocol&&"https:"===window.location.protocol&&!1!==r.upgradeToHttps&&(n.protocol="https:",e.setAttribute(t,n.toString()))}catch(e){}}function C(e){if(e){let t="";try{t=new URL(e,y).pathname}catch(e){}if(t&&t.length>=4){const e=t.slice(-4).toLowerCase();if(".swf"===e||".spl"===e)return!0}}return!1}function R(e){switch(e.toLowerCase()){case m.toLowerCase():case g.toLowerCase():case v.toLowerCase():case w.toLowerCase():return!0;default:return!1}}function q(e){let t=e.parentElement;for(;null!==t;){switch(t.tagName){case"AUDIO":case"VIDEO":return!0}t=t.parentElement}return!1}E.LOADED_METADATA="loadedmetadata",E.LOADED_DATA="loadeddata";class F{constructor(e){if(this.__mimetypes=[],this.__named_mimetypes={},e)for(let t=0;t{t+=`Param ${e}: ${this.params[e]}\n`})),Object.keys(this.attributes).forEach((e=>{var n;t+=`Attribute ${e}: ${null===(n=this.attributes.getNamedItem(e))||void 0===n?void 0:n.value}\n`})),t}get data(){return this.getAttribute("data")}set data(e){if(e){const t=document.createAttribute("data");t.value=e,this.attributes.setNamedItem(t)}else this.attributes.removeNamedItem("data")}static isInterdictable(e){var t,n;if(q(e))return!1;if(e.getElementsByTagName("ruffle-object").length>0||e.getElementsByTagName("ruffle-embed").length>0)return!1;const i=null===(t=e.attributes.getNamedItem("data"))||void 0===t?void 0:t.value.toLowerCase(),s=L(e);let r;if(i){if(_(i))return A(e,"data"),!1;r=C(i)}else{if(!s||!s.movie)return!1;if(_(s.movie)){const t=e.querySelector("param[name='movie']");if(t){A(t,"value");const n=t.getAttribute("value");n&&e.setAttribute("data",n)}return!1}r=C(s.movie)}const o=null===(n=e.attributes.getNamedItem("classid"))||void 0===n?void 0:n.value.toLowerCase();if(o==="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000".toLowerCase())return!Array.from(e.getElementsByTagName("object")).some(M.isInterdictable)&&!Array.from(e.getElementsByTagName("embed")).some(N.isInterdictable);if(o)return!1;const a=e.attributes.getNamedItem("type");return a?R(a.value):r}static fromNativeObjectElement(e){const t=f("ruffle-object",M),n=document.createElement(t);for(const t of Array.from(e.getElementsByTagName("embed")))N.isInterdictable(t)&&t.remove();for(const t of Array.from(e.getElementsByTagName("object")))M.isInterdictable(t)&&t.remove();return n.copyElement(e),n}}var U,D;let $;const B=null!==(D=null===(U=window.RufflePlayer)||void 0===U?void 0:U.config)&&void 0!==D?D:{},W=l(B)+"ruffle.js";let V,H,z,Z;function Y(){try{V=null!=V?V:document.getElementsByTagName("object"),H=null!=H?H:document.getElementsByTagName("embed");for(const e of Array.from(V))if(M.isInterdictable(e)){const t=M.fromNativeObjectElement(e);t.setIsExtension($),e.replaceWith(t)}for(const e of Array.from(H))if(N.isInterdictable(e)){const t=N.fromNativeEmbedElement(e);t.setIsExtension($),e.replaceWith(t)}}catch(e){console.error(`Serious error encountered when polyfilling native Flash elements: ${e}`)}}function Q(){z=null!=z?z:document.getElementsByTagName("iframe"),Z=null!=Z?Z:document.getElementsByTagName("frame"),[z,Z].forEach((e=>{for(let t=0;t{G(i,s)}),!1)}}))}async function G(e,t){var n;let i;await new Promise((e=>{window.setTimeout((()=>{e()}),100)}));try{if(i=e.document,!i)return}catch(e){return void($||console.warn(t+e))}if($||void 0===i.documentElement.dataset.ruffleOptout)if($)e.RufflePlayer||(e.RufflePlayer={}),e.RufflePlayer.config=Object.assign(Object.assign({},B),null!==(n=e.RufflePlayer.config)&&void 0!==n?n:{});else if(!e.RufflePlayer){const t=i.createElement("script");t.setAttribute("src",W),t.onload=()=>{e.RufflePlayer={},e.RufflePlayer.config=B},i.head.appendChild(t)}}class J{constructor(e,t,n,i,s){this.major=e,this.minor=t,this.patch=n,this.prIdent=i,this.buildIdent=s}static fromSemver(e){const t=e.split("+"),n=t[0].split("-"),i=n[0].split("."),s=parseInt(i[0],10);let r=0,o=0,a=null,l=null;return void 0!==i[1]&&(r=parseInt(i[1],10)),void 0!==i[2]&&(o=parseInt(i[2],10)),void 0!==n[1]&&(a=n[1].split(".")),void 0!==t[1]&&(l=t[1].split(".")),new J(s,r,o,a,l)}isCompatibleWith(e){return 0!==this.major&&this.major===e.major||0===this.major&&0===e.major&&0!==this.minor&&this.minor===e.minor||0===this.major&&0===e.major&&0===this.minor&&0===e.minor&&0!==this.patch&&this.patch===e.patch}hasPrecedenceOver(e){if(this.major>e.major)return!0;if(this.majore.minor)return!0;if(this.minore.patch)return!0;if(this.patchparseInt(e.prIdent[n],10))return!0;if(parseInt(this.prIdent[n],10)e.prIdent[n])return!0;if(this.prIdent[n]e.prIdent.length}return!1}isEqual(e){return this.major===e.major&&this.minor===e.minor&&this.patch===e.patch}isStableOrCompatiblePrerelease(e){return null===e.prIdent||this.major===e.major&&this.minor===e.minor&&this.patch===e.patch}}class K{constructor(e){this.requirements=e}satisfiedBy(e){for(let t=0;t"===s?n=n&&e.hasPrecedenceOver(r):">="===s?n=n&&(e.hasPrecedenceOver(r)||r.isEqual(e)):"<"===s?n=n&&r.hasPrecedenceOver(e):"<="===s?n=n&&(r.hasPrecedenceOver(e)||r.isEqual(e)):"^"===s&&(n=n&&r.isCompatibleWith(e))}if(n)return!0}return!1}static fromRequirementString(e){const t=e.split(" ");let n=[];const i=[];for(let e=0;e0&&(i.push(n),n=[]);else if(t[e].length>0){const i=/[0-9]/.exec(t[e]);if(i){const s=t[e].slice(0,i.index).trim(),r=J.fromSemver(t[e].slice(i.index).trim());n.push({comparator:s,version:r})}}return n.length>0&&i.push(n),new K(i)}}const X={version:"0.1.0",polyfill(e){!function(e){$=e,Y(),Q(),new MutationObserver((function(e){e.some((e=>e.addedNodes.length>0))&&(Y(),Q())})).observe(document,{childList:!0,subtree:!0})}(e)},pluginPolyfill(){!function(e){"install"in navigator.plugins&&navigator.plugins.install||Object.defineProperty(navigator,"plugins",{value:new j(navigator.plugins),writable:!1}),navigator.plugins.install(e),!(e.length>0)||"install"in navigator.mimeTypes&&navigator.mimeTypes.install||Object.defineProperty(navigator,"mimeTypes",{value:new F(navigator.mimeTypes),writable:!1});const t=navigator.mimeTypes;for(let n=0;n{r.push(this.encodeBuffer(t,e))})),r.join("\n")}return this.encodeBuffer(t,e)}static encodeBuffer(t,e){const r=Ec.ep.ToBase64(t);let i,n=0;const s=Array();for(;n1?(i=t[0]||i,r=t[1]||r,e=t[2]||sm.get()):e=t[0]||sm.get(),e.subtle.importKey("spki",this.rawData,i,!0,r)}onInit(t){const e=cp.resolve(am),r=this.algorithm=e.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case df:{const e=Au.parse(t.subjectPublicKey,Uf),i=Ec.vJ.toUint8Array(e.modulus);r.publicExponent=Ec.vJ.toUint8Array(e.publicExponent),r.modulusLength=(i[0]?i:i.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var e;let r,i="SHA-1";return t.length>=1&&!(null===(e=t[0])||void 0===e?void 0:e.subtle)?(i=t[0]||i,r=t[1]||sm.get()):r=t[0]||sm.get(),await r.subtle.digest(i,this.rawData)}async getKeyIdentifier(t){t||(t=sm.get());const e=Au.parse(this.rawData,Yd);return await t.subtle.digest("SHA-1",e.subjectPublicKey)}}class um{constructor(){this.items={}}get(t){return this.items[t]||null}register(t,e){this.items[t]=e,this.items[e]=t}}const dm=new um;function fm(t,e){return`\\${Ec.ep.ToHex(Ec.ep.FromUtf8String(e)).toUpperCase()}`}dm.register("CN","2.5.4.3"),dm.register("L","2.5.4.7"),dm.register("ST","2.5.4.8"),dm.register("O","2.5.4.10"),dm.register("OU","2.5.4.11"),dm.register("C","2.5.4.6"),dm.register("DC","0.9.2342.19200300.100.1.25"),dm.register("E","1.2.840.113549.1.9.1"),dm.register("G","2.5.4.42"),dm.register("I","2.5.4.43"),dm.register("SN","2.5.4.4"),dm.register("T","2.5.4.12");class pm{constructor(t,e={}){this.extraNames=new um,this.asn=new Lu;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];this.extraNames.register(t,r)}"string"==typeof t?this.asn=this.fromString(t):t instanceof Lu?this.asn=t:Ec.vJ.isBufferSource(t)?this.asn=Au.parse(t,Lu):this.asn=this.fromJSON(t)}static isASCII(t){for(let e=0;e255)return!1}return!0}getName(t){return this.extraNames.get(t)||dm.get(t)}toString(){return this.asn.map((t=>t.map((t=>{const e=this.getName(t.type)||t.type,r=t.value.anyValue?`#${Ec.ep.ToHex(t.value.anyValue)}`:function(t){return t.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,fm)}(t.value.toString());return`${e}=${r}`})).join("+"))).join(", ")}toJSON(){var t;const e=[];for(const r of this.asn){const i={};for(const e of r){const r=this.getName(e.type)||e.type;null!==(t=i[r])&&void 0!==t||(i[r]=[]),i[r].push(e.value.anyValue?`#${Ec.ep.ToHex(e.value.anyValue)}`:e.value.toString())}e.push(i)}return e}fromString(t){const e=new Lu,r=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let i=null,n=",";for(;i=r.exec(`${t},`);){let[,t,r]=i;const s=r[r.length-1];","!==s&&"+"!==s||(r=r.slice(0,r.length-1),i[3]=s);const o=i[3];if(/[\d.]+/.test(t)||(t=this.getName(t)||""),!t)throw new Error(`Cannot get OID for name type '${t}'`);const a=new Bu({type:t});if("#"===r.charAt(0))a.value.anyValue=Ec.ep.FromHex(r.slice(1));else{const e=/"(.*?[^\\])?"/.exec(r);e&&(r=e[1]),r=r.replace(/\\0a/gi,"\n").replace(/\\0d/gi,"\r").replace(/\\0g/gi,"\t").replace(/\\(.)/g,"$1"),t===this.getName("E")||t===this.getName("DC")?a.value.ia5String=r:pm.isASCII(r)?a.value.printableString=r:a.value.utf8String=r}"+"===n?e[e.length-1].push(a):e.push(new Nu([a])),n=o}return e}fromJSON(t){const e=new Lu;for(const r of t){const t=new Nu;for(const e in r){let i=e;if(/[\d.]+/.test(e)||(i=this.getName(e)||""),!i)throw new Error(`Cannot get OID for name type '${e}'`);const n=r[e];for(const e of n){const r=new Bu({type:i});if("object"==typeof e)for(const t in e)switch(t){case"ia5String":r.value.ia5String=e[t];break;case"utf8String":r.value.utf8String=e[t];break;case"universalString":r.value.universalString=e[t];break;case"bmpString":r.value.bmpString=e[t];break;case"printableString":r.value.printableString=e[t]}else"#"===e[0]?r.value.anyValue=Ec.ep.FromHex(e.slice(1)):i===this.getName("E")||i===this.getName("DC")?r.value.ia5String=e:r.value.printableString=e;t.push(r)}}e.push(t)}return e}toArrayBuffer(){return Au.serialize(this.asn)}async getThumbprint(...t){var e;let r,i="SHA-1";return t.length>=1&&!(null===(e=t[0])||void 0===e?void 0:e.subtle)?(i=t[0]||i,r=t[1]||sm.get()):r=t[0]||sm.get(),await r.subtle.digest(i,this.toArrayBuffer())}}class gm{static register(t,e){this.items.set(t,e)}static create(t){const e=new rm(t),r=this.items.get(e.type);return r?new r(t):e}}gm.items=new Map;const wm="crypto.signatureFormatter";class mm extends lm{constructor(t){lm.isAsnEncoded(t)?super(t,af):super(t),this.tag="CERTIFICATE"}onInit(t){const e=t.tbsCertificate;this.tbs=Au.serialize(e),this.serialNumber=Ec.ep.ToHex(e.serialNumber),this.subjectName=new pm(e.subject),this.subject=new pm(e.subject).toString(),this.issuerName=new pm(e.issuer),this.issuer=this.issuerName.toString();const r=cp.resolve(am);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const i=e.validity.notBefore.utcTime||e.validity.notBefore.generalTime;if(!i)throw new Error("Cannot get 'notBefore' value");this.notBefore=i;const n=e.validity.notAfter.utcTime||e.validity.notAfter.generalTime;if(!n)throw new Error("Cannot get 'notAfter' value");this.notAfter=n,this.extensions=[],e.extensions&&(this.extensions=e.extensions.map((t=>gm.create(Au.serialize(t))))),this.publicKey=new hm(e.subjectPublicKeyInfo)}getExtension(t){for(const e of this.extensions)if("string"==typeof t){if(e.type===t)return e}else if(e instanceof t)return e;return null}getExtensions(t){return this.extensions.filter((e=>"string"==typeof t?e.type===t:e instanceof t))}async verify(t={},e=sm.get()){let r,i;const n=t.publicKey;try{if(n)if("publicKey"in n)r={...n.publicKey.algorithm,...this.signatureAlgorithm},i=await n.publicKey.export(r,["verify"]);else if(n instanceof hm)r={...n.algorithm,...this.signatureAlgorithm},i=await n.export(r,["verify"]);else if(Ec.vJ.isBufferSource(n)){const t=new hm(n);r={...t.algorithm,...this.signatureAlgorithm},i=await t.export(r,["verify"])}else r={...n.algorithm,...this.signatureAlgorithm},i=n;else r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],e)}catch(t){return!1}const s=cp.resolveAll(wm).reverse();let o=null;for(const t of s)if(o=t.toWebSignature(r,this.signature),o)break;if(!o)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const a=await e.subtle.verify(this.signatureAlgorithm,i,o,this.tbs);if(t.signatureOnly)return a;{const e=(t.date||new Date).getTime();return a&&this.notBefore.getTime()e<3?Ec.ep.ToHex(new Uint8Array(Ec.ep.FromHex(t)).reverse()):t)).join("");r.push(new Du({otherName:new Uu({typeId:Am.GUID,value:Au.serialize(new uu(Ec.ep.FromHex(i)))})}))}for(const t of e.ip||[])r.push(new Du({iPAddress:t}));for(const t of e.url||[])r.push(new Du({uniformResourceIdentifier:t}));for(const t of e.upn||[])r.push(new Du({otherName:new Uu({typeId:Am.UPN,value:Au.serialize(Kh.toASN(t))})}));for(const t of e.registeredId||[])r.push(new Du({registeredID:t}));for(const t of e.otherName||[])r.push(new Du({otherName:new Uu({typeId:t.type,value:Ec.ep.FromHex(t.value)})}));super(Dd,t[1],Au.serialize(r))}}onInit(t){super.onInit(t);const e=Au.parse(t.extnValue,Fd);this.dns=e.filter((t=>t.dNSName)).map((t=>t.dNSName||"")),this.email=e.filter((t=>t.rfc822Name)).map((t=>t.rfc822Name||"")),this.ip=e.filter((t=>t.iPAddress)).map((t=>t.iPAddress||"")),this.url=e.filter((t=>t.uniformResourceIdentifier)).map((t=>t.uniformResourceIdentifier||"")),this.upn=e.filter((t=>{var e;return(null===(e=t.otherName)||void 0===e?void 0:e.typeId)===Am.UPN})).map((t=>t.otherName?Au.parse(t.otherName.value,Cu).toString():"")),this.guid=e.filter((t=>{var e;return(null===(e=t.otherName)||void 0===e?void 0:e.typeId)===Am.GUID})).map((t=>t.otherName?Au.parse(t.otherName.value,uu):new uu)).map((t=>{const e=/([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})/i.exec(Ec.ep.ToHex(t));if(!e)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const r=e.slice(1).map(((t,e)=>e<3?Ec.ep.ToHex(new Uint8Array(Ec.ep.FromHex(t)).reverse()):t)).join("-");return`{${r}}`})),this.registeredId=e.filter((t=>t.registeredID)).map((t=>t.registeredID||"")),this.otherNames=e.filter((t=>t.otherName&&![Am.GUID,Am.UPN].includes(t.otherName.typeId))).map((t=>new _m(t.otherName.typeId,t.otherName.value)))}toJSON(){const t={};return this.dns.length&&(t.dns=[...this.dns]),this.email.length&&(t.email=[...this.email]),this.ip.length&&(t.ip=[...this.ip]),this.guid.length&&(t.guid=[...this.guid]),this.upn.length&&(t.upn=[...this.upn]),this.url.length&&(t.url=[...this.url]),this.registeredId.length&&(t.registeredId=[...this.registeredId]),this.otherNames.length&&(t.otherName=this.otherNames.map((t=>t.toJSON()))),t}}Am.GUID="1.3.6.1.4.1.311.25.1",Am.UPN="1.3.6.1.4.1.311.20.2.3";gm.register(Yu,class extends rm{constructor(...t){var e;if(Ec.vJ.isBufferSource(t[0])){super(t[0]);const e=Au.parse(this.value,sd);this.policies=e.map((t=>t.policyIdentifier))}else{const r=t[0],i=null!==(e=t[1])&&void 0!==e&&e,n=new sd(r.map((t=>new nd({policyIdentifier:t}))));super(Yu,i,Au.serialize(n)),this.policies=r}}});class Em extends em{constructor(...t){let e;if(Ec.vJ.isBufferSource(t[0]))e=Ec.vJ.toArrayBuffer(t[0]);else{const r=t[0],i=Array.isArray(t[1])?t[1].map((t=>Ec.vJ.toArrayBuffer(t))):[];e=Au.serialize(new Hd({type:r,values:i}))}super(e,Hd)}onInit(t){this.type=t.type,this.values=t.values}}class Sm extends Em{constructor(...t){var e;if(Ec.vJ.isBufferSource(t[0]))super(t[0]);else{const e=new nf(t[0]);super(uw,[Au.serialize(e)])}null!==(e=this.items)&&void 0!==e||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const t=Au.parse(this.values[0],nf);this.items=t.map((t=>gm.create(Au.serialize(t))))}}}class xm{static register(t,e){this.items.set(t,e)}static create(t){const e=new Em(t),r=this.items.get(e.type);return r?new r(t):e}}xm.items=new Map;let Im=class{toAsnAlgorithm(t){if("rsassa-pkcs1-v1_5"===t.name.toLowerCase()){if(!t.hash)return new Xd({algorithm:df,parameters:null});switch(t.hash.name.toLowerCase()){case"sha-1":return new Xd({algorithm:yf,parameters:null});case"sha-256":return new Xd({algorithm:bf,parameters:null});case"sha-384":return new Xd({algorithm:vf,parameters:null});case"sha-512":return new Xd({algorithm:_f,parameters:null})}}return null}toWebAlgorithm(t){switch(t.algorithm){case df:return{name:"RSASSA-PKCS1-v1_5"};case yf:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case bf:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case vf:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case _f:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};var Tm;Im=Eu([hp()],Im),cp.registerSingleton(om,Im);const km="1.3.36.3.3.2.8.1.1",Cm=`${km}.1`,Rm=`${km}.2`,Bm=`${km}.3`,Nm=`${km}.4`,Om=`${km}.5`,Lm=`${km}.6`,Pm=`${km}.7`,Um=`${km}.8`,Mm=`${km}.9`,Dm=`${km}.10`,Fm=`${km}.11`,Hm=`${km}.12`,jm=`${km}.13`,Wm=`${km}.14`,zm="brainpoolP160r1",Qm="brainpoolP160t1",qm="brainpoolP192r1",Gm="brainpoolP192t1",Vm="brainpoolP224r1",Km="brainpoolP224t1",Jm="brainpoolP256r1",Zm="brainpoolP256t1",Xm="brainpoolP320r1",Ym="brainpoolP320t1",$m="brainpoolP384r1",ty="brainpoolP384t1",ey="brainpoolP512r1",ry="brainpoolP512t1",iy="ECDSA";let ny=Tm=class{toAsnAlgorithm(t){if(t.name.toLowerCase()===iy.toLowerCase())if("hash"in t){switch(("string"==typeof t.hash?t.hash:t.hash.name).toLowerCase()){case"sha-1":return Qw;case"sha-256":return qw;case"sha-384":return Gw;case"sha-512":return Vw}}else if("namedCurve"in t){let e="";switch(t.namedCurve){case"P-256":e=Hw;break;case"K-256":e=Tm.SECP256K1;break;case"P-384":e=jw;break;case"P-521":e=Ww;break;case zm:e=Cm;break;case Qm:e=Rm;break;case qm:e=Bm;break;case Gm:e=Nm;break;case Vm:e=Om;break;case Km:e=Lm;break;case Jm:e=Pm;break;case Zm:e=Um;break;case Xm:e=Mm;break;case Ym:e=Dm;break;case $m:e=Fm;break;case ty:e=Hm;break;case ey:e=jm;break;case ry:e=Wm}if(e)return new Xd({algorithm:Pw,parameters:Au.serialize(new Kw({namedCurve:e}))})}return null}toWebAlgorithm(t){switch(t.algorithm){case Uw:return{name:iy,hash:{name:"SHA-1"}};case Mw:return{name:iy,hash:{name:"SHA-256"}};case Dw:return{name:iy,hash:{name:"SHA-384"}};case Fw:return{name:iy,hash:{name:"SHA-512"}};case Pw:if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(Au.parse(t.parameters,Kw).namedCurve){case Hw:return{name:iy,namedCurve:"P-256"};case Tm.SECP256K1:return{name:iy,namedCurve:"K-256"};case jw:return{name:iy,namedCurve:"P-384"};case Ww:return{name:iy,namedCurve:"P-521"};case Cm:return{name:iy,namedCurve:zm};case Rm:return{name:iy,namedCurve:Qm};case Bm:return{name:iy,namedCurve:qm};case Nm:return{name:iy,namedCurve:Gm};case Om:return{name:iy,namedCurve:Vm};case Lm:return{name:iy,namedCurve:Km};case Pm:return{name:iy,namedCurve:Jm};case Um:return{name:iy,namedCurve:Zm};case Mm:return{name:iy,namedCurve:Xm};case Dm:return{name:iy,namedCurve:Ym};case Fm:return{name:iy,namedCurve:$m};case Hm:return{name:iy,namedCurve:ty};case jm:return{name:iy,namedCurve:ey};case Wm:return{name:iy,namedCurve:ry}}}return null}};ny.SECP256K1="1.3.132.0.10",ny=Tm=Eu([hp()],ny),cp.registerSingleton(om,ny);class sy{addPadding(t,e){const r=Ec.vJ.toUint8Array(e),i=new Uint8Array(t);return i.set(r,t-r.length),i}removePadding(t,e=!1){let r=Ec.vJ.toUint8Array(t);for(let t=0;t127){const t=new Uint8Array(r.length+1);return t.set(r,1),t.buffer}return r.buffer}toAsnSignature(t,e){if("ECDSA"===t.name){const r=t.namedCurve,i=sy.namedCurveSize.get(r)||sy.defaultNamedCurveSize,n=new Zw,s=Ec.vJ.toUint8Array(e);return n.r=this.removePadding(s.slice(0,i),!0),n.s=this.removePadding(s.slice(i,i+i),!0),Au.serialize(n)}return null}toWebSignature(t,e){if("ECDSA"===t.name){const r=Au.parse(e,Zw),i=t.namedCurve,n=sy.namedCurveSize.get(i)||sy.defaultNamedCurveSize,s=this.addPadding(n,this.removePadding(r.r)),o=this.addPadding(n,this.removePadding(r.s));return(0,Ec.$e)(s,o)}return null}}sy.namedCurveSize=new Map,sy.defaultNamedCurveSize=32;const oy="1.3.101.110",ay="1.3.101.111",cy="1.3.101.112",ly="1.3.101.113";let hy=class{toAsnAlgorithm(t){let e=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":e=cy;break;case"ed448":e=ly}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":e=oy;break;case"x448":e=ay}}return e?new Xd({algorithm:e}):null}toWebAlgorithm(t){switch(t.algorithm){case cy:return{name:"EdDSA",namedCurve:"Ed25519"};case ly:return{name:"EdDSA",namedCurve:"Ed448"};case oy:return{name:"ECDH-ES",namedCurve:"X25519"};case ay:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};hy=Eu([hp()],hy),cp.registerSingleton(om,hy);var uy;!function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"}(uy||(uy={}));gm.register(qu,class extends rm{constructor(...t){if(Ec.vJ.isBufferSource(t[0])){super(t[0]);const e=Au.parse(this.value,Gu);this.ca=e.cA,this.pathLength=e.pathLenConstraint}else{const e=new Gu({cA:t[0],pathLenConstraint:t[1]});super(qu,t[2],Au.serialize(e)),this.ca=t[0],this.pathLength=t[1]}}}),gm.register(vd,class extends rm{constructor(...t){if(Ec.vJ.isBufferSource(t[0])){super(t[0]);const e=Au.parse(this.value,_d);this.usages=e.map((t=>t))}else{const e=new _d(t[0]);super(vd,t[1],Au.serialize(e)),this.usages=t[0]}}}),gm.register(Id,class extends rm{constructor(...t){if(Ec.vJ.isBufferSource(t[0])){super(t[0]);const e=Au.parse(this.value,Cd);this.usages=e.toNumber()}else{const e=new Cd(t[0]);super(Id,t[1],Au.serialize(e)),this.usages=t[0]}}}),gm.register(zd,vm),gm.register(Wu,ym),gm.register(Dd,Am),xm.register(hw,class extends Em{constructor(...t){var e;if(Ec.vJ.isBufferSource(t[0]))super(t[0]);else{const e=new Cw({printableString:t[0]});super(hw,[Au.serialize(e)])}null!==(e=this.password)&&void 0!==e||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const t=Au.parse(this.values[0],Cw);this.password=t.toString()}}}),xm.register(uw,Sm),cp.registerSingleton(wm,class{toAsnSignature(t,e){return Ec.vJ.toArrayBuffer(e)}toWebSignature(t,e){return Ec.vJ.toArrayBuffer(e)}}),cp.registerSingleton(wm,sy),sy.namedCurveSize.set("P-256",32),sy.namedCurveSize.set("K-256",32),sy.namedCurveSize.set("P-384",48),sy.namedCurveSize.set("P-521",66);const dy=/-{5}(BEGIN|END) .*-{5}/gm;async function fy({hash:t,signature:e,publicKey:r,domain:i,domainCert:n,created:s,software:o}={}){let a;const c=[];if(e=(0,Ac.toByteArray)(e),n&&i&&!r){const t=n.split("\n\n"),i=(0,Ac.toByteArray)(t[0].replace(dy,"").replace(/\s/gm,"")),s=p(await crypto.subtle.digest("SHA-256",i));c.push({id:"certFingerprint",expected:s,matched:null});const o=new mm(i);r=await o.publicKey.export();const l=(0,Ac.fromByteArray)(new Uint8Array(o.publicKey.rawData));c.push({id:"publicKey",expected:l,matched:null}),o.subject&&o.subject.startsWith("CN=")&&(a=o.subject.split(3)),e=function(t){try{const e=bu.parse(t,Zw),r=0===e.r[0]?e.r.slice(1):e.r,i=0===e.s[0]?e.s.slice(1):e.s;t=Gr([r,i],r.length+i.length)}catch(t){console.log(t)}return t}(e)}else{const t={name:"ECDSA",namedCurve:"P-384"};c.push({id:"publicKey",expected:r,matched:null}),r=await crypto.subtle.importKey("spki",(0,Ac.toByteArray)(r),t,!0,["verify"])}const l=new TextEncoder,h=await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},r,e,l.encode(t));return c.push({id:"signature",expected:!0,matched:h}),s&&c.push({id:"created",expected:s,matched:null}),o&&c.push({id:"software",expected:o,matched:null}),i&&c.push({id:"domain",expected:i,matched:a}),c}const py="pages/pages.jsonl",gy="pages/extraPages.jsonl",wy="datapackage.json";class my{constructor(t,e,r=null){this.loader=t,this.config=e,this.loadId=r,this.canLoadOnDemand=e.onDemand,this.zipreader=null,this.waczname=e.loadUrl}async load(t,e,r){this.zipreader=t.zipreader?t.zipreader:new _c(this.loader);const i=await this.zipreader.load(!0);let n;this.canLoadOnDemand&&t.fullConfig&&this.loader.arrayBuffer&&this.loader.arrayBuffer.byteLength<=c&&(t.fullConfig.extra||(t.fullConfig.extra={}),t.fullConfig.extra.arrayBuffer=this.loader.arrayBuffer);let s=null;return i["datapackage-digest.json"]&&(s=await this.loadDigestData(t,"datapackage-digest.json")),i[wy]?n=await this.loadMetadata(t,i,wy,s):i["webarchive.yaml"]&&(n=await this.loadMetadataYAML(t,i,"webarchive.yaml")),this.canLoadOnDemand?await t.addWACZFile(this.waczname,i):await this.loadWACZFull(t,i,e,r),n||{}}async loadWACZFull(t,e,r=null,i=0){let n=0;const s=(t,e,s)=>{s+=n,r&&i&&r(Math.round(100*s/i),null,s,i)};for(const r of Object.keys(e)){const e=this.zipreader.getCompressedSize(r);(r.endsWith(".warc.gz")||r.endsWith(".warc"))&&await this.loadWARC(t,r,s,e),n+=e}}async loadWARC(t,e,r,i){const{reader:n}=await this.zipreader.loadFile(e,{unzip:!0}),s=new Wn(n,null,e);return s.detectPages=!1,await s.load(t,r,i)}async loadTextEntry(t,e,r){const{reader:i,hasher:n}=await this.zipreader.loadFile(e,{computeHash:!!r}),s=(new TextDecoder).decode(await i.readFully());return r&&n&&await t.addVerifyData(e,r,n.getHash()),s}async loadDigestData(t,e){try{const r=JSON.parse(await this.loadTextEntry(t,e));let i;if(r.path===wy&&r.hash&&(i=r.hash),!r.signedData||r.signedData.hash!==i)return void await t.addVerifyData("signature");await t.addVerifyData("datapackageHash",i);const n=await fy(r.signedData);return await t.addVerifyDataList(n),i}catch(t){console.warn(t)}}async loadMetadata(t,e,r,i){const n=await this.loadTextEntry(t,r,i),s=JSON.parse(n);void 0!==s.config&&t.initConfig&&t.initConfig(s.config);const o=s.metadata||{};let a=null;for(const e of s.resources)e.path===py?(a=e.hash,await t.addVerifyData(e.path,e.hash)):(e.path.endsWith(".idx")||e.path.endsWith(".cdx"))&&await t.addVerifyData(e.path,e.hash);if(e[py]){(await by(t,this.zipreader,this.waczname,py,a)).hasText&&(t.textIndex=o.textIndex=py)}return e[gy]&&(t.textIndex=o.textIndex=gy),o}async loadMetadataYAML(t,e,r){const i=await this.loadTextEntry(t,r),n=Ka.load(i),s={desc:n.desc,title:n.title};n.textIndex&&(s.textIndex=n.textIndex,n.config||(n.config={}),n.config.textIndex=n.textIndex),void 0!==n.config&&t.initConfig(n.config),s.title||(s.title=this.config.sourceName);const o=n.pages||[];o&&o.length?await t.addPages(o):e["pages.csv"]&&await t.loadPagesCSV(t,"pages.csv");const a=n.pageLists||[];return a&&a.length&&await t.addCuratedPageLists(a,"pages","show"),s}}class yy{constructor(t,e){this.json=t,this.baseUrl=e}async load(t){const e={title:this.json.title,desc:this.json.description},r=this.loadFiles(this.baseUrl);return await t.syncWACZ(r),e}loadFiles(){return this.json.resources.map((t=>new URL(t.path,this.baseUrl).href))}}async function by(t,e,r,i=py,n=null){const{reader:s,hasher:o}=await e.loadFile(i,{unzip:!0,computeHash:!0});let a=null,c=[];for await(const e of s.iterLines()){const i=JSON.parse(e);i.wacz=r,a?(c.push(i),500===c.length&&(await t.addPages(c),c=[])):a=i}return c.length&&await t.addPages(c),o&&n&&await t.addVerifyData(i,n,o.getHash()),a}class vy{constructor(t,{cloneResponse:e=!1,allowBody:r=!1,hostProxyOnly:i=!1}={}){if(t=t||{},this.prefix=t.prefix||"",this.proxyPathOnly=t.proxyPathOnly||!1,this.isLive=void 0===t.isLive||t.isLive,this.archivePrefix=t.archivePrefix||"",this.cloneResponse=e,this.allowBody=r,this.hostProxy=t.hostProxy,this.hostProxy instanceof Array){const t={};for(const e of this.hostProxy)t[e.host]=e;this.hostProxy=t}this.hostProxyOnly=i}async getAllPages(){return[]}getFetchUrl(t,e){let r;if(this.hostProxy){r=new URL(t);const e=this.hostProxy[r.host];if(e)return e.prefix+(e.pathOnly?r.pathname+r.search:t)}return this.hostProxyOnly?null:this.proxyPathOnly?(r||(r=new URL(t)),this.prefix+r.pathname+r.search):this.isLive||!e.timestamp?this.prefix+t:this.prefix+this.archivePrefix+e.timestamp+"id_/"+t}async getResource(t,e){const{headers:r,credentials:i,url:n}=t.prepareProxyRequest(e,!0),s=this.getFetchUrl(n,t);if(!s)return null;let o=null;!this.allowBody||"POST"!==t.method&&"PUT"!==t.method||(o=await t.getBody());const a=await fetch(s,{method:t.method,body:o,headers:r,credentials:i,mode:"cors",redirect:"follow"});let c=null;this.cloneResponse&&(c=a.clone());const l=vi.fromResponse({url:n,response:a,date:new Date,noRW:!1,isLive:this.isLive});return c&&(l.clonedResponse=c),l}}class _y extends Ds{constructor(t,e=!1){super(t.dbname,e),this.config=t,this.waczfiles={},this.waczhashes={},this.ziploadercache={},this.resHashes={}}_initDB(t,e,r,i){super._initDB(t,e,r,i),e||(t.createObjectStore("ziplines",{keyPath:["waczname","prefix"]}),t.createObjectStore("waczfiles",{keyPath:"waczname"}),t.createObjectStore("verification",{keyPath:"id"}))}async init(){await super.init();const t=await this.db.getAll("waczfiles")||[];for(const e of t)this.waczfiles[e.waczname]=e;await this.initLoader()}initLoader(){}getReaderForWACZ(){throw new Error("Unimplemented here")}getWACZName(){throw new Error("Unimplemented here")}async close(){super.close(),caches.delete("cache:"+this.name.slice("db:".length))}async clearZipData(){const t=["waczfiles","ziplines"];for(const e of t)await this.db.clear(e)}async addVerifyData(t,e,r,i=!1){let n=null;r&&(n=e===r,i&&console.log(`verify ${t}: ${n}`)),await this.db.put("verification",{id:t,expected:e,matched:n})}async addVerifyDataList(t){const e=this.db.transaction("verification","readwrite");for(const r of t)e.store.put(r);try{await e.done}catch(t){console.warn(t)}}async getVerifyInfo(){const t=await this.db.getAll("verification");let e=0,r=0,i={};const n=["domain","created","certFingerprint","software","datapackageHash","publicKey"];for(const s of t)n.includes(s.id)?i[s.id]=s.expected:"signature"===s.id||!0===s.matched?e++:!1===s.matched&&r++;return i.numInvalid=r,i.numValid=e,i}async getVerifyExpected(t){const e=await this.db.get("verification",t);return e&&e.expected}async clearAll(){await super.clearAll(),await this.clearZipData()}async addWACZFile(t,e){const r={waczname:t,entries:e,indexType:0};await this.db.put("waczfiles",r),this.waczfiles[t]=r;const i=await this.getWACZHash(t);this.waczhashes[i]=t}async getWACZHash(t){return await g(t,"sha-256","")}async computeWACZHashes(){for(const t of Object.keys(this.waczfiles)){const e=await this.getWACZHash(t);this.waczhashes[e]=t}}async loadRecordFromSource(t){const{start:e,length:r,path:i}=t.source,n=this.getWACZName(t),s=e,o=await this.getReaderForWACZ(n),{reader:a,hasher:c}=await o.loadFile("archive/"+i,{offset:s,length:r,unzip:!0,computeHash:!0}),l=new zn(a,c);await this.updateEntriesIfNeeded(o,n);const h=await l.load();return t[qs]&&(h.respHeaders["x-wabac-preset-cookie"]=t[qs]),{remote:h,hasher:c}}async loadWACZ(t){if(!this.waczfiles[t])throw new Error("unknown waczfile: "+t);if(this.waczfiles[t].indexType)return{indexType:this.waczfiles[t].indexType,isNew:!1};const e=await this.getReaderForWACZ(t);await e.load();let r=0;for(const i of Object.keys(this.waczfiles[t].entries))i.endsWith(".cdx")||i.endsWith(".cdxj")?(console.log(`Loading CDX for ${t}`),await this.loadCDX(e,i,t),r=1):i.endsWith(".idx")&&(console.log(`Loading IDX for ${t}`),await this.loadIDX(e,i,t),r=2);return this.waczfiles[t].indexType=r,await this.db.put("waczfiles",this.waczfiles[t]),{indexType:r,isNew:!0}}async loadCDX(t,e,r,i,n){const{reader:s,hasher:o}=await t.loadFile(e,{computeHash:!0}),a=new Vs(s,null,r,{wacz:r}),c=await a.load(this,i,n);if(o){const t=await this.getVerifyExpected(e);t&&this.addVerifyData(e,t,o.getHash())}return c}async loadIDX(t,e,r,i,n){const{reader:s,hasher:o}=await t.loadFile(e,{computeHash:!0});let a=[],c="",l=!1,h=0;for await(const t of s.iterLines()){if(h+=t.length,h===t.length&&t.startsWith("!meta")){const e=t.indexOf(" {");if(e<0){console.warn("Invalid Meta Line: "+t);continue}const r=JSON.parse(t.slice(e));r.filename&&(c=r.filename),"cdxj-gzip-1.0"!==r.format&&console.log(`Unknown CDXJ format "${r.format}", archive may not parse correctly`);continue}let e;if(t.indexOf("\t")>0){let[i,n,s,o]=t.split("\t");s=Number(s),o=Number(o),e={waczname:r,prefix:i,filename:n,offset:s,length:o,loaded:!1},l=!0}else{const i=t.indexOf(" {");if(i<0){console.log("Invalid Index Line: "+t);continue}const n=t.slice(0,i);let{offset:s,length:o,filename:a,digest:h}=JSON.parse(t.slice(i));l=n.indexOf(")/")>0,a=a||c,e={waczname:r,prefix:n,filename:a,offset:s,length:o,digest:h,loaded:!1}}i&&i(h/n,h,n),a.push(e)}if(o){const t=await this.getVerifyExpected(e);t&&this.addVerifyData(e,t,o.getHash())}const u=this.db.transaction("ziplines","readwrite");for(const t of a)u.store.put(t);try{await u.done}catch(t){console.log("Error loading ziplines index: ",t)}l&&l!==this.waczfiles[r].useSurt&&(this.waczfiles[r].useSurt=l,await this.db.put("waczfiles",this.waczfiles[r]))}async loadCDXFromIDX(t,e,r=0,i=!1){const n=this.waczfiles[t].useSurt?decodeURIComponent(jr(e)):e,s=i?this.prefixUpperBound(n):n+" 9999",o=IDBKeyRange.upperBound([t,s],!0),a=this.db.transaction("ziplines","readonly"),c=[];for await(const e of a.store.iterate(o,"prev")){if(e.value.waczname!==t)break;if(c.unshift(e.value),!e.value.prefix.split(" ")[0].startsWith(n))break}await a.done;const l=[],h=await this.getReaderForWACZ(t),u={wacz:t};c.length>3&&r&&c.sort(((t,e)=>{const i=t.prefix.split(" ")[1],n=e.prefix.split(" ")[1];if(!i||!n)return 0;const s=Math.abs(f(i).getTime()-r),o=Math.abs(f(n).getTime()-r);return s===o?0:s3)break}return l.length&&await Promise.allSettled(l),await this.updateEntriesIfNeeded(h,t),l.length>0}async doCDXLoad(t,e,r,i){try{const n="indexes/"+e.filename,s={offset:e.offset,length:e.length,unzip:!0,computeHash:!!e.digest},{reader:o,hasher:a}=await r.loadFile(n,s),c=new Vs(o,null,null,i);if(await c.load(this),a){const t=a.getHash(),r=`${n}:${e.offset}-${e.length}`;await this.addVerifyData(r,e.digest,t)}e.loaded=!0,await this.db.put("ziplines",e)}catch(t){await S(t,this.config)||console.warn(t)}finally{delete this.ziploadercache[t]}}async updateEntriesIfNeeded(t,e){t.entriesUpdated&&(await this.db.put("waczfiles",this.waczfiles[e]),t.entriesUpdated=!1)}async findPageAtUrl(t,e){const r=await this.db.getAllFromIndex("pages","url",t);let i=null,n=Number.MAX_SAFE_INTEGER;for(const t of r){const r=Math.abs(t.ts-e);if(r<1e3)return t;r0)return r;for(const i of Object.keys(this.waczfiles))if(i&&"local"!==i){const{indexType:n,isNew:s}=await this.loadWACZ(i);switch(n){case 2:if(!await this.loadCDXFromIDX(i,t,0,!0))continue;break;case 1:if(!s)continue;break;default:continue}const o=await super.resourcesByUrlAndMime(t,...e);o&&o.length&&(r=r.concat(o))}return r}}class Ay extends _y{async initLoader(){const t=this.config;this.indexLoader=await Rs({url:t.loadUrl,headers:t.headers,size:t.size,extra:t.extra}),await this.checkUpdates()}getWACZName(t){return t.source.wacz}async checkUpdates(){const{response:t}=await this.indexLoader.doInitialFetch(!1);if(206!==t.status&&200!==t.status)return void console.warn("WACZ update failed from: "+this.config.loadUrl);const e=new yy(await t.json(),this.config.loadUrl).loadFiles();await this.syncWACZ(e)}async syncWACZ(t){const e=[];for(const r of t)this.waczfiles[r]||e.push(this.loadNewWACZ(r));e.length&&await Promise.allSettled(e)}async loadNewWACZ(t){const e=await this.getBlockLoader(t),r=new _c(e),i=await r.load(!0);await this.addWACZFile(t,i);const n=await this.getVerifyExpected(py);await by(this,r,t,py,n),await this.updateEntriesIfNeeded(r,t)}async getResource(t,e,r,{pageId:i}={}){await this.initing;const n="navigate"===r.request.mode;let s=i,o=null,a=null;if(s){if(Object.keys(this.waczhashes).length||await this.computeWACZHashes(),o=this.waczhashes[s],!o)return null;a=await super.getResource(t,e,r,{waczname:o})}if(a||!n)return a;for(const i of Object.keys(this.waczfiles))if(a=await super.getResource(t,e,r,{waczname:i,noFuzzyCheck:!0}),a){o=i,s=await this.getWACZHash(o);break}return o?Response.redirect(`${e}:${s}/${t.timestamp}mp_/${t.url}`):void 0}async getReaderForWACZ(t){return new _c(await this.getBlockLoader(t),this.waczfiles[t].entries)}getBlockLoader(t){return Rs({url:t})}}class Ey extends _y{constructor(t,e){super(t,t.noCache),this.zipreader=new _c(e),this.externalSource=null,this.fuzzyUrlRules=[],this.useSurt=!1,this.fullConfig=t,this.textIndex=t&&t.metadata&&t.metadata.textIndex,t.extraConfig&&this.initConfig(t.extraConfig)}_initDB(t,e,r,i){super._initDB(t,e,r,i),2===e&&this.convertV2WACZDB(t,i),3===e&&t.createObjectStore("verification",{keyPath:"id"})}async convertV2WACZDB(t,e){try{const r=await e.objectStore("ziplines").getAll(),i=await e.objectStore("zipEntries").getAll();t.deleteObjectStore("ziplines"),t.deleteObjectStore("zipEntries"),t.createObjectStore("ziplines",{keyPath:["waczname","prefix"]}),t.createObjectStore("waczfiles",{keyPath:"waczname"}),t.createObjectStore("verification",{keyPath:"id"});const n=this.getWACZName();for(const t of r)t.waczname=n,e.objectStore("ziplines").put(t);const s={waczname:n,entries:i,indexType:r.length>0?2:1};e.objectStore("waczfiles").put(s),await e.done}catch(t){console.warn(t)}}getReaderForWACZ(){return this.zipreader}updateHeaders(t){this.zipreader.loader.headers=t}initConfig(t){if(void 0!==t.decodeResponses&&(this.fullConfig.decode=t.decodeResponses),void 0!==t.useSurt&&(this.useSurt=t.useSurt),t.hostProxy&&(this.externalSource=new vy(t,{hostProxyOnly:!0})),t.fuzzy)for(const[e,r]of t.fuzzy){const t=new RegExp(e);this.fuzzyUrlRules.push({match:t,replace:r})}t.textIndex&&(this.textIndex=t.textIndex)}async getTextIndex(){const t={"Content-Type":"application/ndjson"};if(!this.textIndex)return new Response("",{headers:t});try{await this.zipreader.load()}catch(e){return await S(e,this.config),new Response("",{headers:t})}const e=this.zipreader.getCompressedSize(this.textIndex);e>0&&(t["Content-Length"]=""+e);const{reader:r}=await this.zipreader.loadFile(this.textIndex,{unzip:!0});return new Response(r.getReadableStream(),{headers:t})}async getResource(t,e,r,{pageId:i}={}){let n=null;if(this.externalSource&&(n=await this.externalSource.getResource(t,e,r),n))return n;const s=this.getWACZName();if(n=await super.getResource(t,e,r,{pageId:i,waczname:s}),n)return n;if(this.fuzzyUrlRules.length)for(const{match:i,replace:s}of this.fuzzyUrlRules){const o=decodeURIComponent(t.url.replace(i,s));if(o&&o!==t.url&&(t.url=o,n=await super.getResource(t,e,r),n))return n}return null}getWACZName(){return this.config.loadUrl}}class Sy{constructor(t){const e=t.extraConfig||{};this.sourceUrl=e.prefix,this.type=e.sourceType||"kiwix",this.notFoundPageUrl=e.notFoundPageUrl}async getAllPages(){return[]}async getResource(t,e){const{url:r,headers:i}=t.prepareProxyRequest(e);let n=i;if("kiwix"===this.type){let e=await this.resolveHeaders(r);if(!e)for(const t of Ln.getFuzzyCanonsWithArgs(r))if(t!==r&&(e=await this.resolveHeaders(t),e))break;if(!e){if(this.notFoundPageUrl&&"navigate"===t.mode){const t=await fetch(this.notFoundPageUrl);if(200===t.status){const e={"Content-Type":"text/html"},i=await t.text();return new Response(i.replace("$URL",r),{status:404,headers:e})}}return null}let{headers:i,encodedUrl:s,date:o,status:a,statusText:c,hasPayload:l}=e;if(n.has("Range")){const t=n.get("Range");n={Range:t}}let h=null,u=null;l&&(u=await fetch(this.sourceUrl+"A/"+s,{headers:n}),u.body&&(h=new Xr(u.body.getReader(),!1)),206===u.status&&(a=206,c="Partial Content",i.set("Content-Length",u.headers.get("Content-Length")),i.set("Content-Range",u.headers.get("Content-Range")),i.set("Accept-Ranges","bytes"))),h||(h=new Uint8Array([])),o||(o=new Date),i||(i=new Headers);return new vi({payload:h,status:a,statusText:c,headers:i,url:r,date:o,noRW:!1,isLive:!1})}}async resolveHeaders(t){const e=t.slice(t.indexOf("//")+2);let r=encodeURI(e);r=encodeURIComponent(e);let i=await fetch(this.sourceUrl+"H/"+r);if(200!==i.status)return null;let n=null,s=null,o=null,a=null,c=!1;try{const e=await di.parse(i.body);if("revisit"===e.warcType){const r=e.warcHeaders.headers.get("WARC-Refers-To-Target-URI");if(r&&r!==t)return await this.resolveHeaders(r)}s=new Date(e.warcDate),e.httpHeaders?(n=e.httpHeaders.headers,o=Number(e.httpHeaders.statusCode),a=e.httpHeaders.statusText,c="0"!==e.httpHeaders.headers.get("Content-Length")):"resource"===e.warcType&&(n=new Headers,n.set("Content-Type",e.warcContentType),n.set("Content-Length",e.warcContentLength),o=200,a="OK",c=e.warcContentLength>0),o||(o=200)}catch(e){console.warn(e),console.warn("Ignoring headers, error parsing headers response for: "+t)}return{encodedUrl:r,headers:n,date:s,status:o,statusText:a,hasPayload:c}}}globalThis.self||(globalThis.self=globalThis),self.interruptLoads={};class xy extends class{constructor(){this.colldb=null,this.root=null,this.checkIpfs=!0,this._init_db=this._initDB()}async _initDB(){this.colldb=await wn("collDB",1,{upgrade:t=>{t.createObjectStore("colls",{keyPath:"name"}).createIndex("type","type")}})}async loadAll(t){if(await this._init_db,t)for(const e of t.split(",")){const t=e.split(":");if(2===t.length){const e={dbname:t[1],sourceName:t[1],decode:!1},r={name:t[0],type:"archive",config:e};console.log("Adding Coll: "+JSON.stringify(r)),await this.colldb.put("colls",r)}}try{const t=(await this.listAll()).map((t=>this._initColl(t)));await Promise.all(t)}catch(t){console.warn(t.toString())}return!0}async listAll(){return await this._init_db,await this.colldb.getAll("colls")}async loadColl(t){await this._init_db;const e=await this.colldb.get("colls",t);return e?await this._initColl(e):null}async reload(t){return this.loadColl(t)}async deleteColl(t){await this._init_db;const e=await this.colldb.get("colls",t);if(!e)return!1;if(e.config.dbname)try{await mn(e.config.dbname,{blocked(t,r){console.log(`Unable to delete ${e.config.dbname}, blocked: ${r}`)}})}catch(t){return console.warn(t),!1}return await this.colldb.delete("colls",t),!0}async updateAuth(t,e){await this._init_db;const r=await this.colldb.get("colls",t);return!!r&&(r.config.headers=e,await this.colldb.put("colls",r),!0)}async updateMetadata(t,e){await this._init_db;const r=await this.colldb.get("colls",t);return!!r&&(r.config.metadata={...r.config.metadata,...e},await this.colldb.put("colls",r),r.config.metadata)}async updateSize(t,e,r,i){await this._init_db;const n=await this.colldb.get("colls",t);if(!n)return!1;const s=n.config.metadata;return s.fullSize=(s.fullSize||0)+e,s.size=(s.size||0)+r,s.mtime=(new Date).getTime(),void 0!==i&&(n.config.decode=i),await this.colldb.put("colls",n),s}async initNewColl(t,e={},r="archive"){await this._init_db;const i=y(),n="local://"+i,s={name:i,type:r,config:{dbname:"db:"+i,ctime:(new Date).getTime(),decode:!1,metadata:t,sourceUrl:n,extraConfig:e}},o=await this._initColl(s);return await this.colldb.put("colls",s),o}async _initColl(t){const e=await this._initStore(t.type,t.config),r=t.name,i=t.config;return t.config.root&&(this.root=r),this._createCollection({name:r,store:e,config:i})}async _initStore(t,e){let r=null,i=null;switch(t){case"archive":i=new Mn(e.dbname);break;case"remotesource":r=await Rs({url:e.loadUrl,headers:e.headers,size:e.size,extra:e.extra}),i=new Fs(e.dbname,r,e.noCache);break;case"remoteprefix":i=new Hs(e.dbname,e.remotePrefix,e.headers,e.noCache);break;case"wacz":case"remotezip":r=await Rs({url:e.loadUrl||e.sourceUrl,headers:e.headers,extra:e.extra}),i=new Ey(e,r);break;case"remotewarcproxy":i=new Sy(e);break;case"live":i=new vy(e.extraConfig);break;case"multiwacz":i=new Ay(e)}return i?(i.initing&&await i.initing,i):(console.log("no store found: "+t),null)}_createCollection(t){return t}}{constructor(t){super(),this.registerListener(t)}async hasCollection(t){return await this._init_db,null!=await this.colldb.getKey("colls",t)}registerListener(t){t.addEventListener("message",(t=>{t.waitUntil?t.waitUntil(this._handleMessage(t)):this._handleMessage(t)}))}async _handleMessage(t){await this._init_db;const e=t.source||self;switch(t.data.msg_type){case"addColl":{const r=t.data.name,i=(t,i,n,s,o=null,a=null)=>{e.postMessage({msg_type:"collProgress",name:r,percent:t,error:i,currentSize:n,totalSize:s,fileHandle:o,extraMsg:a})};let n;try{if(n=await this.colldb.get("colls",r),n?t.data.skipExisting||(await this.deleteColl(r),n=await this.addCollection(t.data,i)):n=await this.addCollection(t.data,i),!n){if(t.data.name)try{await mn("db:"+t.data.name,{blocked(e,r){console.log(`Load failed and unable to delete ${t.data.name}: ${r}`)}})}catch(t){console.warn(t)}return}}catch(t){if(t instanceof k)return console.warn(t),void i(0,"permission_needed",null,null,t.info&&t.info.fileHandle);if("ConstraintError"!==t.name)return console.warn(t),void i(0,"An unexpected error occured: "+t.toString());console.log("already being added, just continue..."),n=await this.colldb.get("colls",r)}e.postMessage({msg_type:"collAdded",name:r,sourceUrl:n.config.sourceUrl});break}case"cancelLoad":{const e=t.data.name,r=new Promise((t=>self.interruptLoads[e]=t));await r,await this.deleteColl(e),delete self.interruptLoads[e];break}case"removeColl":{const r=t.data.name;await this.hasCollection(r)&&(await this.deleteColl(r),this.doListAll(e));break}case"listAll":this.doListAll(e);break;case"reload":this.reload(t.data.name)}}async doListAll(t){const e=[],r=await this.listAll();for(const t of r)e.push({name:t.name,prefix:t.name,pageList:[],sourceName:t.config.sourceName});t.postMessage({msg_type:"listAll",colls:e})}async addCollection(t,e){let r=t.name,i=null,n={root:t.root||!1},s=null,o=null;const a=t.file;if(!a||!a.sourceUrl)return e(0,"Invalid Load Request"),!1;if(n.dbname="db:"+r,a.sourceUrl.startsWith("proxy:"))n.sourceUrl=a.sourceUrl,n.extraConfig=t.extraConfig,n.extraConfig.prefix||(n.extraConfig.prefix=a.sourceUrl.slice("proxy:".length)),n.topTemplateUrl=t.topTemplateUrl,n.metadata={},i=t.type||n.extraConfig.type||"remotewarcproxy",s=await this._initStore(i,n);else{let l=null;if(a.newFullImport&&(r=y(),a.loadUrl=a.loadUrl||a.sourceUrl,a.name=a.name||a.sourceUrl,a.sourceUrl="local://"+r),i="archive",a.newFullImport&&a.importCollId){const t=await this.colldb.get("colls",a.importCollId);if(!t||"archive"!==t.type)return void e(0,"Invalid Existing Collection: "+a.importCollId);n.dbname=t.config.dbname,o=t.config,o.decode=!0}let h=a.loadUrl||a.sourceUrl;h.match(/[\w]+:\/\//)||(h=new URL(h,self.location.href).href),n.decode=!0,n.onDemand=!1,n.loadUrl=h,n.sourceUrl=a.sourceUrl,n.sourceName=a.name||a.sourceUrl;try{if(n.sourceName.match(/https?:\/\//)){const t=new URL(n.sourceName);n.sourceName=t.pathname+t.hash}}catch(t){}if(n.sourceName=n.sourceName.slice(n.sourceName.lastIndexOf("/")+1),n.headers=a.headers,n.size="number"==typeof a.size?a.size:null,n.extra=a.extra,n.loadUrl.startsWith("file://")&&!a.blob&&!n.extra){if(!this._fileHandles||!this._fileHandles[n.sourceUrl])return void e(0,"missing_local_file");n.extra={fileHandle:this._fileHandles[n.sourceUrl]}}n.extraConfig=t.extraConfig,n.noCache=a.noCache;let u=await Rs({url:h,headers:a.headers,size:a.size,extra:n.extra,blob:a.blob});if(a.loadEager){const{response:t}=await u.doInitialFetch(!1,!0),e={arrayBuffer:new Uint8Array(await t.arrayBuffer())};a.newFullImport=!0,u=await Rs({url:h,headers:a.headers,size:a.size,extra:e})}let d=!1;(n.sourceName.endsWith(".wacz")||n.sourceName.endsWith(".zip"))&&(d=!0);let{abort:f,response:p}=await u.doInitialFetch(d);const g=p.body;if(n.onDemand=u.canLoadOnDemand&&!a.newFullImport,!u.isValid){const t=u.length<=1e3?await p.text():"";return e(0,`Sorry, this URL could not be loaded.\nMake sure this is a valid URL and you have access to this file.\nStatus: ${p.status} ${p.statusText}\nError Details:\n${t}`),f&&f.abort(),!1}if(!u.length)return e(0,"Sorry, this URL could not be loaded because the size of the file is not accessible.\nMake sure this is a valid URL and you have access to this file."),f&&f.abort(),!1;const w=u.length;if(n.sourceName.endsWith(".wacz")||n.sourceName.endsWith(".zip"))if(l=new my(u,n,r),n.onDemand)s=new Ey(n,u),i="wacz";else{if(!u.canLoadOnDemand||!a.newFullImport)return e(0,"Sorry, can't load this WACZ file due to lack of range request support on the server"),f&&f.abort(),!1;s=null,delete n.extra}else n.sourceName.endsWith(".warc")||n.sourceName.endsWith(".warc.gz")?n.noCache||!(w300&&e<400)return;let s=null;void 0===this.timeRanges[n]?(s={count:0,children:[]},this.timeRanges[n]=s,r.referrer.indexOf("mp_/")>0&&self.clients.matchAll({type:"window"}).then((t=>this.updateStatsParent(n,r.referrer,t)))):s=this.timeRanges[n];const o=t.getTime();(!s.min||os.max)&&(s.max=o),s.count++}updateStatsParent(t,e,r){for(let i of r)if(i.url===e){this.timeRanges[i.id]?this.timeRanges[i.id].children[t]=1:this.timeRanges[i.id]={count:0,children:{id:1}};break}}async getStats(t){const e=new URL(t.request.url);let r=0;const i=new URLSearchParams(e.search).get("url"),n=await self.clients.matchAll({type:"window"}),s={};for(let t of n)t.url===i&&(r=t.id),s[t.id]=1;const o=this.timeRanges[r]||{},a={count:o.count||0,min:o.min,max:o.max},c=this.timeRanges[r]&&Object.keys(this.timeRanges[r].children)||[];for(let t of c){const e=this.timeRanges[t];e&&((!a.min||e.mina.max)&&(a.max=e.max),a.count+=e.count)}for(let t of Object.keys(this.timeRanges))s[t]||delete this.timeRanges[t];return new Response(JSON.stringify(a),{headers:{"Content-Type":"application/json"}})}}var Ty=function(){return Ty=Object.assign||function(t){for(var e,r=1,i=arguments.length;r$)/g,""):"[a-zA-Z0-9-_.~%':|=+\\*@$]+")+")"},jy=[{name:"url-parameter",pattern:/^:([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(t){return new RegExp(Hy(t[2]))}},{name:"url-parameter-splat",pattern:/^\*([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/,regex:/([^?]*)/},{name:"url-parameter-matrix",pattern:/^;([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(t){return new RegExp(";"+t[1]+"="+Hy(t[2]))}},{name:"query-parameter",pattern:/^(?:\?|&)(?::)?([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/},{name:"delimiter",pattern:/^(\/|\?)/,regex:function(t){return new RegExp("\\"+t[0])}},{name:"sub-delimiter",pattern:/^(!|&|-|_|\.|;)/,regex:function(t){return new RegExp(t[0])}},{name:"fragment",pattern:/^([0-9a-zA-Z]+)/,regex:function(t){return new RegExp(t[0])}}],Wy=function t(e,r){if(void 0===r&&(r=[]),!jy.some((function(i){var n=e.match(i.pattern);return!!n&&(r.push({type:i.name,match:n[0],val:n.slice(1,2),otherVal:n.slice(2),regex:i.regex instanceof Function?i.regex(n):i.regex}),n[0].length0,this.hasSpatParam=this.tokens.filter((function(t){return/splat$/.test(t.type)})).length>0,this.hasMatrixParams=this.tokens.filter((function(t){return/matrix$/.test(t.type)})).length>0,this.hasQueryParams=this.tokens.filter((function(t){return/^query-parameter/.test(t.type)})).length>0,this.spatParams=this.getParams("url-parameter-splat"),this.urlParams=this.getParams(/^url-parameter/),this.queryParams=this.getParams("query-parameter"),this.params=this.urlParams.concat(this.queryParams),this.source=this.tokens.filter((function(t){return void 0!==t.regex})).map((function(t){return t.regex.source})).join("")}return t.createPath=function(e,r){return new t(e,r)},t.prototype.isQueryParam=function(t){return-1!==this.queryParams.indexOf(t)},t.prototype.isSpatParam=function(t){return-1!==this.spatParams.indexOf(t)},t.prototype.test=function(t,e){var r=this,i=Ty(Ty({caseSensitive:!1,strictTrailingSlash:!1},this.options),e),n=function(t,e){return e||"\\/"===t?t:t.replace(/\\\/$/,"")+"(?:\\/)?"}(this.source,i.strictTrailingSlash),s=this.urlTest(t,n+(this.hasQueryParams?"(\\?.*$|$)":"$"),i.caseSensitive,i.urlParamsEncoding);if(!s||!this.hasQueryParams)return s;var o=Ly(t,i.queryParams);return 0===Object.keys(o).filter((function(t){return!r.isQueryParam(t)})).length?(Object.keys(o).forEach((function(t){return s[t]=o[t]})),s):null},t.prototype.partialTest=function(t,e){var r=this,i=Ty(Ty({caseSensitive:!1,delimited:!0},this.options),e),n=function(t,e){return e?/(\/)$/.test(t)?t:t+"(\\/|\\?|\\.|;|$)":t}(this.source,i.delimited),s=this.urlTest(t,n,i.caseSensitive,i.urlParamsEncoding);if(!s)return s;if(!this.hasQueryParams)return s;var o=Ly(t,i.queryParams);return Object.keys(o).filter((function(t){return r.isQueryParam(t)})).forEach((function(t){return function(t,e,r){void 0===r&&(r="");var i=t[e];return t[e]=void 0===i?r:Array.isArray(i)?i.concat(r):[i,r],t}(s,t,o[t])})),s},t.prototype.build=function(t,e){var r=this;void 0===t&&(t={});var i=Ty(Ty({ignoreConstraints:!1,ignoreSearch:!1,queryParams:{}},this.options),e),n=Object.keys(t).filter((function(t){return!r.isQueryParam(t)})).reduce((function(e,n){if(!zy(t[n]))return e;var s=t[n],o=r.isSpatParam(n);return"boolean"==typeof s?e[n]=s:Array.isArray(s)?e[n]=s.map((function(t){return Fy(t,i.urlParamsEncoding,o)})):e[n]=Fy(s,i.urlParamsEncoding,o),e}),{});if(this.urlParams.some((function(e){return!zy(t[e])}))){var s=this.urlParams.filter((function(e){return!zy(t[e])}));throw new Error("Cannot build path: '"+this.path+"' requires missing parameters { "+s.join(", ")+" }")}if(!i.ignoreConstraints&&!this.tokens.filter((function(t){return/^url-parameter/.test(t.type)&&!/-splat$/.test(t.type)})).every((function(t){return new RegExp("^"+Hy(t.otherVal[0])+"$").test(n[t.val])})))throw new Error("Some parameters of '"+this.path+"' are of invalid format");var o=this.tokens.filter((function(t){return!1===/^query-parameter/.test(t.type)})).map((function(t){return"url-parameter-matrix"===t.type?";"+t.val+"="+n[t.val[0]]:/^url-parameter/.test(t.type)?n[t.val[0]]:t.match})).join("");if(i.ignoreSearch)return o;var a=function(t,e){var r=ky(e);return Object.keys(t).filter((function(e){return void 0!==t[e]})).map((function(e){return By(e,t[e],r)})).filter(Boolean).join("&")}(this.queryParams.filter((function(e){return-1!==Object.keys(t).indexOf(e)})).reduce((function(e,r){return e[r]=t[r],e}),{}),i.queryParams);return a?o+"?"+a:o},t.prototype.getParams=function(t){var e=t instanceof RegExp?function(e){return t.test(e.type)}:function(e){return e.type===t};return this.tokens.filter(e).map((function(t){return t.val[0]}))},t.prototype.urlTest=function(t,e,r,i){var n=this,s=new RegExp("^"+e,r?"":"i"),o=t.match(s);return o?this.urlParams.length?o.slice(1,this.urlParams.length+1).reduce((function(t,e,r){return t[n.urlParams[r]]=(Dy[i]||decodeURIComponent)(e),t}),{}):{}:null},t}();class Gy{constructor(t){this.routes={};for(const[e,r]of Object.entries(t)){let t,i;r instanceof Array?(t=r[0],i=r[1]||"GET"):(t=r,i="GET"),this.routes[i]=this.routes[i]||{},this.routes[i][e]=new qy(t)}}match(t,e="GET"){for(const[r,i]of Object.entries(this.routes[e]||[])){const e=t.split("?",2),n=e[0],s=i.test(n);if(s)return s._route=r,s._query=new URLSearchParams(2===e.length?e[1]:""),s}return{_route:null}}}class Vy{constructor(t){this.router=new Gy(this.routes),this.collections=t}get routes(){return{index:"coll-index",coll:"c/:coll",urls:"c/:coll/urls",createColl:["c/create","POST"],deleteColl:["c/:coll","DELETE"],updateAuth:["c/:coll/updateAuth","POST"],updateMetadata:["c/:coll/metadata","POST"],curated:"c/:coll/curated/:list",pages:"c/:coll/pages",textIndex:"c/:coll/textIndex",deletePage:["c/:coll/page/:page","DELETE"]}}async apiResponse(t,e,r){const i=this.router.match(t,e.method),n=await this.handleApi(e,i,r);if(n instanceof Response)return n;const s=n.error?404:200;return this.makeResponse(n,s)}async handleApi(t,e){switch(e._route){case"index":return await this.listAll(e._query.get("filter"));case"createColl":{const e=await t.json();return I(await this.collections.initNewColl(e.metadata||{},e.extraConfig||{}))}case"coll":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};const r=I(t);return"1"===e._query.get("all")?(t.store.db?(r.pages=await t.store.getAllPages(),r.lists=await t.store.db.getAll("pageLists"),r.curatedPages=await t.store.db.getAll("curatedPages")):(r.pages=[],r.lists=[],r.curatedPages=[]),r.verify=await t.store.getVerifyInfo()):(r.numLists=await t.store.db.count("pageLists"),r.numPages=await t.store.db.count("pages")),t.config.metadata.ipfsPins&&(r.ipfsPins=t.config.metadata.ipfsPins),r}case"deleteColl":{const t="1"===e._query.get("reload");return await this.collections.deleteColl(e.coll,t)?await this.listAll():{error:"collection_not_found"}}case"updateAuth":{const r=await t.json();return{success:await this.collections.updateAuth(e.coll,r.headers)}}case"updateMetadata":{const r=await t.json();return{metadata:await this.collections.updateMetadata(e.coll,r)}}case"urls":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};const r=e._query.get("url"),i=Number(e._query.get("count")||100),n=e._query.get("mime"),s="1"===e._query.get("prefix"),o=e._query.get("fromUrl"),a=e._query.get("fromTs"),c=e._query.get("fromMime"),l=Number(e._query.get("fromStatus")||0);if(!t.store.resourcesByMime)return{urls:[]};let h;return h=r?await t.store.resourcesByUrlAndMime(r,n,i,s,o,a):await t.store.resourcesByMime(n,i,c,o,l),h=h||[],{urls:h}}case"pages":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};return{pages:await t.store.getAllPages()}}case"textIndex":{const t=await this.collections.getColl(e.coll);return t?t.store.getTextIndex?await t.store.getTextIndex():{}:{error:"collection_not_found"}}case"curated":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};const r=Number(e.list);return{curated:await t.store.db.getAllFromIndex("curatedPages","listPages",IDBKeyRange.bound([r],[r+1]))}}case"deletePage":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};const{pageSize:r,deleteSize:i}=t.store.deletePage(e.page);return this.collections.updateSize(e.coll,r,i),{pageSize:r,deleteSize:i}}default:return{error:"not_found"}}}async listAll(t){const e=await this.collections.listAll(),r=[];return e.forEach((e=>{"live"!==e.type&&"remoteproxy"!==e.type&&(t&&0!==e.type.indexOf(t)||r.push(I(e)))})),{colls:r}}makeResponse(t,e=200){return new Response(JSON.stringify(t),{status:e,headers:{"Content-Type":"application/json"}})}}const Ky=/^(?::([\w-]+)\/)?(\d*)([a-z]+_|[$][a-z0-9:.-]+)?(?:\/|\||%7C|%7c)(.+)/;class Jy{constructor(t,e,{isRoot:r=!1,mod:i="",ts:n="",proxyOrigin:s=null,localOrigin:o=null}={}){const a=Ky.exec(t);if(this.url="",this.timestamp=n,this.mod=i,this.pageId="",this.hash="",!a&&(t.startsWith("https:")||t.startsWith("http:")||t.startsWith("blob:")))this.url=t;else if(!a&&r)this.url="https://"+t;else{if(!a)return void(this.url=null);this.pageId=a[1]||"",this.timestamp=a[2],this.mod=a[3],this.url=a[4]}if(s&&o){const t=new URL(this.url);t.origin===o&&(this.url=s+t.pathname+(t.search?t.search:""))}const c=this.url.indexOf("#");c>0&&(this.hash=this.url.slice(c),this.url=this.url.substring(0,c)),this.request=e,this.method=e.method,this.mode=e.mode,this._postToGetConverted=!1}get headers(){return this.request.headers}get destination(){return this.request.destination}get referrer(){return this.request.referrer}async convertPostToGet(){if(this._postToGetConverted)return this.url;const t=this.request;if("POST"!==t.method&&"PUT"!==t.method)return this.url;const e={method:t.method,postData:await t.text(),headers:t.headers,url:this.url};return Wr(e)&&(this.url=e.url,this.method="GET",this.mode="navigate"===this.request.mode?"same-origin":this.request.mode,this._postToGetConverted=!0),this.url}prepareProxyRequest(t,e=!0){let r,i,n;if(e){r=new Headers(this.request.headers),i=this.request.referrer;const e=i.indexOf("/http",t.length-1);e>0&&(i=i.slice(e+1),r.set("X-Proxy-Referer",i)),n=this.request.credentials,this.cookie&&r.set("X-Proxy-Cookie",this.cookie)}else r=new Headers,n="omit";let s=this.url;if(s.startsWith("//"))try{s=new URL(i).protocol+s}catch(t){s="https:"+s}return{referrer:i,headers:r,credentials:n,url:s}}async getBody(){const t=this.request.clone();return new Uint8Array(await t.arrayBuffer())}}const Zy="x-wabac-is-ajax-req";class Xy extends xy{constructor(t,e=null,r=!1,i={}){super(self),this.prefixes=t,this.colls=null,this.inited=null,this.root=e,this.checkIpfs=r,this.defaultConfig=i,this._fileHandles={}}_createCollection(t){return new tn(t,this.prefixes,this.defaultConfig)}loadAll(t){return this.colls={},this.inited=super.loadAll(t),this.inited}async getColl(t){return this.colls[t]||(this.colls[t]=await this.loadColl(t)),this.colls[t]}async reload(t){delete this.colls[t],await this.getColl(t)}async addCollection(t,e){const r=await super.addCollection(t,e);return r&&r.name&&(this.colls[r.name]=this._createCollection(r)),r}async deleteColl(t,e=!1){return this.colls[t]&&(this.colls[t].store&&this.colls[t].store.delete&&await this.colls[t].store.delete(),e&&this.colls[t].config&&this.colls[t].config.extra&&this.colls[t].config.extra.fileHandle&&(this._fileHandles[this.colls[t].config.sourceUrl]=this.colls[t].config.extra.fileHandle)),!!await super.deleteColl(t)&&(delete this.colls[t],!0)}async initNewColl(t,e={},r="archive"){const i=await super.initNewColl(t,e,r);return i&&(this.colls[i.name]=i),i}async updateAuth(t,e){this.colls[t]&&this.colls[t].store.updateHeaders&&this.colls[t].store.updateHeaders(e),await super.updateAuth(t,e)}async updateMetadata(t,e){const r=await super.updateMetadata(t,e);return this.colls[t]&&r&&(this.colls[t].config.metadata=r,this.colls[t].metadata=r),r}async updateSize(t,e,r,i){const n=await super.updateSize(t,e,r,i);return this.colls[t]&&n&&(this.colls[t].config.metadata=n,this.colls[t].metadata=n),void 0!==i&&this.colls[t]&&(this.colls[t].config.decode=i),n}}class Yy{constructor({staticData:t=null,ApiClass:e=Vy,defaultConfig:r={},CollectionsClass:i=Xy}={}){this.prefix=self.registration?self.registration.scope:"",this.replayPrefix=this.prefix;const n=new URLSearchParams(self.location.search);let s="w";n.has("replayPrefix")&&(s=n.get("replayPrefix")),s&&(this.replayPrefix+=s+"/"),this.staticPrefix=this.prefix+"static/",this.distPrefix=this.prefix+"dist/";const o={static:this.staticPrefix,root:this.prefix,main:this.replayPrefix};this.staticData=t||new Map,this.staticData.set(this.staticPrefix+"wombat.js",{type:"application/javascript",content:'/*! wombat.js is part of Webrecorder project. Copyright (C) 2020-2021, Webrecorder Software. Licensed under the Affero General Public License v3. */(()=>{"use strict";function t(){this._map=[]}function e(t,e){void 0!==self.Symbol&&void 0!==self.Symbol.toStringTag&&Object.defineProperty(t.prototype,self.Symbol.toStringTag,{value:e,enumerable:!1})}function r(t){for(var e,r,i=t.__proto__||t.constructor.prototype||t.prototype,o=Object.getOwnPropertyNames(i),n=o.length,s=0;s=0?this._map.splice(e,1)[0][1]:null},t.prototype.map=function(t){for(var e=0;e0?"&":"?";return`${t}${i}__wb_method=${r}&${e}`}(t.url,n,t.method),t.method="GET",t.requestBody=n,!0)}function u(t,e=!0){if("string"==typeof t)try{t=JSON.parse(t)}catch(e){t={}}const r=new URLSearchParams,i={};try{JSON.stringify(t,((t,e)=>{var o;return["object","function"].includes(typeof e)||r.set((o=t,r.has(o)?(i[o]||(i[o]=1),o+"."+ ++i[o]+"_"):o),e),e}))}catch(t){if(!e)throw t}return r}function d(t,e=!0){return u(t,e).toString()}function f(e,i){if(!(this instanceof f))return new f(e,i);this.debug_rw=!1,this.$wbwindow=e,this.WBWindow=Window,this.origHost=e.location.host,this.origHostname=e.location.hostname,this.origProtocol=e.location.protocol,this.HTTP_PREFIX="http://",this.HTTPS_PREFIX="https://",this.REL_PREFIX="//",this.VALID_PREFIXES=[this.HTTP_PREFIX,this.HTTPS_PREFIX,this.REL_PREFIX],this.IGNORE_PREFIXES=["#","about:","data:","blob:","mailto:","javascript:","{","*"],"ignore_prefixes"in i&&(this.IGNORE_PREFIXES=this.IGNORE_PREFIXES.concat(i.ignore_prefixes)),this.WB_CHECK_THIS_FUNC="_____WB$wombat$check$this$function_____",this.WB_ASSIGN_FUNC="_____WB$wombat$assign$function_____",this.wb_setAttribute=e.Element.prototype.setAttribute,this.wb_getAttribute=e.Element.prototype.getAttribute,this.wb_funToString=Function.prototype.toString,this.WBAutoFetchWorker=null,this.wbUseAFWorker=i.enable_auto_fetch&&null!=e.Worker&&i.is_live,this.wb_rel_prefix="",this.wb_wombat_updating=!1,this.message_listeners=new t,this.storage_listeners=new t,this.linkAsTypes={script:"js_",worker:"js_",style:"cs_",image:"im_",document:"if_",fetch:"mp_",font:"oe_",audio:"oe_",video:"oe_",embed:"oe_",object:"oe_",track:"oe_","":"mp_",null:"mp_",undefined:"mp_"},this.linkTagMods={linkRelToAs:{import:this.linkAsTypes,preload:this.linkAsTypes},stylesheet:"cs_",null:"mp_",undefined:"mp_","":"mp_"},this.tagToMod={A:{href:"mp_"},AREA:{href:"mp_"},AUDIO:{src:"oe_",poster:"im_"},BASE:{href:"mp_"},EMBED:{src:"oe_"},FORM:{action:"mp_"},FRAME:{src:"fr_"},IFRAME:{src:"if_"},IMAGE:{href:"im_","xlink:href":"im_"},IMG:{src:"im_",srcset:"im_"},INPUT:{src:"oe_"},INS:{cite:"mp_"},META:{content:"mp_"},OBJECT:{data:"oe_",codebase:"oe_"},Q:{cite:"mp_"},SCRIPT:{src:"js_","xlink:href":"js_"},SOURCE:{src:"oe_",srcset:"oe_"},TRACK:{src:"oe_"},VIDEO:{src:"oe_",poster:"im_"},image:{href:"im_","xlink:href":"im_"}},this.URL_PROPS=["href","hash","pathname","host","hostname","protocol","origin","search","port"],this.wb_info=i,this.wb_opts=i.wombat_opts,this.wb_replay_prefix=i.prefix,this.wb_is_proxy=this.wb_info.proxy_magic||!this.wb_replay_prefix,this.wb_info.top_host=this.wb_info.top_host||"*",this.wb_curr_host=e.location.protocol+"//"+e.location.host,this.wb_info.wombat_opts=this.wb_info.wombat_opts||{},this.wb_orig_scheme=this.wb_info.wombat_scheme+"://",this.wb_orig_origin=this.wb_orig_scheme+this.wb_info.wombat_host,this.wb_abs_prefix=this.wb_replay_prefix,this.wb_capture_date_part="",!this.wb_info.is_live&&this.wb_info.wombat_ts&&(this.wb_capture_date_part="/"+this.wb_info.wombat_ts+"/"),this.BAD_PREFIXES=["http:"+this.wb_replay_prefix,"https:"+this.wb_replay_prefix,"http:/"+this.wb_replay_prefix,"https:/"+this.wb_replay_prefix],this.hostnamePortRe=/^[\\w-]+(\\.[\\w-_]+)+(:\\d+)(\\/|$)/,this.ipPortRe=/^\\d+\\.\\d+\\.\\d+\\.\\d+(:\\d+)?(\\/|$)/,this.workerBlobRe=/__WB_pmw\\(.*?\\)\\.(?=postMessage\\()/g,this.rmCheckThisInjectRe=/_____WB\\$wombat\\$check\\$this\\$function_____\\(.*?\\)/g,this.STYLE_REGEX=/(url\\s*\\(\\s*[\\\\"\']*)([^)\'"]+)([\\\\"\']*\\s*\\))/gi,this.IMPORT_REGEX=/(@import\\s*[\\\\"\']*)([^)\'";]+)([\\\\"\']*\\s*;?)/gi,this.IMPORT_JS_REGEX=/^(import\\s*\\([\'"]+)([^\'"]+)(["\'])/i,this.no_wombatRe=/WB_wombat_/g,this.srcsetRe=/\\s*(\\S*\\s+[\\d.]+[wx]),|(?:\\s*,(?:\\s+|(?=https?:)))/,this.cookie_path_regex=/\\bPath=\'?"?([^;\'"\\s]+)/i,this.cookie_domain_regex=/\\bDomain=([^;\'"\\s]+)/i,this.cookie_expires_regex=/\\bExpires=([^;\'"]+)/gi,this.SetCookieRe=/,(?![|])/,this.IP_RX=/^(\\d)+\\.(\\d)+\\.(\\d)+\\.(\\d)+$/,this.FullHTMLRegex=/^\\s*<(?:html|head|body|!doctype html)/i,this.IsTagRegex=/^\\s*0&&e.preserveMedia(r)}))},w.prototype.terminate=function(){this.worker.terminate()},w.prototype.justFetch=function(t){this.worker.postMessage({type:"fetch-all",values:t})},w.prototype.fetchAsPage=function(t,e,r){if(t){var i={"X-Wombat-History-Page":e};if(r){var o=encodeURIComponent(r.trim());r&&(i["X-Wombat-History-Title"]=o)}var n={url:t,options:{headers:i,cache:"no-store"}};this.justFetch([n])}},w.prototype.postMessage=function(t,e){if(e){var r=this;Promise.resolve().then((function(){r.worker.postMessage(t)}))}else this.worker.postMessage(t)},w.prototype.preserveSrcset=function(t,e){this.postMessage({type:"values",srcset:{value:t,mod:e,presplit:!0}},!0)},w.prototype.preserveDataSrcset=function(t){this.postMessage({type:"values",srcset:{value:t.dataset.srcset,mod:this.rwMod(t),presplit:!1}},!0)},w.prototype.preserveMedia=function(t){this.postMessage({type:"values",media:t},!0)},w.prototype.getSrcset=function(t){return this.wombat.wb_getAttribute?this.wombat.wb_getAttribute.call(t,"srcset"):t.getAttribute("srcset")},w.prototype.rwMod=function(t){switch(t.tagName){case"SOURCE":return t.parentElement&&"PICTURE"===t.parentElement.tagName?"im_":"oe_";case"IMG":return"im_"}return"oe_"},w.prototype.extractFromLocalDoc=function(){var t=this;Promise.resolve().then((function(){for(var e={type:"values",context:{docBaseURI:document.baseURI}},r=[],i=0,o=document.styleSheets;i=0||t.indexOf("ecmascript")>=0)&&(t.indexOf("json")>=0||t.indexOf("text/")>=0))},f.prototype.skipWrapScriptTextBasedOnText=function(t){if(!t||t.indexOf(this.WB_ASSIGN_FUNC)>=0||0===t.indexOf("<"))return!0;for(var e=["window","self","document","location","top","parent","frames","opener"],r=0;r=0)return!1;return!0},f.prototype.nodeHasChildren=function(t){if(!t)return!1;if("function"==typeof t.hasChildNodes)return t.hasChildNodes();var e=t.children||t.childNodes;return!!e&&e.length>0},f.prototype.rwModForElement=function(t,e){if(t){var r="mp_";if("LINK"===t.tagName&&"href"===e){if(t.rel){var i=t.rel.trim().toLowerCase(),o=this.wb_getAttribute.call(t,"as");if(o&&null!=this.linkTagMods.linkRelToAs[i])r=this.linkTagMods.linkRelToAs[i][o.toLowerCase()];else null!=this.linkTagMods[i]&&(r=this.linkTagMods[i])}}else{var n=this.tagToMod[t.tagName];null!=n&&(r=n[e])}return r}},f.prototype.removeWBOSRC=function(t){"SCRIPT"!==t.tagName||t.__$removedWBOSRC$__||(t.hasAttribute("__wb_orig_src")&&t.removeAttribute("__wb_orig_src"),t.__$removedWBOSRC$__=!0)},f.prototype.retrieveWBOSRC=function(t){var e;if("SCRIPT"===t.tagName&&!t.__$removedWBOSRC$__)return null==(e=this.wb_getAttribute?this.wb_getAttribute.call(t,"__wb_orig_src"):t.getAttribute("__wb_orig_src"))&&(t.__$removedWBOSRC$__=!0),e},f.prototype.wrapScriptTextJsProxy=function(t){return\'var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };\\nif (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }\\n{\\nlet window = _____WB$wombat$assign$function_____("window");\\nlet globalThis = _____WB$wombat$assign$function_____("globalThis");\\nlet self = _____WB$wombat$assign$function_____("self");\\nlet document = _____WB$wombat$assign$function_____("document");\\nlet location = _____WB$wombat$assign$function_____("location");\\nlet top = _____WB$wombat$assign$function_____("top");\\nlet parent = _____WB$wombat$assign$function_____("parent");\\nlet frames = _____WB$wombat$assign$function_____("frames");\\nlet opener = _____WB$wombat$assign$function_____("opener");\\n{\\n\'+t.replace(this.DotPostMessageRe,".__WB_pmw(self.window)$1")+"\\n\\n}}"},f.prototype.watchElem=function(t,e){if(!this.$wbwindow.MutationObserver)return!1;new this.$wbwindow.MutationObserver((function(t,r){for(var i=0;i"},f.prototype.getFinalUrl=function(t,e,r){var i=t?this.wb_rel_prefix:this.wb_abs_prefix;return null==e&&(e=this.wb_info.mod),this.wb_info.is_live||(i+=this.wb_info.wombat_ts),"/"!==(i+=e)[i.length-1]&&(i+="/"),i+r},f.prototype.resolveRelUrl=function(t,e){var r=e||this.$wbwindow.document,i=this.makeParser(r.baseURI,r),o=i.href.lastIndexOf("#"),n=o>=0?i.href.substring(0,o):i.href,s=n.lastIndexOf("/");return s>=0&&s!==n.length-1?i.href=n.substring(0,s+1)+t:i.href=n+t,i.href},f.prototype.extractOriginalURL=function(t){if(!t)return"";if(this.wb_is_proxy)return t;var e,r=t.toString(),i=r;if(this.startsWithOneOf(i,this.IGNORE_PREFIXES))return i;if(i.startsWith(this.wb_info.static_prefix))return i;e=this.startsWith(i,this.wb_abs_prefix)?this.wb_abs_prefix.length:this.wb_rel_prefix&&this.startsWith(i,this.wb_rel_prefix)?this.wb_rel_prefix.length:this.wb_rel_prefix?1:0;var o=i.indexOf("/http",e);return o<0&&(o=i.indexOf("///",e)),o<0&&(o=i.indexOf("/blob:",e)),o<0&&(o=i.indexOf("/about:blank",e)),o>=0?i=i.substr(o+1):((o=i.indexOf(this.wb_replay_prefix))>=0&&(i=i.substr(o+this.wb_replay_prefix.length)),i.length>4&&"_"===i.charAt(2)&&"/"===i.charAt(3)&&(i=i.substr(4)),i===r||this.startsWithOneOf(i,this.VALID_PREFIXES)||this.startsWith(i,"blob:")||(i=this.wb_orig_scheme+i)),"/"===r.charAt(0)&&"/"!==r.charAt(1)&&this.startsWith(i,this.wb_orig_origin)&&(i=i.substr(this.wb_orig_origin.length)),this.startsWith(i,this.REL_PREFIX)?this.wb_info.wombat_scheme+":"+i:i},f.prototype.makeParser=function(t,e){var r=this.extractOriginalURL(t),i=e;return e||(i="about:blank"===this.$wbwindow.location.href&&this.$wbwindow.opener?this.$wbwindow.opener.document:this.$wbwindow.document),this._makeURLParser(r,i)},f.prototype._makeURLParser=function(t,e){try{return new this.$wbwindow.URL(t,e.baseURI)}catch(t){}var r=e.createElement("a");return r._no_rewrite=!0,r.href=t,r},f.prototype.defProp=function(t,e,r,i,o){var n=Object.getOwnPropertyDescriptor(t,e);if(n&&!n.configurable)return!1;if(!i)return!1;var s={configurable:!0,enumerable:o||!1,get:i};r&&(s.set=r);try{return Object.defineProperty(t,e,s),!0}catch(t){return console.warn("Failed to redefine property %s",e,t.message),!1}},f.prototype.defGetterProp=function(t,e,r,i){var o=Object.getOwnPropertyDescriptor(t,e);if(o&&!o.configurable)return!1;if(!r)return!1;try{return Object.defineProperty(t,e,{configurable:!0,enumerable:i||!1,get:r}),!0}catch(t){return console.warn("Failed to redefine property %s",e,t.message),!1}},f.prototype.getOrigGetter=function(t,e){var r;if(t.__lookupGetter__&&(r=t.__lookupGetter__(e)),!r&&Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);i&&(r=i.get)}return r},f.prototype.getOrigSetter=function(t,e){var r;if(t.__lookupSetter__&&(r=t.__lookupSetter__(e)),!r&&Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);i&&(r=i.set)}return r},f.prototype.getAllOwnProps=function(t){for(var e=[],r=Object.getOwnPropertyNames(t),i=0;i "+n),r.href=n}}},f.prototype.checkLocationChange=function(t,e){var r=typeof t,i=e?this.$wbwindow.__WB_replay_top.location:this.$wbwindow.location;"string"===r?this.updateLocation(t,i.href,i):"object"===r&&this.updateLocation(t.href,t._orig_href,i)},f.prototype.checkAllLocations=function(){if(this.wb_wombat_updating)return!1;this.wb_wombat_updating=!0,this.checkLocationChange(this.$wbwindow.WB_wombat_location,!1),this.$wbwindow.WB_wombat_location!=this.$wbwindow.__WB_replay_top.WB_wombat_location&&this.checkLocationChange(this.$wbwindow.__WB_replay_top.WB_wombat_location,!0),this.wb_wombat_updating=!1},f.prototype.proxyToObj=function(t){if(t)try{var e=t.__WBProxyRealObj__;if(e)return e}catch(t){}return t},f.prototype.objToProxy=function(t){if(t)try{var e=t._WB_wombat_obj_proxy;if(e)return e}catch(t){}return t},f.prototype.defaultProxyGet=function(t,e,r,i){switch(e){case"__WBProxyRealObj__":return t;case"location":case"WB_wombat_location":return t.WB_wombat_location;case"_WB_wombat_obj_proxy":return t._WB_wombat_obj_proxy;case"__WB_pmw":case this.WB_ASSIGN_FUNC:case this.WB_CHECK_THIS_FUNC:return t[e];case"origin":return t.WB_wombat_location.origin;case"constructor":return t.constructor}var o=t[e],n=typeof o;if("function"===n&&-1!==r.indexOf(e)){switch(e){case"requestAnimationFrame":case"cancelAnimationFrame":if(!this.isNativeFunction(o))return o;break;case"eval":if(this.isNativeFunction(o))return this.wrappedEval(o)}var s=i[e];return s&&s.original===o||(s={original:o,boundFn:o.bind(t)},i[e]=s),s.boundFn}return"object"===n&&o&&o._WB_wombat_obj_proxy?(o instanceof this.WBWindow&&this.initNewWindowWombat(o),o._WB_wombat_obj_proxy):o},f.prototype.setLoc=function(t,e){var r=this.makeParser(e,t.ownerDocument);t._orig_href=e,t._parser=r;var i=r.href;t._hash=r.hash,t._href=i,t._host=r.host,t._hostname=r.hostname,r.origin?t._origin=r.host?r.origin:"null":t._origin=r.protocol+"//"+r.hostname+(r.port?":"+r.port:""),t._pathname=r.pathname,t._port=r.port,t._protocol=r.protocol,t._search=r.search,Object.defineProperty||(t.href=i,t.hash=r.hash,t.host=t._host,t.hostname=t._hostname,t.origin=t._origin,t.pathname=t._pathname,t.port=t._port,t.protocol=t._protocol,t.search=t._search)},f.prototype.makeGetLocProp=function(t,e){var r=this;return function(){if(this._no_rewrite)return e.call(this,t);var i=e.call(this,"href");return"href"===t?r.extractOriginalURL(i):"ancestorOrigins"===t?[]:(this._orig_href!==i&&r.setLoc(this,i),this["_"+t])}},f.prototype.makeSetLocProp=function(t,e,r){var i=this;return function(o){if(this._no_rewrite)return e.call(this,t,o);if(this["_"+t]!==o){if(this["_"+t]=o,!this._parser){var n=r.call(this);this._parser=i.makeParser(n,this.ownerDocument)}var s=!1;"href"===t&&"string"==typeof o&&o&&("."===o[0]||"#"===o[0]?o=i.resolveRelUrl(o,this.ownerDocument):"/"===o[0]&&(o.length>1&&"/"===o[1]?o=this._parser.protocol+o:(s=!0,o=WB_wombat_location.origin+o)));try{this._parser[t]=o}catch(e){console.log("Error setting "+t+" = "+o)}"hash"===t?(o=this._parser[t],e.call(this,"hash",o)):(s=s||o===this._parser.pathname,o=i.rewriteUrl(this._parser.href,s),e.call(this,"href",o))}}},f.prototype.styleReplacer=function(t,e,r,i,o,n){return e+this.rewriteUrl(r)+i},f.prototype.domConstructorErrorChecker=function(t,e,r,i){var o,n="number"==typeof i?i:1;if(t instanceof this.WBWindow?o="Failed to construct \'"+e+"\': Please use the \'new\' operator, this DOM object constructor cannot be called as a function.":r&&r.length=0)return o;if(0===o.indexOf(this.wb_rel_prefix)&&o.indexOf("http")>1){var a=o.indexOf(":/");return a>0&&"/"!==o[a+2]?o.substring(0,a+2)+"/"+o.substring(a+2):o}return this.getFinalUrl(!0,r,this.wb_orig_origin+o)}"."===o.charAt(0)&&(o=this.resolveRelUrl(o,i));var h=this.startsWithOneOf(o.toLowerCase(),this.VALID_PREFIXES);if(h){var w=this.replayTopHost,p=this.replayTopProtocol,c=h+w+"/";if(this.startsWith(o,c)){if(this.startsWith(o,this.wb_replay_prefix))return o;var _=p+"//",l=o.substring(c.length),u=!1;return l.indexOf(this.wb_rel_prefix)<0&&o.indexOf("/static/")<0&&(l=this.getFinalUrl(!0,r,WB_wombat_location.origin+"/"+l),u=!0),h!==_&&h!==this.REL_PREFIX&&(u=!0),u&&(o=e?"":_+w,l&&"/"!==l[0]&&(o+="/"),o+=l),o}return this.getFinalUrl(e,r,o)}return(h=this.startsWithOneOf(o,this.BAD_PREFIXES))?this.getFinalUrl(e,r,this.extractOriginalURL(o)):o},f.prototype.rewriteUrl=function(t,e,r,i){var o=this.rewriteUrl_(t,e,r,i);return this.debug_rw&&(t!==o?console.log("REWRITE: "+t+" -> "+o):console.log("NOT REWRITTEN "+t)),o},f.prototype.performAttributeRewrite=function(t,e,r,i){switch(e){case"innerHTML":case"outerHTML":return this.rewriteHtml(r);case"filter":return this.rewriteInlineStyle(r);case"style":return this.rewriteStyle(r);case"srcset":return this.rewriteSrcset(r,t)}if(i&&!this.startsWithOneOf(r,this.VALID_PREFIXES))return r;var o=this.rwModForElement(t,e);return this.wbUseAFWorker&&this.WBAutoFetchWorker&&this.isSavedDataSrcSrcset(t)&&this.WBAutoFetchWorker.preserveDataSrcset(t),this.rewriteUrl(r,!1,o,t.ownerDocument)},f.prototype.rewriteAttr=function(t,e,r){var i=!1;if(!t||!t.getAttribute||t._no_rewrite||t["_"+e])return i;var o=this.wb_getAttribute.call(t,e);if(!o||this.startsWith(o,"javascript:"))return i;var n=this.performAttributeRewrite(t,e,o,r);return n!==o&&(this.removeWBOSRC(t),this.wb_setAttribute.call(t,e,n),i=!0),i},f.prototype.noExceptRewriteStyle=function(t){try{return this.rewriteStyle(t)}catch(e){return t}},f.prototype.rewriteStyle=function(t){if(!t)return t;var e=t;return"object"==typeof t&&(e=t.toString()),"string"==typeof e?e.replace(this.STYLE_REGEX,this.styleReplacer).replace(this.IMPORT_REGEX,this.styleReplacer).replace(this.no_wombatRe,""):e},f.prototype.rewriteSrcset=function(t,e){if(!t)return"";for(var r=t.split(this.srcsetRe),i=[],o=this.rwModForElement(e,"srcset"),n=0;n=0){var o="javascript:";r=o+"window.parent._wb_wombat.initNewWindowWombat(window);"+i.substr(o.length)}return r||(r=this.rewriteUrl(i,!1,this.rwModForElement(t,e))),r!==i&&(this.wb_setAttribute.call(t,e,r),!0)},f.prototype.rewriteScript=function(t){if(t.hasAttribute("src")||!t.textContent||!this.$wbwindow.Proxy)return this.rewriteAttr(t,"src");if(this.skipWrapScriptBasedOnType(t.type))return!1;var e=t.textContent.trim();return!this.skipWrapScriptTextBasedOnText(e)&&(t.textContent=this.wrapScriptTextJsProxy(e),!0)},f.prototype.rewriteSVGElem=function(t){var e=this.rewriteAttr(t,"filter");return e=this.rewriteAttr(t,"style")||e,e=this.rewriteAttr(t,"xlink:href")||e,e=this.rewriteAttr(t,"href")||e,e=this.rewriteAttr(t,"src")||e},f.prototype.rewriteElem=function(t){var e=!1;if(!t)return e;if(t instanceof SVGElement)e=this.rewriteSVGElem(t);else switch(t.tagName){case"META":var r=this.wb_getAttribute.call(t,"http-equiv");r&&"content-security-policy"===r.toLowerCase()&&(this.wb_setAttribute.call(t,"http-equiv","_"+r),e=!0);break;case"STYLE":var i=this.rewriteStyle(t.textContent);t.textContent!==i&&(t.textContent=i,e=!0,this.wbUseAFWorker&&this.WBAutoFetchWorker&&null!=t.sheet&&this.WBAutoFetchWorker.deferredSheetExtraction(t.sheet));break;case"LINK":e=this.rewriteAttr(t,"href"),this.wbUseAFWorker&&"stylesheet"===t.rel&&this._addEventListener(t,"load",this.utilFns.wbSheetMediaQChecker);break;case"IMG":e=this.rewriteAttr(t,"src"),e=this.rewriteAttr(t,"srcset")||e,e=this.rewriteAttr(t,"style")||e,this.wbUseAFWorker&&this.WBAutoFetchWorker&&t.dataset.srcset&&this.WBAutoFetchWorker.preserveDataSrcset(t);break;case"OBJECT":if(this.wb_info.isSW&&t.parentElement&&"application/pdf"===t.getAttribute("type")){for(var o=this.$wbwindow.document.createElement("IFRAME"),n=0;n0;)for(var i=r.shift(),o=0;o"+r+"","text/html");if(!i||!this.nodeHasChildren(i.head)||!i.head.children[0].content)return r;var o=i.head.children[0];if(o._no_rewrite=!0,this.recurseRewriteElem(o.content)){var n=o.innerHTML;if(e){var s=o.content.children&&o.content.children[0];if(s){var a="";this.endsWith(n,a)&&!this.endsWith(r.toLowerCase(),a)&&(n=n.substring(0,n.length-a.length))}else if("<"!==r[0]||">"!==r[r.length-1])return void(this.write_buff+=r)}return n}return r},f.prototype.rewriteHtmlFull=function(t,e){var r=(new DOMParser).parseFromString(t,"text/html");if(!r)return t;for(var i=!1,o=0;o=0)r.documentElement._no_rewrite=!0,n=this.reconstructDocType(r.doctype)+r.documentElement.outerHTML;else{r.head._no_rewrite=!0,r.body._no_rewrite=!0;var s=this.nodeHasChildren(r.head),a=this.nodeHasChildren(r.body);if(n=(s?r.head.outerHTML:"")+(a?r.body.outerHTML:""),e)if(r.all.length>3){var h="";this.endsWith(n,h)&&!this.endsWith(t.toLowerCase(),h)&&(n=n.substring(0,n.length-h.length))}else if("<"!==t[0]||">"!==t[t.length-1])return void(this.write_buff+=t);n=this.reconstructDocType(r.doctype)+n}return n}return t},f.prototype.rewriteInlineStyle=function(t){var e;try{e=decodeURIComponent(t)}catch(r){e=t}if(e!==t){var r=this.rewriteStyle(e).split(",",2);return r[0]+","+encodeURIComponent(r[1])}return this.rewriteStyle(t)},f.prototype.rewriteCookie=function(t){var e=this,r=t.replace(this.wb_abs_prefix,"").replace(this.wb_rel_prefix,"");return r=r.replace(this.cookie_domain_regex,(function(t,i){var o={domain:i,cookie:r,wb_type:"cookie"};return e.sendTopMessage(o,!0),e.$wbwindow.location.hostname.indexOf(".")>=0&&!e.IP_RX.test(e.$wbwindow.location.hostname)?"Domain=."+e.$wbwindow.location.hostname:""})).replace(this.cookie_path_regex,(function(t,r){var i=e.rewriteUrl(r);return 0===i.indexOf(e.wb_curr_host)&&(i=i.substring(e.wb_curr_host.length)),"Path="+i})),"https:"!==e.$wbwindow.location.protocol&&(r=r.replace("secure","")),r.replace(",|",",")},f.prototype.rewriteWorker=function(t){if(!t)return t;var e=0===(t=t.toString()).indexOf("blob:"),r=0===t.indexOf("javascript:");if(!e&&!r){if(!this.startsWithOneOf(t,this.VALID_PREFIXES)&&!this.startsWith(t,"/")&&!this.startsWithOneOf(t,this.BAD_PREFIXES)){var i=this.resolveRelUrl(t,this.$wbwindow.document);return this.rewriteUrl(i,!1,"wkr_",this.$wbwindow.document)}return this.rewriteUrl(t,!1,"wkr_",this.$wbwindow.document)}var o=r?t.replace("javascript:",""):null;if(e){var n=new XMLHttpRequest;this.utilFns.XHRopen.call(n,"GET",t,!1),this.utilFns.XHRsend.call(n),o=n.responseText.replace(this.workerBlobRe,"").replace(this.rmCheckThisInjectRe,"this")}if(this.wb_info.static_prefix||this.wb_info.ww_rw_script){var s=this.$wbwindow.document.baseURI;o="(function() { self.importScripts(\'"+(this.wb_info.ww_rw_script||this.wb_info.static_prefix+"wombatWorkers.js")+"\'); new WBWombat({\'prefix\': \'"+this.wb_abs_prefix+"\', \'prefixMod\': \'"+this.wb_abs_prefix+"wkrf_/\', \'originalURL\': \'"+s+"\'}); })();"+o}var a=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(a)},f.prototype.rewriteTextNodeFn=function(t,e,r){var i,o=this.proxyToObj(t);if(r.length>0&&o.parentElement&&"STYLE"===o.parentElement.tagName){i=new Array(r.length);var n=r.length-1;2===n?(i[0]=r[0],i[1]=r[1]):1===n&&(i[0]=r[0]),i[n]=this.rewriteStyle(r[n])}else i=r;return e.__WB_orig_apply?e.__WB_orig_apply(o,i):e.apply(o,i)},f.prototype.rewriteDocWriteWriteln=function(t,e,r){var i,o=this.proxyToObj(t),n=r.length;if(0===n)return e.call(o);i=1===n?r[0]:Array.prototype.join.call(r,"");var s=this.rewriteHtml(i,!0),a=e.call(o,s);return this.initNewWindowWombat(o.defaultView),a},f.prototype.rewriteChildNodeFn=function(t,e,r){var i=this.proxyToObj(t);if(0===r.length)return e.call(i);var o=this.rewriteElementsInArguments(r);return e.__WB_orig_apply?e.__WB_orig_apply(i,o):e.apply(i,o)},f.prototype.rewriteInsertAdjHTMLOrElemArgs=function(t,e,r,i,o){var n=this.proxyToObj(t);return n._no_rewrite?e.call(n,r,i):o?e.call(n,r,this.rewriteHtml(i)):(this.rewriteElemComplete(i),e.call(n,r,i))},f.prototype.rewriteSetTimeoutInterval=function(t,e,r){var i=this.isString(r[0]),o=i?new Array(r.length):r;if(i){this.$wbwindow.Proxy?o[0]=this.wrapScriptTextJsProxy(r[0]):o[0]=r[0].replace(/\\blocation\\b/g,"WB_wombat_$&");for(var n=1;n0&&i(this.$wbwindow.CSSStyleValue,"parse"),this.$wbwindow.CSSStyleValue.parseAll&&this.$wbwindow.CSSStyleValue.parseAll.toString().indexOf("[native code]")>0&&i(this.$wbwindow.CSSStyleValue,"parseAll")}if(this.$wbwindow.CSSKeywordValue&&this.$wbwindow.CSSKeywordValue.prototype){var o=this.$wbwindow.CSSKeywordValue;this.$wbwindow.CSSKeywordValue=(t=this.$wbwindow.CSSKeywordValue,function(e){return r.domConstructorErrorChecker(this,"CSSKeywordValue",arguments),new t(r.rewriteStyle(e))}),this.$wbwindow.CSSKeywordValue.prototype=o.prototype,Object.defineProperty(this.$wbwindow.CSSKeywordValue.prototype,"constructor",{value:this.$wbwindow.CSSKeywordValue}),e(this.$wbwindow.CSSKeywordValue,"CSSKeywordValue")}if(this.$wbwindow.StylePropertyMap&&this.$wbwindow.StylePropertyMap.prototype){var n=this.$wbwindow.StylePropertyMap.prototype.set;this.$wbwindow.StylePropertyMap.prototype.set=function(){if(arguments.length<=1)return n.__WB_orig_apply?n.__WB_orig_apply(this,arguments):n.apply(this,arguments);var t=new Array(arguments.length);t[0]=arguments[0];for(var e=1;e")&&(e[0]=r.rewriteHtml(e[0]),i.type="text/html"),new t(e,i)}),this.$wbwindow.Blob.prototype=e.prototype}},f.prototype.initWSOverride=function(){this.$wbwindow.WebSocket&&this.$wbwindow.WebSocket.prototype&&(this.$wbwindow.WebSocket=function(t){function e(t,e){this.addEventListener=function(){},this.removeEventListener=function(){},this.close=function(){},this.send=function(t){console.log("ws send",t)},this.protocol=e&&e.length?e[0]:"",this.url=t,this.readyState=0}return e.CONNECTING=0,e.OPEN=1,e.CLOSING=2,e.CLOSED=3,e}(this.$wbwindow.WebSocket),Object.defineProperty(this.$wbwindow.WebSocket.prototype,"constructor",{value:this.$wbwindow.WebSocket}),e(this.$wbwindow.WebSocket,"WebSocket"))},f.prototype.initDocTitleOverride=function(){var t=this.getOrigGetter(this.$wbwindow.document,"title"),e=this.getOrigSetter(this.$wbwindow.document,"title"),r=this;this.defProp(this.$wbwindow.document,"title",(function(t){var i=e.call(this,t),o={wb_type:"title",title:t};return r.sendTopMessage(o),i}),t)},f.prototype.initFontFaceOverride=function(){if(this.$wbwindow.FontFace){var t,r=this,i=this.$wbwindow.FontFace;this.$wbwindow.FontFace=(t=this.$wbwindow.FontFace,function(e,i,o){r.domConstructorErrorChecker(this,"FontFace",arguments,2);var n=i;return null!=i&&(n="string"!=typeof i?r.rewriteInlineStyle(i.toString()):r.rewriteInlineStyle(i)),new t(e,n,o)}),this.$wbwindow.FontFace.prototype=i.prototype,Object.defineProperty(this.$wbwindow.FontFace.prototype,"constructor",{value:this.$wbwindow.FontFace}),e(this.$wbwindow.FontFace,"FontFace")}},f.prototype.initFixedRatio=function(t){try{this.$wbwindow.devicePixelRatio=t}catch(t){}if(Object.defineProperty)try{Object.defineProperty(this.$wbwindow,"devicePixelRatio",{value:t,writable:!1})}catch(t){}},f.prototype.initPaths=function(t){t.wombat_opts=t.wombat_opts||{},Object.assign(this.wb_info,t),this.wb_opts=t.wombat_opts,this.wb_replay_prefix=t.prefix,this.wb_is_proxy=t.proxy_magic||!this.wb_replay_prefix,this.wb_info.top_host=this.wb_info.top_host||"*",this.wb_curr_host=this.$wbwindow.location.protocol+"//"+this.$wbwindow.location.host,this.wb_info.wombat_opts=this.wb_info.wombat_opts||{},this.wb_orig_scheme=t.wombat_scheme+"://",this.wb_orig_origin=this.wb_orig_scheme+t.wombat_host,this.wb_abs_prefix=this.wb_replay_prefix,!t.is_live&&t.wombat_ts?this.wb_capture_date_part="/"+t.wombat_ts+"/":this.wb_capture_date_part="",this.initBadPrefixes(this.wb_replay_prefix),this.initCookiePreset()},f.prototype.initSeededRandom=function(t){this.$wbwindow.Math.seed=parseInt(t);var e=this;this.$wbwindow.Math.random=function(){return e.$wbwindow.Math.seed=(9301*e.$wbwindow.Math.seed+49297)%233280,e.$wbwindow.Math.seed/233280}},f.prototype.initHistoryOverrides=function(){this.overrideHistoryFunc("pushState"),this.overrideHistoryFunc("replaceState");var t=this;this.$wbwindow.addEventListener("popstate",(function(e){t.sendHistoryUpdate(t.$wbwindow.WB_wombat_location.href,t.$wbwindow.document.title)}))},f.prototype.initCookiePreset=function(){if(this.wb_info.presetCookie)for(var t=this.wb_info.presetCookie.split(";"),e=0;e2&&!this.__WB_xhr_open_arguments[2]&&-1===navigator.userAgent.indexOf("Firefox")&&(this.__WB_xhr_open_arguments[2]=!0,console.warn("wombat.js: Sync XHR not supported in SW-based replay in this browser, converted to async")),this._no_rewrite||(this.__WB_xhr_open_arguments[1]=i.rewriteUrl(this.__WB_xhr_open_arguments[1])),o.apply(this,this.__WB_xhr_open_arguments),!i.startsWith(this.__WB_xhr_open_arguments[1],"data:")){for(const[t,e]of this.__WB_xhr_headers.entries())n.call(this,t,e);n.call(this,"X-Pywb-Requested-With","XMLHttpRequest")}return s.call(this,t)}}else if(this.$wbwindow.XMLHttpRequest.prototype.open){var h=this.$wbwindow.XMLHttpRequest.prototype.open;this.utilFns.XHRopen=h,this.utilFns.XHRsend=this.$wbwindow.XMLHttpRequest.prototype.send,this.$wbwindow.XMLHttpRequest.prototype.open=function(t,e,r,o,n){var s=this._no_rewrite?e:i.rewriteUrl(e),a=!0;null==r||r||(a=!1),h.call(this,t,s,a,o,n),i.startsWith(s,"data:")||this.setRequestHeader("X-Pywb-Requested-With","XMLHttpRequest")}}if(this.$wbwindow.fetch){var w=this.$wbwindow.fetch;this.$wbwindow.fetch=function(t,e){var r=t,o=typeof t;if("string"===o)r=i.rewriteUrl(t);else if("object"===o&&t.url){var n=i.rewriteUrl(t.url);n!==t.url&&(r=new Request(n,e))}else"object"===o&&t.href&&(r=i.rewriteUrl(t.href));if(e||(e={}),void 0===e.credentials)try{e.credentials="include"}catch(t){}return w.call(i.proxyToObj(this),r,e)}}if(this.$wbwindow.Request&&this.$wbwindow.Request.prototype){var p=this.$wbwindow.Request;this.$wbwindow.Request=(t=this.$wbwindow.Request,function(e,r){i.domConstructorErrorChecker(this,"Request",arguments);var o=r||{},n=e,s=typeof e;switch(s){case"string":n=i.rewriteUrl(e);break;case"object":if(n=e,e.url){var a=i.rewriteUrl(e.url);a!==e.url&&(n=new t(a,e))}else e.href&&(n=i.rewriteUrl(e.toString(),!0))}return o.credentials="include",new t(n,o)}),this.$wbwindow.Request.prototype=p.prototype,Object.defineProperty(this.$wbwindow.Request.prototype,"constructor",{value:this.$wbwindow.Request})}if(this.$wbwindow.Response&&this.$wbwindow.Response.prototype){var c=this.$wbwindow.Response.prototype.redirect;this.$wbwindow.Response.prototype.redirect=function(t,e){var r=i.rewriteUrl(t,!0,null,i.$wbwindow.document);return c.call(this,r,e)}}if(this.$wbwindow.EventSource&&this.$wbwindow.EventSource.prototype){var _=this.$wbwindow.EventSource;this.$wbwindow.EventSource=(r=this.$wbwindow.EventSource,function(t,e){i.domConstructorErrorChecker(this,"EventSource",arguments);var o=t;return null!=t&&(o=i.rewriteUrl(t)),new r(o,e)}),this.$wbwindow.EventSource.prototype=_.prototype,Object.defineProperty(this.$wbwindow.EventSource.prototype,"constructor",{value:this.$wbwindow.EventSource}),e(this.$wbwindow.EventSource,"EventSource")}},f.prototype.initElementGetSetAttributeOverride=function(){if(!this.wb_opts.skip_setAttribute&&this.$wbwindow.Element&&this.$wbwindow.Element.prototype){var t=this,e=this.$wbwindow.Element.prototype;if(e.setAttribute){var r=e.setAttribute;e._orig_setAttribute=r,e.setAttribute=function(e,i){var o=i;if(e&&"string"==typeof o){var n=e.toLowerCase();if("LINK"===this.tagName&&"href"===n&&0===o.indexOf("data:text/css"))o=t.rewriteInlineStyle(i);else if("style"===n)o=t.rewriteStyle(i);else if("srcset"===n||"imagesrcset"===n&&"LINK"===this.tagName)o=t.rewriteSrcset(i,this);else{t.shouldRewriteAttr(this.tagName,n)&&(t.removeWBOSRC(this),this._no_rewrite||(o=t.rewriteUrl(i,!1,t.rwModForElement(this,n))))}}return r.call(this,e,o)}}if(e.getAttribute){var i=e.getAttribute;this.wb_getAttribute=i,e.getAttribute=function(e){var r=i.call(this,e);if(null===r)return r;var o=e;if(e&&(o=e.toLowerCase()),t.shouldRewriteAttr(this.tagName,o)){var n=t.retrieveWBOSRC(this);return n||t.extractOriginalURL(r)}return t.startsWith(o,"data-")&&t.startsWithOneOf(r,t.wb_prefixes)?t.extractOriginalURL(r):r}}}},f.prototype.initSvgImageOverrides=function(){if(this.$wbwindow.SVGImageElement){var t=this.$wbwindow.SVGImageElement.prototype,e=t.getAttribute,r=t.getAttributeNS,i=t.setAttribute,o=t.setAttributeNS,n=this;t.getAttribute=function(t){var r=e.call(this,t);return t.indexOf("xlink:href")>=0||"href"===t?n.extractOriginalURL(r):r},t.getAttributeNS=function(t,e){var i=r.call(this,t,e);return e.indexOf("xlink:href")>=0||"href"===e?n.extractOriginalURL(i):i},t.setAttribute=function(t,e){var r=e;return(t.indexOf("xlink:href")>=0||"href"===t)&&(r=n.rewriteUrl(e)),i.call(this,t,r)},t.setAttributeNS=function(t,e,r){var i=r;return(e.indexOf("xlink:href")>=0||"href"===e)&&(i=n.rewriteUrl(r)),o.call(this,t,e,i)}}},f.prototype.initCreateElementNSFix=function(){if(this.$wbwindow.document.createElementNS&&this.$wbwindow.Document.prototype.createElementNS){var t=this.$wbwindow.document.createElementNS,e=this,r=function(r,i){return t.call(e.proxyToObj(this),e.extractOriginalURL(r),i)};this.$wbwindow.Document.prototype.createElementNS=r,this.$wbwindow.document.createElementNS=r}},f.prototype.initInsertAdjacentElementHTMLOverrides=function(){var t=this.$wbwindow.Element;if(t&&t.prototype){var e=t.prototype,r=this.rewriteInsertAdjHTMLOrElemArgs;if(e.insertAdjacentHTML){var i=e.insertAdjacentHTML;e.insertAdjacentHTML=function(t,e){return r(this,i,t,e,!0)}}if(e.insertAdjacentElement){var o=e.insertAdjacentElement;e.insertAdjacentElement=function(t,e){return r(this,o,t,e,!1)}}}},f.prototype.initDomOverride=function(){var t=this.$wbwindow.Node;if(t&&t.prototype){var e=this.rewriteNodeFuncArgs;if(t.prototype.appendChild){var r=t.prototype.appendChild;t.prototype.appendChild=function(t,i){return e(this,r,t,i)}}if(t.prototype.insertBefore){var i=t.prototype.insertBefore;t.prototype.insertBefore=function(t,r){return e(this,i,t,r)}}if(t.prototype.replaceChild){var o=t.prototype.replaceChild;t.prototype.replaceChild=function(t,r){return e(this,o,t,r)}}this.overridePropToProxy(t.prototype,"ownerDocument"),this.overridePropToProxy(this.$wbwindow.HTMLHtmlElement.prototype,"parentNode"),this.overridePropToProxy(this.$wbwindow.Event.prototype,"target")}this.$wbwindow.Element&&this.$wbwindow.Element.prototype&&(this.overrideParentNodeAppendPrepend(this.$wbwindow.Element),this.overrideChildNodeInterface(this.$wbwindow.Element,!1)),this.$wbwindow.DocumentFragment&&this.$wbwindow.DocumentFragment.prototype&&this.overrideParentNodeAppendPrepend(this.$wbwindow.DocumentFragment)},f.prototype.initDocOverrides=function(t){if(Object.defineProperty){this.overrideReferrer(t),this.defGetterProp(t,"origin",(function(){return this.WB_wombat_location.origin})),this.defGetterProp(this.$wbwindow,"origin",(function(){return this.WB_wombat_location.origin}));var e=this;this.defProp(t,"domain",(function(t){var r=this.WB_wombat_location;r&&e.endsWith(r.hostname,t)&&(this.__wb_domain=t)}),(function(){return this.__wb_domain||this.WB_wombat_location.hostname}))}},f.prototype.initDocWriteOpenCloseOverride=function(){if(this.$wbwindow.DOMParser){var t=this.$wbwindow.Document.prototype,e=this.$wbwindow.document,r=this.rewriteDocWriteWriteln,i=e.write,o=function(){return r(this,i,arguments)};e.write=o,t.write=o;var n=e.writeln,s=function(){return r(this,n,arguments)};e.writeln=s,t.writeln=s;var a=this,h=e.open,w=function(){var t,e=a.proxyToObj(this);if(3===arguments.length){var r=a.rewriteUrl(arguments[0],!1,"mp_");t=h.call(e,r,arguments[1],arguments[2]),a.initNewWindowWombat(t,arguments[0])}else t=h.call(e),a.initNewWindowWombat(e.defaultView);return t};e.open=w,t.open=w;var p=e.close,c=function(){var t=a.proxyToObj(this);return a.initNewWindowWombat(t.defaultView),p.__WB_orig_apply?p.__WB_orig_apply(t,arguments):p.apply(t,arguments)};e.close=c,t.close=c;var _=this.getOrigGetter(t,"body"),l=this.getOrigSetter(t,"body");_&&l&&this.defProp(t,"body",(function(t){return t&&(t instanceof HTMLBodyElement||t instanceof HTMLFrameSetElement)&&a.rewriteElemComplete(t),l.call(a.proxyToObj(this),t)}),_)}},f.prototype.initIframeWombat=function(t){var e;e=t._get_contentWindow?t._get_contentWindow.call(t):t.contentWindow;try{if(!e||e===this.$wbwindow||e._skip_wombat||e._wb_wombat)return}catch(t){return}var r=t.src;this.initNewWindowWombat(e,r)},f.prototype.initNewWindowWombat=function(t,e){var r=!1;if(t&&!t._wb_wombat){if(e&&""!==e&&!this.startsWithOneOf(e,["about:blank","javascript:"])||(r=!0),!r&&this.wb_info.isSW){var i=this.extractOriginalURL(e);("about:blank"===i||i.startsWith("srcdoc:")||i.startsWith("blob:"))&&(r=!0)}if(r){var o={};Object.assign(o,this.wb_info);var n=new f(t,o);t._wb_wombat=n.wombatInit()}else this.initProtoPmOrigin(t),this.initPostMessageOverride(t),this.initMessageEventOverride(t),this.initCheckThisFunc(t),this.initImportWrapperFunc(t)}},f.prototype.initTimeoutIntervalOverrides=function(){var t=this.rewriteSetTimeoutInterval;if(this.$wbwindow.setTimeout&&!this.$wbwindow.setTimeout.__$wbpatched$__){var e=this.$wbwindow.setTimeout;this.$wbwindow.setTimeout=function(){return t(this,e,arguments)},this.$wbwindow.setTimeout.__$wbpatched$__=!0}if(this.$wbwindow.setInterval&&!this.$wbwindow.setInterval.__$wbpatched$__){var r=this.$wbwindow.setInterval;this.$wbwindow.setInterval=function(){return t(this,r,arguments)},this.$wbwindow.setInterval.__$wbpatched$__=!0}},f.prototype.initWorkerOverrides=function(){var t,e,r=this;if(this.$wbwindow.Worker&&!this.$wbwindow.Worker._wb_worker_overriden){var i=this.$wbwindow.Worker;this.$wbwindow.Worker=(t=i,function(e,i){return r.domConstructorErrorChecker(this,"Worker",arguments),new t(r.rewriteWorker(e),i)}),this.$wbwindow.Worker.prototype=i.prototype,Object.defineProperty(this.$wbwindow.Worker.prototype,"constructor",{value:this.$wbwindow.Worker}),this.$wbwindow.Worker._wb_worker_overriden=!0}if(this.$wbwindow.SharedWorker&&!this.$wbwindow.SharedWorker.__wb_sharedWorker_overriden){var o=this.$wbwindow.SharedWorker;this.$wbwindow.SharedWorker=(e=o,function(t,i){return r.domConstructorErrorChecker(this,"SharedWorker",arguments),new e(r.rewriteWorker(t),i)}),this.$wbwindow.SharedWorker.prototype=o.prototype,Object.defineProperty(this.$wbwindow.SharedWorker.prototype,"constructor",{value:this.$wbwindow.SharedWorker}),this.$wbwindow.SharedWorker.__wb_sharedWorker_overriden=!0}if(this.$wbwindow.ServiceWorkerContainer&&this.$wbwindow.ServiceWorkerContainer.prototype&&this.$wbwindow.ServiceWorkerContainer.prototype.register){var n=this.$wbwindow.ServiceWorkerContainer.prototype.register;this.$wbwindow.ServiceWorkerContainer.prototype.register=function(t,e){var i=new URL(t,r.$wbwindow.document.baseURI).href,o=r.getPageUnderModifier();return e&&e.scope?e.scope=r.rewriteUrl(e.scope,!1,o):e={scope:r.rewriteUrl("/",!1,o)},n.call(this,r.rewriteUrl(i,!1,"sw_"),e)}}if(this.$wbwindow.Worklet&&this.$wbwindow.Worklet.prototype&&this.$wbwindow.Worklet.prototype.addModule&&!this.$wbwindow.Worklet.__wb_workerlet_overriden){var s=this.$wbwindow.Worklet.prototype.addModule;this.$wbwindow.Worklet.prototype.addModule=function(t,e){var i=r.rewriteUrl(t,!1,"js_");return s.call(this,i,e)},this.$wbwindow.Worklet.__wb_workerlet_overriden=!0}},f.prototype.initLocOverride=function(t,e,r){if(Object.defineProperty)for(var i=0;i=0&&i.splice(n,1)}return i}})}catch(t){console.log(t)}},f.prototype.initHashChange=function(){if(this.$wbwindow.__WB_top_frame){var t=this;this.$wbwindow.addEventListener("message",(function(e){if(e.data&&e.data.from_top){var r=e.data.message;r.wb_type&&"outer_hashchange"===r.wb_type&&t.$wbwindow.location.hash!=r.hash&&(t.$wbwindow.location.hash=r.hash)}})),this.$wbwindow.addEventListener("hashchange",(function(){var e={wb_type:"hashchange",hash:t.$wbwindow.location.hash};t.sendTopMessage(e)}))}},f.prototype.initPostMessageOverride=function(t){if(t.postMessage&&!t.__orig_postMessage){var e=t.postMessage,r=this;t.__orig_postMessage=e;var i=function(i,o,n,s){var a,h,w=r.proxyToObj(this);if(w||((w=t).__WB_source=t),w.__WB_source&&w.__WB_source.WB_wombat_location){var p=w.__WB_source;if(a=p.WB_wombat_location.origin,w.__WB_win_id||(w.__WB_win_id={},w.__WB_counter=0),!p.__WB_id){var c=w.__WB_counter;p.__WB_id=c+p.WB_wombat_location.href,w.__WB_counter+=1}w.__WB_win_id[p.__WB_id]=p,h=p.__WB_id,w.__WB_source=void 0}else a=window.WB_wombat_location.origin;var _=o;_===w.location.origin&&(_=a);var l={from:a,to_origin:_,src_id:h,message:i,from_top:s};if("*"!==o){if("null"===w.location.origin||""===w.location.origin)return;o=w.location.origin}return e.call(w,l,o,n)};t.postMessage=i,t.Window.prototype.postMessage=i;var o=null,n=(o=t.EventTarget&&t.EventTarget.prototype?t.EventTarget.prototype:t).addEventListener;o.addEventListener=function(t,e,i){var o,s=r.proxyToObj(this);if("message"===t?o=r.message_listeners.add_or_get(e,(function(){return c(e,s,r)})):"storage"===t?r.storage_listeners.add_or_get(e,(function(){return p(e,s)})):o=e,o)return n.call(s,t,o,i)};var s=o.removeEventListener;o.removeEventListener=function(t,e,i){var o,n=r.proxyToObj(this);if("message"===t?o=r.message_listeners.remove(e):"storage"===t?r.storage_listeners.remove(e):o=e,o)return s.call(n,t,o,i)};var a=function(e,i){var o=r.getOrigSetter(t,e);r.defProp(t,e,(function(t){this["__orig_"+e]=t;var n=r.proxyToObj(this),s=t?i(t,n,r):t;return o.call(n,s)}),(function(){return this["__orig_"+e]}))};a("onmessage",c),a("onstorage",p)}},f.prototype.initMessageEventOverride=function(t){t.MessageEvent&&!t.MessageEvent.prototype.__extended&&(this.addEventOverride("target"),this.addEventOverride("srcElement"),this.addEventOverride("currentTarget"),this.addEventOverride("eventPhase"),this.addEventOverride("path"),this.overridePropToProxy(t.MessageEvent.prototype,"source"),t.MessageEvent.prototype.__extended=!0)},f.prototype.initUIEventsOverrides=function(){this.overrideAnUIEvent("UIEvent"),this.overrideAnUIEvent("MouseEvent"),this.overrideAnUIEvent("TouchEvent"),this.overrideAnUIEvent("FocusEvent"),this.overrideAnUIEvent("KeyboardEvent"),this.overrideAnUIEvent("WheelEvent"),this.overrideAnUIEvent("InputEvent"),this.overrideAnUIEvent("CompositionEvent")},f.prototype.initOpenOverride=function(){var t=this.$wbwindow.open;this.$wbwindow.Window.prototype.open&&(t=this.$wbwindow.Window.prototype.open);var e=this,r=function(r,i,o){i&&(i=this.rewriteAttrTarget(i));var n=e.rewriteUrl(r,!1),s=t.call(e.proxyToObj(this),n,i,o);return e.initNewWindowWombat(s,r),s};this.$wbwindow.open=r,this.$wbwindow.Window.prototype.open&&(this.$wbwindow.Window.prototype.open=r);for(var i=0;i}\n */\nWBWombat.prototype.rewriteArgs = function(argsObj) {\n // recreate the original arguments object just with URLs rewritten\n var newArgObj = new Array(argsObj.length);\n for (var i = 0; i < newArgObj.length; i++) {\n newArgObj[i] = this.rewriteURL(argsObj[i]);\n }\n return newArgObj;\n};\n\n/**\n * Rewrites the input to one of the Fetch APIs\n * @param {*|string|Request} input\n * @return {*|string|Request}\n */\nWBWombat.prototype.rewriteFetchApi = function(input) {\n var rwInput = input;\n switch (typeof input) {\n case 'string':\n rwInput = this.rewriteURL(input);\n break;\n case 'object':\n if (input.url) {\n var new_url = this.rewriteURL(input.url);\n if (new_url !== input.url) {\n // not much we can do here Request.url is read only\n // https://developer.mozilla.org/en-US/docs/Web/API/Request/url\n rwInput = new Request(new_url, input);\n }\n } else if (input.href) {\n // it is likely that input is either self.location or self.URL\n // we cant do anything here so just let it go\n rwInput = input.href;\n }\n break;\n }\n return rwInput;\n};\n\n/**\n * Rewrites the input to one of the Cache APIs\n * @param {*|string|Request} request\n * @return {*|string|Request}\n */\nWBWombat.prototype.rewriteCacheApi = function(request) {\n var rwRequest = request;\n if (typeof request === 'string') {\n rwRequest = this.rewriteURL(request);\n }\n return rwRequest;\n};\n\n/**\n * Applies an override to the importScripts function\n * @see https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts\n */\nWBWombat.prototype.initImportScriptsRewrite = function() {\n if (!self.importScripts) return;\n var wombat = this;\n var origImportScripts = self.importScripts;\n self.importScripts = function importScripts() {\n // rewrite the arguments object and call original function via fn.apply\n var rwArgs = wombat.rewriteArgs(arguments);\n return origImportScripts.apply(this, rwArgs);\n };\n};\n\n/**\n * Applies overrides to the XMLHttpRequest.open and XMLHttpRequest.responseURL\n * in order to ensure URLs are rewritten.\n *\n * Applies an override to window.fetch in order to rewrite URLs and URLs of\n * the supplied Request objects used as arguments to fetch.\n *\n * Applies overrides to window.Request, window.Response, window.EventSource,\n * and window.WebSocket in order to ensure URLs they operate on are rewritten.\n *\n * @see https://xhr.spec.whatwg.org/\n * @see https://fetch.spec.whatwg.org/\n * @see https://html.spec.whatwg.org/multipage/web-sockets.html#websocket\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n */\nWBWombat.prototype.initHTTPOverrides = function() {\n var wombat = this;\n if (\n self.XMLHttpRequest &&\n self.XMLHttpRequest.prototype &&\n self.XMLHttpRequest.prototype.open\n ) {\n var oXHROpen = self.XMLHttpRequest.prototype.open;\n self.XMLHttpRequest.prototype.open = function open(\n method,\n url,\n async,\n user,\n password\n ) {\n var rwURL = wombat.rewriteURL(url);\n var openAsync = true;\n if (async != null && !async) openAsync = false;\n oXHROpen.call(this, method, rwURL, openAsync, user, password);\n if (rwURL.indexOf('data:') === -1) {\n this.setRequestHeader('X-Pywb-Requested-With', 'XMLHttpRequest');\n }\n };\n }\n\n if (self.fetch != null) {\n // this fetch is Worker.fetch\n var orig_fetch = self.fetch;\n self.fetch = function fetch(input, init_opts) {\n var rwInput = wombat.rewriteFetchApi(input);\n var newInitOpts = init_opts || {};\n newInitOpts['credentials'] = 'include';\n return orig_fetch.call(this, rwInput, newInitOpts);\n };\n }\n\n if (self.Request && self.Request.prototype) {\n var orig_request = self.Request;\n self.Request = (function(Request_) {\n return function Request(input, init_opts) {\n var newInitOpts = init_opts || {};\n var newInput = wombat.rewriteFetchApi(input);\n newInitOpts['credentials'] = 'include';\n return new Request_(newInput, newInitOpts);\n };\n })(self.Request);\n self.Request.prototype = orig_request.prototype;\n }\n\n if (self.Response && self.Response.prototype) {\n var originalRedirect = self.Response.prototype.redirect;\n self.Response.prototype.redirect = function redirect(url, status) {\n var rwURL = wombat.rewriteUrl(url);\n return originalRedirect.call(this, rwURL, status);\n };\n }\n\n if (self.EventSource && self.EventSource.prototype) {\n var origEventSource = self.EventSource;\n self.EventSource = (function(EventSource_) {\n return function EventSource(url, configuration) {\n var rwURL = url;\n if (url != null) {\n rwURL = wombat.rewriteUrl(url);\n }\n return new EventSource_(rwURL, configuration);\n };\n })(self.EventSource);\n self.EventSource.prototype = origEventSource.prototype;\n Object.defineProperty(self.EventSource.prototype, 'constructor', {\n value: self.EventSource\n });\n }\n\n if (self.WebSocket && self.WebSocket.prototype) {\n var origWebSocket = self.WebSocket;\n self.WebSocket = (function(WebSocket_) {\n return function WebSocket(url, configuration) {\n var rwURL = url;\n if (url != null) {\n rwURL = wombat.rewriteWSURL(url);\n }\n return new WebSocket_(rwURL, configuration);\n };\n })(self.WebSocket);\n self.WebSocket.prototype = origWebSocket.prototype;\n Object.defineProperty(self.WebSocket.prototype, 'constructor', {\n value: self.WebSocket\n });\n }\n};\n\n/**\n * Applies an override to Clients.openWindow and WindowClient.navigate that rewrites\n * the supplied URL that represents a controlled window\n * @see https://w3c.github.io/ServiceWorker/#window-client-interface\n * @see https://w3c.github.io/ServiceWorker/#clients-interface\n */\nWBWombat.prototype.initClientApisOverride = function() {\n var wombat = this;\n if (\n self.Clients &&\n self.Clients.prototype &&\n self.Clients.prototype.openWindow\n ) {\n var oClientsOpenWindow = self.Clients.prototype.openWindow;\n self.Clients.prototype.openWindow = function openWindow(url) {\n var rwURL = wombat.rewriteClientWindowURL(url);\n return oClientsOpenWindow.call(this, rwURL);\n };\n }\n\n if (\n self.WindowClient &&\n self.WindowClient.prototype &&\n self.WindowClient.prototype.navigate\n ) {\n var oWinClientNavigate = self.WindowClient.prototype.navigate;\n self.WindowClient.prototype.navigate = function navigate(url) {\n var rwURL = wombat.rewriteClientWindowURL(url, this);\n return oWinClientNavigate.call(this, rwURL);\n };\n }\n};\n\n/**\n * Applies overrides to the CacheStorage and Cache interfaces in order\n * to rewrite the URLs they operate on\n * @see https://w3c.github.io/ServiceWorker/#cachestorage\n * @see https://w3c.github.io/ServiceWorker/#cache-interface\n */\nWBWombat.prototype.initCacheApisOverride = function() {\n var wombat = this;\n if (\n self.CacheStorage &&\n self.CacheStorage.prototype &&\n self.CacheStorage.prototype.match\n ) {\n var oCacheStorageMatch = self.CacheStorage.prototype.match;\n self.CacheStorage.prototype.match = function match(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheStorageMatch.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache && self.Cache.prototype) {\n if (self.Cache.prototype.match) {\n var oCacheMatch = self.Cache.prototype.match;\n self.Cache.prototype.match = function match(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheMatch.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache.prototype.matchAll) {\n var oCacheMatchAll = self.Cache.prototype.matchAll;\n self.Cache.prototype.matchAll = function matchAll(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheMatchAll.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache.prototype.add) {\n var oCacheAdd = self.Cache.prototype.add;\n self.Cache.prototype.add = function add(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheAdd.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache.prototype.addAll) {\n var oCacheAddAll = self.Cache.prototype.addAll;\n self.Cache.prototype.addAll = function addAll(requests) {\n var rwRequests = requests;\n if (Array.isArray(requests)) {\n rwRequests = new Array(requests.length);\n for (var i = 0; i < requests.length; i++) {\n rwRequests[i] = wombat.rewriteCacheApi(requests[i]);\n }\n }\n return oCacheAddAll.call(this, rwRequests);\n };\n }\n\n if (self.Cache.prototype.put) {\n var oCachePut = self.Cache.prototype.put;\n self.Cache.prototype.put = function put(request, response) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCachePut.call(this, rwRequest, response);\n };\n }\n\n if (self.Cache.prototype.delete) {\n var oCacheDelete = self.Cache.prototype.delete;\n self.Cache.prototype.delete = function newCacheDelete(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheDelete.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache.prototype.keys) {\n var oCacheKeys = self.Cache.prototype.keys;\n self.Cache.prototype.keys = function keys(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheKeys.call(this, rwRequest, options);\n };\n }\n }\n};\n\nself.WBWombat = WBWombat;\n"}),r.injectScripts&&(r.injectScripts=r.injectScripts.map((t=>this.staticPrefix+"proxy/"+t))),this.collections=new i(o,n.get("root"),r),this.collections.loadAll(n.get("dbColl")),this.proxyOriginMode=!!n.get("proxyOriginMode"),this.api=new e(this.collections),this.apiPrefix=this.replayPrefix+"api/",this.allowRewrittenCache=!!n.get("allowCache"),this.stats=n.get("stats")?new Iy:null,self.addEventListener("install",(()=>{self.skipWaiting()})),self.addEventListener("activate",(t=>{t.waitUntil(self.clients.claim()),console.log("Activate!")})),self.addEventListener("fetch",(t=>{t.respondWith(this.handleFetch(t))})),self.addEventListener("message",(t=>{"reload_all"===t.data.msg_type&&t.waitUntil(this.collections.loadAll())}))}handleFetch(t){const e=t.request.url;if(this.proxyOriginMode)return this.getResponseFor(t.request,t);if(!e.startsWith(this.prefix))return"chrome-extension://invalid/"===e?x(t.request,"Invalid URL"):this.defaultFetch(t.request);if(this.collections.root&&e.slice(this.prefix.length).indexOf("/")<0)return this.defaultFetch(t.request);if(e.startsWith(this.staticPrefix+"proxy/"))return this.staticPathProxy(e,t.request);if(e.startsWith(this.replayPrefix)&&!e.startsWith(this.staticPrefix))return this.getResponseFor(t.request,t);const r=new URL(e);r.search="",r.hash="";const i=r.href;for(const t of this.staticData.keys())if(t===i){const{content:e,type:r}=this.staticData.get(t);return new Response(e,{headers:{"Content-Type":r}})}return("http:"==r.protocol||"https:"==r.protocol)&&r.pathname.indexOf("/",1)<0?this.handleOffline(t.request):this.defaultFetch(t.request)}staticPathProxy(t,e){return t=t.slice((this.staticPrefix+"proxy/").length),t=new URL(t,self.location.href).href,e=new Request(t),this.defaultFetch(e)}defaultFetch(t){const e={};return"only-if-cached"===t.cache&&"same-origin"!==t.mode&&(e.cache="default"),self.fetch(t,e)}async ensureCached(t){const e=await caches.open("wabac-offline");for(let r of t){r=new URL(r,self.location.href).href;let t=await e.match(r,{ignoreSearch:!0});if(!t)try{t=await this.defaultFetch(r),await e.put(r,t)}catch(t){console.warn(`Failed to Auto Cache: ${r}`,t)}}}async handleOffline(t){let e=null;const r=await caches.open("wabac-offline");try{e=await this.defaultFetch(t)}catch(i){return e=await r.match(t,{ignoreSearch:!0}),e||(e=x(t,"Sorry, this url was not cached for offline use")),e}if(t.url.startsWith(this.prefix+"?"))return e;if(200===e.status){const i=e.clone();await r.put(t,i)}else console.warn(`Not Cacheing ${t.url} - Status ${e.status}`);return e}async getResponseFor(t,e){if(!this.proxyOriginMode&&t.url.startsWith(this.apiPrefix))return this.stats&&t.url.startsWith(this.apiPrefix+"stats.json")?await this.stats.getStats(e):await this.api.apiResponse(t.url.slice(this.apiPrefix.length),t,e);await this.collections.inited;const r=E(t),i=t.headers.get("range");try{if(this.allowRewrittenCache&&!i){const e=await self.caches.match(t);if(e&&!!e.headers.get(Zy)===r)return e}}catch(t){}let n=this.collections.root;n||(n=t.url.slice(this.replayPrefix.length).split("/",1)[0]);const s=await this.collections.getColl(n);if(!s||!this.proxyOriginMode&&!t.url.startsWith(s.prefix))return x(t);const o=this.proxyOriginMode?t.url:t.url.substring(s.prefix.length),a={isRoot:!!this.collections.root};this.proxyOriginMode&&(a.mod="id_",a.proxyOrigin=s.config.extraConfig.proxyOrigin,a.localOrigin=self.location.origin);const c=new Jy(o,t,a);if(!c.url)return x(t,`Replay URL ${o} not found`);const l=await s.handleRequest(c,e);if(l){if(this.stats&&this.stats.updateStats(l.date,l.status,t,e),this.allowRewrittenCache&&200===l.status)try{const e=await self.caches.open("wabac-"+s.name);r&&l.headers.set(Zy,"true");const i=l.clone();await e.put(t,i)}catch(t){console.warn(t)}return l}return i&&console.log("Not Found Range!: "+i),x(t)}}if(self.registration){const t=new Map,r=self.registration.scope;t.set(r,{type:"text/html",content:e}),t.set(r+"index.html",{type:"text/html",content:e});const i={injectScripts:["ruffle/ruffle.js"]};self.ipfsCustomPreload=!0,self.sw=new Yy({staticData:t,defaultConfig:i})}else new xy(self)})();var n=self;for(var s in i)n[s]=i[s];i.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); \ No newline at end of file +class em{constructor(...t){if(1===t.length){const e=t[0];this.rawData=Au.serialize(e),this.onInit(e)}else{const e=Au.parse(t[0],t[1]);this.rawData=Ec.vJ.toArrayBuffer(t[0]),this.onInit(e)}}equal(t){return t instanceof em&&(0,Ec.Xy)(t.rawData,this.rawData)}}class rm extends em{constructor(...t){let e;e=Ec.vJ.isBufferSource(t[0])?Ec.vJ.toArrayBuffer(t[0]):Au.serialize(new rf({extnID:t[0],critical:t[1],extnValue:new uu(Ec.vJ.toArrayBuffer(t[2]))})),super(e,rf)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}}var im;class nm{constructor(){this.items=new Map,this[im]="CryptoProvider","undefined"!=typeof self&&"undefined"!=typeof crypto&&this.set(nm.DEFAULT,crypto)}static isCryptoKeyPair(t){return t&&t.privateKey&&t.publicKey}static isCryptoKey(t){return t&&t.usages&&t.type&&t.algorithm&&void 0!==t.extractable}clear(){this.items.clear()}delete(t){return this.items.delete(t)}forEach(t,e){return this.items.forEach(t,e)}has(t){return this.items.has(t)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(t=nm.DEFAULT){const e=this.items.get(t.toLowerCase());if(!e)throw new Error(`Cannot get Crypto by name '${t}'`);return e}set(t,e){if("string"==typeof t){if(!e)throw new TypeError("Argument 'value' is required");this.items.set(t.toLowerCase(),e)}else this.items.set(nm.DEFAULT,t);return this}}im=Symbol.toStringTag,nm.DEFAULT="default";const sm=new nm,om="crypto.algorithm";const am="crypto.algorithmProvider";cp.registerSingleton(am,class{getAlgorithms(){return cp.resolveAll(om)}toAsnAlgorithm(t){for(const e of this.getAlgorithms()){const r=e.toAsnAlgorithm(t);if(r)return r}if(/[0-9.]+/.test(t.name)){const e=new Xd({algorithm:t.name});if("parameters"in t){const r=t;e.parameters=r.parameters}return e}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(t){for(const e of this.getAlgorithms()){const r=e.toWebAlgorithm(t);if(r)return r}return{name:t.algorithm,parameters:t.parameters}}});class cm{constructor(){this.CertificateTag="CERTIFICATE",this.CertificateRequestTag="CERTIFICATE REQUEST",this.PublicKeyTag="PUBLIC KEY",this.PrivateKeyTag="PRIVATE KEY"}static isPem(t){return"string"==typeof t&&/-{5}BEGIN [A-Z0-9 ]+-{5}([a-zA-Z0-9=+/\n\r]+)-{5}END [A-Z0-9 ]+-{5}/g.test(t)}static decode(t){const e=/-{5}BEGIN [A-Z0-9 ]+-{5}([a-zA-Z0-9=+/\n\r]+)-{5}END [A-Z0-9 ]+-{5}/g,r=[];let i=null;for(;i=e.exec(t);){const t=i[1].replace(/\r/g,"").replace(/\n/g,"");r.push(Ec.ep.FromBase64(t))}return r}static decodeFirst(t){const e=this.decode(t);if(!e.length)throw new RangeError("PEM string doesn't contain any objects");return e[0]}static encode(t,e){if(Array.isArray(t)){const r=new Array;return t.forEach((t=>{r.push(this.encodeBuffer(t,e))})),r.join("\n")}return this.encodeBuffer(t,e)}static encodeBuffer(t,e){const r=Ec.ep.ToBase64(t);let i,n=0;const s=Array();for(;n1?(i=t[0]||i,r=t[1]||r,e=t[2]||sm.get()):e=t[0]||sm.get(),e.subtle.importKey("spki",this.rawData,i,!0,r)}onInit(t){const e=cp.resolve(am),r=this.algorithm=e.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case df:{const e=Au.parse(t.subjectPublicKey,Uf),i=Ec.vJ.toUint8Array(e.modulus);r.publicExponent=Ec.vJ.toUint8Array(e.publicExponent),r.modulusLength=(i[0]?i:i.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var e;let r,i="SHA-1";return t.length>=1&&!(null===(e=t[0])||void 0===e?void 0:e.subtle)?(i=t[0]||i,r=t[1]||sm.get()):r=t[0]||sm.get(),await r.subtle.digest(i,this.rawData)}async getKeyIdentifier(t){t||(t=sm.get());const e=Au.parse(this.rawData,Yd);return await t.subtle.digest("SHA-1",e.subjectPublicKey)}}class um{constructor(){this.items={}}get(t){return this.items[t]||null}register(t,e){this.items[t]=e,this.items[e]=t}}const dm=new um;function fm(t,e){return`\\${Ec.ep.ToHex(Ec.ep.FromUtf8String(e)).toUpperCase()}`}dm.register("CN","2.5.4.3"),dm.register("L","2.5.4.7"),dm.register("ST","2.5.4.8"),dm.register("O","2.5.4.10"),dm.register("OU","2.5.4.11"),dm.register("C","2.5.4.6"),dm.register("DC","0.9.2342.19200300.100.1.25"),dm.register("E","1.2.840.113549.1.9.1"),dm.register("G","2.5.4.42"),dm.register("I","2.5.4.43"),dm.register("SN","2.5.4.4"),dm.register("T","2.5.4.12");class pm{constructor(t,e={}){this.extraNames=new um,this.asn=new Lu;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];this.extraNames.register(t,r)}"string"==typeof t?this.asn=this.fromString(t):t instanceof Lu?this.asn=t:Ec.vJ.isBufferSource(t)?this.asn=Au.parse(t,Lu):this.asn=this.fromJSON(t)}static isASCII(t){for(let e=0;e255)return!1}return!0}getName(t){return this.extraNames.get(t)||dm.get(t)}toString(){return this.asn.map((t=>t.map((t=>{const e=this.getName(t.type)||t.type,r=t.value.anyValue?`#${Ec.ep.ToHex(t.value.anyValue)}`:function(t){return t.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,fm)}(t.value.toString());return`${e}=${r}`})).join("+"))).join(", ")}toJSON(){var t;const e=[];for(const r of this.asn){const i={};for(const e of r){const r=this.getName(e.type)||e.type;null!==(t=i[r])&&void 0!==t||(i[r]=[]),i[r].push(e.value.anyValue?`#${Ec.ep.ToHex(e.value.anyValue)}`:e.value.toString())}e.push(i)}return e}fromString(t){const e=new Lu,r=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let i=null,n=",";for(;i=r.exec(`${t},`);){let[,t,r]=i;const s=r[r.length-1];","!==s&&"+"!==s||(r=r.slice(0,r.length-1),i[3]=s);const o=i[3];if(/[\d.]+/.test(t)||(t=this.getName(t)||""),!t)throw new Error(`Cannot get OID for name type '${t}'`);const a=new Bu({type:t});if("#"===r.charAt(0))a.value.anyValue=Ec.ep.FromHex(r.slice(1));else{const e=/"(.*?[^\\])?"/.exec(r);e&&(r=e[1]),r=r.replace(/\\0a/gi,"\n").replace(/\\0d/gi,"\r").replace(/\\0g/gi,"\t").replace(/\\(.)/g,"$1"),t===this.getName("E")||t===this.getName("DC")?a.value.ia5String=r:pm.isASCII(r)?a.value.printableString=r:a.value.utf8String=r}"+"===n?e[e.length-1].push(a):e.push(new Nu([a])),n=o}return e}fromJSON(t){const e=new Lu;for(const r of t){const t=new Nu;for(const e in r){let i=e;if(/[\d.]+/.test(e)||(i=this.getName(e)||""),!i)throw new Error(`Cannot get OID for name type '${e}'`);const n=r[e];for(const e of n){const r=new Bu({type:i});if("object"==typeof e)for(const t in e)switch(t){case"ia5String":r.value.ia5String=e[t];break;case"utf8String":r.value.utf8String=e[t];break;case"universalString":r.value.universalString=e[t];break;case"bmpString":r.value.bmpString=e[t];break;case"printableString":r.value.printableString=e[t]}else"#"===e[0]?r.value.anyValue=Ec.ep.FromHex(e.slice(1)):i===this.getName("E")||i===this.getName("DC")?r.value.ia5String=e:r.value.printableString=e;t.push(r)}}e.push(t)}return e}toArrayBuffer(){return Au.serialize(this.asn)}async getThumbprint(...t){var e;let r,i="SHA-1";return t.length>=1&&!(null===(e=t[0])||void 0===e?void 0:e.subtle)?(i=t[0]||i,r=t[1]||sm.get()):r=t[0]||sm.get(),await r.subtle.digest(i,this.toArrayBuffer())}}class gm{static register(t,e){this.items.set(t,e)}static create(t){const e=new rm(t),r=this.items.get(e.type);return r?new r(t):e}}gm.items=new Map;const wm="crypto.signatureFormatter";class mm extends lm{constructor(t){lm.isAsnEncoded(t)?super(t,af):super(t),this.tag="CERTIFICATE"}onInit(t){const e=t.tbsCertificate;this.tbs=Au.serialize(e),this.serialNumber=Ec.ep.ToHex(e.serialNumber),this.subjectName=new pm(e.subject),this.subject=new pm(e.subject).toString(),this.issuerName=new pm(e.issuer),this.issuer=this.issuerName.toString();const r=cp.resolve(am);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const i=e.validity.notBefore.utcTime||e.validity.notBefore.generalTime;if(!i)throw new Error("Cannot get 'notBefore' value");this.notBefore=i;const n=e.validity.notAfter.utcTime||e.validity.notAfter.generalTime;if(!n)throw new Error("Cannot get 'notAfter' value");this.notAfter=n,this.extensions=[],e.extensions&&(this.extensions=e.extensions.map((t=>gm.create(Au.serialize(t))))),this.publicKey=new hm(e.subjectPublicKeyInfo)}getExtension(t){for(const e of this.extensions)if("string"==typeof t){if(e.type===t)return e}else if(e instanceof t)return e;return null}getExtensions(t){return this.extensions.filter((e=>"string"==typeof t?e.type===t:e instanceof t))}async verify(t={},e=sm.get()){let r,i;const n=t.publicKey;try{if(n)if("publicKey"in n)r={...n.publicKey.algorithm,...this.signatureAlgorithm},i=await n.publicKey.export(r,["verify"]);else if(n instanceof hm)r={...n.algorithm,...this.signatureAlgorithm},i=await n.export(r,["verify"]);else if(Ec.vJ.isBufferSource(n)){const t=new hm(n);r={...t.algorithm,...this.signatureAlgorithm},i=await t.export(r,["verify"])}else r={...n.algorithm,...this.signatureAlgorithm},i=n;else r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],e)}catch(t){return!1}const s=cp.resolveAll(wm).reverse();let o=null;for(const t of s)if(o=t.toWebSignature(r,this.signature),o)break;if(!o)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const a=await e.subtle.verify(this.signatureAlgorithm,i,o,this.tbs);if(t.signatureOnly)return a;{const e=(t.date||new Date).getTime();return a&&this.notBefore.getTime()e<3?Ec.ep.ToHex(new Uint8Array(Ec.ep.FromHex(t)).reverse()):t)).join("");r.push(new Du({otherName:new Uu({typeId:Am.GUID,value:Au.serialize(new uu(Ec.ep.FromHex(i)))})}))}for(const t of e.ip||[])r.push(new Du({iPAddress:t}));for(const t of e.url||[])r.push(new Du({uniformResourceIdentifier:t}));for(const t of e.upn||[])r.push(new Du({otherName:new Uu({typeId:Am.UPN,value:Au.serialize(Kh.toASN(t))})}));for(const t of e.registeredId||[])r.push(new Du({registeredID:t}));for(const t of e.otherName||[])r.push(new Du({otherName:new Uu({typeId:t.type,value:Ec.ep.FromHex(t.value)})}));super(Dd,t[1],Au.serialize(r))}}onInit(t){super.onInit(t);const e=Au.parse(t.extnValue,Fd);this.dns=e.filter((t=>t.dNSName)).map((t=>t.dNSName||"")),this.email=e.filter((t=>t.rfc822Name)).map((t=>t.rfc822Name||"")),this.ip=e.filter((t=>t.iPAddress)).map((t=>t.iPAddress||"")),this.url=e.filter((t=>t.uniformResourceIdentifier)).map((t=>t.uniformResourceIdentifier||"")),this.upn=e.filter((t=>{var e;return(null===(e=t.otherName)||void 0===e?void 0:e.typeId)===Am.UPN})).map((t=>t.otherName?Au.parse(t.otherName.value,Cu).toString():"")),this.guid=e.filter((t=>{var e;return(null===(e=t.otherName)||void 0===e?void 0:e.typeId)===Am.GUID})).map((t=>t.otherName?Au.parse(t.otherName.value,uu):new uu)).map((t=>{const e=/([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})/i.exec(Ec.ep.ToHex(t));if(!e)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const r=e.slice(1).map(((t,e)=>e<3?Ec.ep.ToHex(new Uint8Array(Ec.ep.FromHex(t)).reverse()):t)).join("-");return`{${r}}`})),this.registeredId=e.filter((t=>t.registeredID)).map((t=>t.registeredID||"")),this.otherNames=e.filter((t=>t.otherName&&![Am.GUID,Am.UPN].includes(t.otherName.typeId))).map((t=>new _m(t.otherName.typeId,t.otherName.value)))}toJSON(){const t={};return this.dns.length&&(t.dns=[...this.dns]),this.email.length&&(t.email=[...this.email]),this.ip.length&&(t.ip=[...this.ip]),this.guid.length&&(t.guid=[...this.guid]),this.upn.length&&(t.upn=[...this.upn]),this.url.length&&(t.url=[...this.url]),this.registeredId.length&&(t.registeredId=[...this.registeredId]),this.otherNames.length&&(t.otherName=this.otherNames.map((t=>t.toJSON()))),t}}Am.GUID="1.3.6.1.4.1.311.25.1",Am.UPN="1.3.6.1.4.1.311.20.2.3";gm.register(Yu,class extends rm{constructor(...t){var e;if(Ec.vJ.isBufferSource(t[0])){super(t[0]);const e=Au.parse(this.value,sd);this.policies=e.map((t=>t.policyIdentifier))}else{const r=t[0],i=null!==(e=t[1])&&void 0!==e&&e,n=new sd(r.map((t=>new nd({policyIdentifier:t}))));super(Yu,i,Au.serialize(n)),this.policies=r}}});class Em extends em{constructor(...t){let e;if(Ec.vJ.isBufferSource(t[0]))e=Ec.vJ.toArrayBuffer(t[0]);else{const r=t[0],i=Array.isArray(t[1])?t[1].map((t=>Ec.vJ.toArrayBuffer(t))):[];e=Au.serialize(new Hd({type:r,values:i}))}super(e,Hd)}onInit(t){this.type=t.type,this.values=t.values}}class Sm extends Em{constructor(...t){var e;if(Ec.vJ.isBufferSource(t[0]))super(t[0]);else{const e=new nf(t[0]);super(uw,[Au.serialize(e)])}null!==(e=this.items)&&void 0!==e||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const t=Au.parse(this.values[0],nf);this.items=t.map((t=>gm.create(Au.serialize(t))))}}}class xm{static register(t,e){this.items.set(t,e)}static create(t){const e=new Em(t),r=this.items.get(e.type);return r?new r(t):e}}xm.items=new Map;let Im=class{toAsnAlgorithm(t){if("rsassa-pkcs1-v1_5"===t.name.toLowerCase()){if(!t.hash)return new Xd({algorithm:df,parameters:null});switch(t.hash.name.toLowerCase()){case"sha-1":return new Xd({algorithm:yf,parameters:null});case"sha-256":return new Xd({algorithm:bf,parameters:null});case"sha-384":return new Xd({algorithm:vf,parameters:null});case"sha-512":return new Xd({algorithm:_f,parameters:null})}}return null}toWebAlgorithm(t){switch(t.algorithm){case df:return{name:"RSASSA-PKCS1-v1_5"};case yf:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case bf:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case vf:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case _f:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};var Tm;Im=Eu([hp()],Im),cp.registerSingleton(om,Im);const km="1.3.36.3.3.2.8.1.1",Cm=`${km}.1`,Rm=`${km}.2`,Bm=`${km}.3`,Nm=`${km}.4`,Om=`${km}.5`,Lm=`${km}.6`,Pm=`${km}.7`,Um=`${km}.8`,Mm=`${km}.9`,Dm=`${km}.10`,Fm=`${km}.11`,Hm=`${km}.12`,jm=`${km}.13`,Wm=`${km}.14`,zm="brainpoolP160r1",Qm="brainpoolP160t1",qm="brainpoolP192r1",Gm="brainpoolP192t1",Vm="brainpoolP224r1",Km="brainpoolP224t1",Jm="brainpoolP256r1",Zm="brainpoolP256t1",Xm="brainpoolP320r1",Ym="brainpoolP320t1",$m="brainpoolP384r1",ty="brainpoolP384t1",ey="brainpoolP512r1",ry="brainpoolP512t1",iy="ECDSA";let ny=Tm=class{toAsnAlgorithm(t){if(t.name.toLowerCase()===iy.toLowerCase())if("hash"in t){switch(("string"==typeof t.hash?t.hash:t.hash.name).toLowerCase()){case"sha-1":return Qw;case"sha-256":return qw;case"sha-384":return Gw;case"sha-512":return Vw}}else if("namedCurve"in t){let e="";switch(t.namedCurve){case"P-256":e=Hw;break;case"K-256":e=Tm.SECP256K1;break;case"P-384":e=jw;break;case"P-521":e=Ww;break;case zm:e=Cm;break;case Qm:e=Rm;break;case qm:e=Bm;break;case Gm:e=Nm;break;case Vm:e=Om;break;case Km:e=Lm;break;case Jm:e=Pm;break;case Zm:e=Um;break;case Xm:e=Mm;break;case Ym:e=Dm;break;case $m:e=Fm;break;case ty:e=Hm;break;case ey:e=jm;break;case ry:e=Wm}if(e)return new Xd({algorithm:Pw,parameters:Au.serialize(new Kw({namedCurve:e}))})}return null}toWebAlgorithm(t){switch(t.algorithm){case Uw:return{name:iy,hash:{name:"SHA-1"}};case Mw:return{name:iy,hash:{name:"SHA-256"}};case Dw:return{name:iy,hash:{name:"SHA-384"}};case Fw:return{name:iy,hash:{name:"SHA-512"}};case Pw:if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(Au.parse(t.parameters,Kw).namedCurve){case Hw:return{name:iy,namedCurve:"P-256"};case Tm.SECP256K1:return{name:iy,namedCurve:"K-256"};case jw:return{name:iy,namedCurve:"P-384"};case Ww:return{name:iy,namedCurve:"P-521"};case Cm:return{name:iy,namedCurve:zm};case Rm:return{name:iy,namedCurve:Qm};case Bm:return{name:iy,namedCurve:qm};case Nm:return{name:iy,namedCurve:Gm};case Om:return{name:iy,namedCurve:Vm};case Lm:return{name:iy,namedCurve:Km};case Pm:return{name:iy,namedCurve:Jm};case Um:return{name:iy,namedCurve:Zm};case Mm:return{name:iy,namedCurve:Xm};case Dm:return{name:iy,namedCurve:Ym};case Fm:return{name:iy,namedCurve:$m};case Hm:return{name:iy,namedCurve:ty};case jm:return{name:iy,namedCurve:ey};case Wm:return{name:iy,namedCurve:ry}}}return null}};ny.SECP256K1="1.3.132.0.10",ny=Tm=Eu([hp()],ny),cp.registerSingleton(om,ny);class sy{addPadding(t,e){const r=Ec.vJ.toUint8Array(e),i=new Uint8Array(t);return i.set(r,t-r.length),i}removePadding(t,e=!1){let r=Ec.vJ.toUint8Array(t);for(let t=0;t127){const t=new Uint8Array(r.length+1);return t.set(r,1),t.buffer}return r.buffer}toAsnSignature(t,e){if("ECDSA"===t.name){const r=t.namedCurve,i=sy.namedCurveSize.get(r)||sy.defaultNamedCurveSize,n=new Zw,s=Ec.vJ.toUint8Array(e);return n.r=this.removePadding(s.slice(0,i),!0),n.s=this.removePadding(s.slice(i,i+i),!0),Au.serialize(n)}return null}toWebSignature(t,e){if("ECDSA"===t.name){const r=Au.parse(e,Zw),i=t.namedCurve,n=sy.namedCurveSize.get(i)||sy.defaultNamedCurveSize,s=this.addPadding(n,this.removePadding(r.r)),o=this.addPadding(n,this.removePadding(r.s));return(0,Ec.$e)(s,o)}return null}}sy.namedCurveSize=new Map,sy.defaultNamedCurveSize=32;const oy="1.3.101.110",ay="1.3.101.111",cy="1.3.101.112",ly="1.3.101.113";let hy=class{toAsnAlgorithm(t){let e=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":e=cy;break;case"ed448":e=ly}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":e=oy;break;case"x448":e=ay}}return e?new Xd({algorithm:e}):null}toWebAlgorithm(t){switch(t.algorithm){case cy:return{name:"EdDSA",namedCurve:"Ed25519"};case ly:return{name:"EdDSA",namedCurve:"Ed448"};case oy:return{name:"ECDH-ES",namedCurve:"X25519"};case ay:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};hy=Eu([hp()],hy),cp.registerSingleton(om,hy);var uy;!function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"}(uy||(uy={}));gm.register(qu,class extends rm{constructor(...t){if(Ec.vJ.isBufferSource(t[0])){super(t[0]);const e=Au.parse(this.value,Gu);this.ca=e.cA,this.pathLength=e.pathLenConstraint}else{const e=new Gu({cA:t[0],pathLenConstraint:t[1]});super(qu,t[2],Au.serialize(e)),this.ca=t[0],this.pathLength=t[1]}}}),gm.register(vd,class extends rm{constructor(...t){if(Ec.vJ.isBufferSource(t[0])){super(t[0]);const e=Au.parse(this.value,_d);this.usages=e.map((t=>t))}else{const e=new _d(t[0]);super(vd,t[1],Au.serialize(e)),this.usages=t[0]}}}),gm.register(Id,class extends rm{constructor(...t){if(Ec.vJ.isBufferSource(t[0])){super(t[0]);const e=Au.parse(this.value,Cd);this.usages=e.toNumber()}else{const e=new Cd(t[0]);super(Id,t[1],Au.serialize(e)),this.usages=t[0]}}}),gm.register(zd,vm),gm.register(Wu,ym),gm.register(Dd,Am),xm.register(hw,class extends Em{constructor(...t){var e;if(Ec.vJ.isBufferSource(t[0]))super(t[0]);else{const e=new Cw({printableString:t[0]});super(hw,[Au.serialize(e)])}null!==(e=this.password)&&void 0!==e||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const t=Au.parse(this.values[0],Cw);this.password=t.toString()}}}),xm.register(uw,Sm),cp.registerSingleton(wm,class{toAsnSignature(t,e){return Ec.vJ.toArrayBuffer(e)}toWebSignature(t,e){return Ec.vJ.toArrayBuffer(e)}}),cp.registerSingleton(wm,sy),sy.namedCurveSize.set("P-256",32),sy.namedCurveSize.set("K-256",32),sy.namedCurveSize.set("P-384",48),sy.namedCurveSize.set("P-521",66);const dy=/-{5}(BEGIN|END) .*-{5}/gm;async function fy({hash:t,signature:e,publicKey:r,domain:i,domainCert:n,created:s,software:o}={}){let a;const c=[];if(e=(0,Ac.toByteArray)(e),n&&i&&!r){const t=n.split("\n\n"),i=(0,Ac.toByteArray)(t[0].replace(dy,"").replace(/\s/gm,"")),s=p(await crypto.subtle.digest("SHA-256",i));c.push({id:"certFingerprint",expected:s,matched:null});const o=new mm(i);r=await o.publicKey.export();const l=(0,Ac.fromByteArray)(new Uint8Array(o.publicKey.rawData));c.push({id:"publicKey",expected:l,matched:null}),o.subject&&o.subject.startsWith("CN=")&&(a=o.subject.split(3)),e=function(t){try{const e=bu.parse(t,Zw),r=0===e.r[0]?e.r.slice(1):e.r,i=0===e.s[0]?e.s.slice(1):e.s;t=Gr([r,i],r.length+i.length)}catch(t){console.log(t)}return t}(e)}else{const t={name:"ECDSA",namedCurve:"P-384"};c.push({id:"publicKey",expected:r,matched:null}),r=await crypto.subtle.importKey("spki",(0,Ac.toByteArray)(r),t,!0,["verify"])}const l=new TextEncoder,h=await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},r,e,l.encode(t));return c.push({id:"signature",expected:!0,matched:h}),s&&c.push({id:"created",expected:s,matched:null}),o&&c.push({id:"software",expected:o,matched:null}),i&&c.push({id:"domain",expected:i,matched:a}),c}const py="pages/pages.jsonl",gy="pages/extraPages.jsonl",wy="datapackage.json";class my{constructor(t,e,r=null){this.loader=t,this.config=e,this.loadId=r,this.canLoadOnDemand=e.onDemand,this.zipreader=null,this.waczname=e.loadUrl}async load(t,e,r){this.zipreader=t.zipreader?t.zipreader:new _c(this.loader);const i=await this.zipreader.load(!0);let n;this.canLoadOnDemand&&t.fullConfig&&this.loader.arrayBuffer&&this.loader.arrayBuffer.byteLength<=c&&(t.fullConfig.extra||(t.fullConfig.extra={}),t.fullConfig.extra.arrayBuffer=this.loader.arrayBuffer);let s=null;return i["datapackage-digest.json"]&&(s=await this.loadDigestData(t,"datapackage-digest.json")),i[wy]?n=await this.loadMetadata(t,i,wy,s):i["webarchive.yaml"]&&(n=await this.loadMetadataYAML(t,i,"webarchive.yaml")),this.canLoadOnDemand?await t.addWACZFile(this.waczname,i):await this.loadWACZFull(t,i,e,r),n||{}}async loadWACZFull(t,e,r=null,i=0){let n=0;const s=(t,e,s)=>{s+=n,r&&i&&r(Math.round(100*s/i),null,s,i)};for(const r of Object.keys(e)){const e=this.zipreader.getCompressedSize(r);(r.endsWith(".warc.gz")||r.endsWith(".warc"))&&await this.loadWARC(t,r,s,e),n+=e}}async loadWARC(t,e,r,i){const{reader:n}=await this.zipreader.loadFile(e,{unzip:!0}),s=new Wn(n,null,e);return s.detectPages=!1,await s.load(t,r,i)}async loadTextEntry(t,e,r){const{reader:i,hasher:n}=await this.zipreader.loadFile(e,{computeHash:!!r}),s=(new TextDecoder).decode(await i.readFully());return r&&n&&await t.addVerifyData(e,r,n.getHash()),s}async loadDigestData(t,e){try{const r=JSON.parse(await this.loadTextEntry(t,e));let i;if(r.path===wy&&r.hash&&(i=r.hash),!r.signedData||r.signedData.hash!==i)return void await t.addVerifyData("signature");await t.addVerifyData("datapackageHash",i);const n=await fy(r.signedData);return await t.addVerifyDataList(n),i}catch(t){console.warn(t)}}async loadMetadata(t,e,r,i){const n=await this.loadTextEntry(t,r,i),s=JSON.parse(n);void 0!==s.config&&t.initConfig&&t.initConfig(s.config);const o=s.metadata||{};let a=null;for(const e of s.resources)e.path===py?(a=e.hash,await t.addVerifyData(e.path,e.hash)):(e.path.endsWith(".idx")||e.path.endsWith(".cdx"))&&await t.addVerifyData(e.path,e.hash);if(e[py]){(await by(t,this.zipreader,this.waczname,py,a)).hasText&&(t.textIndex=o.textIndex=py)}return e[gy]&&(t.textIndex=o.textIndex=gy),o}async loadMetadataYAML(t,e,r){const i=await this.loadTextEntry(t,r),n=Ka.load(i),s={desc:n.desc,title:n.title};n.textIndex&&(s.textIndex=n.textIndex,n.config||(n.config={}),n.config.textIndex=n.textIndex),void 0!==n.config&&t.initConfig(n.config),s.title||(s.title=this.config.sourceName);const o=n.pages||[];o&&o.length?await t.addPages(o):e["pages.csv"]&&await t.loadPagesCSV(t,"pages.csv");const a=n.pageLists||[];return a&&a.length&&await t.addCuratedPageLists(a,"pages","show"),s}}class yy{constructor(t,e){this.json=t,this.baseUrl=e}async load(t){const e={title:this.json.title,desc:this.json.description},r=this.loadFiles(this.baseUrl);return await t.syncWACZ(r),e}loadFiles(){return this.json.resources.map((t=>new URL(t.path,this.baseUrl).href))}}async function by(t,e,r,i=py,n=null){const{reader:s,hasher:o}=await e.loadFile(i,{unzip:!0,computeHash:!0});let a=null,c=[];for await(const e of s.iterLines()){const i=JSON.parse(e);i.wacz=r,a?(c.push(i),500===c.length&&(await t.addPages(c),c=[])):a=i}return c.length&&await t.addPages(c),o&&n&&await t.addVerifyData(i,n,o.getHash()),a}class vy{constructor(t,{cloneResponse:e=!1,allowBody:r=!1,hostProxyOnly:i=!1}={}){if(t=t||{},this.prefix=t.prefix||"",this.proxyPathOnly=t.proxyPathOnly||!1,this.isLive=void 0===t.isLive||t.isLive,this.archivePrefix=t.archivePrefix||"",this.cloneResponse=e,this.allowBody=r,this.hostProxy=t.hostProxy,this.hostProxy instanceof Array){const t={};for(const e of this.hostProxy)t[e.host]=e;this.hostProxy=t}this.hostProxyOnly=i}async getAllPages(){return[]}getFetchUrl(t,e){let r;if(this.hostProxy){r=new URL(t);const e=this.hostProxy[r.host];if(e)return e.prefix+(e.pathOnly?r.pathname+r.search:t)}return this.hostProxyOnly?null:this.proxyPathOnly?(r||(r=new URL(t)),this.prefix+r.pathname+r.search):this.isLive||!e.timestamp?this.prefix+t:this.prefix+this.archivePrefix+e.timestamp+"id_/"+t}async getResource(t,e){const{headers:r,credentials:i,url:n}=t.prepareProxyRequest(e,!0),s=this.getFetchUrl(n,t);if(!s)return null;let o=null;!this.allowBody||"POST"!==t.method&&"PUT"!==t.method||(o=await t.getBody());const a=await fetch(s,{method:t.method,body:o,headers:r,credentials:i,mode:"cors",redirect:"follow"});let c=null;this.cloneResponse&&(c=a.clone());const l=vi.fromResponse({url:n,response:a,date:new Date,noRW:!1,isLive:this.isLive});return c&&(l.clonedResponse=c),l}}class _y extends Ds{constructor(t,e=!1){super(t.dbname,e),this.config=t,this.waczfiles={},this.waczhashes={},this.ziploadercache={},this.resHashes={}}_initDB(t,e,r,i){super._initDB(t,e,r,i),e||(t.createObjectStore("ziplines",{keyPath:["waczname","prefix"]}),t.createObjectStore("waczfiles",{keyPath:"waczname"}),t.createObjectStore("verification",{keyPath:"id"}))}async init(){await super.init();const t=await this.db.getAll("waczfiles")||[];for(const e of t)this.waczfiles[e.waczname]=e;await this.initLoader()}initLoader(){}getReaderForWACZ(){throw new Error("Unimplemented here")}getWACZName(){throw new Error("Unimplemented here")}async close(){super.close(),caches.delete("cache:"+this.name.slice("db:".length))}async clearZipData(){const t=["waczfiles","ziplines"];for(const e of t)await this.db.clear(e)}async addVerifyData(t,e,r,i=!1){let n=null;r&&(n=e===r,i&&console.log(`verify ${t}: ${n}`)),await this.db.put("verification",{id:t,expected:e,matched:n})}async addVerifyDataList(t){const e=this.db.transaction("verification","readwrite");for(const r of t)e.store.put(r);try{await e.done}catch(t){console.warn(t)}}async getVerifyInfo(){const t=await this.db.getAll("verification");let e=0,r=0,i={};const n=["domain","created","certFingerprint","software","datapackageHash","publicKey"];for(const s of t)n.includes(s.id)?i[s.id]=s.expected:"signature"===s.id||!0===s.matched?e++:!1===s.matched&&r++;return i.numInvalid=r,i.numValid=e,i}async getVerifyExpected(t){const e=await this.db.get("verification",t);return e&&e.expected}async clearAll(){await super.clearAll(),await this.clearZipData()}async addWACZFile(t,e){const r={waczname:t,entries:e,indexType:0};await this.db.put("waczfiles",r),this.waczfiles[t]=r;const i=await this.getWACZHash(t);this.waczhashes[i]=t}async getWACZHash(t){return await g(t,"sha-256","")}async computeWACZHashes(){for(const t of Object.keys(this.waczfiles)){const e=await this.getWACZHash(t);this.waczhashes[e]=t}}async loadRecordFromSource(t){const{start:e,length:r,path:i}=t.source,n=this.getWACZName(t),s=e,o=await this.getReaderForWACZ(n),{reader:a,hasher:c}=await o.loadFile("archive/"+i,{offset:s,length:r,unzip:!0,computeHash:!0}),l=new zn(a,c);await this.updateEntriesIfNeeded(o,n);const h=await l.load();return t[qs]&&(h.respHeaders["x-wabac-preset-cookie"]=t[qs]),{remote:h,hasher:c}}async loadWACZ(t){if(!this.waczfiles[t])throw new Error("unknown waczfile: "+t);if(this.waczfiles[t].indexType)return{indexType:this.waczfiles[t].indexType,isNew:!1};const e=await this.getReaderForWACZ(t);await e.load();let r=0;for(const i of Object.keys(this.waczfiles[t].entries))i.endsWith(".cdx")||i.endsWith(".cdxj")?(console.log(`Loading CDX for ${t}`),await this.loadCDX(e,i,t),r=1):i.endsWith(".idx")&&(console.log(`Loading IDX for ${t}`),await this.loadIDX(e,i,t),r=2);return this.waczfiles[t].indexType=r,await this.db.put("waczfiles",this.waczfiles[t]),{indexType:r,isNew:!0}}async loadCDX(t,e,r,i,n){const{reader:s,hasher:o}=await t.loadFile(e,{computeHash:!0}),a=new Vs(s,null,r,{wacz:r}),c=await a.load(this,i,n);if(o){const t=await this.getVerifyExpected(e);t&&this.addVerifyData(e,t,o.getHash())}return c}async loadIDX(t,e,r,i,n){const{reader:s,hasher:o}=await t.loadFile(e,{computeHash:!0});let a=[],c="",l=!1,h=0;for await(const t of s.iterLines()){if(h+=t.length,h===t.length&&t.startsWith("!meta")){const e=t.indexOf(" {");if(e<0){console.warn("Invalid Meta Line: "+t);continue}const r=JSON.parse(t.slice(e));r.filename&&(c=r.filename),"cdxj-gzip-1.0"!==r.format&&console.log(`Unknown CDXJ format "${r.format}", archive may not parse correctly`);continue}let e;if(t.indexOf("\t")>0){let[i,n,s,o]=t.split("\t");s=Number(s),o=Number(o),e={waczname:r,prefix:i,filename:n,offset:s,length:o,loaded:!1},l=!0}else{const i=t.indexOf(" {");if(i<0){console.log("Invalid Index Line: "+t);continue}const n=t.slice(0,i);let{offset:s,length:o,filename:a,digest:h}=JSON.parse(t.slice(i));l=n.indexOf(")/")>0,a=a||c,e={waczname:r,prefix:n,filename:a,offset:s,length:o,digest:h,loaded:!1}}i&&i(h/n,h,n),a.push(e)}if(o){const t=await this.getVerifyExpected(e);t&&this.addVerifyData(e,t,o.getHash())}const u=this.db.transaction("ziplines","readwrite");for(const t of a)u.store.put(t);try{await u.done}catch(t){console.log("Error loading ziplines index: ",t)}l&&l!==this.waczfiles[r].useSurt&&(this.waczfiles[r].useSurt=l,await this.db.put("waczfiles",this.waczfiles[r]))}async loadCDXFromIDX(t,e,r=0,i=!1){const n=this.waczfiles[t].useSurt?decodeURIComponent(jr(e)):e,s=i?this.prefixUpperBound(n):n+" 9999",o=IDBKeyRange.upperBound([t,s],!0),a=this.db.transaction("ziplines","readonly"),c=[];for await(const e of a.store.iterate(o,"prev")){if(e.value.waczname!==t)break;if(c.unshift(e.value),!e.value.prefix.split(" ")[0].startsWith(n))break}await a.done;const l=[],h=await this.getReaderForWACZ(t),u={wacz:t};c.length>3&&r&&c.sort(((t,e)=>{const i=t.prefix.split(" ")[1],n=e.prefix.split(" ")[1];if(!i||!n)return 0;const s=Math.abs(f(i).getTime()-r),o=Math.abs(f(n).getTime()-r);return s===o?0:s3)break}return l.length&&await Promise.allSettled(l),await this.updateEntriesIfNeeded(h,t),l.length>0}async doCDXLoad(t,e,r,i){try{const n="indexes/"+e.filename,s={offset:e.offset,length:e.length,unzip:!0,computeHash:!!e.digest},{reader:o,hasher:a}=await r.loadFile(n,s),c=new Vs(o,null,null,i);if(await c.load(this),a){const t=a.getHash(),r=`${n}:${e.offset}-${e.length}`;await this.addVerifyData(r,e.digest,t)}e.loaded=!0,await this.db.put("ziplines",e)}catch(t){await S(t,this.config)||console.warn(t)}finally{delete this.ziploadercache[t]}}async updateEntriesIfNeeded(t,e){t.entriesUpdated&&(await this.db.put("waczfiles",this.waczfiles[e]),t.entriesUpdated=!1)}async findPageAtUrl(t,e){const r=await this.db.getAllFromIndex("pages","url",t);let i=null,n=Number.MAX_SAFE_INTEGER;for(const t of r){const r=Math.abs(t.ts-e);if(r<1e3)return t;r0)return r;for(const i of Object.keys(this.waczfiles))if(i&&"local"!==i){const{indexType:n,isNew:s}=await this.loadWACZ(i);switch(n){case 2:if(!await this.loadCDXFromIDX(i,t,0,!0))continue;break;case 1:if(!s)continue;break;default:continue}const o=await super.resourcesByUrlAndMime(t,...e);o&&o.length&&(r=r.concat(o))}return r}}class Ay extends _y{async initLoader(){const t=this.config;this.indexLoader=await Rs({url:t.loadUrl,headers:t.headers,size:t.size,extra:t.extra}),await this.checkUpdates()}getWACZName(t){return t.source.wacz}async checkUpdates(){const{response:t}=await this.indexLoader.doInitialFetch(!1);if(206!==t.status&&200!==t.status)return void console.warn("WACZ update failed from: "+this.config.loadUrl);const e=new yy(await t.json(),this.config.loadUrl).loadFiles();await this.syncWACZ(e)}async syncWACZ(t){const e=[];for(const r of t)this.waczfiles[r]||e.push(this.loadNewWACZ(r));e.length&&await Promise.allSettled(e)}async loadNewWACZ(t){const e=await this.getBlockLoader(t),r=new _c(e),i=await r.load(!0);await this.addWACZFile(t,i);const n=await this.getVerifyExpected(py);await by(this,r,t,py,n),await this.updateEntriesIfNeeded(r,t)}async getResource(t,e,r,{pageId:i}={}){await this.initing;const n="navigate"===r.request.mode;let s=i,o=null,a=null;if(s){if(Object.keys(this.waczhashes).length||await this.computeWACZHashes(),o=this.waczhashes[s],!o)return null;a=await super.getResource(t,e,r,{waczname:o})}if(a||!n)return a;for(const i of Object.keys(this.waczfiles))if(a=await super.getResource(t,e,r,{waczname:i,noFuzzyCheck:!0}),a){o=i,s=await this.getWACZHash(o);break}return o?Response.redirect(`${e}:${s}/${t.timestamp}mp_/${t.url}`):void 0}async getReaderForWACZ(t){return new _c(await this.getBlockLoader(t),this.waczfiles[t].entries)}getBlockLoader(t){return Rs({url:t})}}class Ey extends _y{constructor(t,e){super(t,t.noCache),this.zipreader=new _c(e),this.externalSource=null,this.fuzzyUrlRules=[],this.useSurt=!1,this.fullConfig=t,this.textIndex=t&&t.metadata&&t.metadata.textIndex,t.extraConfig&&this.initConfig(t.extraConfig)}_initDB(t,e,r,i){super._initDB(t,e,r,i),2===e&&this.convertV2WACZDB(t,i),3===e&&t.createObjectStore("verification",{keyPath:"id"})}async convertV2WACZDB(t,e){try{const r=await e.objectStore("ziplines").getAll(),i=await e.objectStore("zipEntries").getAll();t.deleteObjectStore("ziplines"),t.deleteObjectStore("zipEntries"),t.createObjectStore("ziplines",{keyPath:["waczname","prefix"]}),t.createObjectStore("waczfiles",{keyPath:"waczname"}),t.createObjectStore("verification",{keyPath:"id"});const n=this.getWACZName();for(const t of r)t.waczname=n,e.objectStore("ziplines").put(t);const s={waczname:n,entries:i,indexType:r.length>0?2:1};e.objectStore("waczfiles").put(s),await e.done}catch(t){console.warn(t)}}getReaderForWACZ(){return this.zipreader}updateHeaders(t){this.zipreader.loader.headers=t}initConfig(t){if(void 0!==t.decodeResponses&&(this.fullConfig.decode=t.decodeResponses),void 0!==t.useSurt&&(this.useSurt=t.useSurt),t.hostProxy&&(this.externalSource=new vy(t,{hostProxyOnly:!0})),t.fuzzy)for(const[e,r]of t.fuzzy){const t=new RegExp(e);this.fuzzyUrlRules.push({match:t,replace:r})}t.textIndex&&(this.textIndex=t.textIndex)}async getTextIndex(){const t={"Content-Type":"application/ndjson"};if(!this.textIndex)return new Response("",{headers:t});try{await this.zipreader.load()}catch(e){return await S(e,this.config),new Response("",{headers:t})}const e=this.zipreader.getCompressedSize(this.textIndex);e>0&&(t["Content-Length"]=""+e);const{reader:r}=await this.zipreader.loadFile(this.textIndex,{unzip:!0});return new Response(r.getReadableStream(),{headers:t})}async getResource(t,e,r,{pageId:i}={}){let n=null;if(this.externalSource&&(n=await this.externalSource.getResource(t,e,r),n))return n;const s=this.getWACZName();if(n=await super.getResource(t,e,r,{pageId:i,waczname:s}),n)return n;if(this.fuzzyUrlRules.length)for(const{match:i,replace:s}of this.fuzzyUrlRules){const o=decodeURIComponent(t.url.replace(i,s));if(o&&o!==t.url&&(t.url=o,n=await super.getResource(t,e,r),n))return n}return null}getWACZName(){return this.config.loadUrl}}class Sy{constructor(t){const e=t.extraConfig||{};this.sourceUrl=e.prefix,this.type=e.sourceType||"kiwix",this.notFoundPageUrl=e.notFoundPageUrl}async getAllPages(){return[]}async getResource(t,e){const{url:r,headers:i}=t.prepareProxyRequest(e);let n=i;if("kiwix"===this.type){let e=await this.resolveHeaders(r);if(!e)for(const t of Ln.getFuzzyCanonsWithArgs(r))if(t!==r&&(e=await this.resolveHeaders(t),e))break;if(!e){if(this.notFoundPageUrl&&"navigate"===t.mode){const t=await fetch(this.notFoundPageUrl);if(200===t.status){const e={"Content-Type":"text/html"},i=await t.text();return new Response(i.replace("$URL",r),{status:404,headers:e})}}return null}let{headers:i,encodedUrl:s,date:o,status:a,statusText:c,hasPayload:l}=e;if(n.has("Range")){const t=n.get("Range");n={Range:t}}let h=null,u=null;l&&(u=await fetch(this.sourceUrl+"A/"+s,{headers:n}),u.body&&(h=new Xr(u.body.getReader(),!1)),206===u.status&&(a=206,c="Partial Content",i.set("Content-Length",u.headers.get("Content-Length")),i.set("Content-Range",u.headers.get("Content-Range")),i.set("Accept-Ranges","bytes"))),h||(h=new Uint8Array([])),o||(o=new Date),i||(i=new Headers);return new vi({payload:h,status:a,statusText:c,headers:i,url:r,date:o,noRW:!1,isLive:!1})}}async resolveHeaders(t){const e=t.slice(t.indexOf("//")+2);let r=encodeURI(e);r=encodeURIComponent(e);let i=await fetch(this.sourceUrl+"H/"+r);if(200!==i.status)return null;let n=null,s=null,o=null,a=null,c=!1;try{const e=await di.parse(i.body);if("revisit"===e.warcType){const r=e.warcHeaders.headers.get("WARC-Refers-To-Target-URI");if(r&&r!==t)return await this.resolveHeaders(r)}s=new Date(e.warcDate),e.httpHeaders?(n=e.httpHeaders.headers,o=Number(e.httpHeaders.statusCode),a=e.httpHeaders.statusText,c="0"!==e.httpHeaders.headers.get("Content-Length")):"resource"===e.warcType&&(n=new Headers,n.set("Content-Type",e.warcContentType),n.set("Content-Length",e.warcContentLength),o=200,a="OK",c=e.warcContentLength>0),o||(o=200)}catch(e){console.warn(e),console.warn("Ignoring headers, error parsing headers response for: "+t)}return{encodedUrl:r,headers:n,date:s,status:o,statusText:a,hasPayload:c}}}globalThis.self||(globalThis.self=globalThis),self.interruptLoads={};class xy extends class{constructor(){this.colldb=null,this.root=null,this.checkIpfs=!0,this._init_db=this._initDB()}async _initDB(){this.colldb=await wn("collDB",1,{upgrade:t=>{t.createObjectStore("colls",{keyPath:"name"}).createIndex("type","type")}})}async loadAll(t){if(await this._init_db,t)for(const e of t.split(",")){const t=e.split(":");if(2===t.length){const e={dbname:t[1],sourceName:t[1],decode:!1},r={name:t[0],type:"archive",config:e};console.log("Adding Coll: "+JSON.stringify(r)),await this.colldb.put("colls",r)}}try{const t=(await this.listAll()).map((t=>this._initColl(t)));await Promise.all(t)}catch(t){console.warn(t.toString())}return!0}async listAll(){return await this._init_db,await this.colldb.getAll("colls")}async loadColl(t){await this._init_db;const e=await this.colldb.get("colls",t);return e?await this._initColl(e):null}async reload(t){return this.loadColl(t)}async deleteColl(t){await this._init_db;const e=await this.colldb.get("colls",t);if(!e)return!1;if(e.config.dbname)try{await mn(e.config.dbname,{blocked(t,r){console.log(`Unable to delete ${e.config.dbname}, blocked: ${r}`)}})}catch(t){return console.warn(t),!1}return await this.colldb.delete("colls",t),!0}async updateAuth(t,e){await this._init_db;const r=await this.colldb.get("colls",t);return!!r&&(r.config.headers=e,await this.colldb.put("colls",r),!0)}async updateMetadata(t,e){await this._init_db;const r=await this.colldb.get("colls",t);return!!r&&(r.config.metadata={...r.config.metadata,...e},await this.colldb.put("colls",r),r.config.metadata)}async updateSize(t,e,r,i){await this._init_db;const n=await this.colldb.get("colls",t);if(!n)return!1;const s=n.config.metadata;return s.fullSize=(s.fullSize||0)+e,s.size=(s.size||0)+r,s.mtime=(new Date).getTime(),void 0!==i&&(n.config.decode=i),await this.colldb.put("colls",n),s}async initNewColl(t,e={},r="archive"){await this._init_db;const i=y(),n="local://"+i,s={name:i,type:r,config:{dbname:"db:"+i,ctime:(new Date).getTime(),decode:!1,metadata:t,sourceUrl:n,extraConfig:e}},o=await this._initColl(s);return await this.colldb.put("colls",s),o}async _initColl(t){const e=await this._initStore(t.type,t.config),r=t.name,i=t.config;return t.config.root&&(this.root=r),this._createCollection({name:r,store:e,config:i})}async _initStore(t,e){let r=null,i=null;switch(t){case"archive":i=new Mn(e.dbname);break;case"remotesource":r=await Rs({url:e.loadUrl,headers:e.headers,size:e.size,extra:e.extra}),i=new Fs(e.dbname,r,e.noCache);break;case"remoteprefix":i=new Hs(e.dbname,e.remotePrefix,e.headers,e.noCache);break;case"wacz":case"remotezip":r=await Rs({url:e.loadUrl||e.sourceUrl,headers:e.headers,extra:e.extra}),i=new Ey(e,r);break;case"remotewarcproxy":i=new Sy(e);break;case"live":i=new vy(e.extraConfig);break;case"multiwacz":i=new Ay(e)}return i?(i.initing&&await i.initing,i):(console.log("no store found: "+t),null)}_createCollection(t){return t}}{constructor(t){super(),this.registerListener(t)}async hasCollection(t){return await this._init_db,null!=await this.colldb.getKey("colls",t)}registerListener(t){t.addEventListener("message",(t=>{t.waitUntil?t.waitUntil(this._handleMessage(t)):this._handleMessage(t)}))}async _handleMessage(t){await this._init_db;const e=t.source||self;switch(t.data.msg_type){case"addColl":{const r=t.data.name,i=(t,i,n,s,o=null,a=null)=>{e.postMessage({msg_type:"collProgress",name:r,percent:t,error:i,currentSize:n,totalSize:s,fileHandle:o,extraMsg:a})};let n;try{if(n=await this.colldb.get("colls",r),n?t.data.skipExisting||(await this.deleteColl(r),n=await this.addCollection(t.data,i)):n=await this.addCollection(t.data,i),!n){if(t.data.name)try{await mn("db:"+t.data.name,{blocked(e,r){console.log(`Load failed and unable to delete ${t.data.name}: ${r}`)}})}catch(t){console.warn(t)}return}}catch(t){if(t instanceof k)return console.warn(t),void i(0,"permission_needed",null,null,t.info&&t.info.fileHandle);if("ConstraintError"!==t.name)return console.warn(t),void i(0,"An unexpected error occured: "+t.toString());console.log("already being added, just continue..."),n=await this.colldb.get("colls",r)}e.postMessage({msg_type:"collAdded",name:r,sourceUrl:n.config.sourceUrl});break}case"cancelLoad":{const e=t.data.name,r=new Promise((t=>self.interruptLoads[e]=t));await r,await this.deleteColl(e),delete self.interruptLoads[e];break}case"removeColl":{const r=t.data.name;await this.hasCollection(r)&&(await this.deleteColl(r),this.doListAll(e));break}case"listAll":this.doListAll(e);break;case"reload":this.reload(t.data.name)}}async doListAll(t){const e=[],r=await this.listAll();for(const t of r)e.push({name:t.name,prefix:t.name,pageList:[],sourceName:t.config.sourceName});t.postMessage({msg_type:"listAll",colls:e})}async addCollection(t,e){let r=t.name,i=null,n={root:t.root||!1},s=null,o=null;const a=t.file;if(!a||!a.sourceUrl)return e(0,"Invalid Load Request"),!1;if(n.dbname="db:"+r,a.sourceUrl.startsWith("proxy:"))n.sourceUrl=a.sourceUrl,n.extraConfig=t.extraConfig,n.extraConfig.prefix||(n.extraConfig.prefix=a.sourceUrl.slice("proxy:".length)),n.topTemplateUrl=t.topTemplateUrl,n.metadata={},i=t.type||n.extraConfig.type||"remotewarcproxy",s=await this._initStore(i,n);else{let l=null;if(a.newFullImport&&(r=y(),a.loadUrl=a.loadUrl||a.sourceUrl,a.name=a.name||a.sourceUrl,a.sourceUrl="local://"+r),i="archive",a.newFullImport&&a.importCollId){const t=await this.colldb.get("colls",a.importCollId);if(!t||"archive"!==t.type)return void e(0,"Invalid Existing Collection: "+a.importCollId);n.dbname=t.config.dbname,o=t.config,o.decode=!0}let h=a.loadUrl||a.sourceUrl;h.match(/[\w]+:\/\//)||(h=new URL(h,self.location.href).href),n.decode=!0,n.onDemand=!1,n.loadUrl=h,n.sourceUrl=a.sourceUrl,n.sourceName=a.name||a.sourceUrl;try{if(n.sourceName.match(/https?:\/\//)){const t=new URL(n.sourceName);n.sourceName=t.pathname+t.hash}}catch(t){}if(n.sourceName=n.sourceName.slice(n.sourceName.lastIndexOf("/")+1),n.headers=a.headers,n.size="number"==typeof a.size?a.size:null,n.extra=a.extra,n.loadUrl.startsWith("file://")&&!a.blob&&!n.extra){if(!this._fileHandles||!this._fileHandles[n.sourceUrl])return void e(0,"missing_local_file");n.extra={fileHandle:this._fileHandles[n.sourceUrl]}}n.extraConfig=t.extraConfig,n.noCache=a.noCache;let u=await Rs({url:h,headers:a.headers,size:a.size,extra:n.extra,blob:a.blob});if(a.loadEager){const{response:t}=await u.doInitialFetch(!1,!0),e={arrayBuffer:new Uint8Array(await t.arrayBuffer())};a.newFullImport=!0,u=await Rs({url:h,headers:a.headers,size:a.size,extra:e})}let d=!1;(n.sourceName.endsWith(".wacz")||n.sourceName.endsWith(".zip"))&&(d=!0);let{abort:f,response:p}=await u.doInitialFetch(d);const g=p.body;if(n.onDemand=u.canLoadOnDemand&&!a.newFullImport,!u.isValid){const t=u.length<=1e3?await p.text():"";return e(0,`Sorry, this URL could not be loaded.\nMake sure this is a valid URL and you have access to this file.\nStatus: ${p.status} ${p.statusText}\nError Details:\n${t}`),f&&f.abort(),!1}if(!u.length)return e(0,"Sorry, this URL could not be loaded because the size of the file is not accessible.\nMake sure this is a valid URL and you have access to this file."),f&&f.abort(),!1;const w=u.length;if(n.sourceName.endsWith(".wacz")||n.sourceName.endsWith(".zip"))if(l=new my(u,n,r),n.onDemand)s=new Ey(n,u),i="wacz";else{if(!u.canLoadOnDemand||!a.newFullImport)return e(0,"Sorry, can't load this WACZ file due to lack of range request support on the server"),f&&f.abort(),!1;s=null,delete n.extra}else n.sourceName.endsWith(".warc")||n.sourceName.endsWith(".warc.gz")?n.noCache||!(w300&&e<400)return;let s=null;void 0===this.timeRanges[n]?(s={count:0,children:[]},this.timeRanges[n]=s,r.referrer.indexOf("mp_/")>0&&self.clients.matchAll({type:"window"}).then((t=>this.updateStatsParent(n,r.referrer,t)))):s=this.timeRanges[n];const o=t.getTime();(!s.min||os.max)&&(s.max=o),s.count++}updateStatsParent(t,e,r){for(let i of r)if(i.url===e){this.timeRanges[i.id]?this.timeRanges[i.id].children[t]=1:this.timeRanges[i.id]={count:0,children:{id:1}};break}}async getStats(t){const e=new URL(t.request.url);let r=0;const i=new URLSearchParams(e.search).get("url"),n=await self.clients.matchAll({type:"window"}),s={};for(let t of n)t.url===i&&(r=t.id),s[t.id]=1;const o=this.timeRanges[r]||{},a={count:o.count||0,min:o.min,max:o.max},c=this.timeRanges[r]&&Object.keys(this.timeRanges[r].children)||[];for(let t of c){const e=this.timeRanges[t];e&&((!a.min||e.mina.max)&&(a.max=e.max),a.count+=e.count)}for(let t of Object.keys(this.timeRanges))s[t]||delete this.timeRanges[t];return new Response(JSON.stringify(a),{headers:{"Content-Type":"application/json"}})}}var Ty=function(){return Ty=Object.assign||function(t){for(var e,r=1,i=arguments.length;r$)/g,""):"[a-zA-Z0-9-_.~%':|=+\\*@$]+")+")"},jy=[{name:"url-parameter",pattern:/^:([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(t){return new RegExp(Hy(t[2]))}},{name:"url-parameter-splat",pattern:/^\*([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/,regex:/([^?]*)/},{name:"url-parameter-matrix",pattern:/^;([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(t){return new RegExp(";"+t[1]+"="+Hy(t[2]))}},{name:"query-parameter",pattern:/^(?:\?|&)(?::)?([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/},{name:"delimiter",pattern:/^(\/|\?)/,regex:function(t){return new RegExp("\\"+t[0])}},{name:"sub-delimiter",pattern:/^(!|&|-|_|\.|;)/,regex:function(t){return new RegExp(t[0])}},{name:"fragment",pattern:/^([0-9a-zA-Z]+)/,regex:function(t){return new RegExp(t[0])}}],Wy=function t(e,r){if(void 0===r&&(r=[]),!jy.some((function(i){var n=e.match(i.pattern);return!!n&&(r.push({type:i.name,match:n[0],val:n.slice(1,2),otherVal:n.slice(2),regex:i.regex instanceof Function?i.regex(n):i.regex}),n[0].length0,this.hasSpatParam=this.tokens.filter((function(t){return/splat$/.test(t.type)})).length>0,this.hasMatrixParams=this.tokens.filter((function(t){return/matrix$/.test(t.type)})).length>0,this.hasQueryParams=this.tokens.filter((function(t){return/^query-parameter/.test(t.type)})).length>0,this.spatParams=this.getParams("url-parameter-splat"),this.urlParams=this.getParams(/^url-parameter/),this.queryParams=this.getParams("query-parameter"),this.params=this.urlParams.concat(this.queryParams),this.source=this.tokens.filter((function(t){return void 0!==t.regex})).map((function(t){return t.regex.source})).join("")}return t.createPath=function(e,r){return new t(e,r)},t.prototype.isQueryParam=function(t){return-1!==this.queryParams.indexOf(t)},t.prototype.isSpatParam=function(t){return-1!==this.spatParams.indexOf(t)},t.prototype.test=function(t,e){var r=this,i=Ty(Ty({caseSensitive:!1,strictTrailingSlash:!1},this.options),e),n=function(t,e){return e||"\\/"===t?t:t.replace(/\\\/$/,"")+"(?:\\/)?"}(this.source,i.strictTrailingSlash),s=this.urlTest(t,n+(this.hasQueryParams?"(\\?.*$|$)":"$"),i.caseSensitive,i.urlParamsEncoding);if(!s||!this.hasQueryParams)return s;var o=Ly(t,i.queryParams);return 0===Object.keys(o).filter((function(t){return!r.isQueryParam(t)})).length?(Object.keys(o).forEach((function(t){return s[t]=o[t]})),s):null},t.prototype.partialTest=function(t,e){var r=this,i=Ty(Ty({caseSensitive:!1,delimited:!0},this.options),e),n=function(t,e){return e?/(\/)$/.test(t)?t:t+"(\\/|\\?|\\.|;|$)":t}(this.source,i.delimited),s=this.urlTest(t,n,i.caseSensitive,i.urlParamsEncoding);if(!s)return s;if(!this.hasQueryParams)return s;var o=Ly(t,i.queryParams);return Object.keys(o).filter((function(t){return r.isQueryParam(t)})).forEach((function(t){return function(t,e,r){void 0===r&&(r="");var i=t[e];return t[e]=void 0===i?r:Array.isArray(i)?i.concat(r):[i,r],t}(s,t,o[t])})),s},t.prototype.build=function(t,e){var r=this;void 0===t&&(t={});var i=Ty(Ty({ignoreConstraints:!1,ignoreSearch:!1,queryParams:{}},this.options),e),n=Object.keys(t).filter((function(t){return!r.isQueryParam(t)})).reduce((function(e,n){if(!zy(t[n]))return e;var s=t[n],o=r.isSpatParam(n);return"boolean"==typeof s?e[n]=s:Array.isArray(s)?e[n]=s.map((function(t){return Fy(t,i.urlParamsEncoding,o)})):e[n]=Fy(s,i.urlParamsEncoding,o),e}),{});if(this.urlParams.some((function(e){return!zy(t[e])}))){var s=this.urlParams.filter((function(e){return!zy(t[e])}));throw new Error("Cannot build path: '"+this.path+"' requires missing parameters { "+s.join(", ")+" }")}if(!i.ignoreConstraints&&!this.tokens.filter((function(t){return/^url-parameter/.test(t.type)&&!/-splat$/.test(t.type)})).every((function(t){return new RegExp("^"+Hy(t.otherVal[0])+"$").test(n[t.val])})))throw new Error("Some parameters of '"+this.path+"' are of invalid format");var o=this.tokens.filter((function(t){return!1===/^query-parameter/.test(t.type)})).map((function(t){return"url-parameter-matrix"===t.type?";"+t.val+"="+n[t.val[0]]:/^url-parameter/.test(t.type)?n[t.val[0]]:t.match})).join("");if(i.ignoreSearch)return o;var a=function(t,e){var r=ky(e);return Object.keys(t).filter((function(e){return void 0!==t[e]})).map((function(e){return By(e,t[e],r)})).filter(Boolean).join("&")}(this.queryParams.filter((function(e){return-1!==Object.keys(t).indexOf(e)})).reduce((function(e,r){return e[r]=t[r],e}),{}),i.queryParams);return a?o+"?"+a:o},t.prototype.getParams=function(t){var e=t instanceof RegExp?function(e){return t.test(e.type)}:function(e){return e.type===t};return this.tokens.filter(e).map((function(t){return t.val[0]}))},t.prototype.urlTest=function(t,e,r,i){var n=this,s=new RegExp("^"+e,r?"":"i"),o=t.match(s);return o?this.urlParams.length?o.slice(1,this.urlParams.length+1).reduce((function(t,e,r){return t[n.urlParams[r]]=(Dy[i]||decodeURIComponent)(e),t}),{}):{}:null},t}();class Gy{constructor(t){this.routes={};for(const[e,r]of Object.entries(t)){let t,i;r instanceof Array?(t=r[0],i=r[1]||"GET"):(t=r,i="GET"),this.routes[i]=this.routes[i]||{},this.routes[i][e]=new qy(t)}}match(t,e="GET"){for(const[r,i]of Object.entries(this.routes[e]||[])){const e=t.split("?",2),n=e[0],s=i.test(n);if(s)return s._route=r,s._query=new URLSearchParams(2===e.length?e[1]:""),s}return{_route:null}}}class Vy{constructor(t){this.router=new Gy(this.routes),this.collections=t}get routes(){return{index:"coll-index",coll:"c/:coll",urls:"c/:coll/urls",createColl:["c/create","POST"],deleteColl:["c/:coll","DELETE"],updateAuth:["c/:coll/updateAuth","POST"],updateMetadata:["c/:coll/metadata","POST"],curated:"c/:coll/curated/:list",pages:"c/:coll/pages",textIndex:"c/:coll/textIndex",deletePage:["c/:coll/page/:page","DELETE"]}}async apiResponse(t,e,r){const i=this.router.match(t,e.method),n=await this.handleApi(e,i,r);if(n instanceof Response)return n;const s=n.error?404:200;return this.makeResponse(n,s)}async handleApi(t,e){switch(e._route){case"index":return await this.listAll(e._query.get("filter"));case"createColl":{const e=await t.json();return I(await this.collections.initNewColl(e.metadata||{},e.extraConfig||{}))}case"coll":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};const r=I(t);return"1"===e._query.get("all")?(t.store.db?(r.pages=await t.store.getAllPages(),r.lists=await t.store.db.getAll("pageLists"),r.curatedPages=await t.store.db.getAll("curatedPages")):(r.pages=[],r.lists=[],r.curatedPages=[]),r.verify=await t.store.getVerifyInfo()):(r.numLists=await t.store.db.count("pageLists"),r.numPages=await t.store.db.count("pages")),t.config.metadata.ipfsPins&&(r.ipfsPins=t.config.metadata.ipfsPins),r}case"deleteColl":{const t="1"===e._query.get("reload");return await this.collections.deleteColl(e.coll,t)?await this.listAll():{error:"collection_not_found"}}case"updateAuth":{const r=await t.json();return{success:await this.collections.updateAuth(e.coll,r.headers)}}case"updateMetadata":{const r=await t.json();return{metadata:await this.collections.updateMetadata(e.coll,r)}}case"urls":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};const r=e._query.get("url"),i=Number(e._query.get("count")||100),n=e._query.get("mime"),s="1"===e._query.get("prefix"),o=e._query.get("fromUrl"),a=e._query.get("fromTs"),c=e._query.get("fromMime"),l=Number(e._query.get("fromStatus")||0);if(!t.store.resourcesByMime)return{urls:[]};let h;return h=r?await t.store.resourcesByUrlAndMime(r,n,i,s,o,a):await t.store.resourcesByMime(n,i,c,o,l),h=h||[],{urls:h}}case"pages":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};return{pages:await t.store.getAllPages()}}case"textIndex":{const t=await this.collections.getColl(e.coll);return t?t.store.getTextIndex?await t.store.getTextIndex():{}:{error:"collection_not_found"}}case"curated":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};const r=Number(e.list);return{curated:await t.store.db.getAllFromIndex("curatedPages","listPages",IDBKeyRange.bound([r],[r+1]))}}case"deletePage":{const t=await this.collections.getColl(e.coll);if(!t)return{error:"collection_not_found"};const{pageSize:r,deleteSize:i}=t.store.deletePage(e.page);return this.collections.updateSize(e.coll,r,i),{pageSize:r,deleteSize:i}}default:return{error:"not_found"}}}async listAll(t){const e=await this.collections.listAll(),r=[];return e.forEach((e=>{"live"!==e.type&&"remoteproxy"!==e.type&&(t&&0!==e.type.indexOf(t)||r.push(I(e)))})),{colls:r}}makeResponse(t,e=200){return new Response(JSON.stringify(t),{status:e,headers:{"Content-Type":"application/json"}})}}const Ky=/^(?::([\w-]+)\/)?(\d*)([a-z]+_|[$][a-z0-9:.-]+)?(?:\/|\||%7C|%7c)(.+)/;class Jy{constructor(t,e,{isRoot:r=!1,mod:i="",ts:n="",proxyOrigin:s=null,localOrigin:o=null}={}){const a=Ky.exec(t);if(this.url="",this.timestamp=n,this.mod=i,this.pageId="",this.hash="",!a&&(t.startsWith("https:")||t.startsWith("http:")||t.startsWith("blob:")))this.url=t;else if(!a&&r)this.url="https://"+t;else{if(!a)return void(this.url=null);this.pageId=a[1]||"",this.timestamp=a[2],this.mod=a[3],this.url=a[4]}if(s&&o){const t=new URL(this.url);t.origin===o&&(this.url=s+t.pathname+(t.search?t.search:""))}const c=this.url.indexOf("#");c>0&&(this.hash=this.url.slice(c),this.url=this.url.substring(0,c)),this.request=e,this.method=e.method,this.mode=e.mode,this._postToGetConverted=!1}get headers(){return this.request.headers}get destination(){return this.request.destination}get referrer(){return this.request.referrer}async convertPostToGet(){if(this._postToGetConverted)return this.url;const t=this.request;if("POST"!==t.method&&"PUT"!==t.method)return this.url;const e={method:t.method,postData:await t.text(),headers:t.headers,url:this.url};return Wr(e)&&(this.url=e.url,this.method="GET",this.mode="navigate"===this.request.mode?"same-origin":this.request.mode,this._postToGetConverted=!0),this.url}prepareProxyRequest(t,e=!0){let r,i,n;if(e){r=new Headers(this.request.headers),i=this.request.referrer;const e=i.indexOf("/http",t.length-1);e>0&&(i=i.slice(e+1),r.set("X-Proxy-Referer",i)),n=this.request.credentials,this.cookie&&r.set("X-Proxy-Cookie",this.cookie)}else r=new Headers,n="omit";let s=this.url;if(s.startsWith("//"))try{s=new URL(i).protocol+s}catch(t){s="https:"+s}return{referrer:i,headers:r,credentials:n,url:s}}async getBody(){const t=this.request.clone();return new Uint8Array(await t.arrayBuffer())}}const Zy="x-wabac-is-ajax-req";class Xy extends xy{constructor(t,e=null,r={}){super(self),this.prefixes=t,this.colls=null,this.inited=null,this.root=e,this.defaultConfig=r,this._fileHandles={}}_createCollection(t){return new tn(t,this.prefixes,this.defaultConfig)}async checkInjectedScripts(t){const e=[];for(const r of t){let t=!1;try{t=200===(await fetch(r)).status}catch(t){}t?e.push(this.prefixes.static+"proxy/"+r):console.warn(`Skipping inject of ${r}, script not found`)}return e}async loadAll(t){return this.defaultConfig.injectScripts&&(this.defaultConfig.injectScripts=await this.checkInjectedScripts(this.defaultConfig.injectScripts)),this.colls={},this.inited=super.loadAll(t),this.inited}async getColl(t){return this.colls[t]||(this.colls[t]=await this.loadColl(t)),this.colls[t]}async reload(t){delete this.colls[t],await this.getColl(t)}async addCollection(t,e){const r=await super.addCollection(t,e);return r&&r.name&&(this.colls[r.name]=this._createCollection(r)),r}async deleteColl(t,e=!1){return this.colls[t]&&(this.colls[t].store&&this.colls[t].store.delete&&await this.colls[t].store.delete(),e&&this.colls[t].config&&this.colls[t].config.extra&&this.colls[t].config.extra.fileHandle&&(this._fileHandles[this.colls[t].config.sourceUrl]=this.colls[t].config.extra.fileHandle)),!!await super.deleteColl(t)&&(delete this.colls[t],!0)}async initNewColl(t,e={},r="archive"){const i=await super.initNewColl(t,e,r);return i&&(this.colls[i.name]=i),i}async updateAuth(t,e){this.colls[t]&&this.colls[t].store.updateHeaders&&this.colls[t].store.updateHeaders(e),await super.updateAuth(t,e)}async updateMetadata(t,e){const r=await super.updateMetadata(t,e);return this.colls[t]&&r&&(this.colls[t].config.metadata=r,this.colls[t].metadata=r),r}async updateSize(t,e,r,i){const n=await super.updateSize(t,e,r,i);return this.colls[t]&&n&&(this.colls[t].config.metadata=n,this.colls[t].metadata=n),void 0!==i&&this.colls[t]&&(this.colls[t].config.decode=i),n}}class Yy{constructor({staticData:t=null,ApiClass:e=Vy,defaultConfig:r={},CollectionsClass:i=Xy}={}){this.prefix=self.registration?self.registration.scope:"",this.replayPrefix=this.prefix;const n=new URLSearchParams(self.location.search);let s="w";n.has("replayPrefix")&&(s=n.get("replayPrefix")),s&&(this.replayPrefix+=s+"/"),this.staticPrefix=this.prefix+"static/",this.distPrefix=this.prefix+"dist/";const o={static:this.staticPrefix,root:this.prefix,main:this.replayPrefix};this.staticData=t||new Map,this.staticData.set(this.staticPrefix+"wombat.js",{type:"application/javascript",content:'/*! wombat.js is part of Webrecorder project. Copyright (C) 2020-2021, Webrecorder Software. Licensed under the Affero General Public License v3. */(()=>{"use strict";function t(){this._map=[]}function e(t,e){void 0!==self.Symbol&&void 0!==self.Symbol.toStringTag&&Object.defineProperty(t.prototype,self.Symbol.toStringTag,{value:e,enumerable:!1})}function r(t){for(var e,r,i=t.__proto__||t.constructor.prototype||t.prototype,o=Object.getOwnPropertyNames(i),n=o.length,s=0;s=0?this._map.splice(e,1)[0][1]:null},t.prototype.map=function(t){for(var e=0;e0?"&":"?";return`${t}${i}__wb_method=${r}&${e}`}(t.url,n,t.method),t.method="GET",t.requestBody=n,!0)}function u(t,e=!0){if("string"==typeof t)try{t=JSON.parse(t)}catch(e){t={}}const r=new URLSearchParams,i={};try{JSON.stringify(t,((t,e)=>{var o;return["object","function"].includes(typeof e)||r.set((o=t,r.has(o)?(i[o]||(i[o]=1),o+"."+ ++i[o]+"_"):o),e),e}))}catch(t){if(!e)throw t}return r}function d(t,e=!0){return u(t,e).toString()}function f(e,i){if(!(this instanceof f))return new f(e,i);this.debug_rw=!1,this.$wbwindow=e,this.WBWindow=Window,this.origHost=e.location.host,this.origHostname=e.location.hostname,this.origProtocol=e.location.protocol,this.HTTP_PREFIX="http://",this.HTTPS_PREFIX="https://",this.REL_PREFIX="//",this.VALID_PREFIXES=[this.HTTP_PREFIX,this.HTTPS_PREFIX,this.REL_PREFIX],this.IGNORE_PREFIXES=["#","about:","data:","blob:","mailto:","javascript:","{","*"],"ignore_prefixes"in i&&(this.IGNORE_PREFIXES=this.IGNORE_PREFIXES.concat(i.ignore_prefixes)),this.WB_CHECK_THIS_FUNC="_____WB$wombat$check$this$function_____",this.WB_ASSIGN_FUNC="_____WB$wombat$assign$function_____",this.wb_setAttribute=e.Element.prototype.setAttribute,this.wb_getAttribute=e.Element.prototype.getAttribute,this.wb_funToString=Function.prototype.toString,this.WBAutoFetchWorker=null,this.wbUseAFWorker=i.enable_auto_fetch&&null!=e.Worker&&i.is_live,this.wb_rel_prefix="",this.wb_wombat_updating=!1,this.message_listeners=new t,this.storage_listeners=new t,this.linkAsTypes={script:"js_",worker:"js_",style:"cs_",image:"im_",document:"if_",fetch:"mp_",font:"oe_",audio:"oe_",video:"oe_",embed:"oe_",object:"oe_",track:"oe_","":"mp_",null:"mp_",undefined:"mp_"},this.linkTagMods={linkRelToAs:{import:this.linkAsTypes,preload:this.linkAsTypes},stylesheet:"cs_",null:"mp_",undefined:"mp_","":"mp_"},this.tagToMod={A:{href:"mp_"},AREA:{href:"mp_"},AUDIO:{src:"oe_",poster:"im_"},BASE:{href:"mp_"},EMBED:{src:"oe_"},FORM:{action:"mp_"},FRAME:{src:"fr_"},IFRAME:{src:"if_"},IMAGE:{href:"im_","xlink:href":"im_"},IMG:{src:"im_",srcset:"im_"},INPUT:{src:"oe_"},INS:{cite:"mp_"},META:{content:"mp_"},OBJECT:{data:"oe_",codebase:"oe_"},Q:{cite:"mp_"},SCRIPT:{src:"js_","xlink:href":"js_"},SOURCE:{src:"oe_",srcset:"oe_"},TRACK:{src:"oe_"},VIDEO:{src:"oe_",poster:"im_"},image:{href:"im_","xlink:href":"im_"}},this.URL_PROPS=["href","hash","pathname","host","hostname","protocol","origin","search","port"],this.wb_info=i,this.wb_opts=i.wombat_opts,this.wb_replay_prefix=i.prefix,this.wb_is_proxy=this.wb_info.proxy_magic||!this.wb_replay_prefix,this.wb_info.top_host=this.wb_info.top_host||"*",this.wb_curr_host=e.location.protocol+"//"+e.location.host,this.wb_info.wombat_opts=this.wb_info.wombat_opts||{},this.wb_orig_scheme=this.wb_info.wombat_scheme+"://",this.wb_orig_origin=this.wb_orig_scheme+this.wb_info.wombat_host,this.wb_abs_prefix=this.wb_replay_prefix,this.wb_capture_date_part="",!this.wb_info.is_live&&this.wb_info.wombat_ts&&(this.wb_capture_date_part="/"+this.wb_info.wombat_ts+"/"),this.BAD_PREFIXES=["http:"+this.wb_replay_prefix,"https:"+this.wb_replay_prefix,"http:/"+this.wb_replay_prefix,"https:/"+this.wb_replay_prefix],this.hostnamePortRe=/^[\\w-]+(\\.[\\w-_]+)+(:\\d+)(\\/|$)/,this.ipPortRe=/^\\d+\\.\\d+\\.\\d+\\.\\d+(:\\d+)?(\\/|$)/,this.workerBlobRe=/__WB_pmw\\(.*?\\)\\.(?=postMessage\\()/g,this.rmCheckThisInjectRe=/_____WB\\$wombat\\$check\\$this\\$function_____\\(.*?\\)/g,this.STYLE_REGEX=/(url\\s*\\(\\s*[\\\\"\']*)([^)\'"]+)([\\\\"\']*\\s*\\))/gi,this.IMPORT_REGEX=/(@import\\s*[\\\\"\']*)([^)\'";]+)([\\\\"\']*\\s*;?)/gi,this.IMPORT_JS_REGEX=/^(import\\s*\\([\'"]+)([^\'"]+)(["\'])/i,this.no_wombatRe=/WB_wombat_/g,this.srcsetRe=/\\s*(\\S*\\s+[\\d.]+[wx]),|(?:\\s*,(?:\\s+|(?=https?:)))/,this.cookie_path_regex=/\\bPath=\'?"?([^;\'"\\s]+)/i,this.cookie_domain_regex=/\\bDomain=([^;\'"\\s]+)/i,this.cookie_expires_regex=/\\bExpires=([^;\'"]+)/gi,this.SetCookieRe=/,(?![|])/,this.IP_RX=/^(\\d)+\\.(\\d)+\\.(\\d)+\\.(\\d)+$/,this.FullHTMLRegex=/^\\s*<(?:html|head|body|!doctype html)/i,this.IsTagRegex=/^\\s*0&&e.preserveMedia(r)}))},w.prototype.terminate=function(){this.worker.terminate()},w.prototype.justFetch=function(t){this.worker.postMessage({type:"fetch-all",values:t})},w.prototype.fetchAsPage=function(t,e,r){if(t){var i={"X-Wombat-History-Page":e};if(r){var o=encodeURIComponent(r.trim());r&&(i["X-Wombat-History-Title"]=o)}var n={url:t,options:{headers:i,cache:"no-store"}};this.justFetch([n])}},w.prototype.postMessage=function(t,e){if(e){var r=this;Promise.resolve().then((function(){r.worker.postMessage(t)}))}else this.worker.postMessage(t)},w.prototype.preserveSrcset=function(t,e){this.postMessage({type:"values",srcset:{value:t,mod:e,presplit:!0}},!0)},w.prototype.preserveDataSrcset=function(t){this.postMessage({type:"values",srcset:{value:t.dataset.srcset,mod:this.rwMod(t),presplit:!1}},!0)},w.prototype.preserveMedia=function(t){this.postMessage({type:"values",media:t},!0)},w.prototype.getSrcset=function(t){return this.wombat.wb_getAttribute?this.wombat.wb_getAttribute.call(t,"srcset"):t.getAttribute("srcset")},w.prototype.rwMod=function(t){switch(t.tagName){case"SOURCE":return t.parentElement&&"PICTURE"===t.parentElement.tagName?"im_":"oe_";case"IMG":return"im_"}return"oe_"},w.prototype.extractFromLocalDoc=function(){var t=this;Promise.resolve().then((function(){for(var e={type:"values",context:{docBaseURI:document.baseURI}},r=[],i=0,o=document.styleSheets;i=0||t.indexOf("ecmascript")>=0)&&(t.indexOf("json")>=0||t.indexOf("text/")>=0))},f.prototype.skipWrapScriptTextBasedOnText=function(t){if(!t||t.indexOf(this.WB_ASSIGN_FUNC)>=0||0===t.indexOf("<"))return!0;for(var e=["window","self","document","location","top","parent","frames","opener"],r=0;r=0)return!1;return!0},f.prototype.nodeHasChildren=function(t){if(!t)return!1;if("function"==typeof t.hasChildNodes)return t.hasChildNodes();var e=t.children||t.childNodes;return!!e&&e.length>0},f.prototype.rwModForElement=function(t,e){if(t){var r="mp_";if("LINK"===t.tagName&&"href"===e){if(t.rel){var i=t.rel.trim().toLowerCase(),o=this.wb_getAttribute.call(t,"as");if(o&&null!=this.linkTagMods.linkRelToAs[i])r=this.linkTagMods.linkRelToAs[i][o.toLowerCase()];else null!=this.linkTagMods[i]&&(r=this.linkTagMods[i])}}else{var n=this.tagToMod[t.tagName];null!=n&&(r=n[e])}return r}},f.prototype.removeWBOSRC=function(t){"SCRIPT"!==t.tagName||t.__$removedWBOSRC$__||(t.hasAttribute("__wb_orig_src")&&t.removeAttribute("__wb_orig_src"),t.__$removedWBOSRC$__=!0)},f.prototype.retrieveWBOSRC=function(t){var e;if("SCRIPT"===t.tagName&&!t.__$removedWBOSRC$__)return null==(e=this.wb_getAttribute?this.wb_getAttribute.call(t,"__wb_orig_src"):t.getAttribute("__wb_orig_src"))&&(t.__$removedWBOSRC$__=!0),e},f.prototype.wrapScriptTextJsProxy=function(t){return\'var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };\\nif (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }\\n{\\nlet window = _____WB$wombat$assign$function_____("window");\\nlet globalThis = _____WB$wombat$assign$function_____("globalThis");\\nlet self = _____WB$wombat$assign$function_____("self");\\nlet document = _____WB$wombat$assign$function_____("document");\\nlet location = _____WB$wombat$assign$function_____("location");\\nlet top = _____WB$wombat$assign$function_____("top");\\nlet parent = _____WB$wombat$assign$function_____("parent");\\nlet frames = _____WB$wombat$assign$function_____("frames");\\nlet opener = _____WB$wombat$assign$function_____("opener");\\n{\\n\'+t.replace(this.DotPostMessageRe,".__WB_pmw(self.window)$1")+"\\n\\n}}"},f.prototype.watchElem=function(t,e){if(!this.$wbwindow.MutationObserver)return!1;new this.$wbwindow.MutationObserver((function(t,r){for(var i=0;i"},f.prototype.getFinalUrl=function(t,e,r){var i=t?this.wb_rel_prefix:this.wb_abs_prefix;return null==e&&(e=this.wb_info.mod),this.wb_info.is_live||(i+=this.wb_info.wombat_ts),"/"!==(i+=e)[i.length-1]&&(i+="/"),i+r},f.prototype.resolveRelUrl=function(t,e){var r=e||this.$wbwindow.document,i=this.makeParser(r.baseURI,r),o=i.href.lastIndexOf("#"),n=o>=0?i.href.substring(0,o):i.href,s=n.lastIndexOf("/");return s>=0&&s!==n.length-1?i.href=n.substring(0,s+1)+t:i.href=n+t,i.href},f.prototype.extractOriginalURL=function(t){if(!t)return"";if(this.wb_is_proxy)return t;var e,r=t.toString(),i=r;if(this.startsWithOneOf(i,this.IGNORE_PREFIXES))return i;if(i.startsWith(this.wb_info.static_prefix))return i;e=this.startsWith(i,this.wb_abs_prefix)?this.wb_abs_prefix.length:this.wb_rel_prefix&&this.startsWith(i,this.wb_rel_prefix)?this.wb_rel_prefix.length:this.wb_rel_prefix?1:0;var o=i.indexOf("/http",e);return o<0&&(o=i.indexOf("///",e)),o<0&&(o=i.indexOf("/blob:",e)),o<0&&(o=i.indexOf("/about:blank",e)),o>=0?i=i.substr(o+1):((o=i.indexOf(this.wb_replay_prefix))>=0&&(i=i.substr(o+this.wb_replay_prefix.length)),i.length>4&&"_"===i.charAt(2)&&"/"===i.charAt(3)&&(i=i.substr(4)),i===r||this.startsWithOneOf(i,this.VALID_PREFIXES)||this.startsWith(i,"blob:")||(i=this.wb_orig_scheme+i)),"/"===r.charAt(0)&&"/"!==r.charAt(1)&&this.startsWith(i,this.wb_orig_origin)&&(i=i.substr(this.wb_orig_origin.length)),this.startsWith(i,this.REL_PREFIX)?this.wb_info.wombat_scheme+":"+i:i},f.prototype.makeParser=function(t,e){var r=this.extractOriginalURL(t),i=e;return e||(i="about:blank"===this.$wbwindow.location.href&&this.$wbwindow.opener?this.$wbwindow.opener.document:this.$wbwindow.document),this._makeURLParser(r,i)},f.prototype._makeURLParser=function(t,e){try{return new this.$wbwindow.URL(t,e.baseURI)}catch(t){}var r=e.createElement("a");return r._no_rewrite=!0,r.href=t,r},f.prototype.defProp=function(t,e,r,i,o){var n=Object.getOwnPropertyDescriptor(t,e);if(n&&!n.configurable)return!1;if(!i)return!1;var s={configurable:!0,enumerable:o||!1,get:i};r&&(s.set=r);try{return Object.defineProperty(t,e,s),!0}catch(t){return console.warn("Failed to redefine property %s",e,t.message),!1}},f.prototype.defGetterProp=function(t,e,r,i){var o=Object.getOwnPropertyDescriptor(t,e);if(o&&!o.configurable)return!1;if(!r)return!1;try{return Object.defineProperty(t,e,{configurable:!0,enumerable:i||!1,get:r}),!0}catch(t){return console.warn("Failed to redefine property %s",e,t.message),!1}},f.prototype.getOrigGetter=function(t,e){var r;if(t.__lookupGetter__&&(r=t.__lookupGetter__(e)),!r&&Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);i&&(r=i.get)}return r},f.prototype.getOrigSetter=function(t,e){var r;if(t.__lookupSetter__&&(r=t.__lookupSetter__(e)),!r&&Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);i&&(r=i.set)}return r},f.prototype.getAllOwnProps=function(t){for(var e=[],r=Object.getOwnPropertyNames(t),i=0;i "+n),r.href=n}}},f.prototype.checkLocationChange=function(t,e){var r=typeof t,i=e?this.$wbwindow.__WB_replay_top.location:this.$wbwindow.location;"string"===r?this.updateLocation(t,i.href,i):"object"===r&&this.updateLocation(t.href,t._orig_href,i)},f.prototype.checkAllLocations=function(){if(this.wb_wombat_updating)return!1;this.wb_wombat_updating=!0,this.checkLocationChange(this.$wbwindow.WB_wombat_location,!1),this.$wbwindow.WB_wombat_location!=this.$wbwindow.__WB_replay_top.WB_wombat_location&&this.checkLocationChange(this.$wbwindow.__WB_replay_top.WB_wombat_location,!0),this.wb_wombat_updating=!1},f.prototype.proxyToObj=function(t){if(t)try{var e=t.__WBProxyRealObj__;if(e)return e}catch(t){}return t},f.prototype.objToProxy=function(t){if(t)try{var e=t._WB_wombat_obj_proxy;if(e)return e}catch(t){}return t},f.prototype.defaultProxyGet=function(t,e,r,i){switch(e){case"__WBProxyRealObj__":return t;case"location":case"WB_wombat_location":return t.WB_wombat_location;case"_WB_wombat_obj_proxy":return t._WB_wombat_obj_proxy;case"__WB_pmw":case this.WB_ASSIGN_FUNC:case this.WB_CHECK_THIS_FUNC:return t[e];case"origin":return t.WB_wombat_location.origin;case"constructor":return t.constructor}var o=t[e],n=typeof o;if("function"===n&&-1!==r.indexOf(e)){switch(e){case"requestAnimationFrame":case"cancelAnimationFrame":if(!this.isNativeFunction(o))return o;break;case"eval":if(this.isNativeFunction(o))return this.wrappedEval(o)}var s=i[e];return s&&s.original===o||(s={original:o,boundFn:o.bind(t)},i[e]=s),s.boundFn}return"object"===n&&o&&o._WB_wombat_obj_proxy?(o instanceof this.WBWindow&&this.initNewWindowWombat(o),o._WB_wombat_obj_proxy):o},f.prototype.setLoc=function(t,e){var r=this.makeParser(e,t.ownerDocument);t._orig_href=e,t._parser=r;var i=r.href;t._hash=r.hash,t._href=i,t._host=r.host,t._hostname=r.hostname,r.origin?t._origin=r.host?r.origin:"null":t._origin=r.protocol+"//"+r.hostname+(r.port?":"+r.port:""),t._pathname=r.pathname,t._port=r.port,t._protocol=r.protocol,t._search=r.search,Object.defineProperty||(t.href=i,t.hash=r.hash,t.host=t._host,t.hostname=t._hostname,t.origin=t._origin,t.pathname=t._pathname,t.port=t._port,t.protocol=t._protocol,t.search=t._search)},f.prototype.makeGetLocProp=function(t,e){var r=this;return function(){if(this._no_rewrite)return e.call(this,t);var i=e.call(this,"href");return"href"===t?r.extractOriginalURL(i):"ancestorOrigins"===t?[]:(this._orig_href!==i&&r.setLoc(this,i),this["_"+t])}},f.prototype.makeSetLocProp=function(t,e,r){var i=this;return function(o){if(this._no_rewrite)return e.call(this,t,o);if(this["_"+t]!==o){if(this["_"+t]=o,!this._parser){var n=r.call(this);this._parser=i.makeParser(n,this.ownerDocument)}var s=!1;"href"===t&&"string"==typeof o&&o&&("."===o[0]||"#"===o[0]?o=i.resolveRelUrl(o,this.ownerDocument):"/"===o[0]&&(o.length>1&&"/"===o[1]?o=this._parser.protocol+o:(s=!0,o=WB_wombat_location.origin+o)));try{this._parser[t]=o}catch(e){console.log("Error setting "+t+" = "+o)}"hash"===t?(o=this._parser[t],e.call(this,"hash",o)):(s=s||o===this._parser.pathname,o=i.rewriteUrl(this._parser.href,s),e.call(this,"href",o))}}},f.prototype.styleReplacer=function(t,e,r,i,o,n){return e+this.rewriteUrl(r)+i},f.prototype.domConstructorErrorChecker=function(t,e,r,i){var o,n="number"==typeof i?i:1;if(t instanceof this.WBWindow?o="Failed to construct \'"+e+"\': Please use the \'new\' operator, this DOM object constructor cannot be called as a function.":r&&r.length=0)return o;if(0===o.indexOf(this.wb_rel_prefix)&&o.indexOf("http")>1){var a=o.indexOf(":/");return a>0&&"/"!==o[a+2]?o.substring(0,a+2)+"/"+o.substring(a+2):o}return this.getFinalUrl(!0,r,this.wb_orig_origin+o)}"."===o.charAt(0)&&(o=this.resolveRelUrl(o,i));var h=this.startsWithOneOf(o.toLowerCase(),this.VALID_PREFIXES);if(h){var w=this.replayTopHost,p=this.replayTopProtocol,c=h+w+"/";if(this.startsWith(o,c)){if(this.startsWith(o,this.wb_replay_prefix))return o;var _=p+"//",l=o.substring(c.length),u=!1;return l.indexOf(this.wb_rel_prefix)<0&&o.indexOf("/static/")<0&&(l=this.getFinalUrl(!0,r,WB_wombat_location.origin+"/"+l),u=!0),h!==_&&h!==this.REL_PREFIX&&(u=!0),u&&(o=e?"":_+w,l&&"/"!==l[0]&&(o+="/"),o+=l),o}return this.getFinalUrl(e,r,o)}return(h=this.startsWithOneOf(o,this.BAD_PREFIXES))?this.getFinalUrl(e,r,this.extractOriginalURL(o)):o},f.prototype.rewriteUrl=function(t,e,r,i){var o=this.rewriteUrl_(t,e,r,i);return this.debug_rw&&(t!==o?console.log("REWRITE: "+t+" -> "+o):console.log("NOT REWRITTEN "+t)),o},f.prototype.performAttributeRewrite=function(t,e,r,i){switch(e){case"innerHTML":case"outerHTML":return this.rewriteHtml(r);case"filter":return this.rewriteInlineStyle(r);case"style":return this.rewriteStyle(r);case"srcset":return this.rewriteSrcset(r,t)}if(i&&!this.startsWithOneOf(r,this.VALID_PREFIXES))return r;var o=this.rwModForElement(t,e);return this.wbUseAFWorker&&this.WBAutoFetchWorker&&this.isSavedDataSrcSrcset(t)&&this.WBAutoFetchWorker.preserveDataSrcset(t),this.rewriteUrl(r,!1,o,t.ownerDocument)},f.prototype.rewriteAttr=function(t,e,r){var i=!1;if(!t||!t.getAttribute||t._no_rewrite||t["_"+e])return i;var o=this.wb_getAttribute.call(t,e);if(!o||this.startsWith(o,"javascript:"))return i;var n=this.performAttributeRewrite(t,e,o,r);return n!==o&&(this.removeWBOSRC(t),this.wb_setAttribute.call(t,e,n),i=!0),i},f.prototype.noExceptRewriteStyle=function(t){try{return this.rewriteStyle(t)}catch(e){return t}},f.prototype.rewriteStyle=function(t){if(!t)return t;var e=t;return"object"==typeof t&&(e=t.toString()),"string"==typeof e?e.replace(this.STYLE_REGEX,this.styleReplacer).replace(this.IMPORT_REGEX,this.styleReplacer).replace(this.no_wombatRe,""):e},f.prototype.rewriteSrcset=function(t,e){if(!t)return"";for(var r=t.split(this.srcsetRe),i=[],o=this.rwModForElement(e,"srcset"),n=0;n=0){var o="javascript:";r=o+"window.parent._wb_wombat.initNewWindowWombat(window);"+i.substr(o.length)}return r||(r=this.rewriteUrl(i,!1,this.rwModForElement(t,e))),r!==i&&(this.wb_setAttribute.call(t,e,r),!0)},f.prototype.rewriteScript=function(t){if(t.hasAttribute("src")||!t.textContent||!this.$wbwindow.Proxy)return this.rewriteAttr(t,"src");if(this.skipWrapScriptBasedOnType(t.type))return!1;var e=t.textContent.trim();return!this.skipWrapScriptTextBasedOnText(e)&&(t.textContent=this.wrapScriptTextJsProxy(e),!0)},f.prototype.rewriteSVGElem=function(t){var e=this.rewriteAttr(t,"filter");return e=this.rewriteAttr(t,"style")||e,e=this.rewriteAttr(t,"xlink:href")||e,e=this.rewriteAttr(t,"href")||e,e=this.rewriteAttr(t,"src")||e},f.prototype.rewriteElem=function(t){var e=!1;if(!t)return e;if(t instanceof SVGElement)e=this.rewriteSVGElem(t);else switch(t.tagName){case"META":var r=this.wb_getAttribute.call(t,"http-equiv");r&&"content-security-policy"===r.toLowerCase()&&(this.wb_setAttribute.call(t,"http-equiv","_"+r),e=!0);break;case"STYLE":var i=this.rewriteStyle(t.textContent);t.textContent!==i&&(t.textContent=i,e=!0,this.wbUseAFWorker&&this.WBAutoFetchWorker&&null!=t.sheet&&this.WBAutoFetchWorker.deferredSheetExtraction(t.sheet));break;case"LINK":e=this.rewriteAttr(t,"href"),this.wbUseAFWorker&&"stylesheet"===t.rel&&this._addEventListener(t,"load",this.utilFns.wbSheetMediaQChecker);break;case"IMG":e=this.rewriteAttr(t,"src"),e=this.rewriteAttr(t,"srcset")||e,e=this.rewriteAttr(t,"style")||e,this.wbUseAFWorker&&this.WBAutoFetchWorker&&t.dataset.srcset&&this.WBAutoFetchWorker.preserveDataSrcset(t);break;case"OBJECT":if(this.wb_info.isSW&&t.parentElement&&"application/pdf"===t.getAttribute("type")){for(var o=this.$wbwindow.document.createElement("IFRAME"),n=0;n0;)for(var i=r.shift(),o=0;o"+r+"","text/html");if(!i||!this.nodeHasChildren(i.head)||!i.head.children[0].content)return r;var o=i.head.children[0];if(o._no_rewrite=!0,this.recurseRewriteElem(o.content)){var n=o.innerHTML;if(e){var s=o.content.children&&o.content.children[0];if(s){var a="";this.endsWith(n,a)&&!this.endsWith(r.toLowerCase(),a)&&(n=n.substring(0,n.length-a.length))}else if("<"!==r[0]||">"!==r[r.length-1])return void(this.write_buff+=r)}return n}return r},f.prototype.rewriteHtmlFull=function(t,e){var r=(new DOMParser).parseFromString(t,"text/html");if(!r)return t;for(var i=!1,o=0;o=0)r.documentElement._no_rewrite=!0,n=this.reconstructDocType(r.doctype)+r.documentElement.outerHTML;else{r.head._no_rewrite=!0,r.body._no_rewrite=!0;var s=this.nodeHasChildren(r.head),a=this.nodeHasChildren(r.body);if(n=(s?r.head.outerHTML:"")+(a?r.body.outerHTML:""),e)if(r.all.length>3){var h="";this.endsWith(n,h)&&!this.endsWith(t.toLowerCase(),h)&&(n=n.substring(0,n.length-h.length))}else if("<"!==t[0]||">"!==t[t.length-1])return void(this.write_buff+=t);n=this.reconstructDocType(r.doctype)+n}return n}return t},f.prototype.rewriteInlineStyle=function(t){var e;try{e=decodeURIComponent(t)}catch(r){e=t}if(e!==t){var r=this.rewriteStyle(e).split(",",2);return r[0]+","+encodeURIComponent(r[1])}return this.rewriteStyle(t)},f.prototype.rewriteCookie=function(t){var e=this,r=t.replace(this.wb_abs_prefix,"").replace(this.wb_rel_prefix,"");return r=r.replace(this.cookie_domain_regex,(function(t,i){var o={domain:i,cookie:r,wb_type:"cookie"};return e.sendTopMessage(o,!0),e.$wbwindow.location.hostname.indexOf(".")>=0&&!e.IP_RX.test(e.$wbwindow.location.hostname)?"Domain=."+e.$wbwindow.location.hostname:""})).replace(this.cookie_path_regex,(function(t,r){var i=e.rewriteUrl(r);return 0===i.indexOf(e.wb_curr_host)&&(i=i.substring(e.wb_curr_host.length)),"Path="+i})),"https:"!==e.$wbwindow.location.protocol&&(r=r.replace("secure","")),r.replace(",|",",")},f.prototype.rewriteWorker=function(t){if(!t)return t;var e=0===(t=t.toString()).indexOf("blob:"),r=0===t.indexOf("javascript:");if(!e&&!r){if(!this.startsWithOneOf(t,this.VALID_PREFIXES)&&!this.startsWith(t,"/")&&!this.startsWithOneOf(t,this.BAD_PREFIXES)){var i=this.resolveRelUrl(t,this.$wbwindow.document);return this.rewriteUrl(i,!1,"wkr_",this.$wbwindow.document)}return this.rewriteUrl(t,!1,"wkr_",this.$wbwindow.document)}var o=r?t.replace("javascript:",""):null;if(e){var n=new XMLHttpRequest;this.utilFns.XHRopen.call(n,"GET",t,!1),this.utilFns.XHRsend.call(n),o=n.responseText.replace(this.workerBlobRe,"").replace(this.rmCheckThisInjectRe,"this")}if(this.wb_info.static_prefix||this.wb_info.ww_rw_script){var s=this.$wbwindow.document.baseURI;o="(function() { self.importScripts(\'"+(this.wb_info.ww_rw_script||this.wb_info.static_prefix+"wombatWorkers.js")+"\'); new WBWombat({\'prefix\': \'"+this.wb_abs_prefix+"\', \'prefixMod\': \'"+this.wb_abs_prefix+"wkrf_/\', \'originalURL\': \'"+s+"\'}); })();"+o}var a=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(a)},f.prototype.rewriteTextNodeFn=function(t,e,r){var i,o=this.proxyToObj(t);if(r.length>0&&o.parentElement&&"STYLE"===o.parentElement.tagName){i=new Array(r.length);var n=r.length-1;2===n?(i[0]=r[0],i[1]=r[1]):1===n&&(i[0]=r[0]),i[n]=this.rewriteStyle(r[n])}else i=r;return e.__WB_orig_apply?e.__WB_orig_apply(o,i):e.apply(o,i)},f.prototype.rewriteDocWriteWriteln=function(t,e,r){var i,o=this.proxyToObj(t),n=r.length;if(0===n)return e.call(o);i=1===n?r[0]:Array.prototype.join.call(r,"");var s=this.rewriteHtml(i,!0),a=e.call(o,s);return this.initNewWindowWombat(o.defaultView),a},f.prototype.rewriteChildNodeFn=function(t,e,r){var i=this.proxyToObj(t);if(0===r.length)return e.call(i);var o=this.rewriteElementsInArguments(r);return e.__WB_orig_apply?e.__WB_orig_apply(i,o):e.apply(i,o)},f.prototype.rewriteInsertAdjHTMLOrElemArgs=function(t,e,r,i,o){var n=this.proxyToObj(t);return n._no_rewrite?e.call(n,r,i):o?e.call(n,r,this.rewriteHtml(i)):(this.rewriteElemComplete(i),e.call(n,r,i))},f.prototype.rewriteSetTimeoutInterval=function(t,e,r){var i=this.isString(r[0]),o=i?new Array(r.length):r;if(i){this.$wbwindow.Proxy?o[0]=this.wrapScriptTextJsProxy(r[0]):o[0]=r[0].replace(/\\blocation\\b/g,"WB_wombat_$&");for(var n=1;n0&&i(this.$wbwindow.CSSStyleValue,"parse"),this.$wbwindow.CSSStyleValue.parseAll&&this.$wbwindow.CSSStyleValue.parseAll.toString().indexOf("[native code]")>0&&i(this.$wbwindow.CSSStyleValue,"parseAll")}if(this.$wbwindow.CSSKeywordValue&&this.$wbwindow.CSSKeywordValue.prototype){var o=this.$wbwindow.CSSKeywordValue;this.$wbwindow.CSSKeywordValue=(t=this.$wbwindow.CSSKeywordValue,function(e){return r.domConstructorErrorChecker(this,"CSSKeywordValue",arguments),new t(r.rewriteStyle(e))}),this.$wbwindow.CSSKeywordValue.prototype=o.prototype,Object.defineProperty(this.$wbwindow.CSSKeywordValue.prototype,"constructor",{value:this.$wbwindow.CSSKeywordValue}),e(this.$wbwindow.CSSKeywordValue,"CSSKeywordValue")}if(this.$wbwindow.StylePropertyMap&&this.$wbwindow.StylePropertyMap.prototype){var n=this.$wbwindow.StylePropertyMap.prototype.set;this.$wbwindow.StylePropertyMap.prototype.set=function(){if(arguments.length<=1)return n.__WB_orig_apply?n.__WB_orig_apply(this,arguments):n.apply(this,arguments);var t=new Array(arguments.length);t[0]=arguments[0];for(var e=1;e")&&(e[0]=r.rewriteHtml(e[0]),i.type="text/html"),new t(e,i)}),this.$wbwindow.Blob.prototype=e.prototype}},f.prototype.initWSOverride=function(){this.$wbwindow.WebSocket&&this.$wbwindow.WebSocket.prototype&&(this.$wbwindow.WebSocket=function(t){function e(t,e){this.addEventListener=function(){},this.removeEventListener=function(){},this.close=function(){},this.send=function(t){console.log("ws send",t)},this.protocol=e&&e.length?e[0]:"",this.url=t,this.readyState=0}return e.CONNECTING=0,e.OPEN=1,e.CLOSING=2,e.CLOSED=3,e}(this.$wbwindow.WebSocket),Object.defineProperty(this.$wbwindow.WebSocket.prototype,"constructor",{value:this.$wbwindow.WebSocket}),e(this.$wbwindow.WebSocket,"WebSocket"))},f.prototype.initDocTitleOverride=function(){var t=this.getOrigGetter(this.$wbwindow.document,"title"),e=this.getOrigSetter(this.$wbwindow.document,"title"),r=this;this.defProp(this.$wbwindow.document,"title",(function(t){var i=e.call(this,t),o={wb_type:"title",title:t};return r.sendTopMessage(o),i}),t)},f.prototype.initFontFaceOverride=function(){if(this.$wbwindow.FontFace){var t,r=this,i=this.$wbwindow.FontFace;this.$wbwindow.FontFace=(t=this.$wbwindow.FontFace,function(e,i,o){r.domConstructorErrorChecker(this,"FontFace",arguments,2);var n=i;return null!=i&&(n="string"!=typeof i?r.rewriteInlineStyle(i.toString()):r.rewriteInlineStyle(i)),new t(e,n,o)}),this.$wbwindow.FontFace.prototype=i.prototype,Object.defineProperty(this.$wbwindow.FontFace.prototype,"constructor",{value:this.$wbwindow.FontFace}),e(this.$wbwindow.FontFace,"FontFace")}},f.prototype.initFixedRatio=function(t){try{this.$wbwindow.devicePixelRatio=t}catch(t){}if(Object.defineProperty)try{Object.defineProperty(this.$wbwindow,"devicePixelRatio",{value:t,writable:!1})}catch(t){}},f.prototype.initPaths=function(t){t.wombat_opts=t.wombat_opts||{},Object.assign(this.wb_info,t),this.wb_opts=t.wombat_opts,this.wb_replay_prefix=t.prefix,this.wb_is_proxy=t.proxy_magic||!this.wb_replay_prefix,this.wb_info.top_host=this.wb_info.top_host||"*",this.wb_curr_host=this.$wbwindow.location.protocol+"//"+this.$wbwindow.location.host,this.wb_info.wombat_opts=this.wb_info.wombat_opts||{},this.wb_orig_scheme=t.wombat_scheme+"://",this.wb_orig_origin=this.wb_orig_scheme+t.wombat_host,this.wb_abs_prefix=this.wb_replay_prefix,!t.is_live&&t.wombat_ts?this.wb_capture_date_part="/"+t.wombat_ts+"/":this.wb_capture_date_part="",this.initBadPrefixes(this.wb_replay_prefix),this.initCookiePreset()},f.prototype.initSeededRandom=function(t){this.$wbwindow.Math.seed=parseInt(t);var e=this;this.$wbwindow.Math.random=function(){return e.$wbwindow.Math.seed=(9301*e.$wbwindow.Math.seed+49297)%233280,e.$wbwindow.Math.seed/233280}},f.prototype.initHistoryOverrides=function(){this.overrideHistoryFunc("pushState"),this.overrideHistoryFunc("replaceState");var t=this;this.$wbwindow.addEventListener("popstate",(function(e){t.sendHistoryUpdate(t.$wbwindow.WB_wombat_location.href,t.$wbwindow.document.title)}))},f.prototype.initCookiePreset=function(){if(this.wb_info.presetCookie)for(var t=this.wb_info.presetCookie.split(";"),e=0;e2&&!this.__WB_xhr_open_arguments[2]&&-1===navigator.userAgent.indexOf("Firefox")&&(this.__WB_xhr_open_arguments[2]=!0,console.warn("wombat.js: Sync XHR not supported in SW-based replay in this browser, converted to async")),this._no_rewrite||(this.__WB_xhr_open_arguments[1]=i.rewriteUrl(this.__WB_xhr_open_arguments[1])),o.apply(this,this.__WB_xhr_open_arguments),!i.startsWith(this.__WB_xhr_open_arguments[1],"data:")){for(const[t,e]of this.__WB_xhr_headers.entries())n.call(this,t,e);n.call(this,"X-Pywb-Requested-With","XMLHttpRequest")}return s.call(this,t)}}else if(this.$wbwindow.XMLHttpRequest.prototype.open){var h=this.$wbwindow.XMLHttpRequest.prototype.open;this.utilFns.XHRopen=h,this.utilFns.XHRsend=this.$wbwindow.XMLHttpRequest.prototype.send,this.$wbwindow.XMLHttpRequest.prototype.open=function(t,e,r,o,n){var s=this._no_rewrite?e:i.rewriteUrl(e),a=!0;null==r||r||(a=!1),h.call(this,t,s,a,o,n),i.startsWith(s,"data:")||this.setRequestHeader("X-Pywb-Requested-With","XMLHttpRequest")}}if(this.$wbwindow.fetch){var w=this.$wbwindow.fetch;this.$wbwindow.fetch=function(t,e){var r=t,o=typeof t;if("string"===o)r=i.rewriteUrl(t);else if("object"===o&&t.url){var n=i.rewriteUrl(t.url);n!==t.url&&(r=new Request(n,e))}else"object"===o&&t.href&&(r=i.rewriteUrl(t.href));if(e||(e={}),void 0===e.credentials)try{e.credentials="include"}catch(t){}return w.call(i.proxyToObj(this),r,e)}}if(this.$wbwindow.Request&&this.$wbwindow.Request.prototype){var p=this.$wbwindow.Request;this.$wbwindow.Request=(t=this.$wbwindow.Request,function(e,r){i.domConstructorErrorChecker(this,"Request",arguments);var o=r||{},n=e,s=typeof e;switch(s){case"string":n=i.rewriteUrl(e);break;case"object":if(n=e,e.url){var a=i.rewriteUrl(e.url);a!==e.url&&(n=new t(a,e))}else e.href&&(n=i.rewriteUrl(e.toString(),!0))}return o.credentials="include",new t(n,o)}),this.$wbwindow.Request.prototype=p.prototype,Object.defineProperty(this.$wbwindow.Request.prototype,"constructor",{value:this.$wbwindow.Request})}if(this.$wbwindow.Response&&this.$wbwindow.Response.prototype){var c=this.$wbwindow.Response.prototype.redirect;this.$wbwindow.Response.prototype.redirect=function(t,e){var r=i.rewriteUrl(t,!0,null,i.$wbwindow.document);return c.call(this,r,e)}}if(this.$wbwindow.EventSource&&this.$wbwindow.EventSource.prototype){var _=this.$wbwindow.EventSource;this.$wbwindow.EventSource=(r=this.$wbwindow.EventSource,function(t,e){i.domConstructorErrorChecker(this,"EventSource",arguments);var o=t;return null!=t&&(o=i.rewriteUrl(t)),new r(o,e)}),this.$wbwindow.EventSource.prototype=_.prototype,Object.defineProperty(this.$wbwindow.EventSource.prototype,"constructor",{value:this.$wbwindow.EventSource}),e(this.$wbwindow.EventSource,"EventSource")}},f.prototype.initElementGetSetAttributeOverride=function(){if(!this.wb_opts.skip_setAttribute&&this.$wbwindow.Element&&this.$wbwindow.Element.prototype){var t=this,e=this.$wbwindow.Element.prototype;if(e.setAttribute){var r=e.setAttribute;e._orig_setAttribute=r,e.setAttribute=function(e,i){var o=i;if(e&&"string"==typeof o){var n=e.toLowerCase();if("LINK"===this.tagName&&"href"===n&&0===o.indexOf("data:text/css"))o=t.rewriteInlineStyle(i);else if("style"===n)o=t.rewriteStyle(i);else if("srcset"===n||"imagesrcset"===n&&"LINK"===this.tagName)o=t.rewriteSrcset(i,this);else{t.shouldRewriteAttr(this.tagName,n)&&(t.removeWBOSRC(this),this._no_rewrite||(o=t.rewriteUrl(i,!1,t.rwModForElement(this,n))))}}return r.call(this,e,o)}}if(e.getAttribute){var i=e.getAttribute;this.wb_getAttribute=i,e.getAttribute=function(e){var r=i.call(this,e);if(null===r)return r;var o=e;if(e&&(o=e.toLowerCase()),t.shouldRewriteAttr(this.tagName,o)){var n=t.retrieveWBOSRC(this);return n||t.extractOriginalURL(r)}return t.startsWith(o,"data-")&&t.startsWithOneOf(r,t.wb_prefixes)?t.extractOriginalURL(r):r}}}},f.prototype.initSvgImageOverrides=function(){if(this.$wbwindow.SVGImageElement){var t=this.$wbwindow.SVGImageElement.prototype,e=t.getAttribute,r=t.getAttributeNS,i=t.setAttribute,o=t.setAttributeNS,n=this;t.getAttribute=function(t){var r=e.call(this,t);return t.indexOf("xlink:href")>=0||"href"===t?n.extractOriginalURL(r):r},t.getAttributeNS=function(t,e){var i=r.call(this,t,e);return e.indexOf("xlink:href")>=0||"href"===e?n.extractOriginalURL(i):i},t.setAttribute=function(t,e){var r=e;return(t.indexOf("xlink:href")>=0||"href"===t)&&(r=n.rewriteUrl(e)),i.call(this,t,r)},t.setAttributeNS=function(t,e,r){var i=r;return(e.indexOf("xlink:href")>=0||"href"===e)&&(i=n.rewriteUrl(r)),o.call(this,t,e,i)}}},f.prototype.initCreateElementNSFix=function(){if(this.$wbwindow.document.createElementNS&&this.$wbwindow.Document.prototype.createElementNS){var t=this.$wbwindow.document.createElementNS,e=this,r=function(r,i){return t.call(e.proxyToObj(this),e.extractOriginalURL(r),i)};this.$wbwindow.Document.prototype.createElementNS=r,this.$wbwindow.document.createElementNS=r}},f.prototype.initInsertAdjacentElementHTMLOverrides=function(){var t=this.$wbwindow.Element;if(t&&t.prototype){var e=t.prototype,r=this.rewriteInsertAdjHTMLOrElemArgs;if(e.insertAdjacentHTML){var i=e.insertAdjacentHTML;e.insertAdjacentHTML=function(t,e){return r(this,i,t,e,!0)}}if(e.insertAdjacentElement){var o=e.insertAdjacentElement;e.insertAdjacentElement=function(t,e){return r(this,o,t,e,!1)}}}},f.prototype.initDomOverride=function(){var t=this.$wbwindow.Node;if(t&&t.prototype){var e=this.rewriteNodeFuncArgs;if(t.prototype.appendChild){var r=t.prototype.appendChild;t.prototype.appendChild=function(t,i){return e(this,r,t,i)}}if(t.prototype.insertBefore){var i=t.prototype.insertBefore;t.prototype.insertBefore=function(t,r){return e(this,i,t,r)}}if(t.prototype.replaceChild){var o=t.prototype.replaceChild;t.prototype.replaceChild=function(t,r){return e(this,o,t,r)}}this.overridePropToProxy(t.prototype,"ownerDocument"),this.overridePropToProxy(this.$wbwindow.HTMLHtmlElement.prototype,"parentNode"),this.overridePropToProxy(this.$wbwindow.Event.prototype,"target")}this.$wbwindow.Element&&this.$wbwindow.Element.prototype&&(this.overrideParentNodeAppendPrepend(this.$wbwindow.Element),this.overrideChildNodeInterface(this.$wbwindow.Element,!1)),this.$wbwindow.DocumentFragment&&this.$wbwindow.DocumentFragment.prototype&&this.overrideParentNodeAppendPrepend(this.$wbwindow.DocumentFragment)},f.prototype.initDocOverrides=function(t){if(Object.defineProperty){this.overrideReferrer(t),this.defGetterProp(t,"origin",(function(){return this.WB_wombat_location.origin})),this.defGetterProp(this.$wbwindow,"origin",(function(){return this.WB_wombat_location.origin}));var e=this;this.defProp(t,"domain",(function(t){var r=this.WB_wombat_location;r&&e.endsWith(r.hostname,t)&&(this.__wb_domain=t)}),(function(){return this.__wb_domain||this.WB_wombat_location.hostname}))}},f.prototype.initDocWriteOpenCloseOverride=function(){if(this.$wbwindow.DOMParser){var t=this.$wbwindow.Document.prototype,e=this.$wbwindow.document,r=this.rewriteDocWriteWriteln,i=e.write,o=function(){return r(this,i,arguments)};e.write=o,t.write=o;var n=e.writeln,s=function(){return r(this,n,arguments)};e.writeln=s,t.writeln=s;var a=this,h=e.open,w=function(){var t,e=a.proxyToObj(this);if(3===arguments.length){var r=a.rewriteUrl(arguments[0],!1,"mp_");t=h.call(e,r,arguments[1],arguments[2]),a.initNewWindowWombat(t,arguments[0])}else t=h.call(e),a.initNewWindowWombat(e.defaultView);return t};e.open=w,t.open=w;var p=e.close,c=function(){var t=a.proxyToObj(this);return a.initNewWindowWombat(t.defaultView),p.__WB_orig_apply?p.__WB_orig_apply(t,arguments):p.apply(t,arguments)};e.close=c,t.close=c;var _=this.getOrigGetter(t,"body"),l=this.getOrigSetter(t,"body");_&&l&&this.defProp(t,"body",(function(t){return t&&(t instanceof HTMLBodyElement||t instanceof HTMLFrameSetElement)&&a.rewriteElemComplete(t),l.call(a.proxyToObj(this),t)}),_)}},f.prototype.initIframeWombat=function(t){var e;e=t._get_contentWindow?t._get_contentWindow.call(t):t.contentWindow;try{if(!e||e===this.$wbwindow||e._skip_wombat||e._wb_wombat)return}catch(t){return}var r=t.src;this.initNewWindowWombat(e,r)},f.prototype.initNewWindowWombat=function(t,e){var r=!1;if(t&&!t._wb_wombat){if(e&&""!==e&&!this.startsWithOneOf(e,["about:blank","javascript:"])||(r=!0),!r&&this.wb_info.isSW){var i=this.extractOriginalURL(e);("about:blank"===i||i.startsWith("srcdoc:")||i.startsWith("blob:"))&&(r=!0)}if(r){var o={};Object.assign(o,this.wb_info);var n=new f(t,o);t._wb_wombat=n.wombatInit()}else this.initProtoPmOrigin(t),this.initPostMessageOverride(t),this.initMessageEventOverride(t),this.initCheckThisFunc(t),this.initImportWrapperFunc(t)}},f.prototype.initTimeoutIntervalOverrides=function(){var t=this.rewriteSetTimeoutInterval;if(this.$wbwindow.setTimeout&&!this.$wbwindow.setTimeout.__$wbpatched$__){var e=this.$wbwindow.setTimeout;this.$wbwindow.setTimeout=function(){return t(this,e,arguments)},this.$wbwindow.setTimeout.__$wbpatched$__=!0}if(this.$wbwindow.setInterval&&!this.$wbwindow.setInterval.__$wbpatched$__){var r=this.$wbwindow.setInterval;this.$wbwindow.setInterval=function(){return t(this,r,arguments)},this.$wbwindow.setInterval.__$wbpatched$__=!0}},f.prototype.initWorkerOverrides=function(){var t,e,r=this;if(this.$wbwindow.Worker&&!this.$wbwindow.Worker._wb_worker_overriden){var i=this.$wbwindow.Worker;this.$wbwindow.Worker=(t=i,function(e,i){return r.domConstructorErrorChecker(this,"Worker",arguments),new t(r.rewriteWorker(e),i)}),this.$wbwindow.Worker.prototype=i.prototype,Object.defineProperty(this.$wbwindow.Worker.prototype,"constructor",{value:this.$wbwindow.Worker}),this.$wbwindow.Worker._wb_worker_overriden=!0}if(this.$wbwindow.SharedWorker&&!this.$wbwindow.SharedWorker.__wb_sharedWorker_overriden){var o=this.$wbwindow.SharedWorker;this.$wbwindow.SharedWorker=(e=o,function(t,i){return r.domConstructorErrorChecker(this,"SharedWorker",arguments),new e(r.rewriteWorker(t),i)}),this.$wbwindow.SharedWorker.prototype=o.prototype,Object.defineProperty(this.$wbwindow.SharedWorker.prototype,"constructor",{value:this.$wbwindow.SharedWorker}),this.$wbwindow.SharedWorker.__wb_sharedWorker_overriden=!0}if(this.$wbwindow.ServiceWorkerContainer&&this.$wbwindow.ServiceWorkerContainer.prototype&&this.$wbwindow.ServiceWorkerContainer.prototype.register){var n=this.$wbwindow.ServiceWorkerContainer.prototype.register;this.$wbwindow.ServiceWorkerContainer.prototype.register=function(t,e){var i=new URL(t,r.$wbwindow.document.baseURI).href,o=r.getPageUnderModifier();return e&&e.scope?e.scope=r.rewriteUrl(e.scope,!1,o):e={scope:r.rewriteUrl("/",!1,o)},n.call(this,r.rewriteUrl(i,!1,"sw_"),e)}}if(this.$wbwindow.Worklet&&this.$wbwindow.Worklet.prototype&&this.$wbwindow.Worklet.prototype.addModule&&!this.$wbwindow.Worklet.__wb_workerlet_overriden){var s=this.$wbwindow.Worklet.prototype.addModule;this.$wbwindow.Worklet.prototype.addModule=function(t,e){var i=r.rewriteUrl(t,!1,"js_");return s.call(this,i,e)},this.$wbwindow.Worklet.__wb_workerlet_overriden=!0}},f.prototype.initLocOverride=function(t,e,r){if(Object.defineProperty)for(var i=0;i=0&&i.splice(n,1)}return i}})}catch(t){console.log(t)}},f.prototype.initHashChange=function(){if(this.$wbwindow.__WB_top_frame){var t=this;this.$wbwindow.addEventListener("message",(function(e){if(e.data&&e.data.from_top){var r=e.data.message;r.wb_type&&"outer_hashchange"===r.wb_type&&t.$wbwindow.location.hash!=r.hash&&(t.$wbwindow.location.hash=r.hash)}})),this.$wbwindow.addEventListener("hashchange",(function(){var e={wb_type:"hashchange",hash:t.$wbwindow.location.hash};t.sendTopMessage(e)}))}},f.prototype.initPostMessageOverride=function(t){if(t.postMessage&&!t.__orig_postMessage){var e=t.postMessage,r=this;t.__orig_postMessage=e;var i=function(i,o,n,s){var a,h,w=r.proxyToObj(this);if(w||((w=t).__WB_source=t),w.__WB_source&&w.__WB_source.WB_wombat_location){var p=w.__WB_source;if(a=p.WB_wombat_location.origin,w.__WB_win_id||(w.__WB_win_id={},w.__WB_counter=0),!p.__WB_id){var c=w.__WB_counter;p.__WB_id=c+p.WB_wombat_location.href,w.__WB_counter+=1}w.__WB_win_id[p.__WB_id]=p,h=p.__WB_id,w.__WB_source=void 0}else a=window.WB_wombat_location.origin;var _=o;_===w.location.origin&&(_=a);var l={from:a,to_origin:_,src_id:h,message:i,from_top:s};if("*"!==o){if("null"===w.location.origin||""===w.location.origin)return;o=w.location.origin}return e.call(w,l,o,n)};t.postMessage=i,t.Window.prototype.postMessage=i;var o=null,n=(o=t.EventTarget&&t.EventTarget.prototype?t.EventTarget.prototype:t).addEventListener;o.addEventListener=function(t,e,i){var o,s=r.proxyToObj(this);if("message"===t?o=r.message_listeners.add_or_get(e,(function(){return c(e,s,r)})):"storage"===t?r.storage_listeners.add_or_get(e,(function(){return p(e,s)})):o=e,o)return n.call(s,t,o,i)};var s=o.removeEventListener;o.removeEventListener=function(t,e,i){var o,n=r.proxyToObj(this);if("message"===t?o=r.message_listeners.remove(e):"storage"===t?r.storage_listeners.remove(e):o=e,o)return s.call(n,t,o,i)};var a=function(e,i){var o=r.getOrigSetter(t,e);r.defProp(t,e,(function(t){this["__orig_"+e]=t;var n=r.proxyToObj(this),s=t?i(t,n,r):t;return o.call(n,s)}),(function(){return this["__orig_"+e]}))};a("onmessage",c),a("onstorage",p)}},f.prototype.initMessageEventOverride=function(t){t.MessageEvent&&!t.MessageEvent.prototype.__extended&&(this.addEventOverride("target"),this.addEventOverride("srcElement"),this.addEventOverride("currentTarget"),this.addEventOverride("eventPhase"),this.addEventOverride("path"),this.overridePropToProxy(t.MessageEvent.prototype,"source"),t.MessageEvent.prototype.__extended=!0)},f.prototype.initUIEventsOverrides=function(){this.overrideAnUIEvent("UIEvent"),this.overrideAnUIEvent("MouseEvent"),this.overrideAnUIEvent("TouchEvent"),this.overrideAnUIEvent("FocusEvent"),this.overrideAnUIEvent("KeyboardEvent"),this.overrideAnUIEvent("WheelEvent"),this.overrideAnUIEvent("InputEvent"),this.overrideAnUIEvent("CompositionEvent")},f.prototype.initOpenOverride=function(){var t=this.$wbwindow.open;this.$wbwindow.Window.prototype.open&&(t=this.$wbwindow.Window.prototype.open);var e=this,r=function(r,i,o){i&&(i=this.rewriteAttrTarget(i));var n=e.rewriteUrl(r,!1),s=t.call(e.proxyToObj(this),n,i,o);return e.initNewWindowWombat(s,r),s};this.$wbwindow.open=r,this.$wbwindow.Window.prototype.open&&(this.$wbwindow.Window.prototype.open=r);for(var i=0;i}\n */\nWBWombat.prototype.rewriteArgs = function(argsObj) {\n // recreate the original arguments object just with URLs rewritten\n var newArgObj = new Array(argsObj.length);\n for (var i = 0; i < newArgObj.length; i++) {\n newArgObj[i] = this.rewriteURL(argsObj[i]);\n }\n return newArgObj;\n};\n\n/**\n * Rewrites the input to one of the Fetch APIs\n * @param {*|string|Request} input\n * @return {*|string|Request}\n */\nWBWombat.prototype.rewriteFetchApi = function(input) {\n var rwInput = input;\n switch (typeof input) {\n case 'string':\n rwInput = this.rewriteURL(input);\n break;\n case 'object':\n if (input.url) {\n var new_url = this.rewriteURL(input.url);\n if (new_url !== input.url) {\n // not much we can do here Request.url is read only\n // https://developer.mozilla.org/en-US/docs/Web/API/Request/url\n rwInput = new Request(new_url, input);\n }\n } else if (input.href) {\n // it is likely that input is either self.location or self.URL\n // we cant do anything here so just let it go\n rwInput = input.href;\n }\n break;\n }\n return rwInput;\n};\n\n/**\n * Rewrites the input to one of the Cache APIs\n * @param {*|string|Request} request\n * @return {*|string|Request}\n */\nWBWombat.prototype.rewriteCacheApi = function(request) {\n var rwRequest = request;\n if (typeof request === 'string') {\n rwRequest = this.rewriteURL(request);\n }\n return rwRequest;\n};\n\n/**\n * Applies an override to the importScripts function\n * @see https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts\n */\nWBWombat.prototype.initImportScriptsRewrite = function() {\n if (!self.importScripts) return;\n var wombat = this;\n var origImportScripts = self.importScripts;\n self.importScripts = function importScripts() {\n // rewrite the arguments object and call original function via fn.apply\n var rwArgs = wombat.rewriteArgs(arguments);\n return origImportScripts.apply(this, rwArgs);\n };\n};\n\n/**\n * Applies overrides to the XMLHttpRequest.open and XMLHttpRequest.responseURL\n * in order to ensure URLs are rewritten.\n *\n * Applies an override to window.fetch in order to rewrite URLs and URLs of\n * the supplied Request objects used as arguments to fetch.\n *\n * Applies overrides to window.Request, window.Response, window.EventSource,\n * and window.WebSocket in order to ensure URLs they operate on are rewritten.\n *\n * @see https://xhr.spec.whatwg.org/\n * @see https://fetch.spec.whatwg.org/\n * @see https://html.spec.whatwg.org/multipage/web-sockets.html#websocket\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n */\nWBWombat.prototype.initHTTPOverrides = function() {\n var wombat = this;\n if (\n self.XMLHttpRequest &&\n self.XMLHttpRequest.prototype &&\n self.XMLHttpRequest.prototype.open\n ) {\n var oXHROpen = self.XMLHttpRequest.prototype.open;\n self.XMLHttpRequest.prototype.open = function open(\n method,\n url,\n async,\n user,\n password\n ) {\n var rwURL = wombat.rewriteURL(url);\n var openAsync = true;\n if (async != null && !async) openAsync = false;\n oXHROpen.call(this, method, rwURL, openAsync, user, password);\n if (rwURL.indexOf('data:') === -1) {\n this.setRequestHeader('X-Pywb-Requested-With', 'XMLHttpRequest');\n }\n };\n }\n\n if (self.fetch != null) {\n // this fetch is Worker.fetch\n var orig_fetch = self.fetch;\n self.fetch = function fetch(input, init_opts) {\n var rwInput = wombat.rewriteFetchApi(input);\n var newInitOpts = init_opts || {};\n newInitOpts['credentials'] = 'include';\n return orig_fetch.call(this, rwInput, newInitOpts);\n };\n }\n\n if (self.Request && self.Request.prototype) {\n var orig_request = self.Request;\n self.Request = (function(Request_) {\n return function Request(input, init_opts) {\n var newInitOpts = init_opts || {};\n var newInput = wombat.rewriteFetchApi(input);\n newInitOpts['credentials'] = 'include';\n return new Request_(newInput, newInitOpts);\n };\n })(self.Request);\n self.Request.prototype = orig_request.prototype;\n }\n\n if (self.Response && self.Response.prototype) {\n var originalRedirect = self.Response.prototype.redirect;\n self.Response.prototype.redirect = function redirect(url, status) {\n var rwURL = wombat.rewriteUrl(url);\n return originalRedirect.call(this, rwURL, status);\n };\n }\n\n if (self.EventSource && self.EventSource.prototype) {\n var origEventSource = self.EventSource;\n self.EventSource = (function(EventSource_) {\n return function EventSource(url, configuration) {\n var rwURL = url;\n if (url != null) {\n rwURL = wombat.rewriteUrl(url);\n }\n return new EventSource_(rwURL, configuration);\n };\n })(self.EventSource);\n self.EventSource.prototype = origEventSource.prototype;\n Object.defineProperty(self.EventSource.prototype, 'constructor', {\n value: self.EventSource\n });\n }\n\n if (self.WebSocket && self.WebSocket.prototype) {\n var origWebSocket = self.WebSocket;\n self.WebSocket = (function(WebSocket_) {\n return function WebSocket(url, configuration) {\n var rwURL = url;\n if (url != null) {\n rwURL = wombat.rewriteWSURL(url);\n }\n return new WebSocket_(rwURL, configuration);\n };\n })(self.WebSocket);\n self.WebSocket.prototype = origWebSocket.prototype;\n Object.defineProperty(self.WebSocket.prototype, 'constructor', {\n value: self.WebSocket\n });\n }\n};\n\n/**\n * Applies an override to Clients.openWindow and WindowClient.navigate that rewrites\n * the supplied URL that represents a controlled window\n * @see https://w3c.github.io/ServiceWorker/#window-client-interface\n * @see https://w3c.github.io/ServiceWorker/#clients-interface\n */\nWBWombat.prototype.initClientApisOverride = function() {\n var wombat = this;\n if (\n self.Clients &&\n self.Clients.prototype &&\n self.Clients.prototype.openWindow\n ) {\n var oClientsOpenWindow = self.Clients.prototype.openWindow;\n self.Clients.prototype.openWindow = function openWindow(url) {\n var rwURL = wombat.rewriteClientWindowURL(url);\n return oClientsOpenWindow.call(this, rwURL);\n };\n }\n\n if (\n self.WindowClient &&\n self.WindowClient.prototype &&\n self.WindowClient.prototype.navigate\n ) {\n var oWinClientNavigate = self.WindowClient.prototype.navigate;\n self.WindowClient.prototype.navigate = function navigate(url) {\n var rwURL = wombat.rewriteClientWindowURL(url, this);\n return oWinClientNavigate.call(this, rwURL);\n };\n }\n};\n\n/**\n * Applies overrides to the CacheStorage and Cache interfaces in order\n * to rewrite the URLs they operate on\n * @see https://w3c.github.io/ServiceWorker/#cachestorage\n * @see https://w3c.github.io/ServiceWorker/#cache-interface\n */\nWBWombat.prototype.initCacheApisOverride = function() {\n var wombat = this;\n if (\n self.CacheStorage &&\n self.CacheStorage.prototype &&\n self.CacheStorage.prototype.match\n ) {\n var oCacheStorageMatch = self.CacheStorage.prototype.match;\n self.CacheStorage.prototype.match = function match(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheStorageMatch.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache && self.Cache.prototype) {\n if (self.Cache.prototype.match) {\n var oCacheMatch = self.Cache.prototype.match;\n self.Cache.prototype.match = function match(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheMatch.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache.prototype.matchAll) {\n var oCacheMatchAll = self.Cache.prototype.matchAll;\n self.Cache.prototype.matchAll = function matchAll(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheMatchAll.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache.prototype.add) {\n var oCacheAdd = self.Cache.prototype.add;\n self.Cache.prototype.add = function add(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheAdd.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache.prototype.addAll) {\n var oCacheAddAll = self.Cache.prototype.addAll;\n self.Cache.prototype.addAll = function addAll(requests) {\n var rwRequests = requests;\n if (Array.isArray(requests)) {\n rwRequests = new Array(requests.length);\n for (var i = 0; i < requests.length; i++) {\n rwRequests[i] = wombat.rewriteCacheApi(requests[i]);\n }\n }\n return oCacheAddAll.call(this, rwRequests);\n };\n }\n\n if (self.Cache.prototype.put) {\n var oCachePut = self.Cache.prototype.put;\n self.Cache.prototype.put = function put(request, response) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCachePut.call(this, rwRequest, response);\n };\n }\n\n if (self.Cache.prototype.delete) {\n var oCacheDelete = self.Cache.prototype.delete;\n self.Cache.prototype.delete = function newCacheDelete(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheDelete.call(this, rwRequest, options);\n };\n }\n\n if (self.Cache.prototype.keys) {\n var oCacheKeys = self.Cache.prototype.keys;\n self.Cache.prototype.keys = function keys(request, options) {\n var rwRequest = wombat.rewriteCacheApi(request);\n return oCacheKeys.call(this, rwRequest, options);\n };\n }\n }\n};\n\nself.WBWombat = WBWombat;\n"}),this.collections=new i(o,n.get("root"),r),this.collections.loadAll(n.get("dbColl")),this.proxyOriginMode=!!n.get("proxyOriginMode"),this.api=new e(this.collections),this.apiPrefix=this.replayPrefix+"api/",this.allowRewrittenCache=!!n.get("allowCache"),this.stats=n.get("stats")?new Iy:null,self.addEventListener("install",(()=>{self.skipWaiting()})),self.addEventListener("activate",(t=>{t.waitUntil(self.clients.claim()),console.log("Activate!")})),self.addEventListener("fetch",(t=>{t.respondWith(this.handleFetch(t))})),self.addEventListener("message",(t=>{"reload_all"===t.data.msg_type&&t.waitUntil(this.collections.loadAll())}))}handleFetch(t){const e=t.request.url;if(this.proxyOriginMode)return this.getResponseFor(t.request,t);if(!e.startsWith(this.prefix))return"chrome-extension://invalid/"===e?x(t.request,"Invalid URL"):this.defaultFetch(t.request);if(this.collections.root&&e.slice(this.prefix.length).indexOf("/")<0)return this.defaultFetch(t.request);if(e.startsWith(this.staticPrefix+"proxy/"))return this.staticPathProxy(e,t.request);if(e.startsWith(this.replayPrefix)&&!e.startsWith(this.staticPrefix))return this.getResponseFor(t.request,t);const r=new URL(e);r.search="",r.hash="";const i=r.href;for(const t of this.staticData.keys())if(t===i){const{content:e,type:r}=this.staticData.get(t);return new Response(e,{headers:{"Content-Type":r}})}return("http:"==r.protocol||"https:"==r.protocol)&&r.pathname.indexOf("/",1)<0?this.handleOffline(t.request):this.defaultFetch(t.request)}staticPathProxy(t,e){return t=t.slice((this.staticPrefix+"proxy/").length),t=new URL(t,self.location.href).href,e=new Request(t),this.defaultFetch(e)}defaultFetch(t){const e={};return"only-if-cached"===t.cache&&"same-origin"!==t.mode&&(e.cache="default"),self.fetch(t,e)}async ensureCached(t){const e=await caches.open("wabac-offline");for(let r of t){r=new URL(r,self.location.href).href;let t=await e.match(r,{ignoreSearch:!0});if(!t)try{t=await this.defaultFetch(r),await e.put(r,t)}catch(t){console.warn(`Failed to Auto Cache: ${r}`,t)}}}async handleOffline(t){let e=null;const r=await caches.open("wabac-offline");try{e=await this.defaultFetch(t)}catch(i){return e=await r.match(t,{ignoreSearch:!0}),e||(e=x(t,"Sorry, this url was not cached for offline use")),e}if(t.url.startsWith(this.prefix+"?"))return e;if(200===e.status){const i=e.clone();await r.put(t,i)}else console.warn(`Not Cacheing ${t.url} - Status ${e.status}`);return e}async getResponseFor(t,e){if(!this.proxyOriginMode&&t.url.startsWith(this.apiPrefix))return this.stats&&t.url.startsWith(this.apiPrefix+"stats.json")?await this.stats.getStats(e):await this.api.apiResponse(t.url.slice(this.apiPrefix.length),t,e);await this.collections.inited;const r=E(t),i=t.headers.get("range");try{if(this.allowRewrittenCache&&!i){const e=await self.caches.match(t);if(e&&!!e.headers.get(Zy)===r)return e}}catch(t){}let n=this.collections.root;n||(n=t.url.slice(this.replayPrefix.length).split("/",1)[0]);const s=await this.collections.getColl(n);if(!s||!this.proxyOriginMode&&!t.url.startsWith(s.prefix))return x(t);const o=this.proxyOriginMode?t.url:t.url.substring(s.prefix.length),a={isRoot:!!this.collections.root};this.proxyOriginMode&&(a.mod="id_",a.proxyOrigin=s.config.extraConfig.proxyOrigin,a.localOrigin=self.location.origin);const c=new Jy(o,t,a);if(!c.url)return x(t,`Replay URL ${o} not found`);const l=await s.handleRequest(c,e);if(l){if(this.stats&&this.stats.updateStats(l.date,l.status,t,e),this.allowRewrittenCache&&200===l.status)try{const e=await self.caches.open("wabac-"+s.name);r&&l.headers.set(Zy,"true");const i=l.clone();await e.put(t,i)}catch(t){console.warn(t)}return l}return i&&console.log("Not Found Range!: "+i),x(t)}}if(self.registration){const t=new Map,r=self.registration.scope;t.set(r,{type:"text/html",content:e}),t.set(r+"index.html",{type:"text/html",content:e});const i={injectScripts:["ruffle/ruffle.js"]};self.ipfsCustomPreload=!0,self.sw=new Yy({staticData:t,defaultConfig:i})}else new xy(self)})();var n=self;for(var s in i)n[s]=i[s];i.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/ui.js b/ui.js index f704555..9d08156 100644 --- a/ui.js +++ b/ui.js @@ -48,7 +48,7 @@ class oe extends re{constructor(e){if(super(e),this.it=R,e.type!==ie)throw Error * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -class se extends oe{}se.directiveName="unsafeSVG",se.resultType=2;const le=ae(se),ce=ae(class extends re{constructor(e){var t;if(super(e),e.type!==te||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const a=e[i];return null==a?t:t+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${a};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ct){this.ct=new Set;for(const e in t)this.ct.add(e);return this.render(t)}this.ct.forEach((e=>{null==t[e]&&(this.ct.delete(e),e.includes("-")?i.removeProperty(e):i[e]="")}));for(const e in t){const a=t[e];null!=a&&(this.ct.add(e),e.includes("-")?i.setProperty(e,a):i[e]=a)}return U}});var de=__webpack_require__(6274),he=__webpack_require__(3029),fe=__webpack_require__.n(he);const be=r(de.Z);function ue(e){return[be,e]}const pe=window.IS_APP||window.electron&&window.electron.IS_APP||window.matchMedia("(display-mode: standalone)").matches,me="1.7.5";function ge(e){" "==e.key&&(e.preventDefault(),e.target.click())}class ve extends X{constructor(){super(),this.size="1.1em",this.width=null,this.height=null}static get properties(){return{svg:{type:String},size:{type:String},width:{type:String},height:{type:String}}}static get styles(){return o` +class se extends oe{}se.directiveName="unsafeSVG",se.resultType=2;const le=ae(se),ce=ae(class extends re{constructor(e){var t;if(super(e),e.type!==te||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const a=e[i];return null==a?t:t+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${a};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ct){this.ct=new Set;for(const e in t)this.ct.add(e);return this.render(t)}this.ct.forEach((e=>{null==t[e]&&(this.ct.delete(e),e.includes("-")?i.removeProperty(e):i[e]="")}));for(const e in t){const a=t[e];null!=a&&(this.ct.add(e),e.includes("-")?i.setProperty(e,a):i[e]=a)}return U}});var de=__webpack_require__(6274),he=__webpack_require__(3029),fe=__webpack_require__.n(he);const be=r(de.Z);function ue(e){return[be,e]}const pe=window.IS_APP||window.electron&&window.electron.IS_APP||window.matchMedia("(display-mode: standalone)").matches,me="1.7.6";function ge(e){" "==e.key&&(e.preventDefault(),e.target.click())}class ve extends X{constructor(){super(),this.size="1.1em",this.width=null,this.height=null}static get properties(){return{svg:{type:String},size:{type:String},width:{type:String},height:{type:String}}}static get styles(){return o` :host { display: inline-block; padding: 0; diff --git a/yarn.lock b/yarn.lock index ac92b69..d4584c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -653,10 +653,10 @@ resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.5.2.tgz#ea584b637ff63c5a477f6f21604b5a205b72c9ec" integrity sha512-vgJ5OLWadI8aKjDlOH3rb+dYyPd2GTZuQC/Tihjct6F9GpXGZINo3Y/IVuZVTM1eDQB+/AOsjPUWH/WySDaXvw== -"@webrecorder/wabac@^2.13.10": - version "2.13.10" - resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.13.10.tgz#7319cf18ff9198d6d4760aed6d2ad271e2472bfc" - integrity sha512-tce4CmMZqPqZH1ZqLbKGb6+2QcdzwZbdMr94PtLcMvkCarXLs7oE2jnHQ3kDDXByDqp4JCS554WviwToACNOaQ== +"@webrecorder/wabac@^2.13.11": + version "2.13.11" + resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.13.11.tgz#95193e3e4c14c730281ee995d2a88838d16cf1e5" + integrity sha512-qbMnvJkBVDsLCXDntGPii+1XvF03ILAwpuTrbOJTdhBnNfF41YCwZ8rpsw6g8AkQKkwE8aMkwxYWr0TuRd7hFg== dependencies: "@peculiar/asn1-ecc" "^2.3.0" "@peculiar/asn1-schema" "^2.3.0"