diff --git a/ui/state.js b/ui/state.js index 31e58c2..53b64cb 100644 --- a/ui/state.js +++ b/ui/state.js @@ -1 +1 @@ -function _0x13df(){const _0x47d610=['maxTokens','apiUrl','#amily2_model','optimizationTargetTag','systemPrompt','#amily2_temperature','#amily2_summarization_enabled','#amily2_lore_depth_input','#amily2_context_messages','loreDepth','1600efXTSA','请检查API配置后点击\x22刷新模型\x22','hide','#amily2_api_url','2608245UcBJQB','#amily2_auto_hide_threshold_value','#amily2_output_format_prompt','已选择:\x20','#amily2_max_tokens_value','#auth_panel','mainPrompt','show','checked','input[name=\x22amily2_lorebook_target\x22][value=\x22','#amily2_temperature_value','4593970pTFMrZ','','38KQwLTP','selected','11FlhtsO','loreInsertionPosition','已加载\x20','2637790CBNeCy','#amily2_main_prompt','attr','autoHideEnabled','contextMessages','13979yyvuti','html','#amily2_mhb_small_auto_enabled','input[name=\x22amily2_optimization_mode\x22][value=\x22','text','#amily2_context_messages_value','3918HRtUNZ','#amily2_enabled','#amily2_lore_depth_container','.plugin-features','#amily2_worldbook_enabled','autoHideThreshold','#amily2_optimization_enabled','lorebookTarget','#amily2_show_optimization_toast','693318adBwMA','prop','showOptimizationToast','input[name=\x22amily2_icon_location\x22][value=\x22','historiographySmallAutoEnable','append','1027950sWhadr','summarizationEnabled','historiographySmallTriggerThreshold','length','#amily2_max_tokens','suppressToast','#amily2_optimization_target_tag','','empty','at_depth','val','#amily2_suppress_toast','worldbookEnabled','4rCIAoz','authorized','#amily2_summarization_prompt','forEach','#amily2_model_notes'];_0x13df=function(){return _0x47d610;};return _0x13df();}(function(_0xb5c45a,_0x5b32d2){const _0x3c5c0c=_0x521b,_0x4a5fbb=_0xb5c45a();while(!![]){try{const _0x4b91b7=-parseInt(_0x3c5c0c(0x14e))/0x1*(-parseInt(_0x3c5c0c(0x18a))/0x2)+parseInt(_0x3c5c0c(0x157))/0x3*(-parseInt(_0x3c5c0c(0x16a))/0x4)+parseInt(_0x3c5c0c(0x143))/0x5+-parseInt(_0x3c5c0c(0x15d))/0x6+parseInt(_0x3c5c0c(0x148))/0x7*(-parseInt(_0x3c5c0c(0x179))/0x8)+parseInt(_0x3c5c0c(0x17d))/0x9+parseInt(_0x3c5c0c(0x188))/0xa*(parseInt(_0x3c5c0c(0x18c))/0xb);if(_0x4b91b7===_0x5b32d2)break;else _0x4a5fbb['push'](_0x4a5fbb['shift']());}catch(_0x252f52){_0x4a5fbb['push'](_0x4a5fbb['shift']());}}}(_0x13df,0x861fb));import{extension_settings}from'/scripts/extensions.js';import{extensionName}from'../utils/settings.js';import{pluginAuthStatus}from'../utils/auth.js';let availableModels=[],latestUpdateInfo=null,newVersionAvailable=![];export function setUpdateInfo(_0x54361a,_0x2e2957){newVersionAvailable=_0x54361a,latestUpdateInfo=_0x2e2957;}export function applyUpdateIndicator(){const _0x5ee720=_0x521b;if(newVersionAvailable)$('#amily2_update_indicator')[_0x5ee720(0x184)]();else{}}function _0x521b(_0xce26cc,_0x501069){const _0x13df70=_0x13df();return _0x521b=function(_0x521bf8,_0x433e4a){_0x521bf8=_0x521bf8-0x143;let _0x216f11=_0x13df70[_0x521bf8];return _0x216f11;},_0x521b(_0xce26cc,_0x501069);}export function getLatestUpdateInfo(){return latestUpdateInfo;}export function setAvailableModels(_0xd5f627){availableModels=_0xd5f627;}export function populateModelDropdown(){const _0x2eb2a5=_0x521b,_0x5edf38=$(_0x2eb2a5(0x171)),_0x19dcec=$(_0x2eb2a5(0x16e));_0x5edf38[_0x2eb2a5(0x165)]();const _0x2a7d27=extension_settings[extensionName]?.['model']||'';if(availableModels[_0x2eb2a5(0x160)]===0x0){_0x5edf38[_0x2eb2a5(0x15c)]('无可用模型,请刷新'),_0x19dcec[_0x2eb2a5(0x149)](_0x2eb2a5(0x17a));return;}const _0x3e8083=$(_0x2eb2a5(0x164))[_0x2eb2a5(0x167)]('')[_0x2eb2a5(0x14c)]('--\x20选择模型\x20--');_0x5edf38[_0x2eb2a5(0x15c)](_0x3e8083),availableModels[_0x2eb2a5(0x16d)](_0x3268f3=>{const _0x1eca1e=_0x2eb2a5,_0x50bcd1=$(_0x1eca1e(0x164))[_0x1eca1e(0x167)](_0x3268f3)['text'](_0x3268f3);_0x3268f3===_0x2a7d27&&_0x50bcd1[_0x1eca1e(0x145)]('selected',_0x1eca1e(0x18b)),_0x5edf38[_0x1eca1e(0x15c)](_0x50bcd1);}),_0x2a7d27&&_0x5edf38['val']()===_0x2a7d27?_0x19dcec[_0x2eb2a5(0x149)](_0x2eb2a5(0x180)+_0x2a7d27+_0x2eb2a5(0x189)):_0x19dcec[_0x2eb2a5(0x149)](_0x2eb2a5(0x18e)+availableModels[_0x2eb2a5(0x160)]+'\x20个可用模型');}export function updateUI(){const _0x2e0995=_0x521b;if(!pluginAuthStatus[_0x2e0995(0x16b)])$(_0x2e0995(0x182))[_0x2e0995(0x184)](),$(_0x2e0995(0x151))['hide']();else{$(_0x2e0995(0x182))[_0x2e0995(0x17b)](),$(_0x2e0995(0x151))[_0x2e0995(0x184)]();const _0x4823d6=extension_settings[extensionName];if(!_0x4823d6)return;$(_0x2e0995(0x14f))['prop'](_0x2e0995(0x185),_0x4823d6['enabled']),$(_0x2e0995(0x17c))['val'](_0x4823d6[_0x2e0995(0x170)]),$('#amily2_api_key')[_0x2e0995(0x167)](_0x4823d6['apiKey']),$(_0x2e0995(0x171))[_0x2e0995(0x167)](_0x4823d6['model']),$(_0x2e0995(0x161))['val'](_0x4823d6[_0x2e0995(0x16f)]),$(_0x2e0995(0x181))[_0x2e0995(0x14c)](_0x4823d6[_0x2e0995(0x16f)]),$(_0x2e0995(0x174))[_0x2e0995(0x167)](_0x4823d6['temperature']),$(_0x2e0995(0x187))['text'](_0x4823d6['temperature']),$(_0x2e0995(0x177))[_0x2e0995(0x167)](_0x4823d6['contextMessages']),$(_0x2e0995(0x14d))['text'](_0x4823d6[_0x2e0995(0x147)]),$(_0x2e0995(0x163))[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x172)]),$(_0x2e0995(0x14b)+_0x4823d6['optimizationMode']+'\x22]')[_0x2e0995(0x158)](_0x2e0995(0x185),!![]),$(_0x2e0995(0x154))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6['optimizationEnabled']),$(_0x2e0995(0x156))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6[_0x2e0995(0x159)]),$(_0x2e0995(0x168))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6[_0x2e0995(0x162)]),$('#amily2_system_prompt')[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x173)]),$(_0x2e0995(0x144))[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x183)]),$(_0x2e0995(0x17f))['val'](_0x4823d6['outputFormatPrompt']),$(_0x2e0995(0x16c))['val'](_0x4823d6['summarizationPrompt']),$(_0x2e0995(0x152))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6[_0x2e0995(0x169)]),$(_0x2e0995(0x175))[_0x2e0995(0x158)]('checked',_0x4823d6[_0x2e0995(0x15e)]),$(_0x2e0995(0x186)+_0x4823d6[_0x2e0995(0x155)]+'\x22]')[_0x2e0995(0x158)](_0x2e0995(0x185),!![]),$(_0x2e0995(0x15a)+_0x4823d6['iconLocation']+'\x22]')[_0x2e0995(0x158)](_0x2e0995(0x185),!![]),$('#amily2_auto_hide_enabled')[_0x2e0995(0x158)]('checked',_0x4823d6[_0x2e0995(0x146)]),$('#amily2_auto_hide_threshold')['val'](_0x4823d6['autoHideThreshold']),$(_0x2e0995(0x17e))[_0x2e0995(0x14c)](_0x4823d6[_0x2e0995(0x153)]),$('#amily2_lore_activation_mode')[_0x2e0995(0x167)](_0x4823d6['loreActivationMode']),$('#amily2_lore_insertion_position')[_0x2e0995(0x167)](_0x4823d6['loreInsertionPosition']),$(_0x2e0995(0x176))[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x178)]),_0x4823d6[_0x2e0995(0x18d)]===_0x2e0995(0x166)?$(_0x2e0995(0x150))[_0x2e0995(0x184)]():$(_0x2e0995(0x150))[_0x2e0995(0x17b)](),_0x4823d6[_0x2e0995(0x15b)]!==undefined&&$(_0x2e0995(0x14a))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6[_0x2e0995(0x15b)]),_0x4823d6[_0x2e0995(0x15f)]!==undefined&&$('#amily2_mhb_small_trigger_count')[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x15f)]),populateModelDropdown();}} +(function(_0x3acc7c,_0x4a0568){const _0x2b39a8=_0x5e90,_0x79bbd1=_0x3acc7c();while(!![]){try{const _0x5a689d=-parseInt(_0x2b39a8(0x142))/0x1*(-parseInt(_0x2b39a8(0x141))/0x2)+parseInt(_0x2b39a8(0x125))/0x3+-parseInt(_0x2b39a8(0x132))/0x4*(-parseInt(_0x2b39a8(0x112))/0x5)+-parseInt(_0x2b39a8(0x153))/0x6*(-parseInt(_0x2b39a8(0x145))/0x7)+parseInt(_0x2b39a8(0x10e))/0x8*(-parseInt(_0x2b39a8(0x152))/0x9)+parseInt(_0x2b39a8(0x13c))/0xa*(parseInt(_0x2b39a8(0x14e))/0xb)+-parseInt(_0x2b39a8(0x144))/0xc*(parseInt(_0x2b39a8(0x14b))/0xd);if(_0x5a689d===_0x4a0568)break;else _0x79bbd1['push'](_0x79bbd1['shift']());}catch(_0x18c1e5){_0x79bbd1['push'](_0x79bbd1['shift']());}}}(_0xb32b,0xbc6de));import{extension_settings}from'/scripts/extensions.js';import{extensionName}from'../utils/settings.js';import{pluginAuthStatus}from'../utils/auth.js';function _0xb32b(){const _0x20be21=['533136SymgXb','#amily2_lore_insertion_position','optimizationMode','#amily2_mhb_small_trigger_count','245CqFKiA','input[name=\x22amily2_icon_location\x22][value=\x22','','#auth_panel','append','#amily2_system_prompt','hide','#amily2_suppress_toast','#amily2_optimization_enabled','checked','#amily2_summarization_prompt','val','#amily2_max_tokens_value','#amily2_api_url','#amily2_model','','#amily2_context_messages_value','suppressToast','请检查API配置后点击\x22刷新模型\x22','383853xXQwNo','prop','#amily2_main_prompt','#amily2_optimization_exclusion_enabled','apiKey','autoHideEnabled','text','showOptimizationToast','enabled','loreInsertionPosition','#amily2_auto_hide_threshold','autoHideThreshold','无可用模型,请刷新','90976adMefd','input[name=\x22amily2_lorebook_target\x22][value=\x22','empty','lorebookTarget','#amily2_api_key','at_depth','attr','iconLocation','worldbookEnabled','#amily2_update_indicator','15420710UvgRoj','temperature','optimizationTargetTag','mainPrompt','#amily2_temperature_value','2NHLPTJ','890533EmTxzm','systemPrompt','470892yQLouJ','7JkIwpw','input[name=\x22amily2_optimization_mode\x22][value=\x22','已加载\x20','length','\x20个可用模型','selected','754jpPXrZ','.plugin-features','#amily2_model_notes','11eFlbio','#amily2_output_format_prompt','summarizationPrompt','optimizationExclusionEnabled','180BmfNcV','4233678LRUZCE','summarizationEnabled','optimizationEnabled','#amily2_worldbook_enabled','show','forEach','#amily2_lore_activation_mode','historiographySmallTriggerThreshold','authorized','model','#amily2_max_tokens','historiographySmallAutoEnable','#amily2_enabled','outputFormatPrompt','contextMessages','#amily2_auto_hide_enabled','#amily2_lore_depth_input','#amily2_optimization_target_tag','#amily2_summarization_enabled','html'];_0xb32b=function(){return _0x20be21;};return _0xb32b();}let availableModels=[],latestUpdateInfo=null,newVersionAvailable=![];export function setUpdateInfo(_0x238b70,_0x420607){newVersionAvailable=_0x238b70,latestUpdateInfo=_0x420607;}export function applyUpdateIndicator(){const _0x92bb50=_0x5e90;if(newVersionAvailable)$(_0x92bb50(0x13b))[_0x92bb50(0x157)]();else{}}function _0x5e90(_0x3b41d0,_0x504af5){const _0xb32be5=_0xb32b();return _0x5e90=function(_0x5e9002,_0x181b24){_0x5e9002=_0x5e9002-0x10e;let _0x3e93c=_0xb32be5[_0x5e9002];return _0x3e93c;},_0x5e90(_0x3b41d0,_0x504af5);}export function getLatestUpdateInfo(){return latestUpdateInfo;}export function setAvailableModels(_0x842684){availableModels=_0x842684;}export function populateModelDropdown(){const _0x248459=_0x5e90,_0x9b4f9b=$(_0x248459(0x120)),_0x5d99bb=$(_0x248459(0x14d));_0x9b4f9b[_0x248459(0x134)]();const _0x2976eb=extension_settings[extensionName]?.[_0x248459(0x15c)]||'';if(availableModels[_0x248459(0x148)]===0x0){_0x9b4f9b[_0x248459(0x116)](_0x248459(0x131)),_0x5d99bb['html'](_0x248459(0x124));return;}const _0x42e01a=$('')[_0x248459(0x11d)]('')[_0x248459(0x12b)]('--\x20选择模型\x20--');_0x9b4f9b[_0x248459(0x116)](_0x42e01a),availableModels[_0x248459(0x158)](_0x50c7b2=>{const _0x100301=_0x248459,_0xf31cbe=$(_0x100301(0x114))['val'](_0x50c7b2)[_0x100301(0x12b)](_0x50c7b2);_0x50c7b2===_0x2976eb&&_0xf31cbe[_0x100301(0x138)](_0x100301(0x14a),_0x100301(0x14a)),_0x9b4f9b[_0x100301(0x116)](_0xf31cbe);}),_0x2976eb&&_0x9b4f9b[_0x248459(0x11d)]()===_0x2976eb?_0x5d99bb[_0x248459(0x166)]('已选择:\x20'+_0x2976eb+_0x248459(0x121)):_0x5d99bb[_0x248459(0x166)](_0x248459(0x147)+availableModels[_0x248459(0x148)]+_0x248459(0x149));}export function updateUI(){const _0x4e1292=_0x5e90;if(!pluginAuthStatus[_0x4e1292(0x15b)])$(_0x4e1292(0x115))['show'](),$(_0x4e1292(0x14c))[_0x4e1292(0x118)]();else{$(_0x4e1292(0x115))[_0x4e1292(0x118)](),$(_0x4e1292(0x14c))[_0x4e1292(0x157)]();const _0x18d55f=extension_settings[extensionName];if(!_0x18d55f)return;$(_0x4e1292(0x15f))[_0x4e1292(0x126)]('checked',_0x18d55f[_0x4e1292(0x12d)]),$(_0x4e1292(0x11f))[_0x4e1292(0x11d)](_0x18d55f['apiUrl']),$(_0x4e1292(0x136))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x129)]),$(_0x4e1292(0x120))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x15c)]),$(_0x4e1292(0x15d))['val'](_0x18d55f['maxTokens']),$(_0x4e1292(0x11e))[_0x4e1292(0x12b)](_0x18d55f['maxTokens']),$('#amily2_temperature')[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x13d)]),$(_0x4e1292(0x140))['text'](_0x18d55f[_0x4e1292(0x13d)]),$('#amily2_context_messages')[_0x4e1292(0x11d)](_0x18d55f['contextMessages']),$(_0x4e1292(0x122))[_0x4e1292(0x12b)](_0x18d55f[_0x4e1292(0x161)]),$(_0x4e1292(0x164))['val'](_0x18d55f[_0x4e1292(0x13e)]),$(_0x4e1292(0x146)+_0x18d55f[_0x4e1292(0x110)]+'\x22]')['prop'](_0x4e1292(0x11b),!![]),$(_0x4e1292(0x11a))[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x155)]),$(_0x4e1292(0x128))['prop'](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x151)]),$('#amily2_show_optimization_toast')[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x12c)]),$(_0x4e1292(0x119))['prop'](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x123)]),$(_0x4e1292(0x117))['val'](_0x18d55f[_0x4e1292(0x143)]),$(_0x4e1292(0x127))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x13f)]),$(_0x4e1292(0x14f))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x160)]),$(_0x4e1292(0x11c))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x150)]),$(_0x4e1292(0x156))[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x13a)]),$(_0x4e1292(0x165))[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x154)]),$(_0x4e1292(0x133)+_0x18d55f[_0x4e1292(0x135)]+'\x22]')[_0x4e1292(0x126)](_0x4e1292(0x11b),!![]),$(_0x4e1292(0x113)+_0x18d55f[_0x4e1292(0x139)]+'\x22]')['prop']('checked',!![]),$(_0x4e1292(0x162))['prop'](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x12a)]),$(_0x4e1292(0x12f))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x130)]),$('#amily2_auto_hide_threshold_value')['text'](_0x18d55f[_0x4e1292(0x130)]),$(_0x4e1292(0x159))[_0x4e1292(0x11d)](_0x18d55f['loreActivationMode']),$(_0x4e1292(0x10f))['val'](_0x18d55f[_0x4e1292(0x12e)]),$(_0x4e1292(0x163))[_0x4e1292(0x11d)](_0x18d55f['loreDepth']),_0x18d55f[_0x4e1292(0x12e)]===_0x4e1292(0x137)?$('#amily2_lore_depth_container')[_0x4e1292(0x157)]():$('#amily2_lore_depth_container')[_0x4e1292(0x118)](),_0x18d55f[_0x4e1292(0x15e)]!==undefined&&$('#amily2_mhb_small_auto_enabled')[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x15e)]),_0x18d55f['historiographySmallTriggerThreshold']!==undefined&&$(_0x4e1292(0x111))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x15a)]),populateModelDropdown();}}