import{bS as i,fF as y,br as d,bv as u,cv as n,fy as s,bT as T,ao as R,bW as b}from"./app-k0jcl5PQ.js";const p="_imageStyle_9s5en_1",_="_imageTypeResource_9s5en_6",h="_fallBackImage_9s5en_12",g={imageStyle:p,imageTypeResource:_,fallBackImage:h},S={width:200,resizeType:y.Cover};function U(a,e,l){var c,o,f;const t=l??S,m=I(e);if("thumbnail"in e&&((c=e.thumbnail)!=null&&c.url))return i.createUrl((o=e.thumbnail)==null?void 0:o.url,{...t});const r=d.safeUrlConcat(a,"/v1/previews");return u.isResource(e)?m===n.Pdf?e.metadata.type===s.Pdf?i.createResourceImage(r,e.url,{...t}):i.createResourceImage(r,(f=e.pdf)==null?void 0:f.url,{...t}):e.metadata.type!==s.Zip?i.createUrl(e.url,l??{size:T.Medium,resizeType:y.Cover}):"/images/zip-resource.png":i.createResourceImage(r,e.url,{...t})}function I(a){var e;return u.isResource(a)?a.metadata.type===s.Pdf||(e=a.pdf)!=null&&e.url?n.Pdf:n.Thumbnails:n.Link}function v(a){var m,r;let e=null,l=0;u.isResource(a.resource)&&(e=a.resource.metadata,l=((r=(m=a.resource.thumbnail)==null?void 0:m.metadata)==null?void 0:r.rotation)??0);const t=U(a.imageCdnUrl,a.resource,a.dynamicRatioImageOptions);return R.jsx(b,{data:t,imageType:I(a.resource),imageStyle:{transform:`rotate(${l}deg)`},alt:a.resource.name,errorFallbackImageSrc:a.imageErrorFallbackUrl,errorFallbackImageClassName:g.fallBackImage,imageClassName:(e==null?void 0:e.type)===s.Image?`${g.imageTypeResource} ${g.imageStyle}`:"",preload:a.preloadImage,preventLoad:!a.preloadImage})}export{v as R,U as g};
//# sourceMappingURL=BNuOjrBr.chunk.js.map
