From 6ed37b7aaee361d02e8fe2f1a6885127e9c44a5b Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Sat, 19 Jul 2025 17:18:33 +0800 Subject: [PATCH] Update hanlinyuan-bindings.js --- ui/hanlinyuan-bindings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/hanlinyuan-bindings.js b/ui/hanlinyuan-bindings.js index e513e34..01cae5f 100644 --- a/ui/hanlinyuan-bindings.js +++ b/ui/hanlinyuan-bindings.js @@ -1 +1 @@ -(function(_0x1553dd,_0x2220e3){const _0x34714e=_0x1cae,_0x39cd5d=_0x1553dd();while(!![]){try{const _0x5a9226=parseInt(_0x34714e(0x275))/0x1*(-parseInt(_0x34714e(0x1fd))/0x2)+parseInt(_0x34714e(0x268))/0x3+parseInt(_0x34714e(0x253))/0x4*(-parseInt(_0x34714e(0x26a))/0x5)+-parseInt(_0x34714e(0x227))/0x6*(-parseInt(_0x34714e(0x20f))/0x7)+parseInt(_0x34714e(0x24a))/0x8*(-parseInt(_0x34714e(0x244))/0x9)+-parseInt(_0x34714e(0x21f))/0xa*(-parseInt(_0x34714e(0x215))/0xb)+parseInt(_0x34714e(0x28f))/0xc*(-parseInt(_0x34714e(0x1f9))/0xd);if(_0x5a9226===_0x2220e3)break;else _0x39cd5d['push'](_0x39cd5d['shift']());}catch(_0xd0ee2d){_0x39cd5d['push'](_0x39cd5d['shift']());}}}(_0x877e,0x77358));import{getContext}from'/scripts/extensions.js';import*as _0x1007d5 from'../core/rag-processor.js';import*as _0x59db5b from'../core/utils/context-utils.js';'use\x20strict';function setupGlobalEventHandlers(){const _0x5cef71=_0x1cae;window[_0x5cef71(0x231)]=saveSettingsFromUI,window[_0x5cef71(0x24f)]=resetSettingsToUI,window[_0x5cef71(0x20d)]=testApi,window[_0x5cef71(0x273)]=fetchHLYEmbeddingModels,window[_0x5cef71(0x29c)]=updatePanelStatus,window[_0x5cef71(0x243)]=purgeStorage,window['startHLYCondensation']=startCondensation,window[_0x5cef71(0x2a4)]=previewCondensation,window['ingestHLYManualText']=ingestManualText,window[_0x5cef71(0x23d)]=log,window[_0x5cef71(0x220)]=showStats;}export function bindHanlinyuanEvents(){const _0x426f0d=_0x1cae,_0x1061bb=getContext();if(!_0x1061bb){console[_0x426f0d(0x252)](_0x426f0d(0x291));return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents();if(_0x1007d5['initialize'])_0x1007d5[_0x426f0d(0x241)]();else{console['error'](_0x426f0d(0x20e));return;}loadSettingsToUI(),console['log']('[翰林院-枢纽]\x20已成功连接各部,政令畅通。');}function bindPanelToggleEvents(){const _0x29eda5=_0x1cae,_0x375458=document[_0x29eda5(0x285)](_0x29eda5(0x27e));if(_0x375458){}}function bindInternalUIEvents(){const _0x340534=_0x1cae,_0x124913=document[_0x340534(0x20c)](_0x340534(0x29d));_0x124913[_0x340534(0x27c)](_0x354974=>{const _0x42585f=_0x340534;_0x354974[_0x42585f(0x264)]('click',()=>{const _0x5656eb=_0x42585f,_0x4ee17a=_0x354974[_0x5656eb(0x1f2)][_0x5656eb(0x235)];document[_0x5656eb(0x20c)](_0x5656eb(0x25a))[_0x5656eb(0x27c)](_0x286c20=>{const _0x369cbf=_0x5656eb;_0x286c20[_0x369cbf(0x26e)][_0x369cbf(0x1ea)](_0x369cbf(0x24c),_0x286c20['id']===_0x369cbf(0x201)+_0x4ee17a+_0x369cbf(0x28c));}),_0x124913['forEach'](_0x4b9e92=>_0x4b9e92[_0x5656eb(0x26e)][_0x5656eb(0x1ea)](_0x5656eb(0x24c),_0x4b9e92===_0x354974));if(_0x4ee17a===_0x5656eb(0x259)){const _0x475c66=document[_0x5656eb(0x285)]('hly-log-output');_0x475c66&&(_0x475c66[_0x5656eb(0x239)]=_0x475c66['scrollHeight']);}});});const _0x25faff=document['getElementById'](_0x340534(0x251));_0x25faff&&_0x25faff['addEventListener'](_0x340534(0x299),toggleCustomEndpointDocket);const _0x36c3e8=document[_0x340534(0x20c)]('input[name=\x22hly-injection-position\x22]');_0x36c3e8[_0x340534(0x27c)](_0x4f5f66=>{const _0x66a030=_0x340534;_0x4f5f66[_0x66a030(0x264)](_0x66a030(0x299),toggleInjectionDetails);});}function toggleInjectionDetails(){const _0x414e9b=_0x1cae,_0x5cbb7d=document['querySelector'](_0x414e9b(0x1ed))[_0x414e9b(0x29f)],_0x235cb3=document['getElementById'](_0x414e9b(0x1ef)),_0x473b33=document['getElementById'](_0x414e9b(0x223)),_0xb71c19=_0x5cbb7d==='1';_0x235cb3[_0x414e9b(0x258)]=!_0xb71c19,_0x473b33['disabled']=!_0xb71c19;}function toggleCustomEndpointDocket(){const _0x2c7594=_0x1cae,_0x12ef93=document[_0x2c7594(0x285)](_0x2c7594(0x251))['value'],_0xdc7fb4=document[_0x2c7594(0x285)](_0x2c7594(0x28b));_0xdc7fb4&&(_0xdc7fb4[_0x2c7594(0x267)][_0x2c7594(0x210)]=_0x12ef93==='custom'||_0x12ef93===_0x2c7594(0x255)?'block':_0x2c7594(0x23c));}function loadSettingsToUI(){const _0xb8a328=_0x1cae,_0x5f47b2=_0x1007d5[_0xb8a328(0x26b)]();if(!_0x5f47b2)return;document[_0xb8a328(0x285)]('hly-retrieval-enabled')[_0xb8a328(0x1f8)]=_0x5f47b2[_0xb8a328(0x200)]['enabled'],document[_0xb8a328(0x285)]('hly-api-endpoint')['value']=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x24e)],document[_0xb8a328(0x285)](_0xb8a328(0x274))[_0xb8a328(0x29f)]=_0x5f47b2['retrieval'][_0xb8a328(0x2a2)],document[_0xb8a328(0x285)](_0xb8a328(0x1ec))['value']=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x29b)];const _0x382006=document[_0xb8a328(0x285)](_0xb8a328(0x22b));if(_0x382006[_0xb8a328(0x217)][_0xb8a328(0x289)]===0x0){const _0x56306a=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x206)],_0x53eb0a=new Option(_0x56306a,_0x56306a,!![],!![]);_0x382006['add'](_0x53eb0a);}_0x382006[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x206)],document[_0xb8a328(0x285)](_0xb8a328(0x271))[_0xb8a328(0x1f8)]=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x228)],document[_0xb8a328(0x285)](_0xb8a328(0x2a3))[_0xb8a328(0x29f)]=_0x5f47b2['advanced']['chunkSize'],document[_0xb8a328(0x285)]('hly-overlap-size')[_0xb8a328(0x29f)]=_0x5f47b2['advanced']['overlap'],document[_0xb8a328(0x285)]('hly-match-threshold')['value']=_0x5f47b2[_0xb8a328(0x23e)][_0xb8a328(0x1fc)],document[_0xb8a328(0x285)]('hly-query-message-count')[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x23e)][_0xb8a328(0x294)],document[_0xb8a328(0x285)](_0xb8a328(0x1fa))[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x23e)][_0xb8a328(0x232)],document['getElementById'](_0xb8a328(0x246))['value']=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x212)],document[_0xb8a328(0x285)](_0xb8a328(0x208))['value']=_0x5f47b2[_0xb8a328(0x224)][_0xb8a328(0x207)];const _0x3fe04c=document['querySelector']('input[name=\x22hly-injection-position\x22][value=\x22'+_0x5f47b2[_0xb8a328(0x224)]['position']+'\x22]');_0x3fe04c&&(_0x3fe04c[_0xb8a328(0x1f8)]=!![]),document[_0xb8a328(0x285)](_0xb8a328(0x1ef))[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x224)]['depth'],document[_0xb8a328(0x285)](_0xb8a328(0x223))[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x224)][_0xb8a328(0x22c)],toggleInjectionDetails(),document[_0xb8a328(0x285)](_0xb8a328(0x280))[_0xb8a328(0x1f8)]=_0x5f47b2[_0xb8a328(0x27f)][_0xb8a328(0x25d)],document['getElementById'](_0xb8a328(0x298))[_0xb8a328(0x29f)]=_0x5f47b2['condensation'][_0xb8a328(0x1f0)],document[_0xb8a328(0x285)](_0xb8a328(0x20b))[_0xb8a328(0x29f)]=_0x5f47b2['condensation'][_0xb8a328(0x237)],document['getElementById'](_0xb8a328(0x281))['checked']=_0x5f47b2['condensation'][_0xb8a328(0x248)][_0xb8a328(0x2a8)],document['getElementById']('hly-include-ai')[_0xb8a328(0x1f8)]=_0x5f47b2[_0xb8a328(0x27f)][_0xb8a328(0x248)]['ai'],toggleCustomEndpointDocket();}function saveSettingsFromUI(){const _0x1818b3=_0x1cae,_0x56541f=_0x1007d5[_0x1818b3(0x26b)]();if(!_0x56541f)return;_0x56541f[_0x1818b3(0x200)][_0x1818b3(0x25d)]=document[_0x1818b3(0x285)](_0x1818b3(0x293))[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x200)][_0x1818b3(0x24e)]=document[_0x1818b3(0x285)](_0x1818b3(0x251))['value'],_0x56541f[_0x1818b3(0x200)][_0x1818b3(0x2a2)]=document[_0x1818b3(0x285)](_0x1818b3(0x274))[_0x1818b3(0x29f)],_0x56541f[_0x1818b3(0x200)]['apiKey']=document[_0x1818b3(0x285)](_0x1818b3(0x1ec))[_0x1818b3(0x29f)],_0x56541f[_0x1818b3(0x200)][_0x1818b3(0x206)]=document[_0x1818b3(0x285)](_0x1818b3(0x22b))['value'],_0x56541f[_0x1818b3(0x200)]['notify']=document[_0x1818b3(0x285)](_0x1818b3(0x271))[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x23e)][_0x1818b3(0x1eb)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x2a3))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x23e)][_0x1818b3(0x21d)]=parseInt(document['getElementById'](_0x1818b3(0x2a5))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x23e)]['matchThreshold']=parseFloat(document[_0x1818b3(0x285)](_0x1818b3(0x25f))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x23e)][_0x1818b3(0x294)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x256))[_0x1818b3(0x29f)]),_0x56541f['advanced']['maxResults']=parseInt(document['getElementById']('hly-max-results')[_0x1818b3(0x29f)]),_0x56541f['retrieval']['batchSize']=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x246))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x224)][_0x1818b3(0x207)]=document[_0x1818b3(0x285)](_0x1818b3(0x208))[_0x1818b3(0x29f)],_0x56541f[_0x1818b3(0x224)][_0x1818b3(0x261)]=parseInt(document[_0x1818b3(0x1f7)]('input[name=\x22hly-injection-position\x22]:checked')[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x224)][_0x1818b3(0x1f4)]=parseInt(document['getElementById'](_0x1818b3(0x1ef))[_0x1818b3(0x29f)])||0x1,_0x56541f['injection'][_0x1818b3(0x22c)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x223))['value']),_0x56541f[_0x1818b3(0x27f)][_0x1818b3(0x25d)]=document[_0x1818b3(0x285)]('hly-condensation-enabled')[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x27f)][_0x1818b3(0x1f0)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x298))[_0x1818b3(0x29f)]),_0x56541f['condensation'][_0x1818b3(0x237)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x20b))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x27f)][_0x1818b3(0x248)]['user']=document[_0x1818b3(0x285)](_0x1818b3(0x281))[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x27f)][_0x1818b3(0x248)]['ai']=document[_0x1818b3(0x285)](_0x1818b3(0x238))[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x27f)]['messageTypes']['hidden']=![],_0x1007d5[_0x1818b3(0x297)](),toastr[_0x1818b3(0x1f5)](_0x1818b3(0x1fb),_0x1818b3(0x278));}function resetSettingsToUI(){const _0x34f6c1=_0x1cae;confirm('您确定要将所有设定恢复为出厂默认值吗?')&&(_0x1007d5[_0x34f6c1(0x209)](),loadSettingsToUI(),toastr[_0x34f6c1(0x23b)](_0x34f6c1(0x22f),'诏曰'));}async function updatePanelStatus(){const _0x17241e=_0x1cae;document['getElementById'](_0x17241e(0x21b))[_0x17241e(0x286)]=_0x59db5b[_0x17241e(0x28a)](),document['getElementById'](_0x17241e(0x25e))[_0x17241e(0x286)]=_0x59db5b['getChatId']()||'无';const _0x20945e=document['getElementById'](_0x17241e(0x202));_0x20945e[_0x17241e(0x286)]='...';try{const _0x4214bd=await _0x1007d5['getVectorCount']();_0x20945e[_0x17241e(0x286)]=_0x4214bd;}catch(_0x208e99){console['error'](_0x17241e(0x250),_0x208e99),_0x20945e[_0x17241e(0x286)]='错误';}}async function testApi(){const _0x3cbd73=_0x1cae;toastr[_0x3cbd73(0x23b)]('正在测试神力连接...','圣旨');try{await _0x1007d5['testApiConnection'](),toastr[_0x3cbd73(0x1f5)](_0x3cbd73(0x295),'圣意');}catch(_0x258d7a){toastr[_0x3cbd73(0x252)]('神力连接失败:\x20'+_0x258d7a['message'],'警报');}}async function fetchHLYEmbeddingModels(){const _0x165949=_0x1cae,_0x469a53=document[_0x165949(0x285)](_0x165949(0x22b)),_0x593785=_0x469a53[_0x165949(0x29f)];_0x469a53[_0x165949(0x216)]=_0x165949(0x265),_0x469a53['disabled']=!![];try{log(_0x165949(0x26c),_0x165949(0x23b));const _0x2cff89=await _0x1007d5['fetchEmbeddingModels']();_0x469a53[_0x165949(0x216)]='';if(_0x2cff89[_0x165949(0x289)]===0x0){_0x469a53[_0x165949(0x216)]=_0x165949(0x28e),toastr[_0x165949(0x236)](_0x165949(0x2a7),_0x165949(0x26f)),log(_0x165949(0x2a7),_0x165949(0x236));return;}_0x2cff89['forEach'](_0x1a5e6d=>{const _0xb9b9b1=new Option(_0x1a5e6d,_0x1a5e6d);_0x469a53['add'](_0xb9b9b1);}),_0x2cff89[_0x165949(0x279)](_0x593785)?_0x469a53[_0x165949(0x29f)]=_0x593785:_0x469a53[_0x165949(0x27d)]=0x0,toastr[_0x165949(0x1f5)](_0x165949(0x240)+_0x2cff89[_0x165949(0x289)]+_0x165949(0x234),'圣意'),log(_0x165949(0x240)+_0x2cff89[_0x165949(0x289)]+'\x20个嵌入模型。',_0x165949(0x1f5));}catch(_0x1c7fc7){console[_0x165949(0x252)](_0x165949(0x230),_0x1c7fc7),toastr[_0x165949(0x252)](_0x165949(0x27a)+_0x1c7fc7[_0x165949(0x21e)],_0x165949(0x1ff)),log('获取模型失败:\x20'+_0x1c7fc7['message'],_0x165949(0x252)),_0x469a53[_0x165949(0x216)]=_0x165949(0x203);}finally{_0x469a53['disabled']=![];}}async function purgeStorage(){const _0x4910f8=_0x1cae;if(confirm(_0x4910f8(0x213))){toastr[_0x4910f8(0x23b)](_0x4910f8(0x1f3),'圣旨');const _0x551d5d=await _0x1007d5[_0x4910f8(0x282)]();_0x551d5d?toastr[_0x4910f8(0x1f5)](_0x4910f8(0x260),'圣意'):toastr[_0x4910f8(0x252)](_0x4910f8(0x28d),'警报'),await updatePanelStatus();}}async function startCondensation(){const _0xae8a39=_0x1cae,_0x40cbb3=document[_0xae8a39(0x285)](_0xae8a39(0x1ee));_0x40cbb3[_0xae8a39(0x286)]=_0xae8a39(0x270),toastr[_0xae8a39(0x23b)]('正在准备凝识...','圣旨');try{const _0x5de16e=_0x1007d5['getMessagesForCondensation']();if(!_0x5de16e||_0x5de16e[_0xae8a39(0x289)]===0x0){toastr[_0xae8a39(0x1f6)](_0xae8a39(0x233),_0xae8a39(0x26f)),_0x40cbb3[_0xae8a39(0x286)]=_0xae8a39(0x287);return;}_0x40cbb3[_0xae8a39(0x286)]=_0xae8a39(0x2a9)+_0x5de16e[_0xae8a39(0x289)]+_0xae8a39(0x214),toastr['info'](_0xae8a39(0x2a9)+_0x5de16e[_0xae8a39(0x289)]+_0xae8a39(0x214),'翰林院启奏');const _0x300da1=await _0x1007d5[_0xae8a39(0x25b)](_0x5de16e);if(_0x300da1[_0xae8a39(0x1f5)])toastr[_0xae8a39(0x1f5)](_0xae8a39(0x1fe)+_0x300da1[_0xae8a39(0x29e)]+_0xae8a39(0x24d),_0xae8a39(0x2a6)),_0x40cbb3[_0xae8a39(0x286)]=_0xae8a39(0x1fe)+_0x300da1['count']+_0xae8a39(0x24d);else throw new Error(_0x300da1[_0xae8a39(0x252)]||_0xae8a39(0x20a));}catch(_0x226195){console[_0xae8a39(0x252)](_0xae8a39(0x269),_0x226195),toastr[_0xae8a39(0x252)]('凝识失败:\x20'+_0x226195['message'],_0xae8a39(0x1ff)),_0x40cbb3['textContent']=_0xae8a39(0x249)+_0x226195[_0xae8a39(0x21e)];}finally{await updatePanelStatus();}}async function showStats(){const _0x5355a1=_0x1cae;try{log(_0x5355a1(0x218),_0x5355a1(0x23b)),toastr['info'](_0x5355a1(0x22a),'圣旨');const _0x2afd7e=await _0x1007d5[_0x5355a1(0x262)](),_0x377bdd=_0x1007d5[_0x5355a1(0x21a)](),_0x5b49f4=_0x1007d5[_0x5355a1(0x26b)](),_0x4c6c92=_0x5355a1(0x245)+_0x377bdd+_0x5355a1(0x21c)+_0x2afd7e+_0x5355a1(0x24b)+_0x5b49f4[_0x5355a1(0x200)][_0x5355a1(0x24e)]+_0x5355a1(0x292)+_0x5b49f4['retrieval'][_0x5355a1(0x206)]+'\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20';toastr[_0x5355a1(0x23b)](_0x4c6c92,_0x5355a1(0x29a),{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log('查看宝库状态成功:集合ID='+_0x377bdd+_0x5355a1(0x26d)+_0x2afd7e,'success');}catch(_0x5c495e){console[_0x5355a1(0x252)](_0x5355a1(0x263),_0x5c495e),toastr['error'](_0x5355a1(0x2a0)+_0x5c495e['message'],_0x5355a1(0x1ff)),log(_0x5355a1(0x2a0)+_0x5c495e[_0x5355a1(0x21e)],_0x5355a1(0x252));}}function previewCondensation(){const _0x32a25f=_0x1cae,_0x262bf7=document[_0x32a25f(0x285)](_0x32a25f(0x1ee));try{const _0x5902bc={'user':document[_0x32a25f(0x285)](_0x32a25f(0x281))['checked'],'ai':document[_0x32a25f(0x285)]('hly-include-ai')[_0x32a25f(0x1f8)],'hidden':![]},_0x38d4f3=_0x1007d5[_0x32a25f(0x277)](_0x5902bc);if(!_0x38d4f3||_0x38d4f3[_0x32a25f(0x289)]===0x0){_0x262bf7[_0x32a25f(0x286)]=_0x32a25f(0x283);return;}const _0x3d8bf9=_0x38d4f3[_0x32a25f(0x272)]((_0x264df5,_0x56e91b)=>_0x56e91b+0x1+_0x32a25f(0x229)+_0x264df5[_0x32a25f(0x205)]+']:\x20'+_0x264df5[_0x32a25f(0x257)])['join']('\x0a\x0a');_0x262bf7[_0x32a25f(0x286)]=_0x32a25f(0x22e)+_0x38d4f3[_0x32a25f(0x289)]+_0x32a25f(0x1e8)+_0x3d8bf9;}catch(_0x3de895){_0x262bf7[_0x32a25f(0x286)]='预览失败:\x20'+_0x3de895[_0x32a25f(0x21e)];}}function _0x877e(){const _0x4e3e99=['injection','log-info','文书已成功录入宝库,新增\x20','17070daXBDt','notify','.\x20[','正在查询宝库状态...','hly-embedding-model','depth_role','用户尝试录入空文本。','将对以下\x20','翰林院设定已重置为初始状态。','[翰林院-枢纽]\x20获取模型列表失败:','saveHLYSettings','maxResults','未找到符合条件的消息可供凝识。','\x20个嵌入模型。','tab','warn','layerEnd','hly-include-ai','scrollTop','log-warn','info','none','hlyLog','advanced','className','成功获取\x20','initialize','.hly-log-placeholder','purgeHLYStorage','2217438KHnCSS','\x0a
\x0a翰林院宝库状态\x0a--------------------\x0a集合ID:\x20','hly-batch-size','log-error','messageTypes','凝识失败:\x20','16XEoHfO','\x0a--------------------\x0aAPI端点:\x20','active','\x20条忆识。','apiEndpoint','resetHLYSettings','[翰林院-枢纽]\x20更新忆识数量失败:','hly-api-endpoint','error','21476yPpSdy','hly-log-entry\x20','azure','hly-query-message-count','mes','disabled','log','.hly-tab-pane','processCondensation','[翰林院-枢纽]\x20手动录入过程发生错误:','enabled','hly-current-chat-id','hly-match-threshold','宝库已清空。','position','getVectorCount','[翰林院-枢纽]\x20查询宝库状态失败:','addEventListener','','fa-circle-info','style','2388144dizNDX','[翰林院-枢纽]\x20凝识过程发生错误:','300HFwSZm','getSettings','开始获取嵌入模型列表...',',\x20忆识总数=','classList','翰林院启奏','正在采集消息...','hly-retrieval-notify','map','fetchHLYEmbeddingModels','hly-custom-api-url','54163ZULjvP','fa-check-circle','getMessagesForCondensation','圣旨已达','includes','获取模型失败:\x20','正在处理您提交的文书...','forEach','selectedIndex','amily2_open_rag_palace','condensation','hly-condensation-enabled','hly-include-user','purgeStorage','根据当前勾选条件,未找到符合的消息可供预览。','createElement','getElementById','textContent','未找到符合条件的消息。','log-success','length','getCharacterName','hly-custom-endpoint-docket','-tab','清空宝库失败。','','3132UlcDnO','trim','[翰林院-枢纽]\x20未能获取SillyTavern上下文,绑定失败。','\x0a所用模型:\x20','hly-retrieval-enabled','queryMessageCount','神力连接通畅!','fa-times-circle','saveSettings','hly-layer-start','change','宝库状态','apiKey','updateHLYMemoryCount','.hly-nav-item','count','value','查询宝库状态失败:\x20','hly-log-output','customApiUrl','hly-chunk-size','previewHLYCondensation','hly-overlap-size','大功告成','未能获取到任何嵌入模型。','user','已采集\x20','\x20条消息进行凝识:\x0a\x0a','录入内容不能为空。','toggle','chunkSize','hly-api-key','input[name=\x22hly-injection-position\x22]:checked','hly-condensation-results','hly-injection-depth','layerStart','fa-exclamation-triangle','dataset','正在清空宝库...','depth','success','warning','querySelector','checked','5395SbNPHL','hly-max-results','翰林院设定已存档封印。','matchThreshold','14uneaUR','凝识完成!新增\x20','严重错误','retrieval','hly-','hly-current-vector-count','','\x22>\x20[','name','embeddingModel','template','hly-injection-template','resetSettings','未知错误','hly-layer-end','querySelectorAll','testHLYApi','[翰林院-枢纽]\x20核心法典未能提供初始化圣旨!','1001YmQSbj','display','文书录入失败:\x20','batchSize','此操作将彻底清空当前角色的所有忆识(向量),且无法恢复。您确定要继续吗?','\x20条消息,开始凝识...','6465327avIyxq','innerHTML','options','用户请求查看宝库状态。','appendChild','getCollectionId','hly-current-character-name','\x0a忆识总数:\x20','overlap','message','10GQghEc','showHLYStats','收到手动录入请求,文本长度:\x20','toLocaleTimeString','hly-injection-role'];_0x877e=function(){return _0x4e3e99;};return _0x877e();}function log(_0x533963,_0x5106b2='info'){const _0x71d2f=_0x1cae,_0x314e99=document[_0x71d2f(0x285)](_0x71d2f(0x2a1));if(!_0x314e99)return;const _0xce7fa3=document[_0x71d2f(0x284)]('p'),_0x2659d4=new Date()[_0x71d2f(0x222)]();let _0x3295ec=_0x71d2f(0x266),_0x46e9e7=_0x71d2f(0x225);switch(_0x5106b2){case _0x71d2f(0x1f5):_0x3295ec=_0x71d2f(0x276),_0x46e9e7=_0x71d2f(0x288);break;case _0x71d2f(0x252):_0x3295ec=_0x71d2f(0x296),_0x46e9e7=_0x71d2f(0x247);break;case _0x71d2f(0x236):_0x3295ec=_0x71d2f(0x1f1),_0x46e9e7=_0x71d2f(0x23a);break;}_0xce7fa3[_0x71d2f(0x23f)]=_0x71d2f(0x254)+_0x46e9e7,_0xce7fa3[_0x71d2f(0x216)]='获取失败','此操作将彻底清空当前角色的所有忆识(向量),且无法恢复。您确定要继续吗?','layerStart','selectedIndex','getMessagesForCondensation','condensation','saveSettings','\x22>\x20[','enabled','根据当前勾选条件,未找到符合的消息可供预览。','hly-retrieval-notify','trim','宝库状态','message','maxResults','warn','innerHTML','hly-condensation-enabled','querySelectorAll','hly-max-results','.hly-tab-pane','none','startHLYCondensation','未找到符合条件的消息可供凝识。','hlyLog','addEventListener','文书已成功录入宝库,新增\x20','getVectorCount','amily2_open_rag_palace','getCharacterName','用户尝试录入空文本。','hly-layer-end','用户请求查看宝库状态。','hidden','error','hly-current-vector-count','use\x20strict','预览失败:\x20','hly-current-character-name','\x0a--------------------\x0aAPI端点:\x20','fetchEmbeddingModels','hly-current-chat-id','checked','成功获取\x20','\x20条消息,开始凝识...','hly-custom-endpoint-docket','value','33470008GhCeyA','click','join','神力连接通畅!','宝库已清空。','\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20','azure','4372216nxuNKI','input[name=\x22hly-injection-position\x22]:checked','getElementById','block','batchSize','清空宝库失败。','add','[翰林院-枢纽]\x20核心法典未能提供初始化圣旨!','正在测试神力连接...','您确定要将所有设定恢复为出厂默认值吗?','大功告成','toLocaleTimeString','tab','user','hly-query-message-count','count','depth_role','input[name=\x22hly-injection-position\x22]','remove','change','将对以下\x20','凝识完成!新增\x20','disabled','录入内容不能为空。','hly-injection-depth','\x0a翰林院宝库状态\x0a--------------------\x0a集合ID:\x20','查询宝库状态失败:\x20','5754215EZOItc','embeddingModel','input[name=\x22hly-injection-position\x22][value=\x22','\x20条消息进行凝识:\x0a\x0a','凝识失败:\x20','getSettings','ingestTextToHanlinyuan','1fQNGQm','overlap','[翰林院-枢纽]\x20查询宝库状态失败:','hly-','hly-embedding-model','querySelector','scrollTop','options','purgeHLYStorage','messageTypes','testHLYApi','layerEnd','apiEndpoint','3196008AvURIE','\x0a所用模型:\x20','翰林院设定已存档封印。','active','10yvmntH',']:\x20','customApiUrl','initialize','toggle','dataset','hly-api-endpoint','length','','未能获取到任何嵌入模型。','hly-include-ai','classList','info','success','hly-chunk-size','template','.\x20[','[翰林院-枢纽]\x20已成功连接各部,政令畅通。','injection','textContent','严重错误','matchThreshold','log','name','forEach','notify','map','fetchHLYEmbeddingModels','chunkSize'];_0x5b2d=function(){return _0x79c88f;};return _0x5b2d();}function setupGlobalEventHandlers(){const _0x3b272c=_0x4f60a9;window[_0x3b272c(0x139)]=saveSettingsFromUI,window[_0x3b272c(0xdc)]=resetSettingsToUI,window[_0x3b272c(0x156)]=testApi,window[_0x3b272c(0xbc)]=fetchHLYEmbeddingModels,window['updateHLYMemoryCount']=updatePanelStatus,window[_0x3b272c(0x154)]=purgeStorage,window[_0x3b272c(0xf7)]=startCondensation,window['previewHLYCondensation']=previewCondensation,window[_0x3b272c(0xce)]=ingestManualText,window[_0x3b272c(0xf9)]=log,window[_0x3b272c(0x13d)]=showStats;}export function bindHanlinyuanEvents(){const _0x3495d2=_0x4f60a9,_0x2184ff=getContext();if(!_0x2184ff){console['error'](_0x3495d2(0xd1));return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents();if(_0x307795[_0x3495d2(0x160)])_0x307795[_0x3495d2(0x160)]();else{console[_0x3495d2(0x103)](_0x3495d2(0x11e));return;}loadSettingsToUI(),console[_0x3495d2(0x173)](_0x3495d2(0x16e));}function bindPanelToggleEvents(){const _0x399974=_0x4f60a9,_0x58ca9d=document[_0x399974(0x119)](_0x399974(0xfd));if(_0x58ca9d){}}function bindInternalUIEvents(){const _0x3c9103=_0x4f60a9,_0x518107=document[_0x3c9103(0xf3)](_0x3c9103(0xd7));_0x518107[_0x3c9103(0xb9)](_0x19149d=>{const _0x1e3090=_0x3c9103;_0x19149d[_0x1e3090(0xfa)](_0x1e3090(0x111),()=>{const _0x5d7d55=_0x1e3090,_0x45b734=_0x19149d[_0x5d7d55(0x162)][_0x5d7d55(0x123)];document[_0x5d7d55(0xf3)](_0x5d7d55(0xf5))[_0x5d7d55(0xb9)](_0x32dd23=>{const _0x19714c=_0x5d7d55;_0x32dd23[_0x19714c(0x168)][_0x19714c(0x161)]('active',_0x32dd23['id']===_0x19714c(0x14f)+_0x45b734+'-tab');}),_0x518107['forEach'](_0x1cecf8=>_0x1cecf8['classList'][_0x5d7d55(0x161)](_0x5d7d55(0x15c),_0x1cecf8===_0x19149d));if(_0x45b734===_0x5d7d55(0x173)){const _0xfb66d4=document[_0x5d7d55(0x119)](_0x5d7d55(0xcd));_0xfb66d4&&(_0xfb66d4[_0x5d7d55(0x152)]=_0xfb66d4[_0x5d7d55(0x13b)]);}});});const _0x4c445a=document[_0x3c9103(0x119)](_0x3c9103(0x163));_0x4c445a&&_0x4c445a['addEventListener'](_0x3c9103(0x12a),toggleCustomEndpointDocket);const _0x278f8b=document[_0x3c9103(0xf3)](_0x3c9103(0x128));_0x278f8b['forEach'](_0x166a40=>{const _0xb62062=_0x3c9103;_0x166a40[_0xb62062(0xfa)](_0xb62062(0x12a),toggleInjectionDetails);});}function toggleInjectionDetails(){const _0x16d85c=_0x4f60a9,_0x1c67db=document[_0x16d85c(0x151)](_0x16d85c(0x118))[_0x16d85c(0x10f)],_0x56c9a7=document[_0x16d85c(0x119)]('hly-injection-depth'),_0xe9866d=document[_0x16d85c(0x119)](_0x16d85c(0xd6)),_0x541fd0=_0x1c67db==='1';_0x56c9a7['disabled']=!_0x541fd0,_0xe9866d[_0x16d85c(0x12d)]=!_0x541fd0;}function toggleCustomEndpointDocket(){const _0x165b52=_0x4f60a9,_0x4fc37b=document[_0x165b52(0x119)]('hly-api-endpoint')[_0x165b52(0x10f)],_0x58149c=document[_0x165b52(0x119)](_0x165b52(0x10e));_0x58149c&&(_0x58149c['style'][_0x165b52(0xcf)]=_0x4fc37b==='custom'||_0x4fc37b===_0x165b52(0x116)?_0x165b52(0x11a):_0x165b52(0xf6));}function loadSettingsToUI(){const _0x1fc4b5=_0x4f60a9,_0x3e9c65=_0x307795[_0x1fc4b5(0x14a)]();if(!_0x3e9c65)return;document['getElementById'](_0x1fc4b5(0xc9))[_0x1fc4b5(0x10b)]=_0x3e9c65[_0x1fc4b5(0xd3)][_0x1fc4b5(0xe9)],document[_0x1fc4b5(0x119)]('hly-api-endpoint')[_0x1fc4b5(0x10f)]=_0x3e9c65[_0x1fc4b5(0xd3)]['apiEndpoint'],document[_0x1fc4b5(0x119)](_0x1fc4b5(0x135))['value']=_0x3e9c65[_0x1fc4b5(0xd3)][_0x1fc4b5(0x15f)],document[_0x1fc4b5(0x119)](_0x1fc4b5(0xd5))['value']=_0x3e9c65['retrieval']['apiKey'];const _0x3bffd9=document['getElementById'](_0x1fc4b5(0x150));if(_0x3bffd9[_0x1fc4b5(0x153)]['length']===0x0){const _0x3203d=_0x3e9c65['retrieval'][_0x1fc4b5(0x146)],_0x1f6045=new Option(_0x3203d,_0x3203d,!![],!![]);_0x3bffd9[_0x1fc4b5(0x11d)](_0x1f6045);}_0x3bffd9[_0x1fc4b5(0x10f)]=_0x3e9c65['retrieval']['embeddingModel'],document[_0x1fc4b5(0x119)](_0x1fc4b5(0xeb))[_0x1fc4b5(0x10b)]=_0x3e9c65[_0x1fc4b5(0xd3)][_0x1fc4b5(0xba)],document[_0x1fc4b5(0x119)](_0x1fc4b5(0x16b))[_0x1fc4b5(0x10f)]=_0x3e9c65[_0x1fc4b5(0xda)][_0x1fc4b5(0xbd)],document[_0x1fc4b5(0x119)](_0x1fc4b5(0x131))['value']=_0x3e9c65[_0x1fc4b5(0xda)][_0x1fc4b5(0x14d)],document['getElementById']('hly-match-threshold')[_0x1fc4b5(0x10f)]=_0x3e9c65[_0x1fc4b5(0xda)][_0x1fc4b5(0x172)],document[_0x1fc4b5(0x119)]('hly-query-message-count')['value']=_0x3e9c65[_0x1fc4b5(0xda)]['queryMessageCount'],document[_0x1fc4b5(0x119)](_0x1fc4b5(0xf4))['value']=_0x3e9c65['advanced'][_0x1fc4b5(0xef)],document['getElementById'](_0x1fc4b5(0x133))[_0x1fc4b5(0x10f)]=_0x3e9c65['retrieval']['batchSize'],document['getElementById'](_0x1fc4b5(0xd0))[_0x1fc4b5(0x10f)]=_0x3e9c65['injection'][_0x1fc4b5(0x16c)];const _0x3e9180=document[_0x1fc4b5(0x151)](_0x1fc4b5(0x147)+_0x3e9c65[_0x1fc4b5(0x16f)][_0x1fc4b5(0xc0)]+'\x22]');_0x3e9180&&(_0x3e9180[_0x1fc4b5(0x10b)]=!![]),document[_0x1fc4b5(0x119)](_0x1fc4b5(0x12f))['value']=_0x3e9c65['injection'][_0x1fc4b5(0xd4)],document[_0x1fc4b5(0x119)]('hly-injection-role')['value']=_0x3e9c65['injection'][_0x1fc4b5(0x127)],toggleInjectionDetails(),document[_0x1fc4b5(0x119)]('hly-condensation-enabled')[_0x1fc4b5(0x10b)]=_0x3e9c65['condensation']['enabled'],document[_0x1fc4b5(0x119)]('hly-layer-start')['value']=_0x3e9c65[_0x1fc4b5(0xe6)]['layerStart'],document[_0x1fc4b5(0x119)](_0x1fc4b5(0x100))[_0x1fc4b5(0x10f)]=_0x3e9c65[_0x1fc4b5(0xe6)]['layerEnd'],document[_0x1fc4b5(0x119)]('hly-include-user')[_0x1fc4b5(0x10b)]=_0x3e9c65[_0x1fc4b5(0xe6)][_0x1fc4b5(0x155)][_0x1fc4b5(0x124)],document[_0x1fc4b5(0x119)](_0x1fc4b5(0x167))[_0x1fc4b5(0x10b)]=_0x3e9c65[_0x1fc4b5(0xe6)][_0x1fc4b5(0x155)]['ai'],toggleCustomEndpointDocket();}function _0x49a7(_0x4a5791,_0x56ca9d){const _0x5b2d5d=_0x5b2d();return _0x49a7=function(_0x49a72e,_0x3ddf93){_0x49a72e=_0x49a72e-0xb9;let _0x120511=_0x5b2d5d[_0x49a72e];return _0x120511;},_0x49a7(_0x4a5791,_0x56ca9d);}function saveSettingsFromUI(){const _0x122c3e=_0x4f60a9,_0x400a36=_0x307795['getSettings']();if(!_0x400a36)return;_0x400a36[_0x122c3e(0xd3)][_0x122c3e(0xe9)]=document['getElementById']('hly-retrieval-enabled')[_0x122c3e(0x10b)],_0x400a36[_0x122c3e(0xd3)][_0x122c3e(0x158)]=document[_0x122c3e(0x119)](_0x122c3e(0x163))[_0x122c3e(0x10f)],_0x400a36[_0x122c3e(0xd3)][_0x122c3e(0x15f)]=document['getElementById']('hly-custom-api-url')[_0x122c3e(0x10f)],_0x400a36[_0x122c3e(0xd3)][_0x122c3e(0xca)]=document[_0x122c3e(0x119)]('hly-api-key')[_0x122c3e(0x10f)],_0x400a36[_0x122c3e(0xd3)][_0x122c3e(0x146)]=document['getElementById']('hly-embedding-model')[_0x122c3e(0x10f)],_0x400a36[_0x122c3e(0xd3)][_0x122c3e(0xba)]=document['getElementById'](_0x122c3e(0xeb))[_0x122c3e(0x10b)],_0x400a36[_0x122c3e(0xda)][_0x122c3e(0xbd)]=parseInt(document[_0x122c3e(0x119)](_0x122c3e(0x16b))['value']),_0x400a36[_0x122c3e(0xda)][_0x122c3e(0x14d)]=parseInt(document[_0x122c3e(0x119)](_0x122c3e(0x131))[_0x122c3e(0x10f)]),_0x400a36[_0x122c3e(0xda)][_0x122c3e(0x172)]=parseFloat(document[_0x122c3e(0x119)](_0x122c3e(0xc6))[_0x122c3e(0x10f)]),_0x400a36['advanced'][_0x122c3e(0x142)]=parseInt(document[_0x122c3e(0x119)](_0x122c3e(0x125))[_0x122c3e(0x10f)]),_0x400a36[_0x122c3e(0xda)][_0x122c3e(0xef)]=parseInt(document[_0x122c3e(0x119)]('hly-max-results')['value']),_0x400a36[_0x122c3e(0xd3)][_0x122c3e(0x11b)]=parseInt(document['getElementById'](_0x122c3e(0x133))['value']),_0x400a36['injection']['template']=document[_0x122c3e(0x119)](_0x122c3e(0xd0))[_0x122c3e(0x10f)],_0x400a36[_0x122c3e(0x16f)][_0x122c3e(0xc0)]=parseInt(document[_0x122c3e(0x151)]('input[name=\x22hly-injection-position\x22]:checked')[_0x122c3e(0x10f)]),_0x400a36['injection'][_0x122c3e(0xd4)]=parseInt(document[_0x122c3e(0x119)](_0x122c3e(0x12f))[_0x122c3e(0x10f)])||0x1,_0x400a36[_0x122c3e(0x16f)][_0x122c3e(0x127)]=parseInt(document['getElementById'](_0x122c3e(0xd6))[_0x122c3e(0x10f)]),_0x400a36[_0x122c3e(0xe6)][_0x122c3e(0xe9)]=document['getElementById'](_0x122c3e(0xf2))[_0x122c3e(0x10b)],_0x400a36[_0x122c3e(0xe6)][_0x122c3e(0xe3)]=parseInt(document['getElementById'](_0x122c3e(0xdb))[_0x122c3e(0x10f)]),_0x400a36[_0x122c3e(0xe6)][_0x122c3e(0x157)]=parseInt(document[_0x122c3e(0x119)](_0x122c3e(0x100))['value']),_0x400a36[_0x122c3e(0xe6)]['messageTypes'][_0x122c3e(0x124)]=document[_0x122c3e(0x119)](_0x122c3e(0xd2))[_0x122c3e(0x10b)],_0x400a36[_0x122c3e(0xe6)][_0x122c3e(0x155)]['ai']=document[_0x122c3e(0x119)](_0x122c3e(0x167))[_0x122c3e(0x10b)],_0x400a36['condensation'][_0x122c3e(0x155)][_0x122c3e(0x102)]=![],_0x307795[_0x122c3e(0xe7)](),toastr[_0x122c3e(0x16a)](_0x122c3e(0x15b),'圣旨已达');}function resetSettingsToUI(){const _0x9cf82c=_0x4f60a9;confirm(_0x9cf82c(0x120))&&(_0x307795['resetSettings'](),loadSettingsToUI(),toastr[_0x9cf82c(0x169)]('翰林院设定已重置为初始状态。','诏曰'));}async function updatePanelStatus(){const _0xc4f8ac=_0x4f60a9;document[_0xc4f8ac(0x119)](_0xc4f8ac(0x107))['textContent']=_0x38d560[_0xc4f8ac(0xfe)](),document['getElementById'](_0xc4f8ac(0x10a))['textContent']=_0x38d560['getChatId']()||'无';const _0x113660=document[_0xc4f8ac(0x119)](_0xc4f8ac(0x104));_0x113660[_0xc4f8ac(0x170)]=_0xc4f8ac(0x13a);try{const _0x64fa5b=await _0x307795[_0xc4f8ac(0xfc)]();_0x113660[_0xc4f8ac(0x170)]=_0x64fa5b;}catch(_0xe45ca0){console[_0xc4f8ac(0x103)]('[翰林院-枢纽]\x20更新忆识数量失败:',_0xe45ca0),_0x113660['textContent']='错误';}}async function testApi(){const _0x1c97cc=_0x4f60a9;toastr[_0x1c97cc(0x169)](_0x1c97cc(0x11f),'圣旨');try{await _0x307795[_0x1c97cc(0x138)](),toastr['success'](_0x1c97cc(0x113),'圣意');}catch(_0x5cb29f){toastr[_0x1c97cc(0x103)]('神力连接失败:\x20'+_0x5cb29f[_0x1c97cc(0xee)],'警报');}}async function fetchHLYEmbeddingModels(){const _0x58af44=_0x4f60a9,_0x44f0f8=document[_0x58af44(0x119)](_0x58af44(0x150)),_0x17b4fb=_0x44f0f8['value'];_0x44f0f8[_0x58af44(0xf1)]='',_0x44f0f8[_0x58af44(0x12d)]=!![];try{log('开始获取嵌入模型列表...',_0x58af44(0x169));const _0x8114c5=await _0x307795[_0x58af44(0x109)]();_0x44f0f8[_0x58af44(0xf1)]='';if(_0x8114c5[_0x58af44(0x164)]===0x0){_0x44f0f8[_0x58af44(0xf1)]=_0x58af44(0x165),toastr['warn'](_0x58af44(0x166),_0x58af44(0xde)),log(_0x58af44(0x166),_0x58af44(0xf0));return;}_0x8114c5[_0x58af44(0xb9)](_0x30c051=>{const _0x54acba=_0x58af44,_0x4dc451=new Option(_0x30c051,_0x30c051);_0x44f0f8[_0x54acba(0x11d)](_0x4dc451);}),_0x8114c5['includes'](_0x17b4fb)?_0x44f0f8[_0x58af44(0x10f)]=_0x17b4fb:_0x44f0f8[_0x58af44(0xe4)]=0x0,toastr[_0x58af44(0x16a)](_0x58af44(0x10c)+_0x8114c5['length']+_0x58af44(0xcb),'圣意'),log('成功获取\x20'+_0x8114c5[_0x58af44(0x164)]+_0x58af44(0xcb),_0x58af44(0x16a));}catch(_0x36f85f){console[_0x58af44(0x103)]('[翰林院-枢纽]\x20获取模型列表失败:',_0x36f85f),toastr[_0x58af44(0x103)](_0x58af44(0xdf)+_0x36f85f[_0x58af44(0xee)],_0x58af44(0x171)),log('获取模型失败:\x20'+_0x36f85f[_0x58af44(0xee)],_0x58af44(0x103)),_0x44f0f8['innerHTML']=_0x58af44(0xe1);}finally{_0x44f0f8[_0x58af44(0x12d)]=![];}}async function purgeStorage(){const _0xa36d20=_0x4f60a9;if(confirm(_0xa36d20(0xe2))){toastr[_0xa36d20(0x169)](_0xa36d20(0x13e),'圣旨');const _0x183b31=await _0x307795['purgeStorage']();_0x183b31?toastr[_0xa36d20(0x16a)](_0xa36d20(0x114),'圣意'):toastr['error'](_0xa36d20(0x11c),'警报'),await updatePanelStatus();}}async function startCondensation(){const _0x268932=_0x4f60a9,_0x51cfeb=document[_0x268932(0x119)]('hly-condensation-results');_0x51cfeb[_0x268932(0x170)]=_0x268932(0x136),toastr['info']('正在准备凝识...','圣旨');try{const _0x3177b7=_0x307795[_0x268932(0xe5)]();if(!_0x3177b7||_0x3177b7[_0x268932(0x164)]===0x0){toastr['warning'](_0x268932(0xf8),_0x268932(0xde)),_0x51cfeb[_0x268932(0x170)]='未找到符合条件的消息。';return;}_0x51cfeb[_0x268932(0x170)]=_0x268932(0xc8)+_0x3177b7[_0x268932(0x164)]+_0x268932(0x10d),toastr['info']('已采集\x20'+_0x3177b7['length']+_0x268932(0x10d),_0x268932(0xde));const _0x11c36f=await _0x307795[_0x268932(0xc2)](_0x3177b7);if(_0x11c36f[_0x268932(0x16a)])toastr[_0x268932(0x16a)]('凝识完成!新增\x20'+_0x11c36f[_0x268932(0x126)]+_0x268932(0x140),_0x268932(0x121)),_0x51cfeb[_0x268932(0x170)]=_0x268932(0x12c)+_0x11c36f['count']+'\x20条忆识。';else throw new Error(_0x11c36f[_0x268932(0x103)]||_0x268932(0x13c));}catch(_0x26f7f5){console[_0x268932(0x103)]('[翰林院-枢纽]\x20凝识过程发生错误:',_0x26f7f5),toastr[_0x268932(0x103)]('凝识失败:\x20'+_0x26f7f5['message'],_0x268932(0x171)),_0x51cfeb[_0x268932(0x170)]=_0x268932(0x149)+_0x26f7f5[_0x268932(0xee)];}finally{await updatePanelStatus();}}async function showStats(){const _0x17e82d=_0x4f60a9;try{log(_0x17e82d(0x101),_0x17e82d(0x169)),toastr[_0x17e82d(0x169)]('正在查询宝库状态...','圣旨');const _0x38240e=await _0x307795[_0x17e82d(0xfc)](),_0x4d1519=_0x307795[_0x17e82d(0xe0)](),_0x27bcda=_0x307795[_0x17e82d(0x14a)](),_0x4914ee=_0x17e82d(0x143)+_0x4d1519+'\x0a忆识总数:\x20'+_0x38240e+_0x17e82d(0x108)+_0x27bcda[_0x17e82d(0xd3)][_0x17e82d(0x158)]+_0x17e82d(0x15a)+_0x27bcda[_0x17e82d(0xd3)][_0x17e82d(0x146)]+_0x17e82d(0x115);toastr[_0x17e82d(0x169)](_0x4914ee,_0x17e82d(0xed),{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log(_0x17e82d(0xbe)+_0x4d1519+',\x20忆识总数='+_0x38240e,_0x17e82d(0x16a));}catch(_0x510c3b){console[_0x17e82d(0x103)](_0x17e82d(0x14e),_0x510c3b),toastr[_0x17e82d(0x103)]('查询宝库状态失败:\x20'+_0x510c3b[_0x17e82d(0xee)],'严重错误'),log(_0x17e82d(0x144)+_0x510c3b[_0x17e82d(0xee)],_0x17e82d(0x103));}}function previewCondensation(){const _0x5203ab=_0x4f60a9,_0x21ce86=document['getElementById']('hly-condensation-results');try{const _0x1bce5a={'user':document['getElementById'](_0x5203ab(0xd2))[_0x5203ab(0x10b)],'ai':document['getElementById'](_0x5203ab(0x167))[_0x5203ab(0x10b)],'hidden':![]},_0x18d4b5=_0x307795['getMessagesForCondensation'](_0x1bce5a);if(!_0x18d4b5||_0x18d4b5[_0x5203ab(0x164)]===0x0){_0x21ce86[_0x5203ab(0x170)]=_0x5203ab(0xea);return;}const _0x8f08c7=_0x18d4b5[_0x5203ab(0xbb)]((_0x57b249,_0x2ae48c)=>_0x2ae48c+0x1+_0x5203ab(0x16d)+_0x57b249[_0x5203ab(0x174)]+_0x5203ab(0x15e)+_0x57b249['mes'])[_0x5203ab(0x112)]('\x0a\x0a');_0x21ce86[_0x5203ab(0x170)]=_0x5203ab(0x12b)+_0x18d4b5[_0x5203ab(0x164)]+_0x5203ab(0x148)+_0x8f08c7;}catch(_0x211b0e){_0x21ce86[_0x5203ab(0x170)]=_0x5203ab(0x106)+_0x211b0e['message'];}}function log(_0x58f844,_0x2ca290=_0x4f60a9(0x169)){const _0xc85658=_0x4f60a9,_0x29feac=document['getElementById'](_0xc85658(0xcd));if(!_0x29feac)return;const _0x848143=document['createElement']('p'),_0x297b67=new Date()[_0xc85658(0x122)]();let _0x4a34ad=_0xc85658(0xc5),_0x14770d='log-info';switch(_0x2ca290){case'success':_0x4a34ad=_0xc85658(0xcc),_0x14770d='log-success';break;case'error':_0x4a34ad='fa-times-circle',_0x14770d='log-error';break;case _0xc85658(0xf0):_0x4a34ad=_0xc85658(0xc7),_0x14770d=_0xc85658(0xd8);break;}_0x848143['className']='hly-log-entry\x20'+_0x14770d,_0x848143[_0xc85658(0xf1)]=_0xc85658(0x130)+_0x4a34ad+_0xc85658(0xe8)+_0x297b67+']\x20'+_0x58f844;const _0x1ab575=_0x29feac[_0xc85658(0x151)]('.hly-log-placeholder');_0x1ab575&&_0x1ab575[_0xc85658(0x129)](),_0x29feac[_0xc85658(0xbf)](_0x848143),_0x29feac['scrollTop']=_0x29feac[_0xc85658(0x13b)];}async function ingestManualText(){const _0x234acf=_0x4f60a9,_0x13fea6=document[_0x234acf(0x119)]('hly-manual-text'),_0x46aaad=_0x13fea6[_0x234acf(0x10f)][_0x234acf(0xec)]();if(!_0x46aaad){toastr[_0x234acf(0x137)](_0x234acf(0x12e),_0x234acf(0xde)),log(_0x234acf(0xff),_0x234acf(0xf0));return;}log('收到手动录入请求,文本长度:\x20'+_0x46aaad[_0x234acf(0x164)],'info'),toastr['info'](_0x234acf(0xd9),'圣旨');try{const _0x11a532=await _0x307795[_0x234acf(0x14b)](_0x46aaad);if(_0x11a532['success'])toastr['success'](_0x234acf(0xfb)+_0x11a532[_0x234acf(0x126)]+_0x234acf(0x140),'大功告成'),log(_0x234acf(0x134)+_0x11a532[_0x234acf(0x126)]+_0x234acf(0x140),_0x234acf(0x16a)),_0x13fea6['value']='';else throw new Error(_0x11a532[_0x234acf(0x103)]||_0x234acf(0x13c));}catch(_0x41b3a8){console[_0x234acf(0x103)](_0x234acf(0x132),_0x41b3a8),toastr['error'](_0x234acf(0xc4)+_0x41b3a8[_0x234acf(0xee)],'严重错误'),log('手动录入失败:\x20'+_0x41b3a8[_0x234acf(0xee)],_0x234acf(0x103));}finally{await updatePanelStatus();}}