mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 11:35:50 +00:00
2 lines
25 KiB
JavaScript
2 lines
25 KiB
JavaScript
(function(_0x58448b,_0x561249){const _0x1f6b02=_0x383b,_0x50cf10=_0x58448b();while(!![]){try{const _0x51cb65=-parseInt(_0x1f6b02(0x11c))/0x1*(parseInt(_0x1f6b02(0xf5))/0x2)+parseInt(_0x1f6b02(0x189))/0x3+parseInt(_0x1f6b02(0x18e))/0x4+parseInt(_0x1f6b02(0x102))/0x5+parseInt(_0x1f6b02(0x156))/0x6+-parseInt(_0x1f6b02(0x176))/0x7*(-parseInt(_0x1f6b02(0x192))/0x8)+-parseInt(_0x1f6b02(0x12b))/0x9;if(_0x51cb65===_0x561249)break;else _0x50cf10['push'](_0x50cf10['shift']());}catch(_0x236fd8){_0x50cf10['push'](_0x50cf10['shift']());}}}(_0x5a97,0x947b0));import{extension_settings}from'/scripts/extensions.js';import{saveSettingsDebounced}from'/script.js';import{defaultSettings,extensionName}from'../utils/settings.js';import{pluginAuthStatus,activatePluginAuthorization,getPasswordForDate}from'../utils/auth.js';import{fetchModels}from'../core/api.js';import{setAvailableModels,populateModelDropdown,getLatestUpdateInfo}from'./state.js';import{fixCommand,testReplyChecker}from'../core/commands.js';import{createDrawer}from'../ui/drawer.js';import{messageFormatting}from'/script.js';import{executeManualCommand}from'../core/autoHideManager.js';import{showContentModal,showHtmlModal}from'./page-window.js';function _0x383b(_0x92d67c,_0x4ca5b6){const _0x5a97a7=_0x5a97();return _0x383b=function(_0x383b6e,_0x52e985){_0x383b6e=_0x383b6e-0xed;let _0x4c3eb1=_0x5a97a7[_0x383b6e];return _0x4c3eb1;},_0x383b(_0x92d67c,_0x4ca5b6);}function displayDailyAuthCode(){const _0x2e23f6=_0x383b,_0x461682=document['getElementById'](_0x2e23f6(0xf8)),_0x51095a=document[_0x2e23f6(0x101)](_0x2e23f6(0x187));if(_0x461682&&_0x51095a){const _0x56b56e=getPasswordForDate(new Date());_0x461682[_0x2e23f6(0x18a)]=_0x56b56e,_0x51095a[_0x2e23f6(0x12e)](_0x2e23f6(0x10a),()=>{const _0x3e4af5=_0x2e23f6;navigator[_0x3e4af5(0x17b)][_0x3e4af5(0x119)](_0x56b56e)[_0x3e4af5(0x166)](()=>{const _0x3ba859=_0x3e4af5;toastr[_0x3ba859(0x19e)](_0x3ba859(0x115));},()=>{const _0x210bae=_0x3e4af5;toastr[_0x210bae(0x160)](_0x210bae(0x137));});});}}function _0x5a97(){const _0x17429b=['title','click.amily2.update','input[type=\x22radio\x22][name^=\x22amily2_\x22]:not([name=\x22amily2_icon_location\x22])','#amily2_update_button',']\x20已镌刻!','amily2_copy_daily_code','<i\x20class=\x22fas\x20fa-check\x22></i>\x20已确认','255744UayUyw','textContent','#amily2_prompt_selector','#amily2_drawer_content','push','1468896KhFuPL','each','change.amily2.checkbox','toUpperCase','171560FCyBJT','first','trigger','includes','change.amily2.manual_model','events-bound','#amily2_memorisation_forms_panel','\x22\x20placeholder=\x22结束字符,\x20如\x20-->\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22delete-rule-btn\x20menu_button\x20danger_button\x22\x20title=\x22删除此规则\x22>×</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','input.amily2.range','val','#auth_submit','changelog','success','unhide_all','amily2_refresh_models','model','#amily2_system_prompt','#amily2_auth_code','click.amily2.manual_command','[Amily-禁卫军]\x20收到迁都指令\x20->\x20','type','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<dialog\x20class=\x22popup\x20wide_dialogue_popup\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22popup-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h3\x20style=\x22margin-top:0;\x20color:\x20#eee;\x20border-bottom:\x201px\x20solid\x20rgba(255,255,255,0.2);\x20padding-bottom:\x2010px;\x22><i\x20class=\x22fas\x20fa-bell\x22\x20style=\x22color:\x20#ff9800;\x22></i>\x20帝国最新情报</h3>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22popup-content\x22\x20style=\x22height:\x2060vh;\x20overflow-y:\x20auto;\x20background:\x20rgba(0,0,0,0.2);\x20padding:\x2015px;\x20border-radius:\x205px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22mes_text\x22>',']\x20的新状态已保存。','.delete-rule-btn','change.amily2.lore_settings','body','checked','#amily2_api_key_wrapper','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<dialog\x20class=\x22popup\x20wide_dialogue_popup\x20large_dialogue_popup\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22popup-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h4\x20style=\x22margin-top:0;\x20color:\x20#eee;\x20border-bottom:\x201px\x20solid\x20rgba(255,255,255,0.2);\x20padding-bottom:\x2010px;\x22>正在编辑:\x20','amily2_manual_unhide_confirm','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22optimization-exclusion-rules-container\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22notes\x22>在这里定义需要从优化内容中排除的文本片段。例如,排除HTML注释,可以设置开始字符为\x20`<!--`,结束字符为\x20`-->`。</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22optimization-rules-list\x22\x20style=\x22max-height:\x2045vh;\x20overflow-y:\x20auto;\x20padding:\x2010px;\x20border:\x201px\x20solid\x20rgba(255,255,255,0.1);\x20border-radius:\x205px;\x20margin-bottom:10px;\x22>','warning','change.amily2.select',']\x20已自动保存!','1879708nhuNix','append','message','amily2_daily_code_display','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22opt-exclusion-rule-row\x22\x20data-index=\x22','temperature','#amily2_manual_hide_from','forceProxyForCustomApi','text','map','amily2_open_rag_palace','#amily2_main_drawer','getElementById','1920340LmpCMT','join','url','off','圣意已在您每次更改时自动镌刻。','stop','配置\x20[','amily2_open_additional_features','click','#amily2_expand_editor','slideDown','#amily2_unhide_all_button,\x20#amily2_manual_hide_confirm,\x20#amily2_manual_unhide_confirm','number','#amily2_lore_depth_container',']\x20已镌刻!','fadeOut','authorized','#amily2_refresh_models,\x20#amily2_test,\x20#amily2_fix_now','#amily2_open_tutorial,\x20#amily2_open_neige_tutorial','授权码已复制到剪贴板!','show','#amily2_manual_unhide_to','_value','writeText','#amily2_manual_model_input','trim','1MmgkuK','loreDepth','close','remove','#amily2_force_proxy','#amily2_update_button_new','stringify','input[type=\x22checkbox\x22][id^=\x22amily2_\x22]','closest','\x22\x20placeholder=\x22开始字符,\x20如\x20<!--\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>到</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20class=\x22text_pole\x22\x20value=\x22','disabled','prop','appendTo','scripts/extensions/third-party/ST-Amily2-Chat-Optimisation/NeiGe.md','#amily2_dialog_editor','587925bHSDdR','amily2_optimization_exclusion_enabled','#amily2_unified_editor','addEventListener','#amily2_update_indicator','click.amily2.unified_save','#amily2_manual_hide_to','iconLocation','#amily2_open_additional_features,\x20#amily2_open_rag_palace,\x20#amily2_open_memorisation_forms,\x20#amily2_back_to_main_settings,\x20#amily2_back_to_main_from_hanlinyuan,\x20#amily2_back_to_main_from_forms','\x20执行失败:','replace','#amily2_save_lore_settings','复制失败,请手动复制。','click.amily2.expand_editor','change.amily2.force_proxy','value','#optimization-exclusion-rules-container','find','hide','manual_unhide',']\x20已成功恢复为帝国初始蓝图。','click.amily2.unified_restore','amily2_test','fadeIn','end','\x22]:checked','topbar','click.amily2.update_new','<i\x20class=\x22fas\x20fa-save\x22></i>\x20确认敕令','扩展区','slideUp','html','click.amily2.auth','start','input','.popup-button-cancel','optimizationExclusionRules','内阁使用教程','#optimization-rules-list','name','<i\x20class=\x22fas\x20fa-spinner\x20fa-spin\x22></i>\x20处理中','[Amily-谕令确认]\x20收到指令:\x20将\x20[','。圣意已存档。','2216160uXvoht','amily2_open_memorisation_forms','请输入授权码','</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22text-align:\x20center;\x20margin-top:\x2010px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20id=\x22optimization-add-rule-btn\x22\x20class=\x22menu_button\x20amily2-add-rule-btn\x22><i\x20class=\x22fas\x20fa-plus\x22></i>\x20添加新规则</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','#amily2_chat_optimiser','length','change.amily2.radio','click.amily2.lore_save','.opt-exclusion-rule-row','showModal','error','Amily2号',']\x20设置为\x20->','正在将帝国徽记迁往\x20[','info','#amily2_main_prompt','then','amily2_','情报部回报','.popup-button-ok','log','click.amily2.chamber_nav','click.amily2.actions','manual_hide','stopPropagation','data','主殿使用教程','span[data-i18n=\x22Manage\x20extensions\x22]','change.amily2.text','at_depth','amily2_manual_hide_confirm','[Amily-谕令镌刻]\x20[','133imFVXm','</h4>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22popup-content\x22\x20style=\x22height:\x2070vh;\x22><div\x20class=\x22height100p\x20wide100p\x20flex-container\x22><textarea\x20id=\x22amily2_dialog_editor\x22\x20class=\x22height100p\x20wide100p\x20maximized_textarea\x20text_pole\x22></textarea></div></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22popup-controls\x22><div\x20class=\x22popup-button-ok\x20menu_button\x20menu_button_primary\x20interactable\x22>保存并关闭</div><div\x20class=\x22popup-button-cancel\x20menu_button\x20interactable\x22\x20style=\x22margin-left:\x2010px;\x22>取消</div></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</dialog>','change.amily2.prompt_selector','amily2_back_to_main_from_forms','setItem','clipboard','迁都令','cached_models_amily2','#amily2_additional_features_panel','select[id^=\x22amily2_lore_\x22],\x20input#amily2_lore_depth_input','排除规则已更新。','input[name=\x22'];_0x5a97=function(){return _0x17429b;};return _0x5a97();}export function bindModalEvents(){const _0x2f4259=_0x383b,_0x5b1719=$('#amily2_drawer_content')[_0x2f4259(0x15b)]?$(_0x2f4259(0x18c)):$(_0x2f4259(0x15a));displayDailyAuthCode();function _0x592490(){const _0x518ce0=_0x2f4259,_0x5b6287=extension_settings[extensionName]||{},_0x3a7883=_0x5b6287[_0x518ce0(0xfc)]===!![],_0x306b7f=_0x5b6287[_0x518ce0(0x1a1)]||'';_0x5b1719[_0x518ce0(0x13c)](_0x518ce0(0x120))[_0x518ce0(0x127)](_0x518ce0(0xed),_0x3a7883),_0x5b1719['find']('#amily2_manual_model_input')[_0x518ce0(0x19b)](_0x306b7f);const _0xb7d8bf=_0x5b1719[_0x518ce0(0x13c)](_0x518ce0(0xee)),_0xb03e9b=_0x5b1719[_0x518ce0(0x13c)]('#amily2_model_autofetch_wrapper'),_0x42eb2f=_0x5b1719[_0x518ce0(0x13c)]('#amily2_manual_model_input');_0x3a7883?(_0xb7d8bf['hide'](),_0xb03e9b[_0x518ce0(0x116)](),_0x42eb2f[_0x518ce0(0x13d)]()):(_0xb7d8bf[_0x518ce0(0x116)](),_0xb03e9b['show'](),_0x42eb2f[_0x518ce0(0x13d)]());}if(!_0x5b1719[_0x2f4259(0x15b)]||_0x5b1719[_0x2f4259(0x16f)](_0x2f4259(0x197)))return;const _0x2b1d87=_0x22c265=>_0x22c265[_0x2f4259(0x135)](/_([a-z])/g,_0x22e74c=>_0x22e74c[0x1][_0x2f4259(0x191)]()),_0x3b2f0e=(_0x5ee2e4,_0x27231a)=>{const _0xe4b53a=_0x2f4259;console[_0xe4b53a(0x16a)](_0xe4b53a(0x154)+_0x5ee2e4+_0xe4b53a(0x162),_0x27231a),!extension_settings[extensionName]&&(extension_settings[extensionName]={}),extension_settings[extensionName]={...extension_settings[extensionName],[_0x5ee2e4]:_0x27231a},saveSettingsDebounced(),console['log'](_0xe4b53a(0x175)+_0x5ee2e4+_0xe4b53a(0x1a8));};_0x5b1719['off'](_0x2f4259(0x139))['on']('change.amily2.force_proxy',_0x2f4259(0x120),function(){const _0x28eed1=_0x2f4259;if(!pluginAuthStatus['authorized'])return;_0x3b2f0e('forceProxyForCustomApi',this[_0x28eed1(0xed)]),_0x592490(),$('#amily2_refresh_models')[_0x28eed1(0x194)](_0x28eed1(0x10a));}),_0x5b1719['off'](_0x2f4259(0x196))['on'](_0x2f4259(0x196),_0x2f4259(0x11a),function(){const _0x42212e=_0x2f4259;if(!pluginAuthStatus['authorized'])return;_0x3b2f0e(_0x42212e(0x1a1),this[_0x42212e(0x13a)]),toastr[_0x42212e(0x19e)]('模型ID\x20['+this[_0x42212e(0x13a)]+_0x42212e(0xf4),'Amily2号');}),_0x5b1719['off'](_0x2f4259(0x14b))['on'](_0x2f4259(0x14b),_0x2f4259(0x19c),async function(){const _0xb0c9c7=_0x2f4259,_0x5d4841=$(_0xb0c9c7(0x1a3))[_0xb0c9c7(0x19b)]()[_0xb0c9c7(0x11b)]();_0x5d4841?await activatePluginAuthorization(_0x5d4841):toastr[_0xb0c9c7(0xf2)](_0xb0c9c7(0x158),_0xb0c9c7(0x161));}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x16c))['on'](_0x2f4259(0x16c),_0x2f4259(0x113),async function(){const _0x2016df=_0x2f4259;if(!pluginAuthStatus[_0x2016df(0x112)])return;const _0xb65234=$(this),_0x4a49bb=_0xb65234[_0x2016df(0x14a)]();_0xb65234['prop']('disabled',!![])[_0x2016df(0x14a)](_0x2016df(0x153));try{switch(this['id']){case _0x2016df(0x1a0):const _0x22060b=await fetchModels();_0x22060b[_0x2016df(0x15b)]>0x0&&(setAvailableModels(_0x22060b),localStorage[_0x2016df(0x17a)](_0x2016df(0x17d),JSON[_0x2016df(0x122)](_0x22060b)),populateModelDropdown());break;case _0x2016df(0x141):await testReplyChecker();break;case'amily2_fix_now':await fixCommand();break;}}catch(_0x1de85d){console['error']('[Amily2-工部]\x20操作按钮\x20'+this['id']+_0x2016df(0x134),_0x1de85d),toastr[_0x2016df(0x160)]('操作失败:\x20'+_0x1de85d[_0x2016df(0xf7)],_0x2016df(0x161));}finally{_0xb65234[_0x2016df(0x127)](_0x2016df(0x126),![])[_0x2016df(0x14a)](_0x4a49bb);}}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x138))['on'](_0x2f4259(0x138),_0x2f4259(0x10b),function(_0x46225b){const _0x238185=_0x2f4259;if(!pluginAuthStatus[_0x238185(0x112)])return;_0x46225b[_0x238185(0x16e)]();const _0x27e416=$(_0x238185(0x18b))[_0x238185(0x19b)](),_0x2cdcce=$(_0x238185(0x12d))[_0x238185(0x19b)](),_0x2ffa39=_0x238185(0xef)+_0x27e416+_0x238185(0x177),_0x3ec77e=$(_0x2ffa39)[_0x238185(0x128)](_0x238185(0x1ab)),_0x13fcd3=_0x3ec77e[_0x238185(0x13c)](_0x238185(0x12a));_0x13fcd3[_0x238185(0x19b)](_0x2cdcce);const _0x4ee356=()=>{const _0x32b7f4=_0x238185;_0x3ec77e[0x0][_0x32b7f4(0x11e)](),_0x3ec77e[_0x32b7f4(0x11f)]();};_0x3ec77e[_0x238185(0x13c)](_0x238185(0x169))['on'](_0x238185(0x10a),()=>{const _0x1028bf=_0x238185,_0xeb44fe=_0x13fcd3[_0x1028bf(0x19b)]();$(_0x1028bf(0x12d))[_0x1028bf(0x19b)](_0xeb44fe),_0x3b2f0e(_0x27e416,_0xeb44fe),toastr[_0x1028bf(0x19e)]('谕令\x20['+_0x27e416+_0x1028bf(0x110),_0x1028bf(0x161)),_0x4ee356();}),_0x3ec77e[_0x238185(0x13c)](_0x238185(0x14e))['on'](_0x238185(0x10a),_0x4ee356),_0x3ec77e[0x0][_0x238185(0x15f)]();}),_0x5b1719[_0x2f4259(0x105)]('click.amily2.tutorial')['on']('click.amily2.tutorial',_0x2f4259(0x114),function(){const _0x1ce318=_0x2f4259;if(!pluginAuthStatus[_0x1ce318(0x112)])return;const _0x38bbeb={'amily2_open_tutorial':{'title':_0x1ce318(0x170),'url':'scripts/extensions/third-party/ST-Amily2-Chat-Optimisation/ZhuDian.md'},'amily2_open_neige_tutorial':{'title':_0x1ce318(0x150),'url':_0x1ce318(0x129)}},_0x546683=_0x38bbeb[this['id']];_0x546683&&showContentModal(_0x546683[_0x1ce318(0x182)],_0x546683[_0x1ce318(0x104)]);}),_0x5b1719[_0x2f4259(0x105)]('click.amily2.update')['on'](_0x2f4259(0x183),_0x2f4259(0x185),function(){const _0x4deb14=_0x2f4259;$(_0x4deb14(0x12f))[_0x4deb14(0x13d)]();const _0x3b4d22=getLatestUpdateInfo();if(_0x3b4d22&&_0x3b4d22[_0x4deb14(0x19d)]){const _0x13f259=messageFormatting(_0x3b4d22['changelog']),_0x4633cd=_0x4deb14(0x1a7)+_0x13f259+'</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22popup-controls\x22><div\x20class=\x22popup-button-ok\x20menu_button\x20menu_button_primary\x20interactable\x22>朕已阅</div></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</dialog>',_0x354181=$(_0x4633cd)[_0x4deb14(0x128)](_0x4deb14(0x1ab)),_0x537c75=()=>{const _0x556d16=_0x4deb14;_0x354181[0x0]['close'](),_0x354181[_0x556d16(0x11f)]();};_0x354181[_0x4deb14(0x13c)](_0x4deb14(0x169))['on'](_0x4deb14(0x10a),_0x537c75),_0x354181[0x0]['showModal']();}else toastr['info']('未能获取到云端情报,请稍后再试。',_0x4deb14(0x168));}),_0x5b1719[_0x2f4259(0x105)]('click.amily2.update_new')['on'](_0x2f4259(0x146),_0x2f4259(0x121),function(){const _0x285382=_0x2f4259;$(_0x285382(0x171))[_0x285382(0x193)]()[_0x285382(0x10a)]();}),_0x5b1719['off'](_0x2f4259(0x1a4))['on'](_0x2f4259(0x1a4),_0x2f4259(0x10d),async function(){const _0x8f42be=_0x2f4259;if(!pluginAuthStatus[_0x8f42be(0x112)])return;const _0x202352=this['id'];let _0x6c1357='',_0x5e16aa={};switch(_0x202352){case'amily2_unhide_all_button':_0x6c1357=_0x8f42be(0x19f);break;case _0x8f42be(0x174):_0x6c1357=_0x8f42be(0x16d),_0x5e16aa={'from':$(_0x8f42be(0xfb))[_0x8f42be(0x19b)](),'to':$(_0x8f42be(0x131))[_0x8f42be(0x19b)]()};break;case _0x8f42be(0xf0):_0x6c1357=_0x8f42be(0x13e),_0x5e16aa={'from':$('#amily2_manual_unhide_from')['val'](),'to':$(_0x8f42be(0x117))[_0x8f42be(0x19b)]()};break;}_0x6c1357&&await executeManualCommand(_0x6c1357,_0x5e16aa);}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x16b))['on'](_0x2f4259(0x16b),_0x2f4259(0x133),function(){const _0x5ca2e9=_0x2f4259;if(!pluginAuthStatus[_0x5ca2e9(0x112)])return;const _0x5852ec=_0x5b1719[_0x5ca2e9(0x13c)]('.plugin-features'),_0x20601b=_0x5b1719[_0x5ca2e9(0x13c)](_0x5ca2e9(0x17e)),_0x2d97c6=_0x5b1719['find']('#amily2_hanlinyuan_panel'),_0x1449ee=_0x5b1719[_0x5ca2e9(0x13c)](_0x5ca2e9(0x198));_0x5852ec['hide'](),_0x20601b[_0x5ca2e9(0x13d)](),_0x2d97c6[_0x5ca2e9(0x13d)](),_0x1449ee[_0x5ca2e9(0x13d)]();switch(this['id']){case _0x5ca2e9(0x109):_0x20601b[_0x5ca2e9(0x116)]();break;case _0x5ca2e9(0xff):_0x2d97c6[_0x5ca2e9(0x116)]();break;case _0x5ca2e9(0x157):_0x1449ee[_0x5ca2e9(0x116)]();break;case'amily2_back_to_main_settings':case'amily2_back_to_main_from_hanlinyuan':case _0x5ca2e9(0x179):_0x5852ec[_0x5ca2e9(0x116)]();break;}}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x190))['on']('change.amily2.checkbox',_0x2f4259(0x123),function(_0x2009a9){const _0x29be62=_0x2f4259;if(!pluginAuthStatus[_0x29be62(0x112)])return;const _0x197261=this['id'],_0x497643=$(this),_0x465f24=_0x2b1d87(_0x197261[_0x29be62(0x135)](_0x29be62(0x167),''));_0x3b2f0e(_0x465f24,_0x497643['prop'](_0x29be62(0xed)));if(_0x197261===_0x29be62(0x12c)&&_0x497643[_0x29be62(0x127)](_0x29be62(0xed))){const _0x5ca3a4=extension_settings[extensionName],_0x200126=_0x5ca3a4['optimizationExclusionRules']||[],_0x504d83=(_0x312a9a={'start':'','end':''},_0xb04863)=>_0x29be62(0xf9)+_0xb04863+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20class=\x22text_pole\x22\x20value=\x22'+_0x312a9a[_0x29be62(0x14c)]+_0x29be62(0x125)+_0x312a9a[_0x29be62(0x143)]+_0x29be62(0x199),_0x2bfea3=_0x200126[_0x29be62(0xfe)](_0x504d83)[_0x29be62(0x103)](''),_0x1d7b8f=_0x29be62(0xf1)+_0x2bfea3+_0x29be62(0x159);showHtmlModal('编辑内容排除规则',_0x1d7b8f,{'okText':'确认','cancelText':'取消','onOk':_0x56300c=>{const _0x22d8e5=_0x29be62,_0x4c30c3=[];_0x56300c['find'](_0x22d8e5(0x15e))[_0x22d8e5(0x18f)](function(){const _0x38e92f=_0x22d8e5,_0x331ce2=$(this)[_0x38e92f(0x13c)](_0x38e92f(0x14d))['eq'](0x0)[_0x38e92f(0x19b)]()[_0x38e92f(0x11b)](),_0x5722ed=$(this)[_0x38e92f(0x13c)]('input')['eq'](0x1)['val']()[_0x38e92f(0x11b)]();if(_0x331ce2&&_0x5722ed)_0x4c30c3[_0x38e92f(0x18d)]({'start':_0x331ce2,'end':_0x5722ed});}),_0x3b2f0e(_0x22d8e5(0x14f),_0x4c30c3),toastr[_0x22d8e5(0x19e)](_0x22d8e5(0x180),_0x22d8e5(0x161));},'onCancel':()=>{}});const _0x7666b7=$(_0x29be62(0x13b)),_0x2b3a35=_0x7666b7[_0x29be62(0x13c)](_0x29be62(0x151));_0x7666b7[_0x29be62(0x13c)]('#optimization-add-rule-btn')['on'](_0x29be62(0x10a),()=>{const _0x279065=_0x29be62,_0x2c086d=_0x2b3a35['children']()[_0x279065(0x15b)];_0x2b3a35[_0x279065(0xf6)](_0x504d83(undefined,_0x2c086d));}),_0x2b3a35['on'](_0x29be62(0x10a),_0x29be62(0x1a9),function(){const _0x60fa88=_0x29be62;$(this)[_0x60fa88(0x124)]('.opt-exclusion-rule-row')[_0x60fa88(0x11f)]();});}}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x15c))['on'](_0x2f4259(0x15c),_0x2f4259(0x184),function(){const _0x33619f=_0x2f4259;if(!pluginAuthStatus[_0x33619f(0x112)])return;const _0x4a19aa=_0x2b1d87(this['name'][_0x33619f(0x135)](_0x33619f(0x167),'')),_0x3110e8=$(_0x33619f(0x181)+this[_0x33619f(0x152)]+_0x33619f(0x144))[_0x33619f(0x19b)]();_0x3b2f0e(_0x4a19aa,_0x3110e8);}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x172))['on'](_0x2f4259(0x172),'#amily2_api_url,\x20#amily2_api_key,\x20#amily2_optimization_target_tag',function(){const _0x36f147=_0x2f4259;if(!pluginAuthStatus['authorized'])return;const _0x2aa672=_0x2b1d87(this['id'][_0x36f147(0x135)](_0x36f147(0x167),''));_0x3b2f0e(_0x2aa672,this[_0x36f147(0x13a)]),toastr[_0x36f147(0x19e)](_0x36f147(0x108)+_0x2aa672+_0x36f147(0xf4),_0x36f147(0x161));}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0xf3))['on']('change.amily2.select','select#amily2_model',function(){const _0x33591f=_0x2f4259;if(!pluginAuthStatus[_0x33591f(0x112)])return;const _0x108cdd=_0x2b1d87(this['id'][_0x33591f(0x135)](_0x33591f(0x167),''));_0x3b2f0e(_0x108cdd,this['value']),populateModelDropdown();}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x19a))['on']('input.amily2.range','input[type=\x22range\x22][id^=\x22amily2_\x22]',function(){const _0x2270a4=_0x2f4259;if(!pluginAuthStatus[_0x2270a4(0x112)])return;const _0x15b6d6=_0x2b1d87(this['id']['replace'](_0x2270a4(0x167),'')),_0x4b7abe=this['id'][_0x2270a4(0x195)](_0x2270a4(0xfa))?parseFloat(this[_0x2270a4(0x13a)]):parseInt(this['value'],0xa);$('#'+this['id']+_0x2270a4(0x118))['text'](_0x4b7abe),_0x3b2f0e(_0x15b6d6,_0x4b7abe);});const _0x248db5={'mainPrompt':_0x2f4259(0x165),'systemPrompt':_0x2f4259(0x1a2),'outputFormatPrompt':'#amily2_output_format_prompt'},_0x50eeff=_0x2f4259(0x18b),_0x3d0ec9=_0x2f4259(0x12d),_0x1da9b5='#amily2_unified_save_button';function _0x3115d9(){const _0x1b570c=_0x2f4259;if(!$(_0x50eeff)[_0x1b570c(0x15b)])return;const _0x2c8795=$(_0x50eeff)[_0x1b570c(0x19b)]();if(!_0x2c8795)return;const _0x433649=extension_settings[extensionName][_0x2c8795]||'';$(_0x3d0ec9)[_0x1b570c(0x19b)](_0x433649);}_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x178))['on'](_0x2f4259(0x178),_0x50eeff,_0x3115d9),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x130))['on'](_0x2f4259(0x130),_0x1da9b5,function(){const _0x2fe944=_0x2f4259,_0x16d0b0=$(_0x50eeff)['val']();if(!_0x16d0b0)return;const _0x4ff241=$(_0x3d0ec9)[_0x2fe944(0x19b)]();_0x3b2f0e(_0x16d0b0,_0x4ff241),toastr[_0x2fe944(0x19e)]('谕令\x20['+_0x16d0b0+_0x2fe944(0x186),_0x2fe944(0x161));}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x140))['on'](_0x2f4259(0x140),'#amily2_unified_restore_button',function(){const _0x30d42a=_0x2f4259,_0x1ab380=$(_0x50eeff)[_0x30d42a(0x19b)]();if(!_0x1ab380)return;const _0x333197=defaultSettings[_0x1ab380];$(_0x3d0ec9)[_0x30d42a(0x19b)](_0x333197),_0x3b2f0e(_0x1ab380,_0x333197),toastr['success']('谕令\x20['+_0x1ab380+_0x30d42a(0x13f),_0x30d42a(0x161));}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x1aa))['on'](_0x2f4259(0x1aa),_0x2f4259(0x17f),function(){const _0x2a2c36=_0x2f4259;if(!pluginAuthStatus[_0x2a2c36(0x112)])return;let _0x5a6a84=_0x2b1d87(this['id'][_0x2a2c36(0x135)](_0x2a2c36(0x167),''));_0x5a6a84==='loreDepthInput'&&(_0x5a6a84=_0x2a2c36(0x11d));const _0x2b23c5=this[_0x2a2c36(0x1a6)]===_0x2a2c36(0x10e)?parseInt(this[_0x2a2c36(0x13a)],0xa):this[_0x2a2c36(0x13a)];_0x3b2f0e(_0x5a6a84,_0x2b23c5);if(this['id']==='amily2_lore_insertion_position'){const _0x691ac2=$(_0x2a2c36(0x10f));this[_0x2a2c36(0x13a)]===_0x2a2c36(0x173)?_0x691ac2[_0x2a2c36(0x10c)](0xc8):_0x691ac2[_0x2a2c36(0x149)](0xc8);}}),_0x5b1719[_0x2f4259(0x105)](_0x2f4259(0x15d))['on'](_0x2f4259(0x15d),_0x2f4259(0x136),function(){const _0x239a24=_0x2f4259;if(!pluginAuthStatus['authorized'])return;const _0x156b56=$(this),_0x509d6e=$('#amily2_lore_save_status');_0x156b56[_0x239a24(0x127)]('disabled',!![])['html'](_0x239a24(0x188)),_0x509d6e[_0x239a24(0xfd)](_0x239a24(0x106))[_0x239a24(0x107)]()[_0x239a24(0x142)](),setTimeout(()=>{const _0x4641a0=_0x239a24;_0x156b56[_0x4641a0(0x127)]('disabled',![])['html'](_0x4641a0(0x147)),_0x509d6e[_0x4641a0(0x111)]();},0x9c4);}),setTimeout(_0x3115d9,0x64),_0x592490(),_0x5b1719[_0x2f4259(0x16f)](_0x2f4259(0x197),!![]);}$(document)['on']('change','input[name=\x22amily2_icon_location\x22]',function(){const _0x3bd8bd=_0x383b;if(!pluginAuthStatus['authorized'])return;const _0x29be6e=$(this)['val']();extension_settings[extensionName][_0x3bd8bd(0x132)]=_0x29be6e,saveSettingsDebounced(),console[_0x3bd8bd(0x16a)](_0x3bd8bd(0x1a5)+_0x29be6e+_0x3bd8bd(0x155)),toastr[_0x3bd8bd(0x164)](_0x3bd8bd(0x163)+(_0x29be6e===_0x3bd8bd(0x145)?'顶栏':_0x3bd8bd(0x148))+']...',_0x3bd8bd(0x17c),{'timeOut':0x7d0}),$(_0x3bd8bd(0x100))[_0x3bd8bd(0x11f)](),$(document)[_0x3bd8bd(0x105)]('mousedown.amily2Drawer'),$('#amily2_extension_frame')['remove'](),setTimeout(createDrawer,0x32);});
|