import{u as I}from"./Bh1htWKH.js";import{d as R,o as u,E as d,S as E,ai as k,x as w,K as S,H as z,bG as C}from"./CmKmn20f.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="48923699-4291-4d08-8828-4dbd2938d678",n._sentryDebugIdIdentifier="sentry-dbid-48923699-4291-4d08-8828-4dbd2938d678")}catch{}})();const P=["media","srcset","sizes"],D=["srcset","sizes"],x=["src","width","height"],A=R({inheritAttrs:!1,__name:"YscPicture",props:{path:{},sources:{},defaultSource:{},withRefitTransformation:{type:Boolean,default:!1},withCoverTransformation:{type:Boolean,default:!1}},setup(n){var m;const a=I(),r=n,l=e=>decodeURIComponent(e.href),g=e=>`${e}px`,_=({url:e,transformations:s})=>{let t=e.searchParams.get("twic")??"v1";const o=s.map(({parameter:i,value:c})=>`${i}=${c}`).join("/");return o.length&&(t=`${t}/${o}`),e.searchParams.set("twic",t),e},$=({width:e,height:s})=>({parameter:"cover",value:`${e}x${s}`}),T=({width:e,height:s,refitParameter:t})=>t?{parameter:"refit",value:`${e}x${s}${t}`}:{parameter:"refit",value:`${e}x${s}`},f=e=>{const s=C();s.pathname=r.path;const t=[];return r.withRefitTransformation&&t.push(T(e)),r.withCoverTransformation&&t.push($(e)),e.postRefitTransformation&&t.push(...e.postRefitTransformation),_({url:s,transformations:t})},b=(()=>{const e=f(r.defaultSource);return l(e)})(),p=e=>[1,2,3].map(t=>{const o=e.width*t,i=e.height*t,c=f({...e,width:o,height:i});return`${l(c)} ${o}w`}).join(", "),v=({breakpoint:e})=>`(min-width: ${a[e]})`,y=(m=r.sources)==null?void 0:m.map(e=>({...e,media:v(e),srcset:p(e),sizes:g(e.width)})),h={srcset:p(r.defaultSource),sizes:"100vw"};return(e,s)=>(u(),d("picture",null,[(u(!0),d(E,null,k(w(y),t=>(u(),d("source",{key:`${r.path}-${t.breakpoint}`,media:t.media,srcset:t.srcset,sizes:t.sizes},null,8,P))),128)),S("source",{srcset:h.srcset,sizes:h.sizes},null,8,D),S("img",z({src:w(b),width:e.defaultSource.width,height:e.defaultSource.height,class:"object-cover w-full h-full"},e.$attrs),null,16,x)]))}});export{A as _}; //# sourceMappingURL=B52Xhfo0.js.map