UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

23 lines • 13.2 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ function _0x52de(_0x2a2e99,_0x40220d){const _0x54edca=_0x54ed();return _0x52de=function(_0x52de11,_0x1ec0d5){_0x52de11=_0x52de11-0x91;let _0x62498e=_0x54edca[_0x52de11];return _0x62498e;},_0x52de(_0x2a2e99,_0x40220d);}const _0x498d5d=_0x52de;function _0x54ed(){const _0x11ecfd=['model','3660GXHwMJ','extendTemplate','createCollection','ck-ai-chat-controls__model-selection','modelSelectorEnabled','Commands\x20are\x20not\x20implemented\x20yet.','AI_CHAT_ENABLE_REASONING','length','selectModel','log','description','_createWebSearchButton','AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','AI_CHAT_REASONING','397734vpbzSa','bindTemplate','_createCommandsButton','add','_createReasoningButton','4992630Tfncyc','isVisible','listenTo','toggleWebSearch','_createModelSelectionDropdown','AI_CHAT_DISABLE_WEB_SEARCH','98pPjVTe','setReasoning','_createModelNameView','activeModelId','_reasoningButton','AI_CHAT_SEARCH_WEB','span','AI_CHAT_CAPABILITIES_NO','_modelSelectionDropdown','ck-ai-chat-controls-button--commands','setModelList','enableModelSelector','setWebSearch','tooltip','isEnabled','toLowerCase','label','ck-ai-chat-controls__model-selection__item-description','AI_CHAT_ENABLE_WEB_SEARCH','ck-ai-chat__prompt-capabilities','ck-ai-chat-controls__model-selection__item-capabilities','_getCapabilityParts','fire','ck-hidden','text','setModel','agent','enabled','webSearchActive','webSearch','AI_CHAT_DISABLE_REASONING','ck-ai-chat-controls-button','ck-ai-chat-controls__model-name','AI_CHAT_COMMANDS','capabilities','clear','_modelNameView','menuitemradio','content','AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','bind','376TiIyYM','withText','reasoning','5020wcTdeK','source','name','div','24gHRwer','33726vdgFfV','button','12247920GbrnJZ','toggleReasoning','execute','ck-ai-chat-controls__model-selection__item-name','buttonView','ck-button__label','setTemplate','isOn','715328AbNQKC','_webSearchButton','activeModelName','reasoningActive','7170944xebvNQ','set','_commandsButton','_modelSelectionDropdownItems','disableModelSelector','style','startsWith','getLocalized','AI_CHAT_CAPABILITIES_YES','addMany','locale','modelSelectorVisible'];_0x54ed=function(){return _0x11ecfd;};return _0x54ed();}(function(_0x5c678c,_0x509e8f){const _0x41d4c6=_0x52de,_0x43cb09=_0x5c678c();while(!![]){try{const _0x1cd734=parseInt(_0x41d4c6(0xd4))/0x1*(parseInt(_0x41d4c6(0xd7))/0x2)+parseInt(_0x41d4c6(0xdb))/0x3*(parseInt(_0x41d4c6(0xe6))/0x4)+-parseInt(_0x41d4c6(0xa5))/0x5+parseInt(_0x41d4c6(0xa0))/0x6*(parseInt(_0x41d4c6(0xab))/0x7)+parseInt(_0x41d4c6(0xea))/0x8+-parseInt(_0x41d4c6(0xde))/0x9+-parseInt(_0x41d4c6(0x92))/0xa*(parseInt(_0x41d4c6(0xdc))/0xb);if(_0x1cd734===_0x509e8f)break;else _0x43cb09['push'](_0x43cb09['shift']());}catch(_0x34fb2f){_0x43cb09['push'](_0x43cb09['shift']());}}}(_0x54ed,0xaf1d4));import{Collection as _0x79e392}from'ckeditor5/src/utils.js';import{IconAI as _0x3e9bde,IconBulb as _0x4423c5,IconWeb as _0x3d787c}from'@ckeditor/ckeditor5-icons';import{addListToDropdown as _0x8edfc8,ButtonLabelView as _0x2e56c8,ButtonView as _0x51b15d,createDropdown as _0x38515c,IconView as _0x191944,UIModel as _0x61fa73,View as _0x406b44}from'ckeditor5/src/ui.js';import{getTranslation as _0x8e7cdb}from'../../../aicore/utils/common-translations.js';import{AIModels as _0x3715b9}from'../../../aicore/model/aimodels.js';const yo=_0x498d5d(0xbe),Uo=_0x498d5d(0xca),jo=_0x498d5d(0xb4),Go=_0x498d5d(0x95),Yo=_0x498d5d(0xe1),qo=_0x498d5d(0xbc),zo=_0x498d5d(0xbf),Fo='n';export class AIChatPromptCapabilitiesView extends _0x406b44{[_0x498d5d(0xe7)];[_0x498d5d(0xaf)];[_0x498d5d(0xec)];[_0x498d5d(0xb3)];[_0x498d5d(0xed)];[_0x498d5d(0xcf)];constructor(_0x27b15){const _0x5718d0=_0x498d5d;super(_0x27b15),this[_0x5718d0(0xeb)](_0x5718d0(0xc7),!0x1),this[_0x5718d0(0xeb)](_0x5718d0(0xe9),!0x1),this[_0x5718d0(0xeb)](_0x5718d0(0xf5),!0x0),this[_0x5718d0(0xeb)](_0x5718d0(0x96),!0x0),this[_0x5718d0(0xeb)](_0x5718d0(0xae),null),this[_0x5718d0(0xeb)](_0x5718d0(0xe8),null),this[_0x5718d0(0xb3)]=this[_0x5718d0(0xa9)](),this[_0x5718d0(0xcf)]=this[_0x5718d0(0xad)](),this[_0x5718d0(0xe7)]=this[_0x5718d0(0x9d)](),this[_0x5718d0(0xaf)]=this[_0x5718d0(0xa4)](),this[_0x5718d0(0xec)]=this[_0x5718d0(0xa2)](),this[_0x5718d0(0xb3)][_0x5718d0(0xe2)][_0x5718d0(0xd3)](_0x5718d0(0xa6))['to'](this,_0x5718d0(0xf5),_0x19758b=>_0x19758b),this[_0x5718d0(0xb3)][_0x5718d0(0xe2)][_0x5718d0(0xd3)](_0x5718d0(0xb8))['to'](this,_0x5718d0(0x96),_0x4d96b6=>_0x4d96b6?this[_0x5718d0(0xb3)][_0x5718d0(0xe2)][_0x5718d0(0xbb)]:_0x8e7cdb(this[_0x5718d0(0xf4)],_0x5718d0(0x9e))),this[_0x5718d0(0xb3)][_0x5718d0(0xd3)](_0x5718d0(0xb9))['to'](this,_0x5718d0(0x96),_0x179892=>_0x179892),this[_0x5718d0(0xe7)][_0x5718d0(0xd3)](_0x5718d0(0xe5))['to'](this,_0x5718d0(0xc7),_0x59ca93=>_0x59ca93),this[_0x5718d0(0xe7)][_0x5718d0(0xd3)](_0x5718d0(0xd5))['to'](this,_0x5718d0(0xf5),_0x249228=>!_0x249228),this[_0x5718d0(0xe7)][_0x5718d0(0xd3)](_0x5718d0(0xb8))['to'](this,_0x5718d0(0xc7),_0x418411=>_0x8e7cdb(this[_0x5718d0(0xf4)],_0x418411?_0x5718d0(0xaa):_0x5718d0(0xbd))),this[_0x5718d0(0xaf)][_0x5718d0(0xd3)](_0x5718d0(0xe5))['to'](this,_0x5718d0(0xe9),_0x49a249=>_0x49a249),this[_0x5718d0(0xaf)][_0x5718d0(0xd3)](_0x5718d0(0xd5))['to'](this,_0x5718d0(0xf5),_0x15cef4=>!_0x15cef4),this[_0x5718d0(0xaf)][_0x5718d0(0xd3)](_0x5718d0(0xb8))['to'](this,_0x5718d0(0xe9),_0x108a1e=>_0x8e7cdb(this[_0x5718d0(0xf4)],_0x108a1e?_0x5718d0(0xc9):_0x5718d0(0x98))),this[_0x5718d0(0xe4)]({'tag':_0x5718d0(0xda),'attributes':{'class':[yo]},'children':[this[_0x5718d0(0xb3)],this[_0x5718d0(0xcf)],this[_0x5718d0(0xe7)],this[_0x5718d0(0xaf)],this[_0x5718d0(0xec)]]}),this[_0x5718d0(0xed)]=new _0x79e392(),_0x8edfc8(this[_0x5718d0(0xb3)],this[_0x5718d0(0xed)]);}[_0x498d5d(0xb5)](_0x331f73,_0x11ab9a){const _0x25f273=_0x498d5d;if(this[_0x25f273(0xeb)](_0x25f273(0xf5),!(_0x11ab9a&&_0x331f73[_0x25f273(0x99)]<=0x1)),this[_0x25f273(0xed)][_0x25f273(0xce)](),_0x331f73?.[_0x25f273(0x99)]){const _0x1552df=_0x3715b9[_0x25f273(0xf1)](this[_0x25f273(0xf4)],_0x331f73);for(const _0x1d5fca of _0x1552df){const _0x4581a1=new _0x61fa73({'label':_0x1d5fca[_0x25f273(0xd9)],'withText':!0x0,'role':_0x25f273(0xd0),'id':_0x1d5fca['id'],'model':_0x1d5fca});_0x4581a1[_0x25f273(0xd3)](_0x25f273(0xe5))['to'](this,_0x25f273(0xae),_0x4d9b07=>_0x4d9b07===_0x1d5fca['id']),this[_0x25f273(0xed)][_0x25f273(0xa3)]({'type':_0x25f273(0xdd),'model':_0x4581a1,'labelView':new Xs(this[_0x25f273(0xf4)],_0x1d5fca)});}}}[_0x498d5d(0xb7)](_0x446c28){const _0x5a161a=_0x498d5d;this[_0x5a161a(0xeb)](_0x5a161a(0xc7),_0x446c28);}[_0x498d5d(0xac)](_0x539e82){const _0x2bb866=_0x498d5d;this[_0x2bb866(0xeb)](_0x2bb866(0xe9),_0x539e82);}[_0x498d5d(0xc4)](_0x551aef){const _0x17984b=_0x498d5d;if(!_0x551aef)return;this[_0x17984b(0xae)]=_0x551aef['id'],this[_0x17984b(0xe8)]=_0x551aef[_0x17984b(0xd9)]||_0x551aef['id'],this[_0x17984b(0xb3)][_0x17984b(0xe2)][_0x17984b(0xeb)](_0x17984b(0xbb),_0x551aef[_0x17984b(0xd9)]),this[_0x17984b(0xb3)][_0x17984b(0xe2)][_0x17984b(0xeb)](_0x17984b(0xb8),_0x551aef[_0x17984b(0xd9)]);const _0x575c16=_0x551aef[_0x17984b(0xcd)][_0x17984b(0xc8)]?.[_0x17984b(0xc6)]??!0x1;this[_0x17984b(0xeb)](_0x17984b(0xc7),!0x1),this[_0x17984b(0xe7)][_0x17984b(0xeb)](_0x17984b(0xe5),!0x1),this[_0x17984b(0xe7)][_0x17984b(0xeb)](_0x17984b(0xb9),_0x575c16),this[_0x17984b(0xe7)][_0x17984b(0xeb)](_0x17984b(0xa6),_0x575c16);const _0x11a100=_0x551aef[_0x17984b(0xcd)][_0x17984b(0xd6)]?.[_0x17984b(0xc6)]??!0x1;this[_0x17984b(0xeb)](_0x17984b(0xe9),!0x1),this[_0x17984b(0xaf)][_0x17984b(0xeb)](_0x17984b(0xe5),!0x1),this[_0x17984b(0xaf)][_0x17984b(0xeb)](_0x17984b(0xb9),_0x11a100),this[_0x17984b(0xaf)][_0x17984b(0xeb)](_0x17984b(0xa6),_0x11a100);}[_0x498d5d(0xb6)](){const _0xeebc03=_0x498d5d;this[_0xeebc03(0xeb)](_0xeebc03(0x96),!0x0),this[_0xeebc03(0xeb)](_0xeebc03(0xf5),!0x0);}[_0x498d5d(0xee)](_0x276840){const _0x53cf1d=_0x498d5d;this[_0x53cf1d(0xeb)](_0x53cf1d(0x96),!0x1),_0x276840&&this[_0x53cf1d(0xeb)](_0x53cf1d(0xf5),!0x1);}[_0x498d5d(0x9d)](){const _0x1bb581=_0x498d5d,_0x755bdb=new _0x51b15d();return _0x755bdb[_0x1bb581(0xeb)]({'label':_0x8e7cdb(this[_0x1bb581(0xf4)],_0x1bb581(0xb0)),'icon':_0x3d787c,'class':Uo,'isToggleable':!0x0,'tooltipPosition':Fo}),_0x755bdb['on'](_0x1bb581(0xe0),()=>{const _0x2055a1=_0x1bb581;this[_0x2055a1(0xc1)](_0x2055a1(0xa8));}),_0x755bdb;}[_0x498d5d(0xa4)](){const _0x2c3494=_0x498d5d,_0x36482f=new _0x51b15d();return _0x36482f[_0x2c3494(0xeb)]({'label':_0x8e7cdb(this[_0x2c3494(0xf4)],_0x2c3494(0x9f)),'icon':_0x4423c5,'class':Uo,'isToggleable':!0x0,'tooltipPosition':Fo}),_0x36482f['on'](_0x2c3494(0xe0),()=>{const _0x18b714=_0x2c3494;this[_0x18b714(0xc1)](_0x18b714(0xdf));}),_0x36482f;}[_0x498d5d(0xa2)](){const _0x570234=_0x498d5d,_0x501072=new _0x51b15d();return _0x501072[_0x570234(0xeb)]({'label':_0x8e7cdb(this[_0x570234(0xf4)],_0x570234(0xcc)),'icon':_0x3e9bde,'withText':!0x0,'class':Uo,'isToggleable':!0x0,'tooltip':_0x8e7cdb(this[_0x570234(0xf4)],_0x570234(0xcc)),'tooltipPosition':Fo}),_0x501072[_0x570234(0x93)]({'attributes':{'class':[jo]}}),_0x501072['on'](_0x570234(0xe0),()=>{const _0xcdd9a4=_0x570234;console[_0xcdd9a4(0x9b)](_0xcdd9a4(0x97)),alert(_0xcdd9a4(0x97));}),_0x501072;}[_0x498d5d(0xa9)](){const _0x474a58=_0x498d5d,_0x4b03db=_0x38515c(this[_0x474a58(0xf4)]);return _0x4b03db[_0x474a58(0xeb)]({'panelPosition':'ne','class':[Go]}),_0x4b03db[_0x474a58(0xe2)][_0x474a58(0xeb)]({'label':_0x8e7cdb(this[_0x474a58(0xf4)],_0x474a58(0xd2)),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Fo}),this[_0x474a58(0xa7)](_0x4b03db,_0x474a58(0xe0),_0x49fb78=>{const _0x487291=_0x474a58;this[_0x487291(0xc1)](_0x487291(0x9a),_0x49fb78[_0x487291(0xd8)][_0x487291(0x91)]);}),_0x4b03db;}[_0x498d5d(0xad)](){const _0x1eed57=_0x498d5d,_0x21fd61=new Jo(this[_0x1eed57(0xf4)]);return _0x21fd61[_0x1eed57(0xd3)](_0x1eed57(0xc3))['to'](this,_0x1eed57(0xe8),_0x37b869=>_0x37b869??''),_0x21fd61[_0x1eed57(0xd3)](_0x1eed57(0xa6))['to'](this,_0x1eed57(0xf5),this,_0x1eed57(0xe8),(_0x445051,_0x44d533)=>!_0x445051&&!_0x44d533?.[_0x1eed57(0xba)]()[_0x1eed57(0xf0)](_0x1eed57(0xc5))),_0x21fd61;}}class Xs extends _0x2e56c8{constructor(_0xe9c7bd,_0x1ea9ae){const _0x3c5c56=_0x498d5d;super();const _0x1c7150=this[_0x3c5c56(0xa1)],_0xc7d1b0=this[_0x3c5c56(0x94)]();this[_0x3c5c56(0xe4)]({'tag':_0x3c5c56(0xda),'attributes':{'class':['ck',_0x3c5c56(0xe3)],'style':_0x1c7150['to'](_0x3c5c56(0xef)),'id':_0x1c7150['to']('id')},'children':[{'tag':_0x3c5c56(0xda),'attributes':{'class':[Yo]},'children':[{'text':_0x1c7150['to'](_0x3c5c56(0xc3))}]},{'tag':_0x3c5c56(0xda),'attributes':{'class':[qo]},'children':[{'tag':_0x3c5c56(0xb1),'children':[{'text':_0x1ea9ae[_0x3c5c56(0x9c)]}]}]},{'tag':_0x3c5c56(0xda),'attributes':{'class':[zo]},'children':_0xc7d1b0}]}),_0xc7d1b0[_0x3c5c56(0xf3)](this[_0x3c5c56(0xc0)](_0xe9c7bd,_0x3d787c,_0x3c5c56(0xb0),_0x1ea9ae[_0x3c5c56(0xcd)][_0x3c5c56(0xc8)]?.[_0x3c5c56(0xc6)]??!0x1)),_0xc7d1b0[_0x3c5c56(0xf3)](this[_0x3c5c56(0xc0)](_0xe9c7bd,_0x4423c5,_0x3c5c56(0x9f),_0x1ea9ae[_0x3c5c56(0xcd)][_0x3c5c56(0xd6)]?.[_0x3c5c56(0xc6)]??!0x1));}[_0x498d5d(0xc0)](_0x1befd2,_0x13f1d7,_0x281e75,_0x4d65e4){const _0x14fa2b=_0x498d5d,_0x47c1c0=new _0x191944();_0x47c1c0[_0x14fa2b(0xd1)]=_0x13f1d7;const _0x643126=new _0x406b44(_0x1befd2);_0x643126[_0x14fa2b(0xe4)]({'tag':_0x14fa2b(0xb1),'children':[{'text':_0x8e7cdb(_0x1befd2,_0x281e75)+':\x20'}]});const _0x32edca=new _0x406b44(_0x1befd2);return _0x32edca[_0x14fa2b(0xe4)]({'tag':_0x14fa2b(0xb1),'children':[{'text':_0x8e7cdb(_0x1befd2,_0x4d65e4?_0x14fa2b(0xf2):_0x14fa2b(0xb2))}]}),[_0x47c1c0,_0x643126,_0x32edca];}}class Jo extends _0x406b44{constructor(_0x5200a8){const _0x5e4558=_0x498d5d;super(_0x5200a8),this[_0x5e4558(0xeb)](_0x5e4558(0xc3),void 0x0),this[_0x5e4558(0xeb)](_0x5e4558(0xa6),!0x0);const _0x1ce540=this[_0x5e4558(0xa1)];this[_0x5e4558(0xe4)]({'tag':_0x5e4558(0xb1),'attributes':{'class':['ck',_0x5e4558(0xcb),_0x1ce540['if'](_0x5e4558(0xa6),_0x5e4558(0xc2),_0x1887c7=>!_0x1887c7)]},'children':[{'text':_0x1ce540['to'](_0x5e4558(0xc3))}]});}}