export function getEnvironmentColor(_0x118143){let _0x4de765=0x0;for(let _0x2c3e7f=0x0;_0x2c3e7f<_0x118143['length'];_0x2c3e7f++){_0x4de765=_0x118143['charCodeAt'](_0x2c3e7f)+((_0x4de765<<0x5)-_0x4de765);}const _0x21dc08=Math['abs'](_0x4de765)%0x168;return'hsl('+_0x21dc08+',\x2055%,\x2048%)';}export function getEnvironmentInitials(_0x435b74){const _0x55bd65=_0x435b74['split'](/[-_.\s]+/)['filter'](Boolean);if(_0x55bd65['length']>=0x2)return(_0x55bd65[0x0][0x0]+_0x55bd65[0x1][0x0])['toUpperCase']();return _0x435b74['substring'](0x0,0x2)['toUpperCase']();}const ICON_REPO_SVG='<svg\x20class=\x22env-meta-icon\x22\x20width=\x2213\x22\x20height=\x2213\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M22\x2019a2\x202\x200\x200\x201-2\x202H4a2\x202\x200\x200\x201-2-2V5a2\x202\x200\x200\x201\x202-2h5l2\x203h9a2\x202\x200\x200\x201\x202\x202z\x22></path></svg>',ICON_TEMPLATE_SVG='<svg\x20class=\x22env-meta-icon\x22\x20width=\x2213\x22\x20height=\x2213\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M14\x202H6a2\x202\x200\x200\x200-2\x202v16a2\x202\x200\x200\x200\x202\x202h12a2\x202\x200\x200\x200\x202-2V8z\x22></path><polyline\x20points=\x2214\x202\x2014\x208\x2020\x208\x22></polyline></svg>';export function renderEnvironmentOption(_0x2399db,_0x25f5f5){const _0x537c19=_0x25f5f5['value'];if(!_0x537c19){_0x2399db['textContent']=_0x25f5f5['textContent'];return;}const _0x30b65c=_0x25f5f5['getAttribute']('data-description')||'',_0x1149ec=parseInt(_0x25f5f5['getAttribute']('data-repo-count')||'0',0xa),_0xfc2fe5=parseInt(_0x25f5f5['getAttribute']('data-template-count')||'0',0xa),_0x54bf0b=_0x25f5f5['getAttribute']('data-custom-color')||getEnvironmentColor(_0x537c19),_0x132ef8=_0x25f5f5['getAttribute']('data-custom-initials')||getEnvironmentInitials(_0x537c19);_0x2399db['classList']['add']('env-rich-option');const _0x56dd08=document['createElement']('span');_0x56dd08['className']='env-option-avatar',_0x56dd08['style']['background']=_0x54bf0b,_0x56dd08['textContent']=_0x132ef8,_0x2399db['appendChild'](_0x56dd08);const _0x5721f4=document['createElement']('span');_0x5721f4['className']='env-option-content';const _0x5b30de=document['createElement']('span');_0x5b30de['className']='env-option-name',_0x5b30de['textContent']=_0x537c19,_0x5721f4['appendChild'](_0x5b30de);if(_0x30b65c){const _0x1eb74e=document['createElement']('span');_0x1eb74e['className']='env-option-desc',_0x1eb74e['textContent']=_0x30b65c,_0x5721f4['appendChild'](_0x1eb74e);}const _0x54c3d7=document['createElement']('span');_0x54c3d7['className']='env-option-meta';const _0x48bb05=[];if(_0x1149ec>0x0)_0x48bb05['push'](ICON_REPO_SVG+'\x20'+_0x1149ec+'\x20repo'+(_0x1149ec!==0x1?'s':''));if(_0xfc2fe5>0x0)_0x48bb05['push'](ICON_TEMPLATE_SVG+'\x20'+_0xfc2fe5+'\x20template'+(_0xfc2fe5!==0x1?'s':''));_0x48bb05['length']>0x0&&(_0x54c3d7['innerHTML']=_0x48bb05['join']('<span\x20class=\x22env-meta-sep\x22></span>'),_0x5721f4['appendChild'](_0x54c3d7)),_0x2399db['appendChild'](_0x5721f4);}export function renderEnvironmentTrigger(_0x64dab0,_0x1caa69){const _0x3cd95c=_0x1caa69['value'];if(!_0x3cd95c){_0x64dab0['textContent']=_0x1caa69['textContent'];return;}const _0x1467de=_0x1caa69['getAttribute']('data-custom-color')||getEnvironmentColor(_0x3cd95c),_0x4ff082=_0x1caa69['getAttribute']('data-custom-initials')||getEnvironmentInitials(_0x3cd95c),_0x12fe54=document['createElement']('span');_0x12fe54['className']='env-trigger-avatar',_0x12fe54['style']['background']=_0x1467de,_0x12fe54['textContent']=_0x4ff082;const _0x5427ef=document['createElement']('span');_0x5427ef['className']='env-trigger-name',_0x5427ef['textContent']=_0x3cd95c,_0x64dab0['appendChild'](_0x12fe54),_0x64dab0['appendChild'](_0x5427ef);}