From 9971c8502530918a187e7fa1cdb80fa2a61a1342 Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Fri, 19 Sep 2025 16:55:34 +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 19e9fbd..95850fc 100644 --- a/ui/hanlinyuan-bindings.js +++ b/ui/hanlinyuan-bindings.js @@ -1 +1 @@ -const _0x1cfca3=_0x3813;(function(_0x39bbf3,_0x5b21fc){const _0x1fdd76=_0x3813,_0x55f706=_0x39bbf3();while(!![]){try{const _0x33b1bd=parseInt(_0x1fdd76(0x171))/0x1*(parseInt(_0x1fdd76(0x1be))/0x2)+parseInt(_0x1fdd76(0x2d3))/0x3*(-parseInt(_0x1fdd76(0x2bd))/0x4)+parseInt(_0x1fdd76(0x136))/0x5*(parseInt(_0x1fdd76(0x2ab))/0x6)+parseInt(_0x1fdd76(0x2e3))/0x7*(parseInt(_0x1fdd76(0x279))/0x8)+-parseInt(_0x1fdd76(0x2d6))/0x9+parseInt(_0x1fdd76(0x16f))/0xa*(parseInt(_0x1fdd76(0x15b))/0xb)+-parseInt(_0x1fdd76(0x1cd))/0xc;if(_0x33b1bd===_0x5b21fc)break;else _0x55f706['push'](_0x55f706['shift']());}catch(_0x15b88b){_0x55f706['push'](_0x55f706['shift']());}}}(_0x4621,0xc37a8));import{getContext}from'/scripts/extensions.js';import*as _0x589651 from'../core/rag-processor.js';import*as _0x3b2ead from'../core/historiographer.js';import*as _0x1e2c21 from'../core/utils/context-utils.js';function _0x3813(_0x4d2163,_0x47d3c5){const _0x462170=_0x4621();return _0x3813=function(_0x3813dc,_0x3f82d2){_0x3813dc=_0x3813dc-0x122;let _0x453ea5=_0x462170[_0x3813dc];return _0x453ea5;},_0x3813(_0x4d2163,_0x47d3c5);}import*as _0x481a58 from'../core/ingestion-manager.js';import{showContentModal,showHtmlModal}from'./page-window.js';import{extractBlocksByTags,applyExclusionRules}from'../core/utils/rag-tag-extractor.js';_0x1cfca3(0x27f);function setupGlobalEventHandlers(){const _0x32c806=_0x1cfca3;window[_0x32c806(0x18b)]=()=>saveSettingsFromUI(![]),window[_0x32c806(0x1c4)]=resetSettingsToUI,window[_0x32c806(0x123)]=testApi,window['fetchHLYEmbeddingModels']=fetchHLYEmbeddingModels,window[_0x32c806(0x1ad)]=fetchHLYRerankModels,window[_0x32c806(0x159)]=updatePanelStatus,window['purgeHLYStorage']=purgeStorage,window[_0x32c806(0x133)]=startCondensation,window[_0x32c806(0x15a)]=previewCondensation,window[_0x32c806(0x2eb)]=ingestManualText,window[_0x32c806(0x28a)]=log,window[_0x32c806(0x1fb)]=showStats,window[_0x32c806(0x154)]=startHistoriography;}function updateAndSaveSetting(_0x27b996,_0x21858f){const _0x49727a=_0x1cfca3,_0x4a961c=_0x589651[_0x49727a(0x2dc)]();if(!_0x4a961c)return;const _0x57cdcc=_0x27b996['split']('.');let _0x3187d7=_0x4a961c;for(let _0x5e83c7=0x0;_0x5e83c7<_0x57cdcc['length']-0x1;_0x5e83c7++){_0x3187d7=_0x3187d7[_0x57cdcc[_0x5e83c7]]=_0x3187d7[_0x57cdcc[_0x5e83c7]]||{};}_0x3187d7[_0x57cdcc[_0x57cdcc[_0x49727a(0x262)]-0x1]]=_0x21858f,_0x589651[_0x49727a(0x1f4)](),log(_0x49727a(0x1ef)+_0x27b996+_0x49727a(0x2c9)+JSON['stringify'](_0x21858f),_0x49727a(0x1c8));}function bindAutoSaveEvents(){const _0x4148d5=_0x1cfca3,_0x3cadc8=document[_0x4148d5(0x23a)](_0x4148d5(0x12e));if(!_0x3cadc8)return;_0x3cadc8[_0x4148d5(0x206)](_0x4148d5(0x263),_0x126da7=>{const _0x54aa71=_0x4148d5,_0x42022e=_0x126da7['target'],_0x2e72b8=_0x42022e[_0x54aa71(0x2da)][_0x54aa71(0x1d5)];if(!_0x2e72b8)return;let _0x80ebb;const _0x5d440a=_0x42022e['dataset'][_0x54aa71(0x149)]||_0x54aa71(0x26b);if(_0x42022e['type']==='checkbox')_0x80ebb=_0x42022e[_0x54aa71(0x2ec)];else{if(_0x42022e['type']===_0x54aa71(0x1fd)){if(_0x42022e[_0x54aa71(0x2ec)]){const _0x4db12e=_0x3cadc8[_0x54aa71(0x214)](_0x54aa71(0x197)+_0x42022e['name']+'\x22]'),_0x25aeab=Array[_0x54aa71(0x1e8)](_0x4db12e)[_0x54aa71(0x1b1)](_0x15eefc=>_0x15eefc[_0x54aa71(0x2ec)]);_0x80ebb=_0x25aeab[_0x54aa71(0x27d)];}else return;}else _0x80ebb=_0x42022e[_0x54aa71(0x27d)];}switch(_0x5d440a){case _0x54aa71(0x1cc):_0x80ebb=parseInt(_0x80ebb,0xa);break;case _0x54aa71(0x2f1):_0x80ebb=parseFloat(_0x80ebb);break;case _0x54aa71(0x2ea):typeof _0x80ebb!=='boolean'&&(_0x80ebb=_0x80ebb===_0x54aa71(0x2fa));break;}if(_0x42022e['type']===_0x54aa71(0x1fd)&&!_0x42022e[_0x54aa71(0x2ec)])return;updateAndSaveSetting(_0x2e72b8,_0x80ebb);});}export function bindHanlinyuanEvents(){const _0x4f32cd=_0x1cfca3,_0x377810=getContext();if(!_0x377810){console[_0x4f32cd(0x1f3)](_0x4f32cd(0x16c));return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents(),bindTutorialEvents(),bindAutoSaveEvents(),bindSessionLockEvent();if(_0x589651['initialize'])_0x589651[_0x4f32cd(0x165)]();else{console['error'](_0x4f32cd(0x162));return;}loadSettingsToUI(),loadWorldbookList(),log(_0x4f32cd(0x167),_0x4f32cd(0x202));const _0x21b849=document['getElementById'](_0x4f32cd(0x1e5)),_0x3baef1=document['getElementById']('hanlinyuan-ingest-novel-file-name'),_0x2b14cd=document[_0x4f32cd(0x23a)]('hanlinyuan-ingest-novel-start'),_0x509a5e=document[_0x4f32cd(0x23a)]('hanlinyuan-ingest-abort'),_0x27aa56=document[_0x4f32cd(0x23a)]('hanlinyuan-ingest-progress-container'),_0x2af0ef=document[_0x4f32cd(0x23a)](_0x4f32cd(0x195)),_0x40abc9=document[_0x4f32cd(0x23a)](_0x4f32cd(0x2c8)),_0x9f78c7=document[_0x4f32cd(0x23a)](_0x4f32cd(0x23c));let _0x5597a6=null,_0x44ce63=null;_0x21b849['addEventListener'](_0x4f32cd(0x263),_0x48786a=>{const _0x349e84=_0x4f32cd;_0x5597a6=_0x48786a[_0x349e84(0x1ed)][_0x349e84(0x252)][0x0],_0x5597a6?(_0x3baef1[_0x349e84(0x24f)]=_0x5597a6['name'],_0x3baef1['title']=_0x5597a6[_0x349e84(0x2ac)]):_0x3baef1[_0x349e84(0x24f)]=_0x349e84(0x1e1);}),_0x2b14cd[_0x4f32cd(0x206)](_0x4f32cd(0x1cf),async()=>{const _0x4792ee=_0x4f32cd;if(!_0x5597a6){toastr[_0x4792ee(0x17f)](_0x4792ee(0x2b4));return;}let _0x522c50=0x0;const _0x46e810=_0x481a58[_0x4792ee(0x2b2)](_0x5597a6),_0x567b26=_0x481a58[_0x4792ee(0x1a1)](_0x46e810);if(_0x567b26){const _0x54d69b=(_0x567b26[_0x4792ee(0x1c6)]/_0x567b26['totalChunks']*0x64)[_0x4792ee(0x260)](0x1),_0x100872=confirm(_0x4792ee(0x1b2)+_0x54d69b+_0x4792ee(0x1bc));_0x100872?(_0x522c50=_0x567b26[_0x4792ee(0x1c6)],toastr['info']('遵命,将从第\x20'+(_0x522c50+0x1)+_0x4792ee(0x1f1),_0x4792ee(0x192)),log(_0x4792ee(0x2e2)+_0x46e810+_0x4792ee(0x2cf)+_0x522c50+_0x4792ee(0x2ed),_0x4792ee(0x202))):(_0x481a58[_0x4792ee(0x2f6)](_0x46e810),toastr[_0x4792ee(0x202)]('遵命,将从头开始录入此书。','圣旨已达'),log(_0x4792ee(0x218)+_0x46e810+_0x4792ee(0x2b3),_0x4792ee(0x13e)));}_0x44ce63=new AbortController();const _0x1a4849=_0x44ce63[_0x4792ee(0x29e)];_0x9f78c7['style']['display']='none',_0x27aa56['style'][_0x4792ee(0x28e)]=_0x4792ee(0x222),_0x40abc9['textContent']=_0x4792ee(0x138),_0x2af0ef[_0x4792ee(0x27d)]=0x0;try{const _0xad5e02=await _0x5597a6['text'](),_0x270e94=_0x291db5=>{const _0x249bec=_0x4792ee;_0x40abc9['textContent']='处理中:\x20'+_0x291db5['message']+'\x20('+_0x291db5[_0x249bec(0x1ca)]+'/'+_0x291db5[_0x249bec(0x25e)]+')',_0x2af0ef[_0x249bec(0x27d)]=_0x291db5[_0x249bec(0x1ca)]/_0x291db5['total']*0x64;},_0x105b93=()=>{const _0x3a398c=_0x4792ee;updatePanelStatus(),log(_0x3a398c(0x1b8),_0x3a398c(0x202));},_0x1987b4=await _0x589651[_0x4792ee(0x1a2)](_0xad5e02,'novel',{'sourceName':_0x5597a6['name']},_0x270e94,_0x1a4849,log,_0x105b93,_0x46e810,_0x522c50);if(_0x1987b4[_0x4792ee(0x1c8)])toastr['success'](_0x4792ee(0x157)+_0x1987b4['count']+_0x4792ee(0x180)),_0x40abc9['textContent']=_0x4792ee(0x1ba)+_0x1987b4[_0x4792ee(0x1de)]+_0x4792ee(0x2e1),_0x2af0ef[_0x4792ee(0x27d)]=0x64,updatePanelStatus();else throw new Error(_0x1987b4[_0x4792ee(0x1f3)]||'未知错误');}catch(_0x4dceef){_0x4dceef[_0x4792ee(0x2ac)]===_0x4792ee(0x29a)?(toastr[_0x4792ee(0x202)](_0x4792ee(0x289)),_0x40abc9['textContent']=_0x4792ee(0x18a)):(toastr['error'](_0x4792ee(0x2b6)+_0x4dceef[_0x4792ee(0x12d)]+_0x4792ee(0x17b)),_0x40abc9[_0x4792ee(0x24f)]=_0x4792ee(0x205)+_0x4dceef[_0x4792ee(0x12d)]);}finally{setTimeout(()=>{const _0xcbd8ad=_0x4792ee;_0x9f78c7[_0xcbd8ad(0x132)]['display']=_0xcbd8ad(0x1ee),_0x27aa56[_0xcbd8ad(0x132)][_0xcbd8ad(0x28e)]='none',_0x21b849[_0xcbd8ad(0x27d)]='',_0x5597a6=null,_0x3baef1[_0xcbd8ad(0x24f)]=_0xcbd8ad(0x1e1);},0xbb8);}}),_0x509a5e[_0x4f32cd(0x206)](_0x4f32cd(0x1cf),()=>{const _0x31c250=_0x4f32cd;_0x44ce63&&_0x44ce63[_0x31c250(0x17d)]();});}function bindSessionLockEvent(){const _0xa5742d=_0x1cfca3,_0x39a2dd=document[_0xa5742d(0x23a)]('hly-session-lock-btn');if(!_0x39a2dd)return;_0x39a2dd[_0xa5742d(0x206)](_0xa5742d(0x1cf),async()=>{const _0x1ad5f3=_0xa5742d,_0x3e6a89=await _0x589651[_0x1ad5f3(0x1d0)]();updateSessionLockUI(_0x3e6a89);if(_0x3e6a89){const _0x3e70a4=_0x589651['getLockedSessionInfo']();_0x3e70a4&&(toastr[_0x1ad5f3(0x1c8)](_0x1ad5f3(0x26a)+_0x3e70a4['id'],'圣旨已下'),log('会话已锁定到宝库:\x20'+_0x3e70a4['id'],'success'));}else toastr[_0x1ad5f3(0x202)](_0x1ad5f3(0x1ae),'诏曰'),log(_0x1ad5f3(0x1c1),_0x1ad5f3(0x202));updatePanelStatus();}),updateSessionLockUI(_0x589651[_0xa5742d(0x2be)]());}function updateSessionLockUI(_0x39c283){const _0x2947f3=_0x1cfca3,_0x155199=document['getElementById'](_0x2947f3(0x2ce));if(!_0x155199)return;const _0x4be774=_0x155199[_0x2947f3(0x198)]('i'),_0x1df3b4=_0x155199[_0x2947f3(0x198)]('span');_0x39c283?(_0x155199[_0x2947f3(0x18d)][_0x2947f3(0x15d)](_0x2947f3(0x19b)),_0x4be774[_0x2947f3(0x21a)]=_0x2947f3(0x26e),_0x1df3b4[_0x2947f3(0x24f)]=_0x2947f3(0x227),_0x155199[_0x2947f3(0x1a4)]=_0x2947f3(0x272)):(_0x155199['classList']['remove'](_0x2947f3(0x19b)),_0x4be774[_0x2947f3(0x21a)]=_0x2947f3(0x1b5),_0x1df3b4[_0x2947f3(0x24f)]=_0x2947f3(0x20a),_0x155199[_0x2947f3(0x1a4)]='点击以锁定,让翰林院固定操作当前角色的宝库');}function bindPanelToggleEvents(){const _0x4f2e5d=_0x1cfca3,_0x58a412=document[_0x4f2e5d(0x23a)]('amily2_open_rag_palace');if(_0x58a412){}}function bindTutorialEvents(){const _0x2f6abe=_0x1cfca3,_0x44ba6c=document['getElementById'](_0x2f6abe(0x23f));_0x44ba6c&&_0x44ba6c[_0x2f6abe(0x206)](_0x2f6abe(0x1cf),()=>{const _0x5c8ced=_0x2f6abe;showContentModal(_0x5c8ced(0x251),_0x5c8ced(0x18c));});}function bindInternalUIEvents(){const _0x520f13=_0x1cfca3,_0xb30ae7=document[_0x520f13(0x214)](_0x520f13(0x2e8));_0xb30ae7[_0x520f13(0x236)](_0x2f08ee=>{const _0x1dd859=_0x520f13;_0x2f08ee[_0x1dd859(0x206)](_0x1dd859(0x1cf),()=>{const _0x99f76d=_0x1dd859,_0x342d62=_0x2f08ee[_0x99f76d(0x2da)][_0x99f76d(0x2a1)],_0x50cec0=_0x99f76d(0x298)+_0x342d62+_0x99f76d(0x125);document[_0x99f76d(0x214)](_0x99f76d(0x2f0))[_0x99f76d(0x236)](_0x4fd458=>{const _0x392f5c=_0x99f76d;_0x4fd458[_0x392f5c(0x18d)]['toggle'](_0x392f5c(0x19b),_0x4fd458['id']===_0x50cec0);}),_0xb30ae7['forEach'](_0x285300=>_0x285300[_0x99f76d(0x18d)]['toggle'](_0x99f76d(0x19b),_0x285300===_0x2f08ee));});});const _0x39dfaa=document['getElementById'](_0x520f13(0x175));_0x39dfaa&&_0x39dfaa[_0x520f13(0x206)]('change',handleApiModeChange);const _0x3c7ddf=document[_0x520f13(0x214)](_0x520f13(0x282));_0x3c7ddf[_0x520f13(0x236)](_0x187009=>{const _0x10f919=_0x520f13;_0x187009[_0x10f919(0x206)](_0x10f919(0x263),toggleInjectionDetails);});const _0x281f84=document[_0x520f13(0x23a)](_0x520f13(0x143)),_0x5d5b37=document[_0x520f13(0x23a)](_0x520f13(0x2f7));_0x281f84&&_0x5d5b37&&_0x281f84[_0x520f13(0x206)]('change',()=>{const _0x2b4778=_0x520f13;_0x5d5b37[_0x2b4778(0x132)][_0x2b4778(0x28e)]=_0x281f84[_0x2b4778(0x2ec)]?_0x2b4778(0x222):_0x2b4778(0x259);});const _0x2774e8=document['getElementById'](_0x520f13(0x217));_0x2774e8&&_0x2774e8['addEventListener']('change',handleWorldbookSelectionChange);const _0x46a5fe=document[_0x520f13(0x23a)](_0x520f13(0x21f));_0x46a5fe&&_0x46a5fe[_0x520f13(0x206)](_0x520f13(0x1cf),showExclusionRulesModal);const _0x431384=document[_0x520f13(0x23a)](_0x520f13(0x20c)),_0x233b3c=document[_0x520f13(0x23a)]('hly-hist-entry-multiselect-options');_0x431384&&_0x233b3c&&(_0x431384['addEventListener'](_0x520f13(0x1cf),_0x3d401f=>{const _0x2b26e7=_0x520f13;_0x3d401f[_0x2b26e7(0x12b)]();const _0x38a136=_0x233b3c['style'][_0x2b26e7(0x28e)]==='block';_0x233b3c['style'][_0x2b26e7(0x28e)]=_0x38a136?_0x2b26e7(0x259):_0x2b26e7(0x222);}),_0x233b3c[_0x520f13(0x206)]('change',_0x5d89cf=>{const _0x15dca3=_0x520f13,_0x9fd002=_0x5d89cf[_0x15dca3(0x1ed)];if(_0x9fd002['type']!==_0x15dca3(0x234))return;const _0x2032b3=_0x233b3c[_0x15dca3(0x214)](_0x15dca3(0x12c)),_0x1d34ae=document[_0x15dca3(0x23a)](_0x15dca3(0x1a5));if(_0x9fd002['id']===_0x15dca3(0x1a5))_0x2032b3['forEach'](_0x425825=>_0x425825[_0x15dca3(0x2ec)]=_0x9fd002['checked']);else{const _0x4a7ab5=Array['from'](_0x2032b3)[_0x15dca3(0x2ef)](_0x5c7246=>_0x5c7246['checked']);_0x1d34ae['checked']=_0x4a7ab5;}const _0x579f9c=_0x233b3c[_0x15dca3(0x214)](_0x15dca3(0x188))[_0x15dca3(0x262)],_0x3f3ee7=_0x2032b3[_0x15dca3(0x262)];_0x431384[_0x15dca3(0x198)](_0x15dca3(0x22a))[_0x15dca3(0x24f)]=_0x15dca3(0x266)+_0x579f9c+'\x20/\x20'+_0x3f3ee7+_0x15dca3(0x24b);}),document[_0x520f13(0x206)](_0x520f13(0x1cf),_0x4860cb=>{const _0x39ea35=_0x520f13;!_0x431384[_0x39ea35(0x19e)](_0x4860cb[_0x39ea35(0x1ed)])&&!_0x233b3c['contains'](_0x4860cb[_0x39ea35(0x1ed)])&&(_0x233b3c[_0x39ea35(0x132)][_0x39ea35(0x28e)]=_0x39ea35(0x259));}));const _0x177e08=document[_0x520f13(0x23a)](_0x520f13(0x231));_0x177e08&&_0x177e08[_0x520f13(0x206)](_0x520f13(0x1cf),deleteAllLocalKnowledgeBases);const _0x408865=document[_0x520f13(0x23a)](_0x520f13(0x25d));_0x408865&&_0x408865['addEventListener'](_0x520f13(0x1cf),()=>moveAllKnowledgeBases(_0x520f13(0x211)));const _0x1917e7=document[_0x520f13(0x23a)]('hly-kb-move-all-to-global');_0x1917e7&&_0x1917e7[_0x520f13(0x206)](_0x520f13(0x1cf),()=>moveAllKnowledgeBases(_0x520f13(0x2a3)));const _0x28a065=[_0x520f13(0x246),_0x520f13(0x2ca)];_0x28a065[_0x520f13(0x236)](_0x12db29=>{const _0x19a67f=_0x520f13,_0x3265a0=document[_0x19a67f(0x23a)](_0x12db29);_0x3265a0&&(_0x3265a0[_0x19a67f(0x206)](_0x19a67f(0x1cf),handleKbAction),_0x3265a0[_0x19a67f(0x206)](_0x19a67f(0x263),handleKbAction));});}function toggleInjectionDetails(){const _0x1db702=_0x1cfca3,_0x65c6fa=document['querySelector'](_0x1db702(0x18e))[_0x1db702(0x27d)],_0x18c6f3=document['getElementById'](_0x1db702(0x182)),_0x2ce743=document['getElementById']('hly-injection-role'),_0x55a64e=_0x65c6fa==='1';_0x18c6f3['disabled']=!_0x55a64e,_0x2ce743[_0x1db702(0x2bf)]=!_0x55a64e;}function handleApiModeChange(){const _0x1323d3=_0x1cfca3,_0x4f96b5=document[_0x1323d3(0x23a)](_0x1323d3(0x175))[_0x1323d3(0x27d)],_0x2459f3=document[_0x1323d3(0x23a)](_0x1323d3(0x135)),_0x2d399c=document[_0x1323d3(0x23a)](_0x1323d3(0x230)),_0x29b1d8=document[_0x1323d3(0x23a)](_0x1323d3(0x142)),_0x5d94e7=_0x29b1d8[_0x1323d3(0x2d4)];if(!_0x2459f3||!_0x2d399c)return;_0x2459f3[_0x1323d3(0x132)]['display']='block',_0x2d399c[_0x1323d3(0x132)][_0x1323d3(0x28e)]=_0x1323d3(0x222);switch(_0x4f96b5){case'google_direct':_0x2459f3[_0x1323d3(0x132)][_0x1323d3(0x28e)]='none',_0x2d399c[_0x1323d3(0x198)](_0x1323d3(0x1e0))['textContent']=_0x1323d3(0x245),_0x2d399c[_0x1323d3(0x198)](_0x1323d3(0x23e))[_0x1323d3(0x12f)]=_0x1323d3(0x2b7);break;case _0x1323d3(0x15e):_0x2459f3[_0x1323d3(0x198)](_0x1323d3(0x1e0))[_0x1323d3(0x24f)]=_0x1323d3(0x168),_0x2459f3[_0x1323d3(0x198)](_0x1323d3(0x23e))[_0x1323d3(0x12f)]='例如\x20http://127.0.0.1:8000/v1',_0x2d399c[_0x1323d3(0x132)][_0x1323d3(0x28e)]=_0x1323d3(0x259);break;case _0x1323d3(0x220):default:_0x2459f3[_0x1323d3(0x198)](_0x1323d3(0x1e0))['textContent']=_0x1323d3(0x26f),_0x2459f3[_0x1323d3(0x198)](_0x1323d3(0x23e))['placeholder']=_0x1323d3(0x14d),_0x2d399c[_0x1323d3(0x198)](_0x1323d3(0x1e0))[_0x1323d3(0x24f)]='通行令牌\x20(API\x20Key):';break;}}function loadSettingsToUI(){const _0x10669c=_0x1cfca3,_0xecec8c=_0x589651[_0x10669c(0x2dc)]();if(!_0xecec8c)return;document['getElementById']('hly-retrieval-enabled')['checked']=_0xecec8c[_0x10669c(0x1ab)][_0x10669c(0x1c3)],document['getElementById'](_0x10669c(0x175))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x1ab)]['apiEndpoint'],document['getElementById']('hly-custom-api-url')[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x1ab)][_0x10669c(0x2a7)],document[_0x10669c(0x23a)](_0x10669c(0x1db))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x1ab)][_0x10669c(0x153)];const _0x4eb2c1=document[_0x10669c(0x23a)](_0x10669c(0x142));if(_0x4eb2c1[_0x10669c(0x27c)]['length']===0x0){const _0x3fd18f=_0xecec8c[_0x10669c(0x1ab)][_0x10669c(0x29f)],_0x2678be=new Option(_0x3fd18f,_0x3fd18f,!![],!![]);_0x4eb2c1[_0x10669c(0x15d)](_0x2678be);}_0x4eb2c1[_0x10669c(0x27d)]=_0xecec8c['retrieval'][_0x10669c(0x29f)],document[_0x10669c(0x23a)](_0x10669c(0x233))[_0x10669c(0x2ec)]=_0xecec8c[_0x10669c(0x1ab)][_0x10669c(0x19d)],document[_0x10669c(0x23a)](_0x10669c(0x1bd))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x17e)][_0x10669c(0x164)],document[_0x10669c(0x23a)](_0x10669c(0x249))[_0x10669c(0x27d)]=_0xecec8c['advanced'][_0x10669c(0x281)],document[_0x10669c(0x23a)]('hly-match-threshold')[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x17e)][_0x10669c(0x223)],document[_0x10669c(0x23a)](_0x10669c(0x141))[_0x10669c(0x27d)]=_0xecec8c['advanced'][_0x10669c(0x2af)],document[_0x10669c(0x23a)](_0x10669c(0x291))['value']=_0xecec8c[_0x10669c(0x17e)]['maxResults'],document[_0x10669c(0x23a)]('hly-batch-size')['value']=_0xecec8c[_0x10669c(0x1ab)][_0x10669c(0x187)],document['getElementById'](_0x10669c(0x16d))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x2a5)][_0x10669c(0x1a0)];const _0x53e561=document['querySelector'](_0x10669c(0x200)+_0xecec8c[_0x10669c(0x2a5)][_0x10669c(0x1ac)]+'\x22]');_0x53e561&&(_0x53e561[_0x10669c(0x2ec)]=!![]);document[_0x10669c(0x23a)](_0x10669c(0x182))[_0x10669c(0x27d)]=_0xecec8c['injection'][_0x10669c(0x208)],document[_0x10669c(0x23a)](_0x10669c(0x17c))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x2a5)][_0x10669c(0x196)],toggleInjectionDetails(),handleApiModeChange(),document['getElementById']('hly-condensation-enabled')[_0x10669c(0x2ec)]=_0xecec8c[_0x10669c(0x24e)][_0x10669c(0x1c3)],document[_0x10669c(0x23a)](_0x10669c(0x1e3))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x24e)][_0x10669c(0x224)],document[_0x10669c(0x23a)](_0x10669c(0x1fc))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x24e)][_0x10669c(0x1a7)],document['getElementById'](_0x10669c(0x193))[_0x10669c(0x2ec)]=_0xecec8c[_0x10669c(0x24e)]['messageTypes'][_0x10669c(0x264)],document[_0x10669c(0x23a)](_0x10669c(0x1c2))[_0x10669c(0x2ec)]=_0xecec8c[_0x10669c(0x24e)][_0x10669c(0x23d)]['ai'];const _0x4c80b4=document[_0x10669c(0x23a)](_0x10669c(0x143)),_0x55dcbf=document['getElementById'](_0x10669c(0x1a6)),_0x24905=document[_0x10669c(0x23a)](_0x10669c(0x2f7));_0x4c80b4[_0x10669c(0x2ec)]=_0xecec8c[_0x10669c(0x24e)][_0x10669c(0x28b)],_0x55dcbf[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x24e)]['tags'],_0x24905[_0x10669c(0x132)]['display']=_0x4c80b4[_0x10669c(0x2ec)]?_0x10669c(0x222):_0x10669c(0x259),document[_0x10669c(0x23a)](_0x10669c(0x2f5))[_0x10669c(0x2ec)]=_0xecec8c[_0x10669c(0x20e)][_0x10669c(0x1c3)],document['getElementById'](_0x10669c(0x145))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x20e)]['url'],document[_0x10669c(0x23a)](_0x10669c(0x1d6))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x20e)][_0x10669c(0x153)];const _0x434475=document['getElementById'](_0x10669c(0x134));if(_0x434475['options'][_0x10669c(0x262)]===0x0){const _0x72b34f=_0xecec8c[_0x10669c(0x20e)][_0x10669c(0x1b0)];if(_0x72b34f){const _0x4ca76b=new Option(_0x72b34f,_0x72b34f,!![],!![]);_0x434475[_0x10669c(0x15d)](_0x4ca76b);}}_0x434475['value']=_0xecec8c[_0x10669c(0x20e)][_0x10669c(0x1b0)],document['getElementById'](_0x10669c(0x160))[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x20e)]['top_n'],document[_0x10669c(0x23a)]('hly-rerank-hybrid-alpha')[_0x10669c(0x27d)]=_0xecec8c[_0x10669c(0x20e)][_0x10669c(0x241)],document[_0x10669c(0x23a)](_0x10669c(0x2c4))[_0x10669c(0x2ec)]=_0xecec8c['rerank']['notify'];}function saveSettingsFromUI(_0x26902f=!![]){const _0x32859f=_0x1cfca3,_0x339442=document[_0x32859f(0x23a)](_0x32859f(0x12e));if(!_0x339442)return;const _0x2b288c=_0x339442[_0x32859f(0x214)]('[data-setting-key]');_0x2b288c[_0x32859f(0x236)](_0x25bb68=>{const _0x3131a7=_0x32859f,_0x1b7346=_0x25bb68[_0x3131a7(0x2da)][_0x3131a7(0x1d5)];if(!_0x1b7346)return;let _0x426288;const _0xde81b6=_0x25bb68['dataset'][_0x3131a7(0x149)]||_0x3131a7(0x26b);if(_0x25bb68[_0x3131a7(0x149)]==='checkbox')_0x426288=_0x25bb68[_0x3131a7(0x2ec)];else{if(_0x25bb68[_0x3131a7(0x149)]==='radio'){if(!_0x25bb68['checked'])return;_0x426288=_0x25bb68[_0x3131a7(0x27d)];}else _0x426288=_0x25bb68[_0x3131a7(0x27d)];}switch(_0xde81b6){case _0x3131a7(0x1cc):_0x426288=parseInt(_0x426288,0xa);break;case _0x3131a7(0x2f1):_0x426288=parseFloat(_0x426288);break;case _0x3131a7(0x2ea):if(typeof _0x426288!==_0x3131a7(0x2ea))_0x426288=_0x426288===_0x3131a7(0x2fa);break;}const _0x1d6a52=_0x589651[_0x3131a7(0x2dc)](),_0x20a8f2=_0x1b7346[_0x3131a7(0x140)]('.');let _0x649d2c=_0x1d6a52;for(let _0x55671d=0x0;_0x55671d<_0x20a8f2[_0x3131a7(0x262)]-0x1;_0x55671d++){_0x649d2c=_0x649d2c[_0x20a8f2[_0x55671d]]=_0x649d2c[_0x20a8f2[_0x55671d]]||{};}_0x649d2c[_0x20a8f2[_0x20a8f2[_0x3131a7(0x262)]-0x1]]=_0x426288;}),_0x589651[_0x32859f(0x1f4)](),!_0x26902f&&(log(_0x32859f(0x172),_0x32859f(0x1c8)),toastr['success'](_0x32859f(0x122),_0x32859f(0x192)));}function resetSettingsToUI(){const _0x34c589=_0x1cfca3;confirm(_0x34c589(0x1ea))&&(_0x589651[_0x34c589(0x1f0)](),loadSettingsToUI(),toastr[_0x34c589(0x202)](_0x34c589(0x1af),'诏曰'));}async function updatePanelStatus(){const _0xb0f66b=_0x1cfca3,_0x43d846=_0x589651[_0xb0f66b(0x2be)](),_0x4e431c=document[_0xb0f66b(0x23a)](_0xb0f66b(0x2cd)),_0x4d8b31=document['getElementById'](_0xb0f66b(0x2df));if(_0x43d846){const _0x157793=_0x589651[_0xb0f66b(0x166)]();_0x157793&&(_0x4e431c[_0xb0f66b(0x24f)]=_0xb0f66b(0x209),_0x4d8b31[_0xb0f66b(0x24f)]=_0x157793['id'],_0x4d8b31[_0xb0f66b(0x1a4)]=_0xb0f66b(0x204)+_0x157793['id'],_0x4e431c[_0xb0f66b(0x18d)][_0xb0f66b(0x15d)](_0xb0f66b(0x1a9)),_0x4d8b31[_0xb0f66b(0x18d)][_0xb0f66b(0x15d)]('hly-locked-status'));}else _0x4e431c['textContent']=_0x1e2c21[_0xb0f66b(0x26c)](),_0x4d8b31['textContent']=_0x1e2c21[_0xb0f66b(0x2c1)]()||'无',_0x4d8b31[_0xb0f66b(0x1a4)]='',_0x4e431c[_0xb0f66b(0x18d)][_0xb0f66b(0x1b9)](_0xb0f66b(0x1a9)),_0x4d8b31[_0xb0f66b(0x18d)][_0xb0f66b(0x1b9)](_0xb0f66b(0x1a9));const _0x5f0f0d=document[_0xb0f66b(0x23a)]('hly-current-vector-count');_0x5f0f0d[_0xb0f66b(0x24f)]='...';try{const _0x1cb475=await _0x589651['getVectorCount']();_0x5f0f0d[_0xb0f66b(0x24f)]=_0x1cb475;}catch(_0x3624c1){console[_0xb0f66b(0x1f3)]('[翰林院-枢纽]\x20更新忆识数量失败:',_0x3624c1),_0x5f0f0d[_0xb0f66b(0x24f)]=_0xb0f66b(0x194),_0x5f0f0d[_0xb0f66b(0x1a4)]=_0xb0f66b(0x2c2)+_0x3624c1[_0xb0f66b(0x12d)];}const _0x3ed7eb=document[_0xb0f66b(0x23a)](_0xb0f66b(0x2e4));if(_0x3ed7eb&&!_0x3ed7eb[_0xb0f66b(0x2da)]['finalText']){const _0x3f8fd9=_0x589651['getSettings'](),_0x56e56a=await _0x589651[_0xb0f66b(0x288)]();if(_0x3f8fd9['condensationHistory']&&_0x3f8fd9[_0xb0f66b(0x13b)][_0x56e56a]){const _0x36db0f=_0x3f8fd9[_0xb0f66b(0x13b)][_0x56e56a];_0x3ed7eb[_0xb0f66b(0x235)]='
上次已从第\x20'+_0x36db0f[_0xb0f66b(0x1f5)]+_0xb0f66b(0x1dc)+_0x36db0f[_0xb0f66b(0x184)]+'\x20楼。
';}else _0x3ed7eb[_0xb0f66b(0x235)]=_0xb0f66b(0x1fe);}renderKnowledgeBases();}async function moveAllKnowledgeBases(_0x194588){const _0x44590f=_0x1cfca3,_0x1a975e=_0x194588===_0x44590f(0x211),_0x2e3fee=_0x1a975e?_0x44590f(0x14a):_0x44590f(0x253),_0x350070=_0x1a975e?'局部':'全局',_0x51ba02=_0x1a975e?_0x589651[_0x44590f(0x1e6)]():_0x589651[_0x44590f(0x2aa)](),_0x2bcdef=Object['keys'](_0x51ba02);if(_0x2bcdef[_0x44590f(0x262)]===0x0){toastr[_0x44590f(0x202)]('源区域('+(_0x1a975e?'全局':'局部')+_0x44590f(0x1fa),'圣谕');return;}if(!confirm(_0x44590f(0x131)+_0x2bcdef['length']+'\x20个知识库从【'+(_0x1a975e?'全局':'局部')+_0x44590f(0x24a)+_0x350070+_0x44590f(0x210)))return;log(_0x44590f(0x2db)+_0x2bcdef[_0x44590f(0x262)]+'\x20个知识库从\x20'+_0x2e3fee+'\x20移动到\x20'+(_0x1a975e?'local':_0x44590f(0x14a))+_0x44590f(0x287),_0x44590f(0x202));const _0x53bef5=_0x2bcdef[_0x44590f(0x185)](_0x12f590=>_0x589651[_0x44590f(0x14b)](_0x12f590,_0x2e3fee));try{await Promise[_0x44590f(0x2a2)](_0x53bef5),toastr[_0x44590f(0x1c8)](_0x44590f(0x278)+_0x2bcdef[_0x44590f(0x262)]+_0x44590f(0x21b),'大功告成'),log(_0x44590f(0x265),_0x44590f(0x1c8));}catch(_0x3ccf12){toastr['error']('批量移动过程中发生错误:\x20'+_0x3ccf12[_0x44590f(0x12d)],'警报'),log(_0x44590f(0x2c5)+_0x3ccf12[_0x44590f(0x12d)],_0x44590f(0x1f3));}finally{await updatePanelStatus();}}async function deleteAllLocalKnowledgeBases(){const _0x477c36=_0x1cfca3,_0x267832=_0x589651[_0x477c36(0x2aa)](),_0x3e915c=Object[_0x477c36(0x2f8)](_0x267832);if(_0x3e915c[_0x477c36(0x262)]===0x0){toastr[_0x477c36(0x202)](_0x477c36(0x179),'圣谕');return;}if(!confirm(_0x477c36(0x207)+_0x3e915c[_0x477c36(0x262)]+'\x20个局部知识库吗?此操作无法恢复!'))return;toastr[_0x477c36(0x202)]('正在删除\x20'+_0x3e915c[_0x477c36(0x262)]+'\x20个局部知识库...','圣旨'),log(_0x477c36(0x239)+_0x3e915c[_0x477c36(0x262)]+_0x477c36(0x275),_0x477c36(0x13e));let _0x127d2b=0x0,_0x1b732d=0x0;for(const _0x431c5a of _0x3e915c){try{await _0x589651[_0x477c36(0x1f9)](_0x431c5a,_0x477c36(0x253)),_0x127d2b++;}catch(_0x4d7fc2){_0x1b732d++,log(_0x477c36(0x258)+_0x431c5a+_0x477c36(0x2c6)+_0x4d7fc2['message'],_0x477c36(0x1f3));}}_0x1b732d>0x0?toastr[_0x477c36(0x1f3)]('操作完成,但有\x20'+_0x1b732d+_0x477c36(0x16b),'警报'):toastr[_0x477c36(0x1c8)](_0x477c36(0x278)+_0x127d2b+'\x20个局部知识库均已成功删除。','大功告成'),log(_0x477c36(0x284)+_0x127d2b+_0x477c36(0x22f)+_0x1b732d,_0x477c36(0x202)),await updatePanelStatus();}async function renderKnowledgeBases(){const _0x4518f7=_0x1cfca3,_0x3074aa=document[_0x4518f7(0x23a)](_0x4518f7(0x246)),_0x47f7c3=document[_0x4518f7(0x23a)](_0x4518f7(0x2ca)),_0x2b244c=document[_0x4518f7(0x23a)](_0x4518f7(0x2ad));if(!_0x3074aa||!_0x47f7c3||!_0x2b244c)return;_0x2b244c[_0x4518f7(0x24f)]=_0x1e2c21[_0x4518f7(0x26c)]()||_0x4518f7(0x29d);try{const _0x3c70e1=_0x589651[_0x4518f7(0x2aa)](),_0x3b0225=_0x589651[_0x4518f7(0x1e6)]();await _renderKbList(_0x3c70e1,_0x3074aa,_0x4518f7(0x253),_0x4518f7(0x148)),await _renderKbList(_0x3b0225,_0x47f7c3,_0x4518f7(0x14a),_0x4518f7(0x243));}catch(_0x23342f){console[_0x4518f7(0x1f3)]('[翰林院-枢纽]\x20渲染知识库列表失败:',_0x23342f),_0x3074aa['innerHTML']='加载失败:\x20'+_0x23342f[_0x4518f7(0x12d)]+_0x4518f7(0x1b4),_0x47f7c3['innerHTML']=_0x4518f7(0x128)+_0x23342f[_0x4518f7(0x12d)]+_0x4518f7(0x1b4);}}async function _renderKbList(_0x5adc0c,_0x4f7eb5,_0x327fb4,_0x1ceb8e){const _0x1deab1=_0x1cfca3,_0x804198=document[_0x1deab1(0x23a)](_0x1ceb8e);_0x4f7eb5[_0x1deab1(0x235)]='',_0x4f7eb5['appendChild'](_0x804198);if(Object[_0x1deab1(0x2f8)](_0x5adc0c)[_0x1deab1(0x262)]===0x0){_0x804198[_0x1deab1(0x132)][_0x1deab1(0x28e)]='block';return;}_0x804198[_0x1deab1(0x132)][_0x1deab1(0x28e)]=_0x1deab1(0x259);for(const [_0x236e1b,_0x1dd398]of Object['entries'](_0x5adc0c)){const _0x2ba54c=document[_0x1deab1(0x225)](_0x1deab1(0x212));_0x2ba54c['className']=_0x1deab1(0x1a3),_0x2ba54c[_0x1deab1(0x2da)]['kbId']=_0x236e1b,_0x2ba54c[_0x1deab1(0x2da)][_0x1deab1(0x151)]=_0x327fb4;const _0x586150=await _0x589651['getVectorCount'](_0x236e1b,_0x327fb4),_0x1b55e7=_0x327fb4==='local'?'':_0x1deab1(0x293);_0x2ba54c[_0x1deab1(0x235)]=_0x1deab1(0x270)+_0x236e1b+'\x22>'+_0x1dd398['name']+'\x20('+_0x586150+_0x1deab1(0x277)+_0x1b55e7+_0x1deab1(0x250)+(_0x1dd398[_0x1deab1(0x1c3)]?'checked':'')+_0x1deab1(0x2b5),_0x4f7eb5[_0x1deab1(0x13f)](_0x2ba54c);}}async function handleKbAction(_0x520cc6){const _0x123a2c=_0x1cfca3,_0xa35950=_0x520cc6[_0x123a2c(0x1ed)],_0x189b73=_0xa35950[_0x123a2c(0x177)]('.hly-kb-list-item');if(!_0x189b73)return;const _0x3b86b2=_0x189b73['dataset'][_0x123a2c(0x295)],_0x11c0cb=_0x189b73[_0x123a2c(0x2da)]['kbScope'],_0x139295=_0x189b73[_0x123a2c(0x198)](_0x123a2c(0x16e))['textContent'][_0x123a2c(0x140)]('\x20(')[0x0];if(_0xa35950['classList'][_0x123a2c(0x19e)](_0x123a2c(0x2d0))){if(confirm(_0x123a2c(0x285)+_0x139295+_0x123a2c(0x290)))try{await _0x589651['removeKnowledgeBase'](_0x3b86b2,_0x11c0cb),log(_0x123a2c(0x237)+_0x139295+_0x123a2c(0x1c5)+_0x3b86b2+')\x20已被删除',_0x123a2c(0x1c8)),toastr[_0x123a2c(0x1c8)](_0x123a2c(0x146)+_0x139295+'】已删除。'),await updatePanelStatus();}catch(_0x508d8f){log('删除知识库\x20'+_0x139295+_0x123a2c(0x2c6)+_0x508d8f[_0x123a2c(0x12d)],_0x123a2c(0x1f3)),toastr['error']('删除失败:\x20'+_0x508d8f[_0x123a2c(0x12d)]);}}if(_0xa35950['closest'](_0x123a2c(0x170))){const _0x9ca293=_0x11c0cb===_0x123a2c(0x253)?'全局':'局部';if(confirm('您确定要将知识库【'+_0x139295+_0x123a2c(0x24a)+_0x9ca293+'】吗?'))try{await _0x589651[_0x123a2c(0x14b)](_0x3b86b2,_0x11c0cb),await updatePanelStatus();}catch(_0x39fd9c){log('移动知识库\x20'+_0x139295+'\x20失败:\x20'+_0x39fd9c[_0x123a2c(0x12d)],'error'),toastr[_0x123a2c(0x1f3)](_0x123a2c(0x255)+_0x39fd9c[_0x123a2c(0x12d)]);}}if(_0xa35950[_0x123a2c(0x18d)][_0x123a2c(0x19e)](_0x123a2c(0x1b7))&&_0x520cc6[_0x123a2c(0x149)]===_0x123a2c(0x263))try{await _0x589651[_0x123a2c(0x22e)](_0x3b86b2,_0x11c0cb),log(_0x123a2c(0x237)+_0x139295+_0x123a2c(0x2b1),'success'),await updatePanelStatus();}catch(_0x42a6ae){log(_0x123a2c(0x190)+_0x139295+'\x20状态失败:\x20'+_0x42a6ae[_0x123a2c(0x12d)],'error'),toastr[_0x123a2c(0x1f3)](_0x123a2c(0x1d3)+_0x42a6ae['message']);}}async function testApi(){const _0x4c55d9=_0x1cfca3;toastr[_0x4c55d9(0x202)](_0x4c55d9(0x161),'圣旨');try{await _0x589651[_0x4c55d9(0x15c)](),toastr[_0x4c55d9(0x1c8)](_0x4c55d9(0x240),'圣意');}catch(_0x2d4423){toastr[_0x4c55d9(0x1f3)](_0x4c55d9(0x2c0)+_0x2d4423[_0x4c55d9(0x12d)],'警报');}}async function fetchHLYEmbeddingModels(){const _0x40b4d5=_0x1cfca3,_0x55f100=document[_0x40b4d5(0x23a)](_0x40b4d5(0x142)),_0x376b08=_0x55f100['value'];_0x55f100[_0x40b4d5(0x235)]='',_0x55f100[_0x40b4d5(0x2bf)]=!![];try{log(_0x40b4d5(0x213),_0x40b4d5(0x202));const _0x18cac0=await _0x589651[_0x40b4d5(0x219)]();_0x55f100['innerHTML']='';if(_0x18cac0[_0x40b4d5(0x262)]===0x0){_0x55f100[_0x40b4d5(0x235)]=_0x40b4d5(0x1e4),toastr[_0x40b4d5(0x13e)]('未能获取到任何模型。',_0x40b4d5(0x2e0)),log(_0x40b4d5(0x1d4),_0x40b4d5(0x13e));return;}_0x18cac0['forEach'](_0x4dcfe8=>{const _0x3ee7b3=_0x40b4d5,_0x46a20e=new Option(_0x4dcfe8,_0x4dcfe8);_0x55f100[_0x3ee7b3(0x15d)](_0x46a20e);}),_0x18cac0[_0x40b4d5(0x1bf)](_0x376b08)?_0x55f100[_0x40b4d5(0x27d)]=_0x376b08:_0x55f100[_0x40b4d5(0x13c)]=0x0,toastr[_0x40b4d5(0x1c8)]('成功获取\x20'+_0x18cac0[_0x40b4d5(0x262)]+_0x40b4d5(0x189),'圣意'),log(_0x40b4d5(0x147)+_0x18cac0[_0x40b4d5(0x262)]+_0x40b4d5(0x189),_0x40b4d5(0x1c8));}catch(_0x5c2ccd){console[_0x40b4d5(0x1f3)](_0x40b4d5(0x156),_0x5c2ccd),toastr[_0x40b4d5(0x1f3)](_0x40b4d5(0x126)+_0x5c2ccd[_0x40b4d5(0x12d)],_0x40b4d5(0x129)),log(_0x40b4d5(0x126)+_0x5c2ccd['message'],_0x40b4d5(0x1f3)),_0x55f100['innerHTML']=_0x40b4d5(0x19a);}finally{_0x55f100[_0x40b4d5(0x2bf)]=![];}}async function fetchHLYRerankModels(){const _0x591edd=_0x1cfca3,_0x344a60=document[_0x591edd(0x23a)](_0x591edd(0x134)),_0x126f79=_0x344a60[_0x591edd(0x27d)];_0x344a60[_0x591edd(0x235)]=_0x591edd(0x216),_0x344a60[_0x591edd(0x2bf)]=!![];try{log('开始获取Rerank模型列表...',_0x591edd(0x202));const _0x5af42b=await _0x589651[_0x591edd(0x23b)]();_0x344a60[_0x591edd(0x235)]='';if(_0x5af42b[_0x591edd(0x262)]===0x0){_0x344a60[_0x591edd(0x235)]=_0x591edd(0x1e4),toastr[_0x591edd(0x13e)]('未能获取到任何Rerank模型。',_0x591edd(0x2e0)),log(_0x591edd(0x2e6),'warn');return;}_0x5af42b[_0x591edd(0x236)](_0x4dfe83=>{const _0x52683c=_0x591edd,_0x45da6f=new Option(_0x4dfe83,_0x4dfe83);_0x344a60[_0x52683c(0x15d)](_0x45da6f);}),_0x5af42b['includes'](_0x126f79)?_0x344a60['value']=_0x126f79:_0x344a60[_0x591edd(0x13c)]=0x0,toastr[_0x591edd(0x1c8)](_0x591edd(0x147)+_0x5af42b['length']+_0x591edd(0x2d1),'圣意'),log(_0x591edd(0x147)+_0x5af42b[_0x591edd(0x262)]+_0x591edd(0x2d1),'success');}catch(_0x8b1089){console[_0x591edd(0x1f3)](_0x591edd(0x2f9),_0x8b1089),toastr['error']('获取Rerank模型失败:\x20'+_0x8b1089[_0x591edd(0x12d)],_0x591edd(0x129)),log(_0x591edd(0x24c)+_0x8b1089[_0x591edd(0x12d)],'error'),_0x344a60[_0x591edd(0x235)]='';}finally{_0x344a60[_0x591edd(0x2bf)]=![];}}async function purgeStorage(){const _0x1250f8=_0x1cfca3;if(confirm(_0x1250f8(0x173))){toastr[_0x1250f8(0x202)](_0x1250f8(0x169),'圣旨');const _0x35d1cf=await _0x589651['purgeStorage']();_0x35d1cf?toastr['success'](_0x1250f8(0x1c9),'圣意'):toastr[_0x1250f8(0x1f3)]('清空宝库失败。','警报'),await updatePanelStatus();}}async function startCondensation(){const _0x3fd563=_0x1cfca3,_0x4fe47c=document[_0x3fd563(0x23a)]('hly-condensation-results'),_0x565ecf=_0x4fe47c[_0x3fd563(0x2da)][_0x3fd563(0x1f8)],_0x5d24d3=document[_0x3fd563(0x23a)](_0x3fd563(0x1e3))[_0x3fd563(0x27d)],_0x5aaa80=document[_0x3fd563(0x23a)](_0x3fd563(0x1fc))['value'],_0xce2a04={'start':parseInt(_0x5d24d3),'end':parseInt(_0x5aaa80)};try{let _0x386b18;_0x565ecf?(log(_0x3fd563(0x1da),_0x3fd563(0x202)),toastr[_0x3fd563(0x202)](_0x3fd563(0x261),'圣旨'),_0x386b18=JSON[_0x3fd563(0x2d2)](_0x565ecf),delete _0x4fe47c['dataset'][_0x3fd563(0x1f8)]):(log(_0x3fd563(0x276),_0x3fd563(0x202)),toastr[_0x3fd563(0x202)]('正在准备凝识...','圣旨'),_0x386b18=_0x589651['getMessagesForCondensation']());if(!_0x386b18||_0x386b18['length']===0x0){toastr[_0x3fd563(0x17f)]('未找到符合条件的消息可供凝识。',_0x3fd563(0x2e0)),_0x4fe47c[_0x3fd563(0x24f)]=_0x3fd563(0x25b);return;}_0x4fe47c[_0x3fd563(0x24f)]=_0x3fd563(0x29b)+_0x386b18[_0x3fd563(0x262)]+_0x3fd563(0x271),toastr[_0x3fd563(0x202)](_0x3fd563(0x29b)+_0x386b18[_0x3fd563(0x262)]+_0x3fd563(0x271),_0x3fd563(0x2e0));const _0x139c00=await _0x589651['processCondensation'](_0x386b18,log,_0xce2a04);if(_0x139c00[_0x3fd563(0x1c8)]){toastr[_0x3fd563(0x1c8)](_0x3fd563(0x2d7)+_0x139c00[_0x3fd563(0x1de)]+_0x3fd563(0x1df),_0x3fd563(0x2f2));const _0x3b3dcf=_0xce2a04[_0x3fd563(0x184)]===0x0?getContext()[_0x3fd563(0x226)][_0x3fd563(0x262)]:_0xce2a04[_0x3fd563(0x184)];_0x4fe47c[_0x3fd563(0x24f)]=_0x3fd563(0x13d)+_0xce2a04[_0x3fd563(0x1f5)]+_0x3fd563(0x24d)+_0x3b3dcf+_0x3fd563(0x191)+_0x139c00[_0x3fd563(0x1de)]+'\x20条忆识。';}else throw new Error(_0x139c00[_0x3fd563(0x1f3)]||_0x3fd563(0x28d));}catch(_0x4374f1){console['error'](_0x3fd563(0x127),_0x4374f1),toastr[_0x3fd563(0x1f3)](_0x3fd563(0x2e5)+_0x4374f1[_0x3fd563(0x12d)],_0x3fd563(0x129)),_0x4fe47c[_0x3fd563(0x24f)]=_0x3fd563(0x2e5)+_0x4374f1[_0x3fd563(0x12d)];}finally{await updatePanelStatus();}}async function loadWorldbookList(){const _0x5069fd=_0x1cfca3,_0x451d3d=document[_0x5069fd(0x23a)]('hly-hist-select-library');if(!_0x451d3d)return;try{log('正在获取可用书库列表...',_0x5069fd(0x202));const _0x5d2273=await _0x3b2ead[_0x5069fd(0x178)]();_0x451d3d[_0x5069fd(0x235)]=_0x5069fd(0x244);if(_0x5d2273[_0x5069fd(0x262)]===0x0){_0x451d3d[_0x5069fd(0x235)]='';return;}_0x5d2273[_0x5069fd(0x236)](_0x3ed5a5=>{const _0x23760b=new Option(_0x3ed5a5,_0x3ed5a5);_0x451d3d['add'](_0x23760b);}),log(_0x5069fd(0x2a4)+_0x5d2273[_0x5069fd(0x262)]+_0x5069fd(0x2cc),_0x5069fd(0x1c8));}catch(_0x5f01d2){console['error'](_0x5069fd(0x2ee),_0x5f01d2),log(_0x5069fd(0x2de)+_0x5f01d2[_0x5069fd(0x12d)],'error'),_0x451d3d[_0x5069fd(0x235)]=_0x5069fd(0x1f2);}}async function handleWorldbookSelectionChange(){const _0x19ac71=_0x1cfca3,_0x33d84f=document[_0x19ac71(0x23a)]('hly-hist-select-library'),_0x1aeb94=document[_0x19ac71(0x23a)]('hly-hist-entry-multiselect-btn'),_0x295f7d=document[_0x19ac71(0x23a)](_0x19ac71(0x28f)),_0x1c3668=_0x33d84f['value'];_0x1aeb94[_0x19ac71(0x2bf)]=!![],_0x1aeb94['querySelector']('span')[_0x19ac71(0x24f)]='正在加载条目...',_0x295f7d[_0x19ac71(0x235)]='',_0x295f7d['style'][_0x19ac71(0x28e)]=_0x19ac71(0x259);if(!_0x1c3668){_0x1aeb94[_0x19ac71(0x198)](_0x19ac71(0x22a))[_0x19ac71(0x24f)]=_0x19ac71(0x137);return;}try{log(_0x19ac71(0x25a)+_0x1c3668+_0x19ac71(0x1c7),'info');const _0xaa901d=await _0x3b2ead[_0x19ac71(0x13a)](_0x1c3668);if(_0xaa901d[_0x19ac71(0x262)]===0x0){_0x1aeb94['querySelector'](_0x19ac71(0x22a))[_0x19ac71(0x24f)]=_0x19ac71(0x1d8);return;}const _0x25d78e='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20';_0x295f7d[_0x19ac71(0x274)]('beforeend',_0x25d78e),_0xaa901d['forEach'](_0x5d2ade=>{const _0x1a64b8=_0x19ac71,_0x4e771c='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','stringify','加载条目失败:\x20','total','fetchRerankModels','聊天记录从第\x20','正在准备凝识...','手动录入','classList','input[name=\x22hly-injection-position\x22][value=\x22','hanlinyuan-ingest-novel-start','【手动存档】所有设定已存档封印。','resetHLYSettings','settingKey','删除知识库\x20','globalToLocal','圣旨已达','本地代理地址:','自定义路径:','template','查看宝库状态成功:集合ID=',',\x20失败:\x20','toggleSessionLock','','error','[翰林院-枢纽]\x20获取Rerank模型列表失败:','files','请先选择一个书库并至少选择一个要编纂的条目。','预览失败:\x20','hly-tag-input-container','appendChild','】吗?此操作无法恢复!','fa-times-circle','removeEventListener','previewHLYCondensation','trim','\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20未找到匹配的书库','\x0a--------------------\x0aAPI端点:\x20','已选择\x200\x20/\x20','includes','push','[断点续传]\x20用户选择放弃旧任务\x20','成功录入\x20','请先选择一个\x20.txt\x20文件','input[name=\x22hly-injection-position\x22]','会话已解锁。','hly-rerank-hybrid-alpha','hly-tag-input','hly-rerank-url','正在读取文件...','移动失败:\x20','log-warn','is-user','删除失败:\x20','input',',从第\x20','hly-kb-list-local-placeholder','','is_user','hly-custom-endpoint-docket','fetchHLYRerankModels','3275708GbIsru','\x22\x20placeholder=\x22开始字符,\x20如\x20\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
加载失败:\x20'+_0x3bb671['message']+_0x22b3ae(0x1f7),_0x507363[_0x22b3ae(0x192)]='
加载失败:\x20'+_0x3bb671['message']+_0x22b3ae(0x1f7);}}async function _renderKbList(_0x3f994e,_0x336d17,_0x1b555e,_0x59e9c7){const _0x13229d=_0x54d868,_0x390c08=document[_0x13229d(0x161)](_0x59e9c7);_0x336d17[_0x13229d(0x192)]='',_0x336d17['appendChild'](_0x390c08);if(Object[_0x13229d(0x1a5)](_0x3f994e)[_0x13229d(0x1a6)]===0x0){_0x390c08[_0x13229d(0xd7)]['display']='block';return;}_0x390c08[_0x13229d(0xd7)][_0x13229d(0x19c)]=_0x13229d(0x1f2);for(const [_0x317fd4,_0xac050a]of Object[_0x13229d(0xe4)](_0x3f994e)){const _0x31b244=document[_0x13229d(0x225)]('div');_0x31b244[_0x13229d(0x10c)]=_0x13229d(0xe0),_0x31b244[_0x13229d(0x27b)][_0x13229d(0x112)]=_0x317fd4,_0x31b244[_0x13229d(0x27b)][_0x13229d(0x1e2)]=_0x1b555e;const _0x2d926e=await _0x200707[_0x13229d(0xf7)](_0x317fd4,_0x1b555e),_0x32f6dc=_0x1b555e===_0x13229d(0xc9)?_0x13229d(0x151):_0x13229d(0x1be);_0x31b244[_0x13229d(0x192)]=_0x13229d(0x201)+_0x317fd4+'\x22>'+_0xac050a['name']+'\x20('+_0x2d926e+_0x13229d(0x116)+_0x32f6dc+_0x13229d(0x168)+(_0xac050a[_0x13229d(0x105)]?_0x13229d(0x14b):'')+_0x13229d(0x193),_0x336d17['appendChild'](_0x31b244);}}async function handleKbAction(_0x2ecd3e){const _0x3be1ad=_0x54d868,_0x13add1=_0x2ecd3e['target'],_0x1dc724=_0x13add1[_0x3be1ad(0x17b)]('.hly-kb-list-item');if(!_0x1dc724)return;const _0x36d91b=_0x1dc724[_0x3be1ad(0x27b)]['kbId'],_0xbfa003=_0x1dc724['dataset'][_0x3be1ad(0x1e2)],_0xc1e59a=_0x1dc724['querySelector']('.hly-kb-name')[_0x3be1ad(0x217)][_0x3be1ad(0x118)]('\x20(')[0x0];if(_0x13add1['classList'][_0x3be1ad(0xc8)](_0x3be1ad(0x229))){if(confirm('您确定要永久删除知识库【'+_0xc1e59a+_0x3be1ad(0x24d)))try{await _0x200707[_0x3be1ad(0x16d)](_0x36d91b,_0xbfa003),log(_0x3be1ad(0x221)+_0xc1e59a+_0x3be1ad(0x25a)+_0x36d91b+_0x3be1ad(0x141),'success'),toastr[_0x3be1ad(0x15b)](_0x3be1ad(0x19a)+_0xc1e59a+_0x3be1ad(0x1f1)),await updatePanelStatus();}catch(_0x3e0c35){log(_0x3be1ad(0x23c)+_0xc1e59a+_0x3be1ad(0x14a)+_0x3e0c35['message'],_0x3be1ad(0x246)),toastr['error'](_0x3be1ad(0x26e)+_0x3e0c35['message']);}}if(_0x13add1[_0x3be1ad(0x17b)](_0x3be1ad(0xc0))){const _0x177c7c=_0xbfa003===_0x3be1ad(0xc9)?'全局':'局部';if(confirm(_0x3be1ad(0xe7)+_0xc1e59a+_0x3be1ad(0x14c)+_0x177c7c+'】吗?'))try{await _0x200707[_0x3be1ad(0xe9)](_0x36d91b,_0xbfa003),await updatePanelStatus();}catch(_0x42c00b){log(_0x3be1ad(0x164)+_0xc1e59a+_0x3be1ad(0x14a)+_0x42c00b[_0x3be1ad(0x183)],_0x3be1ad(0x246)),toastr[_0x3be1ad(0x246)](_0x3be1ad(0x26b)+_0x42c00b[_0x3be1ad(0x183)]);}}if(_0x13add1['classList']['contains']('hly-kb-toggle')&&_0x2ecd3e[_0x3be1ad(0x20e)]===_0x3be1ad(0x1ac))try{await _0x200707['toggleKnowledgeBase'](_0x36d91b,_0xbfa003),log(_0x3be1ad(0x221)+_0xc1e59a+'\x20的状态已切换',_0x3be1ad(0x15b)),await updatePanelStatus();}catch(_0x156fd){log(_0x3be1ad(0xd1)+_0xc1e59a+_0x3be1ad(0xde)+_0x156fd[_0x3be1ad(0x183)],_0x3be1ad(0x246)),toastr[_0x3be1ad(0x246)]('切换状态失败:\x20'+_0x156fd[_0x3be1ad(0x183)]);}}async function testApi(){const _0x1940d2=_0x54d868;toastr[_0x1940d2(0xe3)](_0x1940d2(0x1af),'圣旨');try{await _0x200707[_0x1940d2(0x13b)](),toastr[_0x1940d2(0x15b)](_0x1940d2(0x114),'圣意');}catch(_0x141da2){toastr[_0x1940d2(0x246)](_0x1940d2(0x1f0)+_0x141da2['message'],'警报');}}async function fetchHLYEmbeddingModels(){const _0x24c162=_0x54d868,_0x4f7796=document[_0x24c162(0x161)](_0x24c162(0x27e)),_0x4ae1f5=_0x4f7796[_0x24c162(0x1fb)];_0x4f7796['innerHTML']='',_0x4f7796[_0x24c162(0xfb)]=!![];try{log(_0x24c162(0xf0),_0x24c162(0xe3));const _0x311c45=await _0x200707[_0x24c162(0x19d)]();_0x4f7796['innerHTML']='';if(_0x311c45[_0x24c162(0x1a6)]===0x0){_0x4f7796[_0x24c162(0x192)]=_0x24c162(0x272),toastr[_0x24c162(0x1d3)](_0x24c162(0x1b7),_0x24c162(0x12b)),log(_0x24c162(0x1b7),'warn');return;}_0x311c45[_0x24c162(0x1d6)](_0x18b7bd=>{const _0x57c471=new Option(_0x18b7bd,_0x18b7bd);_0x4f7796['add'](_0x57c471);}),_0x311c45[_0x24c162(0x260)](_0x4ae1f5)?_0x4f7796[_0x24c162(0x1fb)]=_0x4ae1f5:_0x4f7796[_0x24c162(0x1c0)]=0x0,toastr[_0x24c162(0x15b)]('成功获取\x20'+_0x311c45[_0x24c162(0x1a6)]+_0x24c162(0x1b6),'圣意'),log(_0x24c162(0x1ca)+_0x311c45[_0x24c162(0x1a6)]+_0x24c162(0x1b6),_0x24c162(0x15b));}catch(_0x5500f4){console[_0x24c162(0x246)](_0x24c162(0x21a),_0x5500f4),toastr[_0x24c162(0x246)](_0x24c162(0xc6)+_0x5500f4['message'],'严重错误'),log(_0x24c162(0xc6)+_0x5500f4['message'],_0x24c162(0x246)),_0x4f7796[_0x24c162(0x192)]=_0x24c162(0x1e0);}finally{_0x4f7796[_0x24c162(0xfb)]=![];}}async function fetchHLYRerankModels(){const _0x67c46a=_0x54d868,_0x36e713=document[_0x67c46a(0x161)](_0x67c46a(0x199)),_0xbba273=_0x36e713[_0x67c46a(0x1fb)];_0x36e713[_0x67c46a(0x192)]=_0x67c46a(0x245),_0x36e713['disabled']=!![];try{log(_0x67c46a(0xda),'info');const _0x457c03=await _0x200707[_0x67c46a(0x232)]();_0x36e713[_0x67c46a(0x192)]='';if(_0x457c03['length']===0x0){_0x36e713['innerHTML']=_0x67c46a(0x272),toastr[_0x67c46a(0x1d3)](_0x67c46a(0x11f),_0x67c46a(0x12b)),log(_0x67c46a(0x11f),_0x67c46a(0x1d3));return;}_0x457c03[_0x67c46a(0x1d6)](_0x137eb6=>{const _0x40629c=new Option(_0x137eb6,_0x137eb6);_0x36e713['add'](_0x40629c);}),_0x457c03['includes'](_0xbba273)?_0x36e713['value']=_0xbba273:_0x36e713['selectedIndex']=0x0,toastr[_0x67c46a(0x15b)]('成功获取\x20'+_0x457c03['length']+_0x67c46a(0xd0),'圣意'),log(_0x67c46a(0x1ca)+_0x457c03[_0x67c46a(0x1a6)]+_0x67c46a(0xd0),'success');}catch(_0x548c3f){console['error'](_0x67c46a(0x247),_0x548c3f),toastr[_0x67c46a(0x246)](_0x67c46a(0x1ff)+_0x548c3f[_0x67c46a(0x183)],_0x67c46a(0x108)),log(_0x67c46a(0x1ff)+_0x548c3f[_0x67c46a(0x183)],_0x67c46a(0x246)),_0x36e713[_0x67c46a(0x192)]=_0x67c46a(0x1e0);}finally{_0x36e713['disabled']=![];}}async function purgeStorage(){const _0x565ae8=_0x54d868;if(confirm('此操作将彻底清空当前角色的所有忆识(向量),且无法恢复。您确定要继续吗?')){toastr[_0x565ae8(0xe3)](_0x565ae8(0x1e9),'圣旨');const _0x4c867d=await _0x200707[_0x565ae8(0x253)]();_0x4c867d?toastr[_0x565ae8(0x15b)](_0x565ae8(0x16e),'圣意'):toastr[_0x565ae8(0x246)](_0x565ae8(0x137),'警报'),await updatePanelStatus();}}async function startCondensation(){const _0x2c77d7=_0x54d868,_0x1e39fe=document[_0x2c77d7(0x161)](_0x2c77d7(0x1a8)),_0x2b01cc=_0x1e39fe['dataset'][_0x2c77d7(0xfd)],_0x15a907=document['getElementById'](_0x2c77d7(0x1a2))[_0x2c77d7(0x1fb)],_0x4c34fe=document[_0x2c77d7(0x161)](_0x2c77d7(0x15e))[_0x2c77d7(0x1fb)],_0x5b1541={'start':parseInt(_0x15a907),'end':parseInt(_0x4c34fe)};try{let _0x3999c9;_0x2b01cc?(log(_0x2c77d7(0xfa),'info'),toastr[_0x2c77d7(0xe3)]('正在处理您确认后的文书...','圣旨'),_0x3999c9=JSON[_0x2c77d7(0x278)](_0x2b01cc),delete _0x1e39fe['dataset'][_0x2c77d7(0xfd)]):(log(_0x2c77d7(0x106),_0x2c77d7(0xe3)),toastr[_0x2c77d7(0xe3)](_0x2c77d7(0x234),'圣旨'),_0x3999c9=_0x200707['getMessagesForCondensation']());if(!_0x3999c9||_0x3999c9['length']===0x0){toastr[_0x2c77d7(0x12a)](_0x2c77d7(0x16a),_0x2c77d7(0x12b)),_0x1e39fe[_0x2c77d7(0x217)]=_0x2c77d7(0x203);return;}_0x1e39fe[_0x2c77d7(0x217)]=_0x2c77d7(0x226)+_0x3999c9[_0x2c77d7(0x1a6)]+_0x2c77d7(0x15a),toastr['info'](_0x2c77d7(0x226)+_0x3999c9['length']+_0x2c77d7(0x15a),_0x2c77d7(0x12b));const _0x473ca0=await _0x200707['processCondensation'](_0x3999c9,log,_0x5b1541);if(_0x473ca0['success']){toastr['success'](_0x2c77d7(0xfc)+_0x473ca0[_0x2c77d7(0x20b)]+'\x20条忆识。','大功告成');const _0x4fabfa=_0x5b1541['end']===0x0?getContext()[_0x2c77d7(0x219)][_0x2c77d7(0x1a6)]:_0x5b1541[_0x2c77d7(0x163)];_0x1e39fe[_0x2c77d7(0x217)]=_0x2c77d7(0x233)+_0x5b1541['start']+_0x2c77d7(0xf6)+_0x4fabfa+_0x2c77d7(0xd5)+_0x473ca0[_0x2c77d7(0x20b)]+_0x2c77d7(0xd9);}else throw new Error(_0x473ca0[_0x2c77d7(0x246)]||_0x2c77d7(0x172));}catch(_0x5d321b){console[_0x2c77d7(0x246)](_0x2c77d7(0x211),_0x5d321b),toastr[_0x2c77d7(0x246)](_0x2c77d7(0x1aa)+_0x5d321b['message'],_0x2c77d7(0x108)),_0x1e39fe[_0x2c77d7(0x217)]=_0x2c77d7(0x1aa)+_0x5d321b[_0x2c77d7(0x183)];}finally{await updatePanelStatus();}}function _0x4087(_0x6fd71c,_0x53bcaa){const _0x2bc0f4=_0x2bc0();return _0x4087=function(_0x40870d,_0x30f75f){_0x40870d=_0x40870d-0xb8;let _0x7b323d=_0x2bc0f4[_0x40870d];return _0x7b323d;},_0x4087(_0x6fd71c,_0x53bcaa);}async function loadWorldbookList(){const _0x14fead=_0x54d868,_0x3eb590=document['getElementById'](_0x14fead(0x158)),_0x4ebc0b=document[_0x14fead(0x161)]('hly-worldbook-search');if(!_0x3eb590)return;try{log(_0x14fead(0x1bf),_0x14fead(0xe3));const _0x44ab59=await _0x181516['getAvailableWorldbooks']();window[_0x14fead(0xc7)]=_0x44ab59,updateWorldbookOptions(_0x3eb590,'',_0x44ab59);if(_0x4ebc0b){const _0x1bb109=debounce(_0x2b1e31=>{updateWorldbookOptions(_0x3eb590,_0x2b1e31,_0x44ab59);},0x12c);_0x4ebc0b[_0x14fead(0x1c9)](_0x14fead(0x26f),_0x108733=>{const _0x3a50a0=_0x14fead;_0x1bb109(_0x108733[_0x3a50a0(0x17d)][_0x3a50a0(0x1fb)]);});}log(_0x14fead(0x1c1)+_0x44ab59[_0x14fead(0x1a6)]+'\x20个书库。',_0x14fead(0x15b));}catch(_0x257a7e){console[_0x14fead(0x246)](_0x14fead(0x1a3),_0x257a7e),log(_0x14fead(0x207)+_0x257a7e[_0x14fead(0x183)],'error'),_0x3eb590&&(_0x3eb590['innerHTML']=_0x14fead(0x19e));}}function updateWorldbookOptions(_0xd9ca03,_0x2b6b6e,_0x5f0290){const _0x560fe0=_0x54d868,_0x3c58a2=filterWorldbooks(_0x2b6b6e,_0x5f0290),_0x39392b=_0xd9ca03[_0x560fe0(0x1fb)];_0xd9ca03['innerHTML']=_0x560fe0(0xcb);if(_0x3c58a2[_0x560fe0(0x1a6)]===0x0){_0xd9ca03[_0x560fe0(0x192)]=_0x2b6b6e['trim']()?_0x560fe0(0x25d):_0x560fe0(0x1a7);return;}_0x3c58a2['forEach'](_0x2a27d9=>{const _0x313b5d=_0x560fe0,_0x5aed26=document[_0x313b5d(0x225)]('option');_0x5aed26['value']=_0x2a27d9,_0x5aed26[_0x313b5d(0x217)]=_0x2a27d9,_0xd9ca03[_0x313b5d(0x24c)](_0x5aed26);}),_0x39392b&&_0x3c58a2[_0x560fe0(0x260)](_0x39392b)&&(_0xd9ca03[_0x560fe0(0x1fb)]=_0x39392b);}async function handleWorldbookSelectionChange(){const _0x1353d0=_0x54d868,_0x1365ca=document[_0x1353d0(0x161)](_0x1353d0(0x158)),_0xa518a1=document['getElementById'](_0x1353d0(0x18b)),_0x509911=document[_0x1353d0(0x161)](_0x1353d0(0x119)),_0x41fd34=document[_0x1353d0(0x161)](_0x1353d0(0x18a)),_0x2b2dfe=_0x1365ca[_0x1353d0(0x1fb)];_0xa518a1['disabled']=!![],_0xa518a1[_0x1353d0(0x13a)](_0x1353d0(0xed))[_0x1353d0(0x217)]=_0x1353d0(0x206),_0x509911[_0x1353d0(0x192)]='',_0x509911[_0x1353d0(0xd7)][_0x1353d0(0x19c)]=_0x1353d0(0x1f2);_0x41fd34&&(_0x41fd34[_0x1353d0(0x1fb)]='');if(!_0x2b2dfe){_0xa518a1[_0x1353d0(0x13a)](_0x1353d0(0xed))[_0x1353d0(0x217)]=_0x1353d0(0x136);return;}try{log('正在为《'+_0x2b2dfe+'》获取条目列表...',_0x1353d0(0xe3));const _0x56b36c=await _0x181516[_0x1353d0(0x10a)](_0x2b2dfe);if(_0x56b36c[_0x1353d0(0x1a6)]===0x0){_0xa518a1[_0x1353d0(0x13a)]('span')[_0x1353d0(0x217)]=_0x1353d0(0x1c5);return;}window['allEntries']=_0x56b36c,updateEntryOptions('',_0x56b36c);if(_0x41fd34){_0x41fd34[_0x1353d0(0x24f)](_0x1353d0(0x26f),_0x41fd34[_0x1353d0(0x179)]);const _0x4af836=debounce(_0x167f1f=>{updateEntryOptions(_0x167f1f,_0x56b36c);},0x12c);_0x41fd34[_0x1353d0(0x179)]=_0x3f64a3=>{const _0xc887d4=_0x1353d0;_0x4af836(_0x3f64a3[_0xc887d4(0x17d)][_0xc887d4(0x1fb)]);},_0x41fd34[_0x1353d0(0x1c9)](_0x1353d0(0x26f),_0x41fd34[_0x1353d0(0x179)]);}log('成功加载\x20'+_0x56b36c[_0x1353d0(0x1a6)]+_0x1353d0(0x145),'success');}catch(_0x49776e){console[_0x1353d0(0x246)](_0x1353d0(0x257)+_0x2b2dfe+_0x1353d0(0x202),_0x49776e),log(_0x1353d0(0x230)+_0x49776e[_0x1353d0(0x183)],'error'),_0xa518a1['querySelector'](_0x1353d0(0xed))[_0x1353d0(0x217)]='加载失败';}finally{_0xa518a1[_0x1353d0(0xfb)]=![];}}function updateEntryOptions(_0xf0c51f,_0x5cb14d){const _0x5a6ea5=_0x54d868,_0x2010ac=document['getElementById'](_0x5a6ea5(0x119)),_0x2e09d5=document[_0x5a6ea5(0x161)](_0x5a6ea5(0x18b)),_0x5e6afa=filterWorldbookEntries(_0xf0c51f,_0x5cb14d);_0x2010ac[_0x5a6ea5(0x192)]='';const _0x4bb3f9=_0x5a6ea5(0xf2);_0x2010ac['insertAdjacentHTML'](_0x5a6ea5(0xfe),_0x4bb3f9);if(_0x5e6afa[_0x5a6ea5(0x1a6)]===0x0){const _0x5a89fe=' 在这里定义需要从提取内容中排除的文本片段。例如,排除HTML注释,可以设置开始字符为\x20``。\x0a翰林院宝库状态\x0a--------------------\x0a集合ID:\x20'+_0x3d78f9+_0x13862d(0x1cf)+_0x5e0866+_0x13862d(0x25e)+_0xc2a38b['retrieval'][_0x13862d(0xee)]+_0x13862d(0x1e1)+_0xc2a38b[_0x13862d(0x176)][_0x13862d(0x18d)]+'\x0a
\x0a\x20\x20\x20\x20\x20\x20\x20\x20';toastr[_0x13862d(0xe3)](_0xabed44,_0x13862d(0x22b),{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log(_0x13862d(0x242)+_0x3d78f9+_0x13862d(0xeb)+_0x5e0866,_0x13862d(0x15b));}catch(_0x23332c){console['error']('[翰林院-枢纽]\x20查询宝库状态失败:',_0x23332c),toastr['error'](_0x13862d(0x170)+_0x23332c[_0x13862d(0x183)],_0x13862d(0x108)),log(_0x13862d(0x170)+_0x23332c['message'],_0x13862d(0x246));}}function showExclusionRulesModal(){const _0xa82e76=_0x54d868,_0x410f1c=_0x200707[_0xa82e76(0xc2)](),_0x27f108=_0x410f1c[_0xa82e76(0x1b1)][_0xa82e76(0xbd)]||[],_0x609275=(_0x3f7e2e={'start':'','end':''},_0x1bc513)=>'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\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'+_0x4e7d77[_0x37aded(0x11a)]+_0x37aded(0x14d)+_0x4e7d77[_0x37aded(0xcf)]+_0x37aded(0x280)+_0x4e7d77[_0x37aded(0x11a)]+_0x37aded(0x1a1)+_0x4e7d77[_0x37aded(0x273)]+_0x37aded(0x102)+_0x4e7d77['send_date']+'\x22>'+_0x4e7d77[_0x37aded(0x197)]+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20