const MOBILE_QUERY='(hover:\x20none),\x20(pointer:\x20coarse)',LONG_PRESS_DURATION=0x1c2,MOVEMENT_SLOP_SQ=0x64,CLICK_SUPPRESS_MS=0x320;function isMobileContext(){if(typeof window==='undefined'||typeof window['matchMedia']!=='function')return![];return window['matchMedia'](MOBILE_QUERY)['matches'];}export function enableMobileLongPressSelect({container:_0x2d049e,tileSelector:tileSelector='.task-tile',onLongPress:_0x393e65,shouldHandle:_0x31063b}={}){if(typeof document==='undefined')return()=>{};if(typeof _0x393e65!=='function')return()=>{};const _0x5b3180=typeof _0x2d049e==='string'?document['querySelector'](_0x2d049e):_0x2d049e;if(!_0x5b3180)return()=>{};let _0x4137ae=null,_0xb29110=0x0;function _0x4a7002(){if(!_0x4137ae)return;_0x4137ae['timer']&&(clearTimeout(_0x4137ae['timer']),_0x4137ae['timer']=null),_0x4137ae['tile']&&_0x4137ae['tile']['classList']['remove']('mobile-long-press-active'),_0x4137ae=null;}function _0x586f1d(_0x12d536){const _0x4a27b8=_0x8a3c19=>{_0x8a3c19['preventDefault'](),_0x8a3c19['stopPropagation'](),_0x12d536['removeEventListener']('click',_0x4a27b8,!![]);};_0x12d536['addEventListener']('click',_0x4a27b8,!![]),window['setTimeout'](()=>{_0x12d536['removeEventListener']('click',_0x4a27b8,!![]);},CLICK_SUPPRESS_MS);}function _0x2f05a4(_0x5b717b){if(!isMobileContext())return;if(!_0x5b717b['isPrimary'])return;if(_0x5b717b['button']!==undefined&&_0x5b717b['button']!==0x0)return;if(_0x5b717b['pointerType']&&_0x5b717b['pointerType']==='mouse')return;const _0x33e4c0=_0x5b717b['target'];if(!(_0x33e4c0 instanceof Element))return;if(_0x33e4c0['closest']('button,\x20input,\x20select,\x20textarea,\x20label,\x20a[href]:not(.task-tile),\x20[data-no-long-press]'))return;const _0x9867b4=_0x33e4c0['closest'](tileSelector);if(!_0x9867b4||!_0x5b3180['contains'](_0x9867b4))return;if(typeof _0x31063b==='function'&&!_0x31063b(_0x9867b4,_0x5b717b))return;_0x4a7002(),_0x4137ae={'tile':_0x9867b4,'pointerId':_0x5b717b['pointerId'],'startX':_0x5b717b['clientX'],'startY':_0x5b717b['clientY'],'timer':null},_0x9867b4['classList']['add']('mobile-long-press-active'),_0x4137ae['timer']=window['setTimeout'](()=>{const _0xba8f02=_0x4137ae;if(!_0xba8f02)return;_0x4137ae=null,_0xba8f02['tile']['classList']['remove']('mobile-long-press-active');if(typeof navigator!=='undefined'&&typeof navigator['vibrate']==='function')try{navigator['vibrate'](0xe);}catch(_0x5e72a3){}_0xb29110=Date['now']()+CLICK_SUPPRESS_MS,_0x586f1d(_0xba8f02['tile']);try{_0x393e65(_0xba8f02['tile'],_0x5b717b);}catch(_0x3c6b51){console['error']('[mobile-long-press-select]\x20handler\x20failed',_0x3c6b51);}},LONG_PRESS_DURATION);}function _0x5dd774(_0x34fae3){if(!_0x4137ae||_0x34fae3['pointerId']!==_0x4137ae['pointerId'])return;const _0x472f70=_0x34fae3['clientX']-_0x4137ae['startX'],_0x24f5a5=_0x34fae3['clientY']-_0x4137ae['startY'];_0x472f70*_0x472f70+_0x24f5a5*_0x24f5a5>MOVEMENT_SLOP_SQ&&_0x4a7002();}function _0x5cce52(_0x56600f){if(!_0x4137ae)return;if(_0x56600f['pointerId']!==_0x4137ae['pointerId'])return;_0x4a7002();}function _0xe9cd61(){if(_0x4137ae)_0x4a7002();}function _0x41549b(_0x262d86){if(!isMobileContext())return;if(!_0x4137ae&&Date['now']()>_0xb29110)return;_0x262d86['preventDefault']();}return _0x5b3180['addEventListener']('pointerdown',_0x2f05a4,{'passive':!![]}),_0x5b3180['addEventListener']('pointermove',_0x5dd774,{'passive':!![]}),_0x5b3180['addEventListener']('pointerup',_0x5cce52,{'passive':!![]}),_0x5b3180['addEventListener']('pointercancel',_0x5cce52,{'passive':!![]}),_0x5b3180['addEventListener']('pointerleave',_0x5cce52,{'passive':!![]}),_0x5b3180['addEventListener']('contextmenu',_0x41549b),window['addEventListener']('scroll',_0xe9cd61,{'passive':!![],'capture':!![]}),()=>{_0x4a7002(),_0x5b3180['removeEventListener']('pointerdown',_0x2f05a4),_0x5b3180['removeEventListener']('pointermove',_0x5dd774),_0x5b3180['removeEventListener']('pointerup',_0x5cce52),_0x5b3180['removeEventListener']('pointercancel',_0x5cce52),_0x5b3180['removeEventListener']('pointerleave',_0x5cce52),_0x5b3180['removeEventListener']('contextmenu',_0x41549b),window['removeEventListener']('scroll',_0xe9cd61,{'capture':!![]});};}