const DEFAULT_DURATION_MS=0xfa;function prefersReducedMotion(){try{return window['matchMedia']&&window['matchMedia']('(prefers-reduced-motion:\x20reduce)')['matches'];}catch{return![];}}function safeCancelAnimations(_0x33c6f7){if(!_0x33c6f7||typeof _0x33c6f7['getAnimations']!=='function')return;try{_0x33c6f7['getAnimations']()['forEach'](_0x55e9e9=>_0x55e9e9['cancel']());}catch{}}function animateRestoreFlip({contentEl:_0x1a29bd,fromRect:_0x392379,toRect:_0x397896,durationMs:_0x5e75ea}){if(!_0x1a29bd)return;if(!_0x392379||!_0x397896)return;if(prefersReducedMotion())return;const _0x5a6ea9=_0x397896['width']||0x0,_0x4fe1be=_0x397896['height']||0x0,_0x51002e=_0x392379['width']||0x0,_0x3e4f0f=_0x392379['height']||0x0;if(_0x5a6ea9<=0x0||_0x4fe1be<=0x0||_0x51002e<=0x0||_0x3e4f0f<=0x0)return;const _0x1e795d=_0x392379['left']-_0x397896['left'],_0x3ec56d=_0x392379['top']-_0x397896['top'],_0x4eb80b=_0x51002e/_0x5a6ea9,_0x472092=_0x3e4f0f/_0x4fe1be;if(!Number['isFinite'](_0x1e795d)||!Number['isFinite'](_0x3ec56d)||!Number['isFinite'](_0x4eb80b)||!Number['isFinite'](_0x472092))return;safeCancelAnimations(_0x1a29bd);const _0x528e3a=_0x1a29bd['style']['transition'],_0x671ccf=_0x1a29bd['style']['transformOrigin'],_0x2c7251=_0x1a29bd['style']['willChange'];_0x1a29bd['style']['transition']='none',_0x1a29bd['style']['transformOrigin']='top\x20left',_0x1a29bd['style']['willChange']='transform';const _0xd37aeb='translate('+_0x1e795d+'px,\x20'+_0x3ec56d+'px)\x20scale('+_0x4eb80b+',\x20'+_0x472092+')',_0x3ea4ef=_0x1a29bd['animate']([{'transform':_0xd37aeb},{'transform':'none'}],{'duration':_0x5e75ea,'easing':'ease','fill':'both'}),_0x3db279=()=>{_0x1a29bd['style']['transition']=_0x528e3a,_0x1a29bd['style']['transformOrigin']=_0x671ccf,_0x1a29bd['style']['willChange']=_0x2c7251;};_0x3ea4ef['addEventListener']('finish',_0x3db279,{'once':!![]}),_0x3ea4ef['addEventListener']('cancel',_0x3db279,{'once':!![]});}export function toggleModalMaximize(_0x4d8e0b,_0x4b7f34={}){if(!_0x4d8e0b)return;const {storageKey:_0x3c69c6,updateIcon:_0x11353c,onAfterToggle:_0x498e1f,durationMs:durationMs=DEFAULT_DURATION_MS}=_0x4b7f34,_0x245b43=_0x4d8e0b['querySelector']('.modal-content'),_0x98800b=_0x4d8e0b['classList']['contains']('maximized'),_0x3fddef=!_0x98800b;if(!_0x245b43){_0x4d8e0b['classList']['toggle']('maximized'),_0x11353c?.(_0x3fddef),_0x498e1f?.(_0x3fddef);if(_0x3c69c6)try{localStorage['setItem'](_0x3c69c6,String(_0x3fddef));}catch{}return;}if(_0x98800b&&!prefersReducedMotion()){const _0x21d7ba=_0x245b43['getBoundingClientRect']();_0x4d8e0b['classList']['remove']('maximized');const _0xaf734e=_0x245b43['getBoundingClientRect']();animateRestoreFlip({'contentEl':_0x245b43,'fromRect':_0x21d7ba,'toRect':_0xaf734e,'durationMs':durationMs});}else _0x4d8e0b['classList']['toggle']('maximized');_0x11353c?.(_0x3fddef),_0x498e1f?.(_0x3fddef);if(_0x3c69c6)try{localStorage['setItem'](_0x3c69c6,String(_0x3fddef));}catch{}}