const DEFAULT_DURATION_MS=0xfa;function prefersReducedMotion(){try{return window['matchMedia']&&window['matchMedia']('(prefers-reduced-motion:\x20reduce)')['matches'];}catch{return![];}}function safeCancelAnimations(_0x32b698){if(!_0x32b698||typeof _0x32b698['getAnimations']!=='function')return;try{_0x32b698['getAnimations']()['forEach'](_0x2a7704=>_0x2a7704['cancel']());}catch{}}function animateRestoreFlip({contentEl:_0x4e5f9b,fromRect:_0x37bc1e,toRect:_0x7b624b,durationMs:_0x46c4e0}){if(!_0x4e5f9b)return;if(!_0x37bc1e||!_0x7b624b)return;if(prefersReducedMotion())return;const _0x323f01=_0x7b624b['width']||0x0,_0xc2a184=_0x7b624b['height']||0x0,_0x717dae=_0x37bc1e['width']||0x0,_0x3538b4=_0x37bc1e['height']||0x0;if(_0x323f01<=0x0||_0xc2a184<=0x0||_0x717dae<=0x0||_0x3538b4<=0x0)return;const _0x42f16f=_0x37bc1e['left']-_0x7b624b['left'],_0x315fe4=_0x37bc1e['top']-_0x7b624b['top'],_0x5288b9=_0x717dae/_0x323f01,_0x258b36=_0x3538b4/_0xc2a184;if(!Number['isFinite'](_0x42f16f)||!Number['isFinite'](_0x315fe4)||!Number['isFinite'](_0x5288b9)||!Number['isFinite'](_0x258b36))return;safeCancelAnimations(_0x4e5f9b);const _0x151c02=_0x4e5f9b['style']['transition'],_0x4958cb=_0x4e5f9b['style']['transformOrigin'],_0x580534=_0x4e5f9b['style']['willChange'];_0x4e5f9b['style']['transition']='none',_0x4e5f9b['style']['transformOrigin']='top\x20left',_0x4e5f9b['style']['willChange']='transform';const _0x24b4ed='translate('+_0x42f16f+'px,\x20'+_0x315fe4+'px)\x20scale('+_0x5288b9+',\x20'+_0x258b36+')',_0x270217=_0x4e5f9b['animate']([{'transform':_0x24b4ed},{'transform':'none'}],{'duration':_0x46c4e0,'easing':'ease','fill':'both'}),_0x19a9a9=()=>{_0x4e5f9b['style']['transition']=_0x151c02,_0x4e5f9b['style']['transformOrigin']=_0x4958cb,_0x4e5f9b['style']['willChange']=_0x580534;};_0x270217['addEventListener']('finish',_0x19a9a9,{'once':!![]}),_0x270217['addEventListener']('cancel',_0x19a9a9,{'once':!![]});}export function toggleModalMaximize(_0x32fa0f,_0x2aa35f={}){if(!_0x32fa0f)return;const {storageKey:_0x3c265f,updateIcon:_0x14cdc7,onAfterToggle:_0x59e911,durationMs:durationMs=DEFAULT_DURATION_MS}=_0x2aa35f,_0x3261e7=_0x32fa0f['querySelector']('.modal-content'),_0x257040=_0x32fa0f['classList']['contains']('maximized'),_0x301519=!_0x257040;if(!_0x3261e7){_0x32fa0f['classList']['toggle']('maximized'),_0x14cdc7?.(_0x301519),_0x59e911?.(_0x301519);if(_0x3c265f)try{localStorage['setItem'](_0x3c265f,String(_0x301519));}catch{}return;}if(_0x257040&&!prefersReducedMotion()){const _0x11e6e2=_0x3261e7['getBoundingClientRect']();_0x32fa0f['classList']['remove']('maximized');const _0x233d30=_0x3261e7['getBoundingClientRect']();animateRestoreFlip({'contentEl':_0x3261e7,'fromRect':_0x11e6e2,'toRect':_0x233d30,'durationMs':durationMs});}else _0x32fa0f['classList']['toggle']('maximized');_0x14cdc7?.(_0x301519),_0x59e911?.(_0x301519);if(_0x3c265f)try{localStorage['setItem'](_0x3c265f,String(_0x301519));}catch{}}