export const NotificationManager={'isSupported'(){return'Notification'in window;},'isEnabled'(){if(!this['isSupported']())return![];return localStorage['getItem']('notifications-enabled')==='true';},'setEnabled'(_0x17100c){localStorage['setItem']('notifications-enabled',_0x17100c?'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 _0x34125b=await Notification['requestPermission']();return _0x34125b;}catch(_0x2cbc90){return console['error']('Failed\x20to\x20request\x20notification\x20permission:',_0x2cbc90),'denied';}},async 'show'(_0xd1c0a1,_0x4f6d40={}){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 _0x54688e=new Notification(_0xd1c0a1,{'icon':_0x4f6d40['icon']||'/favicon.ico','badge':_0x4f6d40['badge']||'/favicon.ico','body':_0x4f6d40['body']||'','tag':_0x4f6d40['tag']||'','requireInteraction':_0x4f6d40['requireInteraction']||![],'silent':_0x4f6d40['silent']||![],'data':_0x4f6d40['data']||{}});_0x4f6d40['onClick']&&(_0x54688e['onclick']=_0x254c63=>{_0x254c63['preventDefault'](),window['focus'](),_0x4f6d40['onClick'](_0x254c63,_0x54688e),_0x54688e['close']();});if(!_0x4f6d40['requireInteraction']){const _0x3abcf0=_0x4f6d40['duration']||0x1388;setTimeout(()=>{_0x54688e['close']();},_0x3abcf0);}return _0x54688e;}catch(_0x3a8569){return console['error']('Failed\x20to\x20show\x20notification:',_0x3a8569),null;}},async 'notifyTaskComplete'(_0x2a1e08){const _0x19365f=_0x2a1e08['exitCode']!==undefined?_0x2a1e08['exitCode']:_0x2a1e08['exit_code'],_0x1d99e7=_0x2a1e08['status']==='completed'&&_0x19365f===0x0,_0x155bf1=_0x2a1e08['status']==='interrupted',_0x420b68=_0x1d99e7?'✅\x20Task\x20Completed\x20Successfully':_0x155bf1?'⏹️\x20Task\x20Interrupted':'❌\x20Task\x20Failed';let _0x1d3d60;if(_0x2a1e08['taskType']==='test'){const _0xc17ecf=_0x2a1e08['testName']||'Test',_0x466c3e=_0x2a1e08['testDescription']||_0x2a1e08['description']||'';if(_0x466c3e&&_0x466c3e['length']>0x0){let _0x24e211=_0x466c3e;_0x466c3e['length']>0x50&&(_0x24e211=_0x466c3e['substring'](0x0,0x4d)+'...'),_0x1d3d60='Test:\x20'+_0xc17ecf+'\x20-\x20'+_0x24e211;}else _0x1d3d60='Test:\x20'+_0xc17ecf;}else{if(_0x2a1e08['taskType']==='deploy'){const _0x59ea17=_0x2a1e08['deployProfile']||'Deploy',_0x3af58b=_0x2a1e08['deployDescription']||_0x2a1e08['description']||'';if(_0x3af58b&&_0x3af58b['length']>0x0){let _0x450f67=_0x3af58b;_0x3af58b['length']>0x50&&(_0x450f67=_0x3af58b['substring'](0x0,0x4d)+'...'),_0x1d3d60='Deploy:\x20'+_0x59ea17+'\x20-\x20'+_0x450f67;}else _0x1d3d60='Deploy:\x20'+_0x59ea17;}else{const _0xfc42d5=_0x2a1e08['name']?_0x2a1e08['name']['trim']():null,_0x938587=_0x2a1e08['envVars']?.['CODER_AGENT']||_0x2a1e08['envVars']?.['default_agent']||'Unknown',_0x2ee6db=_0x938587['charAt'](0x0)['toUpperCase']()+_0x938587['slice'](0x1);let _0x396266,_0x114be1=![];if(_0x2a1e08['followUpHistory']&&Array['isArray'](_0x2a1e08['followUpHistory'])&&_0x2a1e08['followUpHistory']['length']>0x0){const _0x16bd90=_0x2a1e08['followUpHistory'][_0x2a1e08['followUpHistory']['length']-0x1];_0x396266=_0x16bd90['instructions'],_0x114be1=!![];}else _0x396266=_0x2a1e08['description']||_0x2a1e08['instructions']||_0x2a1e08['taskId'];_0x396266['length']>0x64&&(_0x396266=_0x396266['substring'](0x0,0x61)+'...');const _0x49b40b=_0x114be1?'[Follow-up]\x20':'';_0xfc42d5?_0x1d3d60=_0xfc42d5+'\x0a'+_0x2ee6db+':\x20'+_0x49b40b+_0x396266:_0x1d3d60=_0x2ee6db+':\x20'+_0x49b40b+_0x396266;}}return this['show'](_0x420b68,{'body':_0x1d3d60,'tag':'task-'+_0x2a1e08['taskId'],'requireInteraction':![],'duration':0x1f40,'data':{'taskId':_0x2a1e08['taskId']},'onClick':(_0x576b98,_0x51aeb1)=>{window['open']('task.html?id='+_0x2a1e08['taskId'],'_blank');}});},'shouldNotify'(_0x593511,_0x4b40dc){if(!this['isEnabled']())return![];if(_0x593511['status']!=='completed'&&_0x593511['status']!=='failed'&&_0x593511['status']!=='interrupted')return![];if(!_0x4b40dc['has'](_0x593511['taskId']))return![];const _0xc2b4b0='notified-'+_0x593511['taskId'];if(sessionStorage['getItem'](_0xc2b4b0)==='true')return![];return!![];},'markNotified'(_0x2ed12b){sessionStorage['setItem']('notified-'+_0x2ed12b,'true');},'clearNotificationHistory'(){const _0x182d70=[];for(let _0x37441b=0x0;_0x37441b<sessionStorage['length'];_0x37441b++){const _0x50e7bb=sessionStorage['key'](_0x37441b);_0x50e7bb['startsWith']('notified-')&&_0x182d70['push'](_0x50e7bb);}_0x182d70['forEach'](_0x5667c6=>sessionStorage['removeItem'](_0x5667c6));}};