PageSourceSearch

https://scripod.com/assets/smart-image-YG08YgzI.js

js scripod.com collected 2026-10-09 00:23:54 UTC 1,653 bytes, 1 lines download raw bytes

1import{a as e,t}from"./jsx-runtime-D_MnEzuy.js";import{t as n}from"./react-DBEjWt7A.js";import{i as r}from"./dist-DT2jQ2P_.js";import{t as i}from"./useUpdateEffect-BOYnTCJS.js";var a=e(n(),1),o=new Map,s=new Map,c=e=>e.complete&&e.naturalWidth>0&&e.naturalHeight>0,l=e=>{let t=o.get(e)?.deref();return t&&c(t)?Promise.resolve(t):new Promise((t,n)=>{let r={resolve:t,reject:n},i=s.get(e)??new Set;i.add(r),s.set(e,i)})},u=(e,t)=>{if(!c(t))return;o.set(e,new WeakRef(t));let n=s.get(e);n&&(s.delete(e),n.forEach(({resolve:e})=>{e(t)}))},d=(e,t)=>{o.delete(e);let n=s.get(e);n&&(s.delete(e),n.forEach(({reject:e})=>{e(t)}))},f=async e=>{let t=await l(e);return createImageBitmap(t,{resizeWidth:128,resizeHeight:128,resizeQuality:`high`,colorSpaceConversion:`default`,premultiplyAlpha:`none`})},p=(e,t=512)=>{if(e)return`https://image.scripod.com/${e}`},m=t(),h=({className:e,style:t,src:n,fallbackSrc:o,alt:s=``,ref:c,optimize:l=!0,crossOrigin:f,onLoad:h,onError:g,..._})=>{let[v,y]=(0,a.useState)(l?p(n):n),[b,x]=(0,a.useState)(!0),S=(0,a.useRef)(null),C=(0,a.useCallback)(e=>{S.current=e,typeof c==`function`?c(e):c&&(c.current=e)},[c]);return i(()=>{x(!0),y(l?p(n):n)},[n]),(0,a.useEffect)(()=>{let e=S.current;typeof v!=`string`||!e?.complete||e.naturalWidth===0||e.naturalHeight===0||(x(!1),u(v,e))}
1,[v]),(0,m.jsx)(`img`,{className:r(b&&`bg-foreground/15`,e),style:t,crossOrigin:f??(l?`anonymous`:void 0),src:v,alt:s,ref:C,onLoad:e=>{x(!1),typeof v==`string`&&u(v,e.currentTarget),h?.(e)},onError:e=>{typeof v==`string`&&d(v,Error(`Cover image failed to load`)),o&&v===(l?p(n):n)?(x(!0),y(l?p(o):o)):x(!1),g?.(e)},..._})};export{p as n,f as r,h as t};

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.