export const NotificationManager={'isSupported'(){return'Notification'in window;},'isEnabled'(){if(!this['isSupported']())return![];return localStorage['getItem']('notifications-enabled')==='true';},'setEnabled'(_0x48a447){localStorage['setItem']('notifications-enabled',_0x48a447?'true':'false');},'getPermission'(){if(!this['isSupported']())return'unsupported';return Notification['permission'];},async 'requestPermission'(){if(!this['isSupported']())return'unsupported';if(Notification['permission']==='granted')return'granted';if(Notification['permission']==='denied')return'denied';try{const _0x5c2c91=await Notification['requestPermission']();return _0x5c2c91;}catch(_0x54b7c2){return console['error']('Failed\x20to\x20request\x20notification\x20permission:',_0x54b7c2),'denied';}},async 'show'(_0x45ff45,_0x49b5f9={}){if(!this['isEnabled']())return null;if(!this['isSupported']())return console['warn']('Notifications\x20are\x20not\x20supported\x20in\x20this\x20browser'),null;if(Notification['permission']!=='granted')return console['warn']('Notification\x20permission\x20not\x20granted'),null;try{const _0x4626e2=new Notification(_0x45ff45,{'icon':_0x49b5f9['icon']||'/favicon.ico','badge':_0x49b5f9['badge']||'/favicon.ico','body':_0x49b5f9['body']||'','tag':_0x49b5f9['tag']||'','requireInteraction':_0x49b5f9['requireInteraction']||![],'silent':_0x49b5f9['silent']||![],'data':_0x49b5f9['data']||{}});_0x49b5f9['onClick']&&(_0x4626e2['onclick']=_0xcd36f8=>{_0xcd36f8['preventDefault'](),window['focus'](),_0x49b5f9['onClick'](_0xcd36f8,_0x4626e2),_0x4626e2['close']();});if(!_0x49b5f9['requireInteraction']){const _0x2395d1=_0x49b5f9['duration']||0x1388;setTimeout(()=>{_0x4626e2['close']();},_0x2395d1);}return _0x4626e2;}catch(_0x228ea2){return console['error']('Failed\x20to\x20show\x20notification:',_0x228ea2),null;}},async 'notifyTaskComplete'(_0x13be2a){const _0x378b55=_0x13be2a['exitCode']!==undefined?_0x13be2a['exitCode']:_0x13be2a['exit_code'],_0xe94bac=_0x13be2a['status']==='completed'&&_0x378b55===0x0,_0x4ed55b=_0x13be2a['status']==='interrupted',_0x15e8a3=_0xe94bac?'✅\x20Task\x20Completed\x20Successfully':_0x4ed55b?'⏹️\x20Task\x20Interrupted':'❌\x20Task\x20Failed';let _0x1ce275;if(_0x13be2a['taskType']==='test'){const _0x34815d=_0x13be2a['testName']||'Test',_0x4a3e1f=_0x13be2a['testDescription']||_0x13be2a['description']||'';if(_0x4a3e1f&&_0x4a3e1f['length']>0x0){let _0x1f9b4b=_0x4a3e1f;_0x4a3e1f['length']>0x50&&(_0x1f9b4b=_0x4a3e1f['substring'](0x0,0x4d)+'...'),_0x1ce275='Test:\x20'+_0x34815d+'\x20-\x20'+_0x1f9b4b;}else _0x1ce275='Test:\x20'+_0x34815d;}else{if(_0x13be2a['taskType']==='deploy'){const _0x92b745=_0x13be2a['deployProfile']||'Deploy',_0x501466=_0x13be2a['deployDescription']||_0x13be2a['description']||'';if(_0x501466&&_0x501466['length']>0x0){let _0x42e60f=_0x501466;_0x501466['length']>0x50&&(_0x42e60f=_0x501466['substring'](0x0,0x4d)+'...'),_0x1ce275='Deploy:\x20'+_0x92b745+'\x20-\x20'+_0x42e60f;}else _0x1ce275='Deploy:\x20'+_0x92b745;}else{const _0x4cbc75=_0x13be2a['name']?_0x13be2a['name']['trim']():null,_0x208d0b=_0x13be2a['envVars']?.['CODER_AGENT']||_0x13be2a['envVars']?.['default_agent']||'Unknown',_0x2a5a59=_0x208d0b['charAt'](0x0)['toUpperCase']()+_0x208d0b['slice'](0x1);let _0x161d99,_0x485a93=![];if(_0x13be2a['followUpHistory']&&Array['isArray'](_0x13be2a['followUpHistory'])&&_0x13be2a['followUpHistory']['length']>0x0){const _0x385a4e=_0x13be2a['followUpHistory'][_0x13be2a['followUpHistory']['length']-0x1];_0x161d99=_0x385a4e['instructions'],_0x485a93=!![];}else _0x161d99=_0x13be2a['description']||_0x13be2a['instructions']||_0x13be2a['taskId'];_0x161d99['length']>0x64&&(_0x161d99=_0x161d99['substring'](0x0,0x61)+'...');const _0x22bba4=_0x485a93?'[Follow-up]\x20':'';_0x4cbc75?_0x1ce275=_0x4cbc75+'\x0a'+_0x2a5a59+':\x20'+_0x22bba4+_0x161d99:_0x1ce275=_0x2a5a59+':\x20'+_0x22bba4+_0x161d99;}}return this['show'](_0x15e8a3,{'body':_0x1ce275,'tag':'task-'+_0x13be2a['taskId'],'requireInteraction':![],'duration':0x1f40,'data':{'taskId':_0x13be2a['taskId']},'onClick':(_0x5ada39,_0x2b20aa)=>{window['open']('task.html?id='+_0x13be2a['taskId'],'_blank');}});},'shouldNotify'(_0x4779b3,_0x169bf8){if(!this['isEnabled']())return![];if(_0x4779b3['status']!=='completed'&&_0x4779b3['status']!=='failed'&&_0x4779b3['status']!=='interrupted')return![];if(!_0x169bf8['has'](_0x4779b3['taskId']))return![];const _0xa5ab73='notified-'+_0x4779b3['taskId'];if(sessionStorage['getItem'](_0xa5ab73)==='true')return![];return!![];},'markNotified'(_0x2eba60){sessionStorage['setItem']('notified-'+_0x2eba60,'true');},'clearNotificationHistory'(){const _0x4c6272=[];for(let _0x30c841=0x0;_0x30c841<sessionStorage['length'];_0x30c841++){const _0x3c36fe=sessionStorage['key'](_0x30c841);_0x3c36fe['startsWith']('notified-')&&_0x4c6272['push'](_0x3c36fe);}_0x4c6272['forEach'](_0x558f77=>sessionStorage['removeItem'](_0x558f77));}};