function permissionInSet(_0x3e4fed,_0x10f3ca){if(!_0x3e4fed||!_0x10f3ca)return![];if(_0x3e4fed['includes']('*'))return!![];if(_0x3e4fed['includes'](_0x10f3ca))return!![];const [_0x5c2a54]=_0x10f3ca['split'](':');if(_0x3e4fed['includes'](_0x5c2a54+':*'))return!![];return![];}function hasServerPermission(_0x12dd77,_0xb30f25){const _0x1c9b6c=_0x12dd77?.['permissions']?.['server'];if(!_0x1c9b6c)return![];return permissionInSet(_0x1c9b6c,_0xb30f25);}function hasEnvPermission(_0x8535be,_0x175b4e){if(hasServerPermission(_0x8535be,'*'))return!![];const _0x1c4bd3=_0x8535be?.['permissions']?.['environments'];if(!_0x1c4bd3)return![];for(const _0x512614 of Object['values'](_0x1c4bd3)){if(permissionInSet(_0x512614,_0x175b4e))return!![];}return![];}function hasEnvPermissionOn(_0x29289c,_0x44a892,_0x2f08e9){if(hasServerPermission(_0x29289c,'*'))return!![];const _0x1368e0=_0x29289c?.['permissions']?.['environments']?.[_0x44a892];if(!_0x1368e0)return![];return permissionInSet(_0x1368e0,_0x2f08e9);}function hasTeamPermission(_0x3d1688,_0x5e4f8d){if(hasServerPermission(_0x3d1688,'*'))return!![];const _0x2c49af=_0x3d1688?.['permissions']?.['teams'];if(!_0x2c49af)return![];for(const _0x311e11 of Object['values'](_0x2c49af)){if(permissionInSet(_0x311e11,_0x5e4f8d))return!![];}return![];}function hasAnyEnvironment(_0x8276a8){if(hasServerPermission(_0x8276a8,'*'))return!![];const _0xd373a1=_0x8276a8?.['permissions']?.['environments'];return _0xd373a1!=null&&Object['keys'](_0xd373a1)['length']>0x0;}function canDeleteTask(_0xb24825,_0x538a78){if(!_0xb24825||!_0x538a78||!_0x538a78['environment'])return![];if(hasEnvPermissionOn(_0xb24825,_0x538a78['environment'],'tasks:delete_any'))return!![];if(!hasEnvPermissionOn(_0xb24825,_0x538a78['environment'],'tasks:delete'))return![];return _0x538a78['createdBy']?.['userId']===_0xb24825['id'];}window['Permissions']={'hasServerPermission':hasServerPermission,'hasEnvPermission':hasEnvPermission,'hasEnvPermissionOn':hasEnvPermissionOn,'hasTeamPermission':hasTeamPermission,'hasAnyEnvironment':hasAnyEnvironment,'canDeleteTask':canDeleteTask};