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:_0xb402c6,tileSelector:tileSelector='.task-tile',onLongPress:_0x35cb7b,shouldHandle:_0x3b60f9}={}){if(typeof document==='undefined')return()=>{};if(typeof _0x35cb7b!=='function')return()=>{};const _0xad374f=typeof _0xb402c6==='string'?document['querySelector'](_0xb402c6):_0xb402c6;if(!_0xad374f)return()=>{};let _0x373e69=null,_0x22b521=0x0;function _0x267005(){if(!_0x373e69)return;_0x373e69['timer']&&(clearTimeout(_0x373e69['timer']),_0x373e69['timer']=null),_0x373e69['tile']&&_0x373e69['tile']['classList']['remove']('mobile-long-press-active'),_0x373e69=null;}function _0x54a8fe(_0x59ac0e){const _0x31c5a1=_0x1ea399=>{_0x1ea399['preventDefault'](),_0x1ea399['stopPropagation'](),_0x59ac0e['removeEventListener']('click',_0x31c5a1,!![]);};_0x59ac0e['addEventListener']('click',_0x31c5a1,!![]),window['setTimeout'](()=>{_0x59ac0e['removeEventListener']('click',_0x31c5a1,!![]);},CLICK_SUPPRESS_MS);}function _0x39b36e(_0xee4f13){if(!isMobileContext())return;if(!_0xee4f13['isPrimary'])return;if(_0xee4f13['button']!==undefined&&_0xee4f13['button']!==0x0)return;if(_0xee4f13['pointerType']&&_0xee4f13['pointerType']==='mouse')return;const _0x267234=_0xee4f13['target'];if(!(_0x267234 instanceof Element))return;if(_0x267234['closest']('button,\x20input,\x20select,\x20textarea,\x20label,\x20a[href]:not(.task-tile),\x20[data-no-long-press]'))return;const _0x54e268=_0x267234['closest'](tileSelector);if(!_0x54e268||!_0xad374f['contains'](_0x54e268))return;if(typeof _0x3b60f9==='function'&&!_0x3b60f9(_0x54e268,_0xee4f13))return;_0x267005(),_0x373e69={'tile':_0x54e268,'pointerId':_0xee4f13['pointerId'],'startX':_0xee4f13['clientX'],'startY':_0xee4f13['clientY'],'timer':null},_0x54e268['classList']['add']('mobile-long-press-active'),_0x373e69['timer']=window['setTimeout'](()=>{const _0x220638=_0x373e69;if(!_0x220638)return;_0x373e69=null,_0x220638['tile']['classList']['remove']('mobile-long-press-active');if(typeof navigator!=='undefined'&&typeof navigator['vibrate']==='function')try{navigator['vibrate'](0xe);}catch(_0x1dd1ce){}_0x22b521=Date['now']()+CLICK_SUPPRESS_MS,_0x54a8fe(_0x220638['tile']);try{_0x35cb7b(_0x220638['tile'],_0xee4f13);}catch(_0x39bff1){console['error']('[mobile-long-press-select]\x20handler\x20failed',_0x39bff1);}},LONG_PRESS_DURATION);}function _0x4a47cc(_0x40d96f){if(!_0x373e69||_0x40d96f['pointerId']!==_0x373e69['pointerId'])return;const _0x3b12bf=_0x40d96f['clientX']-_0x373e69['startX'],_0x4844ba=_0x40d96f['clientY']-_0x373e69['startY'];_0x3b12bf*_0x3b12bf+_0x4844ba*_0x4844ba>MOVEMENT_SLOP_SQ&&_0x267005();}function _0x5c0952(_0x2da6e6){if(!_0x373e69)return;if(_0x2da6e6['pointerId']!==_0x373e69['pointerId'])return;_0x267005();}function _0x52012a(){if(_0x373e69)_0x267005();}function _0x1fe11d(_0x56dbae){if(!isMobileContext())return;if(!_0x373e69&&Date['now']()>_0x22b521)return;_0x56dbae['preventDefault']();}return _0xad374f['addEventListener']('pointerdown',_0x39b36e,{'passive':!![]}),_0xad374f['addEventListener']('pointermove',_0x4a47cc,{'passive':!![]}),_0xad374f['addEventListener']('pointerup',_0x5c0952,{'passive':!![]}),_0xad374f['addEventListener']('pointercancel',_0x5c0952,{'passive':!![]}),_0xad374f['addEventListener']('pointerleave',_0x5c0952,{'passive':!![]}),_0xad374f['addEventListener']('contextmenu',_0x1fe11d),window['addEventListener']('scroll',_0x52012a,{'passive':!![],'capture':!![]}),()=>{_0x267005(),_0xad374f['removeEventListener']('pointerdown',_0x39b36e),_0xad374f['removeEventListener']('pointermove',_0x4a47cc),_0xad374f['removeEventListener']('pointerup',_0x5c0952),_0xad374f['removeEventListener']('pointercancel',_0x5c0952),_0xad374f['removeEventListener']('pointerleave',_0x5c0952),_0xad374f['removeEventListener']('contextmenu',_0x1fe11d),window['removeEventListener']('scroll',_0x52012a,{'capture':!![]});};}