export function getEnvironmentColor(_0x3d1ce2){let _0x87029e=0x0;for(let _0xf685e3=0x0;_0xf685e3<_0x3d1ce2['length'];_0xf685e3++){_0x87029e=_0x3d1ce2['charCodeAt'](_0xf685e3)+((_0x87029e<<0x5)-_0x87029e);}const _0x15d266=Math['abs'](_0x87029e)%0x168;return'hsl('+_0x15d266+',\x2055%,\x2048%)';}export function getEnvironmentInitials(_0x3d7a20){const _0x33b8bd=_0x3d7a20['split'](/[-_.\s]+/)['filter'](Boolean);if(_0x33b8bd['length']>=0x2)return(_0x33b8bd[0x0][0x0]+_0x33b8bd[0x1][0x0])['toUpperCase']();return _0x3d7a20['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(_0x325ca0,_0x1b0f7d){const _0x380ef8=_0x1b0f7d['value'];if(!_0x380ef8){_0x325ca0['textContent']=_0x1b0f7d['textContent'];return;}const _0x97f12a=_0x1b0f7d['getAttribute']('data-description')||'',_0x3310cc=parseInt(_0x1b0f7d['getAttribute']('data-repo-count')||'0',0xa),_0x6c5c9e=parseInt(_0x1b0f7d['getAttribute']('data-template-count')||'0',0xa),_0x4b6997=_0x1b0f7d['getAttribute']('data-custom-color')||getEnvironmentColor(_0x380ef8),_0x4d8c8a=_0x1b0f7d['getAttribute']('data-custom-initials')||getEnvironmentInitials(_0x380ef8);_0x325ca0['classList']['add']('env-rich-option');const _0x388e3d=document['createElement']('span');_0x388e3d['className']='env-option-avatar',_0x388e3d['style']['background']=_0x4b6997,_0x388e3d['textContent']=_0x4d8c8a,_0x325ca0['appendChild'](_0x388e3d);const _0x415b7a=document['createElement']('span');_0x415b7a['className']='env-option-content';const _0x40e904=document['createElement']('span');_0x40e904['className']='env-option-name',_0x40e904['textContent']=_0x380ef8,_0x415b7a['appendChild'](_0x40e904);if(_0x97f12a){const _0x695983=document['createElement']('span');_0x695983['className']='env-option-desc',_0x695983['textContent']=_0x97f12a,_0x415b7a['appendChild'](_0x695983);}const _0x23bbfa=document['createElement']('span');_0x23bbfa['className']='env-option-meta';const _0x234a29=[];if(_0x3310cc>0x0)_0x234a29['push'](ICON_REPO_SVG+'\x20'+_0x3310cc+'\x20repo'+(_0x3310cc!==0x1?'s':''));if(_0x6c5c9e>0x0)_0x234a29['push'](ICON_TEMPLATE_SVG+'\x20'+_0x6c5c9e+'\x20template'+(_0x6c5c9e!==0x1?'s':''));_0x234a29['length']>0x0&&(_0x23bbfa['innerHTML']=_0x234a29['join']('<span\x20class=\x22env-meta-sep\x22></span>'),_0x415b7a['appendChild'](_0x23bbfa)),_0x325ca0['appendChild'](_0x415b7a);}export function renderEnvironmentTrigger(_0x5cab8b,_0x4946ed){const _0x91aa59=_0x4946ed['value'];if(!_0x91aa59){_0x5cab8b['textContent']=_0x4946ed['textContent'];return;}const _0x4a5166=_0x4946ed['getAttribute']('data-custom-color')||getEnvironmentColor(_0x91aa59),_0x54f415=_0x4946ed['getAttribute']('data-custom-initials')||getEnvironmentInitials(_0x91aa59),_0x505ee3=document['createElement']('span');_0x505ee3['className']='env-trigger-avatar',_0x505ee3['style']['background']=_0x4a5166,_0x505ee3['textContent']=_0x54f415;const _0x27e2b7=document['createElement']('span');_0x27e2b7['className']='env-trigger-name',_0x27e2b7['textContent']=_0x91aa59,_0x5cab8b['appendChild'](_0x505ee3),_0x5cab8b['appendChild'](_0x27e2b7);}