1import{$ as e,E as t,J as n,N as r,P as i,Q as a,Y as o,a as s,c,i as l,q as u,w as d}from"./DaBJmWNQ.js";import"./S-KyrcF8.js";import{n as f,r as p,t as m}from"./CdvyItnt.js";var h=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~`.split(``),g=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=h.indexOf(r);t=t*83+i}return t},_=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},v=e=>{let t=Math.max(0,Math.min(1,e));return Math.trunc(t<=.0031308?t*12.92*255+.5:(1.055*t**.4166666666666667-.055)*255+.5)},y=e=>e<0?-1:1,b=(e,t)=>y(e)*Math.abs(e)**+t,x=class extends Error{constructor(e){super(e),this.name=`ValidationError`,this.message=e}},S=e=>{if(!e||e.length<6)throw new x(`The blurhash string must be at least 6 characters`);let t=g(e[0]),n=Math.floor(t/9)+1,r=t%9+1;if(e.length!==4+2*r*n)throw new x(`blurhash length mismatch: length is ${e.length} but it should be ${4+2*r*n}`)},C=e=>{let t=e>>16,n=e>>8&255,r=e&255;return[_(t),_(n),_(r)]},w=(e,t)=>{let n=Math.floor(e/361),r=Math.floor(e/19)%19,i=e%19;return[b((n-9)/9,2)*t,b((r-9)/9,2)*t,b((i-9)/9,2)*t]},T=(e,t,n,r)=>{S(e),r|=1;let i=g(e[0]),a=Math.floor(i/9)+1,o=i%9+1,s=(g(e[1])+1)/166,c=Array(o*a);for(let t=0;t<c.length;t++)t===0?c[t]=C(g(e.substring(2,6))):c[t]=w(g(e.substring(4+t*2,6+t*2)),s*r);let l=t*4,u=new Uint8ClampedArray(l*n);for(let e=0;e<n;e++)for(let r=0;r<t;r++){let i=0,s=0,d=0;for(let l=0;l<a;l++)for(let a=0;a<o;a++){let u=Math.cos(Math.PI*r*a/t)*Math.cos(Math.PI*e*l/n),f=c[a+l*o];i+=f[0]*u,s+=f[1]*u,d+=f[2]*u}let f=v(i),p=v(s),m=v(d);u[4*r+0+e*l]=f,u[4*r+1+e*l]=p,u[4*r+2+e*l]=m,u[4*r+3+e*l]=255}return u};
1function E(e,t,n){let r=(4-t*3%4)%4,i=new Uint8Array((t*3+r)*n);for(let a=0;a<n;a++)for(let o=0;o<t;o++){let s=(a*t+o)*4,c=(n-a-1)*(t*3+r)+o*3;i[c]=e[s+2],i[c+1]=e[s+1],i[c+2]=e[s]}let a=new Uint8Array([66,77,54+i.length,4,0,0,0,0,0,0,54,0,0,0,40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,n&255,n>>8&255,n>>16&255,n>>24&255,1,0,24,0,0,0,0,0,i.length,0,0,0,19,11,0,0,19,11,0,0,0,0,0,0,0,0,0,0]),o=new Uint8Array(a.length+i.length);return o.set(a),o.set(i,a.length),o}function D(e,t){return`data:${t};base64,${btoa(String.fromCharCode(...e))}`}function O(e,t=8,n=8){return D(E(T(e,t,n),t,n),`image/bmp`)}var k=t(`<img/>`);function A(t,h){e(h,!0);let g=m,_=l(h,`breakpoints`,19,()=>[320,480,640,800,1024,1280,1600]),v=l(h,`sizes`,3,`100vw`),y=l(h,`format`,3,`auto`),b=l(h,`quality`,3,85),x=l(h,`fit`,3,`cover`),S=s(h,[`$$slots`,`$$events`,`$$legacy`,`src`,`alt`,`width`,`height`,`breakpoints`,`sizes`,`format`,`quality`,`fit`,`fetchpriority`,`class`,`style`]),C=o(()=>/^https?:\/\//.test(h.src)),w=o(()=>h.src.replace(/^\//,``)),T=o(()=>i(C)?void 0:g[i(w)]),E=o(()=>!i(C)&&!i(T)),D=o(()=>i(T)?.id??h.src),A=o(()=>h.width??i(T)?.width??0),j=o(()=>h.height??i(T)?.height??0),M=o(()=>i(A)>0?_().filter(e=>e<=i(A)*2):_()),N=o(()=>i(C)||i(E)?void 0:p(i(D),i(M))),P=o(()=>i(C)||i(E)?h.src:f(i(D),{width:i(A)||void 0,height:i(j)||void 0,format:y(),quality:b(),fit:x()})),F=o(()=>i(T)?.blurhash),I=o(()=>i(F)&&i(A)>0&&i(j)>0?O(i(F),i(A)>=i(j)?12:Math.max(4,Math.round(12/i(j)*i(A))),i(j)>=i(A)?12:Math.max(4,Math.round(12/i(A)*i(j)))):null),L=n(!1),R=o(()=>[!i(L)&&i(I)?`background-image: url('${i(I)}'); background-size: cover`:``,h.style??``].filter(Boolean).join(`; `));var z=k(),B=()=>u(L,!0);c(z,()=>({...S,alt:h.alt,width:i(A)||void 0,height:i(j)||void 0,sizes:v(),srcset:i(N),src:i(P),loading:h.fetchpriority===`high`?`eager`:`lazy`,decoding:`async`,fetchpriority:h.fetchpriority??null,class:h.class,style:i(R)||void 0,onload:B})),r(z),d(t,z),a()}export{A 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.