// @bun
var{defineProperty:Q,getOwnPropertyNames:D,getOwnPropertyDescriptor:H}=Object,L=Object.prototype.hasOwnProperty;function M(j){return this[j]}var h=(j)=>{var q=(Y??=new WeakMap).get(j),z;if(q)return q;if(q=Q({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var G of D(j))if(!L.call(q,G))Q(q,G,{get:M.bind(j,G),enumerable:!(z=H(j,G))||z.enumerable})}return Y.set(j,q),q},Y;var _=(j)=>j;function E(j,q){this[j]=_.bind(null,q)}var S=(j,q)=>{for(var z in q)Q(j,z,{get:q[z],enumerable:!0,configurable:!0,set:E.bind(q,z)})};var I=(j,q)=>()=>(j&&(q=j(j=0)),q);var T=import.meta.require;function F(j){return j.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function J(j,q){if(j.serverDynamic[q]!==void 0)return String(j.serverDynamic[q]);let z=j.static[q];if(typeof z==="string")return z;return}var R="<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'/images/safe-image-default.svg';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>",f;var b=I(()=>{f={name:"SafeImage",aliases:["safe-image","safe-img"],render(j,q,z){let G=J(j,"src")||"",Z=J(j,"alt")||"",$=J(j,"fallback")||"/images/safe-image-default.svg",U=J(j,"class")||J(j,"className")||"",V=J(j,"fallbackClassName")||"",B=[];if(B.push(`src="${F(G)}"`),B.push(`alt="${F(Z)}"`),U)B.push(`class="${F(U)}"`);if(B.push(`data-fallback="${F($)}"`),V)B.push(`data-fallback-class="${F(V)}"`);B.push('onerror="window.__stxSafeImageHandler(this)"');let w=new Set(["src","alt","fallback","class","className","fallbackClassName"]);for(let[K,O]of Object.entries(j.static)){if(w.has(K))continue;if(typeof O==="boolean"){if(O)B.push(F(K))}else B.push(`${F(K)}="${F(O)}"`)}let W=`<img ${B.join(" ")} />`,X=z.context;if(!X.__safeImageHandlerEmitted)return X.__safeImageHandlerEmitted=!0,`${R}${W}`;return W}}});b();export{f as SafeImageBuiltin};
