@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 7.26 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. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
function _0xedbe(){const _0x3fc3a2=['div','warning','forEach','_cachedContentParts','push','AI_SUGGESTION_EMPTY_PART_WARNING','enqueue','ck-ai-suggestion__body','some','index','AI_SUGGESTION_NO_PARTS_WARNING','length','filter','abort','ck-ai-suggestion__body__content-parts','_showUnchangedParts','310752cAVrBD','find','partDefinition','findIndex','updateContentParts','hasPendingParts','12376pKucEp','addEventListener','20151BBoegB','empty-parts-warning','2125800QuBNQF','setContent','partsCount','from','first','hasChanges','_availableActions','add','markAsDone','2eaCEwe','7573398REKcHj','getPartView','updateContent','toggleHeader','pending','2514659YSLVxO','delegate','hasNonEmptyParts','set','_emptyPartsWarningView','1134401FoUKoy','state','_children','8696gJAaoJ','isVisible','queueEmptyPromise','_updateContentPartsPromiseQueue','createCollection','locale','_areActionsDisabled','setTemplate','updatePartState'];_0xedbe=function(){return _0x3fc3a2;};return _0xedbe();}const _0x346c79=_0x18a6;(function(_0x4354e9,_0x459dbe){const _0x43c43c=_0x18a6,_0x39759b=_0x4354e9();while(!![]){try{const _0x529091=parseInt(_0x43c43c(0xe3))/0x1*(parseInt(_0x43c43c(0xd8))/0x2)+parseInt(_0x43c43c(0xc5))/0x3+parseInt(_0x43c43c(0xcb))/0x4+parseInt(_0x43c43c(0xcf))/0x5+parseInt(_0x43c43c(0xd9))/0x6+parseInt(_0x43c43c(0xde))/0x7+parseInt(_0x43c43c(0xe6))/0x8*(-parseInt(_0x43c43c(0xcd))/0x9);if(_0x529091===_0x459dbe)break;else _0x39759b['push'](_0x39759b['shift']());}catch(_0x3522f5){_0x39759b['push'](_0x39759b['shift']());}}}(_0xedbe,0xd079c));import{View as _0x55fb40}from'ckeditor5/src/ui.js';import{AISuggestionBodyViewContentPartView as _0x36e34c}from'./aisuggestioncontentpartview.js';import{AI_SUGGESTION_UI_EVENT_NAMES as _0x5a4cc7}from'../../utils/eventnames.js';import{PromiseQueue as _0x4c79f9}from'../../../aichat/utils/promisequeue.js';function _0x18a6(_0x20d8e2,_0x4ca927){const _0xedbeb6=_0xedbe();return _0x18a6=function(_0x18a60e,_0x2d5c05){_0x18a60e=_0x18a60e-0xb4;let _0x6ec38a=_0xedbeb6[_0x18a60e];return _0x6ec38a;},_0x18a6(_0x20d8e2,_0x4ca927);}import{AIChatFeedErrorItemView as _0x3cde57}from'../../../aichat/ui/feed/aichatfeederroritemview.js';import{getTranslation as _0x5dd2cb}from'../../utils/common-translations.js';export class AISuggestionBodyView extends _0x55fb40{[_0x346c79(0xe5)];[_0x346c79(0xec)];[_0x346c79(0xc4)];[_0x346c79(0xe9)];[_0x346c79(0xe2)];[_0x346c79(0xd5)];[_0x346c79(0xb8)]=[];constructor(_0x23f324,_0x6ec6a6){const _0x1d2c66=_0x346c79;super(_0x23f324);const {areActionsDisabled:_0x54f361,showUnchangedParts:_0xf5a3db,availableActions:_0x137daf}=_0x6ec6a6;this[_0x1d2c66(0xec)]=_0x54f361,this[_0x1d2c66(0xc4)]=_0xf5a3db,this[_0x1d2c66(0xd5)]=_0x137daf,this[_0x1d2c66(0xe1)](_0x1d2c66(0xca),!0x1),this[_0x1d2c66(0xe5)]=this[_0x1d2c66(0xea)](),this[_0x1d2c66(0xe9)]=new _0x4c79f9(),this[_0x1d2c66(0xe2)]=new _0x3cde57({'id':_0x1d2c66(0xce),'initialContent':_0x5dd2cb(_0x23f324,_0x1d2c66(0xba)),'level':_0x1d2c66(0xb6)}),this[_0x1d2c66(0xe2)][_0x1d2c66(0xe7)]=!0x1,this[_0x1d2c66(0xed)]({'tag':_0x1d2c66(0xb5),'attributes':{'class':['ck',_0x1d2c66(0xbc)]},'children':[{'tag':_0x1d2c66(0xb5),'attributes':{'class':['ck',_0x1d2c66(0xc3)]},'children':this[_0x1d2c66(0xe5)]},this[_0x1d2c66(0xe2)]]});}get[_0x346c79(0xd1)](){const _0x73bc1=_0x346c79;return this[_0x73bc1(0xe5)][_0x73bc1(0xc0)];}async[_0x346c79(0xc9)]({parts:_0x46ba98,renderingStrategy:_0x4f9b48,abortSignal:_0x4aa045}){const _0x5d428a=_0x346c79;this[_0x5d428a(0xe5)][_0x5d428a(0xc0)]?_0x46ba98[_0x5d428a(0xb7)](_0xc26525=>{const _0x53e275=_0x5d428a,_0x17e429=this[_0x53e275(0xb8)][_0x53e275(0xc8)](_0x517f18=>_0x517f18[_0x53e275(0xbe)]==_0xc26525[_0x53e275(0xbe)]);-0x1===_0x17e429?this[_0x53e275(0xb8)][_0x53e275(0xb9)](_0xc26525):this[_0x53e275(0xb8)][_0x17e429]=_0xc26525;}):this[_0x5d428a(0xb8)]=_0x46ba98;for(const _0x585b83 of _0x46ba98[_0x5d428a(0xc1)](_0x1f4792=>_0x1f4792[_0x5d428a(0xd4)]))this[_0x5d428a(0xe9)][_0x5d428a(0xbb)](async _0x408b98=>{const _0x524a97=_0x5d428a;let _0x4240ea=this[_0x524a97(0xda)](_0x585b83[_0x524a97(0xbe)]);_0x4240ea||(_0x4240ea=new _0x36e34c(this[_0x524a97(0xeb)],{'part':_0x585b83,'uiIndex':this[_0x524a97(0xe5)][_0x524a97(0xc0)]+0x1,'areActionsDisabled':this[_0x524a97(0xec)],'availableActions':this[_0x524a97(0xd5)]}),_0x4240ea[_0x524a97(0xdf)](..._0x5a4cc7)['to'](this),this[_0x524a97(0xe5)][_0x524a97(0xd6)](_0x4240ea),this[_0x524a97(0xca)]=!0x0),0x2===this[_0x524a97(0xe5)][_0x524a97(0xc0)]&&this[_0x524a97(0xe5)][_0x524a97(0xd3)][_0x524a97(0xdc)](!0x0),_0x4240ea[_0x524a97(0xdc)](this[_0x524a97(0xe5)][_0x524a97(0xc0)]>0x1),await _0x4240ea[_0x524a97(0xdb)]({'part':_0x585b83,'renderingStrategy':_0x4f9b48,'showUnchangedParts':this[_0x524a97(0xc4)],'abortSignal':_0x408b98});});return _0x4aa045?.[_0x5d428a(0xcc)](_0x5d428a(0xc2),()=>{const _0x5607d7=_0x5d428a;this[_0x5607d7(0xe9)][_0x5607d7(0xc2)]();}),this[_0x5d428a(0xe9)][_0x5d428a(0xe8)];}[_0x346c79(0xb4)](_0x3794db,_0xd1da84){const _0xc23f3=_0x346c79,_0x54967f=this[_0xc23f3(0xda)](_0x3794db);_0x54967f&&(_0x54967f[_0xc23f3(0xe4)]=_0xd1da84),this[_0xc23f3(0xca)]=_0xc23f3(0xdd)==_0xd1da84||Array[_0xc23f3(0xd2)](this[_0xc23f3(0xe5)])[_0xc23f3(0xbd)](_0x532f68=>_0xc23f3(0xdd)==_0x532f68[_0xc23f3(0xe4)]);}[_0x346c79(0xda)](_0x2ebfec){const _0x536a6d=_0x346c79;return this[_0x536a6d(0xe5)][_0x536a6d(0xc6)](_0x414c46=>_0x414c46[_0x536a6d(0xc7)][_0x536a6d(0xbe)]==_0x2ebfec)??null;}[_0x346c79(0xd7)](){const _0x28fa53=_0x346c79;if(!this[_0x28fa53(0xc4)]){const _0x3cd1c9=!this[_0x28fa53(0xb8)][_0x28fa53(0xc6)](({hasChanges:_0x2161e7})=>_0x2161e7),_0x5115b1=!!this[_0x28fa53(0xb8)][_0x28fa53(0xc6)](({hasChanges:_0x44f439})=>!_0x44f439);this[_0x28fa53(0xe2)][_0x28fa53(0xe7)]=0x0==this[_0x28fa53(0xe5)][_0x28fa53(0xc0)]||_0x5115b1,_0x3cd1c9?this[_0x28fa53(0xe2)][_0x28fa53(0xd0)](_0x5dd2cb(this[_0x28fa53(0xeb)],_0x28fa53(0xbf))):this[_0x28fa53(0xe2)][_0x28fa53(0xd0)](_0x5dd2cb(this[_0x28fa53(0xeb)],_0x28fa53(0xba)));}}get[_0x346c79(0xe0)](){const _0x59171b=_0x346c79;return!!this[_0x59171b(0xe5)][_0x59171b(0xc6)](_0x330f4d=>_0x330f4d[_0x59171b(0xc7)][_0x59171b(0xd4)]);}}