import{n as l,a8 as g,j as s}from"./index.DXat8gQf.js";import{S as m,T as y}from"./Toolbar.B93Vwnd4.js";import{w as h,u as W,E as b}from"./withFullScreenWrapper.BBIHM2Cb.js";const F=l("div",{target:"e1kqg1ss0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg,maxWidth:"100%",width:"fit-content"})),O=l("div",{target:"e1kqg1ss1"})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:t.radii.default}})),E=l("div",{target:"e1kqg1ss2"})(({theme:t})=>({fontFamily:t.genericFonts.bodyFont,fontSize:t.fontSizes.sm,color:t.colors.fadedText60,textAlign:"center",marginTop:t.spacing.xs,wordWrap:"break-word",padding:t.spacing.threeXS}));var p;(function(t){t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t[t.MinImageOrContainer=-4]="MinImageOrContainer",t[t.MaxImageOrContainer=-5]="MaxImageOrContainer"})(p||(p={}));function M({element:t,width:u,endpoints:f,disableFullscreenMode:x}){const{expanded:i,width:w,height:o,expand:C,collapse:I}=W(b),d=i?w:u;let a;const n=t.width;if([-1,-3,-4].includes(n))a=void 0;else if([-2,-5].includes(n))a=d;else if(n>0)a=n;else throw Error(`Invalid image width: ${n}`);const e={};return o&&i?(e.maxHeight=o,e.objectFit="contain"):(e.width=a,e.maxWidth="100%"),g(m,{width:d,height:o,useContainerWidth:i,topCentered:!0,children:[s(y,{target:m,isFullScreen:i,onExpand:C,onCollapse:I,disableFullscreenMode:x}),s(F,{className:"stImage","data-testid":"stImage",children:t.imgs.map((S,c)=>{const r=S;return g(O,{"data-testid":"stImageContainer",children:[s("img",{style:e,src:f.buildMediaURL(r.url),alt:c.toString()}),r.caption&&s(E,{"data-testid":"stImageCaption",style:e,children:` ${r.caption} `})]},c)})})]})}const q=h(M);export{q as default};
