@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 21.8 kB
JavaScript
/*
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
*
*
*
*
* +---------------------------------------------------------------------------------+
* | |
* | Hello stranger! |
* | |
* | |
* | What you're currently looking at is the source code of a legally protected, |
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
* | are forbidden and will result in legal consequences. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
const _0x59bc08=_0x177f;(function(_0x12550a,_0x5a3f07){const _0x5bdbc4=_0x177f,_0x21c794=_0x12550a();while(!![]){try{const _0x5f5187=parseInt(_0x5bdbc4(0x1f2))/0x1*(-parseInt(_0x5bdbc4(0x22c))/0x2)+-parseInt(_0x5bdbc4(0x201))/0x3+parseInt(_0x5bdbc4(0x230))/0x4*(-parseInt(_0x5bdbc4(0x1ca))/0x5)+parseInt(_0x5bdbc4(0x219))/0x6+-parseInt(_0x5bdbc4(0x1fe))/0x7*(parseInt(_0x5bdbc4(0x1b4))/0x8)+parseInt(_0x5bdbc4(0x232))/0x9+parseInt(_0x5bdbc4(0x220))/0xa*(parseInt(_0x5bdbc4(0x231))/0xb);if(_0x5f5187===_0x5a3f07)break;else _0x21c794['push'](_0x21c794['shift']());}catch(_0x20fda5){_0x21c794['push'](_0x21c794['shift']());}}}(_0x1c15,0x57bef));import{CKEditorError as _0x5ebcea,ObservableMixin as _0x29ad64,uid as _0xe945a3}from'ckeditor5/src/utils.js';import{AIContextItemType as _0xd267e,AIContextTextResourceType as _0x3f6228}from'../../aicore/model/aicontext.js';function _0x1c15(){const _0x5581b7=['1341170JneyRM','MARKDOWN','object','File','DOCUMENT','_toggleAddCurrentDocumentOptionVisibility','text/html','getPendingContextItems','_ongoingUploads','URL','ai-chat-resource-no-data','ai-chat-resource-load-failed','158vwBeEw','_ongoingUploadOperations','uploadUrl','loadSourceResources','4XKCrXW','121bzPwny','891405FUyVWm','ai-chat-file-upload-failed','enabled','sessionId','set','abortController','isInContext','delete','current-document','isHidden','start','addContextOptionsChanged','resourceId','type','addToConversationContext','uploadFile','TEXT','_conversationContextItems','168tDiKgv','getData','updateCurrentDocument','_removeContextItem','_finishUploadOperation','hidden','addUrlToContext','getSentContextItems','sources','map','ai-request-aborted','addResourceToContext','data','_pendingContextItems','message','isSelectionInContext','removeFromContext','all','FILE','getId','stack','sourceResourcesLoaded','3337645UEWRWi','end','_updateResourceInContextState','ai-chat-source-not-found','length','error','_getCustomSourcesInitialState','has','addFilesToContext','_convertTextResourceToFile','contextItemLoadingEnded','file-','ai-chat-url-upload-failed','urls','_finishContextItemLoading','text/markdown','clearPendingContextItems','contextItemAdded','ai-chat-context-unsupported-type','fetchDocument','isCurrentDocumentInContext','getDocument','_ownerId','uploadDocument','string','values','size','_connector','resources','object\x20with\x20content\x20and\x20type\x20properties','_addToConversationContextItem','contextSent','_mapContextItemToRequestData','text/plain','ai-chat-source-resources-load-failed','uiId','resourceStateChanged','content','files-','ai-chat-context-invalid-data','3959vqwEZL','_findSourceIdsByResourceId','init','isCurrentDocumentInConversation','ai-chat-document-upload-failed','isReadOnly','url','push','version','_addContextOptionsState','uploadProgressChanged','addCurrentDocumentToContext','181895CzefYm','name','attributes','869400utkwwy','getResources','document','Current\x20document','label','code','_isResourceInContext','mapContextItemsToRequestData','contextItemRemoved','files','get','HTML','startsWith','_addContextItem','_config','addSelectionToContext','from','selection','abort','SELECTION','_setAddContextOptionsDefaultState','_startUploadOperation','populateFromMessage','removeSelectionFromContext','3605100PHhhDh','filter','url-','_createContextItemFromContent','fire','find','forEach'];_0x1c15=function(){return _0x5581b7;};return _0x1c15();}import{escape as _0x1d2d32}from'es-toolkit/compat';import{errorsMap as _0x54bba8}from'../../errorsmap.js';export const AI_CONTEXT_MODEL_EVENT_NAMES=[_0x59bc08(0x1db),_0x59bc08(0x209),_0x59bc08(0x1d4),_0x59bc08(0x1e9),_0x59bc08(0x1cf),_0x59bc08(0x23d),_0x59bc08(0x1c9),_0x59bc08(0x1ee),_0x59bc08(0x1fc)];function _0x177f(_0x2f6272,_0x216c4d){const _0x1c157b=_0x1c15();return _0x177f=function(_0x177f0f,_0x915992){_0x177f0f=_0x177f0f-0x1af;let _0x51e6b3=_0x1c157b[_0x177f0f];return _0x51e6b3;},_0x177f(_0x2f6272,_0x216c4d);}export class AIChatContext extends _0x29ad64(){[_0x59bc08(0x1e5)];[_0x59bc08(0x20f)];[_0x59bc08(0x1e0)];constructor({connector:_0x2fec8a,config:_0x53a5b5,ownerId:_0x48331f}){const _0x344e2a=_0x59bc08;super(),this[_0x344e2a(0x1e5)]=_0x2fec8a,this[_0x344e2a(0x20f)]=_0x53a5b5,this[_0x344e2a(0x1e0)]=_0x48331f;}[_0x59bc08(0x1f4)](){const _0x497786=_0x59bc08;this[_0x497786(0x1c1)]=new Map(),this[_0x497786(0x1b3)]=new Map(),this[_0x497786(0x228)]=new Map(),this[_0x497786(0x22d)]=new Map(),this[_0x497786(0x215)]();}[_0x59bc08(0x227)](){const _0x8b2d81=_0x59bc08;return this[_0x8b2d81(0x1c1)];}async[_0x59bc08(0x217)](_0x456819){const _0x40b04b=_0x59bc08,_0x19f2ba=await this[_0x40b04b(0x21c)](_0x456819);return this[_0x40b04b(0x1e8)](_0x19f2ba),_0x40b04b(0x23a)===_0x19f2ba[_0x40b04b(0x1ed)]&&this[_0x40b04b(0x225)](),_0x19f2ba;}async[_0x59bc08(0x21c)](_0x8a19c4){const _0x3a3d31=_0x59bc08;if(_0x8a19c4[_0x3a3d31(0x1af)]===_0xd267e[_0x3a3d31(0x224)]){const _0x394d7a=await this[_0x3a3d31(0x1e5)][_0x3a3d31(0x1dd)](this[_0x3a3d31(0x1e0)],_0x8a19c4['id'])[_0x3a3d31(0x1df)]();return{'id':_0x3a3d31(0x23a),'uiId':_0x3a3d31(0x23a),'label':_0x3a3d31(0x204),'type':_0x8a19c4[_0x3a3d31(0x1af)],'content':_0x394d7a[_0x3a3d31(0x1ef)],'hidden':this[_0x3a3d31(0x1b3)][_0x3a3d31(0x1d1)](_0x3a3d31(0x23a)),'version':_0x394d7a[_0x3a3d31(0x200)]?.[_0x3a3d31(0x1fa)],'sessionId':_0x394d7a[_0x3a3d31(0x200)]?.[_0x3a3d31(0x235)]};}return{'id':_0x8a19c4['id'],'uiId':_0x8a19c4['id'],'label':_0x8a19c4[_0x3a3d31(0x200)]?.[_0x3a3d31(0x205)]||_0x8a19c4[_0x3a3d31(0x1ff)]||_0x8a19c4[_0x3a3d31(0x1f8)]||_0x8a19c4['id'],'type':_0x8a19c4[_0x3a3d31(0x1af)],..._0x8a19c4?.[_0x3a3d31(0x200)]?.[_0x3a3d31(0x23e)]?{'resourceId':_0x8a19c4[_0x3a3d31(0x200)]?.[_0x3a3d31(0x23e)]}:{}};}[_0x59bc08(0x1bb)](){const _0x3a4d9d=_0x59bc08;return new Map(this[_0x3a4d9d(0x1b3)]);}[_0x59bc08(0x1c4)](_0x542e75){const _0x134f43=_0x59bc08,_0x5efb79=this[_0x134f43(0x1c1)][_0x134f43(0x20b)](_0x542e75);_0x5efb79?.[_0x134f43(0x1f7)]||this[_0x134f43(0x1b7)](_0x542e75);}[_0x59bc08(0x1da)](){const _0x4706f1=_0x59bc08;if(0x0===this[_0x4706f1(0x1c1)][_0x4706f1(0x1e4)])return;for(const _0x1b7bd4 of this[_0x4706f1(0x1c1)][_0x4706f1(0x1e3)]())this[_0x4706f1(0x1b7)](_0x1b7bd4[_0x4706f1(0x1ed)]);const _0xe79224=this[_0x4706f1(0x1b3)][_0x4706f1(0x20b)](_0x4706f1(0x23a))||this[_0x4706f1(0x1c1)][_0x4706f1(0x20b)](_0x4706f1(0x23a));_0xe79224&&this[_0x4706f1(0x20e)]({..._0xe79224,'isReadOnly':!0x0,'hidden':!0x0});}[_0x59bc08(0x1b0)](_0x1134de){const _0x350866=_0x59bc08;for(const _0x553ea2 of _0x1134de[_0x350866(0x1e3)]())this[_0x350866(0x1e8)](_0x553ea2);this[_0x350866(0x1da)](),this[_0x350866(0x21d)](_0x350866(0x1e9),{'contextItems':Array[_0x350866(0x211)](this[_0x350866(0x1bb)]()[_0x350866(0x1e3)]())});}[_0x59bc08(0x1de)](){const _0x272ec9=_0x59bc08;return this[_0x272ec9(0x1c1)][_0x272ec9(0x1d1)](_0x272ec9(0x23a));}[_0x59bc08(0x1c3)](){const _0x24399e=_0x59bc08;return this[_0x24399e(0x1c1)][_0x24399e(0x1d1)](_0x24399e(0x212));}[_0x59bc08(0x1f5)](){const _0x332537=_0x59bc08;return this[_0x332537(0x1b3)][_0x332537(0x1d1)](_0x332537(0x23a));}static[_0x59bc08(0x208)](_0x2202e3){const _0x5acf9d=_0x59bc08;return Array[_0x5acf9d(0x211)](_0x2202e3[_0x5acf9d(0x1e3)]())[_0x5acf9d(0x1bd)](_0x43cbbd=>this[_0x5acf9d(0x1ea)](_0x43cbbd))[_0x5acf9d(0x21a)](_0xd37df8=>null!==_0xd37df8);}async[_0x59bc08(0x1d2)](_0x2c9a2b,_0x50c9d0,_0x360237=_0xd267e[_0x59bc08(0x1c6)]){const _0x21aec5=_0x59bc08,_0x56ef0e=_0x21aec5(0x1f0)+_0xe945a3();this[_0x21aec5(0x216)](_0x56ef0e);try{await Promise[_0x21aec5(0x1c5)](_0x2c9a2b[_0x21aec5(0x1bd)](async _0x5deafc=>{const _0x3f0ea2=_0x21aec5,_0x191a4d=_0x3f0ea2(0x1d5)+_0xe945a3(),_0x3afb7e=_0x1d2d32(_0x5deafc[_0x3f0ea2(0x1ff)]);try{this[_0x3f0ea2(0x20e)]({'type':_0x360237,'label':_0x50c9d0?.[_0x3f0ea2(0x205)]||_0x3afb7e,'uiId':_0x191a4d,'resourceId':_0x50c9d0?.[_0x3f0ea2(0x23e)]},!0x0);const _0x3f43fb=this[_0x3f0ea2(0x1e5)][_0x3f0ea2(0x1b1)](this[_0x3f0ea2(0x1e0)],_0x5deafc,_0x50c9d0);this[_0x3f0ea2(0x228)][_0x3f0ea2(0x236)](_0x191a4d,_0x3f43fb[_0x3f0ea2(0x237)]);const {id:_0x3cd172}=await _0x3f43fb[_0x3f0ea2(0x1c7)]();this[_0x3f0ea2(0x228)][_0x3f0ea2(0x239)](_0x191a4d),this[_0x3f0ea2(0x1d8)]({'type':_0x360237,'id':_0x3cd172,'label':_0x50c9d0?.[_0x3f0ea2(0x205)]||_0x3afb7e,'uiId':_0x191a4d,'resourceId':_0x50c9d0?.[_0x3f0ea2(0x23e)]},!0x1);}catch(_0x5c377e){this[_0x3f0ea2(0x228)][_0x3f0ea2(0x239)](_0x191a4d);if(!(_0x5c377e instanceof _0x5ebcea&&_0x5c377e[_0x3f0ea2(0x1c2)][_0x3f0ea2(0x20d)](_0x3f0ea2(0x1be)))){const _0x16064c=_0x54bba8[_0x3f0ea2(0x20b)](_0x5c377e[_0x3f0ea2(0x206)])||_0x3f0ea2(0x233),_0x564014=new _0x5ebcea(_0x16064c,null,{'fileName':_0x3afb7e,..._0x5c377e});_0x564014[_0x3f0ea2(0x1c8)]=_0x5c377e[_0x3f0ea2(0x1c8)],this[_0x3f0ea2(0x21d)](_0x3f0ea2(0x1cf),{'error':_0x564014});}this[_0x3f0ea2(0x1b7)](_0x191a4d);}}));}finally{this[_0x21aec5(0x1b8)](_0x56ef0e);}}[_0x59bc08(0x1fd)](_0x9b5066){const _0x58d2f4=_0x59bc08;if(this[_0x58d2f4(0x1de)]())return;const _0x478705={'type':_0xd267e[_0x58d2f4(0x224)],'uiId':_0x58d2f4(0x23a),'label':_0x9b5066,'isReadOnly':this[_0x58d2f4(0x1b3)][_0x58d2f4(0x1d1)](_0x58d2f4(0x23a)),'hidden':this[_0x58d2f4(0x1b3)][_0x58d2f4(0x1d1)](_0x58d2f4(0x23a))};this[_0x58d2f4(0x20e)](_0x478705);}async[_0x59bc08(0x1b6)](_0x311ca2,_0x1ef673,_0x5d1f89,_0x325b42){const _0x179704=_0x59bc08,_0x4e6ba3=this[_0x179704(0x1c1)][_0x179704(0x20b)](_0x179704(0x23a));if(_0x4e6ba3&&_0x311ca2){_0x4e6ba3[_0x179704(0x212)]=_0x325b42?_0x325b42[_0x179704(0x1bd)](_0x1a8864=>({'start':_0x1a8864[_0x179704(0x23c)],'end':_0x1a8864[_0x179704(0x1cb)]})):[];try{if(_0x4e6ba3[_0x179704(0x1fa)]===_0x1ef673)return;const {id:_0x46e8a8}=await this[_0x179704(0x1e5)][_0x179704(0x1e1)](this[_0x179704(0x1e0)],_0x311ca2,{'version':_0x1ef673,'sessionId':_0x5d1f89})[_0x179704(0x1c7)]();_0x4e6ba3['id']=_0x46e8a8,_0x4e6ba3[_0x179704(0x1ef)]=_0x311ca2,_0x4e6ba3[_0x179704(0x1fa)]=_0x1ef673,_0x4e6ba3[_0x179704(0x235)]=_0x5d1f89;}catch(_0x49a070){const _0x47fb07=new _0x5ebcea(_0x179704(0x1f6),null);_0x47fb07[_0x179704(0x1c8)]=_0x49a070[_0x179704(0x1c8)],this[_0x179704(0x21d)](_0x179704(0x1cf),{'error':_0x47fb07});}}}[_0x59bc08(0x210)](_0x560bbb){const _0x1f8a79=_0x59bc08;this[_0x1f8a79(0x20e)]({'type':_0xd267e[_0x1f8a79(0x214)],'label':_0x560bbb,'uiId':_0x1f8a79(0x212),'content':_0x560bbb});}[_0x59bc08(0x218)](){const _0x495741=_0x59bc08;this[_0x495741(0x1b7)](_0x495741(0x212));}async[_0x59bc08(0x1ba)](_0x21c441,_0x173363){const _0x417a42=_0x59bc08,_0x461c8b=_0x417a42(0x21b)+_0xe945a3();this[_0x417a42(0x216)](_0x461c8b);const _0x348412=_0x417a42(0x21b)+_0xe945a3();try{this[_0x417a42(0x20e)]({'type':_0xd267e[_0x417a42(0x229)],'label':_0x173363?.[_0x417a42(0x205)]||_0x21c441,'uiId':_0x348412,'resourceId':_0x173363?.[_0x417a42(0x23e)]},!0x0);const _0x308638=this[_0x417a42(0x1e5)][_0x417a42(0x22e)](this[_0x417a42(0x1e0)],_0x21c441,_0x173363);this[_0x417a42(0x228)][_0x417a42(0x236)](_0x348412,_0x308638[_0x417a42(0x237)]);const {id:_0x5b70e1}=await _0x308638[_0x417a42(0x1c7)]();this[_0x417a42(0x228)][_0x417a42(0x239)](_0x348412),this[_0x417a42(0x1d8)]({'type':_0xd267e[_0x417a42(0x229)],'id':_0x5b70e1,'label':_0x173363?.[_0x417a42(0x205)]||_0x21c441,'uiId':_0x348412,'resourceId':_0x173363?.[_0x417a42(0x23e)]},!0x1);}catch(_0x36eb65){this[_0x417a42(0x228)][_0x417a42(0x239)](_0x348412),(_0x36eb65[_0x417a42(0x1c2)][_0x417a42(0x20d)](_0x417a42(0x1be))||this[_0x417a42(0x21d)](_0x417a42(0x1cf),{'error':new _0x5ebcea(_0x417a42(0x1d6),this,{'url':_0x21c441,'originalError':_0x36eb65}),'url':_0x21c441}),this[_0x417a42(0x1b7)](_0x348412));}finally{this[_0x417a42(0x1b8)](_0x461c8b);}}async[_0x59bc08(0x22f)](_0x56c667,_0x126901,_0x237883){const _0x575c4d=_0x59bc08,_0x3e392a=this[_0x575c4d(0x1fb)][_0x575c4d(0x1bc)][_0x575c4d(0x21e)](_0x1f15f4=>_0x1f15f4['id']===_0x56c667);if(!_0x3e392a)return this[_0x575c4d(0x21d)](_0x575c4d(0x1cf),{'error':new _0x5ebcea(_0x575c4d(0x1cd),this,{'sourceId':_0x56c667}),'sourceId':_0x56c667}),[];try{const _0x467db3=(await _0x3e392a[_0x575c4d(0x202)](_0x126901))[_0x575c4d(0x1bd)](_0x2e4496=>{const _0x170a65=_0x575c4d,_0x58d975=this[_0x170a65(0x207)](_0x2e4496['id']);return{..._0x2e4496,'isInContext':_0x58d975};});return _0x3e392a[_0x575c4d(0x1e6)]=_0x467db3,this[_0x575c4d(0x21d)](_0x575c4d(0x1c9),{'sourceId':_0x56c667,'source':_0x3e392a,'resources':_0x467db3,'uid':_0x237883}),_0x467db3;}catch(_0x2f9c6e){return this[_0x575c4d(0x21d)](_0x575c4d(0x1cf),{'error':new _0x5ebcea(_0x575c4d(0x1ec),this,{'sourceId':_0x56c667,'originalError':_0x2f9c6e}),'sourceId':_0x56c667,'sourceLabel':_0x3e392a[_0x575c4d(0x205)]}),[];}}async[_0x59bc08(0x1bf)](_0x23dc19,_0x492448){const _0x312ac1=_0x59bc08;if(this[_0x312ac1(0x207)](_0x492448['id']))return;let _0x41303e=_0x492448[_0x312ac1(0x1c0)];if(!_0x41303e&&_0x23dc19[_0x312ac1(0x1b5)])try{_0x41303e=await _0x23dc19[_0x312ac1(0x1b5)](_0x492448['id']);}catch(_0x5152dc){return void this[_0x312ac1(0x21d)](_0x312ac1(0x1cf),{'error':new _0x5ebcea(_0x312ac1(0x22b),this,{'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id'],'originalError':_0x5152dc}),'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id']});}if(_0x41303e)switch(_0x492448[_0x312ac1(0x1af)]){case _0xd267e[_0x312ac1(0x229)]:if(_0x312ac1(0x1e2)!=typeof _0x41303e)return void this[_0x312ac1(0x21d)](_0x312ac1(0x1cf),{'error':new _0x5ebcea(_0x312ac1(0x1f1),this,{'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id'],'expectedType':_0x312ac1(0x1e2),'actualType':typeof _0x41303e}),'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id']});await this[_0x312ac1(0x1ba)](_0x41303e,{'label':_0x492448[_0x312ac1(0x205)],'resourceId':_0x492448['id']});break;case _0xd267e[_0x312ac1(0x1c6)]:if(!(_0x41303e instanceof File))return void this[_0x312ac1(0x21d)](_0x312ac1(0x1cf),{'error':new _0x5ebcea(_0x312ac1(0x1f1),this,{'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id'],'expectedType':_0x312ac1(0x223),'actualType':typeof _0x41303e}),'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id']});await this[_0x312ac1(0x1d2)]([_0x41303e],{'label':_0x492448[_0x312ac1(0x205)],'resourceId':_0x492448['id']});break;case _0xd267e[_0x312ac1(0x1b2)]:if(_0x312ac1(0x222)!=typeof _0x41303e||!(_0x312ac1(0x1ef)in _0x41303e)||!(_0x312ac1(0x1af)in _0x41303e))return void this[_0x312ac1(0x21d)](_0x312ac1(0x1cf),{'error':new _0x5ebcea(_0x312ac1(0x1f1),this,{'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id'],'expectedType':_0x312ac1(0x1e7),'actualType':typeof _0x41303e}),'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id']});_0x41303e=AIChatContext[_0x312ac1(0x1d3)](_0x41303e,_0x492448[_0x312ac1(0x205)]),await this[_0x312ac1(0x1d2)]([_0x41303e],{'label':_0x492448[_0x312ac1(0x205)],'resourceId':_0x492448['id']},_0xd267e[_0x312ac1(0x1b2)]);break;default:this[_0x312ac1(0x21d)](_0x312ac1(0x1cf),{'error':new _0x5ebcea(_0x312ac1(0x1dc),this,{'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id'],'resourceType':_0x492448[_0x312ac1(0x1af)]}),'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id']});}else this[_0x312ac1(0x21d)](_0x312ac1(0x1cf),{'error':new _0x5ebcea(_0x312ac1(0x22a),this,{'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id']}),'resourceId':_0x492448['id'],'sourceId':_0x23dc19['id']});}static[_0x59bc08(0x1d3)](_0x23783e,_0xa7ab4c){const _0x32ca00=_0x59bc08;switch(_0x23783e[_0x32ca00(0x1af)]){case _0x3f6228[_0x32ca00(0x221)]:return new File([_0x23783e[_0x32ca00(0x1ef)]],_0xa7ab4c,{'type':_0x32ca00(0x1d9)});case _0x3f6228[_0x32ca00(0x20c)]:return new File([_0x23783e[_0x32ca00(0x1ef)]],_0xa7ab4c,{'type':_0x32ca00(0x226)});default:return new File([_0x23783e[_0x32ca00(0x1ef)]],_0xa7ab4c,{'type':_0x32ca00(0x1eb)});}}static[_0x59bc08(0x1ea)](_0x372787){const _0x79c5b4=_0x59bc08;switch(_0x372787[_0x79c5b4(0x1af)]){case _0xd267e[_0x79c5b4(0x1c6)]:return{'type':_0xd267e[_0x79c5b4(0x1c6)],'id':_0x372787['id']};case _0xd267e[_0x79c5b4(0x229)]:return{'type':_0xd267e[_0x79c5b4(0x229)],'id':_0x372787['id']};case _0xd267e[_0x79c5b4(0x224)]:return{'type':_0xd267e[_0x79c5b4(0x224)],'id':_0x372787['id'],..._0x372787[_0x79c5b4(0x212)]?.[_0x79c5b4(0x1ce)]&&{'selection':_0x372787[_0x79c5b4(0x212)]}};case _0xd267e[_0x79c5b4(0x1b2)]:return{'type':_0xd267e[_0x79c5b4(0x1c6)],'id':_0x372787['id']};default:return null;}}[_0x59bc08(0x20e)](_0x242257,_0x23442c=!0x1){const _0x167246=_0x59bc08;if(this[_0x167246(0x1c1)][_0x167246(0x236)](_0x242257[_0x167246(0x1ed)],_0x242257),_0x242257[_0x167246(0x1b9)]||this[_0x167246(0x21d)](_0x167246(0x1db),{'contextItem':_0x242257,'isLoading':_0x23442c}),_0x167246(0x23a)===_0x242257[_0x167246(0x1ed)]&&this[_0x167246(0x225)](),_0x242257[_0x167246(0x23e)]){const _0x32880a=this[_0x167246(0x1f3)](_0x242257[_0x167246(0x23e)]);_0x32880a&&_0x32880a[_0x167246(0x21f)](_0x5564cd=>{const _0x3834d4=_0x167246;this[_0x3834d4(0x1cc)](_0x5564cd,_0x242257[_0x3834d4(0x23e)],!0x0);});}}[_0x59bc08(0x1b7)](_0x5822ba){const _0x1a3894=_0x59bc08,_0x47c22f=this[_0x1a3894(0x1c1)][_0x1a3894(0x20b)](_0x5822ba),_0x278a80=this[_0x1a3894(0x228)][_0x1a3894(0x20b)](_0x5822ba);if(_0x278a80&&(_0x278a80[_0x1a3894(0x213)](),this[_0x1a3894(0x228)][_0x1a3894(0x239)](_0x5822ba)),_0x47c22f?.[_0x1a3894(0x23e)]){const _0x4fae83=this[_0x1a3894(0x1f3)](_0x47c22f[_0x1a3894(0x23e)]);_0x4fae83&&_0x4fae83[_0x1a3894(0x21f)](_0x464771=>{const _0x120bb1=_0x1a3894;this[_0x120bb1(0x1cc)](_0x464771,_0x47c22f[_0x120bb1(0x23e)],!0x1);});}this[_0x1a3894(0x1c1)][_0x1a3894(0x239)](_0x5822ba),this[_0x1a3894(0x21d)](_0x1a3894(0x209),{'uiId':_0x5822ba,'type':_0x47c22f?.[_0x1a3894(0x1af)]}),_0x1a3894(0x23a)===_0x5822ba&&this[_0x1a3894(0x225)]();}[_0x59bc08(0x1d8)](_0x167b36,_0x42da42){const _0x370343=_0x59bc08;if(this[_0x370343(0x1c1)][_0x370343(0x1d1)](_0x167b36[_0x370343(0x1ed)])&&(this[_0x370343(0x1c1)][_0x370343(0x236)](_0x167b36[_0x370343(0x1ed)],_0x167b36),this[_0x370343(0x21d)](_0x370343(0x1d4),{'contextItem':_0x167b36,'isLoading':_0x42da42}),_0x167b36[_0x370343(0x23e)])){const _0x40b621=this[_0x370343(0x1f3)](_0x167b36[_0x370343(0x23e)]);_0x40b621&&_0x40b621[_0x370343(0x21f)](_0x433b77=>{const _0x5a50f6=_0x370343;this[_0x5a50f6(0x1cc)](_0x433b77,_0x167b36[_0x5a50f6(0x23e)],!0x0);});}}[_0x59bc08(0x1e8)](_0x22dc2b){const _0x5b2ee0=_0x59bc08;this[_0x5b2ee0(0x1b3)][_0x5b2ee0(0x236)](_0x22dc2b[_0x5b2ee0(0x1ed)],_0x22dc2b);}[_0x59bc08(0x215)](){const _0x247940=_0x59bc08;this[_0x247940(0x1fb)]={'document':{'enabled':!0x1!==this[_0x247940(0x20f)]?.[_0x247940(0x203)]?.[_0x247940(0x234)],'isHidden':!0x1},'urls':{'enabled':!0x1!==this[_0x247940(0x20f)]?.[_0x247940(0x1d7)]?.[_0x247940(0x234)]},'files':{'enabled':!0x1!==this[_0x247940(0x20f)]?.[_0x247940(0x20a)]?.[_0x247940(0x234)]},'sources':this[_0x247940(0x1d0)]()},this[_0x247940(0x21d)](_0x247940(0x23d),{'options':this[_0x247940(0x1fb)]});}[_0x59bc08(0x1d0)](){const _0x145fd9=_0x59bc08;return this[_0x145fd9(0x20f)]?.[_0x145fd9(0x1bc)]?.[_0x145fd9(0x1bd)](_0x19ec0c=>({..._0x19ec0c,'resources':[]}))??[];}[_0x59bc08(0x225)](){const _0x22a2c0=_0x59bc08,_0x32eb93=this[_0x22a2c0(0x1de)]()||this[_0x22a2c0(0x1f5)]();this[_0x22a2c0(0x1fb)][_0x22a2c0(0x203)][_0x22a2c0(0x23b)]=_0x32eb93,this[_0x22a2c0(0x21d)](_0x22a2c0(0x23d),{'options':this[_0x22a2c0(0x1fb)]});}[_0x59bc08(0x207)](_0x4e6e4e){const _0x35aada=_0x59bc08;for(const _0x49043e of this[_0x35aada(0x1c1)][_0x35aada(0x1e3)]())if(_0x49043e[_0x35aada(0x23e)]===_0x4e6e4e)return!0x0;for(const _0x1768eb of this[_0x35aada(0x1b3)][_0x35aada(0x1e3)]())if(_0x1768eb[_0x35aada(0x23e)]===_0x4e6e4e)return!0x0;return!0x1;}[_0x59bc08(0x1f3)](_0x553463){const _0x25629f=_0x59bc08,_0x11d945=[];for(const _0x346b22 of this[_0x25629f(0x1fb)][_0x25629f(0x1bc)]){_0x346b22[_0x25629f(0x1e6)][_0x25629f(0x21e)](_0x1ea344=>_0x1ea344['id']===_0x553463)&&_0x11d945[_0x25629f(0x1f9)](_0x346b22['id']);}return 0x0===_0x11d945[_0x25629f(0x1ce)]?null:_0x11d945;}[_0x59bc08(0x1cc)](_0x64a84b,_0x22d5bc,_0x44c21d){const _0x5cb424=_0x59bc08,_0xa5b35b=this[_0x5cb424(0x1fb)][_0x5cb424(0x1bc)][_0x5cb424(0x21e)](_0x12d956=>_0x12d956['id']===_0x64a84b);if(!_0xa5b35b)return;const _0x4f897f=_0xa5b35b[_0x5cb424(0x1e6)][_0x5cb424(0x21e)](_0x2788c8=>_0x2788c8['id']===_0x22d5bc);_0x4f897f&&(_0x4f897f[_0x5cb424(0x238)]=_0x44c21d,this[_0x5cb424(0x21d)](_0x5cb424(0x1ee),{'sourceId':_0x64a84b,'resourceId':_0x22d5bc,'isInContext':_0x44c21d}));}[_0x59bc08(0x216)](_0x29c215){const _0x4014d9=_0x59bc08;this[_0x4014d9(0x22d)][_0x4014d9(0x236)](_0x29c215,!0x0),this[_0x4014d9(0x22d)][_0x4014d9(0x1e4)]&&this[_0x4014d9(0x21d)](_0x4014d9(0x1fc),{'isUploadInProgress':!0x0});}[_0x59bc08(0x1b8)](_0x45a00e){const _0x3ef0d3=_0x59bc08;this[_0x3ef0d3(0x22d)][_0x3ef0d3(0x239)](_0x45a00e),0x0===this[_0x3ef0d3(0x22d)][_0x3ef0d3(0x1e4)]&&this[_0x3ef0d3(0x21d)](_0x3ef0d3(0x1fc),{'isUploadInProgress':!0x1});}}