PageSourceSearch

https://pomelli.page/_next/static/chunks/5506.c578338e15d0e3b5.js

js pomelli.page collected 2026-09-30 18:44:10 UTC 3,250 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3125,5506],{53125:(e,o,t)=>{t.d(o,{downloadImage:()=>r,downloadVideo:()=>i});var a=t(96429);function d(e,o){let t=document.createElement("a");t.href=e,t.download=o,t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)}let l={"image/avif":"avif","image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp"};async function n(e,o){let t,a=new Uint8Array(await o.slice(0,32).arrayBuffer()),d=(...e)=>e.every((e,o)=>a[o]===e),n=(e,o)=>o.split("").every((o,t)=>a[e+t]===o.charCodeAt(0));t=d(137,80,78,71)?"png":d(255,216,255)?"jpg":n(0,"GIF8")?"gif":n(0,"RIFF")&&n(8,"WEBP")?"webp":n(4,"ftyp")&&(n(8,"avif")||n(8,"avis"))?"avif":l[o.type.toLowerCase().split(";")[0]];if(!t)return e;let r=e.replace(/\.[^/.]+$/,"");return`${r}.${t}`}async function r(e,o,t){let{onSuccess:l,onError:r,showToast:i=!0}=t||{};if(e.startsWith("blob:")){let t=o;try{let a=await fetch(e).then(e=>e.blob());t=await n(o,a)}catch(e){console.warn("Could not determine Blob image type, keeping filename",e)}d(e,t),i&&a.o.success("Image downloaded successfully"),l?.();return}try{let t=await fetch(e,{mode:"cors",cache:"no-cache",credentials:"omit"});if(!t.ok)throw Error("Direct download failed");let r=await t.blob(),c=URL.createObjectURL(r);d(c,await n(o,r)),setTimeout(()=>URL.revokeObjectURL(c),1e3),i&&a.o.success("Image downloaded successfully"),l?.();return}catch(e){console.log("Direct download failed, using proxy...",e)}try{let t=await fetch("/api/proxy-download",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageUrl:e})});if(!t.ok)throw Error("Proxy download failed");let r=await t.blob(),c=URL.createObjectURL(r);d(c,await n(o,r)),setTimeout(()=>URL.revokeObjectURL(c),1e3),i&&a.o.success("Image downloaded successfully"),l?.();return}catch(e){console.error("Proxy download failed:",e)}i&&a.o.error("Failed to download image"),window.open(e,"_blank");let c=Error("Download failed, opened in new tab");throw r?.(c),c}async function i(e,o,t){let{onSuccess:d,onError:l,showToast:n=!0}=t||{};try{let t=await fetch(e,{mode:"cors",cache:"no-cache",credentials:"omit"});if(!t.ok)throw Error("Direct download failed");let l=await t.blob(),r=URL.createObjectURL(l),i=document.createElement("a");i.href=r,i.download=o,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>URL.revokeObjectURL(r),1e3),n&&a.o.success("Video downloaded successfully"),d?.();return}catch(e){console.log("Direct download failed, using proxy...",e)}try{let t=await fetch("/api/proxy-download",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageUrl:e})});if(!t.ok)throw Error("Proxy download failed");let l=await t.blob(),r=URL.createObjectURL(l),i=document.createElement("a");i.href=r,i.download=o,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>URL.revokeObjectURL(r),1e3),n&&a.o.success("Video downloaded successfully"),d?.();return}catch(e){console.error("Proxy download failed:",e)}n&&a.o.error("Failed to download video"),window.open(e,"_blank"),l?.(Error("Download failed, opened in new tab"))}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.