1import{u as H,a as V,m as G}from"./d-YqQGoX.js";import{aG as C,ar as J,aH as K,n as X,o as c,a as d,F as q,m as Z,aI as v,aJ as Q,aS as Y,h as n,z as B,q as O,g as L,c as j,x as _,aT as ee,aU as te,aV as ae,aW as ie,aX as P}from"./DYJY8Lm8.js";const se=["type","sizes","srcset"],re=["src","sizes","srcset"],le=Object.assign({inheritAttrs:!1},{__name:"NuxtPicture",props:{legacyFormat:{type:String,required:!1},imgAttrs:{type:Object,required:!1},src:{type:String,required:!1},format:{type:String,required:!1},quality:{type:[String,Number],required:!1},background:{type:String,required:!1},fit:{type:String,required:!1},modifiers:{type:Object,required:!1},preset:{type:String,required:!1},provider:{type:null,required:!1},sizes:{type:[String,Object],required:!1},densities:{type:String,required:!1},preload:{type:[Boolean,Object],required:!1},width:{type:[String,Number],required:!1},height:{type:[String,Number],required:!1},crossorigin:{type:[String,Boolean],required:!1},nonce:{type:String,required:!1}},emits:["load","error"],setup(l,{emit:A}){const a=l,f=A,g=C(),I=new Set(["alt","referrerpolicy","usemap","longdesc","ismap","loading","crossorigin","decoding","nonce"]),N=n(()=>{const r={img:{...h.value,...a.imgAttrs,"data-nuxt-pic":""},picture:{}};for(const e in g)I.has(e)?e in r.img||(r.img[e]=g[e]):r.picture[e]=g[e];return r}),x=n(()=>a.src?.match(/^[^?#]+\.(\w+)(?:$|[?#])/)?.[1]),S=n(()=>a.legacyFormat?a.legacyFormat:!x.value||!["png","webp","gif","svg"].includes(x.value)?"jpeg":"png"),y=H(),{providerOptions:k,imageModifiers:b,normalizedAttrs:h}=V(a),z=n(()=>{const r=a.format?.split(",")||(x.value==="svg"?["svg"]:y.options.format?.length?[...y.options.format]:["webp"]);return r[0]==="svg"?[{src:a.src}]:(r.includes(S.value)&&r.splice(r.indexOf(S.value),1),r.push(S.value),r.map(e=>{const{srcset:t,sizes:i,src:s}=y.getSizes(a.src,{...k.value,sizes:a.sizes||y.options.screens,densities:a.densities,modifiers:{...b.value,format:e}});return{src:s,type:`image/${e}`,sizes:i,srcset:t}}))}),o=J().isHydrating,p=K("imgEl");return X(()=>{const r=Array.isArray(p.value)?p.value[0]:p.value;r&&(r.complete&&o&&(r.getAttribute("data-error")?f("error",new Event("error")):f("load",new Event("load"))),r.onload=e=>{f("load",e)},r.onerror=e=>{f("error",e)},G("nuxt-picture"))}),(r,e)=>(c(),d("picture",Q(Y(N.value.picture)),[(c(!0),d(q,null,Z(z.value,(t,i)=>(c(),d(q,null,[i+1<z.value.length?(c(),d("source",{key:t.src,type:t.type,sizes:t.sizes,srcset:t.srcset},null,8,se)):(c(),d("img",v({ref_for:!0,ref_key:"imgEl",ref:p,key:"last"+t.src},{ref_for:!0},N.value.img,{src:t.src,sizes:t.sizes,srcset:t.srcset}),null,16,re))],64))),256))],16))}}),ne=Object.assign(le,{__name:"NuxtPicture"}),oe=["data-credit"],ce=["data-credit"],ue=["data-credit"],de=["data-credit"],me=1080,T=1280,ve={__name:"ApmPicture",props:{image:Object,maxWidth:Number,src:String,ratio:String,sizes:[Array,String],alt:String,title:String,hidden:Boolean,noLazy:Boolean,simpleImg:Boolean,provider:Object,noBg:{type:Boolean,default:!1}},emits:["load"],setup(l){function A(e,t){return t.find(i=>i>=e)||e}const a=l,f=C();!a.src&&!a.image&&console.warn("[ApmPicture] both SRC and IMAGE are missing "+JSON.stringify(a));const g=n(()=>a.maxWidth?`min(100%, ${a.maxWidth}px)`:"100%"),I=n(()=>`(max-width: 768px) 100vw, ${a.maxWidth||me}px`),N=n(()=>{const e=a.maxWidth?A(+a.maxWidth,[...P]):T,t=P.filter(i=>i<=e);return t.includes(e)||t.push(e),t.map(i=>`${i}:${i}px`).join(" ")}),x=n(()=>(a.title||"").replace(/(&[^;]+;)/,"")),S=n(()=>a.ratio?["ratio","ratio-"+a.ratio]:[]),y=n(()=>{const e={...a.image||{}},t={};if(Object.entries(e).forEach(([u,m])=>{+u&&typeof m=="string"&&(t[u]=m)}),!a.image)return t;let i=Object.keys(t).length;const s=Object.keys(t).map(u=>+u).sort((u,m)=>u-m),$=a.maxWidth?A(+a.maxWidth,s):T;return s.slice().sort((u,m)=>m-u).forEach(u=>{i>1&&u>$&&(delete t[u],i--)}),t}),k=n(()=>{if(a.src)return a.src;const e=Object.keys(y.value).map(Number).sort((i,s)=>i-s);if(!e.length)return"";const t=e.length>=2?e[1]:e[0];return y.value[t]}),b=n(()=>ae({sizeMap:a.image,src:a.src,simpleImg:a.simpleImg})),h=n(()=>{const e=a.image?._meta?.credit;return e&&String(e).trim()?String(e).trim():void 0}),z=n(()=>te({useIpx:b.value,credit:h.value})),W=n(()=>ie(y.value)),o=n(()=>{const e=k.value,t=a.image?._meta;let{width:i,height:s,aspectRatio:$}=f;if(e&&(!i||!s)){const w=e.match(/-(\d+)x(\d+)\./),E=w&&+w[1],R=w&&+w[2];w&&(i?s=R/E*i:s?i=E/R*s:(i=E,s=R))}$||($=i&&s?`${i}/${s}`:"auto");const u=a.alt||t?.description||"",m=b.value,D=!m&&W.value?W.value:void 0,M=m?a.sizes||N.value:ee(a.sizes)||I.value,F=i&&a.maxWidth?Math.min(+i,+a.maxWidth):i,U=i&&s&&a.maxWidth?Math.round(+s*(F/+i)):s;return{...f,title:x.value||void 0,alt:u,"aria-hidden":!u||void 0,"data-credit":h.value,provider:a.provider,sizes:M,densities:m?f.densities||"1":void 0,src:e,srcset:D,width:F,height:U,aspectRatio:$,quality:85,loading:a.noLazy?"eager":"lazy"}}),p=n(()=>{const{"data-credit":e,provider:t,quality:i,format:s,densities:$,aspectRatio:u,...m}=o.value;return m}),r=n(()=>{const e="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2210%22%20height%3D%2210%22%3E%3Crect%20width%3D%2210%22%20height%3D%2210%22%20fill%3D%22rgba(255,255,255,0.5)%22/%3E%3C/svg%3E",{alt:t}=o.value,i=t||x.value,s=`Loading placeholder for "${i||"image"}"`;return{...p.value,alt:s,"aria-hidden":!i,sizes:null,srcset:void 0,src:e,loading:"eager"}});return(e,t)=>{const i=ne;return l.ratio?(c(),d("div",{key:0,class:O(["apm-picture",[S.value]]),style:B(`max-width: ${g.value};`)},[!k.value||l.hidden?(c(),d("img",v({key:0,ref:"altImgNode"},r.value,{class:{"ratio--fill":l.ratio},style:`max-width: 100%; max-height: 100%; aspect-ratio:${o.value.aspectRatio};`}),null,16)):l.hidden?_("",!0):(c(),d(q,{key:1}
1,[z.value?(c(),d("picture",{key:0,"data-credit":h.value,class:O({"ratio--fill":l.ratio,"bg-dark bg-opacity-50":!l.noBg}),style:B(`aspect-ratio:${o.value.aspectRatio};`)},[L("img",v(p.value,{style:`aspect-ratio:${o.value.aspectRatio};`,onLoad:t[0]||(t[0]=s=>e.$emit("load",s))}),null,16)],14,oe)):b.value?(c(),j(i,v({key:2},o.value,{class:{"ratio--fill":l.ratio,"bg-dark bg-opacity-50":!l.noBg},style:`aspect-ratio:${o.value.aspectRatio};`,onLoad:t[2]||(t[2]=s=>e.$emit("load",s))}),null,16,["class","style"])):(c(),d("img",v({key:1},p.value,{class:{"ratio--fill":l.ratio,"bg-dark bg-opacity-50":!l.noBg},style:`aspect-ratio:${o.value.aspectRatio};`,"data-credit":h.value,onLoad:t[1]||(t[1]=s=>e.$emit("load",s))}),null,16,ce))],64))],6)):l.hidden?(c(),d("img",v({key:2,ref:"altImgNode"},r.value,{style:`max-width: ${g.value}; max-height: 100%; aspect-ratio:${o.value.aspectRatio};`}),null,16)):(c(),d(q,{key:1},[k.value?z.value?(c(),d("picture",{key:1,class:O(["apm-picture",{"bg-dark bg-opacity-50":!l.noBg}]),"data-credit":h.value,style:B(`max-width: ${g.value}; aspect-ratio:${o.value.aspectRatio};`)},[L("img",v(p.value,{style:`max-width: ${g.value}; aspect-ratio:${o.value.aspectRatio};`,onLoad:t[3]||(t[3]=s=>e.$emit("load",s))}),null,16)],14,ue)):b.value?(c(),j(i,v({key:3},o.value,{class:["apm-picture",{"bg-dark bg-opacity-50":!l.noBg}],style:`max-width: ${g.value}; aspect-ratio:${o.value.aspectRatio};`,onLoad:t[5]||(t[5]=s=>e.$emit("load",s))}),null,16,["class","style"])):(c(),d("img",v({key:2},p.value,{class:["apm-picture",{"bg-dark bg-opacity-50":!l.noBg}],style:`max-width: ${g.value}; aspect-ratio:${o.value.aspectRatio};`,"data-credit":h.value,onLoad:t[4]||(t[4]=s=>e.$emit("load",s))}),null,16,de)):(c(),d("img",v({key:0,ref:"altImgNode"},r.value,{class:["apm-picture",{"bg-dark bg-opacity-50":!l.noBg}],style:`max-width: ${g.value}; aspect-ratio:${o.value.aspectRatio};`}),null,16))],64))}}};export{ve as _};
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.