"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[955],{80955:(e,t,a)=>{a.d(t,{computeImageInsertFrameSize:()=>r,readImageNaturalSize:()=>n});var h=a(79535),i=a(55848);function r(e,t,a={}){let n=a.maxWidth??560,m=a.maxHeight??720,o=a.minSize??i.E0;if(e<=0||t<=0)return{width:h.m2.width,height:h.m2.height};let u=Math.min(1,n/e,m/t),d=Math.max(o,Math.round(e*u)),g=Math.max(o,Math.round(t*u));return(g=Math.max(o,Math.round(t/e*d)))>m&&(d=Math.max(o,Math.round(e/t*(g=m)))),{width:d,height:g}}function n(e){return"u"<typeof Image?Promise.resolve({width:h.m2.width,height:h.m2.height}):new Promise((t,a)=>{let h=new Image;h.onload=()=>{t({width:h.naturalWidth,height:h.naturalHeight})},h.onerror=()=>a(Error("Failed to read image dimensions")),h.src=e})}}}]);