@ckeditor/ckeditor5-ai
Version:
AI Assistant feature for CKEditor 5.
23 lines • 10.6 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 _0xb7274f=_0x5c6d;(function(_0x3a7673,_0x2b11ae){const _0x271d92=_0x5c6d,_0x139913=_0x3a7673();while(!![]){try{const _0x1b57df=parseInt(_0x271d92(0x82))/0x1*(-parseInt(_0x271d92(0xb2))/0x2)+parseInt(_0x271d92(0xc2))/0x3*(-parseInt(_0x271d92(0x8d))/0x4)+parseInt(_0x271d92(0xba))/0x5*(parseInt(_0x271d92(0xe0))/0x6)+parseInt(_0x271d92(0xe3))/0x7+parseInt(_0x271d92(0x90))/0x8*(-parseInt(_0x271d92(0x73))/0x9)+parseInt(_0x271d92(0xc6))/0xa*(parseInt(_0x271d92(0xbf))/0xb)+parseInt(_0x271d92(0xd7))/0xc*(parseInt(_0x271d92(0x9a))/0xd);if(_0x1b57df===_0x2b11ae)break;else _0x139913['push'](_0x139913['shift']());}catch(_0x504e7e){_0x139913['push'](_0x139913['shift']());}}}(_0x6e20,0x2aae2));import{Plugin as _0x53b999}from'ckeditor5/src/core.js';import _0x2f8e52 from'./aiassistantui.js';import _0x5b4ad3 from'./aiassistantediting.js';function _0x5c6d(_0x96cab8,_0x14ee79){const _0x6e202f=_0x6e20();return _0x5c6d=function(_0x5c6ded,_0x4c937d){_0x5c6ded=_0x5c6ded-0x72;let _0x561f5a=_0x6e202f[_0x5c6ded];return _0x561f5a;},_0x5c6d(_0x96cab8,_0x14ee79);}import{getTranslation as _0xd68573}from'./utils/common-translations.js';function _0x6e20(){const _0xcb8755=['legal','18VSlRJY','Spanish','Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.','isOfficialPlugin','Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.','improveWriting','Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.','locale','658550WcZwnU','Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.','translateHindi','concat','translateArabic','5247WJwnEs','continue','business','946098aRUImW','changeStyle','Portuguese','Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.','5520YGceLi','Edit\x20or\x20review','find','makeLonger','editOrReview','Change\x20style','translate','simplifyLanguage','Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.','Summarize','Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.','Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.','translateGerman','set','translateFrench','Improve\x20writing','Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.','1714836qnPYuv','ai.aiAssistant.commands','generate','Generate\x20from\x20selection','summarize','Journalism','pluginName','Friendly','includes','6KmODyb','German','Translate\x20the\x20content\x20to\x20German\x20language.','1471358upPfIm','get','9aqErch','Change\x20tone','casual','translateChinese','Poetic','ai.aiAssistant.preserveComments','config','English','forEach','Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.','Translate\x20the\x20content\x20to\x20French\x20language.','ai.aiAssistant.removeCommands','confident','makeShorter','Simplify\x20language','2847dssJTU','friendly','French','Business','Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.','ai.aiAssistant.extraCommandGroups','define','translatePortuguese','Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.','Casual','AIAssistant','4rqPPwU','Hindi','Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.','1858432WzvyeK','poetic','Translate\x20the\x20content\x20to\x20Spanish\x20language.','Confident','Direct','Professional','translateEnglish','direct','Legal','groupId','13MTcgMJ','changeTone','journalism','Translate\x20the\x20content\x20to\x20Hindi\x20language.','push','Translate','professional','filter','Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.','Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.','Make\x20longer','Translate\x20the\x20content\x20to\x20English\x20language.','requires','commands','Continue','Translate\x20the\x20content\x20to\x20Arabic\x20language.','Translate\x20the\x20content\x20to\x20Portuguese\x20language.','Make\x20shorter','isPremiumPlugin','translateSpanish','Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.','Arabic','Simplified\x20Chinese'];_0x6e20=function(){return _0xcb8755;};return _0x6e20();}import{normalizeCommandsConfig as _0x559de5}from'./utils/normalizecommandsconfig.js';export default class r extends _0x53b999{static get[_0xb7274f(0xa6)](){return[_0x2f8e52,_0x5b4ad3];}static get[_0xb7274f(0xdd)](){const _0x4f8939=_0xb7274f;return _0x4f8939(0x8c);}static get[_0xb7274f(0xb5)](){return!0x0;}static get[_0xb7274f(0xac)](){return!0x0;}constructor(_0x3652b3){const _0x3d5eba=_0xb7274f;super(_0x3652b3);const _0x23e681=_0x3652b3[_0x3d5eba(0x79)],_0xb3784e=_0x3652b3[_0x3d5eba(0xb9)];_0x23e681[_0x3d5eba(0x88)](_0x3d5eba(0x78),!0x0),_0x23e681[_0x3d5eba(0x88)](_0x3d5eba(0xd8),getDefaultCommands(_0xb3784e)),_0x23e681[_0x3d5eba(0x88)](_0x3d5eba(0x87),[]),_0x23e681[_0x3d5eba(0x88)](_0x3d5eba(0x7e),[]);let _0x346f5c=_0x559de5(_0x23e681[_0x3d5eba(0x72)](_0x3d5eba(0xd8)),_0xb3784e);const _0x143395=_0x23e681[_0x3d5eba(0x72)](_0x3d5eba(0x87)),_0x599099=_0x23e681[_0x3d5eba(0x72)](_0x3d5eba(0x7e));_0x143395[_0x3d5eba(0x7b)](_0x1efe11=>{const _0xeda515=_0x3d5eba,_0x178cb5=_0x346f5c[_0xeda515(0xc8)](_0x4d083f=>_0x4d083f[_0xeda515(0x99)]===_0x1efe11[_0xeda515(0x99)]);_0x178cb5?_0x178cb5[_0xeda515(0xa7)]=_0x178cb5[_0xeda515(0xa7)][_0xeda515(0xbd)](_0x1efe11[_0xeda515(0xa7)]):_0x346f5c[_0xeda515(0x9e)](_0x1efe11);}),_0x346f5c=_0x346f5c[_0x3d5eba(0xa1)](_0x284402=>!_0x599099[_0x3d5eba(0xdf)](_0x284402[_0x3d5eba(0x99)])),_0x346f5c[_0x3d5eba(0x7b)](_0x4fbb45=>{const _0x3455ed=_0x3d5eba;_0x4fbb45[_0x3455ed(0xa7)]=_0x4fbb45[_0x3455ed(0xa7)][_0x3455ed(0xa1)](_0x3a16b1=>!_0x599099[_0x3455ed(0xdf)](_0x3a16b1['id']));}),_0x23e681[_0x3d5eba(0xd3)](_0x3d5eba(0xd8),_0x346f5c);}}export function getDefaultCommands(_0x1f31ad){const _0x42cd08=_0xb7274f;return[{'groupId':_0x42cd08(0xca),'groupLabel':_0xd68573(_0x1f31ad,_0x42cd08(0xc7)),'commands':[{'id':_0x42cd08(0xb7),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xd5)),'prompt':_0x42cd08(0xb6)},{'id':_0x42cd08(0x80),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xab)),'prompt':_0x42cd08(0xb4)},{'id':_0x42cd08(0xc9),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xa4)),'prompt':_0x42cd08(0xd6)},{'id':_0x42cd08(0xcd),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x81)),'prompt':_0x42cd08(0xa2)}]},{'groupId':_0x42cd08(0xd9),'groupLabel':_0xd68573(_0x1f31ad,_0x42cd08(0xda)),'commands':[{'id':_0x42cd08(0xdb),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xcf)),'prompt':_0x42cd08(0xd0)},{'id':_0x42cd08(0xc0),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xa8)),'prompt':_0x42cd08(0xce)}]},{'groupId':_0x42cd08(0x9b),'groupLabel':_0xd68573(_0x1f31ad,_0x42cd08(0x74)),'commands':[{'id':_0x42cd08(0xa0),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x95)),'prompt':_0x42cd08(0xae)},{'id':_0x42cd08(0x75),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x8b)),'prompt':_0x42cd08(0xd1)},{'id':_0x42cd08(0x97),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x94)),'prompt':_0x42cd08(0xc5)},{'id':_0x42cd08(0x7f),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x93)),'prompt':_0x42cd08(0xa3)},{'id':_0x42cd08(0x83),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xde)),'prompt':_0x42cd08(0x8f)}]},{'groupId':_0x42cd08(0xc3),'groupLabel':_0xd68573(_0x1f31ad,_0x42cd08(0xcb)),'commands':[{'id':_0x42cd08(0xc1),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x85)),'prompt':_0x42cd08(0x7c)},{'id':_0x42cd08(0xb1),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x98)),'prompt':_0x42cd08(0xbb)},{'id':_0x42cd08(0x9c),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xdc)),'prompt':_0x42cd08(0x86)},{'id':_0x42cd08(0x91),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x77)),'prompt':_0x42cd08(0xb8)}]},{'groupId':_0x42cd08(0xcc),'groupLabel':_0xd68573(_0x1f31ad,_0x42cd08(0x9f)),'commands':[{'id':_0x42cd08(0x96),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x7a)),'prompt':_0x42cd08(0xa5)},{'id':_0x42cd08(0xad),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xb3)),'prompt':_0x42cd08(0x92)},{'id':_0x42cd08(0x89),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xc4)),'prompt':_0x42cd08(0xaa)},{'id':_0x42cd08(0xd2),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xe1)),'prompt':_0x42cd08(0xe2)},{'id':_0x42cd08(0xd4),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x84)),'prompt':_0x42cd08(0x7d)},{'id':_0x42cd08(0x76),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xb0)),'prompt':_0x42cd08(0x8a)},{'id':_0x42cd08(0xbc),'label':_0xd68573(_0x1f31ad,_0x42cd08(0x8e)),'prompt':_0x42cd08(0x9d)},{'id':_0x42cd08(0xbe),'label':_0xd68573(_0x1f31ad,_0x42cd08(0xaf)),'prompt':_0x42cd08(0xa9)}]}];}