@ckeditor/ckeditor5-ai 46.0.1-alpha.12 → 46.0.1-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x29bd45,Command as _0x5646ef}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x429393,IconCheck as _0x158af4,IconError as _0x192700,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x2ca237,IconRobotPencil as _0x59657e}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x553dc4,CKEditorError as _0x40cdb9,ObservableMixin as _0x4b0a14,global as _0x100eae,isVisible as _0x11da0b,Rect as _0x15f76d,Collection as _0x3f9d89,FocusTracker as et,KeystrokeHandler as rt,first as _0x46b51c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x3b2709,View as _0x224a57,SpinnerView as _0x1ba79e,IconView as _0x155397,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x50a1ff,createDropdown as _0x506fc8,addMenuToDropdown as _0x55b2b7,MenuBarMenuView as _0x53eca6,MenuBarMenuListItemButtonView as _0x5700d7,DialogViewPosition as _0x3acd8c,MenuBarMenuListView as _0x1f29e6,MenuBarMenuListItemView as _0x596962}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4244aa,ClipboardMarkersUtils as _0x4f6a0a}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x168cd6,ViewDataTransfer as _0x41db82,ViewUpcastWriter as _0x1e662c,Matcher as _0x55411c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3c59b0,InvokeModelWithResponseStreamCommand as _0x3875c7,InvokeModelCommand as _0x23ebfb}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x57ada7,_0x2346ab){const _0x2888b=(0x0,_0x2346ab['t'])('Other');return _0x57ada7['length']?'groupId'in _0x57ada7[0x0]?_0x57ada7:[{'groupId':K,'groupLabel':_0x2888b,'order':0x1/0x0,'commands':_0x57ada7}]:[{'groupId':K,'groupLabel':_0x2888b,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x29bd45{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xefdf26}=this,_0x26fa50=['ck-fake-ai-selection'];_0xefdf26['config']['get']('ai.useTheme')&&_0x26fa50['push']('ck-ai-assistant-ui_theme'),_0xefdf26['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x26fa50,'priority':0xc}}),_0xefdf26['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x2ea92e,{writer:_0x12359f})=>{if(!_0x2ea92e['markerRange']['isCollapsed'])return null;const _0x3439e1=_0x12359f['createUIElement']('span');return _0x12359f['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3439e1),_0x3439e1;}});}['afterInit'](){!async function(_0x20dc70){const _0x2ed1b2=_0xdb42bd([0x54,0x42,0x73,0x4c,0x38,0x6a,0x61,0x6b,0x41,0x6e,0x43,0x37,0x47,0x75,0x6c,0x6f,0x5a,0x7a,0x53,0x59,0x44,0x45,0x39,0x52,0x63,0x66,0x74,0x4d,0x4f,0x51,0x65,0x78,0x35,0x4b,0x70,0x31,0x58,0x67,0x57,0x6d,0x4e,0x55,0x62,0x50,0x36,0x4a,0x30,0x71,0x49,0x56,0x48,0x64,0x68,0x76,0x69,0x32,0x33,0x34,0x77,0x72,0x79,0x46]),_0x35e853=0x2861a6d9,_0x3b04a1=0x2866c921^_0x35e853,_0x329610=window[_0xdb42bd([0x44,0x61,0x74,0x65])][_0xdb42bd([0x6e,0x6f,0x77])](),_0x1dc6c0=_0x20dc70[_0xdb42bd([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5940ce=new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x119dec=>{_0x1dc6c0[_0xdb42bd([0x6f,0x6e,0x63,0x65])](_0xdb42bd([0x72,0x65,0x61,0x64,0x79]),_0x119dec);}),_0x421e30={[_0xdb42bd([0x6b,0x74,0x79])]:_0xdb42bd([0x45,0x43]),[_0xdb42bd([0x75,0x73,0x65])]:_0xdb42bd([0x73,0x69,0x67]),[_0xdb42bd([0x63,0x72,0x76])]:_0xdb42bd([0x50,0x2d,0x32,0x35,0x36]),[_0xdb42bd([0x78])]:_0xdb42bd([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0xdb42bd([0x79])]:_0xdb42bd([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0xdb42bd([0x61,0x6c,0x67])]:_0xdb42bd([0x45,0x53,0x32,0x35,0x36])},_0x4eae7e=_0x1dc6c0[_0xdb42bd([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xdb42bd([0x67,0x65,0x74])](_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5b63b8(){let _0x447dbe,_0x44dac1=null,_0x2cf535=null;try{if(_0x4eae7e==_0xdb42bd([0x47,0x50,0x4c]))return _0xdb42bd([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x447dbe=_0x574234(),!_0x447dbe)return _0xdb42bd([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x447dbe[_0xdb42bd([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2cf535=_0x57df7a(_0x447dbe[_0xdb42bd([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x447dbe[_0xdb42bd([0x6a,0x74,0x69])])),await _0x530589()?_0x1f5bf0()?_0x5a2316()?_0xdb42bd([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4d80ec()?(_0x447dbe[_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xdb42bd([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x44dac1=_0x34b8be(_0xdb42bd([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x447dbe[_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xdb42bd([0x74,0x72,0x69,0x61,0x6c])&&(_0x44dac1=_0x34b8be(_0xdb42bd([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x541aa0()):_0xdb42bd([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xdb42bd([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xdb42bd([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xdb42bd([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5a2316(){const _0x2abc3e=[_0xdb42bd([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xdb42bd([0x74,0x72,0x69,0x61,0x6c])][_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x447dbe[_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x329610/0x3e8:0xe10*_0x3b04a1;return _0x447dbe[_0xdb42bd([0x65,0x78,0x70])]<_0x2abc3e;}function _0x1f5bf0(){const _0x44ec63=_0x447dbe[_0xdb42bd([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x44ec63&&(!!_0x44ec63[_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xdb42bd([0x2a]))||!!_0x44ec63[_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xdb42bd([0x41,0x49])));}function _0x4d80ec(){const _0x325b62=_0x447dbe[_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x325b62||0x0==_0x325b62[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x7fb5fa}=new URL(window[_0xdb42bd([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x325b62[_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x7fb5fa))return!0x0;const _0x283044=_0x7fb5fa[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])](_0xdb42bd([0x2e]));return _0x325b62[_0xdb42bd([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3c7ab5=>_0x3c7ab5[_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xdb42bd([0x2a])))[_0xdb42bd([0x6d,0x61,0x70])](_0x2b0db7=>_0x2b0db7[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])](_0xdb42bd([0x2e])))[_0xdb42bd([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5a9330=>_0x5a9330[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x283044[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xdb42bd([0x6d,0x61,0x70])](_0x371a08=>Array(_0x283044[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x371a08[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xdb42bd([0x66,0x69,0x6c,0x6c])](_0x371a08[0x0]===_0xdb42bd([0x2a])?_0xdb42bd([0x2a]):'')[_0xdb42bd([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x371a08))[_0xdb42bd([0x73,0x6f,0x6d,0x65])](_0x2131af=>_0x283044[_0xdb42bd([0x65,0x76,0x65,0x72,0x79])]((_0x8a1669,_0x33ffd2)=>_0x2131af[_0x33ffd2]===_0x8a1669||_0x2131af[_0x33ffd2]===_0xdb42bd([0x2a])));}function _0x541aa0(){return _0x44dac1&&_0x2cf535?new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4f82d0,_0x2aaa3f)=>{_0x44dac1[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x4f82d0,_0x2aaa3f),_0x2cf535[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x32cfde=>{_0x32cfde!=_0xdb42bd([0x56,0x61,0x6c,0x69,0x64])&&_0x4f82d0(_0x32cfde);},_0x2aaa3f);}):_0x44dac1||_0x2cf535||_0xdb42bd([0x56,0x61,0x6c,0x69,0x64]);}}function _0x57df7a(_0x45b0e0,_0x27e919){return new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4042fb=>{if(_0x4dae00())return _0x4042fb(_0xdb42bd([0x56,0x61,0x6c,0x69,0x64]));_0x44433f(),_0x1dc6c0[_0xdb42bd([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xdb42bd([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xbec89f=!0x1;const _0x24e188=_0x553dc4();function _0x405850(_0x2ccdb1){return!!_0x2ccdb1&&(typeof _0x2ccdb1===_0xdb42bd([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2ccdb1===_0xdb42bd([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2ccdb1[_0xdb42bd([0x74,0x68,0x65,0x6e])]===_0xdb42bd([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2ccdb1[_0xdb42bd([0x63,0x61,0x74,0x63,0x68])]===_0xdb42bd([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x4c9a5a(_0x360da3){_0x2dfb1b(_0x360da3)[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x27f328=>{if(!_0x27f328||_0x27f328[_0xdb42bd([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xdb42bd([0x6f,0x6b]))return _0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xb4b0e7(_0x23d9dc(_0x24e188+_0x27e919))!=_0x27f328[_0xdb42bd([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xdb42bd([0x56,0x61,0x6c,0x69,0x64]);})[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x2a60dc=>(_0x6933e4(),_0x2a60dc),()=>{const _0x2196a8=_0x5d9b5a();return null==_0x2196a8?(_0x6933e4(),_0xdb42bd([0x56,0x61,0x6c,0x69,0x64])):_0xdb42bd(_0x329610-_0x2196a8>(0xc6d22d9^_0x35e853)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x4042fb)[_0xdb42bd([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4042fb(_0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2ef24f=0x28574859^_0x35e853;function _0x6933e4(){const _0x4ee5be=_0xdb42bd([0x6c,0x6c,0x63,0x74,0x2d])+_0xb4b0e7(_0x23d9dc(_0x45b0e0)),_0x47016d=_0x1824f8(_0xb4b0e7(window[_0xdb42bd([0x4d,0x61,0x74,0x68])][_0xdb42bd([0x63,0x65,0x69,0x6c])](_0x329610/_0x2ef24f)));window[_0xdb42bd([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xdb42bd([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4ee5be,_0x47016d);}function _0x5d9b5a(){const _0x8c43ce=_0xdb42bd([0x6c,0x6c,0x63,0x74,0x2d])+_0xb4b0e7(_0x23d9dc(_0x45b0e0)),_0x429fc6=window[_0xdb42bd([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xdb42bd([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x8c43ce);return _0x429fc6?window[_0xdb42bd([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1824f8(_0x429fc6),0x10)*_0x2ef24f:null;}function _0x2dfb1b(_0x202487){return new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x199dc9,_0x3e13a6)=>{_0x202487[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x199dc9,_0x3e13a6),window[_0xdb42bd([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3e13a6,0x28607219^_0x35e853);});}}_0x1dc6c0[_0xdb42bd([0x6f,0x6e])](_0xdb42bd([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1c9477,_0x23e0ec)=>{if(_0x23e0ec[0x0]!=_0x45b0e0)return _0x4042fb(_0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x23e0ec[0x1]={..._0x23e0ec[0x1],[_0xdb42bd([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x24e188};},{[_0xdb42bd([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xdb42bd([0x68,0x69,0x67,0x68])}),_0x1dc6c0[_0xdb42bd([0x6f,0x6e])](_0xdb42bd([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x5628d3=>{_0x405850(_0x5628d3[_0xdb42bd([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xbec89f=!0x0,_0x4c9a5a(_0x5628d3[_0xdb42bd([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xdb42bd([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xdb42bd([0x6c,0x6f,0x77])}),_0x5940ce[_0xdb42bd([0x74,0x68,0x65,0x6e])](()=>{_0xbec89f||_0x4042fb(_0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4dae00(){return _0x1dc6c0[_0xdb42bd([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xdb42bd([0x76,0x69,0x65,0x77])][_0xdb42bd([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xdb42bd([0x61,0x75,0x74,0x6f]);}function _0x44433f(){_0x1dc6c0[_0xdb42bd([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xdb42bd([0x76,0x69,0x65,0x77])][_0xdb42bd([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xdb42bd([0x61,0x75,0x74,0x6f]);}}function _0x34b8be(_0x3e4447){const _0x4d9969=[new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4ee5d2=>setTimeout(_0x4ee5d2,0x28689815^_0x35e853)),_0x5940ce[_0xdb42bd([0x74,0x68,0x65,0x6e])](()=>new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x32e352=>{let _0x349a27=0x0;_0x1dc6c0[_0xdb42bd([0x6d,0x6f,0x64,0x65,0x6c])][_0xdb42bd([0x6f,0x6e])](_0xdb42bd([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x40f691,_0x402a97)=>{_0x402a97[0x0][_0xdb42bd([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x349a27++,_0x349a27==(0x2861a721^_0x35e853)&&(_0x32e352(),_0x40f691[_0xdb42bd([0x6f,0x66,0x66])]());});}))];return window[_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xdb42bd([0x72,0x61,0x63,0x65])](_0x4d9969)[_0xdb42bd([0x74,0x68,0x65,0x6e])](()=>_0x3e4447);}async function _0x1bb410(){await _0x5940ce,_0x1dc6c0[_0xdb42bd([0x6d,0x6f,0x64,0x65,0x6c])][_0xdb42bd([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5ef224,_0x1dc6c0[_0xdb42bd([0x6d,0x6f,0x64,0x65,0x6c])][_0xdb42bd([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5ef224,_0x1dc6c0[_0xdb42bd([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xdb42bd([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3adbba(_0x4d7839){const _0x18a93b=_0x3b59e4();_0x1dc6c0[_0x18a93b]=_0xdb42bd([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4d7839,_0x4d7839!=_0xdb42bd([0x56,0x61,0x6c,0x69,0x64])&&_0x1bb410();}function _0x3b59e4(){const _0x1b18a2=window[_0xdb42bd([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xdb42bd([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xdb42bd([0x6e,0x6f,0x77])]())[_0xdb42bd([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xdb42bd([0x2e]),'');let _0x3c8a2c=_0xdb42bd([0x54]);for(let _0x1a0cca=0x0;_0x1a0cca<_0x1b18a2[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1a0cca+=0x2){let _0x1f1fbd=window[_0xdb42bd([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1b18a2[_0xdb42bd([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1a0cca,_0x1a0cca+0x2));_0x1f1fbd>=_0x2ed1b2[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1f1fbd-=_0x2ed1b2[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3c8a2c+=_0x2ed1b2[_0x1f1fbd];}return _0x3c8a2c;}function _0x574234(){const _0x38471b=_0x4eae7e[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])](_0xdb42bd([0x2e]));if(0x3!=_0x38471b[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x369c1b(_0x38471b[0x1]);function _0x369c1b(_0xfe9a15){const _0x2c646c=_0x41e3fe(_0xfe9a15);return _0x2c646c&&_0x52c3ff()?_0x2c646c:null;function _0x52c3ff(){const _0x211049=_0x2c646c[_0xdb42bd([0x6a,0x74,0x69])],_0x23cc11=window[_0xdb42bd([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x211049[_0xdb42bd([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x211049[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x37baf8={..._0x2c646c,[_0xdb42bd([0x6a,0x74,0x69])]:_0x211049[_0xdb42bd([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x211049[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x37baf8[_0xdb42bd([0x76,0x63])],_0x23d9dc(_0x37baf8)==_0x23cc11;}}}async function _0x530589(){let _0x3d8e8b=!0x0;try{const _0x5516c3=_0x4eae7e[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])](_0xdb42bd([0x2e])),[_0x5af5ad,_0x7894d7,_0x5d5bb9]=_0x5516c3;return _0x1fd28a(_0x5af5ad),await _0x51f5f0(_0x5af5ad,_0x7894d7,_0x5d5bb9),_0x3d8e8b;}catch{return!0x1;}function _0x1fd28a(_0xba6978){const _0x9dea60=_0x41e3fe(_0xba6978);_0x9dea60&&_0x9dea60[_0xdb42bd([0x61,0x6c,0x67])]==_0xdb42bd([0x45,0x53,0x32,0x35,0x36])||(_0x3d8e8b=!0x1);}async function _0x51f5f0(_0xad0ab1,_0xfdc993,_0x34c26f){const _0x132791=window[_0xdb42bd([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xdb42bd([0x66,0x72,0x6f,0x6d])](_0x36d54a(_0x34c26f),_0x1acd44=>_0x1acd44[_0xdb42bd([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2bd8c2=new window[(_0xdb42bd([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xdb42bd([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xad0ab1+_0xdb42bd([0x2e])+_0xfdc993),_0x425166=window[_0xdb42bd([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xdb42bd([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x425166)return;const _0x5d0323=await _0x425166[_0xdb42bd([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xdb42bd([0x6a,0x77,0x6b]),_0x421e30,{[_0xdb42bd([0x6e,0x61,0x6d,0x65])]:_0xdb42bd([0x45,0x43,0x44,0x53,0x41]),[_0xdb42bd([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xdb42bd([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xdb42bd([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x425166[_0xdb42bd([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xdb42bd([0x6e,0x61,0x6d,0x65])]:_0xdb42bd([0x45,0x43,0x44,0x53,0x41]),[_0xdb42bd([0x68,0x61,0x73,0x68])]:{[_0xdb42bd([0x6e,0x61,0x6d,0x65])]:_0xdb42bd([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5d0323,_0x132791,_0x2bd8c2)||(_0x3d8e8b=!0x1);}}function _0x41e3fe(_0x33e6e7){return _0x33e6e7[_0xdb42bd([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xdb42bd([0x65,0x79]))?JSON[_0xdb42bd([0x70,0x61,0x72,0x73,0x65])](_0x36d54a(_0x33e6e7)):null;}function _0x36d54a(_0x312793){return window[_0xdb42bd([0x61,0x74,0x6f,0x62])](_0x312793[_0xdb42bd([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xdb42bd([0x2b]))[_0xdb42bd([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xdb42bd([0x2f])));}function _0x23d9dc(_0x3809ac){let _0x373ae5=0x1505;function _0x1be18d(_0x5a2bcf){for(let _0x54c31e=0x0;_0x54c31e<_0x5a2bcf[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x54c31e++){const _0x44bcf8=_0x5a2bcf[_0xdb42bd([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x54c31e);_0x373ae5=(_0x373ae5<<0x5)+_0x373ae5+_0x44bcf8,_0x373ae5&=_0x373ae5;}}function _0x1ebfb2(_0x345f76){Array[_0xdb42bd([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x345f76)?_0x345f76[_0xdb42bd([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1ebfb2):_0x345f76&&typeof _0x345f76==_0xdb42bd([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xdb42bd([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x345f76)[_0xdb42bd([0x73,0x6f,0x72,0x74])]()[_0xdb42bd([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x52e678,_0x4258e7])=>{_0x1be18d(_0x52e678),_0x1ebfb2(_0x4258e7);}):_0x1be18d(window[_0xdb42bd([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x345f76));}return _0x1ebfb2(_0x3809ac),_0x373ae5>>>0x0;}function _0xb4b0e7(_0x1bd27b){return _0x1bd27b[_0xdb42bd([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xdb42bd([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xdb42bd([0x30]));}function _0x1824f8(_0x30b24d){return _0x30b24d[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])]('')[_0xdb42bd([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xdb42bd([0x6a,0x6f,0x69,0x6e])]('');}function _0x5ef224(){}function _0xdb42bd(_0x55e730){return _0x55e730['map'](_0x1ea7bb=>String['fromCharCode'](_0x1ea7bb))['join']('');}_0x3adbba(await _0x5b63b8());}(this);}['showFakeVisualSelection'](){const _0x5ee019=this['editor']['model'];_0x5ee019['change'](_0x597005=>{const _0x262d15=_0x5ee019['document']['selection']['getRanges']();let _0x5f3d31=0x0;for(const _0x4abc43 of _0x262d15){const _0x3bda9f=w+':'+_0x5f3d31;if(_0x5ee019['markers']['has'](_0x3bda9f))_0x597005['updateMarker'](_0x3bda9f,{'range':_0x4abc43});else{if(_0x4abc43['start']['isAtEnd']){const _0x207da9=_0x4abc43['start']['getLastMatchingPosition'](({item:_0x1429bc})=>!_0x5ee019['schema']['isContent'](_0x1429bc),{'boundaries':_0x4abc43});_0x597005['addMarker'](_0x3bda9f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x597005['createRange'](_0x207da9,_0x4abc43['end'])});}else _0x597005['addMarker'](_0x3bda9f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4abc43});}_0x5f3d31++;}});}['hideFakeVisualSelection'](){const _0x4262ff=this['editor']['model'],_0x4f662e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x4f662e['length']&&_0x4262ff['change'](_0x1e71a2=>{_0x4f662e['forEach'](_0x332774=>{_0x1e71a2['removeMarker'](_0x332774);});});}['insertContent'](_0x2d09c2,_0x23a301){const _0x46ac13=this['_getAISelection'](),_0x339cc8=_0x23a301||_0x46ac13['getFirstRange']();this['editor']['model']['canEditAt'](_0x339cc8)&&this['editor']['model']['change'](_0x1a89eb=>{this['hideFakeVisualSelection'](),_0x23a301||this['_resetContentOfSelectedTableCells'](_0x1a89eb,_0x46ac13),this['_pasteHTMLUsingClipboard']({'insertAt':_0x339cc8,'writer':_0x1a89eb,'html':_0x2d09c2});});}['insertContentBelow'](_0x29274b){const {model:_0x212991}=this['editor'],_0x35b27b=this['_getAISelection']();_0x212991['change'](()=>{const _0x67f6b2=this['_prepareTableInsertBelowPosition'](_0x29274b,_0x35b27b)||this['_getDefaultInsertBelowPosition'](_0x35b27b);this['insertContent'](_0x29274b,_0x67f6b2);});}['_getAISelection'](){const _0x438c50=this['editor']['model'],_0x27f08e=Array['from'](_0x438c50['markers']['getMarkersGroup'](w))['map'](_0x5661b9=>_0x5661b9['getRange']());return _0x438c50['createSelection'](_0x27f08e);}['_pasteHTMLUsingClipboard']({writer:_0x36fc3f,html:_0x31e81b,insertAt:_0x248f22}){const {view:_0x2d70d2}=this['editor']['editing'],_0x4206bb=this['editor']['plugins']['get'](_0x4244aa),_0x2ff2d9=new gt();_0x2ff2d9['setData']('text/html',_0x31e81b);const _0x12f2b9=new ClipboardEvent('paste',{'clipboardData':_0x2ff2d9}),_0x31ddbe=new _0x168cd6(_0x2d70d2,_0x12f2b9,{'dataTransfer':new _0x41db82(_0x2ff2d9)});_0x36fc3f['setSelection'](_0x248f22);const _0x3ce001=(_0xc009e5,_0x3ada4a)=>{_0x3ada4a['resultRange']&&_0x36fc3f['setSelection'](_0x3ada4a['resultRange']);};_0x4206bb['once']('contentInsertion',_0x3ce001,{'priority':'lowest'}),_0x2d70d2['document']['fire']('paste',_0x31ddbe),_0x4206bb['off']('contentInsertion',_0x3ce001);}['_getDefaultInsertBelowPosition'](_0x16015b){const {model:_0x4382d3}=this['editor'],_0x4aee80=Array['from'](_0x16015b['getSelectedBlocks']());return _0x4aee80['length']?_0x4382d3['createPositionAfter'](_0x4aee80['pop']()):_0x16015b['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x267e51,_0xa16efb){const {model:_0x2d918d,plugins:_0x278ec4}=this['editor'];if(_0x278ec4['has']('TableUtils')){const _0x136ace=_0x278ec4['get']('TableUtils')['getSelectedTableCells'](_0xa16efb);if(_0x136ace['length']){const _0x11cbfc=this['_getTableRowCountFromContent'](_0x267e51),_0x534128=this['_createEmptyTableRows'](_0x136ace,_0x11cbfc);return _0x2d918d['createPositionAt'](_0x534128,0x0);}}return null;}['_getTableRowCountFromContent'](_0x365e30){const _0x425b7d=this['editor']['plugins']['get']('TableUtils'),_0x34a12b=this['editor']['data']['parse'](_0x365e30),_0x523f66=Array['from'](_0x34a12b['getChildren']())['filter'](_0x33152d=>_0x33152d['is']('element','table'));let _0x2bc893=0x0;return _0x523f66['forEach'](_0x22dbda=>{_0x2bc893+=_0x425b7d['getRows'](_0x22dbda);}),_0x2bc893;}['_createEmptyTableRows'](_0x2d7641,_0x498217){const _0x3ca44c=this['editor']['plugins']['get']('TableUtils'),_0x3856a8=_0x3ca44c['getRowIndexes'](_0x2d7641),_0x45a657=_0x3ca44c['getColumnIndexes'](_0x2d7641),_0x192f43=_0x3856a8['last']+0x1,_0x3f8bf7=_0x45a657['first'],_0x16992e=_0x2d7641[0x0]['findAncestor']('table');for(let _0x4c50bd=0x0;_0x4c50bd<_0x498217;_0x4c50bd++)_0x3ca44c['insertRows'](_0x16992e,{'at':_0x192f43});return _0x16992e['getChild'](_0x192f43)['getChild'](_0x3f8bf7);}['_resetContentOfSelectedTableCells'](_0x2450f2,_0x585264){const {plugins:_0x2384db}=this['editor'],{model:_0x528044}=_0x2450f2;if(!_0x2384db['has']('TableUtils'))return;_0x2384db['get']('TableUtils')['getSelectedTableCells'](_0x585264)['length']&&_0x528044['deleteContent'](_0x585264);}}class x extends _0x29bd45{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x40cdb9('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x212093){super(_0x212093),this['name']='AIRequestError';}}function i(_0x5c8a30,_0x344fbd,_0x5ef7c0){const t=_0x5c8a30['t'];switch(_0x344fbd){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x5ef7c0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5ef7c0);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x5ef7c0);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x344fbd;}}class E extends _0x5646ef{['_commandDefinitions'];constructor(_0x16d36d,_0x521d8b){super(_0x16d36d),this['_commandDefinitions']=_0x521d8b,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x46d916,_0x2aad4a,_0x2f220e)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x2f220e));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x480bb1,_0x11bcfa,_0x5a5cd1)=>{this['enabledCommandsIds']=_0x5a5cd1?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x25f676=this['editor']['model'];this['_hasContext']=function(_0x40f1dc){const _0x3521ce=_0x40f1dc['document']['selection'];return _0x3521ce['isCollapsed']?0x0!==[..._0x3521ce['getSelectedBlocks']()]['length']&&![..._0x3521ce['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x40f1dc['hasContent'](_0x3521ce['getFirstRange']());}(_0x25f676);const _0x3c6b7f=_0x25f676['document']['selection'],_0x3b65e0=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1512b7 of _0x3c6b7f['getRanges']())for(const _0x112ad4 of _0x1512b7['getItems']())if(_0x112ad4['is']('element')&&_0x3b65e0['includes'](_0x112ad4['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x7b8ad8='',_0x315c77='',_0x5adac2='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x7b8ad8,_0x315c77,_0x5adac2);}}function F(_0x13f61b,_0x3774b2){const _0xcc8a60=new Set();for(const _0x429877 of _0x13f61b['values']())(_0x3774b2||!0x1===_0x429877['requiresContent'])&&_0xcc8a60['add'](_0x429877['id']);return Array['from'](_0xcc8a60);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x4b0a14(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4c649b,_0x6095e8,_0xf1832c){super(),this['editor']=_0x4c649b,this['textAdapter']=_0x6095e8,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xf1832c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1feb31,_0x138fcc,_0x40ef41)=>{this['view']['value']=this['_sanitizeHTML'](_0x40ef41);}),this['listenTo'](this['view'],'submitPrompt',(_0x2c0195,_0x4012e1)=>{const _0x1ed873=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4012e1,_0x1ed873,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x3984d7,query:_0x2ccd3f,htmlContent:_0x3c5368,label:_0x3b3ee7,mainActionLabel:_0x5c5ff8}){this['view']['prompt']=_0x3b3ee7,this['view']['mainAction']=_0x5c5ff8,this['initialContext']=_0x3c5368,_0x2ccd3f&&(this['view']['isRendered']?this['_handleQuery'](_0x2ccd3f,_0x3c5368,_0x3984d7,_0x3b3ee7):this['view']['once']('render',()=>{this['_handleQuery'](_0x2ccd3f,_0x3c5368,_0x3984d7,_0x3b3ee7);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x278aaf,_0x51e555,_0x47a3fe,_0x3bbc8e){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x51e555,this['previousQuery']=_0x278aaf,this['previousLabel']=_0x3bbc8e||_0x278aaf,this['previousActionId']=_0x47a3fe,new Promise(_0x282e4b=>{this['textAdapter']['makeRequest']({'query':_0x278aaf,'context':_0x51e555,'onData':_0x5bba74=>{this['currentResponse']=_0x5bba74,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x47a3fe})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x360979=>{_0x360979 instanceof R?this['view']['handleError'](_0x360979['message']):this['view']['handleError'](),_0x282e4b();})['finally'](()=>{this['stopProcessing'](),_0x282e4b();});});}['_parseAndNormalizeContent'](_0x4d56dc,_0x4e27bc=!0x1){const _0x3f3cdd=Q['exec'](_0x4d56dc);_0x4d56dc=_0x3f3cdd?_0x4d56dc['substring'](_0x3f3cdd[0x1]['length']):_0x4d56dc['length']<0x64&&!_0x4e27bc?'':this['_stripMarkdownSyntax'](_0x4d56dc);const _0x535b07=this['_domParser']['parseFromString'](_0x4d56dc,'text/html');if(_0x3f3cdd){const _0x446571=Array['from'](_0x535b07['body']['childNodes']);_0x446571['reverse']();for(const _0xa77a05 of _0x446571){if(_0xa77a05['nodeType']==Node['ELEMENT_NODE'])break;_0xa77a05['remove']();}}const _0x59df9f=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x535b07['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x59df9f);const _0x2dabac=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x85563e=this['editor']['data']['toModel'](_0x59df9f);return _0x2dabac||_0x85563e['markers']['clear'](),this['editor']['data']['stringify'](_0x85563e);}['_normalizeResponseHeadings'](_0x2c9d12){const _0x43ddaa=new _0x1e662c(this['editor']['editing']['view']['document']),_0x30679c=new _0x55411c({'name':/^h[1-5]$/}),_0x13ae7b=[];let _0x1177a7=!0x1;for(const _0x4bfa3f of _0x2c9d12)_0x4bfa3f['is']('element')&&_0x30679c['match'](_0x4bfa3f)&&(_0x13ae7b['push'](_0x4bfa3f),'h1'==_0x4bfa3f['name']&&(_0x1177a7=!0x0));if(_0x1177a7){for(const _0x4c5eed of _0x13ae7b)_0x43ddaa['rename']('h'+(parseInt(_0x4c5eed['name'][0x1])+0x1),_0x4c5eed);}}['_isH1TagSupportEnabled'](){const {data:_0x7fc011,editing:_0x23b794}=this['editor'],_0x2c931f=_0x7fc011['htmlProcessor']['toView']('<h1></h1>'),_0x25831f=_0x7fc011['toView'](_0x7fc011['toModel'](_0x2c931f));return!!_0x23b794['view']['domConverter']['viewToDom'](_0x25831f)['querySelector']('h1');}['_sanitizeHTML'](_0x36beef){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x36beef),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xbb22a7){const _0x38f96d=_0xbb22a7['trim']();return _0x38f96d['startsWith']('```html')?_0x38f96d['endsWith']('```')?_0x38f96d['substring'](0x7,_0x38f96d['length']-0x3):_0x38f96d['substring'](0x7):_0xbb22a7;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x1af63a){super(_0x1af63a),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3db38c=>i(_0x1af63a,'AI_'+_0x3db38c['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1af63a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1af63a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1af63a,'Stop'));const _0x27b6ab=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x27b6ab['if']('isVisible','ck-hidden',_0x3b8902=>!_0x3b8902)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x459852,_0x53d66c){const _0x93549=new _0x3b2709(this['locale']);return _0x93549['set']({'label':_0x459852,'class':_0x53d66c||'','isVisible':!0x0,'withText':!0x0}),_0x93549;}}class ct extends _0x224a57{['contentFieldView'];['copyButtonView'];constructor(_0x5d8c86,_0xde1262=''){super(_0x5d8c86),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1027b2=this['bindTemplate'];this['contentFieldView']=new bt(_0x5d8c86,_0xde1262),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1027b2['if']('isVisible','ck-hidden',_0x5b710a=>!_0x5b710a)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1027b2['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x229c14=!0x1;this['on']('change:value',(_0x45de1e,_0x3c3c58,_0x1fc0f8)=>{const _0x47009b=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1fc0f8),this['isProcessing']&&_0x47009b&&!_0x229c14&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3b9aea,_0x4095b9,_0x573e5e)=>{_0x229c14=!0x1,_0x573e5e?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x229c14=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x229c14=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4b7d62=this['locale'],_0x5ee5db=new _0x3b2709(this['locale']),_0x592c9c='ck-ai-form__copy-button';return _0x5ee5db['set']({'label':i(_0x4b7d62,'Copy'),'icon':_0x429393,'class':_0x592c9c,'tooltip':!0x0}),_0x5ee5db['bind']('isVisible')['to'](this,'value',_0x1bd1e7=>!!_0x1bd1e7),_0x5ee5db['bind']('isEnabled')['to'](this,'isProcessing',_0x425077=>!_0x425077),_0x5ee5db['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5ee5db['icon']=_0x158af4,_0x5ee5db['class']=_0x592c9c+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5ee5db['icon']=_0x429393,_0x5ee5db['class']=_0x592c9c;},0x3e8);}),_0x5ee5db;}['_copyHTMLToClipboard'](_0x3fca0b){const {window:_0x28f5bc,document:_0xf822c7}=_0x100eae;if(_0x28f5bc['ClipboardItem']){const {Blob:_0x337829,ClipboardItem:_0x58748e}=_0x28f5bc,_0x207f52=[new _0x58748e({'text/html':new _0x337829([_0x3fca0b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x337829([_0x3fca0b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x207f52);}else{const _0x305edd=_0xf822c7['createElement']('div');_0x305edd['style']['position']='absolute',_0x305edd['style']['left']='-9999px',_0x305edd['innerHTML']='<span>[</span>'+_0x3fca0b['innerHTML']+'<span>]</span>',_0xf822c7['body']['appendChild'](_0x305edd);const _0x98b636=_0xf822c7['createRange']();_0x98b636['setStartAfter'](_0x305edd['firstElementChild']),_0x98b636['setEndBefore'](_0x305edd['lastElementChild']);const _0x13f58a=_0x28f5bc['getSelection']();_0x13f58a['removeAllRanges'](),_0x13f58a['addRange'](_0x98b636),_0xf822c7['execCommand']('copy'),_0x305edd['remove']();}}}class bt extends _0x224a57{constructor(_0xb06d8f,_0x51e9c7=''){super(_0xb06d8f),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x51e9c7,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x4313e3){this['element']['innerHTML']=_0x4313e3;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4f3197=new _0x224a57(),_0x383a88=this['locale'],_0x24b2c1=new _0x1ba79e();return _0x24b2c1['isVisible']=!0x0,_0x4f3197['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x24b2c1,{'text':i(_0x383a88,'AI\x20is\x20writing...')}]}),_0x4f3197['render'](),_0x4f3197;}}class mt extends _0x224a57{constructor(_0x238b06,_0x1a3c51=''){super(_0x238b06);const _0x30b961=new _0x155397(),_0x27f174=this['bindTemplate'];this['set']('text',_0x1a3c51),_0x30b961['content']=_0x192700,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x30b961,{'text':_0x27f174['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x14965f,_0x43ffec){super(_0x14965f,_0x43ffec),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0xa034c9,_0x222833)=>{_0xa034c9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x222833());});}['_createSubmitButton'](){const _0x1499da=new _0x3b2709(this['locale']),_0x151b91=this['locale'];return _0x1499da['set']({'icon':it,'label':i(_0x151b91,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1499da['on']('execute',()=>{this['submit']();}),_0x1499da['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4e6ede,_0x2d332a)=>!_0x4e6ede&&_0x2d332a),_0x1499da;}['_createShowHistoryButton'](){const _0x2906be=new _0x3b2709(this['locale']),_0x5460ac=this['resultsView'],_0x26c364=this['locale'];_0x2906be['set']({'label':i(_0x26c364,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2906be['bind']('isOn')['to'](_0x5460ac,'isVisible'),_0x2906be['bind']('isEnabled')['to'](this,'isEnabled'),_0x2906be['on']('execute',()=>{_0x5460ac['isVisible']=!_0x5460ac['isVisible'],_0x5460ac['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x118299=()=>{_0x100eae['window']['requestAnimationFrame'](()=>{if(_0x11da0b(this['element'])){const _0x128f66=new _0x15f76d(this['queryView']['fieldView']['element']),_0x5c781e=_0x128f66['width'],_0xce7262='rtl'===_0x26c364['uiLanguageDirection']?'left':'right';_0x128f66['excludeScrollbarsAndBorders'](),_0x2906be['element']['style'][_0xce7262]=_0x5c781e-_0x128f66['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x118299),this['on']('render',_0x118299),_0x2906be;}['submit'](){const _0x26fe68=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x26fe68);}['focus'](_0x4ca6d4){-0x1===_0x4ca6d4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x22c52d){super(_0x22c52d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x22c52d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3fa10e=0x0;for(const _0x33f490 of this['items'])_0x3fa10e+=_0x33f490['items']['length'];return{'resultsCount':_0x3fa10e,'totalItemsCount':_0x3fa10e};}['_createClearHistoryButton'](){const _0x316e88=this['locale'],_0x55f763=new _0x3b2709(this['locale']);return _0x55f763['set']({'label':'('+i(_0x316e88,'Clear')+')','withText':!0x0}),_0x55f763['on']('execute',()=>this['fire']('clearHistory')),_0x55f763;}}class ut extends xt{constructor(_0x2598fc){super();const _0x7fb621=new wt(),_0x322ec5=new _0x3b2709(this['locale'],_0x7fb621);this['children']['add'](_0x322ec5),_0x322ec5['set']({'label':_0x2598fc['prompt'],'withText':!0x0}),_0x322ec5['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x2598fc['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x3f9d89{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2b936e,_0x84584a)=>{const _0x3ead90=os(_0x84584a['prompt']);for(const _0x5b7bad of this)if(_0x5b7bad!=_0x84584a&&os(_0x5b7bad['prompt'])===_0x3ead90){this['remove'](_0x5b7bad);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x1bd425=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x1bd425));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x29038a=>_0x29038a)));}}function os(_0x331438){return _0x331438['toLowerCase']()['trim']();}class k extends _0x224a57{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2ecabf,_0x22b6e4,_0x69f438=''){super(_0x2ecabf),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x2ecabf),this['contentArea']=new ct(_0x2ecabf,_0x69f438),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x68a89b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x22b6e4],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x68a89b['if']('isError','ck-hidden',_0x190b2f=>!_0x190b2f)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x81eaa8=0x1){-0x1===_0x81eaa8?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x19ca2c=this['locale'],_0x21a337=new lt(_0x19ca2c,{'queryView':{'label':i(_0x19ca2c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x19ca2c,'Empty\x20history'),'secondary':i(_0x19ca2c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x21a337['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4513f5,_0x593244)=>_0x4513f5&&!_0x593244),this['listenTo'](_0x21a337,'submit',(_0x5c8b92,_0x51d3f9)=>{this['prompt']=_0x51d3f9;const _0x72a13c=ft(_0x51d3f9);this['fire']('submitPrompt',_0x72a13c),_0x51d3f9['trim']()&&this['_promptHistory']['add']({'prompt':_0x72a13c},0x0);},{'priority':'high'}),_0x21a337;}['_createHistoryView'](){const _0x59cf94=new pt(this['locale']);return _0x59cf94['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x59cf94['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x59cf94;}['_createToolbar'](){const _0x121830=new at(this['locale']);return _0x121830['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x19d37e,_0x6c47f3,_0x593d1c)=>_0x19d37e&&!_0x6c47f3&&!!_0x593d1c),_0x121830['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x121830['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1926d0,_0xaa96ad,_0x197700)=>_0x1926d0&&!_0xaa96ad&&!!_0x197700),_0x121830['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x121830['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2ae7a0,_0x53e9db)=>_0x2ae7a0&&!_0x53e9db),_0x121830['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x121830['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x121830['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x121830;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2cc09c=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2cc09c,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x16b59c){const _0xf55367=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x16b59c||i(_0xf55367,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x29bd45{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x4f6a0a,a,x,_0x50a1ff];}constructor(_0x3d496d){super(_0x3d496d),_0x3d496d['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3d496d['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x3d496d['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3d496d['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4469d6}=this;this['_aiAdapter']=_0x4469d6['plugins']['get'](x),this['_dialog']=_0x4469d6['plugins']['get'](_0x50a1ff),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1eb127=new E(_0x4469d6,Array['from'](this['_commandDefinitions']['values']()));_0x4469d6['commands']['add']('showAIAssistant',_0x1eb127),_0x4469d6['ui']['componentFactory']['add']('aiCommands',_0x41ff0d=>{const _0x330d56=_0x506fc8(_0x41ff0d);return _0x330d56['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x330d56['buttonView']['set']({'label':i(_0x41ff0d,'AI\x20Commands'),'icon':_0x2ca237,'tooltip':!0x0}),_0x330d56['on']('execute',_0x3189c3=>this['_onExecute'](_0x3189c3['source']['id'])),_0x55b2b7(_0x330d56,_0x4469d6['ui']['view']['body'],function(_0x2730e2){const _0x29b721=o(_0x2730e2['config']['get']('ai.aiAssistant.commands'),_0x2730e2['locale']),_0x151717=U(_0x2730e2,_0x29b721)['filter'](_0x5cb742=>_0x5cb742['commands']['length']);if(0x1===_0x151717['length'])return U(_0x2730e2,_0x151717[0x0]['commands'])['map'](_0x2a7156=>({'id':_0x2a7156['id'],'label':_0x2a7156['label']}));return _0x151717['map'](_0x473923=>{const {groupId:_0x43a022,groupLabel:_0x1add01,commands:_0x4495a2}=_0x473923,_0x65c925=U(_0x2730e2,_0x4495a2)['map'](_0x1a3f3e=>({'id':_0x1a3f3e['id'],'label':_0x1a3f3e['label']}));return{'id':_0x43a022,'menu':_0x1add01||_0x43a022,'children':_0x65c925};});}(_0x4469d6),{'ariaLabel':i(_0x41ff0d,'AI\x20Commands')}),_0x330d56['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1eb127['on']('change:enabledCommandsIds',_0x2b45a2),_0x330d56['menuView']['once']('render',_0x2b45a2),_0x330d56;function _0x2b45a2(){_0x330d56['isEnabled']=_0x1eb127['enabledCommandsIds']['length']>0x0;for(const _0x3b384d of _0x330d56['menuView']['buttons'])_0x3b384d['isEnabled']=_0x1eb127['enabledCommandsIds']['includes'](_0x3b384d['id']);}}),_0x4469d6['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4ca644=>{const _0x5519a9=new _0x53eca6(_0x4ca644);_0x5519a9['buttonView']['set']({'label':i(_0x4ca644,'AI\x20Commands'),'icon':_0x2ca237}),_0x5519a9['bind']('isEnabled')['to'](_0x1eb127,'enabledCommandsIds',_0xafb33f=>_0xafb33f['length']>0x0);const _0x44d41a=o(_0x4469d6['config']['get']('ai.aiAssistant.commands'),_0x4ca644);return this['_populateMenuBarMenu'](_0x1eb127,_0x5519a9,_0x44d41a,_0x68b283=>this['_onExecute'](_0x68b283)),_0x5519a9;}),_0x4469d6['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4de04f=this['_createAIAssistantUIButton'](_0x3b2709);return _0x4de04f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4de04f;}),_0x4469d6['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x927b74=this['_createAIAssistantUIButton'](_0x5700d7);return _0x927b74['set']({'role':'menuitemcheckbox'}),_0x927b74;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4d3785=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2cac91;for(const _0x598e0a in _0x4d3785){const _0x1379a6=_0x598e0a,_0x37fce0=_0x4d3785[_0x1379a6];if('aiLicenseKeyValid'==_0x37fce0||'aiLicenseKeyInvalid'==_0x37fce0||'aiLicenseKeyExpired'==_0x37fce0||'aiLicenseKeyDomainLimit'==_0x37fce0||'aiLicenseKeyNotAllowed'==_0x37fce0||'aiLicenseKeyEvaluationLimit'==_0x37fce0||'aiLicenseKeyTrialLimit'==_0x37fce0||'aiLicenseKeyUsageLimit'==_0x37fce0){delete _0x4d3785[_0x1379a6],_0x2cac91=_0x37fce0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2cac91&&_0x4d3785['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2cac91&&_0x4d3785['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2cac91&&_0x4d3785['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2cac91&&_0x4d3785['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2cac91&&_0x4d3785['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2cac91&&_0x4d3785['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x2cac91&&_0x4d3785['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x54664a='',_0x99bc8a='',_0x4f0528='custom'){const _0x3905df=this['editor'],_0x4e6ef7=_0x3905df['editing']['view'],_0x19a051=_0x3905df['plugins']['get'](a),_0x5d9aac=_0x3905df['plugins']['get'](_0x4f6a0a);_0x19a051['showFakeVisualSelection']();const _0x46021e=new l(),_0x3e0747=new ClipboardEvent('copy',{'clipboardData':_0x46021e}),_0x1a3a4f=new _0x41db82(_0x46021e),_0xb66926=new _0x168cd6(_0x4e6ef7,_0x3e0747,{'dataTransfer':_0x1a3a4f});_0x5d9aac['_forceMarkersCopy']('comment',()=>{_0x4e6ef7['document']['fire']('copy',_0xb66926);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3905df,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x10dd4e=_0x1a3a4f['getData']('text/html');const _0xf89a60=_0x3905df['model']['document']['selection'],_0x5964e3=Array['from'](_0xf89a60['getRanges']());0x1===_0x5964e3['length']&&_0x5964e3[0x0]['isFlat']&&!_0xf89a60['getSelectedElement']()&&''!==_0x10dd4e['replace'](/&nbsp;/g,'')['trim']()&&(_0x10dd4e='<p>'+_0x10dd4e+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4f0528,'query':_0x54664a,'htmlContent':_0x10dd4e,'label':_0x99bc8a,'mainActionLabel':_[_0x3905df['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x59657e,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3acd8c['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x19a051['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x6c52c3=new Map(),_0x4abd46=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4606e5 of _0x4abd46)for(const _0x551132 of _0x4606e5['commands'])_0x6c52c3['set'](_0x551132['id'],{..._0x551132,'groupId':_0x4606e5['groupId'],'groupLabel':_0x4606e5['groupLabel']||_0x4606e5['groupId']});return _0x6c52c3;}['_createAIAssistantUIButton'](_0x4d9871){const _0x5f46a3=this['editor'],_0x1b814d=_0x5f46a3['commands']['get']('showAIAssistant'),_0x12a07b=new _0x4d9871(_0x5f46a3['locale']);return _0x12a07b['set']({'label':i(_0x5f46a3['locale'],'AI\x20Assistant'),'icon':_0x59657e,'isToggleable':!0x0}),_0x12a07b['bind']('isEnabled')['to'](_0x1b814d),_0x12a07b['bind']('isOn')['to'](this['_dialog'],'id',_0x32b847=>'aiAssistant'===_0x32b847),this['listenTo'](_0x12a07b,'execute',()=>{_0x12a07b['isOn']?this['hideUI']():_0x1b814d['execute']();}),_0x12a07b;}['_initView'](){const _0x4989e2=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x4989e2['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4989e2['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x444442,ui:{ariaLiveAnnouncer:_0x25c9f4}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5bdfb5,_0x459ac1,_0x405554)=>{const _0x6c84df=this['_aiAssistantController']['currentContext'];_0x405554?_0x25c9f4['announce'](i(_0x444442,'AI\x20is\x20writing')):_0x6c84df&&_0x25c9f4['announce'](i(_0x444442,'Generated\x20content:\x20%0',_0x6c84df),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x525f6d,_0x54a6a8,_0x5058a9)=>{if(_0x5058a9){const _0xdf327=this['_formView']['errorView']['text'];_0x25c9f4['announce'](i(_0x444442,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xdf327));}});}['_onExecute'](_0x261ec2){const _0x2058f7=this['_commandDefinitions']['get'](_0x261ec2),_0x367d7a=this['editor'],_0x2df51a=_0x367d7a['model']['document']['selection'],_0x56ac59=_0x367d7a['commands']['get']('showAIAssistant'),_0x3e0845=_0x367d7a['plugins']['get'](a),_0x50d34e=''+(_0x2058f7['groupId']!==K?_0x2058f7['groupLabel']+':\x20':'')+_0x2058f7['label'];if(!0x1!==_0x2058f7['requiresContent']&&_0x2df51a['isCollapsed']){const _0x1db18b=_0x46b51c(_0x2df51a['getSelectedBlocks']())||_0x367d7a['model']['schema']['getLimitElement'](_0x2df51a);_0x367d7a['model']['change'](_0x450155=>{_0x450155['setSelection'](_0x1db18b,'in');});}_0x3e0845['showFakeVisualSelection'](),_0x56ac59['execute'](_0x2058f7['prompt'],_0x50d34e,'command:'+_0x261ec2);}['_populateMenuBarMenu'](_0x1b0ca8,_0x229e32,_0x109fa8,_0x42a41f){const _0x1d082a=this['editor'],_0x51d38d=_0x1d082a['locale'],_0x414b57=new _0x1f29e6(_0x51d38d),_0x333c62=U(_0x1d082a,_0x109fa8)['filter'](_0x533b6c=>_0x533b6c['commands']['length']);0x1===_0x333c62['length']?this['_getMenuBarGroupButtons']({'command':_0x1b0ca8,'commands':_0x333c62[0x0]['commands'],'parentMenuView':_0x229e32,'onExecute':_0x42a41f})['forEach'](_0x21e7b2=>_0x414b57['items']['add'](_0x21e7b2)):_0x333c62['forEach'](({groupId:_0x634050,groupLabel:_0x38d19d,commands:_0x59f703})=>{const _0xef9393=new _0x596962(_0x51d38d,_0x229e32),_0x262287=new _0x53eca6(_0x51d38d),_0x5c429a=new _0x1f29e6(_0x51d38d),_0x47c25f=this['_getMenuBarGroupButtons']({'command':_0x1b0ca8,'commands':_0x59f703,'parentMenuView':_0x262287,'onExecute':_0x42a41f});_0x262287['buttonView']['set']({'label':_0x38d19d||_0x634050}),_0x262287['delegate']('execute')['to'](_0x229e32),_0x5c429a['items']['addMany'](_0x47c25f),_0x262287['panelView']['children']['add'](_0x5c429a),_0xef9393['children']['add'](_0x262287),_0x414b57['items']['add'](_0xef9393);}),_0x229e32['panelView']['children']['add'](_0x414b57);}['_getMenuBarGroupButtons']({command:_0x640952,commands:_0xe495f3,parentMenuView:_0x1dcaf9,onExecute:_0x416efe}){const _0x4bcdea=this['editor'],_0x1d99e6=_0x4bcdea['locale'];return U(_0x4bcdea,_0xe495f3)['map'](_0x98af97=>{const _0x279576=new _0x596962(_0x1d99e6,_0x1dcaf9),_0x5d966b=new _0x5700d7(_0x1d99e6);return _0x5d966b['set']({'label':_0x98af97['label']}),_0x5d966b['delegate']('execute')['to'](_0x1dcaf9),_0x5d966b['on']('execute',()=>_0x416efe(_0x98af97['id'])),_0x5d966b['bind']('isEnabled')['to'](_0x640952,'enabledCommandsIds',_0x449e28=>_0x449e28['includes'](_0x98af97['id'])),_0x279576['children']['add'](_0x5d966b),_0x279576;});}}function T(_0x52f673,_0x5b2d03){return void 0x0!==_0x52f673['order']&&void 0x0===_0x5b2d03['order']?0x1:void 0x0===_0x52f673['order']&&void 0x0!==_0x5b2d03['order']?-0x1:void 0x0!==_0x52f673['order']&&void 0x0!==_0x5b2d03['order']?_0x52f673['order']-_0x5b2d03['order']:0x0;}function U(_0x7525f5,_0x4922cb){_0x4922cb['sort'](T);const _0x528f43={},_0x1547bf=[];for(const _0x3ae911 of _0x4922cb)if(void 0x0!==_0x3ae911['order']){if(_0x3ae911['order']in _0x528f43)throw new _0x40cdb9('ai-commands-config-order-collision',_0x7525f5,{'conflictingDefinitions':[_0x3ae911,_0x528f43[_0x3ae911['order']]]});_0x528f43[_0x3ae911['order']]=_0x3ae911,_0x1547bf['splice'](_0x3ae911['order'],0x0,_0x3ae911);}else _0x1547bf['push'](_0x3ae911);return _0x1547bf;}class At extends _0x29bd45{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x303856){super(_0x303856);const _0x9566db=_0x303856['config'],_0xe00220=_0x303856['locale'];_0x9566db['define']('ai.aiAssistant.preserveComments',!0x0),_0x9566db['define']('ai.aiAssistant.commands',_t(_0xe00220)),_0x9566db['define']('ai.aiAssistant.extraCommandGroups',[]),_0x9566db['define']('ai.aiAssistant.removeCommands',[]);let _0x457b1b=o(_0x9566db['get']('ai.aiAssistant.commands'),_0xe00220);const _0x1fedd6=_0x9566db['get']('ai.aiAssistant.extraCommandGroups'),_0x2f9dc4=_0x9566db['get']('ai.aiAssistant.removeCommands');_0x1fedd6['forEach'](_0x1485da=>{const _0x373595=_0x457b1b['find'](_0x5d6398=>_0x5d6398['groupId']===_0x1485da['groupId']);_0x373595?_0x373595['commands']=_0x373595['commands']['concat'](_0x1485da['commands']):_0x457b1b['push'](_0x1485da);}),_0x457b1b=_0x457b1b['filter'](_0x4d099c=>!_0x2f9dc4['includes'](_0x4d099c['groupId'])),_0x457b1b['forEach'](_0x5a5f8c=>{_0x5a5f8c['commands']=_0x5a5f8c['commands']['filter'](_0x376b3e=>!_0x2f9dc4['includes'](_0x376b3e['id']));}),_0x9566db['set']('ai.aiAssistant.commands',_0x457b1b);}}function _t(_0x26e98c){return[{'groupId':'editOrReview','groupLabel':i(_0x26e98c,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x26e98c,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x26e98c,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x26e98c,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x26e98c,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x26e98c,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x26e98c,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x26e98c,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x26e98c,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x26e98c,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x26e98c,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x26e98c,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x26e98c,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x26e98c,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x26e98c,'Change\x20style'),'commands':[{'id':'business','label':i(_0x26e98c,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x26e98c,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x26e98c,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x26e98c,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x26e98c,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x26e98c,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x26e98c,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x26e98c,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x26e98c,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x26e98c,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x26e98c,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x26e98c,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x26e98c,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x29bd45{['abortController'];static get['requires'](){return[x];}constructor(_0x199d4a){super(_0x199d4a),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xf12bf7){return this['sendRequest'](_0xf12bf7)['catch'](_0x42b7b1=>{if(_0x42b7b1 instanceof R)return Promise['reject'](_0x42b7b1);if('AbortError'==_0x42b7b1['name'])return Promise['resolve']();throw console['error'](_0x42b7b1),new _0x40cdb9('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x55f357,_0x20d12b){const _0x5a17f7=this['editor']['locale'],_0x35fd33={'Content-Type':'application/json'};if('object'==typeof _0x55f357)Object['assign'](_0x35fd33,_0x55f357);else{if(_0x55f357)try{const _0x5ab85f=await _0x55f357(_0x20d12b);Object['assign'](_0x35fd33,_0x5ab85f);}catch{return Promise['reject'](new R(i(_0x5a17f7,'AI_ERROR_GET_HEADERS')));}}return _0x35fd33;}async['_prepareRequestParameters'](_0x5f0908,_0x5f504e){const _0x58b2b6=this['editor']['locale'];if('object'==typeof _0x5f0908)return _0x5f0908;try{return await _0x5f0908(_0x5f504e);}catch{return Promise['reject'](new R(i(_0x58b2b6,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4c5d3f){super(_0x4c5d3f),_0x4c5d3f['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4c5d3f['config']['get']('ai.openAI.requestParameters')||_0x4c5d3f['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4c5d3f['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4c5d3f['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4c5d3f['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3524b5,context:_0x38c453,onData:_0x4b1fc9,actionId:_0x1a5678}){const _0x2b3301=this['editor']['locale'],_0x2ba5ae=await this['prepareMessages'](_0x3524b5,_0x38c453,_0x1a5678),_0x557874=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1a5678),_0x41b85e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1a5678),_0x53d262={'messages':_0x2ba5ae,..._0x41b85e},_0x243eb6={'method':'POST','headers':_0x557874,'body':JSON['stringify'](_0x53d262),'signal':this['abortController']['signal']},_0x5a6681=await fetch(this['_apiUrl'],_0x243eb6);if(_0x5a6681['ok'])return _0x41b85e['stream']?await this['_readStreamableResponse'](_0x5a6681,_0x4b1fc9):await this['_readStaticResponse'](_0x5a6681,_0x4b1fc9),Promise['resolve']();{const _0x1d68c8=await _0x5a6681['text']();return _0x1d68c8['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2b3301,'AI_ERROR_CONTEXT_LENGTH'))):_0x1d68c8['includes']('Moderation')?Promise['reject'](new R(i(_0x2b3301,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1d68c8));}}async['prepareMessages'](_0x56991c,_0x7e671a,_0x2606b3){let _0x1b29aa,_0x8b975b;return _0x7e671a?(_0x1b29aa='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x8b975b='Instruction:\x0a'+_0x56991c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x7e671a):(_0x1b29aa='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x8b975b=_0x56991c),[{'role':'system','content':_0x1b29aa},{'role':'user','content':_0x8b975b}];}async['_readStreamableResponse'](_0x1449f7,_0x545849){const _0x2efa4d=_0x1449f7['body']['getReader'](),_0x1e9aca=new TextDecoder();let _0x2160ff='',_0x27d2e6='',_0x573405='',_0x559dc1=!0x1;for(;!_0x559dc1;){const {done:_0x573834,value:_0x3e6522}=await _0x2efa4d['read'](),_0x4ad84f=_0x2160ff+_0x1e9aca['decode'](_0x3e6522);let _0x24e547='';_0x559dc1=_0x573834;try{_0x24e547=this['_cleanUpData'](_0x4ad84f),_0x2160ff='';}catch{_0x2160ff=_0x4ad84f;continue;}_0x27d2e6+=_0x24e547,!_0x559dc1&&this['_isBufferIncomplete'](_0x27d2e6)||_0x27d2e6&&(_0x573405+=_0x27d2e6,_0x27d2e6='',_0x545849(_0x573405));}return Promise['resolve']();}async['_readStaticResponse'](_0x52383d,_0x3d1aa3){return _0x3d1aa3((await _0x52383d['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x46e6ec){const _0x4c3ce2=_0x46e6ec['split']('<')['length']!==_0x46e6ec['split']('>')['length'],_0x170abe=_0x46e6ec['length']<0x1e;return _0x4c3ce2&&_0x170abe;}['_cleanUpData'](_0x2148fc){return _0x2148fc['split'](/\n(?![^{]*\})/g)['map'](_0x3856c8=>_0x3856c8['replace']('data:\x20',''))['filter'](_0x29686f=>_0x29686f&&_0x29686f['length']>0x0&&'[DONE]'!==_0x29686f)['map'](_0x1bcefe=>{const {choices:_0x15ad51}=JSON['parse'](_0x1bcefe);if(_0x15ad51[0x0]?.['delta']?.['content'])return _0x15ad51[0x0]['delta']['content'];})['filter'](_0x3dafb1=>_0x3dafb1)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5baa89){super(_0x5baa89),_0x5baa89['config']['get']('ai.aws.requestParameters')||_0x5baa89['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x5baa89['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5baa89['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5baa89['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5baa89['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x50419b,context:_0x420362,onData:_0x524438,actionId:_0xc741f2}){const {model:_0x36649e,stream:_0x1cef98,..._0x4d60ce}=await this['_prepareRequestParameters'](this['_requestParameters'],_0xc741f2),_0x466f10={'prompt':await this['preparePrompt'](_0x50419b,_0x420362,_0x36649e,_0xc741f2),..._0x4d60ce};this['_apiUrl']?await this['_processProxyRequest'](_0x466f10,_0x36649e,_0x1cef98,_0x524438,_0xc741f2):await this['_processAWSRequest'](_0x466f10,_0x36649e,_0x1cef98,_0x524438);}async['preparePrompt'](_0x1283e7,_0x2566d0,_0x511819,_0x190f50){let _0xc60326,_0x2fb853;return _0x2566d0?(_0xc60326='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x2fb853='Instruction:\x0a'+_0x1283e7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2566d0):(_0xc60326='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x2fb853=_0x1283e7),'meta.llama'==this['getModelFamily'](_0x511819)?'<<SYS>>\x0a'+_0xc60326+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2fb853+'\x0a[/INST]':'Human:\x0a'+_0xc60326+'\x0a'+_0x2fb853+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1166ce){if(/^anthropic\.claude/['test'](_0x1166ce))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1166ce))return'ai21.j2';if(/^cohere\.command/['test'](_0x1166ce))return'cohere.command';if(/^meta\.llama/['test'](_0x1166ce))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1166ce));}async['_processProxyRequest'](_0x2ba1f2,_0x4db421,_0x2bfebc,_0x469206,_0x44daa5){const _0x120733={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x44daa5),'body':JSON['stringify']({..._0x2ba1f2,'model':_0x4db421,'stream':_0x2bfebc}),'signal':this['abortController']['signal']},_0x5b550f=await fetch(this['_apiUrl'],_0x120733);_0x2bfebc?await this['_readStreamableResponse'](_0x5b550f,_0x4db421,_0x469206):await this['_readStaticResponse'](_0x5b550f,_0x4db421,_0x469206);}async['_processAWSRequest'](_0x4156a7,_0x132ff4,_0x330a7d,_0x17f2ce){const _0x40dbaf=new _0x3c59b0(this['_bedrockClientConfig']),_0x1ba464={'body':JSON['stringify'](_0x4156a7),'contentType':'application/json','accept':'application/json','modelId':_0x132ff4};let _0x3ab71e;if(_0x330a7d){const _0x1ec668=new _0x3875c7(_0x1ba464);_0x3ab71e=await _0x40dbaf['send'](_0x1ec668,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3ab71e,_0x132ff4,_0x17f2ce);}else{const _0x38fd5f=new _0x23ebfb(_0x1ba464);_0x3ab71e=await _0x40dbaf['send'](_0x38fd5f,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3ab71e,_0x132ff4,_0x17f2ce);}}async['_readAsyncIterableResponse'](_0x36b061,_0x2ce08c,_0x4cf62c){const _0x4b2cdc=_0x36b061['body'],_0x57a505=new TextDecoder('utf-8');let _0x465af6='';for await(const _0xfba06d of _0x4b2cdc)if(_0xfba06d['chunk']){const _0x208f8e=_0x57a505['decode'](_0xfba06d['chunk']['bytes']),_0x3777f0=JSON['parse'](_0x208f8e);_0x465af6+=this['_getGeneratedText'](_0x3777f0,_0x2ce08c),_0x4cf62c(_0x465af6);}return Promise['resolve']();}async['_readStreamableResponse'](_0xeed5c3,_0x206137,_0x1963fd){const _0x448644=_0xeed5c3['body'],_0x13156e=new TextDecoder('utf-8'),_0x408db6=_0x448644['getReader']();let _0x3f0ed1='',_0x336f9b='',_0x142ebc=!0x1;for(;!_0x142ebc;){const {done:_0x5c75bc,value:_0x4d09c1}=await _0x408db6['read']();if(_0x142ebc=_0x5c75bc,_0x142ebc)break;const _0x26117b=(_0x3f0ed1+_0x13156e['decode'](_0x4d09c1))['split']('\x0a')['map'](_0xbfbea6=>{try{return _0x3f0ed1='',JSON['parse'](_0xbfbea6);}catch{return _0x3f0ed1=_0xbfbea6,null;}})['filter'](_0x3932f2=>null!==_0x3932f2);_0x26117b['length']&&(_0x336f9b+=_0x26117b['map'](_0x197a3=>this['_getGeneratedText'](_0x197a3,_0x206137))['join'](''),_0x1963fd(_0x336f9b));}return Promise['resolve']();}async['_readStaticResponse'](_0xf49c2d,_0xc953a0,_0x590a90){let _0x3c5275;return _0x3c5275=_0xf49c2d instanceof Response?await _0xf49c2d['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0xf49c2d['body'])),(_0x590a90(this['_getGeneratedText'](_0x3c5275,_0xc953a0)),Promise['resolve']());}['_getGeneratedText'](_0x5cdead,_0x21df74){switch(this['getModelFamily'](_0x21df74)){case'anthropic.claude':return _0x5cdead['completion'];case'ai21.j2':return _0x5cdead['completions'][0x0]['data']['text'];case'cohere.command':return _0x5cdead['generations'][0x0]['text'];case'meta.llama':return _0x5cdead['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
23
+ import{Plugin as _0x2b6c54,Command as _0x1dccc8}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x304d4d,IconCheck as _0xcff105,IconError as _0x2b859a,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x50f945,IconRobotPencil as _0x343916}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x22b484,CKEditorError as _0x21c9cb,ObservableMixin as _0x54cca6,global as _0x57a210,isVisible as _0x2146f8,Rect as _0x69d59,Collection as _0x1dfbd0,FocusTracker as et,KeystrokeHandler as rt,first as _0x596ae9}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x2e9743,View as _0x14eb86,SpinnerView as _0x2919c2,IconView as _0x33f3c5,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0xd35e38,createDropdown as _0x5f1cff,addMenuToDropdown as _0x2cb014,MenuBarMenuView as _0x459809,MenuBarMenuListItemButtonView as _0x1b20a1,DialogViewPosition as _0x4165ed,MenuBarMenuListView as _0x393361,MenuBarMenuListItemView as _0x32dda9}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x205f38,ClipboardMarkersUtils as _0x3704da}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x3b7ecc,ViewDataTransfer as _0x2f0709,ViewUpcastWriter as _0x26eafd,Matcher as _0x34d36b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x541297,InvokeModelWithResponseStreamCommand as _0x4b1a54,InvokeModelCommand as _0x88711c}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x39f2bf,_0x456ab6){const _0x531b85=(0x0,_0x456ab6['t'])('Other');return _0x39f2bf['length']?'groupId'in _0x39f2bf[0x0]?_0x39f2bf:[{'groupId':K,'groupLabel':_0x531b85,'order':0x1/0x0,'commands':_0x39f2bf}]:[{'groupId':K,'groupLabel':_0x531b85,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x2b6c54{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xc616b5}=this,_0x29fbf6=['ck-fake-ai-selection'];_0xc616b5['config']['get']('ai.useTheme')&&_0x29fbf6['push']('ck-ai-assistant-ui_theme'),_0xc616b5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x29fbf6,'priority':0xc}}),_0xc616b5['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x12f236,{writer:_0x517746})=>{if(!_0x12f236['markerRange']['isCollapsed'])return null;const _0x505c7c=_0x517746['createUIElement']('span');return _0x517746['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x505c7c),_0x505c7c;}});}['afterInit'](){!async function(_0x1cd050){const _0x4f7444=_0x1b167b([0x4c,0x4f,0x50,0x31,0x4a,0x7a,0x4d,0x69,0x59,0x45,0x49,0x57,0x6e,0x62,0x39,0x68,0x52,0x79,0x32,0x34,0x56,0x73,0x48,0x42,0x43,0x4b,0x30,0x64,0x78,0x65,0x54,0x58,0x36,0x6a,0x33,0x76,0x37,0x41,0x70,0x4e,0x6b,0x72,0x63,0x6d,0x71,0x51,0x38,0x6f,0x61,0x53,0x74,0x77,0x6c,0x5a,0x75,0x46,0x66,0x67,0x55,0x44,0x35,0x47]),_0xea1269=0x537cf9ac,_0x5188fb=0x537b89bc^_0xea1269,_0x572d16=window[_0x1b167b([0x44,0x61,0x74,0x65])][_0x1b167b([0x6e,0x6f,0x77])](),_0x485081=_0x1cd050[_0x1b167b([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x28996b=new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1c1627=>{_0x485081[_0x1b167b([0x6f,0x6e,0x63,0x65])](_0x1b167b([0x72,0x65,0x61,0x64,0x79]),_0x1c1627);}),_0x4222f3={[_0x1b167b([0x6b,0x74,0x79])]:_0x1b167b([0x45,0x43]),[_0x1b167b([0x75,0x73,0x65])]:_0x1b167b([0x73,0x69,0x67]),[_0x1b167b([0x63,0x72,0x76])]:_0x1b167b([0x50,0x2d,0x32,0x35,0x36]),[_0x1b167b([0x78])]:_0x1b167b([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x1b167b([0x79])]:_0x1b167b([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x1b167b([0x61,0x6c,0x67])]:_0x1b167b([0x45,0x53,0x32,0x35,0x36])},_0x7c6404=_0x485081[_0x1b167b([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1b167b([0x67,0x65,0x74])](_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x15061c(){let _0x12248b,_0x43c792=null,_0x31c22d=null;try{if(_0x7c6404==_0x1b167b([0x47,0x50,0x4c]))return _0x1b167b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x12248b=_0xb4b751(),!_0x12248b)return _0x1b167b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x12248b[_0x1b167b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x31c22d=_0x536ac2(_0x12248b[_0x1b167b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x12248b[_0x1b167b([0x6a,0x74,0x69])])),await _0x40c64e()?_0x6ba98b()?_0x4dc287()?_0x1b167b([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x506dc3()?(_0x12248b[_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1b167b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x43c792=_0x45f60d(_0x1b167b([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x12248b[_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1b167b([0x74,0x72,0x69,0x61,0x6c])&&(_0x43c792=_0x45f60d(_0x1b167b([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2fa327()):_0x1b167b([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1b167b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1b167b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1b167b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4dc287(){const _0x57d9d3=[_0x1b167b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1b167b([0x74,0x72,0x69,0x61,0x6c])][_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12248b[_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x572d16/0x3e8:0xe10*_0x5188fb;return _0x12248b[_0x1b167b([0x65,0x78,0x70])]<_0x57d9d3;}function _0x6ba98b(){const _0xdfffcd=_0x12248b[_0x1b167b([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xdfffcd&&(!!_0xdfffcd[_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b167b([0x2a]))||!!_0xdfffcd[_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b167b([0x41,0x49])));}function _0x506dc3(){const _0x2e1b8d=_0x12248b[_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2e1b8d||0x0==_0x2e1b8d[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1232a6}=new URL(window[_0x1b167b([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2e1b8d[_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1232a6))return!0x0;const _0x310358=_0x1232a6[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])](_0x1b167b([0x2e]));return _0x2e1b8d[_0x1b167b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x35b95f=>_0x35b95f[_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b167b([0x2a])))[_0x1b167b([0x6d,0x61,0x70])](_0x10c812=>_0x10c812[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])](_0x1b167b([0x2e])))[_0x1b167b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x18396a=>_0x18396a[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x310358[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1b167b([0x6d,0x61,0x70])](_0x1e0754=>Array(_0x310358[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1e0754[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1b167b([0x66,0x69,0x6c,0x6c])](_0x1e0754[0x0]===_0x1b167b([0x2a])?_0x1b167b([0x2a]):'')[_0x1b167b([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1e0754))[_0x1b167b([0x73,0x6f,0x6d,0x65])](_0x17d088=>_0x310358[_0x1b167b([0x65,0x76,0x65,0x72,0x79])]((_0x54d19a,_0x47fc5e)=>_0x17d088[_0x47fc5e]===_0x54d19a||_0x17d088[_0x47fc5e]===_0x1b167b([0x2a])));}function _0x2fa327(){return _0x43c792&&_0x31c22d?new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x232ff9,_0x1ad934)=>{_0x43c792[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x232ff9,_0x1ad934),_0x31c22d[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x3e295f=>{_0x3e295f!=_0x1b167b([0x56,0x61,0x6c,0x69,0x64])&&_0x232ff9(_0x3e295f);},_0x1ad934);}):_0x43c792||_0x31c22d||_0x1b167b([0x56,0x61,0x6c,0x69,0x64]);}}function _0x536ac2(_0x194f36,_0x1c671b){return new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x37f779=>{if(_0x4c01b0())return _0x37f779(_0x1b167b([0x56,0x61,0x6c,0x69,0x64]));_0x5758c6(),_0x485081[_0x1b167b([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1b167b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x41f638=!0x1;const _0x20b1fd=_0x22b484();function _0x2d0f7c(_0x248e29){return!!_0x248e29&&(typeof _0x248e29===_0x1b167b([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x248e29===_0x1b167b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x248e29[_0x1b167b([0x74,0x68,0x65,0x6e])]===_0x1b167b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x248e29[_0x1b167b([0x63,0x61,0x74,0x63,0x68])]===_0x1b167b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x538e00(_0x454387){_0x4ff6c7(_0x454387)[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x3b0d72=>{if(!_0x3b0d72||_0x3b0d72[_0x1b167b([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1b167b([0x6f,0x6b]))return _0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x58a798(_0x449d38(_0x20b1fd+_0x1c671b))!=_0x3b0d72[_0x1b167b([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1b167b([0x56,0x61,0x6c,0x69,0x64]);})[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x28d55c=>(_0x4ddb67(),_0x28d55c),()=>{const _0x5ff8a9=_0x2b7cac();return null==_0x5ff8a9?(_0x4ddb67(),_0x1b167b([0x56,0x61,0x6c,0x69,0x64])):_0x1b167b(_0x572d16-_0x5ff8a9>(0x77707dac^_0xea1269)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x37f779)[_0x1b167b([0x63,0x61,0x74,0x63,0x68])](()=>{_0x37f779(_0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2ba6cd=0x534a172c^_0xea1269;function _0x4ddb67(){const _0x53f0cb=_0x1b167b([0x6c,0x6c,0x63,0x74,0x2d])+_0x58a798(_0x449d38(_0x194f36)),_0x2e784a=_0x361ca5(_0x58a798(window[_0x1b167b([0x4d,0x61,0x74,0x68])][_0x1b167b([0x63,0x65,0x69,0x6c])](_0x572d16/_0x2ba6cd)));window[_0x1b167b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1b167b([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x53f0cb,_0x2e784a);}function _0x2b7cac(){const _0x3a3dd6=_0x1b167b([0x6c,0x6c,0x63,0x74,0x2d])+_0x58a798(_0x449d38(_0x194f36)),_0x2d96e5=window[_0x1b167b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1b167b([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3a3dd6);return _0x2d96e5?window[_0x1b167b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x361ca5(_0x2d96e5),0x10)*_0x2ba6cd:null;}function _0x4ff6c7(_0x5500d6){return new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x59d430,_0x5d4331)=>{_0x5500d6[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x59d430,_0x5d4331),window[_0x1b167b([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5d4331,0x537d2d6c^_0xea1269);});}}_0x485081[_0x1b167b([0x6f,0x6e])](_0x1b167b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x203e28,_0x7e0cfb)=>{if(_0x7e0cfb[0x0]!=_0x194f36)return _0x37f779(_0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x7e0cfb[0x1]={..._0x7e0cfb[0x1],[_0x1b167b([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x20b1fd};},{[_0x1b167b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1b167b([0x68,0x69,0x67,0x68])}),_0x485081[_0x1b167b([0x6f,0x6e])](_0x1b167b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xff4d99=>{_0x2d0f7c(_0xff4d99[_0x1b167b([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x41f638=!0x0,_0x538e00(_0xff4d99[_0x1b167b([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1b167b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1b167b([0x6c,0x6f,0x77])}),_0x28996b[_0x1b167b([0x74,0x68,0x65,0x6e])](()=>{_0x41f638||_0x37f779(_0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4c01b0(){return _0x485081[_0x1b167b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1b167b([0x76,0x69,0x65,0x77])][_0x1b167b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1b167b([0x61,0x75,0x74,0x6f]);}function _0x5758c6(){_0x485081[_0x1b167b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1b167b([0x76,0x69,0x65,0x77])][_0x1b167b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1b167b([0x61,0x75,0x74,0x6f]);}}function _0x45f60d(_0x25f721){const _0x4a4af5=[new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xc50812=>setTimeout(_0xc50812,0x5375c760^_0xea1269)),_0x28996b[_0x1b167b([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x296688=>{let _0x1709dc=0x0;_0x485081[_0x1b167b([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b167b([0x6f,0x6e])](_0x1b167b([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x54dc11,_0x12c2aa)=>{_0x12c2aa[0x0][_0x1b167b([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1709dc++,_0x1709dc==(0x537cf854^_0xea1269)&&(_0x296688(),_0x54dc11[_0x1b167b([0x6f,0x66,0x66])]());});}))];return window[_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1b167b([0x72,0x61,0x63,0x65])](_0x4a4af5)[_0x1b167b([0x74,0x68,0x65,0x6e])](()=>_0x25f721);}async function _0x180a44(){await _0x28996b,_0x485081[_0x1b167b([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b167b([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x390be9,_0x485081[_0x1b167b([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b167b([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x390be9,_0x485081[_0x1b167b([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1b167b([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x75bd7c(_0x4eca6f){const _0x5b4247=_0x4c879f();_0x485081[_0x5b4247]=_0x1b167b([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4eca6f,_0x4eca6f!=_0x1b167b([0x56,0x61,0x6c,0x69,0x64])&&_0x180a44();}function _0x4c879f(){const _0x5874da=window[_0x1b167b([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1b167b([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1b167b([0x6e,0x6f,0x77])]())[_0x1b167b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1b167b([0x2e]),'');let _0x466e2b=_0x1b167b([0x4c]);for(let _0x3fb31a=0x0;_0x3fb31a<_0x5874da[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3fb31a+=0x2){let _0x34c320=window[_0x1b167b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5874da[_0x1b167b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3fb31a,_0x3fb31a+0x2));_0x34c320>=_0x4f7444[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x34c320-=_0x4f7444[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x466e2b+=_0x4f7444[_0x34c320];}return _0x466e2b;}function _0xb4b751(){const _0x1352e9=_0x7c6404[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])](_0x1b167b([0x2e]));if(0x3!=_0x1352e9[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x31f4d6(_0x1352e9[0x1]);function _0x31f4d6(_0x5cd6ab){const _0x1832e9=_0x1fb99f(_0x5cd6ab);return _0x1832e9&&_0x4a9c0b()?_0x1832e9:null;function _0x4a9c0b(){const _0x53ef5d=_0x1832e9[_0x1b167b([0x6a,0x74,0x69])],_0x4462c4=window[_0x1b167b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x53ef5d[_0x1b167b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x53ef5d[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3c3358={..._0x1832e9,[_0x1b167b([0x6a,0x74,0x69])]:_0x53ef5d[_0x1b167b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x53ef5d[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3c3358[_0x1b167b([0x76,0x63])],_0x449d38(_0x3c3358)==_0x4462c4;}}}async function _0x40c64e(){let _0x534060=!0x0;try{const _0x66e64e=_0x7c6404[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])](_0x1b167b([0x2e])),[_0x53cc10,_0x47e97c,_0x110fe0]=_0x66e64e;return _0x2f9e63(_0x53cc10),await _0x3ae43f(_0x53cc10,_0x47e97c,_0x110fe0),_0x534060;}catch{return!0x1;}function _0x2f9e63(_0x5cdef3){const _0x579b3f=_0x1fb99f(_0x5cdef3);_0x579b3f&&_0x579b3f[_0x1b167b([0x61,0x6c,0x67])]==_0x1b167b([0x45,0x53,0x32,0x35,0x36])||(_0x534060=!0x1);}async function _0x3ae43f(_0x5c3e16,_0x34f026,_0x5e7701){const _0x498cd7=window[_0x1b167b([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1b167b([0x66,0x72,0x6f,0x6d])](_0x541b68(_0x5e7701),_0x5727a7=>_0x5727a7[_0x1b167b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x27464d=new window[(_0x1b167b([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1b167b([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5c3e16+_0x1b167b([0x2e])+_0x34f026),_0x8af9a8=window[_0x1b167b([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1b167b([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x8af9a8)return;const _0x525c51=await _0x8af9a8[_0x1b167b([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1b167b([0x6a,0x77,0x6b]),_0x4222f3,{[_0x1b167b([0x6e,0x61,0x6d,0x65])]:_0x1b167b([0x45,0x43,0x44,0x53,0x41]),[_0x1b167b([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1b167b([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1b167b([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x8af9a8[_0x1b167b([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1b167b([0x6e,0x61,0x6d,0x65])]:_0x1b167b([0x45,0x43,0x44,0x53,0x41]),[_0x1b167b([0x68,0x61,0x73,0x68])]:{[_0x1b167b([0x6e,0x61,0x6d,0x65])]:_0x1b167b([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x525c51,_0x498cd7,_0x27464d)||(_0x534060=!0x1);}}function _0x1fb99f(_0x3a86ab){return _0x3a86ab[_0x1b167b([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1b167b([0x65,0x79]))?JSON[_0x1b167b([0x70,0x61,0x72,0x73,0x65])](_0x541b68(_0x3a86ab)):null;}function _0x541b68(_0x449667){return window[_0x1b167b([0x61,0x74,0x6f,0x62])](_0x449667[_0x1b167b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1b167b([0x2b]))[_0x1b167b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1b167b([0x2f])));}function _0x449d38(_0x383f26){let _0x4e86fb=0x1505;function _0x160679(_0x3e3954){for(let _0xeb5d74=0x0;_0xeb5d74<_0x3e3954[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xeb5d74++){const _0x2c74ee=_0x3e3954[_0x1b167b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0xeb5d74);_0x4e86fb=(_0x4e86fb<<0x5)+_0x4e86fb+_0x2c74ee,_0x4e86fb&=_0x4e86fb;}}function _0x53d108(_0x348041){Array[_0x1b167b([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x348041)?_0x348041[_0x1b167b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x53d108):_0x348041&&typeof _0x348041==_0x1b167b([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1b167b([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x348041)[_0x1b167b([0x73,0x6f,0x72,0x74])]()[_0x1b167b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x377b98,_0x209c3e])=>{_0x160679(_0x377b98),_0x53d108(_0x209c3e);}):_0x160679(window[_0x1b167b([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x348041));}return _0x53d108(_0x383f26),_0x4e86fb>>>0x0;}function _0x58a798(_0x31ead5){return _0x31ead5[_0x1b167b([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1b167b([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1b167b([0x30]));}function _0x361ca5(_0x587076){return _0x587076[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1b167b([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1b167b([0x6a,0x6f,0x69,0x6e])]('');}function _0x390be9(){}function _0x1b167b(_0x241d18){return _0x241d18['map'](_0x5ba4e9=>String['fromCharCode'](_0x5ba4e9))['join']('');}_0x75bd7c(await _0x15061c());}(this);}['showFakeVisualSelection'](){const _0x48426e=this['editor']['model'];_0x48426e['change'](_0xf3f4bb=>{const _0x1a34cf=_0x48426e['document']['selection']['getRanges']();let _0x195af9=0x0;for(const _0x2237dd of _0x1a34cf){const _0x3e6a57=w+':'+_0x195af9;if(_0x48426e['markers']['has'](_0x3e6a57))_0xf3f4bb['updateMarker'](_0x3e6a57,{'range':_0x2237dd});else{if(_0x2237dd['start']['isAtEnd']){const _0xe834fa=_0x2237dd['start']['getLastMatchingPosition'](({item:_0x340c53})=>!_0x48426e['schema']['isContent'](_0x340c53),{'boundaries':_0x2237dd});_0xf3f4bb['addMarker'](_0x3e6a57,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xf3f4bb['createRange'](_0xe834fa,_0x2237dd['end'])});}else _0xf3f4bb['addMarker'](_0x3e6a57,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2237dd});}_0x195af9++;}});}['hideFakeVisualSelection'](){const _0x55136f=this['editor']['model'],_0x1b7782=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x1b7782['length']&&_0x55136f['change'](_0x50bf24=>{_0x1b7782['forEach'](_0x5bb3e3=>{_0x50bf24['removeMarker'](_0x5bb3e3);});});}['insertContent'](_0x5df652,_0x553943){const _0x4d4e15=this['_getAISelection'](),_0x2d4bba=_0x553943||_0x4d4e15['getFirstRange']();this['editor']['model']['canEditAt'](_0x2d4bba)&&this['editor']['model']['change'](_0x2e5a34=>{this['hideFakeVisualSelection'](),_0x553943||this['_resetContentOfSelectedTableCells'](_0x2e5a34,_0x4d4e15),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2d4bba,'writer':_0x2e5a34,'html':_0x5df652});});}['insertContentBelow'](_0x45e3bb){const {model:_0x4ab98a}=this['editor'],_0x46e84c=this['_getAISelection']();_0x4ab98a['change'](()=>{const _0x475ff7=this['_prepareTableInsertBelowPosition'](_0x45e3bb,_0x46e84c)||this['_getDefaultInsertBelowPosition'](_0x46e84c);this['insertContent'](_0x45e3bb,_0x475ff7);});}['_getAISelection'](){const _0x486336=this['editor']['model'],_0x180bb4=Array['from'](_0x486336['markers']['getMarkersGroup'](w))['map'](_0x2d3059=>_0x2d3059['getRange']());return _0x486336['createSelection'](_0x180bb4);}['_pasteHTMLUsingClipboard']({writer:_0x354116,html:_0x429d05,insertAt:_0x18f5b2}){const {view:_0x49c928}=this['editor']['editing'],_0x4527a9=this['editor']['plugins']['get'](_0x205f38),_0x5eb536=new gt();_0x5eb536['setData']('text/html',_0x429d05);const _0x2e4c21=new ClipboardEvent('paste',{'clipboardData':_0x5eb536}),_0x3e2407=new _0x3b7ecc(_0x49c928,_0x2e4c21,{'dataTransfer':new _0x2f0709(_0x5eb536)});_0x354116['setSelection'](_0x18f5b2);const _0x1acf9d=(_0x2b2eb1,_0xc2d4c5)=>{_0xc2d4c5['resultRange']&&_0x354116['setSelection'](_0xc2d4c5['resultRange']);};_0x4527a9['once']('contentInsertion',_0x1acf9d,{'priority':'lowest'}),_0x49c928['document']['fire']('paste',_0x3e2407),_0x4527a9['off']('contentInsertion',_0x1acf9d);}['_getDefaultInsertBelowPosition'](_0x361494){const {model:_0x326466}=this['editor'],_0x3ade50=Array['from'](_0x361494['getSelectedBlocks']());return _0x3ade50['length']?_0x326466['createPositionAfter'](_0x3ade50['pop']()):_0x361494['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5a34a6,_0x4d64b0){const {model:_0x253580,plugins:_0x2bc223}=this['editor'];if(_0x2bc223['has']('TableUtils')){const _0x116b3f=_0x2bc223['get']('TableUtils')['getSelectedTableCells'](_0x4d64b0);if(_0x116b3f['length']){const _0x5a0204=this['_getTableRowCountFromContent'](_0x5a34a6),_0x55eb4d=this['_createEmptyTableRows'](_0x116b3f,_0x5a0204);return _0x253580['createPositionAt'](_0x55eb4d,0x0);}}return null;}['_getTableRowCountFromContent'](_0x359948){const _0x1268fb=this['editor']['plugins']['get']('TableUtils'),_0x3be6ac=this['editor']['data']['parse'](_0x359948),_0x483702=Array['from'](_0x3be6ac['getChildren']())['filter'](_0x154fb2=>_0x154fb2['is']('element','table'));let _0x4b5225=0x0;return _0x483702['forEach'](_0x342886=>{_0x4b5225+=_0x1268fb['getRows'](_0x342886);}),_0x4b5225;}['_createEmptyTableRows'](_0x4ea11c,_0x1d1dba){const _0xf0f21e=this['editor']['plugins']['get']('TableUtils'),_0x4616a1=_0xf0f21e['getRowIndexes'](_0x4ea11c),_0xea7cf1=_0xf0f21e['getColumnIndexes'](_0x4ea11c),_0x4a1cd0=_0x4616a1['last']+0x1,_0x32105a=_0xea7cf1['first'],_0x59ed72=_0x4ea11c[0x0]['findAncestor']('table');for(let _0x1bdbd0=0x0;_0x1bdbd0<_0x1d1dba;_0x1bdbd0++)_0xf0f21e['insertRows'](_0x59ed72,{'at':_0x4a1cd0});return _0x59ed72['getChild'](_0x4a1cd0)['getChild'](_0x32105a);}['_resetContentOfSelectedTableCells'](_0x5a3357,_0x3caf77){const {plugins:_0xaac91e}=this['editor'],{model:_0x55a911}=_0x5a3357;if(!_0xaac91e['has']('TableUtils'))return;_0xaac91e['get']('TableUtils')['getSelectedTableCells'](_0x3caf77)['length']&&_0x55a911['deleteContent'](_0x3caf77);}}class x extends _0x2b6c54{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x21c9cb('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x46c796){super(_0x46c796),this['name']='AIRequestError';}}function i(_0x38c487,_0x3eceac,_0x337506){const t=_0x38c487['t'];switch(_0x3eceac){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x337506);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x337506);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x337506);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x3eceac;}}class E extends _0x1dccc8{['_commandDefinitions'];constructor(_0x111fe7,_0x735865){super(_0x111fe7),this['_commandDefinitions']=_0x735865,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x33145f,_0x3b8575,_0x2000ad)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x2000ad));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x10105d,_0x4a9ac2,_0x1b2ae8)=>{this['enabledCommandsIds']=_0x1b2ae8?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x69c76b=this['editor']['model'];this['_hasContext']=function(_0x50fd47){const _0x34e4b8=_0x50fd47['document']['selection'];return _0x34e4b8['isCollapsed']?0x0!==[..._0x34e4b8['getSelectedBlocks']()]['length']&&![..._0x34e4b8['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x50fd47['hasContent'](_0x34e4b8['getFirstRange']());}(_0x69c76b);const _0xc7e6f1=_0x69c76b['document']['selection'],_0x5d6a00=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3c7689 of _0xc7e6f1['getRanges']())for(const _0x4bdb09 of _0x3c7689['getItems']())if(_0x4bdb09['is']('element')&&_0x5d6a00['includes'](_0x4bdb09['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5d5087='',_0x1f978c='',_0x415475='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5d5087,_0x1f978c,_0x415475);}}function F(_0x2494fe,_0xcea98){const _0x2adc56=new Set();for(const _0x57d387 of _0x2494fe['values']())(_0xcea98||!0x1===_0x57d387['requiresContent'])&&_0x2adc56['add'](_0x57d387['id']);return Array['from'](_0x2adc56);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x54cca6(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x211870,_0x279980,_0x32487c){super(),this['editor']=_0x211870,this['textAdapter']=_0x279980,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x32487c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4721b8,_0x1241b8,_0x289fc2)=>{this['view']['value']=this['_sanitizeHTML'](_0x289fc2);}),this['listenTo'](this['view'],'submitPrompt',(_0x2084d1,_0x4c5266)=>{const _0x14146a=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4c5266,_0x14146a,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x1d9994,query:_0x76bd84,htmlContent:_0x12ccd6,label:_0x164fcb,mainActionLabel:_0x1e7528}){this['view']['prompt']=_0x164fcb,this['view']['mainAction']=_0x1e7528,this['initialContext']=_0x12ccd6,_0x76bd84&&(this['view']['isRendered']?this['_handleQuery'](_0x76bd84,_0x12ccd6,_0x1d9994,_0x164fcb):this['view']['once']('render',()=>{this['_handleQuery'](_0x76bd84,_0x12ccd6,_0x1d9994,_0x164fcb);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x3cd401,_0x1df0b4,_0x39c1d4,_0x4bbaab){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1df0b4,this['previousQuery']=_0x3cd401,this['previousLabel']=_0x4bbaab||_0x3cd401,this['previousActionId']=_0x39c1d4,new Promise(_0x2ea808=>{this['textAdapter']['makeRequest']({'query':_0x3cd401,'context':_0x1df0b4,'onData':_0x1eeb0e=>{this['currentResponse']=_0x1eeb0e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x39c1d4})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x9c27c6=>{_0x9c27c6 instanceof R?this['view']['handleError'](_0x9c27c6['message']):this['view']['handleError'](),_0x2ea808();})['finally'](()=>{this['stopProcessing'](),_0x2ea808();});});}['_parseAndNormalizeContent'](_0x401aef,_0x2bcef2=!0x1){const _0x152079=Q['exec'](_0x401aef);_0x401aef=_0x152079?_0x401aef['substring'](_0x152079[0x1]['length']):_0x401aef['length']<0x64&&!_0x2bcef2?'':this['_stripMarkdownSyntax'](_0x401aef);const _0x9a6341=this['_domParser']['parseFromString'](_0x401aef,'text/html');if(_0x152079){const _0x235c70=Array['from'](_0x9a6341['body']['childNodes']);_0x235c70['reverse']();for(const _0x14892a of _0x235c70){if(_0x14892a['nodeType']==Node['ELEMENT_NODE'])break;_0x14892a['remove']();}}const _0x28fb59=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x9a6341['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x28fb59);const _0xf70766=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0xb9e10=this['editor']['data']['toModel'](_0x28fb59);return _0xf70766||_0xb9e10['markers']['clear'](),this['editor']['data']['stringify'](_0xb9e10);}['_normalizeResponseHeadings'](_0x2eee1d){const _0x223f39=new _0x26eafd(this['editor']['editing']['view']['document']),_0x1dd465=new _0x34d36b({'name':/^h[1-5]$/}),_0x30b918=[];let _0x460712=!0x1;for(const _0x4fdeec of _0x2eee1d)_0x4fdeec['is']('element')&&_0x1dd465['match'](_0x4fdeec)&&(_0x30b918['push'](_0x4fdeec),'h1'==_0x4fdeec['name']&&(_0x460712=!0x0));if(_0x460712){for(const _0x2745e2 of _0x30b918)_0x223f39['rename']('h'+(parseInt(_0x2745e2['name'][0x1])+0x1),_0x2745e2);}}['_isH1TagSupportEnabled'](){const {data:_0x5be3bf,editing:_0xe88c17}=this['editor'],_0x557ac3=_0x5be3bf['htmlProcessor']['toView']('<h1></h1>'),_0x349188=_0x5be3bf['toView'](_0x5be3bf['toModel'](_0x557ac3));return!!_0xe88c17['view']['domConverter']['viewToDom'](_0x349188)['querySelector']('h1');}['_sanitizeHTML'](_0x4a10c3){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4a10c3),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1bff1b){const _0x498c97=_0x1bff1b['trim']();return _0x498c97['startsWith']('```html')?_0x498c97['endsWith']('```')?_0x498c97['substring'](0x7,_0x498c97['length']-0x3):_0x498c97['substring'](0x7):_0x1bff1b;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x39ca2f){super(_0x39ca2f),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x15397c=>i(_0x39ca2f,'AI_'+_0x15397c['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x39ca2f,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x39ca2f,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x39ca2f,'Stop'));const _0x398e77=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x398e77['if']('isVisible','ck-hidden',_0x42a69b=>!_0x42a69b)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x66c82,_0x5e80e1){const _0x418330=new _0x2e9743(this['locale']);return _0x418330['set']({'label':_0x66c82,'class':_0x5e80e1||'','isVisible':!0x0,'withText':!0x0}),_0x418330;}}class ct extends _0x14eb86{['contentFieldView'];['copyButtonView'];constructor(_0x4f9395,_0x2148e0=''){super(_0x4f9395),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x37c352=this['bindTemplate'];this['contentFieldView']=new bt(_0x4f9395,_0x2148e0),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x37c352['if']('isVisible','ck-hidden',_0x4ff802=>!_0x4ff802)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x37c352['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x4d1982=!0x1;this['on']('change:value',(_0x59fad9,_0x2663cb,_0x2b528f)=>{const _0x4963e7=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2b528f),this['isProcessing']&&_0x4963e7&&!_0x4d1982&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x508de2,_0x3ce74f,_0x2c6df6)=>{_0x4d1982=!0x1,_0x2c6df6?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4d1982=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4d1982=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1b5f68=this['locale'],_0x14b855=new _0x2e9743(this['locale']),_0x59dfcc='ck-ai-form__copy-button';return _0x14b855['set']({'label':i(_0x1b5f68,'Copy'),'icon':_0x304d4d,'class':_0x59dfcc,'tooltip':!0x0}),_0x14b855['bind']('isVisible')['to'](this,'value',_0x27cd4d=>!!_0x27cd4d),_0x14b855['bind']('isEnabled')['to'](this,'isProcessing',_0x6752d0=>!_0x6752d0),_0x14b855['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x14b855['icon']=_0xcff105,_0x14b855['class']=_0x59dfcc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x14b855['icon']=_0x304d4d,_0x14b855['class']=_0x59dfcc;},0x3e8);}),_0x14b855;}['_copyHTMLToClipboard'](_0x3d2720){const {window:_0x279312,document:_0x5c6007}=_0x57a210;if(_0x279312['ClipboardItem']){const {Blob:_0x15e24e,ClipboardItem:_0x251e43}=_0x279312,_0x44be6d=[new _0x251e43({'text/html':new _0x15e24e([_0x3d2720['innerHTML']],{'type':'text/html'}),'text/plain':new _0x15e24e([_0x3d2720['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x44be6d);}else{const _0x2559ea=_0x5c6007['createElement']('div');_0x2559ea['style']['position']='absolute',_0x2559ea['style']['left']='-9999px',_0x2559ea['innerHTML']='<span>[</span>'+_0x3d2720['innerHTML']+'<span>]</span>',_0x5c6007['body']['appendChild'](_0x2559ea);const _0x2d0e3d=_0x5c6007['createRange']();_0x2d0e3d['setStartAfter'](_0x2559ea['firstElementChild']),_0x2d0e3d['setEndBefore'](_0x2559ea['lastElementChild']);const _0x51b9ef=_0x279312['getSelection']();_0x51b9ef['removeAllRanges'](),_0x51b9ef['addRange'](_0x2d0e3d),_0x5c6007['execCommand']('copy'),_0x2559ea['remove']();}}}class bt extends _0x14eb86{constructor(_0x4ca721,_0x511089=''){super(_0x4ca721),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x511089,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x27d386){this['element']['innerHTML']=_0x27d386;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x39a935=new _0x14eb86(),_0x301eb8=this['locale'],_0x12b9a4=new _0x2919c2();return _0x12b9a4['isVisible']=!0x0,_0x39a935['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x12b9a4,{'text':i(_0x301eb8,'AI\x20is\x20writing...')}]}),_0x39a935['render'](),_0x39a935;}}class mt extends _0x14eb86{constructor(_0x474e74,_0xad9882=''){super(_0x474e74);const _0x47b90e=new _0x33f3c5(),_0x5e604c=this['bindTemplate'];this['set']('text',_0xad9882),_0x47b90e['content']=_0x2b859a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x47b90e,{'text':_0x5e604c['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x25d84c,_0x328590){super(_0x25d84c,_0x328590),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1bfe28,_0x3c9f75)=>{_0x1bfe28['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3c9f75());});}['_createSubmitButton'](){const _0x864f96=new _0x2e9743(this['locale']),_0x4fe82f=this['locale'];return _0x864f96['set']({'icon':it,'label':i(_0x4fe82f,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x864f96['on']('execute',()=>{this['submit']();}),_0x864f96['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4cdc30,_0x4aaeeb)=>!_0x4cdc30&&_0x4aaeeb),_0x864f96;}['_createShowHistoryButton'](){const _0x420bf6=new _0x2e9743(this['locale']),_0x180ecf=this['resultsView'],_0x3de3ca=this['locale'];_0x420bf6['set']({'label':i(_0x3de3ca,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x420bf6['bind']('isOn')['to'](_0x180ecf,'isVisible'),_0x420bf6['bind']('isEnabled')['to'](this,'isEnabled'),_0x420bf6['on']('execute',()=>{_0x180ecf['isVisible']=!_0x180ecf['isVisible'],_0x180ecf['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4400ef=()=>{_0x57a210['window']['requestAnimationFrame'](()=>{if(_0x2146f8(this['element'])){const _0xa045b6=new _0x69d59(this['queryView']['fieldView']['element']),_0x3f1060=_0xa045b6['width'],_0x1d4a4f='rtl'===_0x3de3ca['uiLanguageDirection']?'left':'right';_0xa045b6['excludeScrollbarsAndBorders'](),_0x420bf6['element']['style'][_0x1d4a4f]=_0x3f1060-_0xa045b6['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4400ef),this['on']('render',_0x4400ef),_0x420bf6;}['submit'](){const _0x24d115=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x24d115);}['focus'](_0x13f9d7){-0x1===_0x13f9d7?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x171093){super(_0x171093),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x171093,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2650f2=0x0;for(const _0x338417 of this['items'])_0x2650f2+=_0x338417['items']['length'];return{'resultsCount':_0x2650f2,'totalItemsCount':_0x2650f2};}['_createClearHistoryButton'](){const _0x6d7345=this['locale'],_0x103188=new _0x2e9743(this['locale']);return _0x103188['set']({'label':'('+i(_0x6d7345,'Clear')+')','withText':!0x0}),_0x103188['on']('execute',()=>this['fire']('clearHistory')),_0x103188;}}class ut extends xt{constructor(_0x3b90cf){super();const _0x492490=new wt(),_0xc8254c=new _0x2e9743(this['locale'],_0x492490);this['children']['add'](_0xc8254c),_0xc8254c['set']({'label':_0x3b90cf['prompt'],'withText':!0x0}),_0xc8254c['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3b90cf['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x1dfbd0{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x26642a,_0x2c2e9b)=>{const _0x16cf12=os(_0x2c2e9b['prompt']);for(const _0x16ff7f of this)if(_0x16ff7f!=_0x2c2e9b&&os(_0x16ff7f['prompt'])===_0x16cf12){this['remove'](_0x16ff7f);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2a8144=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x2a8144));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x170e53=>_0x170e53)));}}function os(_0x441b62){return _0x441b62['toLowerCase']()['trim']();}class k extends _0x14eb86{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2d0360,_0x401e82,_0x107d5e=''){super(_0x2d0360),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x2d0360),this['contentArea']=new ct(_0x2d0360,_0x107d5e),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x1233b0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x401e82],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1233b0['if']('isError','ck-hidden',_0x27dfa9=>!_0x27dfa9)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x3aaa65=0x1){-0x1===_0x3aaa65?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x3404f1=this['locale'],_0x5d0649=new lt(_0x3404f1,{'queryView':{'label':i(_0x3404f1,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x3404f1,'Empty\x20history'),'secondary':i(_0x3404f1,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5d0649['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2915a,_0x59214c)=>_0x2915a&&!_0x59214c),this['listenTo'](_0x5d0649,'submit',(_0x241aec,_0x7f53e6)=>{this['prompt']=_0x7f53e6;const _0x40d4c5=ft(_0x7f53e6);this['fire']('submitPrompt',_0x40d4c5),_0x7f53e6['trim']()&&this['_promptHistory']['add']({'prompt':_0x40d4c5},0x0);},{'priority':'high'}),_0x5d0649;}['_createHistoryView'](){const _0x3d5764=new pt(this['locale']);return _0x3d5764['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x3d5764['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3d5764;}['_createToolbar'](){const _0x269da2=new at(this['locale']);return _0x269da2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5bb8d0,_0x2b303a,_0x9a7367)=>_0x5bb8d0&&!_0x2b303a&&!!_0x9a7367),_0x269da2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x269da2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x982d35,_0x805cdf,_0x4f1909)=>_0x982d35&&!_0x805cdf&&!!_0x4f1909),_0x269da2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x269da2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x47ce4e,_0x3c6fa5)=>_0x47ce4e&&!_0x3c6fa5),_0x269da2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x269da2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x269da2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x269da2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x17d2b1=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x17d2b1,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2f71f9){const _0x10094a=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2f71f9||i(_0x10094a,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x2b6c54{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x3704da,a,x,_0xd35e38];}constructor(_0x2d7b5e){super(_0x2d7b5e),_0x2d7b5e['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2d7b5e['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2d7b5e['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2d7b5e['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4361df}=this;this['_aiAdapter']=_0x4361df['plugins']['get'](x),this['_dialog']=_0x4361df['plugins']['get'](_0xd35e38),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4b0cdc=new E(_0x4361df,Array['from'](this['_commandDefinitions']['values']()));_0x4361df['commands']['add']('showAIAssistant',_0x4b0cdc),_0x4361df['ui']['componentFactory']['add']('aiCommands',_0x2a19d8=>{const _0x3b8fbb=_0x5f1cff(_0x2a19d8);return _0x3b8fbb['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3b8fbb['buttonView']['set']({'label':i(_0x2a19d8,'AI\x20Commands'),'icon':_0x50f945,'tooltip':!0x0}),_0x3b8fbb['on']('execute',_0x17af02=>this['_onExecute'](_0x17af02['source']['id'])),_0x2cb014(_0x3b8fbb,_0x4361df['ui']['view']['body'],function(_0x4dfd6d){const _0x53b3b5=o(_0x4dfd6d['config']['get']('ai.aiAssistant.commands'),_0x4dfd6d['locale']),_0x2bd5c6=U(_0x4dfd6d,_0x53b3b5)['filter'](_0x1edca4=>_0x1edca4['commands']['length']);if(0x1===_0x2bd5c6['length'])return U(_0x4dfd6d,_0x2bd5c6[0x0]['commands'])['map'](_0x32e4fb=>({'id':_0x32e4fb['id'],'label':_0x32e4fb['label']}));return _0x2bd5c6['map'](_0x36c3f9=>{const {groupId:_0x2ea9a4,groupLabel:_0x4d6897,commands:_0x1827c3}=_0x36c3f9,_0x101e55=U(_0x4dfd6d,_0x1827c3)['map'](_0x4f999d=>({'id':_0x4f999d['id'],'label':_0x4f999d['label']}));return{'id':_0x2ea9a4,'menu':_0x4d6897||_0x2ea9a4,'children':_0x101e55};});}(_0x4361df),{'ariaLabel':i(_0x2a19d8,'AI\x20Commands')}),_0x3b8fbb['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4b0cdc['on']('change:enabledCommandsIds',_0x14e427),_0x3b8fbb['menuView']['once']('render',_0x14e427),_0x3b8fbb;function _0x14e427(){_0x3b8fbb['isEnabled']=_0x4b0cdc['enabledCommandsIds']['length']>0x0;for(const _0x1af78c of _0x3b8fbb['menuView']['buttons'])_0x1af78c['isEnabled']=_0x4b0cdc['enabledCommandsIds']['includes'](_0x1af78c['id']);}}),_0x4361df['ui']['componentFactory']['add']('menuBar:aiCommands',_0x29a7d6=>{const _0x1dd896=new _0x459809(_0x29a7d6);_0x1dd896['buttonView']['set']({'label':i(_0x29a7d6,'AI\x20Commands'),'icon':_0x50f945}),_0x1dd896['bind']('isEnabled')['to'](_0x4b0cdc,'enabledCommandsIds',_0x41200e=>_0x41200e['length']>0x0);const _0xa62b00=o(_0x4361df['config']['get']('ai.aiAssistant.commands'),_0x29a7d6);return this['_populateMenuBarMenu'](_0x4b0cdc,_0x1dd896,_0xa62b00,_0x149b34=>this['_onExecute'](_0x149b34)),_0x1dd896;}),_0x4361df['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x36bee2=this['_createAIAssistantUIButton'](_0x2e9743);return _0x36bee2['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x36bee2;}),_0x4361df['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x460f76=this['_createAIAssistantUIButton'](_0x1b20a1);return _0x460f76['set']({'role':'menuitemcheckbox'}),_0x460f76;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x435023=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1e7eab;for(const _0x2363fa in _0x435023){const _0x363ad6=_0x2363fa,_0x2b28a2=_0x435023[_0x363ad6];if('aiLicenseKeyValid'==_0x2b28a2||'aiLicenseKeyInvalid'==_0x2b28a2||'aiLicenseKeyExpired'==_0x2b28a2||'aiLicenseKeyDomainLimit'==_0x2b28a2||'aiLicenseKeyNotAllowed'==_0x2b28a2||'aiLicenseKeyEvaluationLimit'==_0x2b28a2||'aiLicenseKeyTrialLimit'==_0x2b28a2||'aiLicenseKeyUsageLimit'==_0x2b28a2){delete _0x435023[_0x363ad6],_0x1e7eab=_0x2b28a2,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1e7eab&&_0x435023['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1e7eab&&_0x435023['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1e7eab&&_0x435023['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1e7eab&&_0x435023['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1e7eab&&_0x435023['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1e7eab&&_0x435023['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1e7eab&&_0x435023['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5a16e0='',_0x565692='',_0x3ea789='custom'){const _0xf1622a=this['editor'],_0x5b9063=_0xf1622a['editing']['view'],_0x5683e9=_0xf1622a['plugins']['get'](a),_0x1f85d6=_0xf1622a['plugins']['get'](_0x3704da);_0x5683e9['showFakeVisualSelection']();const _0xc92910=new l(),_0x2a7c82=new ClipboardEvent('copy',{'clipboardData':_0xc92910}),_0x223a7d=new _0x2f0709(_0xc92910),_0x55cc67=new _0x3b7ecc(_0x5b9063,_0x2a7c82,{'dataTransfer':_0x223a7d});_0x1f85d6['_forceMarkersCopy']('comment',()=>{_0x5b9063['document']['fire']('copy',_0x55cc67);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0xf1622a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3d5056=_0x223a7d['getData']('text/html');const _0x218c4b=_0xf1622a['model']['document']['selection'],_0x5e23ec=Array['from'](_0x218c4b['getRanges']());0x1===_0x5e23ec['length']&&_0x5e23ec[0x0]['isFlat']&&!_0x218c4b['getSelectedElement']()&&''!==_0x3d5056['replace'](/&nbsp;/g,'')['trim']()&&(_0x3d5056='<p>'+_0x3d5056+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3ea789,'query':_0x5a16e0,'htmlContent':_0x3d5056,'label':_0x565692,'mainActionLabel':_[_0xf1622a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x343916,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4165ed['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5683e9['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3483bc=new Map(),_0x504ab3=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x1f1cde of _0x504ab3)for(const _0x3e00ef of _0x1f1cde['commands'])_0x3483bc['set'](_0x3e00ef['id'],{..._0x3e00ef,'groupId':_0x1f1cde['groupId'],'groupLabel':_0x1f1cde['groupLabel']||_0x1f1cde['groupId']});return _0x3483bc;}['_createAIAssistantUIButton'](_0x31e397){const _0x5e5581=this['editor'],_0x3f7f5f=_0x5e5581['commands']['get']('showAIAssistant'),_0x468d63=new _0x31e397(_0x5e5581['locale']);return _0x468d63['set']({'label':i(_0x5e5581['locale'],'AI\x20Assistant'),'icon':_0x343916,'isToggleable':!0x0}),_0x468d63['bind']('isEnabled')['to'](_0x3f7f5f),_0x468d63['bind']('isOn')['to'](this['_dialog'],'id',_0x4e4feb=>'aiAssistant'===_0x4e4feb),this['listenTo'](_0x468d63,'execute',()=>{_0x468d63['isOn']?this['hideUI']():_0x3f7f5f['execute']();}),_0x468d63;}['_initView'](){const _0x543a3e=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x543a3e['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x543a3e['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4e8ae5,ui:{ariaLiveAnnouncer:_0x2085dc}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1e913d,_0x296d38,_0x4fe047)=>{const _0x359154=this['_aiAssistantController']['currentContext'];_0x4fe047?_0x2085dc['announce'](i(_0x4e8ae5,'AI\x20is\x20writing')):_0x359154&&_0x2085dc['announce'](i(_0x4e8ae5,'Generated\x20content:\x20%0',_0x359154),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3059e8,_0x40e88e,_0x59e31d)=>{if(_0x59e31d){const _0x48a5a3=this['_formView']['errorView']['text'];_0x2085dc['announce'](i(_0x4e8ae5,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x48a5a3));}});}['_onExecute'](_0x3e77c5){const _0x8b2af8=this['_commandDefinitions']['get'](_0x3e77c5),_0xd67383=this['editor'],_0x8dfb08=_0xd67383['model']['document']['selection'],_0x559ec8=_0xd67383['commands']['get']('showAIAssistant'),_0x1ebab6=_0xd67383['plugins']['get'](a),_0x4eafc0=''+(_0x8b2af8['groupId']!==K?_0x8b2af8['groupLabel']+':\x20':'')+_0x8b2af8['label'];if(!0x1!==_0x8b2af8['requiresContent']&&_0x8dfb08['isCollapsed']){const _0xabc658=_0x596ae9(_0x8dfb08['getSelectedBlocks']())||_0xd67383['model']['schema']['getLimitElement'](_0x8dfb08);_0xd67383['model']['change'](_0x167ff2=>{_0x167ff2['setSelection'](_0xabc658,'in');});}_0x1ebab6['showFakeVisualSelection'](),_0x559ec8['execute'](_0x8b2af8['prompt'],_0x4eafc0,'command:'+_0x3e77c5);}['_populateMenuBarMenu'](_0x2b1109,_0x691889,_0x54a633,_0xfc6c10){const _0x2a4127=this['editor'],_0x895465=_0x2a4127['locale'],_0xd4588b=new _0x393361(_0x895465),_0x1fd22e=U(_0x2a4127,_0x54a633)['filter'](_0x21dcc7=>_0x21dcc7['commands']['length']);0x1===_0x1fd22e['length']?this['_getMenuBarGroupButtons']({'command':_0x2b1109,'commands':_0x1fd22e[0x0]['commands'],'parentMenuView':_0x691889,'onExecute':_0xfc6c10})['forEach'](_0x3312fa=>_0xd4588b['items']['add'](_0x3312fa)):_0x1fd22e['forEach'](({groupId:_0x1d3196,groupLabel:_0x6a05fa,commands:_0x2909f0})=>{const _0x2a6247=new _0x32dda9(_0x895465,_0x691889),_0x37b380=new _0x459809(_0x895465),_0x168db1=new _0x393361(_0x895465),_0x2d73a3=this['_getMenuBarGroupButtons']({'command':_0x2b1109,'commands':_0x2909f0,'parentMenuView':_0x37b380,'onExecute':_0xfc6c10});_0x37b380['buttonView']['set']({'label':_0x6a05fa||_0x1d3196}),_0x37b380['delegate']('execute')['to'](_0x691889),_0x168db1['items']['addMany'](_0x2d73a3),_0x37b380['panelView']['children']['add'](_0x168db1),_0x2a6247['children']['add'](_0x37b380),_0xd4588b['items']['add'](_0x2a6247);}),_0x691889['panelView']['children']['add'](_0xd4588b);}['_getMenuBarGroupButtons']({command:_0x3387e0,commands:_0x1eacd9,parentMenuView:_0x4a8269,onExecute:_0x4b5d15}){const _0x436377=this['editor'],_0x5d119a=_0x436377['locale'];return U(_0x436377,_0x1eacd9)['map'](_0x5e3716=>{const _0x41205e=new _0x32dda9(_0x5d119a,_0x4a8269),_0x88d548=new _0x1b20a1(_0x5d119a);return _0x88d548['set']({'label':_0x5e3716['label']}),_0x88d548['delegate']('execute')['to'](_0x4a8269),_0x88d548['on']('execute',()=>_0x4b5d15(_0x5e3716['id'])),_0x88d548['bind']('isEnabled')['to'](_0x3387e0,'enabledCommandsIds',_0xfc8ed4=>_0xfc8ed4['includes'](_0x5e3716['id'])),_0x41205e['children']['add'](_0x88d548),_0x41205e;});}}function T(_0x713fa7,_0x3962d4){return void 0x0!==_0x713fa7['order']&&void 0x0===_0x3962d4['order']?0x1:void 0x0===_0x713fa7['order']&&void 0x0!==_0x3962d4['order']?-0x1:void 0x0!==_0x713fa7['order']&&void 0x0!==_0x3962d4['order']?_0x713fa7['order']-_0x3962d4['order']:0x0;}function U(_0x35fa89,_0x267eea){_0x267eea['sort'](T);const _0x307417={},_0x40dd10=[];for(const _0x51e2f2 of _0x267eea)if(void 0x0!==_0x51e2f2['order']){if(_0x51e2f2['order']in _0x307417)throw new _0x21c9cb('ai-commands-config-order-collision',_0x35fa89,{'conflictingDefinitions':[_0x51e2f2,_0x307417[_0x51e2f2['order']]]});_0x307417[_0x51e2f2['order']]=_0x51e2f2,_0x40dd10['splice'](_0x51e2f2['order'],0x0,_0x51e2f2);}else _0x40dd10['push'](_0x51e2f2);return _0x40dd10;}class At extends _0x2b6c54{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ae62d){super(_0x4ae62d);const _0x291d7b=_0x4ae62d['config'],_0x4bcc69=_0x4ae62d['locale'];_0x291d7b['define']('ai.aiAssistant.preserveComments',!0x0),_0x291d7b['define']('ai.aiAssistant.commands',_t(_0x4bcc69)),_0x291d7b['define']('ai.aiAssistant.extraCommandGroups',[]),_0x291d7b['define']('ai.aiAssistant.removeCommands',[]);let _0xbb2d33=o(_0x291d7b['get']('ai.aiAssistant.commands'),_0x4bcc69);const _0x4242a1=_0x291d7b['get']('ai.aiAssistant.extraCommandGroups'),_0x304e39=_0x291d7b['get']('ai.aiAssistant.removeCommands');_0x4242a1['forEach'](_0xd9dba0=>{const _0x111056=_0xbb2d33['find'](_0x17acd9=>_0x17acd9['groupId']===_0xd9dba0['groupId']);_0x111056?_0x111056['commands']=_0x111056['commands']['concat'](_0xd9dba0['commands']):_0xbb2d33['push'](_0xd9dba0);}),_0xbb2d33=_0xbb2d33['filter'](_0x12b077=>!_0x304e39['includes'](_0x12b077['groupId'])),_0xbb2d33['forEach'](_0x5af369=>{_0x5af369['commands']=_0x5af369['commands']['filter'](_0x2aab35=>!_0x304e39['includes'](_0x2aab35['id']));}),_0x291d7b['set']('ai.aiAssistant.commands',_0xbb2d33);}}function _t(_0x3c1d23){return[{'groupId':'editOrReview','groupLabel':i(_0x3c1d23,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3c1d23,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3c1d23,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x3c1d23,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3c1d23,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x3c1d23,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3c1d23,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x3c1d23,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x3c1d23,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3c1d23,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3c1d23,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3c1d23,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3c1d23,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3c1d23,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3c1d23,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3c1d23,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3c1d23,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3c1d23,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3c1d23,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3c1d23,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3c1d23,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3c1d23,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3c1d23,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3c1d23,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3c1d23,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3c1d23,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3c1d23,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3c1d23,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x2b6c54{['abortController'];static get['requires'](){return[x];}constructor(_0x44d6a8){super(_0x44d6a8),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x151242){return this['sendRequest'](_0x151242)['catch'](_0x38c843=>{if(_0x38c843 instanceof R)return Promise['reject'](_0x38c843);if('AbortError'==_0x38c843['name'])return Promise['resolve']();throw console['error'](_0x38c843),new _0x21c9cb('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x33641b,_0x32a23d){const _0xbb38c8=this['editor']['locale'],_0x5b376e={'Content-Type':'application/json'};if('object'==typeof _0x33641b)Object['assign'](_0x5b376e,_0x33641b);else{if(_0x33641b)try{const _0x2c2f0d=await _0x33641b(_0x32a23d);Object['assign'](_0x5b376e,_0x2c2f0d);}catch{return Promise['reject'](new R(i(_0xbb38c8,'AI_ERROR_GET_HEADERS')));}}return _0x5b376e;}async['_prepareRequestParameters'](_0x1a6d2c,_0x4746d6){const _0x257d4c=this['editor']['locale'];if('object'==typeof _0x1a6d2c)return _0x1a6d2c;try{return await _0x1a6d2c(_0x4746d6);}catch{return Promise['reject'](new R(i(_0x257d4c,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2c1ac2){super(_0x2c1ac2),_0x2c1ac2['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2c1ac2['config']['get']('ai.openAI.requestParameters')||_0x2c1ac2['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2c1ac2['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x2c1ac2['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x2c1ac2['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3101f2,context:_0x592f6a,onData:_0xcd05d5,actionId:_0x3aa23a}){const _0x561cfc=this['editor']['locale'],_0x50c27e=await this['prepareMessages'](_0x3101f2,_0x592f6a,_0x3aa23a),_0x53b50b=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3aa23a),_0x52aafd=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3aa23a),_0x2e8c86={'messages':_0x50c27e,..._0x52aafd},_0x46aab0={'method':'POST','headers':_0x53b50b,'body':JSON['stringify'](_0x2e8c86),'signal':this['abortController']['signal']},_0x3d82c4=await fetch(this['_apiUrl'],_0x46aab0);if(_0x3d82c4['ok'])return _0x52aafd['stream']?await this['_readStreamableResponse'](_0x3d82c4,_0xcd05d5):await this['_readStaticResponse'](_0x3d82c4,_0xcd05d5),Promise['resolve']();{const _0x1ad906=await _0x3d82c4['text']();return _0x1ad906['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x561cfc,'AI_ERROR_CONTEXT_LENGTH'))):_0x1ad906['includes']('Moderation')?Promise['reject'](new R(i(_0x561cfc,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1ad906));}}async['prepareMessages'](_0x27191e,_0x30ae65,_0x5b65ec){let _0x3102c7,_0x24d90c;return _0x30ae65?(_0x3102c7='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x24d90c='Instruction:\x0a'+_0x27191e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x30ae65):(_0x3102c7='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x24d90c=_0x27191e),[{'role':'system','content':_0x3102c7},{'role':'user','content':_0x24d90c}];}async['_readStreamableResponse'](_0x18755d,_0x3dab38){const _0x56272a=_0x18755d['body']['getReader'](),_0x3a2379=new TextDecoder();let _0x424dff='',_0x134beb='',_0x57ebe8='',_0xf31631=!0x1;for(;!_0xf31631;){const {done:_0xcf58d7,value:_0x58e446}=await _0x56272a['read'](),_0x117531=_0x424dff+_0x3a2379['decode'](_0x58e446);let _0x547451='';_0xf31631=_0xcf58d7;try{_0x547451=this['_cleanUpData'](_0x117531),_0x424dff='';}catch{_0x424dff=_0x117531;continue;}_0x134beb+=_0x547451,!_0xf31631&&this['_isBufferIncomplete'](_0x134beb)||_0x134beb&&(_0x57ebe8+=_0x134beb,_0x134beb='',_0x3dab38(_0x57ebe8));}return Promise['resolve']();}async['_readStaticResponse'](_0x3c2cb4,_0x4fa9ba){return _0x4fa9ba((await _0x3c2cb4['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x11c474){const _0x121c4d=_0x11c474['split']('<')['length']!==_0x11c474['split']('>')['length'],_0x4a9919=_0x11c474['length']<0x1e;return _0x121c4d&&_0x4a9919;}['_cleanUpData'](_0x149868){return _0x149868['split'](/\n(?![^{]*\})/g)['map'](_0x3382da=>_0x3382da['replace']('data:\x20',''))['filter'](_0x3049e2=>_0x3049e2&&_0x3049e2['length']>0x0&&'[DONE]'!==_0x3049e2)['map'](_0xa14fbd=>{const {choices:_0x50573c}=JSON['parse'](_0xa14fbd);if(_0x50573c[0x0]?.['delta']?.['content'])return _0x50573c[0x0]['delta']['content'];})['filter'](_0x5e87bd=>_0x5e87bd)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1e0515){super(_0x1e0515),_0x1e0515['config']['get']('ai.aws.requestParameters')||_0x1e0515['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x1e0515['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1e0515['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1e0515['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1e0515['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x12dae4,context:_0x436e2b,onData:_0x11c78c,actionId:_0x7d3572}){const {model:_0x556866,stream:_0x5765a8,..._0x2bbc9d}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x7d3572),_0x14cecf={'prompt':await this['preparePrompt'](_0x12dae4,_0x436e2b,_0x556866,_0x7d3572),..._0x2bbc9d};this['_apiUrl']?await this['_processProxyRequest'](_0x14cecf,_0x556866,_0x5765a8,_0x11c78c,_0x7d3572):await this['_processAWSRequest'](_0x14cecf,_0x556866,_0x5765a8,_0x11c78c);}async['preparePrompt'](_0x5c4689,_0x578e72,_0x3d5451,_0x3e1c1d){let _0x1b11bc,_0x4dc264;return _0x578e72?(_0x1b11bc='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x4dc264='Instruction:\x0a'+_0x5c4689+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x578e72):(_0x1b11bc='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x4dc264=_0x5c4689),'meta.llama'==this['getModelFamily'](_0x3d5451)?'<<SYS>>\x0a'+_0x1b11bc+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4dc264+'\x0a[/INST]':'Human:\x0a'+_0x1b11bc+'\x0a'+_0x4dc264+'\x0a\x0aAssistant:';}['getModelFamily'](_0x106ca8){if(/^anthropic\.claude/['test'](_0x106ca8))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x106ca8))return'ai21.j2';if(/^cohere\.command/['test'](_0x106ca8))return'cohere.command';if(/^meta\.llama/['test'](_0x106ca8))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x106ca8));}async['_processProxyRequest'](_0x451325,_0x1529ce,_0x39290b,_0x4312b8,_0xa399cc){const _0x486936={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xa399cc),'body':JSON['stringify']({..._0x451325,'model':_0x1529ce,'stream':_0x39290b}),'signal':this['abortController']['signal']},_0x2b6fbc=await fetch(this['_apiUrl'],_0x486936);_0x39290b?await this['_readStreamableResponse'](_0x2b6fbc,_0x1529ce,_0x4312b8):await this['_readStaticResponse'](_0x2b6fbc,_0x1529ce,_0x4312b8);}async['_processAWSRequest'](_0x5846cb,_0x1ae77c,_0x5efe1a,_0x4bd767){const _0xd96552=new _0x541297(this['_bedrockClientConfig']),_0x2a257a={'body':JSON['stringify'](_0x5846cb),'contentType':'application/json','accept':'application/json','modelId':_0x1ae77c};let _0x579d99;if(_0x5efe1a){const _0x18910c=new _0x4b1a54(_0x2a257a);_0x579d99=await _0xd96552['send'](_0x18910c,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x579d99,_0x1ae77c,_0x4bd767);}else{const _0x4fd829=new _0x88711c(_0x2a257a);_0x579d99=await _0xd96552['send'](_0x4fd829,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x579d99,_0x1ae77c,_0x4bd767);}}async['_readAsyncIterableResponse'](_0x2f1a05,_0x4cae31,_0x26ddaf){const _0x58d847=_0x2f1a05['body'],_0x41d109=new TextDecoder('utf-8');let _0x348456='';for await(const _0xa2fbf3 of _0x58d847)if(_0xa2fbf3['chunk']){const _0xf3f2d0=_0x41d109['decode'](_0xa2fbf3['chunk']['bytes']),_0x522c12=JSON['parse'](_0xf3f2d0);_0x348456+=this['_getGeneratedText'](_0x522c12,_0x4cae31),_0x26ddaf(_0x348456);}return Promise['resolve']();}async['_readStreamableResponse'](_0x359d2e,_0x52cca9,_0x28a43f){const _0x45c36d=_0x359d2e['body'],_0x5a2330=new TextDecoder('utf-8'),_0x2c58ce=_0x45c36d['getReader']();let _0x3bed02='',_0x5e29ff='',_0x5f5df9=!0x1;for(;!_0x5f5df9;){const {done:_0x545bf3,value:_0x3dba67}=await _0x2c58ce['read']();if(_0x5f5df9=_0x545bf3,_0x5f5df9)break;const _0x4cee01=(_0x3bed02+_0x5a2330['decode'](_0x3dba67))['split']('\x0a')['map'](_0x3689c5=>{try{return _0x3bed02='',JSON['parse'](_0x3689c5);}catch{return _0x3bed02=_0x3689c5,null;}})['filter'](_0x3d87c4=>null!==_0x3d87c4);_0x4cee01['length']&&(_0x5e29ff+=_0x4cee01['map'](_0x19587c=>this['_getGeneratedText'](_0x19587c,_0x52cca9))['join'](''),_0x28a43f(_0x5e29ff));}return Promise['resolve']();}async['_readStaticResponse'](_0x387b44,_0x115738,_0x4236a8){let _0x192b8c;return _0x192b8c=_0x387b44 instanceof Response?await _0x387b44['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x387b44['body'])),(_0x4236a8(this['_getGeneratedText'](_0x192b8c,_0x115738)),Promise['resolve']());}['_getGeneratedText'](_0x5e160c,_0x497976){switch(this['getModelFamily'](_0x497976)){case'anthropic.claude':return _0x5e160c['completion'];case'ai21.j2':return _0x5e160c['completions'][0x0]['data']['text'];case'cohere.command':return _0x5e160c['generations'][0x0]['text'];case'meta.llama':return _0x5e160c['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ai",
3
- "version": "46.0.1-alpha.12",
3
+ "version": "46.0.1-alpha.13",
4
4
  "description": "AI Assistant feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -29,14 +29,14 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@aws-sdk/client-bedrock-runtime": "3.823.0",
32
- "@ckeditor/ckeditor5-clipboard": "46.0.1-alpha.12",
33
- "@ckeditor/ckeditor5-core": "46.0.1-alpha.12",
34
- "@ckeditor/ckeditor5-engine": "46.0.1-alpha.12",
35
- "@ckeditor/ckeditor5-icons": "46.0.1-alpha.12",
36
- "@ckeditor/ckeditor5-table": "46.0.1-alpha.12",
37
- "@ckeditor/ckeditor5-ui": "46.0.1-alpha.12",
38
- "@ckeditor/ckeditor5-utils": "46.0.1-alpha.12",
39
- "ckeditor5": "46.0.1-alpha.12",
32
+ "@ckeditor/ckeditor5-clipboard": "46.0.1-alpha.13",
33
+ "@ckeditor/ckeditor5-core": "46.0.1-alpha.13",
34
+ "@ckeditor/ckeditor5-engine": "46.0.1-alpha.13",
35
+ "@ckeditor/ckeditor5-icons": "46.0.1-alpha.13",
36
+ "@ckeditor/ckeditor5-table": "46.0.1-alpha.13",
37
+ "@ckeditor/ckeditor5-ui": "46.0.1-alpha.13",
38
+ "@ckeditor/ckeditor5-utils": "46.0.1-alpha.13",
39
+ "ckeditor5": "46.0.1-alpha.13",
40
40
  "es-toolkit": "1.39.5"
41
41
  },
42
42
  "type": "module",