diff --git a/README.md b/README.md index bf1eedb..c1a3850 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Please report any issue you have with those (only for mainstream browsers) Also, use this if you plan to use b4k's archive. - [Install 4chanX (recommended)](https://www.4chan-x.net/builds/4chan-X.user.js) -- Install the correct WebExtension for your Browser ([Firefox](https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.273.xpi) or [Chrome-based](https://chrome.google.com/webstore/detail/pngextraembedder/bfhpobiikighljcapcfmfganodihbicj)) +- Install the correct WebExtension for your Browser ([Firefox](https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.275.xpi) or [Chrome-based](https://chrome.google.com/webstore/detail/pngextraembedder/bfhpobiikighljcapcfmfganodihbicj)) For FF users, the extension is signed so you can just drag and drop it on your about:addons tab. diff --git a/build-chrome.js b/build-chrome.js index 5e1dca9..2469098 100644 --- a/build-chrome.js +++ b/build-chrome.js @@ -44,6 +44,7 @@ const manif3 = { 64: "1449696017588.png" }, permissions: [ + "storage" ], "host_permissions":[""], web_accessible_resources: [{ diff --git a/chrome/dist/main.js b/chrome/dist/main.js index 7f9fc63..0d87f34 100644 --- a/chrome/dist/main.js +++ b/chrome/dist/main.js @@ -73,7 +73,7 @@ var define_BUILD_VERSION_default; var init_define_BUILD_VERSION = __esm({ ""() { - define_BUILD_VERSION_default = [0, 273]; + define_BUILD_VERSION_default = [0, 275]; } }); @@ -13954,12 +13954,33 @@ } // src/stores.ts - var localLoad = (key2, def) => "__pee__" + key2 in localStorage ? JSON.parse(localStorage.getItem("__pee__" + key2)) : def; - var localSet = (key2, value) => localStorage.setItem("__pee__" + key2, JSON.stringify(value)); + var localLoad = async (key2, def) => { + const isinls = "__pee__" + key2 in localStorage; + const ret = isinls ? { ...def, ...JSON.parse(localStorage.getItem("__pee__" + key2)) } : def; + if (true) { + if (isinls) { + delete localStorage["__pee__" + key2]; + await chrome.storage.local.set({ + [key2]: JSON.stringify(ret) + }); + } else { + const d = await chrome.storage.local.get([key2]); + if (typeof d[key2] == "string") + return { ...def, ...await JSON.parse("" + d[key2] || "{}") }; + } + } + return ret; + }; + var localSet = (key2, value) => { + if (true) + chrome.storage.local.set({ [key2]: JSON.stringify(value) }); + else + localStorage.setItem("__pee__" + key2, JSON.stringify(value)); + }; var initial_settings = localLoad("settingsv2", { - ...localLoad("settings", {}), loop: true, dh: false, + pmeth: 4, xpv: false, xpi: false, hyd: false, @@ -13988,10 +14009,12 @@ conc: 8, ho: false, blacklist: [], - rsources: [], - ...localLoad("settingsv2", {}) + rsources: [] + }); + var settings = writable(); + initial_settings.then((v) => { + settings.set(v); }); - var settings = writable(initial_settings); var appState = writable({ isCatalog: false, is4chanX: false, @@ -14312,6 +14335,7 @@ "archived.moe", "archive.nyafuu.org", "arch.b4k.co", + "archive.4plebs.org", "archive.wakarimasen.moe", "b4k.co", "fireden.net", @@ -16562,6 +16586,8 @@ return threadDataCache; }; var getEmbedsFromCache = async (board, op, pid) => { + if (!csettings) + throw new Error("Settings uninit"); await getThreadDataCache(board, op); const target = +pid.slice(pid.match(/\d/).index); const cachedData = cthreadDataCache[target]; @@ -16601,6 +16627,8 @@ return ret; }; var decodeCoom3Payload = async (buff) => { + if (!csettings) + throw new Error("Settings uninit"); const allowed_domains = filehosts.map((e) => e.serving.replaceAll(".", "\\.")); const pees = buff.toString().split(" ").slice(0, csettings.maxe).filter((e) => allowed_domains.some((v) => e.match(`https://(.*\\.)?${v}/`))); return (await Promise.all(pees.map(async (pee) => { @@ -16678,6 +16706,8 @@ let total = 0; fireNotification("info", `Uploading ${injs.length} files...`); return await Promise.all(injs.map(async (inj) => { + if (!csettings) + throw new Error("Settings uninit"); const peefile = await buildPeeFile(inj); const ret = await filehosts[csettings.fhost || 0].uploadFile(peefile); fireNotification("info", `Uploaded files [${++total}/${injs.length}] ${ret}`); @@ -16808,6 +16838,8 @@ const sneed = new PNGDecoder(reader); const ret = []; let w; + if (!csettings2) + throw new Error("Settings uninit"); try { for await (const [name, chunk, crc, offset] of sneed.chunks()) { let buff; @@ -16883,6 +16915,8 @@ return [ret, () => b]; }; var inject_data = async (container, injb) => { + if (!csettings2) + throw new Error("Settings uninit"); let magic4 = false; const [writestream, extract7] = BufferWriteStream2(); const encoder = new PNGEncoder(writestream); @@ -16892,7 +16926,24 @@ break; if (!magic4 && name == "IDAT") { const passed = import_buffer3.Buffer.from(injb); - await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM7, passed])), () => Promise.resolve(0), 0]); + switch (csettings2.pmeth) { + case 0: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM3, passed])), () => Promise.resolve(0), 0]); + break; + case 1: + xor(passed, password); + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM4, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 2: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM5, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 3: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM6, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 4: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM7, import_buffer3.Buffer.from(bs58.encode(passed))])), () => Promise.resolve(0), 0]); + break; + } magic4 = true; } await encoder.insertchunk([name, chunk, crc, offset]); @@ -16915,7 +16966,7 @@ } return ""; }); - const injb = import_buffer3.Buffer.from(bs58.encode(import_buffer3.Buffer.from(links.join(" ")))); + const injb = import_buffer3.Buffer.from(links.join(" ")); return inject_data(container, injb); }; var has_embed = async (png) => { @@ -18891,10 +18942,6 @@ }; // src/jpg.ts - var csettings3; - settings.subscribe((b) => { - csettings3 = b; - }); var key = import_buffer6.Buffer.from("CUNNYCUNNYCUNNY"); var f5inst = new f5stego(key); var inject4 = async (b, links) => { @@ -18992,9 +19039,9 @@ }; // src/thirdeye.ts - var csettings4; + var csettings3; settings.subscribe((b) => { - csettings4 = b; + csettings3 = b; }); var gelquirk = (prefix) => (a) => { let base = a.post || a.data || a; @@ -19015,6 +19062,8 @@ var phashEn = false; var mindist = 5; settings.subscribe((s) => { + if (!s) + return; experimentalApi = s.expte; boorus = s.rsources.map((e) => ({ ...e, @@ -19024,10 +19073,7 @@ mindist = s.mdist || 5; phashEn = s.phash; }); - var boorus = localLoad("settingsv2", { rsources: [] }).rsources.map((e) => ({ - ...e, - quirks: gelquirk(e.view) - })); + var boorus = []; var unlockQueue = Promise.resolve(); var cache = {}; var findFileFrom = async (b, hex, abort) => { @@ -19050,6 +19096,8 @@ } }; var extract5 = async (b, fn) => { + if (!csettings3) + throw new Error("Settings uninit"); let result; let booru; for (const e of Object.values(boorus)) { @@ -19071,8 +19119,8 @@ url: result[0].page }, filename: fn.substring(0, 33) + result[0].ext, - thumbnail: csettings4.hotlink ? prev || full : import_buffer7.Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), - data: csettings4.hotlink ? full || prev : async (lsn) => { + thumbnail: csettings3.hotlink ? prev || full : import_buffer7.Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), + data: csettings3.hotlink ? full || prev : async (lsn) => { if (!cachedFile) cachedFile = await (await ifetch(full || prev, void 0, lsn)).arrayBuffer(); return import_buffer7.Buffer.from(cachedFile); @@ -19138,9 +19186,9 @@ { host: "Litter", prefix: "litter.catbox.moe/" }, { host: "Zzzz", prefix: "z.zz.fo/" } ]; - var csettings5; + var csettings4; settings.subscribe((b) => { - csettings5 = b; + csettings4 = b; }); var getExt = (fn) => { const isB64 = fn.match(/^((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=))?\.(gif|jpe?g|png|webm)/); @@ -19166,6 +19214,8 @@ return { ext, source }; }; var extract6 = async (b, fn) => { + if (!csettings4) + throw new Error("Settings uninit"); const { ext, source } = getExt(fn); let rsource; for (const cs of sources) { @@ -19180,7 +19230,7 @@ } return [{ filename: ext, - data: csettings5.hotlink ? rsource : async (lsn) => { + data: csettings4.hotlink ? rsource : async (lsn) => { try { return import_buffer8.Buffer.from(await (await ifetch(rsource, void 0, lsn)).arrayBuffer()); } catch (e) { @@ -21202,34 +21252,39 @@ // src/Components/App.svelte function add_css8(target) { - append_styles(target, "svelte-10fwss6", '.bepis.svelte-10fwss6.svelte-10fwss6{max-height:260px;overflow-y:auto}.tagcont.svelte-10fwss6.svelte-10fwss6{display:flex;gap:5px;margin-bottom:10px;flex-wrap:wrap}label.svelte-10fwss6>input[type="text"].svelte-10fwss6,label.svelte-10fwss6>input[type="number"].svelte-10fwss6{width:95%}.content.svelte-10fwss6.svelte-10fwss6{display:flex;flex-direction:column}.error.svelte-10fwss6.svelte-10fwss6{color:red}hr.svelte-10fwss6.svelte-10fwss6{width:100%}h1.svelte-10fwss6.svelte-10fwss6{text-align:center;margin-bottom:0}h4.svelte-10fwss6.svelte-10fwss6{text-align:center;margin:0}.form.svelte-10fwss6.svelte-10fwss6{display:flex;flex-direction:column;gap:20px;position:absolute;padding:15px;border:1px solid white;background-color:black;border-radius:10px}.form.svelte-10fwss6>label.svelte-10fwss6{display:flex;flex-direction:column;gap:10px}.newsbox.svelte-10fwss6.svelte-10fwss6{max-height:300px;overflow-y:scroll}.backpanel.svelte-10fwss6.svelte-10fwss6{position:absolute;right:32px;padding:10px;width:15%;top:32px;border:1px solid;border-radius:5px;background-color:rgba(0, 0, 0, 0.8);pointer-events:all;backdrop-filter:blur(9px);max-height:80vh;min-width:321px}'); + append_styles(target, "svelte-1pjjwl2", '.bepis.svelte-1pjjwl2.svelte-1pjjwl2{max-height:260px;overflow-y:auto}.tagcont.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;gap:5px;margin-bottom:10px;flex-wrap:wrap}label.svelte-1pjjwl2>input[type="text"].svelte-1pjjwl2,label.svelte-1pjjwl2>input[type="number"].svelte-1pjjwl2{width:95%}.content.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;flex-direction:column}.error.svelte-1pjjwl2.svelte-1pjjwl2{color:red}hr.svelte-1pjjwl2.svelte-1pjjwl2{width:100%}h1.svelte-1pjjwl2.svelte-1pjjwl2{text-align:center;margin-bottom:0}h4.svelte-1pjjwl2.svelte-1pjjwl2{text-align:center;margin:0}.form.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;flex-direction:column;gap:20px;position:absolute;padding:15px;border:1px solid white;background-color:black;border-radius:10px}.form.svelte-1pjjwl2>label.svelte-1pjjwl2{display:flex;flex-direction:column;gap:10px}.newsbox.svelte-1pjjwl2.svelte-1pjjwl2{max-height:300px;overflow-y:scroll}.backpanel.svelte-1pjjwl2.svelte-1pjjwl2{position:absolute;right:32px;padding:10px;width:15%;top:32px;border:1px solid;border-radius:5px;background-color:rgba(0, 0, 0, 0.8);pointer-events:all;backdrop-filter:blur(9px);max-height:80vh;min-width:321px}'); } function get_each_context2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[58] = list[i]; + child_ctx[59] = list[i]; return child_ctx; } function get_each_context_12(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[61] = list[i]; + child_ctx[62] = list[i]; return child_ctx; } function get_each_context_2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[64] = list[i]; - child_ctx[66] = i; + child_ctx[65] = list[i]; return child_ctx; } function get_each_context_3(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[67] = list[i]; - child_ctx[66] = i; + child_ctx[68] = list[i]; + child_ctx[70] = i; return child_ctx; } function get_each_context_4(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[69] = list[i]; - child_ctx[66] = i; + child_ctx[71] = list[i]; + child_ctx[70] = i; + return child_ctx; + } + function get_each_context_5(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[73] = list[i]; + child_ctx[70] = i; return child_ctx; } function create_if_block6(ctx) { @@ -21266,11 +21321,11 @@ hr = element("hr"); t5 = space(); create_component(tabs.$$.fragment); - attr(h1, "class", "svelte-10fwss6"); - attr(h4, "class", "svelte-10fwss6"); - attr(hr, "class", "svelte-10fwss6"); - attr(div0, "class", "content svelte-10fwss6"); - attr(div1, "class", "backpanel svelte-10fwss6"); + attr(h1, "class", "svelte-1pjjwl2"); + attr(h4, "class", "svelte-1pjjwl2"); + attr(hr, "class", "svelte-1pjjwl2"); + attr(div0, "class", "content svelte-1pjjwl2"); + attr(div1, "class", "backpanel svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div1, anchor); @@ -21290,7 +21345,7 @@ if (!current || dirty[0] & 1) set_data(t1, ctx2[0]); const tabs_changes = {}; - if (dirty[0] & 1006 | dirty[2] & 512) { + if (dirty[0] & 1006 | dirty[2] & 8192) { tabs_changes.$$scope = { dirty, ctx: ctx2 }; } tabs.$set(tabs_changes); @@ -21322,7 +21377,7 @@ } }; } - function create_default_slot_14(ctx) { + function create_default_slot_16(ctx) { let t; return { c() { @@ -21337,7 +21392,7 @@ } }; } - function create_default_slot_13(ctx) { + function create_default_slot_15(ctx) { let t; return { c() { @@ -21352,7 +21407,7 @@ } }; } - function create_default_slot_12(ctx) { + function create_default_slot_14(ctx) { let t; return { c() { @@ -21367,7 +21422,7 @@ } }; } - function create_default_slot_11(ctx) { + function create_default_slot_13(ctx) { let t; return { c() { @@ -21382,7 +21437,7 @@ } }; } - function create_default_slot_10(ctx) { + function create_default_slot_12(ctx) { let t; return { c() { @@ -21397,12 +21452,27 @@ } }; } + function create_default_slot_11(ctx) { + let t; + return { + c() { + t = text("Advanced"); + }, + m(target, anchor) { + insert(target, t, anchor); + }, + d(detaching) { + if (detaching) + detach(t); + } + }; + } function create_if_block_11(ctx) { let tab; let current; tab = new Tab_default({ props: { - $$slots: { default: [create_default_slot_9] }, + $$slots: { default: [create_default_slot_10] }, $$scope: { ctx } } }); @@ -21429,7 +21499,7 @@ } }; } - function create_default_slot_9(ctx) { + function create_default_slot_10(ctx) { let t; return { c() { @@ -21444,7 +21514,7 @@ } }; } - function create_default_slot_8(ctx) { + function create_default_slot_9(ctx) { let tab0; let t0; let tab1; @@ -21455,40 +21525,48 @@ let t3; let tab4; let t4; + let tab5; + let t5; let if_block_anchor; let current; tab0 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_14] }, + $$slots: { default: [create_default_slot_16] }, $$scope: { ctx } } }); tab1 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_13] }, + $$slots: { default: [create_default_slot_15] }, $$scope: { ctx } } }); tab2 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_12] }, + $$slots: { default: [create_default_slot_14] }, $$scope: { ctx } } }); tab3 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_11] }, + $$slots: { default: [create_default_slot_13] }, $$scope: { ctx } } }); tab3.$on("select", ctx[18]); tab4 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_10] }, + $$slots: { default: [create_default_slot_12] }, $$scope: { ctx } } }); tab4.$on("select", ctx[19]); + tab5 = new Tab_default({ + props: { + $$slots: { default: [create_default_slot_11] }, + $$scope: { ctx } + } + }); let if_block = ctx[8].akValid && create_if_block_11(ctx); return { c() { @@ -21502,6 +21580,8 @@ t3 = space(); create_component(tab4.$$.fragment); t4 = space(); + create_component(tab5.$$.fragment); + t5 = space(); if (if_block) if_block.c(); if_block_anchor = empty(); @@ -21517,6 +21597,8 @@ insert(target, t3, anchor); mount_component(tab4, target, anchor); insert(target, t4, anchor); + mount_component(tab5, target, anchor); + insert(target, t5, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); @@ -21524,30 +21606,35 @@ }, p(ctx2, dirty) { const tab0_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab0_changes.$$scope = { dirty, ctx: ctx2 }; } tab0.$set(tab0_changes); const tab1_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab1_changes.$$scope = { dirty, ctx: ctx2 }; } tab1.$set(tab1_changes); const tab2_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab2_changes.$$scope = { dirty, ctx: ctx2 }; } tab2.$set(tab2_changes); const tab3_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab3_changes.$$scope = { dirty, ctx: ctx2 }; } tab3.$set(tab3_changes); const tab4_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab4_changes.$$scope = { dirty, ctx: ctx2 }; } tab4.$set(tab4_changes); + const tab5_changes = {}; + if (dirty[2] & 8192) { + tab5_changes.$$scope = { dirty, ctx: ctx2 }; + } + tab5.$set(tab5_changes); if (ctx2[8].akValid) { if (if_block) { if (dirty[0] & 256) { @@ -21575,6 +21662,7 @@ transition_in(tab2.$$.fragment, local); transition_in(tab3.$$.fragment, local); transition_in(tab4.$$.fragment, local); + transition_in(tab5.$$.fragment, local); transition_in(if_block); current = true; }, @@ -21584,6 +21672,7 @@ transition_out(tab2.$$.fragment, local); transition_out(tab3.$$.fragment, local); transition_out(tab4.$$.fragment, local); + transition_out(tab5.$$.fragment, local); transition_out(if_block); current = false; }, @@ -21603,6 +21692,9 @@ destroy_component(tab4, detaching); if (detaching) detach(t4); + destroy_component(tab5, detaching); + if (detaching) + detach(t5); if (if_block) if_block.d(detaching); if (detaching) @@ -21676,8 +21768,8 @@ if_block1_anchor = empty(); attr(a, "title", "Only requires Search Files permission. See Hydrus docs on where to set this up."); attr(input, "type", "text"); - attr(input, "class", "svelte-10fwss6"); - attr(label, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { if (if_block0) @@ -21753,7 +21845,7 @@ c() { span = element("span"); t = text(t_value); - attr(span, "class", "error svelte-10fwss6"); + attr(span, "class", "error svelte-1pjjwl2"); }, m(target, anchor) { insert(target, span, anchor); @@ -21790,12 +21882,12 @@ input1 = element("input"); set_style(input0, "width", "5ch"); attr(input0, "type", "number"); - attr(input0, "class", "svelte-10fwss6"); - attr(label0, "class", "svelte-10fwss6"); + attr(input0, "class", "svelte-1pjjwl2"); + attr(label0, "class", "svelte-1pjjwl2"); attr(input1, "placeholder", "Restrict to these tags (space to separate tags, _ to separate words)"); attr(input1, "type", "text"); - attr(input1, "class", "svelte-10fwss6"); - attr(label1, "class", "svelte-10fwss6"); + attr(input1, "class", "svelte-1pjjwl2"); + attr(label1, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, label0, anchor); @@ -21835,7 +21927,7 @@ } }; } - function create_default_slot_7(ctx) { + function create_default_slot_8(ctx) { let label0; let input0; let t0; @@ -22288,24 +22380,24 @@ let dispose; let if_block0 = ctx[7].phash && create_if_block_62(ctx); let if_block1 = ctx[7].rsources.length == 0 && create_if_block_52(ctx); - let each_value_4 = ctx[7].rsources; + let each_value_5 = ctx[7].rsources; let each_blocks_1 = []; - for (let i = 0; i < each_value_4.length; i += 1) { - each_blocks_1[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); + for (let i = 0; i < each_value_5.length; i += 1) { + each_blocks_1[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i)); } const out = (i) => transition_out(each_blocks_1[i], 1, 1, () => { each_blocks_1[i] = null; }); let dialog_props = { - $$slots: { default: [create_default_slot_6] }, + $$slots: { default: [create_default_slot_7] }, $$scope: { ctx } }; dialog = new Dialog_default({ props: dialog_props }); ctx[51](dialog); - let each_value_3 = ctx[7].blacklist; + let each_value_4 = ctx[7].blacklist; let each_blocks = []; - for (let i = 0; i < each_value_3.length; i += 1) { - each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); + for (let i = 0; i < each_value_4.length; i += 1) { + each_blocks[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); } const out_1 = (i) => transition_out(each_blocks[i], 1, 1, () => { each_blocks[i] = null; @@ -22347,9 +22439,9 @@ t13 = space(); input1 = element("input"); attr(input0, "type", "checkbox"); - attr(div0, "class", "tagcont svelte-10fwss6"); - attr(hr, "class", "svelte-10fwss6"); - attr(div1, "class", "tagcont svelte-10fwss6"); + attr(div0, "class", "tagcont svelte-1pjjwl2"); + attr(hr, "class", "svelte-1pjjwl2"); + attr(div1, "class", "tagcont svelte-1pjjwl2"); attr(input1, "placeholder", "Press enter after typing your tag"); }, m(target, anchor) { @@ -22423,48 +22515,48 @@ if_block1 = null; } if (dirty[0] & 73856) { - each_value_4 = ctx2[7].rsources; + each_value_5 = ctx2[7].rsources; let i; - for (i = 0; i < each_value_4.length; i += 1) { - const child_ctx = get_each_context_4(ctx2, each_value_4, i); + for (i = 0; i < each_value_5.length; i += 1) { + const child_ctx = get_each_context_5(ctx2, each_value_5, i); if (each_blocks_1[i]) { each_blocks_1[i].p(child_ctx, dirty); transition_in(each_blocks_1[i], 1); } else { - each_blocks_1[i] = create_each_block_4(child_ctx); + each_blocks_1[i] = create_each_block_5(child_ctx); each_blocks_1[i].c(); transition_in(each_blocks_1[i], 1); each_blocks_1[i].m(div0, null); } } group_outros(); - for (i = each_value_4.length; i < each_blocks_1.length; i += 1) { + for (i = each_value_5.length; i < each_blocks_1.length; i += 1) { out(i); } check_outros(); } const dialog_changes = {}; - if (dirty[0] & 2 | dirty[2] & 512) { + if (dirty[0] & 2 | dirty[2] & 8192) { dialog_changes.$$scope = { dirty, ctx: ctx2 }; } dialog.$set(dialog_changes); if (dirty[0] & 4224) { - each_value_3 = ctx2[7].blacklist; + each_value_4 = ctx2[7].blacklist; let i; - for (i = 0; i < each_value_3.length; i += 1) { - const child_ctx = get_each_context_3(ctx2, each_value_3, i); + for (i = 0; i < each_value_4.length; i += 1) { + const child_ctx = get_each_context_4(ctx2, each_value_4, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { - each_blocks[i] = create_each_block_3(child_ctx); + each_blocks[i] = create_each_block_4(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(div1, null); } } group_outros(); - for (i = each_value_3.length; i < each_blocks.length; i += 1) { + for (i = each_value_4.length; i < each_blocks.length; i += 1) { out_1(i); } check_outros(); @@ -22473,11 +22565,11 @@ i(local) { if (current) return; - for (let i = 0; i < each_value_4.length; i += 1) { + for (let i = 0; i < each_value_5.length; i += 1) { transition_in(each_blocks_1[i]); } transition_in(dialog.$$.fragment, local); - for (let i = 0; i < each_value_3.length; i += 1) { + for (let i = 0; i < each_value_4.length; i += 1) { transition_in(each_blocks[i]); } current = true; @@ -22559,9 +22651,9 @@ a = element("a"); a.textContent = "?"; attr(input, "type", "number"); - attr(input, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); attr(a, "title", "Higher will filter more potentially different images, lower will let more identical images through"); - attr(label, "class", "svelte-10fwss6"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, label, anchor); @@ -22603,21 +22695,21 @@ } }; } - function create_each_block_4(ctx) { + function create_each_block_5(ctx) { let tag; let current; function func(...args) { - return ctx[43](ctx[69], ...args); + return ctx[43](ctx[73], ...args); } function remove_handler() { - return ctx[44](ctx[69]); + return ctx[44](ctx[73]); } function toggle_handler() { - return ctx[45](ctx[69]); + return ctx[45](ctx[73]); } tag = new Tag_default({ props: { - tag: ctx[69].name, + tag: ctx[73].name, toggleable: true, toggled: !ctx[7].rsources.find(func)?.disabled } @@ -22636,7 +22728,7 @@ ctx = new_ctx; const tag_changes = {}; if (dirty[0] & 128) - tag_changes.tag = ctx[69].name; + tag_changes.tag = ctx[73].name; if (dirty[0] & 128) tag_changes.toggled = !ctx[7].rsources.find(func)?.disabled; tag.$set(tag_changes); @@ -22656,7 +22748,7 @@ } }; } - function create_default_slot_6(ctx) { + function create_default_slot_7(ctx) { let div; let label0; let t0; @@ -22700,21 +22792,21 @@ button.textContent = "Add"; attr(input0, "type", "text"); attr(input0, "placeholder", "Safebooru"); - attr(input0, "class", "svelte-10fwss6"); - attr(label0, "class", "svelte-10fwss6"); + attr(input0, "class", "svelte-1pjjwl2"); + attr(label0, "class", "svelte-1pjjwl2"); attr(input1, "type", "text"); attr(input1, "placeholder", "safebooru.com"); - attr(input1, "class", "svelte-10fwss6"); - attr(label1, "class", "svelte-10fwss6"); + attr(input1, "class", "svelte-1pjjwl2"); + attr(label1, "class", "svelte-1pjjwl2"); attr(input2, "type", "text"); attr(input2, "placeholder", "/post.json?tags=md5:"); - attr(input2, "class", "svelte-10fwss6"); - attr(label2, "class", "svelte-10fwss6"); + attr(input2, "class", "svelte-1pjjwl2"); + attr(label2, "class", "svelte-1pjjwl2"); attr(input3, "type", "text"); attr(input3, "placeholder", "https://safebooru.com/post/show/"); - attr(input3, "class", "svelte-10fwss6"); - attr(label3, "class", "svelte-10fwss6"); - attr(div, "class", "form svelte-10fwss6"); + attr(input3, "class", "svelte-1pjjwl2"); + attr(label3, "class", "svelte-1pjjwl2"); + attr(div, "class", "form svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div, anchor); @@ -22772,13 +22864,13 @@ } }; } - function create_each_block_3(ctx) { + function create_each_block_4(ctx) { let tag; let current; function toggle_handler_1() { - return ctx[52](ctx[67]); + return ctx[52](ctx[71]); } - tag = new Tag_default({ props: { tag: ctx[67] } }); + tag = new Tag_default({ props: { tag: ctx[71] } }); tag.$on("toggle", toggle_handler_1); return { c() { @@ -22792,7 +22884,7 @@ ctx = new_ctx; const tag_changes = {}; if (dirty[0] & 128) - tag_changes.tag = ctx[67]; + tag_changes.tag = ctx[71]; tag.$set(tag_changes); }, i(local) { @@ -22810,7 +22902,7 @@ } }; } - function create_default_slot_5(ctx) { + function create_default_slot_6(ctx) { let label; let input; let t0; @@ -22894,16 +22986,16 @@ } }; } - function create_each_block_2(ctx) { + function create_each_block_3(ctx) { let option; - let t_value = ctx[64].domain + ""; + let t_value = ctx[68].domain + ""; let t; let option_value_value; return { c() { option = element("option"); t = text(t_value); - option.__value = option_value_value = ctx[66]; + option.__value = option_value_value = ctx[70]; option.value = option.__value; }, m(target, anchor) { @@ -22917,7 +23009,7 @@ } }; } - function create_default_slot_4(ctx) { + function create_default_slot_5(ctx) { let p; let t1; let select; @@ -22927,10 +23019,10 @@ let input; let mounted; let dispose; - let each_value_2 = filehosts; + let each_value_3 = filehosts; let each_blocks = []; - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); + for (let i = 0; i < each_value_3.length; i += 1) { + each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); } return { c() { @@ -22948,8 +23040,8 @@ if (ctx[7].fhost === void 0) add_render_callback(() => ctx[54].call(select)); attr(input, "type", "number"); - attr(input, "class", "svelte-10fwss6"); - attr(label, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, p, anchor); @@ -22974,14 +23066,14 @@ }, p(ctx2, dirty) { if (dirty & 0) { - each_value_2 = filehosts; + each_value_3 = filehosts; let i; - for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_2(ctx2, each_value_2, i); + for (i = 0; i < each_value_3.length; i += 1) { + const child_ctx = get_each_context_3(ctx2, each_value_3, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_2(child_ctx); + each_blocks[i] = create_each_block_3(child_ctx); each_blocks[i].c(); each_blocks[i].m(select, null); } @@ -22989,7 +23081,7 @@ for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value_2.length; + each_blocks.length = each_value_3.length; } if (dirty[0] & 128) { select_option(select, ctx2[7].fhost); @@ -23036,10 +23128,10 @@ let div; let p; let t1; - let each_value_1 = ctx[6]; + let each_value_2 = ctx[6]; let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i)); + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); } return { c() { @@ -23050,7 +23142,7 @@ for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - attr(div, "class", "bepis svelte-10fwss6"); + attr(div, "class", "bepis svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div, anchor); @@ -23062,14 +23154,14 @@ }, p(ctx2, dirty) { if (dirty[0] & 16448) { - each_value_1 = ctx2[6]; + each_value_2 = ctx2[6]; let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_12(ctx2, each_value_1, i); + for (i = 0; i < each_value_2.length; i += 1) { + const child_ctx = get_each_context_2(ctx2, each_value_2, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_12(child_ctx); + each_blocks[i] = create_each_block_2(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, null); } @@ -23077,7 +23169,7 @@ for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value_1.length; + each_blocks.length = each_value_2.length; } }, d(detaching) { @@ -23087,18 +23179,18 @@ } }; } - function create_each_block_12(ctx) { + function create_each_block_2(ctx) { let div; let a; let t0; - let t1_value = ctx[61].id + ""; + let t1_value = ctx[65].id + ""; let t1; let a_href_value; let t2; - let t3_value = ctx[61].pees + ""; + let t3_value = ctx[65].pees + ""; let t3; let t4; - let t5_value = ctx[61].eyes + ctx[61].other + ""; + let t5_value = ctx[65].eyes + ctx[65].other + ""; let t5; let t6; return { @@ -23112,7 +23204,7 @@ t4 = text(" / "); t5 = text(t5_value); t6 = text(")\n "); - attr(a, "href", a_href_value = "https://boards.4chan.org/" + ctx[14] + "/thread/" + ctx[61].id); + attr(a, "href", a_href_value = "https://boards.4chan.org/" + ctx[14] + "/thread/" + ctx[65].id); attr(div, "class", "mbepis"); }, m(target, anchor) { @@ -23127,14 +23219,14 @@ append(div, t6); }, p(ctx2, dirty) { - if (dirty[0] & 64 && t1_value !== (t1_value = ctx2[61].id + "")) + if (dirty[0] & 64 && t1_value !== (t1_value = ctx2[65].id + "")) set_data(t1, t1_value); - if (dirty[0] & 64 && a_href_value !== (a_href_value = "https://boards.4chan.org/" + ctx2[14] + "/thread/" + ctx2[61].id)) { + if (dirty[0] & 64 && a_href_value !== (a_href_value = "https://boards.4chan.org/" + ctx2[14] + "/thread/" + ctx2[65].id)) { attr(a, "href", a_href_value); } - if (dirty[0] & 64 && t3_value !== (t3_value = ctx2[61].pees + "")) + if (dirty[0] & 64 && t3_value !== (t3_value = ctx2[65].pees + "")) set_data(t3, t3_value); - if (dirty[0] & 64 && t5_value !== (t5_value = ctx2[61].eyes + ctx2[61].other + "")) + if (dirty[0] & 64 && t5_value !== (t5_value = ctx2[65].eyes + ctx2[65].other + "")) set_data(t5, t5_value); }, d(detaching) { @@ -23143,7 +23235,7 @@ } }; } - function create_default_slot_3(ctx) { + function create_default_slot_4(ctx) { let label; let input; let t0; @@ -23219,10 +23311,10 @@ } function create_else_block2(ctx) { let each_1_anchor; - let each_value = ctx[3]; + let each_value_1 = ctx[3]; let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i)); } return { c() { @@ -23239,14 +23331,14 @@ }, p(ctx2, dirty) { if (dirty[0] & 8) { - each_value = ctx2[3]; + each_value_1 = ctx2[3]; let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context2(ctx2, each_value, i); + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_12(ctx2, each_value_1, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block2(child_ctx); + each_blocks[i] = create_each_block_12(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } @@ -23254,7 +23346,7 @@ for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value.length; + each_blocks.length = each_value_1.length; } }, d(detaching) { @@ -23281,13 +23373,13 @@ } }; } - function create_each_block2(ctx) { + function create_each_block_12(ctx) { let h3; - let t0_value = ctx[58].title + ""; + let t0_value = ctx[62].title + ""; let t0; let t1; let p; - let t2_value = ctx[58].content + ""; + let t2_value = ctx[62].content + ""; let t2; return { c() { @@ -23305,9 +23397,9 @@ append(p, t2); }, p(ctx2, dirty) { - if (dirty[0] & 8 && t0_value !== (t0_value = ctx2[58].title + "")) + if (dirty[0] & 8 && t0_value !== (t0_value = ctx2[62].title + "")) set_data(t0, t0_value); - if (dirty[0] & 8 && t2_value !== (t2_value = ctx2[58].content + "")) + if (dirty[0] & 8 && t2_value !== (t2_value = ctx2[62].content + "")) set_data(t2, t2_value); }, d(detaching) { @@ -23320,7 +23412,7 @@ } }; } - function create_default_slot_2(ctx) { + function create_default_slot_3(ctx) { let p; let t2; let div; @@ -23338,7 +23430,7 @@ t2 = space(); div = element("div"); if_block.c(); - attr(div, "class", "newsbox svelte-10fwss6"); + attr(div, "class", "newsbox svelte-1pjjwl2"); }, m(target, anchor) { insert(target, p, anchor); @@ -23369,6 +23461,80 @@ } }; } + function create_each_block2(ctx) { + let option; + let t0; + let t1; + let option_value_value; + return { + c() { + option = element("option"); + t0 = text("Method "); + t1 = text(ctx[59]); + option.__value = option_value_value = ctx[59]; + option.value = option.__value; + }, + m(target, anchor) { + insert(target, option, anchor); + append(option, t0); + append(option, t1); + }, + p: noop, + d(detaching) { + if (detaching) + detach(option); + } + }; + } + function create_default_slot_2(ctx) { + let label; + let t; + let select; + let mounted; + let dispose; + let each_value = [0, 1, 2, 3, 4]; + let each_blocks = []; + for (let i = 0; i < 5; i += 1) { + each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); + } + return { + c() { + label = element("label"); + t = text("PNG Embedding method\n "); + select = element("select"); + for (let i = 0; i < 5; i += 1) { + each_blocks[i].c(); + } + if (ctx[7].pmeth === void 0) + add_render_callback(() => ctx[57].call(select)); + }, + m(target, anchor) { + insert(target, label, anchor); + append(label, t); + append(label, select); + for (let i = 0; i < 5; i += 1) { + each_blocks[i].m(select, null); + } + select_option(select, ctx[7].pmeth); + if (!mounted) { + dispose = listen(select, "change", ctx[57]); + mounted = true; + } + }, + p(ctx2, dirty) { + if (dirty[0] & 128) { + select_option(select, ctx2[7].pmeth); + } + }, + d(detaching) { + if (detaching) + detach(label); + destroy_each(each_blocks, detaching); + mounted = false; + dispose(); + } + }; + } function create_if_block_12(ctx) { let tabpanel; let current; @@ -23441,39 +23607,47 @@ let t4; let tabpanel4; let t5; + let tabpanel5; + let t6; let if_block_anchor; let current; tablist = new TabList_default({ props: { - $$slots: { default: [create_default_slot_8] }, + $$slots: { default: [create_default_slot_9] }, $$scope: { ctx } } }); tabpanel0 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_7] }, + $$slots: { default: [create_default_slot_8] }, $$scope: { ctx } } }); tabpanel1 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_5] }, + $$slots: { default: [create_default_slot_6] }, $$scope: { ctx } } }); tabpanel2 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_4] }, + $$slots: { default: [create_default_slot_5] }, $$scope: { ctx } } }); tabpanel3 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_3] }, + $$slots: { default: [create_default_slot_4] }, $$scope: { ctx } } }); tabpanel4 = new TabPanel_default({ + props: { + $$slots: { default: [create_default_slot_3] }, + $$scope: { ctx } + } + }); + tabpanel5 = new TabPanel_default({ props: { $$slots: { default: [create_default_slot_2] }, $$scope: { ctx } @@ -23494,6 +23668,8 @@ t4 = space(); create_component(tabpanel4.$$.fragment); t5 = space(); + create_component(tabpanel5.$$.fragment); + t6 = space(); if (if_block) if_block.c(); if_block_anchor = empty(); @@ -23511,6 +23687,8 @@ insert(target, t4, anchor); mount_component(tabpanel4, target, anchor); insert(target, t5, anchor); + mount_component(tabpanel5, target, anchor); + insert(target, t6, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); @@ -23518,35 +23696,40 @@ }, p(ctx2, dirty) { const tablist_changes = {}; - if (dirty[0] & 256 | dirty[2] & 512) { + if (dirty[0] & 256 | dirty[2] & 8192) { tablist_changes.$$scope = { dirty, ctx: ctx2 }; } tablist.$set(tablist_changes); const tabpanel0_changes = {}; - if (dirty[0] & 896 | dirty[2] & 512) { + if (dirty[0] & 896 | dirty[2] & 8192) { tabpanel0_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel0.$set(tabpanel0_changes); const tabpanel1_changes = {}; - if (dirty[0] & 134 | dirty[2] & 512) { + if (dirty[0] & 134 | dirty[2] & 8192) { tabpanel1_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel1.$set(tabpanel1_changes); const tabpanel2_changes = {}; - if (dirty[0] & 128 | dirty[2] & 512) { + if (dirty[0] & 128 | dirty[2] & 8192) { tabpanel2_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel2.$set(tabpanel2_changes); const tabpanel3_changes = {}; - if (dirty[0] & 224 | dirty[2] & 512) { + if (dirty[0] & 224 | dirty[2] & 8192) { tabpanel3_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel3.$set(tabpanel3_changes); const tabpanel4_changes = {}; - if (dirty[0] & 8 | dirty[2] & 512) { + if (dirty[0] & 8 | dirty[2] & 8192) { tabpanel4_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel4.$set(tabpanel4_changes); + const tabpanel5_changes = {}; + if (dirty[0] & 128 | dirty[2] & 8192) { + tabpanel5_changes.$$scope = { dirty, ctx: ctx2 }; + } + tabpanel5.$set(tabpanel5_changes); if (ctx2[8].akValid) { if (if_block) { if (dirty[0] & 256) { @@ -23575,6 +23758,7 @@ transition_in(tabpanel2.$$.fragment, local); transition_in(tabpanel3.$$.fragment, local); transition_in(tabpanel4.$$.fragment, local); + transition_in(tabpanel5.$$.fragment, local); transition_in(if_block); current = true; }, @@ -23585,6 +23769,7 @@ transition_out(tabpanel2.$$.fragment, local); transition_out(tabpanel3.$$.fragment, local); transition_out(tabpanel4.$$.fragment, local); + transition_out(tabpanel5.$$.fragment, local); transition_out(if_block); current = false; }, @@ -23607,6 +23792,9 @@ destroy_component(tabpanel4, detaching); if (detaching) detach(t5); + destroy_component(tabpanel5, detaching); + if (detaching) + detach(t6); if (if_block) if_block.d(detaching); if (detaching) @@ -23686,7 +23874,6 @@ function appendBooru() { if (true) { request(newbooru.domain); - alert("Requested! Please click the PEE icon to validate"); } set_store_value(settings, $settings.rsources = [...$settings.rsources, newbooru], $settings); dial.toggle(); @@ -23882,6 +24069,10 @@ $settings.tm = this.checked; settings.set($settings); } + function select_change_handler_1() { + $settings.pmeth = select_value(this); + settings.set($settings); + } $$self.$$set = ($$props2) => { if ("rev" in $$props2) $$invalidate(0, rev = $$props2.rev); @@ -23943,7 +24134,8 @@ keydown_handler, select_change_handler, input_input_handler_2, - input_change_handler_2 + input_change_handler_2, + select_change_handler_1 ]; } var App = class extends SvelteComponent { @@ -25396,7 +25588,7 @@ yield post.querySelector("a[rel]")?.getAttribute("href") || ""; }, getFilename: (post) => { - const opfn = post.querySelector("a.post_file_filename")?.textContent; + const opfn = post.querySelector(".post_file_filename")?.textContent; if (opfn) return opfn; const a = post.querySelector("a[rel]"); @@ -26624,10 +26816,12 @@ if (!supportedMainDomain(location.host) && !supportedAltDomain(location.host)) throw "PEE not supported here, skipping"; var qp; - var csettings6 = initial_settings; + var csettings5; var processors = [thirdeye_default, pomf_default, pngv3_default, jpg_default, webm_default, gif_default]; var cappState; settings.subscribe(async (b) => { + if (!b) + return; if (b.hyd) { if (b.ak) { const hydCli = new HydrusClient(b.ak); @@ -26644,9 +26838,9 @@ } } } - csettings6 = b; + csettings5 = b; processors = [ - ...!csettings6.te ? [thirdeye_default] : [], + ...!csettings5.te ? [thirdeye_default] : [], pngv3_default, pomf_default, jpg_default, @@ -26708,7 +26902,9 @@ var textToElement = (s) => document.createRange().createContextualFragment(s).children[0]; var pendingPosts = []; var signalNewEmbeds = debounce(async () => { - if (!csettings6.tm) + if (!csettings5) + return; + if (!csettings5.tm) return; try { const boardname = location.pathname.match(/\/([^/]*)\//)[1]; @@ -26730,7 +26926,9 @@ var shouldUseCache = () => { if (cappState.isCatalog) return false; - return typeof csettings6.cache == "boolean" ? csettings6.cache : location.hostname.includes("b4k"); + if (!csettings5) + return false; + return typeof csettings5.cache == "boolean" ? csettings5.cache : location.hostname.includes("b4k"); }; var processPost = async (post) => { const origlink = qp.getImageLink(post); @@ -26741,7 +26939,9 @@ return; let res2 = void 0; const reportEmbed = () => { - if (csettings6.tm) { + if (!csettings5) + return false; + if (csettings5.tm) { if (["boards.4chan.org", "boards.4channel.org"].includes(location.host)) { if (!cappState.isCatalog) { const op = +location.pathname.match(/\/thread\/(.*)/)[1]; @@ -26788,7 +26988,9 @@ navigator.clipboard.writeText(text3); } var scrapeBoard = async (self) => { - if (csettings6.tm) { + if (!csettings5) + return false; + if (csettings5.tm) { fireNotification("success", "Scrapping board with telemetry on! Thank you for your service, selfless stranger ;_;7"); } self.disabled = true; @@ -26916,7 +27118,15 @@ Use the WebExtension version of PEE if you want to use b4k!`); return; else qp = lqp; - if (csettings6.vercheck) + await new Promise((_) => { + settings.subscribe((val) => { + if (val) + _(); + }); + }); + if (!csettings5) + return false; + if (csettings5.vercheck) versionCheck(); const postQuote = ({ scanner, parser, utils }) => { const { CLOSEANGLEBRACKET: CLOSEANGLEBRACKET2, NUM: NUM2 } = scanner.tokens; @@ -26967,7 +27177,9 @@ Use the WebExtension version of PEE if you want to use b4k!`); rec.addedNodes.forEach((e) => { if (!(e instanceof HTMLElement)) return; - if (cappState.isCatalog && csettings6.notcata) + if (!csettings5) + return false; + if (cappState.isCatalog && csettings5.notcata) return; let el = qp.postsWithFiles(e); if (!el && e.classList.contains("postContainer")) @@ -27029,7 +27241,7 @@ Use the WebExtension version of PEE if you want to use b4k!`); button2.onclick = () => scrapeBoard(button2); opts.insertAdjacentElement("beforebegin", button2); } - if (csettings6.notcata) + if (csettings5.notcata) return; } const n = 7; diff --git a/chrome/manifest.json b/chrome/manifest.json index c2c0b3d..315b1b9 100644 --- a/chrome/manifest.json +++ b/chrome/manifest.json @@ -2,11 +2,13 @@ "manifest_version": 3, "name": "PngExtraEmbedder", "description": "Discover embedded files on 4chan and archives!", - "version": "0.273", + "version": "0.275", "icons": { "64": "1449696017588.png" }, - "permissions": [], + "permissions": [ + "storage" + ], "host_permissions": [ "" ], diff --git a/dist/main.js b/dist/main.js index 24bb519..111ab2b 100644 --- a/dist/main.js +++ b/dist/main.js @@ -73,7 +73,7 @@ var define_BUILD_VERSION_default; var init_define_BUILD_VERSION = __esm({ ""() { - define_BUILD_VERSION_default = [0, 273]; + define_BUILD_VERSION_default = [0, 275]; } }); @@ -13954,12 +13954,33 @@ } // src/stores.ts - var localLoad = (key2, def) => "__pee__" + key2 in localStorage ? JSON.parse(localStorage.getItem("__pee__" + key2)) : def; - var localSet = (key2, value) => localStorage.setItem("__pee__" + key2, JSON.stringify(value)); + var localLoad = async (key2, def) => { + const isinls = "__pee__" + key2 in localStorage; + const ret = isinls ? { ...def, ...JSON.parse(localStorage.getItem("__pee__" + key2)) } : def; + if (false) { + if (isinls) { + delete localStorage["__pee__" + key2]; + await chrome.storage.local.set({ + [key2]: JSON.stringify(ret) + }); + } else { + const d = await chrome.storage.local.get([key2]); + if (typeof d[key2] == "string") + return { ...def, ...await JSON.parse("" + d[key2] || "{}") }; + } + } + return ret; + }; + var localSet = (key2, value) => { + if (false) + chrome.storage.local.set({ [key2]: JSON.stringify(value) }); + else + localStorage.setItem("__pee__" + key2, JSON.stringify(value)); + }; var initial_settings = localLoad("settingsv2", { - ...localLoad("settings", {}), loop: true, dh: false, + pmeth: 4, xpv: false, xpi: false, hyd: false, @@ -13988,10 +14009,12 @@ conc: 8, ho: false, blacklist: [], - rsources: [], - ...localLoad("settingsv2", {}) + rsources: [] + }); + var settings = writable(); + initial_settings.then((v) => { + settings.set(v); }); - var settings = writable(initial_settings); var appState = writable({ isCatalog: false, is4chanX: false, @@ -14335,6 +14358,7 @@ "archived.moe", "archive.nyafuu.org", "arch.b4k.co", + "archive.4plebs.org", "archive.wakarimasen.moe", "b4k.co", "fireden.net", @@ -16397,6 +16421,8 @@ return threadDataCache; }; var getEmbedsFromCache = async (board, op, pid) => { + if (!csettings) + throw new Error("Settings uninit"); await getThreadDataCache(board, op); const target = +pid.slice(pid.match(/\d/).index); const cachedData = cthreadDataCache[target]; @@ -16436,6 +16462,8 @@ return ret; }; var decodeCoom3Payload = async (buff) => { + if (!csettings) + throw new Error("Settings uninit"); const allowed_domains = filehosts.map((e) => e.serving.replaceAll(".", "\\.")); const pees = buff.toString().split(" ").slice(0, csettings.maxe).filter((e) => allowed_domains.some((v) => e.match(`https://(.*\\.)?${v}/`))); return (await Promise.all(pees.map(async (pee) => { @@ -16513,6 +16541,8 @@ let total = 0; fireNotification("info", `Uploading ${injs.length} files...`); return await Promise.all(injs.map(async (inj) => { + if (!csettings) + throw new Error("Settings uninit"); const peefile = await buildPeeFile(inj); const ret = await filehosts[csettings.fhost || 0].uploadFile(peefile); fireNotification("info", `Uploaded files [${++total}/${injs.length}] ${ret}`); @@ -16643,6 +16673,8 @@ const sneed = new PNGDecoder(reader); const ret = []; let w; + if (!csettings2) + throw new Error("Settings uninit"); try { for await (const [name, chunk, crc, offset] of sneed.chunks()) { let buff; @@ -16718,6 +16750,8 @@ return [ret, () => b]; }; var inject_data = async (container, injb) => { + if (!csettings2) + throw new Error("Settings uninit"); let magic4 = false; const [writestream, extract7] = BufferWriteStream2(); const encoder = new PNGEncoder(writestream); @@ -16727,7 +16761,24 @@ break; if (!magic4 && name == "IDAT") { const passed = import_buffer3.Buffer.from(injb); - await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM7, passed])), () => Promise.resolve(0), 0]); + switch (csettings2.pmeth) { + case 0: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM3, passed])), () => Promise.resolve(0), 0]); + break; + case 1: + xor(passed, password); + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM4, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 2: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM5, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 3: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM6, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 4: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM7, import_buffer3.Buffer.from(bs58.encode(passed))])), () => Promise.resolve(0), 0]); + break; + } magic4 = true; } await encoder.insertchunk([name, chunk, crc, offset]); @@ -16750,7 +16801,7 @@ } return ""; }); - const injb = import_buffer3.Buffer.from(bs58.encode(import_buffer3.Buffer.from(links.join(" ")))); + const injb = import_buffer3.Buffer.from(links.join(" ")); return inject_data(container, injb); }; var has_embed = async (png) => { @@ -18726,10 +18777,6 @@ }; // src/jpg.ts - var csettings3; - settings.subscribe((b) => { - csettings3 = b; - }); var key = import_buffer6.Buffer.from("CUNNYCUNNYCUNNY"); var f5inst = new f5stego(key); var inject4 = async (b, links) => { @@ -18827,9 +18874,9 @@ }; // src/thirdeye.ts - var csettings4; + var csettings3; settings.subscribe((b) => { - csettings4 = b; + csettings3 = b; }); var gelquirk = (prefix) => (a) => { let base = a.post || a.data || a; @@ -18850,6 +18897,8 @@ var phashEn = false; var mindist = 5; settings.subscribe((s) => { + if (!s) + return; experimentalApi = s.expte; boorus = s.rsources.map((e) => ({ ...e, @@ -18859,10 +18908,7 @@ mindist = s.mdist || 5; phashEn = s.phash; }); - var boorus = localLoad("settingsv2", { rsources: [] }).rsources.map((e) => ({ - ...e, - quirks: gelquirk(e.view) - })); + var boorus = []; var unlockQueue = Promise.resolve(); var cache = {}; var findFileFrom = async (b, hex, abort) => { @@ -18885,6 +18931,8 @@ } }; var extract5 = async (b, fn) => { + if (!csettings3) + throw new Error("Settings uninit"); let result; let booru; for (const e of Object.values(boorus)) { @@ -18906,8 +18954,8 @@ url: result[0].page }, filename: fn.substring(0, 33) + result[0].ext, - thumbnail: csettings4.hotlink ? prev || full : import_buffer7.Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), - data: csettings4.hotlink ? full || prev : async (lsn) => { + thumbnail: csettings3.hotlink ? prev || full : import_buffer7.Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), + data: csettings3.hotlink ? full || prev : async (lsn) => { if (!cachedFile) cachedFile = await (await ifetch(full || prev, void 0, lsn)).arrayBuffer(); return import_buffer7.Buffer.from(cachedFile); @@ -18973,9 +19021,9 @@ { host: "Litter", prefix: "litter.catbox.moe/" }, { host: "Zzzz", prefix: "z.zz.fo/" } ]; - var csettings5; + var csettings4; settings.subscribe((b) => { - csettings5 = b; + csettings4 = b; }); var getExt = (fn) => { const isB64 = fn.match(/^((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=))?\.(gif|jpe?g|png|webm)/); @@ -19001,6 +19049,8 @@ return { ext, source }; }; var extract6 = async (b, fn) => { + if (!csettings4) + throw new Error("Settings uninit"); const { ext, source } = getExt(fn); let rsource; for (const cs of sources) { @@ -19015,7 +19065,7 @@ } return [{ filename: ext, - data: csettings5.hotlink ? rsource : async (lsn) => { + data: csettings4.hotlink ? rsource : async (lsn) => { try { return import_buffer8.Buffer.from(await (await ifetch(rsource, void 0, lsn)).arrayBuffer()); } catch (e) { @@ -21037,34 +21087,39 @@ // src/Components/App.svelte function add_css8(target) { - append_styles(target, "svelte-10fwss6", '.bepis.svelte-10fwss6.svelte-10fwss6{max-height:260px;overflow-y:auto}.tagcont.svelte-10fwss6.svelte-10fwss6{display:flex;gap:5px;margin-bottom:10px;flex-wrap:wrap}label.svelte-10fwss6>input[type="text"].svelte-10fwss6,label.svelte-10fwss6>input[type="number"].svelte-10fwss6{width:95%}.content.svelte-10fwss6.svelte-10fwss6{display:flex;flex-direction:column}.error.svelte-10fwss6.svelte-10fwss6{color:red}hr.svelte-10fwss6.svelte-10fwss6{width:100%}h1.svelte-10fwss6.svelte-10fwss6{text-align:center;margin-bottom:0}h4.svelte-10fwss6.svelte-10fwss6{text-align:center;margin:0}.form.svelte-10fwss6.svelte-10fwss6{display:flex;flex-direction:column;gap:20px;position:absolute;padding:15px;border:1px solid white;background-color:black;border-radius:10px}.form.svelte-10fwss6>label.svelte-10fwss6{display:flex;flex-direction:column;gap:10px}.newsbox.svelte-10fwss6.svelte-10fwss6{max-height:300px;overflow-y:scroll}.backpanel.svelte-10fwss6.svelte-10fwss6{position:absolute;right:32px;padding:10px;width:15%;top:32px;border:1px solid;border-radius:5px;background-color:rgba(0, 0, 0, 0.8);pointer-events:all;backdrop-filter:blur(9px);max-height:80vh;min-width:321px}'); + append_styles(target, "svelte-1pjjwl2", '.bepis.svelte-1pjjwl2.svelte-1pjjwl2{max-height:260px;overflow-y:auto}.tagcont.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;gap:5px;margin-bottom:10px;flex-wrap:wrap}label.svelte-1pjjwl2>input[type="text"].svelte-1pjjwl2,label.svelte-1pjjwl2>input[type="number"].svelte-1pjjwl2{width:95%}.content.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;flex-direction:column}.error.svelte-1pjjwl2.svelte-1pjjwl2{color:red}hr.svelte-1pjjwl2.svelte-1pjjwl2{width:100%}h1.svelte-1pjjwl2.svelte-1pjjwl2{text-align:center;margin-bottom:0}h4.svelte-1pjjwl2.svelte-1pjjwl2{text-align:center;margin:0}.form.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;flex-direction:column;gap:20px;position:absolute;padding:15px;border:1px solid white;background-color:black;border-radius:10px}.form.svelte-1pjjwl2>label.svelte-1pjjwl2{display:flex;flex-direction:column;gap:10px}.newsbox.svelte-1pjjwl2.svelte-1pjjwl2{max-height:300px;overflow-y:scroll}.backpanel.svelte-1pjjwl2.svelte-1pjjwl2{position:absolute;right:32px;padding:10px;width:15%;top:32px;border:1px solid;border-radius:5px;background-color:rgba(0, 0, 0, 0.8);pointer-events:all;backdrop-filter:blur(9px);max-height:80vh;min-width:321px}'); } function get_each_context2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[58] = list[i]; + child_ctx[59] = list[i]; return child_ctx; } function get_each_context_12(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[61] = list[i]; + child_ctx[62] = list[i]; return child_ctx; } function get_each_context_2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[64] = list[i]; - child_ctx[66] = i; + child_ctx[65] = list[i]; return child_ctx; } function get_each_context_3(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[67] = list[i]; - child_ctx[66] = i; + child_ctx[68] = list[i]; + child_ctx[70] = i; return child_ctx; } function get_each_context_4(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[69] = list[i]; - child_ctx[66] = i; + child_ctx[71] = list[i]; + child_ctx[70] = i; + return child_ctx; + } + function get_each_context_5(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[73] = list[i]; + child_ctx[70] = i; return child_ctx; } function create_if_block6(ctx) { @@ -21101,11 +21156,11 @@ hr = element("hr"); t5 = space(); create_component(tabs.$$.fragment); - attr(h1, "class", "svelte-10fwss6"); - attr(h4, "class", "svelte-10fwss6"); - attr(hr, "class", "svelte-10fwss6"); - attr(div0, "class", "content svelte-10fwss6"); - attr(div1, "class", "backpanel svelte-10fwss6"); + attr(h1, "class", "svelte-1pjjwl2"); + attr(h4, "class", "svelte-1pjjwl2"); + attr(hr, "class", "svelte-1pjjwl2"); + attr(div0, "class", "content svelte-1pjjwl2"); + attr(div1, "class", "backpanel svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div1, anchor); @@ -21125,7 +21180,7 @@ if (!current || dirty[0] & 1) set_data(t1, ctx2[0]); const tabs_changes = {}; - if (dirty[0] & 1006 | dirty[2] & 512) { + if (dirty[0] & 1006 | dirty[2] & 8192) { tabs_changes.$$scope = { dirty, ctx: ctx2 }; } tabs.$set(tabs_changes); @@ -21157,7 +21212,7 @@ } }; } - function create_default_slot_14(ctx) { + function create_default_slot_16(ctx) { let t; return { c() { @@ -21172,7 +21227,7 @@ } }; } - function create_default_slot_13(ctx) { + function create_default_slot_15(ctx) { let t; return { c() { @@ -21187,7 +21242,7 @@ } }; } - function create_default_slot_12(ctx) { + function create_default_slot_14(ctx) { let t; return { c() { @@ -21202,7 +21257,7 @@ } }; } - function create_default_slot_11(ctx) { + function create_default_slot_13(ctx) { let t; return { c() { @@ -21217,7 +21272,7 @@ } }; } - function create_default_slot_10(ctx) { + function create_default_slot_12(ctx) { let t; return { c() { @@ -21232,12 +21287,27 @@ } }; } + function create_default_slot_11(ctx) { + let t; + return { + c() { + t = text("Advanced"); + }, + m(target, anchor) { + insert(target, t, anchor); + }, + d(detaching) { + if (detaching) + detach(t); + } + }; + } function create_if_block_11(ctx) { let tab; let current; tab = new Tab_default({ props: { - $$slots: { default: [create_default_slot_9] }, + $$slots: { default: [create_default_slot_10] }, $$scope: { ctx } } }); @@ -21264,7 +21334,7 @@ } }; } - function create_default_slot_9(ctx) { + function create_default_slot_10(ctx) { let t; return { c() { @@ -21279,7 +21349,7 @@ } }; } - function create_default_slot_8(ctx) { + function create_default_slot_9(ctx) { let tab0; let t0; let tab1; @@ -21290,40 +21360,48 @@ let t3; let tab4; let t4; + let tab5; + let t5; let if_block_anchor; let current; tab0 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_14] }, + $$slots: { default: [create_default_slot_16] }, $$scope: { ctx } } }); tab1 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_13] }, + $$slots: { default: [create_default_slot_15] }, $$scope: { ctx } } }); tab2 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_12] }, + $$slots: { default: [create_default_slot_14] }, $$scope: { ctx } } }); tab3 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_11] }, + $$slots: { default: [create_default_slot_13] }, $$scope: { ctx } } }); tab3.$on("select", ctx[18]); tab4 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_10] }, + $$slots: { default: [create_default_slot_12] }, $$scope: { ctx } } }); tab4.$on("select", ctx[19]); + tab5 = new Tab_default({ + props: { + $$slots: { default: [create_default_slot_11] }, + $$scope: { ctx } + } + }); let if_block = ctx[8].akValid && create_if_block_11(ctx); return { c() { @@ -21337,6 +21415,8 @@ t3 = space(); create_component(tab4.$$.fragment); t4 = space(); + create_component(tab5.$$.fragment); + t5 = space(); if (if_block) if_block.c(); if_block_anchor = empty(); @@ -21352,6 +21432,8 @@ insert(target, t3, anchor); mount_component(tab4, target, anchor); insert(target, t4, anchor); + mount_component(tab5, target, anchor); + insert(target, t5, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); @@ -21359,30 +21441,35 @@ }, p(ctx2, dirty) { const tab0_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab0_changes.$$scope = { dirty, ctx: ctx2 }; } tab0.$set(tab0_changes); const tab1_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab1_changes.$$scope = { dirty, ctx: ctx2 }; } tab1.$set(tab1_changes); const tab2_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab2_changes.$$scope = { dirty, ctx: ctx2 }; } tab2.$set(tab2_changes); const tab3_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab3_changes.$$scope = { dirty, ctx: ctx2 }; } tab3.$set(tab3_changes); const tab4_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab4_changes.$$scope = { dirty, ctx: ctx2 }; } tab4.$set(tab4_changes); + const tab5_changes = {}; + if (dirty[2] & 8192) { + tab5_changes.$$scope = { dirty, ctx: ctx2 }; + } + tab5.$set(tab5_changes); if (ctx2[8].akValid) { if (if_block) { if (dirty[0] & 256) { @@ -21410,6 +21497,7 @@ transition_in(tab2.$$.fragment, local); transition_in(tab3.$$.fragment, local); transition_in(tab4.$$.fragment, local); + transition_in(tab5.$$.fragment, local); transition_in(if_block); current = true; }, @@ -21419,6 +21507,7 @@ transition_out(tab2.$$.fragment, local); transition_out(tab3.$$.fragment, local); transition_out(tab4.$$.fragment, local); + transition_out(tab5.$$.fragment, local); transition_out(if_block); current = false; }, @@ -21438,6 +21527,9 @@ destroy_component(tab4, detaching); if (detaching) detach(t4); + destroy_component(tab5, detaching); + if (detaching) + detach(t5); if (if_block) if_block.d(detaching); if (detaching) @@ -21511,8 +21603,8 @@ if_block1_anchor = empty(); attr(a, "title", "Only requires Search Files permission. See Hydrus docs on where to set this up."); attr(input, "type", "text"); - attr(input, "class", "svelte-10fwss6"); - attr(label, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { if (if_block0) @@ -21588,7 +21680,7 @@ c() { span = element("span"); t = text(t_value); - attr(span, "class", "error svelte-10fwss6"); + attr(span, "class", "error svelte-1pjjwl2"); }, m(target, anchor) { insert(target, span, anchor); @@ -21625,12 +21717,12 @@ input1 = element("input"); set_style(input0, "width", "5ch"); attr(input0, "type", "number"); - attr(input0, "class", "svelte-10fwss6"); - attr(label0, "class", "svelte-10fwss6"); + attr(input0, "class", "svelte-1pjjwl2"); + attr(label0, "class", "svelte-1pjjwl2"); attr(input1, "placeholder", "Restrict to these tags (space to separate tags, _ to separate words)"); attr(input1, "type", "text"); - attr(input1, "class", "svelte-10fwss6"); - attr(label1, "class", "svelte-10fwss6"); + attr(input1, "class", "svelte-1pjjwl2"); + attr(label1, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, label0, anchor); @@ -21670,7 +21762,7 @@ } }; } - function create_default_slot_7(ctx) { + function create_default_slot_8(ctx) { let label0; let input0; let t0; @@ -22123,24 +22215,24 @@ let dispose; let if_block0 = ctx[7].phash && create_if_block_62(ctx); let if_block1 = ctx[7].rsources.length == 0 && create_if_block_52(ctx); - let each_value_4 = ctx[7].rsources; + let each_value_5 = ctx[7].rsources; let each_blocks_1 = []; - for (let i = 0; i < each_value_4.length; i += 1) { - each_blocks_1[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); + for (let i = 0; i < each_value_5.length; i += 1) { + each_blocks_1[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i)); } const out = (i) => transition_out(each_blocks_1[i], 1, 1, () => { each_blocks_1[i] = null; }); let dialog_props = { - $$slots: { default: [create_default_slot_6] }, + $$slots: { default: [create_default_slot_7] }, $$scope: { ctx } }; dialog = new Dialog_default({ props: dialog_props }); ctx[51](dialog); - let each_value_3 = ctx[7].blacklist; + let each_value_4 = ctx[7].blacklist; let each_blocks = []; - for (let i = 0; i < each_value_3.length; i += 1) { - each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); + for (let i = 0; i < each_value_4.length; i += 1) { + each_blocks[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); } const out_1 = (i) => transition_out(each_blocks[i], 1, 1, () => { each_blocks[i] = null; @@ -22182,9 +22274,9 @@ t13 = space(); input1 = element("input"); attr(input0, "type", "checkbox"); - attr(div0, "class", "tagcont svelte-10fwss6"); - attr(hr, "class", "svelte-10fwss6"); - attr(div1, "class", "tagcont svelte-10fwss6"); + attr(div0, "class", "tagcont svelte-1pjjwl2"); + attr(hr, "class", "svelte-1pjjwl2"); + attr(div1, "class", "tagcont svelte-1pjjwl2"); attr(input1, "placeholder", "Press enter after typing your tag"); }, m(target, anchor) { @@ -22258,48 +22350,48 @@ if_block1 = null; } if (dirty[0] & 73856) { - each_value_4 = ctx2[7].rsources; + each_value_5 = ctx2[7].rsources; let i; - for (i = 0; i < each_value_4.length; i += 1) { - const child_ctx = get_each_context_4(ctx2, each_value_4, i); + for (i = 0; i < each_value_5.length; i += 1) { + const child_ctx = get_each_context_5(ctx2, each_value_5, i); if (each_blocks_1[i]) { each_blocks_1[i].p(child_ctx, dirty); transition_in(each_blocks_1[i], 1); } else { - each_blocks_1[i] = create_each_block_4(child_ctx); + each_blocks_1[i] = create_each_block_5(child_ctx); each_blocks_1[i].c(); transition_in(each_blocks_1[i], 1); each_blocks_1[i].m(div0, null); } } group_outros(); - for (i = each_value_4.length; i < each_blocks_1.length; i += 1) { + for (i = each_value_5.length; i < each_blocks_1.length; i += 1) { out(i); } check_outros(); } const dialog_changes = {}; - if (dirty[0] & 2 | dirty[2] & 512) { + if (dirty[0] & 2 | dirty[2] & 8192) { dialog_changes.$$scope = { dirty, ctx: ctx2 }; } dialog.$set(dialog_changes); if (dirty[0] & 4224) { - each_value_3 = ctx2[7].blacklist; + each_value_4 = ctx2[7].blacklist; let i; - for (i = 0; i < each_value_3.length; i += 1) { - const child_ctx = get_each_context_3(ctx2, each_value_3, i); + for (i = 0; i < each_value_4.length; i += 1) { + const child_ctx = get_each_context_4(ctx2, each_value_4, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { - each_blocks[i] = create_each_block_3(child_ctx); + each_blocks[i] = create_each_block_4(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(div1, null); } } group_outros(); - for (i = each_value_3.length; i < each_blocks.length; i += 1) { + for (i = each_value_4.length; i < each_blocks.length; i += 1) { out_1(i); } check_outros(); @@ -22308,11 +22400,11 @@ i(local) { if (current) return; - for (let i = 0; i < each_value_4.length; i += 1) { + for (let i = 0; i < each_value_5.length; i += 1) { transition_in(each_blocks_1[i]); } transition_in(dialog.$$.fragment, local); - for (let i = 0; i < each_value_3.length; i += 1) { + for (let i = 0; i < each_value_4.length; i += 1) { transition_in(each_blocks[i]); } current = true; @@ -22394,9 +22486,9 @@ a = element("a"); a.textContent = "?"; attr(input, "type", "number"); - attr(input, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); attr(a, "title", "Higher will filter more potentially different images, lower will let more identical images through"); - attr(label, "class", "svelte-10fwss6"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, label, anchor); @@ -22438,21 +22530,21 @@ } }; } - function create_each_block_4(ctx) { + function create_each_block_5(ctx) { let tag; let current; function func(...args) { - return ctx[43](ctx[69], ...args); + return ctx[43](ctx[73], ...args); } function remove_handler() { - return ctx[44](ctx[69]); + return ctx[44](ctx[73]); } function toggle_handler() { - return ctx[45](ctx[69]); + return ctx[45](ctx[73]); } tag = new Tag_default({ props: { - tag: ctx[69].name, + tag: ctx[73].name, toggleable: true, toggled: !ctx[7].rsources.find(func)?.disabled } @@ -22471,7 +22563,7 @@ ctx = new_ctx; const tag_changes = {}; if (dirty[0] & 128) - tag_changes.tag = ctx[69].name; + tag_changes.tag = ctx[73].name; if (dirty[0] & 128) tag_changes.toggled = !ctx[7].rsources.find(func)?.disabled; tag.$set(tag_changes); @@ -22491,7 +22583,7 @@ } }; } - function create_default_slot_6(ctx) { + function create_default_slot_7(ctx) { let div; let label0; let t0; @@ -22535,21 +22627,21 @@ button.textContent = "Add"; attr(input0, "type", "text"); attr(input0, "placeholder", "Safebooru"); - attr(input0, "class", "svelte-10fwss6"); - attr(label0, "class", "svelte-10fwss6"); + attr(input0, "class", "svelte-1pjjwl2"); + attr(label0, "class", "svelte-1pjjwl2"); attr(input1, "type", "text"); attr(input1, "placeholder", "safebooru.com"); - attr(input1, "class", "svelte-10fwss6"); - attr(label1, "class", "svelte-10fwss6"); + attr(input1, "class", "svelte-1pjjwl2"); + attr(label1, "class", "svelte-1pjjwl2"); attr(input2, "type", "text"); attr(input2, "placeholder", "/post.json?tags=md5:"); - attr(input2, "class", "svelte-10fwss6"); - attr(label2, "class", "svelte-10fwss6"); + attr(input2, "class", "svelte-1pjjwl2"); + attr(label2, "class", "svelte-1pjjwl2"); attr(input3, "type", "text"); attr(input3, "placeholder", "https://safebooru.com/post/show/"); - attr(input3, "class", "svelte-10fwss6"); - attr(label3, "class", "svelte-10fwss6"); - attr(div, "class", "form svelte-10fwss6"); + attr(input3, "class", "svelte-1pjjwl2"); + attr(label3, "class", "svelte-1pjjwl2"); + attr(div, "class", "form svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div, anchor); @@ -22607,13 +22699,13 @@ } }; } - function create_each_block_3(ctx) { + function create_each_block_4(ctx) { let tag; let current; function toggle_handler_1() { - return ctx[52](ctx[67]); + return ctx[52](ctx[71]); } - tag = new Tag_default({ props: { tag: ctx[67] } }); + tag = new Tag_default({ props: { tag: ctx[71] } }); tag.$on("toggle", toggle_handler_1); return { c() { @@ -22627,7 +22719,7 @@ ctx = new_ctx; const tag_changes = {}; if (dirty[0] & 128) - tag_changes.tag = ctx[67]; + tag_changes.tag = ctx[71]; tag.$set(tag_changes); }, i(local) { @@ -22645,7 +22737,7 @@ } }; } - function create_default_slot_5(ctx) { + function create_default_slot_6(ctx) { let label; let input; let t0; @@ -22729,16 +22821,16 @@ } }; } - function create_each_block_2(ctx) { + function create_each_block_3(ctx) { let option; - let t_value = ctx[64].domain + ""; + let t_value = ctx[68].domain + ""; let t; let option_value_value; return { c() { option = element("option"); t = text(t_value); - option.__value = option_value_value = ctx[66]; + option.__value = option_value_value = ctx[70]; option.value = option.__value; }, m(target, anchor) { @@ -22752,7 +22844,7 @@ } }; } - function create_default_slot_4(ctx) { + function create_default_slot_5(ctx) { let p; let t1; let select; @@ -22762,10 +22854,10 @@ let input; let mounted; let dispose; - let each_value_2 = filehosts; + let each_value_3 = filehosts; let each_blocks = []; - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); + for (let i = 0; i < each_value_3.length; i += 1) { + each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); } return { c() { @@ -22783,8 +22875,8 @@ if (ctx[7].fhost === void 0) add_render_callback(() => ctx[54].call(select)); attr(input, "type", "number"); - attr(input, "class", "svelte-10fwss6"); - attr(label, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, p, anchor); @@ -22809,14 +22901,14 @@ }, p(ctx2, dirty) { if (dirty & 0) { - each_value_2 = filehosts; + each_value_3 = filehosts; let i; - for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_2(ctx2, each_value_2, i); + for (i = 0; i < each_value_3.length; i += 1) { + const child_ctx = get_each_context_3(ctx2, each_value_3, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_2(child_ctx); + each_blocks[i] = create_each_block_3(child_ctx); each_blocks[i].c(); each_blocks[i].m(select, null); } @@ -22824,7 +22916,7 @@ for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value_2.length; + each_blocks.length = each_value_3.length; } if (dirty[0] & 128) { select_option(select, ctx2[7].fhost); @@ -22871,10 +22963,10 @@ let div; let p; let t1; - let each_value_1 = ctx[6]; + let each_value_2 = ctx[6]; let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i)); + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); } return { c() { @@ -22885,7 +22977,7 @@ for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - attr(div, "class", "bepis svelte-10fwss6"); + attr(div, "class", "bepis svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div, anchor); @@ -22897,14 +22989,14 @@ }, p(ctx2, dirty) { if (dirty[0] & 16448) { - each_value_1 = ctx2[6]; + each_value_2 = ctx2[6]; let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_12(ctx2, each_value_1, i); + for (i = 0; i < each_value_2.length; i += 1) { + const child_ctx = get_each_context_2(ctx2, each_value_2, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_12(child_ctx); + each_blocks[i] = create_each_block_2(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, null); } @@ -22912,7 +23004,7 @@ for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value_1.length; + each_blocks.length = each_value_2.length; } }, d(detaching) { @@ -22922,18 +23014,18 @@ } }; } - function create_each_block_12(ctx) { + function create_each_block_2(ctx) { let div; let a; let t0; - let t1_value = ctx[61].id + ""; + let t1_value = ctx[65].id + ""; let t1; let a_href_value; let t2; - let t3_value = ctx[61].pees + ""; + let t3_value = ctx[65].pees + ""; let t3; let t4; - let t5_value = ctx[61].eyes + ctx[61].other + ""; + let t5_value = ctx[65].eyes + ctx[65].other + ""; let t5; let t6; return { @@ -22947,7 +23039,7 @@ t4 = text(" / "); t5 = text(t5_value); t6 = text(")\n "); - attr(a, "href", a_href_value = "https://boards.4chan.org/" + ctx[14] + "/thread/" + ctx[61].id); + attr(a, "href", a_href_value = "https://boards.4chan.org/" + ctx[14] + "/thread/" + ctx[65].id); attr(div, "class", "mbepis"); }, m(target, anchor) { @@ -22962,14 +23054,14 @@ append(div, t6); }, p(ctx2, dirty) { - if (dirty[0] & 64 && t1_value !== (t1_value = ctx2[61].id + "")) + if (dirty[0] & 64 && t1_value !== (t1_value = ctx2[65].id + "")) set_data(t1, t1_value); - if (dirty[0] & 64 && a_href_value !== (a_href_value = "https://boards.4chan.org/" + ctx2[14] + "/thread/" + ctx2[61].id)) { + if (dirty[0] & 64 && a_href_value !== (a_href_value = "https://boards.4chan.org/" + ctx2[14] + "/thread/" + ctx2[65].id)) { attr(a, "href", a_href_value); } - if (dirty[0] & 64 && t3_value !== (t3_value = ctx2[61].pees + "")) + if (dirty[0] & 64 && t3_value !== (t3_value = ctx2[65].pees + "")) set_data(t3, t3_value); - if (dirty[0] & 64 && t5_value !== (t5_value = ctx2[61].eyes + ctx2[61].other + "")) + if (dirty[0] & 64 && t5_value !== (t5_value = ctx2[65].eyes + ctx2[65].other + "")) set_data(t5, t5_value); }, d(detaching) { @@ -22978,7 +23070,7 @@ } }; } - function create_default_slot_3(ctx) { + function create_default_slot_4(ctx) { let label; let input; let t0; @@ -23054,10 +23146,10 @@ } function create_else_block2(ctx) { let each_1_anchor; - let each_value = ctx[3]; + let each_value_1 = ctx[3]; let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i)); } return { c() { @@ -23074,14 +23166,14 @@ }, p(ctx2, dirty) { if (dirty[0] & 8) { - each_value = ctx2[3]; + each_value_1 = ctx2[3]; let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context2(ctx2, each_value, i); + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_12(ctx2, each_value_1, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block2(child_ctx); + each_blocks[i] = create_each_block_12(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } @@ -23089,7 +23181,7 @@ for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value.length; + each_blocks.length = each_value_1.length; } }, d(detaching) { @@ -23116,13 +23208,13 @@ } }; } - function create_each_block2(ctx) { + function create_each_block_12(ctx) { let h3; - let t0_value = ctx[58].title + ""; + let t0_value = ctx[62].title + ""; let t0; let t1; let p; - let t2_value = ctx[58].content + ""; + let t2_value = ctx[62].content + ""; let t2; return { c() { @@ -23140,9 +23232,9 @@ append(p, t2); }, p(ctx2, dirty) { - if (dirty[0] & 8 && t0_value !== (t0_value = ctx2[58].title + "")) + if (dirty[0] & 8 && t0_value !== (t0_value = ctx2[62].title + "")) set_data(t0, t0_value); - if (dirty[0] & 8 && t2_value !== (t2_value = ctx2[58].content + "")) + if (dirty[0] & 8 && t2_value !== (t2_value = ctx2[62].content + "")) set_data(t2, t2_value); }, d(detaching) { @@ -23155,7 +23247,7 @@ } }; } - function create_default_slot_2(ctx) { + function create_default_slot_3(ctx) { let p; let t2; let div; @@ -23173,7 +23265,7 @@ t2 = space(); div = element("div"); if_block.c(); - attr(div, "class", "newsbox svelte-10fwss6"); + attr(div, "class", "newsbox svelte-1pjjwl2"); }, m(target, anchor) { insert(target, p, anchor); @@ -23204,6 +23296,80 @@ } }; } + function create_each_block2(ctx) { + let option; + let t0; + let t1; + let option_value_value; + return { + c() { + option = element("option"); + t0 = text("Method "); + t1 = text(ctx[59]); + option.__value = option_value_value = ctx[59]; + option.value = option.__value; + }, + m(target, anchor) { + insert(target, option, anchor); + append(option, t0); + append(option, t1); + }, + p: noop, + d(detaching) { + if (detaching) + detach(option); + } + }; + } + function create_default_slot_2(ctx) { + let label; + let t; + let select; + let mounted; + let dispose; + let each_value = [0, 1, 2, 3, 4]; + let each_blocks = []; + for (let i = 0; i < 5; i += 1) { + each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); + } + return { + c() { + label = element("label"); + t = text("PNG Embedding method\n "); + select = element("select"); + for (let i = 0; i < 5; i += 1) { + each_blocks[i].c(); + } + if (ctx[7].pmeth === void 0) + add_render_callback(() => ctx[57].call(select)); + }, + m(target, anchor) { + insert(target, label, anchor); + append(label, t); + append(label, select); + for (let i = 0; i < 5; i += 1) { + each_blocks[i].m(select, null); + } + select_option(select, ctx[7].pmeth); + if (!mounted) { + dispose = listen(select, "change", ctx[57]); + mounted = true; + } + }, + p(ctx2, dirty) { + if (dirty[0] & 128) { + select_option(select, ctx2[7].pmeth); + } + }, + d(detaching) { + if (detaching) + detach(label); + destroy_each(each_blocks, detaching); + mounted = false; + dispose(); + } + }; + } function create_if_block_12(ctx) { let tabpanel; let current; @@ -23276,39 +23442,47 @@ let t4; let tabpanel4; let t5; + let tabpanel5; + let t6; let if_block_anchor; let current; tablist = new TabList_default({ props: { - $$slots: { default: [create_default_slot_8] }, + $$slots: { default: [create_default_slot_9] }, $$scope: { ctx } } }); tabpanel0 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_7] }, + $$slots: { default: [create_default_slot_8] }, $$scope: { ctx } } }); tabpanel1 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_5] }, + $$slots: { default: [create_default_slot_6] }, $$scope: { ctx } } }); tabpanel2 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_4] }, + $$slots: { default: [create_default_slot_5] }, $$scope: { ctx } } }); tabpanel3 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_3] }, + $$slots: { default: [create_default_slot_4] }, $$scope: { ctx } } }); tabpanel4 = new TabPanel_default({ + props: { + $$slots: { default: [create_default_slot_3] }, + $$scope: { ctx } + } + }); + tabpanel5 = new TabPanel_default({ props: { $$slots: { default: [create_default_slot_2] }, $$scope: { ctx } @@ -23329,6 +23503,8 @@ t4 = space(); create_component(tabpanel4.$$.fragment); t5 = space(); + create_component(tabpanel5.$$.fragment); + t6 = space(); if (if_block) if_block.c(); if_block_anchor = empty(); @@ -23346,6 +23522,8 @@ insert(target, t4, anchor); mount_component(tabpanel4, target, anchor); insert(target, t5, anchor); + mount_component(tabpanel5, target, anchor); + insert(target, t6, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); @@ -23353,35 +23531,40 @@ }, p(ctx2, dirty) { const tablist_changes = {}; - if (dirty[0] & 256 | dirty[2] & 512) { + if (dirty[0] & 256 | dirty[2] & 8192) { tablist_changes.$$scope = { dirty, ctx: ctx2 }; } tablist.$set(tablist_changes); const tabpanel0_changes = {}; - if (dirty[0] & 896 | dirty[2] & 512) { + if (dirty[0] & 896 | dirty[2] & 8192) { tabpanel0_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel0.$set(tabpanel0_changes); const tabpanel1_changes = {}; - if (dirty[0] & 134 | dirty[2] & 512) { + if (dirty[0] & 134 | dirty[2] & 8192) { tabpanel1_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel1.$set(tabpanel1_changes); const tabpanel2_changes = {}; - if (dirty[0] & 128 | dirty[2] & 512) { + if (dirty[0] & 128 | dirty[2] & 8192) { tabpanel2_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel2.$set(tabpanel2_changes); const tabpanel3_changes = {}; - if (dirty[0] & 224 | dirty[2] & 512) { + if (dirty[0] & 224 | dirty[2] & 8192) { tabpanel3_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel3.$set(tabpanel3_changes); const tabpanel4_changes = {}; - if (dirty[0] & 8 | dirty[2] & 512) { + if (dirty[0] & 8 | dirty[2] & 8192) { tabpanel4_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel4.$set(tabpanel4_changes); + const tabpanel5_changes = {}; + if (dirty[0] & 128 | dirty[2] & 8192) { + tabpanel5_changes.$$scope = { dirty, ctx: ctx2 }; + } + tabpanel5.$set(tabpanel5_changes); if (ctx2[8].akValid) { if (if_block) { if (dirty[0] & 256) { @@ -23410,6 +23593,7 @@ transition_in(tabpanel2.$$.fragment, local); transition_in(tabpanel3.$$.fragment, local); transition_in(tabpanel4.$$.fragment, local); + transition_in(tabpanel5.$$.fragment, local); transition_in(if_block); current = true; }, @@ -23420,6 +23604,7 @@ transition_out(tabpanel2.$$.fragment, local); transition_out(tabpanel3.$$.fragment, local); transition_out(tabpanel4.$$.fragment, local); + transition_out(tabpanel5.$$.fragment, local); transition_out(if_block); current = false; }, @@ -23442,6 +23627,9 @@ destroy_component(tabpanel4, detaching); if (detaching) detach(t5); + destroy_component(tabpanel5, detaching); + if (detaching) + detach(t6); if (if_block) if_block.d(detaching); if (detaching) @@ -23521,7 +23709,6 @@ function appendBooru() { if (false) { request(newbooru.domain); - alert("Requested! Please click the PEE icon to validate"); } set_store_value(settings, $settings.rsources = [...$settings.rsources, newbooru], $settings); dial.toggle(); @@ -23717,6 +23904,10 @@ $settings.tm = this.checked; settings.set($settings); } + function select_change_handler_1() { + $settings.pmeth = select_value(this); + settings.set($settings); + } $$self.$$set = ($$props2) => { if ("rev" in $$props2) $$invalidate(0, rev = $$props2.rev); @@ -23778,7 +23969,8 @@ keydown_handler, select_change_handler, input_input_handler_2, - input_change_handler_2 + input_change_handler_2, + select_change_handler_1 ]; } var App = class extends SvelteComponent { @@ -25231,7 +25423,7 @@ yield post.querySelector("a[rel]")?.getAttribute("href") || ""; }, getFilename: (post) => { - const opfn = post.querySelector("a.post_file_filename")?.textContent; + const opfn = post.querySelector(".post_file_filename")?.textContent; if (opfn) return opfn; const a = post.querySelector("a[rel]"); @@ -26459,10 +26651,12 @@ if (!supportedMainDomain(location.host) && !supportedAltDomain(location.host)) throw "PEE not supported here, skipping"; var qp; - var csettings6 = initial_settings; + var csettings5; var processors = [thirdeye_default, pomf_default, pngv3_default, jpg_default, webm_default, gif_default]; var cappState; settings.subscribe(async (b) => { + if (!b) + return; if (b.hyd) { if (b.ak) { const hydCli = new HydrusClient(b.ak); @@ -26479,9 +26673,9 @@ } } } - csettings6 = b; + csettings5 = b; processors = [ - ...!csettings6.te ? [thirdeye_default] : [], + ...!csettings5.te ? [thirdeye_default] : [], pngv3_default, pomf_default, jpg_default, @@ -26543,7 +26737,9 @@ var textToElement = (s) => document.createRange().createContextualFragment(s).children[0]; var pendingPosts = []; var signalNewEmbeds = debounce(async () => { - if (!csettings6.tm) + if (!csettings5) + return; + if (!csettings5.tm) return; try { const boardname = location.pathname.match(/\/([^/]*)\//)[1]; @@ -26565,7 +26761,9 @@ var shouldUseCache = () => { if (cappState.isCatalog) return false; - return typeof csettings6.cache == "boolean" ? csettings6.cache : location.hostname.includes("b4k"); + if (!csettings5) + return false; + return typeof csettings5.cache == "boolean" ? csettings5.cache : location.hostname.includes("b4k"); }; var processPost = async (post) => { const origlink = qp.getImageLink(post); @@ -26576,7 +26774,9 @@ return; let res2 = void 0; const reportEmbed = () => { - if (csettings6.tm) { + if (!csettings5) + return false; + if (csettings5.tm) { if (["boards.4chan.org", "boards.4channel.org"].includes(location.host)) { if (!cappState.isCatalog) { const op = +location.pathname.match(/\/thread\/(.*)/)[1]; @@ -26623,7 +26823,9 @@ navigator.clipboard.writeText(text3); } var scrapeBoard = async (self) => { - if (csettings6.tm) { + if (!csettings5) + return false; + if (csettings5.tm) { fireNotification("success", "Scrapping board with telemetry on! Thank you for your service, selfless stranger ;_;7"); } self.disabled = true; @@ -26751,7 +26953,15 @@ Use the WebExtension version of PEE if you want to use b4k!`); return; else qp = lqp; - if (csettings6.vercheck) + await new Promise((_) => { + settings.subscribe((val) => { + if (val) + _(); + }); + }); + if (!csettings5) + return false; + if (csettings5.vercheck) versionCheck(); const postQuote = ({ scanner, parser, utils }) => { const { CLOSEANGLEBRACKET: CLOSEANGLEBRACKET2, NUM: NUM2 } = scanner.tokens; @@ -26802,7 +27012,9 @@ Use the WebExtension version of PEE if you want to use b4k!`); rec.addedNodes.forEach((e) => { if (!(e instanceof HTMLElement)) return; - if (cappState.isCatalog && csettings6.notcata) + if (!csettings5) + return false; + if (cappState.isCatalog && csettings5.notcata) return; let el = qp.postsWithFiles(e); if (!el && e.classList.contains("postContainer")) @@ -26864,7 +27076,7 @@ Use the WebExtension version of PEE if you want to use b4k!`); button2.onclick = () => scrapeBoard(button2); opts.insertAdjacentElement("beforebegin", button2); } - if (csettings6.notcata) + if (csettings5.notcata) return; } const n = 7; diff --git a/firefox/dist/main.js b/firefox/dist/main.js index 80874da..ee2ad3a 100644 --- a/firefox/dist/main.js +++ b/firefox/dist/main.js @@ -73,7 +73,7 @@ var define_BUILD_VERSION_default; var init_define_BUILD_VERSION = __esm({ ""() { - define_BUILD_VERSION_default = [0, 273]; + define_BUILD_VERSION_default = [0, 275]; } }); @@ -13954,12 +13954,33 @@ } // src/stores.ts - var localLoad = (key2, def) => "__pee__" + key2 in localStorage ? JSON.parse(localStorage.getItem("__pee__" + key2)) : def; - var localSet = (key2, value) => localStorage.setItem("__pee__" + key2, JSON.stringify(value)); + var localLoad = async (key2, def) => { + const isinls = "__pee__" + key2 in localStorage; + const ret = isinls ? { ...def, ...JSON.parse(localStorage.getItem("__pee__" + key2)) } : def; + if (true) { + if (isinls) { + delete localStorage["__pee__" + key2]; + await chrome.storage.local.set({ + [key2]: JSON.stringify(ret) + }); + } else { + const d = await chrome.storage.local.get([key2]); + if (typeof d[key2] == "string") + return { ...def, ...await JSON.parse("" + d[key2] || "{}") }; + } + } + return ret; + }; + var localSet = (key2, value) => { + if (true) + chrome.storage.local.set({ [key2]: JSON.stringify(value) }); + else + localStorage.setItem("__pee__" + key2, JSON.stringify(value)); + }; var initial_settings = localLoad("settingsv2", { - ...localLoad("settings", {}), loop: true, dh: false, + pmeth: 4, xpv: false, xpi: false, hyd: false, @@ -13988,10 +14009,12 @@ conc: 8, ho: false, blacklist: [], - rsources: [], - ...localLoad("settingsv2", {}) + rsources: [] + }); + var settings = writable(); + initial_settings.then((v) => { + settings.set(v); }); - var settings = writable(initial_settings); var appState = writable({ isCatalog: false, is4chanX: false, @@ -14312,6 +14335,7 @@ "archived.moe", "archive.nyafuu.org", "arch.b4k.co", + "archive.4plebs.org", "archive.wakarimasen.moe", "b4k.co", "fireden.net", @@ -16539,6 +16563,8 @@ return threadDataCache; }; var getEmbedsFromCache = async (board, op, pid) => { + if (!csettings) + throw new Error("Settings uninit"); await getThreadDataCache(board, op); const target = +pid.slice(pid.match(/\d/).index); const cachedData = cthreadDataCache[target]; @@ -16578,6 +16604,8 @@ return ret; }; var decodeCoom3Payload = async (buff) => { + if (!csettings) + throw new Error("Settings uninit"); const allowed_domains = filehosts.map((e) => e.serving.replaceAll(".", "\\.")); const pees = buff.toString().split(" ").slice(0, csettings.maxe).filter((e) => allowed_domains.some((v) => e.match(`https://(.*\\.)?${v}/`))); return (await Promise.all(pees.map(async (pee) => { @@ -16655,6 +16683,8 @@ let total = 0; fireNotification("info", `Uploading ${injs.length} files...`); return await Promise.all(injs.map(async (inj) => { + if (!csettings) + throw new Error("Settings uninit"); const peefile = await buildPeeFile(inj); const ret = await filehosts[csettings.fhost || 0].uploadFile(peefile); fireNotification("info", `Uploaded files [${++total}/${injs.length}] ${ret}`); @@ -16785,6 +16815,8 @@ const sneed = new PNGDecoder(reader); const ret = []; let w; + if (!csettings2) + throw new Error("Settings uninit"); try { for await (const [name, chunk, crc, offset] of sneed.chunks()) { let buff; @@ -16860,6 +16892,8 @@ return [ret, () => b]; }; var inject_data = async (container, injb) => { + if (!csettings2) + throw new Error("Settings uninit"); let magic4 = false; const [writestream, extract7] = BufferWriteStream2(); const encoder = new PNGEncoder(writestream); @@ -16869,7 +16903,24 @@ break; if (!magic4 && name == "IDAT") { const passed = import_buffer3.Buffer.from(injb); - await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM7, passed])), () => Promise.resolve(0), 0]); + switch (csettings2.pmeth) { + case 0: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM3, passed])), () => Promise.resolve(0), 0]); + break; + case 1: + xor(passed, password); + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM4, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 2: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM5, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 3: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM6, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 4: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM7, import_buffer3.Buffer.from(bs58.encode(passed))])), () => Promise.resolve(0), 0]); + break; + } magic4 = true; } await encoder.insertchunk([name, chunk, crc, offset]); @@ -16892,7 +16943,7 @@ } return ""; }); - const injb = import_buffer3.Buffer.from(bs58.encode(import_buffer3.Buffer.from(links.join(" ")))); + const injb = import_buffer3.Buffer.from(links.join(" ")); return inject_data(container, injb); }; var has_embed = async (png) => { @@ -18868,10 +18919,6 @@ }; // src/jpg.ts - var csettings3; - settings.subscribe((b) => { - csettings3 = b; - }); var key = import_buffer6.Buffer.from("CUNNYCUNNYCUNNY"); var f5inst = new f5stego(key); var inject4 = async (b, links) => { @@ -18969,9 +19016,9 @@ }; // src/thirdeye.ts - var csettings4; + var csettings3; settings.subscribe((b) => { - csettings4 = b; + csettings3 = b; }); var gelquirk = (prefix) => (a) => { let base = a.post || a.data || a; @@ -18992,6 +19039,8 @@ var phashEn = false; var mindist = 5; settings.subscribe((s) => { + if (!s) + return; experimentalApi = s.expte; boorus = s.rsources.map((e) => ({ ...e, @@ -19001,10 +19050,7 @@ mindist = s.mdist || 5; phashEn = s.phash; }); - var boorus = localLoad("settingsv2", { rsources: [] }).rsources.map((e) => ({ - ...e, - quirks: gelquirk(e.view) - })); + var boorus = []; var unlockQueue = Promise.resolve(); var cache = {}; var findFileFrom = async (b, hex, abort) => { @@ -19027,6 +19073,8 @@ } }; var extract5 = async (b, fn) => { + if (!csettings3) + throw new Error("Settings uninit"); let result; let booru; for (const e of Object.values(boorus)) { @@ -19048,8 +19096,8 @@ url: result[0].page }, filename: fn.substring(0, 33) + result[0].ext, - thumbnail: csettings4.hotlink ? prev || full : import_buffer7.Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), - data: csettings4.hotlink ? full || prev : async (lsn) => { + thumbnail: csettings3.hotlink ? prev || full : import_buffer7.Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), + data: csettings3.hotlink ? full || prev : async (lsn) => { if (!cachedFile) cachedFile = await (await ifetch(full || prev, void 0, lsn)).arrayBuffer(); return import_buffer7.Buffer.from(cachedFile); @@ -19115,9 +19163,9 @@ { host: "Litter", prefix: "litter.catbox.moe/" }, { host: "Zzzz", prefix: "z.zz.fo/" } ]; - var csettings5; + var csettings4; settings.subscribe((b) => { - csettings5 = b; + csettings4 = b; }); var getExt = (fn) => { const isB64 = fn.match(/^((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=))?\.(gif|jpe?g|png|webm)/); @@ -19143,6 +19191,8 @@ return { ext, source }; }; var extract6 = async (b, fn) => { + if (!csettings4) + throw new Error("Settings uninit"); const { ext, source } = getExt(fn); let rsource; for (const cs of sources) { @@ -19157,7 +19207,7 @@ } return [{ filename: ext, - data: csettings5.hotlink ? rsource : async (lsn) => { + data: csettings4.hotlink ? rsource : async (lsn) => { try { return import_buffer8.Buffer.from(await (await ifetch(rsource, void 0, lsn)).arrayBuffer()); } catch (e) { @@ -21179,34 +21229,39 @@ // src/Components/App.svelte function add_css8(target) { - append_styles(target, "svelte-10fwss6", '.bepis.svelte-10fwss6.svelte-10fwss6{max-height:260px;overflow-y:auto}.tagcont.svelte-10fwss6.svelte-10fwss6{display:flex;gap:5px;margin-bottom:10px;flex-wrap:wrap}label.svelte-10fwss6>input[type="text"].svelte-10fwss6,label.svelte-10fwss6>input[type="number"].svelte-10fwss6{width:95%}.content.svelte-10fwss6.svelte-10fwss6{display:flex;flex-direction:column}.error.svelte-10fwss6.svelte-10fwss6{color:red}hr.svelte-10fwss6.svelte-10fwss6{width:100%}h1.svelte-10fwss6.svelte-10fwss6{text-align:center;margin-bottom:0}h4.svelte-10fwss6.svelte-10fwss6{text-align:center;margin:0}.form.svelte-10fwss6.svelte-10fwss6{display:flex;flex-direction:column;gap:20px;position:absolute;padding:15px;border:1px solid white;background-color:black;border-radius:10px}.form.svelte-10fwss6>label.svelte-10fwss6{display:flex;flex-direction:column;gap:10px}.newsbox.svelte-10fwss6.svelte-10fwss6{max-height:300px;overflow-y:scroll}.backpanel.svelte-10fwss6.svelte-10fwss6{position:absolute;right:32px;padding:10px;width:15%;top:32px;border:1px solid;border-radius:5px;background-color:rgba(0, 0, 0, 0.8);pointer-events:all;backdrop-filter:blur(9px);max-height:80vh;min-width:321px}'); + append_styles(target, "svelte-1pjjwl2", '.bepis.svelte-1pjjwl2.svelte-1pjjwl2{max-height:260px;overflow-y:auto}.tagcont.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;gap:5px;margin-bottom:10px;flex-wrap:wrap}label.svelte-1pjjwl2>input[type="text"].svelte-1pjjwl2,label.svelte-1pjjwl2>input[type="number"].svelte-1pjjwl2{width:95%}.content.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;flex-direction:column}.error.svelte-1pjjwl2.svelte-1pjjwl2{color:red}hr.svelte-1pjjwl2.svelte-1pjjwl2{width:100%}h1.svelte-1pjjwl2.svelte-1pjjwl2{text-align:center;margin-bottom:0}h4.svelte-1pjjwl2.svelte-1pjjwl2{text-align:center;margin:0}.form.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;flex-direction:column;gap:20px;position:absolute;padding:15px;border:1px solid white;background-color:black;border-radius:10px}.form.svelte-1pjjwl2>label.svelte-1pjjwl2{display:flex;flex-direction:column;gap:10px}.newsbox.svelte-1pjjwl2.svelte-1pjjwl2{max-height:300px;overflow-y:scroll}.backpanel.svelte-1pjjwl2.svelte-1pjjwl2{position:absolute;right:32px;padding:10px;width:15%;top:32px;border:1px solid;border-radius:5px;background-color:rgba(0, 0, 0, 0.8);pointer-events:all;backdrop-filter:blur(9px);max-height:80vh;min-width:321px}'); } function get_each_context2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[58] = list[i]; + child_ctx[59] = list[i]; return child_ctx; } function get_each_context_12(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[61] = list[i]; + child_ctx[62] = list[i]; return child_ctx; } function get_each_context_2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[64] = list[i]; - child_ctx[66] = i; + child_ctx[65] = list[i]; return child_ctx; } function get_each_context_3(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[67] = list[i]; - child_ctx[66] = i; + child_ctx[68] = list[i]; + child_ctx[70] = i; return child_ctx; } function get_each_context_4(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[69] = list[i]; - child_ctx[66] = i; + child_ctx[71] = list[i]; + child_ctx[70] = i; + return child_ctx; + } + function get_each_context_5(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[73] = list[i]; + child_ctx[70] = i; return child_ctx; } function create_if_block6(ctx) { @@ -21243,11 +21298,11 @@ hr = element("hr"); t5 = space(); create_component(tabs.$$.fragment); - attr(h1, "class", "svelte-10fwss6"); - attr(h4, "class", "svelte-10fwss6"); - attr(hr, "class", "svelte-10fwss6"); - attr(div0, "class", "content svelte-10fwss6"); - attr(div1, "class", "backpanel svelte-10fwss6"); + attr(h1, "class", "svelte-1pjjwl2"); + attr(h4, "class", "svelte-1pjjwl2"); + attr(hr, "class", "svelte-1pjjwl2"); + attr(div0, "class", "content svelte-1pjjwl2"); + attr(div1, "class", "backpanel svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div1, anchor); @@ -21267,7 +21322,7 @@ if (!current || dirty[0] & 1) set_data(t1, ctx2[0]); const tabs_changes = {}; - if (dirty[0] & 1006 | dirty[2] & 512) { + if (dirty[0] & 1006 | dirty[2] & 8192) { tabs_changes.$$scope = { dirty, ctx: ctx2 }; } tabs.$set(tabs_changes); @@ -21299,7 +21354,7 @@ } }; } - function create_default_slot_14(ctx) { + function create_default_slot_16(ctx) { let t; return { c() { @@ -21314,7 +21369,7 @@ } }; } - function create_default_slot_13(ctx) { + function create_default_slot_15(ctx) { let t; return { c() { @@ -21329,7 +21384,7 @@ } }; } - function create_default_slot_12(ctx) { + function create_default_slot_14(ctx) { let t; return { c() { @@ -21344,7 +21399,7 @@ } }; } - function create_default_slot_11(ctx) { + function create_default_slot_13(ctx) { let t; return { c() { @@ -21359,7 +21414,7 @@ } }; } - function create_default_slot_10(ctx) { + function create_default_slot_12(ctx) { let t; return { c() { @@ -21374,12 +21429,27 @@ } }; } + function create_default_slot_11(ctx) { + let t; + return { + c() { + t = text("Advanced"); + }, + m(target, anchor) { + insert(target, t, anchor); + }, + d(detaching) { + if (detaching) + detach(t); + } + }; + } function create_if_block_11(ctx) { let tab; let current; tab = new Tab_default({ props: { - $$slots: { default: [create_default_slot_9] }, + $$slots: { default: [create_default_slot_10] }, $$scope: { ctx } } }); @@ -21406,7 +21476,7 @@ } }; } - function create_default_slot_9(ctx) { + function create_default_slot_10(ctx) { let t; return { c() { @@ -21421,7 +21491,7 @@ } }; } - function create_default_slot_8(ctx) { + function create_default_slot_9(ctx) { let tab0; let t0; let tab1; @@ -21432,40 +21502,48 @@ let t3; let tab4; let t4; + let tab5; + let t5; let if_block_anchor; let current; tab0 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_14] }, + $$slots: { default: [create_default_slot_16] }, $$scope: { ctx } } }); tab1 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_13] }, + $$slots: { default: [create_default_slot_15] }, $$scope: { ctx } } }); tab2 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_12] }, + $$slots: { default: [create_default_slot_14] }, $$scope: { ctx } } }); tab3 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_11] }, + $$slots: { default: [create_default_slot_13] }, $$scope: { ctx } } }); tab3.$on("select", ctx[18]); tab4 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_10] }, + $$slots: { default: [create_default_slot_12] }, $$scope: { ctx } } }); tab4.$on("select", ctx[19]); + tab5 = new Tab_default({ + props: { + $$slots: { default: [create_default_slot_11] }, + $$scope: { ctx } + } + }); let if_block = ctx[8].akValid && create_if_block_11(ctx); return { c() { @@ -21479,6 +21557,8 @@ t3 = space(); create_component(tab4.$$.fragment); t4 = space(); + create_component(tab5.$$.fragment); + t5 = space(); if (if_block) if_block.c(); if_block_anchor = empty(); @@ -21494,6 +21574,8 @@ insert(target, t3, anchor); mount_component(tab4, target, anchor); insert(target, t4, anchor); + mount_component(tab5, target, anchor); + insert(target, t5, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); @@ -21501,30 +21583,35 @@ }, p(ctx2, dirty) { const tab0_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab0_changes.$$scope = { dirty, ctx: ctx2 }; } tab0.$set(tab0_changes); const tab1_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab1_changes.$$scope = { dirty, ctx: ctx2 }; } tab1.$set(tab1_changes); const tab2_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab2_changes.$$scope = { dirty, ctx: ctx2 }; } tab2.$set(tab2_changes); const tab3_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab3_changes.$$scope = { dirty, ctx: ctx2 }; } tab3.$set(tab3_changes); const tab4_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab4_changes.$$scope = { dirty, ctx: ctx2 }; } tab4.$set(tab4_changes); + const tab5_changes = {}; + if (dirty[2] & 8192) { + tab5_changes.$$scope = { dirty, ctx: ctx2 }; + } + tab5.$set(tab5_changes); if (ctx2[8].akValid) { if (if_block) { if (dirty[0] & 256) { @@ -21552,6 +21639,7 @@ transition_in(tab2.$$.fragment, local); transition_in(tab3.$$.fragment, local); transition_in(tab4.$$.fragment, local); + transition_in(tab5.$$.fragment, local); transition_in(if_block); current = true; }, @@ -21561,6 +21649,7 @@ transition_out(tab2.$$.fragment, local); transition_out(tab3.$$.fragment, local); transition_out(tab4.$$.fragment, local); + transition_out(tab5.$$.fragment, local); transition_out(if_block); current = false; }, @@ -21580,6 +21669,9 @@ destroy_component(tab4, detaching); if (detaching) detach(t4); + destroy_component(tab5, detaching); + if (detaching) + detach(t5); if (if_block) if_block.d(detaching); if (detaching) @@ -21653,8 +21745,8 @@ if_block1_anchor = empty(); attr(a, "title", "Only requires Search Files permission. See Hydrus docs on where to set this up."); attr(input, "type", "text"); - attr(input, "class", "svelte-10fwss6"); - attr(label, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { if (if_block0) @@ -21730,7 +21822,7 @@ c() { span = element("span"); t = text(t_value); - attr(span, "class", "error svelte-10fwss6"); + attr(span, "class", "error svelte-1pjjwl2"); }, m(target, anchor) { insert(target, span, anchor); @@ -21767,12 +21859,12 @@ input1 = element("input"); set_style(input0, "width", "5ch"); attr(input0, "type", "number"); - attr(input0, "class", "svelte-10fwss6"); - attr(label0, "class", "svelte-10fwss6"); + attr(input0, "class", "svelte-1pjjwl2"); + attr(label0, "class", "svelte-1pjjwl2"); attr(input1, "placeholder", "Restrict to these tags (space to separate tags, _ to separate words)"); attr(input1, "type", "text"); - attr(input1, "class", "svelte-10fwss6"); - attr(label1, "class", "svelte-10fwss6"); + attr(input1, "class", "svelte-1pjjwl2"); + attr(label1, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, label0, anchor); @@ -21812,7 +21904,7 @@ } }; } - function create_default_slot_7(ctx) { + function create_default_slot_8(ctx) { let label0; let input0; let t0; @@ -22265,24 +22357,24 @@ let dispose; let if_block0 = ctx[7].phash && create_if_block_62(ctx); let if_block1 = ctx[7].rsources.length == 0 && create_if_block_52(ctx); - let each_value_4 = ctx[7].rsources; + let each_value_5 = ctx[7].rsources; let each_blocks_1 = []; - for (let i = 0; i < each_value_4.length; i += 1) { - each_blocks_1[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); + for (let i = 0; i < each_value_5.length; i += 1) { + each_blocks_1[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i)); } const out = (i) => transition_out(each_blocks_1[i], 1, 1, () => { each_blocks_1[i] = null; }); let dialog_props = { - $$slots: { default: [create_default_slot_6] }, + $$slots: { default: [create_default_slot_7] }, $$scope: { ctx } }; dialog = new Dialog_default({ props: dialog_props }); ctx[51](dialog); - let each_value_3 = ctx[7].blacklist; + let each_value_4 = ctx[7].blacklist; let each_blocks = []; - for (let i = 0; i < each_value_3.length; i += 1) { - each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); + for (let i = 0; i < each_value_4.length; i += 1) { + each_blocks[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); } const out_1 = (i) => transition_out(each_blocks[i], 1, 1, () => { each_blocks[i] = null; @@ -22324,9 +22416,9 @@ t13 = space(); input1 = element("input"); attr(input0, "type", "checkbox"); - attr(div0, "class", "tagcont svelte-10fwss6"); - attr(hr, "class", "svelte-10fwss6"); - attr(div1, "class", "tagcont svelte-10fwss6"); + attr(div0, "class", "tagcont svelte-1pjjwl2"); + attr(hr, "class", "svelte-1pjjwl2"); + attr(div1, "class", "tagcont svelte-1pjjwl2"); attr(input1, "placeholder", "Press enter after typing your tag"); }, m(target, anchor) { @@ -22400,48 +22492,48 @@ if_block1 = null; } if (dirty[0] & 73856) { - each_value_4 = ctx2[7].rsources; + each_value_5 = ctx2[7].rsources; let i; - for (i = 0; i < each_value_4.length; i += 1) { - const child_ctx = get_each_context_4(ctx2, each_value_4, i); + for (i = 0; i < each_value_5.length; i += 1) { + const child_ctx = get_each_context_5(ctx2, each_value_5, i); if (each_blocks_1[i]) { each_blocks_1[i].p(child_ctx, dirty); transition_in(each_blocks_1[i], 1); } else { - each_blocks_1[i] = create_each_block_4(child_ctx); + each_blocks_1[i] = create_each_block_5(child_ctx); each_blocks_1[i].c(); transition_in(each_blocks_1[i], 1); each_blocks_1[i].m(div0, null); } } group_outros(); - for (i = each_value_4.length; i < each_blocks_1.length; i += 1) { + for (i = each_value_5.length; i < each_blocks_1.length; i += 1) { out(i); } check_outros(); } const dialog_changes = {}; - if (dirty[0] & 2 | dirty[2] & 512) { + if (dirty[0] & 2 | dirty[2] & 8192) { dialog_changes.$$scope = { dirty, ctx: ctx2 }; } dialog.$set(dialog_changes); if (dirty[0] & 4224) { - each_value_3 = ctx2[7].blacklist; + each_value_4 = ctx2[7].blacklist; let i; - for (i = 0; i < each_value_3.length; i += 1) { - const child_ctx = get_each_context_3(ctx2, each_value_3, i); + for (i = 0; i < each_value_4.length; i += 1) { + const child_ctx = get_each_context_4(ctx2, each_value_4, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { - each_blocks[i] = create_each_block_3(child_ctx); + each_blocks[i] = create_each_block_4(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(div1, null); } } group_outros(); - for (i = each_value_3.length; i < each_blocks.length; i += 1) { + for (i = each_value_4.length; i < each_blocks.length; i += 1) { out_1(i); } check_outros(); @@ -22450,11 +22542,11 @@ i(local) { if (current) return; - for (let i = 0; i < each_value_4.length; i += 1) { + for (let i = 0; i < each_value_5.length; i += 1) { transition_in(each_blocks_1[i]); } transition_in(dialog.$$.fragment, local); - for (let i = 0; i < each_value_3.length; i += 1) { + for (let i = 0; i < each_value_4.length; i += 1) { transition_in(each_blocks[i]); } current = true; @@ -22536,9 +22628,9 @@ a = element("a"); a.textContent = "?"; attr(input, "type", "number"); - attr(input, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); attr(a, "title", "Higher will filter more potentially different images, lower will let more identical images through"); - attr(label, "class", "svelte-10fwss6"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, label, anchor); @@ -22580,21 +22672,21 @@ } }; } - function create_each_block_4(ctx) { + function create_each_block_5(ctx) { let tag; let current; function func(...args) { - return ctx[43](ctx[69], ...args); + return ctx[43](ctx[73], ...args); } function remove_handler() { - return ctx[44](ctx[69]); + return ctx[44](ctx[73]); } function toggle_handler() { - return ctx[45](ctx[69]); + return ctx[45](ctx[73]); } tag = new Tag_default({ props: { - tag: ctx[69].name, + tag: ctx[73].name, toggleable: true, toggled: !ctx[7].rsources.find(func)?.disabled } @@ -22613,7 +22705,7 @@ ctx = new_ctx; const tag_changes = {}; if (dirty[0] & 128) - tag_changes.tag = ctx[69].name; + tag_changes.tag = ctx[73].name; if (dirty[0] & 128) tag_changes.toggled = !ctx[7].rsources.find(func)?.disabled; tag.$set(tag_changes); @@ -22633,7 +22725,7 @@ } }; } - function create_default_slot_6(ctx) { + function create_default_slot_7(ctx) { let div; let label0; let t0; @@ -22677,21 +22769,21 @@ button.textContent = "Add"; attr(input0, "type", "text"); attr(input0, "placeholder", "Safebooru"); - attr(input0, "class", "svelte-10fwss6"); - attr(label0, "class", "svelte-10fwss6"); + attr(input0, "class", "svelte-1pjjwl2"); + attr(label0, "class", "svelte-1pjjwl2"); attr(input1, "type", "text"); attr(input1, "placeholder", "safebooru.com"); - attr(input1, "class", "svelte-10fwss6"); - attr(label1, "class", "svelte-10fwss6"); + attr(input1, "class", "svelte-1pjjwl2"); + attr(label1, "class", "svelte-1pjjwl2"); attr(input2, "type", "text"); attr(input2, "placeholder", "/post.json?tags=md5:"); - attr(input2, "class", "svelte-10fwss6"); - attr(label2, "class", "svelte-10fwss6"); + attr(input2, "class", "svelte-1pjjwl2"); + attr(label2, "class", "svelte-1pjjwl2"); attr(input3, "type", "text"); attr(input3, "placeholder", "https://safebooru.com/post/show/"); - attr(input3, "class", "svelte-10fwss6"); - attr(label3, "class", "svelte-10fwss6"); - attr(div, "class", "form svelte-10fwss6"); + attr(input3, "class", "svelte-1pjjwl2"); + attr(label3, "class", "svelte-1pjjwl2"); + attr(div, "class", "form svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div, anchor); @@ -22749,13 +22841,13 @@ } }; } - function create_each_block_3(ctx) { + function create_each_block_4(ctx) { let tag; let current; function toggle_handler_1() { - return ctx[52](ctx[67]); + return ctx[52](ctx[71]); } - tag = new Tag_default({ props: { tag: ctx[67] } }); + tag = new Tag_default({ props: { tag: ctx[71] } }); tag.$on("toggle", toggle_handler_1); return { c() { @@ -22769,7 +22861,7 @@ ctx = new_ctx; const tag_changes = {}; if (dirty[0] & 128) - tag_changes.tag = ctx[67]; + tag_changes.tag = ctx[71]; tag.$set(tag_changes); }, i(local) { @@ -22787,7 +22879,7 @@ } }; } - function create_default_slot_5(ctx) { + function create_default_slot_6(ctx) { let label; let input; let t0; @@ -22871,16 +22963,16 @@ } }; } - function create_each_block_2(ctx) { + function create_each_block_3(ctx) { let option; - let t_value = ctx[64].domain + ""; + let t_value = ctx[68].domain + ""; let t; let option_value_value; return { c() { option = element("option"); t = text(t_value); - option.__value = option_value_value = ctx[66]; + option.__value = option_value_value = ctx[70]; option.value = option.__value; }, m(target, anchor) { @@ -22894,7 +22986,7 @@ } }; } - function create_default_slot_4(ctx) { + function create_default_slot_5(ctx) { let p; let t1; let select; @@ -22904,10 +22996,10 @@ let input; let mounted; let dispose; - let each_value_2 = filehosts; + let each_value_3 = filehosts; let each_blocks = []; - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); + for (let i = 0; i < each_value_3.length; i += 1) { + each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); } return { c() { @@ -22925,8 +23017,8 @@ if (ctx[7].fhost === void 0) add_render_callback(() => ctx[54].call(select)); attr(input, "type", "number"); - attr(input, "class", "svelte-10fwss6"); - attr(label, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, p, anchor); @@ -22951,14 +23043,14 @@ }, p(ctx2, dirty) { if (dirty & 0) { - each_value_2 = filehosts; + each_value_3 = filehosts; let i; - for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_2(ctx2, each_value_2, i); + for (i = 0; i < each_value_3.length; i += 1) { + const child_ctx = get_each_context_3(ctx2, each_value_3, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_2(child_ctx); + each_blocks[i] = create_each_block_3(child_ctx); each_blocks[i].c(); each_blocks[i].m(select, null); } @@ -22966,7 +23058,7 @@ for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value_2.length; + each_blocks.length = each_value_3.length; } if (dirty[0] & 128) { select_option(select, ctx2[7].fhost); @@ -23013,10 +23105,10 @@ let div; let p; let t1; - let each_value_1 = ctx[6]; + let each_value_2 = ctx[6]; let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i)); + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); } return { c() { @@ -23027,7 +23119,7 @@ for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - attr(div, "class", "bepis svelte-10fwss6"); + attr(div, "class", "bepis svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div, anchor); @@ -23039,14 +23131,14 @@ }, p(ctx2, dirty) { if (dirty[0] & 16448) { - each_value_1 = ctx2[6]; + each_value_2 = ctx2[6]; let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_12(ctx2, each_value_1, i); + for (i = 0; i < each_value_2.length; i += 1) { + const child_ctx = get_each_context_2(ctx2, each_value_2, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_12(child_ctx); + each_blocks[i] = create_each_block_2(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, null); } @@ -23054,7 +23146,7 @@ for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value_1.length; + each_blocks.length = each_value_2.length; } }, d(detaching) { @@ -23064,18 +23156,18 @@ } }; } - function create_each_block_12(ctx) { + function create_each_block_2(ctx) { let div; let a; let t0; - let t1_value = ctx[61].id + ""; + let t1_value = ctx[65].id + ""; let t1; let a_href_value; let t2; - let t3_value = ctx[61].pees + ""; + let t3_value = ctx[65].pees + ""; let t3; let t4; - let t5_value = ctx[61].eyes + ctx[61].other + ""; + let t5_value = ctx[65].eyes + ctx[65].other + ""; let t5; let t6; return { @@ -23089,7 +23181,7 @@ t4 = text(" / "); t5 = text(t5_value); t6 = text(")\n "); - attr(a, "href", a_href_value = "https://boards.4chan.org/" + ctx[14] + "/thread/" + ctx[61].id); + attr(a, "href", a_href_value = "https://boards.4chan.org/" + ctx[14] + "/thread/" + ctx[65].id); attr(div, "class", "mbepis"); }, m(target, anchor) { @@ -23104,14 +23196,14 @@ append(div, t6); }, p(ctx2, dirty) { - if (dirty[0] & 64 && t1_value !== (t1_value = ctx2[61].id + "")) + if (dirty[0] & 64 && t1_value !== (t1_value = ctx2[65].id + "")) set_data(t1, t1_value); - if (dirty[0] & 64 && a_href_value !== (a_href_value = "https://boards.4chan.org/" + ctx2[14] + "/thread/" + ctx2[61].id)) { + if (dirty[0] & 64 && a_href_value !== (a_href_value = "https://boards.4chan.org/" + ctx2[14] + "/thread/" + ctx2[65].id)) { attr(a, "href", a_href_value); } - if (dirty[0] & 64 && t3_value !== (t3_value = ctx2[61].pees + "")) + if (dirty[0] & 64 && t3_value !== (t3_value = ctx2[65].pees + "")) set_data(t3, t3_value); - if (dirty[0] & 64 && t5_value !== (t5_value = ctx2[61].eyes + ctx2[61].other + "")) + if (dirty[0] & 64 && t5_value !== (t5_value = ctx2[65].eyes + ctx2[65].other + "")) set_data(t5, t5_value); }, d(detaching) { @@ -23120,7 +23212,7 @@ } }; } - function create_default_slot_3(ctx) { + function create_default_slot_4(ctx) { let label; let input; let t0; @@ -23196,10 +23288,10 @@ } function create_else_block2(ctx) { let each_1_anchor; - let each_value = ctx[3]; + let each_value_1 = ctx[3]; let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i)); } return { c() { @@ -23216,14 +23308,14 @@ }, p(ctx2, dirty) { if (dirty[0] & 8) { - each_value = ctx2[3]; + each_value_1 = ctx2[3]; let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context2(ctx2, each_value, i); + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_12(ctx2, each_value_1, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block2(child_ctx); + each_blocks[i] = create_each_block_12(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } @@ -23231,7 +23323,7 @@ for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value.length; + each_blocks.length = each_value_1.length; } }, d(detaching) { @@ -23258,13 +23350,13 @@ } }; } - function create_each_block2(ctx) { + function create_each_block_12(ctx) { let h3; - let t0_value = ctx[58].title + ""; + let t0_value = ctx[62].title + ""; let t0; let t1; let p; - let t2_value = ctx[58].content + ""; + let t2_value = ctx[62].content + ""; let t2; return { c() { @@ -23282,9 +23374,9 @@ append(p, t2); }, p(ctx2, dirty) { - if (dirty[0] & 8 && t0_value !== (t0_value = ctx2[58].title + "")) + if (dirty[0] & 8 && t0_value !== (t0_value = ctx2[62].title + "")) set_data(t0, t0_value); - if (dirty[0] & 8 && t2_value !== (t2_value = ctx2[58].content + "")) + if (dirty[0] & 8 && t2_value !== (t2_value = ctx2[62].content + "")) set_data(t2, t2_value); }, d(detaching) { @@ -23297,7 +23389,7 @@ } }; } - function create_default_slot_2(ctx) { + function create_default_slot_3(ctx) { let p; let t2; let div; @@ -23315,7 +23407,7 @@ t2 = space(); div = element("div"); if_block.c(); - attr(div, "class", "newsbox svelte-10fwss6"); + attr(div, "class", "newsbox svelte-1pjjwl2"); }, m(target, anchor) { insert(target, p, anchor); @@ -23346,6 +23438,80 @@ } }; } + function create_each_block2(ctx) { + let option; + let t0; + let t1; + let option_value_value; + return { + c() { + option = element("option"); + t0 = text("Method "); + t1 = text(ctx[59]); + option.__value = option_value_value = ctx[59]; + option.value = option.__value; + }, + m(target, anchor) { + insert(target, option, anchor); + append(option, t0); + append(option, t1); + }, + p: noop, + d(detaching) { + if (detaching) + detach(option); + } + }; + } + function create_default_slot_2(ctx) { + let label; + let t; + let select; + let mounted; + let dispose; + let each_value = [0, 1, 2, 3, 4]; + let each_blocks = []; + for (let i = 0; i < 5; i += 1) { + each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); + } + return { + c() { + label = element("label"); + t = text("PNG Embedding method\n "); + select = element("select"); + for (let i = 0; i < 5; i += 1) { + each_blocks[i].c(); + } + if (ctx[7].pmeth === void 0) + add_render_callback(() => ctx[57].call(select)); + }, + m(target, anchor) { + insert(target, label, anchor); + append(label, t); + append(label, select); + for (let i = 0; i < 5; i += 1) { + each_blocks[i].m(select, null); + } + select_option(select, ctx[7].pmeth); + if (!mounted) { + dispose = listen(select, "change", ctx[57]); + mounted = true; + } + }, + p(ctx2, dirty) { + if (dirty[0] & 128) { + select_option(select, ctx2[7].pmeth); + } + }, + d(detaching) { + if (detaching) + detach(label); + destroy_each(each_blocks, detaching); + mounted = false; + dispose(); + } + }; + } function create_if_block_12(ctx) { let tabpanel; let current; @@ -23418,39 +23584,47 @@ let t4; let tabpanel4; let t5; + let tabpanel5; + let t6; let if_block_anchor; let current; tablist = new TabList_default({ props: { - $$slots: { default: [create_default_slot_8] }, + $$slots: { default: [create_default_slot_9] }, $$scope: { ctx } } }); tabpanel0 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_7] }, + $$slots: { default: [create_default_slot_8] }, $$scope: { ctx } } }); tabpanel1 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_5] }, + $$slots: { default: [create_default_slot_6] }, $$scope: { ctx } } }); tabpanel2 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_4] }, + $$slots: { default: [create_default_slot_5] }, $$scope: { ctx } } }); tabpanel3 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_3] }, + $$slots: { default: [create_default_slot_4] }, $$scope: { ctx } } }); tabpanel4 = new TabPanel_default({ + props: { + $$slots: { default: [create_default_slot_3] }, + $$scope: { ctx } + } + }); + tabpanel5 = new TabPanel_default({ props: { $$slots: { default: [create_default_slot_2] }, $$scope: { ctx } @@ -23471,6 +23645,8 @@ t4 = space(); create_component(tabpanel4.$$.fragment); t5 = space(); + create_component(tabpanel5.$$.fragment); + t6 = space(); if (if_block) if_block.c(); if_block_anchor = empty(); @@ -23488,6 +23664,8 @@ insert(target, t4, anchor); mount_component(tabpanel4, target, anchor); insert(target, t5, anchor); + mount_component(tabpanel5, target, anchor); + insert(target, t6, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); @@ -23495,35 +23673,40 @@ }, p(ctx2, dirty) { const tablist_changes = {}; - if (dirty[0] & 256 | dirty[2] & 512) { + if (dirty[0] & 256 | dirty[2] & 8192) { tablist_changes.$$scope = { dirty, ctx: ctx2 }; } tablist.$set(tablist_changes); const tabpanel0_changes = {}; - if (dirty[0] & 896 | dirty[2] & 512) { + if (dirty[0] & 896 | dirty[2] & 8192) { tabpanel0_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel0.$set(tabpanel0_changes); const tabpanel1_changes = {}; - if (dirty[0] & 134 | dirty[2] & 512) { + if (dirty[0] & 134 | dirty[2] & 8192) { tabpanel1_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel1.$set(tabpanel1_changes); const tabpanel2_changes = {}; - if (dirty[0] & 128 | dirty[2] & 512) { + if (dirty[0] & 128 | dirty[2] & 8192) { tabpanel2_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel2.$set(tabpanel2_changes); const tabpanel3_changes = {}; - if (dirty[0] & 224 | dirty[2] & 512) { + if (dirty[0] & 224 | dirty[2] & 8192) { tabpanel3_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel3.$set(tabpanel3_changes); const tabpanel4_changes = {}; - if (dirty[0] & 8 | dirty[2] & 512) { + if (dirty[0] & 8 | dirty[2] & 8192) { tabpanel4_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel4.$set(tabpanel4_changes); + const tabpanel5_changes = {}; + if (dirty[0] & 128 | dirty[2] & 8192) { + tabpanel5_changes.$$scope = { dirty, ctx: ctx2 }; + } + tabpanel5.$set(tabpanel5_changes); if (ctx2[8].akValid) { if (if_block) { if (dirty[0] & 256) { @@ -23552,6 +23735,7 @@ transition_in(tabpanel2.$$.fragment, local); transition_in(tabpanel3.$$.fragment, local); transition_in(tabpanel4.$$.fragment, local); + transition_in(tabpanel5.$$.fragment, local); transition_in(if_block); current = true; }, @@ -23562,6 +23746,7 @@ transition_out(tabpanel2.$$.fragment, local); transition_out(tabpanel3.$$.fragment, local); transition_out(tabpanel4.$$.fragment, local); + transition_out(tabpanel5.$$.fragment, local); transition_out(if_block); current = false; }, @@ -23584,6 +23769,9 @@ destroy_component(tabpanel4, detaching); if (detaching) detach(t5); + destroy_component(tabpanel5, detaching); + if (detaching) + detach(t6); if (if_block) if_block.d(detaching); if (detaching) @@ -23663,7 +23851,6 @@ function appendBooru() { if (true) { request(newbooru.domain); - alert("Requested! Please click the PEE icon to validate"); } set_store_value(settings, $settings.rsources = [...$settings.rsources, newbooru], $settings); dial.toggle(); @@ -23859,6 +24046,10 @@ $settings.tm = this.checked; settings.set($settings); } + function select_change_handler_1() { + $settings.pmeth = select_value(this); + settings.set($settings); + } $$self.$$set = ($$props2) => { if ("rev" in $$props2) $$invalidate(0, rev = $$props2.rev); @@ -23920,7 +24111,8 @@ keydown_handler, select_change_handler, input_input_handler_2, - input_change_handler_2 + input_change_handler_2, + select_change_handler_1 ]; } var App = class extends SvelteComponent { @@ -25373,7 +25565,7 @@ yield post.querySelector("a[rel]")?.getAttribute("href") || ""; }, getFilename: (post) => { - const opfn = post.querySelector("a.post_file_filename")?.textContent; + const opfn = post.querySelector(".post_file_filename")?.textContent; if (opfn) return opfn; const a = post.querySelector("a[rel]"); @@ -26601,10 +26793,12 @@ if (!supportedMainDomain(location.host) && !supportedAltDomain(location.host)) throw "PEE not supported here, skipping"; var qp; - var csettings6 = initial_settings; + var csettings5; var processors = [thirdeye_default, pomf_default, pngv3_default, jpg_default, webm_default, gif_default]; var cappState; settings.subscribe(async (b) => { + if (!b) + return; if (b.hyd) { if (b.ak) { const hydCli = new HydrusClient(b.ak); @@ -26621,9 +26815,9 @@ } } } - csettings6 = b; + csettings5 = b; processors = [ - ...!csettings6.te ? [thirdeye_default] : [], + ...!csettings5.te ? [thirdeye_default] : [], pngv3_default, pomf_default, jpg_default, @@ -26685,7 +26879,9 @@ var textToElement = (s) => document.createRange().createContextualFragment(s).children[0]; var pendingPosts = []; var signalNewEmbeds = debounce(async () => { - if (!csettings6.tm) + if (!csettings5) + return; + if (!csettings5.tm) return; try { const boardname = location.pathname.match(/\/([^/]*)\//)[1]; @@ -26707,7 +26903,9 @@ var shouldUseCache = () => { if (cappState.isCatalog) return false; - return typeof csettings6.cache == "boolean" ? csettings6.cache : location.hostname.includes("b4k"); + if (!csettings5) + return false; + return typeof csettings5.cache == "boolean" ? csettings5.cache : location.hostname.includes("b4k"); }; var processPost = async (post) => { const origlink = qp.getImageLink(post); @@ -26718,7 +26916,9 @@ return; let res2 = void 0; const reportEmbed = () => { - if (csettings6.tm) { + if (!csettings5) + return false; + if (csettings5.tm) { if (["boards.4chan.org", "boards.4channel.org"].includes(location.host)) { if (!cappState.isCatalog) { const op = +location.pathname.match(/\/thread\/(.*)/)[1]; @@ -26765,7 +26965,9 @@ navigator.clipboard.writeText(text3); } var scrapeBoard = async (self) => { - if (csettings6.tm) { + if (!csettings5) + return false; + if (csettings5.tm) { fireNotification("success", "Scrapping board with telemetry on! Thank you for your service, selfless stranger ;_;7"); } self.disabled = true; @@ -26893,7 +27095,15 @@ Use the WebExtension version of PEE if you want to use b4k!`); return; else qp = lqp; - if (csettings6.vercheck) + await new Promise((_) => { + settings.subscribe((val) => { + if (val) + _(); + }); + }); + if (!csettings5) + return false; + if (csettings5.vercheck) versionCheck(); const postQuote = ({ scanner, parser, utils }) => { const { CLOSEANGLEBRACKET: CLOSEANGLEBRACKET2, NUM: NUM2 } = scanner.tokens; @@ -26944,7 +27154,9 @@ Use the WebExtension version of PEE if you want to use b4k!`); rec.addedNodes.forEach((e) => { if (!(e instanceof HTMLElement)) return; - if (cappState.isCatalog && csettings6.notcata) + if (!csettings5) + return false; + if (cappState.isCatalog && csettings5.notcata) return; let el = qp.postsWithFiles(e); if (!el && e.classList.contains("postContainer")) @@ -27006,7 +27218,7 @@ Use the WebExtension version of PEE if you want to use b4k!`); button2.onclick = () => scrapeBoard(button2); opts.insertAdjacentElement("beforebegin", button2); } - if (csettings6.notcata) + if (csettings5.notcata) return; } const n = 7; diff --git a/firefox/manifest.json b/firefox/manifest.json index 05a0f74..7c739d0 100644 --- a/firefox/manifest.json +++ b/firefox/manifest.json @@ -7,7 +7,7 @@ }, "name": "PngExtraEmbedder", "description": "Discover embedded files on 4chan and archives!", - "version": "0.273", + "version": "0.275", "icons": { "64": "1449696017588.png" }, diff --git a/firefox_update.json b/firefox_update.json index 6a4adb5..1878b8c 100644 --- a/firefox_update.json +++ b/firefox_update.json @@ -1 +1 @@ -{"addons":{"{34ac4994-07f2-44d2-8599-682516a6c6a6}":{"updates":[{"version":"0.273","update_link":"https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.273.xpi"}]}}} \ No newline at end of file +{"addons":{"{34ac4994-07f2-44d2-8599-682516a6c6a6}":{"updates":[{"version":"0.275","update_link":"https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.275.xpi"}]}}} \ No newline at end of file diff --git a/main.meta.js b/main.meta.js index e8195f7..4bc1fdf 100644 --- a/main.meta.js +++ b/main.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.273 +// @version 0.275 // @description uhh // @author You // @match https://boards.4channel.org/* diff --git a/main.user.js b/main.user.js index cdf4761..7f37b26 100644 --- a/main.user.js +++ b/main.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.273 +// @version 0.275 // @description uhh // @author You // @match https://boards.4channel.org/* @@ -109,7 +109,7 @@ const _DOMParser = DOMParser; var define_BUILD_VERSION_default; var init_define_BUILD_VERSION = __esm({ ""() { - define_BUILD_VERSION_default = [0, 273]; + define_BUILD_VERSION_default = [0, 275]; } }); @@ -13990,12 +13990,33 @@ const _DOMParser = DOMParser; } // src/stores.ts - var localLoad = (key2, def) => "__pee__" + key2 in localStorage ? JSON.parse(localStorage.getItem("__pee__" + key2)) : def; - var localSet = (key2, value) => localStorage.setItem("__pee__" + key2, JSON.stringify(value)); + var localLoad = async (key2, def) => { + const isinls = "__pee__" + key2 in localStorage; + const ret = isinls ? { ...def, ...JSON.parse(localStorage.getItem("__pee__" + key2)) } : def; + if (false) { + if (isinls) { + delete localStorage["__pee__" + key2]; + await chrome.storage.local.set({ + [key2]: JSON.stringify(ret) + }); + } else { + const d = await chrome.storage.local.get([key2]); + if (typeof d[key2] == "string") + return { ...def, ...await JSON.parse("" + d[key2] || "{}") }; + } + } + return ret; + }; + var localSet = (key2, value) => { + if (false) + chrome.storage.local.set({ [key2]: JSON.stringify(value) }); + else + localStorage.setItem("__pee__" + key2, JSON.stringify(value)); + }; var initial_settings = localLoad("settingsv2", { - ...localLoad("settings", {}), loop: true, dh: false, + pmeth: 4, xpv: false, xpi: false, hyd: false, @@ -14024,10 +14045,12 @@ const _DOMParser = DOMParser; conc: 8, ho: false, blacklist: [], - rsources: [], - ...localLoad("settingsv2", {}) + rsources: [] + }); + var settings = writable(); + initial_settings.then((v) => { + settings.set(v); }); - var settings = writable(initial_settings); var appState = writable({ isCatalog: false, is4chanX: false, @@ -14371,6 +14394,7 @@ const _DOMParser = DOMParser; "archived.moe", "archive.nyafuu.org", "arch.b4k.co", + "archive.4plebs.org", "archive.wakarimasen.moe", "b4k.co", "fireden.net", @@ -16433,6 +16457,8 @@ const _DOMParser = DOMParser; return threadDataCache; }; var getEmbedsFromCache = async (board, op, pid) => { + if (!csettings) + throw new Error("Settings uninit"); await getThreadDataCache(board, op); const target = +pid.slice(pid.match(/\d/).index); const cachedData = cthreadDataCache[target]; @@ -16472,6 +16498,8 @@ const _DOMParser = DOMParser; return ret; }; var decodeCoom3Payload = async (buff) => { + if (!csettings) + throw new Error("Settings uninit"); const allowed_domains = filehosts.map((e) => e.serving.replaceAll(".", "\\.")); const pees = buff.toString().split(" ").slice(0, csettings.maxe).filter((e) => allowed_domains.some((v) => e.match(`https://(.*\\.)?${v}/`))); return (await Promise.all(pees.map(async (pee) => { @@ -16549,6 +16577,8 @@ const _DOMParser = DOMParser; let total = 0; fireNotification("info", `Uploading ${injs.length} files...`); return await Promise.all(injs.map(async (inj) => { + if (!csettings) + throw new Error("Settings uninit"); const peefile = await buildPeeFile(inj); const ret = await filehosts[csettings.fhost || 0].uploadFile(peefile); fireNotification("info", `Uploaded files [${++total}/${injs.length}] ${ret}`); @@ -16679,6 +16709,8 @@ const _DOMParser = DOMParser; const sneed = new PNGDecoder(reader); const ret = []; let w; + if (!csettings2) + throw new Error("Settings uninit"); try { for await (const [name, chunk, crc, offset] of sneed.chunks()) { let buff; @@ -16754,6 +16786,8 @@ const _DOMParser = DOMParser; return [ret, () => b]; }; var inject_data = async (container, injb) => { + if (!csettings2) + throw new Error("Settings uninit"); let magic4 = false; const [writestream, extract7] = BufferWriteStream2(); const encoder = new PNGEncoder(writestream); @@ -16763,7 +16797,24 @@ const _DOMParser = DOMParser; break; if (!magic4 && name == "IDAT") { const passed = import_buffer3.Buffer.from(injb); - await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM7, passed])), () => Promise.resolve(0), 0]); + switch (csettings2.pmeth) { + case 0: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM3, passed])), () => Promise.resolve(0), 0]); + break; + case 1: + xor(passed, password); + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM4, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 2: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM5, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 3: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM6, import_buffer3.Buffer.from(import_buffer3.Buffer.from(passed).toString("base64"))])), () => Promise.resolve(0), 0]); + break; + case 4: + await encoder.insertchunk(["tEXt", async () => buildChunk("tEXt", import_buffer3.Buffer.concat([CUM7, import_buffer3.Buffer.from(bs58.encode(passed))])), () => Promise.resolve(0), 0]); + break; + } magic4 = true; } await encoder.insertchunk([name, chunk, crc, offset]); @@ -16786,7 +16837,7 @@ const _DOMParser = DOMParser; } return ""; }); - const injb = import_buffer3.Buffer.from(bs58.encode(import_buffer3.Buffer.from(links.join(" ")))); + const injb = import_buffer3.Buffer.from(links.join(" ")); return inject_data(container, injb); }; var has_embed = async (png) => { @@ -18762,10 +18813,6 @@ const _DOMParser = DOMParser; }; // src/jpg.ts - var csettings3; - settings.subscribe((b) => { - csettings3 = b; - }); var key = import_buffer6.Buffer.from("CUNNYCUNNYCUNNY"); var f5inst = new f5stego(key); var inject4 = async (b, links) => { @@ -18863,9 +18910,9 @@ const _DOMParser = DOMParser; }; // src/thirdeye.ts - var csettings4; + var csettings3; settings.subscribe((b) => { - csettings4 = b; + csettings3 = b; }); var gelquirk = (prefix) => (a) => { let base = a.post || a.data || a; @@ -18886,6 +18933,8 @@ const _DOMParser = DOMParser; var phashEn = false; var mindist = 5; settings.subscribe((s) => { + if (!s) + return; experimentalApi = s.expte; boorus = s.rsources.map((e) => ({ ...e, @@ -18895,10 +18944,7 @@ const _DOMParser = DOMParser; mindist = s.mdist || 5; phashEn = s.phash; }); - var boorus = localLoad("settingsv2", { rsources: [] }).rsources.map((e) => ({ - ...e, - quirks: gelquirk(e.view) - })); + var boorus = []; var unlockQueue = Promise.resolve(); var cache = {}; var findFileFrom = async (b, hex, abort) => { @@ -18921,6 +18967,8 @@ const _DOMParser = DOMParser; } }; var extract5 = async (b, fn) => { + if (!csettings3) + throw new Error("Settings uninit"); let result; let booru; for (const e of Object.values(boorus)) { @@ -18942,8 +18990,8 @@ const _DOMParser = DOMParser; url: result[0].page }, filename: fn.substring(0, 33) + result[0].ext, - thumbnail: csettings4.hotlink ? prev || full : import_buffer7.Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), - data: csettings4.hotlink ? full || prev : async (lsn) => { + thumbnail: csettings3.hotlink ? prev || full : import_buffer7.Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), + data: csettings3.hotlink ? full || prev : async (lsn) => { if (!cachedFile) cachedFile = await (await ifetch(full || prev, void 0, lsn)).arrayBuffer(); return import_buffer7.Buffer.from(cachedFile); @@ -19009,9 +19057,9 @@ const _DOMParser = DOMParser; { host: "Litter", prefix: "litter.catbox.moe/" }, { host: "Zzzz", prefix: "z.zz.fo/" } ]; - var csettings5; + var csettings4; settings.subscribe((b) => { - csettings5 = b; + csettings4 = b; }); var getExt = (fn) => { const isB64 = fn.match(/^((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=))?\.(gif|jpe?g|png|webm)/); @@ -19037,6 +19085,8 @@ const _DOMParser = DOMParser; return { ext, source }; }; var extract6 = async (b, fn) => { + if (!csettings4) + throw new Error("Settings uninit"); const { ext, source } = getExt(fn); let rsource; for (const cs of sources) { @@ -19051,7 +19101,7 @@ const _DOMParser = DOMParser; } return [{ filename: ext, - data: csettings5.hotlink ? rsource : async (lsn) => { + data: csettings4.hotlink ? rsource : async (lsn) => { try { return import_buffer8.Buffer.from(await (await ifetch(rsource, void 0, lsn)).arrayBuffer()); } catch (e) { @@ -21073,34 +21123,39 @@ const _DOMParser = DOMParser; // src/Components/App.svelte function add_css8(target) { - append_styles(target, "svelte-10fwss6", '.bepis.svelte-10fwss6.svelte-10fwss6{max-height:260px;overflow-y:auto}.tagcont.svelte-10fwss6.svelte-10fwss6{display:flex;gap:5px;margin-bottom:10px;flex-wrap:wrap}label.svelte-10fwss6>input[type="text"].svelte-10fwss6,label.svelte-10fwss6>input[type="number"].svelte-10fwss6{width:95%}.content.svelte-10fwss6.svelte-10fwss6{display:flex;flex-direction:column}.error.svelte-10fwss6.svelte-10fwss6{color:red}hr.svelte-10fwss6.svelte-10fwss6{width:100%}h1.svelte-10fwss6.svelte-10fwss6{text-align:center;margin-bottom:0}h4.svelte-10fwss6.svelte-10fwss6{text-align:center;margin:0}.form.svelte-10fwss6.svelte-10fwss6{display:flex;flex-direction:column;gap:20px;position:absolute;padding:15px;border:1px solid white;background-color:black;border-radius:10px}.form.svelte-10fwss6>label.svelte-10fwss6{display:flex;flex-direction:column;gap:10px}.newsbox.svelte-10fwss6.svelte-10fwss6{max-height:300px;overflow-y:scroll}.backpanel.svelte-10fwss6.svelte-10fwss6{position:absolute;right:32px;padding:10px;width:15%;top:32px;border:1px solid;border-radius:5px;background-color:rgba(0, 0, 0, 0.8);pointer-events:all;backdrop-filter:blur(9px);max-height:80vh;min-width:321px}'); + append_styles(target, "svelte-1pjjwl2", '.bepis.svelte-1pjjwl2.svelte-1pjjwl2{max-height:260px;overflow-y:auto}.tagcont.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;gap:5px;margin-bottom:10px;flex-wrap:wrap}label.svelte-1pjjwl2>input[type="text"].svelte-1pjjwl2,label.svelte-1pjjwl2>input[type="number"].svelte-1pjjwl2{width:95%}.content.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;flex-direction:column}.error.svelte-1pjjwl2.svelte-1pjjwl2{color:red}hr.svelte-1pjjwl2.svelte-1pjjwl2{width:100%}h1.svelte-1pjjwl2.svelte-1pjjwl2{text-align:center;margin-bottom:0}h4.svelte-1pjjwl2.svelte-1pjjwl2{text-align:center;margin:0}.form.svelte-1pjjwl2.svelte-1pjjwl2{display:flex;flex-direction:column;gap:20px;position:absolute;padding:15px;border:1px solid white;background-color:black;border-radius:10px}.form.svelte-1pjjwl2>label.svelte-1pjjwl2{display:flex;flex-direction:column;gap:10px}.newsbox.svelte-1pjjwl2.svelte-1pjjwl2{max-height:300px;overflow-y:scroll}.backpanel.svelte-1pjjwl2.svelte-1pjjwl2{position:absolute;right:32px;padding:10px;width:15%;top:32px;border:1px solid;border-radius:5px;background-color:rgba(0, 0, 0, 0.8);pointer-events:all;backdrop-filter:blur(9px);max-height:80vh;min-width:321px}'); } function get_each_context2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[58] = list[i]; + child_ctx[59] = list[i]; return child_ctx; } function get_each_context_12(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[61] = list[i]; + child_ctx[62] = list[i]; return child_ctx; } function get_each_context_2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[64] = list[i]; - child_ctx[66] = i; + child_ctx[65] = list[i]; return child_ctx; } function get_each_context_3(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[67] = list[i]; - child_ctx[66] = i; + child_ctx[68] = list[i]; + child_ctx[70] = i; return child_ctx; } function get_each_context_4(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[69] = list[i]; - child_ctx[66] = i; + child_ctx[71] = list[i]; + child_ctx[70] = i; + return child_ctx; + } + function get_each_context_5(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[73] = list[i]; + child_ctx[70] = i; return child_ctx; } function create_if_block6(ctx) { @@ -21137,11 +21192,11 @@ const _DOMParser = DOMParser; hr = element("hr"); t5 = space(); create_component(tabs.$$.fragment); - attr(h1, "class", "svelte-10fwss6"); - attr(h4, "class", "svelte-10fwss6"); - attr(hr, "class", "svelte-10fwss6"); - attr(div0, "class", "content svelte-10fwss6"); - attr(div1, "class", "backpanel svelte-10fwss6"); + attr(h1, "class", "svelte-1pjjwl2"); + attr(h4, "class", "svelte-1pjjwl2"); + attr(hr, "class", "svelte-1pjjwl2"); + attr(div0, "class", "content svelte-1pjjwl2"); + attr(div1, "class", "backpanel svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div1, anchor); @@ -21161,7 +21216,7 @@ const _DOMParser = DOMParser; if (!current || dirty[0] & 1) set_data(t1, ctx2[0]); const tabs_changes = {}; - if (dirty[0] & 1006 | dirty[2] & 512) { + if (dirty[0] & 1006 | dirty[2] & 8192) { tabs_changes.$$scope = { dirty, ctx: ctx2 }; } tabs.$set(tabs_changes); @@ -21193,7 +21248,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_14(ctx) { + function create_default_slot_16(ctx) { let t; return { c() { @@ -21208,7 +21263,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_13(ctx) { + function create_default_slot_15(ctx) { let t; return { c() { @@ -21223,7 +21278,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_12(ctx) { + function create_default_slot_14(ctx) { let t; return { c() { @@ -21238,7 +21293,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_11(ctx) { + function create_default_slot_13(ctx) { let t; return { c() { @@ -21253,7 +21308,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_10(ctx) { + function create_default_slot_12(ctx) { let t; return { c() { @@ -21268,12 +21323,27 @@ const _DOMParser = DOMParser; } }; } + function create_default_slot_11(ctx) { + let t; + return { + c() { + t = text("Advanced"); + }, + m(target, anchor) { + insert(target, t, anchor); + }, + d(detaching) { + if (detaching) + detach(t); + } + }; + } function create_if_block_11(ctx) { let tab; let current; tab = new Tab_default({ props: { - $$slots: { default: [create_default_slot_9] }, + $$slots: { default: [create_default_slot_10] }, $$scope: { ctx } } }); @@ -21300,7 +21370,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_9(ctx) { + function create_default_slot_10(ctx) { let t; return { c() { @@ -21315,7 +21385,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_8(ctx) { + function create_default_slot_9(ctx) { let tab0; let t0; let tab1; @@ -21326,40 +21396,48 @@ const _DOMParser = DOMParser; let t3; let tab4; let t4; + let tab5; + let t5; let if_block_anchor; let current; tab0 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_14] }, + $$slots: { default: [create_default_slot_16] }, $$scope: { ctx } } }); tab1 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_13] }, + $$slots: { default: [create_default_slot_15] }, $$scope: { ctx } } }); tab2 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_12] }, + $$slots: { default: [create_default_slot_14] }, $$scope: { ctx } } }); tab3 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_11] }, + $$slots: { default: [create_default_slot_13] }, $$scope: { ctx } } }); tab3.$on("select", ctx[18]); tab4 = new Tab_default({ props: { - $$slots: { default: [create_default_slot_10] }, + $$slots: { default: [create_default_slot_12] }, $$scope: { ctx } } }); tab4.$on("select", ctx[19]); + tab5 = new Tab_default({ + props: { + $$slots: { default: [create_default_slot_11] }, + $$scope: { ctx } + } + }); let if_block = ctx[8].akValid && create_if_block_11(ctx); return { c() { @@ -21373,6 +21451,8 @@ const _DOMParser = DOMParser; t3 = space(); create_component(tab4.$$.fragment); t4 = space(); + create_component(tab5.$$.fragment); + t5 = space(); if (if_block) if_block.c(); if_block_anchor = empty(); @@ -21388,6 +21468,8 @@ const _DOMParser = DOMParser; insert(target, t3, anchor); mount_component(tab4, target, anchor); insert(target, t4, anchor); + mount_component(tab5, target, anchor); + insert(target, t5, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); @@ -21395,30 +21477,35 @@ const _DOMParser = DOMParser; }, p(ctx2, dirty) { const tab0_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab0_changes.$$scope = { dirty, ctx: ctx2 }; } tab0.$set(tab0_changes); const tab1_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab1_changes.$$scope = { dirty, ctx: ctx2 }; } tab1.$set(tab1_changes); const tab2_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab2_changes.$$scope = { dirty, ctx: ctx2 }; } tab2.$set(tab2_changes); const tab3_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab3_changes.$$scope = { dirty, ctx: ctx2 }; } tab3.$set(tab3_changes); const tab4_changes = {}; - if (dirty[2] & 512) { + if (dirty[2] & 8192) { tab4_changes.$$scope = { dirty, ctx: ctx2 }; } tab4.$set(tab4_changes); + const tab5_changes = {}; + if (dirty[2] & 8192) { + tab5_changes.$$scope = { dirty, ctx: ctx2 }; + } + tab5.$set(tab5_changes); if (ctx2[8].akValid) { if (if_block) { if (dirty[0] & 256) { @@ -21446,6 +21533,7 @@ const _DOMParser = DOMParser; transition_in(tab2.$$.fragment, local); transition_in(tab3.$$.fragment, local); transition_in(tab4.$$.fragment, local); + transition_in(tab5.$$.fragment, local); transition_in(if_block); current = true; }, @@ -21455,6 +21543,7 @@ const _DOMParser = DOMParser; transition_out(tab2.$$.fragment, local); transition_out(tab3.$$.fragment, local); transition_out(tab4.$$.fragment, local); + transition_out(tab5.$$.fragment, local); transition_out(if_block); current = false; }, @@ -21474,6 +21563,9 @@ const _DOMParser = DOMParser; destroy_component(tab4, detaching); if (detaching) detach(t4); + destroy_component(tab5, detaching); + if (detaching) + detach(t5); if (if_block) if_block.d(detaching); if (detaching) @@ -21547,8 +21639,8 @@ const _DOMParser = DOMParser; if_block1_anchor = empty(); attr(a, "title", "Only requires Search Files permission. See Hydrus docs on where to set this up."); attr(input, "type", "text"); - attr(input, "class", "svelte-10fwss6"); - attr(label, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { if (if_block0) @@ -21624,7 +21716,7 @@ const _DOMParser = DOMParser; c() { span = element("span"); t = text(t_value); - attr(span, "class", "error svelte-10fwss6"); + attr(span, "class", "error svelte-1pjjwl2"); }, m(target, anchor) { insert(target, span, anchor); @@ -21661,12 +21753,12 @@ const _DOMParser = DOMParser; input1 = element("input"); set_style(input0, "width", "5ch"); attr(input0, "type", "number"); - attr(input0, "class", "svelte-10fwss6"); - attr(label0, "class", "svelte-10fwss6"); + attr(input0, "class", "svelte-1pjjwl2"); + attr(label0, "class", "svelte-1pjjwl2"); attr(input1, "placeholder", "Restrict to these tags (space to separate tags, _ to separate words)"); attr(input1, "type", "text"); - attr(input1, "class", "svelte-10fwss6"); - attr(label1, "class", "svelte-10fwss6"); + attr(input1, "class", "svelte-1pjjwl2"); + attr(label1, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, label0, anchor); @@ -21706,7 +21798,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_7(ctx) { + function create_default_slot_8(ctx) { let label0; let input0; let t0; @@ -22159,24 +22251,24 @@ const _DOMParser = DOMParser; let dispose; let if_block0 = ctx[7].phash && create_if_block_62(ctx); let if_block1 = ctx[7].rsources.length == 0 && create_if_block_52(ctx); - let each_value_4 = ctx[7].rsources; + let each_value_5 = ctx[7].rsources; let each_blocks_1 = []; - for (let i = 0; i < each_value_4.length; i += 1) { - each_blocks_1[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); + for (let i = 0; i < each_value_5.length; i += 1) { + each_blocks_1[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i)); } const out = (i) => transition_out(each_blocks_1[i], 1, 1, () => { each_blocks_1[i] = null; }); let dialog_props = { - $$slots: { default: [create_default_slot_6] }, + $$slots: { default: [create_default_slot_7] }, $$scope: { ctx } }; dialog = new Dialog_default({ props: dialog_props }); ctx[51](dialog); - let each_value_3 = ctx[7].blacklist; + let each_value_4 = ctx[7].blacklist; let each_blocks = []; - for (let i = 0; i < each_value_3.length; i += 1) { - each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); + for (let i = 0; i < each_value_4.length; i += 1) { + each_blocks[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); } const out_1 = (i) => transition_out(each_blocks[i], 1, 1, () => { each_blocks[i] = null; @@ -22218,9 +22310,9 @@ const _DOMParser = DOMParser; t13 = space(); input1 = element("input"); attr(input0, "type", "checkbox"); - attr(div0, "class", "tagcont svelte-10fwss6"); - attr(hr, "class", "svelte-10fwss6"); - attr(div1, "class", "tagcont svelte-10fwss6"); + attr(div0, "class", "tagcont svelte-1pjjwl2"); + attr(hr, "class", "svelte-1pjjwl2"); + attr(div1, "class", "tagcont svelte-1pjjwl2"); attr(input1, "placeholder", "Press enter after typing your tag"); }, m(target, anchor) { @@ -22294,48 +22386,48 @@ const _DOMParser = DOMParser; if_block1 = null; } if (dirty[0] & 73856) { - each_value_4 = ctx2[7].rsources; + each_value_5 = ctx2[7].rsources; let i; - for (i = 0; i < each_value_4.length; i += 1) { - const child_ctx = get_each_context_4(ctx2, each_value_4, i); + for (i = 0; i < each_value_5.length; i += 1) { + const child_ctx = get_each_context_5(ctx2, each_value_5, i); if (each_blocks_1[i]) { each_blocks_1[i].p(child_ctx, dirty); transition_in(each_blocks_1[i], 1); } else { - each_blocks_1[i] = create_each_block_4(child_ctx); + each_blocks_1[i] = create_each_block_5(child_ctx); each_blocks_1[i].c(); transition_in(each_blocks_1[i], 1); each_blocks_1[i].m(div0, null); } } group_outros(); - for (i = each_value_4.length; i < each_blocks_1.length; i += 1) { + for (i = each_value_5.length; i < each_blocks_1.length; i += 1) { out(i); } check_outros(); } const dialog_changes = {}; - if (dirty[0] & 2 | dirty[2] & 512) { + if (dirty[0] & 2 | dirty[2] & 8192) { dialog_changes.$$scope = { dirty, ctx: ctx2 }; } dialog.$set(dialog_changes); if (dirty[0] & 4224) { - each_value_3 = ctx2[7].blacklist; + each_value_4 = ctx2[7].blacklist; let i; - for (i = 0; i < each_value_3.length; i += 1) { - const child_ctx = get_each_context_3(ctx2, each_value_3, i); + for (i = 0; i < each_value_4.length; i += 1) { + const child_ctx = get_each_context_4(ctx2, each_value_4, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { - each_blocks[i] = create_each_block_3(child_ctx); + each_blocks[i] = create_each_block_4(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(div1, null); } } group_outros(); - for (i = each_value_3.length; i < each_blocks.length; i += 1) { + for (i = each_value_4.length; i < each_blocks.length; i += 1) { out_1(i); } check_outros(); @@ -22344,11 +22436,11 @@ const _DOMParser = DOMParser; i(local) { if (current) return; - for (let i = 0; i < each_value_4.length; i += 1) { + for (let i = 0; i < each_value_5.length; i += 1) { transition_in(each_blocks_1[i]); } transition_in(dialog.$$.fragment, local); - for (let i = 0; i < each_value_3.length; i += 1) { + for (let i = 0; i < each_value_4.length; i += 1) { transition_in(each_blocks[i]); } current = true; @@ -22430,9 +22522,9 @@ const _DOMParser = DOMParser; a = element("a"); a.textContent = "?"; attr(input, "type", "number"); - attr(input, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); attr(a, "title", "Higher will filter more potentially different images, lower will let more identical images through"); - attr(label, "class", "svelte-10fwss6"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, label, anchor); @@ -22474,21 +22566,21 @@ const _DOMParser = DOMParser; } }; } - function create_each_block_4(ctx) { + function create_each_block_5(ctx) { let tag; let current; function func(...args) { - return ctx[43](ctx[69], ...args); + return ctx[43](ctx[73], ...args); } function remove_handler() { - return ctx[44](ctx[69]); + return ctx[44](ctx[73]); } function toggle_handler() { - return ctx[45](ctx[69]); + return ctx[45](ctx[73]); } tag = new Tag_default({ props: { - tag: ctx[69].name, + tag: ctx[73].name, toggleable: true, toggled: !ctx[7].rsources.find(func)?.disabled } @@ -22507,7 +22599,7 @@ const _DOMParser = DOMParser; ctx = new_ctx; const tag_changes = {}; if (dirty[0] & 128) - tag_changes.tag = ctx[69].name; + tag_changes.tag = ctx[73].name; if (dirty[0] & 128) tag_changes.toggled = !ctx[7].rsources.find(func)?.disabled; tag.$set(tag_changes); @@ -22527,7 +22619,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_6(ctx) { + function create_default_slot_7(ctx) { let div; let label0; let t0; @@ -22571,21 +22663,21 @@ const _DOMParser = DOMParser; button.textContent = "Add"; attr(input0, "type", "text"); attr(input0, "placeholder", "Safebooru"); - attr(input0, "class", "svelte-10fwss6"); - attr(label0, "class", "svelte-10fwss6"); + attr(input0, "class", "svelte-1pjjwl2"); + attr(label0, "class", "svelte-1pjjwl2"); attr(input1, "type", "text"); attr(input1, "placeholder", "safebooru.com"); - attr(input1, "class", "svelte-10fwss6"); - attr(label1, "class", "svelte-10fwss6"); + attr(input1, "class", "svelte-1pjjwl2"); + attr(label1, "class", "svelte-1pjjwl2"); attr(input2, "type", "text"); attr(input2, "placeholder", "/post.json?tags=md5:"); - attr(input2, "class", "svelte-10fwss6"); - attr(label2, "class", "svelte-10fwss6"); + attr(input2, "class", "svelte-1pjjwl2"); + attr(label2, "class", "svelte-1pjjwl2"); attr(input3, "type", "text"); attr(input3, "placeholder", "https://safebooru.com/post/show/"); - attr(input3, "class", "svelte-10fwss6"); - attr(label3, "class", "svelte-10fwss6"); - attr(div, "class", "form svelte-10fwss6"); + attr(input3, "class", "svelte-1pjjwl2"); + attr(label3, "class", "svelte-1pjjwl2"); + attr(div, "class", "form svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div, anchor); @@ -22643,13 +22735,13 @@ const _DOMParser = DOMParser; } }; } - function create_each_block_3(ctx) { + function create_each_block_4(ctx) { let tag; let current; function toggle_handler_1() { - return ctx[52](ctx[67]); + return ctx[52](ctx[71]); } - tag = new Tag_default({ props: { tag: ctx[67] } }); + tag = new Tag_default({ props: { tag: ctx[71] } }); tag.$on("toggle", toggle_handler_1); return { c() { @@ -22663,7 +22755,7 @@ const _DOMParser = DOMParser; ctx = new_ctx; const tag_changes = {}; if (dirty[0] & 128) - tag_changes.tag = ctx[67]; + tag_changes.tag = ctx[71]; tag.$set(tag_changes); }, i(local) { @@ -22681,7 +22773,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_5(ctx) { + function create_default_slot_6(ctx) { let label; let input; let t0; @@ -22765,16 +22857,16 @@ const _DOMParser = DOMParser; } }; } - function create_each_block_2(ctx) { + function create_each_block_3(ctx) { let option; - let t_value = ctx[64].domain + ""; + let t_value = ctx[68].domain + ""; let t; let option_value_value; return { c() { option = element("option"); t = text(t_value); - option.__value = option_value_value = ctx[66]; + option.__value = option_value_value = ctx[70]; option.value = option.__value; }, m(target, anchor) { @@ -22788,7 +22880,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_4(ctx) { + function create_default_slot_5(ctx) { let p; let t1; let select; @@ -22798,10 +22890,10 @@ const _DOMParser = DOMParser; let input; let mounted; let dispose; - let each_value_2 = filehosts; + let each_value_3 = filehosts; let each_blocks = []; - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); + for (let i = 0; i < each_value_3.length; i += 1) { + each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); } return { c() { @@ -22819,8 +22911,8 @@ const _DOMParser = DOMParser; if (ctx[7].fhost === void 0) add_render_callback(() => ctx[54].call(select)); attr(input, "type", "number"); - attr(input, "class", "svelte-10fwss6"); - attr(label, "class", "svelte-10fwss6"); + attr(input, "class", "svelte-1pjjwl2"); + attr(label, "class", "svelte-1pjjwl2"); }, m(target, anchor) { insert(target, p, anchor); @@ -22845,14 +22937,14 @@ const _DOMParser = DOMParser; }, p(ctx2, dirty) { if (dirty & 0) { - each_value_2 = filehosts; + each_value_3 = filehosts; let i; - for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_2(ctx2, each_value_2, i); + for (i = 0; i < each_value_3.length; i += 1) { + const child_ctx = get_each_context_3(ctx2, each_value_3, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_2(child_ctx); + each_blocks[i] = create_each_block_3(child_ctx); each_blocks[i].c(); each_blocks[i].m(select, null); } @@ -22860,7 +22952,7 @@ const _DOMParser = DOMParser; for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value_2.length; + each_blocks.length = each_value_3.length; } if (dirty[0] & 128) { select_option(select, ctx2[7].fhost); @@ -22907,10 +22999,10 @@ const _DOMParser = DOMParser; let div; let p; let t1; - let each_value_1 = ctx[6]; + let each_value_2 = ctx[6]; let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i)); + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); } return { c() { @@ -22921,7 +23013,7 @@ const _DOMParser = DOMParser; for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - attr(div, "class", "bepis svelte-10fwss6"); + attr(div, "class", "bepis svelte-1pjjwl2"); }, m(target, anchor) { insert(target, div, anchor); @@ -22933,14 +23025,14 @@ const _DOMParser = DOMParser; }, p(ctx2, dirty) { if (dirty[0] & 16448) { - each_value_1 = ctx2[6]; + each_value_2 = ctx2[6]; let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_12(ctx2, each_value_1, i); + for (i = 0; i < each_value_2.length; i += 1) { + const child_ctx = get_each_context_2(ctx2, each_value_2, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_12(child_ctx); + each_blocks[i] = create_each_block_2(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, null); } @@ -22948,7 +23040,7 @@ const _DOMParser = DOMParser; for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value_1.length; + each_blocks.length = each_value_2.length; } }, d(detaching) { @@ -22958,18 +23050,18 @@ const _DOMParser = DOMParser; } }; } - function create_each_block_12(ctx) { + function create_each_block_2(ctx) { let div; let a; let t0; - let t1_value = ctx[61].id + ""; + let t1_value = ctx[65].id + ""; let t1; let a_href_value; let t2; - let t3_value = ctx[61].pees + ""; + let t3_value = ctx[65].pees + ""; let t3; let t4; - let t5_value = ctx[61].eyes + ctx[61].other + ""; + let t5_value = ctx[65].eyes + ctx[65].other + ""; let t5; let t6; return { @@ -22983,7 +23075,7 @@ const _DOMParser = DOMParser; t4 = text(" / "); t5 = text(t5_value); t6 = text(")\n "); - attr(a, "href", a_href_value = "https://boards.4chan.org/" + ctx[14] + "/thread/" + ctx[61].id); + attr(a, "href", a_href_value = "https://boards.4chan.org/" + ctx[14] + "/thread/" + ctx[65].id); attr(div, "class", "mbepis"); }, m(target, anchor) { @@ -22998,14 +23090,14 @@ const _DOMParser = DOMParser; append(div, t6); }, p(ctx2, dirty) { - if (dirty[0] & 64 && t1_value !== (t1_value = ctx2[61].id + "")) + if (dirty[0] & 64 && t1_value !== (t1_value = ctx2[65].id + "")) set_data(t1, t1_value); - if (dirty[0] & 64 && a_href_value !== (a_href_value = "https://boards.4chan.org/" + ctx2[14] + "/thread/" + ctx2[61].id)) { + if (dirty[0] & 64 && a_href_value !== (a_href_value = "https://boards.4chan.org/" + ctx2[14] + "/thread/" + ctx2[65].id)) { attr(a, "href", a_href_value); } - if (dirty[0] & 64 && t3_value !== (t3_value = ctx2[61].pees + "")) + if (dirty[0] & 64 && t3_value !== (t3_value = ctx2[65].pees + "")) set_data(t3, t3_value); - if (dirty[0] & 64 && t5_value !== (t5_value = ctx2[61].eyes + ctx2[61].other + "")) + if (dirty[0] & 64 && t5_value !== (t5_value = ctx2[65].eyes + ctx2[65].other + "")) set_data(t5, t5_value); }, d(detaching) { @@ -23014,7 +23106,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_3(ctx) { + function create_default_slot_4(ctx) { let label; let input; let t0; @@ -23090,10 +23182,10 @@ const _DOMParser = DOMParser; } function create_else_block2(ctx) { let each_1_anchor; - let each_value = ctx[3]; + let each_value_1 = ctx[3]; let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i)); } return { c() { @@ -23110,14 +23202,14 @@ const _DOMParser = DOMParser; }, p(ctx2, dirty) { if (dirty[0] & 8) { - each_value = ctx2[3]; + each_value_1 = ctx2[3]; let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context2(ctx2, each_value, i); + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_12(ctx2, each_value_1, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block2(child_ctx); + each_blocks[i] = create_each_block_12(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } @@ -23125,7 +23217,7 @@ const _DOMParser = DOMParser; for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } - each_blocks.length = each_value.length; + each_blocks.length = each_value_1.length; } }, d(detaching) { @@ -23152,13 +23244,13 @@ const _DOMParser = DOMParser; } }; } - function create_each_block2(ctx) { + function create_each_block_12(ctx) { let h3; - let t0_value = ctx[58].title + ""; + let t0_value = ctx[62].title + ""; let t0; let t1; let p; - let t2_value = ctx[58].content + ""; + let t2_value = ctx[62].content + ""; let t2; return { c() { @@ -23176,9 +23268,9 @@ const _DOMParser = DOMParser; append(p, t2); }, p(ctx2, dirty) { - if (dirty[0] & 8 && t0_value !== (t0_value = ctx2[58].title + "")) + if (dirty[0] & 8 && t0_value !== (t0_value = ctx2[62].title + "")) set_data(t0, t0_value); - if (dirty[0] & 8 && t2_value !== (t2_value = ctx2[58].content + "")) + if (dirty[0] & 8 && t2_value !== (t2_value = ctx2[62].content + "")) set_data(t2, t2_value); }, d(detaching) { @@ -23191,7 +23283,7 @@ const _DOMParser = DOMParser; } }; } - function create_default_slot_2(ctx) { + function create_default_slot_3(ctx) { let p; let t2; let div; @@ -23209,7 +23301,7 @@ const _DOMParser = DOMParser; t2 = space(); div = element("div"); if_block.c(); - attr(div, "class", "newsbox svelte-10fwss6"); + attr(div, "class", "newsbox svelte-1pjjwl2"); }, m(target, anchor) { insert(target, p, anchor); @@ -23240,6 +23332,80 @@ const _DOMParser = DOMParser; } }; } + function create_each_block2(ctx) { + let option; + let t0; + let t1; + let option_value_value; + return { + c() { + option = element("option"); + t0 = text("Method "); + t1 = text(ctx[59]); + option.__value = option_value_value = ctx[59]; + option.value = option.__value; + }, + m(target, anchor) { + insert(target, option, anchor); + append(option, t0); + append(option, t1); + }, + p: noop, + d(detaching) { + if (detaching) + detach(option); + } + }; + } + function create_default_slot_2(ctx) { + let label; + let t; + let select; + let mounted; + let dispose; + let each_value = [0, 1, 2, 3, 4]; + let each_blocks = []; + for (let i = 0; i < 5; i += 1) { + each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); + } + return { + c() { + label = element("label"); + t = text("PNG Embedding method\n "); + select = element("select"); + for (let i = 0; i < 5; i += 1) { + each_blocks[i].c(); + } + if (ctx[7].pmeth === void 0) + add_render_callback(() => ctx[57].call(select)); + }, + m(target, anchor) { + insert(target, label, anchor); + append(label, t); + append(label, select); + for (let i = 0; i < 5; i += 1) { + each_blocks[i].m(select, null); + } + select_option(select, ctx[7].pmeth); + if (!mounted) { + dispose = listen(select, "change", ctx[57]); + mounted = true; + } + }, + p(ctx2, dirty) { + if (dirty[0] & 128) { + select_option(select, ctx2[7].pmeth); + } + }, + d(detaching) { + if (detaching) + detach(label); + destroy_each(each_blocks, detaching); + mounted = false; + dispose(); + } + }; + } function create_if_block_12(ctx) { let tabpanel; let current; @@ -23312,39 +23478,47 @@ const _DOMParser = DOMParser; let t4; let tabpanel4; let t5; + let tabpanel5; + let t6; let if_block_anchor; let current; tablist = new TabList_default({ props: { - $$slots: { default: [create_default_slot_8] }, + $$slots: { default: [create_default_slot_9] }, $$scope: { ctx } } }); tabpanel0 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_7] }, + $$slots: { default: [create_default_slot_8] }, $$scope: { ctx } } }); tabpanel1 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_5] }, + $$slots: { default: [create_default_slot_6] }, $$scope: { ctx } } }); tabpanel2 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_4] }, + $$slots: { default: [create_default_slot_5] }, $$scope: { ctx } } }); tabpanel3 = new TabPanel_default({ props: { - $$slots: { default: [create_default_slot_3] }, + $$slots: { default: [create_default_slot_4] }, $$scope: { ctx } } }); tabpanel4 = new TabPanel_default({ + props: { + $$slots: { default: [create_default_slot_3] }, + $$scope: { ctx } + } + }); + tabpanel5 = new TabPanel_default({ props: { $$slots: { default: [create_default_slot_2] }, $$scope: { ctx } @@ -23365,6 +23539,8 @@ const _DOMParser = DOMParser; t4 = space(); create_component(tabpanel4.$$.fragment); t5 = space(); + create_component(tabpanel5.$$.fragment); + t6 = space(); if (if_block) if_block.c(); if_block_anchor = empty(); @@ -23382,6 +23558,8 @@ const _DOMParser = DOMParser; insert(target, t4, anchor); mount_component(tabpanel4, target, anchor); insert(target, t5, anchor); + mount_component(tabpanel5, target, anchor); + insert(target, t6, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); @@ -23389,35 +23567,40 @@ const _DOMParser = DOMParser; }, p(ctx2, dirty) { const tablist_changes = {}; - if (dirty[0] & 256 | dirty[2] & 512) { + if (dirty[0] & 256 | dirty[2] & 8192) { tablist_changes.$$scope = { dirty, ctx: ctx2 }; } tablist.$set(tablist_changes); const tabpanel0_changes = {}; - if (dirty[0] & 896 | dirty[2] & 512) { + if (dirty[0] & 896 | dirty[2] & 8192) { tabpanel0_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel0.$set(tabpanel0_changes); const tabpanel1_changes = {}; - if (dirty[0] & 134 | dirty[2] & 512) { + if (dirty[0] & 134 | dirty[2] & 8192) { tabpanel1_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel1.$set(tabpanel1_changes); const tabpanel2_changes = {}; - if (dirty[0] & 128 | dirty[2] & 512) { + if (dirty[0] & 128 | dirty[2] & 8192) { tabpanel2_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel2.$set(tabpanel2_changes); const tabpanel3_changes = {}; - if (dirty[0] & 224 | dirty[2] & 512) { + if (dirty[0] & 224 | dirty[2] & 8192) { tabpanel3_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel3.$set(tabpanel3_changes); const tabpanel4_changes = {}; - if (dirty[0] & 8 | dirty[2] & 512) { + if (dirty[0] & 8 | dirty[2] & 8192) { tabpanel4_changes.$$scope = { dirty, ctx: ctx2 }; } tabpanel4.$set(tabpanel4_changes); + const tabpanel5_changes = {}; + if (dirty[0] & 128 | dirty[2] & 8192) { + tabpanel5_changes.$$scope = { dirty, ctx: ctx2 }; + } + tabpanel5.$set(tabpanel5_changes); if (ctx2[8].akValid) { if (if_block) { if (dirty[0] & 256) { @@ -23446,6 +23629,7 @@ const _DOMParser = DOMParser; transition_in(tabpanel2.$$.fragment, local); transition_in(tabpanel3.$$.fragment, local); transition_in(tabpanel4.$$.fragment, local); + transition_in(tabpanel5.$$.fragment, local); transition_in(if_block); current = true; }, @@ -23456,6 +23640,7 @@ const _DOMParser = DOMParser; transition_out(tabpanel2.$$.fragment, local); transition_out(tabpanel3.$$.fragment, local); transition_out(tabpanel4.$$.fragment, local); + transition_out(tabpanel5.$$.fragment, local); transition_out(if_block); current = false; }, @@ -23478,6 +23663,9 @@ const _DOMParser = DOMParser; destroy_component(tabpanel4, detaching); if (detaching) detach(t5); + destroy_component(tabpanel5, detaching); + if (detaching) + detach(t6); if (if_block) if_block.d(detaching); if (detaching) @@ -23557,7 +23745,6 @@ const _DOMParser = DOMParser; function appendBooru() { if (false) { request(newbooru.domain); - alert("Requested! Please click the PEE icon to validate"); } set_store_value(settings, $settings.rsources = [...$settings.rsources, newbooru], $settings); dial.toggle(); @@ -23753,6 +23940,10 @@ const _DOMParser = DOMParser; $settings.tm = this.checked; settings.set($settings); } + function select_change_handler_1() { + $settings.pmeth = select_value(this); + settings.set($settings); + } $$self.$$set = ($$props2) => { if ("rev" in $$props2) $$invalidate(0, rev = $$props2.rev); @@ -23814,7 +24005,8 @@ const _DOMParser = DOMParser; keydown_handler, select_change_handler, input_input_handler_2, - input_change_handler_2 + input_change_handler_2, + select_change_handler_1 ]; } var App = class extends SvelteComponent { @@ -25267,7 +25459,7 @@ const _DOMParser = DOMParser; yield post.querySelector("a[rel]")?.getAttribute("href") || ""; }, getFilename: (post) => { - const opfn = post.querySelector("a.post_file_filename")?.textContent; + const opfn = post.querySelector(".post_file_filename")?.textContent; if (opfn) return opfn; const a = post.querySelector("a[rel]"); @@ -26495,10 +26687,12 @@ const _DOMParser = DOMParser; if (!supportedMainDomain(location.host) && !supportedAltDomain(location.host)) throw "PEE not supported here, skipping"; var qp; - var csettings6 = initial_settings; + var csettings5; var processors = [thirdeye_default, pomf_default, pngv3_default, jpg_default, webm_default, gif_default]; var cappState; settings.subscribe(async (b) => { + if (!b) + return; if (b.hyd) { if (b.ak) { const hydCli = new HydrusClient(b.ak); @@ -26515,9 +26709,9 @@ const _DOMParser = DOMParser; } } } - csettings6 = b; + csettings5 = b; processors = [ - ...!csettings6.te ? [thirdeye_default] : [], + ...!csettings5.te ? [thirdeye_default] : [], pngv3_default, pomf_default, jpg_default, @@ -26579,7 +26773,9 @@ const _DOMParser = DOMParser; var textToElement = (s) => document.createRange().createContextualFragment(s).children[0]; var pendingPosts = []; var signalNewEmbeds = debounce(async () => { - if (!csettings6.tm) + if (!csettings5) + return; + if (!csettings5.tm) return; try { const boardname = location.pathname.match(/\/([^/]*)\//)[1]; @@ -26601,7 +26797,9 @@ const _DOMParser = DOMParser; var shouldUseCache = () => { if (cappState.isCatalog) return false; - return typeof csettings6.cache == "boolean" ? csettings6.cache : location.hostname.includes("b4k"); + if (!csettings5) + return false; + return typeof csettings5.cache == "boolean" ? csettings5.cache : location.hostname.includes("b4k"); }; var processPost = async (post) => { const origlink = qp.getImageLink(post); @@ -26612,7 +26810,9 @@ const _DOMParser = DOMParser; return; let res2 = void 0; const reportEmbed = () => { - if (csettings6.tm) { + if (!csettings5) + return false; + if (csettings5.tm) { if (["boards.4chan.org", "boards.4channel.org"].includes(location.host)) { if (!cappState.isCatalog) { const op = +location.pathname.match(/\/thread\/(.*)/)[1]; @@ -26659,7 +26859,9 @@ const _DOMParser = DOMParser; navigator.clipboard.writeText(text3); } var scrapeBoard = async (self) => { - if (csettings6.tm) { + if (!csettings5) + return false; + if (csettings5.tm) { fireNotification("success", "Scrapping board with telemetry on! Thank you for your service, selfless stranger ;_;7"); } self.disabled = true; @@ -26787,7 +26989,15 @@ Use the WebExtension version of PEE if you want to use b4k!`); return; else qp = lqp; - if (csettings6.vercheck) + await new Promise((_) => { + settings.subscribe((val) => { + if (val) + _(); + }); + }); + if (!csettings5) + return false; + if (csettings5.vercheck) versionCheck(); const postQuote = ({ scanner, parser, utils }) => { const { CLOSEANGLEBRACKET: CLOSEANGLEBRACKET2, NUM: NUM2 } = scanner.tokens; @@ -26838,7 +27048,9 @@ Use the WebExtension version of PEE if you want to use b4k!`); rec.addedNodes.forEach((e) => { if (!(e instanceof HTMLElement)) return; - if (cappState.isCatalog && csettings6.notcata) + if (!csettings5) + return false; + if (cappState.isCatalog && csettings5.notcata) return; let el = qp.postsWithFiles(e); if (!el && e.classList.contains("postContainer")) @@ -26900,7 +27112,7 @@ Use the WebExtension version of PEE if you want to use b4k!`); button2.onclick = () => scrapeBoard(button2); opts.insertAdjacentElement("beforebegin", button2); } - if (csettings6.notcata) + if (csettings5.notcata) return; } const n = 7; diff --git a/pngextraembedder-0.275.xpi b/pngextraembedder-0.275.xpi new file mode 100644 index 0000000..57560f4 Binary files /dev/null and b/pngextraembedder-0.275.xpi differ diff --git a/src/jpg.ts b/src/jpg.ts index 8b43374..459311d 100644 --- a/src/jpg.ts +++ b/src/jpg.ts @@ -1,15 +1,9 @@ import { Buffer } from "buffer"; import type { ImageProcessor } from "./main"; -import {f5stego} from './f5stego'; +import { f5stego } from './f5stego'; import { settings } from "./stores"; import { decodeCoom3Payload } from "./utils"; -export let csettings: Parameters[0]; - -settings.subscribe(b => { - csettings = b; -}); - const key = Buffer.from("CUNNYCUNNYCUNNY"); const f5inst = new f5stego(key); diff --git a/src/main.ts b/src/main.ts index fbc20ff..1318cb6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -38,12 +38,13 @@ export interface ImageProcessor { } let qp: QueryProcessor; -export let csettings: Parameters[0] = initial_settings; +export let csettings: Parameters[0]; let processors: ImageProcessor[] = [thirdeye, pomf, pngv3, jpg, webm, gif]; let cappState: Parameters[0]; settings.subscribe(async b => { + if (!b) return; if (b.hyd) { // transition from disable to enabled if (b.ak) { @@ -164,6 +165,8 @@ let pendingPosts: { id: number, op: number }[] = []; // should be equivalent to buildCumFun(signalNewEmbeds, 5000, {trailing: true}) const signalNewEmbeds = debounce(async () => { // ensure user explicitely enabled telemetry + if (!csettings) + return; if (!csettings.tm) return; try { @@ -190,6 +193,8 @@ const signalNewEmbeds = debounce(async () => { const shouldUseCache = () => { if (cappState.isCatalog) return false; + if (!csettings) + return false; return typeof csettings.cache == "boolean" ? csettings.cache : location.hostname.includes('b4k'); @@ -205,6 +210,8 @@ const processPost = async (post: HTMLDivElement) => { let res2: [EmbeddedFile[], boolean][] | undefined = undefined; const reportEmbed = () => { + if (!csettings) + return false; if (csettings.tm) { // dont report results from archive, only live threads if (['boards.4chan.org', 'boards.4channel.org'].includes(location.host)) { @@ -261,6 +268,8 @@ function copyTextToClipboard(text: string) { } const scrapeBoard = async (self: HTMLButtonElement) => { + if (!csettings) + return false; if (csettings.tm) { fireNotification("success", "Scrapping board with telemetry on! Thank you for your service, selfless stranger ;_;7"); } @@ -451,6 +460,16 @@ const startup = async (is4chanX = true) => { else qp = lqp; + await new Promise(_ => { + settings.subscribe(val => { + if (val) + _(); + }); + }); + + if (!csettings) + return false; + if (csettings.vercheck) versionCheck(); @@ -513,6 +532,8 @@ const startup = async (is4chanX = true) => { rec.addedNodes.forEach(e => { if (!(e instanceof HTMLElement)) return; + if (!csettings) + return false; if (cappState.isCatalog && csettings.notcata) return; // apparently querySelector cannot select the root element if it matches @@ -528,7 +549,7 @@ const startup = async (is4chanX = true) => { mo.observe(e!, { childList: true, subtree: true }); }); } - + if (!document.body) { let bodyRes: any; const bodyInit = new Promise(r => bodyRes = r); diff --git a/src/pomf.ts b/src/pomf.ts index 6aca36b..c304350 100644 --- a/src/pomf.ts +++ b/src/pomf.ts @@ -42,6 +42,8 @@ const getExt = (fn: string) => { }; const extract = async (b: Buffer, fn?: string) => { + if (!csettings) + throw new Error("Settings uninit"); const { ext, source } = getExt(fn!); let rsource: string; diff --git a/src/stores.ts b/src/stores.ts index b7004a5..1eca4ba 100644 --- a/src/stores.ts +++ b/src/stores.ts @@ -2,18 +2,40 @@ import { writable } from "svelte/store"; import type { HydrusClient } from "./hydrus"; import type { Booru } from "./thirdeye"; -export const localLoad = (key: string, def: T) => - ('__pee__' + key) in localStorage - ? JSON.parse(localStorage.getItem('__pee__' + key)!) as T +// Todo: use GM get/setValue instead? +export const localLoad = async (key: string, def: T) => { + const isinls = ('__pee__' + key) in localStorage; + const ret = isinls + ? { ...def, ...JSON.parse(localStorage.getItem('__pee__' + key)!) } as T : def; -const localSet = (key: string, value: any) => - localStorage.setItem('__pee__' + key, JSON.stringify(value)); + if (execution_mode != "userscript") { + if (isinls) { + delete localStorage[('__pee__' + key)]; + await chrome.storage.local.set({ + [key]: JSON.stringify(ret) + }); + } else { + const d = await chrome.storage.local.get([key]); + if (typeof d[key] == "string") + return { ...def, ...(await JSON.parse('' + d[key] || '{}')) } as T; + } + } + + return ret; +}; + +const localSet = (key: string, value: any) => { + if (execution_mode != "userscript") + chrome.storage.local.set({ [key]: JSON.stringify(value) }); + else + localStorage.setItem('__pee__' + key, JSON.stringify(value)); +}; export const initial_settings = localLoad('settingsv2', { - ...localLoad('settings', {}), loop: true, dh: false, + pmeth: 4, xpv: false, xpi: false, hyd: false, @@ -42,11 +64,14 @@ export const initial_settings = localLoad('settingsv2', { conc: 8, ho: false, blacklist: [] as string[], - rsources: [] as (Omit & {view: string, disabled?: boolean})[], - ...localLoad('settingsv2', {}), + rsources: [] as (Omit & { view: string, disabled?: boolean })[], }); -export const settings = writable(initial_settings); +export const settings = writable>(); + +initial_settings.then(v => { + settings.set(v); +}); export const appState = writable({ isCatalog: false, diff --git a/src/thirdeye.ts b/src/thirdeye.ts index e645326..951472f 100644 --- a/src/thirdeye.ts +++ b/src/thirdeye.ts @@ -60,6 +60,8 @@ let black = new Set(); let phashEn = false; let mindist = 5; settings.subscribe(s => { + if (!s) + return; experimentalApi = s.expte; boorus = s.rsources.map(e => ({ ...e, @@ -70,12 +72,7 @@ settings.subscribe(s => { phashEn = s.phash; }); -export let boorus: Booru[] = - localLoad('settingsv2', { rsources: [] as (Omit & { view: string, disabled?: boolean })[] }) - .rsources.map(e => ({ - ...e, - quirks: gelquirk(e.view) - })); +export let boorus: Booru[] = []; const bufferingTime = 2000; let expired: number | NodeJS.Timeout | undefined = undefined; @@ -151,6 +148,8 @@ const findFileFrom = async (b: Booru, hex: string, abort?: EventTarget) => { }; const extract = async (b: Buffer, fn?: string) => { + if (!csettings) + throw new Error("Settings uninit"); let result!: BooruMatch[]; let booru!: string; for (const e of Object.values(boorus)) { diff --git a/src/utils.ts b/src/utils.ts index a40aba0..a3682f8 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -168,6 +168,8 @@ export const getThreadDataCache = async (board: string, op: number) => { Semantic difference: Empty array means there is nothing, undefined means it wasn't found in the cache */ export const getEmbedsFromCache = async (board: string, op: number, pid: string): Promise<[EmbeddedFile[], boolean][] | undefined> => { + if (!csettings) + throw new Error("Settings uninit"); await getThreadDataCache(board, op); const target = +pid.slice(pid.match(/\d/)!.index); const cachedData = cthreadDataCache![target]; @@ -217,6 +219,8 @@ rest: [X bytes of thumbnail data])[file bytes] &4 => has thumbnail */ export const decodeCoom3Payload = async (buff: Buffer) => { + if (!csettings) + throw new Error("Settings uninit"); const allowed_domains = filehosts.map(e => e.serving.replaceAll('.', '\\.')); const pees = buff .toString() @@ -313,6 +317,8 @@ export const uploadFiles = async (injs: File[]) => { let total = 0; fireNotification('info', `Uploading ${injs.length} files...`); return await Promise.all(injs.map(async inj => { + if (!csettings) + throw new Error("Settings uninit"); const peefile = await buildPeeFile(inj); const ret = await filehosts[csettings.fhost || 0].uploadFile(peefile); fireNotification('info', `Uploaded files [${++total}/${injs.length}] ${ret}`);