UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

23 lines 7.78 kB
/* * 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 _0x59a7b1=_0x35ee;(function(_0x48acef,_0x433299){const _0xd20c86=_0x35ee,_0x11cccf=_0x48acef();while(!![]){try{const _0x45bb3d=parseInt(_0xd20c86(0xf9))/0x1*(parseInt(_0xd20c86(0xec))/0x2)+-parseInt(_0xd20c86(0xe6))/0x3*(parseInt(_0xd20c86(0xe0))/0x4)+parseInt(_0xd20c86(0xba))/0x5+-parseInt(_0xd20c86(0xde))/0x6+parseInt(_0xd20c86(0xdb))/0x7*(parseInt(_0xd20c86(0xf0))/0x8)+-parseInt(_0xd20c86(0xd3))/0x9*(-parseInt(_0xd20c86(0xe1))/0xa)+parseInt(_0xd20c86(0xca))/0xb*(-parseInt(_0xd20c86(0xcb))/0xc);if(_0x45bb3d===_0x433299)break;else _0x11cccf['push'](_0x11cccf['shift']());}catch(_0x527f83){_0x11cccf['push'](_0x11cccf['shift']());}}}(_0x5456,0xcc16e));import{IconSubmit as _0x446c25}from'ckeditor5/src/icons.js';function _0x35ee(_0x5c6fcb,_0x1ec29e){const _0x545630=_0x5456();return _0x35ee=function(_0x35ee75,_0x5a80f7){_0x35ee75=_0x35ee75-0xba;let _0x246fc0=_0x545630[_0x35ee75];return _0x246fc0;},_0x35ee(_0x5c6fcb,_0x1ec29e);}import{ButtonView as _0xb36065,AutocompleteView as _0x1e18d9,createLabeledTextarea as _0xedf23e}from'ckeditor5/src/ui.js';import{global as _0x5ebdc5,isVisible as _0x32b2f6,Rect as _0x466028,ResizeObserver as _0x30ffe6}from'ckeditor5/src/utils.js';import{getTranslation as _0x4e853f}from'../../../aicore/utils/common-translations.js';import{AIChatPromptSuggestionsListView as _0x49a613}from'./aichatpromptsuggestionslistview.js';import{escape as _0x11ae6f}from'es-toolkit/compat';function _0x5456(){const _0x520b0e=['width','sendUserMessage','hasError','_queryViewResizeObserver','px\x20-\x20var(--ck-spacing-tiny))','requestAnimationFrame','keystrokes','element','left','destroy','ck-ai-chat__prompt-input','window','110XnjhjI','2239524yIojku','_createSubmitButton','extendTemplate','enter','right','fieldView','target','maxRows','1305VoLaHB','style','focusableChildren','_addContextButtonView','submitButtonView','fieldWrapperChildren','rtl','errorText','10424071UvXLdd','trim','update','2848776fJMnaN','isEmpty','4rEAkku','59580aqXQFB','bind','fire','value','reset','3041133oqZToO','uiLanguageDirection','execute','add','_setUpAddContextButtonPositioning','queryView','10432iZiBGW','ck-ai-chat__prompt-submit-button','placeholder','MIN_ROWS','8SrDBpR','setIsUploadInProgress','render','calc(','MAX_ROWS','submit','isUploadInProgress','excludeScrollbarsAndBorders','minRows','71zaLFQP','AI_CHAT_LABEL_SUBMIT','isEnabled','AI_CHAT_PROMPT_EMPTY_ERROR','7336640wRbNeT','set','locale','setPlaceholderText'];_0x5456=function(){return _0x520b0e;};return _0x5456();}export class AIChatPromptInputView extends _0x1e18d9{[_0x59a7b1(0xd7)];static [_0x59a7b1(0xef)]=0x1;static [_0x59a7b1(0xf4)]=0xc;[_0x59a7b1(0xd6)];[_0x59a7b1(0xc1)];constructor(_0x13ae98,_0x302441){const _0x45e80d=_0x59a7b1;super(_0x13ae98,{'queryView':{'label':'','creator':_0xedf23e,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new _0x49a613(_0x13ae98),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this[_0x45e80d(0xbb)](_0x45e80d(0xdf),!0x0),this[_0x45e80d(0xbb)](_0x45e80d(0xf6),!0x1),this[_0x45e80d(0xd6)]=_0x302441,this[_0x45e80d(0xc1)]=null,this[_0x45e80d(0xeb)][_0x45e80d(0xd0)][_0x45e80d(0xf8)]=AIChatPromptInputView[_0x45e80d(0xef)],this[_0x45e80d(0xeb)][_0x45e80d(0xd0)][_0x45e80d(0xd2)]=AIChatPromptInputView[_0x45e80d(0xf4)],this[_0x45e80d(0xeb)][_0x45e80d(0xd8)][_0x45e80d(0xe9)](this[_0x45e80d(0xd6)]),this[_0x45e80d(0xea)](),this[_0x45e80d(0xcd)]({'attributes':{'class':['ck',_0x45e80d(0xc8)]}}),this[_0x45e80d(0xd7)]=this[_0x45e80d(0xcc)](),this[_0x45e80d(0xd7)][_0x45e80d(0xe2)](_0x45e80d(0xfb))['to'](this,_0x45e80d(0xdf),this,_0x45e80d(0xf6),(_0x393537,_0x4c522b)=>!_0x393537&&!_0x4c522b),this[_0x45e80d(0xd5)][_0x45e80d(0xe9)](this[_0x45e80d(0xd7)]);}[_0x59a7b1(0xf2)](){const _0x45323c=_0x59a7b1;super[_0x45323c(0xf2)](),this[_0x45323c(0xeb)][_0x45323c(0xd8)][_0x45323c(0xe9)](this[_0x45323c(0xd7)]),this[_0x45323c(0xc4)][_0x45323c(0xbb)](_0x45323c(0xce),(_0x575af6,_0x35e5b8)=>{const _0x6186ce=_0x45323c;this[_0x6186ce(0xf6)]||this[_0x6186ce(0xdf)]||_0x575af6[_0x6186ce(0xd1)]==this[_0x6186ce(0xeb)][_0x6186ce(0xd0)][_0x6186ce(0xc5)]&&(this[_0x6186ce(0xf5)](),_0x35e5b8());}),this[_0x45323c(0xeb)][_0x45323c(0xd0)]['on'](_0x45323c(0xdd),()=>{const _0x28d8ed=_0x45323c;this[_0x28d8ed(0xdf)]=''===this[_0x28d8ed(0xeb)][_0x28d8ed(0xd0)][_0x28d8ed(0xc5)][_0x28d8ed(0xe4)]?.[_0x28d8ed(0xdc)]();});}[_0x59a7b1(0xc7)](){const _0x4ac4d0=_0x59a7b1;super[_0x4ac4d0(0xc7)](),this[_0x4ac4d0(0xc1)]&&this[_0x4ac4d0(0xc1)][_0x4ac4d0(0xc7)]();}[_0x59a7b1(0xf5)](){const _0x5571eb=_0x59a7b1,_0x5bb08a=this[_0x5571eb(0xeb)][_0x5571eb(0xd0)][_0x5571eb(0xc5)][_0x5571eb(0xe4)]?.[_0x5571eb(0xdc)]();if(!_0x5bb08a)return this[_0x5571eb(0xeb)][_0x5571eb(0xda)]=_0x4e853f(this[_0x5571eb(0xbc)],_0x5571eb(0xfc)),void(this[_0x5571eb(0xeb)][_0x5571eb(0xd0)][_0x5571eb(0xc0)]=!0x0);this[_0x5571eb(0xeb)][_0x5571eb(0xd0)][_0x5571eb(0xc0)]=!0x1;const _0x5e3f89=_0x11ae6f(_0x5bb08a);this[_0x5571eb(0xe3)](_0x5571eb(0xbf),_0x5e3f89),this[_0x5571eb(0xeb)][_0x5571eb(0xd0)][_0x5571eb(0xe5)]();}[_0x59a7b1(0xbd)](_0x792e0a){const _0x20bcd7=_0x59a7b1;this[_0x20bcd7(0xeb)][_0x20bcd7(0xd0)][_0x20bcd7(0xbb)](_0x20bcd7(0xee),_0x792e0a);}[_0x59a7b1(0xcc)](){const _0xe8a752=_0x59a7b1,_0x5c1e95=new _0xb36065(this[_0xe8a752(0xbc)]);return _0x5c1e95[_0xe8a752(0xbb)]({'icon':_0x446c25,'label':_0x4e853f(this[_0xe8a752(0xbc)],_0xe8a752(0xfa)),'isVisible':!0x0,'tooltip':!0x0,'class':_0xe8a752(0xed),'isEnabled':!0x1}),_0x5c1e95['on'](_0xe8a752(0xe8),()=>{const _0x274f10=_0xe8a752;this[_0x274f10(0xf5)]();}),_0x5c1e95;}[_0x59a7b1(0xf1)](_0x3b2486){const _0x67f56b=_0x59a7b1;this[_0x67f56b(0xf6)]=_0x3b2486;}[_0x59a7b1(0xea)](){const _0x28e03b=_0x59a7b1,_0x30fa3c=this[_0x28e03b(0xbc)],_0x14e4fb=()=>{const _0x33eb27=_0x28e03b;_0x5ebdc5[_0x33eb27(0xc9)][_0x33eb27(0xc3)](()=>{const _0x4ac72c=_0x33eb27;if(_0x32b2f6(this[_0x4ac72c(0xc5)])){const _0x158e13=new _0x466028(this[_0x4ac72c(0xeb)][_0x4ac72c(0xd0)][_0x4ac72c(0xc5)]),_0x4046ec=new _0x466028(this[_0x4ac72c(0xd6)][_0x4ac72c(0xc5)]),_0x5b926e=_0x158e13[_0x4ac72c(0xbe)],_0x414c0a=_0x4ac72c(0xd9)===_0x30fa3c[_0x4ac72c(0xe7)]?_0x4ac72c(0xcf):_0x4ac72c(0xc6);_0x158e13[_0x4ac72c(0xf7)]();const _0x14d105=_0x5b926e-_0x158e13[_0x4ac72c(0xbe)]+0x1;this[_0x4ac72c(0xd6)][_0x4ac72c(0xc5)][_0x4ac72c(0xd4)][_0x414c0a]=_0x4ac72c(0xf3)+(_0x5b926e-_0x4046ec[_0x4ac72c(0xbe)]-_0x14d105)+_0x4ac72c(0xc2);}});};this[_0x28e03b(0xeb)][_0x28e03b(0xd0)]['on'](_0x28e03b(0xdd),_0x14e4fb),this['on'](_0x28e03b(0xf2),()=>{const _0x35499d=_0x28e03b;_0x14e4fb(),this[_0x35499d(0xc1)]=new _0x30ffe6(this[_0x35499d(0xeb)][_0x35499d(0xd0)][_0x35499d(0xc5)],()=>{_0x14e4fb();});});}}